Repository navigation
refactor(rspack): switch React Compiler examples to builtin:swc-loader - #2
Merged
Merged
Conversation
Use Rspack's Rust React Compiler via jsc.transform.reactCompiler instead of babel-loader. Consolidate JS/TS/JSX/TSX into a single rule with detectSyntax: 'auto', remove Babel config/deps, and rename examples to react-compiler and react-compiler-ts. Addresses review feedback on rstackjs#517. Co-authored-by: Ari <mail@heyq02.cn>
Resolve leftover rebase conflict markers in react-compiler-ts and refresh pnpm-lock.yaml after renaming the React Compiler examples. Co-authored-by: Ari <mail@heyq02.cn>
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
⛔ Files ignored due to path filters (3)
📒 Files selected for processing (21)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
heyq02
marked this pull request as ready for review
October 13, 2026 04:43
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.
Summary
Addresses review feedback on #517 by migrating the React Compiler examples from Babel to Rspack's Rust React Compiler.
jsc.transform.reactCompiler: trueon a singlebuiltin:swc-loaderrule withdetectSyntax: 'auto'andreact.runtime: 'automatic'babel.config.jsand Babel dependencies (babel-loader,babel-plugin-react-compiler,@babel/plugin-syntax-*)rspack/react-compiler-babel→rspack/react-compilerandrspack/react-compiler-babel-ts→rspack/react-compiler-tsuseCounter.tsso the TypeScript example still shows hooks in.tsfiles being optimizedFollow-up (separate PR): update React Compiler example links in the Rspack docs (
react-compiler-babel→react-compiler, etc.).Test plan
pnpm --filter "@rspack-example/react-compiler" buildpnpm --filter "@rspack-example/react-compiler-ts" buildreact/compiler-runtimememo cache forAppanduseCounter.tsdev— counter button increments 0 → 3Counter at 0
Counter at 3
react-compiler-ts-counter-smoke-2.mp4
To show artifacts inline, enable in settings.