Repository navigation
build(web): run the React Compiler on worker threads - #727
Merged
Merged
Conversation
Babel, running the React Compiler, is most of the web app's build time. @rolldown/plugin-babel 0.3 can run it on worker threads, but only with options it can send to them, and plugin-react's compiler preset holds its Babel half as a function. We call that function once and pass the plain result; the preset's filters and hooks stay in the main process. Measured on this Mac, four workers (the plugin's default cap): - vp build: 21s to 9.5s, with byte-identical output (diff -rq dist) - dev server, first cold page load: 6.4s to 3.5s - web browser suite: 95s to 78s, 927 tests passing The workers add about 350 MB to a running dev server. Hot updates still apply.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Babel, running the React Compiler, is most of the web app's build time. @rolldown/plugin-babel 0.3 can run it on worker threads (
parallel), but only with options it can send to them, and plugin-react'sreactCompilerPreset()holds its Babel half as a function, soparallel: truethrew.reactCompilerWorkerPreset()inapps/web/vite.config.tscalls that function once and passes the plain result; the preset's filters and hooks stay in the main process.parallel: trueuses up to four workers.Measured on a Mac:
vp build(web)diff -rqof bothdistfolders).