Skip to content

Commit 9ecc5f9

Browse files
authored
docs(rolldown): update plugin-react-oxc mention (vitejs#20498)
1 parent 48139b4 commit 9ecc5f9

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

docs/guide/rolldown.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,17 @@ Thanks to Rolldown and Oxc, various internal Vite plugins, such as the alias or
145145

146146
To test them, you can set the `experimental.enableNativePlugin` option to `true` in your Vite config.
147147

148-
### `@vitejs/plugin-react-oxc`
148+
### Utilizing Oxc's React refresh transform
149149

150-
When using `@vitejs/plugin-react` or `@vitejs/plugin-react-swc`, you can switch to the `@vitejs/plugin-react-oxc` plugin, which uses Oxc for React's fast-refresh instead of Babel or SWC. It is designed to be a drop-in replacement, providing better build performance and aligning with the underlying architecture of `rolldown-vite`.
150+
`@vitejs/plugin-react` v5.0.0+ uses Oxc's React refresh transform. If you are not using any Babel plugins (including the React compiler), the full transform would now be done by Oxc and will improve the build performance without any changes other than updating `@vitejs/plugin-react`.
151151

152-
Be aware that you can only switch to `@vitejs/plugin-react-oxc` if you are not using any Babel or SWC plugins (including the React compiler), or mutate the SWC options.
152+
If you are using `@vitejs/plugin-react-swc` without SWC plugins and custom SWC options, you can switch to the `@vitejs/plugin-react` plugin to utilize Oxc.
153+
154+
::: details `@vitejs/plugin-react-oxc` plugin is deprecated
155+
156+
Previously, we recommended using `@vitejs/plugin-react-oxc` to utilize Oxc's React refresh transform. However, we have merged the implementation into `@vitejs/plugin-react` so that it is easier to switch to `rolldown-vite`. `@vitejs/plugin-react-oxc` is now deprecated and will no longer be updated.
157+
158+
:::
153159

154160
### `withFilter` Wrapper
155161

0 commit comments

Comments
 (0)