Skip to content

Commit 779eb11

Browse files
committed
chore: merge main
2 parents e15582d + 8a91260 commit 779eb11

File tree

42 files changed

+1285
-831
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1285
-831
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ See [`@vitejs/plugin-react` documentation](packages/plugin-react/README.md) and
2020
| Package | Version (click for changelogs) |
2121
| ----------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------- |
2222
| [@vitejs/plugin-react](packages/plugin-react) | [![plugin-react version](https://img.shields.io/npm/v/@vitejs/plugin-react.svg?label=%20)](packages/plugin-react/CHANGELOG.md) |
23+
| [@vitejs/plugin-react-oxc](packages/plugin-react-oxc) | [![plugin-react-oxc version](https://img.shields.io/npm/v/@vitejs/plugin-react-oxc.svg?label=%20)](packages/plugin-react-oxc/CHANGELOG.md) |
2324
| [@vitejs/plugin-react-swc](packages/plugin-react-swc) | [![plugin-react-swc version](https://img.shields.io/npm/v/@vitejs/plugin-react-swc.svg?label=%20)](packages/plugin-react-swc/CHANGELOG.md) |
2425

2526
## License

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"engines": {
66
"node": "^14.18.0 || >=16.0.0"
77
},
8-
"packageManager": "pnpm@10.9.0",
8+
"packageManager": "pnpm@10.11.1",
99
"homepage": "https://github.com/vitejs/vite-plugin-react/",
1010
"keywords": [
1111
"frontend",
@@ -33,26 +33,26 @@
3333
"ci-publish": "tsx scripts/publishCI.ts"
3434
},
3535
"devDependencies": {
36-
"@eslint/js": "^9.25.1",
36+
"@eslint/js": "^9.28.0",
3737
"@types/fs-extra": "^11.0.4",
38-
"@types/node": "^22.15.2",
38+
"@types/node": "^22.15.30",
3939
"@vitejs/release-scripts": "^1.5.0",
40-
"eslint": "^9.25.1",
41-
"eslint-plugin-import-x": "^4.11.0",
42-
"eslint-plugin-n": "^17.17.0",
43-
"eslint-plugin-regexp": "^2.7.0",
40+
"eslint": "^9.28.0",
41+
"eslint-plugin-import-x": "^4.15.1",
42+
"eslint-plugin-n": "^17.19.0",
43+
"eslint-plugin-regexp": "^2.8.0",
4444
"fs-extra": "^11.3.0",
45-
"globals": "^16.0.0",
46-
"lint-staged": "^15.5.1",
45+
"globals": "^16.2.0",
46+
"lint-staged": "^15.5.2",
4747
"picocolors": "^1.1.1",
4848
"playwright-chromium": "^1.52.0",
4949
"prettier": "^3.0.3",
5050
"simple-git-hooks": "^2.13.0",
51-
"tsx": "^4.19.3",
51+
"tsx": "^4.19.4",
5252
"typescript": "^5.8.3",
53-
"typescript-eslint": "^8.31.0",
53+
"typescript-eslint": "^8.33.1",
5454
"vite": "^6.3.3",
55-
"vitest": "^3.1.2"
55+
"vitest": "^3.2.2"
5656
},
5757
"simple-git-hooks": {
5858
"pre-commit": "pnpm exec lint-staged --concurrent false"

packages/common/refresh-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
export const runtimePublicPath = '/@react-refresh'
22

33
const reactCompRE = /extends\s+(?:React\.)?(?:Pure)?Component/
4-
const refreshContentRE = /\$Refresh(?:Reg|Sig)\$\(/
4+
const refreshContentRE = /\$RefreshReg\$\(/
55

66
// NOTE: this is exposed publicly via plugin-react
77
export const preambleCode = `import { injectIntoGlobalHook } from "__BASE__${runtimePublicPath.slice(
88
1,
9-
)}"
9+
)}";
1010
injectIntoGlobalHook(window);
1111
window.$RefreshReg$ = () => {};
1212
window.$RefreshSig$ = () => (type) => type;`

packages/plugin-react-oxc/CHANGELOG.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,28 @@
22

33
## Unreleased
44

5-
### Add `filter` for rolldown-vite
5+
## 0.2.2 (2025-06-10)
6+
7+
### Add Vite 7-beta to peerDependencies range [#497](https://github.com/vitejs/vite-plugin-react/pull/497)
8+
9+
React plugins are compatible with Vite 7, this removes the warning when testing the beta.
10+
11+
## 0.2.1 (2025-06-03)
12+
13+
### Add explicit semicolon in preambleCode [#485](https://github.com/vitejs/vite-plugin-react/pull/485)
14+
15+
This fixes an edge case when using HTML minifiers that strips line breaks aggressively.
16+
17+
## 0.2.0 (2025-05-23)
18+
19+
### Add `filter` for rolldown-vite [#470](https://github.com/vitejs/vite-plugin-react/pull/470)
620

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

23+
### Skip HMR for JSX files with hooks [#480](https://github.com/vitejs/vite-plugin-react/pull/480)
24+
25+
This removes the HMR warning for hooks with JSX.
26+
927
## 0.1.1 (2025-04-10)
1028

1129
## 0.1.0 (2025-04-09)

packages/plugin-react-oxc/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vitejs/plugin-react-oxc",
3-
"version": "0.1.1",
3+
"version": "0.2.2",
44
"license": "MIT",
55
"author": "Evan You",
66
"contributors": [
@@ -40,14 +40,14 @@
4040
},
4141
"homepage": "https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react#readme",
4242
"peerDependencies": {
43-
"vite": "^6.3.0"
43+
"vite": "^6.3.0 || ^7.0.0-beta.0"
4444
},
4545
"devDependencies": {
4646
"@vitejs/react-common": "workspace:*",
4747
"unbuild": "^3.5.0",
4848
"vite": "catalog:rolldown-vite"
4949
},
5050
"dependencies": {
51-
"@rolldown/pluginutils": "1.0.0-beta.9"
51+
"@rolldown/pluginutils": "1.0.0-beta.11"
5252
}
5353
}

packages/plugin-react-swc/CHANGELOG.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,40 @@
22

33
## Unreleased
44

5-
### Add `filter` for rolldown-vite
5+
## 3.10.2 (2025-06-10)
6+
7+
### Suggest `@vitejs/plugin-react-oxc` if rolldown-vite is detected [#491](https://github.com/vitejs/vite-plugin-react/pull/491)
8+
9+
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.
10+
11+
### Use `optimizeDeps.rollupOptions` instead of `optimizeDeps.esbuildOptions` for rolldown-vite [#489](https://github.com/vitejs/vite-plugin-react/pull/489)
12+
13+
This suppresses the warning about `optimizeDeps.esbuildOptions` being deprecated in rolldown-vite.
14+
15+
### Add Vite 7-beta to peerDependencies range [#497](https://github.com/vitejs/vite-plugin-react/pull/497)
16+
17+
React plugins are compatible with Vite 7, this removes the warning when testing the beta.
18+
19+
## 3.10.1 (2025-06-03)
20+
21+
### Add explicit semicolon in preambleCode [#485](https://github.com/vitejs/vite-plugin-react/pull/485)
22+
23+
This fixes an edge case when using HTML minifiers that strips line breaks aggressively.
24+
25+
## 3.10.0 (2025-05-23)
26+
27+
### Add `filter` for rolldown-vite [#470](https://github.com/vitejs/vite-plugin-react/pull/470)
628

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

9-
### Skip HMR preamble in Vitest browser mode
31+
### Skip HMR preamble in Vitest browser mode [#478](https://github.com/vitejs/vite-plugin-react/pull/478)
1032

1133
This was causing annoying `Sourcemap for "/@react-refresh" points to missing source files` and is unnecessary in test mode.
1234

35+
### Skip HMR for JSX files with hooks [#480](https://github.com/vitejs/vite-plugin-react/pull/480)
36+
37+
This removes the HMR warning for hooks with JSX.
38+
1339
## 3.9.0 (2025-04-15)
1440

1541
### Make compatible with rolldown-vite

packages/plugin-react-swc/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,14 @@ react({
117117
})
118118
```
119119

120+
### disableOxcRecommendation
121+
122+
If set, disables the recommendation to use `@vitejs/plugin-react-oxc` (which is shown when `rolldown-vite` is detected and neither `swc` plugins are used nor the `swc` options are mutated).
123+
124+
```ts
125+
react({ disableOxcRecommendation: true })
126+
```
127+
120128
## Consistent components exports
121129

122130
For React refresh to work correctly, your file should only export React components. The best explanation I've read is the one from the [Gatsby docs](https://www.gatsbyjs.com/docs/reference/local-development/fast-refresh/#how-it-works).

packages/plugin-react-swc/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vitejs/plugin-react-swc",
3-
"version": "3.9.0",
3+
"version": "3.10.2",
44
"license": "MIT",
55
"author": "Arnaud Barré (https://github.com/ArnaudBarre)",
66
"description": "Speed up your Vite dev server with SWC",
@@ -29,18 +29,18 @@
2929
},
3030
"homepage": "https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react-swc#readme",
3131
"dependencies": {
32-
"@rolldown/pluginutils": "1.0.0-beta.9",
33-
"@swc/core": "^1.11.22"
32+
"@rolldown/pluginutils": "1.0.0-beta.11",
33+
"@swc/core": "^1.11.31"
3434
},
3535
"peerDependencies": {
36-
"vite": "^4 || ^5 || ^6"
36+
"vite": "^4 || ^5 || ^6 || ^7.0.0-beta.0"
3737
},
3838
"devDependencies": {
3939
"@playwright/test": "^1.52.0",
4040
"@types/fs-extra": "^11.0.4",
41-
"@types/node": "^22.15.2",
41+
"@types/node": "^22.15.30",
4242
"@vitejs/react-common": "workspace:*",
43-
"esbuild": "^0.25.3",
43+
"esbuild": "^0.25.5",
4444
"fs-extra": "^11.3.0",
4545
"picocolors": "^1.1.1",
4646
"prettier": "^3.0.3",

packages/plugin-react-swc/playground/base-path/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"react-dom": "^19.1.0"
1313
},
1414
"devDependencies": {
15-
"@types/react": "^19.1.2",
16-
"@types/react-dom": "^19.1.2",
15+
"@types/react": "^19.1.6",
16+
"@types/react-dom": "^19.1.6",
1717
"@vitejs/plugin-react-swc": "../../dist"
1818
}
1919
}

packages/plugin-react-swc/playground/class-components/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"react-dom": "^19.1.0"
1313
},
1414
"devDependencies": {
15-
"@types/react": "^19.1.2",
16-
"@types/react-dom": "^19.1.2",
15+
"@types/react": "^19.1.6",
16+
"@types/react-dom": "^19.1.6",
1717
"@vitejs/plugin-react-swc": "../../dist"
1818
}
1919
}

0 commit comments

Comments
 (0)