Skip to content

Commit be819c8

Browse files
authored
Merge branch 'main' into 07-08-test_simplify_ts-lib_test
2 parents b5ea72a + b37d377 commit be819c8

File tree

4 files changed

+33
-17
lines changed

4 files changed

+33
-17
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 & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,6 @@ export default defineConfig({
3636
},
3737
],
3838
}),
39-
{
40-
name: 'react-router-fixup',
41-
transform(code) {
42-
if (code.includes(`import { AsyncLocalStorage } from 'async_hooks';`)) {
43-
code = code.replaceAll('async_hooks', 'node:async_hooks')
44-
code = code.replaceAll(
45-
`global.___reactRouterServerStorage___`,
46-
`globalThis.___reactRouterServerStorage___`,
47-
)
48-
return code
49-
}
50-
},
51-
},
5239
],
5340
environments: {
5441
client: {
@@ -61,12 +48,24 @@ export default defineConfig({
6148
include: ['react-router > cookie', 'react-router > set-cookie-parser'],
6249
exclude: ['react-router'],
6350
},
51+
build: {
52+
rollupOptions: {
53+
// @ts-ignore rolldown
54+
platform: 'neutral',
55+
},
56+
},
6457
},
6558
rsc: {
6659
optimizeDeps: {
6760
include: ['react-router > cookie', 'react-router > set-cookie-parser'],
6861
exclude: ['react-router'],
6962
},
63+
build: {
64+
rollupOptions: {
65+
// @ts-ignore rolldown
66+
platform: 'neutral',
67+
},
68+
},
7069
},
7170
},
7271
})

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+
})

packages/plugin-rsc/playwright.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default defineConfig({
2626
use: devices['Desktop Safari'],
2727
},
2828
],
29+
workers: 1,
2930
forbidOnly: !!process.env.CI,
3031
retries: process.env.CI ? 2 : 0,
3132
reporter: ['list', process.env.CI && 'github']

0 commit comments

Comments
 (0)