Skip to content

Commit 3826861

Browse files
Merge remote-tracking branch 'upstream/main' into chore-rsc-nightly
2 parents f4444de + a1f4311 commit 3826861

File tree

28 files changed

+564
-455
lines changed

28 files changed

+564
-455
lines changed

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@
3333
"ci-publish": "tsx scripts/publishCI.ts"
3434
},
3535
"devDependencies": {
36-
"@eslint/js": "^9.32.0",
36+
"@eslint/js": "^9.33.0",
3737
"@types/fs-extra": "^11.0.4",
38-
"@types/node": "^22.17.0",
38+
"@types/node": "^22.17.1",
3939
"@vitejs/release-scripts": "^1.6.0",
40-
"eslint": "^9.32.0",
40+
"eslint": "^9.33.0",
4141
"eslint-plugin-import-x": "^4.16.1",
4242
"eslint-plugin-n": "^17.21.3",
43-
"eslint-plugin-regexp": "^2.9.1",
44-
"fs-extra": "^11.3.0",
43+
"eslint-plugin-regexp": "^2.10.0",
44+
"fs-extra": "^11.3.1",
4545
"globals": "^16.3.0",
4646
"lint-staged": "^15.5.2",
4747
"picocolors": "^1.1.1",
@@ -50,8 +50,8 @@
5050
"simple-git-hooks": "^2.13.1",
5151
"tsx": "^4.20.3",
5252
"typescript": "^5.9.2",
53-
"typescript-eslint": "^8.38.0",
54-
"vite": "^7.0.6",
53+
"typescript-eslint": "^8.39.0",
54+
"vite": "^7.1.1",
5555
"vitest": "^3.2.4"
5656
},
5757
"simple-git-hooks": {

packages/plugin-react-oxc/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
> [!IMPORTANT]
2+
> This package is deprecated. Please use [@vitejs/plugin-react](https://www.npmjs.com/package/@vitejs/plugin-react) instead, which automatically enables Oxc-based Fast Refresh transform on [`rolldown-vite`](https://vitejs.dev/guide/rolldown).
3+
14
# @vitejs/plugin-react-oxc [![npm](https://img.shields.io/npm/v/@vitejs/plugin-react-oxc.svg)](https://npmjs.com/package/@vitejs/plugin-react-oxc)
25

36
The future default Vite plugin for React projects.

packages/plugin-react-oxc/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@
4343
},
4444
"devDependencies": {
4545
"@vitejs/react-common": "workspace:*",
46-
"tsdown": "^0.13.2",
46+
"tsdown": "^0.14.0",
4747
"vite": "catalog:rolldown-vite"
4848
},
4949
"dependencies": {
50-
"@rolldown/pluginutils": "1.0.0-beta.30"
50+
"@rolldown/pluginutils": "1.0.0-beta.31"
5151
}
5252
}

packages/plugin-react-swc/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
},
3333
"homepage": "https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react-swc#readme",
3434
"dependencies": {
35-
"@rolldown/pluginutils": "1.0.0-beta.30",
35+
"@rolldown/pluginutils": "1.0.0-beta.31",
3636
"@swc/core": "^1.13.2"
3737
},
3838
"peerDependencies": {
@@ -41,11 +41,11 @@
4141
"devDependencies": {
4242
"@playwright/test": "^1.54.2",
4343
"@types/fs-extra": "^11.0.4",
44-
"@types/node": "^22.17.0",
44+
"@types/node": "^22.17.1",
4545
"@vitejs/react-common": "workspace:*",
46-
"fs-extra": "^11.3.0",
46+
"fs-extra": "^11.3.1",
4747
"prettier": "^3.0.3",
48-
"tsdown": "^0.13.2",
48+
"tsdown": "^0.14.0",
4949
"typescript": "^5.9.2"
5050
}
5151
}

