Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Oct 1, 2023

This PR contains the following updates:

Package Change Age Confidence
@vitejs/plugin-react (source) 4.0.4 -> 4.7.0 age confidence

Release Notes

vitejs/vite-plugin-react (@​vitejs/plugin-react)

v4.7.0

Compare Source

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' }))

v4.6.0

Compare Source

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

Compare Source

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.

v4.5.1

Compare Source

Add explicit semicolon in preambleCode #​485

This fixes an edge case when using HTML minifiers that strips line breaks aggressively.

v4.5.0

Compare Source

Add filter for rolldown-vite #​470

Added filter so that it is more performant when running this plugin with rolldown-powered version of Vite.

Skip HMR for JSX files with hooks #​480

This removes the HMR warning for hooks with JSX.

v4.4.1

Compare Source

Fix type issue when using moduleResolution: "node" in tsconfig #​462

v4.4.0

Compare Source

Make compatible with rolldown-vite

This plugin is now compatible with rolldown-powered version of Vite.
Note that currently the __source property value position might be incorrect. This will be fixed in the near future.

v4.3.4

Compare Source

Add Vite 6 to peerDependencies range

Vite 6 is highly backward compatible, not much to add!

Force Babel to output spec compliant import attributes #​386

The default was an old spec (with type: "json"). We now enforce spec compliant (with { type: "json" })

v4.3.3

Compare Source

React Compiler runtimeModule option removed

React Compiler was updated to accept a target option and runtimeModule was removed. vite-plugin-react will still detect runtimeModule for backwards compatibility.

When using a custom runtimeModule or target !== '19', the plugin will not try to pre-optimize react/compiler-runtime dependency.

The react-compiler-runtime is now available on npm can be used instead of the local shim for people using the compiler with React < 19.

Here is the configuration to use the compiler with React 18 and correct source maps in development:

npm install babel-plugin-react-compiler react-compiler-runtime @&#8203;babel/plugin-transform-react-jsx-development
export default defineConfig(({ command }) => {
  const babelPlugins = [['babel-plugin-react-compiler', { target: '18' }]]
  if (command === 'serve') {
    babelPlugins.push(['@&#8203;babel/plugin-transform-react-jsx-development', {}])
  }

  return {
    plugins: [react({ babel: { plugins: babelPlugins } })],
  }
})

v4.3.2

Compare Source

Ignore directive sourcemap error #​369

v4.3.1

Compare Source

Fix support for React Compiler with React 18

The previous version made this assumption that the compiler was only usable with React 19, but it's possible to use it with React 18 and a custom runtimeModule: https://gist.github.com/poteto/37c076bf112a07ba39d0e5f0645fec43

When using a custom runtimeModule, the plugin will not try to pre-optimize react/compiler-runtime dependency.

Reminder: Vite expect code outside of node_modules to be ESM, so you will need to update the gist with import React from 'react'.

v4.3.0

Compare Source

Fix support for React compiler

Don't set retainLines: true when the React compiler is used. This creates whitespace issues and the compiler is modifying the JSX too much to get correct line numbers after that. If you want to use the React compiler and get back correct line numbers for tools like vite-plugin-react-click-to-component to work, you should update your config to something like:

export default defineConfig(({ command }) => {
  const babelPlugins = [['babel-plugin-react-compiler', {}]]
  if (command === 'serve') {
    babelPlugins.push(['@&#8203;babel/plugin-transform-react-jsx-development', {}])
  }

  return {
    plugins: [react({ babel: { plugins: babelPlugins } })],
  }
})
Support HMR for class components

This is a long overdue and should fix some issues people had with HMR when migrating from CRA.

v4.2.1

Compare Source

Remove generic parameter on Plugin to avoid type error with Rollup 4/Vite 5 and skipLibCheck: false.

I expect very few people to currently use this feature, but if you are extending the React plugin via api object, you can get back the typing of the hook by importing ViteReactPluginApi:

import type { Plugin } from 'vite'
import type { ViteReactPluginApi } from '@&#8203;vitejs/plugin-react'

export const somePlugin: Plugin = {
  name: 'some-plugin',
  api: {
    reactBabel: (babelConfig) => {
      babelConfig.plugins.push('some-babel-plugin')
    },
  } satisfies ViteReactPluginApi,
}

v4.2.0

Compare Source

Update peer dependency range to target Vite 5

There were no breaking change that impacted this plugin, so any combination of React plugins and Vite core version will work.

Align jsx runtime for optimized dependencies

This will only affect people using internal libraries that contains untranspiled JSX. This change aligns the optimizer with the source code and avoid issues when the published source don't have React in the scope.

Reminder: While being partially supported in Vite, publishing TS & JSX outside of internal libraries is highly discouraged.

v4.1.1

