Skip to content

React Compiler with plugin-swc #428

Closed

Description

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

Activity

  1. ArnaudBarre commented on May 16, 2024

    @ArnaudBarre
    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!

  2. eeuneeun commented on May 27, 2024

    @eeuneeun

    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

  3. alireza-akbarzadeh commented on May 29, 2024

    @alireza-akbarzadeh

    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]],
          },
        }),
      ],
    });
  4. matej-kaska commented on Oct 31, 2024

    @matej-kaska

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

  5. ArnaudBarre commented on Nov 1, 2024

    @ArnaudBarre
    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

  6. AaronDewes commented on Jan 28, 2025

    @AaronDewes

    The Rust port has been removed: react/react#32219

    For React Compiler though, we plan to continue using JavaScript and explore lightweight native wrappers for things like OXC and SWC plugins.

  7. ArnaudBarre commented on Jan 31, 2025

    @ArnaudBarre
    Member

    Yeah, they still plan to have some integrations, but it will probably take times too

  8. rakleed commented on May 23, 2025

    @rakleed
  9. changed the title [-]React Compiler[/-] [+]React Compiler with plugin-swc[/+] on Jul 28, 2025
  10. Hanaffi commented on Nov 24, 2025

    @Hanaffi

    Any update on this please?

  11. added a commit that references this issue on Dec 9, 2025
  12. added a commit that references this issue on Dec 14, 2025
  13. added a commit that references this issue on Feb 2, 2026
  14. HM-Suiji commented on Feb 5, 2026

    @HM-Suiji

    快一些,我很需要这个功能

  15. Arelav commented on Feb 9, 2026

    @Arelav

    快一些,我很需要这个功能

    它是开源的,如果紧急的话可以自己实现。
    And we communicate her in English if you didn't notice

  16. HM-Suiji commented on Feb 12, 2026

    @HM-Suiji

    快一些,我很需要这个功能

    它是开源的,如果紧急的话可以自己实现。 And we communicate her in English if you didn't notice

    I am so sorry. I will try it.

  17. ianujvarshney commented on Jun 1, 2026

    @ianujvarshney

    I was also using @vitejs/plugin-react-swc and wanted React Compiler support.

    After the Vite maintainer's clarification:

    • No official way to use React Compiler without Babel yet
    • oxc-plugin-react-compiler is unofficial (AI-generated, one-person project)
    • Official approach: use @vitejs/plugin-react with Babel

    I've migrated to @vitejs/plugin-react and accepted the Babel trade-off for now. Hoping the official Rust port from PR #36173 lands soon.

    Has anyone tested the performance difference between SWC and the new OXC-based plugin-react with React Compiler enabled?

  18. pippinmole commented on Jun 10, 2026

    @pippinmole

    The React Compiler port to Rust has been merged into React - when can we see this in the official Vite react plugin, if at all?

  19. ArnaudBarre commented on Jun 11, 2026

    @ArnaudBarre
    Member

    Yeah I will see how we can integrate it in the Vite plugin soon!

  20. pippinmole commented on Jun 29, 2026

    @pippinmole

    Yeah I will see how we can integrate it in the Vite plugin soon!

    do you have an ETA? :)

  21. SimenB commented on Jul 6, 2026

    @SimenB

    we have

      react({
        useAtYourOwnRisk_mutateSwcOptions(options) {
          options.jsc ??= {};
          options.jsc.transform ??= {};
          options.jsc.transform.reactCompiler = true;
        },
      }),

    which works fine

  22. AndreFavotto commented on Jul 6, 2026

    @AndreFavotto

    +1 for this!

  23. kevinwt95 commented on Aug 10, 2026

    @kevinwt95

    Any updates here?
    Is options.jsc.transform.reactCompiler = true a valid option? I can't find any documentation for it.

  24. orta commented on Aug 24, 2026

    @orta

    v6.1.0 of this project now includes experimental React Compiler support.

  25. AndreFavotto commented on Aug 24, 2026

    @AndreFavotto

    @orta The release mentions @vitejs/plugin-react only, not react-swc, unfortunately :/
    Regardless, it is a good update. Considering switching to babel in the meantime.

  26. locked and limited conversation to collaborators on Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions