Skip to content

Commit 8e64657

Browse files
authored
build: update Vite to 8 while still supporting 7 as peer deps (#83)
1 parent aa771a5 commit 8e64657

File tree

8 files changed

+475
-366
lines changed

8 files changed

+475
-366
lines changed

.github/workflows/ci.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,70 @@ jobs:
7575
name: playwright-report-dev
7676
path: packages/static/playwright-report-dev/
7777
retention-days: 30
78+
79+
e2e-vite7:
80+
runs-on: ubuntu-latest
81+
needs: ci
82+
83+
steps:
84+
- uses: actions/checkout@v6
85+
86+
- name: Setup pnpm
87+
uses: pnpm/action-setup@v4
88+
89+
- name: Setup Node.js
90+
uses: actions/setup-node@v6
91+
with:
92+
node-version: "24"
93+
cache: "pnpm"
94+
95+
- name: Swap catalog to Vite 7
96+
run: |
97+
sed -i \
98+
-e 's|^\( "@vitejs/plugin-react":\).*|\1 ^5.1.4|' \
99+
-e 's|^\( vite:\).*|\1 ^7.3.1|' \
100+
pnpm-workspace.yaml
101+
grep -q '"@vitejs/plugin-react": \^5\.1\.4' pnpm-workspace.yaml
102+
grep -q 'vite: \^7\.3\.1' pnpm-workspace.yaml
103+
104+
- name: Install dependencies
105+
run: pnpm install --no-frozen-lockfile
106+
107+
- name: Build
108+
run: pnpm --filter @funstack/static build
109+
110+
- name: Cache Playwright browsers
111+
id: playwright-cache
112+
uses: actions/cache@v5
113+
with:
114+
path: ~/.cache/ms-playwright
115+
key: playwright-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
116+
117+
- name: Install Playwright system dependencies
118+
if: steps.playwright-cache.outputs.cache-hit != 'true'
119+
run: pnpm --filter @funstack/static exec playwright install-deps chromium
120+
121+
- name: Install Playwright browsers
122+
run: pnpm --filter @funstack/static exec playwright install chromium
123+
124+
- name: Run e2e tests (build)
125+
run: pnpm run test:e2e
126+
127+
- name: Run e2e tests (dev server)
128+
run: pnpm run test:e2e:dev
129+
130+
- name: Upload Playwright report (build, Vite 7)
131+
uses: actions/upload-artifact@v7
132+
if: ${{ !cancelled() }}
133+
with:
134+
name: playwright-report-build-vite7
135+
path: packages/static/playwright-report/
136+
retention-days: 30
137+
138+
- name: Upload Playwright report (dev server, Vite 7)
139+
uses: actions/upload-artifact@v7
140+
if: ${{ !cancelled() }}
141+
with:
142+
name: playwright-report-dev-vite7
143+
path: packages/static/playwright-report-dev/
144+
retention-days: 30

packages/static/e2e/fixture-multi-entry/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"@funstack/static": "workspace:*",
77
"@types/react": "^19.2.14",
88
"@types/react-dom": "^19.2.3",
9-
"@vitejs/plugin-react": "^5.1.4",
9+
"@vitejs/plugin-react": "catalog:",
1010
"react": "catalog:",
1111
"react-dom": "catalog:",
1212
"vite": "catalog:"

packages/static/e2e/fixture-ssr-defer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"@funstack/static": "workspace:*",
77
"@types/react": "^19.2.14",
88
"@types/react-dom": "^19.2.3",
9-
"@vitejs/plugin-react": "^5.1.4",
9+
"@vitejs/plugin-react": "catalog:",
1010
"react": "catalog:",
1111
"react-dom": "catalog:",
1212
"vite": "catalog:"

packages/static/e2e/fixture/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"@funstack/static": "workspace:*",
77
"@types/react": "^19.2.14",
88
"@types/react-dom": "^19.2.3",
9-
"@vitejs/plugin-react": "^5.1.4",
9+
"@vitejs/plugin-react": "catalog:",
1010
"react": "catalog:",
1111
"react-dom": "catalog:",
1212
"vite": "catalog:"

packages/static/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,6 @@
7878
"peerDependencies": {
7979
"react": "^19.2.3",
8080
"react-dom": "^19.2.3",
81-
"vite": "catalog:"
81+
"vite": "^7.0.0 || ^8.0.0"
8282
}
8383
}

packages/static/src/plugin/getRSCEntryPoint.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ import type { RunnableDevEnvironment } from "vite";
44
* Get the entry point module of the RSC environment.
55
*/
66
export async function getRSCEntryPoint(environment: RunnableDevEnvironment) {
7-
const rscInput = environment.config.build.rollupOptions?.input;
7+
// Vite 8 renamed rollupOptions to rolldownOptions; support both for Vite 7 compat
8+
const buildConfig = environment.config.build;
9+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Vite 7 compat
10+
const rscInput = (
11+
buildConfig.rolldownOptions ?? (buildConfig as any).rollupOptions
12+
)?.input;
813
const source =
914
rscInput !== undefined &&
1015
typeof rscInput !== "string" &&

0 commit comments

Comments
 (0)