From c9868d98fe2e0a6bbca80e22eea44350e773650a Mon Sep 17 00:00:00 2001 From: riteshshukla04 Date: Tue, 9 Dec 2025 20:52:50 +0530 Subject: [PATCH] feat:react-compiler --- packages/rn-tester/.babelrc | 1 + packages/rn-tester/package.json | 1 + private/helloworld/babel.config.js | 1 + private/helloworld/package.json | 1 + yarn.lock | 35 +++++++++++++++++++++++++++++- 5 files changed, 38 insertions(+), 1 deletion(-) diff --git a/packages/rn-tester/.babelrc b/packages/rn-tester/.babelrc index b44cdf957608e5..07e7f4bc4be882 100644 --- a/packages/rn-tester/.babelrc +++ b/packages/rn-tester/.babelrc @@ -5,6 +5,7 @@ }] ], "plugins": [ + "babel-plugin-react-compiler", "babel-plugin-transform-flow-enums" ] } diff --git a/packages/rn-tester/package.json b/packages/rn-tester/package.json index e9b4da816004f7..d30c612747b4a6 100644 --- a/packages/rn-tester/package.json +++ b/packages/rn-tester/package.json @@ -28,6 +28,7 @@ "@react-native/new-app-screen": "0.84.0-main", "@react-native/popup-menu-android": "0.84.0-main", "flow-enums-runtime": "^0.0.6", + "babel-plugin-react-compiler": "^1.0.0", "invariant": "^2.2.4", "nullthrows": "^1.1.1" }, diff --git a/private/helloworld/babel.config.js b/private/helloworld/babel.config.js index e8f8d6934d2d9f..40843e518cbdd9 100644 --- a/private/helloworld/babel.config.js +++ b/private/helloworld/babel.config.js @@ -10,4 +10,5 @@ module.exports = { presets: ['module:@react-native/babel-preset'], + plugins: ['babel-plugin-react-compiler'], }; diff --git a/private/helloworld/package.json b/private/helloworld/package.json index c252c8ebc79594..248a8840656a33 100644 --- a/private/helloworld/package.json +++ b/private/helloworld/package.json @@ -24,6 +24,7 @@ "@react-native/eslint-config": "0.84.0-main", "@react-native/metro-config": "0.84.0-main", "@react-native/typescript-config": "0.84.0-main", + "babel-plugin-react-compiler": "^1.0.0", "@types/jest": "^29.5.14", "commander": "^12.0.0", "eslint": "^8.19.0", diff --git a/yarn.lock b/yarn.lock index 953e854f2c0398..45b7c57a7e97d3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -205,6 +205,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz#a7054dcc145a967dd4dc8fee845a57c1316c9df8" integrity sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow== +"@babel/helper-validator-identifier@^7.28.5": + version "7.28.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz#010b6938fab7cb7df74aa2bbc06aa503b8fe5fb4" + integrity sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q== + "@babel/helper-validator-option@^7.25.9", "@babel/helper-validator-option@^7.27.1": version "7.27.1" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz#fa52f5b1e7db1ab049445b421c4471303897702f" @@ -1043,7 +1048,20 @@ "@babel/parser" "^7.27.2" "@babel/types" "^7.27.1" -"@babel/traverse--for-generate-function-map@npm:@babel/traverse@^7.25.3", "@babel/traverse@^7.25.3", "@babel/traverse@^7.25.9", "@babel/traverse@^7.26.8": +"@babel/traverse--for-generate-function-map@npm:@babel/traverse@^7.25.3": + version "7.26.9" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.26.9.tgz#4398f2394ba66d05d988b2ad13c219a2c857461a" + integrity sha512-ZYW7L+pL8ahU5fXmNbPF+iZFHCv5scFak7MZ9bwaRPLUhHh7QQEMjZUg0HevihoqCM5iSYHN61EyCoZvqC+bxg== + dependencies: + "@babel/code-frame" "^7.26.2" + "@babel/generator" "^7.26.9" + "@babel/parser" "^7.26.9" + "@babel/template" "^7.26.9" + "@babel/types" "^7.26.9" + debug "^4.3.1" + globals "^11.1.0" + +"@babel/traverse@^7.25.3", "@babel/traverse@^7.25.9", "@babel/traverse@^7.26.8": version "7.26.9" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.26.9.tgz#4398f2394ba66d05d988b2ad13c219a2c857461a" integrity sha512-ZYW7L+pL8ahU5fXmNbPF+iZFHCv5scFak7MZ9bwaRPLUhHh7QQEMjZUg0HevihoqCM5iSYHN61EyCoZvqC+bxg== @@ -1077,6 +1095,14 @@ "@babel/helper-string-parser" "^7.27.1" "@babel/helper-validator-identifier" "^7.27.1" +"@babel/types@^7.26.0": + version "7.28.5" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.28.5.tgz#10fc405f60897c35f07e85493c932c7b5ca0592b" + integrity sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA== + dependencies: + "@babel/helper-string-parser" "^7.27.1" + "@babel/helper-validator-identifier" "^7.28.5" + "@babel/types@^7.26.9", "@babel/types@^7.28.2": version "7.28.2" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.28.2.tgz#da9db0856a9a88e0a13b019881d7513588cf712b" @@ -3101,6 +3127,13 @@ babel-plugin-polyfill-regenerator@^0.6.1: dependencies: "@babel/helper-define-polyfill-provider" "^0.6.2" +babel-plugin-react-compiler@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/babel-plugin-react-compiler/-/babel-plugin-react-compiler-1.0.0.tgz#bdf7360a23a4d5ebfca090255da3893efd07425f" + integrity sha512-Ixm8tFfoKKIPYdCCKYTsqv+Fd4IJ0DQqMyEimo+pxUOMUR9cVPlwTrFt9Avu+3cb6Zp3mAzl+t1MrG2fxxKsxw== + dependencies: + "@babel/types" "^7.26.0" + babel-plugin-replace-ts-export-assignment@^0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/babel-plugin-replace-ts-export-assignment/-/babel-plugin-replace-ts-export-assignment-0.0.2.tgz#927a30ba303fcf271108980a8d4f80a693e1d53f"