Skip to content

Commit 814d60d

Browse files
committed
chore: merge main
2 parents ccfcb28 + 1583c5d commit 814d60d

File tree

48 files changed

+1035
-635
lines changed

Some content is hidden

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

48 files changed

+1035
-635
lines changed

.github/renovate.json5

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3-
"extends": ["config:base", "schedule:weekly", "group:allNonMajor"],
3+
"extends": ["config:recommended", "schedule:weekly", "group:allNonMajor"],
44
"labels": ["dependencies"],
55
"ignorePaths": ["**/__tests__/**"],
66
"rangeStrategy": "bump",
77
"packageRules": [
88
{
9-
"depTypeList": ["peerDependencies"],
9+
"matchDepTypes": ["peerDependencies"],
1010
"enabled": false,
1111
},
1212
{
1313
"matchFileNames": ["**/react-18/**", "**/compiler-react-18/**"],
1414
"ignoreDeps": ["react", "react-dom", "@types/react", "@types/react-dom"],
1515
},
16+
{
17+
"extends": ["monorepo:swc"],
18+
"groupName": "swc monorepo",
19+
"separateMajorMinor": false,
20+
},
1621
// renovate doesn't properly handle x.x.x-beta-hash-yyyymm version schema
1722
{
1823
"matchPackageNames": [
@@ -23,8 +28,8 @@
2328
},
2429
{
2530
"matchDepTypes": ["action"],
26-
"excludePackagePrefixes": ["actions/", "github/"],
2731
"pinDigests": true,
32+
"matchPackageNames": ["!actions/{/,}**", "!github/{/,}**"],
2833
},
2934
],
3035
"ignoreDeps": [

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ export default tseslint.config(
127127
{
128128
name: 'disables/playground',
129129
files: [
130+
'packages/**/*.test.?([cm])[jt]s?(x)',
130131
'playground/**/*.?([cm])[jt]s?(x)',
131132
'packages/plugin-react-swc/playground/**/*.?([cm])[jt]s?(x)',
132133
],

package.json

Lines changed: 13 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.11.1",
8+
"packageManager": "pnpm@10.12.2",
99
"homepage": "https://github.com/vitejs/vite-plugin-react/",
1010
"keywords": [
1111
"frontend",
@@ -21,7 +21,8 @@
2121
"format": "prettier --write --cache .",
2222
"lint": "eslint --cache .",
2323
"typecheck": "tsc -p scripts && tsc -p playground && tsc -p packages/plugin-react",
24-
"test": "pnpm run test-serve && pnpm run test-build && pnpm --filter ./packages/plugin-react-swc run test && npm run test-full-bundle-mode",
24+
"test": "pnpm run test-unit && pnpm run test-serve && pnpm run test-build && pnpm --filter ./packages/plugin-react-swc run test && npm run test-full-bundle-mode",
25+
"test-unit": "pnpm -r --filter='./packages/*' run test-unit",
2526
"test-serve": "vitest run -c playground/vitest.config.e2e.ts",
2627
"test-full-bundle-mode": "VITE_TEST_FULL_BUNDLE_MODE=1 vitest run -c playground/vitest.config.e2e.ts",
2728
"test-build": "VITE_TEST_BUILD=1 vitest run -c playground/vitest.config.e2e.ts",
@@ -33,26 +34,26 @@
3334
"ci-publish": "tsx scripts/publishCI.ts"
3435
},
3536
"devDependencies": {
36-
"@eslint/js": "^9.28.0",
37+
"@eslint/js": "^9.29.0",
3738
"@types/fs-extra": "^11.0.4",
38-
"@types/node": "^22.15.30",
39+
"@types/node": "^22.15.32",
3940
"@vitejs/release-scripts": "^1.5.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",
41+
"eslint": "^9.29.0",
42+
"eslint-plugin-import-x": "^4.15.2",
43+
"eslint-plugin-n": "^17.20.0",
44+
"eslint-plugin-regexp": "^2.9.0",
4445
"fs-extra": "^11.3.0",
4546
"globals": "^16.2.0",
4647
"lint-staged": "^15.5.2",
4748
"picocolors": "^1.1.1",
48-
"playwright-chromium": "^1.52.0",
49+
"playwright-chromium": "^1.53.1",
4950
"prettier": "^3.0.3",
5051
"simple-git-hooks": "^2.13.0",
51-
"tsx": "^4.19.4",
52+
"tsx": "^4.20.3",
5253
"typescript": "^5.8.3",
53-
"typescript-eslint": "^8.33.1",
54+
"typescript-eslint": "^8.34.1",
5455
"vite": "^6.3.3",
55-
"vitest": "^3.2.2"
56+
"vitest": "^3.2.4"
5657
},
5758
"simple-git-hooks": {
5859
"pre-commit": "pnpm exec lint-staged --concurrent false"

packages/plugin-react-oxc/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
## Unreleased
44

5+
## 0.2.3 (2025-06-16)
6+
7+
### Disable refresh transform when `server.hmr: false` is set [#502](https://github.com/vitejs/vite-plugin-react/pull/502)
8+
9+
This fixes "`$RefreshReg$` is not defined" error when running Vitest with the plugin.
10+
511
## 0.2.2 (2025-06-10)
612

713
### Add Vite 7-beta to peerDependencies range [#497](https://github.com/vitejs/vite-plugin-react/pull/497)

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.2.2",
3+
"version": "0.2.3",
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 || ^7.0.0-beta.0"
43+
"vite": "^6.3.0 || ^7.0.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.11"
51+
"@rolldown/pluginutils": "1.0.0-beta.19"
5252
}
5353
}

packages/plugin-react-oxc/src/index.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,22 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
8282
},
8383
}
8484

85+
const viteConfigPost: Plugin = {
86+
name: 'vite:react-oxc:config-post',
87+
enforce: 'post',
88+
config(userConfig) {
89+
if (userConfig.server?.hmr === false) {
90+
return {
91+
oxc: {
92+
jsx: {
93+
refresh: false,
94+
},
95+
},
96+
}
97+
}
98+
},
99+
}
100+
85101
const viteRefreshRuntime: Plugin = {
86102
name: 'vite:react-oxc:refresh-runtime',
87103
enforce: 'pre',
@@ -157,5 +173,5 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
157173
},
158174
}
159175

