Skip to content

Fast refresh without babel #278

@Artur-

Description

@Artur-

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 plugin react-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 have useDefineForClassFields: true and that writing custom plugins in Rust cumbersome to many compared to a few lines of JS

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions