-
-
Notifications
You must be signed in to change notification settings - Fork 759
docs: introduce @swc/react-compiler to make react-compiler fast #10823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for rspack ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
website/docs/en/guide/tech/react.mdx
Outdated
{ | ||
// Must be run before 'builtin:swc-loader' to ensure that the file is processed by the React Compiler | ||
// So we add it to the beginning of the rule | ||
test: (resouce) => /\.jsx$/.test(resouce) && isReactCompilerRequiredSync(fs.readFileSync(resouce)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious about the performance impact of readFileSync , can we do a performance comparison test to verify the performance difference between @swc/react-compiler
and the previous babel-loader?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, i will check it later
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Just out of curiosity, are we already use @swc/react-compiler to use the react-compiler compling on jsx files? or only use the I was looking for use react-compiler with swc, but the links leads me here. 😀 |
Currently @swc/react-compiler only provides the Unfortunately, in our early tests, |
Summary
We are introducing a recommendation to use
@swc/react-compiler
for pre-compilation to reduce the number of files processed bybabel-loader
, which is known to add significant compilation time.Related links
Checklist