Skip to content

Commit 7f5c462

Browse files
authored
Merge branch 'main' into navigation-vite
2 parents 1961d19 + aa95627 commit 7f5c462

File tree

127 files changed

+4307
-3200
lines changed

Some content is hidden

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

127 files changed

+4307
-3200
lines changed

.github/workflows/ci-rsc.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: ci-rsc
33
permissions: {}
44

55
on:
6+
workflow_dispatch:
67
push:
78
branches:
89
- main
@@ -31,13 +32,14 @@ jobs:
3132
- run: pnpm -C packages/plugin-rsc test
3233

3334
test-e2e:
34-
name: test-rsc (${{ matrix.os }} / ${{ matrix.browser }}) ${{ matrix.rolldown == true && '(rolldown)' || '' }}
35+
name: test-rsc (${{ matrix.os }} / ${{ matrix.browser }}) ${{ matrix.rolldown == true && '(rolldown)' || '' }} ${{ matrix.react_version && format('(react-{0})', matrix.react_version) || '' }}
3536
runs-on: ${{ matrix.os }}
3637
strategy:
3738
matrix:
3839
os: [ubuntu-latest, macos-latest, windows-latest]
3940
browser: [chromium]
4041
rolldown: [false]
42+
react_version: [""]
4143
include:
4244
- os: ubuntu-latest
4345
browser: firefox
@@ -46,6 +48,12 @@ jobs:
4648
- os: ubuntu-latest
4749
browser: chromium
4850
rolldown: true
51+
- os: ubuntu-latest
52+
browser: chromium
53+
react_version: canary
54+
- os: ubuntu-latest
55+
browser: chromium
56+
react_version: experimental
4957
fail-fast: false
5058
steps:
5159
- uses: actions/checkout@v4
@@ -54,6 +62,13 @@ jobs:
5462
node-version: 22
5563
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
5664
- run: pnpm i
65+
- name: install react
66+
if: ${{ matrix.react_version }}
67+
run: |
68+
sed -i "/^overrides:/a\ react: \"${{ matrix.react_version }}\"" pnpm-workspace.yaml
69+
sed -i "/^overrides:/a\ react-dom: \"${{ matrix.react_version }}\"" pnpm-workspace.yaml
70+
sed -i "/^overrides:/a\ react-server-dom-webpack: \"${{ matrix.react_version }}\"" pnpm-workspace.yaml
71+
pnpm i --no-frozen-lockfile
5772
- run: pnpm build
5873
- name: install rolldown
5974
if: ${{ matrix.rolldown }}
@@ -62,11 +77,9 @@ jobs:
6277
pnpm i --no-frozen-lockfile
6378
- run: pnpm -C packages/plugin-rsc exec playwright install ${{ matrix.browser }}
6479
- run: pnpm -C packages/plugin-rsc test-e2e-ci --project=${{ matrix.browser }}
65-
env:
66-
TEST_ISOLATED: true
6780
- uses: actions/upload-artifact@v4
6881
if: always()
6982
with:
70-
name: test-results-${{ matrix.os }}-${{ matrix.browser }}${{ matrix.rolldown == true && '-rolldown' || '' }}
83+
name: test-results-${{ matrix.os }}-${{ matrix.browser }}${{ matrix.rolldown == true && '-rolldown' || '' }}${{ matrix.react_version && format('-react-{0}', matrix.react_version) || '' }}
7184
path: |
7285
packages/plugin-rsc/test-results

.github/workflows/ci.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
strategy:
3030
matrix:
3131
os: [ubuntu-latest]
32-
node_version: [18, 20, 22, 24]
32+
node_version: [20, 22, 24]
3333
include:
3434
# Active LTS + other OS
3535
- os: macos-latest
@@ -81,9 +81,6 @@ jobs:
8181
# does not need to explicitly set chromium after https://github.com/microsoft/playwright/issues/14862 is solved
8282
run: pnpm playwright install chromium
8383

84-
- if: matrix.node_version == '18'
85-
run: pnpm i -D [email protected] -w
86-
8784
- name: Build
8885
run: pnpm run build
8986

@@ -96,6 +93,17 @@ jobs:
9693
- name: Test SWC
9794
run: pnpm --filter ./packages/plugin-react-swc run test
9895

96+
- name: Setup rolldown-vite
97+
run: |
98+
sed -i"" -e "s/overrides:/overrides:\n vite: catalog:rolldown-vite/" pnpm-workspace.yaml
99+
pnpm i --no-frozen-lockfile
100+
101+
- name: Test serve (rolldown-vite)
102+
run: pnpm run test-serve
103+
104+
- name: Test build (rolldown-vite)
105+
run: pnpm run test-build
106+
99107
lint:
100108
if: github.repository == 'vitejs/vite-plugin-react'
101109
timeout-minutes: 10

