Skip to content

Commit b37d377

Browse files
authored
test(rsc): fix tests on rolldown-vite (#549)
1 parent 8c3929c commit b37d377

File tree

3 files changed

+32
-4
lines changed

3 files changed

+32
-4
lines changed

.github/workflows/ci-rsc.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,21 @@ jobs:
3131
- run: pnpm -C packages/plugin-rsc test
3232

3333
test-e2e:
34-
name: test-rsc (${{ matrix.os }} / ${{ matrix.browser }})
34+
name: test-rsc (${{ matrix.os }} / ${{ matrix.browser }}) ${{ matrix.rolldown == true && '(rolldown)' || '' }}
3535
runs-on: ${{ matrix.os }}
3636
strategy:
37-
# TODO: shard?
3837
matrix:
3938
os: [ubuntu-latest, macos-latest, windows-latest]
4039
browser: [chromium]
40+
rolldown: [false]
4141
include:
4242
- os: ubuntu-latest
4343
browser: firefox
4444
- os: macos-latest
4545
browser: webkit
46+
- os: ubuntu-latest
47+
browser: chromium
48+
rolldown: true
4649
fail-fast: false
4750
steps:
4851
- uses: actions/checkout@v4
@@ -52,6 +55,11 @@ jobs:
5255
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
5356
- run: pnpm i
5457
- run: pnpm build
58+
- name: install rolldown
59+
if: ${{ matrix.rolldown }}
60+
run: |
61+
echo 'overrides: { vite: "npm:rolldown-vite@latest" }' >> pnpm-workspace.yaml
62+
pnpm i --no-frozen-lockfile
5563
- run: pnpm -C packages/plugin-rsc exec playwright install ${{ matrix.browser }}
5664
- run: pnpm -C packages/plugin-rsc test-e2e-ci --project=${{ matrix.browser }}
5765
env:

packages/plugin-rsc/examples/react-router/cf/vite.config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,24 @@ export default defineConfig({
4848
include: ['react-router > cookie', 'react-router > set-cookie-parser'],
4949
exclude: ['react-router'],
5050
},
51+
build: {
52+
rollupOptions: {
53+
// @ts-ignore rolldown
54+
platform: 'neutral',
55+
},
56+
},
5157
},
5258
rsc: {
5359
optimizeDeps: {
5460
include: ['react-router > cookie', 'react-router > set-cookie-parser'],
5561
exclude: ['react-router'],
5662
},
63+
build: {
64+
rollupOptions: {
65+
// @ts-ignore rolldown
66+
platform: 'neutral',
67+
},
68+
},
5769
},
5870
},
5971
})

packages/plugin-rsc/examples/starter-cf-single/vite.config.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import rsc from '@vitejs/plugin-rsc'
33
import react from '@vitejs/plugin-react'
44
import { defineConfig } from 'vite'
55

6-
export default defineConfig((_env) => ({
6+
export default defineConfig({
77
clearScreen: false,
88
build: {
99
minify: false,
@@ -31,6 +31,14 @@ export default defineConfig((_env) => ({
3131
rollupOptions: {
3232
// ensure `default` export only in cloudflare entry output
3333
preserveEntrySignatures: 'exports-only',
34+
// @ts-ignore rolldown
35+
platform: 'neutral',
36+
},
37+
},
38+
optimizeDeps: {
39+
// @ts-ignore rolldown
40+
rollupOptions: {
41+
platform: 'neutral',
3442
},
3543
},
3644
},
@@ -43,4 +51,4 @@ export default defineConfig((_env) => ({
4351
},
4452
},
4553
},
46-
}))
54+
})

0 commit comments

Comments
 (0)