Skip to content

Commit aebbe0e

Browse files
committed
[compiler] Switch to esbuild (facebook#31963)
This migrates the compiler's bundler to esbuild instead of rollup. Unlike React, our bundling use cases are far simpler since the majority of our packages are meant to be run on node. Rollup was adding considerable build time overhead whereas esbuild remains fast and has all the functionality we need out of the box. ### Before ``` time yarn workspaces run build yarn workspaces v1.22.22 > babel-plugin-react-compiler yarn run v1.22.22 $ rimraf dist && rollup --config --bundleConfigAsCjs src/index.ts → dist/index.js... (!) Circular dependencies # ... created dist/index.js in 15.5s ✨ Done in 16.45s. > eslint-plugin-react-compiler yarn run v1.22.22 $ rimraf dist && rollup --config --bundleConfigAsCjs src/index.ts → dist/index.js... (!) Circular dependencies # ... created dist/index.js in 9.1s ✨ Done in 10.11s. > make-read-only-util yarn run v1.22.22 warning package.json: No license field $ tsc ✨ Done in 1.81s. > react-compiler-healthcheck yarn run v1.22.22 $ rimraf dist && rollup --config --bundleConfigAsCjs src/index.ts → dist/index.js... (!) Circular dependencies # ... created dist/index.js in 8.7s ✨ Done in 10.43s. > react-compiler-runtime yarn run v1.22.22 $ rimraf dist && rollup --config --bundleConfigAsCjs src/index.ts → dist/index.js... (!) src/index.ts (1:0): Module level directives cause errors when bundled, "use no memo" in "src/index.ts" was ignored. # ... created dist/index.js in 1.1s ✨ Done in 1.82s. > snap yarn run v1.22.22 $ rimraf dist && concurrently -n snap,runtime "tsc --build" "yarn --silent workspace react-compiler-runtime build --silent" $ rimraf dist && rollup --config --bundleConfigAsCjs --silent [runtime] yarn --silent workspace react-compiler-runtime build --silent exited with code 0 [snap] tsc --build exited with code 0 ✨ Done in 5.73s. ✨ Done in 47.30s. yarn workspaces run build 75.92s user 5.48s system 170% cpu 47.821 total ``` ### After ``` time yarn workspaces run build yarn workspaces v1.22.22 > babel-plugin-react-compiler yarn run v1.22.22 $ rimraf dist && scripts/build.js ✨ Done in 1.02s. > eslint-plugin-react-compiler yarn run v1.22.22 $ rimraf dist && scripts/build.js ✨ Done in 0.93s. > make-read-only-util yarn run v1.22.22 warning package.json: No license field $ rimraf dist && scripts/build.js ✨ Done in 0.89s. > react-compiler-healthcheck yarn run v1.22.22 $ rimraf dist && scripts/build.js ✨ Done in 0.58s. > react-compiler-runtime yarn run v1.22.22 $ rimraf dist && scripts/build.js ✨ Done in 0.48s. > snap yarn run v1.22.22 $ rimraf dist && concurrently -n snap,runtime "tsc --build" "yarn --silent workspace react-compiler-runtime build" $ rimraf dist && scripts/build.js [runtime] yarn --silent workspace react-compiler-runtime build exited with code 0 [snap] tsc --build exited with code 0 ✨ Done in 4.69s. ✨ Done in 9.46s. yarn workspaces run build 9.70s user 0.99s system 103% cpu 10.329 total ``` --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/31963). * facebook#31964 * __->__ facebook#31963 * facebook#31962 DiffTrain build for [220dece](facebook@220dece)
1 parent 51f690d commit aebbe0e

35 files changed

+5825
-5575
lines changed

Diff for: compiled/facebook-www/REVISION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0de1233fd180969f7ffdfc98151922f2466ceb1f
1+
220dece92b9ab5f8867a589f8104b15717d68d2f

Diff for: compiled/facebook-www/REVISION_TRANSFORMS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0de1233fd180969f7ffdfc98151922f2466ceb1f
1+
220dece92b9ab5f8867a589f8104b15717d68d2f

Diff for: compiled/facebook-www/React-dev.classic.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1942,7 +1942,7 @@ __DEV__ &&
19421942
exports.useTransition = function () {
19431943
return resolveDispatcher().useTransition();
19441944
};
1945-
exports.version = "19.1.0-www-classic-0de1233f-20250102";
1945+
exports.version = "19.1.0-www-classic-220dece9-20250102";
19461946
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
19471947
"function" ===
19481948
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

Diff for: compiled/facebook-www/React-dev.modern.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1942,7 +1942,7 @@ __DEV__ &&
19421942
exports.useTransition = function () {
19431943
return resolveDispatcher().useTransition();
19441944
};
1945-
exports.version = "19.1.0-www-modern-0de1233f-20250102";
1945+
exports.version = "19.1.0-www-modern-220dece9-20250102";
19461946
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
19471947
"function" ===
19481948
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

Diff for: compiled/facebook-www/React-prod.classic.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -630,4 +630,4 @@ exports.useSyncExternalStore = function (
630630
exports.useTransition = function () {
631631
return ReactSharedInternals.H.useTransition();
632632
};
633-
exports.version = "19.1.0-www-classic-0de1233f-20250102";
633+
exports.version = "19.1.0-www-classic-220dece9-20250102";

Diff for: compiled/facebook-www/React-prod.modern.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -630,4 +630,4 @@ exports.useSyncExternalStore = function (
630630
exports.useTransition = function () {
631631
return ReactSharedInternals.H.useTransition();
632632
};
633-
exports.version = "19.1.0-www-modern-0de1233f-20250102";
633+
exports.version = "19.1.0-www-modern-220dece9-20250102";

Diff for: compiled/facebook-www/React-profiling.classic.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ exports.useSyncExternalStore = function (
634634
exports.useTransition = function () {
635635
return ReactSharedInternals.H.useTransition();
636636
};
637-
exports.version = "19.1.0-www-classic-0de1233f-20250102";
637+
exports.version = "19.1.0-www-classic-220dece9-20250102";
638638
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
639639
"function" ===
640640
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

Diff for: compiled/facebook-www/React-profiling.modern.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ exports.useSyncExternalStore = function (
634634
exports.useTransition = function () {
635635
return ReactSharedInternals.H.useTransition();
636636
};
637-
exports.version = "19.1.0-www-modern-0de1233f-20250102";
637+
exports.version = "19.1.0-www-modern-220dece9-20250102";
638638
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
639639
"function" ===
640640
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)