@@ -7,6 +7,9 @@ const cacheComponentsEnabled =
7
7
8
8
const pprEnabled = process . env . __NEXT_EXPERIMENTAL_PPR === 'true'
9
9
10
+ const clientSegmentCacheEnabled =
11
+ process . env . __NEXT_EXPERIMENTAL_CLIENT_SEGMENT_CACHE === 'true'
12
+
10
13
const isRspack = ! ! process . env . NEXT_RSPACK
11
14
12
15
describe ( 'build-output-prerender' , ( ) => {
@@ -68,6 +71,28 @@ describe('build-output-prerender', () => {
68
71
✓ rdcForNavigations (enabled by \`__NEXT_EXPERIMENTAL_PPR\`)"
69
72
` )
70
73
}
74
+ } else if ( clientSegmentCacheEnabled ) {
75
+ if ( isTurbopack ) {
76
+ expect ( getPreambleOutput ( next . cliOutput ) ) . toMatchInlineSnapshot ( `
77
+ "▲ Next.js x.y.z (Turbopack)
78
+ - Experiments (use with caution):
79
+ ✓ cacheComponents
80
+ ✓ clientSegmentCache (enabled by \`__NEXT_EXPERIMENTAL_CLIENT_SEGMENT_CACHE\`)
81
+ ✓ enablePrerenderSourceMaps (enabled by \`experimental.cacheComponents\`)
82
+ ✓ ppr (enabled by \`experimental.cacheComponents\`)
83
+ ✓ rdcForNavigations (enabled by \`experimental.ppr\`)"
84
+ ` )
85
+ } else {
86
+ expect ( getPreambleOutput ( next . cliOutput ) ) . toMatchInlineSnapshot ( `
87
+ "▲ Next.js x.y.z (webpack)
88
+ - Experiments (use with caution):
89
+ ✓ cacheComponents
90
+ ✓ clientSegmentCache (enabled by \`__NEXT_EXPERIMENTAL_CLIENT_SEGMENT_CACHE\`)
91
+ ✓ enablePrerenderSourceMaps (enabled by \`experimental.cacheComponents\`)
92
+ ✓ ppr (enabled by \`experimental.cacheComponents\`)
93
+ ✓ rdcForNavigations (enabled by \`experimental.ppr\`)"
94
+ ` )
95
+ }
71
96
} else {
72
97
if ( isTurbopack ) {
73
98
expect ( getPreambleOutput ( next . cliOutput ) ) . toMatchInlineSnapshot ( `
@@ -206,6 +231,36 @@ describe('build-output-prerender', () => {
206
231
✓ serverSourceMaps (enabled by \`--debug-prerender\`)"
207
232
` )
208
233
}
234
+ } else if ( clientSegmentCacheEnabled ) {
235
+ if ( isTurbopack ) {
236
+ expect ( getPreambleOutput ( next . cliOutput ) ) . toMatchInlineSnapshot ( `
237
+ "⚠ Prerendering is running in debug mode. Note: This may affect performance and should not be used for production.
238
+ ▲ Next.js x.y.z (Turbopack)
239
+ - Experiments (use with caution):
240
+ ✓ cacheComponents
241
+ ✓ clientSegmentCache (enabled by \`__NEXT_EXPERIMENTAL_CLIENT_SEGMENT_CACHE\`)
242
+ ✓ enablePrerenderSourceMaps (enabled by \`--debug-prerender\`)
243
+ ✓ ppr (enabled by \`experimental.cacheComponents\`)
244
+ ⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`)
245
+ ✓ rdcForNavigations (enabled by \`experimental.ppr\`)
246
+ ✓ serverSourceMaps (enabled by \`--debug-prerender\`)
247
+ ⨯ turbopackMinify (disabled by \`--debug-prerender\`)"
248
+ ` )
249
+ } else {
250
+ expect ( getPreambleOutput ( next . cliOutput ) ) . toMatchInlineSnapshot ( `
251
+ "⚠ Prerendering is running in debug mode. Note: This may affect performance and should not be used for production.
252
+ ▲ Next.js x.y.z (webpack)
253
+ - Experiments (use with caution):
254
+ ✓ cacheComponents
255
+ ✓ clientSegmentCache (enabled by \`__NEXT_EXPERIMENTAL_CLIENT_SEGMENT_CACHE\`)
256
+ ✓ enablePrerenderSourceMaps (enabled by \`--debug-prerender\`)
257
+ ✓ ppr (enabled by \`experimental.cacheComponents\`)
258
+ ⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`)
259
+ ✓ rdcForNavigations (enabled by \`experimental.ppr\`)
260
+ ⨯ serverMinification (disabled by \`--debug-prerender\`)
261
+ ✓ serverSourceMaps (enabled by \`--debug-prerender\`)"
262
+ ` )
263
+ }
209
264
} else {
210
265
if ( isTurbopack ) {
211
266
expect ( getPreambleOutput ( next . cliOutput ) ) . toMatchInlineSnapshot ( `
@@ -335,6 +390,20 @@ describe('build-output-prerender', () => {
335
390
✓ rdcForNavigations (enabled by \`__NEXT_EXPERIMENTAL_PPR\`)"
336
391
` )
337
392
}
393
+ } else if ( clientSegmentCacheEnabled ) {
394
+ if ( isTurbopack ) {
395
+ expect ( getPreambleOutput ( next . cliOutput ) ) . toMatchInlineSnapshot ( `
396
+ "▲ Next.js x.y.z (Turbopack)
397
+ - Experiments (use with caution):
398
+ ✓ clientSegmentCache (enabled by \`__NEXT_EXPERIMENTAL_CLIENT_SEGMENT_CACHE\`)"
399
+ ` )
400
+ } else {
401
+ expect ( getPreambleOutput ( next . cliOutput ) ) . toMatchInlineSnapshot ( `
402
+ "▲ Next.js x.y.z (webpack)
403
+ - Experiments (use with caution):
404
+ ✓ clientSegmentCache (enabled by \`__NEXT_EXPERIMENTAL_CLIENT_SEGMENT_CACHE\`)"
405
+ ` )
406
+ }
338
407
} else {
339
408
if ( isTurbopack ) {
340
409
expect ( getPreambleOutput ( next . cliOutput ) ) . toMatchInlineSnapshot (
@@ -425,6 +494,30 @@ describe('build-output-prerender', () => {
425
494
✓ serverSourceMaps (enabled by \`--debug-prerender\`)"
426
495
` )
427
496
}
497
+ } else if ( clientSegmentCacheEnabled ) {
498
+ if ( isTurbopack ) {
499
+ expect ( getPreambleOutput ( next . cliOutput ) ) . toMatchInlineSnapshot ( `
500
+ "⚠ Prerendering is running in debug mode. Note: This may affect performance and should not be used for production.
501
+ ▲ Next.js x.y.z (Turbopack)
502
+ - Experiments (use with caution):
503
+ ✓ clientSegmentCache (enabled by \`__NEXT_EXPERIMENTAL_CLIENT_SEGMENT_CACHE\`)
504
+ ✓ enablePrerenderSourceMaps (enabled by \`--debug-prerender\`)
505
+ ⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`)
506
+ ✓ serverSourceMaps (enabled by \`--debug-prerender\`)
507
+ ⨯ turbopackMinify (disabled by \`--debug-prerender\`)"
508
+ ` )
509
+ } else {
510
+ expect ( getPreambleOutput ( next . cliOutput ) ) . toMatchInlineSnapshot ( `
511
+ "⚠ Prerendering is running in debug mode. Note: This may affect performance and should not be used for production.
512
+ ▲ Next.js x.y.z (webpack)
513
+ - Experiments (use with caution):
514
+ ✓ clientSegmentCache (enabled by \`__NEXT_EXPERIMENTAL_CLIENT_SEGMENT_CACHE\`)
515
+ ✓ enablePrerenderSourceMaps (enabled by \`--debug-prerender\`)
516
+ ⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`)
517
+ ⨯ serverMinification (disabled by \`--debug-prerender\`)
518
+ ✓ serverSourceMaps (enabled by \`--debug-prerender\`)"
519
+ ` )
520
+ }
428
521
} else {
429
522
if ( isTurbopack ) {
430
523
expect ( getPreambleOutput ( next . cliOutput ) ) . toMatchInlineSnapshot ( `
0 commit comments