File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2301,6 +2301,13 @@ export default async function build(
23012301 hasEmptyPrelude,
23022302 } )
23032303
2304+ // update the page (eg /blog/[slug]) to also have the postpone metadata
2305+ pageInfos . set ( page , {
2306+ ...( pageInfos . get ( page ) as PageInfo ) ,
2307+ hasPostponed,
2308+ hasEmptyPrelude,
2309+ } )
2310+
23042311 if ( revalidate !== 0 ) {
23052312 const normalizedRoute = normalizePagePath ( route )
23062313
@@ -2386,6 +2393,9 @@ export default async function build(
23862393 pageInfos . set ( page , {
23872394 ...( pageInfos . get ( page ) as PageInfo ) ,
23882395 isDynamicAppRoute : true ,
2396+ // if PPR is turned on and the route contains a dynamic segment,
2397+ // we assume it'll be partially prerendered
2398+ hasPostponed : experimentalPPR ,
23892399 } )
23902400
23912401 // TODO: create a separate manifest to allow enforcing
Original file line number Diff line number Diff line change @@ -459,8 +459,13 @@ export async function printTreeView(
459459 } else if ( isEdgeRuntime ( pageInfo ?. runtime ) ) {
460460 symbol = 'ℇ'
461461 } else if ( pageInfo ?. isPPR ) {
462- // If the page has an empty prelude, then it's equivalent to a static page.
463- if ( pageInfo ?. hasEmptyPrelude || pageInfo . isDynamicAppRoute ) {
462+ if (
463+ // If the page has an empty prelude, then it's equivalent to a dynamic page
464+ pageInfo ?. hasEmptyPrelude ||
465+ // ensure we don't mark dynamic paths that postponed as being dynamic
466+ // since in this case we're able to partially prerender it
467+ ( pageInfo . isDynamicAppRoute && ! pageInfo . hasPostponed )
468+ ) {
464469 symbol = 'λ'
465470 } else if ( ! pageInfo ?. hasPostponed ) {
466471 symbol = '○'
Original file line number Diff line number Diff line change @@ -6,7 +6,17 @@ createNextDescribe(
66 files : __dirname ,
77 skipDeployment : true ,
88 } ,
9- ( { next, isNextDev } ) => {
9+ ( { next, isNextDev, isNextStart } ) => {
10+ if ( isNextStart ) {
11+ describe ( 'build output' , ( ) => {
12+ it ( 'correctly marks pages as being partially prerendered in the build output' , ( ) => {
13+ expect ( next . cliOutput ) . toContain ( '◐ /loading/nested/[slug]' )
14+ expect ( next . cliOutput ) . toContain ( '◐ /suspense/node' )
15+ expect ( next . cliOutput ) . toContain ( '◐ /suspense/node/gsp/[slug]' )
16+ expect ( next . cliOutput ) . toContain ( '◐ /suspense/node/nested/[slug]' )
17+ } )
18+ } )
19+ }
1020 describe . each ( [
1121 { pathname : '/suspense/node' } ,
1222 { pathname : '/suspense/node/nested/1' } ,
You can’t perform that action at this time.
0 commit comments