packages/plugin-react/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"@babel/core": "^7.28.0",
4444
"@babel/plugin-transform-react-jsx-self": "^7.27.1",
4545
"@babel/plugin-transform-react-jsx-source": "^7.27.1",
46-
"@rolldown/pluginutils": "1.0.0-beta.30",
46+
"@rolldown/pluginutils": "1.0.0-beta.31",
4747
"@types/babel__core": "^7.20.5",
4848
"react-refresh": "^0.17.0"
4949
},
@@ -55,8 +55,8 @@
5555
"babel-plugin-react-compiler": "19.1.0-rc.2",
5656
"react": "^19.1.1",
5757
"react-dom": "^19.1.1",
58-
"rolldown": "1.0.0-beta.30",
59-
"tsdown": "^0.13.2",
58+
"rolldown": "1.0.0-beta.31",
59+
"tsdown": "^0.14.0",
6060
"vitest": "^3.2.4"
6161
}
6262
}

packages/plugin-react/src/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,14 @@ export default function viteReact(opts: Options = {}): Plugin[] {
245245
})()
246246
const plugins = [...babelOptions.plugins]
247247

248+
// remove react-compiler plugin on non client environment
249+
if (ssr) {
250+
const reactCompilerPlugin = getReactCompilerPlugin(plugins)
251+
if (reactCompilerPlugin) {
252+
plugins.splice(plugins.indexOf(reactCompilerPlugin), 1)
253+
}
254+
}
255+
248256
const isJSX = filepath.endsWith('x')
249257
const useFastRefresh =
250258
!skipFastRefresh &&

