@vitejs/plugin-react 6.0.2 → 6.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -166,4 +166,4 @@ For React refresh to work correctly, your file should only export React componen
166
166
 
167
167
  If an incompatible change in exports is found, the module will be invalidated and HMR will propagate. To make it easier to export simple constants alongside your component, the module is only invalidated when their value changes.
168
168
 
169
- You can catch mistakes and get more detailed warnings with this [ESLint rule](https://github.com/ArnaudBarre/eslint-plugin-react-refresh), or the equivalent [Oxlint rule](https://oxc.rs/docs/guide/usage/linter/rules/react/only-export-components.html).
169
+ You can catch mistakes and get more detailed warnings with this [ESLint rule](https://github.com/ArnaudBarre/eslint-plugin-react-refresh), this [Oxlint rule](https://oxc.rs/docs/guide/usage/linter/rules/react/only-export-components.html), or this [Biome rule](https://biomejs.dev/linter/rules/use-component-export-only-modules).
package/dist/index.js CHANGED
@@ -41,10 +41,11 @@ const silenceUseClientWarning = (userConfig) => ({ rollupOptions: { onwarn(warni
41
41
  } } });
42
42
  //#endregion
43
43
  //#region src/reactCompilerPreset.ts
44
+ const defaultCodeFilter = /forwardRef|memo|(?:const|let|var|function)\s+(?:[A-Z]|use[A-Z0-9])|(?:[A-Z]|use[A-Z0-9])[^\s:=(){}[\],;]*\s*(?:\(|[:=]\s*(?:function|\())/;
44
45
  const reactCompilerPreset = (options = {}) => ({
45
46
  preset: () => ({ plugins: [["babel-plugin-react-compiler", options]] }),
46
47
  rolldown: {
47
- filter: { code: options.compilationMode === "annotation" ? /['"]use memo['"]/ : /\b[A-Z]|\buse/ },
48
+ filter: { code: options.compilationMode === "annotation" ? /['"]use memo['"]/ : defaultCodeFilter },
48
49
  applyToEnvironmentHook: (env) => env.config.consumer === "client",
49
50
  optimizeDeps: { include: options.target === "17" || options.target === "18" ? ["react-compiler-runtime"] : ["react/compiler-runtime"] }
50
51
  }
@@ -137,7 +138,7 @@ function viteReact(opts = {}) {
137
138
  if (!skipFastRefresh && isBundledDev) return [{
138
139
  tag: "script",
139
140
  attrs: { type: "module" },
140
- children: getPreambleCode(base)
141
+ children: getPreambleCode("/")
141
142
  }];
142
143
  },
143
144
  order: "pre"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitejs/plugin-react",
3
- "version": "6.0.2",
3
+ "version": "6.0.3",
4
4
  "description": "The default Vite plugin for React projects",
5
5
  "keywords": [
6
6
  "fast refresh",
@@ -43,18 +43,18 @@
43
43
  "test-unit": "vitest run"
44
44
  },
45
45
  "dependencies": {
46
- "@rolldown/pluginutils": "^1.0.0"
46
+ "@rolldown/pluginutils": "^1.0.1"
47
47
  },
48
48
  "devDependencies": {
49
- "@babel/core": "8.0.0-rc.4",
49
+ "@babel/core": "8.0.0-rc.6",
50
50
  "@rolldown/plugin-babel": "^0.2.3",
51
51
  "@vitejs/react-common": "workspace:*",
52
52
  "babel-plugin-react-compiler": "^1.0.0",
53
- "react": "^19.2.6",
54
- "react-dom": "^19.2.6",
55
- "rolldown": "^1.0.0",
56
- "tsdown": "^0.22.0",
57
- "vite": "^8.0.11"
53
+ "react": "^19.2.7",
54
+ "react-dom": "^19.2.7",
55
+ "rolldown": "^1.1.1",
56
+ "tsdown": "^0.22.2",
57
+ "vite": "^8.0.16"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "@rolldown/plugin-babel": "^0.1.7 || ^0.2.0",