Skip to content

Conversation

poteto
Copy link
Contributor

@poteto poteto commented Aug 29, 2025

This PR adds examples for Vite + React Compiler (JS & TS). These example repos will be used as templates for a new variant I'm proposing to add to create-vite, that allows new Vite apps to be initialized with the compiler ready to go.

poteto added a commit to poteto/vite that referenced this pull request Aug 29, 2025
This PR builds upon vitejs/vite-plugin-react#799
and adds 2 new variants to create-vite: compiler, and compiler-ts.

This allows new Vite apps to start with React Compiler out of the box.
@poteto poteto force-pushed the vite-react-compiler branch 2 times, most recently from d8b7c9e to cb6288b Compare August 29, 2025 17:51
poteto added a commit to poteto/vite that referenced this pull request Aug 29, 2025
This PR builds upon vitejs/vite-plugin-react#799
and adds 2 new variants to create-vite: compiler, and compiler-ts.

This allows new Vite apps to start with React Compiler out of the box.
@poteto poteto changed the title feat(react-compiler): Add React Compiler examples feat(reactcompiler): Add React Compiler examples Aug 29, 2025
This PR adds examples for Vite + React Compiler (JS & TS). These example
repos will be used as templates for a new variant I'm proposing to add
to create-vite, that allows new Vite apps to be initialized with the
compiler ready to go.
poteto added a commit to poteto/vite that referenced this pull request Aug 29, 2025
This PR builds upon vitejs/vite-plugin-react#799
and adds 2 new variants to create-vite: compiler, and compiler-ts.

This allows new Vite apps to start with React Compiler out of the box.
@poteto poteto force-pushed the vite-react-compiler branch from cb6288b to 2fb1e81 Compare August 29, 2025 17:56
@poteto poteto changed the title feat(reactcompiler): Add React Compiler examples feat(react-compiler): add React Compiler examples Aug 29, 2025
@yyx990803
Copy link
Member

yyx990803 commented Sep 1, 2025

Since we don't really include full examples for the React plugin, I don't think we should add so much code here. It adds the burden of having to sync it with create-vite templates in the future.

I think a better addition to this repo specifically is to add documentation on how to use the compiler when you already have @vitejs/plugin-react installed.

An additional note here is that in the near future, as rolldown-powered Vite becomes the default version, @vitejs/plugin-react will no longer have a Babel dependency. When that happens, usage of React Compiler will likely have to either go through a separate Babel plugin, or there should be a standalone React Compiler plugin that includes Babel as a dependency.

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

Successfully merging this pull request may close these issues.

2 participants