160-
return [viteConfig, viteRefreshRuntime, viteRefreshWrapper]
176+
return [viteConfig, viteConfigPost, viteRefreshRuntime, viteRefreshWrapper]
161177
}

packages/plugin-react-swc/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
### Suggest `@vitejs/plugin-react-oxc` if rolldown-vite is detected [#491](https://github.com/vitejs/vite-plugin-react/pull/491)
88

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.
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: true` in the plugin options.
1010

1111
### Use `optimizeDeps.rollupOptions` instead of `optimizeDeps.esbuildOptions` for rolldown-vite [#489](https://github.com/vitejs/vite-plugin-react/pull/489)
1212

packages/plugin-react-swc/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@
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.11",
33-
"@swc/core": "^1.11.31"
32+
"@rolldown/pluginutils": "1.0.0-beta.19",
33+
"@swc/core": "^1.12.5"
3434
},
3535
"peerDependencies": {
36-
"vite": "^4 || ^5 || ^6 || ^7.0.0-beta.0"
36+
"vite": "^4 || ^5 || ^6 || ^7"
3737
},
3838
"devDependencies": {
39-
"@playwright/test": "^1.52.0",
39+
"@playwright/test": "^1.53.1",
4040
"@types/fs-extra": "^11.0.4",
41-
"@types/node": "^22.15.30",
41+
"@types/node": "^22.15.32",
4242
"@vitejs/react-common": "workspace:*",
4343
"esbuild": "^0.25.5",
4444
"fs-extra": "^11.3.0",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"react-dom": "^19.1.0"
1313
},
1414
"devDependencies": {
15-
"@types/react": "^19.1.6",
15+
"@types/react": "^19.1.8",
1616
"@types/react-dom": "^19.1.6",
1717
"@vitejs/plugin-react-swc": "../../dist"
1818
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"react-dom": "^19.1.0"
1313
},
1414
"devDependencies": {
15-
"@types/react": "^19.1.6",
15+
"@types/react": "^19.1.8",
1616
"@types/react-dom": "^19.1.6",
1717
"@vitejs/plugin-react-swc": "../../dist"
1818
}

0 commit comments

Comments
 (0)