packages/plugin-rsc/CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
## <small>[0.4.19](https://github.com/vitejs/vite-plugin-react/compare/[email protected]@0.4.19) (2025-08-11)</small>
2+
### Bug Fixes
3+
4+
* **rsc:** fix cjs default import on module runner ([#695](https://github.com/vitejs/vite-plugin-react/issues/695)) ([c329914](https://github.com/vitejs/vite-plugin-react/commit/c329914c572473d4f09261fa0eba77484e720d2e))
5+
* **rsc:** replace `?v=` check with more robust `node_modules` detection ([#696](https://github.com/vitejs/vite-plugin-react/issues/696)) ([f0359c4](https://github.com/vitejs/vite-plugin-react/commit/f0359c4eca48ca6eb2ba98254a272949a13f149e))
6+
* **rsc:** replace non-optimized server cjs warning with debug only log ([#698](https://github.com/vitejs/vite-plugin-react/issues/698)) ([a88fb2d](https://github.com/vitejs/vite-plugin-react/commit/a88fb2ded4c8b9f42f2fee70a482615f331122f4))
7+
8+
## <small>[0.4.18](https://github.com/vitejs/vite-plugin-react/compare/[email protected]@0.4.18) (2025-08-11)</small>
9+
### Bug Fixes
10+
11+
* **deps:** update all non-major dependencies ([#694](https://github.com/vitejs/vite-plugin-react/issues/694)) ([5057858](https://github.com/vitejs/vite-plugin-react/commit/50578587472d23125980a46ff993fedaabca28d2))
12+
* **react:** always skip react-compiler on non client envrionment ([#689](https://github.com/vitejs/vite-plugin-react/issues/689)) ([2f62dc0](https://github.com/vitejs/vite-plugin-react/commit/2f62dc0778e8c527c7951d6e35b0658a07f1e6fc))
13+
* **rsc:** support cjs on module runner ([#687](https://github.com/vitejs/vite-plugin-react/issues/687)) ([7a92083](https://github.com/vitejs/vite-plugin-react/commit/7a92083eadb6ad8d92e6e560de414bc600e977c0))
14+
15+
### Miscellaneous Chores
16+
17+
* **rsc:** add .gitignore to create-vite example ([#686](https://github.com/vitejs/vite-plugin-react/issues/686)) ([6df7192](https://github.com/vitejs/vite-plugin-react/commit/6df71929ea5c2176408054bc40bcb8dfbb370018))
18+
* **rsc:** mention deploy example ([#685](https://github.com/vitejs/vite-plugin-react/issues/685)) ([dea484a](https://github.com/vitejs/vite-plugin-react/commit/dea484ab8c740babab89da0f716bb929e57ba2af))
19+
120
## <small>[0.4.17](https://github.com/vitejs/vite-plugin-react/compare/[email protected]@0.4.17) (2025-08-05)</small>
221
### Bug Fixes
322

packages/plugin-rsc/e2e/basic.test.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,20 @@ test.describe('dev-non-optimized-cjs', () => {
5858
)
5959
})
6060

61-
const f = useFixture({ root: 'examples/basic', mode: 'dev' })
61+
const f = useFixture({
62+
root: 'examples/basic',
63+
mode: 'dev',
64+
cliOptions: {
65+
env: {
66+
DEBUG: 'vite-rsc:cjs',
67+
},
68+
},
69+
})
6270

6371
test('show warning', async ({ page }) => {
6472
await page.goto(f.url())
65-
expect(f.proc().stderr()).toContain(
66-
`Found non-optimized CJS dependency in 'ssr' environment.`,
73+
expect(f.proc().stderr()).toMatch(
74+
/non-optimized CJS dependency in 'ssr' environment.*@vitejs\/test-dep-cjs\/index.js/,
6775
)
6876
})
6977
})

packages/plugin-rsc/e2e/react-compiler.test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,7 @@ test.describe(() => {
2222
2323
const overrideConfig = defineConfig({
2424
plugins: [
25-
react({
26-
babel: { plugins: ['babel-plugin-react-compiler'] },
27-
}).map((p) => ({
28-
...p,
29-
applyToEnvironment: (e) => e.name === 'client',
30-
})),
25+
react({ babel: { plugins: ['babel-plugin-react-compiler'] } }),
3126
rsc(),
3227
],
3328
})

packages/plugin-rsc/examples/basic/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"cf-release": "wrangler deploy"
1313
},
1414
"dependencies": {
15-
"@vitejs/plugin-rsc": "latest",
1615
"react": "^19.1.1",
1716
"react-dom": "^19.1.1"
1817
},
@@ -21,17 +20,18 @@
2120
"@types/react": "^19.1.9",
2221
"@types/react-dom": "^19.1.7",
2322
"@vitejs/plugin-react": "latest",
24-
"@vitejs/test-dep-transitive-cjs": "file:./test-dep/transitive-cjs",
25-
"@vitejs/test-dep-transitive-use-sync-external-store": "file:./test-dep/transitive-use-sync-external-store",
23+
"@vitejs/plugin-rsc": "latest",
2624
"@vitejs/test-dep-client-in-server": "file:./test-dep/client-in-server",
2725
"@vitejs/test-dep-client-in-server2": "file:./test-dep/client-in-server2",
26+
"@vitejs/test-dep-css-in-server": "file:./test-dep/css-in-server",
2827
"@vitejs/test-dep-server-in-client": "file:./test-dep/server-in-client",
2928
"@vitejs/test-dep-server-in-server": "file:./test-dep/server-in-server",
30-
"@vitejs/test-dep-css-in-server": "file:./test-dep/css-in-server",
29+
"@vitejs/test-dep-transitive-cjs": "file:./test-dep/transitive-cjs",
30+
"@vitejs/test-dep-transitive-use-sync-external-store": "file:./test-dep/transitive-use-sync-external-store",
3131
"rsc-html-stream": "^0.0.7",
3232
"tailwindcss": "^4.1.11",
33-
"vite": "^7.0.6",
33+
"vite": "^7.1.1",
3434
"vite-plugin-inspect": "^11.3.2",
35-
"wrangler": "^4.27.0"
35+
"wrangler": "^4.28.1"
3636
}
3737
}

0 commit comments

Comments
 (0)