Unverified Commit da1ec0dd authored by Zack Tanner's avatar Zack Tanner Committed by GitHub

[build info]: omit symbol from top level gSP route (#92525)

When a route with params specifies `generateStaticParams`, the meaningful outputs are the sub-paths contained within. The top level route just corresponds with the file path, which isn't representative of a static or partially prerendered output. Previously it'd just inherit one of the sub-path values (ie if one path was PPRed, it'd show PPR, even if some were fully static).

This removes the symbol from those types of outputs, since #92518 moved those symbols to be within the subpaths. 

For truly dynamic param cases (ie, no subpaths), the rendering symbol will still appear.
parent b5da7b7f
...@@ -376,6 +376,7 @@ export async function printTreeView( ...@@ -376,6 +376,7 @@ export async function printTreeView(
(pageInfo?.ssgPageDurations?.reduce((a, b) => a + (b || 0), 0) || 0) (pageInfo?.ssgPageDurations?.reduce((a, b) => a + (b || 0), 0) || 0)
const symbol = getTreeViewSymbol(item, pageInfo) const symbol = getTreeViewSymbol(item, pageInfo)
const hasChildRoutes = Boolean(pageInfo?.ssgPageRoutes?.length)
const displayPath = getTreeViewDisplayPath(item) const displayPath = getTreeViewDisplayPath(item)
...@@ -396,10 +397,14 @@ export async function printTreeView( ...@@ -396,10 +397,14 @@ export async function printTreeView(
]) ])
} }
// Grouped rows act as headers for the generated outputs below them. The
// child rows carry the concrete route symbols instead.
if (!hasChildRoutes) {
usedSymbols.add(symbol) usedSymbols.add(symbol)
}
messages.push([ messages.push([
`${border} ${symbol} ${displayPath}${ `${border} ${hasChildRoutes ? ' ' : symbol} ${displayPath}${
totalDuration > MIN_DURATION totalDuration > MIN_DURATION
? ` (${getPrettyDuration(totalDuration)})` ? ` (${getPrettyDuration(totalDuration)})`
: '' : ''
...@@ -465,6 +470,7 @@ export async function printTreeView( ...@@ -465,6 +470,7 @@ export async function printTreeView(
// parent route pattern, so prefer the child entry when present. // parent route pattern, so prefer the child entry when present.
const routePageInfo = pageInfos.get(route) ?? pageInfo const routePageInfo = pageInfos.get(route) ?? pageInfo
const routeSymbol = getTreeViewSymbol(route, routePageInfo) const routeSymbol = getTreeViewSymbol(route, routePageInfo)
usedSymbols.add(routeSymbol)
const initialCacheControl = const initialCacheControl =
pageInfos.get(route)?.initialCacheControl pageInfos.get(route)?.initialCacheControl
......
...@@ -22,8 +22,8 @@ describe.skip('ppr', () => { ...@@ -22,8 +22,8 @@ describe.skip('ppr', () => {
it('correctly marks pages as being partially prerendered in the build output', () => { it('correctly marks pages as being partially prerendered in the build output', () => {
expect(next.cliOutput).toContain('◐ /loading/nested/[slug]') expect(next.cliOutput).toContain('◐ /loading/nested/[slug]')
expect(next.cliOutput).toContain('◐ /suspense/node') expect(next.cliOutput).toContain('◐ /suspense/node')
expect(next.cliOutput).toContain('◐ /suspense/node/gsp/[slug]') expect(next.cliOutput).toContain(' /suspense/node/gsp/[slug]')
expect(next.cliOutput).toContain('◐ /suspense/node/nested/[slug]') expect(next.cliOutput).toContain(' /suspense/node/nested/[slug]')
}) })
}) })
......
...@@ -2218,7 +2218,7 @@ describe('Prerender', () => { ...@@ -2218,7 +2218,7 @@ describe('Prerender', () => {
if ((global as any).isNextStart) { if ((global as any).isNextStart) {
it('should of formatted build output correctly', () => { it('should of formatted build output correctly', () => {
expect(next.cliOutput).toMatch(/○ \/normal/) expect(next.cliOutput).toMatch(/○ \/normal/)
expect(next.cliOutput).toMatch(/● \/blog\/\[post\]/) expect(next.cliOutput).toMatch(/[├└] {3}\/blog\/\[post\]/)
expect(next.cliOutput).toMatch(/\+2 more paths/) expect(next.cliOutput).toMatch(/\+2 more paths/)
}) })
......
...@@ -43,11 +43,11 @@ describe('build-output-ssg-bailout', () => { ...@@ -43,11 +43,11 @@ describe('build-output-ssg-bailout', () => {
"Route (app) "Route (app)
┌ ○ /_not-found ┌ ○ /_not-found
├ ƒ /ssg-bailout-partial/[id] ├ ƒ /ssg-bailout-partial/[id]
├ ● /ssg-bailout-partial/[id] ├ /ssg-bailout-partial/[id]
│ ├ ● /ssg-bailout-partial/2 │ ├ ● /ssg-bailout-partial/2
│ └ ● /ssg-bailout-partial/3 │ └ ● /ssg-bailout-partial/3
├ ƒ /ssg-bailout/[id] ├ ƒ /ssg-bailout/[id]
└ ● /ssg/[id] └ /ssg/[id]
├ ● /ssg/1 ├ ● /ssg/1
├ ● /ssg/2 ├ ● /ssg/2
└ ● /ssg/3 └ ● /ssg/3
......
...@@ -24,10 +24,10 @@ describe('build-output-tree-view', () => { ...@@ -24,10 +24,10 @@ describe('build-output-tree-view', () => {
├ ○ /cache-life-custom ≈7m ≈2h ├ ○ /cache-life-custom ≈7m ≈2h
├ ○ /cache-life-hours 1h 1d ├ ○ /cache-life-hours 1h 1d
├ ƒ /dynamic ├ ƒ /dynamic
├ ◐ /ppr/[slug] 1w 30d ├ /ppr/[slug] 1w 30d
│ ├ /ppr/[slug] 1w 30d │ ├ ◐ /ppr/[slug] 1w 30d
│ ├ /ppr/days 1d 1w │ ├ ◐ /ppr/days 1d 1w
│ └ /ppr/weeks 1w 30d │ └ ◐ /ppr/weeks 1w 30d
└ ○ /revalidate 15m 1y └ ○ /revalidate 15m 1y
Route (pages) Revalidate Expire Route (pages) Revalidate Expire
...@@ -82,7 +82,7 @@ describe('build-output-tree-view', () => { ...@@ -82,7 +82,7 @@ describe('build-output-tree-view', () => {
it('should show child route symbols for generated app paths', async () => { it('should show child route symbols for generated app paths', async () => {
expect(getTreeView(next.cliOutput)).toContain( expect(getTreeView(next.cliOutput)).toContain(
`├ ◐ /params/semantics/[lowcard]/[highcard]/layout-has/server `├ /params/semantics/[lowcard]/[highcard]/layout-has/server
│ ├ ◐ /params/semantics/[lowcard]/[highcard]/layout-has/server │ ├ ◐ /params/semantics/[lowcard]/[highcard]/layout-has/server
│ ├ ◐ /params/semantics/one/[highcard]/layout-has/server │ ├ ◐ /params/semantics/one/[highcard]/layout-has/server
│ └ ○ /params/semantics/one/build/layout-has/server` │ └ ○ /params/semantics/one/build/layout-has/server`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment