-
-
Notifications
You must be signed in to change notification settings - Fork 7.2k
feat(create-vite): support React Compiler #20704
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
oh this is better, thank you! |
const asObject = JSON.parse(content) | ||
const devDepsEntries = Object.entries(asObject.devDependencies) | ||
devDepsEntries.push([ | ||
'babel-plugin-react-compiler', |
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.
one thing that's missing is also using [email protected]. Version 6 will include compiler diagnostics as part of the plugin by default.
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.
That's quite a bump in dependencies. plugin-proposal-private-methods is deprecated, and I'm surprise of the need for zod in a linter plugin.
Is the hermes parser necessary given that the build will use the babel parser?
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.
Not as much an issue, but are you open to switching to ESM for the next major? ESLint v9 is now quite the norm and fully support ESM. I can make a PR to either reduce the dependency or switch to ESM if you think there is a chance it lands
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.
@ArnaudBarre yes, the eslint plugin now bundles the compiler as well since it can be used standalone. That means a few extra dependencies are needed. Is that blocking anything?
As for ESM I think that will require a larger discussion with the rest of the React team.
I think there're two other ways:
Do you have any thoughts about the other ways? |
The compiler by default would mean we don't run OXC by default. Which can impact the boot time of the starter (I didn't yet benchmark it). This would also mean keeping Babel by default. But given what is the next version of eslint-plugin-react-hooks, we woud need to revisit eslint by default if our goal is to have a light template I think the benefit of having a template with already the compiler setup is to make it easy to quickly try a pattern on a empty app. That said, the way the template is setup forbid the usage via stackblitz which is the easiest way to create repro... |
Alternative to #20702 and vitejs/vite-plugin-react#799 from @poteto which make it easier to keep the template in sync