Compare Source

  • Enable retainLines to get correct line numbers for jsxDev (fix #​235)

v4.1.0

Compare Source

  • Add @types/babel__cores to dependencies (fix #​211)
  • Improve build perf when not using Babel plugins by lazy loading @babel/core #​212
  • Better invalidation message when an export is added & fix HMR for export of nullish values #​215
  • Include non-dev jsx runtime in optimizeDeps & support HMR for JS files using the non dev runtime #​224
  • The build output now contains a index.d.cts file so you don't get types errors when setting moduleResolution to node16 or nodenext in your tsconfig (we recommend using bundler which is more close to how Vite works)

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/vitejs-plugin-react-4.x branch from a83192e to 39ec19d Compare October 24, 2023 08:31
@renovate renovate bot changed the title Update dependency @vitejs/plugin-react to v4.1.0 Update dependency @vitejs/plugin-react to v4.1.1 Nov 2, 2023
@renovate renovate bot force-pushed the renovate/vitejs-plugin-react-4.x branch from 39ec19d to 5458653 Compare November 2, 2023 11:48
@renovate renovate bot changed the title Update dependency @vitejs/plugin-react to v4.1.1 Update dependency @vitejs/plugin-react to v4.2.0 Nov 16, 2023
@renovate renovate bot force-pushed the renovate/vitejs-plugin-react-4.x branch from 5458653 to e3dd77a Compare November 16, 2023 14:21
@renovate renovate bot changed the title Update dependency @vitejs/plugin-react to v4.2.0 Update dependency @vitejs/plugin-react to v4.2.1 Dec 4, 2023
@renovate renovate bot force-pushed the renovate/vitejs-plugin-react-4.x branch from e3dd77a to 4598021 Compare December 4, 2023 23:20
@renovate renovate bot force-pushed the renovate/vitejs-plugin-react-4.x branch from 4598021 to fbd36ae Compare May 22, 2024 19:09
@renovate renovate bot changed the title Update dependency @vitejs/plugin-react to v4.2.1 Update dependency @vitejs/plugin-react to v4.3.0 May 22, 2024
@renovate renovate bot changed the title Update dependency @vitejs/plugin-react to v4.3.0 Update dependency @vitejs/plugin-react to v4.3.1 Jun 10, 2024
@renovate renovate bot force-pushed the renovate/vitejs-plugin-react-4.x branch from fbd36ae to 8774455 Compare June 10, 2024 01:23
@renovate renovate bot changed the title Update dependency @vitejs/plugin-react to v4.3.1 Update dependency @vitejs/plugin-react to v4.3.2 Sep 29, 2024
@renovate renovate bot force-pushed the renovate/vitejs-plugin-react-4.x branch from 8774455 to 249c134 Compare September 29, 2024 22:47
@renovate renovate bot changed the title Update dependency @vitejs/plugin-react to v4.3.2 Update dependency @vitejs/plugin-react to v4.3.3 Oct 19, 2024
@renovate renovate bot force-pushed the renovate/vitejs-plugin-react-4.x branch from 249c134 to 25055af Compare October 19, 2024 18:06
@renovate renovate bot changed the title Update dependency @vitejs/plugin-react to v4.3.3 Update dependency @vitejs/plugin-react to v4.3.4 Nov 26, 2024
@renovate renovate bot force-pushed the renovate/vitejs-plugin-react-4.x branch from 25055af to afb4f21 Compare November 26, 2024 11:54
@renovate renovate bot changed the title Update dependency @vitejs/plugin-react to v4.3.4 Update dependency @vitejs/plugin-react to v4.4.0 Apr 15, 2025
@renovate renovate bot force-pushed the renovate/vitejs-plugin-react-4.x branch from afb4f21 to 40f744f Compare April 15, 2025 12:46
@renovate renovate bot changed the title Update dependency @vitejs/plugin-react to v4.4.0 Update dependency @vitejs/plugin-react to v4.4.1 Apr 19, 2025
@renovate renovate bot force-pushed the renovate/vitejs-plugin-react-4.x branch from 40f744f to 951fa6d Compare April 19, 2025 14:24
@renovate renovate bot changed the title Update dependency @vitejs/plugin-react to v4.4.1 Update dependency @vitejs/plugin-react to v4.5.0 May 23, 2025
@renovate renovate bot force-pushed the renovate/vitejs-plugin-react-4.x branch from 951fa6d to 27d5475 Compare May 23, 2025 02:24
@renovate renovate bot changed the title Update dependency @vitejs/plugin-react to v4.5.0 Update dependency @vitejs/plugin-react to v4.5.1 Jun 6, 2025
@renovate renovate bot force-pushed the renovate/vitejs-plugin-react-4.x branch 2 times, most recently from 6c4eaf8 to acbd204 Compare June 10, 2025 03:59
@renovate renovate bot changed the title Update dependency @vitejs/plugin-react to v4.5.1 Update dependency @vitejs/plugin-react to v4.5.2 Jun 10, 2025
@renovate renovate bot changed the title Update dependency @vitejs/plugin-react to v4.5.2 Update dependency @vitejs/plugin-react to v4.6.0 Jun 23, 2025
@renovate renovate bot force-pushed the renovate/vitejs-plugin-react-4.x branch from acbd204 to f620c00 Compare June 23, 2025 03:34
@renovate renovate bot force-pushed the renovate/vitejs-plugin-react-4.x branch from f620c00 to e97874f Compare July 18, 2025 04:13
@renovate renovate bot changed the title Update dependency @vitejs/plugin-react to v4.6.0 Update dependency @vitejs/plugin-react to v4.7.0 Jul 18, 2025
@renovate renovate bot force-pushed the renovate/vitejs-plugin-react-4.x branch from e97874f to 0571d7e Compare August 10, 2025 15:03
@renovate renovate bot force-pushed the renovate/vitejs-plugin-react-4.x branch from 0571d7e to 5a68a60 Compare August 13, 2025 16:11
@renovate
Copy link
Contributor Author

renovate bot commented Aug 13, 2025

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

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.

1 participant