feat(react)!: remove babel#1123
feat(react)!: remove babel#1123sapphi-red wants to merge 5 commits intorefactor/react-drop-vite7-and-below-supportfrom
Conversation
7a9ebf1 to
a20730e
Compare
a20730e to
557b801
Compare
There was a problem hiding this comment.
Looks cool, thanks for the cleanup, I'm happy I will be able stop downloading babel!
We need to updates the docs (both Readmes in the repo and vite.dev)
I think we should also add a section on how to add babel to a Vite 8 project, promoting this new plugin and all the possibilities for filtering.
| export default defineConfig({ | ||
| plugins: [ | ||
| react({ | ||
| exclude: [/\/node_modules\/(?!(\.pnpm\/)?test-package)/], |
There was a problem hiding this comment.
I don't think this is need given the current test.
We are now testing the capability of @rolldown/plugin-babel to include node_modules.
Maybe the package could contain JSX to show that we can force OXC to run on node_modules files?
| function viteReactForCjs(this: unknown, options: Options): Plugin[] { | ||
| return viteReact.call(this, options) | ||
| } | ||
| Object.assign(viteReactForCjs, { |
There was a problem hiding this comment.
If this needed when supporting only Vite 8+ which means require(esm) IIRM?
| }, | ||
| "devDependencies": { | ||
| "@babel/core": "^7.29.0", | ||
| "@babel/plugin-transform-react-jsx-development": "^7.27.1", |
There was a problem hiding this comment.
Is this plugin needed? It's not here in multiple playground
Is it injected by @rolldown/plugin-babel ?
Description
Built on top of #1124
In Vite 8 (currently beta), react refresh transform can be handled by Oxc. This means there's no transform that uses babel by default.
To reduce the install size, I think we should remove babel from the dependency of
@vitejs/plugin-react.The
@rolldown/plugin-babelpackage lives at https://github.com/rolldown/plugins.context: #1114