Skip to content

feat(react): add native React Compiler support - #1419

Merged
sapphi-red merged 12 commits into
vitejs:mainfrom
Boshen:agent/react-compiler
Aug 19, 2026
Merged

feat(react): add native React Compiler support#1419
sapphi-red merged 12 commits into
vitejs:mainfrom
Boshen:agent/react-compiler

Conversation

@Boshen

@Boshen Boshen commented Aug 9, 2026

Copy link
Copy Markdown
Member

Add a compiler option backed by the optional oxc-transform-react package.

When enabled, oxc-transform-react owns the React Compiler, TypeScript/JSX, and Fast Refresh transforms in one pass, while Rolldown React transforms are disabled. React Compiler and Fast Refresh remain client-only; server environments use the same package for TypeScript/JSX.

Keeping React Compiler in a separate package avoids adding framework-specific compiler size and complexity to Rolldown.

@Boshen Boshen changed the title feat(react): add built-in React Compiler support feat(react): add native React Compiler support Aug 10, 2026
@Boshen
Boshen force-pushed the agent/react-compiler branch from 0aaf260 to 89c2017 Compare August 10, 2026 01:57
Comment thread packages/plugin-react/src/index.ts Outdated
Comment thread packages/plugin-react/src/index.ts Outdated
@Boshen
Boshen marked this pull request as ready for review August 10, 2026 08:56

@ArnaudBarre ArnaudBarre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if we would not have better stability by always using oxc-transform-react. You could then remove react refresh from the builtin oxc-transform, making it a lot more vendor neutral.
That's a trade off, because it would be a bit slower for people not using the compiler, but in my experience the overhead is not visible in real Vite application (and in build mode without compiler, the builtin transform could still be used)

Comment thread packages/plugin-react/src/index.ts Outdated
Comment thread packages/plugin-react/package.json Outdated
Comment thread packages/plugin-react/README.md Outdated
@Boshen

Boshen commented Aug 17, 2026

Copy link
Copy Markdown
Member Author

Release plan: merge this integration PR, then after today's Oxc release (v0.145.0), do a bump then a formal release.

@Boshen

Boshen commented Aug 17, 2026

Copy link
Copy Markdown
Member Author

@sapphi-red handing over to you and the team.

Comment thread packages/plugin-react/README.md Outdated
Comment thread packages/plugin-react/src/index.ts Outdated
Co-authored-by: Arnaud Barré <arnaud.barre72@gmail.com>
Comment thread packages/plugin-react/src/index.ts Outdated
Comment thread packages/plugin-react/src/index.ts Outdated
Comment thread packages/plugin-react/src/index.ts
@sapphi-red
sapphi-red merged commit f1340b0 into vitejs:main Aug 19, 2026
27 of 28 checks passed
cursor Bot pushed a commit to sanity-io/pkg-utils that referenced this pull request Aug 19, 2026
…in-react main

vitejs/vite-plugin-react#1419 is merged (f1340b0c); the tarball now
builds from that canonical commit instead of the fork PR head (the only
source change is an @experimental JSDoc tag on the compiler option).
The npm release is queued as @vitejs/plugin-react@6.1.0 in
vitejs/vite-plugin-react#1428 — vendor/README.md tracks the swap plan.

Co-authored-by: Cody Olsen <stipsan@users.noreply.github.com>
renovate Bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Aug 21, 2026
| datasource | package              | from  | to    |
| ---------- | -------------------- | ----- | ----- |
| npm        | @vitejs/plugin-react | 6.0.2 | 6.1.0 |


## [v6.1.0](https://github.com/vitejs/vite-plugin-react/blob/HEAD/packages/plugin-react/CHANGELOG.md#610-2026-08-19)

##### Add experimental native React Compiler support ([#1419](vitejs/vite-plugin-react#1419))

Add experimental native React Compiler support.

You can use it by installing `oxc-transform-react` and enabling it via the `compiler` option:

```sh
npm install -D oxc-transform-react
```

```js
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

export default defineConfig({
  plugins: [
     react({ compiler: true })
  ]
})
```


## [v6.0.5](https://github.com/vitejs/vite-plugin-react/blob/HEAD/packages/plugin-react/CHANGELOG.md#605-2026-07-30)

##### Fixed the react compiler preset filter to be linear ([#1353](vitejs/vite-plugin-react#1353))

The improved filter in v6.0.3 was non-linear and caused a performance regression ([#1349](vitejs/vite-plugin-react#1349)). The filter was changed to be linear to avoid that.


## [v6.0.4](https://github.com/vitejs/vite-plugin-react/blob/HEAD/packages/plugin-react/CHANGELOG.md#604-2026-07-22)

##### Fixed `$RefreshSig$ is not defined` error when running `vite dev` with `NODE_ENV=production`

When running `vite dev` with `NODE_ENV=production`, the app errored with `$RefreshSig$ is not defined`.
This error is now fixed.


## [v6.0.3](https://github.com/vitejs/vite-plugin-react/blob/HEAD/packages/plugin-react/CHANGELOG.md#603-2026-06-23)
renovate Bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Aug 21, 2026
| datasource | package              | from  | to    |
| ---------- | -------------------- | ----- | ----- |
| npm        | @vitejs/plugin-react | 6.0.2 | 6.1.0 |


## [v6.1.0](https://github.com/vitejs/vite-plugin-react/blob/HEAD/packages/plugin-react/CHANGELOG.md#610-2026-08-19)

##### Add experimental native React Compiler support ([#1419](vitejs/vite-plugin-react#1419))

Add experimental native React Compiler support.

You can use it by installing `oxc-transform-react` and enabling it via the `compiler` option:

```sh
npm install -D oxc-transform-react
```

```js
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

export default defineConfig({
  plugins: [
     react({ compiler: true })
  ]
})
```


## [v6.0.5](https://github.com/vitejs/vite-plugin-react/blob/HEAD/packages/plugin-react/CHANGELOG.md#605-2026-07-30)

##### Fixed the react compiler preset filter to be linear ([#1353](vitejs/vite-plugin-react#1353))

The improved filter in v6.0.3 was non-linear and caused a performance regression ([#1349](vitejs/vite-plugin-react#1349)). The filter was changed to be linear to avoid that.


## [v6.0.4](https://github.com/vitejs/vite-plugin-react/blob/HEAD/packages/plugin-react/CHANGELOG.md#604-2026-07-22)

##### Fixed `$RefreshSig$ is not defined` error when running `vite dev` with `NODE_ENV=production`

When running `vite dev` with `NODE_ENV=production`, the app errored with `$RefreshSig$ is not defined`.
This error is now fixed.


## [v6.0.3](https://github.com/vitejs/vite-plugin-react/blob/HEAD/packages/plugin-react/CHANGELOG.md#603-2026-06-23)
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.

4 participants