Skip to content

Commit 65dfa6c

Browse files
sapphi-redhi-ogawa
andauthored
refactor(react)!: drop Vite 7 and below support (#1124)
Co-authored-by: Hiroshi Ogawa <hi.ogawa.zz@gmail.com>
1 parent db9221f commit 65dfa6c

File tree

18 files changed

+461
-244
lines changed

18 files changed

+461
-244
lines changed

.github/workflows/ci-rsc.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ jobs:
3535
- run: pnpm -C packages/plugin-rsc test
3636

3737
test-e2e:
38-
name: test-rsc (${{ matrix.os }} / ${{ matrix.browser }}) ${{ matrix.rolldown == true && '(rolldown)' || '' }} ${{ matrix.react_version && format('(react-{0})', matrix.react_version) || '' }}
38+
name: test-rsc (${{ matrix.os }} / ${{ matrix.browser }}) ${{ matrix.vite && format('(vite-{0})', matrix.vite) || '' }} ${{ matrix.react_version && format('(react-{0})', matrix.react_version) || '' }}
3939
runs-on: ${{ matrix.os }}
4040
strategy:
4141
matrix:
4242
os: [ubuntu-latest, macos-latest, windows-latest]
4343
browser: [chromium]
44-
rolldown: [false]
44+
vite: ['']
4545
react_version: ['']
4646
include:
4747
- os: ubuntu-latest
@@ -50,7 +50,7 @@ jobs:
5050
browser: webkit
5151
- os: ubuntu-latest
5252
browser: chromium
53-
rolldown: true
53+
vite: 7
5454
- os: ubuntu-latest
5555
browser: chromium
5656
react_version: canary
@@ -75,10 +75,12 @@ jobs:
7575
env:
7676
REACT_VERSION: ${{ matrix.react_version }}
7777
- run: pnpm build
78-
- name: install rolldown
79-
if: ${{ matrix.rolldown }}
78+
- name: install vite ${{ matrix.vite }}
79+
if: ${{ matrix.vite }}
8080
run: |
81-
yq -i '.overrides.vite = "beta"' pnpm-workspace.yaml
81+
yq -i '.overrides.vite = "^${{ matrix.vite }}"' pnpm-workspace.yaml
82+
yq -i '.overrides."@vitejs/plugin-react" = "^5"' pnpm-workspace.yaml
83+
yq -i '.packages += ["!packages/plugin-react"]' pnpm-workspace.yaml
8284
pnpm i --no-frozen-lockfile
8385
- run: pnpm -C packages/plugin-rsc exec playwright install "$BROWSER_NAME"
8486
shell: bash
@@ -91,7 +93,7 @@ jobs:
9193
- uses: actions/upload-artifact@v6
9294
if: always()
9395
with:
94-
name: test-results-${{ matrix.os }}-${{ matrix.browser }}${{ matrix.rolldown == true && '-rolldown' || '' }}${{ matrix.react_version && format('-react-{0}', matrix.react_version) || '' }}
96+
name: test-results-${{ matrix.os }}-${{ matrix.browser }}${{ matrix.vite && format('-vite-{0}', matrix.vite) || '' }}${{ matrix.react_version && format('-react-{0}', matrix.react_version) || '' }}
9597
path: |
9698
packages/plugin-rsc/test-results
9799
if-no-files-found: ignore

.github/workflows/ci.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,6 @@ jobs:
9292
- name: Test SWC
9393
run: pnpm --filter ./packages/plugin-react-swc run test
9494

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

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"build": "pnpm -r --filter='./packages/*' run build",
2727
"dev": "pnpm -r --parallel --filter='./packages/*' run dev",
2828
"release": "node scripts/release.ts",
29-
"ci-publish": "node scripts/publishCI.ts"
29+
"ci-publish": "node scripts/publishCI.ts",
30+
"override-vite7": "yq -i '.overrides.vite = \"^7\"' pnpm-workspace.yaml && yq -i '.overrides.\"@vitejs/plugin-react\" = \"^5\"' pnpm-workspace.yaml && yq -i '.packages += [\"!packages/plugin-react\"]' pnpm-workspace.yaml"
3031
},
3132
"devDependencies": {
3233
"@eslint/js": "^9.39.3",
@@ -46,7 +47,7 @@
4647
"simple-git-hooks": "^2.13.1",
4748
"typescript": "^5.9.3",
4849
"typescript-eslint": "^8.56.0",
49-
"vite": "^7.3.1",
50+
"vite": "^8.0.0-beta.16",
5051
"vite-plugin-inspect": "^11.3.3",
5152
"vitest": "^4.0.18"
5253
},

packages/common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
"@rolldown/pluginutils": "1.0.0-rc.5"
1212
},
1313
"peerDependencies": {
14-
"vite": "^4.2.0 || ^5.0.0 || ^6.0.0"
14+
"vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"
1515
}
1616
}

packages/plugin-react/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,19 @@
4545
"@babel/plugin-transform-react-jsx-self": "^7.27.1",
4646
"@babel/plugin-transform-react-jsx-source": "^7.27.1",
4747
"@rolldown/pluginutils": "1.0.0-rc.5",
48-
"@types/babel__core": "^7.20.5",
49-
"react-refresh": "^0.18.0"
48+
"@types/babel__core": "^7.20.5"
5049
},
5150
"devDependencies": {
5251
"@vitejs/react-common": "workspace:*",
5352
"babel-plugin-react-compiler": "19.1.0-rc.3",
5453
"react": "^19.2.4",
5554
"react-dom": "^19.2.4",
5655
"rolldown": "1.0.0-rc.5",
57-
"tsdown": "^0.20.3"
56+
"tsdown": "^0.20.3",
57+
"vite": "^8.0.0-beta.16"
5858
},
5959
"peerDependencies": {
60-
"vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0"
60+
"vite": "^8.0.0"
6161
},
6262
"engines": {
6363
"node": "^20.19.0 || >=22.12.0"
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
declare module '@babel/plugin-transform-react-jsx-self'
22
declare module '@babel/plugin-transform-react-jsx-source'
3-
declare module 'react-refresh/babel.js'

0 commit comments

Comments
 (0)