Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ppr] Added fallback shell debugging #70528

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading