|
| 1 | +## 4.0.0-beta.0 (2023-04-05) |
| 2 | + |
| 3 | +This major version include a revamp of options: |
| 4 | + |
| 5 | +- `include`/`exclude` now allow to completely override the files processed by the plugin ([#122](https://github.com/vitejs/vite-plugin-react/pull/122)). This is more in line with other Rollup/Vite plugins and simplify the setup of enabling Fast Refresh for `.mdx` files. This can be done like this: |
| 6 | + |
| 7 | +```js |
| 8 | +export default defineConfig({ |
| 9 | + plugins: [ |
| 10 | + { enforce: 'pre', ...mdx() }, |
| 11 | + react({ include: /\.(mdx|js|jsx|ts|tsx)$/ }), |
| 12 | + ], |
| 13 | +}) |
| 14 | +``` |
| 15 | + |
| 16 | +These changes also allow to apply Babel plugins on files outside Vite root (expect in node_modules), which improve support for monorepo (fix [#16](https://github.com/vitejs/vite-plugin-react/issues/16)). |
| 17 | + |
| 18 | +With these changes, only the file extensions is used for filtering processed files and the query param fallback is removed. |
| 19 | + |
| 20 | +- `fastRefresh` is removed ([#122](https://github.com/vitejs/vite-plugin-react/pull/122)). This should be correctly activated by plugin without configuration. |
| 21 | +- `jsxPure` is removed. This is a niche use case that was just passing down the boolean to esbuild.jsxSideEffects. ([#129](https://github.com/vitejs/vite-plugin-react/pull/129)) |
| 22 | +- `jsxRuntime` is unchanged but deprecated ([#131](https://github.com/vitejs/vite-plugin-react/pull/131)) and will be removed in the next major. |
| 23 | + |
| 24 | +This release goes in hand with the upcoming Vite 4.3 release focusing on performances: |
| 25 | + |
| 26 | +- Cache plugin load ([#141](https://github.com/vitejs/vite-plugin-react/issues/141)) |
| 27 | +- Wrap dynamic import to speedup analysis ([#143](https://github.com/vitejs/vite-plugin-react/issues/143)) |
| 28 | + |
| 29 | +Other notable changes: |
| 30 | + |
| 31 | +- Silence "use client" warning ([#144](https://github.com/vitejs/vite-plugin-react/pull/144), fix [#137](https://github.com/vitejs/vite-plugin-react/issues/137)) |
| 32 | +- Fast Refresh is applied on JS files using automatic runtime ([#122](https://github.com/vitejs/vite-plugin-react/pull/122), fix [#83](https://github.com/vitejs/vite-plugin-react/issues/83)) |
| 33 | +- Vite 4.2 is required as a peer dependency ([#128](https://github.com/vitejs/vite-plugin-react/pull/128)) |
| 34 | +- Avoid key collision in React refresh registration ([a74dfef](https://github.com/vitejs/vite-plugin-react/commit/a74dfef), fix [#116](https://github.com/vitejs/vite-plugin-react/issues/116)) |
| 35 | +- Throw when refresh runtime is loaded twice ([#108](https://github.com/vitejs/vite-plugin-react/pull/108), fix [#101](https://github.com/vitejs/vite-plugin-react/issues/101)) |
| 36 | +- Don't force optimization of jsx-runtime ([#132](https://github.com/vitejs/vite-plugin-react/pull/132)) |
| 37 | + |
1 | 38 | ## 3.1.0 (2023-02-02)
|
2 | 39 |
|
3 | 40 | * doc: add jsxImportSource option ([38d71f6](https://github.com/vitejs/vite-plugin-react/commit/38d71f6))
|
|
0 commit comments