MCPcopy Create free account
hub / github.com/vercel/vercel / onPrerenderRoute

Function onPrerenderRoute

packages/next/src/utils.ts:2520–3637  ·  view source on GitHub ↗
(prerenderRouteArgs: OnPrerenderRouteArgs)

Source from the content-addressed store, hash-verified

2518
2519export const onPrerenderRoute =
2520 (prerenderRouteArgs: OnPrerenderRouteArgs) =>
2521 async (
2522 routeKey: string,
2523 {
2524 isBlocking,
2525 isFallback,
2526 isOmitted,
2527 locale,
2528 }: {
2529 /**
2530 * A route is a blocking fallback route if its value in the prerender
2531 * manifest is `null`. This means that unless the page has been
2532 * prerendered (no dynamic params), we can't serve a fallback page for the
2533 * route as it depends on the dynamic params values.
2534 */
2535 isBlocking?: boolean;
2536
2537 /**
2538 * A route is a fallback route if its value in the prerender manifest is
2539 * a string (meaning there is a fallback value/page). This occurs when
2540 * the page is rendered with dynamic params but it's rendered in such a
2541 * way that it's value can be reused for all variants of the dynamic
2542 * params.
2543 */
2544 isFallback?: boolean;
2545
2546 /**
2547 * A route is omitted if its value in the prerender manifest is `false`.
2548 * This can only be set when the `dynamicParams` is set to `false` for
2549 * the dynamic route.
2550 */
2551 isOmitted?: boolean;
2552 locale?: string;
2553 }
2554 ) => {
2555 const {
2556 appDir,
2557 pagesDir,
2558 static404Page,
2559 localePrefixed404,
2560 entryDirectory,
2561 prerenderManifest,
2562 isSharedLambdas,
2563 isServerMode,
2564 canUsePreviewMode,
2565 lambdas,
2566 experimentalStreamingLambdaPaths,
2567 prerenders,
2568 pageLambdaMap,
2569 routesManifest,
2570 isCorrectNotFoundRoutes,
2571 isEmptyAllowQueryForPrendered,
2572 isAppPPREnabled,
2573 isAppClientSegmentCacheEnabled,
2574 isAppClientParamParsingEnabled,
2575 appPathnameFilesMap,
2576 nextVersion,
2577 } = prerenderRouteArgs;

Callers 2

serverBuildFunction · 0.90
buildFunction · 0.90

Calls 15

isDynamicRouteFunction · 0.90
getContentTypeFromFileFunction · 0.90
normalizeLocalePathFunction · 0.85
addLocaleOrDefaultFunction · 0.85
getHTMLPostponedStateFunction · 0.85
normalizeIndexOutputFunction · 0.85
normalizeDataRouteFunction · 0.85
pathnameToOutputNameFunction · 0.85
normalizePathDataFunction · 0.85
replaceMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected