Skip to content
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

React Compiler #205

Open
samesfahani-tuplehealth opened this issue May 16, 2024 · 5 comments
Open

React Compiler #205

samesfahani-tuplehealth opened this issue May 16, 2024 · 5 comments

Comments

@samesfahani-tuplehealth

Will there be instructions on how to use the new React Compiler given that it's babel based?

@ArnaudBarre
Copy link
Member

For now the simplest way is to switch back to the Babel plugin. They working a Rust port, I hope this can be builtin in SWC in the future!

@eeuneeun
Copy link

how can I New React Compiler setting Vite project, now?
I try to rewrite "vite.config.ts" file (plus plugins section) .....
but the "babel" letter makes errors

@alireza-akbarzadeh
Copy link

alireza-akbarzadeh commented May 29, 2024

You should use vite-plugin-react

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";

const ReactCompilerConfig = {};

export default defineConfig({
  plugins: [
    react({
      babel: {
        plugins: [["babel-plugin-react-compiler", ReactCompilerConfig]],
      },
    }),
  ],
});

@matej-kaska
Copy link

matej-kaska commented Oct 31, 2024

Will be there an option to use react compiler with SWC in the future?

@ArnaudBarre
Copy link
Member

If the React team lands the Rust port of the compiler, I think SWC will try to integrate it directly. But the rust part didn't get updated since annouced: https://github.com/facebook/react/commits/main/compiler/crates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants