Releases: vitejs/vite-plugin-react
plugin-rsc@0.4.13
Please refer to CHANGELOG.md for details.
plugin-react@4.7.0
Add HMR support for compound components (#518)
HMR now works for compound components like this:
const Root = () => <div>Accordion Root</div>
const Item = () => <div>Accordion Item</div>
export const Accordion = { Root, Item }
Return Plugin[]
instead of PluginOption[]
(#537)
The return type has changed from react(): PluginOption[]
to more specialized type react(): Plugin[]
. This allows for type-safe manipulation of plugins, for example:
// previously this causes type errors
react({ babel: { plugins: ['babel-plugin-react-compiler'] } })
.map(p => ({ ...p, applyToEnvironment: e => e.name === 'client' }))
plugin-react-swc@3.11.0
Add HMR support for compound components (#518)
HMR now works for compound components like this:
const Root = () => <div>Accordion Root</div>
const Item = () => <div>Accordion Item</div>
export const Accordion = { Root, Item }
Return Plugin[]
instead of PluginOption[]
(#537)
The return type has changed from react(): PluginOption[]
to more specialized type react(): Plugin[]
. This allows for type-safe manipulation of plugins, for example:
// previously this causes type errors
react()
.map(p => ({ ...p, applyToEnvironment: e => e.name === 'client' }))
plugin-react-oxc@0.3.0
Add HMR support for compound components (#518)
HMR now works for compound components like this:
const Root = () => <div>Accordion Root</div>
const Item = () => <div>Accordion Item</div>
export const Accordion = { Root, Item }
Return Plugin[]
instead of PluginOption[]
(#537)
The return type has changed from react(): PluginOption[]
to more specialized type react(): Plugin[]
. This allows for type-safe manipulation of plugins, for example:
// previously this causes type errors
react()
.map(p => ({ ...p, applyToEnvironment: e => e.name === 'client' }))
plugin-rsc@0.4.12
Please refer to CHANGELOG.md for details.
plugin-react@4.6.0
Add raw Rolldown support
This plugin only worked with Vite. But now it can also be used with raw Rolldown. The main purpose for using this plugin with Rolldown is to use react compiler.
plugin-react-oxc@0.2.3
Disable refresh transform when server.hmr: false
is set #502
This fixes "$RefreshReg$
is not defined" error when running Vitest with the plugin.
plugin-react@4.5.2
Suggest @vitejs/plugin-react-oxc
if rolldown-vite is detected #491
Emit a log which recommends @vitejs/plugin-react-oxc
when rolldown-vite
is detected to improve performance and use Oxc under the hood. The warning can be disabled by setting disableOxcRecommendation: false
in the plugin options.
Use optimizeDeps.rollupOptions
instead of optimizeDeps.esbuildOptions
for rolldown-vite #489
This suppresses the warning about optimizeDeps.esbuildOptions
being deprecated in rolldown-vite.
Add Vite 7-beta to peerDependencies range #497
React plugins are compatible with Vite 7, this removes the warning when testing the beta.
plugin-react-swc@3.10.2
Suggest @vitejs/plugin-react-oxc
if rolldown-vite is detected #491
Emit a log which recommends @vitejs/plugin-react-oxc
when rolldown-vite
is detected to improve performance and use Oxc under the hood. The warning can be disabled by setting disableOxcRecommendation: false
in the plugin options.
Use optimizeDeps.rollupOptions
instead of optimizeDeps.esbuildOptions
for rolldown-vite #489
This suppresses the warning about optimizeDeps.esbuildOptions
being deprecated in rolldown-vite.
Add Vite 7-beta to peerDependencies range #497
React plugins are compatible with Vite 7, this removes the warning when testing the beta.
plugin-react-oxc@0.2.2
Add Vite 7-beta to peerDependencies range #497
React plugins are compatible with Vite 7, this removes the warning when testing the beta.