.github/workflows/issue-close-require.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
pull-requests: write # for actions-cool/issues-helper to update PRs
1414
steps:
1515
- name: need reproduction
16-
uses: actions-cool/issues-helper@a610082f8ac0cf03e357eb8dd0d5e2ba075e017e # v3
16+
uses: actions-cool/issues-helper@50068f49b7b2b3857270ead65e2d02e4459b022c # v3
1717
with:
1818
actions: "close-issues"
1919
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/issue-labeled.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
steps:
1515
- name: contribution welcome
1616
if: github.event.label.name == 'contribution welcome' || github.event.label.name == 'help wanted'
17-
uses: actions-cool/issues-helper@a610082f8ac0cf03e357eb8dd0d5e2ba075e017e # v3
17+
uses: actions-cool/issues-helper@50068f49b7b2b3857270ead65e2d02e4459b022c # v3
1818
with:
1919
actions: "create-comment, remove-labels"
2020
token: ${{ secrets.GITHUB_TOKEN }}
@@ -25,7 +25,7 @@ jobs:
2525

2626
- name: remove pending
2727
if: (github.event.label.name == 'enhancement' || contains(github.event.label.description, '(priority)')) && contains(github.event.issue.labels.*.name, 'pending triage')
28-
uses: actions-cool/issues-helper@a610082f8ac0cf03e357eb8dd0d5e2ba075e017e # v3
28+
uses: actions-cool/issues-helper@50068f49b7b2b3857270ead65e2d02e4459b022c # v3
2929
with:
3030
actions: "remove-labels"
3131
token: ${{ secrets.GITHUB_TOKEN }}
@@ -34,7 +34,7 @@ jobs:
3434

3535
- name: need reproduction
3636
if: github.event.label.name == 'need reproduction'
37-
uses: actions-cool/issues-helper@a610082f8ac0cf03e357eb8dd0d5e2ba075e017e # v3
37+
uses: actions-cool/issues-helper@50068f49b7b2b3857270ead65e2d02e4459b022c # v3
3838
with:
3939
actions: "create-comment, remove-labels"
4040
token: ${{ secrets.GITHUB_TOKEN }}

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,7 @@ Some errors are masked and hidden away because of the layers of abstraction and
132132
In many test cases, we need to mock dependencies using `link:` and `file:` protocols. `pnpm` treats `link:` as symlinks and `file:` as hardlinks. To test dependencies as if they were copied into `node_modules`, use the `file:` protocol. Otherwise, use the `link:` protocol.
133133

