-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
Fast refresh without babel #278
Comments
or is fast refresh actually implemented in swc core? |
The philosophy of the projects:
|
Thanks for the info! In our case we are trying to create a sensible configuration for our framework users which makes this a bit more tricky, as they might have a mix of old and new projects. What we really are trying to implement is a way for old projects to work and allow people to gradually migrate to (newer) standards. The linked esbuild PR seems like exactly what we would be hoping for, let's see if that progresses. |
Description
For performance reasons, I would like to not use Babel at all but let
esbuild
handle everything while still having support for fast refresh. By looking at the code it seems like fast refresh is the only reason that babel is invoked by default.As a side effect, this would avoid problems like the one mentioned in #266
Suggested solution
If I understand correctly,
vite-plugin-react-swc
has a pure JS implementation of react refresh. By integrating that into this repository, the babel pluginreact-refresh/babel
becomes unnecessary and babel can be skipped by default. Maybe there is a reason this cannot be done though?Alternative
Using
plugin-react-swc
would be an alternative but has other drawbacks for existing (aka old aka legacy) projects, such as the requirement to haveuseDefineForClassFields: true
and that writing custom plugins in Rust cumbersome to many compared to a few lines of JSAdditional context
No response
Validations
The text was updated successfully, but these errors were encountered: