Unverified Commit 523f1daa authored by Wyatt Johnson's avatar Wyatt Johnson Committed by GitHub

[ppr] Added fallback shell debugging (#70528)

This enhances the experimental debugging mode for Partial Fallback
Prerendering to only render the fallback shell.
parent 07a55e03
...@@ -2082,6 +2082,11 @@ export default abstract class Server< ...@@ -2082,6 +2082,11 @@ export default abstract class Server<
typeof query.__nextppronly !== 'undefined' && typeof query.__nextppronly !== 'undefined' &&
couldSupportPPR 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 // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the
// prerender manifest and this is an app page. // prerender manifest and this is an app page.
const isRoutePPREnabled: boolean = const isRoutePPREnabled: boolean =
...@@ -2106,6 +2111,8 @@ export default abstract class Server< ...@@ -2106,6 +2111,8 @@ export default abstract class Server<
const isDebugDynamicAccesses = const isDebugDynamicAccesses =
isDebugStaticShell && this.renderOpts.dev === true isDebugStaticShell && this.renderOpts.dev === true
const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled
// If we're in minimal mode, then try to get the postponed information from // 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 // the request metadata. If available, use it for resuming the postponed
// render. // render.
...@@ -2974,7 +2981,8 @@ export default abstract class Server< ...@@ -2974,7 +2981,8 @@ export default abstract class Server<
const fallbackRouteParams = const fallbackRouteParams =
isDynamic && isDynamic &&
isRoutePPREnabled && isRoutePPREnabled &&
getRequestMeta(req, 'didSetDefaultRouteMatches') (getRequestMeta(req, 'didSetDefaultRouteMatches') ||
isDebugFallbackShell)
? getFallbackRouteParams(pathname) ? getFallbackRouteParams(pathname)
: null : null
......
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