Skip to content

Commit be90696

Browse files
committed
test: wip
1 parent 61b655f commit be90696

File tree

6 files changed

+48
-2
lines changed

6 files changed

+48
-2
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use client'
2+
3+
export function TestClientChunk1() {
4+
return <span>test-chunk1</span>
5+
}
6+
7+
export function TestClientChunkConflict() {
8+
return <span>test-chunk-conflict1</span>
9+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
'use client'
2+
3+
export function TestClientChunk2() {
4+
return <span>test-chunk2</span>
5+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use client'
2+
3+
export function TestClientChunk3() {
4+
return <span>test-chunk3</span>
5+
}
6+
7+
export function TestClientChunkConflict() {
8+
return <span>test-chunk-conflict3</span>
9+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import {
2+
TestClientChunk1,
3+
TestClientChunkConflict as TestClientChunkConflict1,
4+
} from './client1'
5+
import { TestClientChunk2 } from './client2'
6+
import {
7+
TestClientChunk3,
8+
TestClientChunkConflict as TestClientChunkConflict3,
9+
} from './client3'
10+
11+
export function TestClientChunkServer() {
12+
return (
13+
<div data-testid="test-client-chunk">
14+
<TestClientChunk1 />|
15+
<TestClientChunkConflict1 />|
16+
<TestClientChunk2 />|
17+
<TestClientChunk3 />|
18+
<TestClientChunkConflict3 />
19+
</div>
20+
)
21+
}

packages/plugin-rsc/examples/basic/src/routes/root.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import { TestAssetsServer } from './assets/server'
4141
import { TestHmrSwitchServer } from './hmr-switch/server'
4242
import { TestHmrSwitchClient } from './hmr-switch/client'
4343
import { TestTreeShakeServer } from './tree-shake/server'
44+
import { TestClientChunkServer } from './chunk/server'
4445

4546
export function Root(props: { url: URL }) {
4647
return (
@@ -95,6 +96,7 @@ export function Root(props: { url: URL }) {
9596
<TestImportMetaGlob />
9697
<TestAssetsServer />
9798
<TestTreeShakeServer />
99+
<TestClientChunkServer />
98100
</body>
99101
</html>
100102
)

packages/plugin-rsc/examples/basic/vite.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ export default defineConfig({
3131
copyServerAssetsToClient: (fileName) =>
3232
fileName !== '__server_secret.txt',
3333
clientChunks(id) {
34-
if (id.includes('/src/routes/deps/')) {
35-
return 'group'
34+
if (id.includes('/src/routes/chunk/')) {
35+
return 'custom-chunk'
3636
}
3737
},
3838
}),

0 commit comments

Comments
 (0)