Skip to content

Conversation

TheAlexLichter
Copy link
Contributor

Description

This PR introduces a log (warn) when using rolldown-vite and either:

  • vite-plugin-react,
  • or vite-plugin-react-swc (without any swc plugins set)

It recommends using vite-plugin-react-oxc and links to the Rolldown migration guide.

I'm planning on adding info regarding vite-plugin-react-oxc to it in another PR

Copy link
Member

@ArnaudBarre ArnaudBarre left a comment

Choose a reason for hiding this comment

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

I think that's a good way to make people aware of it, but maybe we should provide a way to disable the warning, but one extra config field for this feels too much. I'm curious of the opinion of other team member @patak-dev @sapphi-red @hi-ogawa

@TheAlexLichter
Copy link
Contributor Author

Thanks for your notes!

maybe we should provide a way to disable the warning, but one extra config field for this feels too much.

I had the same thoughts and didn't come up with a better solution so far. But maybe we could use an env var instead to avoid "one more config option" and cater to the needs of the few who want to disable it? 🤔

@patak-dev
Copy link
Member

I think that's a good way to make people aware of it, but maybe we should provide a way to disable the warning, but one extra config field for this feels too much. I'm curious of the opinion of other team member @patak-dev @sapphi-red @hi-ogawa

I agree that there should be a way to disable the warning. If the idea is making vite-plugin-react-oxc the default, I think it is ok to have an option in the other plugins config to disable it.

@TheAlexLichter
Copy link
Contributor Author

Added disableOxcRecommendation which is not set by default to both plugins 👍🏻

@sapphi-red
Copy link
Member

maybe we should provide a way to disable the warning, but one extra config field for this feels too much.

I had the same thoughts and didn't come up with a better solution so far. But maybe we could use an env var instead to avoid "one more config option" and cater to the needs of the few who want to disable it? 🤔

This isn't directly related, but implementing vitejs/vite#19937 in the future could help users filter out certain warnings more easily.

Copy link
Member

@sapphi-red sapphi-red left a comment

Choose a reason for hiding this comment

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

Would you add a changelog entry?

@sapphi-red sapphi-red merged commit c450133 into vitejs:main Jun 6, 2025
8 checks passed
@TheAlexLichter TheAlexLichter deleted the feat/recommend-oxc-plugin-if-rolldown branch June 6, 2025 09:32
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Jun 14, 2025
| datasource | package              | from  | to    |
| ---------- | -------------------- | ----- | ----- |
| npm        | @vitejs/plugin-react | 4.5.0 | 4.5.2 |


## [v4.5.2](https://github.com/vitejs/vite-plugin-react/blob/HEAD/packages/plugin-react/CHANGELOG.md#452-2025-06-10)

##### Suggest `@vitejs/plugin-react-oxc` if rolldown-vite is detected [#491](vitejs/vite-plugin-react#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](vitejs/vite-plugin-react#489)

This suppresses the warning about `optimizeDeps.esbuildOptions` being deprecated in rolldown-vite.

##### Add Vite 7-beta to peerDependencies range [#497](vitejs/vite-plugin-react#497)

React plugins are compatible with Vite 7, this removes the warning when testing the beta.


## [v4.5.1](https://github.com/vitejs/vite-plugin-react/blob/HEAD/packages/plugin-react/CHANGELOG.md#451-2025-06-03)

##### Add explicit semicolon in preambleCode [#485](vitejs/vite-plugin-react#485)

This fixes an edge case when using HTML minifiers that strips line breaks aggressively.
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Jun 22, 2025
| datasource | package              | from  | to    |
| ---------- | -------------------- | ----- | ----- |
| npm        | @vitejs/plugin-react | 4.5.0 | 4.5.2 |


## [v4.5.2](https://github.com/vitejs/vite-plugin-react/blob/HEAD/packages/plugin-react/CHANGELOG.md#452-2025-06-10)

##### Suggest `@vitejs/plugin-react-oxc` if rolldown-vite is detected [#491](vitejs/vite-plugin-react#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](vitejs/vite-plugin-react#489)

This suppresses the warning about `optimizeDeps.esbuildOptions` being deprecated in rolldown-vite.

##### Add Vite 7-beta to peerDependencies range [#497](vitejs/vite-plugin-react#497)

React plugins are compatible with Vite 7, this removes the warning when testing the beta.


## [v4.5.1](https://github.com/vitejs/vite-plugin-react/blob/HEAD/packages/plugin-react/CHANGELOG.md#451-2025-06-03)

##### Add explicit semicolon in preambleCode [#485](vitejs/vite-plugin-react#485)

This fixes an edge case when using HTML minifiers that strips line breaks aggressively.
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Jul 5, 2025
| datasource | package              | from  | to    |
| ---------- | -------------------- | ----- | ----- |
| npm        | @vitejs/plugin-react | 4.5.0 | 4.6.0 |


## [v4.6.0](https://github.com/vitejs/vite-plugin-react/blob/HEAD/packages/plugin-react/CHANGELOG.md#460-2025-06-23)

##### 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.


## [v4.5.2](https://github.com/vitejs/vite-plugin-react/blob/HEAD/packages/plugin-react/CHANGELOG.md#452-2025-06-10)

##### Suggest `@vitejs/plugin-react-oxc` if rolldown-vite is detected [#491](vitejs/vite-plugin-react#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](vitejs/vite-plugin-react#489)

This suppresses the warning about `optimizeDeps.esbuildOptions` being deprecated in rolldown-vite.

##### Add Vite 7-beta to peerDependencies range [#497](vitejs/vite-plugin-react#497)

React plugins are compatible with Vite 7, this removes the warning when testing the beta.


## [v4.5.1](https://github.com/vitejs/vite-plugin-react/blob/HEAD/packages/plugin-react/CHANGELOG.md#451-2025-06-03)

##### Add explicit semicolon in preambleCode [#485](vitejs/vite-plugin-react#485)

This fixes an edge case when using HTML minifiers that strips line breaks aggressively.
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Jul 5, 2025
| datasource | package              | from  | to    |
| ---------- | -------------------- | ----- | ----- |
| npm        | @vitejs/plugin-react | 4.5.0 | 4.6.0 |


## [v4.6.0](https://github.com/vitejs/vite-plugin-react/blob/HEAD/packages/plugin-react/CHANGELOG.md#460-2025-06-23)

##### 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.


## [v4.5.2](https://github.com/vitejs/vite-plugin-react/blob/HEAD/packages/plugin-react/CHANGELOG.md#452-2025-06-10)

##### Suggest `@vitejs/plugin-react-oxc` if rolldown-vite is detected [#491](vitejs/vite-plugin-react#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](vitejs/vite-plugin-react#489)

This suppresses the warning about `optimizeDeps.esbuildOptions` being deprecated in rolldown-vite.

##### Add Vite 7-beta to peerDependencies range [#497](vitejs/vite-plugin-react#497)

React plugins are compatible with Vite 7, this removes the warning when testing the beta.


## [v4.5.1](https://github.com/vitejs/vite-plugin-react/blob/HEAD/packages/plugin-react/CHANGELOG.md#451-2025-06-03)

##### Add explicit semicolon in preambleCode [#485](vitejs/vite-plugin-react#485)

This fixes an edge case when using HTML minifiers that strips line breaks aggressively.
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