134134
For a mock dependency, make sure you add a `@vitejs/test-` prefix to the package name. This will avoid possible issues like false-positive alerts.
135+
136+
## Contributing to `@vitejs/plugin-rsc`
137+
138+
See [CONTRIBUTING.md](packages/plugin-rsc/CONTRIBUTING.md) in the `@vitejs/plugin-rsc` package for specific guidelines on contributing to the React Server Components plugin.

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"private": true,
44
"type": "module",
55
"engines": {
6-
"node": "^14.18.0 || >=16.0.0"
6+
"node": "^20.19.0 || >=22.12.0"
77
},
88
"packageManager": "[email protected]",
99
"homepage": "https://github.com/vitejs/vite-plugin-react/",
@@ -33,13 +33,13 @@
3333
"ci-publish": "tsx scripts/publishCI.ts"
3434
},
3535
"devDependencies": {
36-
"@eslint/js": "^9.31.0",
36+
"@eslint/js": "^9.32.0",
3737
"@types/fs-extra": "^11.0.4",
38-
"@types/node": "^22.16.3",
38+
"@types/node": "^22.16.5",
3939
"@vitejs/release-scripts": "^1.6.0",
40-
"eslint": "^9.31.0",
40+
"eslint": "^9.32.0",
4141
"eslint-plugin-import-x": "^4.16.1",
42-
"eslint-plugin-n": "^17.21.0",
42+
"eslint-plugin-n": "^17.21.2",
4343
"eslint-plugin-regexp": "^2.9.0",
4444
"fs-extra": "^11.3.0",
4545
"globals": "^16.3.0",
@@ -50,8 +50,8 @@
5050
"simple-git-hooks": "^2.13.0",
5151
"tsx": "^4.20.3",
5252
"typescript": "^5.8.3",
53-
"typescript-eslint": "^8.37.0",
54-
"vite": "^7.0.4",
53+
"typescript-eslint": "^8.38.0",
54+
"vite": "^7.0.6",
5555
"vitest": "^3.2.4"
5656
},
5757
"simple-git-hooks": {

packages/plugin-react-oxc/CHANGELOG.md

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

33
## Unreleased
44

5+
## 0.4.0-beta.0 (2025-07-28)
6+
7+
### Deprecate this plugin
8+
9+
The changes of this plugin is now included in `@vitejs/plugin-react`. Please use `@vitejs/plugin-react` instead.
10+
11+
### Allow processing files in `node_modules`
12+
13+
The default value of `exclude` options is now `[/\/node_modules\//]` to allow processing files in `node_modules` directory. It was previously `[]` and files in `node_modules` was always excluded regardless of the value of `exclude` option.
14+
15+
### Require Node 20.19+, 22.12+
16+
17+
This plugin now requires Node 20.19+ or 22.12+.
18+
519
## 0.3.0 (2025-07-18)
620

721
### Add HMR support for compound components ([#518](https://github.com/vitejs/vite-plugin-react/pull/518))

packages/plugin-react-oxc/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default defineConfig({
2525

2626
### include/exclude
2727

28-
Includes `.js`, `.jsx`, `.ts` & `.tsx` by default. This option can be used to add fast refresh to `.mdx` files:
28+
Includes `.js`, `.jsx`, `.ts` & `.tsx` and excludes `/node_modules/` by default. This option can be used to add fast refresh to `.mdx` files:
2929

3030
```js
3131
import { defineConfig } from 'vite'
@@ -40,8 +40,6 @@ export default defineConfig({
4040
})
4141
```
4242

43-
> `node_modules` are never processed by this plugin (but Oxc will)
44-
4543
### jsxImportSource
4644

4745
Control where the JSX factory is imported from. Default to `'react'`

packages/plugin-react-oxc/package.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vitejs/plugin-react-oxc",
3-
"version": "0.3.0",
3+
"version": "0.4.0-beta.0",
44
"license": "MIT",
55
"author": "Evan You",
66
"contributors": [
@@ -20,15 +20,14 @@
2020
"dist"
2121
],
2222
"type": "module",
23-
"types": "./dist/index.d.ts",
2423
"exports": "./dist/index.js",
2524
"scripts": {
2625
"dev": "tsdown --watch",
2726
"build": "tsdown",
2827
"prepublishOnly": "npm run build"
2928
},
3029
"engines": {
31-
"node": ">=20.0.0"
30+
"node": "^20.19.0 || >=22.12.0"
3231
},
3332
"repository": {
3433
"type": "git",
@@ -44,11 +43,10 @@
4443
},
4544
"devDependencies": {
4645
"@vitejs/react-common": "workspace:*",
47-
"tsdown": "^0.12.9",
48-
"unbuild": "^3.5.0",
46+
"tsdown": "^0.13.0",
4947
"vite": "catalog:rolldown-vite"
5048
},
5149
"dependencies": {
52-
"@rolldown/pluginutils": "1.0.0-beta.27"
50+
"@rolldown/pluginutils": "1.0.0-beta.29"
5351
}
5452
}

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,11 @@ export interface Options {
2525
}
2626

2727
const defaultIncludeRE = /\.[tj]sx?(?:$|\?)/
28+
const defaultExcludeRE = /\/node_modules\//
2829

2930
export default function viteReact(opts: Options = {}): Plugin[] {
3031
const include = opts.include ?? defaultIncludeRE
31-
const exclude = [
32-
...(Array.isArray(opts.exclude)
33-
? opts.exclude
34-
: opts.exclude
35-
? [opts.exclude]
36-
: []),
37-
/\/node_modules\//,
38-
]
32+
const exclude = opts.exclude ?? defaultExcludeRE
3933

4034
const jsxImportSource = opts.jsxImportSource ?? 'react'
4135
const jsxImportRuntime = `${jsxImportSource}/jsx-runtime`
@@ -68,6 +62,13 @@ export default function viteReact(opts: Options = {}): Plugin[] {
6862
},
6963
}
7064
},
65+
configResolved(config) {
66+
config.logger.warn(
67+
'@vitejs/plugin-react-oxc is deprecated. ' +
68+
'Please use @vitejs/plugin-react instead. ' +
69+
'The changes of this plugin is now included in @vitejs/plugin-react.',
70+
)
71+
},
7172
options() {
7273
if (!this.meta.rolldownVersion) {
7374
throw new Error(

0 commit comments

Comments
 (0)