Unverified Commit 9a968b20 authored by Wyatt Johnson's avatar Wyatt Johnson Committed by GitHub

fix: added fallback source route to prerender manifest (#74052)

When serving partial generated shells, the prerender manifest needs to
annotate which source file is associated with the given route. This adds
the new field for dynamic routes.
parent 035f161c
......@@ -293,6 +293,12 @@ export interface DynamicSsgRoute {
*/
fallbackRootParams: readonly string[] | undefined
/**
* The source route that this fallback route is based on. This is a reference
* so that we can associate this dynamic route with the correct source.
*/
fallbackSourceRoute: string | undefined
prefetchDataRoute: string | null | undefined
prefetchDataRouteRegex: string | null | undefined
routeRegex: string
......@@ -3181,6 +3187,9 @@ export default async function build(
fallbackStatus: meta.status,
fallbackHeaders: meta.headers,
fallbackRootParams: route.fallbackRootParams,
fallbackSourceRoute: route.fallbackRouteParams?.length
? page
: undefined,
dataRouteRegex: !dataRoute
? null
: normalizeRouteRegex(
......@@ -3608,6 +3617,7 @@ export default async function build(
? `${normalizedRoute}.html`
: false,
fallbackRevalidate: undefined,
fallbackSourceRoute: undefined,
fallbackRootParams: undefined,
dataRouteRegex: normalizeRouteRegex(
getNamedRouteRegex(
......
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