docs: document Oxc React Compiler and Babel migration - #14522
Conversation
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
|
Hello! Thank you for opening your first PR to Astro’s Docs! 🎉 Here’s what will happen next:
|
| }); | ||
| ``` | ||
|
|
||
| This also works with `react({ compiler: true })`. Babel runs before Oxc transforms TypeScript and JSX. The Babel plugin automatically enables parsing for `.jsx`, `.ts`, and `.tsx` files. It does not load `babel.config.js` or `.babelrc` files; pass the options directly to `babel()`. The old `babel` callback is not supported; use the plugin's [`overrides` and preset hooks](https://github.com/rolldown/plugins/tree/main/packages/babel#options) for conditional transforms. |
There was a problem hiding this comment.
I don't think we have to over-explain how the babel plugin works, people can refer to its docs about that.
Description (required)
Documents the React integration's major migration to
@vitejs/plugin-reactv6 and Oxc. Thebabelintegration option is removed; users with custom Babel transforms must install@rolldown/plugin-babeland@babel/coreand configure them undervite.plugins.Adds before-and-after configuration examples, package-manager installation tabs, and guidance for passing Babel options directly and handling conditional transforms. Explains that this setup runs Babel before Oxc transforms TypeScript and JSX, including when
compiler: trueis enabled.The compiler section covers installation, opt-in setup, React 17/18 runtime dependencies, compiler options, and exclusions. Links to the Babel migration section and removes the claim that existing Babel configuration remains compatible.
The release version marker can be added once the implementation release version is assigned.
Validation: Prettier and
git diff --checkpassed;pnpm checkreported 0 errors, 0 warnings, and one existing hint. Verified the migration section and configuration examples render locally. The implementation PR includes a TSX regression proving custom Babel transforms run before type stripping in development and production, with the compiler enabled and disabled.References