Skip to content

Commit

Permalink
fix: added fallback source route to prerender manifest (vercel#74052)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wyattjoh authored Dec 18, 2024
1 parent 035f161 commit 9a968b2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/next/src/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -3608,6 +3617,7 @@ export default async function build(
? `${normalizedRoute}.html`
: false,
fallbackRevalidate: undefined,
fallbackSourceRoute: undefined,
fallbackRootParams: undefined,
dataRouteRegex: normalizeRouteRegex(
getNamedRouteRegex(
Expand Down

0 comments on commit 9a968b2

Please sign in to comment.