Skip to content

Commit

Permalink
feat: added fallback shell debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
wyattjoh committed Sep 26, 2024
1 parent 07a55e0 commit 8af35a5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/next/src/server/base-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2082,6 +2082,11 @@ export default abstract class Server<
typeof query.__nextppronly !== 'undefined' &&
couldSupportPPR

// When enabled, this will allow the use of the `?__nextppronly` query
// to enable debugging of the fallback shell.
const hasDebugFallbackShellQuery =
hasDebugStaticShellQuery && query.__nextppronly === 'fallback'

// This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the
// prerender manifest and this is an app page.
const isRoutePPREnabled: boolean =
Expand All @@ -2106,6 +2111,8 @@ export default abstract class Server<
const isDebugDynamicAccesses =
isDebugStaticShell && this.renderOpts.dev === true

const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled

// If we're in minimal mode, then try to get the postponed information from
// the request metadata. If available, use it for resuming the postponed
// render.
Expand Down Expand Up @@ -2974,7 +2981,8 @@ export default abstract class Server<
const fallbackRouteParams =
isDynamic &&
isRoutePPREnabled &&
getRequestMeta(req, 'didSetDefaultRouteMatches')
(getRequestMeta(req, 'didSetDefaultRouteMatches') ||
isDebugFallbackShell)
? getFallbackRouteParams(pathname)
: null

Expand Down

0 comments on commit 8af35a5

Please sign in to comment.