| self.__BUILD_MANIFEST = { | ||
| "__rewrites": { | ||
| "afterFiles": [], | ||
| "beforeFiles": [], | ||
| "fallback": [] | ||
| }, | ||
| "sortedPages": [ | ||
| "/_app", | ||
| "/_error" | ||
| ] | ||
| };self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB() |
| self.__MIDDLEWARE_MATCHERS = [];self.__MIDDLEWARE_MATCHERS_CB && self.__MIDDLEWARE_MATCHERS_CB() |
| self.__SSG_MANIFEST=new Set([]);self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB() |
@@ -88,2 +88,3 @@ "use strict"; | ||
| 'process.env.__NEXT_INSTANT_NAV_TOGGLE': isCacheComponentsEnabled, | ||
| 'process.env.__NEXT_EXPERIMENTAL_COLD_CACHE_BADGE': Boolean(config.experimental.coldCacheBadge), | ||
| 'process.env.__NEXT_USE_CACHE': isUseCacheEnabled, | ||
@@ -90,0 +91,0 @@ 'process.env.__NEXT_USE_NODE_STREAMS': isEdgeServer ? false : true, |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/build/define-env.ts"],"sourcesContent":["import type {\n I18NConfig,\n I18NDomains,\n NextConfigComplete,\n} from '../server/config-shared'\nimport type { ProxyMatcher } from './analysis/get-page-static-info'\nimport type { Rewrite } from '../lib/load-custom-routes'\nimport path from 'node:path'\nimport { needsExperimentalReact } from '../lib/needs-experimental-react'\nimport { checkIsAppPPREnabled } from '../server/lib/experimental/ppr'\nimport {\n getNextConfigEnv,\n getNextPublicEnvironmentVariables,\n} from '../lib/static-env'\n\ntype BloomFilter = ReturnType<\n import('../shared/lib/bloom-filter').BloomFilter['export']\n>\n\nexport interface DefineEnvOptions {\n isTurbopack: boolean\n clientRouterFilters?: {\n staticFilter: BloomFilter\n dynamicFilter: BloomFilter\n }\n config: NextConfigComplete\n dev: boolean\n distDir: string\n projectPath: string\n fetchCacheKeyPrefix: string | undefined\n hasRewrites: boolean\n isClient: boolean\n isEdgeServer: boolean\n isNodeServer: boolean\n middlewareMatchers: ProxyMatcher[] | undefined\n omitNonDeterministic?: boolean\n rewrites: {\n beforeFiles: Rewrite[]\n afterFiles: Rewrite[]\n fallback: Rewrite[]\n }\n}\n\nconst DEFINE_ENV_EXPRESSION = Symbol('DEFINE_ENV_EXPRESSION')\n\ninterface DefineEnv {\n [key: string]:\n | string\n | number\n | string[]\n | boolean\n | { [DEFINE_ENV_EXPRESSION]: string }\n | ProxyMatcher[]\n | BloomFilter\n | Partial<NextConfigComplete['images']>\n | I18NDomains\n | I18NConfig\n}\n\ninterface SerializedDefineEnv {\n [key: string]: string\n}\n\n/**\n * Serializes the DefineEnv config so that it can be inserted into the code by Webpack/Turbopack, JSON stringifies each value.\n */\nfunction serializeDefineEnv(defineEnv: DefineEnv): SerializedDefineEnv {\n const defineEnvStringified: SerializedDefineEnv = Object.fromEntries(\n Object.entries(defineEnv).map(([key, value]) => [\n key,\n typeof value === 'object' && DEFINE_ENV_EXPRESSION in value\n ? value[DEFINE_ENV_EXPRESSION]\n : JSON.stringify(value),\n ])\n )\n return defineEnvStringified\n}\n\nfunction getImageConfig(\n config: NextConfigComplete,\n dev: boolean\n): { 'process.env.__NEXT_IMAGE_OPTS': Partial<NextConfigComplete['images']> } {\n return {\n 'process.env.__NEXT_IMAGE_OPTS': {\n deviceSizes: config.images.deviceSizes,\n imageSizes: config.images.imageSizes,\n qualities: config.images.qualities,\n path: config.images.path,\n loader: config.images.loader,\n dangerouslyAllowSVG: config.images.dangerouslyAllowSVG,\n unoptimized: config?.images?.unoptimized,\n ...(dev\n ? {\n // additional config in dev to allow validating on the client\n domains: config.images.domains,\n remotePatterns: config.images?.remotePatterns,\n localPatterns: config.images?.localPatterns,\n output: config.output,\n }\n : {}),\n },\n }\n}\n\nexport function getDefineEnv({\n isTurbopack,\n clientRouterFilters,\n config,\n dev,\n distDir,\n projectPath,\n fetchCacheKeyPrefix,\n hasRewrites,\n isClient,\n isEdgeServer,\n isNodeServer,\n middlewareMatchers,\n omitNonDeterministic,\n rewrites,\n}: DefineEnvOptions): SerializedDefineEnv {\n const nextPublicEnv = getNextPublicEnvironmentVariables()\n const nextConfigEnv = getNextConfigEnv(config)\n\n const isPPREnabled = checkIsAppPPREnabled(config.experimental.ppr)\n const isCacheComponentsEnabled = !!config.cacheComponents\n const isUseCacheEnabled = !!config.experimental.useCache\n\n const defineEnv: DefineEnv = {\n // internal field to identify the plugin config\n __NEXT_DEFINE_ENV: true,\n\n ...nextPublicEnv,\n ...nextConfigEnv,\n ...(!isEdgeServer\n ? {}\n : {\n EdgeRuntime:\n /**\n * Cloud providers can set this environment variable to allow users\n * and library authors to have different implementations based on\n * the runtime they are running with, if it's not using `edge-runtime`\n */\n process.env.NEXT_EDGE_RUNTIME_PROVIDER ?? 'edge-runtime',\n\n // process should be only { env: {...} } for edge runtime.\n // For ignore avoid warn on `process.emit` usage but directly omit it.\n 'process.emit': false,\n }),\n 'process.turbopack': isTurbopack,\n 'process.env.TURBOPACK': isTurbopack,\n 'process.env.__NEXT_BUNDLER': isTurbopack\n ? 'Turbopack'\n : process.env.NEXT_RSPACK\n ? 'Rspack'\n : 'Webpack',\n // TODO: enforce `NODE_ENV` on `process.env`, and add a test:\n 'process.env.NODE_ENV':\n dev || config.experimental.allowDevelopmentBuild\n ? 'development'\n : 'production',\n 'process.env.__NEXT_DEV_SERVER': dev ? '1' : '',\n 'process.env.__NEXT_DISABLE_DEV_OVERLAY_UX':\n process.env.NEXT_PRIVATE_DISABLE_DEV_OVERLAY_UX === '1',\n 'process.env.NEXT_RUNTIME': isEdgeServer\n ? 'edge'\n : isNodeServer\n ? 'nodejs'\n : '',\n 'process.env.NEXT_MINIMAL': '',\n 'process.env.__NEXT_APP_NAV_FAIL_HANDLING': Boolean(\n config.experimental.appNavFailHandling\n ),\n 'process.env.__NEXT_APP_NEW_SCROLL_HANDLER': Boolean(\n config.experimental.appNewScrollHandler\n ),\n 'process.env.__NEXT_PPR': isPPREnabled,\n 'process.env.__NEXT_CACHE_COMPONENTS': isCacheComponentsEnabled,\n 'process.env.__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS': Boolean(\n config.experimental.cachedNavigations\n ),\n 'process.env.__NEXT_INSTANT_NAV_TOGGLE': isCacheComponentsEnabled,\n 'process.env.__NEXT_USE_CACHE': isUseCacheEnabled,\n 'process.env.__NEXT_USE_NODE_STREAMS': isEdgeServer ? false : true,\n\n 'process.env.NEXT_SUPPORTS_IMMUTABLE_ASSETS':\n config.experimental.supportsImmutableAssets || false,\n\n ...(config.experimental?.useSkewCookie || !config.deploymentId\n ? {\n 'process.env.NEXT_DEPLOYMENT_ID': false,\n }\n : isClient\n ? isTurbopack\n ? {\n // This is set at runtime by packages/next/src/client/register-deployment-id-global.ts\n 'process.env.NEXT_DEPLOYMENT_ID': {\n [DEFINE_ENV_EXPRESSION]: 'globalThis.NEXT_DEPLOYMENT_ID',\n },\n }\n : {\n // For Webpack, we currently don't use the non-inlining globalThis.NEXT_DEPLOYMENT_ID\n // approach because we cannot forward this global variable to web workers easily.\n 'process.env.NEXT_DEPLOYMENT_ID': config.deploymentId || false,\n }\n : config.experimental?.runtimeServerDeploymentId\n ? {\n // Don't inline at all, keep process.env.NEXT_DEPLOYMENT_ID as is\n }\n : {\n 'process.env.NEXT_DEPLOYMENT_ID': config.deploymentId || false,\n }),\n\n // Propagates the `__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING` environment\n // variable to the client.\n 'process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING':\n process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING || false,\n 'process.env.__NEXT_FETCH_CACHE_KEY_PREFIX': fetchCacheKeyPrefix ?? '',\n ...(isTurbopack\n ? {}\n : {\n 'process.env.__NEXT_MIDDLEWARE_MATCHERS': middlewareMatchers ?? [],\n }),\n 'process.env.__NEXT_MANUAL_CLIENT_BASE_PATH':\n config.experimental.manualClientBasePath ?? false,\n 'process.env.__NEXT_CLIENT_ROUTER_DYNAMIC_STALETIME': JSON.stringify(\n isNaN(Number(config.experimental.staleTimes?.dynamic))\n ? 0\n : config.experimental.staleTimes?.dynamic\n ),\n 'process.env.__NEXT_CLIENT_ROUTER_STATIC_STALETIME': JSON.stringify(\n isNaN(Number(config.experimental.staleTimes?.static))\n ? 5 * 60 // 5 minutes\n : config.experimental.staleTimes?.static\n ),\n 'process.env.__NEXT_CLIENT_ROUTER_FILTER_ENABLED':\n config.experimental.clientRouterFilter ?? true,\n 'process.env.__NEXT_CLIENT_ROUTER_S_FILTER':\n clientRouterFilters?.staticFilter ?? false,\n 'process.env.__NEXT_CLIENT_ROUTER_D_FILTER':\n clientRouterFilters?.dynamicFilter ?? false,\n 'process.env.__NEXT_CLIENT_VALIDATE_RSC_REQUEST_HEADERS': Boolean(\n config.experimental.validateRSCRequestHeaders\n ),\n 'process.env.__NEXT_DYNAMIC_ON_HOVER': Boolean(\n config.experimental.dynamicOnHover\n ),\n 'process.env.__NEXT_USE_OFFLINE': Boolean(config.experimental.useOffline),\n 'process.env.__NEXT_PREFETCH_INLINING': Boolean(\n config.experimental.prefetchInlining\n ),\n 'process.env.__NEXT_OPTIMISTIC_CLIENT_CACHE':\n config.experimental.optimisticClientCache ?? true,\n 'process.env.__NEXT_MIDDLEWARE_PREFETCH':\n config.experimental.proxyPrefetch ?? 'flexible',\n 'process.env.__NEXT_CROSS_ORIGIN': config.crossOrigin,\n 'process.browser': isClient,\n 'process.env.__NEXT_TEST_MODE': process.env.__NEXT_TEST_MODE ?? false,\n // This is used in client/dev-error-overlay/hot-dev-client.js to replace the dist directory\n ...(dev && (isClient ?? isEdgeServer)\n ? {\n 'process.env.__NEXT_DIST_DIR': distDir,\n }\n : {}),\n // This is used in devtools to strip the project path in edge runtime,\n // as there's only a dummy `dir` value (`.`) as edge runtime doesn't have concept of file system.\n ...(dev && isEdgeServer\n ? {\n 'process.env.__NEXT_EDGE_PROJECT_DIR': isTurbopack\n ? path.relative(process.cwd(), projectPath)\n : projectPath,\n }\n : {}),\n 'process.env.__NEXT_BASE_PATH': config.basePath,\n 'process.env.__NEXT_CASE_SENSITIVE_ROUTES': Boolean(\n config.experimental.caseSensitiveRoutes\n ),\n 'process.env.__NEXT_REWRITES': rewrites as any,\n 'process.env.__NEXT_TRAILING_SLASH': config.trailingSlash,\n 'process.env.__NEXT_DEV_INDICATOR': config.devIndicators !== false,\n 'process.env.__NEXT_DEV_INDICATOR_POSITION':\n config.devIndicators === false\n ? 'bottom-left' // This will not be used as the indicator is disabled.\n : (config.devIndicators.position ?? 'bottom-left'),\n 'process.env.__NEXT_STRICT_MODE':\n config.reactStrictMode === null ? false : config.reactStrictMode,\n 'process.env.__NEXT_STRICT_MODE_APP':\n // When next.config.js does not have reactStrictMode it's enabled by default.\n config.reactStrictMode === null ? true : config.reactStrictMode,\n 'process.env.__NEXT_OPTIMIZE_CSS':\n (config.experimental.optimizeCss && !dev) ?? false,\n 'process.env.__NEXT_SCRIPT_WORKERS':\n (config.experimental.nextScriptWorkers && !dev) ?? false,\n 'process.env.__NEXT_SCROLL_RESTORATION':\n config.experimental.scrollRestoration ?? false,\n ...getImageConfig(config, dev),\n 'process.env.__NEXT_ROUTER_BASEPATH': config.basePath,\n 'process.env.__NEXT_HAS_REWRITES': hasRewrites,\n 'process.env.__NEXT_CONFIG_OUTPUT': config.output,\n 'process.env.__NEXT_I18N_SUPPORT': !!config.i18n,\n 'process.env.__NEXT_I18N_DOMAINS': config.i18n?.domains ?? false,\n 'process.env.__NEXT_I18N_CONFIG': config.i18n || '',\n 'process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE':\n config.skipProxyUrlNormalize,\n 'process.env.__NEXT_EXTERNAL_MIDDLEWARE_REWRITE_RESOLVE':\n config.experimental.externalProxyRewritesResolve ?? false,\n 'process.env.__NEXT_MANUAL_TRAILING_SLASH':\n config.skipTrailingSlashRedirect,\n 'process.env.__NEXT_HAS_WEB_VITALS_ATTRIBUTION':\n (config.experimental.webVitalsAttribution &&\n config.experimental.webVitalsAttribution.length > 0) ??\n false,\n 'process.env.__NEXT_WEB_VITALS_ATTRIBUTION':\n config.experimental.webVitalsAttribution ?? false,\n 'process.env.__NEXT_LINK_NO_TOUCH_START':\n config.experimental.linkNoTouchStart ?? false,\n 'process.env.__NEXT_ASSET_PREFIX': config.assetPrefix,\n 'process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS':\n !!config.experimental.authInterrupts,\n 'process.env.__NEXT_TELEMETRY_DISABLED': Boolean(\n process.env.NEXT_TELEMETRY_DISABLED\n ),\n ...(isNodeServer || isEdgeServer\n ? {\n // Fix bad-actors in the npm ecosystem (e.g. `node-formidable`)\n // This is typically found in unmaintained modules from the\n // pre-webpack era (common in server-side code)\n 'global.GENTLY': false,\n }\n : undefined),\n ...(isNodeServer || isEdgeServer\n ? {\n 'process.env.__NEXT_EXPERIMENTAL_REACT':\n needsExperimentalReact(config),\n }\n : undefined),\n\n 'process.env.__NEXT_MULTI_ZONE_DRAFT_MODE':\n config.experimental.multiZoneDraftMode ?? false,\n 'process.env.__NEXT_TRUST_HOST_HEADER':\n config.experimental.trustHostHeader ?? false,\n 'process.env.__NEXT_ALLOWED_REVALIDATE_HEADERS':\n config.experimental.allowedRevalidateHeaderKeys ?? [],\n ...(isNodeServer || isEdgeServer\n ? {\n 'process.env.__NEXT_RELATIVE_DIST_DIR': config.distDir,\n 'process.env.__NEXT_RELATIVE_PROJECT_DIR': path.relative(\n process.cwd(),\n projectPath\n ),\n }\n : {}),\n\n 'process.env.__NEXT_BROWSER_DEBUG_INFO_IN_TERMINAL': JSON.stringify(\n (config.logging && config.logging.browserToTerminal) || false\n ),\n 'process.env.__NEXT_MCP_SERVER': !!config.experimental.mcpServer,\n\n // The devtools need to know whether or not to show an option to clear the\n // bundler cache. This option may be removed later once Turbopack's\n // filesystem cache feature is more stable.\n //\n // This environment value is currently best-effort:\n // - It's possible to disable the webpack filesystem cache, but it's\n // unlikely for a user to do that.\n // - Rspack's filesystem cache is unstable and requires a different\n // configuration than webpack to enable (which we don't do).\n //\n // In the worst case we'll show an option to clear the cache, but it'll be a\n // no-op that just restarts the development server.\n 'process.env.__NEXT_BUNDLER_HAS_PERSISTENT_CACHE':\n !isTurbopack ||\n (config.experimental.turbopackFileSystemCacheForDev ?? false),\n 'process.env.__NEXT_REACT_DEBUG_CHANNEL':\n config.experimental.reactDebugChannel ?? false,\n 'process.env.__NEXT_TRANSITION_INDICATOR':\n config.experimental.transitionIndicator ?? false,\n 'process.env.__NEXT_GESTURE_TRANSITION':\n config.experimental.gestureTransition ?? false,\n 'process.env.__NEXT_OPTIMISTIC_ROUTING':\n config.experimental.optimisticRouting ?? false,\n 'process.env.__NEXT_INSTRUMENTATION_CLIENT_ROUTER_TRANSITION_EVENTS':\n config.experimental.instrumentationClientRouterTransitionEvents ?? false,\n 'process.env.__NEXT_APP_SHELLS': config.experimental.appShells ?? false,\n 'process.env.__NEXT_VARY_PARAMS': config.experimental.varyParams ?? false,\n 'process.env.__NEXT_EXPOSE_TESTING_API':\n dev || config.experimental.exposeTestingApiInProductionBuild === true,\n 'process.env.__NEXT_CACHE_LIFE': config.cacheLife,\n 'process.env.__NEXT_CLIENT_PARAM_PARSING_ORIGINS':\n config.experimental.clientParamParsingOrigins || [],\n }\n\n const userDefines = config.compiler?.define ?? {}\n for (const key in userDefines) {\n if (defineEnv.hasOwnProperty(key)) {\n throw new Error(\n `The \\`compiler.define\\` option is configured to replace the \\`${key}\\` variable. This variable is either part of a Next.js built-in or is already configured.`\n )\n }\n defineEnv[key] = userDefines[key]\n }\n\n if (isNodeServer || isEdgeServer) {\n const userDefinesServer = config.compiler?.defineServer ?? {}\n for (const key in userDefinesServer) {\n if (defineEnv.hasOwnProperty(key)) {\n throw new Error(\n `The \\`compiler.defineServer\\` option is configured to replace the \\`${key}\\` variable. This variable is either part of a Next.js built-in or is already configured.`\n )\n }\n defineEnv[key] = userDefinesServer[key]\n }\n }\n\n const serializedDefineEnv = serializeDefineEnv(defineEnv)\n\n // we delay inlining these values until after the build\n // with flying shuttle enabled so we can update them\n // without invalidating entries\n if (!dev && omitNonDeterministic) {\n // client uses window. instead of leaving process.env\n // in case process isn't polyfilled on client already\n // since by this point it won't be added by webpack\n const safeKey = (key: string) =>\n isClient ? `window.${key.split('.').pop()}` : key\n\n for (const key in nextPublicEnv) {\n serializedDefineEnv[key] = safeKey(key)\n }\n for (const key in nextConfigEnv) {\n serializedDefineEnv[key] = safeKey(key)\n }\n if (!config.experimental.runtimeServerDeploymentId) {\n for (const key of ['process.env.NEXT_DEPLOYMENT_ID']) {\n serializedDefineEnv[key] = safeKey(key)\n }\n }\n }\n\n return serializedDefineEnv\n}\n"],"names":["getDefineEnv","DEFINE_ENV_EXPRESSION","Symbol","serializeDefineEnv","defineEnv","defineEnvStringified","Object","fromEntries","entries","map","key","value","JSON","stringify","getImageConfig","config","dev","deviceSizes","images","imageSizes","qualities","path","loader","dangerouslyAllowSVG","unoptimized","domains","remotePatterns","localPatterns","output","isTurbopack","clientRouterFilters","distDir","projectPath","fetchCacheKeyPrefix","hasRewrites","isClient","isEdgeServer","isNodeServer","middlewareMatchers","omitNonDeterministic","rewrites","nextPublicEnv","getNextPublicEnvironmentVariables","nextConfigEnv","getNextConfigEnv","isPPREnabled","checkIsAppPPREnabled","experimental","ppr","isCacheComponentsEnabled","cacheComponents","isUseCacheEnabled","useCache","__NEXT_DEFINE_ENV","EdgeRuntime","process","env","NEXT_EDGE_RUNTIME_PROVIDER","NEXT_RSPACK","allowDevelopmentBuild","NEXT_PRIVATE_DISABLE_DEV_OVERLAY_UX","Boolean","appNavFailHandling","appNewScrollHandler","cachedNavigations","supportsImmutableAssets","useSkewCookie","deploymentId","runtimeServerDeploymentId","__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING","manualClientBasePath","isNaN","Number","staleTimes","dynamic","static","clientRouterFilter","staticFilter","dynamicFilter","validateRSCRequestHeaders","dynamicOnHover","useOffline","prefetchInlining","optimisticClientCache","proxyPrefetch","crossOrigin","__NEXT_TEST_MODE","relative","cwd","basePath","caseSensitiveRoutes","trailingSlash","devIndicators","position","reactStrictMode","optimizeCss","nextScriptWorkers","scrollRestoration","i18n","skipProxyUrlNormalize","externalProxyRewritesResolve","skipTrailingSlashRedirect","webVitalsAttribution","length","linkNoTouchStart","assetPrefix","authInterrupts","NEXT_TELEMETRY_DISABLED","undefined","needsExperimentalReact","multiZoneDraftMode","trustHostHeader","allowedRevalidateHeaderKeys","logging","browserToTerminal","mcpServer","turbopackFileSystemCacheForDev","reactDebugChannel","transitionIndicator","gestureTransition","optimisticRouting","instrumentationClientRouterTransitionEvents","appShells","varyParams","exposeTestingApiInProductionBuild","cacheLife","clientParamParsingOrigins","userDefines","compiler","define","hasOwnProperty","Error","userDefinesServer","defineServer","serializedDefineEnv","safeKey","split","pop"],"mappings":";;;;+BAwGgBA;;;eAAAA;;;iEAjGC;wCACsB;qBACF;2BAI9B;;;;;;AA8BP,MAAMC,wBAAwBC,OAAO;AAoBrC;;CAEC,GACD,SAASC,mBAAmBC,SAAoB;IAC9C,MAAMC,uBAA4CC,OAAOC,WAAW,CAClED,OAAOE,OAAO,CAACJ,WAAWK,GAAG,CAAC,CAAC,CAACC,KAAKC,MAAM,GAAK;YAC9CD;YACA,OAAOC,UAAU,YAAYV,yBAAyBU,QAClDA,KAAK,CAACV,sBAAsB,GAC5BW,KAAKC,SAAS,CAACF;SACpB;IAEH,OAAON;AACT;AAEA,SAASS,eACPC,MAA0B,EAC1BC,GAAY;QAUKD,gBAKSA,iBACDA;IAdzB,OAAO;QACL,iCAAiC;YAC/BE,aAAaF,OAAOG,MAAM,CAACD,WAAW;YACtCE,YAAYJ,OAAOG,MAAM,CAACC,UAAU;YACpCC,WAAWL,OAAOG,MAAM,CAACE,SAAS;YAClCC,MAAMN,OAAOG,MAAM,CAACG,IAAI;YACxBC,QAAQP,OAAOG,MAAM,CAACI,MAAM;YAC5BC,qBAAqBR,OAAOG,MAAM,CAACK,mBAAmB;YACtDC,WAAW,EAAET,2BAAAA,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AMgG,UAAU,CAAC7H,MACfyB,WAAW,CAAC,OAAO,EAAEzB,IAAI8H,KAAK,CAAC,KAAKC,GAAG,IAAI,GAAG/H;QAEhD,IAAK,MAAMA,OAAO+B,cAAe;YAC/B6F,mBAAmB,CAAC5H,IAAI,GAAG6H,QAAQ7H;QACrC;QACA,IAAK,MAAMA,OAAOiC,cAAe;YAC/B2F,mBAAmB,CAAC5H,IAAI,GAAG6H,QAAQ7H;QACrC;QACA,IAAI,CAACK,OAAOgC,YAAY,CAACqB,yBAAyB,EAAE;YAClD,KAAK,MAAM1D,OAAO;gBAAC;aAAiC,CAAE;gBACpD4H,mBAAmB,CAAC5H,IAAI,GAAG6H,QAAQ7H;YACrC;QACF;IACF;IAEA,OAAO4H;AACT","ignoreList":[0]} | ||
| {"version":3,"sources":["../../src/build/define-env.ts"],"sourcesContent":["import type {\n I18NConfig,\n I18NDomains,\n NextConfigComplete,\n} from '../server/config-shared'\nimport type { ProxyMatcher } from './analysis/get-page-static-info'\nimport type { Rewrite } from '../lib/load-custom-routes'\nimport path from 'node:path'\nimport { needsExperimentalReact } from '../lib/needs-experimental-react'\nimport { checkIsAppPPREnabled } from '../server/lib/experimental/ppr'\nimport {\n getNextConfigEnv,\n getNextPublicEnvironmentVariables,\n} from '../lib/static-env'\n\ntype BloomFilter = ReturnType<\n import('../shared/lib/bloom-filter').BloomFilter['export']\n>\n\nexport interface DefineEnvOptions {\n isTurbopack: boolean\n clientRouterFilters?: {\n staticFilter: BloomFilter\n dynamicFilter: BloomFilter\n }\n config: NextConfigComplete\n dev: boolean\n distDir: string\n projectPath: string\n fetchCacheKeyPrefix: string | undefined\n hasRewrites: boolean\n isClient: boolean\n isEdgeServer: boolean\n isNodeServer: boolean\n middlewareMatchers: ProxyMatcher[] | undefined\n omitNonDeterministic?: boolean\n rewrites: {\n beforeFiles: Rewrite[]\n afterFiles: Rewrite[]\n fallback: Rewrite[]\n }\n}\n\nconst DEFINE_ENV_EXPRESSION = Symbol('DEFINE_ENV_EXPRESSION')\n\ninterface DefineEnv {\n [key: string]:\n | string\n | number\n | string[]\n | boolean\n | { [DEFINE_ENV_EXPRESSION]: string }\n | ProxyMatcher[]\n | BloomFilter\n | Partial<NextConfigComplete['images']>\n | I18NDomains\n | I18NConfig\n}\n\ninterface SerializedDefineEnv {\n [key: string]: string\n}\n\n/**\n * Serializes the DefineEnv config so that it can be inserted into the code by Webpack/Turbopack, JSON stringifies each value.\n */\nfunction serializeDefineEnv(defineEnv: DefineEnv): SerializedDefineEnv {\n const defineEnvStringified: SerializedDefineEnv = Object.fromEntries(\n Object.entries(defineEnv).map(([key, value]) => [\n key,\n typeof value === 'object' && DEFINE_ENV_EXPRESSION in value\n ? value[DEFINE_ENV_EXPRESSION]\n : JSON.stringify(value),\n ])\n )\n return defineEnvStringified\n}\n\nfunction getImageConfig(\n config: NextConfigComplete,\n dev: boolean\n): { 'process.env.__NEXT_IMAGE_OPTS': Partial<NextConfigComplete['images']> } {\n return {\n 'process.env.__NEXT_IMAGE_OPTS': {\n deviceSizes: config.images.deviceSizes,\n imageSizes: config.images.imageSizes,\n qualities: config.images.qualities,\n path: config.images.path,\n loader: config.images.loader,\n dangerouslyAllowSVG: config.images.dangerouslyAllowSVG,\n unoptimized: config?.images?.unoptimized,\n ...(dev\n ? {\n // additional config in dev to allow validating on the client\n domains: config.images.domains,\n remotePatterns: config.images?.remotePatterns,\n localPatterns: config.images?.localPatterns,\n output: config.output,\n }\n : {}),\n },\n }\n}\n\nexport function getDefineEnv({\n isTurbopack,\n clientRouterFilters,\n config,\n dev,\n distDir,\n projectPath,\n fetchCacheKeyPrefix,\n hasRewrites,\n isClient,\n isEdgeServer,\n isNodeServer,\n middlewareMatchers,\n omitNonDeterministic,\n rewrites,\n}: DefineEnvOptions): SerializedDefineEnv {\n const nextPublicEnv = getNextPublicEnvironmentVariables()\n const nextConfigEnv = getNextConfigEnv(config)\n\n const isPPREnabled = checkIsAppPPREnabled(config.experimental.ppr)\n const isCacheComponentsEnabled = !!config.cacheComponents\n const isUseCacheEnabled = !!config.experimental.useCache\n\n const defineEnv: DefineEnv = {\n // internal field to identify the plugin config\n __NEXT_DEFINE_ENV: true,\n\n ...nextPublicEnv,\n ...nextConfigEnv,\n ...(!isEdgeServer\n ? {}\n : {\n EdgeRuntime:\n /**\n * Cloud providers can set this environment variable to allow users\n * and library authors to have different implementations based on\n * the runtime they are running with, if it's not using `edge-runtime`\n */\n process.env.NEXT_EDGE_RUNTIME_PROVIDER ?? 'edge-runtime',\n\n // process should be only { env: {...} } for edge runtime.\n // For ignore avoid warn on `process.emit` usage but directly omit it.\n 'process.emit': false,\n }),\n 'process.turbopack': isTurbopack,\n 'process.env.TURBOPACK': isTurbopack,\n 'process.env.__NEXT_BUNDLER': isTurbopack\n ? 'Turbopack'\n : process.env.NEXT_RSPACK\n ? 'Rspack'\n : 'Webpack',\n // TODO: enforce `NODE_ENV` on `process.env`, and add a test:\n 'process.env.NODE_ENV':\n dev || config.experimental.allowDevelopmentBuild\n ? 'development'\n : 'production',\n 'process.env.__NEXT_DEV_SERVER': dev ? '1' : '',\n 'process.env.__NEXT_DISABLE_DEV_OVERLAY_UX':\n process.env.NEXT_PRIVATE_DISABLE_DEV_OVERLAY_UX === '1',\n 'process.env.NEXT_RUNTIME': isEdgeServer\n ? 'edge'\n : isNodeServer\n ? 'nodejs'\n : '',\n 'process.env.NEXT_MINIMAL': '',\n 'process.env.__NEXT_APP_NAV_FAIL_HANDLING': Boolean(\n config.experimental.appNavFailHandling\n ),\n 'process.env.__NEXT_APP_NEW_SCROLL_HANDLER': Boolean(\n config.experimental.appNewScrollHandler\n ),\n 'process.env.__NEXT_PPR': isPPREnabled,\n 'process.env.__NEXT_CACHE_COMPONENTS': isCacheComponentsEnabled,\n 'process.env.__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS': Boolean(\n config.experimental.cachedNavigations\n ),\n 'process.env.__NEXT_INSTANT_NAV_TOGGLE': isCacheComponentsEnabled,\n 'process.env.__NEXT_EXPERIMENTAL_COLD_CACHE_BADGE': Boolean(\n config.experimental.coldCacheBadge\n ),\n 'process.env.__NEXT_USE_CACHE': isUseCacheEnabled,\n 'process.env.__NEXT_USE_NODE_STREAMS': isEdgeServer ? false : true,\n\n 'process.env.NEXT_SUPPORTS_IMMUTABLE_ASSETS':\n config.experimental.supportsImmutableAssets || false,\n\n ...(config.experimental?.useSkewCookie || !config.deploymentId\n ? {\n 'process.env.NEXT_DEPLOYMENT_ID': false,\n }\n : isClient\n ? isTurbopack\n ? {\n // This is set at runtime by packages/next/src/client/register-deployment-id-global.ts\n 'process.env.NEXT_DEPLOYMENT_ID': {\n [DEFINE_ENV_EXPRESSION]: 'globalThis.NEXT_DEPLOYMENT_ID',\n },\n }\n : {\n // For Webpack, we currently don't use the non-inlining globalThis.NEXT_DEPLOYMENT_ID\n // approach because we cannot forward this global variable to web workers easily.\n 'process.env.NEXT_DEPLOYMENT_ID': config.deploymentId || false,\n }\n : config.experimental?.runtimeServerDeploymentId\n ? {\n // Don't inline at all, keep process.env.NEXT_DEPLOYMENT_ID as is\n }\n : {\n 'process.env.NEXT_DEPLOYMENT_ID': config.deploymentId || false,\n }),\n\n // Propagates the `__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING` environment\n // variable to the client.\n 'process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING':\n process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING || false,\n 'process.env.__NEXT_FETCH_CACHE_KEY_PREFIX': fetchCacheKeyPrefix ?? '',\n ...(isTurbopack\n ? {}\n : {\n 'process.env.__NEXT_MIDDLEWARE_MATCHERS': middlewareMatchers ?? [],\n }),\n 'process.env.__NEXT_MANUAL_CLIENT_BASE_PATH':\n config.experimental.manualClientBasePath ?? false,\n 'process.env.__NEXT_CLIENT_ROUTER_DYNAMIC_STALETIME': JSON.stringify(\n isNaN(Number(config.experimental.staleTimes?.dynamic))\n ? 0\n : config.experimental.staleTimes?.dynamic\n ),\n 'process.env.__NEXT_CLIENT_ROUTER_STATIC_STALETIME': JSON.stringify(\n isNaN(Number(config.experimental.staleTimes?.static))\n ? 5 * 60 // 5 minutes\n : config.experimental.staleTimes?.static\n ),\n 'process.env.__NEXT_CLIENT_ROUTER_FILTER_ENABLED':\n config.experimental.clientRouterFilter ?? true,\n 'process.env.__NEXT_CLIENT_ROUTER_S_FILTER':\n clientRouterFilters?.staticFilter ?? false,\n 'process.env.__NEXT_CLIENT_ROUTER_D_FILTER':\n clientRouterFilters?.dynamicFilter ?? false,\n 'process.env.__NEXT_CLIENT_VALIDATE_RSC_REQUEST_HEADERS': Boolean(\n config.experimental.validateRSCRequestHeaders\n ),\n 'process.env.__NEXT_DYNAMIC_ON_HOVER': Boolean(\n config.experimental.dynamicOnHover\n ),\n 'process.env.__NEXT_USE_OFFLINE': Boolean(config.experimental.useOffline),\n 'process.env.__NEXT_PREFETCH_INLINING': Boolean(\n config.experimental.prefetchInlining\n ),\n 'process.env.__NEXT_OPTIMISTIC_CLIENT_CACHE':\n config.experimental.optimisticClientCache ?? true,\n 'process.env.__NEXT_MIDDLEWARE_PREFETCH':\n config.experimental.proxyPrefetch ?? 'flexible',\n 'process.env.__NEXT_CROSS_ORIGIN': config.crossOrigin,\n 'process.browser': isClient,\n 'process.env.__NEXT_TEST_MODE': process.env.__NEXT_TEST_MODE ?? false,\n // This is used in client/dev-error-overlay/hot-dev-client.js to replace the dist directory\n ...(dev && (isClient ?? isEdgeServer)\n ? {\n 'process.env.__NEXT_DIST_DIR': distDir,\n }\n : {}),\n // This is used in devtools to strip the project path in edge runtime,\n // as there's only a dummy `dir` value (`.`) as edge runtime doesn't have concept of file system.\n ...(dev && isEdgeServer\n ? {\n 'process.env.__NEXT_EDGE_PROJECT_DIR': isTurbopack\n ? path.relative(process.cwd(), projectPath)\n : projectPath,\n }\n : {}),\n 'process.env.__NEXT_BASE_PATH': config.basePath,\n 'process.env.__NEXT_CASE_SENSITIVE_ROUTES': Boolean(\n config.experimental.caseSensitiveRoutes\n ),\n 'process.env.__NEXT_REWRITES': rewrites as any,\n 'process.env.__NEXT_TRAILING_SLASH': config.trailingSlash,\n 'process.env.__NEXT_DEV_INDICATOR': config.devIndicators !== false,\n 'process.env.__NEXT_DEV_INDICATOR_POSITION':\n config.devIndicators === false\n ? 'bottom-left' // This will not be used as the indicator is disabled.\n : (config.devIndicators.position ?? 'bottom-left'),\n 'process.env.__NEXT_STRICT_MODE':\n config.reactStrictMode === null ? false : config.reactStrictMode,\n 'process.env.__NEXT_STRICT_MODE_APP':\n // When next.config.js does not have reactStrictMode it's enabled by default.\n config.reactStrictMode === null ? true : config.reactStrictMode,\n 'process.env.__NEXT_OPTIMIZE_CSS':\n (config.experimental.optimizeCss && !dev) ?? false,\n 'process.env.__NEXT_SCRIPT_WORKERS':\n (config.experimental.nextScriptWorkers && !dev) ?? false,\n 'process.env.__NEXT_SCROLL_RESTORATION':\n config.experimental.scrollRestoration ?? false,\n ...getImageConfig(config, dev),\n 'process.env.__NEXT_ROUTER_BASEPATH': config.basePath,\n 'process.env.__NEXT_HAS_REWRITES': hasRewrites,\n 'process.env.__NEXT_CONFIG_OUTPUT': config.output,\n 'process.env.__NEXT_I18N_SUPPORT': !!config.i18n,\n 'process.env.__NEXT_I18N_DOMAINS': config.i18n?.domains ?? false,\n 'process.env.__NEXT_I18N_CONFIG': config.i18n || '',\n 'process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE':\n config.skipProxyUrlNormalize,\n 'process.env.__NEXT_EXTERNAL_MIDDLEWARE_REWRITE_RESOLVE':\n config.experimental.externalProxyRewritesResolve ?? false,\n 'process.env.__NEXT_MANUAL_TRAILING_SLASH':\n config.skipTrailingSlashRedirect,\n 'process.env.__NEXT_HAS_WEB_VITALS_ATTRIBUTION':\n (config.experimental.webVitalsAttribution &&\n config.experimental.webVitalsAttribution.length > 0) ??\n false,\n 'process.env.__NEXT_WEB_VITALS_ATTRIBUTION':\n config.experimental.webVitalsAttribution ?? false,\n 'process.env.__NEXT_LINK_NO_TOUCH_START':\n config.experimental.linkNoTouchStart ?? false,\n 'process.env.__NEXT_ASSET_PREFIX': config.assetPrefix,\n 'process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS':\n !!config.experimental.authInterrupts,\n 'process.env.__NEXT_TELEMETRY_DISABLED': Boolean(\n process.env.NEXT_TELEMETRY_DISABLED\n ),\n ...(isNodeServer || isEdgeServer\n ? {\n // Fix bad-actors in the npm ecosystem (e.g. `node-formidable`)\n // This is typically found in unmaintained modules from the\n // pre-webpack era (common in server-side code)\n 'global.GENTLY': false,\n }\n : undefined),\n ...(isNodeServer || isEdgeServer\n ? {\n 'process.env.__NEXT_EXPERIMENTAL_REACT':\n needsExperimentalReact(config),\n }\n : undefined),\n\n 'process.env.__NEXT_MULTI_ZONE_DRAFT_MODE':\n config.experimental.multiZoneDraftMode ?? false,\n 'process.env.__NEXT_TRUST_HOST_HEADER':\n config.experimental.trustHostHeader ?? false,\n 'process.env.__NEXT_ALLOWED_REVALIDATE_HEADERS':\n config.experimental.allowedRevalidateHeaderKeys ?? [],\n ...(isNodeServer || isEdgeServer\n ? {\n 'process.env.__NEXT_RELATIVE_DIST_DIR': config.distDir,\n 'process.env.__NEXT_RELATIVE_PROJECT_DIR': path.relative(\n process.cwd(),\n projectPath\n ),\n }\n : {}),\n\n 'process.env.__NEXT_BROWSER_DEBUG_INFO_IN_TERMINAL': JSON.stringify(\n (config.logging && config.logging.browserToTerminal) || false\n ),\n 'process.env.__NEXT_MCP_SERVER': !!config.experimental.mcpServer,\n\n // The devtools need to know whether or not to show an option to clear the\n // bundler cache. This option may be removed later once Turbopack's\n // filesystem cache feature is more stable.\n //\n // This environment value is currently best-effort:\n // - It's possible to disable the webpack filesystem cache, but it's\n // unlikely for a user to do that.\n // - Rspack's filesystem cache is unstable and requires a different\n // configuration than webpack to enable (which we don't do).\n //\n // In the worst case we'll show an option to clear the cache, but it'll be a\n // no-op that just restarts the development server.\n 'process.env.__NEXT_BUNDLER_HAS_PERSISTENT_CACHE':\n !isTurbopack ||\n (config.experimental.turbopackFileSystemCacheForDev ?? false),\n 'process.env.__NEXT_REACT_DEBUG_CHANNEL':\n config.experimental.reactDebugChannel ?? false,\n 'process.env.__NEXT_TRANSITION_INDICATOR':\n config.experimental.transitionIndicator ?? false,\n 'process.env.__NEXT_GESTURE_TRANSITION':\n config.experimental.gestureTransition ?? false,\n 'process.env.__NEXT_OPTIMISTIC_ROUTING':\n config.experimental.optimisticRouting ?? false,\n 'process.env.__NEXT_INSTRUMENTATION_CLIENT_ROUTER_TRANSITION_EVENTS':\n config.experimental.instrumentationClientRouterTransitionEvents ?? false,\n 'process.env.__NEXT_APP_SHELLS': config.experimental.appShells ?? false,\n 'process.env.__NEXT_VARY_PARAMS': config.experimental.varyParams ?? false,\n 'process.env.__NEXT_EXPOSE_TESTING_API':\n dev || config.experimental.exposeTestingApiInProductionBuild === true,\n 'process.env.__NEXT_CACHE_LIFE': config.cacheLife,\n 'process.env.__NEXT_CLIENT_PARAM_PARSING_ORIGINS':\n config.experimental.clientParamParsingOrigins || [],\n }\n\n const userDefines = config.compiler?.define ?? {}\n for (const key in userDefines) {\n if (defineEnv.hasOwnProperty(key)) {\n throw new Error(\n `The \\`compiler.define\\` option is configured to replace the \\`${key}\\` variable. This variable is either part of a Next.js built-in or is already configured.`\n )\n }\n defineEnv[key] = userDefines[key]\n }\n\n if (isNodeServer || isEdgeServer) {\n const userDefinesServer = config.compiler?.defineServer ?? {}\n for (const key in userDefinesServer) {\n if (defineEnv.hasOwnProperty(key)) {\n throw new Error(\n `The \\`compiler.defineServer\\` option is configured to replace the \\`${key}\\` variable. This variable is either part of a Next.js built-in or is already configured.`\n )\n }\n defineEnv[key] = userDefinesServer[key]\n }\n }\n\n const serializedDefineEnv = serializeDefineEnv(defineEnv)\n\n // we delay inlining these values until after the build\n // with flying shuttle enabled so we can update them\n // without invalidating entries\n if (!dev && omitNonDeterministic) {\n // client uses window. instead of leaving process.env\n // in case process isn't polyfilled on client already\n // since by this point it won't be added by webpack\n const safeKey = (key: string) =>\n isClient ? `window.${key.split('.').pop()}` : key\n\n for (const key in nextPublicEnv) {\n serializedDefineEnv[key] = safeKey(key)\n }\n for (const key in nextConfigEnv) {\n serializedDefineEnv[key] = safeKey(key)\n }\n if (!config.experimental.runtimeServerDeploymentId) {\n for (const key of ['process.env.NEXT_DEPLOYMENT_ID']) {\n serializedDefineEnv[key] = safeKey(key)\n }\n }\n }\n\n return serializedDefineEnv\n}\n"],"names":["getDefineEnv","DEFINE_ENV_EXPRESSION","Symbol","serializeDefineEnv","defineEnv","defineEnvStringified","Object","fromEntries","entries","map","key","value","JSON","stringify","getImageConfig","config","dev","deviceSizes","images","imageSizes","qualities","path","loader","dangerouslyAllowSVG","unoptimized","domains","remotePatterns","localPatterns","output","isTurbopack","clientRouterFilters","distDir","projectPath","fetchCacheKeyPrefix","hasRewrites","isClient","isEdgeServer","isNodeServer","middlewareMatchers","omitNonDeterministic","rewrites","nextPublicEnv","getNextPublicEnvironmentVariables","nextConfigEnv","getNextConfigEnv","isPPREnabled","checkIsAppPPREnabled","experimental","ppr","isCacheComponentsEnabled","cacheComponents","isUseCacheEnabled","useCache","__NEXT_DEFINE_ENV","EdgeRuntime","process","env","NEXT_EDGE_RUNTIME_PROVIDER","NEXT_RSPACK","allowDevelopmentBuild","NEXT_PRIVATE_DISABLE_DEV_OVERLAY_UX","Boolean","appNavFailHandling","appNewScrollHandler","cachedNavigations","coldCacheBadge","supportsImmutableAssets","useSkewCookie","deploymentId","runtimeServerDeploymentId","__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING","manualClientBasePath","isNaN","Number","staleTimes","dynamic","static","clientRouterFilter","staticFilter","dynamicFilter","validateRSCRequestHeaders","dynamicOnHover","useOffline","prefetchInlining","optimisticClientCache","proxyPrefetch","crossOrigin","__NEXT_TEST_MODE","relative","cwd","basePath","caseSensitiveRoutes","trailingSlash","devIndicators","position","reactStrictMode","optimizeCss","nextScriptWorkers","scrollRestoration","i18n","skipProxyUrlNormalize","externalProxyRewritesResolve","skipTrailingSlashRedirect","webVitalsAttribution","length","linkNoTouchStart","assetPrefix","authInterrupts","NEXT_TELEMETRY_DISABLED","undefined","needsExperimentalReact","multiZoneDraftMode","trustHostHeader","allowedRevalidateHeaderKeys","logging","browserToTerminal","mcpServer","turbopackFileSystemCacheForDev","reactDebugChannel","transitionIndicator","gestureTransition","optimisticRouting","instrumentationClientRouterTransitionEvents","appShells","varyParams","exposeTestingApiInProductionBuild","cacheLife","clientParamParsingOrigins","userDefines","compiler","define","hasOwnProperty","Error","userDefinesServer","defineServer","serializedDefineEnv","safeKey","split","pop"],"mappings":";;;;+BAwGgBA;;;eAAAA;;;iEAjGC;wCACsB;qBACF;2BAI9B;;;;;;AA8BP,MAAMC,wBAAwBC,OAAO;AAoBrC;;CAEC,GACD,SAASC,mBAAmBC,SAAoB;IAC9C,MAAMC,uBAA4CC,OAAOC,WAAW,CAClED,OAAOE,OAAO,CAACJ,WAAWK,GAAG,CAAC,CAAC,CAACC,KAAKC,MAAM,GAAK;YAC9CD;YACA,OAAOC,UAAU,YAAYV,yBAAyBU,QAClDA,KAAK,CAACV,sBAAsB,GAC5BW,KAAKC,SAAS,CAACF;SACpB;IAEH,OAAON;AACT;AAEA,SAASS,eACPC,MAA0B,EAC1BC,GAAY;QAUKD,gBAKSA,iBACDA;IAdzB,OAAO;QACL,iCAAiC;YAC/BE,aAAaF,OAAOG,MAAM,CAACD,WAAW;YACtCE,YAAYJ,OAAOG,MAAM,CAACC,UAAU;YACpCC,WAAWL,OAAOG,MAAM,CAACE,SAAS;YAClCC,MAAMN,OAAOG,MAAM,CAACG,IAAI;YACxBC,QAAQP,OAAOG,MAAM,CAACI,MAAM;YAC5BC,qBAAqBR,OAAOG,MAAM,CAACK,mBAAmB;YACtDC,WAAW,EAAET,2BAAAA,iBAAAA,OAAQG,MAAM,qBAAdH,eAAgBS,WAAW;YACxC,GAAIR,MACA;gBACE,6DAA6D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WAAW,CAAC,OAAO,EAAEzB,IAAI+H,KAAK,CAAC,KAAKC,GAAG,IAAI,GAAGhI;QAEhD,IAAK,MAAMA,OAAO+B,cAAe;YAC/B8F,mBAAmB,CAAC7H,IAAI,GAAG8H,QAAQ9H;QACrC;QACA,IAAK,MAAMA,OAAOiC,cAAe;YAC/B4F,mBAAmB,CAAC7H,IAAI,GAAG8H,QAAQ9H;QACrC;QACA,IAAI,CAACK,OAAOgC,YAAY,CAACsB,yBAAyB,EAAE;YAClD,KAAK,MAAM3D,OAAO;gBAAC;aAAiC,CAAE;gBACpD6H,mBAAmB,CAAC7H,IAAI,GAAG8H,QAAQ9H;YACrC;QACF;IACF;IAEA,OAAO6H;AACT","ignoreList":[0]} |
@@ -138,3 +138,3 @@ "use strict"; | ||
| }({}); | ||
| const nextVersion = "16.3.0-preview.4"; | ||
| const nextVersion = "16.3.0-preview.5"; | ||
| const ArchName = (0, _os.arch)(); | ||
@@ -141,0 +141,0 @@ const PlatformName = (0, _os.platform)(); |
@@ -96,3 +96,3 @@ "use strict"; | ||
| isPersistentCachingEnabled: persistentCaching, | ||
| nextVersion: "16.3.0-preview.4" | ||
| nextVersion: "16.3.0-preview.5" | ||
| }, { | ||
@@ -99,0 +99,0 @@ turbopackMemoryEviction: config.experimental.turbopackMemoryEvictionMode, |
@@ -118,3 +118,3 @@ // Import cpu-profile first to start profiling early if enabled | ||
| deferredEntries: config.experimental.deferredEntries, | ||
| nextVersion: "16.3.0-preview.4" | ||
| nextVersion: "16.3.0-preview.5" | ||
| }; | ||
@@ -121,0 +121,0 @@ const sharedTurboOptions = { |
@@ -6,5 +6,5 @@ 1:"$Sreact.fragment" | ||
| 7:"$Sreact.suspense" | ||
| 0:{"rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/_next/static/chunks/0xl2dc951qps8.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"gvgGK9YNB3OVevFmOdjbV"} | ||
| 0:{"rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/_next/static/chunks/0xl2dc951qps8.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"zaAOUXfi0DdJnlA1pFC-8"} | ||
| 4:{} | ||
| 5:"$0:rsc:props:children:0:props:serverProvidedParams:params" | ||
| 8:null |
@@ -12,3 +12,3 @@ 1:"$Sreact.fragment" | ||
| :HL["/_next/static/chunks/0i88bcw_h0tc6.css","style"] | ||
| 0:{"P":null,"c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/0fef2ar.1bdz..js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n (function() {\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n document.documentElement.classList.toggle('dark', theme === 'dark');\n\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {\n document.documentElement.classList.toggle('dark', e.matches);\n });\n })();\n "}}]}],["$","body",null,{"className":"font-sans antialiased","children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]]}]]}],{"children":[["$","$1","c",{"children":[["$","$L4",null,{"Component":"$5","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@6","$@7"]}}],[["$","script","script-0",{"src":"/_next/static/chunks/0xl2dc951qps8.js","async":true,"nonce":"$undefined"}]],["$","$L8",null,{"children":["$","$9",null,{"name":"Next.MetadataOutlet","children":"$@a"}]}]]}],{},null,false,null]},null,false,null],["$","$1","h",{"children":[null,["$","$Lb",null,{"children":"$Lc"}],["$","div",null,{"hidden":true,"children":["$","$Ld",null,{"children":["$","$9",null,{"name":"Next.Metadata","children":"$Le"}]}]}],null]}],false]],"m":"$undefined","G":["$f",[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"gvgGK9YNB3OVevFmOdjbV"} | ||
| 0:{"P":null,"c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/0fef2ar.1bdz..js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n (function() {\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n document.documentElement.classList.toggle('dark', theme === 'dark');\n\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {\n document.documentElement.classList.toggle('dark', e.matches);\n });\n })();\n "}}]}],["$","body",null,{"className":"font-sans antialiased","children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]]}]]}],{"children":[["$","$1","c",{"children":[["$","$L4",null,{"Component":"$5","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@6","$@7"]}}],[["$","script","script-0",{"src":"/_next/static/chunks/0xl2dc951qps8.js","async":true,"nonce":"$undefined"}]],["$","$L8",null,{"children":["$","$9",null,{"name":"Next.MetadataOutlet","children":"$@a"}]}]]}],{},null,false,null]},null,false,null],["$","$1","h",{"children":[null,["$","$Lb",null,{"children":"$Lc"}],["$","div",null,{"hidden":true,"children":["$","$Ld",null,{"children":["$","$9",null,{"name":"Next.Metadata","children":"$Le"}]}]}],null]}],false]],"m":"$undefined","G":["$f",[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"zaAOUXfi0DdJnlA1pFC-8"} | ||
| 6:{} | ||
@@ -15,0 +15,0 @@ 7:"$0:f:0:1:1:children:0:props:children:0:props:serverProvidedParams:params" |
@@ -5,2 +5,2 @@ 1:"$Sreact.fragment" | ||
| 4:"$Sreact.suspense" | ||
| 0:{"rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"Next.js Bundle Analyzer"}],["$","meta","1",{"name":"description","content":"Visualize and analyze your Next.js bundle sizes with interactive treemap and dependency analysis"}]]}]}]}],null]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"gvgGK9YNB3OVevFmOdjbV"} | ||
| 0:{"rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"Next.js Bundle Analyzer"}],["$","meta","1",{"name":"description","content":"Visualize and analyze your Next.js bundle sizes with interactive treemap and dependency analysis"}]]}]}]}],null]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"zaAOUXfi0DdJnlA1pFC-8"} |
@@ -5,2 +5,2 @@ 1:"$Sreact.fragment" | ||
| :HL["/_next/static/chunks/0i88bcw_h0tc6.css","style"] | ||
| 0:{"rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next"}],["$","script","script-0",{"src":"/_next/static/chunks/0fef2ar.1bdz..js","async":true}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n (function() {\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n document.documentElement.classList.toggle('dark', theme === 'dark');\n\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {\n document.documentElement.classList.toggle('dark', e.matches);\n });\n })();\n "}}]}],["$","body",null,{"className":"font-sans antialiased","children":["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"gvgGK9YNB3OVevFmOdjbV"} | ||
| 0:{"rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next"}],["$","script","script-0",{"src":"/_next/static/chunks/0fef2ar.1bdz..js","async":true}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n (function() {\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n document.documentElement.classList.toggle('dark', theme === 'dark');\n\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {\n document.documentElement.classList.toggle('dark', e.matches);\n });\n })();\n "}}]}],["$","body",null,{"className":"font-sans antialiased","children":["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"zaAOUXfi0DdJnlA1pFC-8"} |
| :HL["/_next/static/chunks/0i88bcw_h0tc6.css","style"] | ||
| 0:{"tree":{"name":"","param":null,"prefetchHints":16,"slots":{"children":{"name":"__PAGE__","param":null,"prefetchHints":0,"slots":null}}},"staleTime":300,"buildId":"gvgGK9YNB3OVevFmOdjbV"} | ||
| 0:{"tree":{"name":"","param":null,"prefetchHints":16,"slots":{"children":{"name":"__PAGE__","param":null,"prefetchHints":0,"slots":null}}},"staleTime":300,"buildId":"zaAOUXfi0DdJnlA1pFC-8"} |
@@ -10,2 +10,2 @@ <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/0i88bcw_h0tc6.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/0d4ot_2.1nmew.js"/><script src="/_next/static/chunks/14rcihda6~d~-.js" async=""></script><script src="/_next/static/chunks/0co-gl6-7li6g.js" async=""></script><script src="/_next/static/chunks/turbopack-0gxze4efaysqx.js" async=""></script><script src="/_next/static/chunks/0fef2ar.1bdz..js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>Next.js Bundle Analyzer</title><meta name="description" content="Visualize and analyze your Next.js bundle sizes with interactive treemap and dependency analysis"/><script> | ||
| })(); | ||
| </script><script src="/_next/static/chunks/03~yq9q893hmn.js" noModule=""></script></head><body class="font-sans antialiased"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/0d4ot_2.1nmew.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[85561,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\"]\n3:I[39293,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\"]\n4:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"ViewportBoundary\"]\na:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"MetadataBoundary\"]\nc:I[39586,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\",1]\n:HL[\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",16],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/0fef2ar.1bdz..js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n (function() {\\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\\n document.documentElement.classList.toggle('dark', theme === 'dark');\\n\\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) =\u003e {\\n document.documentElement.classList.toggle('dark', e.matches);\\n });\\n })();\\n \"}}]}],[\"$\",\"body\",null,{\"className\":\"font-sans antialiased\",\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"gvgGK9YNB3OVevFmOdjbV\"}\n"])</script><script>self.__next_f.push([1,"d:[]\n7:\"$Wd\"\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\nb:[[\"$\",\"title\",\"0\",{\"children\":\"Next.js Bundle Analyzer\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Visualize and analyze your Next.js bundle sizes with interactive treemap and dependency analysis\"}]]\n"])</script></body></html> | ||
| </script><script src="/_next/static/chunks/03~yq9q893hmn.js" noModule=""></script></head><body class="font-sans antialiased"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/0d4ot_2.1nmew.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[85561,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\"]\n3:I[39293,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\"]\n4:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"ViewportBoundary\"]\na:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"MetadataBoundary\"]\nc:I[39586,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\",1]\n:HL[\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",16],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/0fef2ar.1bdz..js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n (function() {\\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\\n document.documentElement.classList.toggle('dark', theme === 'dark');\\n\\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) =\u003e {\\n document.documentElement.classList.toggle('dark', e.matches);\\n });\\n })();\\n \"}}]}],[\"$\",\"body\",null,{\"className\":\"font-sans antialiased\",\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"zaAOUXfi0DdJnlA1pFC-8\"}\n"])</script><script>self.__next_f.push([1,"d:[]\n7:\"$Wd\"\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\nb:[[\"$\",\"title\",\"0\",{\"children\":\"Next.js Bundle Analyzer\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Visualize and analyze your Next.js bundle sizes with interactive treemap and dependency analysis\"}]]\n"])</script></body></html> |
@@ -10,3 +10,3 @@ 1:"$Sreact.fragment" | ||
| :HL["/_next/static/chunks/0i88bcw_h0tc6.css","style"] | ||
| 0:{"P":null,"c":["","_not-found"],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/0fef2ar.1bdz..js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n (function() {\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n document.documentElement.classList.toggle('dark', theme === 'dark');\n\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {\n document.documentElement.classList.toggle('dark', e.matches);\n });\n })();\n "}}]}],["$","body",null,{"className":"font-sans antialiased","children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L4",null,{"children":["$","$5",null,{"name":"Next.MetadataOutlet","children":"$@6"}]}]]}],{},null,false,null]},null,false,"$@7"]},null,false,null],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$5",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],null]}],false]],"m":"$undefined","G":["$c",[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"gvgGK9YNB3OVevFmOdjbV"} | ||
| 0:{"P":null,"c":["","_not-found"],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/0fef2ar.1bdz..js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n (function() {\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n document.documentElement.classList.toggle('dark', theme === 'dark');\n\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {\n document.documentElement.classList.toggle('dark', e.matches);\n });\n })();\n "}}]}],["$","body",null,{"className":"font-sans antialiased","children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L4",null,{"children":["$","$5",null,{"name":"Next.MetadataOutlet","children":"$@6"}]}]]}],{},null,false,null]},null,false,"$@7"]},null,false,null],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$5",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],null]}],false]],"m":"$undefined","G":["$c",[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"zaAOUXfi0DdJnlA1pFC-8"} | ||
| d:[] | ||
@@ -13,0 +13,0 @@ 7:"$Wd" |
@@ -10,3 +10,3 @@ 1:"$Sreact.fragment" | ||
| :HL["/_next/static/chunks/0i88bcw_h0tc6.css","style"] | ||
| 0:{"P":null,"c":["","_not-found"],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/0fef2ar.1bdz..js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n (function() {\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n document.documentElement.classList.toggle('dark', theme === 'dark');\n\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {\n document.documentElement.classList.toggle('dark', e.matches);\n });\n })();\n "}}]}],["$","body",null,{"className":"font-sans antialiased","children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L4",null,{"children":["$","$5",null,{"name":"Next.MetadataOutlet","children":"$@6"}]}]]}],{},null,false,null]},null,false,"$@7"]},null,false,null],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$5",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],null]}],false]],"m":"$undefined","G":["$c",[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"gvgGK9YNB3OVevFmOdjbV"} | ||
| 0:{"P":null,"c":["","_not-found"],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/0fef2ar.1bdz..js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n (function() {\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n document.documentElement.classList.toggle('dark', theme === 'dark');\n\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {\n document.documentElement.classList.toggle('dark', e.matches);\n });\n })();\n "}}]}],["$","body",null,{"className":"font-sans antialiased","children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L4",null,{"children":["$","$5",null,{"name":"Next.MetadataOutlet","children":"$@6"}]}]]}],{},null,false,null]},null,false,"$@7"]},null,false,null],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$5",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],null]}],false]],"m":"$undefined","G":["$c",[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"zaAOUXfi0DdJnlA1pFC-8"} | ||
| d:[] | ||
@@ -13,0 +13,0 @@ 7:"$Wd" |
@@ -5,2 +5,2 @@ 1:"$Sreact.fragment" | ||
| 4:"$Sreact.suspense" | ||
| 0:{"rsc":["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"Next.js Bundle Analyzer"}],["$","meta","1",{"name":"description","content":"Visualize and analyze your Next.js bundle sizes with interactive treemap and dependency analysis"}]]}]}]}],null]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"gvgGK9YNB3OVevFmOdjbV"} | ||
| 0:{"rsc":["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"Next.js Bundle Analyzer"}],["$","meta","1",{"name":"description","content":"Visualize and analyze your Next.js bundle sizes with interactive treemap and dependency analysis"}]]}]}]}],null]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"zaAOUXfi0DdJnlA1pFC-8"} |
@@ -5,2 +5,2 @@ 1:"$Sreact.fragment" | ||
| :HL["/_next/static/chunks/0i88bcw_h0tc6.css","style"] | ||
| 0:{"rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next"}],["$","script","script-0",{"src":"/_next/static/chunks/0fef2ar.1bdz..js","async":true}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n (function() {\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n document.documentElement.classList.toggle('dark', theme === 'dark');\n\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {\n document.documentElement.classList.toggle('dark', e.matches);\n });\n })();\n "}}]}],["$","body",null,{"className":"font-sans antialiased","children":["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"gvgGK9YNB3OVevFmOdjbV"} | ||
| 0:{"rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next"}],["$","script","script-0",{"src":"/_next/static/chunks/0fef2ar.1bdz..js","async":true}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n (function() {\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n document.documentElement.classList.toggle('dark', theme === 'dark');\n\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {\n document.documentElement.classList.toggle('dark', e.matches);\n });\n })();\n "}}]}],["$","body",null,{"className":"font-sans antialiased","children":["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"zaAOUXfi0DdJnlA1pFC-8"} |
| 1:"$Sreact.fragment" | ||
| 2:I[94039,["/_next/static/chunks/0fef2ar.1bdz..js"],"OutletBoundary"] | ||
| 3:"$Sreact.suspense" | ||
| 0:{"rsc":["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],null,["$","$L2",null,{"children":["$","$3",null,{"name":"Next.MetadataOutlet","children":"$@4"}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"gvgGK9YNB3OVevFmOdjbV"} | ||
| 0:{"rsc":["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],null,["$","$L2",null,{"children":["$","$3",null,{"name":"Next.MetadataOutlet","children":"$@4"}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"zaAOUXfi0DdJnlA1pFC-8"} | ||
| 4:null |
@@ -5,2 +5,2 @@ 1:"$Sreact.fragment" | ||
| 4:[] | ||
| 0:{"rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"isPartial":false,"staleTime":300,"varyParams":"$W4","buildId":"gvgGK9YNB3OVevFmOdjbV"} | ||
| 0:{"rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"isPartial":false,"staleTime":300,"varyParams":"$W4","buildId":"zaAOUXfi0DdJnlA1pFC-8"} |
| :HL["/_next/static/chunks/0i88bcw_h0tc6.css","style"] | ||
| 0:{"tree":{"name":"","param":null,"prefetchHints":16,"slots":{"children":{"name":"/_not-found","param":null,"prefetchHints":0,"slots":{"children":{"name":"__PAGE__","param":null,"prefetchHints":0,"slots":null}}}}},"staleTime":300,"buildId":"gvgGK9YNB3OVevFmOdjbV"} | ||
| 0:{"tree":{"name":"","param":null,"prefetchHints":16,"slots":{"children":{"name":"/_not-found","param":null,"prefetchHints":0,"slots":{"children":{"name":"__PAGE__","param":null,"prefetchHints":0,"slots":null}}}}},"staleTime":300,"buildId":"zaAOUXfi0DdJnlA1pFC-8"} |
@@ -10,2 +10,2 @@ <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/0i88bcw_h0tc6.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/0d4ot_2.1nmew.js"/><script src="/_next/static/chunks/14rcihda6~d~-.js" async=""></script><script src="/_next/static/chunks/0co-gl6-7li6g.js" async=""></script><script src="/_next/static/chunks/turbopack-0gxze4efaysqx.js" async=""></script><script src="/_next/static/chunks/0fef2ar.1bdz..js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>Next.js Bundle Analyzer</title><meta name="description" content="Visualize and analyze your Next.js bundle sizes with interactive treemap and dependency analysis"/><script> | ||
| })(); | ||
| </script><script src="/_next/static/chunks/03~yq9q893hmn.js" noModule=""></script></head><body class="font-sans antialiased"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/0d4ot_2.1nmew.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[85561,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\"]\n3:I[39293,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\"]\n4:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"ViewportBoundary\"]\na:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"MetadataBoundary\"]\nc:I[39586,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\",1]\n:HL[\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",16],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/0fef2ar.1bdz..js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n (function() {\\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\\n document.documentElement.classList.toggle('dark', theme === 'dark');\\n\\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) =\u003e {\\n document.documentElement.classList.toggle('dark', e.matches);\\n });\\n })();\\n \"}}]}],[\"$\",\"body\",null,{\"className\":\"font-sans antialiased\",\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"gvgGK9YNB3OVevFmOdjbV\"}\n"])</script><script>self.__next_f.push([1,"d:[]\n7:\"$Wd\"\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\nb:[[\"$\",\"title\",\"0\",{\"children\":\"Next.js Bundle Analyzer\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Visualize and analyze your Next.js bundle sizes with interactive treemap and dependency analysis\"}]]\n"])</script></body></html> | ||
| </script><script src="/_next/static/chunks/03~yq9q893hmn.js" noModule=""></script></head><body class="font-sans antialiased"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/0d4ot_2.1nmew.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[85561,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\"]\n3:I[39293,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\"]\n4:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"ViewportBoundary\"]\na:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"MetadataBoundary\"]\nc:I[39586,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\",1]\n:HL[\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",16],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/0fef2ar.1bdz..js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n (function() {\\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\\n document.documentElement.classList.toggle('dark', theme === 'dark');\\n\\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) =\u003e {\\n document.documentElement.classList.toggle('dark', e.matches);\\n });\\n })();\\n \"}}]}],[\"$\",\"body\",null,{\"className\":\"font-sans antialiased\",\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"zaAOUXfi0DdJnlA1pFC-8\"}\n"])</script><script>self.__next_f.push([1,"d:[]\n7:\"$Wd\"\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\nb:[[\"$\",\"title\",\"0\",{\"children\":\"Next.js Bundle Analyzer\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Visualize and analyze your Next.js bundle sizes with interactive treemap and dependency analysis\"}]]\n"])</script></body></html> |
@@ -10,2 +10,2 @@ <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/0i88bcw_h0tc6.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/0d4ot_2.1nmew.js"/><script src="/_next/static/chunks/14rcihda6~d~-.js" async=""></script><script src="/_next/static/chunks/0co-gl6-7li6g.js" async=""></script><script src="/_next/static/chunks/turbopack-0gxze4efaysqx.js" async=""></script><script src="/_next/static/chunks/0fef2ar.1bdz..js" async=""></script><script src="/_next/static/chunks/0xl2dc951qps8.js" async=""></script><title>Next.js Bundle Analyzer</title><meta name="description" content="Visualize and analyze your Next.js bundle sizes with interactive treemap and dependency analysis"/><script> | ||
| })(); | ||
| </script><script src="/_next/static/chunks/03~yq9q893hmn.js" noModule=""></script></head><body class="font-sans antialiased"><div hidden=""><!--$--><!--/$--></div><main class="h-screen flex flex-col bg-background"><div class="flex-none px-4 py-2 border-b border-border flex items-center gap-3"><div class="flex-1 flex"><div class="flex items-center gap-2 min-w-64 max-w-full"><button class="inline-flex items-center gap-2 whitespace-nowrap rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground h-9 px-4 py-2 flex-grow-1 w-full justify-between font-mono text-sm" role="combobox" aria-expanded="false" disabled="" type="button" aria-haspopup="dialog" aria-controls="radix-_R_lbtb_" data-state="closed"><div class="flex items-center"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-loader mr-2 inline animate-spin" aria-hidden="true"><path d="M12 2v4"></path><path d="m16.2 7.8 2.9-2.9"></path><path d="M18 12h4"></path><path d="m16.2 16.2 2.9 2.9"></path><path d="M12 18v4"></path><path d="m4.9 19.1 2.9-2.9"></path><path d="M2 12h4"></path><path d="m4.9 4.9 2.9 2.9"></path></svg>Loading routes...</div><div class="flex items-center gap-2"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevrons-up-down h-4 w-4 shrink-0 opacity-50" aria-hidden="true"><path d="m7 15 5 5 5-5"></path><path d="m7 9 5-5 5 5"></path></svg></div></button></div></div><div class="flex items-center gap-2"></div></div><div class="flex-1 flex min-h-0"><div class="flex-1 min-w-0 p-4 bg-background"><div class="h-full w-full grid grid-cols-12 grid-rows-8 gap-2"><div class="animate-pulse rounded-md bg-muted col-span-5 row-span-4"></div><div class="animate-pulse rounded-md bg-muted col-span-4 row-span-3"></div><div class="animate-pulse rounded-md bg-muted col-span-3 row-span-3"></div><div class="animate-pulse rounded-md bg-muted col-span-4 row-span-1"></div><div class="animate-pulse rounded-md bg-muted col-span-3 row-span-2"></div><div class="animate-pulse rounded-md bg-muted col-span-3 row-span-4"></div><div class="animate-pulse rounded-md bg-muted col-span-2 row-span-2"></div><div class="animate-pulse rounded-md bg-muted col-span-2 row-span-2"></div><div class="animate-pulse rounded-md bg-muted col-span-3 row-span-2"></div><div class="animate-pulse rounded-md bg-muted col-span-4 row-span-2"></div><div class="animate-pulse rounded-md bg-muted col-span-2 row-span-2"></div><div class="animate-pulse rounded-md bg-muted col-span-3 row-span-2"></div></div></div><button type="button" class="flex-none w-1 bg-border cursor-col-resize transition-colors" disabled="" aria-label="Resize sidebar"></button><div class="flex-none bg-muted border-l border-border overflow-y-auto" style="width:20%"><div class="flex-1 p-3 space-y-4 overflow-y-auto"><div class="animate-pulse rounded-md bg-muted h-4 w-3/4"></div><div class="animate-pulse rounded-md bg-muted h-4 w-full"></div><div class="animate-pulse rounded-md bg-muted h-4 w-5/6"></div><div class="mt-4 space-y-2"><div class="animate-pulse rounded-md bg-muted h-3 w-full"></div><div class="animate-pulse rounded-md bg-muted h-3 w-full"></div><div class="animate-pulse rounded-md bg-muted h-3 w-4/5"></div></div></div></div></div></main><!--$--><!--/$--><script src="/_next/static/chunks/0d4ot_2.1nmew.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[85561,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\"]\n3:I[39293,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\"]\n4:I[25399,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"ClientPageRoot\"]\n5:I[79331,[\"/_next/static/chunks/0fef2ar.1bdz..js\",\"/_next/static/chunks/0xl2dc951qps8.js\"],\"default\"]\n8:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"OutletBoundary\"]\n9:\"$Sreact.suspense\"\nb:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"ViewportBoundary\"]\nd:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"MetadataBoundary\"]\nf:I[39586,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\",1]\n:HL[\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]},\"$undefined\",\"$undefined\",16],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/0fef2ar.1bdz..js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n (function() {\\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\\n document.documentElement.classList.toggle('dark', theme === 'dark');\\n\\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) =\u003e {\\n document.documentElement.classList.toggle('dark', e.matches);\\n });\\n })();\\n \"}}]}],[\"$\",\"body\",null,{\"className\":\"font-sans antialiased\",\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$L4\",null,{\"Component\":\"$5\",\"serverProvidedParams\":{\"searchParams\":{},\"params\":{},\"promises\":[\"$@6\",\"$@7\"]}}],[[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/0xl2dc951qps8.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"$L8\",null,{\"children\":[\"$\",\"$9\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@a\"}]}]]}],{},null,false,null]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$Lb\",null,{\"children\":\"$Lc\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Ld\",null,{\"children\":[\"$\",\"$9\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Le\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$f\",[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"gvgGK9YNB3OVevFmOdjbV\"}\n"])</script><script>self.__next_f.push([1,"6:{}\n7:\"$0:f:0:1:1:children:0:props:children:0:props:serverProvidedParams:params\"\n"])</script><script>self.__next_f.push([1,"c:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"a:null\ne:[[\"$\",\"title\",\"0\",{\"children\":\"Next.js Bundle Analyzer\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Visualize and analyze your Next.js bundle sizes with interactive treemap and dependency analysis\"}]]\n"])</script></body></html> | ||
| </script><script src="/_next/static/chunks/03~yq9q893hmn.js" noModule=""></script></head><body class="font-sans antialiased"><div hidden=""><!--$--><!--/$--></div><main class="h-screen flex flex-col bg-background"><div class="flex-none px-4 py-2 border-b border-border flex items-center gap-3"><div class="flex-1 flex"><div class="flex items-center gap-2 min-w-64 max-w-full"><button class="inline-flex items-center gap-2 whitespace-nowrap rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground h-9 px-4 py-2 flex-grow-1 w-full justify-between font-mono text-sm" role="combobox" aria-expanded="false" disabled="" type="button" aria-haspopup="dialog" aria-controls="radix-_R_lbtb_" data-state="closed"><div class="flex items-center"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-loader mr-2 inline animate-spin" aria-hidden="true"><path d="M12 2v4"></path><path d="m16.2 7.8 2.9-2.9"></path><path d="M18 12h4"></path><path d="m16.2 16.2 2.9 2.9"></path><path d="M12 18v4"></path><path d="m4.9 19.1 2.9-2.9"></path><path d="M2 12h4"></path><path d="m4.9 4.9 2.9 2.9"></path></svg>Loading routes...</div><div class="flex items-center gap-2"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevrons-up-down h-4 w-4 shrink-0 opacity-50" aria-hidden="true"><path d="m7 15 5 5 5-5"></path><path d="m7 9 5-5 5 5"></path></svg></div></button></div></div><div class="flex items-center gap-2"></div></div><div class="flex-1 flex min-h-0"><div class="flex-1 min-w-0 p-4 bg-background"><div class="h-full w-full grid grid-cols-12 grid-rows-8 gap-2"><div class="animate-pulse rounded-md bg-muted col-span-5 row-span-4"></div><div class="animate-pulse rounded-md bg-muted col-span-4 row-span-3"></div><div class="animate-pulse rounded-md bg-muted col-span-3 row-span-3"></div><div class="animate-pulse rounded-md bg-muted col-span-4 row-span-1"></div><div class="animate-pulse rounded-md bg-muted col-span-3 row-span-2"></div><div class="animate-pulse rounded-md bg-muted col-span-3 row-span-4"></div><div class="animate-pulse rounded-md bg-muted col-span-2 row-span-2"></div><div class="animate-pulse rounded-md bg-muted col-span-2 row-span-2"></div><div class="animate-pulse rounded-md bg-muted col-span-3 row-span-2"></div><div class="animate-pulse rounded-md bg-muted col-span-4 row-span-2"></div><div class="animate-pulse rounded-md bg-muted col-span-2 row-span-2"></div><div class="animate-pulse rounded-md bg-muted col-span-3 row-span-2"></div></div></div><button type="button" class="flex-none w-1 bg-border cursor-col-resize transition-colors" disabled="" aria-label="Resize sidebar"></button><div class="flex-none bg-muted border-l border-border overflow-y-auto" style="width:20%"><div class="flex-1 p-3 space-y-4 overflow-y-auto"><div class="animate-pulse rounded-md bg-muted h-4 w-3/4"></div><div class="animate-pulse rounded-md bg-muted h-4 w-full"></div><div class="animate-pulse rounded-md bg-muted h-4 w-5/6"></div><div class="mt-4 space-y-2"><div class="animate-pulse rounded-md bg-muted h-3 w-full"></div><div class="animate-pulse rounded-md bg-muted h-3 w-full"></div><div class="animate-pulse rounded-md bg-muted h-3 w-4/5"></div></div></div></div></div></main><!--$--><!--/$--><script src="/_next/static/chunks/0d4ot_2.1nmew.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[85561,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\"]\n3:I[39293,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\"]\n4:I[25399,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"ClientPageRoot\"]\n5:I[79331,[\"/_next/static/chunks/0fef2ar.1bdz..js\",\"/_next/static/chunks/0xl2dc951qps8.js\"],\"default\"]\n8:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"OutletBoundary\"]\n9:\"$Sreact.suspense\"\nb:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"ViewportBoundary\"]\nd:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"MetadataBoundary\"]\nf:I[39586,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\",1]\n:HL[\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]},\"$undefined\",\"$undefined\",16],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/0fef2ar.1bdz..js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n (function() {\\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\\n document.documentElement.classList.toggle('dark', theme === 'dark');\\n\\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) =\u003e {\\n document.documentElement.classList.toggle('dark', e.matches);\\n });\\n })();\\n \"}}]}],[\"$\",\"body\",null,{\"className\":\"font-sans antialiased\",\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$L4\",null,{\"Component\":\"$5\",\"serverProvidedParams\":{\"searchParams\":{},\"params\":{},\"promises\":[\"$@6\",\"$@7\"]}}],[[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/0xl2dc951qps8.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"$L8\",null,{\"children\":[\"$\",\"$9\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@a\"}]}]]}],{},null,false,null]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$Lb\",null,{\"children\":\"$Lc\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Ld\",null,{\"children\":[\"$\",\"$9\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Le\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$f\",[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"zaAOUXfi0DdJnlA1pFC-8\"}\n"])</script><script>self.__next_f.push([1,"6:{}\n7:\"$0:f:0:1:1:children:0:props:children:0:props:serverProvidedParams:params\"\n"])</script><script>self.__next_f.push([1,"c:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"a:null\ne:[[\"$\",\"title\",\"0\",{\"children\":\"Next.js Bundle Analyzer\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Visualize and analyze your Next.js bundle sizes with interactive treemap and dependency analysis\"}]]\n"])</script></body></html> |
@@ -12,3 +12,3 @@ 1:"$Sreact.fragment" | ||
| :HL["/_next/static/chunks/0i88bcw_h0tc6.css","style"] | ||
| 0:{"P":null,"c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/0fef2ar.1bdz..js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n (function() {\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n document.documentElement.classList.toggle('dark', theme === 'dark');\n\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {\n document.documentElement.classList.toggle('dark', e.matches);\n });\n })();\n "}}]}],["$","body",null,{"className":"font-sans antialiased","children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]]}]]}],{"children":[["$","$1","c",{"children":[["$","$L4",null,{"Component":"$5","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@6","$@7"]}}],[["$","script","script-0",{"src":"/_next/static/chunks/0xl2dc951qps8.js","async":true,"nonce":"$undefined"}]],["$","$L8",null,{"children":["$","$9",null,{"name":"Next.MetadataOutlet","children":"$@a"}]}]]}],{},null,false,null]},null,false,null],["$","$1","h",{"children":[null,["$","$Lb",null,{"children":"$Lc"}],["$","div",null,{"hidden":true,"children":["$","$Ld",null,{"children":["$","$9",null,{"name":"Next.Metadata","children":"$Le"}]}]}],null]}],false]],"m":"$undefined","G":["$f",[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"gvgGK9YNB3OVevFmOdjbV"} | ||
| 0:{"P":null,"c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/0fef2ar.1bdz..js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n (function() {\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n document.documentElement.classList.toggle('dark', theme === 'dark');\n\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {\n document.documentElement.classList.toggle('dark', e.matches);\n });\n })();\n "}}]}],["$","body",null,{"className":"font-sans antialiased","children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]]}]]}],{"children":[["$","$1","c",{"children":[["$","$L4",null,{"Component":"$5","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@6","$@7"]}}],[["$","script","script-0",{"src":"/_next/static/chunks/0xl2dc951qps8.js","async":true,"nonce":"$undefined"}]],["$","$L8",null,{"children":["$","$9",null,{"name":"Next.MetadataOutlet","children":"$@a"}]}]]}],{},null,false,null]},null,false,null],["$","$1","h",{"children":[null,["$","$Lb",null,{"children":"$Lc"}],["$","div",null,{"hidden":true,"children":["$","$Ld",null,{"children":["$","$9",null,{"name":"Next.Metadata","children":"$Le"}]}]}],null]}],false]],"m":"$undefined","G":["$f",[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"zaAOUXfi0DdJnlA1pFC-8"} | ||
| 6:{} | ||
@@ -15,0 +15,0 @@ 7:"$0:f:0:1:1:children:0:props:children:0:props:serverProvidedParams:params" |
@@ -42,3 +42,3 @@ #!/usr/bin/env node | ||
| const nextBuild = async (options, directory)=>{ | ||
| process.title = `next-build (v${"16.3.0-preview.4"})`; | ||
| process.title = `next-build (v${"16.3.0-preview.5"})`; | ||
| process.on('SIGTERM', ()=>{ | ||
@@ -45,0 +45,0 @@ (0, _cpuprofile.saveCpuProfile)(); |
@@ -43,3 +43,3 @@ #!/usr/bin/env node | ||
| const bindings = await (0, _swc.loadBindings)((_config_experimental1 = config.experimental) == null ? void 0 : _config_experimental1.useWasmBinary); | ||
| await bindings.turbo.databaseCompact(cachePath, "16.3.0-preview.4"); | ||
| await bindings.turbo.databaseCompact(cachePath, "16.3.0-preview.5"); | ||
| console.log('Turbopack database compaction complete.'); | ||
@@ -46,0 +46,0 @@ }; |
@@ -18,3 +18,3 @@ /** | ||
| const _setattributesfromprops = require("./set-attributes-from-props"); | ||
| const version = "16.3.0-preview.4"; | ||
| const version = "16.3.0-preview.5"; | ||
| window.next = { | ||
@@ -21,0 +21,0 @@ version, |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/client/components/app-router-headers.ts"],"sourcesContent":["export const RSC_HEADER = 'rsc' as const\nexport const ACTION_HEADER = 'next-action' as const\n// TODO: Instead of sending the full router state, we only need to send the\n// segment path. Saves bytes. Then we could also use this field for segment\n// prefetches, which also need to specify a particular segment.\nexport const NEXT_ROUTER_STATE_TREE_HEADER = 'next-router-state-tree' as const\nexport const NEXT_ROUTER_PREFETCH_HEADER = 'next-router-prefetch' as const\n// This contains the path to the segment being prefetched.\n// TODO: If we change next-router-state-tree to be a segment path, we can use\n// that instead. Then next-router-prefetch and next-router-segment-prefetch can\n// be merged into a single enum.\nexport const NEXT_ROUTER_SEGMENT_PREFETCH_HEADER =\n 'next-router-segment-prefetch' as const\nexport const NEXT_HMR_REFRESH_HEADER = 'next-hmr-refresh' as const\nexport const NEXT_HMR_REFRESH_HASH_COOKIE = '__next_hmr_refresh_hash__' as const\nexport const NEXT_URL = 'next-url' as const\nexport const RSC_CONTENT_TYPE_HEADER = 'text/x-component' as const\n\n// Cookie for the Instant Navigation Testing API. Sent automatically with all\n// requests while a navigation lock is held; the server uses its presence to\n// render only the static shell. Not exposed in production builds by default.\nexport const NEXT_INSTANT_TEST_COOKIE =\n 'next-instant-navigation-testing' as const\n\nexport const FLIGHT_HEADERS = [\n RSC_HEADER,\n NEXT_ROUTER_STATE_TREE_HEADER,\n NEXT_ROUTER_PREFETCH_HEADER,\n NEXT_HMR_REFRESH_HEADER,\n NEXT_ROUTER_SEGMENT_PREFETCH_HEADER,\n] as const\n\nexport const NEXT_RSC_UNION_QUERY = '_rsc' as const\n\nexport const NEXT_ROUTER_STALE_TIME_HEADER = 'x-nextjs-stale-time' as const\nexport const NEXT_DID_POSTPONE_HEADER = 'x-nextjs-postponed' as const\nexport const NEXT_REWRITTEN_PATH_HEADER = 'x-nextjs-rewritten-path' as const\nexport const NEXT_REWRITTEN_QUERY_HEADER = 'x-nextjs-rewritten-query' as const\nexport const NEXT_IS_PRERENDER_HEADER = 'x-nextjs-prerender' as const\nexport const NEXT_ACTION_NOT_FOUND_HEADER = 'x-nextjs-action-not-found' as const\nexport const NEXT_REQUEST_ID_HEADER = 'x-nextjs-request-id' as const\nexport const NEXT_HTML_REQUEST_ID_HEADER = 'x-nextjs-html-request-id' as const\n\n// TODO: Should this include nextjs in the name, like the others?\nexport const NEXT_ACTION_REVALIDATED_HEADER = 'x-action-revalidated' as const\n"],"names":["ACTION_HEADER","FLIGHT_HEADERS","NEXT_ACTION_NOT_FOUND_HEADER","NEXT_ACTION_REVALIDATED_HEADER","NEXT_DID_POSTPONE_HEADER","NEXT_HMR_REFRESH_HASH_COOKIE","NEXT_HMR_REFRESH_HEADER","NEXT_HTML_REQUEST_ID_HEADER","NEXT_INSTANT_TEST_COOKIE","NEXT_IS_PRERENDER_HEADER","NEXT_REQUEST_ID_HEADER","NEXT_REWRITTEN_PATH_HEADER","NEXT_REWRITTEN_QUERY_HEADER","NEXT_ROUTER_PREFETCH_HEADER","NEXT_ROUTER_SEGMENT_PREFETCH_HEADER","NEXT_ROUTER_STALE_TIME_HEADER","NEXT_ROUTER_STATE_TREE_HEADER","NEXT_RSC_UNION_QUERY","NEXT_URL","RSC_CONTENT_TYPE_HEADER","RSC_HEADER"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IACaA,aAAa;eAAbA;;IAuBAC,cAAc;eAAdA;;IAeAC,4BAA4B;eAA5BA;;IAKAC,8BAA8B;eAA9BA;;IATAC,wBAAwB;eAAxBA;;IArBAC,4BAA4B;eAA5BA;;IADAC,uBAAuB;eAAvBA;;IA4BAC,2BAA2B;eAA3BA;;IApBAC,wBAAwB;eAAxBA;;IAiBAC,wBAAwB;eAAxBA;;IAEAC,sBAAsB;eAAtBA;;IAJAC,0BAA0B;eAA1BA;;IACAC,2BAA2B;eAA3BA;;IA/BAC,2BAA2B;eAA3BA;;IAKAC,mCAAmC;eAAnCA;;IAuBAC,6BAA6B;eAA7BA;;IA7BAC,6BAA6B;eAA7BA;;IA2BAC,oBAAoB;eAApBA;;IAjBAC,QAAQ;eAARA;;IACAC,uBAAuB;eAAvBA;;IAhBAC,UAAU;eAAVA;;;AAAN,MAAMA,aAAa;AACnB,MAAMpB,gBAAgB;AAItB,MAAMgB,gCAAgC;AACtC,MAAMH,8BAA8B;AAKpC,MAAMC,sCACX;AACK,MAAMR,0BAA0B;AAChC,MAAMD,+BAA+B;AACrC,MAAMa,WAAW;AACjB,MAAMC,0BAA0B;AAKhC,MAAMX,2BACX;AAEK,MAAMP,iBAAiB;IAC5BmB;IACAJ;IACAH;IACAP;IACAQ;CACD;AAEM,MAAMG,uBAAuB;AAE7B,MAAMF,gCAAgC;AACtC,MAAMX,2BAA2B;AACjC,MAAMO,6BAA6B;AACnC,MAAMC,8BAA8B;AACpC,MAAMH,2BAA2B;AACjC,MAAMP,+BAA+B;AACrC,MAAMQ,yBAAyB;AAC/B,MAAMH,8BAA8B;AAGpC,MAAMJ,iCAAiC","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/client/components/app-router-headers.ts"],"sourcesContent":["export const RSC_HEADER = 'rsc' as const\nexport const ACTION_HEADER = 'next-action' as const\n// TODO: Instead of sending the full router state, we only need to send the\n// segment path. Saves bytes. Then we could also use this field for segment\n// prefetches, which also need to specify a particular segment.\nexport const NEXT_ROUTER_STATE_TREE_HEADER = 'next-router-state-tree' as const\nexport const NEXT_ROUTER_PREFETCH_HEADER = 'next-router-prefetch' as const\n// This contains the path to the segment being prefetched.\n// TODO: If we change next-router-state-tree to be a segment path, we can use\n// that instead. Then next-router-prefetch and next-router-segment-prefetch can\n// be merged into a single enum.\nexport const NEXT_ROUTER_SEGMENT_PREFETCH_HEADER =\n 'next-router-segment-prefetch' as const\nexport const NEXT_HMR_REFRESH_HEADER = 'next-hmr-refresh' as const\nexport const NEXT_HMR_REFRESH_HASH_COOKIE = '__next_hmr_refresh_hash__' as const\nexport const NEXT_URL = 'next-url' as const\nexport const RSC_CONTENT_TYPE_HEADER = 'text/x-component' as const\n\n// Cookie for the Instant Navigation Testing API. Sent automatically with all\n// requests while a navigation lock is held; the server uses its presence to\n// render only the shell. Not exposed in production builds by default.\nexport const NEXT_INSTANT_TEST_COOKIE =\n 'next-instant-navigation-testing' as const\n\nexport const FLIGHT_HEADERS = [\n RSC_HEADER,\n NEXT_ROUTER_STATE_TREE_HEADER,\n NEXT_ROUTER_PREFETCH_HEADER,\n NEXT_HMR_REFRESH_HEADER,\n NEXT_ROUTER_SEGMENT_PREFETCH_HEADER,\n] as const\n\nexport const NEXT_RSC_UNION_QUERY = '_rsc' as const\n\nexport const NEXT_ROUTER_STALE_TIME_HEADER = 'x-nextjs-stale-time' as const\nexport const NEXT_DID_POSTPONE_HEADER = 'x-nextjs-postponed' as const\nexport const NEXT_REWRITTEN_PATH_HEADER = 'x-nextjs-rewritten-path' as const\nexport const NEXT_REWRITTEN_QUERY_HEADER = 'x-nextjs-rewritten-query' as const\nexport const NEXT_IS_PRERENDER_HEADER = 'x-nextjs-prerender' as const\nexport const NEXT_ACTION_NOT_FOUND_HEADER = 'x-nextjs-action-not-found' as const\nexport const NEXT_REQUEST_ID_HEADER = 'x-nextjs-request-id' as const\nexport const NEXT_HTML_REQUEST_ID_HEADER = 'x-nextjs-html-request-id' as const\n\n// TODO: Should this include nextjs in the name, like the others?\nexport const NEXT_ACTION_REVALIDATED_HEADER = 'x-action-revalidated' as const\n"],"names":["ACTION_HEADER","FLIGHT_HEADERS","NEXT_ACTION_NOT_FOUND_HEADER","NEXT_ACTION_REVALIDATED_HEADER","NEXT_DID_POSTPONE_HEADER","NEXT_HMR_REFRESH_HASH_COOKIE","NEXT_HMR_REFRESH_HEADER","NEXT_HTML_REQUEST_ID_HEADER","NEXT_INSTANT_TEST_COOKIE","NEXT_IS_PRERENDER_HEADER","NEXT_REQUEST_ID_HEADER","NEXT_REWRITTEN_PATH_HEADER","NEXT_REWRITTEN_QUERY_HEADER","NEXT_ROUTER_PREFETCH_HEADER","NEXT_ROUTER_SEGMENT_PREFETCH_HEADER","NEXT_ROUTER_STALE_TIME_HEADER","NEXT_ROUTER_STATE_TREE_HEADER","NEXT_RSC_UNION_QUERY","NEXT_URL","RSC_CONTENT_TYPE_HEADER","RSC_HEADER"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IACaA,aAAa;eAAbA;;IAuBAC,cAAc;eAAdA;;IAeAC,4BAA4B;eAA5BA;;IAKAC,8BAA8B;eAA9BA;;IATAC,wBAAwB;eAAxBA;;IArBAC,4BAA4B;eAA5BA;;IADAC,uBAAuB;eAAvBA;;IA4BAC,2BAA2B;eAA3BA;;IApBAC,wBAAwB;eAAxBA;;IAiBAC,wBAAwB;eAAxBA;;IAEAC,sBAAsB;eAAtBA;;IAJAC,0BAA0B;eAA1BA;;IACAC,2BAA2B;eAA3BA;;IA/BAC,2BAA2B;eAA3BA;;IAKAC,mCAAmC;eAAnCA;;IAuBAC,6BAA6B;eAA7BA;;IA7BAC,6BAA6B;eAA7BA;;IA2BAC,oBAAoB;eAApBA;;IAjBAC,QAAQ;eAARA;;IACAC,uBAAuB;eAAvBA;;IAhBAC,UAAU;eAAVA;;;AAAN,MAAMA,aAAa;AACnB,MAAMpB,gBAAgB;AAItB,MAAMgB,gCAAgC;AACtC,MAAMH,8BAA8B;AAKpC,MAAMC,sCACX;AACK,MAAMR,0BAA0B;AAChC,MAAMD,+BAA+B;AACrC,MAAMa,WAAW;AACjB,MAAMC,0BAA0B;AAKhC,MAAMX,2BACX;AAEK,MAAMP,iBAAiB;IAC5BmB;IACAJ;IACAH;IACAP;IACAQ;CACD;AAEM,MAAMG,uBAAuB;AAE7B,MAAMF,gCAAgC;AACtC,MAAMX,2BAA2B;AACjC,MAAMO,6BAA6B;AACnC,MAAMC,8BAA8B;AACpC,MAAMH,2BAA2B;AACjC,MAAMP,+BAA+B;AACrC,MAAMQ,yBAAyB;AAC/B,MAAMH,8BAA8B;AAGpC,MAAMJ,iCAAiC","ignoreList":[0]} |
@@ -263,3 +263,4 @@ "use strict"; | ||
| const cacheKey = (0, _cachekey.createCacheKey)(instance.prefetchHref, nextUrl); | ||
| instance.prefetchTask = (0, _scheduler.schedulePrefetchTask)(cacheKey, treeAtTimeOfPrefetch, instance.fetchStrategy, priority, null); | ||
| instance.prefetchTask = (0, _scheduler.schedulePrefetchTask)(cacheKey, treeAtTimeOfPrefetch, instance.fetchStrategy, priority, null, null // navigationLockPrefetch | ||
| ); | ||
| } else { | ||
@@ -292,3 +293,4 @@ // We already have an old task object that we can reschedule. This is | ||
| const cacheKey = (0, _cachekey.createCacheKey)(instance.prefetchHref, nextUrl); | ||
| instance.prefetchTask = (0, _scheduler.schedulePrefetchTask)(cacheKey, tree, instance.fetchStrategy, _types.PrefetchPriority.Default, null); | ||
| instance.prefetchTask = (0, _scheduler.schedulePrefetchTask)(cacheKey, tree, instance.fetchStrategy, _types.PrefetchPriority.Default, null, null // navigationLockPrefetch | ||
| ); | ||
| } | ||
@@ -295,0 +297,0 @@ } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/client/components/links.ts"],"sourcesContent":["import type { FlightRouterState } from '../../shared/lib/app-router-types'\nimport type { AppRouterInstance } from '../../shared/lib/app-router-context.shared-runtime'\nimport {\n FetchStrategy,\n type PrefetchTaskFetchStrategy,\n PrefetchPriority,\n} from './segment-cache/types'\nimport { createCacheKey } from './segment-cache/cache-key'\nimport {\n type PrefetchTask,\n schedulePrefetchTask as scheduleSegmentPrefetchTask,\n cancelPrefetchTask,\n reschedulePrefetchTask,\n isPrefetchTaskDirty,\n} from './segment-cache/scheduler'\nimport { startTransition } from 'react'\n\ntype LinkElement = HTMLAnchorElement | SVGAElement\n\ntype Element = LinkElement | HTMLFormElement\n\n// Properties that are shared between Link and Form instances. We use the same\n// shape for both to prevent a polymorphic de-opt in the VM.\ntype LinkOrFormInstanceShared = {\n router: AppRouterInstance\n fetchStrategy: PrefetchTaskFetchStrategy\n\n isVisible: boolean\n\n // The most recently initiated prefetch task. It may or may not have\n // already completed. The same prefetch task object can be reused across\n // multiple prefetches of the same link.\n prefetchTask: PrefetchTask | null\n}\n\nexport type FormInstance = LinkOrFormInstanceShared & {\n prefetchHref: string\n setOptimisticLinkStatus: null\n}\n\ntype PrefetchableLinkInstance = LinkOrFormInstanceShared & {\n // In dev, the Owner Stack captured at the time this Link was rendered, for\n // configurations where a warning might later fire.\n // `undefined` means we opted out of capturing the stack.\n // If you issue a warning, handle the `undefined` case separately\n // so it's clear in the logs when a warning is missing its source location.\n // A warning with an undefined ownerStack is considered a bug though so make\n // sure reaching the log site is a subset of codepaths that lead to capturing\n // the stack\n ownerStack: string | null | undefined\n prefetchHref: string\n setOptimisticLinkStatus: (status: { pending: boolean }) => void\n}\n\ntype NonPrefetchableLinkInstance = LinkOrFormInstanceShared & {\n ownerStack: string | null | undefined\n prefetchHref: null\n setOptimisticLinkStatus: (status: { pending: boolean }) => void\n}\n\ntype PrefetchableInstance = PrefetchableLinkInstance | FormInstance\n\nexport type LinkInstance =\n | PrefetchableLinkInstance\n | NonPrefetchableLinkInstance\n\n// Tracks the most recently navigated link instance. When null, indicates\n// the current navigation was not initiated by a link click.\nlet linkForMostRecentNavigation: LinkInstance | null = null\n\n// Status object indicating link is pending\nexport const PENDING_LINK_STATUS = { pending: true }\n\n// Status object indicating link is idle\nexport const IDLE_LINK_STATUS = { pending: false }\n\n// Updates the loading state when navigating between links\n// - Resets the previous link's loading state\n// - Sets the new link's loading state\n// - Updates tracking of current navigation\nexport function setLinkForCurrentNavigation(link: LinkInstance | null) {\n startTransition(() => {\n linkForMostRecentNavigation?.setOptimisticLinkStatus(IDLE_LINK_STATUS)\n link?.setOptimisticLinkStatus(PENDING_LINK_STATUS)\n linkForMostRecentNavigation = link\n })\n}\n\n// Unmounts the current link instance from navigation tracking\nexport function unmountLinkForCurrentNavigation(link: LinkInstance) {\n if (linkForMostRecentNavigation === link) {\n linkForMostRecentNavigation = null\n }\n}\n\n/**\n * Returns the link instance that initiated the most recent navigation.\n * Returns null if the navigation was not initiated by a link click.\n *\n * Used by the Instant Navigation Testing API in dev mode to match the\n * fetch strategy of the link during cache-miss navigations.\n */\nexport function getLinkForCurrentNavigation(): LinkInstance | null {\n return linkForMostRecentNavigation\n}\n\n// Use a WeakMap to associate a Link instance with its DOM element. This is\n// used by the IntersectionObserver to track the link's visibility.\nconst prefetchable:\n | WeakMap<Element, PrefetchableInstance>\n | Map<Element, PrefetchableInstance> =\n typeof WeakMap === 'function' ? new WeakMap() : new Map()\n\n// A Set of the currently visible links. We re-prefetch visible links after a\n// cache invalidation, or when the current URL changes. It's a separate data\n// structure from the WeakMap above because only the visible links need to\n// be enumerated.\nconst prefetchableAndVisible: Set<PrefetchableInstance> = new Set()\n\n// A single IntersectionObserver instance shared by all <Link> components.\nconst observer: IntersectionObserver | null =\n typeof IntersectionObserver === 'function'\n ? new IntersectionObserver(handleIntersect, {\n rootMargin: '200px',\n })\n : null\n\nfunction observeVisibility(element: Element, instance: PrefetchableInstance) {\n const existingInstance = prefetchable.get(element)\n if (existingInstance !== undefined) {\n // This shouldn't happen because each <Link> component should have its own\n // anchor tag instance, but it's defensive coding to avoid a memory leak in\n // case there's a logical error somewhere else.\n unmountPrefetchableInstance(element)\n }\n // Only track prefetchable links that have a valid prefetch URL\n prefetchable.set(element, instance)\n if (observer !== null) {\n observer.observe(element)\n }\n}\n\nfunction coercePrefetchableUrl(href: string): URL | null {\n if (typeof window !== 'undefined') {\n const { createPrefetchURL } =\n require('./app-router-utils') as typeof import('./app-router-utils')\n\n try {\n return createPrefetchURL(href)\n } catch {\n // createPrefetchURL sometimes throws an error if an invalid URL is\n // provided, though I'm not sure if it's actually necessary.\n // TODO: Consider removing the throw from the inner function, or change it\n // to reportError. Or maybe the error isn't even necessary for automatic\n // prefetches, just navigations.\n const reportErrorFn =\n typeof reportError === 'function' ? reportError : console.error\n reportErrorFn(\n `Cannot prefetch '${href}' because it cannot be converted to a URL.`\n )\n return null\n }\n } else {\n return null\n }\n}\n\nexport function mountLinkInstance(\n element: LinkElement,\n href: string,\n router: AppRouterInstance,\n fetchStrategy: PrefetchTaskFetchStrategy,\n prefetchEnabled: boolean,\n setOptimisticLinkStatus: (status: { pending: boolean }) => void,\n ownerStack: string | null | undefined\n): LinkInstance {\n if (prefetchEnabled) {\n const prefetchURL = coercePrefetchableUrl(href)\n if (prefetchURL !== null) {\n const instance: PrefetchableLinkInstance = {\n router,\n fetchStrategy,\n isVisible: false,\n prefetchTask: null,\n prefetchHref: prefetchURL.href,\n setOptimisticLinkStatus,\n ownerStack,\n }\n // We only observe the link's visibility if it's prefetchable. For\n // example, this excludes links to external URLs.\n observeVisibility(element, instance)\n return instance\n }\n }\n // If the link is not prefetchable, we still create an instance so we can\n // track its optimistic state (i.e. useLinkStatus).\n const instance: NonPrefetchableLinkInstance = {\n router,\n fetchStrategy,\n isVisible: false,\n prefetchTask: null,\n prefetchHref: null,\n setOptimisticLinkStatus,\n ownerStack,\n }\n return instance\n}\n\nexport function mountFormInstance(\n element: HTMLFormElement,\n href: string,\n router: AppRouterInstance,\n fetchStrategy: PrefetchTaskFetchStrategy\n): void {\n const prefetchURL = coercePrefetchableUrl(href)\n if (prefetchURL === null) {\n // This href is not prefetchable, so we don't track it.\n // TODO: We currently observe/unobserve a form every time its href changes.\n // For Links, this isn't a big deal because the href doesn't usually change,\n // but for forms it's extremely common. We should optimize this.\n return\n }\n const instance: FormInstance = {\n router,\n fetchStrategy,\n isVisible: false,\n prefetchTask: null,\n prefetchHref: prefetchURL.href,\n setOptimisticLinkStatus: null,\n }\n observeVisibility(element, instance)\n}\n\nexport function unmountPrefetchableInstance(element: Element) {\n const instance = prefetchable.get(element)\n if (instance !== undefined) {\n prefetchable.delete(element)\n prefetchableAndVisible.delete(instance)\n const prefetchTask = instance.prefetchTask\n if (prefetchTask !== null) {\n cancelPrefetchTask(prefetchTask)\n }\n }\n if (observer !== null) {\n observer.unobserve(element)\n }\n}\n\nfunction handleIntersect(entries: Array<IntersectionObserverEntry>) {\n for (const entry of entries) {\n // Some extremely old browsers or polyfills don't reliably support\n // isIntersecting so we check intersectionRatio instead. (Do we care? Not\n // really. But whatever this is fine.)\n const isVisible = entry.intersectionRatio > 0\n onLinkVisibilityChanged(entry.target as HTMLAnchorElement, isVisible)\n }\n}\n\nexport function onLinkVisibilityChanged(element: Element, isVisible: boolean) {\n if (process.env.NODE_ENV !== 'production') {\n // Prefetching on viewport is disabled in development for performance\n // reasons, because it requires compiling the target page.\n // TODO: Investigate re-enabling this.\n return\n }\n\n const instance = prefetchable.get(element)\n if (instance === undefined) {\n return\n }\n\n instance.isVisible = isVisible\n if (isVisible) {\n prefetchableAndVisible.add(instance)\n } else {\n prefetchableAndVisible.delete(instance)\n }\n rescheduleLinkPrefetch(instance, PrefetchPriority.Default)\n}\n\nexport function onNavigationIntent(\n element: HTMLAnchorElement | SVGAElement,\n unstable_upgradeToDynamicPrefetch: boolean\n) {\n const instance = prefetchable.get(element)\n if (instance === undefined) {\n return\n }\n // Prefetch the link on hover/touchstart.\n if (instance !== undefined) {\n if (\n process.env.__NEXT_DYNAMIC_ON_HOVER &&\n unstable_upgradeToDynamicPrefetch\n ) {\n // Switch to a full prefetch\n instance.fetchStrategy = FetchStrategy.Full\n }\n rescheduleLinkPrefetch(instance, PrefetchPriority.Intent)\n }\n}\n\nfunction rescheduleLinkPrefetch(\n instance: PrefetchableInstance,\n priority: PrefetchPriority.Default | PrefetchPriority.Intent\n) {\n // Ensures that app-router-instance is not compiled in the server bundle\n if (typeof window !== 'undefined') {\n const existingPrefetchTask = instance.prefetchTask\n\n if (!instance.isVisible) {\n // Cancel any in-progress prefetch task. (If it already finished then this\n // is a no-op.)\n if (existingPrefetchTask !== null) {\n cancelPrefetchTask(existingPrefetchTask)\n }\n // We don't need to reset the prefetchTask to null upon cancellation; an\n // old task object can be rescheduled with reschedulePrefetchTask. This is a\n // micro-optimization but also makes the code simpler (don't need to\n // worry about whether an old task object is stale).\n return\n }\n\n const { getCurrentAppRouterState } =\n require('./app-router-instance') as typeof import('./app-router-instance')\n\n const appRouterState = getCurrentAppRouterState()\n if (appRouterState !== null) {\n const treeAtTimeOfPrefetch = appRouterState.tree\n if (existingPrefetchTask === null) {\n // Initiate a prefetch task.\n const nextUrl = appRouterState.nextUrl\n const cacheKey = createCacheKey(instance.prefetchHref, nextUrl)\n instance.prefetchTask = scheduleSegmentPrefetchTask(\n cacheKey,\n treeAtTimeOfPrefetch,\n instance.fetchStrategy,\n priority,\n null\n )\n } else {\n // We already have an old task object that we can reschedule. This is\n // effectively the same as canceling the old task and creating a new one.\n reschedulePrefetchTask(\n existingPrefetchTask,\n treeAtTimeOfPrefetch,\n instance.fetchStrategy,\n priority\n )\n }\n }\n }\n}\n\nexport function pingVisibleLinks(\n nextUrl: string | null,\n tree: FlightRouterState\n) {\n // For each currently visible link, cancel the existing prefetch task (if it\n // exists) and schedule a new one. This is effectively the same as if all the\n // visible links left and then re-entered the viewport.\n //\n // This is called when the Next-Url or the base tree changes, since those\n // may affect the result of a prefetch task. It's also called after a\n // cache invalidation.\n for (const instance of prefetchableAndVisible) {\n const task = instance.prefetchTask\n if (task !== null && !isPrefetchTaskDirty(task, nextUrl, tree)) {\n // The cache has not been invalidated, and none of the inputs have\n // changed. Bail out.\n continue\n }\n // Something changed. Cancel the existing prefetch task and schedule a\n // new one.\n if (task !== null) {\n cancelPrefetchTask(task)\n }\n const cacheKey = createCacheKey(instance.prefetchHref, nextUrl)\n instance.prefetchTask = scheduleSegmentPrefetchTask(\n cacheKey,\n tree,\n instance.fetchStrategy,\n PrefetchPriority.Default,\n null\n )\n }\n}\n"],"names":["IDLE_LINK_STATUS","PENDING_LINK_STATUS","getLinkForCurrentNavigation","mountFormInstance","mountLinkInstance","onLinkVisibilityChanged","onNavigationIntent","pingVisibleLinks","setLinkForCurrentNavigation","unmountLinkForCurrentNavigation","unmountPrefetchableInstance","linkForMostRecentNavigation","pending","link","startTransition","setOptimisticLinkStatus","prefetchable","WeakMap","Map","prefetchableAndVisible","Set","observer","IntersectionObserver","handleIntersect","rootMargin","observeVisibility","element","instance","existingInstance","get","undefined","set","observe","coercePrefetchableUrl","href","window","createPrefetchURL","require","reportErrorFn","reportError","console","error","router","fetchStrategy","prefetchEnabled","ownerStack","prefetchURL","isVisible","prefetchTask","prefetchHref","delete","cancelPrefetchTask","unobserve","entries","entry","intersectionRatio","target","process","env","NODE_ENV","add","rescheduleLinkPrefetch","PrefetchPriority","Default","unstable_upgradeToDynamicPrefetch","__NEXT_DYNAMIC_ON_HOVER","FetchStrategy","Full","Intent","priority","existingPrefetchTask","getCurrentAppRouterState","appRouterState","treeAtTimeOfPrefetch","tree","nextUrl","cacheKey","createCacheKey","scheduleSegmentPrefetchTask","reschedulePrefetchTask","task","isPrefetchTaskDirty"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;IA0EaA,gBAAgB;eAAhBA;;IAHAC,mBAAmB;eAAnBA;;IA+BGC,2BAA2B;eAA3BA;;IA0GAC,iBAAiB;eAAjBA;;IAzCAC,iBAAiB;eAAjBA;;IA2FAC,uBAAuB;eAAvBA;;IAsBAC,kBAAkB;eAAlBA;;IAyEAC,gBAAgB;eAAhBA;;IAjRAC,2BAA2B;eAA3BA;;IASAC,+BAA+B;eAA/BA;;IAgJAC,2BAA2B;eAA3BA;;;uBAnOT;0BACwB;2BAOxB;uBACyB;AAmDhC,yEAAyE;AACzE,4DAA4D;AAC5D,IAAIC,8BAAmD;AAGhD,MAAMV,sBAAsB;IAAEW,SAAS;AAAK;AAG5C,MAAMZ,mBAAmB;IAAEY,SAAS;AAAM;AAM1C,SAASJ,4BAA4BK,IAAyB;IACnEC,IAAAA,sBAAe,EAAC;QACdH,6BAA6BI,wBAAwBf;QACrDa,MAAME,wBAAwBd;QAC9BU,8BAA8BE;IAChC;AACF;AAGO,SAASJ,gCAAgCI,IAAkB;IAChE,IAAIF,gCAAgCE,MAAM;QACxCF,8BAA8B;IAChC;AACF;AASO,SAAST;IACd,OAAOS;AACT;AAEA,2EAA2E;AAC3E,mEAAmE;AACnE,MAAMK,eAGJ,OAAOC,YAAY,aAAa,IAAIA,YAAY,IAAIC;AAEtD,6EAA6E;AAC7E,4EAA4E;AAC5E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DF,UACAH,sBACA9C,SAASgB,aAAa,EACtB0B,UACA;YAEJ,OAAO;gBACL,qEAAqE;gBACrE,yEAAyE;gBACzEU,IAAAA,iCAAsB,EACpBT,sBACAG,sBACA9C,SAASgB,aAAa,EACtB0B;YAEJ;QACF;IACF;AACF;AAEO,SAAS9D,iBACdoE,OAAsB,EACtBD,IAAuB;IAEvB,4EAA4E;IAC5E,6EAA6E;IAC7E,uDAAuD;IACvD,EAAE;IACF,yEAAyE;IACzE,qEAAqE;IACrE,sBAAsB;IACtB,KAAK,MAAM/C,YAAYR,uBAAwB;QAC7C,MAAM6D,OAAOrD,SAASqB,YAAY;QAClC,IAAIgC,SAAS,QAAQ,CAACC,IAAAA,8BAAmB,EAACD,MAAML,SAASD,OAAO;YAG9D;QACF;QACA,sEAAsE;QACtE,WAAW;QACX,IAAIM,SAAS,MAAM;YACjB7B,IAAAA,6BAAkB,EAAC6B;QACrB;QACA,MAAMJ,WAAWC,IAAAA,wBAAc,EAAClD,SAASsB,YAAY,EAAE0B;QACvDhD,SAASqB,YAAY,GAAG8B,IAAAA,+BAA2B,EACjDF,UACAF,MACA/C,SAASgB,aAAa,EACtBmB,uBAAgB,CAACC,OAAO,EACxB;IAEJ;AACF","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/client/components/links.ts"],"sourcesContent":["import type { FlightRouterState } from '../../shared/lib/app-router-types'\nimport type { AppRouterInstance } from '../../shared/lib/app-router-context.shared-runtime'\nimport {\n FetchStrategy,\n type PrefetchTaskFetchStrategy,\n PrefetchPriority,\n} from './segment-cache/types'\nimport { createCacheKey } from './segment-cache/cache-key'\nimport {\n type PrefetchTask,\n schedulePrefetchTask as scheduleSegmentPrefetchTask,\n cancelPrefetchTask,\n reschedulePrefetchTask,\n isPrefetchTaskDirty,\n} from './segment-cache/scheduler'\nimport { startTransition } from 'react'\n\ntype LinkElement = HTMLAnchorElement | SVGAElement\n\ntype Element = LinkElement | HTMLFormElement\n\n// Properties that are shared between Link and Form instances. We use the same\n// shape for both to prevent a polymorphic de-opt in the VM.\ntype LinkOrFormInstanceShared = {\n router: AppRouterInstance\n fetchStrategy: PrefetchTaskFetchStrategy\n\n isVisible: boolean\n\n // The most recently initiated prefetch task. It may or may not have\n // already completed. The same prefetch task object can be reused across\n // multiple prefetches of the same link.\n prefetchTask: PrefetchTask | null\n}\n\nexport type FormInstance = LinkOrFormInstanceShared & {\n prefetchHref: string\n setOptimisticLinkStatus: null\n}\n\ntype PrefetchableLinkInstance = LinkOrFormInstanceShared & {\n // In dev, the Owner Stack captured at the time this Link was rendered, for\n // configurations where a warning might later fire.\n // `undefined` means we opted out of capturing the stack.\n // If you issue a warning, handle the `undefined` case separately\n // so it's clear in the logs when a warning is missing its source location.\n // A warning with an undefined ownerStack is considered a bug though so make\n // sure reaching the log site is a subset of codepaths that lead to capturing\n // the stack\n ownerStack: string | null | undefined\n prefetchHref: string\n setOptimisticLinkStatus: (status: { pending: boolean }) => void\n}\n\ntype NonPrefetchableLinkInstance = LinkOrFormInstanceShared & {\n ownerStack: string | null | undefined\n prefetchHref: null\n setOptimisticLinkStatus: (status: { pending: boolean }) => void\n}\n\ntype PrefetchableInstance = PrefetchableLinkInstance | FormInstance\n\nexport type LinkInstance =\n | PrefetchableLinkInstance\n | NonPrefetchableLinkInstance\n\n// Tracks the most recently navigated link instance. When null, indicates\n// the current navigation was not initiated by a link click.\nlet linkForMostRecentNavigation: LinkInstance | null = null\n\n// Status object indicating link is pending\nexport const PENDING_LINK_STATUS = { pending: true }\n\n// Status object indicating link is idle\nexport const IDLE_LINK_STATUS = { pending: false }\n\n// Updates the loading state when navigating between links\n// - Resets the previous link's loading state\n// - Sets the new link's loading state\n// - Updates tracking of current navigation\nexport function setLinkForCurrentNavigation(link: LinkInstance | null) {\n startTransition(() => {\n linkForMostRecentNavigation?.setOptimisticLinkStatus(IDLE_LINK_STATUS)\n link?.setOptimisticLinkStatus(PENDING_LINK_STATUS)\n linkForMostRecentNavigation = link\n })\n}\n\n// Unmounts the current link instance from navigation tracking\nexport function unmountLinkForCurrentNavigation(link: LinkInstance) {\n if (linkForMostRecentNavigation === link) {\n linkForMostRecentNavigation = null\n }\n}\n\n/**\n * Returns the link instance that initiated the most recent navigation.\n * Returns null if the navigation was not initiated by a link click.\n *\n * Used by the Instant Navigation Testing API in dev mode to match the\n * fetch strategy of the link during cache-miss navigations.\n */\nexport function getLinkForCurrentNavigation(): LinkInstance | null {\n return linkForMostRecentNavigation\n}\n\n// Use a WeakMap to associate a Link instance with its DOM element. This is\n// used by the IntersectionObserver to track the link's visibility.\nconst prefetchable:\n | WeakMap<Element, PrefetchableInstance>\n | Map<Element, PrefetchableInstance> =\n typeof WeakMap === 'function' ? new WeakMap() : new Map()\n\n// A Set of the currently visible links. We re-prefetch visible links after a\n// cache invalidation, or when the current URL changes. It's a separate data\n// structure from the WeakMap above because only the visible links need to\n// be enumerated.\nconst prefetchableAndVisible: Set<PrefetchableInstance> = new Set()\n\n// A single IntersectionObserver instance shared by all <Link> components.\nconst observer: IntersectionObserver | null =\n typeof IntersectionObserver === 'function'\n ? new IntersectionObserver(handleIntersect, {\n rootMargin: '200px',\n })\n : null\n\nfunction observeVisibility(element: Element, instance: PrefetchableInstance) {\n const existingInstance = prefetchable.get(element)\n if (existingInstance !== undefined) {\n // This shouldn't happen because each <Link> component should have its own\n // anchor tag instance, but it's defensive coding to avoid a memory leak in\n // case there's a logical error somewhere else.\n unmountPrefetchableInstance(element)\n }\n // Only track prefetchable links that have a valid prefetch URL\n prefetchable.set(element, instance)\n if (observer !== null) {\n observer.observe(element)\n }\n}\n\nfunction coercePrefetchableUrl(href: string): URL | null {\n if (typeof window !== 'undefined') {\n const { createPrefetchURL } =\n require('./app-router-utils') as typeof import('./app-router-utils')\n\n try {\n return createPrefetchURL(href)\n } catch {\n // createPrefetchURL sometimes throws an error if an invalid URL is\n // provided, though I'm not sure if it's actually necessary.\n // TODO: Consider removing the throw from the inner function, or change it\n // to reportError. Or maybe the error isn't even necessary for automatic\n // prefetches, just navigations.\n const reportErrorFn =\n typeof reportError === 'function' ? reportError : console.error\n reportErrorFn(\n `Cannot prefetch '${href}' because it cannot be converted to a URL.`\n )\n return null\n }\n } else {\n return null\n }\n}\n\nexport function mountLinkInstance(\n element: LinkElement,\n href: string,\n router: AppRouterInstance,\n fetchStrategy: PrefetchTaskFetchStrategy,\n prefetchEnabled: boolean,\n setOptimisticLinkStatus: (status: { pending: boolean }) => void,\n ownerStack: string | null | undefined\n): LinkInstance {\n if (prefetchEnabled) {\n const prefetchURL = coercePrefetchableUrl(href)\n if (prefetchURL !== null) {\n const instance: PrefetchableLinkInstance = {\n router,\n fetchStrategy,\n isVisible: false,\n prefetchTask: null,\n prefetchHref: prefetchURL.href,\n setOptimisticLinkStatus,\n ownerStack,\n }\n // We only observe the link's visibility if it's prefetchable. For\n // example, this excludes links to external URLs.\n observeVisibility(element, instance)\n return instance\n }\n }\n // If the link is not prefetchable, we still create an instance so we can\n // track its optimistic state (i.e. useLinkStatus).\n const instance: NonPrefetchableLinkInstance = {\n router,\n fetchStrategy,\n isVisible: false,\n prefetchTask: null,\n prefetchHref: null,\n setOptimisticLinkStatus,\n ownerStack,\n }\n return instance\n}\n\nexport function mountFormInstance(\n element: HTMLFormElement,\n href: string,\n router: AppRouterInstance,\n fetchStrategy: PrefetchTaskFetchStrategy\n): void {\n const prefetchURL = coercePrefetchableUrl(href)\n if (prefetchURL === null) {\n // This href is not prefetchable, so we don't track it.\n // TODO: We currently observe/unobserve a form every time its href changes.\n // For Links, this isn't a big deal because the href doesn't usually change,\n // but for forms it's extremely common. We should optimize this.\n return\n }\n const instance: FormInstance = {\n router,\n fetchStrategy,\n isVisible: false,\n prefetchTask: null,\n prefetchHref: prefetchURL.href,\n setOptimisticLinkStatus: null,\n }\n observeVisibility(element, instance)\n}\n\nexport function unmountPrefetchableInstance(element: Element) {\n const instance = prefetchable.get(element)\n if (instance !== undefined) {\n prefetchable.delete(element)\n prefetchableAndVisible.delete(instance)\n const prefetchTask = instance.prefetchTask\n if (prefetchTask !== null) {\n cancelPrefetchTask(prefetchTask)\n }\n }\n if (observer !== null) {\n observer.unobserve(element)\n }\n}\n\nfunction handleIntersect(entries: Array<IntersectionObserverEntry>) {\n for (const entry of entries) {\n // Some extremely old browsers or polyfills don't reliably support\n // isIntersecting so we check intersectionRatio instead. (Do we care? Not\n // really. But whatever this is fine.)\n const isVisible = entry.intersectionRatio > 0\n onLinkVisibilityChanged(entry.target as HTMLAnchorElement, isVisible)\n }\n}\n\nexport function onLinkVisibilityChanged(element: Element, isVisible: boolean) {\n if (process.env.NODE_ENV !== 'production') {\n // Prefetching on viewport is disabled in development for performance\n // reasons, because it requires compiling the target page.\n // TODO: Investigate re-enabling this.\n return\n }\n\n const instance = prefetchable.get(element)\n if (instance === undefined) {\n return\n }\n\n instance.isVisible = isVisible\n if (isVisible) {\n prefetchableAndVisible.add(instance)\n } else {\n prefetchableAndVisible.delete(instance)\n }\n rescheduleLinkPrefetch(instance, PrefetchPriority.Default)\n}\n\nexport function onNavigationIntent(\n element: HTMLAnchorElement | SVGAElement,\n unstable_upgradeToDynamicPrefetch: boolean\n) {\n const instance = prefetchable.get(element)\n if (instance === undefined) {\n return\n }\n // Prefetch the link on hover/touchstart.\n if (instance !== undefined) {\n if (\n process.env.__NEXT_DYNAMIC_ON_HOVER &&\n unstable_upgradeToDynamicPrefetch\n ) {\n // Switch to a full prefetch\n instance.fetchStrategy = FetchStrategy.Full\n }\n rescheduleLinkPrefetch(instance, PrefetchPriority.Intent)\n }\n}\n\nfunction rescheduleLinkPrefetch(\n instance: PrefetchableInstance,\n priority: PrefetchPriority.Default | PrefetchPriority.Intent\n) {\n // Ensures that app-router-instance is not compiled in the server bundle\n if (typeof window !== 'undefined') {\n const existingPrefetchTask = instance.prefetchTask\n\n if (!instance.isVisible) {\n // Cancel any in-progress prefetch task. (If it already finished then this\n // is a no-op.)\n if (existingPrefetchTask !== null) {\n cancelPrefetchTask(existingPrefetchTask)\n }\n // We don't need to reset the prefetchTask to null upon cancellation; an\n // old task object can be rescheduled with reschedulePrefetchTask. This is a\n // micro-optimization but also makes the code simpler (don't need to\n // worry about whether an old task object is stale).\n return\n }\n\n const { getCurrentAppRouterState } =\n require('./app-router-instance') as typeof import('./app-router-instance')\n\n const appRouterState = getCurrentAppRouterState()\n if (appRouterState !== null) {\n const treeAtTimeOfPrefetch = appRouterState.tree\n if (existingPrefetchTask === null) {\n // Initiate a prefetch task.\n const nextUrl = appRouterState.nextUrl\n const cacheKey = createCacheKey(instance.prefetchHref, nextUrl)\n instance.prefetchTask = scheduleSegmentPrefetchTask(\n cacheKey,\n treeAtTimeOfPrefetch,\n instance.fetchStrategy,\n priority,\n null,\n null // navigationLockPrefetch\n )\n } else {\n // We already have an old task object that we can reschedule. This is\n // effectively the same as canceling the old task and creating a new one.\n reschedulePrefetchTask(\n existingPrefetchTask,\n treeAtTimeOfPrefetch,\n instance.fetchStrategy,\n priority\n )\n }\n }\n }\n}\n\nexport function pingVisibleLinks(\n nextUrl: string | null,\n tree: FlightRouterState\n) {\n // For each currently visible link, cancel the existing prefetch task (if it\n // exists) and schedule a new one. This is effectively the same as if all the\n // visible links left and then re-entered the viewport.\n //\n // This is called when the Next-Url or the base tree changes, since those\n // may affect the result of a prefetch task. It's also called after a\n // cache invalidation.\n for (const instance of prefetchableAndVisible) {\n const task = instance.prefetchTask\n if (task !== null && !isPrefetchTaskDirty(task, nextUrl, tree)) {\n // The cache has not been invalidated, and none of the inputs have\n // changed. Bail out.\n continue\n }\n // Something changed. Cancel the existing prefetch task and schedule a\n // new one.\n if (task !== null) {\n cancelPrefetchTask(task)\n }\n const cacheKey = createCacheKey(instance.prefetchHref, nextUrl)\n instance.prefetchTask = scheduleSegmentPrefetchTask(\n cacheKey,\n tree,\n instance.fetchStrategy,\n PrefetchPriority.Default,\n null,\n null // navigationLockPrefetch\n )\n }\n}\n"],"names":["IDLE_LINK_STATUS","PENDING_LINK_STATUS","getLinkForCurrentNavigation","mountFormInstance","mountLinkInstance","onLinkVisibilityChanged","onNavigationIntent","pingVisibleLinks","setLinkForCurrentNavigation","unmountLinkForCurrentNavigation","unmountPrefetchableInstance","linkForMostRecentNavigation","pending","link","startTransition","setOptimisticLinkStatus","prefetchable","WeakMap","Map","prefetchableAndVisible","Set","observer","IntersectionObserver","handleIntersect","rootMargin","observeVisibility","element","instance","existingInstance","get","undefined","set","observe","coercePrefetchableUrl","href","window","createPrefetchURL","require","reportErrorFn","reportError","console","error","router","fetchStrategy","prefetchEnabled","ownerStack","prefetchURL","isVisible","prefetchTask","prefetchHref","delete","cancelPrefetchTask","unobserve","entries","entry","intersectionRatio","target","process","env","NODE_ENV","add","rescheduleLinkPrefetch","PrefetchPriority","Default","unstable_upgradeToDynamicPrefetch","__NEXT_DYNAMIC_ON_HOVER","FetchStrategy","Full","Intent","priority","existingPrefetchTask","getCurrentAppRouterState","appRouterState","treeAtTimeOfPrefetch","tree","nextUrl","cacheKey","createCacheKey","scheduleSegmentPrefetchTask","reschedulePrefetchTask","task","isPrefetchTaskDirty"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;IA0EaA,gBAAgB;eAAhBA;;IAHAC,mBAAmB;eAAnBA;;IA+BGC,2BAA2B;eAA3BA;;IA0GAC,iBAAiB;eAAjBA;;IAzCAC,iBAAiB;eAAjBA;;IA2FAC,uBAAuB;eAAvBA;;IAsBAC,kBAAkB;eAAlBA;;IA0EAC,gBAAgB;eAAhBA;;IAlRAC,2BAA2B;eAA3BA;;IASAC,+BAA+B;eAA/BA;;IAgJAC,2BAA2B;eAA3BA;;;uBAnOT;0BACwB;2BAOxB;uBACyB;AAmDhC,yEAAyE;AACzE,4DAA4D;AAC5D,IAAIC,8BAAmD;AAGhD,MAAMV,sBAAsB;IAAEW,SAAS;AAAK;AAG5C,MAAMZ,mBAAmB;IAAEY,SAAS;AAAM;AAM1C,SAASJ,4BAA4BK,IAAyB;IACnEC,IAAAA,sBAAe,EAAC;QACdH,6BAA6BI,wBAAwBf;QACrDa,MA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EV,MAAMmC,iBAAiBD;QACvB,IAAIC,mBAAmB,MAAM;YAC3B,MAAMC,uBAAuBD,eAAeE,IAAI;YAChD,IAAIJ,yBAAyB,MAAM;gBACjC,4BAA4B;gBAC5B,MAAMK,UAAUH,eAAeG,OAAO;gBACtC,MAAMC,WAAWC,IAAAA,wBAAc,EAAClD,SAASsB,YAAY,EAAE0B;gBACvDhD,SAASqB,YAAY,GAAG8B,IAAAA,+BAA2B,EACjDF,UACAH,sBACA9C,SAASgB,aAAa,EACtB0B,UACA,MACA,KAAK,yBAAyB;;YAElC,OAAO;gBACL,qEAAqE;gBACrE,yEAAyE;gBACzEU,IAAAA,iCAAsB,EACpBT,sBACAG,sBACA9C,SAASgB,aAAa,EACtB0B;YAEJ;QACF;IACF;AACF;AAEO,SAAS9D,iBACdoE,OAAsB,EACtBD,IAAuB;IAEvB,4EAA4E;IAC5E,6EAA6E;IAC7E,uDAAuD;IACvD,EAAE;IACF,yEAAyE;IACzE,qEAAqE;IACrE,sBAAsB;IACtB,KAAK,MAAM/C,YAAYR,uBAAwB;QAC7C,MAAM6D,OAAOrD,SAASqB,YAAY;QAClC,IAAIgC,SAAS,QAAQ,CAACC,IAAAA,8BAAmB,EAACD,MAAML,SAASD,OAAO;YAG9D;QACF;QACA,sEAAsE;QACtE,WAAW;QACX,IAAIM,SAAS,MAAM;YACjB7B,IAAAA,6BAAkB,EAAC6B;QACrB;QACA,MAAMJ,WAAWC,IAAAA,wBAAc,EAAClD,SAASsB,YAAY,EAAE0B;QACvDhD,SAASqB,YAAY,GAAG8B,IAAAA,+BAA2B,EACjDF,UACAF,MACA/C,SAASgB,aAAa,EACtBmB,uBAAgB,CAACC,OAAO,EACxB,MACA,KAAK,yBAAyB;;IAElC;AACF","ignoreList":[0]} |
| import type { CacheNodeSeedData, FlightRouterState } from '../../../shared/lib/app-router-types'; | ||
| import type { CacheNode } from '../../../shared/lib/app-router-types'; | ||
| import type { HeadData, ScrollRef } from '../../../shared/lib/app-router-types'; | ||
| import type { NavigationLockState } from '../segment-cache/navigation-testing-lock'; | ||
| import { type RouteTree, type RefreshState, type FulfilledRouteCacheEntry } from '../segment-cache/cache'; | ||
@@ -36,5 +37,5 @@ import { type PageVaryPath } from '../segment-cache/vary-path'; | ||
| }; | ||
| export type NavigationLock = Promise<void> | null; | ||
| export type NavigationLock = NavigationLockState | null; | ||
| export declare function createInitialCacheNodeForHydration(navigatedAt: number, initialTree: RouteTree, seedData: CacheNodeSeedData | null, seedHead: HeadData, seedDynamicStaleAt: number): NavigationTask; | ||
| export declare function startPPRNavigation(navigatedAt: number, oldUrl: URL, oldRenderedSearch: string, oldCacheNode: CacheNode | null, oldRouterState: FlightRouterState, newRouteTree: RouteTree, newMetadataVaryPath: PageVaryPath | null, freshness: FreshnessPolicy, seedData: CacheNodeSeedData | null, seedHead: HeadData | null, seedDynamicStaleAt: number, isSamePageNavigation: boolean, accumulation: NavigationRequestAccumulation): NavigationTask | null; | ||
| export declare function startPPRNavigation(navigatedAt: number, oldUrl: URL, oldRenderedSearch: string, oldCacheNode: CacheNode | null, oldRouterState: FlightRouterState, newRouteTree: RouteTree, newMetadataVaryPath: PageVaryPath | null, freshness: FreshnessPolicy, seedData: CacheNodeSeedData | null, seedHead: HeadData | null, seedDynamicStaleAt: number, isSamePageNavigation: boolean, accumulation: NavigationRequestAccumulation, restrictToShell: boolean): NavigationTask | null; | ||
| export declare function spawnDynamicRequests(task: NavigationTask, primaryUrl: URL, nextUrl: string | null, freshnessPolicy: FreshnessPolicy, accumulation: NavigationRequestAccumulation, routeCacheEntry: FulfilledRouteCacheEntry | null, navigateType: 'push' | 'replace', navigationLock: NavigationLock): void; | ||
@@ -41,0 +42,0 @@ type PendingDeferredRsc<T> = Promise<T> & { |
@@ -44,3 +44,4 @@ "use strict"; | ||
| const restoreSeed = (0, _navigation.convertServerPatchToFullTree)(now, treeToRestore, null, renderedSearch, _bfcache.UnknownDynamicStaleTime); | ||
| const task = (0, _pprnavigations.startPPRNavigation)(now, currentUrl, state.renderedSearch, state.cache, state.tree, restoreSeed.routeTree, restoreSeed.metadataVaryPath, _pprnavigations.FreshnessPolicy.HistoryTraversal, null, null, restoreSeed.dynamicStaleAt, false, accumulation); | ||
| const task = (0, _pprnavigations.startPPRNavigation)(now, currentUrl, state.renderedSearch, state.cache, state.tree, restoreSeed.routeTree, restoreSeed.metadataVaryPath, _pprnavigations.FreshnessPolicy.HistoryTraversal, null, null, restoreSeed.dynamicStaleAt, false, accumulation, // A history-traversal restore never restricts to the shell. | ||
| false); | ||
| if (task === null) { | ||
@@ -47,0 +48,0 @@ return (0, _navigation.completeHardNavigation)(state, restoredUrl, 'replace'); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../../src/client/components/router-reducer/reducers/restore-reducer.ts"],"sourcesContent":["import type {\n ReadonlyReducerState,\n ReducerState,\n RestoreAction,\n} from '../router-reducer-types'\nimport { extractPathFromFlightRouterState } from '../compute-changed-path'\nimport {\n FreshnessPolicy,\n getCurrentNavigationLock,\n spawnDynamicRequests,\n startPPRNavigation,\n type NavigationRequestAccumulation,\n} from '../ppr-navigations'\nimport type { FlightRouterState } from '../../../../shared/lib/app-router-types'\nimport {\n completeHardNavigation,\n completeTraverseNavigation,\n convertServerPatchToFullTree,\n} from '../../segment-cache/navigation'\nimport { UnknownDynamicStaleTime } from '../../segment-cache/bfcache'\n\nexport function restoreReducer(\n state: ReadonlyReducerState,\n action: RestoreAction\n): ReducerState {\n // This action is used to restore the router state from the history state.\n // However, it's possible that the history state no longer contains the `FlightRouterState`.\n // We will copy over the internal state on pushState/replaceState events, but if a history entry\n // occurred before hydration, or if the user navigated to a hash using a regular anchor link,\n // the history state will not contain the `FlightRouterState`.\n // In this case, we'll continue to use the existing tree so the router doesn't get into an invalid state.\n let treeToRestore: FlightRouterState | undefined\n let renderedSearch: string | undefined\n const historyState = action.historyState\n if (historyState) {\n treeToRestore = historyState.tree\n renderedSearch = historyState.renderedSearch\n } else {\n treeToRestore = state.tree\n renderedSearch = state.renderedSearch\n }\n\n const currentUrl = new URL(state.canonicalUrl, location.origin)\n const restoredUrl = action.url\n const restoredNextUrl =\n extractPathFromFlightRouterState(treeToRestore) ?? restoredUrl.pathname\n const navigationLock = getCurrentNavigationLock()\n\n const now = Date.now()\n // TODO: Store the dynamic stale time on the top-level state so it's known\n // during restores and refreshes.\n const accumulation: NavigationRequestAccumulation = {\n separateRefreshUrls: null,\n scrollRef: null,\n }\n const restoreSeed = convertServerPatchToFullTree(\n now,\n treeToRestore,\n null,\n renderedSearch,\n UnknownDynamicStaleTime\n )\n const task = startPPRNavigation(\n now,\n currentUrl,\n state.renderedSearch,\n state.cache,\n state.tree,\n restoreSeed.routeTree,\n restoreSeed.metadataVaryPath,\n FreshnessPolicy.HistoryTraversal,\n null,\n null,\n restoreSeed.dynamicStaleAt,\n false,\n accumulation\n )\n\n if (task === null) {\n return completeHardNavigation(state, restoredUrl, 'replace')\n }\n spawnDynamicRequests(\n task,\n restoredUrl,\n restoredNextUrl,\n FreshnessPolicy.HistoryTraversal,\n accumulation,\n // History traversal doesn't use route prediction, so there's no route\n // cache entry to mark as having a dynamic rewrite on mismatch. If a\n // mismatch occurs, the retry handler will traverse the known route tree\n // to find and mark the entry.\n null,\n // History traversal always uses 'replace'.\n 'replace',\n navigationLock\n )\n return completeTraverseNavigation(\n state,\n restoredUrl,\n renderedSearch,\n task.node,\n task.route,\n restoredNextUrl\n )\n}\n"],"names":["restoreReducer","state","action","treeToRestore","renderedSearch","historyState","tree","currentUrl","URL","canonicalUrl","location","origin","restoredUrl","url","restoredNextUrl","extractPathFromFlightRouterState","pathname","navigationLock","getCurrentNavigationLock","now","Date","accumulation","separateRefreshUrls","scrollRef","restoreSeed","convertServerPatchToFullTree","UnknownDynamicStaleTime","task","startPPRNavigation","cache","routeTree","metadataVaryPath","FreshnessPolicy","HistoryTraversal","dynamicStaleAt","completeHardNavigation","spawnDynamicRequests","completeTraverseNavigation","node","route"],"mappings":";;;;+BAqBgBA;;;eAA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IACxE,8BAA8B;IAC9B,MACA,2CAA2C;IAC3C,WACAJ;IAEF,OAAOoB,IAAAA,sCAA0B,EAC/BpC,OACAW,aACAR,gBACAuB,KAAKW,IAAI,EACTX,KAAKY,KAAK,EACVzB;AAEJ","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../../src/client/components/router-reducer/reducers/restore-reducer.ts"],"sourcesContent":["import type {\n ReadonlyReducerState,\n ReducerState,\n RestoreAction,\n} from '../router-reducer-types'\nimport { extractPathFromFlightRouterState } from '../compute-changed-path'\nimport {\n FreshnessPolicy,\n getCurrentNavigationLock,\n spawnDynamicRequests,\n startPPRNavigation,\n type NavigationRequestAccumulation,\n} from '../ppr-navigations'\nimport type { FlightRouterState } from '../../../../shared/lib/app-router-types'\nimport {\n completeHardNavigation,\n completeTraverseNavigation,\n convertServerPatchToFullTree,\n} from '../../segment-cache/navigation'\nimport { UnknownDynamicStaleTime } from '../../segment-cache/bfcache'\n\nexport function restoreReducer(\n state: ReadonlyReducerState,\n action: RestoreAction\n): ReducerState {\n // This action is used to restore the router state from the history state.\n // However, it's possible that the history state no longer contains the `FlightRouterState`.\n // We will copy over the internal state on pushState/replaceState events, but if a history entry\n // occurred before hydration, or if the user navigated to a hash using a regular anchor link,\n // the history state will not contain the `FlightRouterState`.\n // In this case, we'll continue to use the existing tree so the router doesn't get into an invalid state.\n let treeToRestore: FlightRouterState | undefined\n let renderedSearch: string | undefined\n const historyState = action.historyState\n if (historyState) {\n treeToRestore = historyState.tree\n renderedSearch = historyState.renderedSearch\n } else {\n treeToRestore = state.tree\n renderedSearch = state.renderedSearch\n }\n\n const currentUrl = new URL(state.canonicalUrl, location.origin)\n const restoredUrl = action.url\n const restoredNextUrl =\n extractPathFromFlightRouterState(treeToRestore) ?? restoredUrl.pathname\n const navigationLock = getCurrentNavigationLock()\n\n const now = Date.now()\n // TODO: Store the dynamic stale time on the top-level state so it's known\n // during restores and refreshes.\n const accumulation: NavigationRequestAccumulation = {\n separateRefreshUrls: null,\n scrollRef: null,\n }\n const restoreSeed = convertServerPatchToFullTree(\n now,\n treeToRestore,\n null,\n renderedSearch,\n UnknownDynamicStaleTime\n )\n const task = startPPRNavigation(\n now,\n currentUrl,\n state.renderedSearch,\n state.cache,\n state.tree,\n restoreSeed.routeTree,\n restoreSeed.metadataVaryPath,\n FreshnessPolicy.HistoryTraversal,\n null,\n null,\n restoreSeed.dynamicStaleAt,\n false,\n accumulation,\n // A history-traversal restore never restricts to the shell.\n false\n )\n\n if (task === null) {\n return completeHardNavigation(state, restoredUrl, 'replace')\n }\n spawnDynamicRequests(\n task,\n restoredUrl,\n restoredNextUrl,\n FreshnessPolicy.HistoryTraversal,\n accumulation,\n // History traversal doesn't use route prediction, so there's no route\n // cache entry to mark as having a dynamic rewrite on mismatch. If a\n // mismatch occurs, the retry handler will traverse the known route tree\n // to find and mark the entry.\n null,\n // History traversal always uses 'replace'.\n 'replace',\n navigationLock\n )\n return completeTraverseNavigation(\n state,\n restoredUrl,\n renderedSearch,\n task.node,\n task.route,\n restoredNextUrl\n )\n}\n"],"names":["restoreReducer","state","action","treeToRestore","renderedSearch","historyState","tree","currentUrl","URL","canonicalUrl","location","origin","restoredUrl","url","restoredNextUrl","extractPathFromFlightRouterState","pathname","navigationLock","getCurrentNavigationLock","now","Date","accumulation","separateRefreshUrls","scrollRef","restoreSeed","convertServerPatchToFullTree","UnknownDynamicStaleTime","task","startPPRNavigation","cache","routeTree","metadataVaryPath","FreshnessPolicy","HistoryTraversal","dynamicStaleAt","completeHardNavigation","spawnDynamicRequests","completeTraverseNavigation","node","route"],"mappings":";;;;+BAqBgBA;;;eAAAA;;;oCAhBiC;gCAO1C;4BAMA;yBACiC;AAEjC,SAASA,eACdC,KAA2B,EAC3BC,MAAqB;IAErB,0EAA0E;IAC1E,4FAA4F;IAC5F,gGAAgG;IAChG,6FAA6F;IAC7F,8DAA8D;IAC9D,yGAAyG;IACzG,IAAIC;IACJ,IAAIC;IACJ,MAAMC,eAAeH,OAAOG,YA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RouterStateSegment } from '../../../shared/lib/app-router-types'; | ||
| import { type PrefetchTask, type PrefetchSubtaskResult } from './scheduler'; | ||
| import type { NavigationLockPrefetch } from './navigation-testing-lock'; | ||
| import { type SegmentVaryPath, type PageVaryPath, type LayoutVaryPath } from './vary-path'; | ||
@@ -178,3 +179,3 @@ import type { NormalizedPathname, NormalizedSearch, RouteCacheKey } from './cache-key'; | ||
| */ | ||
| export declare function readSegmentCacheEntryForNavigation(now: number, varyPath: SegmentVaryPath): SegmentCacheEntry | null; | ||
| export declare function readSegmentCacheEntryForNavigation(now: number, varyPath: SegmentVaryPath, restrictToShell?: boolean): SegmentCacheEntry | null; | ||
| export declare function waitForSegmentCacheEntry(pendingEntry: PendingSegmentCacheEntry): Promise<FulfilledSegmentCacheEntry | null>; | ||
@@ -191,3 +192,3 @@ /** | ||
| */ | ||
| export declare function readOrCreateSegmentCacheEntry(now: number, fetchStrategy: FetchStrategy, tree: RouteTree): SegmentCacheEntry; | ||
| export declare function readOrCreateSegmentCacheEntry(now: number, fetchStrategy: FetchStrategy, tree: RouteTree, navigationLockPrefetch: NavigationLockPrefetch | null): SegmentCacheEntry; | ||
| export declare function readOrCreateRevalidatingSegmentEntry(now: number, fetchStrategy: FetchStrategy, tree: RouteTree): SegmentCacheEntry; | ||
@@ -197,3 +198,3 @@ export declare function overwriteRevalidatingSegmentCacheEntry(now: number, fetchStrategy: FetchStrategy, tree: RouteTree): EmptySegmentCacheEntry; | ||
| export declare function createDetachedSegmentCacheEntry(now: number): EmptySegmentCacheEntry; | ||
| export declare function upgradeToPendingSegment(emptyEntry: EmptySegmentCacheEntry, fetchStrategy: FetchStrategy): PendingSegmentCacheEntry; | ||
| export declare function upgradeToPendingSegment(emptyEntry: EmptySegmentCacheEntry, fetchStrategy: FetchStrategy, navigationLockPrefetch: NavigationLockPrefetch | null): PendingSegmentCacheEntry; | ||
| export declare function attemptToFulfillDynamicSegmentFromBFCache(now: number, segment: EmptySegmentCacheEntry, tree: RouteTree): FulfilledSegmentCacheEntry | null; | ||
@@ -200,0 +201,0 @@ /** |
@@ -13,5 +13,68 @@ /** | ||
| */ | ||
| import type { FlightRouterState } from '../../../shared/lib/app-router-types'; | ||
| import { type FlightRouterState } from '../../../shared/lib/app-router-types'; | ||
| import { type PendingSegmentCacheEntry, type SegmentCacheEntry } from './cache'; | ||
| import type { FetchStrategy } from './types'; | ||
| /** | ||
| * The "wait for the locked navigation's prefetch to fulfill" state for a single | ||
| * locked navigation. `promise` resolves once that prefetch has spawned every | ||
| * request and all of them have fulfilled, so the navigation reads present data | ||
| * rather than a still-in-flight entry. Owned by the prefetch task (one per | ||
| * navigation, so successive navigations in a scope resolve independently) and | ||
| * also tracked in `NavigationLockState.activePrefetches` so the lock can | ||
| * force-resolve any that are still pending when it's released. | ||
| * | ||
| * `pendingCount` holds one reference for the scheduler while it is still | ||
| * spawning, plus one per in-flight entry; `promise` resolves when it drains to | ||
| * 0. `trackedEntries` dedupes entry registration. | ||
| */ | ||
| export type NavigationLockPrefetch = { | ||
| promise: Promise<void>; | ||
| resolve: () => void; | ||
| pendingCount: number; | ||
| trackedEntries: Set<PendingSegmentCacheEntry>; | ||
| }; | ||
| export type NavigationLockState = { | ||
| released: Promise<void>; | ||
| resolveReleased: () => void; | ||
| fetch: typeof fetch; | ||
| activePrefetches: Set<NavigationLockPrefetch>; | ||
| ownedEntries: Set<SegmentCacheEntry>; | ||
| }; | ||
| export declare function getPreLockFetch(): typeof fetch | null; | ||
| /** | ||
| * Creates the "wait for prefetch to fulfill" state for one locked navigation, | ||
| * registers it on the current lock, and returns it (the caller stores it on the | ||
| * prefetch task and awaits `.promise`). Returns null if no lock is held. | ||
| * | ||
| * `pendingCount` starts at 1, representing the scheduler itself while it is | ||
| * still spawning requests; that reference is released by | ||
| * `finishNavigationLockPrefetchSpawning`. Each spawned pending entry adds | ||
| * another (see `trackNavigationLockPrefetchEntry`). `promise` resolves when the | ||
| * count drains to 0 — i.e. spawning finished and every entry fulfilled. | ||
| */ | ||
| export declare function beginNavigationLockPrefetch(): NavigationLockPrefetch | null; | ||
| /** | ||
| * Records a freshly-created segment entry as owned by the current lock scope, so | ||
| * navigation reads will match it — and only entries created within the scope | ||
| * (see `NavigationLockState.ownedEntries`). Called from | ||
| * `createDetachedSegmentCacheEntry`, the single factory every creation path | ||
| * funnels through, so re-keyed entries created during response processing (e.g. | ||
| * a runtime prefetch resolving a concrete param) are owned too. No-op when no | ||
| * lock is held. | ||
| */ | ||
| export declare function recordNavigationLockOwnedEntry(entry: SegmentCacheEntry): void; | ||
| /** | ||
| * Called by `upgradeToPendingSegment` whenever the locked-navigation prefetch | ||
| * spawns a pending segment entry. Adds the entry to the prefetch's ref count and | ||
| * decrements when it fulfills (or rejects — `waitForSegmentCacheEntry` resolves | ||
| * to null). Deduped so the same entry never double-counts. | ||
| */ | ||
| export declare function trackNavigationLockPrefetchEntry(prefetch: NavigationLockPrefetch, entry: PendingSegmentCacheEntry): void; | ||
| /** | ||
| * Called once the scheduler has finished spawning every request for the | ||
| * locked-navigation prefetch, releasing the scheduler's reference from the ref | ||
| * count. The prefetch resolves here if every spawned entry already fulfilled. | ||
| */ | ||
| export declare function finishNavigationLockPrefetchSpawning(prefetch: NavigationLockPrefetch): void; | ||
| /** | ||
| * Global fetch override | ||
@@ -45,7 +108,24 @@ * | ||
| export declare function isNavigationLocked(): boolean; | ||
| export declare function getCurrentNavigationLock(): Promise<void> | null; | ||
| export declare function getCurrentNavigationLock(): NavigationLockState | null; | ||
| /** | ||
| * Decides whether segment reads during a navigation should be restricted to | ||
| * shell entries (every param substituted with Fallback) rather than matching | ||
| * entries that vary on concrete route params. | ||
| * | ||
| * The testing tools (Navigation Inspector, instant()) simulate what a user | ||
| * would see with a warm cache. When the lock is held, partial prefetching is | ||
| * enabled for the target route, and no whole-route ("speculative") prefetch | ||
| * would have been made, only the shell is prefetched — so that's all a | ||
| * navigation should be allowed to match. A speculative prefetch happens for a | ||
| * `<Link prefetch={true}>` or an eagerly-prefetched subtree, in which case the | ||
| * concrete-param entry is genuinely warm and may be matched. | ||
| * | ||
| * Always returns false outside the testing API; the branch below is eliminated | ||
| * from production bundles. | ||
| */ | ||
| export declare function shouldRestrictNavigationToShell(rootPrefetchHints: number, linkFetchStrategy: FetchStrategy): boolean; | ||
| /** | ||
| * Waits for the navigation lock to be released, if it's currently held. | ||
| * No-op if the lock is not acquired. | ||
| */ | ||
| export declare function waitForNavigationLockIfActive(lock?: Promise<void> | null): Promise<void>; | ||
| export declare function waitForNavigationLockIfActive(lock?: NavigationLockState | null): Promise<void>; |
@@ -17,2 +17,4 @@ /** | ||
| 0 && (module.exports = { | ||
| beginNavigationLockPrefetch: null, | ||
| finishNavigationLockPrefetchSpawning: null, | ||
| getCurrentNavigationLock: null, | ||
@@ -22,3 +24,6 @@ getPreLockFetch: null, | ||
| isNavigationLocked: null, | ||
| recordNavigationLockOwnedEntry: null, | ||
| shouldRestrictNavigationToShell: null, | ||
| startListeningForInstantNavigationCookie: null, | ||
| trackNavigationLockPrefetchEntry: null, | ||
| updateCapturedSPAToTree: null, | ||
@@ -34,2 +39,8 @@ waitForNavigationLockIfActive: null | ||
| _export(exports, { | ||
| beginNavigationLockPrefetch: function() { | ||
| return beginNavigationLockPrefetch; | ||
| }, | ||
| finishNavigationLockPrefetchSpawning: function() { | ||
| return finishNavigationLockPrefetchSpawning; | ||
| }, | ||
| getCurrentNavigationLock: function() { | ||
@@ -47,5 +58,14 @@ return getCurrentNavigationLock; | ||
| }, | ||
| recordNavigationLockOwnedEntry: function() { | ||
| return recordNavigationLockOwnedEntry; | ||
| }, | ||
| shouldRestrictNavigationToShell: function() { | ||
| return shouldRestrictNavigationToShell; | ||
| }, | ||
| startListeningForInstantNavigationCookie: function() { | ||
| return startListeningForInstantNavigationCookie; | ||
| }, | ||
| trackNavigationLockPrefetchEntry: function() { | ||
| return trackNavigationLockPrefetchEntry; | ||
| }, | ||
| updateCapturedSPAToTree: function() { | ||
@@ -58,4 +78,7 @@ return updateCapturedSPAToTree; | ||
| }); | ||
| const _approutertypes = require("../../../shared/lib/app-router-types"); | ||
| const _approuterheaders = require("../app-router-headers"); | ||
| const _useactionqueue = require("../use-action-queue"); | ||
| const _scheduler = require("./scheduler"); | ||
| const _cache = require("./cache"); | ||
| function parseCookieValue(raw) { | ||
@@ -111,2 +134,59 @@ if (raw === '') { | ||
| } | ||
| function beginNavigationLockPrefetch() { | ||
| if (process.env.__NEXT_EXPOSE_TESTING_API && lockState !== null) { | ||
| let resolve; | ||
| const promise = new Promise((r)=>{ | ||
| resolve = r; | ||
| }); | ||
| const prefetch = { | ||
| promise, | ||
| resolve: resolve, | ||
| pendingCount: 1, | ||
| trackedEntries: new Set() | ||
| }; | ||
| lockState.activePrefetches.add(prefetch); | ||
| return prefetch; | ||
| } | ||
| return null; | ||
| } | ||
| function recordNavigationLockOwnedEntry(entry) { | ||
| if (process.env.__NEXT_EXPOSE_TESTING_API && lockState !== null) { | ||
| lockState.ownedEntries.add(entry); | ||
| } | ||
| } | ||
| function trackNavigationLockPrefetchEntry(prefetch, entry) { | ||
| if (process.env.__NEXT_EXPOSE_TESTING_API) { | ||
| if (prefetch.trackedEntries.has(entry)) { | ||
| return; | ||
| } | ||
| prefetch.trackedEntries.add(entry); | ||
| prefetch.pendingCount++; | ||
| const onSettled = ()=>{ | ||
| prefetch.pendingCount--; | ||
| settleNavigationLockPrefetchIfDrained(prefetch); | ||
| }; | ||
| // Decrement whether the entry fulfills or its request rejects, so a failed | ||
| // segment can't leave the navigation waiting forever. | ||
| (0, _cache.waitForSegmentCacheEntry)(entry).then(onSettled, onSettled); | ||
| } | ||
| } | ||
| function finishNavigationLockPrefetchSpawning(prefetch) { | ||
| if (process.env.__NEXT_EXPOSE_TESTING_API) { | ||
| prefetch.pendingCount--; | ||
| settleNavigationLockPrefetchIfDrained(prefetch); | ||
| } | ||
| } | ||
| function settleNavigationLockPrefetchIfDrained(prefetch) { | ||
| if (process.env.__NEXT_EXPOSE_TESTING_API) { | ||
| if (prefetch.pendingCount === 0) { | ||
| // Unregister from the lock (if still held) and resolve. Resolving is | ||
| // idempotent, so it's safe even if the lock already force-resolved this on | ||
| // release. | ||
| if (lockState !== null) { | ||
| lockState.activePrefetches.delete(prefetch); | ||
| } | ||
| prefetch.resolve(); | ||
| } | ||
| } | ||
| } | ||
| function acquireLock() { | ||
@@ -116,10 +196,12 @@ if (lockState !== null) { | ||
| } | ||
| let resolve; | ||
| const promise = new Promise((r)=>{ | ||
| resolve = r; | ||
| let resolveReleased; | ||
| const released = new Promise((r)=>{ | ||
| resolveReleased = r; | ||
| }); | ||
| lockState = { | ||
| promise, | ||
| resolve: resolve, | ||
| fetch: window.fetch | ||
| released, | ||
| resolveReleased: resolveReleased, | ||
| fetch: window.fetch, | ||
| activePrefetches: new Set(), | ||
| ownedEntries: new Set() | ||
| }; | ||
@@ -142,5 +224,11 @@ // Install the fetch blocker. We only intercept `window.fetch` for the | ||
| } | ||
| const { resolve } = lockState; | ||
| const { resolveReleased, activePrefetches } = lockState; | ||
| lockState = null; | ||
| resolve(); | ||
| // Force-resolve every prefetch that hasn't finished, so a navigation still | ||
| // waiting on one doesn't hang now that the scope is ending. | ||
| for (const prefetch of activePrefetches){ | ||
| prefetch.resolve(); | ||
| } | ||
| // Resolve the release promise so a gated dynamic write unblocks too. | ||
| resolveReleased(); | ||
| } | ||
@@ -159,3 +247,3 @@ function globalFetchOverride(input, init) { | ||
| const currentLock = lockState; | ||
| return currentLock.promise.then(()=>{ | ||
| return currentLock.released.then(()=>{ | ||
| const preLockFetch = currentLock.fetch; | ||
@@ -167,3 +255,3 @@ return preLockFetch(input, init); | ||
| if (process.env.__NEXT_EXPOSE_TESTING_API) { | ||
| // If the server served a static shell, this is an MPA page load | ||
| // If the server served a shell, this is an MPA page load | ||
| // while the lock is held. Transition to captured-MPA and acquire. | ||
@@ -270,10 +358,16 @@ if (self.__next_instant_test) { | ||
| if (process.env.__NEXT_EXPOSE_TESTING_API) { | ||
| return lockState !== null ? lockState.promise : null; | ||
| return lockState; | ||
| } | ||
| return null; | ||
| } | ||
| function shouldRestrictNavigationToShell(rootPrefetchHints, linkFetchStrategy) { | ||
| if (process.env.__NEXT_EXPOSE_TESTING_API) { | ||
| return isNavigationLocked() && (rootPrefetchHints & _approutertypes.PrefetchHint.SubtreeHasPartialPrefetching) !== 0 && !(0, _scheduler.subtreeHasSpeculativePrefetch)(linkFetchStrategy, rootPrefetchHints); | ||
| } | ||
| return false; | ||
| } | ||
| async function waitForNavigationLockIfActive(lock = getCurrentNavigationLock()) { | ||
| if (process.env.__NEXT_EXPOSE_TESTING_API) { | ||
| if (lock !== null) { | ||
| await lock; | ||
| await lock.released; | ||
| } | ||
@@ -280,0 +374,0 @@ } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/client/components/segment-cache/navigation-testing-lock.ts"],"sourcesContent":["/**\n * Navigation lock for the Instant Navigation Testing API.\n *\n * Manages the in-memory lock (a promise) that gates dynamic data writes\n * during instant navigation captures, and owns all cookie state\n * transitions (pending → captured-MPA, pending → captured-SPA).\n *\n * External actors (Playwright, devtools) set [0] to start a lock scope\n * and delete the cookie to end one. Next.js writes captured values.\n * The CookieStore handler distinguishes them by value: pending = external,\n * captured = self-write (ignored).\n */\n\nimport type {\n FlightRouterState,\n InstantCookie,\n} from '../../../shared/lib/app-router-types'\nimport { NEXT_INSTANT_TEST_COOKIE } from '../app-router-headers'\nimport { refreshOnInstantNavigationUnlock } from '../use-action-queue'\n\ntype InstantNavCookieState = 'empty' | 'pending' | 'mpa' | 'spa'\n\nfunction parseCookieValue(raw: string): InstantNavCookieState {\n if (raw === '') {\n return 'empty'\n }\n try {\n const parsed = JSON.parse(raw)\n if (Array.isArray(parsed)) {\n if (parsed.length >= 3) {\n const rawState = parsed[2]\n return rawState === null ? 'mpa' : 'spa'\n }\n }\n } catch {}\n return 'pending'\n}\n\nfunction writeCookieValue(value: InstantCookie): void {\n if (typeof cookieStore === 'undefined') {\n return\n }\n // Read the existing cookie to preserve its attributes (domain, path),\n // then write back with the new value. This updates the same cookie\n // entry that the external actor created, regardless of how it was\n // scoped.\n //\n // Capture the current lockState and compare it in the callback so we\n // only write if the lock we observed at call time is still held. This\n // guards against two races: (a) the scope ended between get and set\n // (lockState is now null), and (b) the scope ended and a new one was\n // acquired in the same gap (lockState is a different object). In\n // either case we must not write — doing so would leak stale state\n // into the next scope or outlive the current one.\n const lockAtCall = lockState\n cookieStore.get(NEXT_INSTANT_TEST_COOKIE).then((existing: any) => {\n if (existing && lockState === lockAtCall && lockAtCall !== null) {\n const options: any = {\n name: NEXT_INSTANT_TEST_COOKIE,\n value: JSON.stringify(value),\n path: existing.path ?? '/',\n }\n if (existing.domain) {\n options.domain = existing.domain\n }\n cookieStore.set(options)\n }\n })\n}\n\ntype NavigationLockState = {\n promise: Promise<void>\n resolve: () => void\n // The pre-lock `window.fetch`, captured at `acquireLock` time and\n // restored at `releaseLock`. Internal Next.js code reads this via\n // `getPreLockFetch` to bypass the override we install on `window.fetch`\n // during a lock scope.\n fetch: typeof fetch\n}\n\nlet lockState: NavigationLockState | null = null\n\nexport function getPreLockFetch(): typeof fetch | null {\n return lockState !== null ? lockState.fetch : null\n}\n\nfunction acquireLock(): void {\n if (lockState !== null) {\n return\n }\n let resolve: () => void\n const promise = new Promise<void>((r) => {\n resolve = r\n })\n lockState = { promise, resolve: resolve!, fetch: window.fetch }\n\n // Install the fetch blocker. We only intercept `window.fetch` for the\n // duration of the lock so that — outside of a testing scope — user-\n // installed overrides of `window.fetch` are untouched.\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n window.fetch = globalFetchOverride\n }\n}\n\nfunction releaseLock(): void {\n if (lockState === null) {\n return\n }\n // Restore the pre-lock `window.fetch` before resolving the lock promise\n // so any fetches queued on the promise see the restored fetch.\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n window.fetch = lockState.fetch\n }\n const { resolve } = lockState\n lockState = null\n resolve()\n}\n\n/**\n * Global fetch override\n *\n * While the navigation lock is active, we install this as `window.fetch` so\n * out-of-band client-side fetches (e.g. `fetch('/api/data')` inside a\n * useEffect) are blocked until the lock is released. Next.js internals\n * bypass the override by importing `fetch` from `./fetch`, which reads the\n * captured pre-lock fetch via `getPreLockFetch`.\n *\n * NOTE: This override only affects environments where the Instant Navigation\n * Testing API is enabled. It has no impact on live production behavior.\n */\nexport function globalFetchOverride(\n input: RequestInfo | URL,\n init?: RequestInit\n): Promise<Response> {\n if (lockState === null) {\n // Lock is not active. Fall through to the global fetch — we reach this\n // only if a caller captured a reference to this function during a lock\n // scope and invoked it after release.\n return fetch(input, init)\n }\n // Block user-initiated fetches until the lock is released, then dispatch\n // through the fetch captured at acquire time. Reading from `lockState`\n // (rather than `window.fetch`) pins to the capture even if `window.fetch`\n // is reassigned after release.\n const currentLock = lockState\n return currentLock.promise.then(() => {\n const preLockFetch = currentLock.fetch\n return preLockFetch(input, init)\n })\n}\n\n/**\n * Sets up the cookie-based lock. Handles the initial page load state and\n * registers a CookieStore listener for runtime changes.\n *\n * Called once during page initialization from app-globals.ts.\n */\nexport function startListeningForInstantNavigationCookie(): void {\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n // If the server served a static shell, this is an MPA page load\n // while the lock is held. Transition to captured-MPA and acquire.\n if (self.__next_instant_test) {\n if (typeof cookieStore !== 'undefined') {\n // If the cookie was already cleared during the MPA page\n // transition, reload to get the full dynamic page.\n cookieStore.get(NEXT_INSTANT_TEST_COOKIE).then((cookie: any) => {\n if (!cookie) {\n window.location.reload()\n }\n })\n }\n\n // Acquire the lock before writing the cookie. writeCookieValue's\n // guard requires lockState to be non-null at call time (so a stale\n // write can't outlive its scope). On a fresh page load that scope\n // is the one we're about to establish, so we have to establish it\n // first.\n acquireLock()\n writeCookieValue([1, `c${Math.random()}`, null])\n }\n\n if (typeof cookieStore === 'undefined') {\n return\n }\n\n cookieStore.addEventListener('change', (event: CookieChangeEvent) => {\n for (const cookie of event.changed) {\n if (cookie.name === NEXT_INSTANT_TEST_COOKIE) {\n const state = parseCookieValue(cookie.value ?? '')\n\n if (state === 'pending') {\n // External actor starting a new lock scope.\n if (lockState !== null) {\n // This can be the delayed CookieStore event for the pending\n // cookie that was already observed synchronously from\n // document.cookie. Keep the existing lock identity so work that\n // captured it keeps waiting on the same promise.\n return\n }\n acquireLock()\n }\n // Captured value (our own transition) or empty. Ignore.\n return\n }\n }\n\n for (const cookie of event.deleted) {\n if (cookie.name === NEXT_INSTANT_TEST_COOKIE) {\n releaseLock()\n refreshOnInstantNavigationUnlock()\n return\n }\n }\n })\n }\n}\n\n/**\n * Transitions the cookie from pending to captured-SPA once the prefetch resolves\n * and the navigation is known to be an SPA.\n */\nexport function updateCapturedSPAToTree(\n fromTree: FlightRouterState,\n toTree: FlightRouterState\n): void {\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n writeCookieValue([1, `c${Math.random()}`, { from: fromTree, to: toTree }])\n }\n}\n\n/**\n * Returns true if the navigation lock is currently active.\n */\nexport function isNavigationLocked(): boolean {\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n if (lockState !== null) {\n return true\n }\n\n // If `lockState` is null, fall back to reading the test cookie\n // synchronously from `document.cookie`. This accounts for a small race\n // between `cookieStore.set(...)` and its corresponding `change` event.\n // During that gap `lockState` is still null even though the cookie\n // indicates a new lock scope is starting.\n if (typeof document === 'undefined') {\n return false\n }\n const allCookies = document.cookie\n if (!allCookies.includes(NEXT_INSTANT_TEST_COOKIE)) {\n // Fast bail-out: in almost every navigation the test cookie is not\n // set at all.\n return false\n }\n const target = NEXT_INSTANT_TEST_COOKIE + '='\n for (const segment of allCookies.split(';')) {\n const trimmed = segment.trim()\n if (\n trimmed.startsWith(target) &&\n parseCookieValue(trimmed.slice(target.length)) === 'pending'\n ) {\n // The cookie was set by an external actor but the change event was not\n // yet dispatched. Acquire the lock synchronously.\n acquireLock()\n return true\n }\n }\n }\n return false\n}\n\nexport function getCurrentNavigationLock(): Promise<void> | null {\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n return lockState !== null ? lockState.promise : null\n }\n return null\n}\n\n/**\n * Waits for the navigation lock to be released, if it's currently held.\n * No-op if the lock is not acquired.\n */\nexport async function waitForNavigationLockIfActive(\n lock: Promise<void> | null = getCurrentNavigationLock()\n): Promise<void> {\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n if (lock !== null) {\n await lock\n }\n }\n}\n"],"names":["getCurrentNavigationLock","getPreLockFetch","globalFetchOverride","isNavigationLocked","startListeningForInstantNavigationCookie","updateCapturedSPAToTree","waitForNavigationLockIfActive","parseCookieValue","raw","parsed","JSON","parse","Array","isArray","length","rawState","writeCookieValue","value","cookieStore","lockAtCall","lockState","get","NEXT_INSTANT_TEST_COOKIE","then","existing","options","name","stringify","path","domain","set","fetch","acquireLock","resolve","promise","Promise","r","window","process","env","__NEXT_EXPOSE_TESTING_API","releaseLock","input","init","currentLock","preLockFetch","self","__next_instant_test","cookie","location","reload","Math","random","addEventListener","event","changed","state","deleted","refreshOnInstantNavigationUnlock","fromTree","toTree","from","to","document","allCookies","includes","target","segment","split","trimmed","trim","startsWith","slice","lock"],"mappings":"AAAA;;;;;;;;;;;CAWC;;;;;;;;;;;;;;;;;;;;IAmQeA,wBAAwB;eAAxBA;;IA5LAC,eAAe;eAAfA;;IAgDAC,mBAAmB;eAAnBA;;IAuGAC,kBAAkB;eAAlBA;;IA5EAC,wCAAwC;eAAxCA;;IAgEAC,uBAAuB;eAAvBA;;IA4DMC,6BAA6B;eAA7BA;;;kCAxQmB;gCACQ;AAIjD,SAASC,iBAAiBC,GAAW;IACnC,IAAIA,QAAQ,IAAI;QACd,OAAO;IACT;IACA,IAAI;QACF,MAAMC,SAASC,KAAKC,KAAK,CAACH;QAC1B,IAAII,MAAMC,OAAO,CAACJ,SAAS;YACzB,IAAIA,OAAOK,MAAM,IAAI,GAAG;gBACtB,MAAMC,WAAWN,MAAM,CAAC,EAAE;gBAC1B,OAAOM,aAAa,OAAO,QAAQ;YACrC;QACF;IACF,EAAE,OAAM,CAAC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,GAAG;IAClD;IACA,OAAO;AACT;AAMO,eAAe5B,8BACpBmE,OAA6BzE,0BAA0B;IAEvD,IAAIsC,QAAQC,GAAG,CAACC,yBAAyB,EAAE;QACzC,IAAIiC,SAAS,MAAM;YACjB,MAAMA;QACR;IACF;AACF","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/client/components/segment-cache/navigation-testing-lock.ts"],"sourcesContent":["/**\n * Navigation lock for the Instant Navigation Testing API.\n *\n * Manages the in-memory lock (a promise) that gates dynamic data writes\n * during instant navigation captures, and owns all cookie state\n * transitions (pending → captured-MPA, pending → captured-SPA).\n *\n * External actors (Playwright, devtools) set [0] to start a lock scope\n * and delete the cookie to end one. Next.js writes captured values.\n * The CookieStore handler distinguishes them by value: pending = external,\n * captured = self-write (ignored).\n */\n\nimport {\n PrefetchHint,\n type FlightRouterState,\n type InstantCookie,\n} from '../../../shared/lib/app-router-types'\nimport { NEXT_INSTANT_TEST_COOKIE } from '../app-router-headers'\nimport { refreshOnInstantNavigationUnlock } from '../use-action-queue'\nimport { subtreeHasSpeculativePrefetch } from './scheduler'\nimport {\n waitForSegmentCacheEntry,\n type PendingSegmentCacheEntry,\n type SegmentCacheEntry,\n} from './cache'\nimport type { FetchStrategy } from './types'\n\ntype InstantNavCookieState = 'empty' | 'pending' | 'mpa' | 'spa'\n\nfunction parseCookieValue(raw: string): InstantNavCookieState {\n if (raw === '') {\n return 'empty'\n }\n try {\n const parsed = JSON.parse(raw)\n if (Array.isArray(parsed)) {\n if (parsed.length >= 3) {\n const rawState = parsed[2]\n return rawState === null ? 'mpa' : 'spa'\n }\n }\n } catch {}\n return 'pending'\n}\n\nfunction writeCookieValue(value: InstantCookie): void {\n if (typeof cookieStore === 'undefined') {\n return\n }\n // Read the existing cookie to preserve its attributes (domain, path),\n // then write back with the new value. This updates the same cookie\n // entry that the external actor created, regardless of how it was\n // scoped.\n //\n // Capture the current lockState and compare it in the callback so we\n // only write if the lock we observed at call time is still held. This\n // guards against two races: (a) the scope ended between get and set\n // (lockState is now null), and (b) the scope ended and a new one was\n // acquired in the same gap (lockState is a different object). In\n // either case we must not write — doing so would leak stale state\n // into the next scope or outlive the current one.\n const lockAtCall = lockState\n cookieStore.get(NEXT_INSTANT_TEST_COOKIE).then((existing: any) => {\n if (existing && lockState === lockAtCall && lockAtCall !== null) {\n const options: any = {\n name: NEXT_INSTANT_TEST_COOKIE,\n value: JSON.stringify(value),\n path: existing.path ?? '/',\n }\n if (existing.domain) {\n options.domain = existing.domain\n }\n cookieStore.set(options)\n }\n })\n}\n\n/**\n * The \"wait for the locked navigation's prefetch to fulfill\" state for a single\n * locked navigation. `promise` resolves once that prefetch has spawned every\n * request and all of them have fulfilled, so the navigation reads present data\n * rather than a still-in-flight entry. Owned by the prefetch task (one per\n * navigation, so successive navigations in a scope resolve independently) and\n * also tracked in `NavigationLockState.activePrefetches` so the lock can\n * force-resolve any that are still pending when it's released.\n *\n * `pendingCount` holds one reference for the scheduler while it is still\n * spawning, plus one per in-flight entry; `promise` resolves when it drains to\n * 0. `trackedEntries` dedupes entry registration.\n */\nexport type NavigationLockPrefetch = {\n promise: Promise<void>\n resolve: () => void\n pendingCount: number\n trackedEntries: Set<PendingSegmentCacheEntry>\n}\n\nexport type NavigationLockState = {\n // Resolves when the lock is released (the testing scope ends). The dynamic-\n // data write during a locked navigation waits on this; see\n // `getCurrentNavigationLock` and `waitForNavigationLockIfActive`.\n released: Promise<void>\n resolveReleased: () => void\n // The pre-lock `window.fetch`, captured at `acquireLock` time and\n // restored at `releaseLock`. Internal Next.js code reads this via\n // `getPreLockFetch` to bypass the override we install on `window.fetch`\n // during a lock scope.\n fetch: typeof fetch\n // Every prefetch-completion state for this scope that hasn't resolved yet.\n // A prefetch removes itself when it drains; on release, any still here are\n // force-resolved so no navigation hangs waiting on a prefetch that the scope\n // ended before it could finish.\n activePrefetches: Set<NavigationLockPrefetch>\n // Every segment entry that was (re)fetched within this lock scope. Navigation\n // reads are restricted to these, so each instant() navigation observes only\n // data fetched under the lock — a \"clean read\" — and never matches a stale\n // entry left in the cache by an earlier navigation or prefetch. See\n // `readSegmentCacheEntryForNavigation`.\n ownedEntries: Set<SegmentCacheEntry>\n}\n\nlet lockState: NavigationLockState | null = null\n\nexport function getPreLockFetch(): typeof fetch | null {\n return lockState !== null ? lockState.fetch : null\n}\n\n/**\n * Creates the \"wait for prefetch to fulfill\" state for one locked navigation,\n * registers it on the current lock, and returns it (the caller stores it on the\n * prefetch task and awaits `.promise`). Returns null if no lock is held.\n *\n * `pendingCount` starts at 1, representing the scheduler itself while it is\n * still spawning requests; that reference is released by\n * `finishNavigationLockPrefetchSpawning`. Each spawned pending entry adds\n * another (see `trackNavigationLockPrefetchEntry`). `promise` resolves when the\n * count drains to 0 — i.e. spawning finished and every entry fulfilled.\n */\nexport function beginNavigationLockPrefetch(): NavigationLockPrefetch | null {\n if (process.env.__NEXT_EXPOSE_TESTING_API && lockState !== null) {\n let resolve: () => void\n const promise = new Promise<void>((r) => {\n resolve = r\n })\n const prefetch: NavigationLockPrefetch = {\n promise,\n resolve: resolve!,\n pendingCount: 1,\n trackedEntries: new Set(),\n }\n lockState.activePrefetches.add(prefetch)\n return prefetch\n }\n return null\n}\n\n/**\n * Records a freshly-created segment entry as owned by the current lock scope, so\n * navigation reads will match it — and only entries created within the scope\n * (see `NavigationLockState.ownedEntries`). Called from\n * `createDetachedSegmentCacheEntry`, the single factory every creation path\n * funnels through, so re-keyed entries created during response processing (e.g.\n * a runtime prefetch resolving a concrete param) are owned too. No-op when no\n * lock is held.\n */\nexport function recordNavigationLockOwnedEntry(entry: SegmentCacheEntry): void {\n if (process.env.__NEXT_EXPOSE_TESTING_API && lockState !== null) {\n lockState.ownedEntries.add(entry)\n }\n}\n\n/**\n * Called by `upgradeToPendingSegment` whenever the locked-navigation prefetch\n * spawns a pending segment entry. Adds the entry to the prefetch's ref count and\n * decrements when it fulfills (or rejects — `waitForSegmentCacheEntry` resolves\n * to null). Deduped so the same entry never double-counts.\n */\nexport function trackNavigationLockPrefetchEntry(\n prefetch: NavigationLockPrefetch,\n entry: PendingSegmentCacheEntry\n): void {\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n if (prefetch.trackedEntries.has(entry)) {\n return\n }\n prefetch.trackedEntries.add(entry)\n prefetch.pendingCount++\n const onSettled = () => {\n prefetch.pendingCount--\n settleNavigationLockPrefetchIfDrained(prefetch)\n }\n // Decrement whether the entry fulfills or its request rejects, so a failed\n // segment can't leave the navigation waiting forever.\n waitForSegmentCacheEntry(entry).then(onSettled, onSettled)\n }\n}\n\n/**\n * Called once the scheduler has finished spawning every request for the\n * locked-navigation prefetch, releasing the scheduler's reference from the ref\n * count. The prefetch resolves here if every spawned entry already fulfilled.\n */\nexport function finishNavigationLockPrefetchSpawning(\n prefetch: NavigationLockPrefetch\n): void {\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n prefetch.pendingCount--\n settleNavigationLockPrefetchIfDrained(prefetch)\n }\n}\n\nfunction settleNavigationLockPrefetchIfDrained(\n prefetch: NavigationLockPrefetch\n): void {\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n if (prefetch.pendingCount === 0) {\n // Unregister from the lock (if still held) and resolve. Resolving is\n // idempotent, so it's safe even if the lock already force-resolved this on\n // release.\n if (lockState !== null) {\n lockState.activePrefetches.delete(prefetch)\n }\n prefetch.resolve()\n }\n }\n}\n\nfunction acquireLock(): void {\n if (lockState !== null) {\n return\n }\n let resolveReleased: () => void\n const released = new Promise<void>((r) => {\n resolveReleased = r\n })\n lockState = {\n released,\n resolveReleased: resolveReleased!,\n fetch: window.fetch,\n activePrefetches: new Set(),\n ownedEntries: new Set(),\n }\n\n // Install the fetch blocker. We only intercept `window.fetch` for the\n // duration of the lock so that — outside of a testing scope — user-\n // installed overrides of `window.fetch` are untouched.\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n window.fetch = globalFetchOverride\n }\n}\n\nfunction releaseLock(): void {\n if (lockState === null) {\n return\n }\n // Restore the pre-lock `window.fetch` before resolving the lock promise\n // so any fetches queued on the promise see the restored fetch.\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n window.fetch = lockState.fetch\n }\n const { resolveReleased, activePrefetches } = lockState\n lockState = null\n // Force-resolve every prefetch that hasn't finished, so a navigation still\n // waiting on one doesn't hang now that the scope is ending.\n for (const prefetch of activePrefetches) {\n prefetch.resolve()\n }\n // Resolve the release promise so a gated dynamic write unblocks too.\n resolveReleased()\n}\n\n/**\n * Global fetch override\n *\n * While the navigation lock is active, we install this as `window.fetch` so\n * out-of-band client-side fetches (e.g. `fetch('/api/data')` inside a\n * useEffect) are blocked until the lock is released. Next.js internals\n * bypass the override by importing `fetch` from `./fetch`, which reads the\n * captured pre-lock fetch via `getPreLockFetch`.\n *\n * NOTE: This override only affects environments where the Instant Navigation\n * Testing API is enabled. It has no impact on live production behavior.\n */\nexport function globalFetchOverride(\n input: RequestInfo | URL,\n init?: RequestInit\n): Promise<Response> {\n if (lockState === null) {\n // Lock is not active. Fall through to the global fetch — we reach this\n // only if a caller captured a reference to this function during a lock\n // scope and invoked it after release.\n return fetch(input, init)\n }\n // Block user-initiated fetches until the lock is released, then dispatch\n // through the fetch captured at acquire time. Reading from `lockState`\n // (rather than `window.fetch`) pins to the capture even if `window.fetch`\n // is reassigned after release.\n const currentLock = lockState\n return currentLock.released.then(() => {\n const preLockFetch = currentLock.fetch\n return preLockFetch(input, init)\n })\n}\n\n/**\n * Sets up the cookie-based lock. Handles the initial page load state and\n * registers a CookieStore listener for runtime changes.\n *\n * Called once during page initialization from app-globals.ts.\n */\nexport function startListeningForInstantNavigationCookie(): void {\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n // If the server served a shell, this is an MPA page load\n // while the lock is held. Transition to captured-MPA and acquire.\n if (self.__next_instant_test) {\n if (typeof cookieStore !== 'undefined') {\n // If the cookie was already cleared during the MPA page\n // transition, reload to get the full dynamic page.\n cookieStore.get(NEXT_INSTANT_TEST_COOKIE).then((cookie: any) => {\n if (!cookie) {\n window.location.reload()\n }\n })\n }\n\n // Acquire the lock before writing the cookie. writeCookieValue's\n // guard requires lockState to be non-null at call time (so a stale\n // write can't outlive its scope). On a fresh page load that scope\n // is the one we're about to establish, so we have to establish it\n // first.\n acquireLock()\n writeCookieValue([1, `c${Math.random()}`, null])\n }\n\n if (typeof cookieStore === 'undefined') {\n return\n }\n\n cookieStore.addEventListener('change', (event: CookieChangeEvent) => {\n for (const cookie of event.changed) {\n if (cookie.name === NEXT_INSTANT_TEST_COOKIE) {\n const state = parseCookieValue(cookie.value ?? '')\n\n if (state === 'pending') {\n // External actor starting a new lock scope.\n if (lockState !== null) {\n // This can be the delayed CookieStore event for the pending\n // cookie that was already observed synchronously from\n // document.cookie. Keep the existing lock identity so work that\n // captured it keeps waiting on the same promise.\n return\n }\n acquireLock()\n }\n // Captured value (our own transition) or empty. Ignore.\n return\n }\n }\n\n for (const cookie of event.deleted) {\n if (cookie.name === NEXT_INSTANT_TEST_COOKIE) {\n releaseLock()\n refreshOnInstantNavigationUnlock()\n return\n }\n }\n })\n }\n}\n\n/**\n * Transitions the cookie from pending to captured-SPA once the prefetch resolves\n * and the navigation is known to be an SPA.\n */\nexport function updateCapturedSPAToTree(\n fromTree: FlightRouterState,\n toTree: FlightRouterState\n): void {\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n writeCookieValue([1, `c${Math.random()}`, { from: fromTree, to: toTree }])\n }\n}\n\n/**\n * Returns true if the navigation lock is currently active.\n */\nexport function isNavigationLocked(): boolean {\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n if (lockState !== null) {\n return true\n }\n\n // If `lockState` is null, fall back to reading the test cookie\n // synchronously from `document.cookie`. This accounts for a small race\n // between `cookieStore.set(...)` and its corresponding `change` event.\n // During that gap `lockState` is still null even though the cookie\n // indicates a new lock scope is starting.\n if (typeof document === 'undefined') {\n return false\n }\n const allCookies = document.cookie\n if (!allCookies.includes(NEXT_INSTANT_TEST_COOKIE)) {\n // Fast bail-out: in almost every navigation the test cookie is not\n // set at all.\n return false\n }\n const target = NEXT_INSTANT_TEST_COOKIE + '='\n for (const segment of allCookies.split(';')) {\n const trimmed = segment.trim()\n if (\n trimmed.startsWith(target) &&\n parseCookieValue(trimmed.slice(target.length)) === 'pending'\n ) {\n // The cookie was set by an external actor but the change event was not\n // yet dispatched. Acquire the lock synchronously.\n acquireLock()\n return true\n }\n }\n }\n return false\n}\n\nexport function getCurrentNavigationLock(): NavigationLockState | null {\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n return lockState\n }\n return null\n}\n\n/**\n * Decides whether segment reads during a navigation should be restricted to\n * shell entries (every param substituted with Fallback) rather than matching\n * entries that vary on concrete route params.\n *\n * The testing tools (Navigation Inspector, instant()) simulate what a user\n * would see with a warm cache. When the lock is held, partial prefetching is\n * enabled for the target route, and no whole-route (\"speculative\") prefetch\n * would have been made, only the shell is prefetched — so that's all a\n * navigation should be allowed to match. A speculative prefetch happens for a\n * `<Link prefetch={true}>` or an eagerly-prefetched subtree, in which case the\n * concrete-param entry is genuinely warm and may be matched.\n *\n * Always returns false outside the testing API; the branch below is eliminated\n * from production bundles.\n */\nexport function shouldRestrictNavigationToShell(\n rootPrefetchHints: number,\n linkFetchStrategy: FetchStrategy\n): boolean {\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n return (\n isNavigationLocked() &&\n (rootPrefetchHints & PrefetchHint.SubtreeHasPartialPrefetching) !== 0 &&\n !subtreeHasSpeculativePrefetch(linkFetchStrategy, rootPrefetchHints)\n )\n }\n return false\n}\n\n/**\n * Waits for the navigation lock to be released, if it's currently held.\n * No-op if the lock is not acquired.\n */\nexport async function waitForNavigationLockIfActive(\n lock: NavigationLockState | null = getCurrentNavigationLock()\n): Promise<void> {\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n if (lock !== null) {\n await lock.released\n }\n }\n}\n"],"names":["beginNavigationLockPrefetch","finishNavigationLockPrefetchSpawning","getCurrentNavigationLock","getPreLockFetch","globalFetchOverride","isNavigationLocked","recordNavigationLockOwnedEntry","shouldRestrictNavigationToShell","startListeningForInstantNavigationCookie","trackNavigationLockPrefetchEntry","updateCapturedSPAToTree","waitForNavigationLockIfActive","parseCookieValue","raw","parsed","JSON","parse","Array","isArray","length","rawState","writeCookieValue","value","cookieStore","lockAtCall","lockState","get","NEXT_INSTANT_TEST_COOKIE","then","existing","options","name","stringify","path","domain","set","fetch","process","env","__NEXT_EXPOSE_TESTING_API","resolve","promise","Promise","r","prefetch","pendingCount","trackedEntries","Set","activePrefetches","add","entry","ownedEntries","has","onSettled","settleNavigationLockPrefetchIfDrained","waitForSegmentCacheEntry","delete","acquireLock","resolveReleased","released","window","releaseLock","input","init","currentLock","preLockFetch","self","__next_instant_test","cookie","location","reload","Math","random","addEventListener","event","changed","state","deleted","refreshOnInstantNavigationUnlock","fromTree","toTree","from","to","document","allCookies","includes","target","segment","split","trimmed","trim","startsWith","slice","rootPrefetchHints","linkFetchStrategy","PrefetchHint","SubtreeHasPartialPrefetching","subtreeHasSpeculativePrefetch","lock"],"mappings":"AAAA;;;;;;;;;;;CAWC;;;;;;;;;;;;;;;;;;;;;;;;;IAgIeA,2BAA2B;eAA3BA;;IAgEAC,oCAAoC;eAApCA;;IA6NAC,wBAAwB;eAAxBA;;IA5SAC,eAAe;eAAfA;;IAgKAC,mBAAmB;eAAnBA;;IAuGAC,kBAAkB;eAAlBA;;IA7NAC,8BAA8B;eAA9BA;;IAyRAC,+BAA+B;eAA/BA;;IAxIAC,wCAAwC;eAAxCA;;IArIAC,gCAAgC;eAAhCA;;IAqMAC,uBAAuB;eAAvBA;;IA0FMC,6BAA6B;eAA7BA;;;gCAhcf;kCACkC;gCACQ;2BACH;uBAKvC;AAKP,SAASC,iBAAiBC,GAAW;IACnC,IAAIA,QAAQ,IAAI;QACd,OAAO;IACT;IACA,IAAI;QACF,MAAMC,SAASC,KAAKC,KAAK,CAACH;QAC1B,IAAII,MAAMC,OAAO,CAACJ,SAAS;YACzB,IAAIA,OAAOK,MAAM,IA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G,IAAI;YAC5B,IACED,QAAQE,UAAU,CAACL,WACnB1E,iBAAiB6E,QAAQG,KAAK,CAACN,OAAOnE,MAAM,OAAO,WACnD;gBACA,uEAAuE;gBACvE,kDAAkD;gBAClDsC;gBACA,OAAO;YACT;QACF;IACF;IACA,OAAO;AACT;AAEO,SAASvD;IACd,IAAImC,QAAQC,GAAG,CAACC,yBAAyB,EAAE;QACzC,OAAOd;IACT;IACA,OAAO;AACT;AAkBO,SAASlB,gCACdsF,iBAAyB,EACzBC,iBAAgC;IAEhC,IAAIzD,QAAQC,GAAG,CAACC,yBAAyB,EAAE;QACzC,OACElC,wBACA,AAACwF,CAAAA,oBAAoBE,4BAAY,CAACC,4BAA4B,AAAD,MAAO,KACpE,CAACC,IAAAA,wCAA6B,EAACH,mBAAmBD;IAEtD;IACA,OAAO;AACT;AAMO,eAAelF,8BACpBuF,OAAmChG,0BAA0B;IAE7D,IAAImC,QAAQC,GAAG,CAACC,yBAAyB,EAAE;QACzC,IAAI2D,SAAS,MAAM;YACjB,MAAMA,KAAKvC,QAAQ;QACrB;IACF;AACF","ignoreList":[0]} |
@@ -61,3 +61,3 @@ "use strict"; | ||
| // for routes that already have a cached route tree. Without this, the | ||
| // static shell might be incomplete because some segments were never | ||
| // shell might be incomplete because some segments were never | ||
| // requested. | ||
@@ -136,4 +136,8 @@ if (process.env.__NEXT_EXPOSE_TESTING_API) { | ||
| // aren't flooded with warnings the moment they enable Cache Components. | ||
| // | ||
| // The warning is suppressed if any segment on the target route exports | ||
| // `instant = false`, which is the explicit API for opting a route out of | ||
| // this validation. | ||
| const link = (0, _links.getLinkForCurrentNavigation)(); | ||
| if (link !== null && link.fetchStrategy === _types.FetchStrategy.Full && (navigationSeed.routeTree.prefetchHints & _approutertypes.PrefetchHint.SubtreeHasPartialPrefetching) === 0) { | ||
| if (link !== null && link.fetchStrategy === _types.FetchStrategy.Full && (navigationSeed.routeTree.prefetchHints & (_approutertypes.PrefetchHint.SubtreeHasPartialPrefetching | _approutertypes.PrefetchHint.SubtreeHasInstantFalse)) === 0) { | ||
| const error = (0, _instantmessages.createLinkPrefetchPartialError)(url.pathname); | ||
@@ -154,2 +158,11 @@ const ownerStack = 'ownerStack' in link ? link.ownerStack : undefined; | ||
| } | ||
| // Instant Navigation Testing API: when the lock is held, restrict segment | ||
| // reads to shell entries if the target route would only have prefetched | ||
| // its shell. | ||
| let restrictToShell = false; | ||
| if (process.env.__NEXT_EXPOSE_TESTING_API) { | ||
| const { shouldRestrictNavigationToShell } = require('./navigation-testing-lock'); | ||
| const link = (0, _links.getLinkForCurrentNavigation)(); | ||
| restrictToShell = shouldRestrictNavigationToShell(navigationSeed.routeTree.prefetchHints, link !== null ? link.fetchStrategy : _types.FetchStrategy.PPR); | ||
| } | ||
| const accumulation = { | ||
@@ -178,3 +191,3 @@ separateRefreshUrls: null, | ||
| const isSamePageNavigation = url.href === currentUrl.href; | ||
| const task = (0, _pprnavigations.startPPRNavigation)(now, currentUrl, currentRenderedSearch, currentCacheNode, currentFlightRouterState, navigationSeed.routeTree, navigationSeed.metadataVaryPath, freshnessPolicy, navigationSeed.data, navigationSeed.head, navigationSeed.dynamicStaleAt, isSamePageNavigation, accumulation); | ||
| const task = (0, _pprnavigations.startPPRNavigation)(now, currentUrl, currentRenderedSearch, currentCacheNode, currentFlightRouterState, navigationSeed.routeTree, navigationSeed.metadataVaryPath, freshnessPolicy, navigationSeed.data, navigationSeed.head, navigationSeed.dynamicStaleAt, isSamePageNavigation, accumulation, restrictToShell); | ||
| if (task !== null) { | ||
@@ -634,6 +647,13 @@ if (freshnessPolicy !== _pprnavigations.FreshnessPolicy.Gesture) { | ||
| const cacheKey = (0, _cachekey.createCacheKey)(url.href, nextUrl); | ||
| await new Promise((resolve)=>{ | ||
| (0, _scheduler.schedulePrefetchTask)(cacheKey, currentFlightRouterState, fetchStrategy, _types.PrefetchPriority.Default, null, resolve // _onComplete callback | ||
| ); | ||
| }); | ||
| // Create this navigation's "wait for prefetch to fulfill" state and schedule | ||
| // the prefetch as a locked-navigation prefetch. The prefetch's promise | ||
| // resolves once it has spawned every request and all of them have fulfilled, | ||
| // so the navigation below reads present data rather than a still-in-flight | ||
| // entry. | ||
| const { beginNavigationLockPrefetch } = require('./navigation-testing-lock'); | ||
| const navigationLockPrefetch = beginNavigationLockPrefetch(); | ||
| (0, _scheduler.schedulePrefetchTask)(cacheKey, currentFlightRouterState, fetchStrategy, _types.PrefetchPriority.Default, null, navigationLockPrefetch); | ||
| if (navigationLockPrefetch !== null) { | ||
| await navigationLockPrefetch.promise; | ||
| } | ||
| // Prefetch is complete. Proceed with the normal navigation flow, which | ||
@@ -640,0 +660,0 @@ // will now find the route in the cache. |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/client/components/segment-cache/navigation.ts"],"sourcesContent":["import type {\n CacheNodeSeedData,\n FlightRouterState,\n FlightSegmentPath,\n ScrollRef,\n} from '../../../shared/lib/app-router-types'\nimport type { CacheNode } from '../../../shared/lib/app-router-types'\nimport type { HeadData } from '../../../shared/lib/app-router-types'\nimport {\n PrefetchHint,\n SubtreePrefetchHints,\n propagateSubtreeBits,\n} from '../../../shared/lib/app-router-types'\nimport type { NormalizedFlightData } from '../../flight-data-helpers'\nimport { fetchServerResponse } from '../router-reducer/fetch-server-response'\nimport {\n startPPRNavigation,\n spawnDynamicRequests,\n FreshnessPolicy,\n getCurrentNavigationLock,\n type NavigationLock,\n type NavigationRequestAccumulation,\n} from '../router-reducer/ppr-navigations'\nimport { createHrefFromUrl } from '../router-reducer/create-href-from-url'\nimport { NEXT_NAV_DEPLOYMENT_ID_HEADER } from '../../../lib/constants'\nimport {\n EntryStatus,\n readRouteCacheEntry,\n deprecated_requestOptimisticRouteCacheEntry,\n convertRootFlightRouterStateToRouteTree,\n getStaleAt,\n writePrerenderResponseIntoCache,\n processRuntimePrefetchStream,\n writeDynamicRenderResponseIntoCache,\n type RouteTree,\n type FulfilledRouteCacheEntry,\n} from './cache'\nimport { discoverKnownRoute } from './optimistic-routes'\nimport { createCacheKey, type NormalizedSearch } from './cache-key'\nimport { schedulePrefetchTask } from './scheduler'\nimport { PrefetchPriority, FetchStrategy } from './types'\nimport { getLinkForCurrentNavigation } from '../links'\nimport type { PageVaryPath } from './vary-path'\nimport type { AppRouterState } from '../router-reducer/router-reducer-types'\nimport { ScrollBehavior } from '../router-reducer/router-reducer-types'\nimport { computeChangedPath } from '../router-reducer/compute-changed-path'\nimport { isJavaScriptURLString } from '../../lib/javascript-url'\nimport { UnknownDynamicStaleTime, computeDynamicStaleAt } from './bfcache'\nimport { createLinkPrefetchPartialError } from '../../../shared/lib/instant-messages'\n\n/**\n * Navigate to a new URL, using the Segment Cache to construct a response.\n *\n * To allow for synchronous navigations whenever possible, this is not an async\n * function. It returns a promise only if there's no matching prefetch in\n * the cache. Otherwise it returns an immediate result and uses Suspense/RSC to\n * stream in any missing data.\n */\nexport function navigate(\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n nextUrl: string | null,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace'\n): AppRouterState | Promise<AppRouterState> {\n let navigationLock: NavigationLock = null\n\n // Instant Navigation Testing API: when the lock is active, ensure a\n // prefetch task has been initiated before proceeding with the navigation.\n // This guarantees that segment data requests are at least pending, even\n // for routes that already have a cached route tree. Without this, the\n // static shell might be incomplete because some segments were never\n // requested.\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n const { isNavigationLocked } =\n require('./navigation-testing-lock') as typeof import('./navigation-testing-lock')\n if (isNavigationLocked()) {\n navigationLock = getCurrentNavigationLock()\n return ensurePrefetchThenNavigate(\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n nextUrl,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n )\n }\n }\n\n return navigateImpl(\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n nextUrl,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n )\n}\n\nfunction navigateImpl(\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n nextUrl: string | null,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock\n): AppRouterState | Promise<AppRouterState> {\n const now = Date.now()\n const href = url.href\n\n const cacheKey = createCacheKey(href, nextUrl)\n const route = readRouteCacheEntry(now, cacheKey)\n if (route !== null && route.status === EntryStatus.Fulfilled) {\n // We have a matching prefetch.\n return navigateUsingPrefetchedRouteTree(\n now,\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n route,\n navigationLock\n )\n }\n\n // There was no matching route tree in the cache. Let's see if we can\n // construct an \"optimistic\" route tree using the deprecated search-params\n // based matching. This is only used when the new optimisticRouting flag is\n // disabled.\n //\n // Do not construct an optimistic route tree if there was a cache hit, but\n // the entry has a rejected status, since it may have been rejected due to a\n // rewrite or redirect based on the search params.\n //\n // TODO: There are multiple reasons a prefetch might be rejected; we should\n // track them explicitly and choose what to do here based on that.\n if (!process.env.__NEXT_OPTIMISTIC_ROUTING) {\n if (route === null || route.status !== EntryStatus.Rejected) {\n const optimisticRoute = deprecated_requestOptimisticRouteCacheEntry(\n now,\n url,\n nextUrl\n )\n if (optimisticRoute !== null) {\n // We have an optimistic route tree. Proceed with the normal flow.\n return navigateUsingPrefetchedRouteTree(\n now,\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n optimisticRoute,\n navigationLock\n )\n }\n }\n }\n\n // There's no matching prefetch for this route in the cache. We must lazily\n // fetch it from the server before we can perform the navigation.\n //\n // TODO: If this is a gesture navigation, instead of performing a\n // dynamic request, we should do a runtime prefetch.\n return navigateToUnknownRoute(\n now,\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n ).catch(() => {\n // If the navigation fails, return the current state\n return state\n })\n}\n\nexport function navigateToKnownRoute(\n now: number,\n state: AppRouterState,\n url: URL,\n canonicalUrl: string,\n navigationSeed: NavigationSeed,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n freshnessPolicy: FreshnessPolicy,\n nextUrl: string | null,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock,\n debugInfo: Array<unknown> | null,\n // The route cache entry used for this navigation, if it came from route\n // prediction. Passed through so it can be marked as having a dynamic rewrite\n // if the server returns a different pathname (indicating dynamic rewrite\n // behavior).\n //\n // When null, the navigation did not use route prediction - either because\n // the route was already fully cached, or it's a navigation that doesn't\n // involve prediction (refresh, history traversal, server action, etc.).\n // In these cases, if a mismatch occurs, we still mark the route as having a\n // dynamic rewrite by traversing the known route tree (see\n // dispatchRetryDueToTreeMismatch).\n routeCacheEntry: FulfilledRouteCacheEntry | null\n): AppRouterState {\n // A version of navigate() that accepts the target route tree as an argument\n // rather than reading it from the prefetch cache.\n if (\n process.env.NODE_ENV !== 'production' &&\n process.env.__NEXT_CACHE_COMPONENTS\n ) {\n // Warn when navigating via a `<Link prefetch={true}>` to a route that has\n // not opted into Partial Prefetching. Such a link does a legacy \"full\"\n // prefetch that includes the route's dynamic data, defeating the\n // static/dynamic split that Cache Components provides.\n //\n // This runs at navigation time (rather than prefetch time) so that, in dev\n // where we don't prefetch, the warning only appears when you actually\n // navigate to the route — existing apps with many `prefetch={true}` links\n // aren't flooded with warnings the moment they enable Cache Components.\n const link = getLinkForCurrentNavigation()\n if (\n link !== null &&\n link.fetchStrategy === FetchStrategy.Full &&\n (navigationSeed.routeTree.prefetchHints &\n PrefetchHint.SubtreeHasPartialPrefetching) ===\n 0\n ) {\n const error = createLinkPrefetchPartialError(url.pathname)\n const ownerStack = 'ownerStack' in link ? link.ownerStack : undefined\n if (ownerStack === undefined) {\n console.error(\n '' +\n 'Cannot associate the \"prefetch={true}\" warning with a specific <Link> making it harder to find the cause of the following warning. ' +\n 'This is a bug in Next.js.'\n )\n } else if (ownerStack !== null) {\n // Replace the (useless) stack captured at the throw site — which\n // points into router internals — with the Owner Stack captured when\n // the <Link> rendered. That way the dev overlay associates this\n // warning with the JSX that created the link, not with\n // navigation.ts.\n error.stack = `${error.name}: ${error.message}${ownerStack}`\n }\n console.error(error)\n }\n }\n const accumulation: NavigationRequestAccumulation = {\n separateRefreshUrls: null,\n scrollRef: null,\n }\n // We special case navigations to the exact same URL as the current location.\n // It's a common UI pattern for apps to refresh when you click a link to the\n // current page. So when this happens, we refresh the dynamic data in the page\n // segments.\n //\n // Note that this does not apply if the any part of the hash or search query\n // has changed. This might feel a bit weird but it makes more sense when you\n // consider that the way to trigger this behavior is to click the same link\n // multiple times.\n //\n // TODO: We should probably refresh the *entire* route when this case occurs,\n // not just the page segments. Essentially treating it the same as a refresh()\n // triggered by an action, which is the more explicit way of modeling the UI\n // pattern described above.\n //\n // Also note that this only refreshes the dynamic data, not static/ cached\n // data. If the page segment is fully static and prefetched, the request is\n // skipped. (This is also how refresh() works.)\n const isSamePageNavigation = url.href === currentUrl.href\n const task = startPPRNavigation(\n now,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n navigationSeed.routeTree,\n navigationSeed.metadataVaryPath,\n freshnessPolicy,\n navigationSeed.data,\n navigationSeed.head,\n navigationSeed.dynamicStaleAt,\n isSamePageNavigation,\n accumulation\n )\n if (task !== null) {\n if (freshnessPolicy !== FreshnessPolicy.Gesture) {\n spawnDynamicRequests(\n task,\n url,\n nextUrl,\n freshnessPolicy,\n accumulation,\n routeCacheEntry,\n navigateType,\n navigationLock\n )\n }\n return completeSoftNavigation(\n state,\n url,\n nextUrl,\n task.route,\n task.node,\n navigationSeed.renderedSearch,\n canonicalUrl,\n navigateType,\n scrollBehavior,\n accumulation.scrollRef,\n debugInfo\n )\n }\n // Could not perform a SPA navigation. Revert to a full-page (MPA) navigation.\n return completeHardNavigation(state, url, navigateType)\n}\n\nfunction navigateUsingPrefetchedRouteTree(\n now: number,\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n nextUrl: string | null,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n route: FulfilledRouteCacheEntry,\n navigationLock: NavigationLock\n): AppRouterState {\n const routeTree = route.tree\n const canonicalUrl = route.canonicalUrl + url.hash\n const renderedSearch = route.renderedSearch\n const prefetchSeed: NavigationSeed = {\n renderedSearch,\n routeTree,\n metadataVaryPath: route.metadata.varyPath as any,\n data: null,\n head: null,\n dynamicStaleAt: computeDynamicStaleAt(now, UnknownDynamicStaleTime),\n }\n return navigateToKnownRoute(\n now,\n state,\n url,\n canonicalUrl,\n prefetchSeed,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n nextUrl,\n scrollBehavior,\n navigateType,\n navigationLock,\n null,\n route\n )\n}\n\n// Used to request all the dynamic data for a route, rather than just a subset,\n// e.g. during a refresh or a revalidation. Typically this gets constructed\n// during the normal flow when diffing the route tree, but for an unprefetched\n// navigation, where we don't know the structure of the target route, we use\n// this instead.\nconst DynamicRequestTreeForEntireRoute: FlightRouterState = [\n '',\n {},\n null,\n 'refetch',\n]\n\nasync function navigateToUnknownRoute(\n now: number,\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n nextUrl: string | null,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock\n): Promise<AppRouterState> {\n // Runs when a navigation happens but there's no cached prefetch we can use.\n // Don't bother to wait for a prefetch response; go straight to a full\n // navigation that contains both static and dynamic data in a single stream.\n // (This is unlike the old navigation implementation, which instead blocks\n // the dynamic request until a prefetch request is received.)\n //\n // To avoid duplication of logic, we're going to pretend that the tree\n // returned by the dynamic request is, in fact, a prefetch tree. Then we can\n // use the same server response to write the actual data into the CacheNode\n // tree. So it's the same flow as the \"happy path\" (prefetch, then\n // navigation), except we use a single server response for both stages.\n\n let dynamicRequestTree: FlightRouterState\n switch (freshnessPolicy) {\n case FreshnessPolicy.Default:\n case FreshnessPolicy.HistoryTraversal:\n case FreshnessPolicy.Gesture:\n dynamicRequestTree = currentFlightRouterState\n break\n case FreshnessPolicy.Hydration: // <- shouldn't happen during client nav\n case FreshnessPolicy.RefreshAll:\n case FreshnessPolicy.HMRRefresh:\n dynamicRequestTree = DynamicRequestTreeForEntireRoute\n break\n default:\n freshnessPolicy satisfies never\n dynamicRequestTree = currentFlightRouterState\n break\n }\n\n const promiseForDynamicServerResponse = fetchServerResponse(url, {\n flightRouterState: dynamicRequestTree,\n nextUrl,\n })\n const result = await promiseForDynamicServerResponse\n if (typeof result === 'string') {\n // This is an MPA navigation.\n const redirectUrl = new URL(result, location.origin)\n return completeHardNavigation(state, redirectUrl, navigateType)\n }\n\n const {\n flightData,\n canonicalUrl,\n renderedSearch,\n couldBeIntercepted,\n supportsPerSegmentPrefetching,\n dynamicStaleTime,\n staticStageData,\n runtimePrefetchStream,\n responseHeaders,\n debugInfo,\n } = result\n\n // Since the response format of dynamic requests and prefetches is slightly\n // different, we'll need to massage the data a bit. Create FlightRouterState\n // tree that simulates what we'd receive as the result of a prefetch.\n const navigationSeed = convertServerPatchToFullTree(\n now,\n currentFlightRouterState,\n flightData,\n renderedSearch,\n dynamicStaleTime\n )\n\n // Learn the route pattern so we can predict it for future navigations.\n // hasDynamicRewrite is false because this is a fresh navigation to an\n // unknown route - any rewrite detection happens during the traversal inside\n // discoverKnownRoute. The hasDynamicRewrite param is only set to true when\n // retrying after a tree mismatch (see dispatchRetryDueToTreeMismatch).\n const metadataVaryPath = navigationSeed.metadataVaryPath\n if (metadataVaryPath !== null) {\n discoverKnownRoute(\n now,\n url.pathname,\n url.search as NormalizedSearch,\n nextUrl,\n null, // No pending entry\n navigationSeed.routeTree,\n metadataVaryPath,\n couldBeIntercepted,\n createHrefFromUrl(canonicalUrl),\n supportsPerSegmentPrefetching,\n false // hasDynamicRewrite - not a retry, rewrite detection happens during traversal\n )\n\n if (staticStageData !== null) {\n const { response: staticStageResponse, isResponsePartial } =\n staticStageData\n\n // Write the static stage of the response into the segment cache so that\n // subsequent navigations can serve cached static segments instantly.\n getStaleAt(now, staticStageResponse.s)\n .then((staleAt) => {\n const buildId =\n responseHeaders.get(NEXT_NAV_DEPLOYMENT_ID_HEADER) ??\n staticStageResponse.b\n\n // TODO: Implement Shell extraction as part of Cached Navigations.\n // Intentionally holding off on doing this until we decide how the\n // Cached Navigations behavior should work in combination with App\n // Shells.\n writePrerenderResponseIntoCache(\n now,\n FetchStrategy.PPR,\n staticStageResponse.f,\n buildId,\n staticStageResponse.h,\n staticStageResponse.r ?? null,\n staleAt,\n currentFlightRouterState,\n renderedSearch,\n isResponsePartial\n )\n })\n .catch(() => {\n // The static stage processing failed. Not fatal — the navigation\n // completed normally, we just won't write into the cache.\n })\n }\n\n if (runtimePrefetchStream !== null) {\n processRuntimePrefetchStream(\n now,\n runtimePrefetchStream,\n currentFlightRouterState,\n renderedSearch\n )\n .then((processed) => {\n if (processed !== null) {\n writeDynamicRenderResponseIntoCache(\n now,\n FetchStrategy.PPRRuntime,\n processed.flightDatas,\n processed.buildId,\n processed.isResponsePartial,\n processed.headVaryParams,\n processed.rootVaryParamsIterable,\n processed.staleAt,\n processed.navigationSeed,\n null\n )\n }\n })\n .catch(() => {\n // The runtime prefetch cache write failed. Not fatal — the\n // navigation completed normally, we just won't cache runtime data.\n })\n }\n }\n\n // In the streaming dev render, this single response's seed content may still\n // be streaming when we build the tree below. An unknown-route navigation\n // places that content inline (it has no prior cache entry, so the server\n // sends a full seed rather than the dynamic-only delta a known route gets),\n // and that inline content is not gated like a known route's deferred RSCs. So\n // React could read a still-pending chunk and flash a Suspense fallback\n // (wanted on a cold cache, but not on a warm one). Wait for the shell to\n // flush (`revealAfter`) first, so the inline seed content is decoded by the\n // time React reads it, the same way the known-route path gates its deferred\n // RSCs. `revealAfter` is null outside the streaming dev render. On a cache\n // miss it resolves early, so the cold-cache fallback is still shown.\n if (result.revealAfter !== null) {\n await result.revealAfter\n }\n\n return navigateToKnownRoute(\n now,\n state,\n url,\n createHrefFromUrl(canonicalUrl),\n navigationSeed,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n nextUrl,\n scrollBehavior,\n navigateType,\n navigationLock,\n debugInfo,\n // Unknown route navigations don't use route prediction - the route tree\n // came directly from the server. If a mismatch occurs during dynamic data\n // fetch, the retry handler will traverse the known route tree to mark the\n // entry as having a dynamic rewrite.\n null\n )\n}\n\nexport function completeHardNavigation(\n state: AppRouterState,\n url: URL,\n navigateType: 'push' | 'replace'\n): AppRouterState {\n if (isJavaScriptURLString(url.href)) {\n console.error(\n 'Next.js has blocked a javascript: URL as a security precaution.'\n )\n return state\n }\n const newState: AppRouterState = {\n canonicalUrl:\n url.origin === location.origin ? createHrefFromUrl(url) : url.href,\n pushRef: {\n pendingPush: navigateType === 'push',\n mpaNavigation: true,\n preserveCustomHistoryState: false,\n },\n // TODO: None of the rest of these values are consistent with the incoming\n // navigation. We rely on the fact that AppRouter will suspend and trigger\n // a hard navigation before it accesses any of these values. But instead\n // we should trigger the hard navigation and blocking any subsequent\n // router updates without updating React.\n renderedSearch: state.renderedSearch,\n focusAndScrollRef: state.focusAndScrollRef,\n cache: state.cache,\n tree: state.tree,\n nextUrl: state.nextUrl,\n previousNextUrl: state.previousNextUrl,\n debugInfo: null,\n }\n return newState\n}\n\nexport function completeSoftNavigation(\n oldState: AppRouterState,\n url: URL,\n referringNextUrl: string | null,\n tree: FlightRouterState,\n cache: CacheNode,\n renderedSearch: string,\n canonicalUrl: string,\n navigateType: 'push' | 'replace',\n scrollBehavior: ScrollBehavior,\n scrollRef: ScrollRef | null,\n collectedDebugInfo: Array<unknown> | null\n) {\n // The \"Next-Url\" is a special representation of the URL that Next.js\n // uses to implement interception routes.\n // TODO: Get rid of this extra traversal by computing this during the\n // same traversal that computes the tree itself. We should also figure out\n // what is the minimum information needed for the server to correctly\n // intercept the route.\n const changedPath = computeChangedPath(oldState.tree, tree)\n const nextUrlForNewRoute = changedPath ? changedPath : oldState.nextUrl\n\n // This value is stored on the state as `previousNextUrl`; the naming is\n // confusing. What it represents is the \"Next-Url\" header that was used to\n // fetch the incoming route. It's essentially the refererer URL, but in a\n // Next.js specific format. During refreshes, this is sent back to the server\n // instead of the current route's \"Next-Url\" so that the same interception\n // logic is applied as during the original navigation.\n const previousNextUrl = referringNextUrl\n\n // Check if the only thing that changed was the hash fragment.\n const oldUrl = new URL(oldState.canonicalUrl, url)\n const onlyHashChange =\n // We don't need to compare the origins, because client-driven\n // navigations are always same-origin.\n url.pathname === oldUrl.pathname &&\n url.search === oldUrl.search &&\n url.hash !== oldUrl.hash\n\n // Determine whether and how the page should scroll after this\n // navigation.\n //\n // By default, we scroll to the segments that were navigated to — i.e.\n // segments in the new part of the route, as opposed to shared segments\n // that were already part of the previous route. All newly navigated\n // segments share a single ScrollRef. When they mount, the first one\n // to mount initiates the scroll. They share a ref so that only one\n // scroll happens per navigation.\n //\n // If a subsequent navigation produces new segments, those supersede\n // any pending scroll from the previous navigation by invalidating its\n // ScrollRef. If a navigation doesn't produce any new segments (e.g.\n // a refresh where the route structure didn't change), any pending\n // scrolls from previous navigations are unaffected.\n //\n // The branches below handle special cases layered on top of this\n // default model.\n let activeScrollRef: ScrollRef | null\n let forceScroll: boolean\n if (scrollBehavior === ScrollBehavior.NoScroll) {\n // The user explicitly opted out of scrolling (e.g. scroll={false}\n // on a Link or router.push).\n //\n // If this navigation created new scroll targets (scrollRef !== null),\n // neutralize them. If it didn't, any prior scroll targets carried\n // forward on the cache nodes via reuseSharedCacheNode remain active.\n if (scrollRef !== null) {\n scrollRef.current = false\n }\n activeScrollRef = oldState.focusAndScrollRef.scrollRef\n forceScroll = false\n } else if (onlyHashChange) {\n // Hash-only navigations should scroll regardless of per-node state.\n // Create a fresh ref so the first segment to scroll consumes it.\n //\n // Invalidate any scroll ref from a prior navigation that hasn't\n // been consumed yet.\n const oldScrollRef = oldState.focusAndScrollRef.scrollRef\n if (oldScrollRef !== null) {\n oldScrollRef.current = false\n }\n // Also invalidate any per-node refs that were accumulated during\n // this navigation's tree construction — the hash-only ref\n // supersedes them.\n if (scrollRef !== null) {\n scrollRef.current = false\n }\n activeScrollRef = { current: true }\n forceScroll = true\n } else {\n // Default case. Use the accumulated scrollRef (may be null if no\n // new segments were created). The handler checks per-node refs, so\n // unchanged parallel route slots won't scroll.\n activeScrollRef = scrollRef\n\n // If this navigation created new scroll targets, invalidate any\n // pending scroll from a previous navigation.\n if (scrollRef !== null) {\n const oldScrollRef = oldState.focusAndScrollRef.scrollRef\n if (oldScrollRef !== null) {\n oldScrollRef.current = false\n }\n }\n forceScroll = false\n }\n\n const newState: AppRouterState = {\n canonicalUrl,\n renderedSearch,\n pushRef: {\n pendingPush: navigateType === 'push',\n mpaNavigation: false,\n preserveCustomHistoryState: false,\n },\n focusAndScrollRef: {\n scrollRef: activeScrollRef,\n forceScroll,\n onlyHashChange,\n hashFragment:\n // Remove leading # and decode hash to make non-latin hashes work.\n //\n // Empty hash should trigger default behavior of scrolling layout into\n // view. #top is handled in layout-router.\n //\n // Refer to `ScrollAndFocusHandler` for details on how this is used.\n scrollBehavior !== ScrollBehavior.NoScroll && url.hash !== ''\n ? decodeURIComponent(url.hash.slice(1))\n : oldState.focusAndScrollRef.hashFragment,\n },\n cache,\n tree,\n nextUrl: nextUrlForNewRoute,\n previousNextUrl,\n debugInfo: collectedDebugInfo,\n }\n return newState\n}\n\nexport function completeTraverseNavigation(\n state: AppRouterState,\n url: URL,\n renderedSearch: string,\n cache: CacheNode,\n tree: FlightRouterState,\n nextUrl: string | null\n) {\n return {\n // Set canonical url\n canonicalUrl: createHrefFromUrl(url),\n renderedSearch,\n pushRef: {\n pendingPush: false,\n mpaNavigation: false,\n // Ensures that the custom history state that was set is preserved when applying this update.\n preserveCustomHistoryState: true,\n },\n focusAndScrollRef: state.focusAndScrollRef,\n cache,\n // Restore provided tree\n tree,\n nextUrl,\n // TODO: We need to restore previousNextUrl, too, which represents the\n // Next-Url that was used to fetch the data. Anywhere we fetch using the\n // canonical URL, there should be a corresponding Next-Url.\n previousNextUrl: null,\n debugInfo: null,\n }\n}\n\n// TODO: The rest of this file is related to converting the server response into\n// the data structures used by the client. Probably should move to a\n// separate module.\n\nexport type NavigationSeed = {\n renderedSearch: string\n routeTree: RouteTree\n metadataVaryPath: PageVaryPath | null\n data: CacheNodeSeedData | null\n head: HeadData | null\n dynamicStaleAt: number\n}\n\nexport function convertServerPatchToFullTree(\n now: number,\n currentTree: FlightRouterState,\n flightData: Array<NormalizedFlightData> | null,\n renderedSearch: string,\n dynamicStaleTimeSeconds: number\n): NavigationSeed {\n // During a client navigation or prefetch, the server sends back only a patch\n // for the parts of the tree that have changed.\n //\n // This applies the patch to the base tree to create a full representation of\n // the resulting tree.\n //\n // The return type includes a full FlightRouterState tree and a full\n // CacheNodeSeedData tree. (Conceptually these are the same tree, and should\n // eventually be unified, but there's still lots of existing code that\n // operates on FlightRouterState trees alone without the CacheNodeSeedData.)\n //\n // TODO: This similar to what apply-router-state-patch-to-tree does. It\n // will eventually fully replace it. We should get rid of all the remaining\n // places where we iterate over the server patch format. This should also\n // eventually replace normalizeFlightData.\n\n let baseTree: FlightRouterState = currentTree\n let baseData: CacheNodeSeedData | null = null\n let head: HeadData | null = null\n if (flightData !== null) {\n for (const {\n segmentPath,\n tree: treePatch,\n seedData: dataPatch,\n head: headPatch,\n } of flightData) {\n const result = convertServerPatchToFullTreeImpl(\n baseTree,\n baseData,\n treePatch,\n dataPatch,\n segmentPath,\n renderedSearch,\n 0\n )\n baseTree = result.tree\n baseData = result.data\n // This is the same for all patches per response, so just pick an\n // arbitrary one\n head = headPatch\n }\n }\n\n const finalFlightRouterState = baseTree\n\n // Convert the final FlightRouterState into a RouteTree type.\n //\n // TODO: Eventually, FlightRouterState will evolve to being a transport format\n // only. The RouteTree type will become the main type used for dealing with\n // routes on the client, and we'll store it in the state directly.\n const acc = { metadataVaryPath: null }\n const routeTree = convertRootFlightRouterStateToRouteTree(\n finalFlightRouterState,\n renderedSearch as NormalizedSearch,\n acc\n )\n\n return {\n routeTree,\n metadataVaryPath: acc.metadataVaryPath,\n data: baseData,\n renderedSearch,\n head,\n dynamicStaleAt: computeDynamicStaleAt(now, dynamicStaleTimeSeconds),\n }\n}\n\nfunction convertServerPatchToFullTreeImpl(\n baseRouterState: FlightRouterState,\n baseData: CacheNodeSeedData | null,\n treePatch: FlightRouterState,\n dataPatch: CacheNodeSeedData | null,\n segmentPath: FlightSegmentPath,\n renderedSearch: string,\n index: number\n): { tree: FlightRouterState; data: CacheNodeSeedData | null } {\n if (index === segmentPath.length) {\n // We reached the part of the tree that we need to patch.\n return {\n tree: treePatch,\n data: dataPatch,\n }\n }\n\n // segmentPath represents the parent path of subtree. It's a repeating\n // pattern of parallel route key and segment:\n //\n // [string, Segment, string, Segment, string, Segment, ...]\n //\n // This path tells us which part of the base tree to apply the tree patch.\n //\n // NOTE: We receive the FlightRouterState patch in the same request as the\n // seed data patch. Therefore we don't need to worry about diffing the segment\n // values; we can assume the server sent us a correct result.\n const updatedParallelRouteKey: string = segmentPath[index]\n // const segment: Segment = segmentPath[index + 1] <-- Not used, see note above\n\n const baseTreeChildren = baseRouterState[1]\n const baseSeedDataChildren = baseData !== null ? baseData[1] : null\n const newTreeChildren: Record<string, FlightRouterState> = {}\n const newSeedDataChildren: Record<string, CacheNodeSeedData | null> = {}\n for (const parallelRouteKey in baseTreeChildren) {\n const childBaseRouterState = baseTreeChildren[parallelRouteKey]\n const childBaseSeedData =\n baseSeedDataChildren !== null\n ? (baseSeedDataChildren[parallelRouteKey] ?? null)\n : null\n if (parallelRouteKey === updatedParallelRouteKey) {\n const result = convertServerPatchToFullTreeImpl(\n childBaseRouterState,\n childBaseSeedData,\n treePatch,\n dataPatch,\n segmentPath,\n renderedSearch,\n // Advance the index by two and keep cloning until we reach\n // the end of the segment path.\n index + 2\n )\n\n newTreeChildren[parallelRouteKey] = result.tree\n newSeedDataChildren[parallelRouteKey] = result.data\n } else {\n // This child is not being patched. Copy it over as-is.\n newTreeChildren[parallelRouteKey] = childBaseRouterState\n newSeedDataChildren[parallelRouteKey] = childBaseSeedData\n }\n }\n\n let clonedTree: FlightRouterState\n let clonedSeedData: CacheNodeSeedData\n // Clone all the fields except the children.\n\n // Clone the FlightRouterState tree. Based on equivalent logic in\n // apply-router-state-patch-to-tree, but should confirm whether we need to\n // copy all of these fields. Not sure the server ever sends, e.g. the\n // refetch marker.\n clonedTree = [baseRouterState[0], newTreeChildren]\n if (2 in baseRouterState) {\n const compressedRefreshState = baseRouterState[2]\n if (\n compressedRefreshState !== undefined &&\n compressedRefreshState !== null\n ) {\n // Since this part of the tree was patched with new data, any parent\n // refresh states should be updated to reflect the new rendered search\n // value. (The refresh state acts like a \"context provider\".) All pages\n // within the same server response share the same renderedSearch value,\n // but the same RouteTree could be composed from multiple different\n // routes, and multiple responses.\n clonedTree[2] = [compressedRefreshState[0], renderedSearch]\n }\n }\n if (3 in baseRouterState) {\n clonedTree[3] = baseRouterState[3]\n }\n // Recompute the propagated \"subtree\" prefetch hints for this segment. Mirrors\n // the propagation done on the server in\n // createFlightRouterStateFromLoaderTree.\n let prefetchHints = (baseRouterState[4] ?? 0) & ~SubtreePrefetchHints\n for (const parallelRouteKey in newTreeChildren) {\n const childHints = newTreeChildren[parallelRouteKey][4]\n if (childHints !== undefined) {\n prefetchHints = propagateSubtreeBits(prefetchHints, childHints)\n }\n }\n if (prefetchHints !== 0) {\n clonedTree[4] = prefetchHints\n }\n\n // Clone the CacheNodeSeedData tree.\n const isEmptySeedDataPartial = true\n clonedSeedData = [\n null,\n newSeedDataChildren,\n null,\n isEmptySeedDataPartial,\n null,\n ]\n\n return {\n tree: clonedTree,\n data: clonedSeedData,\n }\n}\n\n/**\n * Instant Navigation Testing API: ensures a prefetch task has been initiated\n * and completed before proceeding with the navigation. This guarantees that\n * segment data requests are at least pending, even for routes whose route\n * tree is already cached.\n *\n * After the prefetch completes, delegates to the normal navigation flow.\n */\nasync function ensurePrefetchThenNavigate(\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n nextUrl: string | null,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock\n): Promise<AppRouterState> {\n const link = getLinkForCurrentNavigation()\n const fetchStrategy = link !== null ? link.fetchStrategy : FetchStrategy.PPR\n\n const cacheKey = createCacheKey(url.href, nextUrl)\n\n await new Promise<void>((resolve) => {\n schedulePrefetchTask(\n cacheKey,\n currentFlightRouterState,\n fetchStrategy,\n PrefetchPriority.Default,\n null, // onInvalidate\n resolve // _onComplete callback\n )\n })\n\n // Prefetch is complete. Proceed with the normal navigation flow, which\n // will now find the route in the cache.\n const result = await navigateImpl(\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n nextUrl,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n )\n\n // Only transition to captured-SPA once the navigation is known to be an SPA.\n // If the result is an MPA navigation, leave the cookie pending and let the new\n // document load transition it to captured-MPA.\n if (!result.pushRef.mpaNavigation) {\n const { updateCapturedSPAToTree } =\n require('./navigation-testing-lock') as typeof import('./navigation-testing-lock')\n updateCapturedSPAToTree(currentFlightRouterState, result.tree)\n }\n\n return result\n}\n"],"names":["completeHardNavigation","completeSoftNavigation","completeTraverseNavigation","convertServerPatchToFullTree","navigate","navigateToKnownRoute","state","url","currentUrl","currentRenderedSearch","currentCacheNode","currentFlightRouterState","nextUrl","freshnessPolicy","scrollBehavior","navigateType","navigationLock","process","env","__NEXT_EXPOSE_TESTING_API","isNavigationLocked","require","getCurrentNavigationLock","ensurePrefetchThenNavigate","navigateImpl","now","Date","href","cacheKey","createCacheKey","route","readRouteCacheEntry","status","EntryStatus","Fulfilled","navigateUsingPrefetchedRouteTree","__NEXT_OPTIMISTIC_ROUTING","Rejected","optimisticRoute","deprecated_requestOptimisticRouteCacheEntry","navigateToUnknownRoute","catch","canonicalUrl","navigationSeed","debugInfo","routeCacheEntry","NODE_ENV","__NEXT_CACHE_COMPONENTS","link","getLinkForCurrentNavigation","fetchStrategy","FetchStrategy","Full","routeTree","prefetchHints","PrefetchHint","SubtreeHasPartialPrefetching","error","createLinkPrefetchPartialError","pathname","ownerStack","undefined","console","stack","name","message","accumulation","separateRefreshUrls","scrollRef","isSamePageNavigation","task","startPPRNavigation","metadataVaryPath","data","head","dynamicStaleAt","FreshnessPolicy","Gesture","spawnDynamicRequests","node","renderedSearch","tree","hash","prefetchSeed","metadata","varyPath","computeDynamicStaleAt","UnknownDynamicStaleTime","DynamicRequestTreeForEntireRoute","dynamicRequestTree","Default","HistoryTraversal","Hydration","RefreshAll","HMRRefresh","promiseForDynamicServerResponse","fetchServerResponse","flightRouterState","result","redirectUrl","URL","location","origin","flightData","couldBeIntercepted","supportsPerSegmentPrefetching","dynamicStaleTime","staticStageData","runtimePrefetchStream","responseHeaders","discoverKnownRoute","search","createHrefFromUrl","response","staticStageResponse","isResponsePartial","getStaleAt","s","then","staleAt","buildId","get","NEXT_NAV_DEPLOYMENT_ID_HEADER","b","writePrerenderResponseIntoCache","PPR","f","h","r","processRuntimePrefetchStream","processed","writeDynamicRenderResponseIntoCache","PPRRuntime","flightDatas","headVaryParams","rootVaryParamsIterable","revealAfter","isJavaScriptURLString","newState","pushRef","pendingPush","mpaNavigation","preserveCustomHistoryState","focusAndScrollRef","cache","previousNextUrl","oldState","referringNextUrl","collectedDebugInfo","changedPath","computeChangedPath","nextUrlForNewRoute","oldUrl","onlyHashChange","activeScrollRef","forceScroll","ScrollBehavior","NoScroll","current","oldScrollRef","hashFragment","decodeURIComponent","slice","currentTree","dynamicStaleTimeSeconds","baseTree","baseData","segmentPath","treePatch","seedData","dataPatch","headPatch","convertServerPatchToFullTreeImpl","finalFlightRouterState","acc","convertRootFlightRouterStateToRouteTree","baseRouterState","index","length","updatedParallelRouteKey","baseTreeChildren","baseSeedDataChildren","newTreeChildren","newSeedDataChildren","parallelRouteKey","childBaseRouterState","childBaseSeedData","clonedTree","clonedSeedData","compressedRefreshState","SubtreePrefetchHints","childHints","propagateSubtreeBits","isEmptySeedDataPartial","Promise","resolve","schedulePrefetchTask","PrefetchPriority","updateCapturedSPAToTree"],"mappings":";;;;;;;;;;;;;;;;;;;IAwmBgBA,sBAAsB;eAAtBA;;IAmCAC,sBAAsB;eAAtBA;;IA0IAC,0BAA0B;eAA1BA;;IA4CAC,4BAA4B;eAA5BA;;IAvwBAC,QAAQ;eAARA;;IA4JAC,oBAAoB;eAApBA;;;gCA1MT;qCAE6B;gCAQ7B;mCAC2B;2BACY;uBAYvC;kCAC4B;0BACmB;2BACjB;uBACW;uBACJ;oCAGb;oCACI;+BACG;yBACyB;iCAChB;AAUxC,SAASD,SACdE,KAAqB,EACrBC,GAAQ,EACRC,UAAe,EACfC,qBAA6B,EAC7BC,gBAAkC,EAClCC,wBAA2C,EAC3CC,OAAsB,EACtBC,eAAgC,EAChCC,cAA8B,EAC9BC,YAAgC;IAEhC,IAAIC,iBAAiC;IAErC,oEAAoE;IACp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QAAc,CAACC;QACvBC,IAAAA,+BAAoB,EAClBxK,UACAjB,0BACAuC,eACAmJ,uBAAgB,CAAC3G,OAAO,EACxB,MACAyG,QAAQ,uBAAuB;;IAEnC;IAEA,uEAAuE;IACvE,wCAAwC;IACxC,MAAMjG,SAAS,MAAM1E,aACnBlB,OACAC,KACAC,YACAC,uBACAC,kBACAC,0BACAC,SACAC,iBACAC,gBACAC,cACAC;IAGF,6EAA6E;IAC7E,+EAA+E;IAC/E,+CAA+C;IAC/C,IAAI,CAACkF,OAAOyC,OAAO,CAACE,aAAa,EAAE;QACjC,MAAM,EAAEyD,uBAAuB,EAAE,GAC/BjL,QAAQ;QACViL,wBAAwB3L,0BAA0BuF,OAAOjB,IAAI;IAC/D;IAEA,OAAOiB;AACT","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/client/components/segment-cache/navigation.ts"],"sourcesContent":["import type {\n CacheNodeSeedData,\n FlightRouterState,\n FlightSegmentPath,\n ScrollRef,\n} from '../../../shared/lib/app-router-types'\nimport type { CacheNode } from '../../../shared/lib/app-router-types'\nimport type { HeadData } from '../../../shared/lib/app-router-types'\nimport {\n PrefetchHint,\n SubtreePrefetchHints,\n propagateSubtreeBits,\n} from '../../../shared/lib/app-router-types'\nimport type { NormalizedFlightData } from '../../flight-data-helpers'\nimport { fetchServerResponse } from '../router-reducer/fetch-server-response'\nimport {\n startPPRNavigation,\n spawnDynamicRequests,\n FreshnessPolicy,\n getCurrentNavigationLock,\n type NavigationLock,\n type NavigationRequestAccumulation,\n} from '../router-reducer/ppr-navigations'\nimport { createHrefFromUrl } from '../router-reducer/create-href-from-url'\nimport { NEXT_NAV_DEPLOYMENT_ID_HEADER } from '../../../lib/constants'\nimport {\n EntryStatus,\n readRouteCacheEntry,\n deprecated_requestOptimisticRouteCacheEntry,\n convertRootFlightRouterStateToRouteTree,\n getStaleAt,\n writePrerenderResponseIntoCache,\n processRuntimePrefetchStream,\n writeDynamicRenderResponseIntoCache,\n type RouteTree,\n type FulfilledRouteCacheEntry,\n} from './cache'\nimport { discoverKnownRoute } from './optimistic-routes'\nimport { createCacheKey, type NormalizedSearch } from './cache-key'\nimport { schedulePrefetchTask } from './scheduler'\nimport { PrefetchPriority, FetchStrategy } from './types'\nimport { getLinkForCurrentNavigation } from '../links'\nimport type { PageVaryPath } from './vary-path'\nimport type { AppRouterState } from '../router-reducer/router-reducer-types'\nimport { ScrollBehavior } from '../router-reducer/router-reducer-types'\nimport { computeChangedPath } from '../router-reducer/compute-changed-path'\nimport { isJavaScriptURLString } from '../../lib/javascript-url'\nimport { UnknownDynamicStaleTime, computeDynamicStaleAt } from './bfcache'\nimport { createLinkPrefetchPartialError } from '../../../shared/lib/instant-messages'\n\n/**\n * Navigate to a new URL, using the Segment Cache to construct a response.\n *\n * To allow for synchronous navigations whenever possible, this is not an async\n * function. It returns a promise only if there's no matching prefetch in\n * the cache. Otherwise it returns an immediate result and uses Suspense/RSC to\n * stream in any missing data.\n */\nexport function navigate(\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n nextUrl: string | null,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace'\n): AppRouterState | Promise<AppRouterState> {\n let navigationLock: NavigationLock = null\n\n // Instant Navigation Testing API: when the lock is active, ensure a\n // prefetch task has been initiated before proceeding with the navigation.\n // This guarantees that segment data requests are at least pending, even\n // for routes that already have a cached route tree. Without this, the\n // shell might be incomplete because some segments were never\n // requested.\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n const { isNavigationLocked } =\n require('./navigation-testing-lock') as typeof import('./navigation-testing-lock')\n if (isNavigationLocked()) {\n navigationLock = getCurrentNavigationLock()\n return ensurePrefetchThenNavigate(\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n nextUrl,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n )\n }\n }\n\n return navigateImpl(\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n nextUrl,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n )\n}\n\nfunction navigateImpl(\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n nextUrl: string | null,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock\n): AppRouterState | Promise<AppRouterState> {\n const now = Date.now()\n const href = url.href\n\n const cacheKey = createCacheKey(href, nextUrl)\n const route = readRouteCacheEntry(now, cacheKey)\n if (route !== null && route.status === EntryStatus.Fulfilled) {\n // We have a matching prefetch.\n return navigateUsingPrefetchedRouteTree(\n now,\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n route,\n navigationLock\n )\n }\n\n // There was no matching route tree in the cache. Let's see if we can\n // construct an \"optimistic\" route tree using the deprecated search-params\n // based matching. This is only used when the new optimisticRouting flag is\n // disabled.\n //\n // Do not construct an optimistic route tree if there was a cache hit, but\n // the entry has a rejected status, since it may have been rejected due to a\n // rewrite or redirect based on the search params.\n //\n // TODO: There are multiple reasons a prefetch might be rejected; we should\n // track them explicitly and choose what to do here based on that.\n if (!process.env.__NEXT_OPTIMISTIC_ROUTING) {\n if (route === null || route.status !== EntryStatus.Rejected) {\n const optimisticRoute = deprecated_requestOptimisticRouteCacheEntry(\n now,\n url,\n nextUrl\n )\n if (optimisticRoute !== null) {\n // We have an optimistic route tree. Proceed with the normal flow.\n return navigateUsingPrefetchedRouteTree(\n now,\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n optimisticRoute,\n navigationLock\n )\n }\n }\n }\n\n // There's no matching prefetch for this route in the cache. We must lazily\n // fetch it from the server before we can perform the navigation.\n //\n // TODO: If this is a gesture navigation, instead of performing a\n // dynamic request, we should do a runtime prefetch.\n return navigateToUnknownRoute(\n now,\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n ).catch(() => {\n // If the navigation fails, return the current state\n return state\n })\n}\n\nexport function navigateToKnownRoute(\n now: number,\n state: AppRouterState,\n url: URL,\n canonicalUrl: string,\n navigationSeed: NavigationSeed,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n freshnessPolicy: FreshnessPolicy,\n nextUrl: string | null,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock,\n debugInfo: Array<unknown> | null,\n // The route cache entry used for this navigation, if it came from route\n // prediction. Passed through so it can be marked as having a dynamic rewrite\n // if the server returns a different pathname (indicating dynamic rewrite\n // behavior).\n //\n // When null, the navigation did not use route prediction - either because\n // the route was already fully cached, or it's a navigation that doesn't\n // involve prediction (refresh, history traversal, server action, etc.).\n // In these cases, if a mismatch occurs, we still mark the route as having a\n // dynamic rewrite by traversing the known route tree (see\n // dispatchRetryDueToTreeMismatch).\n routeCacheEntry: FulfilledRouteCacheEntry | null\n): AppRouterState {\n // A version of navigate() that accepts the target route tree as an argument\n // rather than reading it from the prefetch cache.\n if (\n process.env.NODE_ENV !== 'production' &&\n process.env.__NEXT_CACHE_COMPONENTS\n ) {\n // Warn when navigating via a `<Link prefetch={true}>` to a route that has\n // not opted into Partial Prefetching. Such a link does a legacy \"full\"\n // prefetch that includes the route's dynamic data, defeating the\n // static/dynamic split that Cache Components provides.\n //\n // This runs at navigation time (rather than prefetch time) so that, in dev\n // where we don't prefetch, the warning only appears when you actually\n // navigate to the route — existing apps with many `prefetch={true}` links\n // aren't flooded with warnings the moment they enable Cache Components.\n //\n // The warning is suppressed if any segment on the target route exports\n // `instant = false`, which is the explicit API for opting a route out of\n // this validation.\n const link = getLinkForCurrentNavigation()\n if (\n link !== null &&\n link.fetchStrategy === FetchStrategy.Full &&\n (navigationSeed.routeTree.prefetchHints &\n (PrefetchHint.SubtreeHasPartialPrefetching |\n PrefetchHint.SubtreeHasInstantFalse)) ===\n 0\n ) {\n const error = createLinkPrefetchPartialError(url.pathname)\n const ownerStack = 'ownerStack' in link ? link.ownerStack : undefined\n if (ownerStack === undefined) {\n console.error(\n '' +\n 'Cannot associate the \"prefetch={true}\" warning with a specific <Link> making it harder to find the cause of the following warning. ' +\n 'This is a bug in Next.js.'\n )\n } else if (ownerStack !== null) {\n // Replace the (useless) stack captured at the throw site — which\n // points into router internals — with the Owner Stack captured when\n // the <Link> rendered. That way the dev overlay associates this\n // warning with the JSX that created the link, not with\n // navigation.ts.\n error.stack = `${error.name}: ${error.message}${ownerStack}`\n }\n console.error(error)\n }\n }\n\n // Instant Navigation Testing API: when the lock is held, restrict segment\n // reads to shell entries if the target route would only have prefetched\n // its shell.\n let restrictToShell = false\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n const { shouldRestrictNavigationToShell } =\n require('./navigation-testing-lock') as typeof import('./navigation-testing-lock')\n const link = getLinkForCurrentNavigation()\n restrictToShell = shouldRestrictNavigationToShell(\n navigationSeed.routeTree.prefetchHints,\n link !== null ? link.fetchStrategy : FetchStrategy.PPR\n )\n }\n\n const accumulation: NavigationRequestAccumulation = {\n separateRefreshUrls: null,\n scrollRef: null,\n }\n // We special case navigations to the exact same URL as the current location.\n // It's a common UI pattern for apps to refresh when you click a link to the\n // current page. So when this happens, we refresh the dynamic data in the page\n // segments.\n //\n // Note that this does not apply if the any part of the hash or search query\n // has changed. This might feel a bit weird but it makes more sense when you\n // consider that the way to trigger this behavior is to click the same link\n // multiple times.\n //\n // TODO: We should probably refresh the *entire* route when this case occurs,\n // not just the page segments. Essentially treating it the same as a refresh()\n // triggered by an action, which is the more explicit way of modeling the UI\n // pattern described above.\n //\n // Also note that this only refreshes the dynamic data, not static/ cached\n // data. If the page segment is fully static and prefetched, the request is\n // skipped. (This is also how refresh() works.)\n const isSamePageNavigation = url.href === currentUrl.href\n const task = startPPRNavigation(\n now,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n navigationSeed.routeTree,\n navigationSeed.metadataVaryPath,\n freshnessPolicy,\n navigationSeed.data,\n navigationSeed.head,\n navigationSeed.dynamicStaleAt,\n isSamePageNavigation,\n accumulation,\n restrictToShell\n )\n if (task !== null) {\n if (freshnessPolicy !== FreshnessPolicy.Gesture) {\n spawnDynamicRequests(\n task,\n url,\n nextUrl,\n freshnessPolicy,\n accumulation,\n routeCacheEntry,\n navigateType,\n navigationLock\n )\n }\n return completeSoftNavigation(\n state,\n url,\n nextUrl,\n task.route,\n task.node,\n navigationSeed.renderedSearch,\n canonicalUrl,\n navigateType,\n scrollBehavior,\n accumulation.scrollRef,\n debugInfo\n )\n }\n // Could not perform a SPA navigation. Revert to a full-page (MPA) navigation.\n return completeHardNavigation(state, url, navigateType)\n}\n\nfunction navigateUsingPrefetchedRouteTree(\n now: number,\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n nextUrl: string | null,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n route: FulfilledRouteCacheEntry,\n navigationLock: NavigationLock\n): AppRouterState {\n const routeTree = route.tree\n const canonicalUrl = route.canonicalUrl + url.hash\n const renderedSearch = route.renderedSearch\n const prefetchSeed: NavigationSeed = {\n renderedSearch,\n routeTree,\n metadataVaryPath: route.metadata.varyPath as any,\n data: null,\n head: null,\n dynamicStaleAt: computeDynamicStaleAt(now, UnknownDynamicStaleTime),\n }\n return navigateToKnownRoute(\n now,\n state,\n url,\n canonicalUrl,\n prefetchSeed,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n nextUrl,\n scrollBehavior,\n navigateType,\n navigationLock,\n null,\n route\n )\n}\n\n// Used to request all the dynamic data for a route, rather than just a subset,\n// e.g. during a refresh or a revalidation. Typically this gets constructed\n// during the normal flow when diffing the route tree, but for an unprefetched\n// navigation, where we don't know the structure of the target route, we use\n// this instead.\nconst DynamicRequestTreeForEntireRoute: FlightRouterState = [\n '',\n {},\n null,\n 'refetch',\n]\n\nasync function navigateToUnknownRoute(\n now: number,\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n nextUrl: string | null,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock\n): Promise<AppRouterState> {\n // Runs when a navigation happens but there's no cached prefetch we can use.\n // Don't bother to wait for a prefetch response; go straight to a full\n // navigation that contains both static and dynamic data in a single stream.\n // (This is unlike the old navigation implementation, which instead blocks\n // the dynamic request until a prefetch request is received.)\n //\n // To avoid duplication of logic, we're going to pretend that the tree\n // returned by the dynamic request is, in fact, a prefetch tree. Then we can\n // use the same server response to write the actual data into the CacheNode\n // tree. So it's the same flow as the \"happy path\" (prefetch, then\n // navigation), except we use a single server response for both stages.\n\n let dynamicRequestTree: FlightRouterState\n switch (freshnessPolicy) {\n case FreshnessPolicy.Default:\n case FreshnessPolicy.HistoryTraversal:\n case FreshnessPolicy.Gesture:\n dynamicRequestTree = currentFlightRouterState\n break\n case FreshnessPolicy.Hydration: // <- shouldn't happen during client nav\n case FreshnessPolicy.RefreshAll:\n case FreshnessPolicy.HMRRefresh:\n dynamicRequestTree = DynamicRequestTreeForEntireRoute\n break\n default:\n freshnessPolicy satisfies never\n dynamicRequestTree = currentFlightRouterState\n break\n }\n\n const promiseForDynamicServerResponse = fetchServerResponse(url, {\n flightRouterState: dynamicRequestTree,\n nextUrl,\n })\n const result = await promiseForDynamicServerResponse\n if (typeof result === 'string') {\n // This is an MPA navigation.\n const redirectUrl = new URL(result, location.origin)\n return completeHardNavigation(state, redirectUrl, navigateType)\n }\n\n const {\n flightData,\n canonicalUrl,\n renderedSearch,\n couldBeIntercepted,\n supportsPerSegmentPrefetching,\n dynamicStaleTime,\n staticStageData,\n runtimePrefetchStream,\n responseHeaders,\n debugInfo,\n } = result\n\n // Since the response format of dynamic requests and prefetches is slightly\n // different, we'll need to massage the data a bit. Create FlightRouterState\n // tree that simulates what we'd receive as the result of a prefetch.\n const navigationSeed = convertServerPatchToFullTree(\n now,\n currentFlightRouterState,\n flightData,\n renderedSearch,\n dynamicStaleTime\n )\n\n // Learn the route pattern so we can predict it for future navigations.\n // hasDynamicRewrite is false because this is a fresh navigation to an\n // unknown route - any rewrite detection happens during the traversal inside\n // discoverKnownRoute. The hasDynamicRewrite param is only set to true when\n // retrying after a tree mismatch (see dispatchRetryDueToTreeMismatch).\n const metadataVaryPath = navigationSeed.metadataVaryPath\n if (metadataVaryPath !== null) {\n discoverKnownRoute(\n now,\n url.pathname,\n url.search as NormalizedSearch,\n nextUrl,\n null, // No pending entry\n navigationSeed.routeTree,\n metadataVaryPath,\n couldBeIntercepted,\n createHrefFromUrl(canonicalUrl),\n supportsPerSegmentPrefetching,\n false // hasDynamicRewrite - not a retry, rewrite detection happens during traversal\n )\n\n if (staticStageData !== null) {\n const { response: staticStageResponse, isResponsePartial } =\n staticStageData\n\n // Write the static stage of the response into the segment cache so that\n // subsequent navigations can serve cached static segments instantly.\n getStaleAt(now, staticStageResponse.s)\n .then((staleAt) => {\n const buildId =\n responseHeaders.get(NEXT_NAV_DEPLOYMENT_ID_HEADER) ??\n staticStageResponse.b\n\n // TODO: Implement Shell extraction as part of Cached Navigations.\n // Intentionally holding off on doing this until we decide how the\n // Cached Navigations behavior should work in combination with App\n // Shells.\n writePrerenderResponseIntoCache(\n now,\n FetchStrategy.PPR,\n staticStageResponse.f,\n buildId,\n staticStageResponse.h,\n staticStageResponse.r ?? null,\n staleAt,\n currentFlightRouterState,\n renderedSearch,\n isResponsePartial\n )\n })\n .catch(() => {\n // The static stage processing failed. Not fatal — the navigation\n // completed normally, we just won't write into the cache.\n })\n }\n\n if (runtimePrefetchStream !== null) {\n processRuntimePrefetchStream(\n now,\n runtimePrefetchStream,\n currentFlightRouterState,\n renderedSearch\n )\n .then((processed) => {\n if (processed !== null) {\n writeDynamicRenderResponseIntoCache(\n now,\n FetchStrategy.PPRRuntime,\n processed.flightDatas,\n processed.buildId,\n processed.isResponsePartial,\n processed.headVaryParams,\n processed.rootVaryParamsIterable,\n processed.staleAt,\n processed.navigationSeed,\n null\n )\n }\n })\n .catch(() => {\n // The runtime prefetch cache write failed. Not fatal — the\n // navigation completed normally, we just won't cache runtime data.\n })\n }\n }\n\n // In the streaming dev render, this single response's seed content may still\n // be streaming when we build the tree below. An unknown-route navigation\n // places that content inline (it has no prior cache entry, so the server\n // sends a full seed rather than the dynamic-only delta a known route gets),\n // and that inline content is not gated like a known route's deferred RSCs. So\n // React could read a still-pending chunk and flash a Suspense fallback\n // (wanted on a cold cache, but not on a warm one). Wait for the shell to\n // flush (`revealAfter`) first, so the inline seed content is decoded by the\n // time React reads it, the same way the known-route path gates its deferred\n // RSCs. `revealAfter` is null outside the streaming dev render. On a cache\n // miss it resolves early, so the cold-cache fallback is still shown.\n if (result.revealAfter !== null) {\n await result.revealAfter\n }\n\n return navigateToKnownRoute(\n now,\n state,\n url,\n createHrefFromUrl(canonicalUrl),\n navigationSeed,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n nextUrl,\n scrollBehavior,\n navigateType,\n navigationLock,\n debugInfo,\n // Unknown route navigations don't use route prediction - the route tree\n // came directly from the server. If a mismatch occurs during dynamic data\n // fetch, the retry handler will traverse the known route tree to mark the\n // entry as having a dynamic rewrite.\n null\n )\n}\n\nexport function completeHardNavigation(\n state: AppRouterState,\n url: URL,\n navigateType: 'push' | 'replace'\n): AppRouterState {\n if (isJavaScriptURLString(url.href)) {\n console.error(\n 'Next.js has blocked a javascript: URL as a security precaution.'\n )\n return state\n }\n const newState: AppRouterState = {\n canonicalUrl:\n url.origin === location.origin ? createHrefFromUrl(url) : url.href,\n pushRef: {\n pendingPush: navigateType === 'push',\n mpaNavigation: true,\n preserveCustomHistoryState: false,\n },\n // TODO: None of the rest of these values are consistent with the incoming\n // navigation. We rely on the fact that AppRouter will suspend and trigger\n // a hard navigation before it accesses any of these values. But instead\n // we should trigger the hard navigation and blocking any subsequent\n // router updates without updating React.\n renderedSearch: state.renderedSearch,\n focusAndScrollRef: state.focusAndScrollRef,\n cache: state.cache,\n tree: state.tree,\n nextUrl: state.nextUrl,\n previousNextUrl: state.previousNextUrl,\n debugInfo: null,\n }\n return newState\n}\n\nexport function completeSoftNavigation(\n oldState: AppRouterState,\n url: URL,\n referringNextUrl: string | null,\n tree: FlightRouterState,\n cache: CacheNode,\n renderedSearch: string,\n canonicalUrl: string,\n navigateType: 'push' | 'replace',\n scrollBehavior: ScrollBehavior,\n scrollRef: ScrollRef | null,\n collectedDebugInfo: Array<unknown> | null\n) {\n // The \"Next-Url\" is a special representation of the URL that Next.js\n // uses to implement interception routes.\n // TODO: Get rid of this extra traversal by computing this during the\n // same traversal that computes the tree itself. We should also figure out\n // what is the minimum information needed for the server to correctly\n // intercept the route.\n const changedPath = computeChangedPath(oldState.tree, tree)\n const nextUrlForNewRoute = changedPath ? changedPath : oldState.nextUrl\n\n // This value is stored on the state as `previousNextUrl`; the naming is\n // confusing. What it represents is the \"Next-Url\" header that was used to\n // fetch the incoming route. It's essentially the refererer URL, but in a\n // Next.js specific format. During refreshes, this is sent back to the server\n // instead of the current route's \"Next-Url\" so that the same interception\n // logic is applied as during the original navigation.\n const previousNextUrl = referringNextUrl\n\n // Check if the only thing that changed was the hash fragment.\n const oldUrl = new URL(oldState.canonicalUrl, url)\n const onlyHashChange =\n // We don't need to compare the origins, because client-driven\n // navigations are always same-origin.\n url.pathname === oldUrl.pathname &&\n url.search === oldUrl.search &&\n url.hash !== oldUrl.hash\n\n // Determine whether and how the page should scroll after this\n // navigation.\n //\n // By default, we scroll to the segments that were navigated to — i.e.\n // segments in the new part of the route, as opposed to shared segments\n // that were already part of the previous route. All newly navigated\n // segments share a single ScrollRef. When they mount, the first one\n // to mount initiates the scroll. They share a ref so that only one\n // scroll happens per navigation.\n //\n // If a subsequent navigation produces new segments, those supersede\n // any pending scroll from the previous navigation by invalidating its\n // ScrollRef. If a navigation doesn't produce any new segments (e.g.\n // a refresh where the route structure didn't change), any pending\n // scrolls from previous navigations are unaffected.\n //\n // The branches below handle special cases layered on top of this\n // default model.\n let activeScrollRef: ScrollRef | null\n let forceScroll: boolean\n if (scrollBehavior === ScrollBehavior.NoScroll) {\n // The user explicitly opted out of scrolling (e.g. scroll={false}\n // on a Link or router.push).\n //\n // If this navigation created new scroll targets (scrollRef !== null),\n // neutralize them. If it didn't, any prior scroll targets carried\n // forward on the cache nodes via reuseSharedCacheNode remain active.\n if (scrollRef !== null) {\n scrollRef.current = false\n }\n activeScrollRef = oldState.focusAndScrollRef.scrollRef\n forceScroll = false\n } else if (onlyHashChange) {\n // Hash-only navigations should scroll regardless of per-node state.\n // Create a fresh ref so the first segment to scroll consumes it.\n //\n // Invalidate any scroll ref from a prior navigation that hasn't\n // been consumed yet.\n const oldScrollRef = oldState.focusAndScrollRef.scrollRef\n if (oldScrollRef !== null) {\n oldScrollRef.current = false\n }\n // Also invalidate any per-node refs that were accumulated during\n // this navigation's tree construction — the hash-only ref\n // supersedes them.\n if (scrollRef !== null) {\n scrollRef.current = false\n }\n activeScrollRef = { current: true }\n forceScroll = true\n } else {\n // Default case. Use the accumulated scrollRef (may be null if no\n // new segments were created). The handler checks per-node refs, so\n // unchanged parallel route slots won't scroll.\n activeScrollRef = scrollRef\n\n // If this navigation created new scroll targets, invalidate any\n // pending scroll from a previous navigation.\n if (scrollRef !== null) {\n const oldScrollRef = oldState.focusAndScrollRef.scrollRef\n if (oldScrollRef !== null) {\n oldScrollRef.current = false\n }\n }\n forceScroll = false\n }\n\n const newState: AppRouterState = {\n canonicalUrl,\n renderedSearch,\n pushRef: {\n pendingPush: navigateType === 'push',\n mpaNavigation: false,\n preserveCustomHistoryState: false,\n },\n focusAndScrollRef: {\n scrollRef: activeScrollRef,\n forceScroll,\n onlyHashChange,\n hashFragment:\n // Remove leading # and decode hash to make non-latin hashes work.\n //\n // Empty hash should trigger default behavior of scrolling layout into\n // view. #top is handled in layout-router.\n //\n // Refer to `ScrollAndFocusHandler` for details on how this is used.\n scrollBehavior !== ScrollBehavior.NoScroll && url.hash !== ''\n ? decodeURIComponent(url.hash.slice(1))\n : oldState.focusAndScrollRef.hashFragment,\n },\n cache,\n tree,\n nextUrl: nextUrlForNewRoute,\n previousNextUrl,\n debugInfo: collectedDebugInfo,\n }\n return newState\n}\n\nexport function completeTraverseNavigation(\n state: AppRouterState,\n url: URL,\n renderedSearch: string,\n cache: CacheNode,\n tree: FlightRouterState,\n nextUrl: string | null\n) {\n return {\n // Set canonical url\n canonicalUrl: createHrefFromUrl(url),\n renderedSearch,\n pushRef: {\n pendingPush: false,\n mpaNavigation: false,\n // Ensures that the custom history state that was set is preserved when applying this update.\n preserveCustomHistoryState: true,\n },\n focusAndScrollRef: state.focusAndScrollRef,\n cache,\n // Restore provided tree\n tree,\n nextUrl,\n // TODO: We need to restore previousNextUrl, too, which represents the\n // Next-Url that was used to fetch the data. Anywhere we fetch using the\n // canonical URL, there should be a corresponding Next-Url.\n previousNextUrl: null,\n debugInfo: null,\n }\n}\n\n// TODO: The rest of this file is related to converting the server response into\n// the data structures used by the client. Probably should move to a\n// separate module.\n\nexport type NavigationSeed = {\n renderedSearch: string\n routeTree: RouteTree\n metadataVaryPath: PageVaryPath | null\n data: CacheNodeSeedData | null\n head: HeadData | null\n dynamicStaleAt: number\n}\n\nexport function convertServerPatchToFullTree(\n now: number,\n currentTree: FlightRouterState,\n flightData: Array<NormalizedFlightData> | null,\n renderedSearch: string,\n dynamicStaleTimeSeconds: number\n): NavigationSeed {\n // During a client navigation or prefetch, the server sends back only a patch\n // for the parts of the tree that have changed.\n //\n // This applies the patch to the base tree to create a full representation of\n // the resulting tree.\n //\n // The return type includes a full FlightRouterState tree and a full\n // CacheNodeSeedData tree. (Conceptually these are the same tree, and should\n // eventually be unified, but there's still lots of existing code that\n // operates on FlightRouterState trees alone without the CacheNodeSeedData.)\n //\n // TODO: This similar to what apply-router-state-patch-to-tree does. It\n // will eventually fully replace it. We should get rid of all the remaining\n // places where we iterate over the server patch format. This should also\n // eventually replace normalizeFlightData.\n\n let baseTree: FlightRouterState = currentTree\n let baseData: CacheNodeSeedData | null = null\n let head: HeadData | null = null\n if (flightData !== null) {\n for (const {\n segmentPath,\n tree: treePatch,\n seedData: dataPatch,\n head: headPatch,\n } of flightData) {\n const result = convertServerPatchToFullTreeImpl(\n baseTree,\n baseData,\n treePatch,\n dataPatch,\n segmentPath,\n renderedSearch,\n 0\n )\n baseTree = result.tree\n baseData = result.data\n // This is the same for all patches per response, so just pick an\n // arbitrary one\n head = headPatch\n }\n }\n\n const finalFlightRouterState = baseTree\n\n // Convert the final FlightRouterState into a RouteTree type.\n //\n // TODO: Eventually, FlightRouterState will evolve to being a transport format\n // only. The RouteTree type will become the main type used for dealing with\n // routes on the client, and we'll store it in the state directly.\n const acc = { metadataVaryPath: null }\n const routeTree = convertRootFlightRouterStateToRouteTree(\n finalFlightRouterState,\n renderedSearch as NormalizedSearch,\n acc\n )\n\n return {\n routeTree,\n metadataVaryPath: acc.metadataVaryPath,\n data: baseData,\n renderedSearch,\n head,\n dynamicStaleAt: computeDynamicStaleAt(now, dynamicStaleTimeSeconds),\n }\n}\n\nfunction convertServerPatchToFullTreeImpl(\n baseRouterState: FlightRouterState,\n baseData: CacheNodeSeedData | null,\n treePatch: FlightRouterState,\n dataPatch: CacheNodeSeedData | null,\n segmentPath: FlightSegmentPath,\n renderedSearch: string,\n index: number\n): { tree: FlightRouterState; data: CacheNodeSeedData | null } {\n if (index === segmentPath.length) {\n // We reached the part of the tree that we need to patch.\n return {\n tree: treePatch,\n data: dataPatch,\n }\n }\n\n // segmentPath represents the parent path of subtree. It's a repeating\n // pattern of parallel route key and segment:\n //\n // [string, Segment, string, Segment, string, Segment, ...]\n //\n // This path tells us which part of the base tree to apply the tree patch.\n //\n // NOTE: We receive the FlightRouterState patch in the same request as the\n // seed data patch. Therefore we don't need to worry about diffing the segment\n // values; we can assume the server sent us a correct result.\n const updatedParallelRouteKey: string = segmentPath[index]\n // const segment: Segment = segmentPath[index + 1] <-- Not used, see note above\n\n const baseTreeChildren = baseRouterState[1]\n const baseSeedDataChildren = baseData !== null ? baseData[1] : null\n const newTreeChildren: Record<string, FlightRouterState> = {}\n const newSeedDataChildren: Record<string, CacheNodeSeedData | null> = {}\n for (const parallelRouteKey in baseTreeChildren) {\n const childBaseRouterState = baseTreeChildren[parallelRouteKey]\n const childBaseSeedData =\n baseSeedDataChildren !== null\n ? (baseSeedDataChildren[parallelRouteKey] ?? null)\n : null\n if (parallelRouteKey === updatedParallelRouteKey) {\n const result = convertServerPatchToFullTreeImpl(\n childBaseRouterState,\n childBaseSeedData,\n treePatch,\n dataPatch,\n segmentPath,\n renderedSearch,\n // Advance the index by two and keep cloning until we reach\n // the end of the segment path.\n index + 2\n )\n\n newTreeChildren[parallelRouteKey] = result.tree\n newSeedDataChildren[parallelRouteKey] = result.data\n } else {\n // This child is not being patched. Copy it over as-is.\n newTreeChildren[parallelRouteKey] = childBaseRouterState\n newSeedDataChildren[parallelRouteKey] = childBaseSeedData\n }\n }\n\n let clonedTree: FlightRouterState\n let clonedSeedData: CacheNodeSeedData\n // Clone all the fields except the children.\n\n // Clone the FlightRouterState tree. Based on equivalent logic in\n // apply-router-state-patch-to-tree, but should confirm whether we need to\n // copy all of these fields. Not sure the server ever sends, e.g. the\n // refetch marker.\n clonedTree = [baseRouterState[0], newTreeChildren]\n if (2 in baseRouterState) {\n const compressedRefreshState = baseRouterState[2]\n if (\n compressedRefreshState !== undefined &&\n compressedRefreshState !== null\n ) {\n // Since this part of the tree was patched with new data, any parent\n // refresh states should be updated to reflect the new rendered search\n // value. (The refresh state acts like a \"context provider\".) All pages\n // within the same server response share the same renderedSearch value,\n // but the same RouteTree could be composed from multiple different\n // routes, and multiple responses.\n clonedTree[2] = [compressedRefreshState[0], renderedSearch]\n }\n }\n if (3 in baseRouterState) {\n clonedTree[3] = baseRouterState[3]\n }\n // Recompute the propagated \"subtree\" prefetch hints for this segment. Mirrors\n // the propagation done on the server in\n // createFlightRouterStateFromLoaderTree.\n let prefetchHints = (baseRouterState[4] ?? 0) & ~SubtreePrefetchHints\n for (const parallelRouteKey in newTreeChildren) {\n const childHints = newTreeChildren[parallelRouteKey][4]\n if (childHints !== undefined) {\n prefetchHints = propagateSubtreeBits(prefetchHints, childHints)\n }\n }\n if (prefetchHints !== 0) {\n clonedTree[4] = prefetchHints\n }\n\n // Clone the CacheNodeSeedData tree.\n const isEmptySeedDataPartial = true\n clonedSeedData = [\n null,\n newSeedDataChildren,\n null,\n isEmptySeedDataPartial,\n null,\n ]\n\n return {\n tree: clonedTree,\n data: clonedSeedData,\n }\n}\n\n/**\n * Instant Navigation Testing API: ensures a prefetch task has been initiated\n * and completed before proceeding with the navigation. This guarantees that\n * segment data requests are at least pending, even for routes whose route\n * tree is already cached.\n *\n * After the prefetch completes, delegates to the normal navigation flow.\n */\nasync function ensurePrefetchThenNavigate(\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n nextUrl: string | null,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock\n): Promise<AppRouterState> {\n const link = getLinkForCurrentNavigation()\n const fetchStrategy = link !== null ? link.fetchStrategy : FetchStrategy.PPR\n\n const cacheKey = createCacheKey(url.href, nextUrl)\n\n // Create this navigation's \"wait for prefetch to fulfill\" state and schedule\n // the prefetch as a locked-navigation prefetch. The prefetch's promise\n // resolves once it has spawned every request and all of them have fulfilled,\n // so the navigation below reads present data rather than a still-in-flight\n // entry.\n const { beginNavigationLockPrefetch } =\n require('./navigation-testing-lock') as typeof import('./navigation-testing-lock')\n const navigationLockPrefetch = beginNavigationLockPrefetch()\n schedulePrefetchTask(\n cacheKey,\n currentFlightRouterState,\n fetchStrategy,\n PrefetchPriority.Default,\n null, // onInvalidate\n navigationLockPrefetch\n )\n if (navigationLockPrefetch !== null) {\n await navigationLockPrefetch.promise\n }\n\n // Prefetch is complete. Proceed with the normal navigation flow, which\n // will now find the route in the cache.\n const result = await navigateImpl(\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n nextUrl,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n )\n\n // Only transition to captured-SPA once the navigation is known to be an SPA.\n // If the result is an MPA navigation, leave the cookie pending and let the new\n // document load transition it to captured-MPA.\n if (!result.pushRef.mpaNavigation) {\n const { updateCapturedSPAToTree } =\n require('./navigation-testing-lock') as typeof import('./navigation-testing-lock')\n updateCapturedSPAToTree(currentFlightRouterState, result.tree)\n }\n\n return result\n}\n"],"names":["completeHardNavigation","completeSoftNavigation","completeTraverseNavigation","convertServerPatchToFullTree","navigate","navigateToKnownRoute","state","url","currentUrl","currentRenderedSearch","currentCacheNode","currentFlightRouterState","nextUrl","freshnessPolicy","scrollBehavior","navigateType","navigationLock","process","env","__NEXT_EXPOSE_TESTING_API","isNavigationLocked","require","getCurrentNavigationLock","ensurePrefetchThenNavigate","navigateImpl","now","Date","href","cacheKey","createCacheKey","route","readRouteCacheEntry","status","EntryStatus","Fulfilled","navigateUsingPrefetchedRouteTree","__NEXT_OPTIMISTIC_ROUTING","Rejected","optimisticRoute","deprecated_requestOptimisticRouteCacheEntry","navigateToUnknownRoute","catch","canonicalUrl","navigationSeed","debugInfo","routeCacheEntry","NODE_ENV","__NEXT_CACHE_COMPONENTS","link","getLinkForCurrentNavigation","fetchStrategy","FetchStrategy","Full","routeTree","prefetchHints","PrefetchHint","SubtreeHasPartialPrefetching","SubtreeHasInstantFalse","error","createLinkPrefetchPartialError","pathname","ownerStack","undefined","console","stack","name","message","restrictToShell","shouldRestrictNavigationToShell","PPR","accumulation","separateRefreshUrls","scrollRef","isSamePageNavigation","task","startPPRNavigation","metadataVaryPath","data","head","dynamicStaleAt","FreshnessPolicy","Gesture","spawnDynamicRequests","node","renderedSearch","tree","hash","prefetchSeed","metadata","varyPath","computeDynamicStaleAt","UnknownDynamicStaleTime","DynamicRequestTreeForEntireRoute","dynamicRequestTree","Default","HistoryTraversal","Hydration","RefreshAll","HMRRefresh","promiseForDynamicServerResponse","fetchServerResponse","flightRouterState","result","redirectUrl","URL","location","origin","flightData","couldBeIntercepted","supportsPerSegmentPrefetching","dynamicStaleTime","staticStageData","runtimePrefetchStream","responseHeaders","discoverKnownRoute","search","createHrefFromUrl","response","staticStageResponse","isResponsePartial","getStaleAt","s","then","staleAt","buildId","get","NEXT_NAV_DEPLOYMENT_ID_HEADER","b","writePrerenderResponseIntoCache","f","h","r","processRuntimePrefetchStream","processed","writeDynamicRenderResponseIntoCache","PPRRuntime","flightDatas","headVaryParams","rootVaryParamsIterable","revealAfter","isJavaScriptURLString","newState","pushRef","pendingPush","mpaNavigation","preserveCustomHistoryState","focusAndScrollRef","cache","previousNextUrl","oldState","referringNextUrl","collectedDebugInfo","changedPath","computeChangedPath","nextUrlForNewRoute","oldUrl","onlyHashChange","activeScrollRef","forceScroll","ScrollBehavior","NoScroll","current","oldScrollRef","hashFragment","decodeURIComponent","slice","currentTree","dynamicStaleTimeSeconds","baseTree","baseData","segmentPath","treePatch","seedData","dataPatch","headPatch","convertServerPatchToFullTreeImpl","finalFlightRouterState","acc","convertRootFlightRouterStateToRouteTree","baseRouterState","index","length","updatedParallelRouteKey","baseTreeChildren","baseSeedDataChildren","newTreeChildren","newSeedDataChildren","parallelRouteKey","childBaseRouterState","childBaseSeedData","clonedTree","clonedSeedData","compressedRefreshState","SubtreePrefetchHints","childHints","propagateSubtreeBits","isEmptySeedDataPartial","beginNavigationLockPrefetch","navigationLockPrefetch","schedulePrefetchTask","PrefetchPriority","promise","updateCapturedSPAToTree"],"mappings":";;;;;;;;;;;;;;;;;;;IA6nBgBA,sBAAsB;eAAtBA;;IAmCAC,sBAAsB;eAAtBA;;IA0IAC,0BAA0B;eAA1BA;;IA4CAC,4BAA4B;eAA5BA;;IA5xBAC,QAAQ;eAARA;;IA4JAC,oBAAoB;eAApBA;;;gCA1MT;qCAE6B;gCAQ7B;mCAC2B;2BACY;uBAYvC;kCAC4B;0BACmB;2BACjB;uBACW;uBACJ;oCAGb;oCACI;+BACG;yBACyB;iCAChB;AAUxC,SAASD,SACdE,KAAqB,EACrBC,GAAQ,EACRC,UAAe,EACfC,qBAA6B,EAC7BC,gBAAkC,EAClCC,wBAA2C,EAC3CC,OAAsB,EACtBC,eAAgC,EAChCC,cAA8B,EAC9BC,YAAgC;IAEhC,IAAIC,iBAAiC;IAErC,oEAAoE;IACpE,0EAA0E;IAC1E,wEAAwE;IACxE,sEAAsE;IACtE,6DAA6D;IAC7D,aAAa;IACb,IAAIC,QAAQC,GAAG,CAACC,yBAAyB,EAAE;QACzC,MAAM,EAAEC,kBAAkB,EAAE,GAC1BC,QAAQ;QACV,IAAID,sBAAsB;YACxBJ,iBAAiBM,IAAAA,wCAAwB;YACzC,OAAOC,2BACLjB,OACAC,KACAC,YACAC,uBACAC,kBACAC,0BACAC,SACAC,iBACAC,gBACAC,cACAC;QAEJ;IACF;IAEA,OAAOQ,aACLlB,OACAC,KACAC,YACAC,uBACAC,kBACAC,0BACAC,SACAC,iBACAC,gBACAC,cACAC;AAEJ;AAEA,SAASQ,aACPlB,KAAqB,EACrBC,GAAQ,EAC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A6E;IAC7E,2EAA2E;IAC3E,SAAS;IACT,MAAM,EAAEyL,2BAA2B,EAAE,GACnChL,QAAQ;IACV,MAAMiL,yBAAyBD;IAC/BE,IAAAA,+BAAoB,EAClB3K,UACAjB,0BACAuC,eACAsJ,uBAAgB,CAAC1G,OAAO,EACxB,MACAwG;IAEF,IAAIA,2BAA2B,MAAM;QACnC,MAAMA,uBAAuBG,OAAO;IACtC;IAEA,uEAAuE;IACvE,wCAAwC;IACxC,MAAMnG,SAAS,MAAM9E,aACnBlB,OACAC,KACAC,YACAC,uBACAC,kBACAC,0BACAC,SACAC,iBACAC,gBACAC,cACAC;IAGF,6EAA6E;IAC7E,+EAA+E;IAC/E,+CAA+C;IAC/C,IAAI,CAACsF,OAAOwC,OAAO,CAACE,aAAa,EAAE;QACjC,MAAM,EAAE0D,uBAAuB,EAAE,GAC/BrL,QAAQ;QACVqL,wBAAwB/L,0BAA0B2F,OAAOjB,IAAI;IAC/D;IAEA,OAAOiB;AACT","ignoreList":[0]} |
@@ -22,3 +22,4 @@ "use strict"; | ||
| const cacheKey = (0, _cachekey.createCacheKey)(url.href, nextUrl); | ||
| (0, _scheduler.schedulePrefetchTask)(cacheKey, treeAtTimeOfPrefetch, fetchStrategy, _types.PrefetchPriority.Default, onInvalidate); | ||
| (0, _scheduler.schedulePrefetchTask)(cacheKey, treeAtTimeOfPrefetch, fetchStrategy, _types.PrefetchPriority.Default, onInvalidate, null // navigationLockPrefetch | ||
| ); | ||
| } | ||
@@ -25,0 +26,0 @@ |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/client/components/segment-cache/prefetch.ts"],"sourcesContent":["import type { FlightRouterState } from '../../../shared/lib/app-router-types'\nimport { createPrefetchURL } from '../app-router-utils'\nimport { createCacheKey } from './cache-key'\nimport { schedulePrefetchTask } from './scheduler'\nimport { PrefetchPriority, type PrefetchTaskFetchStrategy } from './types'\n\n/**\n * Entrypoint for prefetching a URL into the Segment Cache.\n * @param href - The URL to prefetch. Typically this will come from a <Link>,\n * or router.prefetch. It must be validated before we attempt to prefetch it.\n * @param nextUrl - A special header used by the server for interception routes.\n * Roughly corresponds to the current URL.\n * @param treeAtTimeOfPrefetch - The FlightRouterState at the time the prefetch\n * was requested. This is only used when PPR is disabled.\n * @param fetchStrategy - Whether to prefetch dynamic data, in addition to\n * static data. This is used by `<Link prefetch={true}>`.\n * @param onInvalidate - A callback that will be called when the prefetch cache\n * When called, it signals to the listener that the data associated with the\n * prefetch may have been invalidated from the cache. This is not a live\n * subscription — it's called at most once per `prefetch` call. The only\n * supported use case is to trigger a new prefetch inside the listener, if\n * desired. It also may be called even in cases where the associated data is\n * still cached. Prefetching is a poll-based (pull) operation, not an event-\n * based (push) one. Rather than subscribe to specific cache entries, you\n * occasionally poll the prefetch cache to check if anything is missing.\n */\nexport function prefetch(\n href: string,\n nextUrl: string | null,\n treeAtTimeOfPrefetch: FlightRouterState,\n fetchStrategy: PrefetchTaskFetchStrategy,\n onInvalidate: null | (() => void)\n) {\n const url = createPrefetchURL(href)\n if (url === null) {\n // This href should not be prefetched.\n return\n }\n const cacheKey = createCacheKey(url.href, nextUrl)\n schedulePrefetchTask(\n cacheKey,\n treeAtTimeOfPrefetch,\n fetchStrategy,\n PrefetchPriority.Default,\n onInvalidate\n )\n}\n"],"names":["prefetch","href","nextUrl","treeAtTimeOfPrefetch","fetchStrategy","onInvalidate","url","createPrefetchURL","cacheKey","createCacheKey","schedulePrefetchTask","PrefetchPriority","Default"],"mappings":";;;;+BA0BgBA;;;eAAAA;;;gCAzBkB;0BACH;2BACM;uBAC4B;AAsB1D,SAASA,SACdC,IAAY,EACZC,OAAsB,EACtBC,oBAAuC,EACvCC,aAAwC,EACxCC,YAAiC;IAEjC,MAAMC,MAAMC,IAAAA,iCAAiB,EAACN;IAC9B,IAAIK,QAAQ,MAAM;QAChB,sCAAsC;QACtC;IACF;IACA,MAAME,WAAWC,IAAAA,wBAAc,EAACH,IAAIL,IAAI,EAAEC;IAC1CQ,IAAAA,+BAAoB,EAClBF,UACAL,sBACAC,eACAO,uBAAgB,CAACC,OAAO,EACxBP;AAEJ","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/client/components/segment-cache/prefetch.ts"],"sourcesContent":["import type { FlightRouterState } from '../../../shared/lib/app-router-types'\nimport { createPrefetchURL } from '../app-router-utils'\nimport { createCacheKey } from './cache-key'\nimport { schedulePrefetchTask } from './scheduler'\nimport { PrefetchPriority, type PrefetchTaskFetchStrategy } from './types'\n\n/**\n * Entrypoint for prefetching a URL into the Segment Cache.\n * @param href - The URL to prefetch. Typically this will come from a <Link>,\n * or router.prefetch. It must be validated before we attempt to prefetch it.\n * @param nextUrl - A special header used by the server for interception routes.\n * Roughly corresponds to the current URL.\n * @param treeAtTimeOfPrefetch - The FlightRouterState at the time the prefetch\n * was requested. This is only used when PPR is disabled.\n * @param fetchStrategy - Whether to prefetch dynamic data, in addition to\n * static data. This is used by `<Link prefetch={true}>`.\n * @param onInvalidate - A callback that will be called when the prefetch cache\n * When called, it signals to the listener that the data associated with the\n * prefetch may have been invalidated from the cache. This is not a live\n * subscription — it's called at most once per `prefetch` call. The only\n * supported use case is to trigger a new prefetch inside the listener, if\n * desired. It also may be called even in cases where the associated data is\n * still cached. Prefetching is a poll-based (pull) operation, not an event-\n * based (push) one. Rather than subscribe to specific cache entries, you\n * occasionally poll the prefetch cache to check if anything is missing.\n */\nexport function prefetch(\n href: string,\n nextUrl: string | null,\n treeAtTimeOfPrefetch: FlightRouterState,\n fetchStrategy: PrefetchTaskFetchStrategy,\n onInvalidate: null | (() => void)\n) {\n const url = createPrefetchURL(href)\n if (url === null) {\n // This href should not be prefetched.\n return\n }\n const cacheKey = createCacheKey(url.href, nextUrl)\n schedulePrefetchTask(\n cacheKey,\n treeAtTimeOfPrefetch,\n fetchStrategy,\n PrefetchPriority.Default,\n onInvalidate,\n null // navigationLockPrefetch\n )\n}\n"],"names":["prefetch","href","nextUrl","treeAtTimeOfPrefetch","fetchStrategy","onInvalidate","url","createPrefetchURL","cacheKey","createCacheKey","schedulePrefetchTask","PrefetchPriority","Default"],"mappings":";;;;+BA0BgBA;;;eAAAA;;;gCAzBkB;0BACH;2BACM;uBAC4B;AAsB1D,SAASA,SACdC,IAAY,EACZC,OAAsB,EACtBC,oBAAuC,EACvCC,aAAwC,EACxCC,YAAiC;IAEjC,MAAMC,MAAMC,IAAAA,iCAAiB,EAACN;IAC9B,IAAIK,QAAQ,MAAM;QAChB,sCAAsC;QACtC;IACF;IACA,MAAME,WAAWC,IAAAA,wBAAc,EAACH,IAAIL,IAAI,EAAEC;IAC1CQ,IAAAA,+BAAoB,EAClBF,UACAL,sBACAC,eACAO,uBAAgB,CAACC,OAAO,EACxBP,cACA,KAAK,yBAAyB;;AAElC","ignoreList":[0]} |
| import type { FlightRouterState } from '../../../shared/lib/app-router-types'; | ||
| import { EntryStatus } from './cache'; | ||
| import type { RouteCacheKey } from './cache-key'; | ||
| import { type PrefetchTaskFetchStrategy, PrefetchPriority } from './types'; | ||
| import { FetchStrategy, type PrefetchTaskFetchStrategy, PrefetchPriority } from './types'; | ||
| import type { NavigationLockPrefetch } from './navigation-testing-lock'; | ||
| import type { SegmentRequestKey } from '../../../shared/lib/segment-cache/segment-value-encoding'; | ||
@@ -109,11 +110,9 @@ export type PrefetchTask = { | ||
| /** | ||
| * Called when the prefetch task finishes (either completed or canceled). | ||
| * Used by the Instant Navigation Testing API to await prefetch completion. | ||
| * Not exposed in production builds by default. | ||
| * | ||
| * Note: "Complete" means the scheduler has no more work to do for this task | ||
| * — all network requests have been spawned. It does not mean all data has | ||
| * been retrieved; responses may still be in flight. | ||
| * Instant Navigation Testing API only. Non-null when this prefetch task drives | ||
| * a locked navigation (the `ensurePrefetchThenNavigate` path). Holds that | ||
| * navigation's "wait for prefetch to fulfill" state: each spawned pending entry | ||
| * is tracked against it (see `upgradeToPendingSegment`), and the scheduler | ||
| * signals it when done spawning. See navigation-testing-lock.ts. | ||
| */ | ||
| _onComplete?: () => void; | ||
| _navigationLockPrefetch?: NavigationLockPrefetch | null; | ||
| }; | ||
@@ -163,5 +162,7 @@ /** | ||
| * static data. This is used by `<Link prefetch={true}>`. | ||
| * @param _onComplete Called when the prefetch task finishes. Testing API only. | ||
| * @param navigationLockPrefetch Testing API only. Non-null when this prefetch | ||
| * drives a locked navigation (from `ensurePrefetchThenNavigate`); carries that | ||
| * navigation's "wait for prefetch to fulfill" state. Null otherwise. | ||
| */ | ||
| export declare function schedulePrefetchTask(key: RouteCacheKey, treeAtTimeOfPrefetch: FlightRouterState, fetchStrategy: PrefetchTaskFetchStrategy, priority: PrefetchPriority, onInvalidate: null | (() => void), _onComplete?: () => void): PrefetchTask; | ||
| export declare function schedulePrefetchTask(key: RouteCacheKey, treeAtTimeOfPrefetch: FlightRouterState, fetchStrategy: PrefetchTaskFetchStrategy, priority: PrefetchPriority, onInvalidate: null | (() => void), navigationLockPrefetch: NavigationLockPrefetch | null): PrefetchTask; | ||
| export declare function cancelPrefetchTask(task: PrefetchTask): void; | ||
@@ -177,2 +178,9 @@ export declare function reschedulePrefetchTask(task: PrefetchTask, treeAtTimeOfPrefetch: FlightRouterState, fetchStrategy: PrefetchTaskFetchStrategy, priority: PrefetchPriority): void; | ||
| export declare function pingPrefetchTask(task: PrefetchTask): void; | ||
| /** | ||
| * Decides whether to skip the speculative prefetch of a subtree. Usually we | ||
| * only perform a speculative prefetch if the Link's prefetch prop is set to | ||
| * true. However, we also will do a speculative prefetch if the prefetching | ||
| * mode of the segment is set to "unstable_eager". | ||
| */ | ||
| export declare function subtreeHasSpeculativePrefetch(fetchStrategy: FetchStrategy, prefetchHints: number): boolean; | ||
| export {}; |
@@ -63,3 +63,3 @@ /* global location */ // imports polyfill from `@next/polyfill-module` after build. | ||
| const _isnextroutererror = require("./components/is-next-router-error"); | ||
| const version = "16.3.0-preview.4"; | ||
| const version = "16.3.0-preview.5"; | ||
| let router; | ||
@@ -66,0 +66,0 @@ const emitter = (0, _mitt.default)(); |
@@ -121,3 +121,3 @@ --- | ||
| `updateTag` immediately expires cached data for read-your-own-writes scenarios — the user sees their change right away instead of stale content. Unlike `revalidateTag`, it can only be used in [Server Actions](/docs/app/getting-started/mutating-data). | ||
| `updateTag` immediately expires cached data for read-your-own-writes scenarios — the user sees their change right away instead of stale content. Unlike `revalidateTag`, it can only be used in [Server Actions](/docs/app/guides/server-actions). | ||
@@ -124,0 +124,0 @@ ```tsx filename="app/lib/actions.ts" highlight={1,12} switcher |
@@ -1459,3 +1459,3 @@ --- | ||
| Treat [Server Actions](/docs/app/getting-started/mutating-data) with the same security considerations as public-facing API endpoints, and verify if the user is allowed to perform a mutation. | ||
| Treat [Server Actions](/docs/app/guides/server-actions) with the same security considerations as public-facing API endpoints, and verify if the user is allowed to perform a mutation. | ||
@@ -1462,0 +1462,0 @@ In the example below, we check the user's role before allowing the action to proceed: |
@@ -900,3 +900,3 @@ --- | ||
| Server Actions let you run server-side code from the client. Their primary purpose is to mutate data from your frontend client. | ||
| [Server Actions](/docs/app/guides/server-actions) let you run server-side code from the client. Their primary purpose is to mutate data from your frontend client. | ||
@@ -903,0 +903,0 @@ Server Actions are queued. Using them for data fetching introduces sequential execution. |
@@ -21,10 +21,25 @@ --- | ||
| ## Use the adoption skill (recommended) | ||
| The [`next-cache-components-adoption`](https://github.com/vercel/next.js/tree/canary/skills/next-cache-components-adoption) skill drives this migration with a coding agent, one feature at a time, checking in at every feature boundary. It supports two modes: | ||
| - **Incremental.** Opens a single mechanical PR that opts every route out of validation, then ships each feature as a follow-up PR. | ||
| - **Direct.** Adopts every route in place on one branch. | ||
| Install the skill: | ||
| ```bash filename="Terminal" | ||
| npx skills add vercel/next.js --skill next-cache-components-adoption | ||
| ``` | ||
| Prompt the agent: | ||
| ```text | ||
| Adopt Cache Components in this project using the next-cache-components-adoption skill. | ||
| ``` | ||
| ## Or migrate by hand | ||
| Start by removing the route segment configs (`dynamic`, `revalidate`, `fetchCache`), then follow the validation insights and errors. Each one names the code to fix, most often uncached data to cache with [`use cache`](/docs/app/api-reference/directives/use-cache) or runtime data to wrap in [`<Suspense>`](https://react.dev/reference/react/Suspense). If a route needs more work than you want to take on right now, you can [opt it out of validation](#opting-out-of-validation) and come back to it later. | ||
| > **Good to know:** For agents working on larger apps, the [`next-cache-components-adoption`](https://github.com/vercel/next.js/tree/canary/skills/next-cache-components-adoption) skill drives this guide route by route. It can blanket-opt-out the app with `instant = false` to unblock the build, work each opt-out back off, help decide what becomes instant and what stays blocking, and walk the dev-overlay validation insights with you. Install with: | ||
| > | ||
| > ```bash filename="Terminal" | ||
| > npx skills add https://github.com/vercel/next.js/tree/canary/skills/next-cache-components-adoption | ||
| > ``` | ||
| Your existing `fetch` and `unstable_cache` caching keeps working as a separate layer, so let the insights and errors guide what to change. | ||
@@ -728,2 +743,4 @@ | ||
| > **Good to know**: When a cookie or header value drives an attribute on the `<html>` element in the root layout (`lang`, `dir`, `data-theme`, etc.), reading it on the server makes the whole subtree request-bound, so there's no child to wrap in `<Suspense>`. An inline `<script>` in `<head>` that sets the attribute before paint keeps the shell static; see [Preventing flash before hydration](/docs/app/guides/preventing-flash-before-hydration) for the pattern. | ||
| ## Route Handlers (`GET`) | ||
@@ -730,0 +747,0 @@ |
@@ -249,7 +249,3 @@ --- | ||
| ```tsx filename="app/layout.tsx" switcher | ||
| export default function RootLayout({ | ||
| children, | ||
| }: { | ||
| children: React.ReactNode | ||
| }) { | ||
| export default function RootLayout({ children }: LayoutProps<'/'>) { | ||
| return ( | ||
@@ -301,2 +297,48 @@ <html lang="en" data-theme="light" suppressHydrationWarning> | ||
| ### Storing the theme in a cookie | ||
| Unlike `localStorage`, a cookie is sent with every request, so the server _can_ read it with [`cookies()`](/docs/app/api-reference/functions/cookies). But reading it in the root layout opts the entire app out of static prerendering (and under [Cache Components](/docs/app/api-reference/config/next-config-js/cacheComponents), forces blocking every segment under the layout). To keep the page statically prerendered with a generic default and still avoid the flash, read the cookie in the inline script instead: | ||
| ```tsx filename="app/layout.tsx" switcher | ||
| export default function RootLayout({ children }: LayoutProps<'/'>) { | ||
| return ( | ||
| <html lang="en" data-theme="light" suppressHydrationWarning> | ||
| <head> | ||
| <script | ||
| dangerouslySetInnerHTML={{ | ||
| __html: `(function(){try{var m=document.cookie.match(/(?:^|; )theme=([^;]*)/);if(m)document.documentElement.setAttribute("data-theme",decodeURIComponent(m[1]))}catch(e){}})()`, | ||
| }} | ||
| /> | ||
| </head> | ||
| <body>{children}</body> | ||
| </html> | ||
| ) | ||
| } | ||
| ``` | ||
| ```jsx filename="app/layout.js" switcher | ||
| export default function RootLayout({ children }) { | ||
| return ( | ||
| <html lang="en" data-theme="light" suppressHydrationWarning> | ||
| <head> | ||
| <script | ||
| dangerouslySetInnerHTML={{ | ||
| __html: `(function(){try{var m=document.cookie.match(/(?:^|; )theme=([^;]*)/);if(m)document.documentElement.setAttribute("data-theme",decodeURIComponent(m[1]))}catch(e){}})()`, | ||
| }} | ||
| /> | ||
| </head> | ||
| <body>{children}</body> | ||
| </html> | ||
| ) | ||
| } | ||
| ``` | ||
| To switch themes, set the attribute on `<html>` and persist the choice to the cookie: | ||
| ```js | ||
| const theme = 'dark' | ||
| document.documentElement.setAttribute('data-theme', theme) | ||
| document.cookie = `theme=${encodeURIComponent(theme)}; path=/; max-age=31536000; SameSite=Lax` | ||
| ``` | ||
| ## Syncing with React state | ||
@@ -303,0 +345,0 @@ |
@@ -28,3 +28,3 @@ --- | ||
| Next.js can start as a static site or even a strict SPA where everything is rendered client-side. If your project grows, Next.js allows you to progressively add more server features (e.g. [React Server Components](/docs/app/getting-started/server-and-client-components), [Server Actions](/docs/app/getting-started/mutating-data), and more) as needed. | ||
| Next.js can start as a static site or even a strict SPA where everything is rendered client-side. If your project grows, Next.js allows you to progressively add more server features (e.g. [React Server Components](/docs/app/getting-started/server-and-client-components), [Server Actions](/docs/app/guides/server-actions), and more) as needed. | ||
@@ -31,0 +31,0 @@ ## Examples |
@@ -404,4 +404,4 @@ --- | ||
| See the [Server Actions](/docs/app/getting-started/mutating-data) docs for more examples. | ||
| See [Mutating data](/docs/app/getting-started/mutating-data) for more examples. | ||
| </AppOnly> |
@@ -84,2 +84,3 @@ --- | ||
| - The function is only necessary when dynamic rendering is required and common Request-time APIs are not used. | ||
| - With [Cache Components](/docs/app/api-reference/config/next-config-js/cacheComponents), prefer [`io()`](/docs/app/api-reference/functions/io) for excluding content from the static shell. It works the same way but can also be cached and prefetched. Reach for `connection()` only when rendering should wait for a real user request. | ||
@@ -86,0 +87,0 @@ ### Version History |
@@ -177,9 +177,11 @@ --- | ||
| // Load the font once at module scope. process.cwd() is the Next.js project | ||
| // directory. Reading it inside the component would be treated as dynamic I/O | ||
| // under Cache Components and opt the route out of static generation. | ||
| const interSemiBold = await readFile( | ||
| join(process.cwd(), 'assets/Inter-SemiBold.ttf') | ||
| ) | ||
| // Image generation | ||
| export default async function Image() { | ||
| // Font loading, process.cwd() is Next.js project directory | ||
| const interSemiBold = await readFile( | ||
| join(process.cwd(), 'assets/Inter-SemiBold.ttf') | ||
| ) | ||
| return new ImageResponse( | ||
@@ -186,0 +188,0 @@ ( |
| --- | ||
| title: io | ||
| description: API Reference for the io function. | ||
| version: draft | ||
| --- | ||
| `io()` informs Next.js that an IO operation will follow this call. When [Cache Components](/docs/app/api-reference/config/next-config-js/cacheComponents) is not enabled or when rendering in Pages Router, signifying IO in this way is not meaningful and the call will always resolve immediately. When Cache Components is enabled, you may be required to add `await io()` preceding synchronous IO that is encountered while prerendering pages (`new Date()` for example). Additionally, if you want to avoid having genuine uncached IO invoked while prerendering, you shield it by preceeding it with `await io()`. | ||
| When [Cache Components](/docs/app/api-reference/config/next-config-js/cacheComponents) is enabled, Next.js needs you to decide whether to capture a synchronous value like `new Date()` or `Math.random()` once and reuse it for every visitor, or produce it fresh for each request. | ||
| ```ts filename="app/page.tsx" switcher | ||
| To capture the value in the [static shell](/docs/app/glossary#static-shell), wrap it in [`"use cache"`](/docs/app/api-reference/directives/use-cache). To keep it out of the static shell, use `await io()`, which suspends during prerendering. | ||
| During a request, inside cached scopes, in the browser, and apps without Cache Components (including the Pages Router), calling `io()` resolves immediately. | ||
| ## Usage | ||
| Call `io()` to inform Next.js that an IO operation follows. | ||
| In a Server Component, call `await io()` before reading a value like `new Date()`, `Math.random()`, `crypto.randomUUID()`, or a synchronous database driver such as [`node:sqlite`](https://nodejs.org/api/sqlite.html): | ||
| ```tsx filename="app/page.tsx" highlight={13} switcher | ||
| import { Suspense } from 'react' | ||
| import { io } from 'next/cache' | ||
| import { db } from '@/lib/db' | ||
| export default async function Page() { | ||
| // Synchronous IO: new Date() would fail during prerender without this | ||
| export default function Page() { | ||
| return ( | ||
| <Suspense fallback={<p>Loading...</p>}> | ||
| <CurrentTime /> | ||
| </Suspense> | ||
| ) | ||
| } | ||
| async function CurrentTime() { | ||
| await io() | ||
| const now = new Date().toISOString() | ||
| return <p>{new Date().toISOString()}</p> | ||
| } | ||
| ``` | ||
| // Async IO: the query would run and be discarded during prerender; | ||
| // io() above lets Next.js skip it entirely | ||
| const orders = await db.query('SELECT * FROM orders LIMIT 10') | ||
| ```jsx filename="app/page.js" highlight={13} switcher | ||
| import { Suspense } from 'react' | ||
| import { io } from 'next/cache' | ||
| export default function Page() { | ||
| return ( | ||
| <main> | ||
| <p>Generated at: {now}</p> | ||
| <ul> | ||
| {orders.map((order) => ( | ||
| <li key={order.id}>{order.name}</li> | ||
| ))} | ||
| </ul> | ||
| </main> | ||
| <Suspense fallback={<p>Loading...</p>}> | ||
| <CurrentTime /> | ||
| </Suspense> | ||
| ) | ||
| } | ||
| async function CurrentTime() { | ||
| await io() | ||
| return <p>{new Date().toISOString()}</p> | ||
| } | ||
| ``` | ||
| ```js filename="app/page.js" switcher | ||
| In this route `CurrentTime` is wrapped in a `<Suspense>` boundary, during prerender, the `await io()` suspends and the fallback ships in the static shell. If `CurrentTime` were rendered inside a [`"use cache"`](/docs/app/api-reference/directives/use-cache) scope instead, `io()` would be a no-op, the value is captured into the static shell and no `<Suspense>` boundary is required. | ||
| In a Client Component, call `io()` with React's [`use`](https://react.dev/reference/react/use) hook before reading a synchronous source like `Date.now()`. Client Components prerender on the server during SSR, where the read would otherwise be included in the static shell: | ||
| ```tsx filename="app/components.tsx" highlight={6} switcher | ||
| 'use client' | ||
| import { use } from 'react' | ||
| import { io } from 'next/cache' | ||
| import { db } from '@/lib/db' | ||
| export default async function Page() { | ||
| // Synchronous IO: new Date() would fail during prerender without this | ||
| await io() | ||
| const now = new Date().toISOString() | ||
| export function CurrentTime() { | ||
| use(io()) | ||
| return <div>{Date.now()}</div> | ||
| } | ||
| ``` | ||
| // Async IO: the query would run and be discarded during prerender; | ||
| // io() above lets Next.js skip it entirely | ||
| const orders = await db.query('SELECT * FROM orders LIMIT 10') | ||
| ```jsx filename="app/components.js" highlight={6} switcher | ||
| 'use client' | ||
| import { use } from 'react' | ||
| import { io } from 'next/cache' | ||
| return ( | ||
| <main> | ||
| <p>Generated at: {now}</p> | ||
| <ul> | ||
| {orders.map((order) => ( | ||
| <li key={order.id}>{order.name}</li> | ||
| ))} | ||
| </ul> | ||
| </main> | ||
| ) | ||
| export function CurrentTime() { | ||
| use(io()) | ||
| return <div>{Date.now()}</div> | ||
| } | ||
| ``` | ||
| ## How is this different from `connection()`? | ||
| ## When you don't need `io()` | ||
| [`connection()`](/docs/app/api-reference/functions/connection) requires an active HTTP request context and signals that the component needs request-specific data. It is imported from `next/server`. | ||
| - The component already uses a [Request-time API](/docs/app/glossary#request-time-apis) like `cookies()` or `headers()`. The request-time API is itself the suspension point. | ||
| - The data comes from an awaited `fetch` or async database query wrapped in `<Suspense>`. The `await` is the suspension point. | ||
| `io()` does not require a request context. It can be used inside `"use cache"` scopes, client components, and anywhere you perform IO that should not be included in a static prerender. It is imported from `next/cache`. | ||
| ## How `io()` differs from `connection()` | ||
| Use `connection()` when you need the request itself (cookies, headers, etc.). Use `io()` when you perform IO that is independent of the request but should still prevent static prerendering. | ||
| The [`connection()`](/docs/app/api-reference/functions/connection) function excludes the code that follows it from the static shell, but it stays suspended until a full user navigation reaches the server, so it also blocks [prefetches](/docs/app/guides/prefetching). `io()` suspends like any other asynchronous function, so the code after it can be wrapped in [`"use cache"`](/docs/app/api-reference/directives/use-cache) and prefetched and cached on the client. Prefer `io()` over `connection()`, and reach for `connection()` only when you need to wait for a real user request. | ||
@@ -83,14 +103,8 @@ ## Reference | ||
| - A `Promise<void>` that resolves immediately during a real request or inside a cache scope, and suspends indefinitely during prerendering to prevent static output from including IO-dependent content. | ||
| A `Promise<void>`. With Cache Components enabled, awaiting this promise stops prerendering so the code that follows is excluded from the prerender output. In every other context (real requests, cache scopes, [`generateStaticParams`](/docs/app/api-reference/functions/generate-static-params), the browser, and routes without Cache Components), it resolves immediately. | ||
| ## Good to know | ||
| ## Version History | ||
| - `io()` is imported from `next/cache`, not `next/server`. | ||
| - Inside `"use cache"` scopes, `io()` resolves immediately. The cache captures the IO result at fill time. | ||
| - In client components, `io()` resolves immediately since there is no prerender context in the browser. | ||
| ### Version History | ||
| | Version | Changes | | ||
| | --------- | ----------- | | ||
| | `v16.x.x` | `io` added. | | ||
| | `v16.3.0` | `io` added. | |
@@ -50,5 +50,89 @@ --- | ||
| > - `next/root-params` can be used in Server Components. It cannot be used in Client Components, Server Actions, or [Route Handlers](/docs/app/api-reference/file-conventions/route). Support for Route Handlers is planned for a future release. | ||
| > - With [Cache Components](/docs/app/api-reference/config/next-config-js/cacheComponents) enabled, [`generateStaticParams`](/docs/app/api-reference/functions/generate-static-params) must return at least one value for each root parameter. Providing values makes them static route parameters, required for prerendering static shells. | ||
| > - The examples on this page use [`PageProps`](/docs/app/api-reference/file-conventions/page#page-props-helper) and [`LayoutProps`](/docs/app/api-reference/file-conventions/layout#layout-props-helper), which are auto-generated type helpers based on your route structure. | ||
| > - Types for the `next/root-params` exports are generated during `next dev`, `next build`, or [`next typegen`](/docs/app/api-reference/cli/next#next-typegen-options), the same as [`PageProps` and `LayoutProps`](/docs/app/api-reference/config/typescript#route-aware-type-helpers). | ||
| ## Root parameters and `generateStaticParams` | ||
| Root parameters are available as soon as you create the routes that define them. A [`generateStaticParams`](/docs/app/api-reference/functions/generate-static-params) function is only required with [Cache Components](/docs/app/api-reference/config/next-config-js/cacheComponents), where each root parameter must have at least one value or the build fails. | ||
| With a single root parameter: | ||
| ```tsx filename="app/[lang]/layout.tsx" highlight={11,12,13} switcher | ||
| import { lang } from 'next/root-params' | ||
| export default async function RootLayout(props: LayoutProps<'/[lang]'>) { | ||
| return ( | ||
| <html lang={await lang()}> | ||
| <body>{props.children}</body> | ||
| </html> | ||
| ) | ||
| } | ||
| export async function generateStaticParams() { | ||
| return [{ lang: 'en' }, { lang: 'fr' }] | ||
| } | ||
| ``` | ||
| ```jsx filename="app/[lang]/layout.js" highlight={11,12,13} switcher | ||
| import { lang } from 'next/root-params' | ||
| export default async function RootLayout({ children }) { | ||
| return ( | ||
| <html lang={await lang()}> | ||
| <body>{children}</body> | ||
| </html> | ||
| ) | ||
| } | ||
| export async function generateStaticParams() { | ||
| return [{ lang: 'en' }, { lang: 'fr' }] | ||
| } | ||
| ``` | ||
| With multiple root parameters, return a value for each: | ||
| ```tsx filename="app/[lang]/[locale]/layout.tsx" | ||
| export async function generateStaticParams() { | ||
| return [ | ||
| { lang: 'en', locale: 'us' }, | ||
| { lang: 'en', locale: 'uk' }, | ||
| ] | ||
| } | ||
| ``` | ||
| ### Reading root parameters in a nested `generateStaticParams` | ||
| Inside a nested segment's [`generateStaticParams`](/docs/app/api-reference/functions/generate-static-params), you can read a root parameter directly with its getter, instead of destructuring it from the `params` argument: | ||
| ```tsx filename="app/[lang]/posts/[slug]/page.tsx" highlight={1,4} switcher | ||
| import { lang } from 'next/root-params' | ||
| export async function generateStaticParams() { | ||
| const language = await lang() | ||
| const posts = await fetch( | ||
| `https://api.example.com/posts?lang=${language}` | ||
| ).then((res) => res.json()) | ||
| return posts.map((post) => ({ slug: post.slug })) | ||
| } | ||
| export default async function Page() { | ||
| // ... | ||
| } | ||
| ``` | ||
| ```jsx filename="app/[lang]/posts/[slug]/page.js" highlight={1,4} switcher | ||
| import { lang } from 'next/root-params' | ||
| export async function generateStaticParams() { | ||
| const language = await lang() | ||
| const posts = await fetch( | ||
| `https://api.example.com/posts?lang=${language}` | ||
| ).then((res) => res.json()) | ||
| return posts.map((post) => ({ slug: post.slug })) | ||
| } | ||
| export default async function Page() { | ||
| // ... | ||
| } | ||
| ``` | ||
| ## Root parameters and other route parameters | ||
@@ -203,38 +287,2 @@ | ||
| ## Use in `generateStaticParams` for nested segments | ||
| Inside a nested segment's [`generateStaticParams`](/docs/app/api-reference/functions/generate-static-params), you can read a root parameter directly with its getter, instead of destructuring it from the `params` argument: | ||
| ```tsx filename="app/[lang]/posts/[slug]/page.tsx" highlight={1,4} switcher | ||
| import { lang } from 'next/root-params' | ||
| export async function generateStaticParams() { | ||
| const language = await lang() | ||
| const posts = await fetch( | ||
| `https://api.example.com/posts?lang=${language}` | ||
| ).then((res) => res.json()) | ||
| return posts.map((post) => ({ slug: post.slug })) | ||
| } | ||
| export default async function Page() { | ||
| // ... | ||
| } | ||
| ``` | ||
| ```jsx filename="app/[lang]/posts/[slug]/page.js" highlight={1,4} switcher | ||
| import { lang } from 'next/root-params' | ||
| export async function generateStaticParams() { | ||
| const language = await lang() | ||
| const posts = await fetch( | ||
| `https://api.example.com/posts?lang=${language}` | ||
| ).then((res) => res.json()) | ||
| return posts.map((post) => ({ slug: post.slug })) | ||
| } | ||
| export default async function Page() { | ||
| // ... | ||
| } | ||
| ``` | ||
| ## Multiple root layouts | ||
@@ -241,0 +289,0 @@ |
@@ -7,2 +7,3 @@ --- | ||
| - app/api-reference/functions/permanentRedirect | ||
| - app/guides/server-actions | ||
| --- | ||
@@ -9,0 +10,0 @@ |
| --- | ||
| title: refresh | ||
| description: API Reference for the refresh function. | ||
| related: | ||
| links: | ||
| - app/guides/server-actions | ||
| --- | ||
| `refresh` allows you to refresh the client router from within a [Server Action](/docs/app/getting-started/mutating-data). | ||
| `refresh` allows you to refresh the client router from within a [Server Action](/docs/app/guides/server-actions). | ||
@@ -8,0 +11,0 @@ ## Usage |
| --- | ||
| title: revalidatePath | ||
| description: API Reference for the revalidatePath function. | ||
| related: | ||
| links: | ||
| - app/guides/server-actions | ||
| --- | ||
@@ -5,0 +8,0 @@ |
| --- | ||
| title: revalidateTag | ||
| description: API Reference for the revalidateTag function. | ||
| related: | ||
| links: | ||
| - app/guides/server-actions | ||
| --- | ||
@@ -5,0 +8,0 @@ |
| --- | ||
| title: serverActions | ||
| description: Configure Server Actions behavior in your Next.js application. | ||
| related: | ||
| links: | ||
| - app/guides/server-actions | ||
| --- | ||
| Options for configuring Server Actions behavior in your Next.js application. | ||
| Options for configuring Server Actions behavior in your Next.js application. For how Server Actions work, including the security boundary these options tune, see the [Server Actions guide](/docs/app/guides/server-actions). | ||
@@ -8,0 +11,0 @@ ## `allowedOrigins` |
@@ -73,2 +73,3 @@ import path from 'node:path'; | ||
| 'process.env.__NEXT_INSTANT_NAV_TOGGLE': isCacheComponentsEnabled, | ||
| 'process.env.__NEXT_EXPERIMENTAL_COLD_CACHE_BADGE': Boolean(config.experimental.coldCacheBadge), | ||
| 'process.env.__NEXT_USE_CACHE': isUseCacheEnabled, | ||
@@ -75,0 +76,0 @@ 'process.env.__NEXT_USE_NODE_STREAMS': isEdgeServer ? false : true, |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/build/define-env.ts"],"sourcesContent":["import type {\n I18NConfig,\n I18NDomains,\n NextConfigComplete,\n} from '../server/config-shared'\nimport type { ProxyMatcher } from './analysis/get-page-static-info'\nimport type { Rewrite } from '../lib/load-custom-routes'\nimport path from 'node:path'\nimport { needsExperimentalReact } from '../lib/needs-experimental-react'\nimport { checkIsAppPPREnabled } from '../server/lib/experimental/ppr'\nimport {\n getNextConfigEnv,\n getNextPublicEnvironmentVariables,\n} from '../lib/static-env'\n\ntype BloomFilter = ReturnType<\n import('../shared/lib/bloom-filter').BloomFilter['export']\n>\n\nexport interface DefineEnvOptions {\n isTurbopack: boolean\n clientRouterFilters?: {\n staticFilter: BloomFilter\n dynamicFilter: BloomFilter\n }\n config: NextConfigComplete\n dev: boolean\n distDir: string\n projectPath: string\n fetchCacheKeyPrefix: string | undefined\n hasRewrites: boolean\n isClient: boolean\n isEdgeServer: boolean\n isNodeServer: boolean\n middlewareMatchers: ProxyMatcher[] | undefined\n omitNonDeterministic?: boolean\n rewrites: {\n beforeFiles: Rewrite[]\n afterFiles: Rewrite[]\n fallback: Rewrite[]\n }\n}\n\nconst DEFINE_ENV_EXPRESSION = Symbol('DEFINE_ENV_EXPRESSION')\n\ninterface DefineEnv {\n [key: string]:\n | string\n | number\n | string[]\n | boolean\n | { [DEFINE_ENV_EXPRESSION]: string }\n | ProxyMatcher[]\n | BloomFilter\n | Partial<NextConfigComplete['images']>\n | I18NDomains\n | I18NConfig\n}\n\ninterface SerializedDefineEnv {\n [key: string]: string\n}\n\n/**\n * Serializes the DefineEnv config so that it can be inserted into the code by Webpack/Turbopack, JSON stringifies each value.\n */\nfunction serializeDefineEnv(defineEnv: DefineEnv): SerializedDefineEnv {\n const defineEnvStringified: SerializedDefineEnv = Object.fromEntries(\n Object.entries(defineEnv).map(([key, value]) => [\n key,\n typeof value === 'object' && DEFINE_ENV_EXPRESSION in value\n ? value[DEFINE_ENV_EXPRESSION]\n : JSON.stringify(value),\n ])\n )\n return defineEnvStringified\n}\n\nfunction getImageConfig(\n config: NextConfigComplete,\n dev: boolean\n): { 'process.env.__NEXT_IMAGE_OPTS': Partial<NextConfigComplete['images']> } {\n return {\n 'process.env.__NEXT_IMAGE_OPTS': {\n deviceSizes: config.images.deviceSizes,\n imageSizes: config.images.imageSizes,\n qualities: config.images.qualities,\n path: config.images.path,\n loader: config.images.loader,\n dangerouslyAllowSVG: config.images.dangerouslyAllowSVG,\n unoptimized: config?.images?.unoptimized,\n ...(dev\n ? {\n // additional config in dev to allow validating on the client\n domains: config.images.domains,\n remotePatterns: config.images?.remotePatterns,\n localPatterns: config.images?.localPatterns,\n output: config.output,\n }\n : {}),\n },\n }\n}\n\nexport function getDefineEnv({\n isTurbopack,\n clientRouterFilters,\n config,\n dev,\n distDir,\n projectPath,\n fetchCacheKeyPrefix,\n hasRewrites,\n isClient,\n isEdgeServer,\n isNodeServer,\n middlewareMatchers,\n omitNonDeterministic,\n rewrites,\n}: DefineEnvOptions): SerializedDefineEnv {\n const nextPublicEnv = getNextPublicEnvironmentVariables()\n const nextConfigEnv = getNextConfigEnv(config)\n\n const isPPREnabled = checkIsAppPPREnabled(config.experimental.ppr)\n const isCacheComponentsEnabled = !!config.cacheComponents\n const isUseCacheEnabled = !!config.experimental.useCache\n\n const defineEnv: DefineEnv = {\n // internal field to identify the plugin config\n __NEXT_DEFINE_ENV: true,\n\n ...nextPublicEnv,\n ...nextConfigEnv,\n ...(!isEdgeServer\n ? {}\n : {\n EdgeRuntime:\n /**\n * Cloud providers can set this environment variable to allow users\n * and library authors to have different implementations based on\n * the runtime they are running with, if it's not using `edge-runtime`\n */\n process.env.NEXT_EDGE_RUNTIME_PROVIDER ?? 'edge-runtime',\n\n // process should be only { env: {...} } for edge runtime.\n // For ignore avoid warn on `process.emit` usage but directly omit it.\n 'process.emit': false,\n }),\n 'process.turbopack': isTurbopack,\n 'process.env.TURBOPACK': isTurbopack,\n 'process.env.__NEXT_BUNDLER': isTurbopack\n ? 'Turbopack'\n : process.env.NEXT_RSPACK\n ? 'Rspack'\n : 'Webpack',\n // TODO: enforce `NODE_ENV` on `process.env`, and add a test:\n 'process.env.NODE_ENV':\n dev || config.experimental.allowDevelopmentBuild\n ? 'development'\n : 'production',\n 'process.env.__NEXT_DEV_SERVER': dev ? '1' : '',\n 'process.env.__NEXT_DISABLE_DEV_OVERLAY_UX':\n process.env.NEXT_PRIVATE_DISABLE_DEV_OVERLAY_UX === '1',\n 'process.env.NEXT_RUNTIME': isEdgeServer\n ? 'edge'\n : isNodeServer\n ? 'nodejs'\n : '',\n 'process.env.NEXT_MINIMAL': '',\n 'process.env.__NEXT_APP_NAV_FAIL_HANDLING': Boolean(\n config.experimental.appNavFailHandling\n ),\n 'process.env.__NEXT_APP_NEW_SCROLL_HANDLER': Boolean(\n config.experimental.appNewScrollHandler\n ),\n 'process.env.__NEXT_PPR': isPPREnabled,\n 'process.env.__NEXT_CACHE_COMPONENTS': isCacheComponentsEnabled,\n 'process.env.__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS': Boolean(\n config.experimental.cachedNavigations\n ),\n 'process.env.__NEXT_INSTANT_NAV_TOGGLE': isCacheComponentsEnabled,\n 'process.env.__NEXT_USE_CACHE': isUseCacheEnabled,\n 'process.env.__NEXT_USE_NODE_STREAMS': isEdgeServer ? false : true,\n\n 'process.env.NEXT_SUPPORTS_IMMUTABLE_ASSETS':\n config.experimental.supportsImmutableAssets || false,\n\n ...(config.experimental?.useSkewCookie || !config.deploymentId\n ? {\n 'process.env.NEXT_DEPLOYMENT_ID': false,\n }\n : isClient\n ? isTurbopack\n ? {\n // This is set at runtime by packages/next/src/client/register-deployment-id-global.ts\n 'process.env.NEXT_DEPLOYMENT_ID': {\n [DEFINE_ENV_EXPRESSION]: 'globalThis.NEXT_DEPLOYMENT_ID',\n },\n }\n : {\n // For Webpack, we currently don't use the non-inlining globalThis.NEXT_DEPLOYMENT_ID\n // approach because we cannot forward this global variable to web workers easily.\n 'process.env.NEXT_DEPLOYMENT_ID': config.deploymentId || false,\n }\n : config.experimental?.runtimeServerDeploymentId\n ? {\n // Don't inline at all, keep process.env.NEXT_DEPLOYMENT_ID as is\n }\n : {\n 'process.env.NEXT_DEPLOYMENT_ID': config.deploymentId || false,\n }),\n\n // Propagates the `__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING` environment\n // variable to the client.\n 'process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING':\n process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING || false,\n 'process.env.__NEXT_FETCH_CACHE_KEY_PREFIX': fetchCacheKeyPrefix ?? '',\n ...(isTurbopack\n ? {}\n : {\n 'process.env.__NEXT_MIDDLEWARE_MATCHERS': middlewareMatchers ?? [],\n }),\n 'process.env.__NEXT_MANUAL_CLIENT_BASE_PATH':\n config.experimental.manualClientBasePath ?? false,\n 'process.env.__NEXT_CLIENT_ROUTER_DYNAMIC_STALETIME': JSON.stringify(\n isNaN(Number(config.experimental.staleTimes?.dynamic))\n ? 0\n : config.experimental.staleTimes?.dynamic\n ),\n 'process.env.__NEXT_CLIENT_ROUTER_STATIC_STALETIME': JSON.stringify(\n isNaN(Number(config.experimental.staleTimes?.static))\n ? 5 * 60 // 5 minutes\n : config.experimental.staleTimes?.static\n ),\n 'process.env.__NEXT_CLIENT_ROUTER_FILTER_ENABLED':\n config.experimental.clientRouterFilter ?? true,\n 'process.env.__NEXT_CLIENT_ROUTER_S_FILTER':\n clientRouterFilters?.staticFilter ?? false,\n 'process.env.__NEXT_CLIENT_ROUTER_D_FILTER':\n clientRouterFilters?.dynamicFilter ?? false,\n 'process.env.__NEXT_CLIENT_VALIDATE_RSC_REQUEST_HEADERS': Boolean(\n config.experimental.validateRSCRequestHeaders\n ),\n 'process.env.__NEXT_DYNAMIC_ON_HOVER': Boolean(\n config.experimental.dynamicOnHover\n ),\n 'process.env.__NEXT_USE_OFFLINE': Boolean(config.experimental.useOffline),\n 'process.env.__NEXT_PREFETCH_INLINING': Boolean(\n config.experimental.prefetchInlining\n ),\n 'process.env.__NEXT_OPTIMISTIC_CLIENT_CACHE':\n config.experimental.optimisticClientCache ?? true,\n 'process.env.__NEXT_MIDDLEWARE_PREFETCH':\n config.experimental.proxyPrefetch ?? 'flexible',\n 'process.env.__NEXT_CROSS_ORIGIN': config.crossOrigin,\n 'process.browser': isClient,\n 'process.env.__NEXT_TEST_MODE': process.env.__NEXT_TEST_MODE ?? false,\n // This is used in client/dev-error-overlay/hot-dev-client.js to replace the dist directory\n ...(dev && (isClient ?? isEdgeServer)\n ? {\n 'process.env.__NEXT_DIST_DIR': distDir,\n }\n : {}),\n // This is used in devtools to strip the project path in edge runtime,\n // as there's only a dummy `dir` value (`.`) as edge runtime doesn't have concept of file system.\n ...(dev && isEdgeServer\n ? {\n 'process.env.__NEXT_EDGE_PROJECT_DIR': isTurbopack\n ? path.relative(process.cwd(), projectPath)\n : projectPath,\n }\n : {}),\n 'process.env.__NEXT_BASE_PATH': config.basePath,\n 'process.env.__NEXT_CASE_SENSITIVE_ROUTES': Boolean(\n config.experimental.caseSensitiveRoutes\n ),\n 'process.env.__NEXT_REWRITES': rewrites as any,\n 'process.env.__NEXT_TRAILING_SLASH': config.trailingSlash,\n 'process.env.__NEXT_DEV_INDICATOR': config.devIndicators !== false,\n 'process.env.__NEXT_DEV_INDICATOR_POSITION':\n config.devIndicators === false\n ? 'bottom-left' // This will not be used as the indicator is disabled.\n : (config.devIndicators.position ?? 'bottom-left'),\n 'process.env.__NEXT_STRICT_MODE':\n config.reactStrictMode === null ? false : config.reactStrictMode,\n 'process.env.__NEXT_STRICT_MODE_APP':\n // When next.config.js does not have reactStrictMode it's enabled by default.\n config.reactStrictMode === null ? true : config.reactStrictMode,\n 'process.env.__NEXT_OPTIMIZE_CSS':\n (config.experimental.optimizeCss && !dev) ?? false,\n 'process.env.__NEXT_SCRIPT_WORKERS':\n (config.experimental.nextScriptWorkers && !dev) ?? false,\n 'process.env.__NEXT_SCROLL_RESTORATION':\n config.experimental.scrollRestoration ?? false,\n ...getImageConfig(config, dev),\n 'process.env.__NEXT_ROUTER_BASEPATH': config.basePath,\n 'process.env.__NEXT_HAS_REWRITES': hasRewrites,\n 'process.env.__NEXT_CONFIG_OUTPUT': config.output,\n 'process.env.__NEXT_I18N_SUPPORT': !!config.i18n,\n 'process.env.__NEXT_I18N_DOMAINS': config.i18n?.domains ?? false,\n 'process.env.__NEXT_I18N_CONFIG': config.i18n || '',\n 'process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE':\n config.skipProxyUrlNormalize,\n 'process.env.__NEXT_EXTERNAL_MIDDLEWARE_REWRITE_RESOLVE':\n config.experimental.externalProxyRewritesResolve ?? false,\n 'process.env.__NEXT_MANUAL_TRAILING_SLASH':\n config.skipTrailingSlashRedirect,\n 'process.env.__NEXT_HAS_WEB_VITALS_ATTRIBUTION':\n (config.experimental.webVitalsAttribution &&\n config.experimental.webVitalsAttribution.length > 0) ??\n false,\n 'process.env.__NEXT_WEB_VITALS_ATTRIBUTION':\n config.experimental.webVitalsAttribution ?? false,\n 'process.env.__NEXT_LINK_NO_TOUCH_START':\n config.experimental.linkNoTouchStart ?? false,\n 'process.env.__NEXT_ASSET_PREFIX': config.assetPrefix,\n 'process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS':\n !!config.experimental.authInterrupts,\n 'process.env.__NEXT_TELEMETRY_DISABLED': Boolean(\n process.env.NEXT_TELEMETRY_DISABLED\n ),\n ...(isNodeServer || isEdgeServer\n ? {\n // Fix bad-actors in the npm ecosystem (e.g. `node-formidable`)\n // This is typically found in unmaintained modules from the\n // pre-webpack era (common in server-side code)\n 'global.GENTLY': false,\n }\n : undefined),\n ...(isNodeServer || isEdgeServer\n ? {\n 'process.env.__NEXT_EXPERIMENTAL_REACT':\n needsExperimentalReact(config),\n }\n : undefined),\n\n 'process.env.__NEXT_MULTI_ZONE_DRAFT_MODE':\n config.experimental.multiZoneDraftMode ?? false,\n 'process.env.__NEXT_TRUST_HOST_HEADER':\n config.experimental.trustHostHeader ?? false,\n 'process.env.__NEXT_ALLOWED_REVALIDATE_HEADERS':\n config.experimental.allowedRevalidateHeaderKeys ?? [],\n ...(isNodeServer || isEdgeServer\n ? {\n 'process.env.__NEXT_RELATIVE_DIST_DIR': config.distDir,\n 'process.env.__NEXT_RELATIVE_PROJECT_DIR': path.relative(\n process.cwd(),\n projectPath\n ),\n }\n : {}),\n\n 'process.env.__NEXT_BROWSER_DEBUG_INFO_IN_TERMINAL': JSON.stringify(\n (config.logging && config.logging.browserToTerminal) || false\n ),\n 'process.env.__NEXT_MCP_SERVER': !!config.experimental.mcpServer,\n\n // The devtools need to know whether or not to show an option to clear the\n // bundler cache. This option may be removed later once Turbopack's\n // filesystem cache feature is more stable.\n //\n // This environment value is currently best-effort:\n // - It's possible to disable the webpack filesystem cache, but it's\n // unlikely for a user to do that.\n // - Rspack's filesystem cache is unstable and requires a different\n // configuration than webpack to enable (which we don't do).\n //\n // In the worst case we'll show an option to clear the cache, but it'll be a\n // no-op that just restarts the development server.\n 'process.env.__NEXT_BUNDLER_HAS_PERSISTENT_CACHE':\n !isTurbopack ||\n (config.experimental.turbopackFileSystemCacheForDev ?? false),\n 'process.env.__NEXT_REACT_DEBUG_CHANNEL':\n config.experimental.reactDebugChannel ?? false,\n 'process.env.__NEXT_TRANSITION_INDICATOR':\n config.experimental.transitionIndicator ?? false,\n 'process.env.__NEXT_GESTURE_TRANSITION':\n config.experimental.gestureTransition ?? false,\n 'process.env.__NEXT_OPTIMISTIC_ROUTING':\n config.experimental.optimisticRouting ?? false,\n 'process.env.__NEXT_INSTRUMENTATION_CLIENT_ROUTER_TRANSITION_EVENTS':\n config.experimental.instrumentationClientRouterTransitionEvents ?? false,\n 'process.env.__NEXT_APP_SHELLS': config.experimental.appShells ?? false,\n 'process.env.__NEXT_VARY_PARAMS': config.experimental.varyParams ?? false,\n 'process.env.__NEXT_EXPOSE_TESTING_API':\n dev || config.experimental.exposeTestingApiInProductionBuild === true,\n 'process.env.__NEXT_CACHE_LIFE': config.cacheLife,\n 'process.env.__NEXT_CLIENT_PARAM_PARSING_ORIGINS':\n config.experimental.clientParamParsingOrigins || [],\n }\n\n const userDefines = config.compiler?.define ?? {}\n for (const key in userDefines) {\n if (defineEnv.hasOwnProperty(key)) {\n throw new Error(\n `The \\`compiler.define\\` option is configured to replace the \\`${key}\\` variable. This variable is either part of a Next.js built-in or is already configured.`\n )\n }\n defineEnv[key] = userDefines[key]\n }\n\n if (isNodeServer || isEdgeServer) {\n const userDefinesServer = config.compiler?.defineServer ?? {}\n for (const key in userDefinesServer) {\n if (defineEnv.hasOwnProperty(key)) {\n throw new Error(\n `The \\`compiler.defineServer\\` option is configured to replace the \\`${key}\\` variable. This variable is either part of a Next.js built-in or is already configured.`\n )\n }\n defineEnv[key] = userDefinesServer[key]\n }\n }\n\n const serializedDefineEnv = serializeDefineEnv(defineEnv)\n\n // we delay inlining these values until after the build\n // with flying shuttle enabled so we can update them\n // without invalidating entries\n if (!dev && omitNonDeterministic) {\n // client uses window. instead of leaving process.env\n // in case process isn't polyfilled on client already\n // since by this point it won't be added by webpack\n const safeKey = (key: string) =>\n isClient ? `window.${key.split('.').pop()}` : key\n\n for (const key in nextPublicEnv) {\n serializedDefineEnv[key] = safeKey(key)\n }\n for (const key in nextConfigEnv) {\n serializedDefineEnv[key] = safeKey(key)\n }\n if (!config.experimental.runtimeServerDeploymentId) {\n for (const key of ['process.env.NEXT_DEPLOYMENT_ID']) {\n serializedDefineEnv[key] = safeKey(key)\n }\n }\n }\n\n return serializedDefineEnv\n}\n"],"names":["path","needsExperimentalReact","checkIsAppPPREnabled","getNextConfigEnv","getNextPublicEnvironmentVariables","DEFINE_ENV_EXPRESSION","Symbol","serializeDefineEnv","defineEnv","defineEnvStringified","Object","fromEntries","entries","map","key","value","JSON","stringify","getImageConfig","config","dev","deviceSizes","images","imageSizes","qualities","loader","dangerouslyAllowSVG","unoptimized","domains","remotePatterns","localPatterns","output","getDefineEnv","isTurbopack","clientRouterFilters","distDir","projectPath","fetchCacheKeyPrefix","hasRewrites","isClient","isEdgeServer","isNodeServer","middlewareMatchers","omitNonDeterministic","rewrites","nextPublicEnv","nextConfigEnv","isPPREnabled","experimental","ppr","isCacheComponentsEnabled","cacheComponents","isUseCacheEnabled","useCache","__NEXT_DEFINE_ENV","EdgeRuntime","process","env","NEXT_EDGE_RUNTIME_PROVIDER","NEXT_RSPACK","allowDevelopmentBuild","NEXT_PRIVATE_DISABLE_DEV_OVERLAY_UX","Boolean","appNavFailHandling","appNewScrollHandler","cachedNavigations","supportsImmutableAssets","useSkewCookie","deploymentId","runtimeServerDeploymentId","__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING","manualClientBasePath","isNaN","Number","staleTimes","dynamic","static","clientRouterFilter","staticFilter","dynamicFilter","validateRSCRequestHeaders","dynamicOnHover","useOffline","prefetchInlining","optimisticClientCache","proxyPrefetch","crossOrigin","__NEXT_TEST_MODE","relative","cwd","basePath","caseSensitiveRoutes","trailingSlash","devIndicators","position","reactStrictMode","optimizeCss","nextScriptWorkers","scrollRestoration","i18n","skipProxyUrlNormalize","externalProxyRewritesResolve","skipTrailingSlashRedirect","webVitalsAttribution","length","linkNoTouchStart","assetPrefix","authInterrupts","NEXT_TELEMETRY_DISABLED","undefined","multiZoneDraftMode","trustHostHeader","allowedRevalidateHeaderKeys","logging","browserToTerminal","mcpServer","turbopackFileSystemCacheForDev","reactDebugChannel","transitionIndicator","gestureTransition","optimisticRouting","instrumentationClientRouterTransitionEvents","appShells","varyParams","exposeTestingApiInProductionBuild","cacheLife","clientParamParsingOrigins","userDefines","compiler","define","hasOwnProperty","Error","userDefinesServer","defineServer","serializedDefineEnv","safeKey","split","pop"],"mappings":"AAOA,OAAOA,UAAU,YAAW;AAC5B,SAASC,sBAAsB,QAAQ,kCAAiC;AACxE,SAASC,oBAAoB,QAAQ,iCAAgC;AACrE,SACEC,gBAAgB,EAChBC,iCAAiC,QAC5B,oBAAmB;AA8B1B,MAAMC,wBAAwBC,OAAO;AAoBrC;;CAEC,GACD,SAASC,mBAAmBC,SAAoB;IAC9C,MAAMC,uBAA4CC,OAAOC,WAAW,CAClED,OAAOE,OAAO,CAACJ,WAAWK,GAAG,CAAC,CAAC,CAACC,KAAKC,MAAM,GAAK;YAC9CD;YACA,OAAOC,UAAU,YAAYV,yBAAyBU,QAClDA,KAAK,CAACV,sBAAsB,GAC5BW,KAAKC,SAAS,CAACF;SACpB;IAEH,OAAON;AACT;AAEA,SAASS,eACPC,MAA0B,EAC1BC,GAAY;QAUKD,gBAKSA,iBACDA;IAdzB,OAAO;QACL,iCAAi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,CAACM,IAAI,GAAGsH,iBAAiB,CAACtH,IAAI;QACzC;IACF;IAEA,MAAMwH,sBAAsB/H,mBAAmBC;IAE/C,uDAAuD;IACvD,oDAAoD;IACpD,+BAA+B;IAC/B,IAAI,CAACY,OAAOuB,sBAAsB;QAChC,qDAAqD;QACrD,qDAAqD;QACrD,mDAAmD;QACnD,MAAM4F,UAAU,CAACzH,MACfyB,WAAW,CAAC,OAAO,EAAEzB,IAAI0H,KAAK,CAAC,KAAKC,GAAG,IAAI,GAAG3H;QAEhD,IAAK,MAAMA,OAAO+B,cAAe;YAC/ByF,mBAAmB,CAACxH,IAAI,GAAGyH,QAAQzH;QACrC;QACA,IAAK,MAAMA,OAAOgC,cAAe;YAC/BwF,mBAAmB,CAACxH,IAAI,GAAGyH,QAAQzH;QACrC;QACA,IAAI,CAACK,OAAO6B,YAAY,CAACqB,yBAAyB,EAAE;YAClD,KAAK,MAAMvD,OAAO;gBAAC;aAAiC,CAAE;gBACpDwH,mBAAmB,CAACxH,IAAI,GAAGyH,QAAQzH;YACrC;QACF;IACF;IAEA,OAAOwH;AACT","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/build/define-env.ts"],"sourcesContent":["import type {\n I18NConfig,\n I18NDomains,\n NextConfigComplete,\n} from '../server/config-shared'\nimport type { ProxyMatcher } from './analysis/get-page-static-info'\nimport type { Rewrite } from '../lib/load-custom-routes'\nimport path from 'node:path'\nimport { needsExperimentalReact } from '../lib/needs-experimental-react'\nimport { checkIsAppPPREnabled } from '../server/lib/experimental/ppr'\nimport {\n getNextConfigEnv,\n getNextPublicEnvironmentVariables,\n} from '../lib/static-env'\n\ntype BloomFilter = ReturnType<\n import('../shared/lib/bloom-filter').BloomFilter['export']\n>\n\nexport interface DefineEnvOptions {\n isTurbopack: boolean\n clientRouterFilters?: {\n staticFilter: BloomFilter\n dynamicFilter: BloomFilter\n }\n config: NextConfigComplete\n dev: boolean\n distDir: string\n projectPath: string\n fetchCacheKeyPrefix: string | undefined\n hasRewrites: boolean\n isClient: boolean\n isEdgeServer: boolean\n isNodeServer: boolean\n middlewareMatchers: ProxyMatcher[] | undefined\n omitNonDeterministic?: boolean\n rewrites: {\n beforeFiles: Rewrite[]\n afterFiles: Rewrite[]\n fallback: Rewrite[]\n }\n}\n\nconst DEFINE_ENV_EXPRESSION = Symbol('DEFINE_ENV_EXPRESSION')\n\ninterface DefineEnv {\n [key: string]:\n | string\n | number\n | string[]\n | boolean\n | { [DEFINE_ENV_EXPRESSION]: string }\n | ProxyMatcher[]\n | BloomFilter\n | Partial<NextConfigComplete['images']>\n | I18NDomains\n | I18NConfig\n}\n\ninterface SerializedDefineEnv {\n [key: string]: string\n}\n\n/**\n * Serializes the DefineEnv config so that it can be inserted into the code by Webpack/Turbopack, JSON stringifies each value.\n */\nfunction serializeDefineEnv(defineEnv: DefineEnv): SerializedDefineEnv {\n const defineEnvStringified: SerializedDefineEnv = Object.fromEntries(\n Object.entries(defineEnv).map(([key, value]) => [\n key,\n typeof value === 'object' && DEFINE_ENV_EXPRESSION in value\n ? value[DEFINE_ENV_EXPRESSION]\n : JSON.stringify(value),\n ])\n )\n return defineEnvStringified\n}\n\nfunction getImageConfig(\n config: NextConfigComplete,\n dev: boolean\n): { 'process.env.__NEXT_IMAGE_OPTS': Partial<NextConfigComplete['images']> } {\n return {\n 'process.env.__NEXT_IMAGE_OPTS': {\n deviceSizes: config.images.deviceSizes,\n imageSizes: config.images.imageSizes,\n qualities: config.images.qualities,\n path: config.images.path,\n loader: config.images.loader,\n dangerouslyAllowSVG: config.images.dangerouslyAllowSVG,\n unoptimized: config?.images?.unoptimized,\n ...(dev\n ? {\n // additional config in dev to allow validating on the client\n domains: config.images.domains,\n remotePatterns: config.images?.remotePatterns,\n localPatterns: config.images?.localPatterns,\n output: config.output,\n }\n : {}),\n },\n }\n}\n\nexport function getDefineEnv({\n isTurbopack,\n clientRouterFilters,\n config,\n dev,\n distDir,\n projectPath,\n fetchCacheKeyPrefix,\n hasRewrites,\n isClient,\n isEdgeServer,\n isNodeServer,\n middlewareMatchers,\n omitNonDeterministic,\n rewrites,\n}: DefineEnvOptions): SerializedDefineEnv {\n const nextPublicEnv = getNextPublicEnvironmentVariables()\n const nextConfigEnv = getNextConfigEnv(config)\n\n const isPPREnabled = checkIsAppPPREnabled(config.experimental.ppr)\n const isCacheComponentsEnabled = !!config.cacheComponents\n const isUseCacheEnabled = !!config.experimental.useCache\n\n const defineEnv: DefineEnv = {\n // internal field to identify the plugin config\n __NEXT_DEFINE_ENV: true,\n\n ...nextPublicEnv,\n ...nextConfigEnv,\n ...(!isEdgeServer\n ? {}\n : {\n EdgeRuntime:\n /**\n * Cloud providers can set this environment variable to allow users\n * and library authors to have different implementations based on\n * the runtime they are running with, if it's not using `edge-runtime`\n */\n process.env.NEXT_EDGE_RUNTIME_PROVIDER ?? 'edge-runtime',\n\n // process should be only { env: {...} } for edge runtime.\n // For ignore avoid warn on `process.emit` usage but directly omit it.\n 'process.emit': false,\n }),\n 'process.turbopack': isTurbopack,\n 'process.env.TURBOPACK': isTurbopack,\n 'process.env.__NEXT_BUNDLER': isTurbopack\n ? 'Turbopack'\n : process.env.NEXT_RSPACK\n ? 'Rspack'\n : 'Webpack',\n // TODO: enforce `NODE_ENV` on `process.env`, and add a test:\n 'process.env.NODE_ENV':\n dev || config.experimental.allowDevelopmentBuild\n ? 'development'\n : 'production',\n 'process.env.__NEXT_DEV_SERVER': dev ? '1' : '',\n 'process.env.__NEXT_DISABLE_DEV_OVERLAY_UX':\n process.env.NEXT_PRIVATE_DISABLE_DEV_OVERLAY_UX === '1',\n 'process.env.NEXT_RUNTIME': isEdgeServer\n ? 'edge'\n : isNodeServer\n ? 'nodejs'\n : '',\n 'process.env.NEXT_MINIMAL': '',\n 'process.env.__NEXT_APP_NAV_FAIL_HANDLING': Boolean(\n config.experimental.appNavFailHandling\n ),\n 'process.env.__NEXT_APP_NEW_SCROLL_HANDLER': Boolean(\n config.experimental.appNewScrollHandler\n ),\n 'process.env.__NEXT_PPR': isPPREnabled,\n 'process.env.__NEXT_CACHE_COMPONENTS': isCacheComponentsEnabled,\n 'process.env.__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS': Boolean(\n config.experimental.cachedNavigations\n ),\n 'process.env.__NEXT_INSTANT_NAV_TOGGLE': isCacheComponentsEnabled,\n 'process.env.__NEXT_EXPERIMENTAL_COLD_CACHE_BADGE': Boolean(\n config.experimental.coldCacheBadge\n ),\n 'process.env.__NEXT_USE_CACHE': isUseCacheEnabled,\n 'process.env.__NEXT_USE_NODE_STREAMS': isEdgeServer ? false : true,\n\n 'process.env.NEXT_SUPPORTS_IMMUTABLE_ASSETS':\n config.experimental.supportsImmutableAssets || false,\n\n ...(config.experimental?.useSkewCookie || !config.deploymentId\n ? {\n 'process.env.NEXT_DEPLOYMENT_ID': false,\n }\n : isClient\n ? isTurbopack\n ? {\n // This is set at runtime by packages/next/src/client/register-deployment-id-global.ts\n 'process.env.NEXT_DEPLOYMENT_ID': {\n [DEFINE_ENV_EXPRESSION]: 'globalThis.NEXT_DEPLOYMENT_ID',\n },\n }\n : {\n // For Webpack, we currently don't use the non-inlining globalThis.NEXT_DEPLOYMENT_ID\n // approach because we cannot forward this global variable to web workers easily.\n 'process.env.NEXT_DEPLOYMENT_ID': config.deploymentId || false,\n }\n : config.experimental?.runtimeServerDeploymentId\n ? {\n // Don't inline at all, keep process.env.NEXT_DEPLOYMENT_ID as is\n }\n : {\n 'process.env.NEXT_DEPLOYMENT_ID': config.deploymentId || false,\n }),\n\n // Propagates the `__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING` environment\n // variable to the client.\n 'process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING':\n process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING || false,\n 'process.env.__NEXT_FETCH_CACHE_KEY_PREFIX': fetchCacheKeyPrefix ?? '',\n ...(isTurbopack\n ? {}\n : {\n 'process.env.__NEXT_MIDDLEWARE_MATCHERS': middlewareMatchers ?? [],\n }),\n 'process.env.__NEXT_MANUAL_CLIENT_BASE_PATH':\n config.experimental.manualClientBasePath ?? false,\n 'process.env.__NEXT_CLIENT_ROUTER_DYNAMIC_STALETIME': JSON.stringify(\n isNaN(Number(config.experimental.staleTimes?.dynamic))\n ? 0\n : config.experimental.staleTimes?.dynamic\n ),\n 'process.env.__NEXT_CLIENT_ROUTER_STATIC_STALETIME': JSON.stringify(\n isNaN(Number(config.experimental.staleTimes?.static))\n ? 5 * 60 // 5 minutes\n : config.experimental.staleTimes?.static\n ),\n 'process.env.__NEXT_CLIENT_ROUTER_FILTER_ENABLED':\n config.experimental.clientRouterFilter ?? true,\n 'process.env.__NEXT_CLIENT_ROUTER_S_FILTER':\n clientRouterFilters?.staticFilter ?? false,\n 'process.env.__NEXT_CLIENT_ROUTER_D_FILTER':\n clientRouterFilters?.dynamicFilter ?? false,\n 'process.env.__NEXT_CLIENT_VALIDATE_RSC_REQUEST_HEADERS': Boolean(\n config.experimental.validateRSCRequestHeaders\n ),\n 'process.env.__NEXT_DYNAMIC_ON_HOVER': Boolean(\n config.experimental.dynamicOnHover\n ),\n 'process.env.__NEXT_USE_OFFLINE': Boolean(config.experimental.useOffline),\n 'process.env.__NEXT_PREFETCH_INLINING': Boolean(\n config.experimental.prefetchInlining\n ),\n 'process.env.__NEXT_OPTIMISTIC_CLIENT_CACHE':\n config.experimental.optimisticClientCache ?? true,\n 'process.env.__NEXT_MIDDLEWARE_PREFETCH':\n config.experimental.proxyPrefetch ?? 'flexible',\n 'process.env.__NEXT_CROSS_ORIGIN': config.crossOrigin,\n 'process.browser': isClient,\n 'process.env.__NEXT_TEST_MODE': process.env.__NEXT_TEST_MODE ?? false,\n // This is used in client/dev-error-overlay/hot-dev-client.js to replace the dist directory\n ...(dev && (isClient ?? isEdgeServer)\n ? {\n 'process.env.__NEXT_DIST_DIR': distDir,\n }\n : {}),\n // This is used in devtools to strip the project path in edge runtime,\n // as there's only a dummy `dir` value (`.`) as edge runtime doesn't have concept of file system.\n ...(dev && isEdgeServer\n ? {\n 'process.env.__NEXT_EDGE_PROJECT_DIR': isTurbopack\n ? path.relative(process.cwd(), projectPath)\n : projectPath,\n }\n : {}),\n 'process.env.__NEXT_BASE_PATH': config.basePath,\n 'process.env.__NEXT_CASE_SENSITIVE_ROUTES': Boolean(\n config.experimental.caseSensitiveRoutes\n ),\n 'process.env.__NEXT_REWRITES': rewrites as any,\n 'process.env.__NEXT_TRAILING_SLASH': config.trailingSlash,\n 'process.env.__NEXT_DEV_INDICATOR': config.devIndicators !== false,\n 'process.env.__NEXT_DEV_INDICATOR_POSITION':\n config.devIndicators === false\n ? 'bottom-left' // This will not be used as the indicator is disabled.\n : (config.devIndicators.position ?? 'bottom-left'),\n 'process.env.__NEXT_STRICT_MODE':\n config.reactStrictMode === null ? false : config.reactStrictMode,\n 'process.env.__NEXT_STRICT_MODE_APP':\n // When next.config.js does not have reactStrictMode it's enabled by default.\n config.reactStrictMode === null ? true : config.reactStrictMode,\n 'process.env.__NEXT_OPTIMIZE_CSS':\n (config.experimental.optimizeCss && !dev) ?? false,\n 'process.env.__NEXT_SCRIPT_WORKERS':\n (config.experimental.nextScriptWorkers && !dev) ?? false,\n 'process.env.__NEXT_SCROLL_RESTORATION':\n config.experimental.scrollRestoration ?? false,\n ...getImageConfig(config, dev),\n 'process.env.__NEXT_ROUTER_BASEPATH': config.basePath,\n 'process.env.__NEXT_HAS_REWRITES': hasRewrites,\n 'process.env.__NEXT_CONFIG_OUTPUT': config.output,\n 'process.env.__NEXT_I18N_SUPPORT': !!config.i18n,\n 'process.env.__NEXT_I18N_DOMAINS': config.i18n?.domains ?? false,\n 'process.env.__NEXT_I18N_CONFIG': config.i18n || '',\n 'process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE':\n config.skipProxyUrlNormalize,\n 'process.env.__NEXT_EXTERNAL_MIDDLEWARE_REWRITE_RESOLVE':\n config.experimental.externalProxyRewritesResolve ?? false,\n 'process.env.__NEXT_MANUAL_TRAILING_SLASH':\n config.skipTrailingSlashRedirect,\n 'process.env.__NEXT_HAS_WEB_VITALS_ATTRIBUTION':\n (config.experimental.webVitalsAttribution &&\n config.experimental.webVitalsAttribution.length > 0) ??\n false,\n 'process.env.__NEXT_WEB_VITALS_ATTRIBUTION':\n config.experimental.webVitalsAttribution ?? false,\n 'process.env.__NEXT_LINK_NO_TOUCH_START':\n config.experimental.linkNoTouchStart ?? false,\n 'process.env.__NEXT_ASSET_PREFIX': config.assetPrefix,\n 'process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS':\n !!config.experimental.authInterrupts,\n 'process.env.__NEXT_TELEMETRY_DISABLED': Boolean(\n process.env.NEXT_TELEMETRY_DISABLED\n ),\n ...(isNodeServer || isEdgeServer\n ? {\n // Fix bad-actors in the npm ecosystem (e.g. `node-formidable`)\n // This is typically found in unmaintained modules from the\n // pre-webpack era (common in server-side code)\n 'global.GENTLY': false,\n }\n : undefined),\n ...(isNodeServer || isEdgeServer\n ? {\n 'process.env.__NEXT_EXPERIMENTAL_REACT':\n needsExperimentalReact(config),\n }\n : undefined),\n\n 'process.env.__NEXT_MULTI_ZONE_DRAFT_MODE':\n config.experimental.multiZoneDraftMode ?? false,\n 'process.env.__NEXT_TRUST_HOST_HEADER':\n config.experimental.trustHostHeader ?? false,\n 'process.env.__NEXT_ALLOWED_REVALIDATE_HEADERS':\n config.experimental.allowedRevalidateHeaderKeys ?? [],\n ...(isNodeServer || isEdgeServer\n ? {\n 'process.env.__NEXT_RELATIVE_DIST_DIR': config.distDir,\n 'process.env.__NEXT_RELATIVE_PROJECT_DIR': path.relative(\n process.cwd(),\n projectPath\n ),\n }\n : {}),\n\n 'process.env.__NEXT_BROWSER_DEBUG_INFO_IN_TERMINAL': JSON.stringify(\n (config.logging && config.logging.browserToTerminal) || false\n ),\n 'process.env.__NEXT_MCP_SERVER': !!config.experimental.mcpServer,\n\n // The devtools need to know whether or not to show an option to clear the\n // bundler cache. This option may be removed later once Turbopack's\n // filesystem cache feature is more stable.\n //\n // This environment value is currently best-effort:\n // - It's possible to disable the webpack filesystem cache, but it's\n // unlikely for a user to do that.\n // - Rspack's filesystem cache is unstable and requires a different\n // configuration than webpack to enable (which we don't do).\n //\n // In the worst case we'll show an option to clear the cache, but it'll be a\n // no-op that just restarts the development server.\n 'process.env.__NEXT_BUNDLER_HAS_PERSISTENT_CACHE':\n !isTurbopack ||\n (config.experimental.turbopackFileSystemCacheForDev ?? false),\n 'process.env.__NEXT_REACT_DEBUG_CHANNEL':\n config.experimental.reactDebugChannel ?? false,\n 'process.env.__NEXT_TRANSITION_INDICATOR':\n config.experimental.transitionIndicator ?? false,\n 'process.env.__NEXT_GESTURE_TRANSITION':\n config.experimental.gestureTransition ?? false,\n 'process.env.__NEXT_OPTIMISTIC_ROUTING':\n config.experimental.optimisticRouting ?? false,\n 'process.env.__NEXT_INSTRUMENTATION_CLIENT_ROUTER_TRANSITION_EVENTS':\n config.experimental.instrumentationClientRouterTransitionEvents ?? false,\n 'process.env.__NEXT_APP_SHELLS': config.experimental.appShells ?? false,\n 'process.env.__NEXT_VARY_PARAMS': config.experimental.varyParams ?? false,\n 'process.env.__NEXT_EXPOSE_TESTING_API':\n dev || config.experimental.exposeTestingApiInProductionBuild === true,\n 'process.env.__NEXT_CACHE_LIFE': config.cacheLife,\n 'process.env.__NEXT_CLIENT_PARAM_PARSING_ORIGINS':\n config.experimental.clientParamParsingOrigins || [],\n }\n\n const userDefines = config.compiler?.define ?? {}\n for (const key in userDefines) {\n if (defineEnv.hasOwnProperty(key)) {\n throw new Error(\n `The \\`compiler.define\\` option is configured to replace the \\`${key}\\` variable. This variable is either part of a Next.js built-in or is already configured.`\n )\n }\n defineEnv[key] = userDefines[key]\n }\n\n if (isNodeServer || isEdgeServer) {\n const userDefinesServer = config.compiler?.defineServer ?? {}\n for (const key in userDefinesServer) {\n if (defineEnv.hasOwnProperty(key)) {\n throw new Error(\n `The \\`compiler.defineServer\\` option is configured to replace the \\`${key}\\` variable. This variable is either part of a Next.js built-in or is already configured.`\n )\n }\n defineEnv[key] = userDefinesServer[key]\n }\n }\n\n const serializedDefineEnv = serializeDefineEnv(defineEnv)\n\n // we delay inlining these values until after the build\n // with flying shuttle enabled so we can update them\n // without invalidating entries\n if (!dev && omitNonDeterministic) {\n // client uses window. instead of leaving process.env\n // in case process isn't polyfilled on client already\n // since by this point it won't be added by webpack\n const safeKey = (key: string) =>\n isClient ? `window.${key.split('.').pop()}` : key\n\n for (const key in nextPublicEnv) {\n serializedDefineEnv[key] = safeKey(key)\n }\n for (const key in nextConfigEnv) {\n serializedDefineEnv[key] = safeKey(key)\n }\n if (!config.experimental.runtimeServerDeploymentId) {\n for (const key of ['process.env.NEXT_DEPLOYMENT_ID']) {\n serializedDefineEnv[key] = safeKey(key)\n }\n }\n }\n\n return serializedDefineEnv\n}\n"],"names":["path","needsExperimentalReact","checkIsAppPPREnabled","getNextConfigEnv","getNextPublicEnvironmentVariables","DEFINE_ENV_EXPRESSION","Symbol","serializeDefineEnv","defineEnv","defineEnvStringified","Object","fromEntries","entries","map","key","value","JSON","stringify","getImageConfig","config","dev","deviceSizes","images","imageSizes","qualities","loader","dangerouslyAllowSVG","unoptimized","domains","remotePatterns","localPatterns","output","getDefineEnv","isTurbopack","clientRouterFilters","distDir","projectPath","fetchCacheKeyPrefix","hasRewrites","isClient","isEdgeServer","isNodeServer","middlewareMatchers","omitNonDeterministic","rewrites","nextPublicEnv","nextConfigEnv","isPPREnabled","experimental","ppr","isCacheComponentsEnabled","cacheComponents","isUseCacheEnabled","useCache","__NEXT_DEFINE_ENV","EdgeRuntime","process","env","NEXT_EDGE_RUNTIME_PROVIDER","NEXT_RSPACK","allowDevelopmentBuild","NEXT_PRIVATE_DISABLE_DEV_OVERLAY_UX","Boolean","appNavFailHandling","appNewScrollHandler","cachedNavigations","coldCacheBadge","supportsImmutableAssets","useSkewCookie","deploymentId","runtimeServerDeploymentId","__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING","manualClientBasePath","isNaN","Number","staleTimes","dynamic","static","clientRouterFilter","staticFilter","dynamicFilter","validateRSCRequestHeaders","dynamicOnHover","useOffline","prefetchInlining","optimisticClientCache","proxyPrefetch","crossOrigin","__NEXT_TEST_MODE","relative","cwd","basePath","caseSensitiveRoutes","trailingSlash","devIndicators","position","reactStrictMode","optimizeCss","nextScriptWorkers","scrollRestoration","i18n","skipProxyUrlNormalize","externalProxyRewritesResolve","skipTrailingSlashRedirect","webVitalsAttribution","length","linkNoTouchStart","assetPrefix","authInterrupts","NEXT_TELEMETRY_DISABLED","undefined","multiZoneDraftMode","trustHostHeader","allowedRevalidateHeaderKeys","logging","browserToTerminal","mcpServer","turbopackFileSystemCacheForDev","reactDebugChannel","transitionIndicator","gestureTransition","optimisticRouting","instrumentationClientRouterTransitionEvents","appShells","varyParams","exposeTestingApiInProductionBuild","cacheLife","clientParamParsingOrigins","userDefines","compiler","define","hasOwnProperty","Error","userDefinesServer","defineServer","serializedDefineEnv","safeKey","split","pop"],"mappings":"AAOA,OAAOA,UAAU,YAAW;AAC5B,SAASC,sBAAsB,QAAQ,kCAAiC;AACxE,SAASC,oBAAoB,QAAQ,iCAAgC;AACrE,SACEC,gBAAgB,EAChBC,iCAAiC,QAC5B,oBAAmB;AA8B1B,MAAMC,wBAAwBC,OAAO;AAoBrC;;CAEC,GACD,SAASC,mBAAmBC,SAAoB;IAC9C,MAAMC,uBAA4CC,OAAOC,WAAW,CAClED,OAAOE,OAAO,CAACJ,WAAWK,GAAG,CAAC,CAAC,CAACC,KAAKC,MAAM,GAAK;YAC9CD;YACA,OAAOC,UAAU,YAAYV,yBAAyBU,QAClDA,KAAK,CAACV,sBAAsB,GAC5BW,KAAKC,SAAS,CAACF;SACpB;IAEH,OAAON;AACT;AAEA,SAASS,eACPC,MAA0B,EAC1BC,GAAY;QAUKD,gBAKSA,iBACDA;IAdzB,OAAO;QACL,iCAAiC;YAC/BE,aAAaF,OAAOG,MAAM,CAACD,WAAW;YACtCE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AN,SAAS,CAACM,IAAI,GAAGuH,iBAAiB,CAACvH,IAAI;QACzC;IACF;IAEA,MAAMyH,sBAAsBhI,mBAAmBC;IAE/C,uDAAuD;IACvD,oDAAoD;IACpD,+BAA+B;IAC/B,IAAI,CAACY,OAAOuB,sBAAsB;QAChC,qDAAqD;QACrD,qDAAqD;QACrD,mDAAmD;QACnD,MAAM6F,UAAU,CAAC1H,MACfyB,WAAW,CAAC,OAAO,EAAEzB,IAAI2H,KAAK,CAAC,KAAKC,GAAG,IAAI,GAAG5H;QAEhD,IAAK,MAAMA,OAAO+B,cAAe;YAC/B0F,mBAAmB,CAACzH,IAAI,GAAG0H,QAAQ1H;QACrC;QACA,IAAK,MAAMA,OAAOgC,cAAe;YAC/ByF,mBAAmB,CAACzH,IAAI,GAAG0H,QAAQ1H;QACrC;QACA,IAAI,CAACK,OAAO6B,YAAY,CAACsB,yBAAyB,EAAE;YAClD,KAAK,MAAMxD,OAAO;gBAAC;aAAiC,CAAE;gBACpDyH,mBAAmB,CAACzH,IAAI,GAAG0H,QAAQ1H;YACrC;QACF;IACF;IAEA,OAAOyH;AACT","ignoreList":[0]} |
@@ -14,3 +14,3 @@ import path from 'path'; | ||
| }({}); | ||
| const nextVersion = "16.3.0-preview.4"; | ||
| const nextVersion = "16.3.0-preview.5"; | ||
| const ArchName = arch(); | ||
@@ -17,0 +17,0 @@ const PlatformName = platform(); |
@@ -69,3 +69,3 @@ import path from 'path'; | ||
| isPersistentCachingEnabled: persistentCaching, | ||
| nextVersion: "16.3.0-preview.4" | ||
| nextVersion: "16.3.0-preview.5" | ||
| }, { | ||
@@ -72,0 +72,0 @@ turbopackMemoryEviction: config.experimental.turbopackMemoryEvictionMode, |
@@ -87,3 +87,3 @@ // Import cpu-profile first to start profiling early if enabled | ||
| deferredEntries: config.experimental.deferredEntries, | ||
| nextVersion: "16.3.0-preview.4" | ||
| nextVersion: "16.3.0-preview.5" | ||
| }; | ||
@@ -90,0 +90,0 @@ const sharedTurboOptions = { |
@@ -8,3 +8,3 @@ /** | ||
| import { setAttributesFromProps } from './set-attributes-from-props'; | ||
| const version = "16.3.0-preview.4"; | ||
| const version = "16.3.0-preview.5"; | ||
| window.next = { | ||
@@ -11,0 +11,0 @@ version, |
@@ -19,3 +19,3 @@ export const RSC_HEADER = 'rsc'; | ||
| // requests while a navigation lock is held; the server uses its presence to | ||
| // render only the static shell. Not exposed in production builds by default. | ||
| // render only the shell. Not exposed in production builds by default. | ||
| export const NEXT_INSTANT_TEST_COOKIE = 'next-instant-navigation-testing'; | ||
@@ -22,0 +22,0 @@ export const FLIGHT_HEADERS = [ |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/client/components/app-router-headers.ts"],"sourcesContent":["export const RSC_HEADER = 'rsc' as const\nexport const ACTION_HEADER = 'next-action' as const\n// TODO: Instead of sending the full router state, we only need to send the\n// segment path. Saves bytes. Then we could also use this field for segment\n// prefetches, which also need to specify a particular segment.\nexport const NEXT_ROUTER_STATE_TREE_HEADER = 'next-router-state-tree' as const\nexport const NEXT_ROUTER_PREFETCH_HEADER = 'next-router-prefetch' as const\n// This contains the path to the segment being prefetched.\n// TODO: If we change next-router-state-tree to be a segment path, we can use\n// that instead. Then next-router-prefetch and next-router-segment-prefetch can\n// be merged into a single enum.\nexport const NEXT_ROUTER_SEGMENT_PREFETCH_HEADER =\n 'next-router-segment-prefetch' as const\nexport const NEXT_HMR_REFRESH_HEADER = 'next-hmr-refresh' as const\nexport const NEXT_HMR_REFRESH_HASH_COOKIE = '__next_hmr_refresh_hash__' as const\nexport const NEXT_URL = 'next-url' as const\nexport const RSC_CONTENT_TYPE_HEADER = 'text/x-component' as const\n\n// Cookie for the Instant Navigation Testing API. Sent automatically with all\n// requests while a navigation lock is held; the server uses its presence to\n// render only the static shell. Not exposed in production builds by default.\nexport const NEXT_INSTANT_TEST_COOKIE =\n 'next-instant-navigation-testing' as const\n\nexport const FLIGHT_HEADERS = [\n RSC_HEADER,\n NEXT_ROUTER_STATE_TREE_HEADER,\n NEXT_ROUTER_PREFETCH_HEADER,\n NEXT_HMR_REFRESH_HEADER,\n NEXT_ROUTER_SEGMENT_PREFETCH_HEADER,\n] as const\n\nexport const NEXT_RSC_UNION_QUERY = '_rsc' as const\n\nexport const NEXT_ROUTER_STALE_TIME_HEADER = 'x-nextjs-stale-time' as const\nexport const NEXT_DID_POSTPONE_HEADER = 'x-nextjs-postponed' as const\nexport const NEXT_REWRITTEN_PATH_HEADER = 'x-nextjs-rewritten-path' as const\nexport const NEXT_REWRITTEN_QUERY_HEADER = 'x-nextjs-rewritten-query' as const\nexport const NEXT_IS_PRERENDER_HEADER = 'x-nextjs-prerender' as const\nexport const NEXT_ACTION_NOT_FOUND_HEADER = 'x-nextjs-action-not-found' as const\nexport const NEXT_REQUEST_ID_HEADER = 'x-nextjs-request-id' as const\nexport const NEXT_HTML_REQUEST_ID_HEADER = 'x-nextjs-html-request-id' as const\n\n// TODO: Should this include nextjs in the name, like the others?\nexport const NEXT_ACTION_REVALIDATED_HEADER = 'x-action-revalidated' as const\n"],"names":["RSC_HEADER","ACTION_HEADER","NEXT_ROUTER_STATE_TREE_HEADER","NEXT_ROUTER_PREFETCH_HEADER","NEXT_ROUTER_SEGMENT_PREFETCH_HEADER","NEXT_HMR_REFRESH_HEADER","NEXT_HMR_REFRESH_HASH_COOKIE","NEXT_URL","RSC_CONTENT_TYPE_HEADER","NEXT_INSTANT_TEST_COOKIE","FLIGHT_HEADERS","NEXT_RSC_UNION_QUERY","NEXT_ROUTER_STALE_TIME_HEADER","NEXT_DID_POSTPONE_HEADER","NEXT_REWRITTEN_PATH_HEADER","NEXT_REWRITTEN_QUERY_HEADER","NEXT_IS_PRERENDER_HEADER","NEXT_ACTION_NOT_FOUND_HEADER","NEXT_REQUEST_ID_HEADER","NEXT_HTML_REQUEST_ID_HEADER","NEXT_ACTION_REVALIDATED_HEADER"],"mappings":"AAAA,OAAO,MAAMA,aAAa,MAAc;AACxC,OAAO,MAAMC,gBAAgB,cAAsB;AACnD,2EAA2E;AAC3E,2EAA2E;AAC3E,+DAA+D;AAC/D,OAAO,MAAMC,gCAAgC,yBAAiC;AAC9E,OAAO,MAAMC,8BAA8B,uBAA+B;AAC1E,0DAA0D;AAC1D,6EAA6E;AAC7E,+EAA+E;AAC/E,gCAAgC;AAChC,OAAO,MAAMC,sCACX,+BAAuC;AACzC,OAAO,MAAMC,0BAA0B,mBAA2B;AAClE,OAAO,MAAMC,+BAA+B,4BAAoC;AAChF,OAAO,MAAMC,WAAW,WAAmB;AAC3C,OAAO,MAAMC,0BAA0B,mBAA2B;AAElE,6EAA6E;AAC7E,4EAA4E;AAC5E,6EAA6E;AAC7E,OAAO,MAAMC,2BACX,kCAA0C;AAE5C,OAAO,MAAMC,iBAAiB;IAC5BV;IACAE;IACAC;IACAE;IACAD;CACD,CAAS;AAEV,OAAO,MAAMO,uBAAuB,OAAe;AAEnD,OAAO,MAAMC,gCAAgC,sBAA8B;AAC3E,OAAO,MAAMC,2BAA2B,qBAA6B;AACrE,OAAO,MAAMC,6BAA6B,0BAAkC;AAC5E,OAAO,MAAMC,8BAA8B,2BAAmC;AAC9E,OAAO,MAAMC,2BAA2B,qBAA6B;AACrE,OAAO,MAAMC,+BAA+B,4BAAoC;AAChF,OAAO,MAAMC,yBAAyB,sBAA8B;AACpE,OAAO,MAAMC,8BAA8B,2BAAmC;AAE9E,iEAAiE;AACjE,OAAO,MAAMC,iCAAiC,uBAA+B","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/client/components/app-router-headers.ts"],"sourcesContent":["export const RSC_HEADER = 'rsc' as const\nexport const ACTION_HEADER = 'next-action' as const\n// TODO: Instead of sending the full router state, we only need to send the\n// segment path. Saves bytes. Then we could also use this field for segment\n// prefetches, which also need to specify a particular segment.\nexport const NEXT_ROUTER_STATE_TREE_HEADER = 'next-router-state-tree' as const\nexport const NEXT_ROUTER_PREFETCH_HEADER = 'next-router-prefetch' as const\n// This contains the path to the segment being prefetched.\n// TODO: If we change next-router-state-tree to be a segment path, we can use\n// that instead. Then next-router-prefetch and next-router-segment-prefetch can\n// be merged into a single enum.\nexport const NEXT_ROUTER_SEGMENT_PREFETCH_HEADER =\n 'next-router-segment-prefetch' as const\nexport const NEXT_HMR_REFRESH_HEADER = 'next-hmr-refresh' as const\nexport const NEXT_HMR_REFRESH_HASH_COOKIE = '__next_hmr_refresh_hash__' as const\nexport const NEXT_URL = 'next-url' as const\nexport const RSC_CONTENT_TYPE_HEADER = 'text/x-component' as const\n\n// Cookie for the Instant Navigation Testing API. Sent automatically with all\n// requests while a navigation lock is held; the server uses its presence to\n// render only the shell. Not exposed in production builds by default.\nexport const NEXT_INSTANT_TEST_COOKIE =\n 'next-instant-navigation-testing' as const\n\nexport const FLIGHT_HEADERS = [\n RSC_HEADER,\n NEXT_ROUTER_STATE_TREE_HEADER,\n NEXT_ROUTER_PREFETCH_HEADER,\n NEXT_HMR_REFRESH_HEADER,\n NEXT_ROUTER_SEGMENT_PREFETCH_HEADER,\n] as const\n\nexport const NEXT_RSC_UNION_QUERY = '_rsc' as const\n\nexport const NEXT_ROUTER_STALE_TIME_HEADER = 'x-nextjs-stale-time' as const\nexport const NEXT_DID_POSTPONE_HEADER = 'x-nextjs-postponed' as const\nexport const NEXT_REWRITTEN_PATH_HEADER = 'x-nextjs-rewritten-path' as const\nexport const NEXT_REWRITTEN_QUERY_HEADER = 'x-nextjs-rewritten-query' as const\nexport const NEXT_IS_PRERENDER_HEADER = 'x-nextjs-prerender' as const\nexport const NEXT_ACTION_NOT_FOUND_HEADER = 'x-nextjs-action-not-found' as const\nexport const NEXT_REQUEST_ID_HEADER = 'x-nextjs-request-id' as const\nexport const NEXT_HTML_REQUEST_ID_HEADER = 'x-nextjs-html-request-id' as const\n\n// TODO: Should this include nextjs in the name, like the others?\nexport const NEXT_ACTION_REVALIDATED_HEADER = 'x-action-revalidated' as const\n"],"names":["RSC_HEADER","ACTION_HEADER","NEXT_ROUTER_STATE_TREE_HEADER","NEXT_ROUTER_PREFETCH_HEADER","NEXT_ROUTER_SEGMENT_PREFETCH_HEADER","NEXT_HMR_REFRESH_HEADER","NEXT_HMR_REFRESH_HASH_COOKIE","NEXT_URL","RSC_CONTENT_TYPE_HEADER","NEXT_INSTANT_TEST_COOKIE","FLIGHT_HEADERS","NEXT_RSC_UNION_QUERY","NEXT_ROUTER_STALE_TIME_HEADER","NEXT_DID_POSTPONE_HEADER","NEXT_REWRITTEN_PATH_HEADER","NEXT_REWRITTEN_QUERY_HEADER","NEXT_IS_PRERENDER_HEADER","NEXT_ACTION_NOT_FOUND_HEADER","NEXT_REQUEST_ID_HEADER","NEXT_HTML_REQUEST_ID_HEADER","NEXT_ACTION_REVALIDATED_HEADER"],"mappings":"AAAA,OAAO,MAAMA,aAAa,MAAc;AACxC,OAAO,MAAMC,gBAAgB,cAAsB;AACnD,2EAA2E;AAC3E,2EAA2E;AAC3E,+DAA+D;AAC/D,OAAO,MAAMC,gCAAgC,yBAAiC;AAC9E,OAAO,MAAMC,8BAA8B,uBAA+B;AAC1E,0DAA0D;AAC1D,6EAA6E;AAC7E,+EAA+E;AAC/E,gCAAgC;AAChC,OAAO,MAAMC,sCACX,+BAAuC;AACzC,OAAO,MAAMC,0BAA0B,mBAA2B;AAClE,OAAO,MAAMC,+BAA+B,4BAAoC;AAChF,OAAO,MAAMC,WAAW,WAAmB;AAC3C,OAAO,MAAMC,0BAA0B,mBAA2B;AAElE,6EAA6E;AAC7E,4EAA4E;AAC5E,sEAAsE;AACtE,OAAO,MAAMC,2BACX,kCAA0C;AAE5C,OAAO,MAAMC,iBAAiB;IAC5BV;IACAE;IACAC;IACAE;IACAD;CACD,CAAS;AAEV,OAAO,MAAMO,uBAAuB,OAAe;AAEnD,OAAO,MAAMC,gCAAgC,sBAA8B;AAC3E,OAAO,MAAMC,2BAA2B,qBAA6B;AACrE,OAAO,MAAMC,6BAA6B,0BAAkC;AAC5E,OAAO,MAAMC,8BAA8B,2BAAmC;AAC9E,OAAO,MAAMC,2BAA2B,qBAA6B;AACrE,OAAO,MAAMC,+BAA+B,4BAAoC;AAChF,OAAO,MAAMC,yBAAyB,sBAA8B;AACpE,OAAO,MAAMC,8BAA8B,2BAAmC;AAE9E,iEAAiE;AACjE,OAAO,MAAMC,iCAAiC,uBAA+B","ignoreList":[0]} |
@@ -218,3 +218,4 @@ import { FetchStrategy, PrefetchPriority } from './segment-cache/types'; | ||
| const cacheKey = createCacheKey(instance.prefetchHref, nextUrl); | ||
| instance.prefetchTask = scheduleSegmentPrefetchTask(cacheKey, treeAtTimeOfPrefetch, instance.fetchStrategy, priority, null); | ||
| instance.prefetchTask = scheduleSegmentPrefetchTask(cacheKey, treeAtTimeOfPrefetch, instance.fetchStrategy, priority, null, null // navigationLockPrefetch | ||
| ); | ||
| } else { | ||
@@ -247,3 +248,4 @@ // We already have an old task object that we can reschedule. This is | ||
| const cacheKey = createCacheKey(instance.prefetchHref, nextUrl); | ||
| instance.prefetchTask = scheduleSegmentPrefetchTask(cacheKey, tree, instance.fetchStrategy, PrefetchPriority.Default, null); | ||
| instance.prefetchTask = scheduleSegmentPrefetchTask(cacheKey, tree, instance.fetchStrategy, PrefetchPriority.Default, null, null // navigationLockPrefetch | ||
| ); | ||
| } | ||
@@ -250,0 +252,0 @@ } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/client/components/links.ts"],"sourcesContent":["import type { FlightRouterState } from '../../shared/lib/app-router-types'\nimport type { AppRouterInstance } from '../../shared/lib/app-router-context.shared-runtime'\nimport {\n FetchStrategy,\n type PrefetchTaskFetchStrategy,\n PrefetchPriority,\n} from './segment-cache/types'\nimport { createCacheKey } from './segment-cache/cache-key'\nimport {\n type PrefetchTask,\n schedulePrefetchTask as scheduleSegmentPrefetchTask,\n cancelPrefetchTask,\n reschedulePrefetchTask,\n isPrefetchTaskDirty,\n} from './segment-cache/scheduler'\nimport { startTransition } from 'react'\n\ntype LinkElement = HTMLAnchorElement | SVGAElement\n\ntype Element = LinkElement | HTMLFormElement\n\n// Properties that are shared between Link and Form instances. We use the same\n// shape for both to prevent a polymorphic de-opt in the VM.\ntype LinkOrFormInstanceShared = {\n router: AppRouterInstance\n fetchStrategy: PrefetchTaskFetchStrategy\n\n isVisible: boolean\n\n // The most recently initiated prefetch task. It may or may not have\n // already completed. The same prefetch task object can be reused across\n // multiple prefetches of the same link.\n prefetchTask: PrefetchTask | null\n}\n\nexport type FormInstance = LinkOrFormInstanceShared & {\n prefetchHref: string\n setOptimisticLinkStatus: null\n}\n\ntype PrefetchableLinkInstance = LinkOrFormInstanceShared & {\n // In dev, the Owner Stack captured at the time this Link was rendered, for\n // configurations where a warning might later fire.\n // `undefined` means we opted out of capturing the stack.\n // If you issue a warning, handle the `undefined` case separately\n // so it's clear in the logs when a warning is missing its source location.\n // A warning with an undefined ownerStack is considered a bug though so make\n // sure reaching the log site is a subset of codepaths that lead to capturing\n // the stack\n ownerStack: string | null | undefined\n prefetchHref: string\n setOptimisticLinkStatus: (status: { pending: boolean }) => void\n}\n\ntype NonPrefetchableLinkInstance = LinkOrFormInstanceShared & {\n ownerStack: string | null | undefined\n prefetchHref: null\n setOptimisticLinkStatus: (status: { pending: boolean }) => void\n}\n\ntype PrefetchableInstance = PrefetchableLinkInstance | FormInstance\n\nexport type LinkInstance =\n | PrefetchableLinkInstance\n | NonPrefetchableLinkInstance\n\n// Tracks the most recently navigated link instance. When null, indicates\n// the current navigation was not initiated by a link click.\nlet linkForMostRecentNavigation: LinkInstance | null = null\n\n// Status object indicating link is pending\nexport const PENDING_LINK_STATUS = { pending: true }\n\n// Status object indicating link is idle\nexport const IDLE_LINK_STATUS = { pending: false }\n\n// Updates the loading state when navigating between links\n// - Resets the previous link's loading state\n// - Sets the new link's loading state\n// - Updates tracking of current navigation\nexport function setLinkForCurrentNavigation(link: LinkInstance | null) {\n startTransition(() => {\n linkForMostRecentNavigation?.setOptimisticLinkStatus(IDLE_LINK_STATUS)\n link?.setOptimisticLinkStatus(PENDING_LINK_STATUS)\n linkForMostRecentNavigation = link\n })\n}\n\n// Unmounts the current link instance from navigation tracking\nexport function unmountLinkForCurrentNavigation(link: LinkInstance) {\n if (linkForMostRecentNavigation === link) {\n linkForMostRecentNavigation = null\n }\n}\n\n/**\n * Returns the link instance that initiated the most recent navigation.\n * Returns null if the navigation was not initiated by a link click.\n *\n * Used by the Instant Navigation Testing API in dev mode to match the\n * fetch strategy of the link during cache-miss navigations.\n */\nexport function getLinkForCurrentNavigation(): LinkInstance | null {\n return linkForMostRecentNavigation\n}\n\n// Use a WeakMap to associate a Link instance with its DOM element. This is\n// used by the IntersectionObserver to track the link's visibility.\nconst prefetchable:\n | WeakMap<Element, PrefetchableInstance>\n | Map<Element, PrefetchableInstance> =\n typeof WeakMap === 'function' ? new WeakMap() : new Map()\n\n// A Set of the currently visible links. We re-prefetch visible links after a\n// cache invalidation, or when the current URL changes. It's a separate data\n// structure from the WeakMap above because only the visible links need to\n// be enumerated.\nconst prefetchableAndVisible: Set<PrefetchableInstance> = new Set()\n\n// A single IntersectionObserver instance shared by all <Link> components.\nconst observer: IntersectionObserver | null =\n typeof IntersectionObserver === 'function'\n ? new IntersectionObserver(handleIntersect, {\n rootMargin: '200px',\n })\n : null\n\nfunction observeVisibility(element: Element, instance: PrefetchableInstance) {\n const existingInstance = prefetchable.get(element)\n if (existingInstance !== undefined) {\n // This shouldn't happen because each <Link> component should have its own\n // anchor tag instance, but it's defensive coding to avoid a memory leak in\n // case there's a logical error somewhere else.\n unmountPrefetchableInstance(element)\n }\n // Only track prefetchable links that have a valid prefetch URL\n prefetchable.set(element, instance)\n if (observer !== null) {\n observer.observe(element)\n }\n}\n\nfunction coercePrefetchableUrl(href: string): URL | null {\n if (typeof window !== 'undefined') {\n const { createPrefetchURL } =\n require('./app-router-utils') as typeof import('./app-router-utils')\n\n try {\n return createPrefetchURL(href)\n } catch {\n // createPrefetchURL sometimes throws an error if an invalid URL is\n // provided, though I'm not sure if it's actually necessary.\n // TODO: Consider removing the throw from the inner function, or change it\n // to reportError. Or maybe the error isn't even necessary for automatic\n // prefetches, just navigations.\n const reportErrorFn =\n typeof reportError === 'function' ? reportError : console.error\n reportErrorFn(\n `Cannot prefetch '${href}' because it cannot be converted to a URL.`\n )\n return null\n }\n } else {\n return null\n }\n}\n\nexport function mountLinkInstance(\n element: LinkElement,\n href: string,\n router: AppRouterInstance,\n fetchStrategy: PrefetchTaskFetchStrategy,\n prefetchEnabled: boolean,\n setOptimisticLinkStatus: (status: { pending: boolean }) => void,\n ownerStack: string | null | undefined\n): LinkInstance {\n if (prefetchEnabled) {\n const prefetchURL = coercePrefetchableUrl(href)\n if (prefetchURL !== null) {\n const instance: PrefetchableLinkInstance = {\n router,\n fetchStrategy,\n isVisible: false,\n prefetchTask: null,\n prefetchHref: prefetchURL.href,\n setOptimisticLinkStatus,\n ownerStack,\n }\n // We only observe the link's visibility if it's prefetchable. For\n // example, this excludes links to external URLs.\n observeVisibility(element, instance)\n return instance\n }\n }\n // If the link is not prefetchable, we still create an instance so we can\n // track its optimistic state (i.e. useLinkStatus).\n const instance: NonPrefetchableLinkInstance = {\n router,\n fetchStrategy,\n isVisible: false,\n prefetchTask: null,\n prefetchHref: null,\n setOptimisticLinkStatus,\n ownerStack,\n }\n return instance\n}\n\nexport function mountFormInstance(\n element: HTMLFormElement,\n href: string,\n router: AppRouterInstance,\n fetchStrategy: PrefetchTaskFetchStrategy\n): void {\n const prefetchURL = coercePrefetchableUrl(href)\n if (prefetchURL === null) {\n // This href is not prefetchable, so we don't track it.\n // TODO: We currently observe/unobserve a form every time its href changes.\n // For Links, this isn't a big deal because the href doesn't usually change,\n // but for forms it's extremely common. We should optimize this.\n return\n }\n const instance: FormInstance = {\n router,\n fetchStrategy,\n isVisible: false,\n prefetchTask: null,\n prefetchHref: prefetchURL.href,\n setOptimisticLinkStatus: null,\n }\n observeVisibility(element, instance)\n}\n\nexport function unmountPrefetchableInstance(element: Element) {\n const instance = prefetchable.get(element)\n if (instance !== undefined) {\n prefetchable.delete(element)\n prefetchableAndVisible.delete(instance)\n const prefetchTask = instance.prefetchTask\n if (prefetchTask !== null) {\n cancelPrefetchTask(prefetchTask)\n }\n }\n if (observer !== null) {\n observer.unobserve(element)\n }\n}\n\nfunction handleIntersect(entries: Array<IntersectionObserverEntry>) {\n for (const entry of entries) {\n // Some extremely old browsers or polyfills don't reliably support\n // isIntersecting so we check intersectionRatio instead. (Do we care? Not\n // really. But whatever this is fine.)\n const isVisible = entry.intersectionRatio > 0\n onLinkVisibilityChanged(entry.target as HTMLAnchorElement, isVisible)\n }\n}\n\nexport function onLinkVisibilityChanged(element: Element, isVisible: boolean) {\n if (process.env.NODE_ENV !== 'production') {\n // Prefetching on viewport is disabled in development for performance\n // reasons, because it requires compiling the target page.\n // TODO: Investigate re-enabling this.\n return\n }\n\n const instance = prefetchable.get(element)\n if (instance === undefined) {\n return\n }\n\n instance.isVisible = isVisible\n if (isVisible) {\n prefetchableAndVisible.add(instance)\n } else {\n prefetchableAndVisible.delete(instance)\n }\n rescheduleLinkPrefetch(instance, PrefetchPriority.Default)\n}\n\nexport function onNavigationIntent(\n element: HTMLAnchorElement | SVGAElement,\n unstable_upgradeToDynamicPrefetch: boolean\n) {\n const instance = prefetchable.get(element)\n if (instance === undefined) {\n return\n }\n // Prefetch the link on hover/touchstart.\n if (instance !== undefined) {\n if (\n process.env.__NEXT_DYNAMIC_ON_HOVER &&\n unstable_upgradeToDynamicPrefetch\n ) {\n // Switch to a full prefetch\n instance.fetchStrategy = FetchStrategy.Full\n }\n rescheduleLinkPrefetch(instance, PrefetchPriority.Intent)\n }\n}\n\nfunction rescheduleLinkPrefetch(\n instance: PrefetchableInstance,\n priority: PrefetchPriority.Default | PrefetchPriority.Intent\n) {\n // Ensures that app-router-instance is not compiled in the server bundle\n if (typeof window !== 'undefined') {\n const existingPrefetchTask = instance.prefetchTask\n\n if (!instance.isVisible) {\n // Cancel any in-progress prefetch task. (If it already finished then this\n // is a no-op.)\n if (existingPrefetchTask !== null) {\n cancelPrefetchTask(existingPrefetchTask)\n }\n // We don't need to reset the prefetchTask to null upon cancellation; an\n // old task object can be rescheduled with reschedulePrefetchTask. This is a\n // micro-optimization but also makes the code simpler (don't need to\n // worry about whether an old task object is stale).\n return\n }\n\n const { getCurrentAppRouterState } =\n require('./app-router-instance') as typeof import('./app-router-instance')\n\n const appRouterState = getCurrentAppRouterState()\n if (appRouterState !== null) {\n const treeAtTimeOfPrefetch = appRouterState.tree\n if (existingPrefetchTask === null) {\n // Initiate a prefetch task.\n const nextUrl = appRouterState.nextUrl\n const cacheKey = createCacheKey(instance.prefetchHref, nextUrl)\n instance.prefetchTask = scheduleSegmentPrefetchTask(\n cacheKey,\n treeAtTimeOfPrefetch,\n instance.fetchStrategy,\n priority,\n null\n )\n } else {\n // We already have an old task object that we can reschedule. This is\n // effectively the same as canceling the old task and creating a new one.\n reschedulePrefetchTask(\n existingPrefetchTask,\n treeAtTimeOfPrefetch,\n instance.fetchStrategy,\n priority\n )\n }\n }\n }\n}\n\nexport function pingVisibleLinks(\n nextUrl: string | null,\n tree: FlightRouterState\n) {\n // For each currently visible link, cancel the existing prefetch task (if it\n // exists) and schedule a new one. This is effectively the same as if all the\n // visible links left and then re-entered the viewport.\n //\n // This is called when the Next-Url or the base tree changes, since those\n // may affect the result of a prefetch task. It's also called after a\n // cache invalidation.\n for (const instance of prefetchableAndVisible) {\n const task = instance.prefetchTask\n if (task !== null && !isPrefetchTaskDirty(task, nextUrl, tree)) {\n // The cache has not been invalidated, and none of the inputs have\n // changed. Bail out.\n continue\n }\n // Something changed. Cancel the existing prefetch task and schedule a\n // new one.\n if (task !== null) {\n cancelPrefetchTask(task)\n }\n const cacheKey = createCacheKey(instance.prefetchHref, nextUrl)\n instance.prefetchTask = scheduleSegmentPrefetchTask(\n cacheKey,\n tree,\n instance.fetchStrategy,\n PrefetchPriority.Default,\n null\n )\n }\n}\n"],"names":["FetchStrategy","PrefetchPriority","createCacheKey","schedulePrefetchTask","scheduleSegmentPrefetchTask","cancelPrefetchTask","reschedulePrefetchTask","isPrefetchTaskDirty","startTransition","linkForMostRecentNavigation","PENDING_LINK_STATUS","pending","IDLE_LINK_STATUS","setLinkForCurrentNavigation","link","setOptimisticLinkStatus","unmountLinkForCurrentNavigation","getLinkForCurrentNavigation","prefetchable","WeakMap","Map","prefetchableAndVisible","Set","observer","IntersectionObserver","handleIntersect","rootMargin","observeVisibility","element","instance","existingInstance","get","undefined","unmountPrefetchableInstance","set","observe","coercePrefetchableUrl","href","window","createPrefetchURL","require","reportErrorFn","reportError","console","error","mountLinkInstance","router","fetchStrategy","prefetchEnabled","ownerStack","prefetchURL","isVisible","prefetchTask","prefetchHref","mountFormInstance","delete","unobserve","entries","entry","intersectionRatio","onLinkVisibilityChanged","target","process","env","NODE_ENV","add","rescheduleLinkPrefetch","Default","onNavigationIntent","unstable_upgradeToDynamicPrefetch","__NEXT_DYNAMIC_ON_HOVER","Full","Intent","priority","existingPrefetchTask","getCurrentAppRouterState","appRouterState","treeAtTimeOfPrefetch","tree","nextUrl","cacheKey","pingVisibleLinks","task"],"mappings":"AAEA,SACEA,aAAa,EAEbC,gBAAgB,QACX,wBAAuB;AAC9B,SAASC,cAAc,QAAQ,4BAA2B;AAC1D,SAEEC,wBAAwBC,2BAA2B,EACnDC,kBAAkB,EAClBC,sBAAsB,EACtBC,mBAAmB,QACd,4BAA2B;AAClC,SAASC,eAAe,QAAQ,QAAO;AAmDvC,yEAAyE;AACzE,4DAA4D;AAC5D,IAAIC,8BAAmD;AAEvD,2CAA2C;AAC3C,OAAO,MAAMC,sBAAsB;IAAEC,SAAS;AAAK,EAAC;AAEpD,wCAAwC;AACxC,OAAO,MAAMC,mBAAmB;IAAED,SAAS;AAAM,EAAC;AAElD,0DAA0D;AAC1D,6CAA6C;AAC7C,sCAAsC;AACtC,2CAA2C;AAC3C,OAAO,SAASE,4BAA4BC,IAAyB;IACnEN,gBAAgB;QACdC,6BAA6BM,wBAAwBH;QACrDE,MAAMC,wBAAwBL;QAC9BD,8BAA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QAAQ;QAEV,MAAMoC,iBAAiBD;QACvB,IAAIC,mBAAmB,MAAM;YAC3B,MAAMC,uBAAuBD,eAAeE,IAAI;YAChD,IAAIJ,yBAAyB,MAAM;gBACjC,4BAA4B;gBAC5B,MAAMK,UAAUH,eAAeG,OAAO;gBACtC,MAAMC,WAAW9E,eAAe2B,SAASwB,YAAY,EAAE0B;gBACvDlD,SAASuB,YAAY,GAAGhD,4BACtB4E,UACAH,sBACAhD,SAASkB,aAAa,EACtB0B,UACA;YAEJ,OAAO;gBACL,qEAAqE;gBACrE,yEAAyE;gBACzEnE,uBACEoE,sBACAG,sBACAhD,SAASkB,aAAa,EACtB0B;YAEJ;QACF;IACF;AACF;AAEA,OAAO,SAASQ,iBACdF,OAAsB,EACtBD,IAAuB;IAEvB,4EAA4E;IAC5E,6EAA6E;IAC7E,uDAAuD;IACvD,EAAE;IACF,yEAAyE;IACzE,qEAAqE;IACrE,sBAAsB;IACtB,KAAK,MAAMjD,YAAYR,uBAAwB;QAC7C,MAAM6D,OAAOrD,SAASuB,YAAY;QAClC,IAAI8B,SAAS,QAAQ,CAAC3E,oBAAoB2E,MAAMH,SAASD,OAAO;YAG9D;QACF;QACA,sEAAsE;QACtE,WAAW;QACX,IAAII,SAAS,MAAM;YACjB7E,mBAAmB6E;QACrB;QACA,MAAMF,WAAW9E,eAAe2B,SAASwB,YAAY,EAAE0B;QACvDlD,SAASuB,YAAY,GAAGhD,4BACtB4E,UACAF,MACAjD,SAASkB,aAAa,EACtB9C,iBAAiBkE,OAAO,EACxB;IAEJ;AACF","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/client/components/links.ts"],"sourcesContent":["import type { FlightRouterState } from '../../shared/lib/app-router-types'\nimport type { AppRouterInstance } from '../../shared/lib/app-router-context.shared-runtime'\nimport {\n FetchStrategy,\n type PrefetchTaskFetchStrategy,\n PrefetchPriority,\n} from './segment-cache/types'\nimport { createCacheKey } from './segment-cache/cache-key'\nimport {\n type PrefetchTask,\n schedulePrefetchTask as scheduleSegmentPrefetchTask,\n cancelPrefetchTask,\n reschedulePrefetchTask,\n isPrefetchTaskDirty,\n} from './segment-cache/scheduler'\nimport { startTransition } from 'react'\n\ntype LinkElement = HTMLAnchorElement | SVGAElement\n\ntype Element = LinkElement | HTMLFormElement\n\n// Properties that are shared between Link and Form instances. We use the same\n// shape for both to prevent a polymorphic de-opt in the VM.\ntype LinkOrFormInstanceShared = {\n router: AppRouterInstance\n fetchStrategy: PrefetchTaskFetchStrategy\n\n isVisible: boolean\n\n // The most recently initiated prefetch task. It may or may not have\n // already completed. The same prefetch task object can be reused across\n // multiple prefetches of the same link.\n prefetchTask: PrefetchTask | null\n}\n\nexport type FormInstance = LinkOrFormInstanceShared & {\n prefetchHref: string\n setOptimisticLinkStatus: null\n}\n\ntype PrefetchableLinkInstance = LinkOrFormInstanceShared & {\n // In dev, the Owner Stack captured at the time this Link was rendered, for\n // configurations where a warning might later fire.\n // `undefined` means we opted out of capturing the stack.\n // If you issue a warning, handle the `undefined` case separately\n // so it's clear in the logs when a warning is missing its source location.\n // A warning with an undefined ownerStack is considered a bug though so make\n // sure reaching the log site is a subset of codepaths that lead to capturing\n // the stack\n ownerStack: string | null | undefined\n prefetchHref: string\n setOptimisticLinkStatus: (status: { pending: boolean }) => void\n}\n\ntype NonPrefetchableLinkInstance = LinkOrFormInstanceShared & {\n ownerStack: string | null | undefined\n prefetchHref: null\n setOptimisticLinkStatus: (status: { pending: boolean }) => void\n}\n\ntype PrefetchableInstance = PrefetchableLinkInstance | FormInstance\n\nexport type LinkInstance =\n | PrefetchableLinkInstance\n | NonPrefetchableLinkInstance\n\n// Tracks the most recently navigated link instance. When null, indicates\n// the current navigation was not initiated by a link click.\nlet linkForMostRecentNavigation: LinkInstance | null = null\n\n// Status object indicating link is pending\nexport const PENDING_LINK_STATUS = { pending: true }\n\n// Status object indicating link is idle\nexport const IDLE_LINK_STATUS = { pending: false }\n\n// Updates the loading state when navigating between links\n// - Resets the previous link's loading state\n// - Sets the new link's loading state\n// - Updates tracking of current navigation\nexport function setLinkForCurrentNavigation(link: LinkInstance | null) {\n startTransition(() => {\n linkForMostRecentNavigation?.setOptimisticLinkStatus(IDLE_LINK_STATUS)\n link?.setOptimisticLinkStatus(PENDING_LINK_STATUS)\n linkForMostRecentNavigation = link\n })\n}\n\n// Unmounts the current link instance from navigation tracking\nexport function unmountLinkForCurrentNavigation(link: LinkInstance) {\n if (linkForMostRecentNavigation === link) {\n linkForMostRecentNavigation = null\n }\n}\n\n/**\n * Returns the link instance that initiated the most recent navigation.\n * Returns null if the navigation was not initiated by a link click.\n *\n * Used by the Instant Navigation Testing API in dev mode to match the\n * fetch strategy of the link during cache-miss navigations.\n */\nexport function getLinkForCurrentNavigation(): LinkInstance | null {\n return linkForMostRecentNavigation\n}\n\n// Use a WeakMap to associate a Link instance with its DOM element. This is\n// used by the IntersectionObserver to track the link's visibility.\nconst prefetchable:\n | WeakMap<Element, PrefetchableInstance>\n | Map<Element, PrefetchableInstance> =\n typeof WeakMap === 'function' ? new WeakMap() : new Map()\n\n// A Set of the currently visible links. We re-prefetch visible links after a\n// cache invalidation, or when the current URL changes. It's a separate data\n// structure from the WeakMap above because only the visible links need to\n// be enumerated.\nconst prefetchableAndVisible: Set<PrefetchableInstance> = new Set()\n\n// A single IntersectionObserver instance shared by all <Link> components.\nconst observer: IntersectionObserver | null =\n typeof IntersectionObserver === 'function'\n ? new IntersectionObserver(handleIntersect, {\n rootMargin: '200px',\n })\n : null\n\nfunction observeVisibility(element: Element, instance: PrefetchableInstance) {\n const existingInstance = prefetchable.get(element)\n if (existingInstance !== undefined) {\n // This shouldn't happen because each <Link> component should have its own\n // anchor tag instance, but it's defensive coding to avoid a memory leak in\n // case there's a logical error somewhere else.\n unmountPrefetchableInstance(element)\n }\n // Only track prefetchable links that have a valid prefetch URL\n prefetchable.set(element, instance)\n if (observer !== null) {\n observer.observe(element)\n }\n}\n\nfunction coercePrefetchableUrl(href: string): URL | null {\n if (typeof window !== 'undefined') {\n const { createPrefetchURL } =\n require('./app-router-utils') as typeof import('./app-router-utils')\n\n try {\n return createPrefetchURL(href)\n } catch {\n // createPrefetchURL sometimes throws an error if an invalid URL is\n // provided, though I'm not sure if it's actually necessary.\n // TODO: Consider removing the throw from the inner function, or change it\n // to reportError. Or maybe the error isn't even necessary for automatic\n // prefetches, just navigations.\n const reportErrorFn =\n typeof reportError === 'function' ? reportError : console.error\n reportErrorFn(\n `Cannot prefetch '${href}' because it cannot be converted to a URL.`\n )\n return null\n }\n } else {\n return null\n }\n}\n\nexport function mountLinkInstance(\n element: LinkElement,\n href: string,\n router: AppRouterInstance,\n fetchStrategy: PrefetchTaskFetchStrategy,\n prefetchEnabled: boolean,\n setOptimisticLinkStatus: (status: { pending: boolean }) => void,\n ownerStack: string | null | undefined\n): LinkInstance {\n if (prefetchEnabled) {\n const prefetchURL = coercePrefetchableUrl(href)\n if (prefetchURL !== null) {\n const instance: PrefetchableLinkInstance = {\n router,\n fetchStrategy,\n isVisible: false,\n prefetchTask: null,\n prefetchHref: prefetchURL.href,\n setOptimisticLinkStatus,\n ownerStack,\n }\n // We only observe the link's visibility if it's prefetchable. For\n // example, this excludes links to external URLs.\n observeVisibility(element, instance)\n return instance\n }\n }\n // If the link is not prefetchable, we still create an instance so we can\n // track its optimistic state (i.e. useLinkStatus).\n const instance: NonPrefetchableLinkInstance = {\n router,\n fetchStrategy,\n isVisible: false,\n prefetchTask: null,\n prefetchHref: null,\n setOptimisticLinkStatus,\n ownerStack,\n }\n return instance\n}\n\nexport function mountFormInstance(\n element: HTMLFormElement,\n href: string,\n router: AppRouterInstance,\n fetchStrategy: PrefetchTaskFetchStrategy\n): void {\n const prefetchURL = coercePrefetchableUrl(href)\n if (prefetchURL === null) {\n // This href is not prefetchable, so we don't track it.\n // TODO: We currently observe/unobserve a form every time its href changes.\n // For Links, this isn't a big deal because the href doesn't usually change,\n // but for forms it's extremely common. We should optimize this.\n return\n }\n const instance: FormInstance = {\n router,\n fetchStrategy,\n isVisible: false,\n prefetchTask: null,\n prefetchHref: prefetchURL.href,\n setOptimisticLinkStatus: null,\n }\n observeVisibility(element, instance)\n}\n\nexport function unmountPrefetchableInstance(element: Element) {\n const instance = prefetchable.get(element)\n if (instance !== undefined) {\n prefetchable.delete(element)\n prefetchableAndVisible.delete(instance)\n const prefetchTask = instance.prefetchTask\n if (prefetchTask !== null) {\n cancelPrefetchTask(prefetchTask)\n }\n }\n if (observer !== null) {\n observer.unobserve(element)\n }\n}\n\nfunction handleIntersect(entries: Array<IntersectionObserverEntry>) {\n for (const entry of entries) {\n // Some extremely old browsers or polyfills don't reliably support\n // isIntersecting so we check intersectionRatio instead. (Do we care? Not\n // really. But whatever this is fine.)\n const isVisible = entry.intersectionRatio > 0\n onLinkVisibilityChanged(entry.target as HTMLAnchorElement, isVisible)\n }\n}\n\nexport function onLinkVisibilityChanged(element: Element, isVisible: boolean) {\n if (process.env.NODE_ENV !== 'production') {\n // Prefetching on viewport is disabled in development for performance\n // reasons, because it requires compiling the target page.\n // TODO: Investigate re-enabling this.\n return\n }\n\n const instance = prefetchable.get(element)\n if (instance === undefined) {\n return\n }\n\n instance.isVisible = isVisible\n if (isVisible) {\n prefetchableAndVisible.add(instance)\n } else {\n prefetchableAndVisible.delete(instance)\n }\n rescheduleLinkPrefetch(instance, PrefetchPriority.Default)\n}\n\nexport function onNavigationIntent(\n element: HTMLAnchorElement | SVGAElement,\n unstable_upgradeToDynamicPrefetch: boolean\n) {\n const instance = prefetchable.get(element)\n if (instance === undefined) {\n return\n }\n // Prefetch the link on hover/touchstart.\n if (instance !== undefined) {\n if (\n process.env.__NEXT_DYNAMIC_ON_HOVER &&\n unstable_upgradeToDynamicPrefetch\n ) {\n // Switch to a full prefetch\n instance.fetchStrategy = FetchStrategy.Full\n }\n rescheduleLinkPrefetch(instance, PrefetchPriority.Intent)\n }\n}\n\nfunction rescheduleLinkPrefetch(\n instance: PrefetchableInstance,\n priority: PrefetchPriority.Default | PrefetchPriority.Intent\n) {\n // Ensures that app-router-instance is not compiled in the server bundle\n if (typeof window !== 'undefined') {\n const existingPrefetchTask = instance.prefetchTask\n\n if (!instance.isVisible) {\n // Cancel any in-progress prefetch task. (If it already finished then this\n // is a no-op.)\n if (existingPrefetchTask !== null) {\n cancelPrefetchTask(existingPrefetchTask)\n }\n // We don't need to reset the prefetchTask to null upon cancellation; an\n // old task object can be rescheduled with reschedulePrefetchTask. This is a\n // micro-optimization but also makes the code simpler (don't need to\n // worry about whether an old task object is stale).\n return\n }\n\n const { getCurrentAppRouterState } =\n require('./app-router-instance') as typeof import('./app-router-instance')\n\n const appRouterState = getCurrentAppRouterState()\n if (appRouterState !== null) {\n const treeAtTimeOfPrefetch = appRouterState.tree\n if (existingPrefetchTask === null) {\n // Initiate a prefetch task.\n const nextUrl = appRouterState.nextUrl\n const cacheKey = createCacheKey(instance.prefetchHref, nextUrl)\n instance.prefetchTask = scheduleSegmentPrefetchTask(\n cacheKey,\n treeAtTimeOfPrefetch,\n instance.fetchStrategy,\n priority,\n null,\n null // navigationLockPrefetch\n )\n } else {\n // We already have an old task object that we can reschedule. This is\n // effectively the same as canceling the old task and creating a new one.\n reschedulePrefetchTask(\n existingPrefetchTask,\n treeAtTimeOfPrefetch,\n instance.fetchStrategy,\n priority\n )\n }\n }\n }\n}\n\nexport function pingVisibleLinks(\n nextUrl: string | null,\n tree: FlightRouterState\n) {\n // For each currently visible link, cancel the existing prefetch task (if it\n // exists) and schedule a new one. This is effectively the same as if all the\n // visible links left and then re-entered the viewport.\n //\n // This is called when the Next-Url or the base tree changes, since those\n // may affect the result of a prefetch task. It's also called after a\n // cache invalidation.\n for (const instance of prefetchableAndVisible) {\n const task = instance.prefetchTask\n if (task !== null && !isPrefetchTaskDirty(task, nextUrl, tree)) {\n // The cache has not been invalidated, and none of the inputs have\n // changed. Bail out.\n continue\n }\n // Something changed. Cancel the existing prefetch task and schedule a\n // new one.\n if (task !== null) {\n cancelPrefetchTask(task)\n }\n const cacheKey = createCacheKey(instance.prefetchHref, nextUrl)\n instance.prefetchTask = scheduleSegmentPrefetchTask(\n cacheKey,\n tree,\n instance.fetchStrategy,\n PrefetchPriority.Default,\n null,\n null // navigationLockPrefetch\n )\n }\n}\n"],"names":["FetchStrategy","PrefetchPriority","createCacheKey","schedulePrefetchTask","scheduleSegmentPrefetchTask","cancelPrefetchTask","reschedulePrefetchTask","isPrefetchTaskDirty","startTransition","linkForMostRecentNavigation","PENDING_LINK_STATUS","pending","IDLE_LINK_STATUS","setLinkForCurrentNavigation","link","setOptimisticLinkStatus","unmountLinkForCurrentNavigation","getLinkForCurrentNavigation","prefetchable","WeakMap","Map","prefetchableAndVisible","Set","observer","IntersectionObserver","handleIntersect","rootMargin","observeVisibility","element","instance","existingInstance","get","undefined","unmountPrefetchableInstance","set","observe","coercePrefetchableUrl","href","window","createPrefetchURL","require","reportErrorFn","reportError","console","error","mountLinkInstance","router","fetchStrategy","prefetchEnabled","ownerStack","prefetchURL","isVisible","prefetchTask","prefetchHref","mountFormInstance","delete","unobserve","entries","entry","intersectionRatio","onLinkVisibilityChanged","target","process","env","NODE_ENV","add","rescheduleLinkPrefetch","Default","onNavigationIntent","unstable_upgradeToDynamicPrefetch","__NEXT_DYNAMIC_ON_HOVER","Full","Intent","priority","existingPrefetchTask","getCurrentAppRouterState","appRouterState","treeAtTimeOfPrefetch","tree","nextUrl","cacheKey","pingVisibleLinks","task"],"mappings":"AAEA,SACEA,aAAa,EAEbC,gBAAgB,QACX,wBAAuB;AAC9B,SAASC,cAAc,QAAQ,4BAA2B;AAC1D,SAEEC,wBAAwBC,2BAA2B,EACnDC,kBAAkB,EAClBC,sBAAsB,EACtBC,mBAAmB,QACd,4BAA2B;AAClC,SAASC,eAAe,QAAQ,QAAO;AAmDvC,yEAAyE;AACzE,4DAA4D;AAC5D,IAAIC,8BAAmD;AAEvD,2CAA2C;AAC3C,OAAO,MAAMC,sBAAsB;IAAEC,SAAS;AAAK,EAAC;AAEpD,wCAAwC;AACxC,OAAO,MAA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 -34,3 +34,4 @@ import { extractPathFromFlightRouterState } from '../compute-changed-path'; | ||
| const restoreSeed = convertServerPatchToFullTree(now, treeToRestore, null, renderedSearch, UnknownDynamicStaleTime); | ||
| const task = startPPRNavigation(now, currentUrl, state.renderedSearch, state.cache, state.tree, restoreSeed.routeTree, restoreSeed.metadataVaryPath, FreshnessPolicy.HistoryTraversal, null, null, restoreSeed.dynamicStaleAt, false, accumulation); | ||
| const task = startPPRNavigation(now, currentUrl, state.renderedSearch, state.cache, state.tree, restoreSeed.routeTree, restoreSeed.metadataVaryPath, FreshnessPolicy.HistoryTraversal, null, null, restoreSeed.dynamicStaleAt, false, accumulation, // A history-traversal restore never restricts to the shell. | ||
| false); | ||
| if (task === null) { | ||
@@ -37,0 +38,0 @@ return completeHardNavigation(state, restoredUrl, 'replace'); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../../../src/client/components/router-reducer/reducers/restore-reducer.ts"],"sourcesContent":["import type {\n ReadonlyReducerState,\n ReducerState,\n RestoreAction,\n} from '../router-reducer-types'\nimport { extractPathFromFlightRouterState } from '../compute-changed-path'\nimport {\n FreshnessPolicy,\n getCurrentNavigationLock,\n spawnDynamicRequests,\n startPPRNavigation,\n type NavigationRequestAccumulation,\n} from '../ppr-navigations'\nimport type { FlightRouterState } from '../../../../shared/lib/app-router-types'\nimport {\n completeHardNavigation,\n completeTraverseNavigation,\n convertServerPatchToFullTree,\n} from '../../segment-cache/navigation'\nimport { UnknownDynamicStaleTime } from '../../segment-cache/bfcache'\n\nexport function restoreReducer(\n state: ReadonlyReducerState,\n action: RestoreAction\n): ReducerState {\n // This action is used to restore the router state from the history state.\n // However, it's possible that the history state no longer contains the `FlightRouterState`.\n // We will copy over the internal state on pushState/replaceState events, but if a history entry\n // occurred before hydration, or if the user navigated to a hash using a regular anchor link,\n // the history state will not contain the `FlightRouterState`.\n // In this case, we'll continue to use the existing tree so the router doesn't get into an invalid state.\n let treeToRestore: FlightRouterState | undefined\n let renderedSearch: string | undefined\n const historyState = action.historyState\n if (historyState) {\n treeToRestore = historyState.tree\n renderedSearch = historyState.renderedSearch\n } else {\n treeToRestore = state.tree\n renderedSearch = state.renderedSearch\n }\n\n const currentUrl = new URL(state.canonicalUrl, location.origin)\n const restoredUrl = action.url\n const restoredNextUrl =\n extractPathFromFlightRouterState(treeToRestore) ?? restoredUrl.pathname\n const navigationLock = getCurrentNavigationLock()\n\n const now = Date.now()\n // TODO: Store the dynamic stale time on the top-level state so it's known\n // during restores and refreshes.\n const accumulation: NavigationRequestAccumulation = {\n separateRefreshUrls: null,\n scrollRef: null,\n }\n const restoreSeed = convertServerPatchToFullTree(\n now,\n treeToRestore,\n null,\n renderedSearch,\n UnknownDynamicStaleTime\n )\n const task = startPPRNavigation(\n now,\n currentUrl,\n state.renderedSearch,\n state.cache,\n state.tree,\n restoreSeed.routeTree,\n restoreSeed.metadataVaryPath,\n FreshnessPolicy.HistoryTraversal,\n null,\n null,\n restoreSeed.dynamicStaleAt,\n false,\n accumulation\n )\n\n if (task === null) {\n return completeHardNavigation(state, restoredUrl, 'replace')\n }\n spawnDynamicRequests(\n task,\n restoredUrl,\n restoredNextUrl,\n FreshnessPolicy.HistoryTraversal,\n accumulation,\n // History traversal doesn't use route prediction, so there's no route\n // cache entry to mark as having a dynamic rewrite on mismatch. If a\n // mismatch occurs, the retry handler will traverse the known route tree\n // to find and mark the entry.\n null,\n // History traversal always uses 'replace'.\n 'replace',\n navigationLock\n )\n return completeTraverseNavigation(\n state,\n restoredUrl,\n renderedSearch,\n task.node,\n task.route,\n restoredNextUrl\n )\n}\n"],"names":["extractPathFromFlightRouterState","FreshnessPolicy","getCurrentNavigationLock","spawnDynamicRequests","startPPRNavigation","completeHardNavigation","completeTraverseNavigation","convertServerPatchToFullTree","UnknownDynamicStaleTime","restoreReducer","state","action","treeToRestore","renderedSearch","historyState","tree","currentUrl","URL","canonicalUrl","location","origin","restoredUrl","url","restoredNextUrl","pathname","navigationLock","now","Date","accumulation","separateRefreshUrls","scrollRef","restoreSeed","task","cache","routeTree","metadataVaryPath","HistoryTraversal","dynamicStaleAt","node","route"],"mappings":"AAKA,SAASA,gCAAgC,QAAQ,0BAAyB;AAC1E,SACEC,eAAe,EACfC,wBAAwB,EACxBC,oBAAoB,EACpBC,kBAAkB,QAEb,qBAAoB;AAE3B,SACEC,sBAAsB,EACtBC,0BAA0B,EAC1BC,4BAA4B,QACvB,iCAAgC;AACvC,SAASC,uBAAuB,QAAQ,8BAA6B;AAErE,OAAO,SAASC,eACdC,KAA2B,EAC3BC,MAAqB;IAErB,0EAA0E;IAC1E,4FAA4F;IAC5F,gGAAgG;IAChG,6FAA6F;IAC7F,8DAA8D;IAC9D,yGAAyG;IACzG,IAAIC;IACJ,IAAIC;IACJ,MAAMC,eAAeH,OAAOG,YAAY;IACxC,IAAIA,cAAc;QAChBF,gBAAgBE,aAAaC,IAAI;QACjCF,iBAAiBC,aAAaD,cAAc;IAC9C,OAAO;QACLD,gBAAgBF,MAAMK,IAAI;QAC1BF,iBAAiBH,MAAMG,cAAc;IACvC;IAEA,MAAMG,aAAa,IAAIC,IAAIP,MAAMQ,YAAY,EAAEC,SAASC,MAAM;IAC9D,MAAMC,cAAcV,OAAOW,GAAG;IAC9B,MAAMC,kBACJvB,iCAAiCY,kBAAkBS,YAAYG,QAAQ;IACzE,MAAMC,iBAAiBvB;IAEvB,MAAMwB,MAAMC,KAAKD,GAAG;IACpB,0EAA0E;IAC1E,iCAAiC;IACjC,MAAME,eAA8C;QAClDC,qBAAqB;QACrBC,WAAW;IACb;IACA,MAAMC,cAAcxB,6BAClBmB,KACAd,eACA,MACAC,gBACAL;IAEF,MAAMwB,OAAO5B,mBACXsB,KACAV,YACAN,MAAMG,cAAc,EACpBH,MAAMuB,KAAK,EACXvB,MAAMK,IAAI,EACVgB,YAAYG,SAAS,EACrBH,YAAYI,gBAAgB,EAC5BlC,gBAAgBmC,gBAAgB,EAChC,MACA,MACAL,YAAYM,cAAc,EAC1B,OACAT;IAGF,IAAII,SAAS,MAAM;QACjB,OAAO3B,uBAAuBK,OAAOW,aAAa;IACpD;IACAlB,qBACE6B,MACAX,aACAE,iBACAtB,gBAAgBmC,gBAAgB,EAChCR,cACA,sEAAsE;IACtE,oEAAoE;IACpE,wEAAwE;IACxE,8BAA8B;IAC9B,MACA,2CAA2C;IAC3C,WACAH;IAEF,OAAOnB,2BACLI,OACAW,aACAR,gBACAmB,KAAKM,IAAI,EACTN,KAAKO,KAAK,EACVhB;AAEJ","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../../../src/client/components/router-reducer/reducers/restore-reducer.ts"],"sourcesContent":["import type {\n ReadonlyReducerState,\n ReducerState,\n RestoreAction,\n} from '../router-reducer-types'\nimport { extractPathFromFlightRouterState } from '../compute-changed-path'\nimport {\n FreshnessPolicy,\n getCurrentNavigationLock,\n spawnDynamicRequests,\n startPPRNavigation,\n type NavigationRequestAccumulation,\n} from '../ppr-navigations'\nimport type { FlightRouterState } from '../../../../shared/lib/app-router-types'\nimport {\n completeHardNavigation,\n completeTraverseNavigation,\n convertServerPatchToFullTree,\n} from '../../segment-cache/navigation'\nimport { UnknownDynamicStaleTime } from '../../segment-cache/bfcache'\n\nexport function restoreReducer(\n state: ReadonlyReducerState,\n action: RestoreAction\n): ReducerState {\n // This action is used to restore the router state from the history state.\n // However, it's possible that the history state no longer contains the `FlightRouterState`.\n // We will copy over the internal state on pushState/replaceState events, but if a history entry\n // occurred before hydration, or if the user navigated to a hash using a regular anchor link,\n // the history state will not contain the `FlightRouterState`.\n // In this case, we'll continue to use the existing tree so the router doesn't get into an invalid state.\n let treeToRestore: FlightRouterState | undefined\n let renderedSearch: string | undefined\n const historyState = action.historyState\n if (historyState) {\n treeToRestore = historyState.tree\n renderedSearch = historyState.renderedSearch\n } else {\n treeToRestore = state.tree\n renderedSearch = state.renderedSearch\n }\n\n const currentUrl = new URL(state.canonicalUrl, location.origin)\n const restoredUrl = action.url\n const restoredNextUrl =\n extractPathFromFlightRouterState(treeToRestore) ?? restoredUrl.pathname\n const navigationLock = getCurrentNavigationLock()\n\n const now = Date.now()\n // TODO: Store the dynamic stale time on the top-level state so it's known\n // during restores and refreshes.\n const accumulation: NavigationRequestAccumulation = {\n separateRefreshUrls: null,\n scrollRef: null,\n }\n const restoreSeed = convertServerPatchToFullTree(\n now,\n treeToRestore,\n null,\n renderedSearch,\n UnknownDynamicStaleTime\n )\n const task = startPPRNavigation(\n now,\n currentUrl,\n state.renderedSearch,\n state.cache,\n state.tree,\n restoreSeed.routeTree,\n restoreSeed.metadataVaryPath,\n FreshnessPolicy.HistoryTraversal,\n null,\n null,\n restoreSeed.dynamicStaleAt,\n false,\n accumulation,\n // A history-traversal restore never restricts to the shell.\n false\n )\n\n if (task === null) {\n return completeHardNavigation(state, restoredUrl, 'replace')\n }\n spawnDynamicRequests(\n task,\n restoredUrl,\n restoredNextUrl,\n FreshnessPolicy.HistoryTraversal,\n accumulation,\n // History traversal doesn't use route prediction, so there's no route\n // cache entry to mark as having a dynamic rewrite on mismatch. If a\n // mismatch occurs, the retry handler will traverse the known route tree\n // to find and mark the entry.\n null,\n // History traversal always uses 'replace'.\n 'replace',\n navigationLock\n )\n return completeTraverseNavigation(\n state,\n restoredUrl,\n renderedSearch,\n task.node,\n task.route,\n restoredNextUrl\n )\n}\n"],"names":["extractPathFromFlightRouterState","FreshnessPolicy","getCurrentNavigationLock","spawnDynamicRequests","startPPRNavigation","completeHardNavigation","completeTraverseNavigation","convertServerPatchToFullTree","UnknownDynamicStaleTime","restoreReducer","state","action","treeToRestore","renderedSearch","historyState","tree","currentUrl","URL","canonicalUrl","location","origin","restoredUrl","url","restoredNextUrl","pathname","navigationLock","now","Date","accumulation","separateRefreshUrls","scrollRef","restoreSeed","task","cache","routeTree","metadataVaryPath","HistoryTraversal","dynamicStaleAt","node","route"],"mappings":"AAKA,SAASA,gCAAgC,QAAQ,0BAAyB;AAC1E,SACEC,eAAe,EACfC,wBAAwB,EACxBC,oBAAoB,EACpBC,kBAA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E,wEAAwE;IACxE,8BAA8B;IAC9B,MACA,2CAA2C;IAC3C,WACAH;IAEF,OAAOnB,2BACLI,OACAW,aACAR,gBACAmB,KAAKM,IAAI,EACTN,KAAKO,KAAK,EACVhB;AAEJ","ignoreList":[0]} |
@@ -12,4 +12,7 @@ /** | ||
| * captured = self-write (ignored). | ||
| */ import { NEXT_INSTANT_TEST_COOKIE } from '../app-router-headers'; | ||
| */ import { PrefetchHint } from '../../../shared/lib/app-router-types'; | ||
| import { NEXT_INSTANT_TEST_COOKIE } from '../app-router-headers'; | ||
| import { refreshOnInstantNavigationUnlock } from '../use-action-queue'; | ||
| import { subtreeHasSpeculativePrefetch } from './scheduler'; | ||
| import { waitForSegmentCacheEntry } from './cache'; | ||
| function parseCookieValue(raw) { | ||
@@ -65,2 +68,86 @@ if (raw === '') { | ||
| } | ||
| /** | ||
| * Creates the "wait for prefetch to fulfill" state for one locked navigation, | ||
| * registers it on the current lock, and returns it (the caller stores it on the | ||
| * prefetch task and awaits `.promise`). Returns null if no lock is held. | ||
| * | ||
| * `pendingCount` starts at 1, representing the scheduler itself while it is | ||
| * still spawning requests; that reference is released by | ||
| * `finishNavigationLockPrefetchSpawning`. Each spawned pending entry adds | ||
| * another (see `trackNavigationLockPrefetchEntry`). `promise` resolves when the | ||
| * count drains to 0 — i.e. spawning finished and every entry fulfilled. | ||
| */ export function beginNavigationLockPrefetch() { | ||
| if (process.env.__NEXT_EXPOSE_TESTING_API && lockState !== null) { | ||
| let resolve; | ||
| const promise = new Promise((r)=>{ | ||
| resolve = r; | ||
| }); | ||
| const prefetch = { | ||
| promise, | ||
| resolve: resolve, | ||
| pendingCount: 1, | ||
| trackedEntries: new Set() | ||
| }; | ||
| lockState.activePrefetches.add(prefetch); | ||
| return prefetch; | ||
| } | ||
| return null; | ||
| } | ||
| /** | ||
| * Records a freshly-created segment entry as owned by the current lock scope, so | ||
| * navigation reads will match it — and only entries created within the scope | ||
| * (see `NavigationLockState.ownedEntries`). Called from | ||
| * `createDetachedSegmentCacheEntry`, the single factory every creation path | ||
| * funnels through, so re-keyed entries created during response processing (e.g. | ||
| * a runtime prefetch resolving a concrete param) are owned too. No-op when no | ||
| * lock is held. | ||
| */ export function recordNavigationLockOwnedEntry(entry) { | ||
| if (process.env.__NEXT_EXPOSE_TESTING_API && lockState !== null) { | ||
| lockState.ownedEntries.add(entry); | ||
| } | ||
| } | ||
| /** | ||
| * Called by `upgradeToPendingSegment` whenever the locked-navigation prefetch | ||
| * spawns a pending segment entry. Adds the entry to the prefetch's ref count and | ||
| * decrements when it fulfills (or rejects — `waitForSegmentCacheEntry` resolves | ||
| * to null). Deduped so the same entry never double-counts. | ||
| */ export function trackNavigationLockPrefetchEntry(prefetch, entry) { | ||
| if (process.env.__NEXT_EXPOSE_TESTING_API) { | ||
| if (prefetch.trackedEntries.has(entry)) { | ||
| return; | ||
| } | ||
| prefetch.trackedEntries.add(entry); | ||
| prefetch.pendingCount++; | ||
| const onSettled = ()=>{ | ||
| prefetch.pendingCount--; | ||
| settleNavigationLockPrefetchIfDrained(prefetch); | ||
| }; | ||
| // Decrement whether the entry fulfills or its request rejects, so a failed | ||
| // segment can't leave the navigation waiting forever. | ||
| waitForSegmentCacheEntry(entry).then(onSettled, onSettled); | ||
| } | ||
| } | ||
| /** | ||
| * Called once the scheduler has finished spawning every request for the | ||
| * locked-navigation prefetch, releasing the scheduler's reference from the ref | ||
| * count. The prefetch resolves here if every spawned entry already fulfilled. | ||
| */ export function finishNavigationLockPrefetchSpawning(prefetch) { | ||
| if (process.env.__NEXT_EXPOSE_TESTING_API) { | ||
| prefetch.pendingCount--; | ||
| settleNavigationLockPrefetchIfDrained(prefetch); | ||
| } | ||
| } | ||
| function settleNavigationLockPrefetchIfDrained(prefetch) { | ||
| if (process.env.__NEXT_EXPOSE_TESTING_API) { | ||
| if (prefetch.pendingCount === 0) { | ||
| // Unregister from the lock (if still held) and resolve. Resolving is | ||
| // idempotent, so it's safe even if the lock already force-resolved this on | ||
| // release. | ||
| if (lockState !== null) { | ||
| lockState.activePrefetches.delete(prefetch); | ||
| } | ||
| prefetch.resolve(); | ||
| } | ||
| } | ||
| } | ||
| function acquireLock() { | ||
@@ -70,10 +157,12 @@ if (lockState !== null) { | ||
| } | ||
| let resolve; | ||
| const promise = new Promise((r)=>{ | ||
| resolve = r; | ||
| let resolveReleased; | ||
| const released = new Promise((r)=>{ | ||
| resolveReleased = r; | ||
| }); | ||
| lockState = { | ||
| promise, | ||
| resolve: resolve, | ||
| fetch: window.fetch | ||
| released, | ||
| resolveReleased: resolveReleased, | ||
| fetch: window.fetch, | ||
| activePrefetches: new Set(), | ||
| ownedEntries: new Set() | ||
| }; | ||
@@ -96,5 +185,11 @@ // Install the fetch blocker. We only intercept `window.fetch` for the | ||
| } | ||
| const { resolve } = lockState; | ||
| const { resolveReleased, activePrefetches } = lockState; | ||
| lockState = null; | ||
| resolve(); | ||
| // Force-resolve every prefetch that hasn't finished, so a navigation still | ||
| // waiting on one doesn't hang now that the scope is ending. | ||
| for (const prefetch of activePrefetches){ | ||
| prefetch.resolve(); | ||
| } | ||
| // Resolve the release promise so a gated dynamic write unblocks too. | ||
| resolveReleased(); | ||
| } | ||
@@ -124,3 +219,3 @@ /** | ||
| const currentLock = lockState; | ||
| return currentLock.promise.then(()=>{ | ||
| return currentLock.released.then(()=>{ | ||
| const preLockFetch = currentLock.fetch; | ||
@@ -137,3 +232,3 @@ return preLockFetch(input, init); | ||
| if (process.env.__NEXT_EXPOSE_TESTING_API) { | ||
| // If the server served a static shell, this is an MPA page load | ||
| // If the server served a shell, this is an MPA page load | ||
| // while the lock is held. Transition to captured-MPA and acquire. | ||
@@ -245,3 +340,3 @@ if (self.__next_instant_test) { | ||
| if (process.env.__NEXT_EXPOSE_TESTING_API) { | ||
| return lockState !== null ? lockState.promise : null; | ||
| return lockState; | ||
| } | ||
@@ -251,2 +346,23 @@ return null; | ||
| /** | ||
| * Decides whether segment reads during a navigation should be restricted to | ||
| * shell entries (every param substituted with Fallback) rather than matching | ||
| * entries that vary on concrete route params. | ||
| * | ||
| * The testing tools (Navigation Inspector, instant()) simulate what a user | ||
| * would see with a warm cache. When the lock is held, partial prefetching is | ||
| * enabled for the target route, and no whole-route ("speculative") prefetch | ||
| * would have been made, only the shell is prefetched — so that's all a | ||
| * navigation should be allowed to match. A speculative prefetch happens for a | ||
| * `<Link prefetch={true}>` or an eagerly-prefetched subtree, in which case the | ||
| * concrete-param entry is genuinely warm and may be matched. | ||
| * | ||
| * Always returns false outside the testing API; the branch below is eliminated | ||
| * from production bundles. | ||
| */ export function shouldRestrictNavigationToShell(rootPrefetchHints, linkFetchStrategy) { | ||
| if (process.env.__NEXT_EXPOSE_TESTING_API) { | ||
| return isNavigationLocked() && (rootPrefetchHints & PrefetchHint.SubtreeHasPartialPrefetching) !== 0 && !subtreeHasSpeculativePrefetch(linkFetchStrategy, rootPrefetchHints); | ||
| } | ||
| return false; | ||
| } | ||
| /** | ||
| * Waits for the navigation lock to be released, if it's currently held. | ||
@@ -257,3 +373,3 @@ * No-op if the lock is not acquired. | ||
| if (lock !== null) { | ||
| await lock; | ||
| await lock.released; | ||
| } | ||
@@ -260,0 +376,0 @@ } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../../src/client/components/segment-cache/navigation-testing-lock.ts"],"sourcesContent":["/**\n * Navigation lock for the Instant Navigation Testing API.\n *\n * Manages the in-memory lock (a promise) that gates dynamic data writes\n * during instant navigation captures, and owns all cookie state\n * transitions (pending → captured-MPA, pending → captured-SPA).\n *\n * External actors (Playwright, devtools) set [0] to start a lock scope\n * and delete the cookie to end one. Next.js writes captured values.\n * The CookieStore handler distinguishes them by value: pending = external,\n * captured = self-write (ignored).\n */\n\nimport type {\n FlightRouterState,\n InstantCookie,\n} from '../../../shared/lib/app-router-types'\nimport { NEXT_INSTANT_TEST_COOKIE } from '../app-router-headers'\nimport { refreshOnInstantNavigationUnlock } from '../use-action-queue'\n\ntype InstantNavCookieState = 'empty' | 'pending' | 'mpa' | 'spa'\n\nfunction parseCookieValue(raw: string): InstantNavCookieState {\n if (raw === '') {\n return 'empty'\n }\n try {\n const parsed = JSON.parse(raw)\n if (Array.isArray(parsed)) {\n if (parsed.length >= 3) {\n const rawState = parsed[2]\n return rawState === null ? 'mpa' : 'spa'\n }\n }\n } catch {}\n return 'pending'\n}\n\nfunction writeCookieValue(value: InstantCookie): void {\n if (typeof cookieStore === 'undefined') {\n return\n }\n // Read the existing cookie to preserve its attributes (domain, path),\n // then write back with the new value. This updates the same cookie\n // entry that the external actor created, regardless of how it was\n // scoped.\n //\n // Capture the current lockState and compare it in the callback so we\n // only write if the lock we observed at call time is still held. This\n // guards against two races: (a) the scope ended between get and set\n // (lockState is now null), and (b) the scope ended and a new one was\n // acquired in the same gap (lockState is a different object). In\n // either case we must not write — doing so would leak stale state\n // into the next scope or outlive the current one.\n const lockAtCall = lockState\n cookieStore.get(NEXT_INSTANT_TEST_COOKIE).then((existing: any) => {\n if (existing && lockState === lockAtCall && lockAtCall !== null) {\n const options: any = {\n name: NEXT_INSTANT_TEST_COOKIE,\n value: JSON.stringify(value),\n path: existing.path ?? '/',\n }\n if (existing.domain) {\n options.domain = existing.domain\n }\n cookieStore.set(options)\n }\n })\n}\n\ntype NavigationLockState = {\n promise: Promise<void>\n resolve: () => void\n // The pre-lock `window.fetch`, captured at `acquireLock` time and\n // restored at `releaseLock`. Internal Next.js code reads this via\n // `getPreLockFetch` to bypass the override we install on `window.fetch`\n // during a lock scope.\n fetch: typeof fetch\n}\n\nlet lockState: NavigationLockState | null = null\n\nexport function getPreLockFetch(): typeof fetch | null {\n return lockState !== null ? lockState.fetch : null\n}\n\nfunction acquireLock(): void {\n if (lockState !== null) {\n return\n }\n let resolve: () => void\n const promise = new Promise<void>((r) => {\n resolve = r\n })\n lockState = { promise, resolve: resolve!, fetch: window.fetch }\n\n // Install the fetch blocker. We only intercept `window.fetch` for the\n // duration of the lock so that — outside of a testing scope — user-\n // installed overrides of `window.fetch` are untouched.\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n window.fetch = globalFetchOverride\n }\n}\n\nfunction releaseLock(): void {\n if (lockState === null) {\n return\n }\n // Restore the pre-lock `window.fetch` before resolving the lock promise\n // so any fetches queued on the promise see the restored fetch.\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n window.fetch = lockState.fetch\n }\n const { resolve } = lockState\n lockState = null\n resolve()\n}\n\n/**\n * Global fetch override\n *\n * While the navigation lock is active, we install this as `window.fetch` so\n * out-of-band client-side fetches (e.g. `fetch('/api/data')` inside a\n * useEffect) are blocked until the lock is released. Next.js internals\n * bypass the override by importing `fetch` from `./fetch`, which reads the\n * captured pre-lock fetch via `getPreLockFetch`.\n *\n * NOTE: This override only affects environments where the Instant Navigation\n * Testing API is enabled. It has no impact on live production behavior.\n */\nexport function globalFetchOverride(\n input: RequestInfo | URL,\n init?: RequestInit\n): Promise<Response> {\n if (lockState === null) {\n // Lock is not active. Fall through to the global fetch — we reach this\n // only if a caller captured a reference to this function during a lock\n // scope and invoked it after release.\n return fetch(input, init)\n }\n // Block user-initiated fetches until the lock is released, then dispatch\n // through the fetch captured at acquire time. Reading from `lockState`\n // (rather than `window.fetch`) pins to the capture even if `window.fetch`\n // is reassigned after release.\n const currentLock = lockState\n return currentLock.promise.then(() => {\n const preLockFetch = currentLock.fetch\n return preLockFetch(input, init)\n })\n}\n\n/**\n * Sets up the cookie-based lock. Handles the initial page load state and\n * registers a CookieStore listener for runtime changes.\n *\n * Called once during page initialization from app-globals.ts.\n */\nexport function startListeningForInstantNavigationCookie(): void {\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n // If the server served a static shell, this is an MPA page load\n // while the lock is held. Transition to captured-MPA and acquire.\n if (self.__next_instant_test) {\n if (typeof cookieStore !== 'undefined') {\n // If the cookie was already cleared during the MPA page\n // transition, reload to get the full dynamic page.\n cookieStore.get(NEXT_INSTANT_TEST_COOKIE).then((cookie: any) => {\n if (!cookie) {\n window.location.reload()\n }\n })\n }\n\n // Acquire the lock before writing the cookie. writeCookieValue's\n // guard requires lockState to be non-null at call time (so a stale\n // write can't outlive its scope). On a fresh page load that scope\n // is the one we're about to establish, so we have to establish it\n // first.\n acquireLock()\n writeCookieValue([1, `c${Math.random()}`, null])\n }\n\n if (typeof cookieStore === 'undefined') {\n return\n }\n\n cookieStore.addEventListener('change', (event: CookieChangeEvent) => {\n for (const cookie of event.changed) {\n if (cookie.name === NEXT_INSTANT_TEST_COOKIE) {\n const state = parseCookieValue(cookie.value ?? '')\n\n if (state === 'pending') {\n // External actor starting a new lock scope.\n if (lockState !== null) {\n // This can be the delayed CookieStore event for the pending\n // cookie that was already observed synchronously from\n // document.cookie. Keep the existing lock identity so work that\n // captured it keeps waiting on the same promise.\n return\n }\n acquireLock()\n }\n // Captured value (our own transition) or empty. Ignore.\n return\n }\n }\n\n for (const cookie of event.deleted) {\n if (cookie.name === NEXT_INSTANT_TEST_COOKIE) {\n releaseLock()\n refreshOnInstantNavigationUnlock()\n return\n }\n }\n })\n }\n}\n\n/**\n * Transitions the cookie from pending to captured-SPA once the prefetch resolves\n * and the navigation is known to be an SPA.\n */\nexport function updateCapturedSPAToTree(\n fromTree: FlightRouterState,\n toTree: FlightRouterState\n): void {\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n writeCookieValue([1, `c${Math.random()}`, { from: fromTree, to: toTree }])\n }\n}\n\n/**\n * Returns true if the navigation lock is currently active.\n */\nexport function isNavigationLocked(): boolean {\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n if (lockState !== null) {\n return true\n }\n\n // If `lockState` is null, fall back to reading the test cookie\n // synchronously from `document.cookie`. This accounts for a small race\n // between `cookieStore.set(...)` and its corresponding `change` event.\n // During that gap `lockState` is still null even though the cookie\n // indicates a new lock scope is starting.\n if (typeof document === 'undefined') {\n return false\n }\n const allCookies = document.cookie\n if (!allCookies.includes(NEXT_INSTANT_TEST_COOKIE)) {\n // Fast bail-out: in almost every navigation the test cookie is not\n // set at all.\n return false\n }\n const target = NEXT_INSTANT_TEST_COOKIE + '='\n for (const segment of allCookies.split(';')) {\n const trimmed = segment.trim()\n if (\n trimmed.startsWith(target) &&\n parseCookieValue(trimmed.slice(target.length)) === 'pending'\n ) {\n // The cookie was set by an external actor but the change event was not\n // yet dispatched. Acquire the lock synchronously.\n acquireLock()\n return true\n }\n }\n }\n return false\n}\n\nexport function getCurrentNavigationLock(): Promise<void> | null {\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n return lockState !== null ? lockState.promise : null\n }\n return null\n}\n\n/**\n * Waits for the navigation lock to be released, if it's currently held.\n * No-op if the lock is not acquired.\n */\nexport async function waitForNavigationLockIfActive(\n lock: Promise<void> | null = getCurrentNavigationLock()\n): Promise<void> {\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n if (lock !== null) {\n await lock\n }\n }\n}\n"],"names":["NEXT_INSTANT_TEST_COOKIE","refreshOnInstantNavigationUnlock","parseCookieValue","raw","parsed","JSON","parse","Array","isArray","length","rawState","writeCookieValue","value","cookieStore","lockAtCall","lockState","get","then","existing","options","name","stringify","path","domain","set","getPreLockFetch","fetch","acquireLock","resolve","promise","Promise","r","window","process","env","__NEXT_EXPOSE_TESTING_API","globalFetchOverride","releaseLock","input","init","currentLock","preLockFetch","startListeningForInstantNavigationCookie","self","__next_instant_test","cookie","location","reload","Math","random","addEventListener","event","changed","state","deleted","updateCapturedSPAToTree","fromTree","toTree","from","to","isNavigationLocked","document","allCookies","includes","target","segment","split","trimmed","trim","startsWith","slice","getCurrentNavigationLock","waitForNavigationLockIfActive","lock"],"mappings":"AAAA;;;;;;;;;;;CAWC,GAMD,SAASA,wBAAwB,QAAQ,wBAAuB;AAChE,SAASC,gCAAgC,QAAQ,sBAAqB;AAItE,SAASC,iBAAiBC,GAAW;IACnC,IAAIA,QAAQ,IAAI;QACd,OAAO;IACT;IACA,IAAI;QACF,MAAMC,SAASC,KAAKC,KAAK,CAACH;QAC1B,IAAII,MAAMC,OAAO,CAACJ,SAAS;YACzB,I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ACvE,kDAAkD;gBAClDkB;gBACA,OAAO;YACT;QACF;IACF;IACA,OAAO;AACT;AAEA,OAAO,SAAS4C;IACd,IAAItC,QAAQC,GAAG,CAACC,yBAAyB,EAAE;QACzC,OAAOpB,cAAc,OAAOA,UAAUc,OAAO,GAAG;IAClD;IACA,OAAO;AACT;AAEA;;;CAGC,GACD,OAAO,eAAe2C,8BACpBC,OAA6BF,0BAA0B;IAEvD,IAAItC,QAAQC,GAAG,CAACC,yBAAyB,EAAE;QACzC,IAAIsC,SAAS,MAAM;YACjB,MAAMA;QACR;IACF;AACF","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../../src/client/components/segment-cache/navigation-testing-lock.ts"],"sourcesContent":["/**\n * Navigation lock for the Instant Navigation Testing API.\n *\n * Manages the in-memory lock (a promise) that gates dynamic data writes\n * during instant navigation captures, and owns all cookie state\n * transitions (pending → captured-MPA, pending → captured-SPA).\n *\n * External actors (Playwright, devtools) set [0] to start a lock scope\n * and delete the cookie to end one. Next.js writes captured values.\n * The CookieStore handler distinguishes them by value: pending = external,\n * captured = self-write (ignored).\n */\n\nimport {\n PrefetchHint,\n type FlightRouterState,\n type InstantCookie,\n} from '../../../shared/lib/app-router-types'\nimport { NEXT_INSTANT_TEST_COOKIE } from '../app-router-headers'\nimport { refreshOnInstantNavigationUnlock } from '../use-action-queue'\nimport { subtreeHasSpeculativePrefetch } from './scheduler'\nimport {\n waitForSegmentCacheEntry,\n type PendingSegmentCacheEntry,\n type SegmentCacheEntry,\n} from './cache'\nimport type { FetchStrategy } from './types'\n\ntype InstantNavCookieState = 'empty' | 'pending' | 'mpa' | 'spa'\n\nfunction parseCookieValue(raw: string): InstantNavCookieState {\n if (raw === '') {\n return 'empty'\n }\n try {\n const parsed = JSON.parse(raw)\n if (Array.isArray(parsed)) {\n if (parsed.length >= 3) {\n const rawState = parsed[2]\n return rawState === null ? 'mpa' : 'spa'\n }\n }\n } catch {}\n return 'pending'\n}\n\nfunction writeCookieValue(value: InstantCookie): void {\n if (typeof cookieStore === 'undefined') {\n return\n }\n // Read the existing cookie to preserve its attributes (domain, path),\n // then write back with the new value. This updates the same cookie\n // entry that the external actor created, regardless of how it was\n // scoped.\n //\n // Capture the current lockState and compare it in the callback so we\n // only write if the lock we observed at call time is still held. This\n // guards against two races: (a) the scope ended between get and set\n // (lockState is now null), and (b) the scope ended and a new one was\n // acquired in the same gap (lockState is a different object). In\n // either case we must not write — doing so would leak stale state\n // into the next scope or outlive the current one.\n const lockAtCall = lockState\n cookieStore.get(NEXT_INSTANT_TEST_COOKIE).then((existing: any) => {\n if (existing && lockState === lockAtCall && lockAtCall !== null) {\n const options: any = {\n name: NEXT_INSTANT_TEST_COOKIE,\n value: JSON.stringify(value),\n path: existing.path ?? '/',\n }\n if (existing.domain) {\n options.domain = existing.domain\n }\n cookieStore.set(options)\n }\n })\n}\n\n/**\n * The \"wait for the locked navigation's prefetch to fulfill\" state for a single\n * locked navigation. `promise` resolves once that prefetch has spawned every\n * request and all of them have fulfilled, so the navigation reads present data\n * rather than a still-in-flight entry. Owned by the prefetch task (one per\n * navigation, so successive navigations in a scope resolve independently) and\n * also tracked in `NavigationLockState.activePrefetches` so the lock can\n * force-resolve any that are still pending when it's released.\n *\n * `pendingCount` holds one reference for the scheduler while it is still\n * spawning, plus one per in-flight entry; `promise` resolves when it drains to\n * 0. `trackedEntries` dedupes entry registration.\n */\nexport type NavigationLockPrefetch = {\n promise: Promise<void>\n resolve: () => void\n pendingCount: number\n trackedEntries: Set<PendingSegmentCacheEntry>\n}\n\nexport type NavigationLockState = {\n // Resolves when the lock is released (the testing scope ends). The dynamic-\n // data write during a locked navigation waits on this; see\n // `getCurrentNavigationLock` and `waitForNavigationLockIfActive`.\n released: Promise<void>\n resolveReleased: () => void\n // The pre-lock `window.fetch`, captured at `acquireLock` time and\n // restored at `releaseLock`. Internal Next.js code reads this via\n // `getPreLockFetch` to bypass the override we install on `window.fetch`\n // during a lock scope.\n fetch: typeof fetch\n // Every prefetch-completion state for this scope that hasn't resolved yet.\n // A prefetch removes itself when it drains; on release, any still here are\n // force-resolved so no navigation hangs waiting on a prefetch that the scope\n // ended before it could finish.\n activePrefetches: Set<NavigationLockPrefetch>\n // Every segment entry that was (re)fetched within this lock scope. Navigation\n // reads are restricted to these, so each instant() navigation observes only\n // data fetched under the lock — a \"clean read\" — and never matches a stale\n // entry left in the cache by an earlier navigation or prefetch. See\n // `readSegmentCacheEntryForNavigation`.\n ownedEntries: Set<SegmentCacheEntry>\n}\n\nlet lockState: NavigationLockState | null = null\n\nexport function getPreLockFetch(): typeof fetch | null {\n return lockState !== null ? lockState.fetch : null\n}\n\n/**\n * Creates the \"wait for prefetch to fulfill\" state for one locked navigation,\n * registers it on the current lock, and returns it (the caller stores it on the\n * prefetch task and awaits `.promise`). Returns null if no lock is held.\n *\n * `pendingCount` starts at 1, representing the scheduler itself while it is\n * still spawning requests; that reference is released by\n * `finishNavigationLockPrefetchSpawning`. Each spawned pending entry adds\n * another (see `trackNavigationLockPrefetchEntry`). `promise` resolves when the\n * count drains to 0 — i.e. spawning finished and every entry fulfilled.\n */\nexport function beginNavigationLockPrefetch(): NavigationLockPrefetch | null {\n if (process.env.__NEXT_EXPOSE_TESTING_API && lockState !== null) {\n let resolve: () => void\n const promise = new Promise<void>((r) => {\n resolve = r\n })\n const prefetch: NavigationLockPrefetch = {\n promise,\n resolve: resolve!,\n pendingCount: 1,\n trackedEntries: new Set(),\n }\n lockState.activePrefetches.add(prefetch)\n return prefetch\n }\n return null\n}\n\n/**\n * Records a freshly-created segment entry as owned by the current lock scope, so\n * navigation reads will match it — and only entries created within the scope\n * (see `NavigationLockState.ownedEntries`). Called from\n * `createDetachedSegmentCacheEntry`, the single factory every creation path\n * funnels through, so re-keyed entries created during response processing (e.g.\n * a runtime prefetch resolving a concrete param) are owned too. No-op when no\n * lock is held.\n */\nexport function recordNavigationLockOwnedEntry(entry: SegmentCacheEntry): void {\n if (process.env.__NEXT_EXPOSE_TESTING_API && lockState !== null) {\n lockState.ownedEntries.add(entry)\n }\n}\n\n/**\n * Called by `upgradeToPendingSegment` whenever the locked-navigation prefetch\n * spawns a pending segment entry. Adds the entry to the prefetch's ref count and\n * decrements when it fulfills (or rejects — `waitForSegmentCacheEntry` resolves\n * to null). Deduped so the same entry never double-counts.\n */\nexport function trackNavigationLockPrefetchEntry(\n prefetch: NavigationLockPrefetch,\n entry: PendingSegmentCacheEntry\n): void {\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n if (prefetch.trackedEntries.has(entry)) {\n return\n }\n prefetch.trackedEntries.add(entry)\n prefetch.pendingCount++\n const onSettled = () => {\n prefetch.pendingCount--\n settleNavigationLockPrefetchIfDrained(prefetch)\n }\n // Decrement whether the entry fulfills or its request rejects, so a failed\n // segment can't leave the navigation waiting forever.\n waitForSegmentCacheEntry(entry).then(onSettled, onSettled)\n }\n}\n\n/**\n * Called once the scheduler has finished spawning every request for the\n * locked-navigation prefetch, releasing the scheduler's reference from the ref\n * count. The prefetch resolves here if every spawned entry already fulfilled.\n */\nexport function finishNavigationLockPrefetchSpawning(\n prefetch: NavigationLockPrefetch\n): void {\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n prefetch.pendingCount--\n settleNavigationLockPrefetchIfDrained(prefetch)\n }\n}\n\nfunction settleNavigationLockPrefetchIfDrained(\n prefetch: NavigationLockPrefetch\n): void {\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n if (prefetch.pendingCount === 0) {\n // Unregister from the lock (if still held) and resolve. Resolving is\n // idempotent, so it's safe even if the lock already force-resolved this on\n // release.\n if (lockState !== null) {\n lockState.activePrefetches.delete(prefetch)\n }\n prefetch.resolve()\n }\n }\n}\n\nfunction acquireLock(): void {\n if (lockState !== null) {\n return\n }\n let resolveReleased: () => void\n const released = new Promise<void>((r) => {\n resolveReleased = r\n })\n lockState = {\n released,\n resolveReleased: resolveReleased!,\n fetch: window.fetch,\n activePrefetches: new Set(),\n ownedEntries: new Set(),\n }\n\n // Install the fetch blocker. We only intercept `window.fetch` for the\n // duration of the lock so that — outside of a testing scope — user-\n // installed overrides of `window.fetch` are untouched.\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n window.fetch = globalFetchOverride\n }\n}\n\nfunction releaseLock(): void {\n if (lockState === null) {\n return\n }\n // Restore the pre-lock `window.fetch` before resolving the lock promise\n // so any fetches queued on the promise see the restored fetch.\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n window.fetch = lockState.fetch\n }\n const { resolveReleased, activePrefetches } = lockState\n lockState = null\n // Force-resolve every prefetch that hasn't finished, so a navigation still\n // waiting on one doesn't hang now that the scope is ending.\n for (const prefetch of activePrefetches) {\n prefetch.resolve()\n }\n // Resolve the release promise so a gated dynamic write unblocks too.\n resolveReleased()\n}\n\n/**\n * Global fetch override\n *\n * While the navigation lock is active, we install this as `window.fetch` so\n * out-of-band client-side fetches (e.g. `fetch('/api/data')` inside a\n * useEffect) are blocked until the lock is released. Next.js internals\n * bypass the override by importing `fetch` from `./fetch`, which reads the\n * captured pre-lock fetch via `getPreLockFetch`.\n *\n * NOTE: This override only affects environments where the Instant Navigation\n * Testing API is enabled. It has no impact on live production behavior.\n */\nexport function globalFetchOverride(\n input: RequestInfo | URL,\n init?: RequestInit\n): Promise<Response> {\n if (lockState === null) {\n // Lock is not active. Fall through to the global fetch — we reach this\n // only if a caller captured a reference to this function during a lock\n // scope and invoked it after release.\n return fetch(input, init)\n }\n // Block user-initiated fetches until the lock is released, then dispatch\n // through the fetch captured at acquire time. Reading from `lockState`\n // (rather than `window.fetch`) pins to the capture even if `window.fetch`\n // is reassigned after release.\n const currentLock = lockState\n return currentLock.released.then(() => {\n const preLockFetch = currentLock.fetch\n return preLockFetch(input, init)\n })\n}\n\n/**\n * Sets up the cookie-based lock. Handles the initial page load state and\n * registers a CookieStore listener for runtime changes.\n *\n * Called once during page initialization from app-globals.ts.\n */\nexport function startListeningForInstantNavigationCookie(): void {\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n // If the server served a shell, this is an MPA page load\n // while the lock is held. Transition to captured-MPA and acquire.\n if (self.__next_instant_test) {\n if (typeof cookieStore !== 'undefined') {\n // If the cookie was already cleared during the MPA page\n // transition, reload to get the full dynamic page.\n cookieStore.get(NEXT_INSTANT_TEST_COOKIE).then((cookie: any) => {\n if (!cookie) {\n window.location.reload()\n }\n })\n }\n\n // Acquire the lock before writing the cookie. writeCookieValue's\n // guard requires lockState to be non-null at call time (so a stale\n // write can't outlive its scope). On a fresh page load that scope\n // is the one we're about to establish, so we have to establish it\n // first.\n acquireLock()\n writeCookieValue([1, `c${Math.random()}`, null])\n }\n\n if (typeof cookieStore === 'undefined') {\n return\n }\n\n cookieStore.addEventListener('change', (event: CookieChangeEvent) => {\n for (const cookie of event.changed) {\n if (cookie.name === NEXT_INSTANT_TEST_COOKIE) {\n const state = parseCookieValue(cookie.value ?? '')\n\n if (state === 'pending') {\n // External actor starting a new lock scope.\n if (lockState !== null) {\n // This can be the delayed CookieStore event for the pending\n // cookie that was already observed synchronously from\n // document.cookie. Keep the existing lock identity so work that\n // captured it keeps waiting on the same promise.\n return\n }\n acquireLock()\n }\n // Captured value (our own transition) or empty. Ignore.\n return\n }\n }\n\n for (const cookie of event.deleted) {\n if (cookie.name === NEXT_INSTANT_TEST_COOKIE) {\n releaseLock()\n refreshOnInstantNavigationUnlock()\n return\n }\n }\n })\n }\n}\n\n/**\n * Transitions the cookie from pending to captured-SPA once the prefetch resolves\n * and the navigation is known to be an SPA.\n */\nexport function updateCapturedSPAToTree(\n fromTree: FlightRouterState,\n toTree: FlightRouterState\n): void {\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n writeCookieValue([1, `c${Math.random()}`, { from: fromTree, to: toTree }])\n }\n}\n\n/**\n * Returns true if the navigation lock is currently active.\n */\nexport function isNavigationLocked(): boolean {\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n if (lockState !== null) {\n return true\n }\n\n // If `lockState` is null, fall back to reading the test cookie\n // synchronously from `document.cookie`. This accounts for a small race\n // between `cookieStore.set(...)` and its corresponding `change` event.\n // During that gap `lockState` is still null even though the cookie\n // indicates a new lock scope is starting.\n if (typeof document === 'undefined') {\n return false\n }\n const allCookies = document.cookie\n if (!allCookies.includes(NEXT_INSTANT_TEST_COOKIE)) {\n // Fast bail-out: in almost every navigation the test cookie is not\n // set at all.\n return false\n }\n const target = NEXT_INSTANT_TEST_COOKIE + '='\n for (const segment of allCookies.split(';')) {\n const trimmed = segment.trim()\n if (\n trimmed.startsWith(target) &&\n parseCookieValue(trimmed.slice(target.length)) === 'pending'\n ) {\n // The cookie was set by an external actor but the change event was not\n // yet dispatched. Acquire the lock synchronously.\n acquireLock()\n return true\n }\n }\n }\n return false\n}\n\nexport function getCurrentNavigationLock(): NavigationLockState | null {\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n return lockState\n }\n return null\n}\n\n/**\n * Decides whether segment reads during a navigation should be restricted to\n * shell entries (every param substituted with Fallback) rather than matching\n * entries that vary on concrete route params.\n *\n * The testing tools (Navigation Inspector, instant()) simulate what a user\n * would see with a warm cache. When the lock is held, partial prefetching is\n * enabled for the target route, and no whole-route (\"speculative\") prefetch\n * would have been made, only the shell is prefetched — so that's all a\n * navigation should be allowed to match. A speculative prefetch happens for a\n * `<Link prefetch={true}>` or an eagerly-prefetched subtree, in which case the\n * concrete-param entry is genuinely warm and may be matched.\n *\n * Always returns false outside the testing API; the branch below is eliminated\n * from production bundles.\n */\nexport function shouldRestrictNavigationToShell(\n rootPrefetchHints: number,\n linkFetchStrategy: FetchStrategy\n): boolean {\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n return (\n isNavigationLocked() &&\n (rootPrefetchHints & PrefetchHint.SubtreeHasPartialPrefetching) !== 0 &&\n !subtreeHasSpeculativePrefetch(linkFetchStrategy, rootPrefetchHints)\n )\n }\n return false\n}\n\n/**\n * Waits for the navigation lock to be released, if it's currently held.\n * No-op if the lock is not acquired.\n */\nexport async function waitForNavigationLockIfActive(\n lock: NavigationLockState | null = getCurrentNavigationLock()\n): Promise<void> {\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n if (lock !== null) {\n await lock.released\n }\n }\n}\n"],"names":["PrefetchHint","NEXT_INSTANT_TEST_COOKIE","refreshOnInstantNavigationUnlock","subtreeHasSpeculativePrefetch","waitForSegmentCacheEntry","parseCookieValue","raw","parsed","JSON","parse","Array","isArray","length","rawState","writeCookieValue","value","cookieStore","lockAtCall","lockState","get","then","existing","options","name","stringify","path","domain","set","getPreLockFetch","fetch","beginNavigationLockPrefetch","process","env","__NEXT_EXPOSE_TESTING_API","resolve","promise","Promise","r","prefetch","pendingCount","trackedEntries","Set","activePrefetches","add","recordNavigationLockOwnedEntry","entry","ownedEntries","trackNavigationLockPrefetchEntry","has","onSettled","settleNavigationLockPrefetchIfDrained","finishNavigationLockPrefetchSpawning","delete","acquireLock","resolveReleased","released","window","globalFetchOverride","releaseLock","input","init","currentLock","preLockFetch","startListeningForInstantNavigationCookie","self","__next_instant_test","cookie","location","reload","Math","random","addEventListener","event","changed","state","deleted","updateCapturedSPAToTree","fromTree","toTree","from","to","isNavigationLocked","document","allCookies","includes","target","segment","split","trimmed","trim","startsWith","slice","getCurrentNavigationLock","shouldRestrictNavigationToShell","rootPrefetchHints","linkFetchStrategy","SubtreeHasPartialPrefetching","waitForNavigationLockIfActive","lock"],"mappings":"AAAA;;;;;;;;;;;CAWC,GAED,SACEA,YAAY,QAGP,uCAAsC;AAC7C,SAASC,wBAAwB,QAAQ,wBAAuB;AAChE,SAASC,gCAAgC,QAAQ,sBAAqB;AACtE,SAASC,6BAA6B,QAAQ,cAAa;AAC3D,SACEC,wBAAwB,QAGnB,UAAS;AAKhB,SAASC,iBAAiBC,GAAW;IACnC,IAAIA,QAAQ,IAAI;QACd,OAAO;IACT;IACA,IAAI;QACF,MAAMC,SAASC,KAAKC,KAAK,CAACH;QAC1B,IAAII,MAAMC,OAAO,CAACJ,SAAS;YACzB,IAAIA,OAAOK,MAAM,IAAI,GAAG;gBACtB,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pF,2BAA2B;QAC1C,KAAK,MAAMqF,WAAWH,WAAWI,KAAK,CAAC,KAAM;YAC3C,MAAMC,UAAUF,QAAQG,IAAI;YAC5B,IACED,QAAQE,UAAU,CAACL,WACnBhF,iBAAiBmF,QAAQG,KAAK,CAACN,OAAOzE,MAAM,OAAO,WACnD;gBACA,uEAAuE;gBACvE,kDAAkD;gBAClDyC;gBACA,OAAO;YACT;QACF;IACF;IACA,OAAO;AACT;AAEA,OAAO,SAASuC;IACd,IAAI7D,QAAQC,GAAG,CAACC,yBAAyB,EAAE;QACzC,OAAOf;IACT;IACA,OAAO;AACT;AAEA;;;;;;;;;;;;;;;CAeC,GACD,OAAO,SAAS2E,gCACdC,iBAAyB,EACzBC,iBAAgC;IAEhC,IAAIhE,QAAQC,GAAG,CAACC,yBAAyB,EAAE;QACzC,OACEgD,wBACA,AAACa,CAAAA,oBAAoB9F,aAAagG,4BAA4B,AAAD,MAAO,KACpE,CAAC7F,8BAA8B4F,mBAAmBD;IAEtD;IACA,OAAO;AACT;AAEA;;;CAGC,GACD,OAAO,eAAeG,8BACpBC,OAAmCN,0BAA0B;IAE7D,IAAI7D,QAAQC,GAAG,CAACC,yBAAyB,EAAE;QACzC,IAAIiE,SAAS,MAAM;YACjB,MAAMA,KAAK3C,QAAQ;QACrB;IACF;AACF","ignoreList":[0]} |
@@ -30,3 +30,3 @@ import { PrefetchHint, SubtreePrefetchHints, propagateSubtreeBits } from '../../../shared/lib/app-router-types'; | ||
| // for routes that already have a cached route tree. Without this, the | ||
| // static shell might be incomplete because some segments were never | ||
| // shell might be incomplete because some segments were never | ||
| // requested. | ||
@@ -105,4 +105,8 @@ if (process.env.__NEXT_EXPOSE_TESTING_API) { | ||
| // aren't flooded with warnings the moment they enable Cache Components. | ||
| // | ||
| // The warning is suppressed if any segment on the target route exports | ||
| // `instant = false`, which is the explicit API for opting a route out of | ||
| // this validation. | ||
| const link = getLinkForCurrentNavigation(); | ||
| if (link !== null && link.fetchStrategy === FetchStrategy.Full && (navigationSeed.routeTree.prefetchHints & PrefetchHint.SubtreeHasPartialPrefetching) === 0) { | ||
| if (link !== null && link.fetchStrategy === FetchStrategy.Full && (navigationSeed.routeTree.prefetchHints & (PrefetchHint.SubtreeHasPartialPrefetching | PrefetchHint.SubtreeHasInstantFalse)) === 0) { | ||
| const error = createLinkPrefetchPartialError(url.pathname); | ||
@@ -123,2 +127,11 @@ const ownerStack = 'ownerStack' in link ? link.ownerStack : undefined; | ||
| } | ||
| // Instant Navigation Testing API: when the lock is held, restrict segment | ||
| // reads to shell entries if the target route would only have prefetched | ||
| // its shell. | ||
| let restrictToShell = false; | ||
| if (process.env.__NEXT_EXPOSE_TESTING_API) { | ||
| const { shouldRestrictNavigationToShell } = require('./navigation-testing-lock'); | ||
| const link = getLinkForCurrentNavigation(); | ||
| restrictToShell = shouldRestrictNavigationToShell(navigationSeed.routeTree.prefetchHints, link !== null ? link.fetchStrategy : FetchStrategy.PPR); | ||
| } | ||
| const accumulation = { | ||
@@ -147,3 +160,3 @@ separateRefreshUrls: null, | ||
| const isSamePageNavigation = url.href === currentUrl.href; | ||
| const task = startPPRNavigation(now, currentUrl, currentRenderedSearch, currentCacheNode, currentFlightRouterState, navigationSeed.routeTree, navigationSeed.metadataVaryPath, freshnessPolicy, navigationSeed.data, navigationSeed.head, navigationSeed.dynamicStaleAt, isSamePageNavigation, accumulation); | ||
| const task = startPPRNavigation(now, currentUrl, currentRenderedSearch, currentCacheNode, currentFlightRouterState, navigationSeed.routeTree, navigationSeed.metadataVaryPath, freshnessPolicy, navigationSeed.data, navigationSeed.head, navigationSeed.dynamicStaleAt, isSamePageNavigation, accumulation, restrictToShell); | ||
| if (task !== null) { | ||
@@ -603,6 +616,13 @@ if (freshnessPolicy !== FreshnessPolicy.Gesture) { | ||
| const cacheKey = createCacheKey(url.href, nextUrl); | ||
| await new Promise((resolve)=>{ | ||
| schedulePrefetchTask(cacheKey, currentFlightRouterState, fetchStrategy, PrefetchPriority.Default, null, resolve // _onComplete callback | ||
| ); | ||
| }); | ||
| // Create this navigation's "wait for prefetch to fulfill" state and schedule | ||
| // the prefetch as a locked-navigation prefetch. The prefetch's promise | ||
| // resolves once it has spawned every request and all of them have fulfilled, | ||
| // so the navigation below reads present data rather than a still-in-flight | ||
| // entry. | ||
| const { beginNavigationLockPrefetch } = require('./navigation-testing-lock'); | ||
| const navigationLockPrefetch = beginNavigationLockPrefetch(); | ||
| schedulePrefetchTask(cacheKey, currentFlightRouterState, fetchStrategy, PrefetchPriority.Default, null, navigationLockPrefetch); | ||
| if (navigationLockPrefetch !== null) { | ||
| await navigationLockPrefetch.promise; | ||
| } | ||
| // Prefetch is complete. Proceed with the normal navigation flow, which | ||
@@ -609,0 +629,0 @@ // will now find the route in the cache. |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../../src/client/components/segment-cache/navigation.ts"],"sourcesContent":["import type {\n CacheNodeSeedData,\n FlightRouterState,\n FlightSegmentPath,\n ScrollRef,\n} from '../../../shared/lib/app-router-types'\nimport type { CacheNode } from '../../../shared/lib/app-router-types'\nimport type { HeadData } from '../../../shared/lib/app-router-types'\nimport {\n PrefetchHint,\n SubtreePrefetchHints,\n propagateSubtreeBits,\n} from '../../../shared/lib/app-router-types'\nimport type { NormalizedFlightData } from '../../flight-data-helpers'\nimport { fetchServerResponse } from '../router-reducer/fetch-server-response'\nimport {\n startPPRNavigation,\n spawnDynamicRequests,\n FreshnessPolicy,\n getCurrentNavigationLock,\n type NavigationLock,\n type NavigationRequestAccumulation,\n} from '../router-reducer/ppr-navigations'\nimport { createHrefFromUrl } from '../router-reducer/create-href-from-url'\nimport { NEXT_NAV_DEPLOYMENT_ID_HEADER } from '../../../lib/constants'\nimport {\n EntryStatus,\n readRouteCacheEntry,\n deprecated_requestOptimisticRouteCacheEntry,\n convertRootFlightRouterStateToRouteTree,\n getStaleAt,\n writePrerenderResponseIntoCache,\n processRuntimePrefetchStream,\n writeDynamicRenderResponseIntoCache,\n type RouteTree,\n type FulfilledRouteCacheEntry,\n} from './cache'\nimport { discoverKnownRoute } from './optimistic-routes'\nimport { createCacheKey, type NormalizedSearch } from './cache-key'\nimport { schedulePrefetchTask } from './scheduler'\nimport { PrefetchPriority, FetchStrategy } from './types'\nimport { getLinkForCurrentNavigation } from '../links'\nimport type { PageVaryPath } from './vary-path'\nimport type { AppRouterState } from '../router-reducer/router-reducer-types'\nimport { ScrollBehavior } from '../router-reducer/router-reducer-types'\nimport { computeChangedPath } from '../router-reducer/compute-changed-path'\nimport { isJavaScriptURLString } from '../../lib/javascript-url'\nimport { UnknownDynamicStaleTime, computeDynamicStaleAt } from './bfcache'\nimport { createLinkPrefetchPartialError } from '../../../shared/lib/instant-messages'\n\n/**\n * Navigate to a new URL, using the Segment Cache to construct a response.\n *\n * To allow for synchronous navigations whenever possible, this is not an async\n * function. It returns a promise only if there's no matching prefetch in\n * the cache. Otherwise it returns an immediate result and uses Suspense/RSC to\n * stream in any missing data.\n */\nexport function navigate(\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n nextUrl: string | null,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace'\n): AppRouterState | Promise<AppRouterState> {\n let navigationLock: NavigationLock = null\n\n // Instant Navigation Testing API: when the lock is active, ensure a\n // prefetch task has been initiated before proceeding with the navigation.\n // This guarantees that segment data requests are at least pending, even\n // for routes that already have a cached route tree. Without this, the\n // static shell might be incomplete because some segments were never\n // requested.\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n const { isNavigationLocked } =\n require('./navigation-testing-lock') as typeof import('./navigation-testing-lock')\n if (isNavigationLocked()) {\n navigationLock = getCurrentNavigationLock()\n return ensurePrefetchThenNavigate(\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n nextUrl,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n )\n }\n }\n\n return navigateImpl(\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n nextUrl,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n )\n}\n\nfunction navigateImpl(\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n nextUrl: string | null,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock\n): AppRouterState | Promise<AppRouterState> {\n const now = Date.now()\n const href = url.href\n\n const cacheKey = createCacheKey(href, nextUrl)\n const route = readRouteCacheEntry(now, cacheKey)\n if (route !== null && route.status === EntryStatus.Fulfilled) {\n // We have a matching prefetch.\n return navigateUsingPrefetchedRouteTree(\n now,\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n route,\n navigationLock\n )\n }\n\n // There was no matching route tree in the cache. Let's see if we can\n // construct an \"optimistic\" route tree using the deprecated search-params\n // based matching. This is only used when the new optimisticRouting flag is\n // disabled.\n //\n // Do not construct an optimistic route tree if there was a cache hit, but\n // the entry has a rejected status, since it may have been rejected due to a\n // rewrite or redirect based on the search params.\n //\n // TODO: There are multiple reasons a prefetch might be rejected; we should\n // track them explicitly and choose what to do here based on that.\n if (!process.env.__NEXT_OPTIMISTIC_ROUTING) {\n if (route === null || route.status !== EntryStatus.Rejected) {\n const optimisticRoute = deprecated_requestOptimisticRouteCacheEntry(\n now,\n url,\n nextUrl\n )\n if (optimisticRoute !== null) {\n // We have an optimistic route tree. Proceed with the normal flow.\n return navigateUsingPrefetchedRouteTree(\n now,\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n optimisticRoute,\n navigationLock\n )\n }\n }\n }\n\n // There's no matching prefetch for this route in the cache. We must lazily\n // fetch it from the server before we can perform the navigation.\n //\n // TODO: If this is a gesture navigation, instead of performing a\n // dynamic request, we should do a runtime prefetch.\n return navigateToUnknownRoute(\n now,\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n ).catch(() => {\n // If the navigation fails, return the current state\n return state\n })\n}\n\nexport function navigateToKnownRoute(\n now: number,\n state: AppRouterState,\n url: URL,\n canonicalUrl: string,\n navigationSeed: NavigationSeed,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n freshnessPolicy: FreshnessPolicy,\n nextUrl: string | null,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock,\n debugInfo: Array<unknown> | null,\n // The route cache entry used for this navigation, if it came from route\n // prediction. Passed through so it can be marked as having a dynamic rewrite\n // if the server returns a different pathname (indicating dynamic rewrite\n // behavior).\n //\n // When null, the navigation did not use route prediction - either because\n // the route was already fully cached, or it's a navigation that doesn't\n // involve prediction (refresh, history traversal, server action, etc.).\n // In these cases, if a mismatch occurs, we still mark the route as having a\n // dynamic rewrite by traversing the known route tree (see\n // dispatchRetryDueToTreeMismatch).\n routeCacheEntry: FulfilledRouteCacheEntry | null\n): AppRouterState {\n // A version of navigate() that accepts the target route tree as an argument\n // rather than reading it from the prefetch cache.\n if (\n process.env.NODE_ENV !== 'production' &&\n process.env.__NEXT_CACHE_COMPONENTS\n ) {\n // Warn when navigating via a `<Link prefetch={true}>` to a route that has\n // not opted into Partial Prefetching. Such a link does a legacy \"full\"\n // prefetch that includes the route's dynamic data, defeating the\n // static/dynamic split that Cache Components provides.\n //\n // This runs at navigation time (rather than prefetch time) so that, in dev\n // where we don't prefetch, the warning only appears when you actually\n // navigate to the route — existing apps with many `prefetch={true}` links\n // aren't flooded with warnings the moment they enable Cache Components.\n const link = getLinkForCurrentNavigation()\n if (\n link !== null &&\n link.fetchStrategy === FetchStrategy.Full &&\n (navigationSeed.routeTree.prefetchHints &\n PrefetchHint.SubtreeHasPartialPrefetching) ===\n 0\n ) {\n const error = createLinkPrefetchPartialError(url.pathname)\n const ownerStack = 'ownerStack' in link ? link.ownerStack : undefined\n if (ownerStack === undefined) {\n console.error(\n '' +\n 'Cannot associate the \"prefetch={true}\" warning with a specific <Link> making it harder to find the cause of the following warning. ' +\n 'This is a bug in Next.js.'\n )\n } else if (ownerStack !== null) {\n // Replace the (useless) stack captured at the throw site — which\n // points into router internals — with the Owner Stack captured when\n // the <Link> rendered. That way the dev overlay associates this\n // warning with the JSX that created the link, not with\n // navigation.ts.\n error.stack = `${error.name}: ${error.message}${ownerStack}`\n }\n console.error(error)\n }\n }\n const accumulation: NavigationRequestAccumulation = {\n separateRefreshUrls: null,\n scrollRef: null,\n }\n // We special case navigations to the exact same URL as the current location.\n // It's a common UI pattern for apps to refresh when you click a link to the\n // current page. So when this happens, we refresh the dynamic data in the page\n // segments.\n //\n // Note that this does not apply if the any part of the hash or search query\n // has changed. This might feel a bit weird but it makes more sense when you\n // consider that the way to trigger this behavior is to click the same link\n // multiple times.\n //\n // TODO: We should probably refresh the *entire* route when this case occurs,\n // not just the page segments. Essentially treating it the same as a refresh()\n // triggered by an action, which is the more explicit way of modeling the UI\n // pattern described above.\n //\n // Also note that this only refreshes the dynamic data, not static/ cached\n // data. If the page segment is fully static and prefetched, the request is\n // skipped. (This is also how refresh() works.)\n const isSamePageNavigation = url.href === currentUrl.href\n const task = startPPRNavigation(\n now,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n navigationSeed.routeTree,\n navigationSeed.metadataVaryPath,\n freshnessPolicy,\n navigationSeed.data,\n navigationSeed.head,\n navigationSeed.dynamicStaleAt,\n isSamePageNavigation,\n accumulation\n )\n if (task !== null) {\n if (freshnessPolicy !== FreshnessPolicy.Gesture) {\n spawnDynamicRequests(\n task,\n url,\n nextUrl,\n freshnessPolicy,\n accumulation,\n routeCacheEntry,\n navigateType,\n navigationLock\n )\n }\n return completeSoftNavigation(\n state,\n url,\n nextUrl,\n task.route,\n task.node,\n navigationSeed.renderedSearch,\n canonicalUrl,\n navigateType,\n scrollBehavior,\n accumulation.scrollRef,\n debugInfo\n )\n }\n // Could not perform a SPA navigation. Revert to a full-page (MPA) navigation.\n return completeHardNavigation(state, url, navigateType)\n}\n\nfunction navigateUsingPrefetchedRouteTree(\n now: number,\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n nextUrl: string | null,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n route: FulfilledRouteCacheEntry,\n navigationLock: NavigationLock\n): AppRouterState {\n const routeTree = route.tree\n const canonicalUrl = route.canonicalUrl + url.hash\n const renderedSearch = route.renderedSearch\n const prefetchSeed: NavigationSeed = {\n renderedSearch,\n routeTree,\n metadataVaryPath: route.metadata.varyPath as any,\n data: null,\n head: null,\n dynamicStaleAt: computeDynamicStaleAt(now, UnknownDynamicStaleTime),\n }\n return navigateToKnownRoute(\n now,\n state,\n url,\n canonicalUrl,\n prefetchSeed,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n nextUrl,\n scrollBehavior,\n navigateType,\n navigationLock,\n null,\n route\n )\n}\n\n// Used to request all the dynamic data for a route, rather than just a subset,\n// e.g. during a refresh or a revalidation. Typically this gets constructed\n// during the normal flow when diffing the route tree, but for an unprefetched\n// navigation, where we don't know the structure of the target route, we use\n// this instead.\nconst DynamicRequestTreeForEntireRoute: FlightRouterState = [\n '',\n {},\n null,\n 'refetch',\n]\n\nasync function navigateToUnknownRoute(\n now: number,\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n nextUrl: string | null,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock\n): Promise<AppRouterState> {\n // Runs when a navigation happens but there's no cached prefetch we can use.\n // Don't bother to wait for a prefetch response; go straight to a full\n // navigation that contains both static and dynamic data in a single stream.\n // (This is unlike the old navigation implementation, which instead blocks\n // the dynamic request until a prefetch request is received.)\n //\n // To avoid duplication of logic, we're going to pretend that the tree\n // returned by the dynamic request is, in fact, a prefetch tree. Then we can\n // use the same server response to write the actual data into the CacheNode\n // tree. So it's the same flow as the \"happy path\" (prefetch, then\n // navigation), except we use a single server response for both stages.\n\n let dynamicRequestTree: FlightRouterState\n switch (freshnessPolicy) {\n case FreshnessPolicy.Default:\n case FreshnessPolicy.HistoryTraversal:\n case FreshnessPolicy.Gesture:\n dynamicRequestTree = currentFlightRouterState\n break\n case FreshnessPolicy.Hydration: // <- shouldn't happen during client nav\n case FreshnessPolicy.RefreshAll:\n case FreshnessPolicy.HMRRefresh:\n dynamicRequestTree = DynamicRequestTreeForEntireRoute\n break\n default:\n freshnessPolicy satisfies never\n dynamicRequestTree = currentFlightRouterState\n break\n }\n\n const promiseForDynamicServerResponse = fetchServerResponse(url, {\n flightRouterState: dynamicRequestTree,\n nextUrl,\n })\n const result = await promiseForDynamicServerResponse\n if (typeof result === 'string') {\n // This is an MPA navigation.\n const redirectUrl = new URL(result, location.origin)\n return completeHardNavigation(state, redirectUrl, navigateType)\n }\n\n const {\n flightData,\n canonicalUrl,\n renderedSearch,\n couldBeIntercepted,\n supportsPerSegmentPrefetching,\n dynamicStaleTime,\n staticStageData,\n runtimePrefetchStream,\n responseHeaders,\n debugInfo,\n } = result\n\n // Since the response format of dynamic requests and prefetches is slightly\n // different, we'll need to massage the data a bit. Create FlightRouterState\n // tree that simulates what we'd receive as the result of a prefetch.\n const navigationSeed = convertServerPatchToFullTree(\n now,\n currentFlightRouterState,\n flightData,\n renderedSearch,\n dynamicStaleTime\n )\n\n // Learn the route pattern so we can predict it for future navigations.\n // hasDynamicRewrite is false because this is a fresh navigation to an\n // unknown route - any rewrite detection happens during the traversal inside\n // discoverKnownRoute. The hasDynamicRewrite param is only set to true when\n // retrying after a tree mismatch (see dispatchRetryDueToTreeMismatch).\n const metadataVaryPath = navigationSeed.metadataVaryPath\n if (metadataVaryPath !== null) {\n discoverKnownRoute(\n now,\n url.pathname,\n url.search as NormalizedSearch,\n nextUrl,\n null, // No pending entry\n navigationSeed.routeTree,\n metadataVaryPath,\n couldBeIntercepted,\n createHrefFromUrl(canonicalUrl),\n supportsPerSegmentPrefetching,\n false // hasDynamicRewrite - not a retry, rewrite detection happens during traversal\n )\n\n if (staticStageData !== null) {\n const { response: staticStageResponse, isResponsePartial } =\n staticStageData\n\n // Write the static stage of the response into the segment cache so that\n // subsequent navigations can serve cached static segments instantly.\n getStaleAt(now, staticStageResponse.s)\n .then((staleAt) => {\n const buildId =\n responseHeaders.get(NEXT_NAV_DEPLOYMENT_ID_HEADER) ??\n staticStageResponse.b\n\n // TODO: Implement Shell extraction as part of Cached Navigations.\n // Intentionally holding off on doing this until we decide how the\n // Cached Navigations behavior should work in combination with App\n // Shells.\n writePrerenderResponseIntoCache(\n now,\n FetchStrategy.PPR,\n staticStageResponse.f,\n buildId,\n staticStageResponse.h,\n staticStageResponse.r ?? null,\n staleAt,\n currentFlightRouterState,\n renderedSearch,\n isResponsePartial\n )\n })\n .catch(() => {\n // The static stage processing failed. Not fatal — the navigation\n // completed normally, we just won't write into the cache.\n })\n }\n\n if (runtimePrefetchStream !== null) {\n processRuntimePrefetchStream(\n now,\n runtimePrefetchStream,\n currentFlightRouterState,\n renderedSearch\n )\n .then((processed) => {\n if (processed !== null) {\n writeDynamicRenderResponseIntoCache(\n now,\n FetchStrategy.PPRRuntime,\n processed.flightDatas,\n processed.buildId,\n processed.isResponsePartial,\n processed.headVaryParams,\n processed.rootVaryParamsIterable,\n processed.staleAt,\n processed.navigationSeed,\n null\n )\n }\n })\n .catch(() => {\n // The runtime prefetch cache write failed. Not fatal — the\n // navigation completed normally, we just won't cache runtime data.\n })\n }\n }\n\n // In the streaming dev render, this single response's seed content may still\n // be streaming when we build the tree below. An unknown-route navigation\n // places that content inline (it has no prior cache entry, so the server\n // sends a full seed rather than the dynamic-only delta a known route gets),\n // and that inline content is not gated like a known route's deferred RSCs. So\n // React could read a still-pending chunk and flash a Suspense fallback\n // (wanted on a cold cache, but not on a warm one). Wait for the shell to\n // flush (`revealAfter`) first, so the inline seed content is decoded by the\n // time React reads it, the same way the known-route path gates its deferred\n // RSCs. `revealAfter` is null outside the streaming dev render. On a cache\n // miss it resolves early, so the cold-cache fallback is still shown.\n if (result.revealAfter !== null) {\n await result.revealAfter\n }\n\n return navigateToKnownRoute(\n now,\n state,\n url,\n createHrefFromUrl(canonicalUrl),\n navigationSeed,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n nextUrl,\n scrollBehavior,\n navigateType,\n navigationLock,\n debugInfo,\n // Unknown route navigations don't use route prediction - the route tree\n // came directly from the server. If a mismatch occurs during dynamic data\n // fetch, the retry handler will traverse the known route tree to mark the\n // entry as having a dynamic rewrite.\n null\n )\n}\n\nexport function completeHardNavigation(\n state: AppRouterState,\n url: URL,\n navigateType: 'push' | 'replace'\n): AppRouterState {\n if (isJavaScriptURLString(url.href)) {\n console.error(\n 'Next.js has blocked a javascript: URL as a security precaution.'\n )\n return state\n }\n const newState: AppRouterState = {\n canonicalUrl:\n url.origin === location.origin ? createHrefFromUrl(url) : url.href,\n pushRef: {\n pendingPush: navigateType === 'push',\n mpaNavigation: true,\n preserveCustomHistoryState: false,\n },\n // TODO: None of the rest of these values are consistent with the incoming\n // navigation. We rely on the fact that AppRouter will suspend and trigger\n // a hard navigation before it accesses any of these values. But instead\n // we should trigger the hard navigation and blocking any subsequent\n // router updates without updating React.\n renderedSearch: state.renderedSearch,\n focusAndScrollRef: state.focusAndScrollRef,\n cache: state.cache,\n tree: state.tree,\n nextUrl: state.nextUrl,\n previousNextUrl: state.previousNextUrl,\n debugInfo: null,\n }\n return newState\n}\n\nexport function completeSoftNavigation(\n oldState: AppRouterState,\n url: URL,\n referringNextUrl: string | null,\n tree: FlightRouterState,\n cache: CacheNode,\n renderedSearch: string,\n canonicalUrl: string,\n navigateType: 'push' | 'replace',\n scrollBehavior: ScrollBehavior,\n scrollRef: ScrollRef | null,\n collectedDebugInfo: Array<unknown> | null\n) {\n // The \"Next-Url\" is a special representation of the URL that Next.js\n // uses to implement interception routes.\n // TODO: Get rid of this extra traversal by computing this during the\n // same traversal that computes the tree itself. We should also figure out\n // what is the minimum information needed for the server to correctly\n // intercept the route.\n const changedPath = computeChangedPath(oldState.tree, tree)\n const nextUrlForNewRoute = changedPath ? changedPath : oldState.nextUrl\n\n // This value is stored on the state as `previousNextUrl`; the naming is\n // confusing. What it represents is the \"Next-Url\" header that was used to\n // fetch the incoming route. It's essentially the refererer URL, but in a\n // Next.js specific format. During refreshes, this is sent back to the server\n // instead of the current route's \"Next-Url\" so that the same interception\n // logic is applied as during the original navigation.\n const previousNextUrl = referringNextUrl\n\n // Check if the only thing that changed was the hash fragment.\n const oldUrl = new URL(oldState.canonicalUrl, url)\n const onlyHashChange =\n // We don't need to compare the origins, because client-driven\n // navigations are always same-origin.\n url.pathname === oldUrl.pathname &&\n url.search === oldUrl.search &&\n url.hash !== oldUrl.hash\n\n // Determine whether and how the page should scroll after this\n // navigation.\n //\n // By default, we scroll to the segments that were navigated to — i.e.\n // segments in the new part of the route, as opposed to shared segments\n // that were already part of the previous route. All newly navigated\n // segments share a single ScrollRef. When they mount, the first one\n // to mount initiates the scroll. They share a ref so that only one\n // scroll happens per navigation.\n //\n // If a subsequent navigation produces new segments, those supersede\n // any pending scroll from the previous navigation by invalidating its\n // ScrollRef. If a navigation doesn't produce any new segments (e.g.\n // a refresh where the route structure didn't change), any pending\n // scrolls from previous navigations are unaffected.\n //\n // The branches below handle special cases layered on top of this\n // default model.\n let activeScrollRef: ScrollRef | null\n let forceScroll: boolean\n if (scrollBehavior === ScrollBehavior.NoScroll) {\n // The user explicitly opted out of scrolling (e.g. scroll={false}\n // on a Link or router.push).\n //\n // If this navigation created new scroll targets (scrollRef !== null),\n // neutralize them. If it didn't, any prior scroll targets carried\n // forward on the cache nodes via reuseSharedCacheNode remain active.\n if (scrollRef !== null) {\n scrollRef.current = false\n }\n activeScrollRef = oldState.focusAndScrollRef.scrollRef\n forceScroll = false\n } else if (onlyHashChange) {\n // Hash-only navigations should scroll regardless of per-node state.\n // Create a fresh ref so the first segment to scroll consumes it.\n //\n // Invalidate any scroll ref from a prior navigation that hasn't\n // been consumed yet.\n const oldScrollRef = oldState.focusAndScrollRef.scrollRef\n if (oldScrollRef !== null) {\n oldScrollRef.current = false\n }\n // Also invalidate any per-node refs that were accumulated during\n // this navigation's tree construction — the hash-only ref\n // supersedes them.\n if (scrollRef !== null) {\n scrollRef.current = false\n }\n activeScrollRef = { current: true }\n forceScroll = true\n } else {\n // Default case. Use the accumulated scrollRef (may be null if no\n // new segments were created). The handler checks per-node refs, so\n // unchanged parallel route slots won't scroll.\n activeScrollRef = scrollRef\n\n // If this navigation created new scroll targets, invalidate any\n // pending scroll from a previous navigation.\n if (scrollRef !== null) {\n const oldScrollRef = oldState.focusAndScrollRef.scrollRef\n if (oldScrollRef !== null) {\n oldScrollRef.current = false\n }\n }\n forceScroll = false\n }\n\n const newState: AppRouterState = {\n canonicalUrl,\n renderedSearch,\n pushRef: {\n pendingPush: navigateType === 'push',\n mpaNavigation: false,\n preserveCustomHistoryState: false,\n },\n focusAndScrollRef: {\n scrollRef: activeScrollRef,\n forceScroll,\n onlyHashChange,\n hashFragment:\n // Remove leading # and decode hash to make non-latin hashes work.\n //\n // Empty hash should trigger default behavior of scrolling layout into\n // view. #top is handled in layout-router.\n //\n // Refer to `ScrollAndFocusHandler` for details on how this is used.\n scrollBehavior !== ScrollBehavior.NoScroll && url.hash !== ''\n ? decodeURIComponent(url.hash.slice(1))\n : oldState.focusAndScrollRef.hashFragment,\n },\n cache,\n tree,\n nextUrl: nextUrlForNewRoute,\n previousNextUrl,\n debugInfo: collectedDebugInfo,\n }\n return newState\n}\n\nexport function completeTraverseNavigation(\n state: AppRouterState,\n url: URL,\n renderedSearch: string,\n cache: CacheNode,\n tree: FlightRouterState,\n nextUrl: string | null\n) {\n return {\n // Set canonical url\n canonicalUrl: createHrefFromUrl(url),\n renderedSearch,\n pushRef: {\n pendingPush: false,\n mpaNavigation: false,\n // Ensures that the custom history state that was set is preserved when applying this update.\n preserveCustomHistoryState: true,\n },\n focusAndScrollRef: state.focusAndScrollRef,\n cache,\n // Restore provided tree\n tree,\n nextUrl,\n // TODO: We need to restore previousNextUrl, too, which represents the\n // Next-Url that was used to fetch the data. Anywhere we fetch using the\n // canonical URL, there should be a corresponding Next-Url.\n previousNextUrl: null,\n debugInfo: null,\n }\n}\n\n// TODO: The rest of this file is related to converting the server response into\n// the data structures used by the client. Probably should move to a\n// separate module.\n\nexport type NavigationSeed = {\n renderedSearch: string\n routeTree: RouteTree\n metadataVaryPath: PageVaryPath | null\n data: CacheNodeSeedData | null\n head: HeadData | null\n dynamicStaleAt: number\n}\n\nexport function convertServerPatchToFullTree(\n now: number,\n currentTree: FlightRouterState,\n flightData: Array<NormalizedFlightData> | null,\n renderedSearch: string,\n dynamicStaleTimeSeconds: number\n): NavigationSeed {\n // During a client navigation or prefetch, the server sends back only a patch\n // for the parts of the tree that have changed.\n //\n // This applies the patch to the base tree to create a full representation of\n // the resulting tree.\n //\n // The return type includes a full FlightRouterState tree and a full\n // CacheNodeSeedData tree. (Conceptually these are the same tree, and should\n // eventually be unified, but there's still lots of existing code that\n // operates on FlightRouterState trees alone without the CacheNodeSeedData.)\n //\n // TODO: This similar to what apply-router-state-patch-to-tree does. It\n // will eventually fully replace it. We should get rid of all the remaining\n // places where we iterate over the server patch format. This should also\n // eventually replace normalizeFlightData.\n\n let baseTree: FlightRouterState = currentTree\n let baseData: CacheNodeSeedData | null = null\n let head: HeadData | null = null\n if (flightData !== null) {\n for (const {\n segmentPath,\n tree: treePatch,\n seedData: dataPatch,\n head: headPatch,\n } of flightData) {\n const result = convertServerPatchToFullTreeImpl(\n baseTree,\n baseData,\n treePatch,\n dataPatch,\n segmentPath,\n renderedSearch,\n 0\n )\n baseTree = result.tree\n baseData = result.data\n // This is the same for all patches per response, so just pick an\n // arbitrary one\n head = headPatch\n }\n }\n\n const finalFlightRouterState = baseTree\n\n // Convert the final FlightRouterState into a RouteTree type.\n //\n // TODO: Eventually, FlightRouterState will evolve to being a transport format\n // only. The RouteTree type will become the main type used for dealing with\n // routes on the client, and we'll store it in the state directly.\n const acc = { metadataVaryPath: null }\n const routeTree = convertRootFlightRouterStateToRouteTree(\n finalFlightRouterState,\n renderedSearch as NormalizedSearch,\n acc\n )\n\n return {\n routeTree,\n metadataVaryPath: acc.metadataVaryPath,\n data: baseData,\n renderedSearch,\n head,\n dynamicStaleAt: computeDynamicStaleAt(now, dynamicStaleTimeSeconds),\n }\n}\n\nfunction convertServerPatchToFullTreeImpl(\n baseRouterState: FlightRouterState,\n baseData: CacheNodeSeedData | null,\n treePatch: FlightRouterState,\n dataPatch: CacheNodeSeedData | null,\n segmentPath: FlightSegmentPath,\n renderedSearch: string,\n index: number\n): { tree: FlightRouterState; data: CacheNodeSeedData | null } {\n if (index === segmentPath.length) {\n // We reached the part of the tree that we need to patch.\n return {\n tree: treePatch,\n data: dataPatch,\n }\n }\n\n // segmentPath represents the parent path of subtree. It's a repeating\n // pattern of parallel route key and segment:\n //\n // [string, Segment, string, Segment, string, Segment, ...]\n //\n // This path tells us which part of the base tree to apply the tree patch.\n //\n // NOTE: We receive the FlightRouterState patch in the same request as the\n // seed data patch. Therefore we don't need to worry about diffing the segment\n // values; we can assume the server sent us a correct result.\n const updatedParallelRouteKey: string = segmentPath[index]\n // const segment: Segment = segmentPath[index + 1] <-- Not used, see note above\n\n const baseTreeChildren = baseRouterState[1]\n const baseSeedDataChildren = baseData !== null ? baseData[1] : null\n const newTreeChildren: Record<string, FlightRouterState> = {}\n const newSeedDataChildren: Record<string, CacheNodeSeedData | null> = {}\n for (const parallelRouteKey in baseTreeChildren) {\n const childBaseRouterState = baseTreeChildren[parallelRouteKey]\n const childBaseSeedData =\n baseSeedDataChildren !== null\n ? (baseSeedDataChildren[parallelRouteKey] ?? null)\n : null\n if (parallelRouteKey === updatedParallelRouteKey) {\n const result = convertServerPatchToFullTreeImpl(\n childBaseRouterState,\n childBaseSeedData,\n treePatch,\n dataPatch,\n segmentPath,\n renderedSearch,\n // Advance the index by two and keep cloning until we reach\n // the end of the segment path.\n index + 2\n )\n\n newTreeChildren[parallelRouteKey] = result.tree\n newSeedDataChildren[parallelRouteKey] = result.data\n } else {\n // This child is not being patched. Copy it over as-is.\n newTreeChildren[parallelRouteKey] = childBaseRouterState\n newSeedDataChildren[parallelRouteKey] = childBaseSeedData\n }\n }\n\n let clonedTree: FlightRouterState\n let clonedSeedData: CacheNodeSeedData\n // Clone all the fields except the children.\n\n // Clone the FlightRouterState tree. Based on equivalent logic in\n // apply-router-state-patch-to-tree, but should confirm whether we need to\n // copy all of these fields. Not sure the server ever sends, e.g. the\n // refetch marker.\n clonedTree = [baseRouterState[0], newTreeChildren]\n if (2 in baseRouterState) {\n const compressedRefreshState = baseRouterState[2]\n if (\n compressedRefreshState !== undefined &&\n compressedRefreshState !== null\n ) {\n // Since this part of the tree was patched with new data, any parent\n // refresh states should be updated to reflect the new rendered search\n // value. (The refresh state acts like a \"context provider\".) All pages\n // within the same server response share the same renderedSearch value,\n // but the same RouteTree could be composed from multiple different\n // routes, and multiple responses.\n clonedTree[2] = [compressedRefreshState[0], renderedSearch]\n }\n }\n if (3 in baseRouterState) {\n clonedTree[3] = baseRouterState[3]\n }\n // Recompute the propagated \"subtree\" prefetch hints for this segment. Mirrors\n // the propagation done on the server in\n // createFlightRouterStateFromLoaderTree.\n let prefetchHints = (baseRouterState[4] ?? 0) & ~SubtreePrefetchHints\n for (const parallelRouteKey in newTreeChildren) {\n const childHints = newTreeChildren[parallelRouteKey][4]\n if (childHints !== undefined) {\n prefetchHints = propagateSubtreeBits(prefetchHints, childHints)\n }\n }\n if (prefetchHints !== 0) {\n clonedTree[4] = prefetchHints\n }\n\n // Clone the CacheNodeSeedData tree.\n const isEmptySeedDataPartial = true\n clonedSeedData = [\n null,\n newSeedDataChildren,\n null,\n isEmptySeedDataPartial,\n null,\n ]\n\n return {\n tree: clonedTree,\n data: clonedSeedData,\n }\n}\n\n/**\n * Instant Navigation Testing API: ensures a prefetch task has been initiated\n * and completed before proceeding with the navigation. This guarantees that\n * segment data requests are at least pending, even for routes whose route\n * tree is already cached.\n *\n * After the prefetch completes, delegates to the normal navigation flow.\n */\nasync function ensurePrefetchThenNavigate(\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n nextUrl: string | null,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock\n): Promise<AppRouterState> {\n const link = getLinkForCurrentNavigation()\n const fetchStrategy = link !== null ? link.fetchStrategy : FetchStrategy.PPR\n\n const cacheKey = createCacheKey(url.href, nextUrl)\n\n await new Promise<void>((resolve) => {\n schedulePrefetchTask(\n cacheKey,\n currentFlightRouterState,\n fetchStrategy,\n PrefetchPriority.Default,\n null, // onInvalidate\n resolve // _onComplete callback\n )\n })\n\n // Prefetch is complete. Proceed with the normal navigation flow, which\n // will now find the route in the cache.\n const result = await navigateImpl(\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n nextUrl,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n )\n\n // Only transition to captured-SPA once the navigation is known to be an SPA.\n // If the result is an MPA navigation, leave the cookie pending and let the new\n // document load transition it to captured-MPA.\n if (!result.pushRef.mpaNavigation) {\n const { updateCapturedSPAToTree } =\n require('./navigation-testing-lock') as typeof import('./navigation-testing-lock')\n updateCapturedSPAToTree(currentFlightRouterState, result.tree)\n }\n\n return result\n}\n"],"names":["PrefetchHint","SubtreePrefetchHints","propagateSubtreeBits","fetchServerResponse","startPPRNavigation","spawnDynamicRequests","FreshnessPolicy","getCurrentNavigationLock","createHrefFromUrl","NEXT_NAV_DEPLOYMENT_ID_HEADER","EntryStatus","readRouteCacheEntry","deprecated_requestOptimisticRouteCacheEntry","convertRootFlightRouterStateToRouteTree","getStaleAt","writePrerenderResponseIntoCache","processRuntimePrefetchStream","writeDynamicRenderResponseIntoCache","discoverKnownRoute","createCacheKey","schedulePrefetchTask","PrefetchPriority","FetchStrategy","getLinkForCurrentNavigation","ScrollBehavior","computeChangedPath","isJavaScriptURLString","UnknownDynamicStaleTime","computeDynamicStaleAt","createLinkPrefetchPartialError","navigate","state","url","currentUrl","currentRenderedSearch","currentCacheNode","currentFlightRouterState","nextUrl","freshnessPolicy","scrollBehavior","navigateType","navigationLock","process","env","__NEXT_EXPOSE_TESTING_API","isNavigationLocked","require","ensurePrefetchThenNavigate","navigateImpl","now","Date","href","cacheKey","route","status","Fulfilled","navigateUsingPrefetchedRouteTree","__NEXT_OPTIMISTIC_ROUTING","Rejected","optimisticRoute","navigateToUnknownRoute","catch","navigateToKnownRoute","canonicalUrl","navigationSeed","debugInfo","routeCacheEntry","NODE_ENV","__NEXT_CACHE_COMPONENTS","link","fetchStrategy","Full","routeTree","prefetchHints","SubtreeHasPartialPrefetching","error","pathname","ownerStack","undefined","console","stack","name","message","accumulation","separateRefreshUrls","scrollRef","isSamePageNavigation","task","metadataVaryPath","data","head","dynamicStaleAt","Gesture","completeSoftNavigation","node","renderedSearch","completeHardNavigation","tree","hash","prefetchSeed","metadata","varyPath","DynamicRequestTreeForEntireRoute","dynamicRequestTree","Default","HistoryTraversal","Hydration","RefreshAll","HMRRefresh","promiseForDynamicServerResponse","flightRouterState","result","redirectUrl","URL","location","origin","flightData","couldBeIntercepted","supportsPerSegmentPrefetching","dynamicStaleTime","staticStageData","runtimePrefetchStream","responseHeaders","convertServerPatchToFullTree","search","response","staticStageResponse","isResponsePartial","s","then","staleAt","buildId","get","b","PPR","f","h","r","processed","PPRRuntime","flightDatas","headVaryParams","rootVaryParamsIterable","revealAfter","newState","pushRef","pendingPush","mpaNavigation","preserveCustomHistoryState","focusAndScrollRef","cache","previousNextUrl","oldState","referringNextUrl","collectedDebugInfo","changedPath","nextUrlForNewRoute","oldUrl","onlyHashChange","activeScrollRef","forceScroll","NoScroll","current","oldScrollRef","hashFragment","decodeURIComponent","slice","completeTraverseNavigation","currentTree","dynamicStaleTimeSeconds","baseTree","baseData","segmentPath","treePatch","seedData","dataPatch","headPatch","convertServerPatchToFullTreeImpl","finalFlightRouterState","acc","baseRouterState","index","length","updatedParallelRouteKey","baseTreeChildren","baseSeedDataChildren","newTreeChildren","newSeedDataChildren","parallelRouteKey","childBaseRouterState","childBaseSeedData","clonedTree","clonedSeedData","compressedRefreshState","childHints","isEmptySeedDataPartial","Promise","resolve","updateCapturedSPAToTree"],"mappings":"AAQA,SACEA,YAAY,EACZC,oBAAoB,EACpBC,oBAAoB,QACf,uCAAsC;AAE7C,SAASC,mBAAmB,QAAQ,0CAAyC;AAC7E,SACEC,kBAAkB,EAClBC,oBAAoB,EACpBC,eAAe,EACfC,wBAAwB,QAGnB,oCAAmC;AAC1C,SAASC,iBAAiB,QAAQ,yCAAwC;AAC1E,SAASC,6BAA6B,QAAQ,yBAAwB;AACtE,SACEC,WAAW,EACXC,mBAAmB,EACnBC,2CAA2C,EAC3CC,uCAAuC,EACvCC,UAAU,EACVC,+BAA+B,EAC/BC,4BAA4B,EAC5BC,mCAAmC,QAG9B,UAAS;AAChB,SAASC,kBAAkB,QAAQ,sBAAqB;AACxD,SAASC,cAAc,QAA+B,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9C;IACb,MAAM+C,gBAAgBD,SAAS,OAAOA,KAAKC,aAAa,GAAGhD,cAAcgH,GAAG;IAE5E,MAAMlF,WAAWjC,eAAea,IAAImB,IAAI,EAAEd;IAE1C,MAAM,IAAI+J,QAAc,CAACC;QACvBjL,qBACEgC,UACAhB,0BACAkC,eACAjD,iBAAiBmF,OAAO,EACxB,MACA6F,QAAQ,uBAAuB;;IAEnC;IAEA,uEAAuE;IACvE,wCAAwC;IACxC,MAAMtF,SAAS,MAAM/D,aACnBjB,OACAC,KACAC,YACAC,uBACAC,kBACAC,0BACAC,SACAC,iBACAC,gBACAC,cACAC;IAGF,6EAA6E;IAC7E,+EAA+E;IAC/E,+CAA+C;IAC/C,IAAI,CAACsE,OAAOkC,OAAO,CAACE,aAAa,EAAE;QACjC,MAAM,EAAEmD,uBAAuB,EAAE,GAC/BxJ,QAAQ;QACVwJ,wBAAwBlK,0BAA0B2E,OAAOd,IAAI;IAC/D;IAEA,OAAOc;AACT","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../../src/client/components/segment-cache/navigation.ts"],"sourcesContent":["import type {\n CacheNodeSeedData,\n FlightRouterState,\n FlightSegmentPath,\n ScrollRef,\n} from '../../../shared/lib/app-router-types'\nimport type { CacheNode } from '../../../shared/lib/app-router-types'\nimport type { HeadData } from '../../../shared/lib/app-router-types'\nimport {\n PrefetchHint,\n SubtreePrefetchHints,\n propagateSubtreeBits,\n} from '../../../shared/lib/app-router-types'\nimport type { NormalizedFlightData } from '../../flight-data-helpers'\nimport { fetchServerResponse } from '../router-reducer/fetch-server-response'\nimport {\n startPPRNavigation,\n spawnDynamicRequests,\n FreshnessPolicy,\n getCurrentNavigationLock,\n type NavigationLock,\n type NavigationRequestAccumulation,\n} from '../router-reducer/ppr-navigations'\nimport { createHrefFromUrl } from '../router-reducer/create-href-from-url'\nimport { NEXT_NAV_DEPLOYMENT_ID_HEADER } from '../../../lib/constants'\nimport {\n EntryStatus,\n readRouteCacheEntry,\n deprecated_requestOptimisticRouteCacheEntry,\n convertRootFlightRouterStateToRouteTree,\n getStaleAt,\n writePrerenderResponseIntoCache,\n processRuntimePrefetchStream,\n writeDynamicRenderResponseIntoCache,\n type RouteTree,\n type FulfilledRouteCacheEntry,\n} from './cache'\nimport { discoverKnownRoute } from './optimistic-routes'\nimport { createCacheKey, type NormalizedSearch } from './cache-key'\nimport { schedulePrefetchTask } from './scheduler'\nimport { PrefetchPriority, FetchStrategy } from './types'\nimport { getLinkForCurrentNavigation } from '../links'\nimport type { PageVaryPath } from './vary-path'\nimport type { AppRouterState } from '../router-reducer/router-reducer-types'\nimport { ScrollBehavior } from '../router-reducer/router-reducer-types'\nimport { computeChangedPath } from '../router-reducer/compute-changed-path'\nimport { isJavaScriptURLString } from '../../lib/javascript-url'\nimport { UnknownDynamicStaleTime, computeDynamicStaleAt } from './bfcache'\nimport { createLinkPrefetchPartialError } from '../../../shared/lib/instant-messages'\n\n/**\n * Navigate to a new URL, using the Segment Cache to construct a response.\n *\n * To allow for synchronous navigations whenever possible, this is not an async\n * function. It returns a promise only if there's no matching prefetch in\n * the cache. Otherwise it returns an immediate result and uses Suspense/RSC to\n * stream in any missing data.\n */\nexport function navigate(\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n nextUrl: string | null,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace'\n): AppRouterState | Promise<AppRouterState> {\n let navigationLock: NavigationLock = null\n\n // Instant Navigation Testing API: when the lock is active, ensure a\n // prefetch task has been initiated before proceeding with the navigation.\n // This guarantees that segment data requests are at least pending, even\n // for routes that already have a cached route tree. Without this, the\n // shell might be incomplete because some segments were never\n // requested.\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n const { isNavigationLocked } =\n require('./navigation-testing-lock') as typeof import('./navigation-testing-lock')\n if (isNavigationLocked()) {\n navigationLock = getCurrentNavigationLock()\n return ensurePrefetchThenNavigate(\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n nextUrl,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n )\n }\n }\n\n return navigateImpl(\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n nextUrl,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n )\n}\n\nfunction navigateImpl(\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n nextUrl: string | null,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock\n): AppRouterState | Promise<AppRouterState> {\n const now = Date.now()\n const href = url.href\n\n const cacheKey = createCacheKey(href, nextUrl)\n const route = readRouteCacheEntry(now, cacheKey)\n if (route !== null && route.status === EntryStatus.Fulfilled) {\n // We have a matching prefetch.\n return navigateUsingPrefetchedRouteTree(\n now,\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n route,\n navigationLock\n )\n }\n\n // There was no matching route tree in the cache. Let's see if we can\n // construct an \"optimistic\" route tree using the deprecated search-params\n // based matching. This is only used when the new optimisticRouting flag is\n // disabled.\n //\n // Do not construct an optimistic route tree if there was a cache hit, but\n // the entry has a rejected status, since it may have been rejected due to a\n // rewrite or redirect based on the search params.\n //\n // TODO: There are multiple reasons a prefetch might be rejected; we should\n // track them explicitly and choose what to do here based on that.\n if (!process.env.__NEXT_OPTIMISTIC_ROUTING) {\n if (route === null || route.status !== EntryStatus.Rejected) {\n const optimisticRoute = deprecated_requestOptimisticRouteCacheEntry(\n now,\n url,\n nextUrl\n )\n if (optimisticRoute !== null) {\n // We have an optimistic route tree. Proceed with the normal flow.\n return navigateUsingPrefetchedRouteTree(\n now,\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n optimisticRoute,\n navigationLock\n )\n }\n }\n }\n\n // There's no matching prefetch for this route in the cache. We must lazily\n // fetch it from the server before we can perform the navigation.\n //\n // TODO: If this is a gesture navigation, instead of performing a\n // dynamic request, we should do a runtime prefetch.\n return navigateToUnknownRoute(\n now,\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n ).catch(() => {\n // If the navigation fails, return the current state\n return state\n })\n}\n\nexport function navigateToKnownRoute(\n now: number,\n state: AppRouterState,\n url: URL,\n canonicalUrl: string,\n navigationSeed: NavigationSeed,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n freshnessPolicy: FreshnessPolicy,\n nextUrl: string | null,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock,\n debugInfo: Array<unknown> | null,\n // The route cache entry used for this navigation, if it came from route\n // prediction. Passed through so it can be marked as having a dynamic rewrite\n // if the server returns a different pathname (indicating dynamic rewrite\n // behavior).\n //\n // When null, the navigation did not use route prediction - either because\n // the route was already fully cached, or it's a navigation that doesn't\n // involve prediction (refresh, history traversal, server action, etc.).\n // In these cases, if a mismatch occurs, we still mark the route as having a\n // dynamic rewrite by traversing the known route tree (see\n // dispatchRetryDueToTreeMismatch).\n routeCacheEntry: FulfilledRouteCacheEntry | null\n): AppRouterState {\n // A version of navigate() that accepts the target route tree as an argument\n // rather than reading it from the prefetch cache.\n if (\n process.env.NODE_ENV !== 'production' &&\n process.env.__NEXT_CACHE_COMPONENTS\n ) {\n // Warn when navigating via a `<Link prefetch={true}>` to a route that has\n // not opted into Partial Prefetching. Such a link does a legacy \"full\"\n // prefetch that includes the route's dynamic data, defeating the\n // static/dynamic split that Cache Components provides.\n //\n // This runs at navigation time (rather than prefetch time) so that, in dev\n // where we don't prefetch, the warning only appears when you actually\n // navigate to the route — existing apps with many `prefetch={true}` links\n // aren't flooded with warnings the moment they enable Cache Components.\n //\n // The warning is suppressed if any segment on the target route exports\n // `instant = false`, which is the explicit API for opting a route out of\n // this validation.\n const link = getLinkForCurrentNavigation()\n if (\n link !== null &&\n link.fetchStrategy === FetchStrategy.Full &&\n (navigationSeed.routeTree.prefetchHints &\n (PrefetchHint.SubtreeHasPartialPrefetching |\n PrefetchHint.SubtreeHasInstantFalse)) ===\n 0\n ) {\n const error = createLinkPrefetchPartialError(url.pathname)\n const ownerStack = 'ownerStack' in link ? link.ownerStack : undefined\n if (ownerStack === undefined) {\n console.error(\n '' +\n 'Cannot associate the \"prefetch={true}\" warning with a specific <Link> making it harder to find the cause of the following warning. ' +\n 'This is a bug in Next.js.'\n )\n } else if (ownerStack !== null) {\n // Replace the (useless) stack captured at the throw site — which\n // points into router internals — with the Owner Stack captured when\n // the <Link> rendered. That way the dev overlay associates this\n // warning with the JSX that created the link, not with\n // navigation.ts.\n error.stack = `${error.name}: ${error.message}${ownerStack}`\n }\n console.error(error)\n }\n }\n\n // Instant Navigation Testing API: when the lock is held, restrict segment\n // reads to shell entries if the target route would only have prefetched\n // its shell.\n let restrictToShell = false\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n const { shouldRestrictNavigationToShell } =\n require('./navigation-testing-lock') as typeof import('./navigation-testing-lock')\n const link = getLinkForCurrentNavigation()\n restrictToShell = shouldRestrictNavigationToShell(\n navigationSeed.routeTree.prefetchHints,\n link !== null ? link.fetchStrategy : FetchStrategy.PPR\n )\n }\n\n const accumulation: NavigationRequestAccumulation = {\n separateRefreshUrls: null,\n scrollRef: null,\n }\n // We special case navigations to the exact same URL as the current location.\n // It's a common UI pattern for apps to refresh when you click a link to the\n // current page. So when this happens, we refresh the dynamic data in the page\n // segments.\n //\n // Note that this does not apply if the any part of the hash or search query\n // has changed. This might feel a bit weird but it makes more sense when you\n // consider that the way to trigger this behavior is to click the same link\n // multiple times.\n //\n // TODO: We should probably refresh the *entire* route when this case occurs,\n // not just the page segments. Essentially treating it the same as a refresh()\n // triggered by an action, which is the more explicit way of modeling the UI\n // pattern described above.\n //\n // Also note that this only refreshes the dynamic data, not static/ cached\n // data. If the page segment is fully static and prefetched, the request is\n // skipped. (This is also how refresh() works.)\n const isSamePageNavigation = url.href === currentUrl.href\n const task = startPPRNavigation(\n now,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n navigationSeed.routeTree,\n navigationSeed.metadataVaryPath,\n freshnessPolicy,\n navigationSeed.data,\n navigationSeed.head,\n navigationSeed.dynamicStaleAt,\n isSamePageNavigation,\n accumulation,\n restrictToShell\n )\n if (task !== null) {\n if (freshnessPolicy !== FreshnessPolicy.Gesture) {\n spawnDynamicRequests(\n task,\n url,\n nextUrl,\n freshnessPolicy,\n accumulation,\n routeCacheEntry,\n navigateType,\n navigationLock\n )\n }\n return completeSoftNavigation(\n state,\n url,\n nextUrl,\n task.route,\n task.node,\n navigationSeed.renderedSearch,\n canonicalUrl,\n navigateType,\n scrollBehavior,\n accumulation.scrollRef,\n debugInfo\n )\n }\n // Could not perform a SPA navigation. Revert to a full-page (MPA) navigation.\n return completeHardNavigation(state, url, navigateType)\n}\n\nfunction navigateUsingPrefetchedRouteTree(\n now: number,\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n nextUrl: string | null,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n route: FulfilledRouteCacheEntry,\n navigationLock: NavigationLock\n): AppRouterState {\n const routeTree = route.tree\n const canonicalUrl = route.canonicalUrl + url.hash\n const renderedSearch = route.renderedSearch\n const prefetchSeed: NavigationSeed = {\n renderedSearch,\n routeTree,\n metadataVaryPath: route.metadata.varyPath as any,\n data: null,\n head: null,\n dynamicStaleAt: computeDynamicStaleAt(now, UnknownDynamicStaleTime),\n }\n return navigateToKnownRoute(\n now,\n state,\n url,\n canonicalUrl,\n prefetchSeed,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n nextUrl,\n scrollBehavior,\n navigateType,\n navigationLock,\n null,\n route\n )\n}\n\n// Used to request all the dynamic data for a route, rather than just a subset,\n// e.g. during a refresh or a revalidation. Typically this gets constructed\n// during the normal flow when diffing the route tree, but for an unprefetched\n// navigation, where we don't know the structure of the target route, we use\n// this instead.\nconst DynamicRequestTreeForEntireRoute: FlightRouterState = [\n '',\n {},\n null,\n 'refetch',\n]\n\nasync function navigateToUnknownRoute(\n now: number,\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n nextUrl: string | null,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock\n): Promise<AppRouterState> {\n // Runs when a navigation happens but there's no cached prefetch we can use.\n // Don't bother to wait for a prefetch response; go straight to a full\n // navigation that contains both static and dynamic data in a single stream.\n // (This is unlike the old navigation implementation, which instead blocks\n // the dynamic request until a prefetch request is received.)\n //\n // To avoid duplication of logic, we're going to pretend that the tree\n // returned by the dynamic request is, in fact, a prefetch tree. Then we can\n // use the same server response to write the actual data into the CacheNode\n // tree. So it's the same flow as the \"happy path\" (prefetch, then\n // navigation), except we use a single server response for both stages.\n\n let dynamicRequestTree: FlightRouterState\n switch (freshnessPolicy) {\n case FreshnessPolicy.Default:\n case FreshnessPolicy.HistoryTraversal:\n case FreshnessPolicy.Gesture:\n dynamicRequestTree = currentFlightRouterState\n break\n case FreshnessPolicy.Hydration: // <- shouldn't happen during client nav\n case FreshnessPolicy.RefreshAll:\n case FreshnessPolicy.HMRRefresh:\n dynamicRequestTree = DynamicRequestTreeForEntireRoute\n break\n default:\n freshnessPolicy satisfies never\n dynamicRequestTree = currentFlightRouterState\n break\n }\n\n const promiseForDynamicServerResponse = fetchServerResponse(url, {\n flightRouterState: dynamicRequestTree,\n nextUrl,\n })\n const result = await promiseForDynamicServerResponse\n if (typeof result === 'string') {\n // This is an MPA navigation.\n const redirectUrl = new URL(result, location.origin)\n return completeHardNavigation(state, redirectUrl, navigateType)\n }\n\n const {\n flightData,\n canonicalUrl,\n renderedSearch,\n couldBeIntercepted,\n supportsPerSegmentPrefetching,\n dynamicStaleTime,\n staticStageData,\n runtimePrefetchStream,\n responseHeaders,\n debugInfo,\n } = result\n\n // Since the response format of dynamic requests and prefetches is slightly\n // different, we'll need to massage the data a bit. Create FlightRouterState\n // tree that simulates what we'd receive as the result of a prefetch.\n const navigationSeed = convertServerPatchToFullTree(\n now,\n currentFlightRouterState,\n flightData,\n renderedSearch,\n dynamicStaleTime\n )\n\n // Learn the route pattern so we can predict it for future navigations.\n // hasDynamicRewrite is false because this is a fresh navigation to an\n // unknown route - any rewrite detection happens during the traversal inside\n // discoverKnownRoute. The hasDynamicRewrite param is only set to true when\n // retrying after a tree mismatch (see dispatchRetryDueToTreeMismatch).\n const metadataVaryPath = navigationSeed.metadataVaryPath\n if (metadataVaryPath !== null) {\n discoverKnownRoute(\n now,\n url.pathname,\n url.search as NormalizedSearch,\n nextUrl,\n null, // No pending entry\n navigationSeed.routeTree,\n metadataVaryPath,\n couldBeIntercepted,\n createHrefFromUrl(canonicalUrl),\n supportsPerSegmentPrefetching,\n false // hasDynamicRewrite - not a retry, rewrite detection happens during traversal\n )\n\n if (staticStageData !== null) {\n const { response: staticStageResponse, isResponsePartial } =\n staticStageData\n\n // Write the static stage of the response into the segment cache so that\n // subsequent navigations can serve cached static segments instantly.\n getStaleAt(now, staticStageResponse.s)\n .then((staleAt) => {\n const buildId =\n responseHeaders.get(NEXT_NAV_DEPLOYMENT_ID_HEADER) ??\n staticStageResponse.b\n\n // TODO: Implement Shell extraction as part of Cached Navigations.\n // Intentionally holding off on doing this until we decide how the\n // Cached Navigations behavior should work in combination with App\n // Shells.\n writePrerenderResponseIntoCache(\n now,\n FetchStrategy.PPR,\n staticStageResponse.f,\n buildId,\n staticStageResponse.h,\n staticStageResponse.r ?? null,\n staleAt,\n currentFlightRouterState,\n renderedSearch,\n isResponsePartial\n )\n })\n .catch(() => {\n // The static stage processing failed. Not fatal — the navigation\n // completed normally, we just won't write into the cache.\n })\n }\n\n if (runtimePrefetchStream !== null) {\n processRuntimePrefetchStream(\n now,\n runtimePrefetchStream,\n currentFlightRouterState,\n renderedSearch\n )\n .then((processed) => {\n if (processed !== null) {\n writeDynamicRenderResponseIntoCache(\n now,\n FetchStrategy.PPRRuntime,\n processed.flightDatas,\n processed.buildId,\n processed.isResponsePartial,\n processed.headVaryParams,\n processed.rootVaryParamsIterable,\n processed.staleAt,\n processed.navigationSeed,\n null\n )\n }\n })\n .catch(() => {\n // The runtime prefetch cache write failed. Not fatal — the\n // navigation completed normally, we just won't cache runtime data.\n })\n }\n }\n\n // In the streaming dev render, this single response's seed content may still\n // be streaming when we build the tree below. An unknown-route navigation\n // places that content inline (it has no prior cache entry, so the server\n // sends a full seed rather than the dynamic-only delta a known route gets),\n // and that inline content is not gated like a known route's deferred RSCs. So\n // React could read a still-pending chunk and flash a Suspense fallback\n // (wanted on a cold cache, but not on a warm one). Wait for the shell to\n // flush (`revealAfter`) first, so the inline seed content is decoded by the\n // time React reads it, the same way the known-route path gates its deferred\n // RSCs. `revealAfter` is null outside the streaming dev render. On a cache\n // miss it resolves early, so the cold-cache fallback is still shown.\n if (result.revealAfter !== null) {\n await result.revealAfter\n }\n\n return navigateToKnownRoute(\n now,\n state,\n url,\n createHrefFromUrl(canonicalUrl),\n navigationSeed,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n nextUrl,\n scrollBehavior,\n navigateType,\n navigationLock,\n debugInfo,\n // Unknown route navigations don't use route prediction - the route tree\n // came directly from the server. If a mismatch occurs during dynamic data\n // fetch, the retry handler will traverse the known route tree to mark the\n // entry as having a dynamic rewrite.\n null\n )\n}\n\nexport function completeHardNavigation(\n state: AppRouterState,\n url: URL,\n navigateType: 'push' | 'replace'\n): AppRouterState {\n if (isJavaScriptURLString(url.href)) {\n console.error(\n 'Next.js has blocked a javascript: URL as a security precaution.'\n )\n return state\n }\n const newState: AppRouterState = {\n canonicalUrl:\n url.origin === location.origin ? createHrefFromUrl(url) : url.href,\n pushRef: {\n pendingPush: navigateType === 'push',\n mpaNavigation: true,\n preserveCustomHistoryState: false,\n },\n // TODO: None of the rest of these values are consistent with the incoming\n // navigation. We rely on the fact that AppRouter will suspend and trigger\n // a hard navigation before it accesses any of these values. But instead\n // we should trigger the hard navigation and blocking any subsequent\n // router updates without updating React.\n renderedSearch: state.renderedSearch,\n focusAndScrollRef: state.focusAndScrollRef,\n cache: state.cache,\n tree: state.tree,\n nextUrl: state.nextUrl,\n previousNextUrl: state.previousNextUrl,\n debugInfo: null,\n }\n return newState\n}\n\nexport function completeSoftNavigation(\n oldState: AppRouterState,\n url: URL,\n referringNextUrl: string | null,\n tree: FlightRouterState,\n cache: CacheNode,\n renderedSearch: string,\n canonicalUrl: string,\n navigateType: 'push' | 'replace',\n scrollBehavior: ScrollBehavior,\n scrollRef: ScrollRef | null,\n collectedDebugInfo: Array<unknown> | null\n) {\n // The \"Next-Url\" is a special representation of the URL that Next.js\n // uses to implement interception routes.\n // TODO: Get rid of this extra traversal by computing this during the\n // same traversal that computes the tree itself. We should also figure out\n // what is the minimum information needed for the server to correctly\n // intercept the route.\n const changedPath = computeChangedPath(oldState.tree, tree)\n const nextUrlForNewRoute = changedPath ? changedPath : oldState.nextUrl\n\n // This value is stored on the state as `previousNextUrl`; the naming is\n // confusing. What it represents is the \"Next-Url\" header that was used to\n // fetch the incoming route. It's essentially the refererer URL, but in a\n // Next.js specific format. During refreshes, this is sent back to the server\n // instead of the current route's \"Next-Url\" so that the same interception\n // logic is applied as during the original navigation.\n const previousNextUrl = referringNextUrl\n\n // Check if the only thing that changed was the hash fragment.\n const oldUrl = new URL(oldState.canonicalUrl, url)\n const onlyHashChange =\n // We don't need to compare the origins, because client-driven\n // navigations are always same-origin.\n url.pathname === oldUrl.pathname &&\n url.search === oldUrl.search &&\n url.hash !== oldUrl.hash\n\n // Determine whether and how the page should scroll after this\n // navigation.\n //\n // By default, we scroll to the segments that were navigated to — i.e.\n // segments in the new part of the route, as opposed to shared segments\n // that were already part of the previous route. All newly navigated\n // segments share a single ScrollRef. When they mount, the first one\n // to mount initiates the scroll. They share a ref so that only one\n // scroll happens per navigation.\n //\n // If a subsequent navigation produces new segments, those supersede\n // any pending scroll from the previous navigation by invalidating its\n // ScrollRef. If a navigation doesn't produce any new segments (e.g.\n // a refresh where the route structure didn't change), any pending\n // scrolls from previous navigations are unaffected.\n //\n // The branches below handle special cases layered on top of this\n // default model.\n let activeScrollRef: ScrollRef | null\n let forceScroll: boolean\n if (scrollBehavior === ScrollBehavior.NoScroll) {\n // The user explicitly opted out of scrolling (e.g. scroll={false}\n // on a Link or router.push).\n //\n // If this navigation created new scroll targets (scrollRef !== null),\n // neutralize them. If it didn't, any prior scroll targets carried\n // forward on the cache nodes via reuseSharedCacheNode remain active.\n if (scrollRef !== null) {\n scrollRef.current = false\n }\n activeScrollRef = oldState.focusAndScrollRef.scrollRef\n forceScroll = false\n } else if (onlyHashChange) {\n // Hash-only navigations should scroll regardless of per-node state.\n // Create a fresh ref so the first segment to scroll consumes it.\n //\n // Invalidate any scroll ref from a prior navigation that hasn't\n // been consumed yet.\n const oldScrollRef = oldState.focusAndScrollRef.scrollRef\n if (oldScrollRef !== null) {\n oldScrollRef.current = false\n }\n // Also invalidate any per-node refs that were accumulated during\n // this navigation's tree construction — the hash-only ref\n // supersedes them.\n if (scrollRef !== null) {\n scrollRef.current = false\n }\n activeScrollRef = { current: true }\n forceScroll = true\n } else {\n // Default case. Use the accumulated scrollRef (may be null if no\n // new segments were created). The handler checks per-node refs, so\n // unchanged parallel route slots won't scroll.\n activeScrollRef = scrollRef\n\n // If this navigation created new scroll targets, invalidate any\n // pending scroll from a previous navigation.\n if (scrollRef !== null) {\n const oldScrollRef = oldState.focusAndScrollRef.scrollRef\n if (oldScrollRef !== null) {\n oldScrollRef.current = false\n }\n }\n forceScroll = false\n }\n\n const newState: AppRouterState = {\n canonicalUrl,\n renderedSearch,\n pushRef: {\n pendingPush: navigateType === 'push',\n mpaNavigation: false,\n preserveCustomHistoryState: false,\n },\n focusAndScrollRef: {\n scrollRef: activeScrollRef,\n forceScroll,\n onlyHashChange,\n hashFragment:\n // Remove leading # and decode hash to make non-latin hashes work.\n //\n // Empty hash should trigger default behavior of scrolling layout into\n // view. #top is handled in layout-router.\n //\n // Refer to `ScrollAndFocusHandler` for details on how this is used.\n scrollBehavior !== ScrollBehavior.NoScroll && url.hash !== ''\n ? decodeURIComponent(url.hash.slice(1))\n : oldState.focusAndScrollRef.hashFragment,\n },\n cache,\n tree,\n nextUrl: nextUrlForNewRoute,\n previousNextUrl,\n debugInfo: collectedDebugInfo,\n }\n return newState\n}\n\nexport function completeTraverseNavigation(\n state: AppRouterState,\n url: URL,\n renderedSearch: string,\n cache: CacheNode,\n tree: FlightRouterState,\n nextUrl: string | null\n) {\n return {\n // Set canonical url\n canonicalUrl: createHrefFromUrl(url),\n renderedSearch,\n pushRef: {\n pendingPush: false,\n mpaNavigation: false,\n // Ensures that the custom history state that was set is preserved when applying this update.\n preserveCustomHistoryState: true,\n },\n focusAndScrollRef: state.focusAndScrollRef,\n cache,\n // Restore provided tree\n tree,\n nextUrl,\n // TODO: We need to restore previousNextUrl, too, which represents the\n // Next-Url that was used to fetch the data. Anywhere we fetch using the\n // canonical URL, there should be a corresponding Next-Url.\n previousNextUrl: null,\n debugInfo: null,\n }\n}\n\n// TODO: The rest of this file is related to converting the server response into\n// the data structures used by the client. Probably should move to a\n// separate module.\n\nexport type NavigationSeed = {\n renderedSearch: string\n routeTree: RouteTree\n metadataVaryPath: PageVaryPath | null\n data: CacheNodeSeedData | null\n head: HeadData | null\n dynamicStaleAt: number\n}\n\nexport function convertServerPatchToFullTree(\n now: number,\n currentTree: FlightRouterState,\n flightData: Array<NormalizedFlightData> | null,\n renderedSearch: string,\n dynamicStaleTimeSeconds: number\n): NavigationSeed {\n // During a client navigation or prefetch, the server sends back only a patch\n // for the parts of the tree that have changed.\n //\n // This applies the patch to the base tree to create a full representation of\n // the resulting tree.\n //\n // The return type includes a full FlightRouterState tree and a full\n // CacheNodeSeedData tree. (Conceptually these are the same tree, and should\n // eventually be unified, but there's still lots of existing code that\n // operates on FlightRouterState trees alone without the CacheNodeSeedData.)\n //\n // TODO: This similar to what apply-router-state-patch-to-tree does. It\n // will eventually fully replace it. We should get rid of all the remaining\n // places where we iterate over the server patch format. This should also\n // eventually replace normalizeFlightData.\n\n let baseTree: FlightRouterState = currentTree\n let baseData: CacheNodeSeedData | null = null\n let head: HeadData | null = null\n if (flightData !== null) {\n for (const {\n segmentPath,\n tree: treePatch,\n seedData: dataPatch,\n head: headPatch,\n } of flightData) {\n const result = convertServerPatchToFullTreeImpl(\n baseTree,\n baseData,\n treePatch,\n dataPatch,\n segmentPath,\n renderedSearch,\n 0\n )\n baseTree = result.tree\n baseData = result.data\n // This is the same for all patches per response, so just pick an\n // arbitrary one\n head = headPatch\n }\n }\n\n const finalFlightRouterState = baseTree\n\n // Convert the final FlightRouterState into a RouteTree type.\n //\n // TODO: Eventually, FlightRouterState will evolve to being a transport format\n // only. The RouteTree type will become the main type used for dealing with\n // routes on the client, and we'll store it in the state directly.\n const acc = { metadataVaryPath: null }\n const routeTree = convertRootFlightRouterStateToRouteTree(\n finalFlightRouterState,\n renderedSearch as NormalizedSearch,\n acc\n )\n\n return {\n routeTree,\n metadataVaryPath: acc.metadataVaryPath,\n data: baseData,\n renderedSearch,\n head,\n dynamicStaleAt: computeDynamicStaleAt(now, dynamicStaleTimeSeconds),\n }\n}\n\nfunction convertServerPatchToFullTreeImpl(\n baseRouterState: FlightRouterState,\n baseData: CacheNodeSeedData | null,\n treePatch: FlightRouterState,\n dataPatch: CacheNodeSeedData | null,\n segmentPath: FlightSegmentPath,\n renderedSearch: string,\n index: number\n): { tree: FlightRouterState; data: CacheNodeSeedData | null } {\n if (index === segmentPath.length) {\n // We reached the part of the tree that we need to patch.\n return {\n tree: treePatch,\n data: dataPatch,\n }\n }\n\n // segmentPath represents the parent path of subtree. It's a repeating\n // pattern of parallel route key and segment:\n //\n // [string, Segment, string, Segment, string, Segment, ...]\n //\n // This path tells us which part of the base tree to apply the tree patch.\n //\n // NOTE: We receive the FlightRouterState patch in the same request as the\n // seed data patch. Therefore we don't need to worry about diffing the segment\n // values; we can assume the server sent us a correct result.\n const updatedParallelRouteKey: string = segmentPath[index]\n // const segment: Segment = segmentPath[index + 1] <-- Not used, see note above\n\n const baseTreeChildren = baseRouterState[1]\n const baseSeedDataChildren = baseData !== null ? baseData[1] : null\n const newTreeChildren: Record<string, FlightRouterState> = {}\n const newSeedDataChildren: Record<string, CacheNodeSeedData | null> = {}\n for (const parallelRouteKey in baseTreeChildren) {\n const childBaseRouterState = baseTreeChildren[parallelRouteKey]\n const childBaseSeedData =\n baseSeedDataChildren !== null\n ? (baseSeedDataChildren[parallelRouteKey] ?? null)\n : null\n if (parallelRouteKey === updatedParallelRouteKey) {\n const result = convertServerPatchToFullTreeImpl(\n childBaseRouterState,\n childBaseSeedData,\n treePatch,\n dataPatch,\n segmentPath,\n renderedSearch,\n // Advance the index by two and keep cloning until we reach\n // the end of the segment path.\n index + 2\n )\n\n newTreeChildren[parallelRouteKey] = result.tree\n newSeedDataChildren[parallelRouteKey] = result.data\n } else {\n // This child is not being patched. Copy it over as-is.\n newTreeChildren[parallelRouteKey] = childBaseRouterState\n newSeedDataChildren[parallelRouteKey] = childBaseSeedData\n }\n }\n\n let clonedTree: FlightRouterState\n let clonedSeedData: CacheNodeSeedData\n // Clone all the fields except the children.\n\n // Clone the FlightRouterState tree. Based on equivalent logic in\n // apply-router-state-patch-to-tree, but should confirm whether we need to\n // copy all of these fields. Not sure the server ever sends, e.g. the\n // refetch marker.\n clonedTree = [baseRouterState[0], newTreeChildren]\n if (2 in baseRouterState) {\n const compressedRefreshState = baseRouterState[2]\n if (\n compressedRefreshState !== undefined &&\n compressedRefreshState !== null\n ) {\n // Since this part of the tree was patched with new data, any parent\n // refresh states should be updated to reflect the new rendered search\n // value. (The refresh state acts like a \"context provider\".) All pages\n // within the same server response share the same renderedSearch value,\n // but the same RouteTree could be composed from multiple different\n // routes, and multiple responses.\n clonedTree[2] = [compressedRefreshState[0], renderedSearch]\n }\n }\n if (3 in baseRouterState) {\n clonedTree[3] = baseRouterState[3]\n }\n // Recompute the propagated \"subtree\" prefetch hints for this segment. Mirrors\n // the propagation done on the server in\n // createFlightRouterStateFromLoaderTree.\n let prefetchHints = (baseRouterState[4] ?? 0) & ~SubtreePrefetchHints\n for (const parallelRouteKey in newTreeChildren) {\n const childHints = newTreeChildren[parallelRouteKey][4]\n if (childHints !== undefined) {\n prefetchHints = propagateSubtreeBits(prefetchHints, childHints)\n }\n }\n if (prefetchHints !== 0) {\n clonedTree[4] = prefetchHints\n }\n\n // Clone the CacheNodeSeedData tree.\n const isEmptySeedDataPartial = true\n clonedSeedData = [\n null,\n newSeedDataChildren,\n null,\n isEmptySeedDataPartial,\n null,\n ]\n\n return {\n tree: clonedTree,\n data: clonedSeedData,\n }\n}\n\n/**\n * Instant Navigation Testing API: ensures a prefetch task has been initiated\n * and completed before proceeding with the navigation. This guarantees that\n * segment data requests are at least pending, even for routes whose route\n * tree is already cached.\n *\n * After the prefetch completes, delegates to the normal navigation flow.\n */\nasync function ensurePrefetchThenNavigate(\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n nextUrl: string | null,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock\n): Promise<AppRouterState> {\n const link = getLinkForCurrentNavigation()\n const fetchStrategy = link !== null ? link.fetchStrategy : FetchStrategy.PPR\n\n const cacheKey = createCacheKey(url.href, nextUrl)\n\n // Create this navigation's \"wait for prefetch to fulfill\" state and schedule\n // the prefetch as a locked-navigation prefetch. The prefetch's promise\n // resolves once it has spawned every request and all of them have fulfilled,\n // so the navigation below reads present data rather than a still-in-flight\n // entry.\n const { beginNavigationLockPrefetch } =\n require('./navigation-testing-lock') as typeof import('./navigation-testing-lock')\n const navigationLockPrefetch = beginNavigationLockPrefetch()\n schedulePrefetchTask(\n cacheKey,\n currentFlightRouterState,\n fetchStrategy,\n PrefetchPriority.Default,\n null, // onInvalidate\n navigationLockPrefetch\n )\n if (navigationLockPrefetch !== null) {\n await navigationLockPrefetch.promise\n }\n\n // Prefetch is complete. Proceed with the normal navigation flow, which\n // will now find the route in the cache.\n const result = await navigateImpl(\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n nextUrl,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n )\n\n // Only transition to captured-SPA once the navigation is known to be an SPA.\n // If the result is an MPA navigation, leave the cookie pending and let the new\n // document load transition it to captured-MPA.\n if (!result.pushRef.mpaNavigation) {\n const { updateCapturedSPAToTree } =\n require('./navigation-testing-lock') as typeof import('./navigation-testing-lock')\n updateCapturedSPAToTree(currentFlightRouterState, result.tree)\n }\n\n return result\n}\n"],"names":["PrefetchHint","SubtreePrefetchHints","propagateSubtreeBits","fetchServerResponse","startPPRNavigation","spawnDynamicRequests","FreshnessPolicy","getCurrentNavigationLock","createHrefFromUrl","NEXT_NAV_DEPLOYMENT_ID_HEADER","EntryStatus","readRouteCacheEntry","deprecated_requestOptimisticRouteCacheEntry","convertRootFlightRouterStateToRouteTree","getStaleAt","writePrerenderResponseIntoCache","processRuntimePrefetchStream","writeDynamicRenderResponseIntoCache","discoverKnownRoute","createCacheKey","schedulePrefetchTask","PrefetchPriority","FetchStrategy","getLinkForCurrentNavigation","ScrollBehavior","computeChangedPath","isJavaScriptURLString","UnknownDynamicStaleTime","computeDynamicStaleAt","createLinkPrefetchPartialError","navigate","state","url","currentUrl","currentRenderedSearch","currentCacheNode","currentFlightRouterState","nextUrl","freshnessPolicy","scrollBehavior","navigateType","navigationLock","process","env","__NEXT_EXPOSE_TESTING_API","isNavigationLocked","require","ensurePrefetchThenNavigate","navigateImpl","now","Date","href","cacheKey","route","status","Fulfilled","navigateUsingPrefetchedRouteTree","__NEXT_OPTIMISTIC_ROUTING","Rejected","optimisticRoute","navigateToUnknownRoute","catch","navigateToKnownRoute","canonicalUrl","navigationSeed","debugInfo","routeCacheEntry","NODE_ENV","__NEXT_CACHE_COMPONENTS","link","fetchStrategy","Full","routeTree","prefetchHints","SubtreeHasPartialPrefetching","SubtreeHasInstantFalse","error","pathname","ownerStack","undefined","console","stack","name","message","restrictToShell","shouldRestrictNavigationToShell","PPR","accumulation","separateRefreshUrls","scrollRef","isSamePageNavigation","task","metadataVaryPath","data","head","dynamicStaleAt","Gesture","completeSoftNavigation","node","renderedSearch","completeHardNavigation","tree","hash","prefetchSeed","metadata","varyPath","DynamicRequestTreeForEntireRoute","dynamicRequestTree","Default","HistoryTraversal","Hydration","RefreshAll","HMRRefresh","promiseForDynamicServerResponse","flightRouterState","result","redirectUrl","URL","location","origin","flightData","couldBeIntercepted","supportsPerSegmentPrefetching","dynamicStaleTime","staticStageData","runtimePrefetchStream","responseHeaders","convertServerPatchToFullTree","search","response","staticStageResponse","isResponsePartial","s","then","staleAt","buildId","get","b","f","h","r","processed","PPRRuntime","flightDatas","headVaryParams","rootVaryParamsIterable","revealAfter","newState","pushRef","pendingPush","mpaNavigation","preserveCustomHistoryState","focusAndScrollRef","cache","previousNextUrl","oldState","referringNextUrl","collectedDebugInfo","changedPath","nextUrlForNewRoute","oldUrl","onlyHashChange","activeScrollRef","forceScroll","NoScroll","current","oldScrollRef","hashFragment","decodeURIComponent","slice","completeTraverseNavigation","currentTree","dynamicStaleTimeSeconds","baseTree","baseData","segmentPath","treePatch","seedData","dataPatch","headPatch","convertServerPatchToFullTreeImpl","finalFlightRouterState","acc","baseRouterState","index","length","updatedParallelRouteKey","baseTreeChildren","baseSeedDataChildren","newTreeChildren","newSeedDataChildren","parallelRouteKey","childBaseRouterState","childBaseSeedData","clonedTree","clonedSeedData","compressedRefreshState","childHints","isEmptySeedDataPartial","beginNavigationLockPrefetch","navigationLockPrefetch","promise","updateCapturedSPAToTree"],"mappings":"AAQA,SACEA,YAAY,EACZC,oBAAoB,EACpBC,oBAAoB,QACf,uCAAsC;AAE7C,SAASC,mBAAmB,QAAQ,0CAAyC;AAC7E,SACEC,kBAAkB,EAClBC,oBAAoB,EACpBC,eAAe,EACfC,wBAAwB,QAGnB,oCAAmC;AAC1C,SAASC,iBAAiB,QAAQ,yCAAwC;AAC1E,SAASC,6BAA6B,QAAQ,yBAAwB;AACtE,SACEC,WAAW,EACXC,mBAAmB,EACnBC,2CAA2C,EAC3CC,uCAAuC,EACvCC,UAAU,EACVC,+BAA+B,EAC/BC,4BAA4B,EAC5BC,mCAAmC,QAG9B,UAAS;AAChB,SAASC,kBAAkB,QAAQ,sBAAqB;AACxD,SAASC,cAAc,QAA+B,cAAa;AACnE,SAASC,oBAAoB,QAAQ,cAAa;AAClD,SAASC,gBAAgB,EAAEC,aAAa,QAAQ,UAAS;AACzD,SAASC,2BAA2B,QAAQ,WAAU;AAGtD,SAASC,cAAc,QAAQ,yCAAwC;AACvE,SAASC,kBAAkB,QAAQ,yCAAwC;AAC3E,SAASC,qBAAqB,QAAQ,2BAA0B;AAChE,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,YAAW;AAC1E,SAASC,8BAA8B,QAAQ,uCAAsC;AAErF;;;;;;;CAOC,GACD,OAAO,SAASC,SACdC,KAAqB,EACrBC,G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AChCC,cAA8B;IAE9B,MAAM4B,OAAO9C;IACb,MAAM+C,gBAAgBD,SAAS,OAAOA,KAAKC,aAAa,GAAGhD,cAAcgE,GAAG;IAE5E,MAAMlC,WAAWjC,eAAea,IAAImB,IAAI,EAAEd;IAE1C,6EAA6E;IAC7E,uEAAuE;IACvE,6EAA6E;IAC7E,2EAA2E;IAC3E,SAAS;IACT,MAAM,EAAEkK,2BAA2B,EAAE,GACnCzJ,QAAQ;IACV,MAAM0J,yBAAyBD;IAC/BnL,qBACEgC,UACAhB,0BACAkC,eACAjD,iBAAiBuF,OAAO,EACxB,MACA4F;IAEF,IAAIA,2BAA2B,MAAM;QACnC,MAAMA,uBAAuBC,OAAO;IACtC;IAEA,uEAAuE;IACvE,wCAAwC;IACxC,MAAMtF,SAAS,MAAMnE,aACnBjB,OACAC,KACAC,YACAC,uBACAC,kBACAC,0BACAC,SACAC,iBACAC,gBACAC,cACAC;IAGF,6EAA6E;IAC7E,+EAA+E;IAC/E,+CAA+C;IAC/C,IAAI,CAAC0E,OAAOiC,OAAO,CAACE,aAAa,EAAE;QACjC,MAAM,EAAEoD,uBAAuB,EAAE,GAC/B5J,QAAQ;QACV4J,wBAAwBtK,0BAA0B+E,OAAOd,IAAI;IAC/D;IAEA,OAAOc;AACT","ignoreList":[0]} |
@@ -31,5 +31,6 @@ import { createPrefetchURL } from '../app-router-utils'; | ||
| const cacheKey = createCacheKey(url.href, nextUrl); | ||
| schedulePrefetchTask(cacheKey, treeAtTimeOfPrefetch, fetchStrategy, PrefetchPriority.Default, onInvalidate); | ||
| schedulePrefetchTask(cacheKey, treeAtTimeOfPrefetch, fetchStrategy, PrefetchPriority.Default, onInvalidate, null // navigationLockPrefetch | ||
| ); | ||
| } | ||
| //# sourceMappingURL=prefetch.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../../src/client/components/segment-cache/prefetch.ts"],"sourcesContent":["import type { FlightRouterState } from '../../../shared/lib/app-router-types'\nimport { createPrefetchURL } from '../app-router-utils'\nimport { createCacheKey } from './cache-key'\nimport { schedulePrefetchTask } from './scheduler'\nimport { PrefetchPriority, type PrefetchTaskFetchStrategy } from './types'\n\n/**\n * Entrypoint for prefetching a URL into the Segment Cache.\n * @param href - The URL to prefetch. Typically this will come from a <Link>,\n * or router.prefetch. It must be validated before we attempt to prefetch it.\n * @param nextUrl - A special header used by the server for interception routes.\n * Roughly corresponds to the current URL.\n * @param treeAtTimeOfPrefetch - The FlightRouterState at the time the prefetch\n * was requested. This is only used when PPR is disabled.\n * @param fetchStrategy - Whether to prefetch dynamic data, in addition to\n * static data. This is used by `<Link prefetch={true}>`.\n * @param onInvalidate - A callback that will be called when the prefetch cache\n * When called, it signals to the listener that the data associated with the\n * prefetch may have been invalidated from the cache. This is not a live\n * subscription — it's called at most once per `prefetch` call. The only\n * supported use case is to trigger a new prefetch inside the listener, if\n * desired. It also may be called even in cases where the associated data is\n * still cached. Prefetching is a poll-based (pull) operation, not an event-\n * based (push) one. Rather than subscribe to specific cache entries, you\n * occasionally poll the prefetch cache to check if anything is missing.\n */\nexport function prefetch(\n href: string,\n nextUrl: string | null,\n treeAtTimeOfPrefetch: FlightRouterState,\n fetchStrategy: PrefetchTaskFetchStrategy,\n onInvalidate: null | (() => void)\n) {\n const url = createPrefetchURL(href)\n if (url === null) {\n // This href should not be prefetched.\n return\n }\n const cacheKey = createCacheKey(url.href, nextUrl)\n schedulePrefetchTask(\n cacheKey,\n treeAtTimeOfPrefetch,\n fetchStrategy,\n PrefetchPriority.Default,\n onInvalidate\n )\n}\n"],"names":["createPrefetchURL","createCacheKey","schedulePrefetchTask","PrefetchPriority","prefetch","href","nextUrl","treeAtTimeOfPrefetch","fetchStrategy","onInvalidate","url","cacheKey","Default"],"mappings":"AACA,SAASA,iBAAiB,QAAQ,sBAAqB;AACvD,SAASC,cAAc,QAAQ,cAAa;AAC5C,SAASC,oBAAoB,QAAQ,cAAa;AAClD,SAASC,gBAAgB,QAAwC,UAAS;AAE1E;;;;;;;;;;;;;;;;;;;CAmBC,GACD,OAAO,SAASC,SACdC,IAAY,EACZC,OAAsB,EACtBC,oBAAuC,EACvCC,aAAwC,EACxCC,YAAiC;IAEjC,MAAMC,MAAMV,kBAAkBK;IAC9B,IAAIK,QAAQ,MAAM;QAChB,sCAAsC;QACtC;IACF;IACA,MAAMC,WAAWV,eAAeS,IAAIL,IAAI,EAAEC;IAC1CJ,qBACES,UACAJ,sBACAC,eACAL,iBAAiBS,OAAO,EACxBH;AAEJ","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../../src/client/components/segment-cache/prefetch.ts"],"sourcesContent":["import type { FlightRouterState } from '../../../shared/lib/app-router-types'\nimport { createPrefetchURL } from '../app-router-utils'\nimport { createCacheKey } from './cache-key'\nimport { schedulePrefetchTask } from './scheduler'\nimport { PrefetchPriority, type PrefetchTaskFetchStrategy } from './types'\n\n/**\n * Entrypoint for prefetching a URL into the Segment Cache.\n * @param href - The URL to prefetch. Typically this will come from a <Link>,\n * or router.prefetch. It must be validated before we attempt to prefetch it.\n * @param nextUrl - A special header used by the server for interception routes.\n * Roughly corresponds to the current URL.\n * @param treeAtTimeOfPrefetch - The FlightRouterState at the time the prefetch\n * was requested. This is only used when PPR is disabled.\n * @param fetchStrategy - Whether to prefetch dynamic data, in addition to\n * static data. This is used by `<Link prefetch={true}>`.\n * @param onInvalidate - A callback that will be called when the prefetch cache\n * When called, it signals to the listener that the data associated with the\n * prefetch may have been invalidated from the cache. This is not a live\n * subscription — it's called at most once per `prefetch` call. The only\n * supported use case is to trigger a new prefetch inside the listener, if\n * desired. It also may be called even in cases where the associated data is\n * still cached. Prefetching is a poll-based (pull) operation, not an event-\n * based (push) one. Rather than subscribe to specific cache entries, you\n * occasionally poll the prefetch cache to check if anything is missing.\n */\nexport function prefetch(\n href: string,\n nextUrl: string | null,\n treeAtTimeOfPrefetch: FlightRouterState,\n fetchStrategy: PrefetchTaskFetchStrategy,\n onInvalidate: null | (() => void)\n) {\n const url = createPrefetchURL(href)\n if (url === null) {\n // This href should not be prefetched.\n return\n }\n const cacheKey = createCacheKey(url.href, nextUrl)\n schedulePrefetchTask(\n cacheKey,\n treeAtTimeOfPrefetch,\n fetchStrategy,\n PrefetchPriority.Default,\n onInvalidate,\n null // navigationLockPrefetch\n )\n}\n"],"names":["createPrefetchURL","createCacheKey","schedulePrefetchTask","PrefetchPriority","prefetch","href","nextUrl","treeAtTimeOfPrefetch","fetchStrategy","onInvalidate","url","cacheKey","Default"],"mappings":"AACA,SAASA,iBAAiB,QAAQ,sBAAqB;AACvD,SAASC,cAAc,QAAQ,cAAa;AAC5C,SAASC,oBAAoB,QAAQ,cAAa;AAClD,SAASC,gBAAgB,QAAwC,UAAS;AAE1E;;;;;;;;;;;;;;;;;;;CAmBC,GACD,OAAO,SAASC,SACdC,IAAY,EACZC,OAAsB,EACtBC,oBAAuC,EACvCC,aAAwC,EACxCC,YAAiC;IAEjC,MAAMC,MAAMV,kBAAkBK;IAC9B,IAAIK,QAAQ,MAAM;QAChB,sCAAsC;QACtC;IACF;IACA,MAAMC,WAAWV,eAAeS,IAAIL,IAAI,EAAEC;IAC1CJ,qBACES,UACAJ,sBACAC,eACAL,iBAAiBS,OAAO,EACxBH,cACA,KAAK,yBAAyB;;AAElC","ignoreList":[0]} |
@@ -28,3 +28,3 @@ /* global location */ // imports polyfill from `@next/polyfill-module` after build. | ||
| import { isNextRouterError } from './components/is-next-router-error'; | ||
| export const version = "16.3.0-preview.4"; | ||
| export const version = "16.3.0-preview.5"; | ||
| export let router; | ||
@@ -31,0 +31,0 @@ export const emitter = mitt(); |
@@ -20,3 +20,3 @@ import { readFileSync, writeFileSync } from 'fs'; | ||
| const data = await res.json(); | ||
| const versionData = data.versions["16.3.0-preview.4"]; | ||
| const versionData = data.versions["16.3.0-preview.5"]; | ||
| return { | ||
@@ -54,3 +54,3 @@ os: versionData.os, | ||
| lockfileParsed.dependencies[pkg] = { | ||
| version: "16.3.0-preview.4", | ||
| version: "16.3.0-preview.5", | ||
| resolved: pkgData.tarball, | ||
@@ -63,3 +63,3 @@ integrity: pkgData.integrity, | ||
| lockfileParsed.packages[pkg] = { | ||
| version: "16.3.0-preview.4", | ||
| version: "16.3.0-preview.5", | ||
| resolved: pkgData.tarball, | ||
@@ -66,0 +66,0 @@ integrity: pkgData.integrity, |
@@ -74,2 +74,7 @@ import { PrefetchHint, propagateSubtreeBits } from '../../shared/lib/app-router-types'; | ||
| prefetchHints |= PrefetchHint.SubtreeHasPartialPrefetching; | ||
| } else if (instantConfig === false) { | ||
| // The segment explicitly opts out of Partial Prefetching. We don't change | ||
| // the prefetch behavior, but we record it so the dev-time | ||
| // `<Link prefetch={true}>` warning can be suppressed for this route. | ||
| prefetchHints |= PrefetchHint.SubtreeHasInstantFalse; | ||
| } | ||
@@ -76,0 +81,0 @@ if (prefetchConfig === 'partial') { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/server/app-render/create-flight-router-state-from-loader-tree.ts"],"sourcesContent":["import type { LoaderTree } from '../lib/app-dir-module'\nimport {\n PrefetchHint,\n propagateSubtreeBits,\n type FlightRouterState,\n type PrefetchHints,\n} from '../../shared/lib/app-router-types'\nimport type { GetDynamicParamFromSegment } from './app-render'\nimport { addSearchParamsIfPageSegment } from '../../shared/lib/segment'\nimport type { AppSegmentConfig } from '../../build/segment-config/app/app-segment-config'\n\nasync function createFlightRouterStateFromLoaderTreeImpl(\n loaderTree: LoaderTree,\n hintTree: PrefetchHints | null,\n prefetchInliningEnabled: boolean,\n cacheComponents: boolean,\n partialPrefetching: boolean | 'unstable_eager' | undefined,\n isStaticGeneration: boolean,\n isBuildTimePrerendering: boolean,\n getDynamicParamFromSegment: GetDynamicParamFromSegment,\n searchParams: any,\n didFindRootLayout: boolean\n): Promise<FlightRouterState> {\n const [segment, parallelRoutes, { layout, loading, page }] = loaderTree\n const dynamicParam = getDynamicParamFromSegment(loaderTree)\n const treeSegment = dynamicParam ? dynamicParam.treeSegment : segment\n\n const segmentTree: FlightRouterState = [\n addSearchParamsIfPageSegment(treeSegment, searchParams),\n {},\n ]\n\n // Load the layout or page module to check its instant and prefetch\n // configs. When a segment doesn't export prefetch, it defaults to\n // 'partial' if the app has opted into partial prefetching globally via the\n // `partialPrefetching` config in next.config.js.\n const mod = layout ? await layout[0]() : page ? await page[0]() : undefined\n const instantConfig = mod ? (mod as AppSegmentConfig).instant : undefined\n const prefetchConfig =\n (mod ? (mod as AppSegmentConfig).prefetch : undefined) ??\n (partialPrefetching === 'unstable_eager'\n ? 'unstable_eager'\n : partialPrefetching\n ? 'partial'\n : undefined)\n let prefetchHints = 0\n\n // Union in the precomputed build-time hints (e.g. segment inlining\n // decisions) if available. When hints are not available (e.g. dev mode or\n // if prefetch-hints.json was not generated), we fall through and still\n // compute the other hints below. In the future this should be a build\n // error, but for now we gracefully degrade.\n //\n // TODO: Move more of the hints computation (IsRootLayoutOrAbove, instant config,\n // loading boundary detection) into the build-time measurement step in\n // collectPrefetchHints, so this function only needs to union the\n // precomputed bitmask rather than re-derive hints on every render.\n if (hintTree !== null) {\n prefetchHints |= hintTree.hints\n } else if (prefetchInliningEnabled) {\n if (isBuildTimePrerendering) {\n // Prefetch inlining is enabled but no hint tree was provided during a\n // build-time prerender. This happens for the initial RSC payload\n // generated before collectPrefetchHints has run. Mark so the client\n // can expire the route cache entry and re-fetch the tree with correct\n // hints.\n prefetchHints |= PrefetchHint.InliningHintsStale\n } else if (isStaticGeneration) {\n // TODO(#91407): Temporary mitigation: when hints are missing during\n // runtime static generation, fall back to treating every segment as\n // unprefetchable. This currently happens for routes with\n // `instant = false` at the root segment, which causes the prerender\n // to run per-request instead of being cached, and the prefetch hints\n // manifest is not available.\n //\n // Once that bug is fixed, this branch should become an error again —\n // hints should always be available from the manifest during ISR.\n prefetchHints |= PrefetchHint.PrefetchDisabled\n } else if (cacheComponents) {\n // At runtime with no hint tree, this is a fully dynamic route with no\n // manifest entry. Treat every segment as unprefetchable. Do NOT set\n // InliningHintsStale — that would cause the client to enter an\n // infinite re-fetch loop trying to get hints that will never exist.\n prefetchHints |= PrefetchHint.PrefetchDisabled\n } else {\n // Without cacheComponents, dynamic pages have no static shell so\n // hints are never computed. Don't disable prefetching — just skip\n // the inlining hint system and let prefetching proceed normally.\n }\n }\n\n // Mark every segment at or above the root layout (i.e. until we descend past\n // the first segment that has a layout).\n if (!didFindRootLayout) {\n prefetchHints |= PrefetchHint.IsRootLayoutOrAbove\n if (typeof layout !== 'undefined') {\n // This segment is the root layout; its descendants are below it.\n didFindRootLayout = true\n }\n }\n\n const isInstant =\n instantConfig === true ||\n (typeof instantConfig === 'object' && instantConfig !== null)\n if (isInstant) {\n prefetchHints |= PrefetchHint.SubtreeHasPartialPrefetching\n }\n\n if (prefetchConfig === 'partial') {\n prefetchHints |= PrefetchHint.SubtreeHasPartialPrefetching\n } else if (prefetchConfig === 'unstable_eager') {\n // Like 'partial' (uses the PPR fetch strategy) but also marks the segment\n // as eager, so App Shells keeps prefetching it instead of relying on the\n // shared app shell.\n prefetchHints |=\n PrefetchHint.SubtreeHasPartialPrefetching |\n PrefetchHint.SubtreeHasEagerPrefetch\n } else if (prefetchConfig === 'force-disabled') {\n prefetchHints |= PrefetchHint.PrefetchDisabled\n } else if (prefetchConfig === 'allow-runtime') {\n prefetchHints |= PrefetchHint.HasRuntimePrefetch\n }\n\n // Mark the segment as \"eager\" unless its effective prefetch strategy is\n // 'partial' or 'allow-runtime'. A truthy instant is treated as\n // 'partial' (not eager). 'unstable_eager' already set the bit above. Under\n // App Shells, a subtree with no eager segment skips its Speculative prefetch\n // and relies on the shared app shell instead.\n if (\n !isInstant &&\n prefetchConfig !== 'partial' &&\n prefetchConfig !== 'allow-runtime'\n ) {\n prefetchHints |= PrefetchHint.SubtreeHasEagerPrefetch\n }\n\n // Check if this segment has a loading boundary\n if (loading) {\n prefetchHints |= PrefetchHint.SegmentHasLoadingBoundary\n }\n\n const children: FlightRouterState[1] = {}\n for (const parallelRouteKey in parallelRoutes) {\n // Look up the child hint node by parallel route key, traversing the\n // hint tree in parallel with the loader tree.\n const childHintNode = hintTree?.slots?.[parallelRouteKey] ?? null\n\n const child = await createFlightRouterStateFromLoaderTreeImpl(\n parallelRoutes[parallelRouteKey],\n childHintNode,\n prefetchInliningEnabled,\n cacheComponents,\n partialPrefetching,\n isStaticGeneration,\n isBuildTimePrerendering,\n getDynamicParamFromSegment,\n searchParams,\n didFindRootLayout\n )\n // Propagate subtree flags from children\n if (child[4] !== undefined) {\n prefetchHints = propagateSubtreeBits(prefetchHints, child[4])\n }\n children[parallelRouteKey] = child\n }\n segmentTree[1] = children\n\n if (prefetchHints !== 0) {\n segmentTree[4] = prefetchHints\n }\n\n return segmentTree\n}\n\nexport async function createFlightRouterStateFromLoaderTree(\n loaderTree: LoaderTree,\n hintTree: PrefetchHints | null,\n prefetchInliningEnabled: boolean,\n cacheComponents: boolean,\n partialPrefetching: boolean | 'unstable_eager' | undefined,\n isStaticGeneration: boolean,\n isBuildTimePrerendering: boolean,\n getDynamicParamFromSegment: GetDynamicParamFromSegment,\n searchParams: any,\n // Whether a root layout was already found above this loader tree slice, so a\n // slice that starts below the root layout doesn't mark a sub-layout as the\n // root layout.\n didFindRootLayout: boolean = false\n): Promise<FlightRouterState> {\n return createFlightRouterStateFromLoaderTreeImpl(\n loaderTree,\n hintTree,\n prefetchInliningEnabled,\n cacheComponents,\n partialPrefetching,\n isStaticGeneration,\n isBuildTimePrerendering,\n getDynamicParamFromSegment,\n searchParams,\n didFindRootLayout\n )\n}\n\nexport async function createRouteTreePrefetch(\n loaderTree: LoaderTree,\n hintTree: PrefetchHints | null,\n prefetchInliningEnabled: boolean,\n cacheComponents: boolean,\n partialPrefetching: boolean | 'unstable_eager' | undefined,\n isStaticGeneration: boolean,\n isBuildTimePrerendering: boolean,\n getDynamicParamFromSegment: GetDynamicParamFromSegment,\n // See note on createFlightRouterStateFromLoaderTree's didFindRootLayout.\n didFindRootLayout: boolean = false\n): Promise<FlightRouterState> {\n // Search params should not be added to page segment's cache key during a\n // route tree prefetch request, because they do not affect the structure of\n // the route. The client cache has its own logic to handle search params.\n const searchParams = {}\n return createFlightRouterStateFromLoaderTreeImpl(\n loaderTree,\n hintTree,\n prefetchInliningEnabled,\n cacheComponents,\n partialPrefetching,\n isStaticGeneration,\n isBuildTimePrerendering,\n getDynamicParamFromSegment,\n searchParams,\n didFindRootLayout\n )\n}\n"],"names":["PrefetchHint","propagateSubtreeBits","addSearchParamsIfPageSegment","createFlightRouterStateFromLoaderTreeImpl","loaderTree","hintTree","prefetchInliningEnabled","cacheComponents","partialPrefetching","isStaticGeneration","isBuildTimePrerendering","getDynamicParamFromSegment","searchParams","didFindRootLayout","segment","parallelRoutes","layout","loading","page","dynamicParam","treeSegment","segmentTree","mod","undefined","instantConfig","instant","prefetchConfig","prefetch","prefetchHints","hints","InliningHintsStale","PrefetchDisabled","IsRootLayoutOrAbove","isInstant","SubtreeHasPartialPrefetching","SubtreeHasEagerPrefetch","HasRuntimePrefetch","SegmentHasLoadingBoundary","children","parallelRouteKey","childHintNode","slots","child","createFlightRouterStateFromLoaderTree","createRouteTreePrefetch"],"mappings":"AACA,SACEA,YAAY,EACZC,oBAAoB,QAGf,oCAAmC;AAE1C,SAASC,4BAA4B,QAAQ,2BAA0B;AAGvE,eAAeC,0CACbC,UAAsB,EACtBC,QAA8B,EAC9BC,uBAAgC,EAChCC,eAAwB,EACxBC,kBAA0D,EAC1DC,kBAA2B,EAC3BC,uBAAgC,EAChCC,0BAAsD,EACtDC,YAAiB,EACjBC,iBAA0B;IAE1B,MAAM,CAACC,SAASC,gBAAgB,EAAEC,MAAM,EAAEC,OAAO,EAAEC,IAAI,EAAE,CAAC,GAAGd;IAC7D,MAAMe,eAAeR,2BAA2BP;IAChD,MAAMgB,cAAcD,eAAeA,aAAaC,WAAW,GAAGN;IAE9D,MAAMO,cAAiC;QACrCnB,6BAA6BkB,aAAaR;QAC1C,CAAC;KACF;IAED,mEAAmE;IACnE,kEAAkE;IAClE,2EAA2E;IAC3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AAE,GAAGiB;IAEjB,IAAIV,kBAAkB,GAAG;QACvBP,WAAW,CAAC,EAAE,GAAGO;IACnB;IAEA,OAAOP;AACT;AAEA,OAAO,eAAesB,sCACpBvC,UAAsB,EACtBC,QAA8B,EAC9BC,uBAAgC,EAChCC,eAAwB,EACxBC,kBAA0D,EAC1DC,kBAA2B,EAC3BC,uBAAgC,EAChCC,0BAAsD,EACtDC,YAAiB,EACjB,6EAA6E;AAC7E,2EAA2E;AAC3E,eAAe;AACfC,oBAA6B,KAAK;IAElC,OAAOV,0CACLC,YACAC,UACAC,yBACAC,iBACAC,oBACAC,oBACAC,yBACAC,4BACAC,cACAC;AAEJ;AAEA,OAAO,eAAe+B,wBACpBxC,UAAsB,EACtBC,QAA8B,EAC9BC,uBAAgC,EAChCC,eAAwB,EACxBC,kBAA0D,EAC1DC,kBAA2B,EAC3BC,uBAAgC,EAChCC,0BAAsD,EACtD,yEAAyE;AACzEE,oBAA6B,KAAK;IAElC,yEAAyE;IACzE,2EAA2E;IAC3E,yEAAyE;IACzE,MAAMD,eAAe,CAAC;IACtB,OAAOT,0CACLC,YACAC,UACAC,yBACAC,iBACAC,oBACAC,oBACAC,yBACAC,4BACAC,cACAC;AAEJ","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/server/app-render/create-flight-router-state-from-loader-tree.ts"],"sourcesContent":["import type { LoaderTree } from '../lib/app-dir-module'\nimport {\n PrefetchHint,\n propagateSubtreeBits,\n type FlightRouterState,\n type PrefetchHints,\n} from '../../shared/lib/app-router-types'\nimport type { GetDynamicParamFromSegment } from './app-render'\nimport { addSearchParamsIfPageSegment } from '../../shared/lib/segment'\nimport type { AppSegmentConfig } from '../../build/segment-config/app/app-segment-config'\n\nasync function createFlightRouterStateFromLoaderTreeImpl(\n loaderTree: LoaderTree,\n hintTree: PrefetchHints | null,\n prefetchInliningEnabled: boolean,\n cacheComponents: boolean,\n partialPrefetching: boolean | 'unstable_eager' | undefined,\n isStaticGeneration: boolean,\n isBuildTimePrerendering: boolean,\n getDynamicParamFromSegment: GetDynamicParamFromSegment,\n searchParams: any,\n didFindRootLayout: boolean\n): Promise<FlightRouterState> {\n const [segment, parallelRoutes, { layout, loading, page }] = loaderTree\n const dynamicParam = getDynamicParamFromSegment(loaderTree)\n const treeSegment = dynamicParam ? dynamicParam.treeSegment : segment\n\n const segmentTree: FlightRouterState = [\n addSearchParamsIfPageSegment(treeSegment, searchParams),\n {},\n ]\n\n // Load the layout or page module to check its instant and prefetch\n // configs. When a segment doesn't export prefetch, it defaults to\n // 'partial' if the app has opted into partial prefetching globally via the\n // `partialPrefetching` config in next.config.js.\n const mod = layout ? await layout[0]() : page ? await page[0]() : undefined\n const instantConfig = mod ? (mod as AppSegmentConfig).instant : undefined\n const prefetchConfig =\n (mod ? (mod as AppSegmentConfig).prefetch : undefined) ??\n (partialPrefetching === 'unstable_eager'\n ? 'unstable_eager'\n : partialPrefetching\n ? 'partial'\n : undefined)\n let prefetchHints = 0\n\n // Union in the precomputed build-time hints (e.g. segment inlining\n // decisions) if available. When hints are not available (e.g. dev mode or\n // if prefetch-hints.json was not generated), we fall through and still\n // compute the other hints below. In the future this should be a build\n // error, but for now we gracefully degrade.\n //\n // TODO: Move more of the hints computation (IsRootLayoutOrAbove, instant config,\n // loading boundary detection) into the build-time measurement step in\n // collectPrefetchHints, so this function only needs to union the\n // precomputed bitmask rather than re-derive hints on every render.\n if (hintTree !== null) {\n prefetchHints |= hintTree.hints\n } else if (prefetchInliningEnabled) {\n if (isBuildTimePrerendering) {\n // Prefetch inlining is enabled but no hint tree was provided during a\n // build-time prerender. This happens for the initial RSC payload\n // generated before collectPrefetchHints has run. Mark so the client\n // can expire the route cache entry and re-fetch the tree with correct\n // hints.\n prefetchHints |= PrefetchHint.InliningHintsStale\n } else if (isStaticGeneration) {\n // TODO(#91407): Temporary mitigation: when hints are missing during\n // runtime static generation, fall back to treating every segment as\n // unprefetchable. This currently happens for routes with\n // `instant = false` at the root segment, which causes the prerender\n // to run per-request instead of being cached, and the prefetch hints\n // manifest is not available.\n //\n // Once that bug is fixed, this branch should become an error again —\n // hints should always be available from the manifest during ISR.\n prefetchHints |= PrefetchHint.PrefetchDisabled\n } else if (cacheComponents) {\n // At runtime with no hint tree, this is a fully dynamic route with no\n // manifest entry. Treat every segment as unprefetchable. Do NOT set\n // InliningHintsStale — that would cause the client to enter an\n // infinite re-fetch loop trying to get hints that will never exist.\n prefetchHints |= PrefetchHint.PrefetchDisabled\n } else {\n // Without cacheComponents, dynamic pages have no static shell so\n // hints are never computed. Don't disable prefetching — just skip\n // the inlining hint system and let prefetching proceed normally.\n }\n }\n\n // Mark every segment at or above the root layout (i.e. until we descend past\n // the first segment that has a layout).\n if (!didFindRootLayout) {\n prefetchHints |= PrefetchHint.IsRootLayoutOrAbove\n if (typeof layout !== 'undefined') {\n // This segment is the root layout; its descendants are below it.\n didFindRootLayout = true\n }\n }\n\n const isInstant =\n instantConfig === true ||\n (typeof instantConfig === 'object' && instantConfig !== null)\n if (isInstant) {\n prefetchHints |= PrefetchHint.SubtreeHasPartialPrefetching\n } else if (instantConfig === false) {\n // The segment explicitly opts out of Partial Prefetching. We don't change\n // the prefetch behavior, but we record it so the dev-time\n // `<Link prefetch={true}>` warning can be suppressed for this route.\n prefetchHints |= PrefetchHint.SubtreeHasInstantFalse\n }\n\n if (prefetchConfig === 'partial') {\n prefetchHints |= PrefetchHint.SubtreeHasPartialPrefetching\n } else if (prefetchConfig === 'unstable_eager') {\n // Like 'partial' (uses the PPR fetch strategy) but also marks the segment\n // as eager, so App Shells keeps prefetching it instead of relying on the\n // shared app shell.\n prefetchHints |=\n PrefetchHint.SubtreeHasPartialPrefetching |\n PrefetchHint.SubtreeHasEagerPrefetch\n } else if (prefetchConfig === 'force-disabled') {\n prefetchHints |= PrefetchHint.PrefetchDisabled\n } else if (prefetchConfig === 'allow-runtime') {\n prefetchHints |= PrefetchHint.HasRuntimePrefetch\n }\n\n // Mark the segment as \"eager\" unless its effective prefetch strategy is\n // 'partial' or 'allow-runtime'. A truthy instant is treated as\n // 'partial' (not eager). 'unstable_eager' already set the bit above. Under\n // App Shells, a subtree with no eager segment skips its Speculative prefetch\n // and relies on the shared app shell instead.\n if (\n !isInstant &&\n prefetchConfig !== 'partial' &&\n prefetchConfig !== 'allow-runtime'\n ) {\n prefetchHints |= PrefetchHint.SubtreeHasEagerPrefetch\n }\n\n // Check if this segment has a loading boundary\n if (loading) {\n prefetchHints |= PrefetchHint.SegmentHasLoadingBoundary\n }\n\n const children: FlightRouterState[1] = {}\n for (const parallelRouteKey in parallelRoutes) {\n // Look up the child hint node by parallel route key, traversing the\n // hint tree in parallel with the loader tree.\n const childHintNode = hintTree?.slots?.[parallelRouteKey] ?? null\n\n const child = await createFlightRouterStateFromLoaderTreeImpl(\n parallelRoutes[parallelRouteKey],\n childHintNode,\n prefetchInliningEnabled,\n cacheComponents,\n partialPrefetching,\n isStaticGeneration,\n isBuildTimePrerendering,\n getDynamicParamFromSegment,\n searchParams,\n didFindRootLayout\n )\n // Propagate subtree flags from children\n if (child[4] !== undefined) {\n prefetchHints = propagateSubtreeBits(prefetchHints, child[4])\n }\n children[parallelRouteKey] = child\n }\n segmentTree[1] = children\n\n if (prefetchHints !== 0) {\n segmentTree[4] = prefetchHints\n }\n\n return segmentTree\n}\n\nexport async function createFlightRouterStateFromLoaderTree(\n loaderTree: LoaderTree,\n hintTree: PrefetchHints | null,\n prefetchInliningEnabled: boolean,\n cacheComponents: boolean,\n partialPrefetching: boolean | 'unstable_eager' | undefined,\n isStaticGeneration: boolean,\n isBuildTimePrerendering: boolean,\n getDynamicParamFromSegment: GetDynamicParamFromSegment,\n searchParams: any,\n // Whether a root layout was already found above this loader tree slice, so a\n // slice that starts below the root layout doesn't mark a sub-layout as the\n // root layout.\n didFindRootLayout: boolean = false\n): Promise<FlightRouterState> {\n return createFlightRouterStateFromLoaderTreeImpl(\n loaderTree,\n hintTree,\n prefetchInliningEnabled,\n cacheComponents,\n partialPrefetching,\n isStaticGeneration,\n isBuildTimePrerendering,\n getDynamicParamFromSegment,\n searchParams,\n didFindRootLayout\n )\n}\n\nexport async function createRouteTreePrefetch(\n loaderTree: LoaderTree,\n hintTree: PrefetchHints | null,\n prefetchInliningEnabled: boolean,\n cacheComponents: boolean,\n partialPrefetching: boolean | 'unstable_eager' | undefined,\n isStaticGeneration: boolean,\n isBuildTimePrerendering: boolean,\n getDynamicParamFromSegment: GetDynamicParamFromSegment,\n // See note on createFlightRouterStateFromLoaderTree's didFindRootLayout.\n didFindRootLayout: boolean = false\n): Promise<FlightRouterState> {\n // Search params should not be added to page segment's cache key during a\n // route tree prefetch request, because they do not affect the structure of\n // the route. The client cache has its own logic to handle search params.\n const searchParams = {}\n return createFlightRouterStateFromLoaderTreeImpl(\n loaderTree,\n hintTree,\n prefetchInliningEnabled,\n cacheComponents,\n partialPrefetching,\n isStaticGeneration,\n isBuildTimePrerendering,\n getDynamicParamFromSegment,\n searchParams,\n didFindRootLayout\n )\n}\n"],"names":["PrefetchHint","propagateSubtreeBits","addSearchParamsIfPageSegment","createFlightRouterStateFromLoaderTreeImpl","loaderTree","hintTree","prefetchInliningEnabled","cacheComponents","partialPrefetching","isStaticGeneration","isBuildTimePrerendering","getDynamicParamFromSegment","searchParams","didFindRootLayout","segment","parallelRoutes","layout","loading","page","dynamicParam","treeSegment","segmentTree","mod","undefined","instantConfig","instant","prefetchConfig","prefetch","prefetchHints","hints","InliningHintsStale","PrefetchDisabled","IsRootLayoutOrAbove","isInstant","SubtreeHasPartialPrefetching","SubtreeHasInstantFalse","SubtreeHasEagerPrefetch","HasRuntimePrefetch","SegmentHasLoadingBoundary","children","parallelRouteKey","childHintNode","slots","child","createFlightRouterStateFromLoaderTree","createRouteTreePrefetch"],"mappings":"AACA,SACEA,YAAY,EACZC,oBAAoB,QAGf,oCAAmC;AAE1C,SAASC,4BAA4B,QAAQ,2BAA0B;AAGvE,eAAeC,0CACbC,UAAsB,EACtBC,QAA8B,EAC9BC,uBAAgC,EAChCC,e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BACAC,4BACAC,cACAC;AAEJ","ignoreList":[0]} |
@@ -27,2 +27,3 @@ // eslint-disable-next-line import/no-extraneous-dependencies | ||
| export { preloadStyle, preloadFont, preconnect } from './rsc/preloads'; | ||
| export { isEmptyHTMLPrelude } from './postponed-state'; | ||
| export { Postpone } from './rsc/postpone'; | ||
@@ -29,0 +30,0 @@ export { taintObjectReference } from './rsc/taint'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/server/app-render/entry-base.ts"],"sourcesContent":["// eslint-disable-next-line import/no-extraneous-dependencies\nexport {\n createTemporaryReferenceSet,\n renderToReadableStream,\n decodeReply,\n decodeAction,\n decodeFormState,\n} from 'react-server-dom-webpack/server'\n\n// eslint-disable-next-line import/no-extraneous-dependencies\nexport { prerender } from 'react-server-dom-webpack/static'\n\n// Node.js-specific Flight APIs, needed by stream-ops.node.ts via ComponentMod.\n// These must be exported from entry-base (react-server layer) because direct\n// imports from react-server-dom-webpack/* fail outside this layer.\ntype FlightRenderToPipeableStream = (...args: any[]) => {\n pipe<Writable extends NodeJS.WritableStream>(destination: Writable): Writable\n abort: (reason?: unknown) => void\n}\n\ntype FlightPrerenderToNodeStream = (...args: any[]) => Promise<{\n prelude: import('node:stream').Readable\n}>\n\n/* eslint-disable import/no-extraneous-dependencies */\nexport let renderToPipeableStream: FlightRenderToPipeableStream | undefined\nexport let prerenderToNodeStream: FlightPrerenderToNodeStream | undefined\nif (process.env.__NEXT_USE_NODE_STREAMS) {\n renderToPipeableStream = (\n require('react-server-dom-webpack/server.node') as typeof import('react-server-dom-webpack/server.node')\n ).renderToPipeableStream\n prerenderToNodeStream = (\n require('react-server-dom-webpack/static') as typeof import('react-server-dom-webpack/static')\n ).prerenderToNodeStream\n} else {\n renderToPipeableStream = undefined\n prerenderToNodeStream = undefined\n}\n/* eslint-enable import/no-extraneous-dependencies */\n\n// TODO: Just re-export `* as ReactServer`\nexport { captureOwnerStack, createElement, Fragment } from 'react'\n\nexport {\n default as LayoutRouter,\n LoadingBoundaryProvider,\n} from '../../client/components/layout-router'\nexport { default as RenderFromTemplateContext } from '../../client/components/render-from-template-context'\nexport { ClientPageRoot } from '../../client/components/client-page'\nexport { ClientSegmentRoot } from '../../client/components/client-segment'\nexport {\n createServerSearchParamsForServerPage,\n createPrerenderSearchParamsForClientPage,\n} from '../request/search-params'\nexport {\n createServerParamsForServerSegment,\n createPrerenderParamsForClientSegment,\n} from '../request/params'\nexport * as serverHooks from '../../client/components/hooks-server-context'\nexport { HTTPAccessFallbackBoundary } from '../../client/components/http-access-fallback/error-boundary'\nexport { createMetadataComponents } from '../../lib/metadata/metadata'\nexport { RootLayoutBoundary } from '../../lib/framework/boundary-components'\n\nexport { preloadStyle, preloadFont, preconnect } from './rsc/preloads'\nexport { Postpone } from './rsc/postpone'\nexport { taintObjectReference } from './rsc/taint'\nexport {\n collectSegmentData,\n collectPrefetchHints,\n} from './collect-segment-data'\n\nexport const InstantValidation = () => {\n if (\n process.env.NEXT_RUNTIME !== 'edge' &&\n process.env.__NEXT_CACHE_COMPONENTS\n ) {\n return require('./instant-validation/instant-validation') as typeof import('./instant-validation/instant-validation')\n } else {\n return undefined\n }\n}\n\nimport type { NodeJsPartialHmrUpdate } from '../../build/swc/types'\nimport { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { workUnitAsyncStorage } from './work-unit-async-storage.external'\nimport { patchFetch as _patchFetch } from '../lib/patch-fetch'\n\nlet SegmentViewNode: typeof import('../../next-devtools/userspace/app/segment-explorer-node').SegmentViewNode =\n () => null\nlet SegmentViewStateNode: typeof import('../../next-devtools/userspace/app/segment-explorer-node').SegmentViewStateNode =\n () => null\nif (process.env.NODE_ENV === 'development') {\n const mod =\n require('../../next-devtools/userspace/app/segment-explorer-node') as typeof import('../../next-devtools/userspace/app/segment-explorer-node')\n SegmentViewNode = mod.SegmentViewNode\n SegmentViewStateNode = mod.SegmentViewStateNode\n}\n\n// For hot-reloader\ndeclare global {\n var __next__clear_chunk_cache__: (() => void) | null | undefined\n var __turbopack_clear_chunk_cache__: () => void | null | undefined\n var __turbopack_server_hmr_apply__:\n | ((update: NodeJsPartialHmrUpdate) => boolean)\n | undefined\n}\n\n// hot-reloader modules are not bundled so we need to inject `__next__clear_chunk_cache__`\n// into globalThis from this file which is bundled.\nif (process.env.TURBOPACK) {\n globalThis.__next__clear_chunk_cache__ = __turbopack_clear_chunk_cache__\n} else {\n // Webpack does not have chunks on the server\n globalThis.__next__clear_chunk_cache__ = null\n}\n\n// patchFetch makes use of APIs such as `React.unstable_postpone` which are only available\n// in the experimental channel of React, so export it from here so that it comes from the bundled runtime\nexport function patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage,\n })\n}\n\n// Development only\nexport { SegmentViewNode, SegmentViewStateNode }\n"],"names":["createTemporaryReferenceSet","renderToReadableStream","decodeReply","decodeAction","decodeFormState","prerender","renderToPipeableStream","prerenderToNodeStream","process","env","__NEXT_USE_NODE_STREAMS","require","undefined","captureOwnerStack","createElement","Fragment","default","LayoutRouter","LoadingBoundaryProvider","RenderFromTemplateContext","ClientPageRoot","ClientSegmentRoot","createServerSearchParamsForServerPage","createPrerenderSearchParamsForClientPage","createServerParamsForServerSegment","createPrerenderParamsForClientSegment","serverHooks","HTTPAccessFallbackBoundary","createMetadataComponents","RootLayoutBoundary","preloadStyle","preloadFont","preconnect","Postpone","taintObjectReference","collectSegmentData","collectPrefetchHints","InstantValidation","NEXT_RUNTIME","__NEXT_CACHE_COMPONENTS","workAsyncStorage","workUnitAsyncStorage","patchFetch","_patchFetch","SegmentViewNode","SegmentViewStateNode","NODE_ENV","mod","TURBOPACK","globalThis","__next__clear_chunk_cache__","__turbopack_clear_chunk_cache__"],"mappings":"AAAA,6DAA6D;AAC7D,SACEA,2BAA2B,EAC3BC,sBAAsB,EACtBC,WAAW,EACXC,YAAY,EACZC,eAAe,QACV,kCAAiC;AAExC,6DAA6D;AAC7D,SAASC,SAAS,QAAQ,kCAAiC;AAc3D,oDAAoD,GAC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qBAAoB;AAE9D,IAAIC,kBACF,IAAM;AACR,IAAIC,uBACF,IAAM;AACR,IAAIrC,QAAQC,GAAG,CAACqC,QAAQ,KAAK,eAAe;IAC1C,MAAMC,MACJpC,QAAQ;IACViC,kBAAkBG,IAAIH,eAAe;IACrCC,uBAAuBE,IAAIF,oBAAoB;AACjD;AAWA,0FAA0F;AAC1F,mDAAmD;AACnD,IAAIrC,QAAQC,GAAG,CAACuC,SAAS,EAAE;IACzBC,WAAWC,2BAA2B,GAAGC;AAC3C,OAAO;IACL,6CAA6C;IAC7CF,WAAWC,2BAA2B,GAAG;AAC3C;AAEA,0FAA0F;AAC1F,yGAAyG;AACzG,OAAO,SAASR;IACd,OAAOC,YAAY;QACjBH;QACAC;IACF;AACF;AAEA,mBAAmB;AACnB,SAASG,eAAe,EAAEC,oBAAoB,GAAE","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/server/app-render/entry-base.ts"],"sourcesContent":["// eslint-disable-next-line import/no-extraneous-dependencies\nexport {\n createTemporaryReferenceSet,\n renderToReadableStream,\n decodeReply,\n decodeAction,\n decodeFormState,\n} from 'react-server-dom-webpack/server'\n\n// eslint-disable-next-line import/no-extraneous-dependencies\nexport { prerender } from 'react-server-dom-webpack/static'\n\n// Node.js-specific Flight APIs, needed by stream-ops.node.ts via ComponentMod.\n// These must be exported from entry-base (react-server layer) because direct\n// imports from react-server-dom-webpack/* fail outside this layer.\ntype FlightRenderToPipeableStream = (...args: any[]) => {\n pipe<Writable extends NodeJS.WritableStream>(destination: Writable): Writable\n abort: (reason?: unknown) => void\n}\n\ntype FlightPrerenderToNodeStream = (...args: any[]) => Promise<{\n prelude: import('node:stream').Readable\n}>\n\n/* eslint-disable import/no-extraneous-dependencies */\nexport let renderToPipeableStream: FlightRenderToPipeableStream | undefined\nexport let prerenderToNodeStream: FlightPrerenderToNodeStream | undefined\nif (process.env.__NEXT_USE_NODE_STREAMS) {\n renderToPipeableStream = (\n require('react-server-dom-webpack/server.node') as typeof import('react-server-dom-webpack/server.node')\n ).renderToPipeableStream\n prerenderToNodeStream = (\n require('react-server-dom-webpack/static') as typeof import('react-server-dom-webpack/static')\n ).prerenderToNodeStream\n} else {\n renderToPipeableStream = undefined\n prerenderToNodeStream = undefined\n}\n/* eslint-enable import/no-extraneous-dependencies */\n\n// TODO: Just re-export `* as ReactServer`\nexport { captureOwnerStack, createElement, Fragment } from 'react'\n\nexport {\n default as LayoutRouter,\n LoadingBoundaryProvider,\n} from '../../client/components/layout-router'\nexport { default as RenderFromTemplateContext } from '../../client/components/render-from-template-context'\nexport { ClientPageRoot } from '../../client/components/client-page'\nexport { ClientSegmentRoot } from '../../client/components/client-segment'\nexport {\n createServerSearchParamsForServerPage,\n createPrerenderSearchParamsForClientPage,\n} from '../request/search-params'\nexport {\n createServerParamsForServerSegment,\n createPrerenderParamsForClientSegment,\n} from '../request/params'\nexport * as serverHooks from '../../client/components/hooks-server-context'\nexport { HTTPAccessFallbackBoundary } from '../../client/components/http-access-fallback/error-boundary'\nexport { createMetadataComponents } from '../../lib/metadata/metadata'\nexport { RootLayoutBoundary } from '../../lib/framework/boundary-components'\n\nexport { preloadStyle, preloadFont, preconnect } from './rsc/preloads'\nexport { isEmptyHTMLPrelude } from './postponed-state'\nexport { Postpone } from './rsc/postpone'\nexport { taintObjectReference } from './rsc/taint'\nexport {\n collectSegmentData,\n collectPrefetchHints,\n} from './collect-segment-data'\n\nexport const InstantValidation = () => {\n if (\n process.env.NEXT_RUNTIME !== 'edge' &&\n process.env.__NEXT_CACHE_COMPONENTS\n ) {\n return require('./instant-validation/instant-validation') as typeof import('./instant-validation/instant-validation')\n } else {\n return undefined\n }\n}\n\nimport type { NodeJsPartialHmrUpdate } from '../../build/swc/types'\nimport { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { workUnitAsyncStorage } from './work-unit-async-storage.external'\nimport { patchFetch as _patchFetch } from '../lib/patch-fetch'\n\nlet SegmentViewNode: typeof import('../../next-devtools/userspace/app/segment-explorer-node').SegmentViewNode =\n () => null\nlet SegmentViewStateNode: typeof import('../../next-devtools/userspace/app/segment-explorer-node').SegmentViewStateNode =\n () => null\nif (process.env.NODE_ENV === 'development') {\n const mod =\n require('../../next-devtools/userspace/app/segment-explorer-node') as typeof import('../../next-devtools/userspace/app/segment-explorer-node')\n SegmentViewNode = mod.SegmentViewNode\n SegmentViewStateNode = mod.SegmentViewStateNode\n}\n\n// For hot-reloader\ndeclare global {\n var __next__clear_chunk_cache__: (() => void) | null | undefined\n var __turbopack_clear_chunk_cache__: () => void | null | undefined\n var __turbopack_server_hmr_apply__:\n | ((update: NodeJsPartialHmrUpdate) => boolean)\n | undefined\n}\n\n// hot-reloader modules are not bundled so we need to inject `__next__clear_chunk_cache__`\n// into globalThis from this file which is bundled.\nif (process.env.TURBOPACK) {\n globalThis.__next__clear_chunk_cache__ = __turbopack_clear_chunk_cache__\n} else {\n // Webpack does not have chunks on the server\n globalThis.__next__clear_chunk_cache__ = null\n}\n\n// patchFetch makes use of APIs such as `React.unstable_postpone` which are only available\n// in the experimental channel of React, so export it from here so that it comes from the bundled runtime\nexport function patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage,\n })\n}\n\n// Development only\nexport { SegmentViewNode, SegmentViewStateNode }\n"],"names":["createTemporaryReferenceSet","renderToReadableStream","decodeReply","decodeAction","decodeFormState","prerender","renderToPipeableStream","prerenderToNodeStream","process","env","__NEXT_USE_NODE_STREAMS","require","undefined","captureOwnerStack","createElement","Fragment","default","LayoutRouter","LoadingBoundaryProvider","RenderFromTemplateContext","ClientPageRoot","ClientSegmentRoot","createServerSearchParamsForServerPage","createPrerenderSearchParamsForClientPage","createServerParamsForServerSegment","createPrerenderParamsForClientSegment","serverHooks","HTTPAccessFallbackBoundary","createMetadataComponents","RootLayoutBoundary","preloadStyle","preloadFont","preconnect","isEmptyHTMLPrelude","Postpone","taintObjectReference","collectSegmentData","collectPrefetchHints","InstantValidation","NEXT_RUNTIME","__NEXT_CACHE_COMPONENTS","workAsyncStorage","workUnitAsyncStorage","patchFetch","_patchFetch","SegmentViewNode","SegmentViewStateNode","NODE_ENV","mod","TURBOPACK","globalThis","__next__clear_chunk_cache__","__turbopack_clear_chunk_cache__"],"mappings":"AAAA,6DAA6D;AAC7D,SACEA,2BAA2B,EAC3BC,sBAAsB,EACtBC,WAAW,EACXC,YAAY,EACZC,eAAe,QACV,kCAAiC;AAExC,6DAA6D;AAC7D,SAASC,SAAS,QAAQ,kCAAiC;AAc3D,oDAAoD,GACpD,OAAO,IAAIC,uBAAgE;AAC3E,OAAO,IAAIC,sBAA8D;AACzE,IAAIC,QAAQC,GAAG,CAACC,uBAAuB,EAAE;IACvCJ,yBAAyB,AACvBK,QAAQ,wCACRL,sBAAsB;IACxBC,wBAAwB,AACtBI,QAAQ,mCACRJ,qBAAqB;AACzB,OAAO;IACLD,yBAAyBM;IACzBL,wBAAwBK;AAC1B;AACA,mDAAmD,GAEnD,0CAA0C;AAC1C,SAASC,iBAAiB,EAAEC,aAAa,EAAEC,QAAQ,QAAQ,QAAO;AAElE,SACEC,WAAWC,YAAY,EACvBC,uBAAuB,QAClB,wCAAuC;AAC9C,SAASF,WAAWG,yBAAyB,QAAQ,uDAAsD;AAC3G,SAASC,cAAc,QAAQ,sCAAqC;AACpE,SAASC,iBAAiB,QAAQ,yCAAwC;AAC1E,SACEC,qCAAqC,EACrCC,wCAAwC,QACnC,2BAA0B;AACjC,SACEC,kCAAkC,EAClCC,qCAAqC,QAChC,oBAAmB;AAC1B,OAAO,KAAKC,WAAW,MAAM,+CAA8C;AAC3E,SAASC,0BAA0B,QAAQ,8DAA6D;AACxG,SAASC,wBAAwB,QAAQ,8BAA6B;AACtE,SAASC,kBAAkB,QAAQ,0CAAyC;AAE5E,SAASC,YAAY,EAAEC,WAAW,EAAEC,UAAU,QAAQ,iBAAgB;AACtE,SAASC,kBAAkB,QAAQ,oBAAmB;AACtD,SAASC,QAAQ,QAAQ,iBAAgB;AACzC,SAASC,oBAAoB,QAAQ,cAAa;AAClD,SACEC,kBAAkB,EAClBC,oBAAoB,QACf,yBAAwB;AAE/B,OAAO,MAAMC,oBAAoB;IAC/B,IACE9B,QAAQC,GAAG,CAAC8B,YAAY,KAAK,UAC7B/B,QAAQC,GAAG,CAAC+B,uBAAuB,EACnC;QACA,OAAO7B,QAAQ;IACjB,OAAO;QACL,OAAOC;IACT;AACF,EAAC;AAGD,SAAS6B,gBAAgB,QAAQ,4CAA2C;AAC5E,SAASC,oBAAoB,QAAQ,qCAAoC;AACzE,SAASC,cAAcC,WAAW,QAAQ,qBAAoB;AAE9D,IAAIC,kBACF,IAAM;AACR,IAAIC,uBACF,IAAM;AACR,IAAItC,QAAQC,GAAG,CAACsC,QAAQ,KAAK,eAAe;IAC1C,MAAMC,MACJrC,QAAQ;IACVkC,kBAAkBG,IAAIH,eAAe;IACrCC,uBAAuBE,IAAIF,oBAAoB;AACjD;AAWA,0FAA0F;AAC1F,mDAAmD;AACnD,IAAItC,QAAQC,GAAG,CAACwC,SAAS,EAAE;IACzBC,WAAWC,2BAA2B,GAAGC;AAC3C,OAAO;IACL,6CAA6C;IAC7CF,WAAWC,2BAA2B,GAAG;AAC3C;AAEA,0FAA0F;AAC1F,yGAAyG;AACzG,OAAO,SAASR;IACd,OAAOC,YAAY;QACjBH;QACAC;IACF;AACF;AAEA,mBAAmB;AACnB,SAASG,eAAe,EAAEC,oBAAoB,GAAE","ignoreList":[0]} |
@@ -119,3 +119,44 @@ import { getDynamicParam } from '../../shared/lib/router/utils/get-dynamic-param'; | ||
| } | ||
| /** | ||
| * Cheaply determines whether a serialized postponed state represents an empty | ||
| * HTML prelude — i.e. the static shell rendered no bytes before the first | ||
| * dynamic hole (a blocking dynamic API at the root with no Suspense boundary | ||
| * above it). Returns false for dynamic-data states or unparseable input. | ||
| * | ||
| * Unlike `parsePostponedState`, this does not interpolate fallback route params | ||
| * or build a resume data cache: it only reads the prelude marker, which is | ||
| * independent of param values. The Instant Navigation Testing API uses this to | ||
| * detect the blank-document case in both dev (fresh render) and production | ||
| * (prebuilt shell), where the marker is persisted in the postponed state. | ||
| */ export function isEmptyHTMLPrelude(state) { | ||
| try { | ||
| var _state_match; | ||
| const lengthMatch = (_state_match = state.match(/^([0-9]*):/)) == null ? void 0 : _state_match[1]; | ||
| if (!lengthMatch) { | ||
| return false; | ||
| } | ||
| const length = parseInt(lengthMatch); | ||
| let postponedString = state.slice(lengthMatch.length + 1, lengthMatch.length + 1 + length); | ||
| // `null` is the dynamic-data case (a full shell was produced). | ||
| if (postponedString === 'null') { | ||
| return false; | ||
| } | ||
| // An optional `<n><replacements>` prefix carries fallback route param | ||
| // replacements; skip it to reach the `[preludeState, postponed]` data. | ||
| if (/^[0-9]/.test(postponedString)) { | ||
| var _postponedString_match; | ||
| const replacementsLengthMatch = (_postponedString_match = postponedString.match(/^([0-9]*)/)) == null ? void 0 : _postponedString_match[1]; | ||
| if (!replacementsLengthMatch) { | ||
| return false; | ||
| } | ||
| const replacementsLength = parseInt(replacementsLengthMatch); | ||
| postponedString = postponedString.slice(replacementsLengthMatch.length + replacementsLength); | ||
| } | ||
| const data = JSON.parse(postponedString); | ||
| return Array.isArray(data) && data[0] === 0; | ||
| } catch { | ||
| return false; | ||
| } | ||
| } | ||
| //# sourceMappingURL=postponed-state.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/server/app-render/postponed-state.ts"],"sourcesContent":["import type {\n OpaqueFallbackRouteParamEntries,\n OpaqueFallbackRouteParams,\n} from '../../server/request/fallback-params'\nimport { getDynamicParam } from '../../shared/lib/router/utils/get-dynamic-param'\nimport type { Params } from '../request/params'\nimport {\n createPrerenderResumeDataCache,\n createRenderResumeDataCache,\n type PrerenderResumeDataCache,\n type RenderResumeDataCache,\n} from '../resume-data-cache/resume-data-cache'\nimport { stringifyResumeDataCache } from '../resume-data-cache/resume-data-cache'\n\nexport enum DynamicState {\n /**\n * The dynamic access occurred during the RSC render phase.\n */\n DATA = 1,\n\n /**\n * The dynamic access occurred during the HTML shell render phase.\n */\n HTML = 2,\n}\n\n/**\n * The postponed state for dynamic data.\n */\nexport type DynamicDataPostponedState = {\n /**\n * The type of dynamic state.\n */\n readonly type: DynamicState.DATA\n\n /**\n * The immutable resume data cache.\n */\n readonly renderResumeDataCache: RenderResumeDataCache\n}\n\n/**\n * The postponed state for dynamic HTML.\n */\nexport type DynamicHTMLPostponedState = {\n /**\n * The type of dynamic state.\n */\n readonly type: DynamicState.HTML\n\n /**\n * The postponed data used by React.\n */\n readonly data: [\n preludeState: DynamicHTMLPreludeState,\n postponed: ReactPostponed,\n ]\n\n /**\n * The immutable resume data cache.\n */\n readonly renderResumeDataCache: RenderResumeDataCache\n}\n\nexport const enum DynamicHTMLPreludeState {\n Empty = 0,\n Full = 1,\n}\n\ntype ReactPostponed = NonNullable<\n import('react-dom/static').PrerenderResult['postponed']\n>\n\nexport type PostponedState =\n | DynamicDataPostponedState\n | DynamicHTMLPostponedState\n\nexport async function getDynamicHTMLPostponedState(\n postponed: ReactPostponed,\n preludeState: DynamicHTMLPreludeState,\n fallbackRouteParams: OpaqueFallbackRouteParams | null,\n resumeDataCache: PrerenderResumeDataCache | RenderResumeDataCache,\n isCacheComponentsEnabled: boolean\n): Promise<string> {\n const data: DynamicHTMLPostponedState['data'] = [preludeState, postponed]\n const dataString = JSON.stringify(data)\n\n // If there are no fallback route params, we can just serialize the postponed\n // state as is.\n if (!fallbackRouteParams || fallbackRouteParams.size === 0) {\n // Serialized as `<postponedString.length>:<postponedString><renderResumeDataCache>`\n return `${dataString.length}:${dataString}${await stringifyResumeDataCache(\n createRenderResumeDataCache(resumeDataCache),\n isCacheComponentsEnabled\n )}`\n }\n\n const replacements: OpaqueFallbackRouteParamEntries = Array.from(\n fallbackRouteParams.entries()\n )\n const replacementsString = JSON.stringify(replacements)\n\n // Serialized as `<replacements.length><replacements><data>`\n const postponedString = `${replacementsString.length}${replacementsString}${dataString}`\n\n // Serialized as `<postponedString.length>:<postponedString><renderResumeDataCache>`\n return `${postponedString.length}:${postponedString}${await stringifyResumeDataCache(resumeDataCache, isCacheComponentsEnabled)}`\n}\n\nexport async function getDynamicDataPostponedState(\n resumeDataCache: PrerenderResumeDataCache | RenderResumeDataCache,\n isCacheComponentsEnabled: boolean\n): Promise<string> {\n return `4:null${await stringifyResumeDataCache(createRenderResumeDataCache(resumeDataCache), isCacheComponentsEnabled)}`\n}\n\nexport function parsePostponedState(\n state: string,\n interpolatedParams: Params,\n maxPostponedStateSizeBytes: number | undefined\n): PostponedState {\n try {\n const postponedStringLengthMatch = state.match(/^([0-9]*):/)?.[1]\n if (!postponedStringLengthMatch) {\n throw new Error(`Invariant: invalid postponed state ${state}`)\n }\n\n const postponedStringLength = parseInt(postponedStringLengthMatch)\n\n // We add a `:` to the end of the length as the first character of the\n // postponed string is the length of the replacement entries.\n const postponedString = state.slice(\n postponedStringLengthMatch.length + 1,\n postponedStringLengthMatch.length + postponedStringLength + 1\n )\n\n const renderResumeDataCache = createRenderResumeDataCache(\n state.slice(\n postponedStringLengthMatch.length + postponedStringLength + 1\n ),\n maxPostponedStateSizeBytes\n )\n\n try {\n if (postponedString === 'null') {\n return { type: DynamicState.DATA, renderResumeDataCache }\n }\n\n if (/^[0-9]/.test(postponedString)) {\n const match = postponedString.match(/^([0-9]*)/)?.[1]\n if (!match) {\n throw new Error(\n `Invariant: invalid postponed state ${JSON.stringify(postponedString)}`\n )\n }\n\n // This is the length of the replacements entries.\n const length = parseInt(match)\n const replacements = JSON.parse(\n postponedString.slice(\n match.length,\n // We then go to the end of the string.\n match.length + length\n )\n ) as OpaqueFallbackRouteParamEntries\n\n let postponed = postponedString.slice(match.length + length)\n for (const [\n segmentKey,\n [searchValue, dynamicParamType],\n ] of replacements) {\n const {\n treeSegment: [\n ,\n // This is the same value that'll be used in the postponed state\n // as it's part of the tree data. That's why we use it as the\n // replacement value.\n value,\n ],\n } = getDynamicParam(\n interpolatedParams,\n segmentKey,\n dynamicParamType,\n null,\n null // staticSiblings not needed for postponed state\n )\n\n postponed = postponed.replaceAll(searchValue, value)\n }\n\n return {\n type: DynamicState.HTML,\n data: JSON.parse(postponed),\n renderResumeDataCache,\n }\n }\n\n return {\n type: DynamicState.HTML,\n data: JSON.parse(postponedString),\n renderResumeDataCache,\n }\n } catch (err) {\n console.error('Failed to parse postponed state', err)\n return { type: DynamicState.DATA, renderResumeDataCache }\n }\n } catch (err) {\n console.error('Failed to parse postponed state', err)\n return {\n type: DynamicState.DATA,\n renderResumeDataCache: createRenderResumeDataCache(\n createPrerenderResumeDataCache()\n ),\n }\n }\n}\n\nexport function getPostponedFromState(state: DynamicHTMLPostponedState) {\n const [preludeState, postponed] = state.data\n return { preludeState, postponed }\n}\n"],"names":["getDynamicParam","createPrerenderResumeDataCache","createRenderResumeDataCache","stringifyResumeDataCache","DynamicState","DynamicHTMLPreludeState","getDynamicHTMLPostponedState","postponed","preludeState","fallbackRouteParams","resumeDataCache","isCacheComponentsEnabled","data","dataString","JSON","stringify","size","length","replacements","Array","from","entries","replacementsString","postponedString","getDynamicDataPostponedState","parsePostponedState","state","interpolatedParams","maxPostponedStateSizeBytes","postponedStringLengthMatch","match","Error","postponedStringLength","parseInt","slice","renderResumeDataCache","type","test","parse","segmentKey","searchValue","dynamicParamType","treeSegment","value","replaceAll","err","console","error","getPostponedFromState"],"mappings":"AAIA,SAASA,eAAe,QAAQ,kDAAiD;AAEjF,SACEC,8BAA8B,EAC9BC,2BAA2B,QAGtB,yCAAwC;AAC/C,SAASC,wBAAwB,QAAQ,yCAAwC;AAEjF,OAAO,IAAA,AAAKC,sCAAAA;IACV;;GAEC;IAGD;;GAEC;WARSA;MAUX;AAwCD,OAAO,IAAA,AAAWC,iDAAAA;;;WAAAA;MAGjB;AAUD,OAAO,eAAeC,6BACpBC,SAAyB,EACzBC,YAAqC,EACrCC,mBAAqD,EACrDC,eAAiE,EACjEC,wBAAiC;IAEjC,MAAMC,OAA0C;QAACJ;QAAcD;KAAU;IACzE,MAAMM,aAAaC,KAA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OAAO;YACLT,IAAI;YACJD,uBAAuBjC,4BACrBD;QAEJ;IACF;AACF;AAEA,OAAO,SAAS+C,sBAAsBtB,KAAgC;IACpE,MAAM,CAAClB,cAAcD,UAAU,GAAGmB,MAAMd,IAAI;IAC5C,OAAO;QAAEJ;QAAcD;IAAU;AACnC","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/server/app-render/postponed-state.ts"],"sourcesContent":["import type {\n OpaqueFallbackRouteParamEntries,\n OpaqueFallbackRouteParams,\n} from '../../server/request/fallback-params'\nimport { getDynamicParam } from '../../shared/lib/router/utils/get-dynamic-param'\nimport type { Params } from '../request/params'\nimport {\n createPrerenderResumeDataCache,\n createRenderResumeDataCache,\n type PrerenderResumeDataCache,\n type RenderResumeDataCache,\n} from '../resume-data-cache/resume-data-cache'\nimport { stringifyResumeDataCache } from '../resume-data-cache/resume-data-cache'\n\nexport enum DynamicState {\n /**\n * The dynamic access occurred during the RSC render phase.\n */\n DATA = 1,\n\n /**\n * The dynamic access occurred during the HTML shell render phase.\n */\n HTML = 2,\n}\n\n/**\n * The postponed state for dynamic data.\n */\nexport type DynamicDataPostponedState = {\n /**\n * The type of dynamic state.\n */\n readonly type: DynamicState.DATA\n\n /**\n * The immutable resume data cache.\n */\n readonly renderResumeDataCache: RenderResumeDataCache\n}\n\n/**\n * The postponed state for dynamic HTML.\n */\nexport type DynamicHTMLPostponedState = {\n /**\n * The type of dynamic state.\n */\n readonly type: DynamicState.HTML\n\n /**\n * The postponed data used by React.\n */\n readonly data: [\n preludeState: DynamicHTMLPreludeState,\n postponed: ReactPostponed,\n ]\n\n /**\n * The immutable resume data cache.\n */\n readonly renderResumeDataCache: RenderResumeDataCache\n}\n\nexport const enum DynamicHTMLPreludeState {\n Empty = 0,\n Full = 1,\n}\n\ntype ReactPostponed = NonNullable<\n import('react-dom/static').PrerenderResult['postponed']\n>\n\nexport type PostponedState =\n | DynamicDataPostponedState\n | DynamicHTMLPostponedState\n\nexport async function getDynamicHTMLPostponedState(\n postponed: ReactPostponed,\n preludeState: DynamicHTMLPreludeState,\n fallbackRouteParams: OpaqueFallbackRouteParams | null,\n resumeDataCache: PrerenderResumeDataCache | RenderResumeDataCache,\n isCacheComponentsEnabled: boolean\n): Promise<string> {\n const data: DynamicHTMLPostponedState['data'] = [preludeState, postponed]\n const dataString = JSON.stringify(data)\n\n // If there are no fallback route params, we can just serialize the postponed\n // state as is.\n if (!fallbackRouteParams || fallbackRouteParams.size === 0) {\n // Serialized as `<postponedString.length>:<postponedString><renderResumeDataCache>`\n return `${dataString.length}:${dataString}${await stringifyResumeDataCache(\n createRenderResumeDataCache(resumeDataCache),\n isCacheComponentsEnabled\n )}`\n }\n\n const replacements: OpaqueFallbackRouteParamEntries = Array.from(\n fallbackRouteParams.entries()\n )\n const replacementsString = JSON.stringify(replacements)\n\n // Serialized as `<replacements.length><replacements><data>`\n const postponedString = `${replacementsString.length}${replacementsString}${dataString}`\n\n // Serialized as `<postponedString.length>:<postponedString><renderResumeDataCache>`\n return `${postponedString.length}:${postponedString}${await stringifyResumeDataCache(resumeDataCache, isCacheComponentsEnabled)}`\n}\n\nexport async function getDynamicDataPostponedState(\n resumeDataCache: PrerenderResumeDataCache | RenderResumeDataCache,\n isCacheComponentsEnabled: boolean\n): Promise<string> {\n return `4:null${await stringifyResumeDataCache(createRenderResumeDataCache(resumeDataCache), isCacheComponentsEnabled)}`\n}\n\nexport function parsePostponedState(\n state: string,\n interpolatedParams: Params,\n maxPostponedStateSizeBytes: number | undefined\n): PostponedState {\n try {\n const postponedStringLengthMatch = state.match(/^([0-9]*):/)?.[1]\n if (!postponedStringLengthMatch) {\n throw new Error(`Invariant: invalid postponed state ${state}`)\n }\n\n const postponedStringLength = parseInt(postponedStringLengthMatch)\n\n // We add a `:` to the end of the length as the first character of the\n // postponed string is the length of the replacement entries.\n const postponedString = state.slice(\n postponedStringLengthMatch.length + 1,\n postponedStringLengthMatch.length + postponedStringLength + 1\n )\n\n const renderResumeDataCache = createRenderResumeDataCache(\n state.slice(\n postponedStringLengthMatch.length + postponedStringLength + 1\n ),\n maxPostponedStateSizeBytes\n )\n\n try {\n if (postponedString === 'null') {\n return { type: DynamicState.DATA, renderResumeDataCache }\n }\n\n if (/^[0-9]/.test(postponedString)) {\n const match = postponedString.match(/^([0-9]*)/)?.[1]\n if (!match) {\n throw new Error(\n `Invariant: invalid postponed state ${JSON.stringify(postponedString)}`\n )\n }\n\n // This is the length of the replacements entries.\n const length = parseInt(match)\n const replacements = JSON.parse(\n postponedString.slice(\n match.length,\n // We then go to the end of the string.\n match.length + length\n )\n ) as OpaqueFallbackRouteParamEntries\n\n let postponed = postponedString.slice(match.length + length)\n for (const [\n segmentKey,\n [searchValue, dynamicParamType],\n ] of replacements) {\n const {\n treeSegment: [\n ,\n // This is the same value that'll be used in the postponed state\n // as it's part of the tree data. That's why we use it as the\n // replacement value.\n value,\n ],\n } = getDynamicParam(\n interpolatedParams,\n segmentKey,\n dynamicParamType,\n null,\n null // staticSiblings not needed for postponed state\n )\n\n postponed = postponed.replaceAll(searchValue, value)\n }\n\n return {\n type: DynamicState.HTML,\n data: JSON.parse(postponed),\n renderResumeDataCache,\n }\n }\n\n return {\n type: DynamicState.HTML,\n data: JSON.parse(postponedString),\n renderResumeDataCache,\n }\n } catch (err) {\n console.error('Failed to parse postponed state', err)\n return { type: DynamicState.DATA, renderResumeDataCache }\n }\n } catch (err) {\n console.error('Failed to parse postponed state', err)\n return {\n type: DynamicState.DATA,\n renderResumeDataCache: createRenderResumeDataCache(\n createPrerenderResumeDataCache()\n ),\n }\n }\n}\n\nexport function getPostponedFromState(state: DynamicHTMLPostponedState) {\n const [preludeState, postponed] = state.data\n return { preludeState, postponed }\n}\n\n/**\n * Cheaply determines whether a serialized postponed state represents an empty\n * HTML prelude — i.e. the static shell rendered no bytes before the first\n * dynamic hole (a blocking dynamic API at the root with no Suspense boundary\n * above it). Returns false for dynamic-data states or unparseable input.\n *\n * Unlike `parsePostponedState`, this does not interpolate fallback route params\n * or build a resume data cache: it only reads the prelude marker, which is\n * independent of param values. The Instant Navigation Testing API uses this to\n * detect the blank-document case in both dev (fresh render) and production\n * (prebuilt shell), where the marker is persisted in the postponed state.\n */\nexport function isEmptyHTMLPrelude(state: string): boolean {\n try {\n const lengthMatch = state.match(/^([0-9]*):/)?.[1]\n if (!lengthMatch) {\n return false\n }\n\n const length = parseInt(lengthMatch)\n let postponedString = state.slice(\n lengthMatch.length + 1,\n lengthMatch.length + 1 + length\n )\n\n // `null` is the dynamic-data case (a full shell was produced).\n if (postponedString === 'null') {\n return false\n }\n\n // An optional `<n><replacements>` prefix carries fallback route param\n // replacements; skip it to reach the `[preludeState, postponed]` data.\n if (/^[0-9]/.test(postponedString)) {\n const replacementsLengthMatch = postponedString.match(/^([0-9]*)/)?.[1]\n if (!replacementsLengthMatch) {\n return false\n }\n const replacementsLength = parseInt(replacementsLengthMatch)\n postponedString = postponedString.slice(\n replacementsLengthMatch.length + replacementsLength\n )\n }\n\n const data = JSON.parse(postponedString)\n return Array.isArray(data) && data[0] === DynamicHTMLPreludeState.Empty\n } catch {\n return false\n }\n}\n"],"names":["getDynamicParam","createPrerenderResumeDataCache","createRenderResumeDataCache","stringifyResumeDataCache","DynamicState","DynamicHTMLPreludeState","getDynamicHTMLPostponedState","postponed","preludeState","fallbackRouteParams","resumeDataCache","isCacheComponentsEnabled","data","dataString","JSON","stringify","size","length","replacements","Array","from","entries","replacementsString","postponedString","getDynamicDataPostponedState","parsePostponedState","state","interpolatedParams","maxPostponedStateSizeBytes","postponedStringLengthMatch","match","Error","postponedStringLength","parseInt","slice","renderResumeDataCache","type","test","parse","segmentKey","searchValue","dynamicParamType","treeSegment","value","replaceAll","err","console","error","getPostponedFromState","isEmptyHTMLPrelude","lengthMatch","replacementsLengthMatch","replacementsLength","isArray"],"mappings":"AAIA,SAASA,eAAe,QAAQ,kDAAiD;AAEjF,SACEC,8BAA8B,EAC9BC,2BAA2B,QAGtB,yCAAwC;AAC/C,SAASC,wBAAwB,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wB,KAAK,CAACf;QACxB,OAAOJ,MAAMkC,OAAO,CAACzC,SAASA,IAAI,CAAC,EAAE;IACvC,EAAE,OAAM;QACN,OAAO;IACT;AACF","ignoreList":[0]} |
@@ -180,2 +180,3 @@ import { VALID_LOADERS } from '../shared/lib/image-config'; | ||
| appNewScrollHandler: z.boolean().optional(), | ||
| coldCacheBadge: z.boolean().optional(), | ||
| preloadEntriesOnStart: z.boolean().optional(), | ||
@@ -182,0 +183,0 @@ allowedRevalidateHeaderKeys: z.array(z.string()).optional(), |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/server/config-schema.ts"],"sourcesContent":["import type { NextConfig } from './config'\nimport { VALID_LOADERS } from '../shared/lib/image-config'\n\nimport { z } from 'next/dist/compiled/zod'\nimport type zod from 'next/dist/compiled/zod'\n\nimport type { SizeLimit } from '../types'\nimport {\n LIGHTNINGCSS_FEATURE_NAMES,\n type ExportPathMap,\n type TurbopackLoaderItem,\n type TurbopackOptions,\n type TurbopackRuleConfigItem,\n type TurbopackRuleConfigCollection,\n type TurbopackRuleCondition,\n type TurbopackLoaderBuiltinCondition,\n} from './config-shared'\nimport type {\n Header,\n Rewrite,\n RouteHas,\n Redirect,\n} from '../lib/load-custom-routes'\nimport { SUPPORTED_TEST_RUNNERS_LIST } from '../cli/next-test'\n\n// A custom zod schema for the SizeLimit type\nconst zSizeLimit = z.custom<SizeLimit>((val) => {\n if (typeof val === 'number' || typeof val === 'string') {\n return true\n }\n return false\n})\n\nconst zExportMap: zod.ZodType<ExportPathMap> = z.record(\n z.string(),\n z.object({\n page: z.string(),\n query: z.any(), // NextParsedUrlQuery\n\n // private optional properties\n _fallbackRouteParams: z.array(z.any()).optional(),\n _isAppDir: z.boolean().optional(),\n _isDynamicError: z.boolean().optional(),\n _isRoutePPREnabled: z.boolean().optional(),\n _allowEmptyStaticShell: z.boolean().optional(),\n _isFallbackUpgradeable: z.boolean().optional(),\n })\n)\n\nconst zRouteHas: zod.ZodType<RouteHas> = z.union([\n z.object({\n type: z.enum(['header', 'query', 'cookie']),\n key: z.string(),\n value: z.string().optional(),\n }),\n z.object({\n type: z.literal('host'),\n key: z.undefined().optional(),\n value: z.string(),\n }),\n])\n\nconst zRewrite: zod.ZodType<Rewrite> = z.object({\n source: z.string(),\n destination: z.string(),\n basePath: z.literal(false).optional(),\n locale: z.literal(false).optional(),\n has: z.array(zRouteHas).optional(),\n missing: z.array(zRouteHas).optional(),\n internal: z.boolean().optional(),\n})\n\nconst zRedirect: zod.ZodType<Redirect> = z\n .object({\n source: z.string(),\n destination: z.string(),\n basePath: z.literal(false).optional(),\n locale: z.literal(false).optional(),\n has: z.array(zRouteHas).optional(),\n missing: z.array(zRouteHas).optional(),\n internal: z.boolean().optional(),\n })\n .and(\n z.union([\n z.object({\n statusCode: z.never().optional(),\n permanent: z.boolean(),\n }),\n z.object({\n statusCode: z.number(),\n permanent: z.never().optional(),\n }),\n ])\n )\n\nconst zHeader: zod.ZodType<Header> = z.object({\n source: z.string(),\n basePath: z.literal(false).optional(),\n locale: z.literal(false).optional(),\n headers: z.array(z.object({ key: z.string(), value: z.string() })),\n has: z.array(zRouteHas).optional(),\n missing: z.array(zRouteHas).optional(),\n\n internal: z.boolean().optional(),\n})\n\nconst zTurbopackLoaderItem: zod.ZodType<TurbopackLoaderItem> = z.union([\n z.string(),\n z.strictObject({\n loader: z.string(),\n // Any JSON value can be used as turbo loader options, so use z.any() here\n options: z.record(z.string(), z.any()).optional(),\n }),\n])\n\nconst zTurbopackLoaderBuiltinCondition: zod.ZodType<TurbopackLoaderBuiltinCondition> =\n z.union([\n z.literal('browser'),\n z.literal('foreign'),\n z.literal('development'),\n z.literal('production'),\n z.literal('node'),\n z.literal('edge-light'),\n ])\n\nconst zTurbopackCondition: zod.ZodType<TurbopackRuleCondition> = z.union([\n z.strictObject({ all: z.lazy(() => z.array(zTurbopackCondition)) }),\n z.strictObject({ any: z.lazy(() => z.array(zTurbopackCondition)) }),\n z.strictObject({ not: z.lazy(() => zTurbopackCondition) }),\n zTurbopackLoaderBuiltinCondition,\n z.strictObject({\n path: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n content: z.instanceof(RegExp).optional(),\n query: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n contentType: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n }),\n])\n\nconst zTurbopackModuleType = z.enum([\n 'asset',\n 'ecmascript',\n 'typescript',\n 'css',\n 'css-module',\n 'wasm',\n 'raw',\n 'node',\n 'bytes',\n])\n\nconst zTurbopackRuleConfigItem: zod.ZodType<TurbopackRuleConfigItem> =\n z.strictObject({\n loaders: z.array(zTurbopackLoaderItem).optional(),\n as: z.string().optional(),\n condition: zTurbopackCondition.optional(),\n type: zTurbopackModuleType.optional(),\n })\n\nconst zTurbopackRuleConfigCollection: zod.ZodType<TurbopackRuleConfigCollection> =\n z.union([\n zTurbopackRuleConfigItem,\n z.array(z.union([zTurbopackLoaderItem, zTurbopackRuleConfigItem])),\n ])\n\nconst zTurbopackConfig: zod.ZodType<TurbopackOptions> = z.strictObject({\n rules: z.record(z.string(), zTurbopackRuleConfigCollection).optional(),\n resolveAlias: z\n .record(\n z.string(),\n z.union([\n z.string(),\n z.array(z.string()),\n z.record(z.string(), z.union([z.string(), z.array(z.string())])),\n ])\n )\n .optional(),\n resolveExtensions: z.array(z.string()).optional(),\n root: z.string().optional(),\n debugIds: z.boolean().optional(),\n chunkLoadingGlobal: z.string().optional(),\n ignoreIssue: z\n .array(\n z.object({\n path: z.union([z.string(), z.instanceof(RegExp)]),\n title: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n description: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n })\n )\n .optional(),\n})\n\nexport const experimentalSchema = {\n outputHashSalt: z.string().optional(),\n useSkewCookie: z.boolean().optional(),\n after: z.boolean().optional(),\n appNavFailHandling: z.boolean().optional(),\n appNewScrollHandler: z.boolean().optional(),\n preloadEntriesOnStart: z.boolean().optional(),\n allowedRevalidateHeaderKeys: z.array(z.string()).optional(),\n staleTimes: z\n .object({\n dynamic: z.number().optional(),\n static: z.number().gte(30).optional(),\n })\n .optional(),\n cacheLife: z\n .record(\n z.object({\n stale: z.number().optional(),\n revalidate: z.number().optional(),\n expire: z.number().optional(),\n })\n )\n .optional(),\n cacheHandlers: z.record(z.string(), z.string().optional()).optional(),\n clientRouterFilter: z.boolean().optional(),\n clientRouterFilterRedirects: z.boolean().optional(),\n clientRouterFilterAllowedRate: z.number().optional(),\n cpus: z.number().optional(),\n memoryBasedWorkersCount: z.boolean().optional(),\n craCompat: z.boolean().optional(),\n caseSensitiveRoutes: z.boolean().optional(),\n clientParamParsingOrigins: z.array(z.string()).optional(),\n cachedNavigations: z\n .union([z.boolean(), z.literal('allow-runtime')])\n .optional(),\n dynamicOnHover: z.boolean().optional(),\n useOffline: z.boolean().optional(),\n optimisticRouting: z.boolean().optional(),\n instrumentationClientRouterTransitionEvents: z.boolean().optional(),\n appShells: z.boolean().optional(),\n varyParams: z.boolean().optional(),\n prefetchInlining: z\n .union([\n z.boolean(),\n z.object({\n maxSize: z.number().optional(),\n maxBundleSize: z.number().optional(),\n }),\n ])\n .optional(),\n disableOptimizedLoading: z.boolean().optional(),\n disablePostcssPresetEnv: z.boolean().optional(),\n cacheComponents: z.boolean().optional(),\n inlineCss: z.boolean().optional(),\n esmExternals: z.union([z.boolean(), z.literal('loose')]).optional(),\n serverActions: z\n .object({\n bodySizeLimit: zSizeLimit.optional(),\n allowedOrigins: z.array(z.string()).optional(),\n })\n .optional(),\n maxPostponedStateSize: zSizeLimit.optional(),\n // The original type was Record<string, any>\n extensionAlias: z.record(z.string(), z.any()).optional(),\n externalDir: z.boolean().optional(),\n externalMiddlewareRewritesResolve: z.boolean().optional(),\n externalProxyRewritesResolve: z.boolean().optional(),\n exposeTestingApiInProductionBuild: z.boolean().optional(),\n fallbackNodePolyfills: z.literal(false).optional(),\n fetchCacheKeyPrefix: z.string().optional(),\n forceSwcTransforms: z.boolean().optional(),\n fullySpecified: z.boolean().optional(),\n gzipSize: z.boolean().optional(),\n imgOptConcurrency: z.number().int().optional().nullable(),\n imgOptOperationCache: z.boolean().optional().nullable(),\n imgOptTimeoutInSeconds: z.number().int().optional(),\n imgOptMaxInputPixels: z.number().int().optional(),\n imgOptSequentialRead: z.boolean().optional().nullable(),\n imgOptSkipMetadata: z.boolean().optional().nullable(),\n isrFlushToDisk: z.boolean().optional(),\n largePageDataBytes: z.number().optional(),\n linkNoTouchStart: z.boolean().optional(),\n manualClientBasePath: z.boolean().optional(),\n middlewarePrefetch: z.enum(['strict', 'flexible']).optional(),\n proxyPrefetch: z.enum(['strict', 'flexible']).optional(),\n middlewareClientMaxBodySize: zSizeLimit.optional(),\n proxyClientMaxBodySize: zSizeLimit.optional(),\n multiZoneDraftMode: z.boolean().optional(),\n cssChunking: z\n .union([\n z.boolean(),\n z.literal('strict'),\n z.literal('loose'),\n z.literal('graph'),\n z.strictObject({ type: z.literal('strict') }),\n z.strictObject({ type: z.literal('loose') }),\n z.strictObject({\n type: z.literal('graph'),\n requestCost: z.number().nonnegative().finite().optional(),\n moduleFactorCost: z.number().nonnegative().finite().optional(),\n }),\n ])\n .optional(),\n nextScriptWorkers: z.boolean().optional(),\n // The critter option is unknown, use z.any() here\n optimizeCss: z.union([z.boolean(), z.any()]).optional(),\n optimisticClientCache: z.boolean().optional(),\n parallelServerCompiles: z.boolean().optional(),\n parallelServerBuildTraces: z.boolean().optional(),\n ppr: z\n .union([z.boolean(), z.literal('incremental')])\n .readonly()\n .optional(),\n taint: z.boolean().optional(),\n blockingSSR: z.boolean().optional(),\n prerenderEarlyExit: z.boolean().optional(),\n proxyTimeout: z.number().gte(0).optional(),\n rootParams: z.boolean().optional(),\n mcpServer: z.boolean().optional(),\n removeUncaughtErrorAndRejectionListeners: z.boolean().optional(),\n validateRSCRequestHeaders: z.boolean().optional(),\n scrollRestoration: z.boolean().optional(),\n sri: z\n .object({\n algorithm: z.enum(['sha256', 'sha384', 'sha512']).optional(),\n })\n .optional(),\n swcPlugins: z\n // The specific swc plugin's option is unknown, use z.any() here\n .array(z.tuple([z.string(), z.record(z.string(), z.any())]))\n .optional(),\n swcEnvOptions: z\n .object({\n mode: z.enum(['usage', 'entry']).optional(),\n coreJs: z.string().optional(),\n skip: z.array(z.string()).optional(),\n include: z.array(z.string()).optional(),\n exclude: z.array(z.string()).optional(),\n shippedProposals: z.boolean().optional(),\n forceAllTransforms: z.boolean().optional(),\n debug: z.boolean().optional(),\n loose: z.boolean().optional(),\n })\n .optional(),\n swcTraceProfiling: z.boolean().optional(),\n // NonNullable<webpack.Configuration['experiments']>['buildHttp']\n urlImports: z.any().optional(),\n viewTransition: z.boolean().optional(),\n workerThreads: z.boolean().optional(),\n webVitalsAttribution: z\n .array(\n z.union([\n z.literal('CLS'),\n z.literal('FCP'),\n z.literal('FID'),\n z.literal('INP'),\n z.literal('LCP'),\n z.literal('TTFB'),\n ])\n )\n .optional(),\n // This is partial set of mdx-rs transform options we support, aligned\n // with next_core::next_config::MdxRsOptions. Ensure both types are kept in sync.\n mdxRs: z\n .union([\n z.boolean(),\n z.object({\n development: z.boolean().optional(),\n jsxRuntime: z.string().optional(),\n jsxImportSource: z.string().optional(),\n providerImportSource: z.string().optional(),\n mdxType: z.enum(['gfm', 'commonmark']).optional(),\n }),\n ])\n .optional(),\n transitionIndicator: z.boolean().optional(),\n gestureTransition: z.boolean().optional(),\n typedRoutes: z.boolean().optional(),\n webpackBuildWorker: z.boolean().optional(),\n webpackMemoryOptimizations: z.boolean().optional(),\n turbopackMemoryEviction: z\n .union([z.literal(false), z.literal('full')])\n .optional(),\n turbopackPluginRuntimeStrategy: z\n .enum(['workerThreads', 'childProcesses', 'forceWorkerThreads'])\n .optional(),\n turbopackMinify: z.boolean().optional(),\n turbopackFileSystemCacheForDev: z.boolean().optional(),\n turbopackFileSystemCacheForBuild: z.boolean().optional(),\n turbopackSourceMaps: z.boolean().optional(),\n turbopackInputSourceMaps: z.boolean().optional(),\n turbopackTreeShaking: z.boolean().optional(),\n turbopackRemoveUnusedImports: z.boolean().optional(),\n turbopackRemoveUnusedExports: z.boolean().optional(),\n turbopackScopeHoisting: z.boolean().optional(),\n turbopackWorkerAssetPrefix: z.string().optional(),\n turbopackClientSideNestedAsyncChunking: z.boolean().optional(),\n turbopackServerSideNestedAsyncChunking: z.boolean().optional(),\n turbopackImportTypeBytes: z.boolean().optional(),\n turbopackImportTypeText: z.boolean().optional(),\n turbopackUseBuiltinBabel: z.boolean().optional(),\n turbopackUseBuiltinSass: z.boolean().optional(),\n turbopackLocalPostcssConfig: z.boolean().optional(),\n turbopackModuleIds: z.enum(['named', 'deterministic']).optional(),\n turbopackInferModuleSideEffects: z.boolean().optional(),\n turbopackServerFastRefresh: z.boolean().optional(),\n optimizePackageImports: z.array(z.string()).optional(),\n optimizeServerReact: z.boolean().optional(),\n strictRouteTypes: z.boolean().optional(),\n clientTraceMetadata: z.array(z.string()).optional(),\n serverMinification: z.boolean().optional(),\n serverSourceMaps: z.boolean().optional(),\n useWasmBinary: z.boolean().optional(),\n useLightningcss: z.boolean().optional(),\n lightningCssFeatures: z\n .object({\n include: z.array(z.enum(LIGHTNINGCSS_FEATURE_NAMES)).optional(),\n exclude: z.array(z.enum(LIGHTNINGCSS_FEATURE_NAMES)).optional(),\n })\n .optional(),\n testProxy: z.boolean().optional(),\n defaultTestRunner: z.enum(SUPPORTED_TEST_RUNNERS_LIST).optional(),\n allowDevelopmentBuild: z.literal(true).optional(),\n\n reactDebugChannel: z.boolean().optional(),\n instantInsights: z\n .object({\n validationLevel: z\n .enum([\n 'warning',\n 'manual-warning',\n 'experimental-error',\n 'experimental-manual-error',\n ])\n .optional(),\n })\n .optional(),\n staticGenerationRetryCount: z.number().int().optional(),\n staticGenerationMaxConcurrency: z.number().int().optional(),\n staticGenerationMinPagesPerWorker: z.number().int().optional(),\n typedEnv: z.boolean().optional(),\n serverComponentsHmrCache: z.boolean().optional(),\n authInterrupts: z.boolean().optional(),\n useCache: z.boolean().optional(),\n useCacheTimeout: z.number().positive().optional(),\n slowModuleDetection: z\n .object({\n buildTimeThresholdMs: z.number().int(),\n })\n .optional(),\n globalNotFound: z.boolean().optional(),\n turbopackRustReactCompiler: z.boolean().optional(),\n browserDebugInfoInTerminal: z\n .union([\n z.boolean(),\n z.enum(['error', 'warn', 'verbose']),\n z.object({\n level: z.enum(['error', 'warn', 'verbose']).optional(),\n depthLimit: z.number().int().positive().optional(),\n edgeLimit: z.number().int().positive().optional(),\n showSourceLocation: z.boolean().optional(),\n }),\n ])\n .optional(),\n lockDistDir: z.boolean().optional(),\n hideLogsAfterAbort: z.boolean().optional(),\n runtimeServerDeploymentId: z.boolean().optional(),\n supportsImmutableAssets: z.boolean().optional(),\n deferredEntries: z.array(z.string()).optional(),\n onBeforeDeferredEntries: z.function().returns(z.promise(z.void())).optional(),\n reportSystemEnvInlining: z.enum(['warn', 'error']).optional(),\n}\n\nexport const configSchema: zod.ZodType<NextConfig> = z.lazy(() =>\n z.strictObject({\n adapterPath: z.string().optional(),\n agentRules: z.boolean().optional(),\n allowedDevOrigins: z.array(z.string()).optional(),\n assetPrefix: z.string().optional(),\n basePath: z.string().optional(),\n bundlePagesRouterDependencies: z.boolean().optional(),\n cacheComponents: z.boolean().optional(),\n cacheHandler: z.string().min(1).optional(),\n cacheHandlers: z.record(z.string(), z.string().optional()).optional(),\n cacheLife: z\n .record(\n z.object({\n stale: z.number().optional(),\n revalidate: z.number().optional(),\n expire: z.number().optional(),\n })\n )\n .optional(),\n cacheMaxMemorySize: z.number().optional(),\n cleanDistDir: z.boolean().optional(),\n compiler: z\n .strictObject({\n emotion: z\n .union([\n z.boolean(),\n z.object({\n sourceMap: z.boolean().optional(),\n autoLabel: z\n .union([\n z.literal('always'),\n z.literal('dev-only'),\n z.literal('never'),\n ])\n .optional(),\n labelFormat: z.string().min(1).optional(),\n importMap: z\n .record(\n z.string(),\n z.record(\n z.string(),\n z.object({\n canonicalImport: z\n .tuple([z.string(), z.string()])\n .optional(),\n styledBaseImport: z\n .tuple([z.string(), z.string()])\n .optional(),\n })\n )\n )\n .optional(),\n }),\n ])\n .optional(),\n reactRemoveProperties: z\n .union([\n z.boolean().optional(),\n z.object({\n properties: z.array(z.string()).optional(),\n }),\n ])\n .optional(),\n relay: z\n .object({\n src: z.string(),\n artifactDirectory: z.string().optional(),\n language: z.enum(['javascript', 'typescript', 'flow']).optional(),\n eagerEsModules: z.boolean().optional(),\n })\n .optional(),\n removeConsole: z\n .union([\n z.boolean().optional(),\n z.object({\n exclude: z.array(z.string()).min(1).optional(),\n }),\n ])\n .optional(),\n styledComponents: z.union([\n z.boolean().optional(),\n z.object({\n displayName: z.boolean().optional(),\n topLevelImportPaths: z.array(z.string()).optional(),\n ssr: z.boolean().optional(),\n fileName: z.boolean().optional(),\n meaninglessFileNames: z.array(z.string()).optional(),\n minify: z.boolean().optional(),\n transpileTemplateLiterals: z.boolean().optional(),\n namespace: z.string().min(1).optional(),\n pure: z.boolean().optional(),\n cssProp: z.boolean().optional(),\n }),\n ]),\n styledJsx: z.union([\n z.boolean().optional(),\n z.object({\n useLightningcss: z.boolean().optional(),\n }),\n ]),\n define: z\n .record(z.string(), z.union([z.string(), z.number(), z.boolean()]))\n .optional(),\n defineServer: z\n .record(z.string(), z.union([z.string(), z.number(), z.boolean()]))\n .optional(),\n runAfterProductionCompile: z\n .function()\n .returns(z.promise(z.void()))\n .optional(),\n })\n .optional(),\n compress: z.boolean().optional(),\n configOrigin: z.string().optional(),\n crossOrigin: z\n .union([z.literal('anonymous'), z.literal('use-credentials')])\n .optional(),\n deploymentId: z.string().optional(),\n devIndicators: z\n .union([\n z.object({\n position: z\n .union([\n z.literal('bottom-left'),\n z.literal('bottom-right'),\n z.literal('top-left'),\n z.literal('top-right'),\n ])\n .optional(),\n }),\n z.literal(false),\n ])\n .optional(),\n distDir: z.string().min(1).optional(),\n env: z.record(z.string(), z.union([z.string(), z.undefined()])).optional(),\n enablePrerenderSourceMaps: z.boolean().optional(),\n excludeDefaultMomentLocales: z.boolean().optional(),\n experimental: z.strictObject(experimentalSchema).optional(),\n exportPathMap: z\n .function()\n .args(\n zExportMap,\n z.object({\n dev: z.boolean(),\n dir: z.string(),\n outDir: z.string().nullable(),\n distDir: z.string(),\n buildId: z.string(),\n })\n )\n .returns(z.union([zExportMap, z.promise(zExportMap)]))\n .optional(),\n generateBuildId: z\n .function()\n .args()\n .returns(\n z.union([\n z.string(),\n z.null(),\n z.promise(z.union([z.string(), z.null()])),\n ])\n )\n .optional(),\n generateEtags: z.boolean().optional(),\n headers: z\n .function()\n .args()\n .returns(z.promise(z.array(zHeader)))\n .optional(),\n htmlLimitedBots: z.instanceof(RegExp).optional(),\n httpAgentOptions: z\n .strictObject({ keepAlive: z.boolean().optional() })\n .optional(),\n i18n: z\n .strictObject({\n defaultLocale: z.string().min(1),\n domains: z\n .array(\n z.strictObject({\n defaultLocale: z.string().min(1),\n domain: z.string().min(1),\n http: z.literal(true).optional(),\n locales: z.array(z.string().min(1)).optional(),\n })\n )\n .optional(),\n localeDetection: z.literal(false).optional(),\n locales: z.array(z.string().min(1)),\n })\n .nullable()\n .optional(),\n images: z\n .strictObject({\n localPatterns: z\n .array(\n z.strictObject({\n pathname: z.string().optional(),\n search: z.string().optional(),\n })\n )\n .max(25)\n .optional(),\n remotePatterns: z\n .array(\n z.union([\n z.instanceof(URL),\n z.strictObject({\n hostname: z.string(),\n pathname: z.string().optional(),\n port: z.string().max(5).optional(),\n protocol: z.enum(['http', 'https']).optional(),\n search: z.string().optional(),\n }),\n ])\n )\n .max(50)\n .optional(),\n unoptimized: z.boolean().optional(),\n customCacheHandler: z.boolean().optional(),\n contentSecurityPolicy: z.string().optional(),\n contentDispositionType: z.enum(['inline', 'attachment']).optional(),\n dangerouslyAllowSVG: z.boolean().optional(),\n dangerouslyAllowLocalIP: z.boolean().optional(),\n deviceSizes: z\n .array(z.number().int().gte(1).lte(10000))\n .max(25)\n .optional(),\n disableStaticImages: z.boolean().optional(),\n domains: z.array(z.string()).max(50).optional(),\n formats: z\n .array(z.enum(['image/avif', 'image/webp']))\n .max(4)\n .optional(),\n imageSizes: z\n .array(z.number().int().gte(1).lte(10000))\n .min(0)\n .max(25)\n .optional(),\n loader: z.enum(VALID_LOADERS).optional(),\n loaderFile: z.string().optional(),\n maximumDiskCacheSize: z.number().int().min(0).optional(),\n maximumRedirects: z.number().int().min(0).max(20).optional(),\n maximumResponseBody: z\n .number()\n .int()\n .min(1)\n .max(Number.MAX_SAFE_INTEGER)\n .optional(),\n minimumCacheTTL: z.number().int().gte(0).optional(),\n path: z.string().optional(),\n qualities: z\n .array(z.number().int().gte(1).lte(100))\n .min(1)\n .max(20)\n .optional(),\n })\n .optional(),\n logging: z\n .union([\n z.object({\n fetches: z\n .object({\n fullUrl: z.boolean().optional(),\n hmrRefreshes: z.boolean().optional(),\n })\n .optional(),\n incomingRequests: z\n .union([\n z.boolean(),\n z.object({\n ignore: z.array(z.instanceof(RegExp)),\n }),\n ])\n .optional(),\n serverFunctions: z.boolean().optional(),\n browserToTerminal: z\n .union([z.boolean(), z.enum(['error', 'warn'])])\n .optional(),\n }),\n z.literal(false),\n ])\n .optional(),\n modularizeImports: z\n .record(\n z.string(),\n z.object({\n transform: z.union([z.string(), z.record(z.string(), z.string())]),\n preventFullImport: z.boolean().optional(),\n skipDefaultConversion: z.boolean().optional(),\n })\n )\n .optional(),\n onDemandEntries: z\n .strictObject({\n maxInactiveAge: z.number().optional(),\n pagesBufferLength: z.number().optional(),\n })\n .optional(),\n output: z.enum(['standalone', 'export']).optional(),\n outputFileTracingRoot: z.string().optional(),\n outputFileTracingExcludes: z\n .record(z.string(), z.array(z.string()))\n .optional(),\n outputFileTracingIncludes: z\n .record(z.string(), z.array(z.string()))\n .optional(),\n pageExtensions: z.array(z.string()).min(1).optional(),\n instrumentationClientInject: z.array(z.string()).optional(),\n partialPrefetching: z\n .union([z.boolean(), z.literal('unstable_eager')])\n .optional(),\n poweredByHeader: z.boolean().optional(),\n productionBrowserSourceMaps: z.boolean().optional(),\n reactCompiler: z.union([\n z.boolean(),\n z\n .object({\n compilationMode: z.enum(['infer', 'annotation', 'all']).optional(),\n panicThreshold: z\n .enum(['none', 'critical_errors', 'all_errors'])\n .optional(),\n })\n .optional(),\n ]),\n reactProductionProfiling: z.boolean().optional(),\n reactStrictMode: z.boolean().nullable().optional(),\n reactMaxHeadersLength: z.number().nonnegative().int().optional(),\n redirects: z\n .function()\n .args()\n .returns(z.promise(z.array(zRedirect)))\n .optional(),\n rewrites: z\n .function()\n .args()\n .returns(\n z.promise(\n z.union([\n z.array(zRewrite),\n z.object({\n beforeFiles: z.array(zRewrite),\n afterFiles: z.array(zRewrite),\n fallback: z.array(zRewrite),\n }),\n ])\n )\n )\n .optional(),\n // sassOptions properties are unknown besides implementation, use z.any() here\n sassOptions: z\n .object({\n implementation: z.string().optional(),\n })\n .catchall(z.any())\n .optional(),\n serverExternalPackages: z.array(z.string()).optional(),\n skipMiddlewareUrlNormalize: z.boolean().optional(),\n skipProxyUrlNormalize: z.boolean().optional(),\n skipTrailingSlashRedirect: z.boolean().optional(),\n staticPageGenerationTimeout: z.number().optional(),\n expireTime: z.number().optional(),\n target: z.string().optional(),\n trailingSlash: z.boolean().optional(),\n transpilePackages: z.array(z.string()).optional(),\n turbopack: zTurbopackConfig.optional(),\n typescript: z\n .strictObject({\n ignoreBuildErrors: z.boolean().optional(),\n tsconfigPath: z.string().min(1).optional(),\n })\n .optional(),\n typedRoutes: z.boolean().optional(),\n useFileSystemPublicRoutes: z.boolean().optional(),\n // The webpack config type is unknown, use z.any() here\n webpack: z.any().nullable().optional(),\n watchOptions: z\n .strictObject({\n pollIntervalMs: z.number().positive().finite().optional(),\n })\n .optional(),\n })\n)\n"],"names":["VALID_LOADERS","z","LIGHTNINGCSS_FEATURE_NAMES","SUPPORTED_TEST_RUNNERS_LIST","zSizeLimit","custom","val","zExportMap","record","string","object","page","query","any","_fallbackRouteParams","array","optional","_isAppDir","boolean","_isDynamicError","_isRoutePPREnabled","_allowEmptyStaticShell","_isFallbackUpgradeable","zRouteHas","union","type","enum","key","value","literal","undefined","zRewrite","source","destination","basePath","locale","has","missing","internal","zRedirect","and","statusCode","never","permanent","number","zHeader","headers","zTurbopackLoaderItem","strictObject","loader","options","zTurbopackLoaderBuiltinCondition","zTurbopackCondition","all","lazy","not","path","instanceof","RegExp","content","contentType","zTurbopackModuleType","zTurbopackRuleConfigItem","loaders","as","condition","zTurbopackRuleConfigCollection","zTurbopackConfig","rules","resolveAlias","resolveExtensions","root","debugIds","chunkLoadingGlobal","ignoreIssue","title","description","experimentalSchema","outputHashSalt","useSkewCookie","after","appNavFailHandling","appNewScrollHandler","preloadEntriesOnStart","allowedRevalidateHeaderKeys","staleTimes","dynamic","static","gte","cacheLife","stale","revalidate","expire","cacheHandlers","clientRouterFilter","clientRouterFilterRedirects","clientRouterFilterAllowedRate","cpus","memoryBasedWorkersCount","craCompat","caseSensitiveRoutes","clientParamParsingOrigins","cachedNavigations","dynamicOnHover","useOffline","optimisticRouting","instrumentationClientRouterTransitionEvents","appShells","varyParams","prefetchInlining","maxSize","maxBundleSize","disableOptimizedLoading","disablePostcssPresetEnv","cacheComponents","inlineCss","esmExternals","serverActions","bodySizeLimit","allowedOrigins","maxPostponedStateSize","extensionAlias","externalDir","externalMiddlewareRewritesResolve","externalProxyRewritesResolve","exposeTestingApiInProductionBuild","fallbackNodePolyfills","fetchCacheKeyPrefix","forceSwcTransforms","fullySpecified","gzipSize","imgOptConcurrency","int","nullable","imgOptOperationCache","imgOptTimeoutInSeconds","imgOptMaxInputPixels","imgOptSequentialRead","imgOptSkipMetadata","isrFlushToDisk","largePageDataBytes","linkNoTouchStart","manualClientBasePath","middlewarePrefetch","proxyPrefetch","middlewareClientMaxBodySize","proxyClientMaxBodySize","multiZoneDraftMode","cssChunking","requestCost","nonnegative","finite","moduleFactorCost","nextScriptWorkers","optimizeCss","optimisticClientCache","parallelServerCompiles","parallelServerBuildTraces","ppr","readonly","taint","blockingSSR","prerenderEarlyExit","proxyTimeout","rootParams","mcpServer","removeUncaughtErrorAndRejectionListeners","validateRSCRequestHeaders","scrollRestoration","sri","algorithm","swcPlugins","tuple","swcEnvOptions","mode","coreJs","skip","include","exclude","shippedProposals","forceAllTransforms","debug","loose","swcTraceProfiling","urlImports","viewTransition","workerThreads","webVitalsAttribution","mdxRs","development","jsxRuntime","jsxImportSource","providerImportSource","mdxType","transitionIndicator","gestureTransition","typedRoutes","webpackBuildWorker","webpackMemoryOptimizations","turbopackMemoryEviction","turbopackPluginRuntimeStrategy","turbopackMinify","turbopackFileSystemCacheForDev","turbopackFileSystemCacheForBuild","turbopackSourceMaps","turbopackInputSourceMaps","turbopackTreeShaking","turbopackRemoveUnusedImports","turbopackRemoveUnusedExports","turbopackScopeHoisting","turbopackWorkerAssetPrefix","turbopackClientSideNestedAsyncChunking","turbopackServerSideNestedAsyncChunking","turbopackImportTypeBytes","turbopackImportTypeText","turbopackUseBuiltinBabel","turbopackUseBuiltinSass","turbopackLocalPostcssConfig","turbopackModuleIds","turbopackInferModuleSideEffects","turbopackServerFastRefresh","optimizePackageImports","optimizeServerReact","strictRouteTypes","clientTraceMetadata","serverMinification","serverSourceMaps","useWasmBinary","useLightningcss","lightningCssFeatures","testProxy","defaultTestRunner","allowDevelopmentBuild","reactDebugChannel","instantInsights","validationLevel","staticGenerationRetryCount","staticGenerationMaxConcurrency","staticGenerationMinPagesPerWorker","typedEnv","serverComponentsHmrCache","authInterrupts","useCache","useCacheTimeout","positive","slowModuleDetection","buildTimeThresholdMs","globalNotFound","turbopackRustReactCompiler","browserDebugInfoInTerminal","level","depthLimit","edgeLimit","showSourceLocation","lockDistDir","hideLogsAfterAbort","runtimeServerDeploymentId","supportsImmutableAssets","deferredEntries","onBeforeDeferredEntries","function","returns","promise","void","reportSystemEnvInlining","configSchema","adapterPath","agentRules","allowedDevOrigins","assetPrefix","bundlePagesRouterDependencies","cacheHandler","min","cacheMaxMemorySize","cleanDistDir","compiler","emotion","sourceMap","autoLabel","labelFormat","importMap","canonicalImport","styledBaseImport","reactRemoveProperties","properties","relay","src","artifactDirectory","language","eagerEsModules","removeConsole","styledComponents","displayName","topLevelImportPaths","ssr","fileName","meaninglessFileNames","minify","transpileTemplateLiterals","namespace","pure","cssProp","styledJsx","define","defineServer","runAfterProductionCompile","compress","configOrigin","crossOrigin","deploymentId","devIndicators","position","distDir","env","enablePrerenderSourceMaps","excludeDefaultMomentLocales","experimental","exportPathMap","args","dev","dir","outDir","buildId","generateBuildId","null","generateEtags","htmlLimitedBots","httpAgentOptions","keepAlive","i18n","defaultLocale","domains","domain","http","locales","localeDetection","images","localPatterns","pathname","search","max","remotePatterns","URL","hostname","port","protocol","unoptimized","customCacheHandler","contentSecurityPolicy","contentDispositionType","dangerouslyAllowSVG","dangerouslyAllowLocalIP","deviceSizes","lte","disableStaticImages","formats","imageSizes","loaderFile","maximumDiskCacheSize","maximumRedirects","maximumResponseBody","Number","MAX_SAFE_INTEGER","minimumCacheTTL","qualities","logging","fetches","fullUrl","hmrRefreshes","incomingRequests","ignore","serverFunctions","browserToTerminal","modularizeImports","transform","preventFullImport","skipDefaultConversion","onDemandEntries","maxInactiveAge","pagesBufferLength","output","outputFileTracingRoot","outputFileTracingExcludes","outputFileTracingIncludes","pageExtensions","instrumentationClientInject","partialPrefetching","poweredByHeader","productionBrowserSourceMaps","reactCompiler","compilationMode","panicThreshold","reactProductionProfiling","reactStrictMode","reactMaxHeadersLength","redirects","rewrites","beforeFiles","afterFiles","fallback","sassOptions","implementation","catchall","serverExternalPackages","skipMiddlewareUrlNormalize","skipProxyUrlNormalize","skipTrailingSlashRedirect","staticPageGenerationTimeout","expireTime","target","trailingSlash","transpilePackages","turbopack","typescript","ignoreBuildErrors","tsconfigPath","useFileSystemPublicRoutes","webpack","watchOptions","pollIntervalMs"],"mappings":"AACA,SAASA,aAAa,QAAQ,6BAA4B;AAE1D,SAASC,CAAC,QAAQ,yBAAwB;AAI1C,SACEC,0BAA0B,QAQrB,kBAAiB;AAO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,EAAEQ,MAAM,IAAIO,QAAQ;QACpDoY,4BAA4BnZ,EAAEiB,OAAO,GAAGF,QAAQ;QAChDqY,uBAAuBpZ,EAAEiB,OAAO,GAAGF,QAAQ;QAC3CsY,2BAA2BrZ,EAAEiB,OAAO,GAAGF,QAAQ;QAC/CuY,6BAA6BtZ,EAAE2C,MAAM,GAAG5B,QAAQ;QAChDwY,YAAYvZ,EAAE2C,MAAM,GAAG5B,QAAQ;QAC/ByY,QAAQxZ,EAAEQ,MAAM,GAAGO,QAAQ;QAC3B0Y,eAAezZ,EAAEiB,OAAO,GAAGF,QAAQ;QACnC2Y,mBAAmB1Z,EAAEc,KAAK,CAACd,EAAEQ,MAAM,IAAIO,QAAQ;QAC/C4Y,WAAWzV,iBAAiBnD,QAAQ;QACpC6Y,YAAY5Z,EACT+C,YAAY,CAAC;YACZ8W,mBAAmB7Z,EAAEiB,OAAO,GAAGF,QAAQ;YACvC+Y,cAAc9Z,EAAEQ,MAAM,GAAGuQ,GAAG,CAAC,GAAGhQ,QAAQ;QAC1C,GACCA,QAAQ;QACXoL,aAAanM,EAAEiB,OAAO,GAAGF,QAAQ;QACjCgZ,2BAA2B/Z,EAAEiB,OAAO,GAAGF,QAAQ;QAC/C,uDAAuD;QACvDiZ,SAASha,EAAEY,GAAG,GAAGwH,QAAQ,GAAGrH,QAAQ;QACpCkZ,cAAcja,EACX+C,YAAY,CAAC;YACZmX,gBAAgBla,EAAE2C,MAAM,GAAGwM,QAAQ,GAAG7F,MAAM,GAAGvI,QAAQ;QACzD,GACCA,QAAQ;IACb,IACD","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/server/config-schema.ts"],"sourcesContent":["import type { NextConfig } from './config'\nimport { VALID_LOADERS } from '../shared/lib/image-config'\n\nimport { z } from 'next/dist/compiled/zod'\nimport type zod from 'next/dist/compiled/zod'\n\nimport type { SizeLimit } from '../types'\nimport {\n LIGHTNINGCSS_FEATURE_NAMES,\n type ExportPathMap,\n type TurbopackLoaderItem,\n type TurbopackOptions,\n type TurbopackRuleConfigItem,\n type TurbopackRuleConfigCollection,\n type TurbopackRuleCondition,\n type TurbopackLoaderBuiltinCondition,\n} from './config-shared'\nimport type {\n Header,\n Rewrite,\n RouteHas,\n Redirect,\n} from '../lib/load-custom-routes'\nimport { SUPPORTED_TEST_RUNNERS_LIST } from '../cli/next-test'\n\n// A custom zod schema for the SizeLimit type\nconst zSizeLimit = z.custom<SizeLimit>((val) => {\n if (typeof val === 'number' || typeof val === 'string') {\n return true\n }\n return false\n})\n\nconst zExportMap: zod.ZodType<ExportPathMap> = z.record(\n z.string(),\n z.object({\n page: z.string(),\n query: z.any(), // NextParsedUrlQuery\n\n // private optional properties\n _fallbackRouteParams: z.array(z.any()).optional(),\n _isAppDir: z.boolean().optional(),\n _isDynamicError: z.boolean().optional(),\n _isRoutePPREnabled: z.boolean().optional(),\n _allowEmptyStaticShell: z.boolean().optional(),\n _isFallbackUpgradeable: z.boolean().optional(),\n })\n)\n\nconst zRouteHas: zod.ZodType<RouteHas> = z.union([\n z.object({\n type: z.enum(['header', 'query', 'cookie']),\n key: z.string(),\n value: z.string().optional(),\n }),\n z.object({\n type: z.literal('host'),\n key: z.undefined().optional(),\n value: z.string(),\n }),\n])\n\nconst zRewrite: zod.ZodType<Rewrite> = z.object({\n source: z.string(),\n destination: z.string(),\n basePath: z.literal(false).optional(),\n locale: z.literal(false).optional(),\n has: z.array(zRouteHas).optional(),\n missing: z.array(zRouteHas).optional(),\n internal: z.boolean().optional(),\n})\n\nconst zRedirect: zod.ZodType<Redirect> = z\n .object({\n source: z.string(),\n destination: z.string(),\n basePath: z.literal(false).optional(),\n locale: z.literal(false).optional(),\n has: z.array(zRouteHas).optional(),\n missing: z.array(zRouteHas).optional(),\n internal: z.boolean().optional(),\n })\n .and(\n z.union([\n z.object({\n statusCode: z.never().optional(),\n permanent: z.boolean(),\n }),\n z.object({\n statusCode: z.number(),\n permanent: z.never().optional(),\n }),\n ])\n )\n\nconst zHeader: zod.ZodType<Header> = z.object({\n source: z.string(),\n basePath: z.literal(false).optional(),\n locale: z.literal(false).optional(),\n headers: z.array(z.object({ key: z.string(), value: z.string() })),\n has: z.array(zRouteHas).optional(),\n missing: z.array(zRouteHas).optional(),\n\n internal: z.boolean().optional(),\n})\n\nconst zTurbopackLoaderItem: zod.ZodType<TurbopackLoaderItem> = z.union([\n z.string(),\n z.strictObject({\n loader: z.string(),\n // Any JSON value can be used as turbo loader options, so use z.any() here\n options: z.record(z.string(), z.any()).optional(),\n }),\n])\n\nconst zTurbopackLoaderBuiltinCondition: zod.ZodType<TurbopackLoaderBuiltinCondition> =\n z.union([\n z.literal('browser'),\n z.literal('foreign'),\n z.literal('development'),\n z.literal('production'),\n z.literal('node'),\n z.literal('edge-light'),\n ])\n\nconst zTurbopackCondition: zod.ZodType<TurbopackRuleCondition> = z.union([\n z.strictObject({ all: z.lazy(() => z.array(zTurbopackCondition)) }),\n z.strictObject({ any: z.lazy(() => z.array(zTurbopackCondition)) }),\n z.strictObject({ not: z.lazy(() => zTurbopackCondition) }),\n zTurbopackLoaderBuiltinCondition,\n z.strictObject({\n path: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n content: z.instanceof(RegExp).optional(),\n query: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n contentType: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n }),\n])\n\nconst zTurbopackModuleType = z.enum([\n 'asset',\n 'ecmascript',\n 'typescript',\n 'css',\n 'css-module',\n 'wasm',\n 'raw',\n 'node',\n 'bytes',\n])\n\nconst zTurbopackRuleConfigItem: zod.ZodType<TurbopackRuleConfigItem> =\n z.strictObject({\n loaders: z.array(zTurbopackLoaderItem).optional(),\n as: z.string().optional(),\n condition: zTurbopackCondition.optional(),\n type: zTurbopackModuleType.optional(),\n })\n\nconst zTurbopackRuleConfigCollection: zod.ZodType<TurbopackRuleConfigCollection> =\n z.union([\n zTurbopackRuleConfigItem,\n z.array(z.union([zTurbopackLoaderItem, zTurbopackRuleConfigItem])),\n ])\n\nconst zTurbopackConfig: zod.ZodType<TurbopackOptions> = z.strictObject({\n rules: z.record(z.string(), zTurbopackRuleConfigCollection).optional(),\n resolveAlias: z\n .record(\n z.string(),\n z.union([\n z.string(),\n z.array(z.string()),\n z.record(z.string(), z.union([z.string(), z.array(z.string())])),\n ])\n )\n .optional(),\n resolveExtensions: z.array(z.string()).optional(),\n root: z.string().optional(),\n debugIds: z.boolean().optional(),\n chunkLoadingGlobal: z.string().optional(),\n ignoreIssue: z\n .array(\n z.object({\n path: z.union([z.string(), z.instanceof(RegExp)]),\n title: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n description: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n })\n )\n .optional(),\n})\n\nexport const experimentalSchema = {\n outputHashSalt: z.string().optional(),\n useSkewCookie: z.boolean().optional(),\n after: z.boolean().optional(),\n appNavFailHandling: z.boolean().optional(),\n appNewScrollHandler: z.boolean().optional(),\n coldCacheBadge: z.boolean().optional(),\n preloadEntriesOnStart: z.boolean().optional(),\n allowedRevalidateHeaderKeys: z.array(z.string()).optional(),\n staleTimes: z\n .object({\n dynamic: z.number().optional(),\n static: z.number().gte(30).optional(),\n })\n .optional(),\n cacheLife: z\n .record(\n z.object({\n stale: z.number().optional(),\n revalidate: z.number().optional(),\n expire: z.number().optional(),\n })\n )\n .optional(),\n cacheHandlers: z.record(z.string(), z.string().optional()).optional(),\n clientRouterFilter: z.boolean().optional(),\n clientRouterFilterRedirects: z.boolean().optional(),\n clientRouterFilterAllowedRate: z.number().optional(),\n cpus: z.number().optional(),\n memoryBasedWorkersCount: z.boolean().optional(),\n craCompat: z.boolean().optional(),\n caseSensitiveRoutes: z.boolean().optional(),\n clientParamParsingOrigins: z.array(z.string()).optional(),\n cachedNavigations: z\n .union([z.boolean(), z.literal('allow-runtime')])\n .optional(),\n dynamicOnHover: z.boolean().optional(),\n useOffline: z.boolean().optional(),\n optimisticRouting: z.boolean().optional(),\n instrumentationClientRouterTransitionEvents: z.boolean().optional(),\n appShells: z.boolean().optional(),\n varyParams: z.boolean().optional(),\n prefetchInlining: z\n .union([\n z.boolean(),\n z.object({\n maxSize: z.number().optional(),\n maxBundleSize: z.number().optional(),\n }),\n ])\n .optional(),\n disableOptimizedLoading: z.boolean().optional(),\n disablePostcssPresetEnv: z.boolean().optional(),\n cacheComponents: z.boolean().optional(),\n inlineCss: z.boolean().optional(),\n esmExternals: z.union([z.boolean(), z.literal('loose')]).optional(),\n serverActions: z\n .object({\n bodySizeLimit: zSizeLimit.optional(),\n allowedOrigins: z.array(z.string()).optional(),\n })\n .optional(),\n maxPostponedStateSize: zSizeLimit.optional(),\n // The original type was Record<string, any>\n extensionAlias: z.record(z.string(), z.any()).optional(),\n externalDir: z.boolean().optional(),\n externalMiddlewareRewritesResolve: z.boolean().optional(),\n externalProxyRewritesResolve: z.boolean().optional(),\n exposeTestingApiInProductionBuild: z.boolean().optional(),\n fallbackNodePolyfills: z.literal(false).optional(),\n fetchCacheKeyPrefix: z.string().optional(),\n forceSwcTransforms: z.boolean().optional(),\n fullySpecified: z.boolean().optional(),\n gzipSize: z.boolean().optional(),\n imgOptConcurrency: z.number().int().optional().nullable(),\n imgOptOperationCache: z.boolean().optional().nullable(),\n imgOptTimeoutInSeconds: z.number().int().optional(),\n imgOptMaxInputPixels: z.number().int().optional(),\n imgOptSequentialRead: z.boolean().optional().nullable(),\n imgOptSkipMetadata: z.boolean().optional().nullable(),\n isrFlushToDisk: z.boolean().optional(),\n largePageDataBytes: z.number().optional(),\n linkNoTouchStart: z.boolean().optional(),\n manualClientBasePath: z.boolean().optional(),\n middlewarePrefetch: z.enum(['strict', 'flexible']).optional(),\n proxyPrefetch: z.enum(['strict', 'flexible']).optional(),\n middlewareClientMaxBodySize: zSizeLimit.optional(),\n proxyClientMaxBodySize: zSizeLimit.optional(),\n multiZoneDraftMode: z.boolean().optional(),\n cssChunking: z\n .union([\n z.boolean(),\n z.literal('strict'),\n z.literal('loose'),\n z.literal('graph'),\n z.strictObject({ type: z.literal('strict') }),\n z.strictObject({ type: z.literal('loose') }),\n z.strictObject({\n type: z.literal('graph'),\n requestCost: z.number().nonnegative().finite().optional(),\n moduleFactorCost: z.number().nonnegative().finite().optional(),\n }),\n ])\n .optional(),\n nextScriptWorkers: z.boolean().optional(),\n // The critter option is unknown, use z.any() here\n optimizeCss: z.union([z.boolean(), z.any()]).optional(),\n optimisticClientCache: z.boolean().optional(),\n parallelServerCompiles: z.boolean().optional(),\n parallelServerBuildTraces: z.boolean().optional(),\n ppr: z\n .union([z.boolean(), z.literal('incremental')])\n .readonly()\n .optional(),\n taint: z.boolean().optional(),\n blockingSSR: z.boolean().optional(),\n prerenderEarlyExit: z.boolean().optional(),\n proxyTimeout: z.number().gte(0).optional(),\n rootParams: z.boolean().optional(),\n mcpServer: z.boolean().optional(),\n removeUncaughtErrorAndRejectionListeners: z.boolean().optional(),\n validateRSCRequestHeaders: z.boolean().optional(),\n scrollRestoration: z.boolean().optional(),\n sri: z\n .object({\n algorithm: z.enum(['sha256', 'sha384', 'sha512']).optional(),\n })\n .optional(),\n swcPlugins: z\n // The specific swc plugin's option is unknown, use z.any() here\n .array(z.tuple([z.string(), z.record(z.string(), z.any())]))\n .optional(),\n swcEnvOptions: z\n .object({\n mode: z.enum(['usage', 'entry']).optional(),\n coreJs: z.string().optional(),\n skip: z.array(z.string()).optional(),\n include: z.array(z.string()).optional(),\n exclude: z.array(z.string()).optional(),\n shippedProposals: z.boolean().optional(),\n forceAllTransforms: z.boolean().optional(),\n debug: z.boolean().optional(),\n loose: z.boolean().optional(),\n })\n .optional(),\n swcTraceProfiling: z.boolean().optional(),\n // NonNullable<webpack.Configuration['experiments']>['buildHttp']\n urlImports: z.any().optional(),\n viewTransition: z.boolean().optional(),\n workerThreads: z.boolean().optional(),\n webVitalsAttribution: z\n .array(\n z.union([\n z.literal('CLS'),\n z.literal('FCP'),\n z.literal('FID'),\n z.literal('INP'),\n z.literal('LCP'),\n z.literal('TTFB'),\n ])\n )\n .optional(),\n // This is partial set of mdx-rs transform options we support, aligned\n // with next_core::next_config::MdxRsOptions. Ensure both types are kept in sync.\n mdxRs: z\n .union([\n z.boolean(),\n z.object({\n development: z.boolean().optional(),\n jsxRuntime: z.string().optional(),\n jsxImportSource: z.string().optional(),\n providerImportSource: z.string().optional(),\n mdxType: z.enum(['gfm', 'commonmark']).optional(),\n }),\n ])\n .optional(),\n transitionIndicator: z.boolean().optional(),\n gestureTransition: z.boolean().optional(),\n typedRoutes: z.boolean().optional(),\n webpackBuildWorker: z.boolean().optional(),\n webpackMemoryOptimizations: z.boolean().optional(),\n turbopackMemoryEviction: z\n .union([z.literal(false), z.literal('full')])\n .optional(),\n turbopackPluginRuntimeStrategy: z\n .enum(['workerThreads', 'childProcesses', 'forceWorkerThreads'])\n .optional(),\n turbopackMinify: z.boolean().optional(),\n turbopackFileSystemCacheForDev: z.boolean().optional(),\n turbopackFileSystemCacheForBuild: z.boolean().optional(),\n turbopackSourceMaps: z.boolean().optional(),\n turbopackInputSourceMaps: z.boolean().optional(),\n turbopackTreeShaking: z.boolean().optional(),\n turbopackRemoveUnusedImports: z.boolean().optional(),\n turbopackRemoveUnusedExports: z.boolean().optional(),\n turbopackScopeHoisting: z.boolean().optional(),\n turbopackWorkerAssetPrefix: z.string().optional(),\n turbopackClientSideNestedAsyncChunking: z.boolean().optional(),\n turbopackServerSideNestedAsyncChunking: z.boolean().optional(),\n turbopackImportTypeBytes: z.boolean().optional(),\n turbopackImportTypeText: z.boolean().optional(),\n turbopackUseBuiltinBabel: z.boolean().optional(),\n turbopackUseBuiltinSass: z.boolean().optional(),\n turbopackLocalPostcssConfig: z.boolean().optional(),\n turbopackModuleIds: z.enum(['named', 'deterministic']).optional(),\n turbopackInferModuleSideEffects: z.boolean().optional(),\n turbopackServerFastRefresh: z.boolean().optional(),\n optimizePackageImports: z.array(z.string()).optional(),\n optimizeServerReact: z.boolean().optional(),\n strictRouteTypes: z.boolean().optional(),\n clientTraceMetadata: z.array(z.string()).optional(),\n serverMinification: z.boolean().optional(),\n serverSourceMaps: z.boolean().optional(),\n useWasmBinary: z.boolean().optional(),\n useLightningcss: z.boolean().optional(),\n lightningCssFeatures: z\n .object({\n include: z.array(z.enum(LIGHTNINGCSS_FEATURE_NAMES)).optional(),\n exclude: z.array(z.enum(LIGHTNINGCSS_FEATURE_NAMES)).optional(),\n })\n .optional(),\n testProxy: z.boolean().optional(),\n defaultTestRunner: z.enum(SUPPORTED_TEST_RUNNERS_LIST).optional(),\n allowDevelopmentBuild: z.literal(true).optional(),\n\n reactDebugChannel: z.boolean().optional(),\n instantInsights: z\n .object({\n validationLevel: z\n .enum([\n 'warning',\n 'manual-warning',\n 'experimental-error',\n 'experimental-manual-error',\n ])\n .optional(),\n })\n .optional(),\n staticGenerationRetryCount: z.number().int().optional(),\n staticGenerationMaxConcurrency: z.number().int().optional(),\n staticGenerationMinPagesPerWorker: z.number().int().optional(),\n typedEnv: z.boolean().optional(),\n serverComponentsHmrCache: z.boolean().optional(),\n authInterrupts: z.boolean().optional(),\n useCache: z.boolean().optional(),\n useCacheTimeout: z.number().positive().optional(),\n slowModuleDetection: z\n .object({\n buildTimeThresholdMs: z.number().int(),\n })\n .optional(),\n globalNotFound: z.boolean().optional(),\n turbopackRustReactCompiler: z.boolean().optional(),\n browserDebugInfoInTerminal: z\n .union([\n z.boolean(),\n z.enum(['error', 'warn', 'verbose']),\n z.object({\n level: z.enum(['error', 'warn', 'verbose']).optional(),\n depthLimit: z.number().int().positive().optional(),\n edgeLimit: z.number().int().positive().optional(),\n showSourceLocation: z.boolean().optional(),\n }),\n ])\n .optional(),\n lockDistDir: z.boolean().optional(),\n hideLogsAfterAbort: z.boolean().optional(),\n runtimeServerDeploymentId: z.boolean().optional(),\n supportsImmutableAssets: z.boolean().optional(),\n deferredEntries: z.array(z.string()).optional(),\n onBeforeDeferredEntries: z.function().returns(z.promise(z.void())).optional(),\n reportSystemEnvInlining: z.enum(['warn', 'error']).optional(),\n}\n\nexport const configSchema: zod.ZodType<NextConfig> = z.lazy(() =>\n z.strictObject({\n adapterPath: z.string().optional(),\n agentRules: z.boolean().optional(),\n allowedDevOrigins: z.array(z.string()).optional(),\n assetPrefix: z.string().optional(),\n basePath: z.string().optional(),\n bundlePagesRouterDependencies: z.boolean().optional(),\n cacheComponents: z.boolean().optional(),\n cacheHandler: z.string().min(1).optional(),\n cacheHandlers: z.record(z.string(), z.string().optional()).optional(),\n cacheLife: z\n .record(\n z.object({\n stale: z.number().optional(),\n revalidate: z.number().optional(),\n expire: z.number().optional(),\n })\n )\n .optional(),\n cacheMaxMemorySize: z.number().optional(),\n cleanDistDir: z.boolean().optional(),\n compiler: z\n .strictObject({\n emotion: z\n .union([\n z.boolean(),\n z.object({\n sourceMap: z.boolean().optional(),\n autoLabel: z\n .union([\n z.literal('always'),\n z.literal('dev-only'),\n z.literal('never'),\n ])\n .optional(),\n labelFormat: z.string().min(1).optional(),\n importMap: z\n .record(\n z.string(),\n z.record(\n z.string(),\n z.object({\n canonicalImport: z\n .tuple([z.string(), z.string()])\n .optional(),\n styledBaseImport: z\n .tuple([z.string(), z.string()])\n .optional(),\n })\n )\n )\n .optional(),\n }),\n ])\n .optional(),\n reactRemoveProperties: z\n .union([\n z.boolean().optional(),\n z.object({\n properties: z.array(z.string()).optional(),\n }),\n ])\n .optional(),\n relay: z\n .object({\n src: z.string(),\n artifactDirectory: z.string().optional(),\n language: z.enum(['javascript', 'typescript', 'flow']).optional(),\n eagerEsModules: z.boolean().optional(),\n })\n .optional(),\n removeConsole: z\n .union([\n z.boolean().optional(),\n z.object({\n exclude: z.array(z.string()).min(1).optional(),\n }),\n ])\n .optional(),\n styledComponents: z.union([\n z.boolean().optional(),\n z.object({\n displayName: z.boolean().optional(),\n topLevelImportPaths: z.array(z.string()).optional(),\n ssr: z.boolean().optional(),\n fileName: z.boolean().optional(),\n meaninglessFileNames: z.array(z.string()).optional(),\n minify: z.boolean().optional(),\n transpileTemplateLiterals: z.boolean().optional(),\n namespace: z.string().min(1).optional(),\n pure: z.boolean().optional(),\n cssProp: z.boolean().optional(),\n }),\n ]),\n styledJsx: z.union([\n z.boolean().optional(),\n z.object({\n useLightningcss: z.boolean().optional(),\n }),\n ]),\n define: z\n .record(z.string(), z.union([z.string(), z.number(), z.boolean()]))\n .optional(),\n defineServer: z\n .record(z.string(), z.union([z.string(), z.number(), z.boolean()]))\n .optional(),\n runAfterProductionCompile: z\n .function()\n .returns(z.promise(z.void()))\n .optional(),\n })\n .optional(),\n compress: z.boolean().optional(),\n configOrigin: z.string().optional(),\n crossOrigin: z\n .union([z.literal('anonymous'), z.literal('use-credentials')])\n .optional(),\n deploymentId: z.string().optional(),\n devIndicators: z\n .union([\n z.object({\n position: z\n .union([\n z.literal('bottom-left'),\n z.literal('bottom-right'),\n z.literal('top-left'),\n z.literal('top-right'),\n ])\n .optional(),\n }),\n z.literal(false),\n ])\n .optional(),\n distDir: z.string().min(1).optional(),\n env: z.record(z.string(), z.union([z.string(), z.undefined()])).optional(),\n enablePrerenderSourceMaps: z.boolean().optional(),\n excludeDefaultMomentLocales: z.boolean().optional(),\n experimental: z.strictObject(experimentalSchema).optional(),\n exportPathMap: z\n .function()\n .args(\n zExportMap,\n z.object({\n dev: z.boolean(),\n dir: z.string(),\n outDir: z.string().nullable(),\n distDir: z.string(),\n buildId: z.string(),\n })\n )\n .returns(z.union([zExportMap, z.promise(zExportMap)]))\n .optional(),\n generateBuildId: z\n .function()\n .args()\n .returns(\n z.union([\n z.string(),\n z.null(),\n z.promise(z.union([z.string(), z.null()])),\n ])\n )\n .optional(),\n generateEtags: z.boolean().optional(),\n headers: z\n .function()\n .args()\n .returns(z.promise(z.array(zHeader)))\n .optional(),\n htmlLimitedBots: z.instanceof(RegExp).optional(),\n httpAgentOptions: z\n .strictObject({ keepAlive: z.boolean().optional() })\n .optional(),\n i18n: z\n .strictObject({\n defaultLocale: z.string().min(1),\n domains: z\n .array(\n z.strictObject({\n defaultLocale: z.string().min(1),\n domain: z.string().min(1),\n http: z.literal(true).optional(),\n locales: z.array(z.string().min(1)).optional(),\n })\n )\n .optional(),\n localeDetection: z.literal(false).optional(),\n locales: z.array(z.string().min(1)),\n })\n .nullable()\n .optional(),\n images: z\n .strictObject({\n localPatterns: z\n .array(\n z.strictObject({\n pathname: z.string().optional(),\n search: z.string().optional(),\n })\n )\n .max(25)\n .optional(),\n remotePatterns: z\n .array(\n z.union([\n z.instanceof(URL),\n z.strictObject({\n hostname: z.string(),\n pathname: z.string().optional(),\n port: z.string().max(5).optional(),\n protocol: z.enum(['http', 'https']).optional(),\n search: z.string().optional(),\n }),\n ])\n )\n .max(50)\n .optional(),\n unoptimized: z.boolean().optional(),\n customCacheHandler: z.boolean().optional(),\n contentSecurityPolicy: z.string().optional(),\n contentDispositionType: z.enum(['inline', 'attachment']).optional(),\n dangerouslyAllowSVG: z.boolean().optional(),\n dangerouslyAllowLocalIP: z.boolean().optional(),\n deviceSizes: z\n .array(z.number().int().gte(1).lte(10000))\n .max(25)\n .optional(),\n disableStaticImages: z.boolean().optional(),\n domains: z.array(z.string()).max(50).optional(),\n formats: z\n .array(z.enum(['image/avif', 'image/webp']))\n .max(4)\n .optional(),\n imageSizes: z\n .array(z.number().int().gte(1).lte(10000))\n .min(0)\n .max(25)\n .optional(),\n loader: z.enum(VALID_LOADERS).optional(),\n loaderFile: z.string().optional(),\n maximumDiskCacheSize: z.number().int().min(0).optional(),\n maximumRedirects: z.number().int().min(0).max(20).optional(),\n maximumResponseBody: z\n .number()\n .int()\n .min(1)\n .max(Number.MAX_SAFE_INTEGER)\n .optional(),\n minimumCacheTTL: z.number().int().gte(0).optional(),\n path: z.string().optional(),\n qualities: z\n .array(z.number().int().gte(1).lte(100))\n .min(1)\n .max(20)\n .optional(),\n })\n .optional(),\n logging: z\n .union([\n z.object({\n fetches: z\n .object({\n fullUrl: z.boolean().optional(),\n hmrRefreshes: z.boolean().optional(),\n })\n .optional(),\n incomingRequests: z\n .union([\n z.boolean(),\n z.object({\n ignore: z.array(z.instanceof(RegExp)),\n }),\n ])\n .optional(),\n serverFunctions: z.boolean().optional(),\n browserToTerminal: z\n .union([z.boolean(), z.enum(['error', 'warn'])])\n .optional(),\n }),\n z.literal(false),\n ])\n .optional(),\n modularizeImports: z\n .record(\n z.string(),\n z.object({\n transform: z.union([z.string(), z.record(z.string(), z.string())]),\n preventFullImport: z.boolean().optional(),\n skipDefaultConversion: z.boolean().optional(),\n })\n )\n .optional(),\n onDemandEntries: z\n .strictObject({\n maxInactiveAge: z.number().optional(),\n pagesBufferLength: z.number().optional(),\n })\n .optional(),\n output: z.enum(['standalone', 'export']).optional(),\n outputFileTracingRoot: z.string().optional(),\n outputFileTracingExcludes: z\n .record(z.string(), z.array(z.string()))\n .optional(),\n outputFileTracingIncludes: z\n .record(z.string(), z.array(z.string()))\n .optional(),\n pageExtensions: z.array(z.string()).min(1).optional(),\n instrumentationClientInject: z.array(z.string()).optional(),\n partialPrefetching: z\n .union([z.boolean(), z.literal('unstable_eager')])\n .optional(),\n poweredByHeader: z.boolean().optional(),\n productionBrowserSourceMaps: z.boolean().optional(),\n reactCompiler: z.union([\n z.boolean(),\n z\n .object({\n compilationMode: z.enum(['infer', 'annotation', 'all']).optional(),\n panicThreshold: z\n .enum(['none', 'critical_errors', 'all_errors'])\n .optional(),\n })\n .optional(),\n ]),\n reactProductionProfiling: z.boolean().optional(),\n reactStrictMode: z.boolean().nullable().optional(),\n reactMaxHeadersLength: z.number().nonnegative().int().optional(),\n redirects: z\n .function()\n .args()\n .returns(z.promise(z.array(zRedirect)))\n .optional(),\n rewrites: z\n .function()\n .args()\n .returns(\n z.promise(\n z.union([\n z.array(zRewrite),\n z.object({\n beforeFiles: z.array(zRewrite),\n afterFiles: z.array(zRewrite),\n fallback: z.array(zRewrite),\n }),\n ])\n )\n )\n .optional(),\n // sassOptions properties are unknown besides implementation, use z.any() here\n sassOptions: z\n .object({\n implementation: z.string().optional(),\n })\n .catchall(z.any())\n .optional(),\n serverExternalPackages: z.array(z.string()).optional(),\n skipMiddlewareUrlNormalize: z.boolean().optional(),\n skipProxyUrlNormalize: z.boolean().optional(),\n skipTrailingSlashRedirect: z.boolean().optional(),\n staticPageGenerationTimeout: z.number().optional(),\n expireTime: z.number().optional(),\n target: z.string().optional(),\n trailingSlash: z.boolean().optional(),\n transpilePackages: z.array(z.string()).optional(),\n turbopack: zTurbopackConfig.optional(),\n typescript: z\n .strictObject({\n ignoreBuildErrors: z.boolean().optional(),\n tsconfigPath: z.string().min(1).optional(),\n })\n .optional(),\n typedRoutes: z.boolean().optional(),\n useFileSystemPublicRoutes: z.boolean().optional(),\n // The webpack config type is unknown, use z.any() here\n webpack: z.any().nullable().optional(),\n watchOptions: z\n .strictObject({\n pollIntervalMs: z.number().positive().finite().optional(),\n })\n .optional(),\n })\n)\n"],"names":["VALID_LOADERS","z","LIGHTNINGCSS_FEATURE_NAMES","SUPPORTED_TEST_RUNNERS_LIST","zSizeLimit","custom","val","zExportMap","record","string","object","page","query","any","_fallbackRouteParams","array","optional","_isAppDir","boolean","_isDynamicError","_isRoutePPREnabled","_allowEmptyStaticShell","_isFallbackUpgradeable","zRouteHas","union","type","enum","key","value","literal","undefined","zRewrite","source","destination","basePath","locale","has","missing","internal","zRedirect","and","statusCode","never","permanent","number","zHeader","headers","zTurbopackLoaderItem","strictObject","loader","options","zTurbopackLoaderBuiltinCondition","zTurbopackCondition","all","lazy","not","path","instanceof","RegExp","content","contentType","zTurbopackModuleType","zTurbopackRuleConfigItem","loaders","as","condition","zTurbopackRuleConfigCollection","zTurbopackConfig","rules","resolveAlias","resolveExtensions","root","debugIds","chunkLoadingGlobal","ignoreIssue","title","description","experimentalSchema","outputHashSalt","useSkewCookie","after","appNavFailHandling","appNewScrollHandler","coldCacheBadge","preloadEntriesOnStart","allowedRevalidateHeaderKeys","staleTimes","dynamic","static","gte","cacheLife","stale","revalidate","expire","cacheHandlers","clientRouterFilter","clientRouterFilterRedirects","clientRouterFilterAllowedRate","cpus","memoryBasedWorkersCount","craCompat","caseSensitiveRoutes","clientParamParsingOrigins","cachedNavigations","dynamicOnHover","useOffline","optimisticRouting","instrumentationClientRouterTransitionEvents","appShells","varyParams","prefetchInlining","maxSize","maxBundleSize","disableOptimizedLoading","disablePostcssPresetEnv","cacheComponents","inlineCss","esmExternals","serverActions","bodySizeLimit","allowedOrigins","maxPostponedStateSize","extensionAlias","externalDir","externalMiddlewareRewritesResolve","externalProxyRewritesResolve","exposeTestingApiInProductionBuild","fallbackNodePolyfills","fetchCacheKeyPrefix","forceSwcTransforms","fullySpecified","gzipSize","imgOptConcurrency","int","nullable","imgOptOperationCache","imgOptTimeoutInSeconds","imgOptMaxInputPixels","imgOptSequentialRead","imgOptSkipMetadata","isrFlushToDisk","largePageDataBytes","linkNoTouchStart","manualClientBasePath","middlewarePrefetch","proxyPrefetch","middlewareClientMaxBodySize","proxyClientMaxBodySize","multiZoneDraftMode","cssChunking","requestCost","nonnegative","finite","moduleFactorCost","nextScriptWorkers","optimizeCss","optimisticClientCache","parallelServerCompiles","parallelServerBuildTraces","ppr","readonly","taint","blockingSSR","prerenderEarlyExit","proxyTimeout","rootParams","mcpServer","removeUncaughtErrorAndRejectionListeners","validateRSCRequestHeaders","scrollRestoration","sri","algorithm","swcPlugins","tuple","swcEnvOptions","mode","coreJs","skip","include","exclude","shippedProposals","forceAllTransforms","debug","loose","swcTraceProfiling","urlImports","viewTransition","workerThreads","webVitalsAttribution","mdxRs","development","jsxRuntime","jsxImportSource","providerImportSource","mdxType","transitionIndicator","gestureTransition","typedRoutes","webpackBuildWorker","webpackMemoryOptimizations","turbopackMemoryEviction","turbopackPluginRuntimeStrategy","turbopackMinify","turbopackFileSystemCacheForDev","turbopackFileSystemCacheForBuild","turbopackSourceMaps","turbopackInputSourceMaps","turbopackTreeShaking","turbopackRemoveUnusedImports","turbopackRemoveUnusedExports","turbopackScopeHoisting","turbopackWorkerAssetPrefix","turbopackClientSideNestedAsyncChunking","turbopackServerSideNestedAsyncChunking","turbopackImportTypeBytes","turbopackImportTypeText","turbopackUseBuiltinBabel","turbopackUseBuiltinSass","turbopackLocalPostcssConfig","turbopackModuleIds","turbopackInferModuleSideEffects","turbopackServerFastRefresh","optimizePackageImports","optimizeServerReact","strictRouteTypes","clientTraceMetadata","serverMinification","serverSourceMaps","useWasmBinary","useLightningcss","lightningCssFeatures","testProxy","defaultTestRunner","allowDevelopmentBuild","reactDebugChannel","instantInsights","validationLevel","staticGenerationRetryCount","staticGenerationMaxConcurrency","staticGenerationMinPagesPerWorker","typedEnv","serverComponentsHmrCache","authInterrupts","useCache","useCacheTimeout","positive","slowModuleDetection","buildTimeThresholdMs","globalNotFound","turbopackRustReactCompiler","browserDebugInfoInTerminal","level","depthLimit","edgeLimit","showSourceLocation","lockDistDir","hideLogsAfterAbort","runtimeServerDeploymentId","supportsImmutableAssets","deferredEntries","onBeforeDeferredEntries","function","returns","promise","void","reportSystemEnvInlining","configSchema","adapterPath","agentRules","allowedDevOrigins","assetPrefix","bundlePagesRouterDependencies","cacheHandler","min","cacheMaxMemorySize","cleanDistDir","compiler","emotion","sourceMap","autoLabel","labelFormat","importMap","canonicalImport","styledBaseImport","reactRemoveProperties","properties","relay","src","artifactDirectory","language","eagerEsModules","removeConsole","styledComponents","displayName","topLevelImportPaths","ssr","fileName","meaninglessFileNames","minify","transpileTemplateLiterals","namespace","pure","cssProp","styledJsx","define","defineServer","runAfterProductionCompile","compress","configOrigin","crossOrigin","deploymentId","devIndicators","position","distDir","env","enablePrerenderSourceMaps","excludeDefaultMomentLocales","experimental","exportPathMap","args","dev","dir","outDir","buildId","generateBuildId","null","generateEtags","htmlLimitedBots","httpAgentOptions","keepAlive","i18n","defaultLocale","domains","domain","http","locales","localeDetection","images","localPatterns","pathname","search","max","remotePatterns","URL","hostname","port","protocol","unoptimized","customCacheHandler","contentSecurityPolicy","contentDispositionType","dangerouslyAllowSVG","dangerouslyAllowLocalIP","deviceSizes","lte","disableStaticImages","formats","imageSizes","loaderFile","maximumDiskCacheSize","maximumRedirects","maximumResponseBody","Number","MAX_SAFE_INTEGER","minimumCacheTTL","qualities","logging","fetches","fullUrl","hmrRefreshes","incomingRequests","ignore","serverFunctions","browserToTerminal","modularizeImports","transform","preventFullImport","skipDefaultConversion","onDemandEntries","maxInactiveAge","pagesBufferLength","output","outputFileTracingRoot","outputFileTracingExcludes","outputFileTracingIncludes","pageExtensions","instrumentationClientInject","partialPrefetching","poweredByHeader","productionBrowserSourceMaps","reactCompiler","compilationMode","panicThreshold","reactProductionProfiling","reactStrictMode","reactMaxHeadersLength","redirects","rewrites","beforeFiles","afterFiles","fallback","sassOptions","implementation","catchall","serverExternalPackages","skipMiddlewareUrlNormalize","skipProxyUrlNormalize","skipTrailingSlashRedirect","staticPageGenerationTimeout","expireTime","target","trailingSlash","transpilePackages","turbopack","typescript","ignoreBuildErrors","tsconfigPath","useFileSystemPublicRoutes","webpack","watchOptions","pollIntervalMs"],"mappings":"AACA,SAASA,aAAa,QAAQ,6BAA4B;AAE1D,SAASC,CAAC,QAAQ,yBAAwB;AAI1C,SACEC,0BAA0B,QAQrB,kBAAiB;AAOxB,SAASC,2BAA2B,QAAQ,mBAAkB;AAE9D,6CAA6C;AAC7C,MAAMC,aAAaH,EAAEI,MAAM,CAAY,CAACC;IACtC,IAAI,OAAOA,QAAQ,YAAY,OAAOA,QAAQ,UAAU;QACtD,OAAO;IACT;IACA,OAAO;AACT;AAEA,MAAMC,aAAyCN,EAAEO,MAAM,CACrDP,EAAEQ,MAAM,IACRR,EAAES,MAAM,CAAC;IACPC,MAAMV,EAAEQ,MAAM;IACdG,OAAOX,EAAEY,GAAG;IAEZ,8BAA8B;IAC9BC,sBAAsBb,EAAEc,KAAK,CAACd,EAAEY,GAAG,IAAIG,QAAQ;IAC/CC,WAAWhB,EAAEiB,OAAO,GAAGF,QAAQ;IAC/BG,iBAAiBlB,EAAEiB,OAAO,GAAGF,QAAQ;IACrCI,oBAAoBnB,EAAEiB,OAAO,GAAGF,QAAQ;IACxCK,wBAAwBpB,EAAE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ACT+C,YAAY,CAAC;YACZ+W,mBAAmB9Z,EAAEiB,OAAO,GAAGF,QAAQ;YACvCgZ,cAAc/Z,EAAEQ,MAAM,GAAGwQ,GAAG,CAAC,GAAGjQ,QAAQ;QAC1C,GACCA,QAAQ;QACXqL,aAAapM,EAAEiB,OAAO,GAAGF,QAAQ;QACjCiZ,2BAA2Bha,EAAEiB,OAAO,GAAGF,QAAQ;QAC/C,uDAAuD;QACvDkZ,SAASja,EAAEY,GAAG,GAAGyH,QAAQ,GAAGtH,QAAQ;QACpCmZ,cAAcla,EACX+C,YAAY,CAAC;YACZoX,gBAAgBna,EAAE2C,MAAM,GAAGyM,QAAQ,GAAG7F,MAAM,GAAGxI,QAAQ;QACzD,GACCA,QAAQ;IACb,IACD","ignoreList":[0]} |
@@ -164,2 +164,3 @@ import os from 'os'; | ||
| appNewScrollHandler: false, | ||
| coldCacheBadge: false, | ||
| useSkewCookie: false, | ||
@@ -166,0 +167,0 @@ cssChunking: true, |
@@ -26,3 +26,3 @@ import { loadEnvConfig } from '@next/env'; | ||
| } | ||
| Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"16.3.0-preview.4"}`))}${versionSuffix}`); | ||
| Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"16.3.0-preview.5"}`))}${versionSuffix}`); | ||
| if (appUrl) { | ||
@@ -29,0 +29,0 @@ Log.bootstrap(`- Local: ${appUrl}`); |
@@ -65,2 +65,3 @@ import path from 'path'; | ||
| const legacyStaticFolderItems = new Set(); | ||
| const serviceWorkerItems = new Set(); | ||
| const appFiles = new Set(); | ||
@@ -83,2 +84,3 @@ const pageFiles = new Set(); | ||
| const legacyStaticFolderPath = path.join(opts.dir, 'static'); | ||
| const serviceWorkerFolderPath = path.join(distDir, 'service-worker'); | ||
| let customRoutes = { | ||
@@ -138,2 +140,11 @@ redirects: [], | ||
| } | ||
| try { | ||
| for (const file of (await recursiveReadDir(serviceWorkerFolderPath))){ | ||
| serviceWorkerItems.add(encodeURIPath(normalizePathSep(file))); | ||
| } | ||
| } catch (err) { | ||
| if (err.code !== 'ENOENT') { | ||
| throw err; | ||
| } | ||
| } | ||
| const routesManifestPath = path.join(distDir, ROUTES_MANIFEST); | ||
@@ -254,2 +265,3 @@ const prerenderManifestPath = path.join(distDir, PRERENDER_MANIFEST); | ||
| debug('nextStaticFolderItems', nextStaticFolderItems); | ||
| debug('serviceWorkerItems', serviceWorkerItems); | ||
| debug('pageFiles', pageFiles); | ||
@@ -336,2 +348,6 @@ debug('appFiles', appFiles); | ||
| [ | ||
| serviceWorkerItems, | ||
| 'serviceWorker' | ||
| ], | ||
| [ | ||
| nextStaticFolderItems, | ||
@@ -443,2 +459,7 @@ 'nextStaticFolder' | ||
| } | ||
| case 'serviceWorker': | ||
| { | ||
| itemsRoot = serviceWorkerFolderPath; | ||
| break; | ||
| } | ||
| case 'appFile': | ||
@@ -466,3 +487,4 @@ case 'pageFile': | ||
| 'publicFolder', | ||
| 'legacyStaticFolder' | ||
| 'legacyStaticFolder', | ||
| 'serviceWorker' | ||
| ].includes(type); | ||
@@ -469,0 +491,0 @@ if (isStaticAsset && itemsRoot) { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../../src/server/lib/router-utils/filesystem.ts"],"sourcesContent":["import type {\n FunctionsConfigManifest,\n ManifestRoute,\n PrerenderManifest,\n RoutesManifest,\n} from '../../../build'\nimport type { NextConfigRuntime } from '../../config-shared'\nimport type { MiddlewareManifest } from '../../../build/webpack/plugins/middleware-plugin'\nimport type { UnwrapPromise } from '../../../lib/coalesced-function'\nimport type { PatchMatcher } from '../../../shared/lib/router/utils/path-match'\nimport type { MiddlewareRouteMatch } from '../../../shared/lib/router/utils/middleware-route-matcher'\nimport type { __ApiPreviewProps } from '../../api-utils'\n\nimport path from 'path'\nimport fs from 'fs/promises'\nimport * as Log from '../../../build/output/log'\nimport setupDebug from 'next/dist/compiled/debug'\nimport { LRUCache } from '../lru-cache'\nimport loadCustomRoutes, { type Rewrite } from '../../../lib/load-custom-routes'\nimport { modifyRouteRegex } from '../../../lib/redirect-status'\nimport { FileType, fileExists } from '../../../lib/file-exists'\nimport { recursiveReadDir } from '../../../lib/recursive-readdir'\nimport { isDynamicRoute } from '../../../shared/lib/router/utils'\nimport { escapeStringRegexp } from '../../../shared/lib/escape-regexp'\nimport { getPathMatch } from '../../../shared/lib/router/utils/path-match'\nimport {\n getNamedRouteRegex,\n getRouteRegex,\n} from '../../../shared/lib/router/utils/route-regex'\nimport { getRouteMatcher } from '../../../shared/lib/router/utils/route-matcher'\nimport { pathHasPrefix } from '../../../shared/lib/router/utils/path-has-prefix'\nimport { normalizeLocalePath } from '../../../shared/lib/i18n/normalize-locale-path'\nimport { removePathPrefix } from '../../../shared/lib/router/utils/remove-path-prefix'\nimport { getMiddlewareRouteMatcher } from '../../../shared/lib/router/utils/middleware-route-matcher'\nimport {\n APP_PATH_ROUTES_MANIFEST,\n BUILD_ID_FILE,\n FUNCTIONS_CONFIG_MANIFEST,\n MIDDLEWARE_MANIFEST,\n PAGES_MANIFEST,\n PRERENDER_MANIFEST,\n ROUTES_MANIFEST,\n} from '../../../shared/lib/constants'\nimport { normalizePathSep } from '../../../shared/lib/page-path/normalize-path-sep'\nimport { normalizeMetadataRoute } from '../../../lib/metadata/get-metadata-route'\nimport { RSCPathnameNormalizer } from '../../normalizers/request/rsc'\nimport { encodeURIPath } from '../../../shared/lib/encode-uri-path'\nimport { isMetadataRouteFile } from '../../../lib/metadata/is-metadata-route'\n\nexport type FsOutput = {\n type:\n | 'appFile'\n | 'pageFile'\n | 'nextImage'\n | 'publicFolder'\n | 'nextStaticFolder'\n | 'legacyStaticFolder'\n | 'devVirtualFsItem'\n\n itemPath: string\n fsPath?: string\n itemsRoot?: string\n locale?: string\n}\n\nconst debug = setupDebug('next:router-server:filesystem')\n\nexport type FilesystemDynamicRoute = ManifestRoute & {\n /**\n * The path matcher that can be used to match paths against this route.\n */\n match: PatchMatcher\n}\n\nexport const buildCustomRoute = <T>(\n type: 'redirect' | 'header' | 'rewrite' | 'before_files_rewrite',\n item: T & { source: string },\n basePath?: string,\n caseSensitive?: boolean\n): T & { match: PatchMatcher; check?: boolean; regex: string } => {\n const restrictedRedirectPaths = ['/_next'].map((p) =>\n basePath ? `${basePath}${p}` : p\n )\n let builtRegex = ''\n const match = getPathMatch(item.source, {\n strict: true,\n removeUnnamedParams: true,\n regexModifier: (regex: string) => {\n if (!(item as any).internal) {\n regex = modifyRouteRegex(\n regex,\n type === 'redirect' ? restrictedRedirectPaths : undefined\n )\n }\n builtRegex = regex\n return builtRegex\n },\n sensitive: caseSensitive,\n })\n\n return {\n ...item,\n regex: builtRegex,\n ...(type === 'rewrite' ? { check: true } : {}),\n match,\n }\n}\n\nexport async function setupFsCheck(opts: {\n dir: string\n dev: boolean\n minimalMode?: boolean\n config: NextConfigRuntime\n}) {\n const getItemsLru = !opts.dev\n ? new LRUCache<FsOutput | null>(1024 * 1024, function length(value) {\n if (!value) {\n // Null entries (negative cache) still need a non-zero size for LRU eviction\n return 1\n }\n return (\n (value.fsPath || '').length +\n value.itemPath.length +\n value.type.length\n )\n })\n : undefined\n\n // routes that have _next/data endpoints (SSG/SSP)\n const nextDataRoutes = new Set<string>()\n const publicFolderItems = new Set<string>()\n const nextStaticFolderItems = new Set<string>()\n const legacyStaticFolderItems = new Set<string>()\n\n const appFiles = new Set<string>()\n const pageFiles = new Set<string>()\n // Map normalized path to the file path. This is essential\n // for parallel and group routes as their original path\n // cannot be restored from the request path.\n // Example:\n // [normalized-path] -> [file-path]\n // /icon-<hash>.png -> .../app/@parallel/icon.png\n // /icon-<hash>.png -> .../app/(group)/icon.png\n // /icon.png -> .../app/icon.png\n const staticMetadataFiles = new Map<string, string>()\n let dynamicRoutes: FilesystemDynamicRoute[] = []\n\n let middlewareMatcher:\n | ReturnType<typeof getMiddlewareRouteMatcher>\n | undefined = () => false\n\n const distDir = path.join(opts.dir, opts.config.distDir)\n const publicFolderPath = path.join(opts.dir, 'public')\n const nextStaticFolderPath = path.join(distDir, 'static')\n const legacyStaticFolderPath = path.join(opts.dir, 'static')\n let customRoutes: UnwrapPromise<ReturnType<typeof loadCustomRoutes>> = {\n redirects: [],\n rewrites: {\n beforeFiles: [],\n afterFiles: [],\n fallback: [],\n },\n onMatchHeaders: [],\n headers: [],\n }\n let buildId = 'development'\n let previewProps: __ApiPreviewProps\n\n if (!opts.dev) {\n const buildIdPath = path.join(opts.dir, opts.config.distDir, BUILD_ID_FILE)\n try {\n buildId = await fs.readFile(buildIdPath, 'utf8')\n } catch (err: any) {\n if (err.code !== 'ENOENT') throw err\n throw new Error(\n `Could not find a production build in the '${opts.config.distDir}' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id`\n )\n }\n\n try {\n for (const file of await recursiveReadDir(publicFolderPath)) {\n // Ensure filename is encoded and normalized.\n publicFolderItems.add(encodeURIPath(normalizePathSep(file)))\n }\n } catch (err: any) {\n if (err.code !== 'ENOENT') {\n throw err\n }\n }\n\n try {\n for (const file of await recursiveReadDir(legacyStaticFolderPath)) {\n // Ensure filename is encoded and normalized.\n legacyStaticFolderItems.add(encodeURIPath(normalizePathSep(file)))\n }\n Log.warn(\n `The static directory has been deprecated in favor of the public directory. https://nextjs.org/docs/messages/static-dir-deprecated`\n )\n } catch (err: any) {\n if (err.code !== 'ENOENT') {\n throw err\n }\n }\n\n try {\n for (const file of await recursiveReadDir(nextStaticFolderPath)) {\n // Ensure filename is encoded and normalized.\n nextStaticFolderItems.add(\n path.posix.join(\n '/_next/static',\n encodeURIPath(normalizePathSep(file))\n )\n )\n }\n } catch (err) {\n if (opts.config.output !== 'standalone') throw err\n }\n\n const routesManifestPath = path.join(distDir, ROUTES_MANIFEST)\n const prerenderManifestPath = path.join(distDir, PRERENDER_MANIFEST)\n const middlewareManifestPath = path.join(\n distDir,\n 'server',\n MIDDLEWARE_MANIFEST\n )\n const functionsConfigManifestPath = path.join(\n distDir,\n 'server',\n FUNCTIONS_CONFIG_MANIFEST\n )\n const pagesManifestPath = path.join(distDir, 'server', PAGES_MANIFEST)\n const appRoutesManifestPath = path.join(distDir, APP_PATH_ROUTES_MANIFEST)\n\n const routesManifest = JSON.parse(\n await fs.readFile(routesManifestPath, 'utf8')\n ) as RoutesManifest\n\n previewProps = (\n JSON.parse(\n await fs.readFile(prerenderManifestPath, 'utf8')\n ) as PrerenderManifest\n ).preview\n\n const middlewareManifest = JSON.parse(\n await fs.readFile(middlewareManifestPath, 'utf8').catch(() => '{}')\n ) as MiddlewareManifest\n\n const functionsConfigManifest = JSON.parse(\n await fs.readFile(functionsConfigManifestPath, 'utf8').catch(() => '{}')\n ) as FunctionsConfigManifest\n\n const pagesManifest = JSON.parse(\n await fs.readFile(pagesManifestPath, 'utf8')\n )\n const appRoutesManifest = JSON.parse(\n await fs.readFile(appRoutesManifestPath, 'utf8').catch(() => '{}')\n )\n\n for (const key of Object.keys(pagesManifest)) {\n // ensure the non-locale version is in the set\n if (opts.config.i18n) {\n pageFiles.add(\n normalizeLocalePath(key, opts.config.i18n.locales).pathname\n )\n } else {\n pageFiles.add(key)\n }\n }\n for (const key of Object.keys(appRoutesManifest)) {\n appFiles.add(appRoutesManifest[key])\n }\n\n const escapedBuildId = escapeStringRegexp(buildId)\n\n for (const route of routesManifest.dataRoutes) {\n if (isDynamicRoute(route.page)) {\n const routeRegex = getNamedRouteRegex(route.page, {\n prefixRouteKeys: true,\n })\n dynamicRoutes.push({\n ...route,\n regex: routeRegex.re.toString(),\n namedRegex: routeRegex.namedRegex,\n routeKeys: routeRegex.routeKeys,\n match: getRouteMatcher({\n // TODO: fix this in the manifest itself, must also be fixed in\n // upstream builder that relies on this\n re: opts.config.i18n\n ? new RegExp(\n route.dataRouteRegex.replace(\n `/${escapedBuildId}/`,\n `/${escapedBuildId}/(?<nextLocale>[^/]+?)/`\n )\n )\n : new RegExp(route.dataRouteRegex),\n groups: routeRegex.groups,\n }),\n })\n }\n nextDataRoutes.add(route.page)\n }\n\n for (const route of routesManifest.dynamicRoutes) {\n // If a route is marked as skipInternalRouting, it's not for the internal\n // router, and instead has been added to support external routers.\n if (route.skipInternalRouting) {\n continue\n }\n\n dynamicRoutes.push({\n ...route,\n match: getRouteMatcher(getRouteRegex(route.page)),\n })\n }\n\n if (middlewareManifest.middleware?.['/']?.matchers) {\n middlewareMatcher = getMiddlewareRouteMatcher(\n middlewareManifest.middleware?.['/']?.matchers\n )\n } else if (functionsConfigManifest?.functions['/_middleware']) {\n middlewareMatcher = getMiddlewareRouteMatcher(\n functionsConfigManifest.functions['/_middleware'].matchers ?? [\n { regexp: '.*', originalSource: '/:path*' },\n ]\n )\n }\n\n customRoutes = {\n redirects: routesManifest.redirects,\n rewrites: routesManifest.rewrites\n ? Array.isArray(routesManifest.rewrites)\n ? {\n beforeFiles: [],\n afterFiles: routesManifest.rewrites,\n fallback: [],\n }\n : routesManifest.rewrites\n : {\n beforeFiles: [],\n afterFiles: [],\n fallback: [],\n },\n headers: routesManifest.headers,\n onMatchHeaders: routesManifest.onMatchHeaders,\n }\n } else {\n // dev handling\n customRoutes = await loadCustomRoutes(opts.config)\n\n previewProps = {\n previewModeId: (require('crypto') as typeof import('crypto'))\n .randomBytes(16)\n .toString('hex'),\n previewModeSigningKey: (require('crypto') as typeof import('crypto'))\n .randomBytes(32)\n .toString('hex'),\n previewModeEncryptionKey: (require('crypto') as typeof import('crypto'))\n .randomBytes(32)\n .toString('hex'),\n }\n }\n\n const headers = customRoutes.headers.map((item) =>\n buildCustomRoute(\n 'header',\n item,\n opts.config.basePath,\n opts.config.experimental.caseSensitiveRoutes\n )\n )\n const onMatchHeaders = customRoutes.onMatchHeaders.map((item) =>\n buildCustomRoute(\n 'header',\n item,\n opts.config.basePath,\n opts.config.experimental.caseSensitiveRoutes\n )\n )\n const redirects = customRoutes.redirects.map((item) =>\n buildCustomRoute(\n 'redirect',\n item,\n opts.config.basePath,\n opts.config.experimental.caseSensitiveRoutes\n )\n )\n const rewrites = {\n beforeFiles: customRoutes.rewrites.beforeFiles.map((item) =>\n buildCustomRoute('before_files_rewrite', item)\n ),\n afterFiles: customRoutes.rewrites.afterFiles.map((item) =>\n buildCustomRoute(\n 'rewrite',\n item,\n opts.config.basePath,\n opts.config.experimental.caseSensitiveRoutes\n )\n ),\n fallback: customRoutes.rewrites.fallback.map((item) =>\n buildCustomRoute(\n 'rewrite',\n item,\n opts.config.basePath,\n opts.config.experimental.caseSensitiveRoutes\n )\n ),\n }\n\n const { i18n } = opts.config\n\n const handleLocale = (pathname: string, locales?: string[]) => {\n let locale: string | undefined\n\n if (i18n) {\n const i18nResult = normalizeLocalePath(pathname, locales || i18n.locales)\n\n pathname = i18nResult.pathname\n locale = i18nResult.detectedLocale\n }\n return { locale, pathname }\n }\n\n debug('nextDataRoutes', nextDataRoutes)\n debug('dynamicRoutes', dynamicRoutes)\n debug('customRoutes', customRoutes)\n debug('publicFolderItems', publicFolderItems)\n debug('nextStaticFolderItems', nextStaticFolderItems)\n debug('pageFiles', pageFiles)\n debug('appFiles', appFiles)\n\n let ensureFn: (item: FsOutput) => Promise<void> | undefined\n\n const normalizers = {\n // Because we can't know if the app directory is enabled or not at this\n // stage, we assume that it is.\n rsc: new RSCPathnameNormalizer(),\n }\n\n return {\n headers,\n onMatchHeaders,\n rewrites,\n redirects,\n\n buildId,\n handleLocale,\n\n appFiles,\n pageFiles,\n staticMetadataFiles,\n dynamicRoutes,\n nextDataRoutes,\n\n exportPathMapRoutes: undefined as\n | undefined\n | ReturnType<typeof buildCustomRoute<Rewrite>>[],\n\n devVirtualFsItems: new Set<string>(),\n\n previewProps,\n middlewareMatcher: middlewareMatcher as MiddlewareRouteMatch | undefined,\n\n ensureCallback(fn: typeof ensureFn) {\n ensureFn = fn\n },\n\n async getItem(itemPath: string): Promise<FsOutput | null> {\n const originalItemPath = itemPath\n const itemKey = originalItemPath\n const lruResult = getItemsLru?.get(itemKey)\n\n if (lruResult) {\n return lruResult\n }\n\n const { basePath } = opts.config\n\n const hasBasePath = pathHasPrefix(itemPath, basePath)\n\n // Return null if path doesn't start with basePath\n if (basePath && !hasBasePath) {\n return null\n }\n\n // Remove basePath if it exists.\n if (basePath && hasBasePath) {\n itemPath = removePathPrefix(itemPath, basePath) || '/'\n }\n\n // Simulate minimal mode requests by normalizing RSC and postponed\n // requests.\n if (opts.minimalMode) {\n if (normalizers.rsc.match(itemPath)) {\n itemPath = normalizers.rsc.normalize(itemPath, true)\n }\n }\n\n if (itemPath !== '/' && itemPath.endsWith('/')) {\n itemPath = itemPath.substring(0, itemPath.length - 1)\n }\n\n let decodedItemPath = itemPath\n\n try {\n decodedItemPath = decodeURIComponent(itemPath)\n } catch {}\n\n if (itemPath === '/_next/image') {\n return {\n itemPath,\n type: 'nextImage',\n }\n }\n\n if (opts.dev && isMetadataRouteFile(itemPath, [], false)) {\n const fsPath = staticMetadataFiles.get(itemPath)\n if (fsPath) {\n return {\n // \"nextStaticFolder\" sets Cache-Control \"no-store\" on dev.\n type: 'nextStaticFolder',\n fsPath,\n itemPath: fsPath,\n }\n }\n }\n\n const itemsToCheck: Array<[Set<string>, FsOutput['type']]> = [\n [this.devVirtualFsItems, 'devVirtualFsItem'],\n [nextStaticFolderItems, 'nextStaticFolder'],\n [legacyStaticFolderItems, 'legacyStaticFolder'],\n [publicFolderItems, 'publicFolder'],\n [appFiles, 'appFile'],\n [pageFiles, 'pageFile'],\n ]\n\n for (let [items, type] of itemsToCheck) {\n let locale: string | undefined\n let curItemPath = itemPath\n let curDecodedItemPath = decodedItemPath\n\n const isDynamicOutput = type === 'pageFile' || type === 'appFile'\n\n if (i18n) {\n const localeResult = handleLocale(\n itemPath,\n // legacy behavior allows visiting static assets under\n // default locale but no other locale\n isDynamicOutput\n ? undefined\n : [\n i18n?.defaultLocale,\n // default locales from domains need to be matched too\n ...(i18n.domains?.map((item) => item.defaultLocale) || []),\n ]\n )\n\n if (localeResult.pathname !== curItemPath) {\n curItemPath = localeResult.pathname\n locale = localeResult.locale\n\n try {\n curDecodedItemPath = decodeURIComponent(curItemPath)\n } catch {}\n }\n }\n\n if (type === 'legacyStaticFolder') {\n if (!pathHasPrefix(curItemPath, '/static')) {\n continue\n }\n curItemPath = curItemPath.substring('/static'.length)\n\n try {\n curDecodedItemPath = decodeURIComponent(curItemPath)\n } catch {}\n }\n\n if (\n type === 'nextStaticFolder' &&\n !pathHasPrefix(curItemPath, '/_next/static')\n ) {\n continue\n }\n\n const nextDataPrefix = `/_next/data/${buildId}/`\n\n if (\n type === 'pageFile' &&\n curItemPath.startsWith(nextDataPrefix) &&\n curItemPath.endsWith('.json')\n ) {\n items = nextDataRoutes\n // remove _next/data/<build-id> prefix\n curItemPath = curItemPath.substring(nextDataPrefix.length - 1)\n\n // remove .json postfix\n curItemPath = curItemPath.substring(\n 0,\n curItemPath.length - '.json'.length\n )\n const curLocaleResult = handleLocale(curItemPath)\n curItemPath =\n curLocaleResult.pathname === '/index'\n ? '/'\n : curLocaleResult.pathname\n\n locale = curLocaleResult.locale\n\n try {\n curDecodedItemPath = decodeURIComponent(curItemPath)\n } catch {}\n }\n\n let matchedItem = items.has(curItemPath)\n\n // check decoded variant as well\n if (!matchedItem && !opts.dev) {\n matchedItem = items.has(curDecodedItemPath)\n if (matchedItem) curItemPath = curDecodedItemPath\n else {\n // x-ref: https://github.com/vercel/next.js/issues/54008\n // There're cases that urls get decoded before requests, we should support both encoded and decoded ones.\n // e.g. nginx could decode the proxy urls, the below ones should be treated as the same:\n // decoded version: `/_next/static/chunks/pages/blog/[slug]-d4858831b91b69f6.js`\n // encoded version: `/_next/static/chunks/pages/blog/%5Bslug%5D-d4858831b91b69f6.js`\n try {\n // encode the special characters in the path and retrieve again to determine if path exists.\n const encodedCurItemPath = encodeURIPath(curItemPath)\n matchedItem = items.has(encodedCurItemPath)\n } catch {}\n }\n }\n\n if (matchedItem || opts.dev) {\n let fsPath: string | undefined\n let itemsRoot: string | undefined\n\n switch (type) {\n case 'nextStaticFolder': {\n itemsRoot = nextStaticFolderPath\n curItemPath = curItemPath.substring('/_next/static'.length)\n break\n }\n case 'legacyStaticFolder': {\n itemsRoot = legacyStaticFolderPath\n break\n }\n case 'publicFolder': {\n itemsRoot = publicFolderPath\n break\n }\n case 'appFile':\n case 'pageFile':\n case 'nextImage':\n case 'devVirtualFsItem': {\n break\n }\n default: {\n ;(type) satisfies never\n }\n }\n\n if (itemsRoot && curItemPath) {\n fsPath = path.posix.join(itemsRoot, curItemPath)\n }\n\n // dynamically check fs in development so we don't\n // have to wait on the watcher\n if (!matchedItem && opts.dev) {\n const isStaticAsset = (\n [\n 'nextStaticFolder',\n 'publicFolder',\n 'legacyStaticFolder',\n ] as (typeof type)[]\n ).includes(type)\n\n if (isStaticAsset && itemsRoot) {\n let found = fsPath && (await fileExists(fsPath, FileType.File))\n\n if (!found) {\n try {\n // In dev, we ensure encoded paths match\n // decoded paths on the filesystem so check\n // that variation as well\n const tempItemPath = decodeURIComponent(curItemPath)\n fsPath = path.posix.join(itemsRoot, tempItemPath)\n found = await fileExists(fsPath, FileType.File)\n } catch {}\n\n if (!found) {\n continue\n }\n }\n } else if (type === 'pageFile' || type === 'appFile') {\n const isAppFile = type === 'appFile'\n\n // Attempt to ensure the page/app file is compiled and ready\n if (ensureFn) {\n const ensureItemPath = isAppFile\n ? normalizeMetadataRoute(curItemPath)\n : curItemPath\n\n try {\n await ensureFn({ type, itemPath: ensureItemPath })\n } catch (error) {\n // If ensure failed, skip this item and continue to the next one\n continue\n }\n }\n } else {\n continue\n }\n }\n\n // i18n locales aren't matched for app dir\n if (type === 'appFile' && locale && locale !== i18n?.defaultLocale) {\n continue\n }\n\n const itemResult = {\n type,\n fsPath,\n locale,\n itemsRoot,\n itemPath: curItemPath,\n }\n\n getItemsLru?.set(itemKey, itemResult)\n return itemResult\n }\n }\n\n getItemsLru?.set(itemKey, null)\n return null\n },\n getDynamicRoutes() {\n // this should include data routes\n return this.dynamicRoutes\n },\n getMiddlewareMatchers() {\n return this.middlewareMatcher\n },\n }\n}\n"],"names":["path","fs","Log","setupDebug","LRUCache","loadCustomRoutes","modifyRouteRegex","FileType","fileExists","recursiveReadDir","isDynamicRoute","escapeStringRegexp","getPathMatch","getNamedRouteRegex","getRouteRegex","getRouteMatcher","pathHasPrefix","normalizeLocalePath","removePathPrefix","getMiddlewareRouteMatcher","APP_PATH_ROUTES_MANIFEST","BUILD_ID_FILE","FUNCTIONS_CONFIG_MANIFEST","MIDDLEWARE_MANIFEST","PAGES_MANIFEST","PRERENDER_MANIFEST","ROUTES_MANIFEST","normalizePathSep","normalizeMetadataRoute","RSCPathnameNormalizer","encodeURIPath","isMetadataRouteFile","debug","buildCustomRoute","type","item","basePath","caseSensitive","restrictedRedirectPaths","map","p","builtRegex","match","source","strict","removeUnnamedParams","regexModifier","regex","internal","undefined","sensitive","check","setupFsCheck","opts","getItemsLru","dev","length","value","fsPath","itemPath","nextDataRoutes","Set","publicFolderItems","nextStaticFolderItems","legacyStaticFolderItems","appFiles","pageFiles","staticMetadataFiles","Map","dynamicRoutes","middlewareMatcher","distDir","join","dir","config","publicFolderPath","nextStaticFolderPath","legacyStaticFolderPath","customRoutes","redirects","rewrites","beforeFiles","afterFiles","fallback","onMatchHeaders","headers","buildId","previewProps","middlewareManifest","buildIdPath","readFile","err","code","Error","file","add","warn","posix","output","routesManifestPath","prerenderManifestPath","middlewareManifestPath","functionsConfigManifestPath","pagesManifestPath","appRoutesManifestPath","routesManifest","JSON","parse","preview","catch","functionsConfigManifest","pagesManifest","appRoutesManifest","key","Object","keys","i18n","locales","pathname","escapedBuildId","route","dataRoutes","page","routeRegex","prefixRouteKeys","push","re","toString","namedRegex","routeKeys","RegExp","dataRouteRegex","replace","groups","skipInternalRouting","middleware","matchers","functions","regexp","originalSource","Array","isArray","previewModeId","require","randomBytes","previewModeSigningKey","previewModeEncryptionKey","experimental","caseSensitiveRoutes","handleLocale","locale","i18nResult","detectedLocale","ensureFn","normalizers","rsc","exportPathMapRoutes","devVirtualFsItems","ensureCallback","fn","getItem","originalItemPath","itemKey","lruResult","get","hasBasePath","minimalMode","normalize","endsWith","substring","decodedItemPath","decodeURIComponent","itemsToCheck","items","curItemPath","curDecodedItemPath","isDynamicOutput","localeResult","defaultLocale","domains","nextDataPrefix","startsWith","curLocaleResult","matchedItem","has","encodedCurItemPath","itemsRoot","isStaticAsset","includes","found","File","tempItemPath","isAppFile","ensureItemPath","error","itemResult","set","getDynamicRoutes","getMiddlewareMatchers"],"mappings":"AAaA,OAAOA,UAAU,OAAM;AACvB,OAAOC,QAAQ,cAAa;AAC5B,YAAYC,SAAS,4BAA2B;AAChD,OAAOC,gBAAgB,2BAA0B;AACjD,SAASC,QAAQ,QAAQ,eAAc;AACvC,OAAOC,sBAAwC,kCAAiC;AAChF,SAASC,gBAAgB,QAAQ,+BAA8B;AAC/D,SAASC,QAAQ,EAAEC,UAAU,QAAQ,2BAA0B;AAC/D,SAASC,gBAAgB,QAAQ,iCAAgC;AACjE,SAASC,cAAc,QAAQ,mCAAkC;AACjE,SAASC,kBAAkB,QAAQ,oCAAmC;AACtE,SAASC,YAAY,QAAQ,8CAA6C;AAC1E,SACEC,kBAAkB,EAClBC,aAAa,QACR,+CAA8C;AACrD,SAASC,eAAe,QAAQ,iDAAgD;AAChF,SAASC,aAAa,QAAQ,mDAAkD;AAChF,SAASC,mBAAmB,QAAQ,iDAAgD;AACpF,SAASC,gBAAgB,QAAQ,sDAAqD;AACtF,SAASC,yBAAyB,QAAQ,4DAA2D;AACrG,SACEC,wBAAwB,EACxBC,aAAa,EACbC,yBAAyB,EACzBC,mBAAmB,EACnBC,cAAc,EACdC,kBAAkB,EAClBC,eAAe,QACV,gCAA+B;AACtC,SAASC,gBAAgB,QAAQ,mDAAkD;AACnF,SAASC,sBAAsB,QAAQ,2CAA0C;AACjF,SAASC,qBAAqB,QAAQ,gCAA+B;AACrE,SAASC,aAAa,QAAQ,sCAAqC;AACnE,SAASC,mBAAmB,QAAQ,0CAAyC;AAkB7E,MAAMC,QAAQ7B,WAAW;AASzB,OAAO,MAA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C;gCAET,IAAI,CAACD,OAAO;oCACV;gCACF;4BACF;wBACF,OAAO,IAAI3J,SAAS,cAAcA,SAAS,WAAW;4BACpD,MAAM8J,YAAY9J,SAAS;4BAE3B,4DAA4D;4BAC5D,IAAIuH,UAAU;gCACZ,MAAMwC,iBAAiBD,YACnBpK,uBAAuBkJ,eACvBA;gCAEJ,IAAI;oCACF,MAAMrB,SAAS;wCAAEvH;wCAAMyB,UAAUsI;oCAAe;gCAClD,EAAE,OAAOC,OAAO;oCAEd;gCACF;4BACF;wBACF,OAAO;4BACL;wBACF;oBACF;oBAEA,0CAA0C;oBAC1C,IAAIhK,SAAS,aAAaoH,UAAUA,YAAWlC,wBAAAA,KAAM8D,aAAa,GAAE;wBAClE;oBACF;oBAEA,MAAMiB,aAAa;wBACjBjK;wBACAwB;wBACA4F;wBACAoC;wBACA/H,UAAUmH;oBACZ;oBAEAxH,+BAAAA,YAAa8I,GAAG,CAAClC,SAASiC;oBAC1B,OAAOA;gBACT;YACF;YAEA7I,+BAAAA,YAAa8I,GAAG,CAAClC,SAAS;YAC1B,OAAO;QACT;QACAmC;YACE,kCAAkC;YAClC,OAAO,IAAI,CAAChI,aAAa;QAC3B;QACAiI;YACE,OAAO,IAAI,CAAChI,iBAAiB;QAC/B;IACF;AACF","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../../src/server/lib/router-utils/filesystem.ts"],"sourcesContent":["import type {\n FunctionsConfigManifest,\n ManifestRoute,\n PrerenderManifest,\n RoutesManifest,\n} from '../../../build'\nimport type { NextConfigRuntime } from '../../config-shared'\nimport type { MiddlewareManifest } from '../../../build/webpack/plugins/middleware-plugin'\nimport type { UnwrapPromise } from '../../../lib/coalesced-function'\nimport type { PatchMatcher } from '../../../shared/lib/router/utils/path-match'\nimport type { MiddlewareRouteMatch } from '../../../shared/lib/router/utils/middleware-route-matcher'\nimport type { __ApiPreviewProps } from '../../api-utils'\n\nimport path from 'path'\nimport fs from 'fs/promises'\nimport * as Log from '../../../build/output/log'\nimport setupDebug from 'next/dist/compiled/debug'\nimport { LRUCache } from '../lru-cache'\nimport loadCustomRoutes, { type Rewrite } from '../../../lib/load-custom-routes'\nimport { modifyRouteRegex } from '../../../lib/redirect-status'\nimport { FileType, fileExists } from '../../../lib/file-exists'\nimport { recursiveReadDir } from '../../../lib/recursive-readdir'\nimport { isDynamicRoute } from '../../../shared/lib/router/utils'\nimport { escapeStringRegexp } from '../../../shared/lib/escape-regexp'\nimport { getPathMatch } from '../../../shared/lib/router/utils/path-match'\nimport {\n getNamedRouteRegex,\n getRouteRegex,\n} from '../../../shared/lib/router/utils/route-regex'\nimport { getRouteMatcher } from '../../../shared/lib/router/utils/route-matcher'\nimport { pathHasPrefix } from '../../../shared/lib/router/utils/path-has-prefix'\nimport { normalizeLocalePath } from '../../../shared/lib/i18n/normalize-locale-path'\nimport { removePathPrefix } from '../../../shared/lib/router/utils/remove-path-prefix'\nimport { getMiddlewareRouteMatcher } from '../../../shared/lib/router/utils/middleware-route-matcher'\nimport {\n APP_PATH_ROUTES_MANIFEST,\n BUILD_ID_FILE,\n FUNCTIONS_CONFIG_MANIFEST,\n MIDDLEWARE_MANIFEST,\n PAGES_MANIFEST,\n PRERENDER_MANIFEST,\n ROUTES_MANIFEST,\n} from '../../../shared/lib/constants'\nimport { normalizePathSep } from '../../../shared/lib/page-path/normalize-path-sep'\nimport { normalizeMetadataRoute } from '../../../lib/metadata/get-metadata-route'\nimport { RSCPathnameNormalizer } from '../../normalizers/request/rsc'\nimport { encodeURIPath } from '../../../shared/lib/encode-uri-path'\nimport { isMetadataRouteFile } from '../../../lib/metadata/is-metadata-route'\n\nexport type FsOutput = {\n type:\n | 'appFile'\n | 'pageFile'\n | 'nextImage'\n | 'publicFolder'\n | 'nextStaticFolder'\n | 'legacyStaticFolder'\n | 'serviceWorker'\n | 'devVirtualFsItem'\n\n itemPath: string\n fsPath?: string\n itemsRoot?: string\n locale?: string\n}\n\nconst debug = setupDebug('next:router-server:filesystem')\n\nexport type FilesystemDynamicRoute = ManifestRoute & {\n /**\n * The path matcher that can be used to match paths against this route.\n */\n match: PatchMatcher\n}\n\nexport const buildCustomRoute = <T>(\n type: 'redirect' | 'header' | 'rewrite' | 'before_files_rewrite',\n item: T & { source: string },\n basePath?: string,\n caseSensitive?: boolean\n): T & { match: PatchMatcher; check?: boolean; regex: string } => {\n const restrictedRedirectPaths = ['/_next'].map((p) =>\n basePath ? `${basePath}${p}` : p\n )\n let builtRegex = ''\n const match = getPathMatch(item.source, {\n strict: true,\n removeUnnamedParams: true,\n regexModifier: (regex: string) => {\n if (!(item as any).internal) {\n regex = modifyRouteRegex(\n regex,\n type === 'redirect' ? restrictedRedirectPaths : undefined\n )\n }\n builtRegex = regex\n return builtRegex\n },\n sensitive: caseSensitive,\n })\n\n return {\n ...item,\n regex: builtRegex,\n ...(type === 'rewrite' ? { check: true } : {}),\n match,\n }\n}\n\nexport async function setupFsCheck(opts: {\n dir: string\n dev: boolean\n minimalMode?: boolean\n config: NextConfigRuntime\n}) {\n const getItemsLru = !opts.dev\n ? new LRUCache<FsOutput | null>(1024 * 1024, function length(value) {\n if (!value) {\n // Null entries (negative cache) still need a non-zero size for LRU eviction\n return 1\n }\n return (\n (value.fsPath || '').length +\n value.itemPath.length +\n value.type.length\n )\n })\n : undefined\n\n // routes that have _next/data endpoints (SSG/SSP)\n const nextDataRoutes = new Set<string>()\n const publicFolderItems = new Set<string>()\n const nextStaticFolderItems = new Set<string>()\n const legacyStaticFolderItems = new Set<string>()\n const serviceWorkerItems = new Set<string>()\n\n const appFiles = new Set<string>()\n const pageFiles = new Set<string>()\n // Map normalized path to the file path. This is essential\n // for parallel and group routes as their original path\n // cannot be restored from the request path.\n // Example:\n // [normalized-path] -> [file-path]\n // /icon-<hash>.png -> .../app/@parallel/icon.png\n // /icon-<hash>.png -> .../app/(group)/icon.png\n // /icon.png -> .../app/icon.png\n const staticMetadataFiles = new Map<string, string>()\n let dynamicRoutes: FilesystemDynamicRoute[] = []\n\n let middlewareMatcher:\n | ReturnType<typeof getMiddlewareRouteMatcher>\n | undefined = () => false\n\n const distDir = path.join(opts.dir, opts.config.distDir)\n const publicFolderPath = path.join(opts.dir, 'public')\n const nextStaticFolderPath = path.join(distDir, 'static')\n const legacyStaticFolderPath = path.join(opts.dir, 'static')\n const serviceWorkerFolderPath = path.join(distDir, 'service-worker')\n let customRoutes: UnwrapPromise<ReturnType<typeof loadCustomRoutes>> = {\n redirects: [],\n rewrites: {\n beforeFiles: [],\n afterFiles: [],\n fallback: [],\n },\n onMatchHeaders: [],\n headers: [],\n }\n let buildId = 'development'\n let previewProps: __ApiPreviewProps\n\n if (!opts.dev) {\n const buildIdPath = path.join(opts.dir, opts.config.distDir, BUILD_ID_FILE)\n try {\n buildId = await fs.readFile(buildIdPath, 'utf8')\n } catch (err: any) {\n if (err.code !== 'ENOENT') throw err\n throw new Error(\n `Could not find a production build in the '${opts.config.distDir}' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id`\n )\n }\n\n try {\n for (const file of await recursiveReadDir(publicFolderPath)) {\n // Ensure filename is encoded and normalized.\n publicFolderItems.add(encodeURIPath(normalizePathSep(file)))\n }\n } catch (err: any) {\n if (err.code !== 'ENOENT') {\n throw err\n }\n }\n\n try {\n for (const file of await recursiveReadDir(legacyStaticFolderPath)) {\n // Ensure filename is encoded and normalized.\n legacyStaticFolderItems.add(encodeURIPath(normalizePathSep(file)))\n }\n Log.warn(\n `The static directory has been deprecated in favor of the public directory. https://nextjs.org/docs/messages/static-dir-deprecated`\n )\n } catch (err: any) {\n if (err.code !== 'ENOENT') {\n throw err\n }\n }\n\n try {\n for (const file of await recursiveReadDir(nextStaticFolderPath)) {\n // Ensure filename is encoded and normalized.\n nextStaticFolderItems.add(\n path.posix.join(\n '/_next/static',\n encodeURIPath(normalizePathSep(file))\n )\n )\n }\n } catch (err) {\n if (opts.config.output !== 'standalone') throw err\n }\n\n try {\n for (const file of await recursiveReadDir(serviceWorkerFolderPath)) {\n serviceWorkerItems.add(encodeURIPath(normalizePathSep(file)))\n }\n } catch (err: any) {\n if (err.code !== 'ENOENT') {\n throw err\n }\n }\n\n const routesManifestPath = path.join(distDir, ROUTES_MANIFEST)\n const prerenderManifestPath = path.join(distDir, PRERENDER_MANIFEST)\n const middlewareManifestPath = path.join(\n distDir,\n 'server',\n MIDDLEWARE_MANIFEST\n )\n const functionsConfigManifestPath = path.join(\n distDir,\n 'server',\n FUNCTIONS_CONFIG_MANIFEST\n )\n const pagesManifestPath = path.join(distDir, 'server', PAGES_MANIFEST)\n const appRoutesManifestPath = path.join(distDir, APP_PATH_ROUTES_MANIFEST)\n\n const routesManifest = JSON.parse(\n await fs.readFile(routesManifestPath, 'utf8')\n ) as RoutesManifest\n\n previewProps = (\n JSON.parse(\n await fs.readFile(prerenderManifestPath, 'utf8')\n ) as PrerenderManifest\n ).preview\n\n const middlewareManifest = JSON.parse(\n await fs.readFile(middlewareManifestPath, 'utf8').catch(() => '{}')\n ) as MiddlewareManifest\n\n const functionsConfigManifest = JSON.parse(\n await fs.readFile(functionsConfigManifestPath, 'utf8').catch(() => '{}')\n ) as FunctionsConfigManifest\n\n const pagesManifest = JSON.parse(\n await fs.readFile(pagesManifestPath, 'utf8')\n )\n const appRoutesManifest = JSON.parse(\n await fs.readFile(appRoutesManifestPath, 'utf8').catch(() => '{}')\n )\n\n for (const key of Object.keys(pagesManifest)) {\n // ensure the non-locale version is in the set\n if (opts.config.i18n) {\n pageFiles.add(\n normalizeLocalePath(key, opts.config.i18n.locales).pathname\n )\n } else {\n pageFiles.add(key)\n }\n }\n for (const key of Object.keys(appRoutesManifest)) {\n appFiles.add(appRoutesManifest[key])\n }\n\n const escapedBuildId = escapeStringRegexp(buildId)\n\n for (const route of routesManifest.dataRoutes) {\n if (isDynamicRoute(route.page)) {\n const routeRegex = getNamedRouteRegex(route.page, {\n prefixRouteKeys: true,\n })\n dynamicRoutes.push({\n ...route,\n regex: routeRegex.re.toString(),\n namedRegex: routeRegex.namedRegex,\n routeKeys: routeRegex.routeKeys,\n match: getRouteMatcher({\n // TODO: fix this in the manifest itself, must also be fixed in\n // upstream builder that relies on this\n re: opts.config.i18n\n ? new RegExp(\n route.dataRouteRegex.replace(\n `/${escapedBuildId}/`,\n `/${escapedBuildId}/(?<nextLocale>[^/]+?)/`\n )\n )\n : new RegExp(route.dataRouteRegex),\n groups: routeRegex.groups,\n }),\n })\n }\n nextDataRoutes.add(route.page)\n }\n\n for (const route of routesManifest.dynamicRoutes) {\n // If a route is marked as skipInternalRouting, it's not for the internal\n // router, and instead has been added to support external routers.\n if (route.skipInternalRouting) {\n continue\n }\n\n dynamicRoutes.push({\n ...route,\n match: getRouteMatcher(getRouteRegex(route.page)),\n })\n }\n\n if (middlewareManifest.middleware?.['/']?.matchers) {\n middlewareMatcher = getMiddlewareRouteMatcher(\n middlewareManifest.middleware?.['/']?.matchers\n )\n } else if (functionsConfigManifest?.functions['/_middleware']) {\n middlewareMatcher = getMiddlewareRouteMatcher(\n functionsConfigManifest.functions['/_middleware'].matchers ?? [\n { regexp: '.*', originalSource: '/:path*' },\n ]\n )\n }\n\n customRoutes = {\n redirects: routesManifest.redirects,\n rewrites: routesManifest.rewrites\n ? Array.isArray(routesManifest.rewrites)\n ? {\n beforeFiles: [],\n afterFiles: routesManifest.rewrites,\n fallback: [],\n }\n : routesManifest.rewrites\n : {\n beforeFiles: [],\n afterFiles: [],\n fallback: [],\n },\n headers: routesManifest.headers,\n onMatchHeaders: routesManifest.onMatchHeaders,\n }\n } else {\n // dev handling\n customRoutes = await loadCustomRoutes(opts.config)\n\n previewProps = {\n previewModeId: (require('crypto') as typeof import('crypto'))\n .randomBytes(16)\n .toString('hex'),\n previewModeSigningKey: (require('crypto') as typeof import('crypto'))\n .randomBytes(32)\n .toString('hex'),\n previewModeEncryptionKey: (require('crypto') as typeof import('crypto'))\n .randomBytes(32)\n .toString('hex'),\n }\n }\n\n const headers = customRoutes.headers.map((item) =>\n buildCustomRoute(\n 'header',\n item,\n opts.config.basePath,\n opts.config.experimental.caseSensitiveRoutes\n )\n )\n const onMatchHeaders = customRoutes.onMatchHeaders.map((item) =>\n buildCustomRoute(\n 'header',\n item,\n opts.config.basePath,\n opts.config.experimental.caseSensitiveRoutes\n )\n )\n const redirects = customRoutes.redirects.map((item) =>\n buildCustomRoute(\n 'redirect',\n item,\n opts.config.basePath,\n opts.config.experimental.caseSensitiveRoutes\n )\n )\n const rewrites = {\n beforeFiles: customRoutes.rewrites.beforeFiles.map((item) =>\n buildCustomRoute('before_files_rewrite', item)\n ),\n afterFiles: customRoutes.rewrites.afterFiles.map((item) =>\n buildCustomRoute(\n 'rewrite',\n item,\n opts.config.basePath,\n opts.config.experimental.caseSensitiveRoutes\n )\n ),\n fallback: customRoutes.rewrites.fallback.map((item) =>\n buildCustomRoute(\n 'rewrite',\n item,\n opts.config.basePath,\n opts.config.experimental.caseSensitiveRoutes\n )\n ),\n }\n\n const { i18n } = opts.config\n\n const handleLocale = (pathname: string, locales?: string[]) => {\n let locale: string | undefined\n\n if (i18n) {\n const i18nResult = normalizeLocalePath(pathname, locales || i18n.locales)\n\n pathname = i18nResult.pathname\n locale = i18nResult.detectedLocale\n }\n return { locale, pathname }\n }\n\n debug('nextDataRoutes', nextDataRoutes)\n debug('dynamicRoutes', dynamicRoutes)\n debug('customRoutes', customRoutes)\n debug('publicFolderItems', publicFolderItems)\n debug('nextStaticFolderItems', nextStaticFolderItems)\n debug('serviceWorkerItems', serviceWorkerItems)\n debug('pageFiles', pageFiles)\n debug('appFiles', appFiles)\n\n let ensureFn: (item: FsOutput) => Promise<void> | undefined\n\n const normalizers = {\n // Because we can't know if the app directory is enabled or not at this\n // stage, we assume that it is.\n rsc: new RSCPathnameNormalizer(),\n }\n\n return {\n headers,\n onMatchHeaders,\n rewrites,\n redirects,\n\n buildId,\n handleLocale,\n\n appFiles,\n pageFiles,\n staticMetadataFiles,\n dynamicRoutes,\n nextDataRoutes,\n\n exportPathMapRoutes: undefined as\n | undefined\n | ReturnType<typeof buildCustomRoute<Rewrite>>[],\n\n devVirtualFsItems: new Set<string>(),\n\n previewProps,\n middlewareMatcher: middlewareMatcher as MiddlewareRouteMatch | undefined,\n\n ensureCallback(fn: typeof ensureFn) {\n ensureFn = fn\n },\n\n async getItem(itemPath: string): Promise<FsOutput | null> {\n const originalItemPath = itemPath\n const itemKey = originalItemPath\n const lruResult = getItemsLru?.get(itemKey)\n\n if (lruResult) {\n return lruResult\n }\n\n const { basePath } = opts.config\n\n const hasBasePath = pathHasPrefix(itemPath, basePath)\n\n // Return null if path doesn't start with basePath\n if (basePath && !hasBasePath) {\n return null\n }\n\n // Remove basePath if it exists.\n if (basePath && hasBasePath) {\n itemPath = removePathPrefix(itemPath, basePath) || '/'\n }\n\n // Simulate minimal mode requests by normalizing RSC and postponed\n // requests.\n if (opts.minimalMode) {\n if (normalizers.rsc.match(itemPath)) {\n itemPath = normalizers.rsc.normalize(itemPath, true)\n }\n }\n\n if (itemPath !== '/' && itemPath.endsWith('/')) {\n itemPath = itemPath.substring(0, itemPath.length - 1)\n }\n\n let decodedItemPath = itemPath\n\n try {\n decodedItemPath = decodeURIComponent(itemPath)\n } catch {}\n\n if (itemPath === '/_next/image') {\n return {\n itemPath,\n type: 'nextImage',\n }\n }\n\n if (opts.dev && isMetadataRouteFile(itemPath, [], false)) {\n const fsPath = staticMetadataFiles.get(itemPath)\n if (fsPath) {\n return {\n // \"nextStaticFolder\" sets Cache-Control \"no-store\" on dev.\n type: 'nextStaticFolder',\n fsPath,\n itemPath: fsPath,\n }\n }\n }\n\n const itemsToCheck: Array<[Set<string>, FsOutput['type']]> = [\n [this.devVirtualFsItems, 'devVirtualFsItem'],\n [serviceWorkerItems, 'serviceWorker'],\n [nextStaticFolderItems, 'nextStaticFolder'],\n [legacyStaticFolderItems, 'legacyStaticFolder'],\n [publicFolderItems, 'publicFolder'],\n [appFiles, 'appFile'],\n [pageFiles, 'pageFile'],\n ]\n\n for (let [items, type] of itemsToCheck) {\n let locale: string | undefined\n let curItemPath = itemPath\n let curDecodedItemPath = decodedItemPath\n\n const isDynamicOutput = type === 'pageFile' || type === 'appFile'\n\n if (i18n) {\n const localeResult = handleLocale(\n itemPath,\n // legacy behavior allows visiting static assets under\n // default locale but no other locale\n isDynamicOutput\n ? undefined\n : [\n i18n?.defaultLocale,\n // default locales from domains need to be matched too\n ...(i18n.domains?.map((item) => item.defaultLocale) || []),\n ]\n )\n\n if (localeResult.pathname !== curItemPath) {\n curItemPath = localeResult.pathname\n locale = localeResult.locale\n\n try {\n curDecodedItemPath = decodeURIComponent(curItemPath)\n } catch {}\n }\n }\n\n if (type === 'legacyStaticFolder') {\n if (!pathHasPrefix(curItemPath, '/static')) {\n continue\n }\n curItemPath = curItemPath.substring('/static'.length)\n\n try {\n curDecodedItemPath = decodeURIComponent(curItemPath)\n } catch {}\n }\n\n if (\n type === 'nextStaticFolder' &&\n !pathHasPrefix(curItemPath, '/_next/static')\n ) {\n continue\n }\n\n const nextDataPrefix = `/_next/data/${buildId}/`\n\n if (\n type === 'pageFile' &&\n curItemPath.startsWith(nextDataPrefix) &&\n curItemPath.endsWith('.json')\n ) {\n items = nextDataRoutes\n // remove _next/data/<build-id> prefix\n curItemPath = curItemPath.substring(nextDataPrefix.length - 1)\n\n // remove .json postfix\n curItemPath = curItemPath.substring(\n 0,\n curItemPath.length - '.json'.length\n )\n const curLocaleResult = handleLocale(curItemPath)\n curItemPath =\n curLocaleResult.pathname === '/index'\n ? '/'\n : curLocaleResult.pathname\n\n locale = curLocaleResult.locale\n\n try {\n curDecodedItemPath = decodeURIComponent(curItemPath)\n } catch {}\n }\n\n let matchedItem = items.has(curItemPath)\n\n // check decoded variant as well\n if (!matchedItem && !opts.dev) {\n matchedItem = items.has(curDecodedItemPath)\n if (matchedItem) curItemPath = curDecodedItemPath\n else {\n // x-ref: https://github.com/vercel/next.js/issues/54008\n // There're cases that urls get decoded before requests, we should support both encoded and decoded ones.\n // e.g. nginx could decode the proxy urls, the below ones should be treated as the same:\n // decoded version: `/_next/static/chunks/pages/blog/[slug]-d4858831b91b69f6.js`\n // encoded version: `/_next/static/chunks/pages/blog/%5Bslug%5D-d4858831b91b69f6.js`\n try {\n // encode the special characters in the path and retrieve again to determine if path exists.\n const encodedCurItemPath = encodeURIPath(curItemPath)\n matchedItem = items.has(encodedCurItemPath)\n } catch {}\n }\n }\n\n if (matchedItem || opts.dev) {\n let fsPath: string | undefined\n let itemsRoot: string | undefined\n\n switch (type) {\n case 'nextStaticFolder': {\n itemsRoot = nextStaticFolderPath\n curItemPath = curItemPath.substring('/_next/static'.length)\n break\n }\n case 'legacyStaticFolder': {\n itemsRoot = legacyStaticFolderPath\n break\n }\n case 'publicFolder': {\n itemsRoot = publicFolderPath\n break\n }\n case 'serviceWorker': {\n itemsRoot = serviceWorkerFolderPath\n break\n }\n case 'appFile':\n case 'pageFile':\n case 'nextImage':\n case 'devVirtualFsItem': {\n break\n }\n default: {\n ;(type) satisfies never\n }\n }\n\n if (itemsRoot && curItemPath) {\n fsPath = path.posix.join(itemsRoot, curItemPath)\n }\n\n // dynamically check fs in development so we don't\n // have to wait on the watcher\n if (!matchedItem && opts.dev) {\n const isStaticAsset = (\n [\n 'nextStaticFolder',\n 'publicFolder',\n 'legacyStaticFolder',\n 'serviceWorker',\n ] as (typeof type)[]\n ).includes(type)\n\n if (isStaticAsset && itemsRoot) {\n let found = fsPath && (await fileExists(fsPath, FileType.File))\n\n if (!found) {\n try {\n // In dev, we ensure encoded paths match\n // decoded paths on the filesystem so check\n // that variation as well\n const tempItemPath = decodeURIComponent(curItemPath)\n fsPath = path.posix.join(itemsRoot, tempItemPath)\n found = await fileExists(fsPath, FileType.File)\n } catch {}\n\n if (!found) {\n continue\n }\n }\n } else if (type === 'pageFile' || type === 'appFile') {\n const isAppFile = type === 'appFile'\n\n // Attempt to ensure the page/app file is compiled and ready\n if (ensureFn) {\n const ensureItemPath = isAppFile\n ? normalizeMetadataRoute(curItemPath)\n : curItemPath\n\n try {\n await ensureFn({ type, itemPath: ensureItemPath })\n } catch (error) {\n // If ensure failed, skip this item and continue to the next one\n continue\n }\n }\n } else {\n continue\n }\n }\n\n // i18n locales aren't matched for app dir\n if (type === 'appFile' && locale && locale !== i18n?.defaultLocale) {\n continue\n }\n\n const itemResult = {\n type,\n fsPath,\n locale,\n itemsRoot,\n itemPath: curItemPath,\n }\n\n getItemsLru?.set(itemKey, itemResult)\n return itemResult\n }\n }\n\n getItemsLru?.set(itemKey, null)\n return null\n },\n getDynamicRoutes() {\n // this should include data routes\n return this.dynamicRoutes\n },\n getMiddlewareMatchers() {\n return this.middlewareMatcher\n },\n }\n}\n"],"names":["path","fs","Log","setupDebug","LRUCache","loadCustomRoutes","modifyRouteRegex","FileType","fileExists","recursiveReadDir","isDynamicRoute","escapeStringRegexp","getPathMatch","getNamedRouteRegex","getRouteRegex","getRouteMatcher","pathHasPrefix","normalizeLocalePath","removePathPrefix","getMiddlewareRouteMatcher","APP_PATH_ROUTES_MANIFEST","BUILD_ID_FILE","FUNCTIONS_CONFIG_MANIFEST","MIDDLEWARE_MANIFEST","PAGES_MANIFEST","PRERENDER_MANIFEST","ROUTES_MANIFEST","normalizePathSep","normalizeMetadataRoute","RSCPathnameNormalizer","encodeURIPath","isMetadataRouteFile","debug","buildCustomRoute","type","item","basePath","caseSensitive","restrictedRedirectPaths","map","p","builtRegex","match","source","strict","removeUnnamedParams","regexModifier","regex","internal","undefined","sensitive","check","setupFsCheck","opts","getItemsLru","dev","length","value","fsPath","itemPath","nextDataRoutes","Set","publicFolderItems","nextStaticFolderItems","legacyStaticFolderItems","serviceWorkerItems","appFiles","pageFiles","staticMetadataFiles","Map","dynamicRoutes","middlewareMatcher","distDir","join","dir","config","publicFolderPath","nextStaticFolderPath","legacyStaticFolderPath","serviceWorkerFolderPath","customRoutes","redirects","rewrites","beforeFiles","afterFiles","fallback","onMatchHeaders","headers","buildId","previewProps","middlewareManifest","buildIdPath","readFile","err","code","Error","file","add","warn","posix","output","routesManifestPath","prerenderManifestPath","middlewareManifestPath","functionsConfigManifestPath","pagesManifestPath","appRoutesManifestPath","routesManifest","JSON","parse","preview","catch","functionsConfigManifest","pagesManifest","appRoutesManifest","key","Object","keys","i18n","locales","pathname","escapedBuildId","route","dataRoutes","page","routeRegex","prefixRouteKeys","push","re","toString","namedRegex","routeKeys","RegExp","dataRouteRegex","replace","groups","skipInternalRouting","middleware","matchers","functions","regexp","originalSource","Array","isArray","previewModeId","require","randomBytes","previewModeSigningKey","previewModeEncryptionKey","experimental","caseSensitiveRoutes","handleLocale","locale","i18nResult","detectedLocale","ensureFn","normalizers","rsc","exportPathMapRoutes","devVirtualFsItems","ensureCallback","fn","getItem","originalItemPath","itemKey","lruResult","get","hasBasePath","minimalMode","normalize","endsWith","substring","decodedItemPath","decodeURIComponent","itemsToCheck","items","curItemPath","curDecodedItemPath","isDynamicOutput","localeResult","defaultLocale","domains","nextDataPrefix","startsWith","curLocaleResult","matchedItem","has","encodedCurItemPath","itemsRoot","isStaticAsset","includes","found","File","tempItemPath","isAppFile","ensureItemPath","error","itemResult","set","getDynamicRoutes","getMiddlewareMatchers"],"mappings":"AAaA,OAAOA,UAAU,OAAM;AACvB,OAAOC,QAAQ,cAAa;AAC5B,YAAYC,SAAS,4BAA2B;AAChD,OAAOC,gBAAgB,2BAA0B;AACjD,SAASC,QAAQ,QAAQ,eAAc;AACvC,OAAOC,sBAAwC,kCAAiC;AAChF,SAASC,gBAAgB,QAAQ,+BAA8B;AAC/D,SAASC,QAAQ,EAAEC,UAAU,QAAQ,2BAA0B;AAC/D,SAASC,gBAAgB,QAAQ,iCAAgC;AACjE,SAASC,cAAc,QAAQ,mCAAkC;AACjE,SAASC,kBAAkB,QAAQ,oCAAmC;AACtE,SAASC,YAAY,QAAQ,8CAA6C;AAC1E,SACEC,kBAAkB,EAClBC,aAAa,QACR,+CAA8C;AACrD,SAASC,eAAe,QAAQ,iDAAgD;AAChF,SAASC,aAAa,QAAQ,mDAAkD;AAChF,SAASC,mBAAmB,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C1C,IAAIlK,SAAS,aAAasH,UAAUA,YAAWlC,wBAAAA,KAAM8D,aAAa,GAAE;wBAClE;oBACF;oBAEA,MAAMiB,aAAa;wBACjBnK;wBACAwB;wBACA8F;wBACAoC;wBACAjI,UAAUqH;oBACZ;oBAEA1H,+BAAAA,YAAagJ,GAAG,CAAClC,SAASiC;oBAC1B,OAAOA;gBACT;YACF;YAEA/I,+BAAAA,YAAagJ,GAAG,CAAClC,SAAS;YAC1B,OAAO;QACT;QACAmC;YACE,kCAAkC;YAClC,OAAO,IAAI,CAACjI,aAAa;QAC3B;QACAkI;YACE,OAAO,IAAI,CAACjI,iBAAiB;QAC/B;IACF;AACF","ignoreList":[0]} |
@@ -112,3 +112,3 @@ // Start CPU profile if it wasn't already started. | ||
| let { port } = serverOptions; | ||
| process.title = `next-server (v${"16.3.0-preview.4"})`; | ||
| process.title = `next-server (v${"16.3.0-preview.5"})`; | ||
| let handlersReady = ()=>{}; | ||
@@ -115,0 +115,0 @@ let handlersError = ()=>{}; |
| import { Readable } from 'node:stream'; | ||
| import { createHash } from 'node:crypto'; | ||
| import { InvariantError } from '../../shared/lib/invariant-error'; | ||
@@ -79,2 +80,3 @@ import { workAsyncStorage } from '../app-render/work-async-storage.external'; | ||
| } | ||
| const [element, options] = args; | ||
| // `createHangingInputAbortSignal` aborts once the prerender's cache-sourced | ||
@@ -135,3 +137,7 @@ // input is ready, so anything the serialization below is still awaiting past | ||
| try { | ||
| const { prelude } = await prerenderToNodeStream(args, clientModules, { | ||
| // We serialize only the `element`. It's the part that needs Flight, to run | ||
| // its async Server Components once and to surface any dynamic input. The | ||
| // `options` are already-resolved plain data; they're folded into the cache | ||
| // key directly and passed to satori as-is below. | ||
| const { prelude } = await prerenderToNodeStream(element, clientModules, { | ||
| signal: hangingInputAbortSignal, | ||
@@ -167,6 +173,14 @@ filterStackFrame: undefined, | ||
| } | ||
| const buffer = Buffer.concat(chunks); | ||
| // Base64-encode the serialized output to use it as a stable string key | ||
| // (the Flight stream is binary, so it isn't safe to treat as UTF-8 text). | ||
| const cacheKey = buffer.toString('base64'); | ||
| const elementBuffer = Buffer.concat(chunks); | ||
| // Derive a stable cache key from the serialized element plus the options. | ||
| // We hash rather than reuse the raw serialized bytes so the key stays | ||
| // compact even for large inputs (e.g. embedded fonts), and we fold the | ||
| // options in by content so two images that differ only in their options | ||
| // (size, fonts, ...) don't collide. The options are hashed directly here, | ||
| // never serialized through Flight, which would both bloat the key and apply | ||
| // `Buffer.prototype .toJSON` to font data. | ||
| const hash = createHash('sha256'); | ||
| hash.update(elementBuffer); | ||
| updateHashWithOptions(hash, options); | ||
| const cacheKey = hash.digest('base64'); | ||
| const cached = resumeDataCache.imageResponses.get(cacheKey); | ||
@@ -176,14 +190,8 @@ if (cached) { | ||
| } | ||
| // Deserialize the resolved tree and hand it to satori. Because the user's | ||
| // Deserialize the element and hand it to satori. Because the user's | ||
| // components already ran during serialization, satori only walks resolved | ||
| // host elements and never re-runs them, confining user-space I/O to the | ||
| // in-store serialization above. | ||
| // | ||
| // The Flight client hands back the output of an async Server Component as | ||
| // a `React.lazy` (sync components and plain host elements are inlined). | ||
| // satori can't unwrap lazies, so we resolve them into plain elements first. | ||
| // We only reach here once the serialization completed, so every lazy is | ||
| // already resolved and `_init` returns synchronously. | ||
| const resolvedArgs = resolveFlightLazies(await createFromNodeStream(Readable.from([ | ||
| buffer | ||
| const deserializedElement = await createFromNodeStream(Readable.from([ | ||
| elementBuffer | ||
| ]), { | ||
@@ -196,3 +204,19 @@ // We don't want to trigger preloads of client references here. | ||
| findSourceMapURL: undefined | ||
| })); | ||
| }); | ||
| // The Flight client hands back the output of an async Server Component as | ||
| // a `React.lazy` (sync components and plain host elements are inlined). | ||
| // satori can't unwrap lazies, so we resolve them into plain elements first. | ||
| // We only reach here once the serialization completed, so every lazy is | ||
| // already resolved and `_init` returns synchronously. | ||
| const resolvedElement = resolveFlightLazies(deserializedElement); | ||
| // Pair the resolved element with the original, in-memory `options`, which | ||
| // never went through Flight. This keeps the font `Buffer` intact: had it | ||
| // been serialized, Flight would apply the `toJSON` method that Node's | ||
| // `Buffer` carries, turning it into a `{ type: 'Buffer', data: [...] }` | ||
| // object that satori's font parser rejects (it needs an `ArrayBuffer` or a | ||
| // typed array). | ||
| const resolvedArgs = [ | ||
| resolvedElement, | ||
| options | ||
| ]; | ||
| // Render satori outside the prerender work-unit store. It does uncached | ||
@@ -212,2 +236,77 @@ // `fetch` calls (e.g. loading a font), and inside a Cache Components | ||
| } | ||
| /** | ||
| * Updates a hash with a stable encoding of the `ImageResponse` options so they | ||
| * can participate in the cache key without being serialized through Flight. | ||
| * Binary values (font `Buffer`s, `ArrayBuffer`s, typed arrays) are hashed by | ||
| * their raw bytes; objects are walked in sorted-key order. | ||
| * | ||
| * `ImageResponse` options are plain data: numbers, strings, booleans, nested | ||
| * plain objects/arrays, and binary font data. Exotic objects such as `Map` or | ||
| * `Date` keep their state outside their enumerable own keys, so the key walk | ||
| * below would hash them incorrectly. Options never contain these, but we warn | ||
| * if one ever shows up so a mis-keyed cache can be reported. | ||
| * | ||
| * The encoding is self-delimiting: every node starts with a type tag, and | ||
| * variable-length parts (byte runs, primitives, keys) are length-prefixed, | ||
| * while arrays and objects are count-prefixed. This makes it injective, so no | ||
| * concatenation of values can be mistaken for a differently shaped input. | ||
| */ function updateHashWithOptions(hash, value) { | ||
| if (value === undefined) { | ||
| hash.update('u'); | ||
| return; | ||
| } | ||
| if (value === null) { | ||
| hash.update('n'); | ||
| return; | ||
| } | ||
| const type = typeof value; | ||
| if (type !== 'object') { | ||
| // Tag with the primitive type so e.g. the number `1` and the string `'1'` | ||
| // don't hash the same. | ||
| updateHashWithBytes(hash, 'p', Buffer.from(`${type}:${String(value)}`)); | ||
| return; | ||
| } | ||
| if (value instanceof ArrayBuffer) { | ||
| updateHashWithBytes(hash, 'a', new Uint8Array(value)); | ||
| return; | ||
| } | ||
| if (ArrayBuffer.isView(value)) { | ||
| updateHashWithBytes(hash, 'v', new Uint8Array(value.buffer, value.byteOffset, value.byteLength)); | ||
| return; | ||
| } | ||
| if (Array.isArray(value)) { | ||
| hash.update(`[${value.length},`); | ||
| for (const item of value){ | ||
| updateHashWithOptions(hash, item); | ||
| } | ||
| return; | ||
| } | ||
| // The key walk below captures a plain object faithfully, but an exotic object | ||
| // keeps its state elsewhere (a `Map`'s/`Set`'s entries, a `Date`'s time), so | ||
| // two different values would hash the same and could return the wrong cached | ||
| // image. This shouldn't happen for `ImageResponse` options, so we warn rather | ||
| // than fail, then hash best-effort, so it can be reported. Not gated on | ||
| // `NODE_ENV`: this runs during the production `next build` prerender, where | ||
| // the warning is most useful. | ||
| const prototype = Object.getPrototypeOf(value); | ||
| if (prototype !== Object.prototype && prototype !== null) { | ||
| var _value_constructor; | ||
| const typeName = ((_value_constructor = value.constructor) == null ? void 0 : _value_constructor.name) ?? 'object'; | ||
| console.warn(`Cannot reliably include an \`ImageResponse\` option of type ` + `\`${typeName}\` in the cache key, so different images may collide and ` + `return an incorrect cached result. Please report this to the Next.js ` + `team.`); | ||
| } | ||
| const keys = Object.keys(value).sort(); | ||
| hash.update(`{${keys.length},`); | ||
| for (const key of keys){ | ||
| updateHashWithBytes(hash, 'k', Buffer.from(key)); | ||
| updateHashWithOptions(hash, value[key]); | ||
| } | ||
| } | ||
| /** | ||
| * Hashes a length-prefixed, tagged byte run: `<tag><byteLength>:<bytes>`. The | ||
| * length prefix keeps the run self-delimiting so it can't blend into adjacent | ||
| * nodes. | ||
| */ function updateHashWithBytes(hash, tag, bytes) { | ||
| hash.update(`${tag}${bytes.byteLength}:`); | ||
| hash.update(bytes); | ||
| } | ||
| async function renderImageResponseArrayBuffer(args) { | ||
@@ -214,0 +313,0 @@ const OGImageResponse = (await importOgModule()).ImageResponse; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/server/og/cache-image-response.ts"],"sourcesContent":["import { Readable } from 'node:stream'\n\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'\nimport { createHangingInputAbortSignal } from '../app-render/dynamic-rendering'\nimport { makeHangingPromise } from '../dynamic-rendering-utils'\nimport {\n getClientReferenceManifest,\n getServerModuleMap,\n} from '../app-render/manifests-singleton'\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport { prerenderToNodeStream } from 'react-server-dom-webpack/static'\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport { createFromNodeStream } from 'react-server-dom-webpack/client'\n\ntype OgModule = typeof import('next/dist/compiled/@vercel/og')\n\ntype ImageResponseArgs = ConstructorParameters<OgModule['ImageResponse']>\n\nfunction importOgModule(): Promise<OgModule> {\n // Cache Components is Node-only (rejected for the edge runtime at compile\n // time), so we always load the Node build. Loading it dynamically keeps the\n // heavy `@vercel/og` renderer (satori + WASM) off the module-load path, so\n // it's pulled in only when an image is actually rendered.\n return import('next/dist/compiled/@vercel/og/index.node.js')\n}\n\n/**\n * Builds the body for a Cache Components `ImageResponse`. The rendered image is\n * cached in the Resume Data Cache during a prerender, so the prospective\n * prerender renders it once and the final prerender retrieves it from memory\n * within microtasks. This lets metadata image routes be statically prerendered\n * under Cache Components instead of being treated as dynamic.\n *\n * The cache boundary is drawn around only the deterministic rasterization of\n * the element tree into an image. The `ImageResponse` element tree is rendered\n * with React Flight once, inside the prerender work-unit store, so any\n * user-space I/O (e.g. `cookies()` or an uncached `fetch`) runs in the correct\n * scope and is subject to the normal Cache Components rules. If that tree\n * needs dynamic input the serialization can't complete, and the route falls\n * back to dynamic. Otherwise the fully resolved tree is handed to satori,\n * which never re-runs the user's components.\n *\n * Outside of a prerender (normal requests) this just renders.\n */\nexport function getCachedImageResponseBody(\n args: ImageResponseArgs\n): ReadableStream<Uint8Array> {\n return new ReadableStream<Uint8Array>({\n async start(controller) {\n const arrayBuffer = await getCachedImageResponseArrayBuffer(args)\n if (arrayBuffer.byteLength > 0) {\n controller.enqueue(new Uint8Array(arrayBuffer))\n }\n controller.close()\n },\n })\n}\n\nasync function getCachedImageResponseArrayBuffer(\n args: ImageResponseArgs\n): Promise<ArrayBuffer> {\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n switch (workUnitStore?.type) {\n case 'prerender':\n // We only cache during a prerender. Metadata image routes compile to\n // route handlers, which use the `prerender` store.\n break\n case undefined:\n case 'request':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n case 'prerender-runtime':\n case 'prerender-client':\n case 'validation-client':\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'generate-static-params':\n return renderImageResponseArrayBuffer(args)\n default:\n return workUnitStore satisfies never\n }\n\n const { cacheSignal, resumeDataCache, renderSignal } = workUnitStore\n\n if (!resumeDataCache) {\n return renderImageResponseArrayBuffer(args)\n }\n\n const workStore = workAsyncStorage.getStore()\n\n if (!workStore) {\n throw new InvariantError(\n 'Expected a work store while caching an `ImageResponse` during prerendering.'\n )\n }\n\n // `createHangingInputAbortSignal` aborts once the prerender's cache-sourced\n // input is ready, so anything the serialization below is still awaiting past\n // that point can be treated as dynamic (non-cache) input. In the prospective\n // pass it aborts when `cacheSignal.inputReady()` resolves (no cache reads\n // in progress); in the final pass the caches are already filled, so it just\n // aborts on the next tick.\n const hangingInputAbortSignal = createHangingInputAbortSignal(workUnitStore)\n\n // We open the cache read lazily, once we know the serialization completed and\n // we're about to render and store the image. Opening it before serializing\n // would keep `cacheSignal.inputReady()` from resolving and thus prevent the\n // abort signal from ever firing, deadlocking the prospective prerender.\n let readState: 'ready' | 'pending' | 'done' = 'ready'\n\n function beginReadOnce() {\n if (readState === 'ready') {\n readState = 'pending'\n cacheSignal?.beginRead()\n }\n }\n\n function endReadIfStarted() {\n if (readState === 'pending') {\n cacheSignal?.endRead()\n }\n readState = 'done'\n }\n\n // We serialize the element tree with `prerenderToNodeStream` rather than\n // `renderToPipeableStream`. It's the right fit for prerendering, and it\n // schedules work deferred for size (`deferTask`) on microtasks, so a fully\n // static tree finishes flushing before the abort signal fires; a tree still\n // pending at abort time is then genuinely waiting on dynamic input rather\n // than just deferred.\n //\n // `renderToPipeableStream` would schedule that deferred work on\n // `setImmediate` instead, which isn't necessarily a deal-breaker: the\n // sequential-task scheme page rendering uses (`runInSequentialTasks`) drains\n // pending immediates at each task boundary, so deferred work still runs in\n // time. But route handler prerendering doesn't use that scheme, so here the\n // deferred immediates would race the abort.\n //\n // The prerender halts silently on abort, leaving unfulfilled references in\n // place rather than reporting through `onError`. So to tell a halt (the tree\n // needed dynamic input) apart from a normal completion, we record whether the\n // abort fired before the serialization finished. `abort()` runs this listener\n // synchronously, well before we read `resultIsPartial` below.\n let prerenderCompleted = false\n let resultIsPartial = false\n let serializationError: unknown\n\n hangingInputAbortSignal.addEventListener(\n 'abort',\n () => {\n if (!prerenderCompleted) {\n resultIsPartial = true\n }\n },\n { once: true }\n )\n\n const { clientModules, rscModuleMapping } = getClientReferenceManifest()\n\n try {\n const { prelude } = await prerenderToNodeStream(args, clientModules, {\n signal: hangingInputAbortSignal,\n filterStackFrame: undefined,\n onError(error) {\n // A halt (our deliberate abort) emits nothing, so this is only called\n // for genuine serialization errors. We surface the first one.\n if (serializationError === undefined && !resultIsPartial) {\n serializationError = error\n }\n },\n })\n\n prerenderCompleted = true\n\n if (serializationError !== undefined) {\n throw serializationError\n }\n\n if (resultIsPartial) {\n // The element tree needed dynamic input (e.g. `cookies()` or an uncached\n // `fetch`), so the image can't be produced statically. Return a hanging\n // promise: the body never resolves, and the final prerender's macrotask\n // budget then classifies the route as dynamic.\n return makeHangingPromise<ArrayBuffer>(\n renderSignal,\n workStore.route,\n 'dynamic `ImageResponse`'\n )\n }\n\n // The serialization finished before any dynamic input was needed, so we\n // will render and cache the image. Hold the cache read now, before the\n // stream is buffered and deserialized below, so that the prospective\n // prerender's `cacheReady()` waits for the image to be stored.\n beginReadOnce()\n\n const chunks: Buffer[] = []\n for await (const chunk of prelude) {\n chunks.push(chunk)\n }\n\n const buffer = Buffer.concat(chunks)\n // Base64-encode the serialized output to use it as a stable string key\n // (the Flight stream is binary, so it isn't safe to treat as UTF-8 text).\n const cacheKey = buffer.toString('base64')\n\n const cached = resumeDataCache.imageResponses.get(cacheKey)\n\n if (cached) {\n return await cached\n }\n\n // Deserialize the resolved tree and hand it to satori. Because the user's\n // components already ran during serialization, satori only walks resolved\n // host elements and never re-runs them, confining user-space I/O to the\n // in-store serialization above.\n //\n // The Flight client hands back the output of an async Server Component as\n // a `React.lazy` (sync components and plain host elements are inlined).\n // satori can't unwrap lazies, so we resolve them into plain elements first.\n // We only reach here once the serialization completed, so every lazy is\n // already resolved and `_init` returns synchronously.\n const resolvedArgs = resolveFlightLazies(\n await createFromNodeStream(\n Readable.from([buffer]),\n {\n // We don't want to trigger preloads of client references here.\n moduleLoading: null,\n moduleMap: rscModuleMapping,\n serverModuleMap: getServerModuleMap(),\n },\n { findSourceMapURL: undefined }\n )\n ) as ImageResponseArgs\n\n // Render satori outside the prerender work-unit store. It does uncached\n // `fetch` calls (e.g. loading a font), and inside a Cache Components\n // prerender an uncached `fetch` outside a cache scope becomes a hanging\n // promise. Those are framework fetches, not user I/O, so we let them\n // resolve normally with no store.\n const arrayBufferPromise = workUnitAsyncStorage.exit(() =>\n renderImageResponseArrayBuffer(resolvedArgs)\n )\n\n if (resumeDataCache.mutable) {\n resumeDataCache.imageResponses.set(cacheKey, arrayBufferPromise)\n }\n\n return await arrayBufferPromise\n } finally {\n endReadIfStarted()\n }\n}\n\nasync function renderImageResponseArrayBuffer(\n args: ImageResponseArgs\n): Promise<ArrayBuffer> {\n const OGImageResponse = (await importOgModule()).ImageResponse\n const imageResponse = new OGImageResponse(...args)\n\n if (!imageResponse.body) {\n return new ArrayBuffer(0)\n }\n\n return imageResponse.arrayBuffer()\n}\n\nconst REACT_LAZY_TYPE = Symbol.for('react.lazy')\n\n/**\n * Recursively replaces the `React.lazy` references that Flight emits for\n * resolved async Server Components with the elements they resolve to, so that\n * satori (which doesn't understand lazy nodes) can walk the tree. This must\n * only be called on a fully resolved (completed) Flight result, where each\n * lazy's `_init` returns synchronously rather than suspending.\n */\nfunction resolveFlightLazies(node: unknown): unknown {\n if (node === null || typeof node !== 'object') {\n return node\n }\n\n if ((node as { $$typeof?: symbol }).$$typeof === REACT_LAZY_TYPE) {\n const lazy = node as {\n _init: (payload: unknown) => unknown\n _payload: unknown\n }\n return resolveFlightLazies(lazy._init(lazy._payload))\n }\n\n if (Array.isArray(node)) {\n return node.map(resolveFlightLazies)\n }\n\n const element = node as { props?: { children?: unknown } }\n if (element.props && 'children' in element.props) {\n return {\n ...element,\n props: {\n ...element.props,\n children: resolveFlightLazies(element.props.children),\n },\n }\n }\n\n return node\n}\n"],"names":["Readable","InvariantError","workAsyncStorage","workUnitAsyncStorage","createHangingInputAbortSignal","makeHangingPromise","getClientReferenceManifest","getServerModuleMap","prerenderToNodeStream","createFromNodeStream","importOgModule","getCachedImageResponseBody","args","ReadableStream","start","controller","arrayBuffer","getCachedImageResponseArrayBuffer","byteLength","enqueue","Uint8Array","close","workUnitStore","getStore","type","undefined","renderImageResponseArrayBuffer","cacheSignal","resumeDataCache","renderSignal","workStore","hangingInputAbortSignal","readState","beginReadOnce","beginRead","endReadIfStarted","endRead","prerenderCompleted","resultIsPartial","serializationError","addEventListener","once","clientModules","rscModuleMapping","prelude","signal","filterStackFrame","onError","error","route","chunks","chunk","push","buffer","Buffer","concat","cacheKey","toString","cached","imageResponses","get","resolvedArgs","resolveFlightLazies","from","moduleLoading","moduleMap","serverModuleMap","findSourceMapURL","arrayBufferPromise","exit","mutable","set","OGImageResponse","ImageResponse","imageResponse","body","ArrayBuffer","REACT_LAZY_TYPE","Symbol","for","node","$$typeof","lazy","_init","_payload","Array","isArray","map","element","props","children"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAa;AAEtC,SAASC,cAAc,QAAQ,mCAAkC;AACjE,SAASC,gBAAgB,QAAQ,4CAA2C;AAC5E,SAASC,oBAAoB,QAAQ,iDAAgD;AACrF,SAASC,6BAA6B,QAAQ,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,WAAW;AAClC;AAEA,MAAM6D,kBAAkBC,OAAOC,GAAG,CAAC;AAEnC;;;;;;CAMC,GACD,SAASjB,oBAAoBkB,IAAa;IACxC,IAAIA,SAAS,QAAQ,OAAOA,SAAS,UAAU;QAC7C,OAAOA;IACT;IAEA,IAAI,AAACA,KAA+BC,QAAQ,KAAKJ,iBAAiB;QAChE,MAAMK,OAAOF;QAIb,OAAOlB,oBAAoBoB,KAAKC,KAAK,CAACD,KAAKE,QAAQ;IACrD;IAEA,IAAIC,MAAMC,OAAO,CAACN,OAAO;QACvB,OAAOA,KAAKO,GAAG,CAACzB;IAClB;IAEA,MAAM0B,UAAUR;IAChB,IAAIQ,QAAQC,KAAK,IAAI,cAAcD,QAAQC,KAAK,EAAE;QAChD,OAAO;YACL,GAAGD,OAAO;YACVC,OAAO;gBACL,GAAGD,QAAQC,KAAK;gBAChBC,UAAU5B,oBAAoB0B,QAAQC,KAAK,CAACC,QAAQ;YACtD;QACF;IACF;IAEA,OAAOV;AACT","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/server/og/cache-image-response.ts"],"sourcesContent":["import { Readable } from 'node:stream'\nimport { createHash, type Hash } from 'node:crypto'\n\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'\nimport { createHangingInputAbortSignal } from '../app-render/dynamic-rendering'\nimport { makeHangingPromise } from '../dynamic-rendering-utils'\nimport {\n getClientReferenceManifest,\n getServerModuleMap,\n} from '../app-render/manifests-singleton'\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport { prerenderToNodeStream } from 'react-server-dom-webpack/static'\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport { createFromNodeStream } from 'react-server-dom-webpack/client'\n\ntype OgModule = typeof import('next/dist/compiled/@vercel/og')\n\ntype ImageResponseArgs = ConstructorParameters<OgModule['ImageResponse']>\n\nfunction importOgModule(): Promise<OgModule> {\n // Cache Components is Node-only (rejected for the edge runtime at compile\n // time), so we always load the Node build. Loading it dynamically keeps the\n // heavy `@vercel/og` renderer (satori + WASM) off the module-load path, so\n // it's pulled in only when an image is actually rendered.\n return import('next/dist/compiled/@vercel/og/index.node.js')\n}\n\n/**\n * Builds the body for a Cache Components `ImageResponse`. The rendered image is\n * cached in the Resume Data Cache during a prerender, so the prospective\n * prerender renders it once and the final prerender retrieves it from memory\n * within microtasks. This lets metadata image routes be statically prerendered\n * under Cache Components instead of being treated as dynamic.\n *\n * The cache boundary is drawn around only the deterministic rasterization of\n * the element tree into an image. The `ImageResponse` element tree is rendered\n * with React Flight once, inside the prerender work-unit store, so any\n * user-space I/O (e.g. `cookies()` or an uncached `fetch`) runs in the correct\n * scope and is subject to the normal Cache Components rules. If that tree\n * needs dynamic input the serialization can't complete, and the route falls\n * back to dynamic. Otherwise the fully resolved tree is handed to satori,\n * which never re-runs the user's components.\n *\n * Outside of a prerender (normal requests) this just renders.\n */\nexport function getCachedImageResponseBody(\n args: ImageResponseArgs\n): ReadableStream<Uint8Array> {\n return new ReadableStream<Uint8Array>({\n async start(controller) {\n const arrayBuffer = await getCachedImageResponseArrayBuffer(args)\n if (arrayBuffer.byteLength > 0) {\n controller.enqueue(new Uint8Array(arrayBuffer))\n }\n controller.close()\n },\n })\n}\n\nasync function getCachedImageResponseArrayBuffer(\n args: ImageResponseArgs\n): Promise<ArrayBuffer> {\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n switch (workUnitStore?.type) {\n case 'prerender':\n // We only cache during a prerender. Metadata image routes compile to\n // route handlers, which use the `prerender` store.\n break\n case undefined:\n case 'request':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n case 'prerender-runtime':\n case 'prerender-client':\n case 'validation-client':\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'generate-static-params':\n return renderImageResponseArrayBuffer(args)\n default:\n return workUnitStore satisfies never\n }\n\n const { cacheSignal, resumeDataCache, renderSignal } = workUnitStore\n\n if (!resumeDataCache) {\n return renderImageResponseArrayBuffer(args)\n }\n\n const workStore = workAsyncStorage.getStore()\n\n if (!workStore) {\n throw new InvariantError(\n 'Expected a work store while caching an `ImageResponse` during prerendering.'\n )\n }\n\n const [element, options] = args\n\n // `createHangingInputAbortSignal` aborts once the prerender's cache-sourced\n // input is ready, so anything the serialization below is still awaiting past\n // that point can be treated as dynamic (non-cache) input. In the prospective\n // pass it aborts when `cacheSignal.inputReady()` resolves (no cache reads\n // in progress); in the final pass the caches are already filled, so it just\n // aborts on the next tick.\n const hangingInputAbortSignal = createHangingInputAbortSignal(workUnitStore)\n\n // We open the cache read lazily, once we know the serialization completed and\n // we're about to render and store the image. Opening it before serializing\n // would keep `cacheSignal.inputReady()` from resolving and thus prevent the\n // abort signal from ever firing, deadlocking the prospective prerender.\n let readState: 'ready' | 'pending' | 'done' = 'ready'\n\n function beginReadOnce() {\n if (readState === 'ready') {\n readState = 'pending'\n cacheSignal?.beginRead()\n }\n }\n\n function endReadIfStarted() {\n if (readState === 'pending') {\n cacheSignal?.endRead()\n }\n readState = 'done'\n }\n\n // We serialize the element tree with `prerenderToNodeStream` rather than\n // `renderToPipeableStream`. It's the right fit for prerendering, and it\n // schedules work deferred for size (`deferTask`) on microtasks, so a fully\n // static tree finishes flushing before the abort signal fires; a tree still\n // pending at abort time is then genuinely waiting on dynamic input rather\n // than just deferred.\n //\n // `renderToPipeableStream` would schedule that deferred work on\n // `setImmediate` instead, which isn't necessarily a deal-breaker: the\n // sequential-task scheme page rendering uses (`runInSequentialTasks`) drains\n // pending immediates at each task boundary, so deferred work still runs in\n // time. But route handler prerendering doesn't use that scheme, so here the\n // deferred immediates would race the abort.\n //\n // The prerender halts silently on abort, leaving unfulfilled references in\n // place rather than reporting through `onError`. So to tell a halt (the tree\n // needed dynamic input) apart from a normal completion, we record whether the\n // abort fired before the serialization finished. `abort()` runs this listener\n // synchronously, well before we read `resultIsPartial` below.\n let prerenderCompleted = false\n let resultIsPartial = false\n let serializationError: unknown\n\n hangingInputAbortSignal.addEventListener(\n 'abort',\n () => {\n if (!prerenderCompleted) {\n resultIsPartial = true\n }\n },\n { once: true }\n )\n\n const { clientModules, rscModuleMapping } = getClientReferenceManifest()\n\n try {\n // We serialize only the `element`. It's the part that needs Flight, to run\n // its async Server Components once and to surface any dynamic input. The\n // `options` are already-resolved plain data; they're folded into the cache\n // key directly and passed to satori as-is below.\n const { prelude } = await prerenderToNodeStream(element, clientModules, {\n signal: hangingInputAbortSignal,\n filterStackFrame: undefined,\n onError(error) {\n // A halt (our deliberate abort) emits nothing, so this is only called\n // for genuine serialization errors. We surface the first one.\n if (serializationError === undefined && !resultIsPartial) {\n serializationError = error\n }\n },\n })\n\n prerenderCompleted = true\n\n if (serializationError !== undefined) {\n throw serializationError\n }\n\n if (resultIsPartial) {\n // The element tree needed dynamic input (e.g. `cookies()` or an uncached\n // `fetch`), so the image can't be produced statically. Return a hanging\n // promise: the body never resolves, and the final prerender's macrotask\n // budget then classifies the route as dynamic.\n return makeHangingPromise<ArrayBuffer>(\n renderSignal,\n workStore.route,\n 'dynamic `ImageResponse`'\n )\n }\n\n // The serialization finished before any dynamic input was needed, so we\n // will render and cache the image. Hold the cache read now, before the\n // stream is buffered and deserialized below, so that the prospective\n // prerender's `cacheReady()` waits for the image to be stored.\n beginReadOnce()\n\n const chunks: Buffer[] = []\n for await (const chunk of prelude) {\n chunks.push(chunk)\n }\n\n const elementBuffer = Buffer.concat(chunks)\n\n // Derive a stable cache key from the serialized element plus the options.\n // We hash rather than reuse the raw serialized bytes so the key stays\n // compact even for large inputs (e.g. embedded fonts), and we fold the\n // options in by content so two images that differ only in their options\n // (size, fonts, ...) don't collide. The options are hashed directly here,\n // never serialized through Flight, which would both bloat the key and apply\n // `Buffer.prototype .toJSON` to font data.\n const hash = createHash('sha256')\n hash.update(elementBuffer)\n updateHashWithOptions(hash, options)\n const cacheKey = hash.digest('base64')\n\n const cached = resumeDataCache.imageResponses.get(cacheKey)\n\n if (cached) {\n return await cached\n }\n\n // Deserialize the element and hand it to satori. Because the user's\n // components already ran during serialization, satori only walks resolved\n // host elements and never re-runs them, confining user-space I/O to the\n // in-store serialization above.\n const deserializedElement = await createFromNodeStream(\n Readable.from([elementBuffer]),\n {\n // We don't want to trigger preloads of client references here.\n moduleLoading: null,\n moduleMap: rscModuleMapping,\n serverModuleMap: getServerModuleMap(),\n },\n { findSourceMapURL: undefined }\n )\n\n // The Flight client hands back the output of an async Server Component as\n // a `React.lazy` (sync components and plain host elements are inlined).\n // satori can't unwrap lazies, so we resolve them into plain elements first.\n // We only reach here once the serialization completed, so every lazy is\n // already resolved and `_init` returns synchronously.\n const resolvedElement = resolveFlightLazies(deserializedElement)\n\n // Pair the resolved element with the original, in-memory `options`, which\n // never went through Flight. This keeps the font `Buffer` intact: had it\n // been serialized, Flight would apply the `toJSON` method that Node's\n // `Buffer` carries, turning it into a `{ type: 'Buffer', data: [...] }`\n // object that satori's font parser rejects (it needs an `ArrayBuffer` or a\n // typed array).\n const resolvedArgs = [resolvedElement, options] as ImageResponseArgs\n\n // Render satori outside the prerender work-unit store. It does uncached\n // `fetch` calls (e.g. loading a font), and inside a Cache Components\n // prerender an uncached `fetch` outside a cache scope becomes a hanging\n // promise. Those are framework fetches, not user I/O, so we let them\n // resolve normally with no store.\n const arrayBufferPromise = workUnitAsyncStorage.exit(() =>\n renderImageResponseArrayBuffer(resolvedArgs)\n )\n\n if (resumeDataCache.mutable) {\n resumeDataCache.imageResponses.set(cacheKey, arrayBufferPromise)\n }\n\n return await arrayBufferPromise\n } finally {\n endReadIfStarted()\n }\n}\n\n/**\n * Updates a hash with a stable encoding of the `ImageResponse` options so they\n * can participate in the cache key without being serialized through Flight.\n * Binary values (font `Buffer`s, `ArrayBuffer`s, typed arrays) are hashed by\n * their raw bytes; objects are walked in sorted-key order.\n *\n * `ImageResponse` options are plain data: numbers, strings, booleans, nested\n * plain objects/arrays, and binary font data. Exotic objects such as `Map` or\n * `Date` keep their state outside their enumerable own keys, so the key walk\n * below would hash them incorrectly. Options never contain these, but we warn\n * if one ever shows up so a mis-keyed cache can be reported.\n *\n * The encoding is self-delimiting: every node starts with a type tag, and\n * variable-length parts (byte runs, primitives, keys) are length-prefixed,\n * while arrays and objects are count-prefixed. This makes it injective, so no\n * concatenation of values can be mistaken for a differently shaped input.\n */\nfunction updateHashWithOptions(hash: Hash, value: unknown): void {\n if (value === undefined) {\n hash.update('u')\n return\n }\n\n if (value === null) {\n hash.update('n')\n return\n }\n\n const type = typeof value\n\n if (type !== 'object') {\n // Tag with the primitive type so e.g. the number `1` and the string `'1'`\n // don't hash the same.\n updateHashWithBytes(hash, 'p', Buffer.from(`${type}:${String(value)}`))\n return\n }\n\n if (value instanceof ArrayBuffer) {\n updateHashWithBytes(hash, 'a', new Uint8Array(value))\n return\n }\n\n if (ArrayBuffer.isView(value)) {\n updateHashWithBytes(\n hash,\n 'v',\n new Uint8Array(value.buffer, value.byteOffset, value.byteLength)\n )\n return\n }\n\n if (Array.isArray(value)) {\n hash.update(`[${value.length},`)\n for (const item of value) {\n updateHashWithOptions(hash, item)\n }\n return\n }\n\n // The key walk below captures a plain object faithfully, but an exotic object\n // keeps its state elsewhere (a `Map`'s/`Set`'s entries, a `Date`'s time), so\n // two different values would hash the same and could return the wrong cached\n // image. This shouldn't happen for `ImageResponse` options, so we warn rather\n // than fail, then hash best-effort, so it can be reported. Not gated on\n // `NODE_ENV`: this runs during the production `next build` prerender, where\n // the warning is most useful.\n const prototype = Object.getPrototypeOf(value)\n if (prototype !== Object.prototype && prototype !== null) {\n const typeName =\n (value as { constructor?: { name?: string } }).constructor?.name ??\n 'object'\n console.warn(\n `Cannot reliably include an \\`ImageResponse\\` option of type ` +\n `\\`${typeName}\\` in the cache key, so different images may collide and ` +\n `return an incorrect cached result. Please report this to the Next.js ` +\n `team.`\n )\n }\n\n const keys = Object.keys(value).sort()\n hash.update(`{${keys.length},`)\n for (const key of keys) {\n updateHashWithBytes(hash, 'k', Buffer.from(key))\n updateHashWithOptions(hash, (value as Record<string, unknown>)[key])\n }\n}\n\n/**\n * Hashes a length-prefixed, tagged byte run: `<tag><byteLength>:<bytes>`. The\n * length prefix keeps the run self-delimiting so it can't blend into adjacent\n * nodes.\n */\nfunction updateHashWithBytes(hash: Hash, tag: string, bytes: Uint8Array): void {\n hash.update(`${tag}${bytes.byteLength}:`)\n hash.update(bytes)\n}\n\nasync function renderImageResponseArrayBuffer(\n args: ImageResponseArgs\n): Promise<ArrayBuffer> {\n const OGImageResponse = (await importOgModule()).ImageResponse\n const imageResponse = new OGImageResponse(...args)\n\n if (!imageResponse.body) {\n return new ArrayBuffer(0)\n }\n\n return imageResponse.arrayBuffer()\n}\n\nconst REACT_LAZY_TYPE = Symbol.for('react.lazy')\n\n/**\n * Recursively replaces the `React.lazy` references that Flight emits for\n * resolved async Server Components with the elements they resolve to, so that\n * satori (which doesn't understand lazy nodes) can walk the tree. This must\n * only be called on a fully resolved (completed) Flight result, where each\n * lazy's `_init` returns synchronously rather than suspending.\n */\nfunction resolveFlightLazies(node: unknown): unknown {\n if (node === null || typeof node !== 'object') {\n return node\n }\n\n if ((node as { $$typeof?: symbol }).$$typeof === REACT_LAZY_TYPE) {\n const lazy = node as {\n _init: (payload: unknown) => unknown\n _payload: unknown\n }\n return resolveFlightLazies(lazy._init(lazy._payload))\n }\n\n if (Array.isArray(node)) {\n return node.map(resolveFlightLazies)\n }\n\n const element = node as { props?: { children?: unknown } }\n if (element.props && 'children' in element.props) {\n return {\n ...element,\n props: {\n ...element.props,\n children: resolveFlightLazies(element.props.children),\n },\n }\n }\n\n return node\n}\n"],"names":["Readable","createHash","InvariantError","workAsyncStorage","workUnitAsyncStorage","createHangingInputAbortSignal","makeHangingPromise","getClientReferenceManifest","getServerModuleMap","prerenderToNodeStream","createFromNodeStream","importOgModule","getCachedImageResponseBody","args","ReadableStream","start","controller","arrayBuffer","getCachedImageResponseArrayBuffer","byteLength","enqueue","Uint8Array","close","workUnitStore","getStore","type","undefined","renderImageResponseArrayBuffer","cacheSignal","resumeDataCache","renderSignal","workStore","element","options","hangingInputAbortSignal","readState","beginReadOnce","beginRead","endReadIfStarted","endRead","prerenderCompleted","resultIsPartial","serializationError","addEventListener","once","clientModules","rscModuleMapping","prelude","signal","filterStackFrame","onError","error","route","chunks","chunk","push","elementBuffer","Buffer","concat","hash","update","updateHashWithOptions","cacheKey","digest","cached","imageResponses","get","deserializedElement","from","moduleLoading","moduleMap","serverModuleMap","findSourceMapURL","resolvedElement","resolveFlightLazies","resolvedArgs","arrayBufferPromise","exit","mutable","set","value","updateHashWithBytes","String","ArrayBuffer","isView","buffer","byteOffset","Array","isArray","length","item","prototype","Object","getPrototypeOf","typeName","constructor","name","console","warn","keys","sort","key","tag","bytes","OGImageResponse","ImageResponse","imageResponse","body","REACT_LAZY_TYPE","Symbol","for","node","$$typeof","lazy","_init","_payload","map","props","children"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAa;AACtC,SAASC,UAAU,QAAmB,cAAa;AAEnD,SAASC,cAAc,QAAQ,mCAAkC;AACjE,SAASC,gBAAgB,QAAQ,4CAA2C;AAC5E,SAASC,oBAAoB,QAAQ,iDAAgD;AACrF,SAASC,6BAA6B,QAAQ,kCAAiC;AAC/E,SAASC,kBAAkB,QAAQ,6BAA4B;AAC/D,SACEC,0BAA0B,EAC1BC,kBAAkB,QACb,oCAAmC;AAC1C,6DAA6D;AAC7D,SAASC,qBAAqB,QAAQ,kCAAiC;AACvE,6DAA6D;AAC7D,SAASC,oBAAoB,QAAQ,kCAAiC;AAMtE,SAASC;IACP,0EAA0E;IAC1E,4EAA4E;IAC5E,2EAA2E;IAC3E,0DAA0D;IAC1D,OAAO,MAAM,CAAC;AAChB;AAEA;;;;;;;;;;;;;;;;;CAiBC,GACD,OAAO,SAASC,2BACdC,IAAuB;IAEvB,OAAO,IAAIC,eAA2B;QACpC,MAAMC,OAAMC,UAAU;YACpB,MAAMC,cAAc,MAAMC,kCAAkCL;YAC5D,IAAII,YAAYE,UAAU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AAiC,CAACqB,IAAI;IACrE;AACF;AAEA;;;;CAIC,GACD,SAASpB,oBAAoBtB,IAAU,EAAE2C,GAAW,EAAEC,KAAiB;IACrE5C,KAAKC,MAAM,CAAC,GAAG0C,MAAMC,MAAMpF,UAAU,CAAC,CAAC,CAAC;IACxCwC,KAAKC,MAAM,CAAC2C;AACd;AAEA,eAAe5E,+BACbd,IAAuB;IAEvB,MAAM2F,kBAAkB,AAAC,CAAA,MAAM7F,gBAAe,EAAG8F,aAAa;IAC9D,MAAMC,gBAAgB,IAAIF,mBAAmB3F;IAE7C,IAAI,CAAC6F,cAAcC,IAAI,EAAE;QACvB,OAAO,IAAIxB,YAAY;IACzB;IAEA,OAAOuB,cAAczF,WAAW;AAClC;AAEA,MAAM2F,kBAAkBC,OAAOC,GAAG,CAAC;AAEnC;;;;;;CAMC,GACD,SAASpC,oBAAoBqC,IAAa;IACxC,IAAIA,SAAS,QAAQ,OAAOA,SAAS,UAAU;QAC7C,OAAOA;IACT;IAEA,IAAI,AAACA,KAA+BC,QAAQ,KAAKJ,iBAAiB;QAChE,MAAMK,OAAOF;QAIb,OAAOrC,oBAAoBuC,KAAKC,KAAK,CAACD,KAAKE,QAAQ;IACrD;IAEA,IAAI5B,MAAMC,OAAO,CAACuB,OAAO;QACvB,OAAOA,KAAKK,GAAG,CAAC1C;IAClB;IAEA,MAAM1C,UAAU+E;IAChB,IAAI/E,QAAQqF,KAAK,IAAI,cAAcrF,QAAQqF,KAAK,EAAE;QAChD,OAAO;YACL,GAAGrF,OAAO;YACVqF,OAAO;gBACL,GAAGrF,QAAQqF,KAAK;gBAChBC,UAAU5C,oBAAoB1C,QAAQqF,KAAK,CAACC,QAAQ;YACtD;QACF;IACF;IAEA,OAAOP;AACT","ignoreList":[0]} |
@@ -56,2 +56,8 @@ /** | ||
| PrefetchHint[PrefetchHint["SubtreeHasEagerPrefetch"] = 4096] = "SubtreeHasEagerPrefetch"; | ||
| // This segment or one of its descendants exports `instant = false`, | ||
| // explicitly opting out of Partial Prefetching. Propagates upward so the root | ||
| // reflects the entire subtree. Used only to suppress the dev-time | ||
| // `<Link prefetch={true}>` warning — unlike PrefetchDisabled, it has no effect | ||
| // on the actual prefetch behavior. | ||
| PrefetchHint[PrefetchHint["SubtreeHasInstantFalse"] = 8192] = "SubtreeHasInstantFalse"; | ||
| return PrefetchHint; | ||
@@ -73,3 +79,3 @@ }({}); | ||
| * from a node's children. | ||
| */ export const SubtreePrefetchHints = 2 | 8 | 2048 | 4096; | ||
| */ export const SubtreePrefetchHints = 2 | 8 | 2048 | 8192 | 4096; | ||
| /** | ||
@@ -103,2 +109,7 @@ * Folds a child segment's prefetch hints into its parent's, propagating the | ||
| } | ||
| // And for `instant = false`. Like eager prefetch, the bit is set directly on | ||
| // each opted-out segment, so propagate it as-is. | ||
| if (childHints & 8192) { | ||
| parentHints |= 8192; | ||
| } | ||
| return parentHints; | ||
@@ -105,0 +116,0 @@ } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/shared/lib/app-router-types.ts"],"sourcesContent":["/**\n * App Router types - Client-safe types for the Next.js App Router\n *\n * This file contains type definitions that can be safely imported\n * by both client-side and server-side code without circular dependencies.\n */\n\nimport type React from 'react'\n\nexport type LoadingModuleData =\n | [React.JSX.Element, React.ReactNode, React.ReactNode]\n | null\n\nimport type { VaryParamsIterable } from './segment-cache/vary-params-decoding'\n\n/** viewport metadata node */\nexport type HeadData = React.ReactNode\n\n/**\n * Cache node used in app-router / layout-router.\n */\n\nexport type CacheNode = {\n /**\n * When rsc is not null, it represents the RSC data for the\n * corresponding segment.\n *\n * `null` is a valid React Node but because segment data is always a\n * <LayoutRouter> component, we can use `null` to represent empty. When it is\n * null, it represents missing data, and rendering should suspend.\n */\n rsc: React.ReactNode\n\n /**\n * Represents a static version of the segment that can be shown immediately,\n * and may or may not contain dynamic holes. It's prefetched before a\n * navigation occurs.\n *\n * During rendering, we will choose whether to render `rsc` or `prefetchRsc`\n * with `useDeferredValue`. As with the `rsc` field, a value of `null` means\n * no value was provided. In this case, the LayoutRouter will go straight to\n * rendering the `rsc` value; if that one is also missing, it will suspend and\n * trigger a lazy fetch.\n */\n prefetchRsc: React.ReactNode\n\n prefetchHead: HeadData | null\n\n head: HeadData\n\n slots: Record<string, CacheNode> | null\n\n /**\n * A shared mutable ref that tracks whether this segment should be scrolled\n * to. All new segments created during a single navigation share the same\n * ref. When any segment's scroll handler fires, it sets `current` to\n * `false` so no other segment scrolls for the same navigation.\n *\n * `null` means this segment is not a scroll target (e.g., a reused shared\n * layout segment).\n */\n scrollRef: ScrollRef | null\n\n /**\n * Globally-unique identifier minted from a monotonic counter when the\n * CacheNode is freshly created. Surfaced to user code as a string via\n * `useRouter().bfcacheId` and intended to be used as a React `key` to\n * opt out of Activity-based state preservation on fresh navigations.\n *\n * Preserved when the CacheNode is reused (shared layouts, refresh,\n * search/hash-only navigations) or restored from the BFCache during a\n * back/forward navigation.\n */\n bfcacheId: number\n}\n\n/**\n * A mutable ref shared across all new segments created during a single\n * navigation. Used to ensure that only one segment scrolls per navigation.\n */\nexport type ScrollRef = { current: boolean }\n\nexport type DynamicParamTypes =\n | 'catchall'\n | 'catchall-intercepted-(..)(..)'\n | 'catchall-intercepted-(.)'\n | 'catchall-intercepted-(..)'\n | 'catchall-intercepted-(...)'\n | 'optional-catchall'\n | 'dynamic'\n | 'dynamic-intercepted-(..)(..)'\n | 'dynamic-intercepted-(.)'\n | 'dynamic-intercepted-(..)'\n | 'dynamic-intercepted-(...)'\n\nexport type DynamicParamTypesShort =\n | 'c'\n | 'ci(..)(..)'\n | 'ci(.)'\n | 'ci(..)'\n | 'ci(...)'\n | 'oc'\n | 'd'\n | 'di(..)(..)'\n | 'di(.)'\n | 'di(..)'\n | 'di(...)'\n\n// The tuple form of a segment, used for dynamic route params\nexport type DynamicSegmentTuple = [\n // Param name\n paramName: string,\n // Param cache key (almost the same as the value, but arrays are\n // concatenated into strings)\n // TODO: We should change this to just be the value. Currently we convert\n // it back to a value when passing to useParams. It only needs to be\n // a string when converted to a a cache key, but that doesn't mean we\n // need to store it as that representation.\n paramCacheKey: string,\n // Dynamic param type\n dynamicParamType: DynamicParamTypesShort,\n // Static sibling segments at the same URL level. Used by the client\n // router to determine if a prefetch can be reused when navigating to\n // a static sibling of a dynamic route. For example, if the route is\n // /products/[id] and there's also /products/sale, then staticSiblings\n // would be ['sale']. null means the siblings are unknown (e.g. in\n // webpack dev mode).\n staticSiblings: readonly string[] | null,\n]\n\nexport type Segment = string | DynamicSegmentTuple\n\n/**\n * Router state\n */\nexport type FlightRouterState = [\n segment: Segment,\n parallelRoutes: { [parallelRouterKey: string]: FlightRouterState },\n refreshState?: CompressedRefreshState | null,\n /**\n * - \"refetch\" is used during a request to inform the server where rendering\n * should start from.\n *\n * - \"inside-shared-layout\" is used during a prefetch request to inform the\n * server that even if the segment matches, it should be treated as if it's\n * within the \"new\" part of a navigation — inside the shared layout. If\n * the segment doesn't match, then it has no effect, since it would be\n * treated as new regardless. If it does match, though, the server does not\n * need to render it, because the client already has it.\n *\n * - \"metadata-only\" instructs the server to skip rendering the segments and\n * only send the head data.\n *\n * A bit confusing, but that's because it has only one extremely narrow use\n * case — during a non-PPR prefetch, the server uses it to find the first\n * loading boundary beneath a shared layout.\n *\n * TODO: We should rethink the protocol for dynamic requests. It might not\n * make sense for the client to send a FlightRouterState, since this type is\n * overloaded with concerns.\n */\n refresh?: 'refetch' | 'inside-shared-layout' | 'metadata-only' | null,\n /**\n * Bitmask of PrefetchHint flags. Encodes route structure metadata:\n * root layout, loading boundaries, instant configs, and runtime prefetch\n * hints. Only set when non-zero.\n */\n prefetchHints?: number,\n]\n\n/**\n * When rendering a parallel route, some of the parallel paths may not match\n * the current URL. In that case, the Next client has to render something,\n * so it will render whichever was the last route to match that slot. We use\n * this type to track when this has happened. It's a tuple of the original\n * URL that was used to fetch the segment, and the (possibly rewritten) search\n * query that was rendered by the server. The URL is needed when performing\n * a refresh of the segment, and the search query is needed for looking up\n * matching entries in the segment cache.\n */\nexport type CompressedRefreshState = [url: string, renderedSearch: string]\n\nexport const enum PrefetchHint {\n // This segment has a runtime prefetch enabled (via instant with\n // prefetch: 'runtime'). Per-segment only, does not propagate to ancestors.\n HasRuntimePrefetch = 0b00001,\n // This segment or one of its descendants opts into Partial Prefetching.\n // Currently set when a truthy instant config is present on any\n // segment in the subtree (regardless of prefetch mode). Propagates upward\n // so the root segment reflects the entire subtree.\n SubtreeHasPartialPrefetching = 0b00010,\n // This segment itself has a loading.tsx boundary.\n SegmentHasLoadingBoundary = 0b00100,\n // A descendant segment (but not this one) has a loading.tsx boundary.\n // Propagates upward so the root reflects the entire subtree.\n SubtreeHasLoadingBoundary = 0b01000,\n // This segment is at or above the application's root layout — the root layout\n // segment itself and all of its ancestors. A dynamic param in one of these\n // segments is a \"root param\".\n IsRootLayoutOrAbove = 0b10000,\n // This segment's response includes its parent's data inlined into it.\n // Set at build time by the segment size measurement pass.\n ParentInlinedIntoSelf = 0b100000,\n // This segment's data is inlined into one of its children — don't fetch\n // it separately. Set at build time by the segment size measurement pass.\n InlinedIntoChild = 0b1000000,\n // On a __PAGE__: this page's response includes the head (metadata/viewport)\n // at the end of its SegmentPrefetch[] array.\n HeadInlinedIntoSelf = 0b10000000,\n // On the root hint node: the head was NOT inlined into any page — fetch\n // it separately. Absence of this bit means the head is bundled into a page.\n HeadOutlined = 0b100000000,\n // The inlining hints in this tree may be stale because the tree was\n // generated before collectPrefetchHints ran (e.g. the initial RSC payload\n // for a fully static page at build time). When writing this tree into the\n // cache, the route entry should be immediately expired so it gets\n // re-fetched with correct hints. Only set during build-time prerendering,\n // never at runtime.\n InliningHintsStale = 0b1000000000,\n // This segment has instant = false, opting out of all\n // prefetching entirely (neither static nor runtime).\n PrefetchDisabled = 0b10000000000,\n // This segment or one of its descendants has runtime prefetch enabled\n // (HasRuntimePrefetch). Propagates upward so the root reflects the\n // entire subtree.\n SubtreeHasRuntimePrefetch = 0b100000000000,\n // This segment or one of its descendants prefetches \"eagerly\" — i.e. its\n // effective prefetch strategy is anything other than 'partial' or\n // 'allow-runtime'. Used by App Shells: a non-eager subtree relies on the\n // shared app shell and skips its Speculative prefetch. Propagates upward so\n // the root reflects the entire subtree.\n SubtreeHasEagerPrefetch = 0b1000000000000,\n}\n\n/**\n * Bitmask for checking whether a segment's static prefetch is skipped. Matches\n * if EITHER bit is set — i.e. the segment uses runtime prefetching\n * (HasRuntimePrefetch) OR prefetching is disabled entirely (PrefetchDisabled,\n * e.g. instant = false). The segment participates in the bundle chain\n * but with null data.\n *\n * Usage: `(hints & StaticPrefetchDisabled) !== 0`\n */\nexport const StaticPrefetchDisabled =\n PrefetchHint.HasRuntimePrefetch | PrefetchHint.PrefetchDisabled\n\n/**\n * The subset of PrefetchHint bits that propagate upward from a child segment to\n * its ancestors (as opposed to segment-local bits like SegmentHasLoadingBoundary\n * or IsRootLayoutOrAbove). Used to clear stale propagated bits before re-deriving them\n * from a node's children.\n */\nexport const SubtreePrefetchHints =\n PrefetchHint.SubtreeHasPartialPrefetching |\n PrefetchHint.SubtreeHasLoadingBoundary |\n PrefetchHint.SubtreeHasRuntimePrefetch |\n PrefetchHint.SubtreeHasEagerPrefetch\n\n/**\n * Folds a child segment's prefetch hints into its parent's, propagating the\n * \"subtree\" flags. A child's segment-local flag (e.g. it has a loading boundary,\n * or it has a runtime prefetch) becomes the corresponding \"subtree\" flag on the\n * parent, so the root segment ends up reflecting the entire subtree.\n *\n * Used wherever a route tree is assembled bottom-up: on the server when building\n * a prefetch tree (createFlightRouterStateFromLoaderTree) and on the client when\n * merging a navigation patch into the existing tree (convertServerPatchToFullTree).\n * Keep these in sync by routing both through this helper.\n */\nexport function propagateSubtreeBits(\n parentHints: number,\n childHints: number\n): number {\n if (childHints & PrefetchHint.SubtreeHasPartialPrefetching) {\n parentHints |= PrefetchHint.SubtreeHasPartialPrefetching\n }\n // A child with a loading boundary (directly, or anywhere in its subtree) makes\n // this a SubtreeHasLoadingBoundary on the parent.\n if (\n childHints &\n (PrefetchHint.SegmentHasLoadingBoundary |\n PrefetchHint.SubtreeHasLoadingBoundary)\n ) {\n parentHints |= PrefetchHint.SubtreeHasLoadingBoundary\n }\n // Likewise for runtime prefetch.\n if (\n childHints &\n (PrefetchHint.HasRuntimePrefetch | PrefetchHint.SubtreeHasRuntimePrefetch)\n ) {\n parentHints |= PrefetchHint.SubtreeHasRuntimePrefetch\n }\n // And for eager prefetch. The bit is set directly on each eager segment, so\n // there's no separate segment-local flag — propagate it as-is.\n if (childHints & PrefetchHint.SubtreeHasEagerPrefetch) {\n parentHints |= PrefetchHint.SubtreeHasEagerPrefetch\n }\n return parentHints\n}\n\n/**\n * Individual Flight response path\n */\nexport type FlightSegmentPath =\n // Uses `any` as repeating pattern can't be typed.\n | any[]\n // Looks somewhat like this\n | [\n segment: Segment,\n parallelRouterKey: string,\n segment: Segment,\n parallelRouterKey: string,\n segment: Segment,\n parallelRouterKey: string,\n ]\n\n/**\n * Represents a tree of segments and the Flight data (i.e. React nodes) that\n * correspond to each one. The tree is isomorphic to the FlightRouterState;\n * however in the future we want to be able to fetch arbitrary partial segments\n * without having to fetch all its children. So this response format will\n * likely change.\n */\nexport type CacheNodeSeedData = [\n node: React.ReactNode | null,\n parallelRoutes: {\n [parallelRouterKey: string]: CacheNodeSeedData | null\n },\n // TODO: This field is no longer used. Remove it.\n loading: null,\n isPartial: boolean,\n /**\n * An AsyncIterable that yields the route params this segment accessed during\n * server rendering (one name per yield, deduped). Used by the client router\n * to determine cache key specificity - segments that only access certain\n * params can be reused across navigations where unaccessed params change.\n *\n * Does NOT include root params; those are emitted once at the top level of\n * the response (see `r` on the payload) and unioned in by the consumer.\n *\n * - null: tracking was not enabled for this render (e.g., not a prerender).\n * Treat conservatively - assume all params vary.\n * - Drains to empty Set: segment accesses no params (e.g., client components,\n * or server components that don't read params). Can be shared across all\n * param values.\n * - Drains to non-empty Set: segment depends on those params. Can only reuse\n * when those specific params match.\n */\n varyParams: VaryParamsIterable | null,\n]\n\nexport type FlightDataSegment = [\n /* segment of the rendered slice: */ Segment,\n /* treePatch */ FlightRouterState,\n /* cacheNodeSeedData */ CacheNodeSeedData | null, // Can be null during prefetch if there's no loading component\n /* head: viewport */ HeadData,\n /* isHeadPartial */ boolean,\n]\n\nexport type FlightDataPath =\n // Uses `any` as repeating pattern can't be typed.\n | any[]\n // Looks somewhat like this\n | [\n // Holds full path to the segment.\n ...FlightSegmentPath[],\n ...FlightDataSegment,\n ]\n\n/**\n * The Flight response data\n */\nexport type FlightData = Array<FlightDataPath> | string\n\n/**\n * Per-route prefetch hints computed at build time. Mirrors the shape of the\n * loader tree so hints can be traversed in parallel during router state\n * creation. Each node stores a bitmask of PrefetchHint flags\n * (ParentInlinedIntoSelf, InlinedIntoChild) computed by the segment size\n * measurement pass.\n *\n * Persisted to prefetch-hints.json as Record<string, PrefetchHints> (keyed\n * by route pattern) and loaded at server startup.\n */\nexport type PrefetchHints = {\n /** Bitmask of PrefetchHint flags for this segment. */\n hints: number\n /** Child hint nodes, keyed by parallel route key. */\n slots: Record<string, PrefetchHints> | null\n}\n\nexport type ActionResult = Promise<any>\n\nexport type InitialRSCPayload = {\n /** buildId, can be empty if the x-nextjs-build-id header is set */\n b?: string\n /** initialCanonicalUrlParts */\n c: string[]\n /** initialRenderedSearch */\n q: string\n /** couldBeIntercepted */\n i: boolean\n /** initialFlightData */\n f: FlightDataPath[]\n /** missingSlots */\n m: Set<string> | undefined\n /** GlobalError */\n G: [React.ComponentType<any>, React.ReactNode | undefined]\n /** supportsPerSegmentPrefetching */\n S: boolean\n /**\n * headVaryParams - vary params for the head (metadata) of the response.\n * Does not include root params (see `r`).\n */\n h: VaryParamsIterable | null\n /**\n * rootVaryParams - the root params accessed anywhere in the response, emitted\n * once. The client unions these into the head and every segment's vary\n * params, rather than the server folding them into each set.\n */\n r?: VaryParamsIterable\n /** staleTime in seconds - Only present when Cache Components is enabled. */\n s?: AsyncIterable<number>\n /** staticStageByteLength - Resolves when the static stage ends. */\n l?: Promise<number>\n /**\n * shellByteLength - Resolves when the shell stage ends.\n * If it resolves to null, then the shell is the same as the main response.\n * */\n a?: Promise<number | null>\n /** runtimePrefetchStream — Embedded runtime prefetch Flight stream. */\n p?: ReadableStream<Uint8Array>\n /**\n * dynamicStaleTime — Per-page BFCache stale time in seconds, from\n * `unstable_dynamicStaleTime`. Only included for dynamic renders. Controls\n * how long the client router cache retains dynamic navigation data. This is\n * distinct from the `s` field, which controls segment cache (prefetch)\n * staleness.\n */\n d?: number\n /**\n * revealAfter (dev only). Resolves once the server has flushed the\n * shell-stage content to the stream (static shell, or runtime-prefetchable\n * shell for runtime-prefetch routes), or earlier on a cache miss. The client\n * decodes this from the payload and defers resolving the response's deferred\n * RSCs on it, so a boundary's children aren't revealed before their row has\n * been decoded (which would flush a premature Suspense fallback). Its\n * resolution row follows the children's row in the payload, so the children\n * are decoded by the time the client unblocks. The HTML render gates on the\n * same signal server-side instead of reading this field.\n */\n _revealAfter?: Promise<void>\n}\n\n// Response from `createFromFetch` for normal rendering\nexport type NavigationFlightResponse = {\n /** buildId, can be empty if the x-nextjs-build-id header is set */\n b?: string\n /** flightData */\n f: FlightData\n /** supportsPerSegmentPrefetching */\n S: boolean\n /** renderedSearch */\n q: string\n /** couldBeIntercepted */\n i: boolean\n /** staleTime - Only present in dynamic runtime prefetch responses. */\n s?: AsyncIterable<number>\n /** staticStageByteLength - Resolves when the static stage ends. */\n l?: Promise<number>\n /**\n * shellByteLength - Resolves when the shell stage ends.\n * If it resolves to null, then the shell is the same as the main response.\n * */\n a?: Promise<number | null>\n /**\n * shellUsedSessionData - true if resolving session data\n * unblocked new content in the shell.\n * NOTE: only use this in runtime/session prefetch requests\n * where we have a proper session shell.\n * */\n u?: Promise<boolean>\n /** headVaryParams. Does not include root params (see `r`). */\n h: VaryParamsIterable | null\n /**\n * rootVaryParams - the root params accessed anywhere in the response, emitted\n * once. The client unions these into the head and every segment's vary\n * params.\n */\n r?: VaryParamsIterable\n /** runtimePrefetchStream — Embedded runtime prefetch Flight stream. */\n p?: ReadableStream<Uint8Array>\n /**\n * dynamicStaleTime — Per-page BFCache stale time in seconds, from\n * `unstable_dynamicStaleTime`. Only included for dynamic renders. Controls\n * how long the client router cache retains dynamic navigation data. This is\n * distinct from the `s` field, which controls segment cache (prefetch)\n * staleness.\n */\n d?: number\n /**\n * revealAfter (dev only). Resolves once the server has flushed the\n * shell-stage content to the stream (static shell, or runtime-prefetchable\n * shell for runtime-prefetch routes), or earlier on a cache miss. The client\n * decodes this from the payload and defers resolving the response's deferred\n * RSCs on it, so a boundary's children aren't revealed before their row has\n * been decoded (which would flush a premature Suspense fallback). Its\n * resolution row follows the children's row in the payload, so the children\n * are decoded by the time the client unblocks. The HTML render gates on the\n * same signal server-side instead of reading this field.\n */\n _revealAfter?: Promise<void>\n}\n\n// Response from `createFromFetch` for server actions. Action's flight data can be null\nexport type ActionFlightResponse = {\n /** actionResult */\n a: ActionResult\n /** buildId, can be empty if the x-nextjs-build-id header is set */\n b?: string\n /** flightData */\n f: FlightData\n /** renderedSearch */\n q: string\n /** couldBeIntercepted */\n i: boolean\n}\n\nexport type RSCPayload =\n | InitialRSCPayload\n | NavigationFlightResponse\n | ActionFlightResponse\n\nexport type InstantCookie =\n // pending (waiting to capture)\n | [captured: 0, id: string]\n // captured MPA page load\n | [captured: 1, id: string, state: null]\n // captured SPA navigation (from/to route trees)\n | [\n captured: 1,\n id: string,\n state: { from: FlightRouterState; to: FlightRouterState | null },\n ]\n"],"names":["PrefetchHint","StaticPrefetchDisabled","SubtreePrefetchHints","propagateSubtreeBits","parentHints","childHints"],"mappings":"AAAA;;;;;CAKC,GAiLD,OAAO,IAAA,AAAWA,sCAAAA;IAChB,gEAAgE;IAChE,2EAA2E;;IAE3E,wEAAwE;IACxE,+DAA+D;IAC/D,0EAA0E;IAC1E,mDAAmD;;IAEnD,kDAAkD;;IAElD,sEAAsE;IACtE,6DAA6D;;IAE7D,8EAA8E;IAC9E,2EAA2E;IAC3E,8BAA8B;;IAE9B,sEAAsE;IACtE,0DAA0D;;IAE1D,wEAAwE;IACxE,yEAAyE;;IAEzE,4EAA4E;IAC5E,6CAA6C;;IAE7C,wEAAwE;IACxE,4EAA4E;;IAE5E,oEAAoE;IACpE,0EAA0E;IAC1E,0EAA0E;IAC1E,kEAAkE;IAClE,0EAA0E;IAC1E,oBAAoB;;IAEpB,sDAAsD;IACtD,qDAAqD;;IAErD,sEAAsE;IACtE,mEAAmE;IACnE,kBAAkB;;IAElB,yEAAyE;IACzE,kEAAkE;IAClE,yEAAyE;IACzE,4EAA4E;IAC5E,wCAAwC;;WAhDxBA;MAkDjB;AAED;;;;;;;;CAQC,GACD,OAAO,MAAMC,yBACXD,SAA+D;AAEjE;;;;;CAKC,GACD,OAAO,MAAME,uBACXF,oBAGoC;AAEtC;;;;;;;;;;CAUC,GACD,OAAO,SAASG,qBACdC,WAAmB,EACnBC,UAAkB;IAElB,IAAIA,gBAAwD;QAC1DD;IACF;IACA,+EAA+E;IAC/E,kDAAkD;IAClD,IACEC,aACCL,CAAAA,KACsC,GACvC;QACAI;IACF;IACA,iCAAiC;IACjC,IACEC,aACCL,CAAAA,QAAuE,GACxE;QACAI;IACF;IACA,4EAA4E;IAC5E,+DAA+D;IAC/D,IAAIC,mBAAmD;QACrDD;IACF;IACA,OAAOA;AACT","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/shared/lib/app-router-types.ts"],"sourcesContent":["/**\n * App Router types - Client-safe types for the Next.js App Router\n *\n * This file contains type definitions that can be safely imported\n * by both client-side and server-side code without circular dependencies.\n */\n\nimport type React from 'react'\n\nexport type LoadingModuleData =\n | [React.JSX.Element, React.ReactNode, React.ReactNode]\n | null\n\nimport type { VaryParamsIterable } from './segment-cache/vary-params-decoding'\n\n/** viewport metadata node */\nexport type HeadData = React.ReactNode\n\n/**\n * Cache node used in app-router / layout-router.\n */\n\nexport type CacheNode = {\n /**\n * When rsc is not null, it represents the RSC data for the\n * corresponding segment.\n *\n * `null` is a valid React Node but because segment data is always a\n * <LayoutRouter> component, we can use `null` to represent empty. When it is\n * null, it represents missing data, and rendering should suspend.\n */\n rsc: React.ReactNode\n\n /**\n * Represents a static version of the segment that can be shown immediately,\n * and may or may not contain dynamic holes. It's prefetched before a\n * navigation occurs.\n *\n * During rendering, we will choose whether to render `rsc` or `prefetchRsc`\n * with `useDeferredValue`. As with the `rsc` field, a value of `null` means\n * no value was provided. In this case, the LayoutRouter will go straight to\n * rendering the `rsc` value; if that one is also missing, it will suspend and\n * trigger a lazy fetch.\n */\n prefetchRsc: React.ReactNode\n\n prefetchHead: HeadData | null\n\n head: HeadData\n\n slots: Record<string, CacheNode> | null\n\n /**\n * A shared mutable ref that tracks whether this segment should be scrolled\n * to. All new segments created during a single navigation share the same\n * ref. When any segment's scroll handler fires, it sets `current` to\n * `false` so no other segment scrolls for the same navigation.\n *\n * `null` means this segment is not a scroll target (e.g., a reused shared\n * layout segment).\n */\n scrollRef: ScrollRef | null\n\n /**\n * Globally-unique identifier minted from a monotonic counter when the\n * CacheNode is freshly created. Surfaced to user code as a string via\n * `useRouter().bfcacheId` and intended to be used as a React `key` to\n * opt out of Activity-based state preservation on fresh navigations.\n *\n * Preserved when the CacheNode is reused (shared layouts, refresh,\n * search/hash-only navigations) or restored from the BFCache during a\n * back/forward navigation.\n */\n bfcacheId: number\n}\n\n/**\n * A mutable ref shared across all new segments created during a single\n * navigation. Used to ensure that only one segment scrolls per navigation.\n */\nexport type ScrollRef = { current: boolean }\n\nexport type DynamicParamTypes =\n | 'catchall'\n | 'catchall-intercepted-(..)(..)'\n | 'catchall-intercepted-(.)'\n | 'catchall-intercepted-(..)'\n | 'catchall-intercepted-(...)'\n | 'optional-catchall'\n | 'dynamic'\n | 'dynamic-intercepted-(..)(..)'\n | 'dynamic-intercepted-(.)'\n | 'dynamic-intercepted-(..)'\n | 'dynamic-intercepted-(...)'\n\nexport type DynamicParamTypesShort =\n | 'c'\n | 'ci(..)(..)'\n | 'ci(.)'\n | 'ci(..)'\n | 'ci(...)'\n | 'oc'\n | 'd'\n | 'di(..)(..)'\n | 'di(.)'\n | 'di(..)'\n | 'di(...)'\n\n// The tuple form of a segment, used for dynamic route params\nexport type DynamicSegmentTuple = [\n // Param name\n paramName: string,\n // Param cache key (almost the same as the value, but arrays are\n // concatenated into strings)\n // TODO: We should change this to just be the value. Currently we convert\n // it back to a value when passing to useParams. It only needs to be\n // a string when converted to a a cache key, but that doesn't mean we\n // need to store it as that representation.\n paramCacheKey: string,\n // Dynamic param type\n dynamicParamType: DynamicParamTypesShort,\n // Static sibling segments at the same URL level. Used by the client\n // router to determine if a prefetch can be reused when navigating to\n // a static sibling of a dynamic route. For example, if the route is\n // /products/[id] and there's also /products/sale, then staticSiblings\n // would be ['sale']. null means the siblings are unknown (e.g. in\n // webpack dev mode).\n staticSiblings: readonly string[] | null,\n]\n\nexport type Segment = string | DynamicSegmentTuple\n\n/**\n * Router state\n */\nexport type FlightRouterState = [\n segment: Segment,\n parallelRoutes: { [parallelRouterKey: string]: FlightRouterState },\n refreshState?: CompressedRefreshState | null,\n /**\n * - \"refetch\" is used during a request to inform the server where rendering\n * should start from.\n *\n * - \"inside-shared-layout\" is used during a prefetch request to inform the\n * server that even if the segment matches, it should be treated as if it's\n * within the \"new\" part of a navigation — inside the shared layout. If\n * the segment doesn't match, then it has no effect, since it would be\n * treated as new regardless. If it does match, though, the server does not\n * need to render it, because the client already has it.\n *\n * - \"metadata-only\" instructs the server to skip rendering the segments and\n * only send the head data.\n *\n * A bit confusing, but that's because it has only one extremely narrow use\n * case — during a non-PPR prefetch, the server uses it to find the first\n * loading boundary beneath a shared layout.\n *\n * TODO: We should rethink the protocol for dynamic requests. It might not\n * make sense for the client to send a FlightRouterState, since this type is\n * overloaded with concerns.\n */\n refresh?: 'refetch' | 'inside-shared-layout' | 'metadata-only' | null,\n /**\n * Bitmask of PrefetchHint flags. Encodes route structure metadata:\n * root layout, loading boundaries, instant configs, and runtime prefetch\n * hints. Only set when non-zero.\n */\n prefetchHints?: number,\n]\n\n/**\n * When rendering a parallel route, some of the parallel paths may not match\n * the current URL. In that case, the Next client has to render something,\n * so it will render whichever was the last route to match that slot. We use\n * this type to track when this has happened. It's a tuple of the original\n * URL that was used to fetch the segment, and the (possibly rewritten) search\n * query that was rendered by the server. The URL is needed when performing\n * a refresh of the segment, and the search query is needed for looking up\n * matching entries in the segment cache.\n */\nexport type CompressedRefreshState = [url: string, renderedSearch: string]\n\nexport const enum PrefetchHint {\n // This segment has a runtime prefetch enabled (via instant with\n // prefetch: 'runtime'). Per-segment only, does not propagate to ancestors.\n HasRuntimePrefetch = 0b00001,\n // This segment or one of its descendants opts into Partial Prefetching.\n // Currently set when a truthy instant config is present on any\n // segment in the subtree (regardless of prefetch mode). Propagates upward\n // so the root segment reflects the entire subtree.\n SubtreeHasPartialPrefetching = 0b00010,\n // This segment itself has a loading.tsx boundary.\n SegmentHasLoadingBoundary = 0b00100,\n // A descendant segment (but not this one) has a loading.tsx boundary.\n // Propagates upward so the root reflects the entire subtree.\n SubtreeHasLoadingBoundary = 0b01000,\n // This segment is at or above the application's root layout — the root layout\n // segment itself and all of its ancestors. A dynamic param in one of these\n // segments is a \"root param\".\n IsRootLayoutOrAbove = 0b10000,\n // This segment's response includes its parent's data inlined into it.\n // Set at build time by the segment size measurement pass.\n ParentInlinedIntoSelf = 0b100000,\n // This segment's data is inlined into one of its children — don't fetch\n // it separately. Set at build time by the segment size measurement pass.\n InlinedIntoChild = 0b1000000,\n // On a __PAGE__: this page's response includes the head (metadata/viewport)\n // at the end of its SegmentPrefetch[] array.\n HeadInlinedIntoSelf = 0b10000000,\n // On the root hint node: the head was NOT inlined into any page — fetch\n // it separately. Absence of this bit means the head is bundled into a page.\n HeadOutlined = 0b100000000,\n // The inlining hints in this tree may be stale because the tree was\n // generated before collectPrefetchHints ran (e.g. the initial RSC payload\n // for a fully static page at build time). When writing this tree into the\n // cache, the route entry should be immediately expired so it gets\n // re-fetched with correct hints. Only set during build-time prerendering,\n // never at runtime.\n InliningHintsStale = 0b1000000000,\n // This segment has instant = false, opting out of all\n // prefetching entirely (neither static nor runtime).\n PrefetchDisabled = 0b10000000000,\n // This segment or one of its descendants has runtime prefetch enabled\n // (HasRuntimePrefetch). Propagates upward so the root reflects the\n // entire subtree.\n SubtreeHasRuntimePrefetch = 0b100000000000,\n // This segment or one of its descendants prefetches \"eagerly\" — i.e. its\n // effective prefetch strategy is anything other than 'partial' or\n // 'allow-runtime'. Used by App Shells: a non-eager subtree relies on the\n // shared app shell and skips its Speculative prefetch. Propagates upward so\n // the root reflects the entire subtree.\n SubtreeHasEagerPrefetch = 0b1000000000000,\n // This segment or one of its descendants exports `instant = false`,\n // explicitly opting out of Partial Prefetching. Propagates upward so the root\n // reflects the entire subtree. Used only to suppress the dev-time\n // `<Link prefetch={true}>` warning — unlike PrefetchDisabled, it has no effect\n // on the actual prefetch behavior.\n SubtreeHasInstantFalse = 0b10000000000000,\n}\n\n/**\n * Bitmask for checking whether a segment's static prefetch is skipped. Matches\n * if EITHER bit is set — i.e. the segment uses runtime prefetching\n * (HasRuntimePrefetch) OR prefetching is disabled entirely (PrefetchDisabled,\n * e.g. instant = false). The segment participates in the bundle chain\n * but with null data.\n *\n * Usage: `(hints & StaticPrefetchDisabled) !== 0`\n */\nexport const StaticPrefetchDisabled =\n PrefetchHint.HasRuntimePrefetch | PrefetchHint.PrefetchDisabled\n\n/**\n * The subset of PrefetchHint bits that propagate upward from a child segment to\n * its ancestors (as opposed to segment-local bits like SegmentHasLoadingBoundary\n * or IsRootLayoutOrAbove). Used to clear stale propagated bits before re-deriving them\n * from a node's children.\n */\nexport const SubtreePrefetchHints =\n PrefetchHint.SubtreeHasPartialPrefetching |\n PrefetchHint.SubtreeHasLoadingBoundary |\n PrefetchHint.SubtreeHasRuntimePrefetch |\n PrefetchHint.SubtreeHasInstantFalse |\n PrefetchHint.SubtreeHasEagerPrefetch\n\n/**\n * Folds a child segment's prefetch hints into its parent's, propagating the\n * \"subtree\" flags. A child's segment-local flag (e.g. it has a loading boundary,\n * or it has a runtime prefetch) becomes the corresponding \"subtree\" flag on the\n * parent, so the root segment ends up reflecting the entire subtree.\n *\n * Used wherever a route tree is assembled bottom-up: on the server when building\n * a prefetch tree (createFlightRouterStateFromLoaderTree) and on the client when\n * merging a navigation patch into the existing tree (convertServerPatchToFullTree).\n * Keep these in sync by routing both through this helper.\n */\nexport function propagateSubtreeBits(\n parentHints: number,\n childHints: number\n): number {\n if (childHints & PrefetchHint.SubtreeHasPartialPrefetching) {\n parentHints |= PrefetchHint.SubtreeHasPartialPrefetching\n }\n // A child with a loading boundary (directly, or anywhere in its subtree) makes\n // this a SubtreeHasLoadingBoundary on the parent.\n if (\n childHints &\n (PrefetchHint.SegmentHasLoadingBoundary |\n PrefetchHint.SubtreeHasLoadingBoundary)\n ) {\n parentHints |= PrefetchHint.SubtreeHasLoadingBoundary\n }\n // Likewise for runtime prefetch.\n if (\n childHints &\n (PrefetchHint.HasRuntimePrefetch | PrefetchHint.SubtreeHasRuntimePrefetch)\n ) {\n parentHints |= PrefetchHint.SubtreeHasRuntimePrefetch\n }\n // And for eager prefetch. The bit is set directly on each eager segment, so\n // there's no separate segment-local flag — propagate it as-is.\n if (childHints & PrefetchHint.SubtreeHasEagerPrefetch) {\n parentHints |= PrefetchHint.SubtreeHasEagerPrefetch\n }\n // And for `instant = false`. Like eager prefetch, the bit is set directly on\n // each opted-out segment, so propagate it as-is.\n if (childHints & PrefetchHint.SubtreeHasInstantFalse) {\n parentHints |= PrefetchHint.SubtreeHasInstantFalse\n }\n return parentHints\n}\n\n/**\n * Individual Flight response path\n */\nexport type FlightSegmentPath =\n // Uses `any` as repeating pattern can't be typed.\n | any[]\n // Looks somewhat like this\n | [\n segment: Segment,\n parallelRouterKey: string,\n segment: Segment,\n parallelRouterKey: string,\n segment: Segment,\n parallelRouterKey: string,\n ]\n\n/**\n * Represents a tree of segments and the Flight data (i.e. React nodes) that\n * correspond to each one. The tree is isomorphic to the FlightRouterState;\n * however in the future we want to be able to fetch arbitrary partial segments\n * without having to fetch all its children. So this response format will\n * likely change.\n */\nexport type CacheNodeSeedData = [\n node: React.ReactNode | null,\n parallelRoutes: {\n [parallelRouterKey: string]: CacheNodeSeedData | null\n },\n // TODO: This field is no longer used. Remove it.\n loading: null,\n isPartial: boolean,\n /**\n * An AsyncIterable that yields the route params this segment accessed during\n * server rendering (one name per yield, deduped). Used by the client router\n * to determine cache key specificity - segments that only access certain\n * params can be reused across navigations where unaccessed params change.\n *\n * Does NOT include root params; those are emitted once at the top level of\n * the response (see `r` on the payload) and unioned in by the consumer.\n *\n * - null: tracking was not enabled for this render (e.g., not a prerender).\n * Treat conservatively - assume all params vary.\n * - Drains to empty Set: segment accesses no params (e.g., client components,\n * or server components that don't read params). Can be shared across all\n * param values.\n * - Drains to non-empty Set: segment depends on those params. Can only reuse\n * when those specific params match.\n */\n varyParams: VaryParamsIterable | null,\n]\n\nexport type FlightDataSegment = [\n /* segment of the rendered slice: */ Segment,\n /* treePatch */ FlightRouterState,\n /* cacheNodeSeedData */ CacheNodeSeedData | null, // Can be null during prefetch if there's no loading component\n /* head: viewport */ HeadData,\n /* isHeadPartial */ boolean,\n]\n\nexport type FlightDataPath =\n // Uses `any` as repeating pattern can't be typed.\n | any[]\n // Looks somewhat like this\n | [\n // Holds full path to the segment.\n ...FlightSegmentPath[],\n ...FlightDataSegment,\n ]\n\n/**\n * The Flight response data\n */\nexport type FlightData = Array<FlightDataPath> | string\n\n/**\n * Per-route prefetch hints computed at build time. Mirrors the shape of the\n * loader tree so hints can be traversed in parallel during router state\n * creation. Each node stores a bitmask of PrefetchHint flags\n * (ParentInlinedIntoSelf, InlinedIntoChild) computed by the segment size\n * measurement pass.\n *\n * Persisted to prefetch-hints.json as Record<string, PrefetchHints> (keyed\n * by route pattern) and loaded at server startup.\n */\nexport type PrefetchHints = {\n /** Bitmask of PrefetchHint flags for this segment. */\n hints: number\n /** Child hint nodes, keyed by parallel route key. */\n slots: Record<string, PrefetchHints> | null\n}\n\nexport type ActionResult = Promise<any>\n\nexport type InitialRSCPayload = {\n /** buildId, can be empty if the x-nextjs-build-id header is set */\n b?: string\n /** initialCanonicalUrlParts */\n c: string[]\n /** initialRenderedSearch */\n q: string\n /** couldBeIntercepted */\n i: boolean\n /** initialFlightData */\n f: FlightDataPath[]\n /** missingSlots */\n m: Set<string> | undefined\n /** GlobalError */\n G: [React.ComponentType<any>, React.ReactNode | undefined]\n /** supportsPerSegmentPrefetching */\n S: boolean\n /**\n * headVaryParams - vary params for the head (metadata) of the response.\n * Does not include root params (see `r`).\n */\n h: VaryParamsIterable | null\n /**\n * rootVaryParams - the root params accessed anywhere in the response, emitted\n * once. The client unions these into the head and every segment's vary\n * params, rather than the server folding them into each set.\n */\n r?: VaryParamsIterable\n /** staleTime in seconds - Only present when Cache Components is enabled. */\n s?: AsyncIterable<number>\n /** staticStageByteLength - Resolves when the static stage ends. */\n l?: Promise<number>\n /**\n * shellByteLength - Resolves when the shell stage ends.\n * If it resolves to null, then the shell is the same as the main response.\n * */\n a?: Promise<number | null>\n /** runtimePrefetchStream — Embedded runtime prefetch Flight stream. */\n p?: ReadableStream<Uint8Array>\n /**\n * dynamicStaleTime — Per-page BFCache stale time in seconds, from\n * `unstable_dynamicStaleTime`. Only included for dynamic renders. Controls\n * how long the client router cache retains dynamic navigation data. This is\n * distinct from the `s` field, which controls segment cache (prefetch)\n * staleness.\n */\n d?: number\n /**\n * revealAfter (dev only). Resolves once the server has flushed the\n * shell-stage content to the stream (static shell, or runtime-prefetchable\n * shell for runtime-prefetch routes), or earlier on a cache miss. The client\n * decodes this from the payload and defers resolving the response's deferred\n * RSCs on it, so a boundary's children aren't revealed before their row has\n * been decoded (which would flush a premature Suspense fallback). Its\n * resolution row follows the children's row in the payload, so the children\n * are decoded by the time the client unblocks. The HTML render gates on the\n * same signal server-side instead of reading this field.\n */\n _revealAfter?: Promise<void>\n}\n\n// Response from `createFromFetch` for normal rendering\nexport type NavigationFlightResponse = {\n /** buildId, can be empty if the x-nextjs-build-id header is set */\n b?: string\n /** flightData */\n f: FlightData\n /** supportsPerSegmentPrefetching */\n S: boolean\n /** renderedSearch */\n q: string\n /** couldBeIntercepted */\n i: boolean\n /** staleTime - Only present in dynamic runtime prefetch responses. */\n s?: AsyncIterable<number>\n /** staticStageByteLength - Resolves when the static stage ends. */\n l?: Promise<number>\n /**\n * shellByteLength - Resolves when the shell stage ends.\n * If it resolves to null, then the shell is the same as the main response.\n * */\n a?: Promise<number | null>\n /**\n * shellUsedSessionData - true if resolving session data\n * unblocked new content in the shell.\n * NOTE: only use this in runtime/session prefetch requests\n * where we have a proper session shell.\n * */\n u?: Promise<boolean>\n /** headVaryParams. Does not include root params (see `r`). */\n h: VaryParamsIterable | null\n /**\n * rootVaryParams - the root params accessed anywhere in the response, emitted\n * once. The client unions these into the head and every segment's vary\n * params.\n */\n r?: VaryParamsIterable\n /** runtimePrefetchStream — Embedded runtime prefetch Flight stream. */\n p?: ReadableStream<Uint8Array>\n /**\n * dynamicStaleTime — Per-page BFCache stale time in seconds, from\n * `unstable_dynamicStaleTime`. Only included for dynamic renders. Controls\n * how long the client router cache retains dynamic navigation data. This is\n * distinct from the `s` field, which controls segment cache (prefetch)\n * staleness.\n */\n d?: number\n /**\n * revealAfter (dev only). Resolves once the server has flushed the\n * shell-stage content to the stream (static shell, or runtime-prefetchable\n * shell for runtime-prefetch routes), or earlier on a cache miss. The client\n * decodes this from the payload and defers resolving the response's deferred\n * RSCs on it, so a boundary's children aren't revealed before their row has\n * been decoded (which would flush a premature Suspense fallback). Its\n * resolution row follows the children's row in the payload, so the children\n * are decoded by the time the client unblocks. The HTML render gates on the\n * same signal server-side instead of reading this field.\n */\n _revealAfter?: Promise<void>\n}\n\n// Response from `createFromFetch` for server actions. Action's flight data can be null\nexport type ActionFlightResponse = {\n /** actionResult */\n a: ActionResult\n /** buildId, can be empty if the x-nextjs-build-id header is set */\n b?: string\n /** flightData */\n f: FlightData\n /** renderedSearch */\n q: string\n /** couldBeIntercepted */\n i: boolean\n}\n\nexport type RSCPayload =\n | InitialRSCPayload\n | NavigationFlightResponse\n | ActionFlightResponse\n\nexport type InstantCookie =\n // pending (waiting to capture)\n | [captured: 0, id: string]\n // captured MPA page load\n | [captured: 1, id: string, state: null]\n // captured SPA navigation (from/to route trees)\n | [\n captured: 1,\n id: string,\n state: { from: FlightRouterState; to: FlightRouterState | null },\n ]\n"],"names":["PrefetchHint","StaticPrefetchDisabled","SubtreePrefetchHints","propagateSubtreeBits","parentHints","childHints"],"mappings":"AAAA;;;;;CAKC,GAiLD,OAAO,IAAA,AAAWA,sCAAAA;IAChB,gEAAgE;IAChE,2EAA2E;;IAE3E,wEAAwE;IACxE,+DAA+D;IAC/D,0EAA0E;IAC1E,mDAAmD;;IAEnD,kDAAkD;;IAElD,sEAAsE;IACtE,6DAA6D;;IAE7D,8EAA8E;IAC9E,2EAA2E;IAC3E,8BAA8B;;IAE9B,sEAAsE;IACtE,0DAA0D;;IAE1D,wEAAwE;IACxE,yEAAyE;;IAEzE,4EAA4E;IAC5E,6CAA6C;;IAE7C,wEAAwE;IACxE,4EAA4E;;IAE5E,oEAAoE;IACpE,0EAA0E;IAC1E,0EAA0E;IAC1E,kEAAkE;IAClE,0EAA0E;IAC1E,oBAAoB;;IAEpB,sDAAsD;IACtD,qDAAqD;;IAErD,sEAAsE;IACtE,mEAAmE;IACnE,kBAAkB;;IAElB,yEAAyE;IACzE,kEAAkE;IAClE,yEAAyE;IACzE,4EAA4E;IAC5E,wCAAwC;;IAExC,oEAAoE;IACpE,8EAA8E;IAC9E,kEAAkE;IAClE,+EAA+E;IAC/E,mCAAmC;;WAtDnBA;MAwDjB;AAED;;;;;;;;CAQC,GACD,OAAO,MAAMC,yBACXD,SAA+D;AAEjE;;;;;CAKC,GACD,OAAO,MAAME,uBACXF,2BAIoC;AAEtC;;;;;;;;;;CAUC,GACD,OAAO,SAASG,qBACdC,WAAmB,EACnBC,UAAkB;IAElB,IAAIA,gBAAwD;QAC1DD;IACF;IACA,+EAA+E;IAC/E,kDAAkD;IAClD,IACEC,aACCL,CAAAA,KACsC,GACvC;QACAI;IACF;IACA,iCAAiC;IACjC,IACEC,aACCL,CAAAA,QAAuE,GACxE;QACAI;IACF;IACA,4EAA4E;IAC5E,+DAA+D;IAC/D,IAAIC,mBAAmD;QACrDD;IACF;IACA,6EAA6E;IAC7E,iDAAiD;IACjD,IAAIC,mBAAkD;QACpDD;IACF;IACA,OAAOA;AACT","ignoreList":[0]} |
| export function isStableBuild() { | ||
| return !"16.3.0-preview.4"?.includes('canary') && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV; | ||
| return !"16.3.0-preview.5"?.includes('canary') && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV; | ||
| } | ||
@@ -4,0 +4,0 @@ export class CanaryOnlyConfigError extends Error { |
@@ -75,3 +75,3 @@ "use strict"; | ||
| const data = await res.json(); | ||
| const versionData = data.versions["16.3.0-preview.4"]; | ||
| const versionData = data.versions["16.3.0-preview.5"]; | ||
| return { | ||
@@ -104,3 +104,3 @@ os: versionData.os, | ||
| lockfileParsed.dependencies[pkg] = { | ||
| version: "16.3.0-preview.4", | ||
| version: "16.3.0-preview.5", | ||
| resolved: pkgData.tarball, | ||
@@ -113,3 +113,3 @@ integrity: pkgData.integrity, | ||
| lockfileParsed.packages[pkg] = { | ||
| version: "16.3.0-preview.4", | ||
| version: "16.3.0-preview.5", | ||
| resolved: pkgData.tarball, | ||
@@ -116,0 +116,0 @@ integrity: pkgData.integrity, |
@@ -96,2 +96,7 @@ "use strict"; | ||
| prefetchHints |= _approutertypes.PrefetchHint.SubtreeHasPartialPrefetching; | ||
| } else if (instantConfig === false) { | ||
| // The segment explicitly opts out of Partial Prefetching. We don't change | ||
| // the prefetch behavior, but we record it so the dev-time | ||
| // `<Link prefetch={true}>` warning can be suppressed for this route. | ||
| prefetchHints |= _approutertypes.PrefetchHint.SubtreeHasInstantFalse; | ||
| } | ||
@@ -98,0 +103,0 @@ if (prefetchConfig === 'partial') { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/server/app-render/create-flight-router-state-from-loader-tree.ts"],"sourcesContent":["import type { LoaderTree } from '../lib/app-dir-module'\nimport {\n PrefetchHint,\n propagateSubtreeBits,\n type FlightRouterState,\n type PrefetchHints,\n} from '../../shared/lib/app-router-types'\nimport type { GetDynamicParamFromSegment } from './app-render'\nimport { addSearchParamsIfPageSegment } from '../../shared/lib/segment'\nimport type { AppSegmentConfig } from '../../build/segment-config/app/app-segment-config'\n\nasync function createFlightRouterStateFromLoaderTreeImpl(\n loaderTree: LoaderTree,\n hintTree: PrefetchHints | null,\n prefetchInliningEnabled: boolean,\n cacheComponents: boolean,\n partialPrefetching: boolean | 'unstable_eager' | undefined,\n isStaticGeneration: boolean,\n isBuildTimePrerendering: boolean,\n getDynamicParamFromSegment: GetDynamicParamFromSegment,\n searchParams: any,\n didFindRootLayout: boolean\n): Promise<FlightRouterState> {\n const [segment, parallelRoutes, { layout, loading, page }] = loaderTree\n const dynamicParam = getDynamicParamFromSegment(loaderTree)\n const treeSegment = dynamicParam ? dynamicParam.treeSegment : segment\n\n const segmentTree: FlightRouterState = [\n addSearchParamsIfPageSegment(treeSegment, searchParams),\n {},\n ]\n\n // Load the layout or page module to check its instant and prefetch\n // configs. When a segment doesn't export prefetch, it defaults to\n // 'partial' if the app has opted into partial prefetching globally via the\n // `partialPrefetching` config in next.config.js.\n const mod = layout ? await layout[0]() : page ? await page[0]() : undefined\n const instantConfig = mod ? (mod as AppSegmentConfig).instant : undefined\n const prefetchConfig =\n (mod ? (mod as AppSegmentConfig).prefetch : undefined) ??\n (partialPrefetching === 'unstable_eager'\n ? 'unstable_eager'\n : partialPrefetching\n ? 'partial'\n : undefined)\n let prefetchHints = 0\n\n // Union in the precomputed build-time hints (e.g. segment inlining\n // decisions) if available. When hints are not available (e.g. dev mode or\n // if prefetch-hints.json was not generated), we fall through and still\n // compute the other hints below. In the future this should be a build\n // error, but for now we gracefully degrade.\n //\n // TODO: Move more of the hints computation (IsRootLayoutOrAbove, instant config,\n // loading boundary detection) into the build-time measurement step in\n // collectPrefetchHints, so this function only needs to union the\n // precomputed bitmask rather than re-derive hints on every render.\n if (hintTree !== null) {\n prefetchHints |= hintTree.hints\n } else if (prefetchInliningEnabled) {\n if (isBuildTimePrerendering) {\n // Prefetch inlining is enabled but no hint tree was provided during a\n // build-time prerender. This happens for the initial RSC payload\n // generated before collectPrefetchHints has run. Mark so the client\n // can expire the route cache entry and re-fetch the tree with correct\n // hints.\n prefetchHints |= PrefetchHint.InliningHintsStale\n } else if (isStaticGeneration) {\n // TODO(#91407): Temporary mitigation: when hints are missing during\n // runtime static generation, fall back to treating every segment as\n // unprefetchable. This currently happens for routes with\n // `instant = false` at the root segment, which causes the prerender\n // to run per-request instead of being cached, and the prefetch hints\n // manifest is not available.\n //\n // Once that bug is fixed, this branch should become an error again —\n // hints should always be available from the manifest during ISR.\n prefetchHints |= PrefetchHint.PrefetchDisabled\n } else if (cacheComponents) {\n // At runtime with no hint tree, this is a fully dynamic route with no\n // manifest entry. Treat every segment as unprefetchable. Do NOT set\n // InliningHintsStale — that would cause the client to enter an\n // infinite re-fetch loop trying to get hints that will never exist.\n prefetchHints |= PrefetchHint.PrefetchDisabled\n } else {\n // Without cacheComponents, dynamic pages have no static shell so\n // hints are never computed. Don't disable prefetching — just skip\n // the inlining hint system and let prefetching proceed normally.\n }\n }\n\n // Mark every segment at or above the root layout (i.e. until we descend past\n // the first segment that has a layout).\n if (!didFindRootLayout) {\n prefetchHints |= PrefetchHint.IsRootLayoutOrAbove\n if (typeof layout !== 'undefined') {\n // This segment is the root layout; its descendants are below it.\n didFindRootLayout = true\n }\n }\n\n const isInstant =\n instantConfig === true ||\n (typeof instantConfig === 'object' && instantConfig !== null)\n if (isInstant) {\n prefetchHints |= PrefetchHint.SubtreeHasPartialPrefetching\n }\n\n if (prefetchConfig === 'partial') {\n prefetchHints |= PrefetchHint.SubtreeHasPartialPrefetching\n } else if (prefetchConfig === 'unstable_eager') {\n // Like 'partial' (uses the PPR fetch strategy) but also marks the segment\n // as eager, so App Shells keeps prefetching it instead of relying on the\n // shared app shell.\n prefetchHints |=\n PrefetchHint.SubtreeHasPartialPrefetching |\n PrefetchHint.SubtreeHasEagerPrefetch\n } else if (prefetchConfig === 'force-disabled') {\n prefetchHints |= PrefetchHint.PrefetchDisabled\n } else if (prefetchConfig === 'allow-runtime') {\n prefetchHints |= PrefetchHint.HasRuntimePrefetch\n }\n\n // Mark the segment as \"eager\" unless its effective prefetch strategy is\n // 'partial' or 'allow-runtime'. A truthy instant is treated as\n // 'partial' (not eager). 'unstable_eager' already set the bit above. Under\n // App Shells, a subtree with no eager segment skips its Speculative prefetch\n // and relies on the shared app shell instead.\n if (\n !isInstant &&\n prefetchConfig !== 'partial' &&\n prefetchConfig !== 'allow-runtime'\n ) {\n prefetchHints |= PrefetchHint.SubtreeHasEagerPrefetch\n }\n\n // Check if this segment has a loading boundary\n if (loading) {\n prefetchHints |= PrefetchHint.SegmentHasLoadingBoundary\n }\n\n const children: FlightRouterState[1] = {}\n for (const parallelRouteKey in parallelRoutes) {\n // Look up the child hint node by parallel route key, traversing the\n // hint tree in parallel with the loader tree.\n const childHintNode = hintTree?.slots?.[parallelRouteKey] ?? null\n\n const child = await createFlightRouterStateFromLoaderTreeImpl(\n parallelRoutes[parallelRouteKey],\n childHintNode,\n prefetchInliningEnabled,\n cacheComponents,\n partialPrefetching,\n isStaticGeneration,\n isBuildTimePrerendering,\n getDynamicParamFromSegment,\n searchParams,\n didFindRootLayout\n )\n // Propagate subtree flags from children\n if (child[4] !== undefined) {\n prefetchHints = propagateSubtreeBits(prefetchHints, child[4])\n }\n children[parallelRouteKey] = child\n }\n segmentTree[1] = children\n\n if (prefetchHints !== 0) {\n segmentTree[4] = prefetchHints\n }\n\n return segmentTree\n}\n\nexport async function createFlightRouterStateFromLoaderTree(\n loaderTree: LoaderTree,\n hintTree: PrefetchHints | null,\n prefetchInliningEnabled: boolean,\n cacheComponents: boolean,\n partialPrefetching: boolean | 'unstable_eager' | undefined,\n isStaticGeneration: boolean,\n isBuildTimePrerendering: boolean,\n getDynamicParamFromSegment: GetDynamicParamFromSegment,\n searchParams: any,\n // Whether a root layout was already found above this loader tree slice, so a\n // slice that starts below the root layout doesn't mark a sub-layout as the\n // root layout.\n didFindRootLayout: boolean = false\n): Promise<FlightRouterState> {\n return createFlightRouterStateFromLoaderTreeImpl(\n loaderTree,\n hintTree,\n prefetchInliningEnabled,\n cacheComponents,\n partialPrefetching,\n isStaticGeneration,\n isBuildTimePrerendering,\n getDynamicParamFromSegment,\n searchParams,\n didFindRootLayout\n )\n}\n\nexport async function createRouteTreePrefetch(\n loaderTree: LoaderTree,\n hintTree: PrefetchHints | null,\n prefetchInliningEnabled: boolean,\n cacheComponents: boolean,\n partialPrefetching: boolean | 'unstable_eager' | undefined,\n isStaticGeneration: boolean,\n isBuildTimePrerendering: boolean,\n getDynamicParamFromSegment: GetDynamicParamFromSegment,\n // See note on createFlightRouterStateFromLoaderTree's didFindRootLayout.\n didFindRootLayout: boolean = false\n): Promise<FlightRouterState> {\n // Search params should not be added to page segment's cache key during a\n // route tree prefetch request, because they do not affect the structure of\n // the route. The client cache has its own logic to handle search params.\n const searchParams = {}\n return createFlightRouterStateFromLoaderTreeImpl(\n loaderTree,\n hintTree,\n prefetchInliningEnabled,\n cacheComponents,\n partialPrefetching,\n isStaticGeneration,\n isBuildTimePrerendering,\n getDynamicParamFromSegment,\n searchParams,\n didFindRootLayout\n )\n}\n"],"names":["createFlightRouterStateFromLoaderTree","createRouteTreePrefetch","createFlightRouterStateFromLoaderTreeImpl","loaderTree","hintTree","prefetchInliningEnabled","cacheComponents","partialPrefetching","isStaticGeneration","isBuildTimePrerendering","getDynamicParamFromSegment","searchParams","didFindRootLayout","segment","parallelRoutes","layout","loading","page","dynamicParam","treeSegment","segmentTree","addSearchParamsIfPageSegment","mod","undefined","instantConfig","instant","prefetchConfig","prefetch","prefetchHints","hints","PrefetchHint","InliningHintsStale","PrefetchDisabled","IsRootLayoutOrAbove","isInstant","SubtreeHasPartialPrefetching","SubtreeHasEagerPrefetch","HasRuntimePrefetch","SegmentHasLoadingBoundary","children","parallelRouteKey","childHintNode","slots","child","propagateSubtreeBits"],"mappings":";;;;;;;;;;;;;;;IA8KsBA,qCAAqC;eAArCA;;IA6BAC,uBAAuB;eAAvBA;;;gCArMf;yBAEsC;AAG7C,eAAeC,0CACbC,UAAsB,EACtBC,QAA8B,EAC9BC,uBAAgC,EAChCC,eAAwB,EACxBC,kBAA0D,EAC1DC,kBAA2B,EAC3BC,uBAAgC,EAChCC,0BAAsD,EACtDC,YAAiB,EACjBC,iBAA0B;IAE1B,MAAM,CAACC,SAASC,gBAAgB,EAAEC,MAAM,EAAEC,OAAO,EAAEC,IAAI,EAAE,CAAC,GAAGd;IAC7D,MAAMe,eAAeR,2BAA2BP;IAChD,MAAMgB,cAAcD,eAAeA,aAAaC,WAAW,GAAGN;IAE9D,MAAMO,cAAiC;QACrCC,IAAAA,qCAA4B,EAACF,aAAaR;QAC1C,CAAC;KACF;IAED,mEAAmE;IACnE,kEAAkE;IAClE,2EAA2E;IAC3E,iDAAiD;IACjD,MAAMW,MAAMP,SAAS,MAAMA,MAAM,CAAC,EAAE,KAAKE,OAAO,MAAMA,IAAI,CAAC,EAAE,KAAKM;IAClE,MAAMC,gBAAgBF,MAAM,AAACA,IAAyBG,OAAO,GAAGF;IAChE,MAAMG,iBACJ,AAACJ,CAAAA,MAAM,AAACA,IAAyBK,QAAQ,GAAGJ,SAAQ,KACnDhB,CAAAA,uBAAuB,mBACpB,mBACAA,qBACE,YACAgB,SAAQ;IAChB,IAAIK,gBAAgB;IAEpB,mEAAmE;IACnE,0EAA0E;IAC1E,uEAAuE;IACvE,sEAAsE;IACtE,4CAA4C;IAC5C,EAAE;IACF,iFAAiF;IACjF,sEAAsE;IACtE,iEAAiE;IACjE,mEAAmE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;AAEJ;AAEO,eAAeX,wBACpBE,UAAsB,EACtBC,QAA8B,EAC9BC,uBAAgC,EAChCC,eAAwB,EACxBC,kBAA0D,EAC1DC,kBAA2B,EAC3BC,uBAAgC,EAChCC,0BAAsD,EACtD,yEAAyE;AACzEE,oBAA6B,KAAK;IAElC,yEAAyE;IACzE,2EAA2E;IAC3E,yEAAyE;IACzE,MAAMD,eAAe,CAAC;IACtB,OAAOT,0CACLC,YACAC,UACAC,yBACAC,iBACAC,oBACAC,oBACAC,yBACAC,4BACAC,cACAC;AAEJ","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/server/app-render/create-flight-router-state-from-loader-tree.ts"],"sourcesContent":["import type { LoaderTree } from '../lib/app-dir-module'\nimport {\n PrefetchHint,\n propagateSubtreeBits,\n type FlightRouterState,\n type PrefetchHints,\n} from '../../shared/lib/app-router-types'\nimport type { GetDynamicParamFromSegment } from './app-render'\nimport { addSearchParamsIfPageSegment } from '../../shared/lib/segment'\nimport type { AppSegmentConfig } from '../../build/segment-config/app/app-segment-config'\n\nasync function createFlightRouterStateFromLoaderTreeImpl(\n loaderTree: LoaderTree,\n hintTree: PrefetchHints | null,\n prefetchInliningEnabled: boolean,\n cacheComponents: boolean,\n partialPrefetching: boolean | 'unstable_eager' | undefined,\n isStaticGeneration: boolean,\n isBuildTimePrerendering: boolean,\n getDynamicParamFromSegment: GetDynamicParamFromSegment,\n searchParams: any,\n didFindRootLayout: boolean\n): Promise<FlightRouterState> {\n const [segment, parallelRoutes, { layout, loading, page }] = loaderTree\n const dynamicParam = getDynamicParamFromSegment(loaderTree)\n const treeSegment = dynamicParam ? dynamicParam.treeSegment : segment\n\n const segmentTree: FlightRouterState = [\n addSearchParamsIfPageSegment(treeSegment, searchParams),\n {},\n ]\n\n // Load the layout or page module to check its instant and prefetch\n // configs. When a segment doesn't export prefetch, it defaults to\n // 'partial' if the app has opted into partial prefetching globally via the\n // `partialPrefetching` config in next.config.js.\n const mod = layout ? await layout[0]() : page ? await page[0]() : undefined\n const instantConfig = mod ? (mod as AppSegmentConfig).instant : undefined\n const prefetchConfig =\n (mod ? (mod as AppSegmentConfig).prefetch : undefined) ??\n (partialPrefetching === 'unstable_eager'\n ? 'unstable_eager'\n : partialPrefetching\n ? 'partial'\n : undefined)\n let prefetchHints = 0\n\n // Union in the precomputed build-time hints (e.g. segment inlining\n // decisions) if available. When hints are not available (e.g. dev mode or\n // if prefetch-hints.json was not generated), we fall through and still\n // compute the other hints below. In the future this should be a build\n // error, but for now we gracefully degrade.\n //\n // TODO: Move more of the hints computation (IsRootLayoutOrAbove, instant config,\n // loading boundary detection) into the build-time measurement step in\n // collectPrefetchHints, so this function only needs to union the\n // precomputed bitmask rather than re-derive hints on every render.\n if (hintTree !== null) {\n prefetchHints |= hintTree.hints\n } else if (prefetchInliningEnabled) {\n if (isBuildTimePrerendering) {\n // Prefetch inlining is enabled but no hint tree was provided during a\n // build-time prerender. This happens for the initial RSC payload\n // generated before collectPrefetchHints has run. Mark so the client\n // can expire the route cache entry and re-fetch the tree with correct\n // hints.\n prefetchHints |= PrefetchHint.InliningHintsStale\n } else if (isStaticGeneration) {\n // TODO(#91407): Temporary mitigation: when hints are missing during\n // runtime static generation, fall back to treating every segment as\n // unprefetchable. This currently happens for routes with\n // `instant = false` at the root segment, which causes the prerender\n // to run per-request instead of being cached, and the prefetch hints\n // manifest is not available.\n //\n // Once that bug is fixed, this branch should become an error again —\n // hints should always be available from the manifest during ISR.\n prefetchHints |= PrefetchHint.PrefetchDisabled\n } else if (cacheComponents) {\n // At runtime with no hint tree, this is a fully dynamic route with no\n // manifest entry. Treat every segment as unprefetchable. Do NOT set\n // InliningHintsStale — that would cause the client to enter an\n // infinite re-fetch loop trying to get hints that will never exist.\n prefetchHints |= PrefetchHint.PrefetchDisabled\n } else {\n // Without cacheComponents, dynamic pages have no static shell so\n // hints are never computed. Don't disable prefetching — just skip\n // the inlining hint system and let prefetching proceed normally.\n }\n }\n\n // Mark every segment at or above the root layout (i.e. until we descend past\n // the first segment that has a layout).\n if (!didFindRootLayout) {\n prefetchHints |= PrefetchHint.IsRootLayoutOrAbove\n if (typeof layout !== 'undefined') {\n // This segment is the root layout; its descendants are below it.\n didFindRootLayout = true\n }\n }\n\n const isInstant =\n instantConfig === true ||\n (typeof instantConfig === 'object' && instantConfig !== null)\n if (isInstant) {\n prefetchHints |= PrefetchHint.SubtreeHasPartialPrefetching\n } else if (instantConfig === false) {\n // The segment explicitly opts out of Partial Prefetching. We don't change\n // the prefetch behavior, but we record it so the dev-time\n // `<Link prefetch={true}>` warning can be suppressed for this route.\n prefetchHints |= PrefetchHint.SubtreeHasInstantFalse\n }\n\n if (prefetchConfig === 'partial') {\n prefetchHints |= PrefetchHint.SubtreeHasPartialPrefetching\n } else if (prefetchConfig === 'unstable_eager') {\n // Like 'partial' (uses the PPR fetch strategy) but also marks the segment\n // as eager, so App Shells keeps prefetching it instead of relying on the\n // shared app shell.\n prefetchHints |=\n PrefetchHint.SubtreeHasPartialPrefetching |\n PrefetchHint.SubtreeHasEagerPrefetch\n } else if (prefetchConfig === 'force-disabled') {\n prefetchHints |= PrefetchHint.PrefetchDisabled\n } else if (prefetchConfig === 'allow-runtime') {\n prefetchHints |= PrefetchHint.HasRuntimePrefetch\n }\n\n // Mark the segment as \"eager\" unless its effective prefetch strategy is\n // 'partial' or 'allow-runtime'. A truthy instant is treated as\n // 'partial' (not eager). 'unstable_eager' already set the bit above. Under\n // App Shells, a subtree with no eager segment skips its Speculative prefetch\n // and relies on the shared app shell instead.\n if (\n !isInstant &&\n prefetchConfig !== 'partial' &&\n prefetchConfig !== 'allow-runtime'\n ) {\n prefetchHints |= PrefetchHint.SubtreeHasEagerPrefetch\n }\n\n // Check if this segment has a loading boundary\n if (loading) {\n prefetchHints |= PrefetchHint.SegmentHasLoadingBoundary\n }\n\n const children: FlightRouterState[1] = {}\n for (const parallelRouteKey in parallelRoutes) {\n // Look up the child hint node by parallel route key, traversing the\n // hint tree in parallel with the loader tree.\n const childHintNode = hintTree?.slots?.[parallelRouteKey] ?? null\n\n const child = await createFlightRouterStateFromLoaderTreeImpl(\n parallelRoutes[parallelRouteKey],\n childHintNode,\n prefetchInliningEnabled,\n cacheComponents,\n partialPrefetching,\n isStaticGeneration,\n isBuildTimePrerendering,\n getDynamicParamFromSegment,\n searchParams,\n didFindRootLayout\n )\n // Propagate subtree flags from children\n if (child[4] !== undefined) {\n prefetchHints = propagateSubtreeBits(prefetchHints, child[4])\n }\n children[parallelRouteKey] = child\n }\n segmentTree[1] = children\n\n if (prefetchHints !== 0) {\n segmentTree[4] = prefetchHints\n }\n\n return segmentTree\n}\n\nexport async function createFlightRouterStateFromLoaderTree(\n loaderTree: LoaderTree,\n hintTree: PrefetchHints | null,\n prefetchInliningEnabled: boolean,\n cacheComponents: boolean,\n partialPrefetching: boolean | 'unstable_eager' | undefined,\n isStaticGeneration: boolean,\n isBuildTimePrerendering: boolean,\n getDynamicParamFromSegment: GetDynamicParamFromSegment,\n searchParams: any,\n // Whether a root layout was already found above this loader tree slice, so a\n // slice that starts below the root layout doesn't mark a sub-layout as the\n // root layout.\n didFindRootLayout: boolean = false\n): Promise<FlightRouterState> {\n return createFlightRouterStateFromLoaderTreeImpl(\n loaderTree,\n hintTree,\n prefetchInliningEnabled,\n cacheComponents,\n partialPrefetching,\n isStaticGeneration,\n isBuildTimePrerendering,\n getDynamicParamFromSegment,\n searchParams,\n didFindRootLayout\n )\n}\n\nexport async function createRouteTreePrefetch(\n loaderTree: LoaderTree,\n hintTree: PrefetchHints | null,\n prefetchInliningEnabled: boolean,\n cacheComponents: boolean,\n partialPrefetching: boolean | 'unstable_eager' | undefined,\n isStaticGeneration: boolean,\n isBuildTimePrerendering: boolean,\n getDynamicParamFromSegment: GetDynamicParamFromSegment,\n // See note on createFlightRouterStateFromLoaderTree's didFindRootLayout.\n didFindRootLayout: boolean = false\n): Promise<FlightRouterState> {\n // Search params should not be added to page segment's cache key during a\n // route tree prefetch request, because they do not affect the structure of\n // the route. The client cache has its own logic to handle search params.\n const searchParams = {}\n return createFlightRouterStateFromLoaderTreeImpl(\n loaderTree,\n hintTree,\n prefetchInliningEnabled,\n cacheComponents,\n partialPrefetching,\n isStaticGeneration,\n isBuildTimePrerendering,\n getDynamicParamFromSegment,\n searchParams,\n didFindRootLayout\n )\n}\n"],"names":["createFlightRouterStateFromLoaderTree","createRouteTreePrefetch","createFlightRouterStateFromLoaderTreeImpl","loaderTree","hintTree","prefetchInliningEnabled","cacheComponents","partialPrefetching","isStaticGeneration","isBuildTimePrerendering","getDynamicParamFromSegment","searchParams","didFindRootLayout","segment","parallelRoutes","layout","loading","page","dynamicParam","treeSegment","segmentTree","addSearchParamsIfPageSegment","mod","undefined","instantConfig","instant","prefetchConfig","prefetch","prefetchHints","hints","PrefetchHint","InliningHintsStale","PrefetchDisabled","IsRootLayoutOrAbove","isInstant","SubtreeHasPartialPrefetching","SubtreeHasInstantFalse","SubtreeHasEagerPrefetch","HasRuntimePrefetch","SegmentHasLoadingBoundary","children","parallelRouteKey","childHintNode","slots","child","propagateSubtreeBits"],"mappings":";;;;;;;;;;;;;;;IAmLsBA,qCAAqC;eAArCA;;IA6BAC,uBAAuB;eAAvBA;;;gCA1Mf;yBAEsC;AAG7C,eAAeC,0CACbC,UAAsB,EACtBC,QAA8B,EAC9BC,uBAAgC,EAChCC,eAAwB,EACxBC,kBAA0D,EAC1DC,kBAA2B,EAC3BC,uBAAgC,EAChCC,0BAAsD,EACtDC,YAAiB,EACjBC,iBAA0B;IAE1B,MAAM,CAACC,SAASC,gBAAgB,EAAEC,MAAM,EAAEC,OAAO,EAAEC,IAAI,EAAE,CAAC,GAAGd;IAC7D,MAAMe,eAAeR,2BAA2BP;IAChD,MAAMgB,cAAcD,eAAeA,aAAaC,WAAW,GAAGN;IAE9D,MAAMO,cAAiC;QACrCC,IAAAA,qCAA4B,EAACF,aAAaR;QAC1C,CAAC;KACF;IAED,mEAAmE;IACnE,kEAAkE;IAClE,2EAA2E;IAC3E,iDAAiD;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IAAIgC,KAAK,CAAC,EAAE,KAAKrB,WAAW;YAC1BK,gBAAgBiB,IAAAA,oCAAoB,EAACjB,eAAegB,KAAK,CAAC,EAAE;QAC9D;QACAJ,QAAQ,CAACC,iBAAiB,GAAGG;IAC/B;IACAxB,WAAW,CAAC,EAAE,GAAGoB;IAEjB,IAAIZ,kBAAkB,GAAG;QACvBR,WAAW,CAAC,EAAE,GAAGQ;IACnB;IAEA,OAAOR;AACT;AAEO,eAAepB,sCACpBG,UAAsB,EACtBC,QAA8B,EAC9BC,uBAAgC,EAChCC,eAAwB,EACxBC,kBAA0D,EAC1DC,kBAA2B,EAC3BC,uBAAgC,EAChCC,0BAAsD,EACtDC,YAAiB,EACjB,6EAA6E;AAC7E,2EAA2E;AAC3E,eAAe;AACfC,oBAA6B,KAAK;IAElC,OAAOV,0CACLC,YACAC,UACAC,yBACAC,iBACAC,oBACAC,oBACAC,yBACAC,4BACAC,cACAC;AAEJ;AAEO,eAAeX,wBACpBE,UAAsB,EACtBC,QAA8B,EAC9BC,uBAAgC,EAChCC,eAAwB,EACxBC,kBAA0D,EAC1DC,kBAA2B,EAC3BC,uBAAgC,EAChCC,0BAAsD,EACtD,yEAAyE;AACzEE,oBAA6B,KAAK;IAElC,yEAAyE;IACzE,2EAA2E;IAC3E,yEAAyE;IACzE,MAAMD,eAAe,CAAC;IACtB,OAAOT,0CACLC,YACAC,UACAC,yBACAC,iBACAC,oBACAC,oBACAC,yBACAC,4BACAC,cACAC;AAEJ","ignoreList":[0]} |
@@ -24,2 +24,3 @@ export { createTemporaryReferenceSet, renderToReadableStream, decodeReply, decodeAction, decodeFormState, } from 'react-server-dom-webpack/server'; | ||
| export { preloadStyle, preloadFont, preconnect } from './rsc/preloads'; | ||
| export { isEmptyHTMLPrelude } from './postponed-state'; | ||
| export { Postpone } from './rsc/postpone'; | ||
@@ -26,0 +27,0 @@ export { taintObjectReference } from './rsc/taint'; |
@@ -32,2 +32,3 @@ // eslint-disable-next-line import/no-extraneous-dependencies | ||
| decodeReply: null, | ||
| isEmptyHTMLPrelude: null, | ||
| patchFetch: null, | ||
@@ -126,2 +127,5 @@ preconnect: null, | ||
| }, | ||
| isEmptyHTMLPrelude: function() { | ||
| return _postponedstate.isEmptyHTMLPrelude; | ||
| }, | ||
| patchFetch: function() { | ||
@@ -172,2 +176,3 @@ return patchFetch; | ||
| const _preloads = require("./rsc/preloads"); | ||
| const _postponedstate = require("./postponed-state"); | ||
| const _postpone = require("./rsc/postpone"); | ||
@@ -174,0 +179,0 @@ const _taint = require("./rsc/taint"); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/server/app-render/entry-base.ts"],"sourcesContent":["// eslint-disable-next-line import/no-extraneous-dependencies\nexport {\n createTemporaryReferenceSet,\n renderToReadableStream,\n decodeReply,\n decodeAction,\n decodeFormState,\n} from 'react-server-dom-webpack/server'\n\n// eslint-disable-next-line import/no-extraneous-dependencies\nexport { prerender } from 'react-server-dom-webpack/static'\n\n// Node.js-specific Flight APIs, needed by stream-ops.node.ts via ComponentMod.\n// These must be exported from entry-base (react-server layer) because direct\n// imports from react-server-dom-webpack/* fail outside this layer.\ntype FlightRenderToPipeableStream = (...args: any[]) => {\n pipe<Writable extends NodeJS.WritableStream>(destination: Writable): Writable\n abort: (reason?: unknown) => void\n}\n\ntype FlightPrerenderToNodeStream = (...args: any[]) => Promise<{\n prelude: import('node:stream').Readable\n}>\n\n/* eslint-disable import/no-extraneous-dependencies */\nexport let renderToPipeableStream: FlightRenderToPipeableStream | undefined\nexport let prerenderToNodeStream: FlightPrerenderToNodeStream | undefined\nif (process.env.__NEXT_USE_NODE_STREAMS) {\n renderToPipeableStream = (\n require('react-server-dom-webpack/server.node') as typeof import('react-server-dom-webpack/server.node')\n ).renderToPipeableStream\n prerenderToNodeStream = (\n require('react-server-dom-webpack/static') as typeof import('react-server-dom-webpack/static')\n ).prerenderToNodeStream\n} else {\n renderToPipeableStream = undefined\n prerenderToNodeStream = undefined\n}\n/* eslint-enable import/no-extraneous-dependencies */\n\n// TODO: Just re-export `* as ReactServer`\nexport { captureOwnerStack, createElement, Fragment } from 'react'\n\nexport {\n default as LayoutRouter,\n LoadingBoundaryProvider,\n} from '../../client/components/layout-router'\nexport { default as RenderFromTemplateContext } from '../../client/components/render-from-template-context'\nexport { ClientPageRoot } from '../../client/components/client-page'\nexport { ClientSegmentRoot } from '../../client/components/client-segment'\nexport {\n createServerSearchParamsForServerPage,\n createPrerenderSearchParamsForClientPage,\n} from '../request/search-params'\nexport {\n createServerParamsForServerSegment,\n createPrerenderParamsForClientSegment,\n} from '../request/params'\nexport * as serverHooks from '../../client/components/hooks-server-context'\nexport { HTTPAccessFallbackBoundary } from '../../client/components/http-access-fallback/error-boundary'\nexport { createMetadataComponents } from '../../lib/metadata/metadata'\nexport { RootLayoutBoundary } from '../../lib/framework/boundary-components'\n\nexport { preloadStyle, preloadFont, preconnect } from './rsc/preloads'\nexport { Postpone } from './rsc/postpone'\nexport { taintObjectReference } from './rsc/taint'\nexport {\n collectSegmentData,\n collectPrefetchHints,\n} from './collect-segment-data'\n\nexport const InstantValidation = () => {\n if (\n process.env.NEXT_RUNTIME !== 'edge' &&\n process.env.__NEXT_CACHE_COMPONENTS\n ) {\n return require('./instant-validation/instant-validation') as typeof import('./instant-validation/instant-validation')\n } else {\n return undefined\n }\n}\n\nimport type { NodeJsPartialHmrUpdate } from '../../build/swc/types'\nimport { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { workUnitAsyncStorage } from './work-unit-async-storage.external'\nimport { patchFetch as _patchFetch } from '../lib/patch-fetch'\n\nlet SegmentViewNode: typeof import('../../next-devtools/userspace/app/segment-explorer-node').SegmentViewNode =\n () => null\nlet SegmentViewStateNode: typeof import('../../next-devtools/userspace/app/segment-explorer-node').SegmentViewStateNode =\n () => null\nif (process.env.NODE_ENV === 'development') {\n const mod =\n require('../../next-devtools/userspace/app/segment-explorer-node') as typeof import('../../next-devtools/userspace/app/segment-explorer-node')\n SegmentViewNode = mod.SegmentViewNode\n SegmentViewStateNode = mod.SegmentViewStateNode\n}\n\n// For hot-reloader\ndeclare global {\n var __next__clear_chunk_cache__: (() => void) | null | undefined\n var __turbopack_clear_chunk_cache__: () => void | null | undefined\n var __turbopack_server_hmr_apply__:\n | ((update: NodeJsPartialHmrUpdate) => boolean)\n | undefined\n}\n\n// hot-reloader modules are not bundled so we need to inject `__next__clear_chunk_cache__`\n// into globalThis from this file which is bundled.\nif (process.env.TURBOPACK) {\n globalThis.__next__clear_chunk_cache__ = __turbopack_clear_chunk_cache__\n} else {\n // Webpack does not have chunks on the server\n globalThis.__next__clear_chunk_cache__ = null\n}\n\n// patchFetch makes use of APIs such as `React.unstable_postpone` which are only available\n// in the experimental channel of React, so export it from here so that it comes from the bundled runtime\nexport function patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage,\n })\n}\n\n// Development only\nexport { SegmentViewNode, SegmentViewStateNode }\n"],"names":["ClientPageRoot","ClientSegmentRoot","Fragment","HTTPAccessFallbackBoundary","InstantValidation","LayoutRouter","LoadingBoundaryProvider","Postpone","RenderFromTemplateContext","RootLayoutBoundary","SegmentViewNode","SegmentViewStateNode","captureOwnerStack","collectPrefetchHints","collectSegmentData","createElement","createMetadataComponents","createPrerenderParamsForClientSegment","createPrerenderSearchParamsForClientPage","createServerParamsForServerSegment","createServerSearchParamsForServerPage","createTemporaryReferenceSet","decodeAction","decodeFormState","decodeReply","patchFetch","preconnect","preloadFont","preloadStyle","prerender","prerenderToNodeStream","renderToPipeableStream","renderToReadableStream","serverHooks","taintObjectReference","process","env","__NEXT_USE_NODE_STREAMS","require","undefined","NEXT_RUNTIME","__NEXT_CACHE_COMPONENTS","NODE_ENV","mod","TURBOPACK","globalThis","__next__clear_chunk_cache__","__turbopack_clear_chunk_cache__","_patchFetch","workAsyncStorage","workUnitAsyncStorage"],"mappings":"AAAA,6DAA6D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAg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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA5DnC,IAAIH;AACJ,IAAID;AACX,IAAIK,QAAQC,GAAG,CAACC,uBAAuB,EAAE;IACvCN,yBAAyB,AACvBO,QAAQ,wCACRP,sBAAsB;IACxBD,wBAAwB,AACtBQ,QAAQ,mCACRR,qBAAqB;AACzB,OAAO;IACLC,yBAAyBQ;IACzBT,wBAAwBS;AAC1B;AAkCO,MAAMnC,oBAAoB;IAC/B,IACE+B,QAAQC,GAAG,CAACI,YAAY,KAAK,UAC7BL,QAAQC,GAAG,CAACK,uBAAuB,EACnC;QACA,OAAOH,QAAQ;IACjB,OAAO;QACL,OAAOC;IACT;AACF;AAOA,IAAI7B,kBACF,IAAM;AACR,IAAIC,uBACF,IAAM;AACR,IAAIwB,QAAQC,GAAG,CAACM,QAAQ,KAAK,eAAe;IAC1C,MAAMC,MACJL,QAAQ;IACV5B,kBAAkBiC,IAAIjC,eAAe;IACrCC,uBAAuBgC,IAAIhC,oBAAoB;AACjD;AAWA,0FAA0F;AAC1F,mDAAmD;AACnD,IAAIwB,QAAQC,GAAG,CAACQ,SAAS,EAAE;IACzBC,WAAWC,2BAA2B,GAAGC;AAC3C,OAAO;IACL,6CAA6C;IAC7CF,WAAWC,2BAA2B,GAAG;AAC3C;AAIO,SAASrB;IACd,OAAOuB,IAAAA,sBAAW,EAAC;QACjBC,kBAAAA,0CAAgB;QAChBC,sBAAAA,kDAAoB;IACtB;AACF","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/server/app-render/entry-base.ts"],"sourcesContent":["// eslint-disable-next-line import/no-extraneous-dependencies\nexport {\n createTemporaryReferenceSet,\n renderToReadableStream,\n decodeReply,\n decodeAction,\n decodeFormState,\n} from 'react-server-dom-webpack/server'\n\n// eslint-disable-next-line import/no-extraneous-dependencies\nexport { prerender } from 'react-server-dom-webpack/static'\n\n// Node.js-specific Flight APIs, needed by stream-ops.node.ts via ComponentMod.\n// These must be exported from entry-base (react-server layer) because direct\n// imports from react-server-dom-webpack/* fail outside this layer.\ntype FlightRenderToPipeableStream = (...args: any[]) => {\n pipe<Writable extends NodeJS.WritableStream>(destination: Writable): Writable\n abort: (reason?: unknown) => void\n}\n\ntype FlightPrerenderToNodeStream = (...args: any[]) => Promise<{\n prelude: import('node:stream').Readable\n}>\n\n/* eslint-disable import/no-extraneous-dependencies */\nexport let renderToPipeableStream: FlightRenderToPipeableStream | undefined\nexport let prerenderToNodeStream: FlightPrerenderToNodeStream | undefined\nif (process.env.__NEXT_USE_NODE_STREAMS) {\n renderToPipeableStream = (\n require('react-server-dom-webpack/server.node') as typeof import('react-server-dom-webpack/server.node')\n ).renderToPipeableStream\n prerenderToNodeStream = (\n require('react-server-dom-webpack/static') as typeof import('react-server-dom-webpack/static')\n ).prerenderToNodeStream\n} else {\n renderToPipeableStream = undefined\n prerenderToNodeStream = undefined\n}\n/* eslint-enable import/no-extraneous-dependencies */\n\n// TODO: Just re-export `* as ReactServer`\nexport { captureOwnerStack, createElement, Fragment } from 'react'\n\nexport {\n default as LayoutRouter,\n LoadingBoundaryProvider,\n} from '../../client/components/layout-router'\nexport { default as RenderFromTemplateContext } from '../../client/components/render-from-template-context'\nexport { ClientPageRoot } from '../../client/components/client-page'\nexport { ClientSegmentRoot } from '../../client/components/client-segment'\nexport {\n createServerSearchParamsForServerPage,\n createPrerenderSearchParamsForClientPage,\n} from '../request/search-params'\nexport {\n createServerParamsForServerSegment,\n createPrerenderParamsForClientSegment,\n} from '../request/params'\nexport * as serverHooks from '../../client/components/hooks-server-context'\nexport { HTTPAccessFallbackBoundary } from '../../client/components/http-access-fallback/error-boundary'\nexport { createMetadataComponents } from '../../lib/metadata/metadata'\nexport { RootLayoutBoundary } from '../../lib/framework/boundary-components'\n\nexport { preloadStyle, preloadFont, preconnect } from './rsc/preloads'\nexport { isEmptyHTMLPrelude } from './postponed-state'\nexport { Postpone } from './rsc/postpone'\nexport { taintObjectReference } from './rsc/taint'\nexport {\n collectSegmentData,\n collectPrefetchHints,\n} from './collect-segment-data'\n\nexport const InstantValidation = () => {\n if (\n process.env.NEXT_RUNTIME !== 'edge' &&\n process.env.__NEXT_CACHE_COMPONENTS\n ) {\n return require('./instant-validation/instant-validation') as typeof import('./instant-validation/instant-validation')\n } else {\n return undefined\n }\n}\n\nimport type { NodeJsPartialHmrUpdate } from '../../build/swc/types'\nimport { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { workUnitAsyncStorage } from './work-unit-async-storage.external'\nimport { patchFetch as _patchFetch } from '../lib/patch-fetch'\n\nlet SegmentViewNode: typeof import('../../next-devtools/userspace/app/segment-explorer-node').SegmentViewNode =\n () => null\nlet SegmentViewStateNode: typeof import('../../next-devtools/userspace/app/segment-explorer-node').SegmentViewStateNode =\n () => null\nif (process.env.NODE_ENV === 'development') {\n const mod =\n require('../../next-devtools/userspace/app/segment-explorer-node') as typeof import('../../next-devtools/userspace/app/segment-explorer-node')\n SegmentViewNode = mod.SegmentViewNode\n SegmentViewStateNode = mod.SegmentViewStateNode\n}\n\n// For hot-reloader\ndeclare global {\n var __next__clear_chunk_cache__: (() => void) | null | undefined\n var __turbopack_clear_chunk_cache__: () => void | null | undefined\n var __turbopack_server_hmr_apply__:\n | ((update: NodeJsPartialHmrUpdate) => boolean)\n | undefined\n}\n\n// hot-reloader modules are not bundled so we need to inject `__next__clear_chunk_cache__`\n// into globalThis from this file which is bundled.\nif (process.env.TURBOPACK) {\n globalThis.__next__clear_chunk_cache__ = __turbopack_clear_chunk_cache__\n} else {\n // Webpack does not have chunks on the server\n globalThis.__next__clear_chunk_cache__ = null\n}\n\n// patchFetch makes use of APIs such as `React.unstable_postpone` which are only available\n// in the experimental channel of React, so export it from here so that it comes from the bundled runtime\nexport function patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage,\n })\n}\n\n// Development only\nexport { SegmentViewNode, SegmentViewStateNode }\n"],"names":["ClientPageRoot","ClientSegmentRoot","Fragment","HTTPAccessFallbackBoundary","InstantValidation","LayoutRouter","LoadingBoundaryProvider","Postpone","RenderFromTemplateContext","RootLayoutBoundary","SegmentViewNode","SegmentViewStateNode","captureOwnerStack","collectPrefetchHints","collectSegmentData","createElement","createMetadataComponents","createPrerenderParamsForClientSegment","createPrerenderSearchParamsForClientPage","createServerParamsForServerSegment","createServerSearchParamsForServerPage","createTemporaryReferenceSet","decodeAction","decodeFormState","decodeReply","isEmptyHTMLPrelude","patchFetch","preconnect","preloadFont","preloadStyle","prerender","prerenderToNodeStream","renderToPipeableStream","renderToReadableStream","serverHooks","taintObjectReference","process","env","__NEXT_USE_NODE_STREAMS","require","undefined","NEXT_RUNTIME","__NEXT_CACHE_COMPONENTS","NODE_ENV","mod","TURBOPACK","globalThis","__next__clear_chunk_cache__","__turbopack_clear_chunk_cache__","_patchFetch","workAsyncStorage","workUnitAsyncStorage"],"mappings":"AAAA,6DAA6D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgDpDA,cAAc;eAAdA,0BAAc;;IACdC,iBAAiB;eAAjBA,gCAAiB;;IARiBC,QAAQ;eAARA,eAAQ;;IAkB1CC,0BAA0B;eAA1BA,yCAA0B;;IAatBC,iBAAiB;eAAjBA;;IA5BAC,YAAY;eAAZA,qBAAY;;IACvBC,uBAAuB;eAAvBA,qCAAuB;;IAoBhBC,QAAQ;eAARA,kBAAQ;;IAlBGC,yBAAyB;eAAzBA,kCAAyB;;IAcpCC,kBAAkB;eAAlBA,sCAAkB;;IAkElBC,eAAe;eAAfA;;IAAiBC,oBAAoB;eAApBA;;IAtFjBC,iBAAiB;eAAjBA,wBAAiB;;IA4BxBC,oBAAoB;eAApBA,wCAAoB;;IADpBC,kBAAkB;eAAlBA,sCAAkB;;IA3BQC,aAAa;eAAbA,oBAAa;;IAmBhCC,wBAAwB;eAAxBA,kCAAwB;;IAJ/BC,qCAAqC;eAArCA,6CAAqC;;IAJrCC,wCAAwC;eAAxCA,sDAAwC;;IAGxCC,kCAAkC;e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lC,eAAe;IACrCC,uBAAuBiC,IAAIjC,oBAAoB;AACjD;AAWA,0FAA0F;AAC1F,mDAAmD;AACnD,IAAIyB,QAAQC,GAAG,CAACQ,SAAS,EAAE;IACzBC,WAAWC,2BAA2B,GAAGC;AAC3C,OAAO;IACL,6CAA6C;IAC7CF,WAAWC,2BAA2B,GAAG;AAC3C;AAIO,SAASrB;IACd,OAAOuB,IAAAA,sBAAW,EAAC;QACjBC,kBAAAA,0CAAgB;QAChBC,sBAAAA,kDAAoB;IACtB;AACF","ignoreList":[0]} |
@@ -60,2 +60,15 @@ import type { OpaqueFallbackRouteParams } from '../../server/request/fallback-params'; | ||
| }; | ||
| /** | ||
| * Cheaply determines whether a serialized postponed state represents an empty | ||
| * HTML prelude — i.e. the static shell rendered no bytes before the first | ||
| * dynamic hole (a blocking dynamic API at the root with no Suspense boundary | ||
| * above it). Returns false for dynamic-data states or unparseable input. | ||
| * | ||
| * Unlike `parsePostponedState`, this does not interpolate fallback route params | ||
| * or build a resume data cache: it only reads the prelude marker, which is | ||
| * independent of param values. The Instant Navigation Testing API uses this to | ||
| * detect the blank-document case in both dev (fresh render) and production | ||
| * (prebuilt shell), where the marker is persisted in the postponed state. | ||
| */ | ||
| export declare function isEmptyHTMLPrelude(state: string): boolean; | ||
| export {}; |
@@ -11,2 +11,3 @@ "use strict"; | ||
| getPostponedFromState: null, | ||
| isEmptyHTMLPrelude: null, | ||
| parsePostponedState: null | ||
@@ -36,2 +37,5 @@ }); | ||
| }, | ||
| isEmptyHTMLPrelude: function() { | ||
| return isEmptyHTMLPrelude; | ||
| }, | ||
| parsePostponedState: function() { | ||
@@ -158,3 +162,33 @@ return parsePostponedState; | ||
| } | ||
| function isEmptyHTMLPrelude(state) { | ||
| try { | ||
| var _state_match; | ||
| const lengthMatch = (_state_match = state.match(/^([0-9]*):/)) == null ? void 0 : _state_match[1]; | ||
| if (!lengthMatch) { | ||
| return false; | ||
| } | ||
| const length = parseInt(lengthMatch); | ||
| let postponedString = state.slice(lengthMatch.length + 1, lengthMatch.length + 1 + length); | ||
| // `null` is the dynamic-data case (a full shell was produced). | ||
| if (postponedString === 'null') { | ||
| return false; | ||
| } | ||
| // An optional `<n><replacements>` prefix carries fallback route param | ||
| // replacements; skip it to reach the `[preludeState, postponed]` data. | ||
| if (/^[0-9]/.test(postponedString)) { | ||
| var _postponedString_match; | ||
| const replacementsLengthMatch = (_postponedString_match = postponedString.match(/^([0-9]*)/)) == null ? void 0 : _postponedString_match[1]; | ||
| if (!replacementsLengthMatch) { | ||
| return false; | ||
| } | ||
| const replacementsLength = parseInt(replacementsLengthMatch); | ||
| postponedString = postponedString.slice(replacementsLengthMatch.length + replacementsLength); | ||
| } | ||
| const data = JSON.parse(postponedString); | ||
| return Array.isArray(data) && data[0] === 0; | ||
| } catch { | ||
| return false; | ||
| } | ||
| } | ||
| //# sourceMappingURL=postponed-state.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/server/app-render/postponed-state.ts"],"sourcesContent":["import type {\n OpaqueFallbackRouteParamEntries,\n OpaqueFallbackRouteParams,\n} from '../../server/request/fallback-params'\nimport { getDynamicParam } from '../../shared/lib/router/utils/get-dynamic-param'\nimport type { Params } from '../request/params'\nimport {\n createPrerenderResumeDataCache,\n createRenderResumeDataCache,\n type PrerenderResumeDataCache,\n type RenderResumeDataCache,\n} from '../resume-data-cache/resume-data-cache'\nimport { stringifyResumeDataCache } from '../resume-data-cache/resume-data-cache'\n\nexport enum DynamicState {\n /**\n * The dynamic access occurred during the RSC render phase.\n */\n DATA = 1,\n\n /**\n * The dynamic access occurred during the HTML shell render phase.\n */\n HTML = 2,\n}\n\n/**\n * The postponed state for dynamic data.\n */\nexport type DynamicDataPostponedState = {\n /**\n * The type of dynamic state.\n */\n readonly type: DynamicState.DATA\n\n /**\n * The immutable resume data cache.\n */\n readonly renderResumeDataCache: RenderResumeDataCache\n}\n\n/**\n * The postponed state for dynamic HTML.\n */\nexport type DynamicHTMLPostponedState = {\n /**\n * The type of dynamic state.\n */\n readonly type: DynamicState.HTML\n\n /**\n * The postponed data used by React.\n */\n readonly data: [\n preludeState: DynamicHTMLPreludeState,\n postponed: ReactPostponed,\n ]\n\n /**\n * The immutable resume data cache.\n */\n readonly renderResumeDataCache: RenderResumeDataCache\n}\n\nexport const enum DynamicHTMLPreludeState {\n Empty = 0,\n Full = 1,\n}\n\ntype ReactPostponed = NonNullable<\n import('react-dom/static').PrerenderResult['postponed']\n>\n\nexport type PostponedState =\n | DynamicDataPostponedState\n | DynamicHTMLPostponedState\n\nexport async function getDynamicHTMLPostponedState(\n postponed: ReactPostponed,\n preludeState: DynamicHTMLPreludeState,\n fallbackRouteParams: OpaqueFallbackRouteParams | null,\n resumeDataCache: PrerenderResumeDataCache | RenderResumeDataCache,\n isCacheComponentsEnabled: boolean\n): Promise<string> {\n const data: DynamicHTMLPostponedState['data'] = [preludeState, postponed]\n const dataString = JSON.stringify(data)\n\n // If there are no fallback route params, we can just serialize the postponed\n // state as is.\n if (!fallbackRouteParams || fallbackRouteParams.size === 0) {\n // Serialized as `<postponedString.length>:<postponedString><renderResumeDataCache>`\n return `${dataString.length}:${dataString}${await stringifyResumeDataCache(\n createRenderResumeDataCache(resumeDataCache),\n isCacheComponentsEnabled\n )}`\n }\n\n const replacements: OpaqueFallbackRouteParamEntries = Array.from(\n fallbackRouteParams.entries()\n )\n const replacementsString = JSON.stringify(replacements)\n\n // Serialized as `<replacements.length><replacements><data>`\n const postponedString = `${replacementsString.length}${replacementsString}${dataString}`\n\n // Serialized as `<postponedString.length>:<postponedString><renderResumeDataCache>`\n return `${postponedString.length}:${postponedString}${await stringifyResumeDataCache(resumeDataCache, isCacheComponentsEnabled)}`\n}\n\nexport async function getDynamicDataPostponedState(\n resumeDataCache: PrerenderResumeDataCache | RenderResumeDataCache,\n isCacheComponentsEnabled: boolean\n): Promise<string> {\n return `4:null${await stringifyResumeDataCache(createRenderResumeDataCache(resumeDataCache), isCacheComponentsEnabled)}`\n}\n\nexport function parsePostponedState(\n state: string,\n interpolatedParams: Params,\n maxPostponedStateSizeBytes: number | undefined\n): PostponedState {\n try {\n const postponedStringLengthMatch = state.match(/^([0-9]*):/)?.[1]\n if (!postponedStringLengthMatch) {\n throw new Error(`Invariant: invalid postponed state ${state}`)\n }\n\n const postponedStringLength = parseInt(postponedStringLengthMatch)\n\n // We add a `:` to the end of the length as the first character of the\n // postponed string is the length of the replacement entries.\n const postponedString = state.slice(\n postponedStringLengthMatch.length + 1,\n postponedStringLengthMatch.length + postponedStringLength + 1\n )\n\n const renderResumeDataCache = createRenderResumeDataCache(\n state.slice(\n postponedStringLengthMatch.length + postponedStringLength + 1\n ),\n maxPostponedStateSizeBytes\n )\n\n try {\n if (postponedString === 'null') {\n return { type: DynamicState.DATA, renderResumeDataCache }\n }\n\n if (/^[0-9]/.test(postponedString)) {\n const match = postponedString.match(/^([0-9]*)/)?.[1]\n if (!match) {\n throw new Error(\n `Invariant: invalid postponed state ${JSON.stringify(postponedString)}`\n )\n }\n\n // This is the length of the replacements entries.\n const length = parseInt(match)\n const replacements = JSON.parse(\n postponedString.slice(\n match.length,\n // We then go to the end of the string.\n match.length + length\n )\n ) as OpaqueFallbackRouteParamEntries\n\n let postponed = postponedString.slice(match.length + length)\n for (const [\n segmentKey,\n [searchValue, dynamicParamType],\n ] of replacements) {\n const {\n treeSegment: [\n ,\n // This is the same value that'll be used in the postponed state\n // as it's part of the tree data. That's why we use it as the\n // replacement value.\n value,\n ],\n } = getDynamicParam(\n interpolatedParams,\n segmentKey,\n dynamicParamType,\n null,\n null // staticSiblings not needed for postponed state\n )\n\n postponed = postponed.replaceAll(searchValue, value)\n }\n\n return {\n type: DynamicState.HTML,\n data: JSON.parse(postponed),\n renderResumeDataCache,\n }\n }\n\n return {\n type: DynamicState.HTML,\n data: JSON.parse(postponedString),\n renderResumeDataCache,\n }\n } catch (err) {\n console.error('Failed to parse postponed state', err)\n return { type: DynamicState.DATA, renderResumeDataCache }\n }\n } catch (err) {\n console.error('Failed to parse postponed state', err)\n return {\n type: DynamicState.DATA,\n renderResumeDataCache: createRenderResumeDataCache(\n createPrerenderResumeDataCache()\n ),\n }\n }\n}\n\nexport function getPostponedFromState(state: DynamicHTMLPostponedState) {\n const [preludeState, postponed] = state.data\n return { preludeState, postponed }\n}\n"],"names":["DynamicHTMLPreludeState","DynamicState","getDynamicDataPostponedState","getDynamicHTMLPostponedState","getPostponedFromState","parsePostponedState","postponed","preludeState","fallbackRouteParams","resumeDataCache","isCacheComponentsEnabled","data","dataString","JSON","stringify","size","length","stringifyResumeDataCache","createRenderResumeDataCache","replacements","Array","from","entries","replacementsString","postponedString","state","interpolatedParams","maxPostponedStateSizeBytes","postponedStringLengthMatch","match","Error","postponedStringLength","parseInt","slice","renderResumeDataCache","type","test","parse","segmentKey","searchValue","dynamicParamType","treeSegment","value","getDynamicParam","replaceAll","err","console","error","createPrerenderResumeDataCache"],"mappings":";;;;;;;;;;;;;;;;;;;IAgEkBA,uBAAuB;eAAvBA;;IAlDNC,YAAY;eAAZA;;IA+FUC,4BAA4B;eAA5BA;;IAhCAC,4BAA4B;eAA5BA;;IA4INC,qBAAqB;eAArBA;;IArGAC,mBAAmB;eAAnBA;;;iCAhHgB;iCAOzB;AAGA,IAAA,AAAKJ,sCAAAA;IACV;;GAEC;IAGD;;GAEC;WARSA;;AAkDL,IAAA,AAAWD,iDAAAA;;;WAAAA;;AAaX,eAAeG,6BACpBG,SAAyB,EACzBC,YAAqC,EACrCC,mBAAqD,EACrDC,eAAiE,EACjEC,wBAAiC;IAEjC,MAAMC,OAA0C;QAACJ;QAAcD;KAAU;IACzE,MAAMM,aAAaC,KAAKC,SAAS,CAACH;IAElC,6EAA6E;IAC7E,eAAe;IACf,IAAI,CAACH,uBAAuBA,oBAAoBO,IAAI,KAAK,GAAG;QAC1D,oFAAoF;QACpF,OAAO,GAAGH,WAAWI,MAAM,CAAC,CAAC,EAAEJ,aAAa,MAAMK,IAAAA,yCAAwB,EACxEC,IAAAA,4C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AClB,cAAcD,UAAU,GAAGmB,MAAMd,IAAI;IAC5C,OAAO;QAAEJ;QAAcD;IAAU;AACnC","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/server/app-render/postponed-state.ts"],"sourcesContent":["import type {\n OpaqueFallbackRouteParamEntries,\n OpaqueFallbackRouteParams,\n} from '../../server/request/fallback-params'\nimport { getDynamicParam } from '../../shared/lib/router/utils/get-dynamic-param'\nimport type { Params } from '../request/params'\nimport {\n createPrerenderResumeDataCache,\n createRenderResumeDataCache,\n type PrerenderResumeDataCache,\n type RenderResumeDataCache,\n} from '../resume-data-cache/resume-data-cache'\nimport { stringifyResumeDataCache } from '../resume-data-cache/resume-data-cache'\n\nexport enum DynamicState {\n /**\n * The dynamic access occurred during the RSC render phase.\n */\n DATA = 1,\n\n /**\n * The dynamic access occurred during the HTML shell render phase.\n */\n HTML = 2,\n}\n\n/**\n * The postponed state for dynamic data.\n */\nexport type DynamicDataPostponedState = {\n /**\n * The type of dynamic state.\n */\n readonly type: DynamicState.DATA\n\n /**\n * The immutable resume data cache.\n */\n readonly renderResumeDataCache: RenderResumeDataCache\n}\n\n/**\n * The postponed state for dynamic HTML.\n */\nexport type DynamicHTMLPostponedState = {\n /**\n * The type of dynamic state.\n */\n readonly type: DynamicState.HTML\n\n /**\n * The postponed data used by React.\n */\n readonly data: [\n preludeState: DynamicHTMLPreludeState,\n postponed: ReactPostponed,\n ]\n\n /**\n * The immutable resume data cache.\n */\n readonly renderResumeDataCache: RenderResumeDataCache\n}\n\nexport const enum DynamicHTMLPreludeState {\n Empty = 0,\n Full = 1,\n}\n\ntype ReactPostponed = NonNullable<\n import('react-dom/static').PrerenderResult['postponed']\n>\n\nexport type PostponedState =\n | DynamicDataPostponedState\n | DynamicHTMLPostponedState\n\nexport async function getDynamicHTMLPostponedState(\n postponed: ReactPostponed,\n preludeState: DynamicHTMLPreludeState,\n fallbackRouteParams: OpaqueFallbackRouteParams | null,\n resumeDataCache: PrerenderResumeDataCache | RenderResumeDataCache,\n isCacheComponentsEnabled: boolean\n): Promise<string> {\n const data: DynamicHTMLPostponedState['data'] = [preludeState, postponed]\n const dataString = JSON.stringify(data)\n\n // If there are no fallback route params, we can just serialize the postponed\n // state as is.\n if (!fallbackRouteParams || fallbackRouteParams.size === 0) {\n // Serialized as `<postponedString.length>:<postponedString><renderResumeDataCache>`\n return `${dataString.length}:${dataString}${await stringifyResumeDataCache(\n createRenderResumeDataCache(resumeDataCache),\n isCacheComponentsEnabled\n )}`\n }\n\n const replacements: OpaqueFallbackRouteParamEntries = Array.from(\n fallbackRouteParams.entries()\n )\n const replacementsString = JSON.stringify(replacements)\n\n // Serialized as `<replacements.length><replacements><data>`\n const postponedString = `${replacementsString.length}${replacementsString}${dataString}`\n\n // Serialized as `<postponedString.length>:<postponedString><renderResumeDataCache>`\n return `${postponedString.length}:${postponedString}${await stringifyResumeDataCache(resumeDataCache, isCacheComponentsEnabled)}`\n}\n\nexport async function getDynamicDataPostponedState(\n resumeDataCache: PrerenderResumeDataCache | RenderResumeDataCache,\n isCacheComponentsEnabled: boolean\n): Promise<string> {\n return `4:null${await stringifyResumeDataCache(createRenderResumeDataCache(resumeDataCache), isCacheComponentsEnabled)}`\n}\n\nexport function parsePostponedState(\n state: string,\n interpolatedParams: Params,\n maxPostponedStateSizeBytes: number | undefined\n): PostponedState {\n try {\n const postponedStringLengthMatch = state.match(/^([0-9]*):/)?.[1]\n if (!postponedStringLengthMatch) {\n throw new Error(`Invariant: invalid postponed state ${state}`)\n }\n\n const postponedStringLength = parseInt(postponedStringLengthMatch)\n\n // We add a `:` to the end of the length as the first character of the\n // postponed string is the length of the replacement entries.\n const postponedString = state.slice(\n postponedStringLengthMatch.length + 1,\n postponedStringLengthMatch.length + postponedStringLength + 1\n )\n\n const renderResumeDataCache = createRenderResumeDataCache(\n state.slice(\n postponedStringLengthMatch.length + postponedStringLength + 1\n ),\n maxPostponedStateSizeBytes\n )\n\n try {\n if (postponedString === 'null') {\n return { type: DynamicState.DATA, renderResumeDataCache }\n }\n\n if (/^[0-9]/.test(postponedString)) {\n const match = postponedString.match(/^([0-9]*)/)?.[1]\n if (!match) {\n throw new Error(\n `Invariant: invalid postponed state ${JSON.stringify(postponedString)}`\n )\n }\n\n // This is the length of the replacements entries.\n const length = parseInt(match)\n const replacements = JSON.parse(\n postponedString.slice(\n match.length,\n // We then go to the end of the string.\n match.length + length\n )\n ) as OpaqueFallbackRouteParamEntries\n\n let postponed = postponedString.slice(match.length + length)\n for (const [\n segmentKey,\n [searchValue, dynamicParamType],\n ] of replacements) {\n const {\n treeSegment: [\n ,\n // This is the same value that'll be used in the postponed state\n // as it's part of the tree data. That's why we use it as the\n // replacement value.\n value,\n ],\n } = getDynamicParam(\n interpolatedParams,\n segmentKey,\n dynamicParamType,\n null,\n null // staticSiblings not needed for postponed state\n )\n\n postponed = postponed.replaceAll(searchValue, value)\n }\n\n return {\n type: DynamicState.HTML,\n data: JSON.parse(postponed),\n renderResumeDataCache,\n }\n }\n\n return {\n type: DynamicState.HTML,\n data: JSON.parse(postponedString),\n renderResumeDataCache,\n }\n } catch (err) {\n console.error('Failed to parse postponed state', err)\n return { type: DynamicState.DATA, renderResumeDataCache }\n }\n } catch (err) {\n console.error('Failed to parse postponed state', err)\n return {\n type: DynamicState.DATA,\n renderResumeDataCache: createRenderResumeDataCache(\n createPrerenderResumeDataCache()\n ),\n }\n }\n}\n\nexport function getPostponedFromState(state: DynamicHTMLPostponedState) {\n const [preludeState, postponed] = state.data\n return { preludeState, postponed }\n}\n\n/**\n * Cheaply determines whether a serialized postponed state represents an empty\n * HTML prelude — i.e. the static shell rendered no bytes before the first\n * dynamic hole (a blocking dynamic API at the root with no Suspense boundary\n * above it). Returns false for dynamic-data states or unparseable input.\n *\n * Unlike `parsePostponedState`, this does not interpolate fallback route params\n * or build a resume data cache: it only reads the prelude marker, which is\n * independent of param values. The Instant Navigation Testing API uses this to\n * detect the blank-document case in both dev (fresh render) and production\n * (prebuilt shell), where the marker is persisted in the postponed state.\n */\nexport function isEmptyHTMLPrelude(state: string): boolean {\n try {\n const lengthMatch = state.match(/^([0-9]*):/)?.[1]\n if (!lengthMatch) {\n return false\n }\n\n const length = parseInt(lengthMatch)\n let postponedString = state.slice(\n lengthMatch.length + 1,\n lengthMatch.length + 1 + length\n )\n\n // `null` is the dynamic-data case (a full shell was produced).\n if (postponedString === 'null') {\n return false\n }\n\n // An optional `<n><replacements>` prefix carries fallback route param\n // replacements; skip it to reach the `[preludeState, postponed]` data.\n if (/^[0-9]/.test(postponedString)) {\n const replacementsLengthMatch = postponedString.match(/^([0-9]*)/)?.[1]\n if (!replacementsLengthMatch) {\n return false\n }\n const replacementsLength = parseInt(replacementsLengthMatch)\n postponedString = postponedString.slice(\n replacementsLengthMatch.length + replacementsLength\n )\n }\n\n const data = JSON.parse(postponedString)\n return Array.isArray(data) && data[0] === DynamicHTMLPreludeState.Empty\n } catch {\n return false\n }\n}\n"],"names":["DynamicHTMLPreludeState","DynamicState","getDynamicDataPostponedState","getDynamicHTMLPostponedState","getPostponedFromState","isEmptyHTMLPrelude","parsePostponedState","postponed","preludeState","fallbackRouteParams","resumeDataCache","isCacheComponentsEnabled","data","dataString","JSON","stringify","size","length","stringifyResumeDataCache","createRenderResumeDataCache","replacements","Array","from","entries","replacementsString","postponedString","state","interpolatedParams","maxPostponedStateSizeBytes","postponedStringLengthMatch","match","Error","postponedStringLength","parseInt","slice","renderResumeDataCache","type","test","parse","segmentKey","searchValue","dynamicParamType","treeSegment","value","getDynamicParam","replaceAll","err","console","error","createPrerenderResumeDataCache","lengthMatch","replacementsLengthMatch","replacementsLength","isArray"],"mappings":";;;;;;;;;;;;;;;;;;;;IAgEkBA,uBAAuB;eAAvBA;;IAlDNC,YAAY;eAAZA;;IA+FUC,4BAA4B;eAA5BA;;IAhCAC,4BAA4B;eAA5BA;;IA4INC,qBAAqB;eAArBA;;IAiBAC,kBAAkB;eAAlBA;;IAtHAC,mBAAmB;eAAnBA;;;iCAhHgB;iCAOzB;A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EA,MAAMxC,OAAOE,KAAKwB,KAAK,CAACb;QACxB,OAAOJ,MAAMgC,OAAO,CAACzC,SAASA,IAAI,CAAC,EAAE;IACvC,EAAE,OAAM;QACN,OAAO;IACT;AACF","ignoreList":[0]} |
@@ -11,2 +11,3 @@ import type { NextConfig } from './config'; | ||
| appNewScrollHandler: z.ZodOptional<z.ZodBoolean>; | ||
| coldCacheBadge: z.ZodOptional<z.ZodBoolean>; | ||
| preloadEntriesOnStart: z.ZodOptional<z.ZodBoolean>; | ||
@@ -13,0 +14,0 @@ allowedRevalidateHeaderKeys: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; |
@@ -202,2 +202,3 @@ "use strict"; | ||
| appNewScrollHandler: _zod.z.boolean().optional(), | ||
| coldCacheBadge: _zod.z.boolean().optional(), | ||
| preloadEntriesOnStart: _zod.z.boolean().optional(), | ||
@@ -204,0 +205,0 @@ allowedRevalidateHeaderKeys: _zod.z.array(_zod.z.string()).optional(), |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/server/config-schema.ts"],"sourcesContent":["import type { NextConfig } from './config'\nimport { VALID_LOADERS } from '../shared/lib/image-config'\n\nimport { z } from 'next/dist/compiled/zod'\nimport type zod from 'next/dist/compiled/zod'\n\nimport type { SizeLimit } from '../types'\nimport {\n LIGHTNINGCSS_FEATURE_NAMES,\n type ExportPathMap,\n type TurbopackLoaderItem,\n type TurbopackOptions,\n type TurbopackRuleConfigItem,\n type TurbopackRuleConfigCollection,\n type TurbopackRuleCondition,\n type TurbopackLoaderBuiltinCondition,\n} from './config-shared'\nimport type {\n Header,\n Rewrite,\n RouteHas,\n Redirect,\n} from '../lib/load-custom-routes'\nimport { SUPPORTED_TEST_RUNNERS_LIST } from '../cli/next-test'\n\n// A custom zod schema for the SizeLimit type\nconst zSizeLimit = z.custom<SizeLimit>((val) => {\n if (typeof val === 'number' || typeof val === 'string') {\n return true\n }\n return false\n})\n\nconst zExportMap: zod.ZodType<ExportPathMap> = z.record(\n z.string(),\n z.object({\n page: z.string(),\n query: z.any(), // NextParsedUrlQuery\n\n // private optional properties\n _fallbackRouteParams: z.array(z.any()).optional(),\n _isAppDir: z.boolean().optional(),\n _isDynamicError: z.boolean().optional(),\n _isRoutePPREnabled: z.boolean().optional(),\n _allowEmptyStaticShell: z.boolean().optional(),\n _isFallbackUpgradeable: z.boolean().optional(),\n })\n)\n\nconst zRouteHas: zod.ZodType<RouteHas> = z.union([\n z.object({\n type: z.enum(['header', 'query', 'cookie']),\n key: z.string(),\n value: z.string().optional(),\n }),\n z.object({\n type: z.literal('host'),\n key: z.undefined().optional(),\n value: z.string(),\n }),\n])\n\nconst zRewrite: zod.ZodType<Rewrite> = z.object({\n source: z.string(),\n destination: z.string(),\n basePath: z.literal(false).optional(),\n locale: z.literal(false).optional(),\n has: z.array(zRouteHas).optional(),\n missing: z.array(zRouteHas).optional(),\n internal: z.boolean().optional(),\n})\n\nconst zRedirect: zod.ZodType<Redirect> = z\n .object({\n source: z.string(),\n destination: z.string(),\n basePath: z.literal(false).optional(),\n locale: z.literal(false).optional(),\n has: z.array(zRouteHas).optional(),\n missing: z.array(zRouteHas).optional(),\n internal: z.boolean().optional(),\n })\n .and(\n z.union([\n z.object({\n statusCode: z.never().optional(),\n permanent: z.boolean(),\n }),\n z.object({\n statusCode: z.number(),\n permanent: z.never().optional(),\n }),\n ])\n )\n\nconst zHeader: zod.ZodType<Header> = z.object({\n source: z.string(),\n basePath: z.literal(false).optional(),\n locale: z.literal(false).optional(),\n headers: z.array(z.object({ key: z.string(), value: z.string() })),\n has: z.array(zRouteHas).optional(),\n missing: z.array(zRouteHas).optional(),\n\n internal: z.boolean().optional(),\n})\n\nconst zTurbopackLoaderItem: zod.ZodType<TurbopackLoaderItem> = z.union([\n z.string(),\n z.strictObject({\n loader: z.string(),\n // Any JSON value can be used as turbo loader options, so use z.any() here\n options: z.record(z.string(), z.any()).optional(),\n }),\n])\n\nconst zTurbopackLoaderBuiltinCondition: zod.ZodType<TurbopackLoaderBuiltinCondition> =\n z.union([\n z.literal('browser'),\n z.literal('foreign'),\n z.literal('development'),\n z.literal('production'),\n z.literal('node'),\n z.literal('edge-light'),\n ])\n\nconst zTurbopackCondition: zod.ZodType<TurbopackRuleCondition> = z.union([\n z.strictObject({ all: z.lazy(() => z.array(zTurbopackCondition)) }),\n z.strictObject({ any: z.lazy(() => z.array(zTurbopackCondition)) }),\n z.strictObject({ not: z.lazy(() => zTurbopackCondition) }),\n zTurbopackLoaderBuiltinCondition,\n z.strictObject({\n path: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n content: z.instanceof(RegExp).optional(),\n query: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n contentType: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n }),\n])\n\nconst zTurbopackModuleType = z.enum([\n 'asset',\n 'ecmascript',\n 'typescript',\n 'css',\n 'css-module',\n 'wasm',\n 'raw',\n 'node',\n 'bytes',\n])\n\nconst zTurbopackRuleConfigItem: zod.ZodType<TurbopackRuleConfigItem> =\n z.strictObject({\n loaders: z.array(zTurbopackLoaderItem).optional(),\n as: z.string().optional(),\n condition: zTurbopackCondition.optional(),\n type: zTurbopackModuleType.optional(),\n })\n\nconst zTurbopackRuleConfigCollection: zod.ZodType<TurbopackRuleConfigCollection> =\n z.union([\n zTurbopackRuleConfigItem,\n z.array(z.union([zTurbopackLoaderItem, zTurbopackRuleConfigItem])),\n ])\n\nconst zTurbopackConfig: zod.ZodType<TurbopackOptions> = z.strictObject({\n rules: z.record(z.string(), zTurbopackRuleConfigCollection).optional(),\n resolveAlias: z\n .record(\n z.string(),\n z.union([\n z.string(),\n z.array(z.string()),\n z.record(z.string(), z.union([z.string(), z.array(z.string())])),\n ])\n )\n .optional(),\n resolveExtensions: z.array(z.string()).optional(),\n root: z.string().optional(),\n debugIds: z.boolean().optional(),\n chunkLoadingGlobal: z.string().optional(),\n ignoreIssue: z\n .array(\n z.object({\n path: z.union([z.string(), z.instanceof(RegExp)]),\n title: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n description: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n })\n )\n .optional(),\n})\n\nexport const experimentalSchema = {\n outputHashSalt: z.string().optional(),\n useSkewCookie: z.boolean().optional(),\n after: z.boolean().optional(),\n appNavFailHandling: z.boolean().optional(),\n appNewScrollHandler: z.boolean().optional(),\n preloadEntriesOnStart: z.boolean().optional(),\n allowedRevalidateHeaderKeys: z.array(z.string()).optional(),\n staleTimes: z\n .object({\n dynamic: z.number().optional(),\n static: z.number().gte(30).optional(),\n })\n .optional(),\n cacheLife: z\n .record(\n z.object({\n stale: z.number().optional(),\n revalidate: z.number().optional(),\n expire: z.number().optional(),\n })\n )\n .optional(),\n cacheHandlers: z.record(z.string(), z.string().optional()).optional(),\n clientRouterFilter: z.boolean().optional(),\n clientRouterFilterRedirects: z.boolean().optional(),\n clientRouterFilterAllowedRate: z.number().optional(),\n cpus: z.number().optional(),\n memoryBasedWorkersCount: z.boolean().optional(),\n craCompat: z.boolean().optional(),\n caseSensitiveRoutes: z.boolean().optional(),\n clientParamParsingOrigins: z.array(z.string()).optional(),\n cachedNavigations: z\n .union([z.boolean(), z.literal('allow-runtime')])\n .optional(),\n dynamicOnHover: z.boolean().optional(),\n useOffline: z.boolean().optional(),\n optimisticRouting: z.boolean().optional(),\n instrumentationClientRouterTransitionEvents: z.boolean().optional(),\n appShells: z.boolean().optional(),\n varyParams: z.boolean().optional(),\n prefetchInlining: z\n .union([\n z.boolean(),\n z.object({\n maxSize: z.number().optional(),\n maxBundleSize: z.number().optional(),\n }),\n ])\n .optional(),\n disableOptimizedLoading: z.boolean().optional(),\n disablePostcssPresetEnv: z.boolean().optional(),\n cacheComponents: z.boolean().optional(),\n inlineCss: z.boolean().optional(),\n esmExternals: z.union([z.boolean(), z.literal('loose')]).optional(),\n serverActions: z\n .object({\n bodySizeLimit: zSizeLimit.optional(),\n allowedOrigins: z.array(z.string()).optional(),\n })\n .optional(),\n maxPostponedStateSize: zSizeLimit.optional(),\n // The original type was Record<string, any>\n extensionAlias: z.record(z.string(), z.any()).optional(),\n externalDir: z.boolean().optional(),\n externalMiddlewareRewritesResolve: z.boolean().optional(),\n externalProxyRewritesResolve: z.boolean().optional(),\n exposeTestingApiInProductionBuild: z.boolean().optional(),\n fallbackNodePolyfills: z.literal(false).optional(),\n fetchCacheKeyPrefix: z.string().optional(),\n forceSwcTransforms: z.boolean().optional(),\n fullySpecified: z.boolean().optional(),\n gzipSize: z.boolean().optional(),\n imgOptConcurrency: z.number().int().optional().nullable(),\n imgOptOperationCache: z.boolean().optional().nullable(),\n imgOptTimeoutInSeconds: z.number().int().optional(),\n imgOptMaxInputPixels: z.number().int().optional(),\n imgOptSequentialRead: z.boolean().optional().nullable(),\n imgOptSkipMetadata: z.boolean().optional().nullable(),\n isrFlushToDisk: z.boolean().optional(),\n largePageDataBytes: z.number().optional(),\n linkNoTouchStart: z.boolean().optional(),\n manualClientBasePath: z.boolean().optional(),\n middlewarePrefetch: z.enum(['strict', 'flexible']).optional(),\n proxyPrefetch: z.enum(['strict', 'flexible']).optional(),\n middlewareClientMaxBodySize: zSizeLimit.optional(),\n proxyClientMaxBodySize: zSizeLimit.optional(),\n multiZoneDraftMode: z.boolean().optional(),\n cssChunking: z\n .union([\n z.boolean(),\n z.literal('strict'),\n z.literal('loose'),\n z.literal('graph'),\n z.strictObject({ type: z.literal('strict') }),\n z.strictObject({ type: z.literal('loose') }),\n z.strictObject({\n type: z.literal('graph'),\n requestCost: z.number().nonnegative().finite().optional(),\n moduleFactorCost: z.number().nonnegative().finite().optional(),\n }),\n ])\n .optional(),\n nextScriptWorkers: z.boolean().optional(),\n // The critter option is unknown, use z.any() here\n optimizeCss: z.union([z.boolean(), z.any()]).optional(),\n optimisticClientCache: z.boolean().optional(),\n parallelServerCompiles: z.boolean().optional(),\n parallelServerBuildTraces: z.boolean().optional(),\n ppr: z\n .union([z.boolean(), z.literal('incremental')])\n .readonly()\n .optional(),\n taint: z.boolean().optional(),\n blockingSSR: z.boolean().optional(),\n prerenderEarlyExit: z.boolean().optional(),\n proxyTimeout: z.number().gte(0).optional(),\n rootParams: z.boolean().optional(),\n mcpServer: z.boolean().optional(),\n removeUncaughtErrorAndRejectionListeners: z.boolean().optional(),\n validateRSCRequestHeaders: z.boolean().optional(),\n scrollRestoration: z.boolean().optional(),\n sri: z\n .object({\n algorithm: z.enum(['sha256', 'sha384', 'sha512']).optional(),\n })\n .optional(),\n swcPlugins: z\n // The specific swc plugin's option is unknown, use z.any() here\n .array(z.tuple([z.string(), z.record(z.string(), z.any())]))\n .optional(),\n swcEnvOptions: z\n .object({\n mode: z.enum(['usage', 'entry']).optional(),\n coreJs: z.string().optional(),\n skip: z.array(z.string()).optional(),\n include: z.array(z.string()).optional(),\n exclude: z.array(z.string()).optional(),\n shippedProposals: z.boolean().optional(),\n forceAllTransforms: z.boolean().optional(),\n debug: z.boolean().optional(),\n loose: z.boolean().optional(),\n })\n .optional(),\n swcTraceProfiling: z.boolean().optional(),\n // NonNullable<webpack.Configuration['experiments']>['buildHttp']\n urlImports: z.any().optional(),\n viewTransition: z.boolean().optional(),\n workerThreads: z.boolean().optional(),\n webVitalsAttribution: z\n .array(\n z.union([\n z.literal('CLS'),\n z.literal('FCP'),\n z.literal('FID'),\n z.literal('INP'),\n z.literal('LCP'),\n z.literal('TTFB'),\n ])\n )\n .optional(),\n // This is partial set of mdx-rs transform options we support, aligned\n // with next_core::next_config::MdxRsOptions. Ensure both types are kept in sync.\n mdxRs: z\n .union([\n z.boolean(),\n z.object({\n development: z.boolean().optional(),\n jsxRuntime: z.string().optional(),\n jsxImportSource: z.string().optional(),\n providerImportSource: z.string().optional(),\n mdxType: z.enum(['gfm', 'commonmark']).optional(),\n }),\n ])\n .optional(),\n transitionIndicator: z.boolean().optional(),\n gestureTransition: z.boolean().optional(),\n typedRoutes: z.boolean().optional(),\n webpackBuildWorker: z.boolean().optional(),\n webpackMemoryOptimizations: z.boolean().optional(),\n turbopackMemoryEviction: z\n .union([z.literal(false), z.literal('full')])\n .optional(),\n turbopackPluginRuntimeStrategy: z\n .enum(['workerThreads', 'childProcesses', 'forceWorkerThreads'])\n .optional(),\n turbopackMinify: z.boolean().optional(),\n turbopackFileSystemCacheForDev: z.boolean().optional(),\n turbopackFileSystemCacheForBuild: z.boolean().optional(),\n turbopackSourceMaps: z.boolean().optional(),\n turbopackInputSourceMaps: z.boolean().optional(),\n turbopackTreeShaking: z.boolean().optional(),\n turbopackRemoveUnusedImports: z.boolean().optional(),\n turbopackRemoveUnusedExports: z.boolean().optional(),\n turbopackScopeHoisting: z.boolean().optional(),\n turbopackWorkerAssetPrefix: z.string().optional(),\n turbopackClientSideNestedAsyncChunking: z.boolean().optional(),\n turbopackServerSideNestedAsyncChunking: z.boolean().optional(),\n turbopackImportTypeBytes: z.boolean().optional(),\n turbopackImportTypeText: z.boolean().optional(),\n turbopackUseBuiltinBabel: z.boolean().optional(),\n turbopackUseBuiltinSass: z.boolean().optional(),\n turbopackLocalPostcssConfig: z.boolean().optional(),\n turbopackModuleIds: z.enum(['named', 'deterministic']).optional(),\n turbopackInferModuleSideEffects: z.boolean().optional(),\n turbopackServerFastRefresh: z.boolean().optional(),\n optimizePackageImports: z.array(z.string()).optional(),\n optimizeServerReact: z.boolean().optional(),\n strictRouteTypes: z.boolean().optional(),\n clientTraceMetadata: z.array(z.string()).optional(),\n serverMinification: z.boolean().optional(),\n serverSourceMaps: z.boolean().optional(),\n useWasmBinary: z.boolean().optional(),\n useLightningcss: z.boolean().optional(),\n lightningCssFeatures: z\n .object({\n include: z.array(z.enum(LIGHTNINGCSS_FEATURE_NAMES)).optional(),\n exclude: z.array(z.enum(LIGHTNINGCSS_FEATURE_NAMES)).optional(),\n })\n .optional(),\n testProxy: z.boolean().optional(),\n defaultTestRunner: z.enum(SUPPORTED_TEST_RUNNERS_LIST).optional(),\n allowDevelopmentBuild: z.literal(true).optional(),\n\n reactDebugChannel: z.boolean().optional(),\n instantInsights: z\n .object({\n validationLevel: z\n .enum([\n 'warning',\n 'manual-warning',\n 'experimental-error',\n 'experimental-manual-error',\n ])\n .optional(),\n })\n .optional(),\n staticGenerationRetryCount: z.number().int().optional(),\n staticGenerationMaxConcurrency: z.number().int().optional(),\n staticGenerationMinPagesPerWorker: z.number().int().optional(),\n typedEnv: z.boolean().optional(),\n serverComponentsHmrCache: z.boolean().optional(),\n authInterrupts: z.boolean().optional(),\n useCache: z.boolean().optional(),\n useCacheTimeout: z.number().positive().optional(),\n slowModuleDetection: z\n .object({\n buildTimeThresholdMs: z.number().int(),\n })\n .optional(),\n globalNotFound: z.boolean().optional(),\n turbopackRustReactCompiler: z.boolean().optional(),\n browserDebugInfoInTerminal: z\n .union([\n z.boolean(),\n z.enum(['error', 'warn', 'verbose']),\n z.object({\n level: z.enum(['error', 'warn', 'verbose']).optional(),\n depthLimit: z.number().int().positive().optional(),\n edgeLimit: z.number().int().positive().optional(),\n showSourceLocation: z.boolean().optional(),\n }),\n ])\n .optional(),\n lockDistDir: z.boolean().optional(),\n hideLogsAfterAbort: z.boolean().optional(),\n runtimeServerDeploymentId: z.boolean().optional(),\n supportsImmutableAssets: z.boolean().optional(),\n deferredEntries: z.array(z.string()).optional(),\n onBeforeDeferredEntries: z.function().returns(z.promise(z.void())).optional(),\n reportSystemEnvInlining: z.enum(['warn', 'error']).optional(),\n}\n\nexport const configSchema: zod.ZodType<NextConfig> = z.lazy(() =>\n z.strictObject({\n adapterPath: z.string().optional(),\n agentRules: z.boolean().optional(),\n allowedDevOrigins: z.array(z.string()).optional(),\n assetPrefix: z.string().optional(),\n basePath: z.string().optional(),\n bundlePagesRouterDependencies: z.boolean().optional(),\n cacheComponents: z.boolean().optional(),\n cacheHandler: z.string().min(1).optional(),\n cacheHandlers: z.record(z.string(), z.string().optional()).optional(),\n cacheLife: z\n .record(\n z.object({\n stale: z.number().optional(),\n revalidate: z.number().optional(),\n expire: z.number().optional(),\n })\n )\n .optional(),\n cacheMaxMemorySize: z.number().optional(),\n cleanDistDir: z.boolean().optional(),\n compiler: z\n .strictObject({\n emotion: z\n .union([\n z.boolean(),\n z.object({\n sourceMap: z.boolean().optional(),\n autoLabel: z\n .union([\n z.literal('always'),\n z.literal('dev-only'),\n z.literal('never'),\n ])\n .optional(),\n labelFormat: z.string().min(1).optional(),\n importMap: z\n .record(\n z.string(),\n z.record(\n z.string(),\n z.object({\n canonicalImport: z\n .tuple([z.string(), z.string()])\n .optional(),\n styledBaseImport: z\n .tuple([z.string(), z.string()])\n .optional(),\n })\n )\n )\n .optional(),\n }),\n ])\n .optional(),\n reactRemoveProperties: z\n .union([\n z.boolean().optional(),\n z.object({\n properties: z.array(z.string()).optional(),\n }),\n ])\n .optional(),\n relay: z\n .object({\n src: z.string(),\n artifactDirectory: z.string().optional(),\n language: z.enum(['javascript', 'typescript', 'flow']).optional(),\n eagerEsModules: z.boolean().optional(),\n })\n .optional(),\n removeConsole: z\n .union([\n z.boolean().optional(),\n z.object({\n exclude: z.array(z.string()).min(1).optional(),\n }),\n ])\n .optional(),\n styledComponents: z.union([\n z.boolean().optional(),\n z.object({\n displayName: z.boolean().optional(),\n topLevelImportPaths: z.array(z.string()).optional(),\n ssr: z.boolean().optional(),\n fileName: z.boolean().optional(),\n meaninglessFileNames: z.array(z.string()).optional(),\n minify: z.boolean().optional(),\n transpileTemplateLiterals: z.boolean().optional(),\n namespace: z.string().min(1).optional(),\n pure: z.boolean().optional(),\n cssProp: z.boolean().optional(),\n }),\n ]),\n styledJsx: z.union([\n z.boolean().optional(),\n z.object({\n useLightningcss: z.boolean().optional(),\n }),\n ]),\n define: z\n .record(z.string(), z.union([z.string(), z.number(), z.boolean()]))\n .optional(),\n defineServer: z\n .record(z.string(), z.union([z.string(), z.number(), z.boolean()]))\n .optional(),\n runAfterProductionCompile: z\n .function()\n .returns(z.promise(z.void()))\n .optional(),\n })\n .optional(),\n compress: z.boolean().optional(),\n configOrigin: z.string().optional(),\n crossOrigin: z\n .union([z.literal('anonymous'), z.literal('use-credentials')])\n .optional(),\n deploymentId: z.string().optional(),\n devIndicators: z\n .union([\n z.object({\n position: z\n .union([\n z.literal('bottom-left'),\n z.literal('bottom-right'),\n z.literal('top-left'),\n z.literal('top-right'),\n ])\n .optional(),\n }),\n z.literal(false),\n ])\n .optional(),\n distDir: z.string().min(1).optional(),\n env: z.record(z.string(), z.union([z.string(), z.undefined()])).optional(),\n enablePrerenderSourceMaps: z.boolean().optional(),\n excludeDefaultMomentLocales: z.boolean().optional(),\n experimental: z.strictObject(experimentalSchema).optional(),\n exportPathMap: z\n .function()\n .args(\n zExportMap,\n z.object({\n dev: z.boolean(),\n dir: z.string(),\n outDir: z.string().nullable(),\n distDir: z.string(),\n buildId: z.string(),\n })\n )\n .returns(z.union([zExportMap, z.promise(zExportMap)]))\n .optional(),\n generateBuildId: z\n .function()\n .args()\n .returns(\n z.union([\n z.string(),\n z.null(),\n z.promise(z.union([z.string(), z.null()])),\n ])\n )\n .optional(),\n generateEtags: z.boolean().optional(),\n headers: z\n .function()\n .args()\n .returns(z.promise(z.array(zHeader)))\n .optional(),\n htmlLimitedBots: z.instanceof(RegExp).optional(),\n httpAgentOptions: z\n .strictObject({ keepAlive: z.boolean().optional() })\n .optional(),\n i18n: z\n .strictObject({\n defaultLocale: z.string().min(1),\n domains: z\n .array(\n z.strictObject({\n defaultLocale: z.string().min(1),\n domain: z.string().min(1),\n http: z.literal(true).optional(),\n locales: z.array(z.string().min(1)).optional(),\n })\n )\n .optional(),\n localeDetection: z.literal(false).optional(),\n locales: z.array(z.string().min(1)),\n })\n .nullable()\n .optional(),\n images: z\n .strictObject({\n localPatterns: z\n .array(\n z.strictObject({\n pathname: z.string().optional(),\n search: z.string().optional(),\n })\n )\n .max(25)\n .optional(),\n remotePatterns: z\n .array(\n z.union([\n z.instanceof(URL),\n z.strictObject({\n hostname: z.string(),\n pathname: z.string().optional(),\n port: z.string().max(5).optional(),\n protocol: z.enum(['http', 'https']).optional(),\n search: z.string().optional(),\n }),\n ])\n )\n .max(50)\n .optional(),\n unoptimized: z.boolean().optional(),\n customCacheHandler: z.boolean().optional(),\n contentSecurityPolicy: z.string().optional(),\n contentDispositionType: z.enum(['inline', 'attachment']).optional(),\n dangerouslyAllowSVG: z.boolean().optional(),\n dangerouslyAllowLocalIP: z.boolean().optional(),\n deviceSizes: z\n .array(z.number().int().gte(1).lte(10000))\n .max(25)\n .optional(),\n disableStaticImages: z.boolean().optional(),\n domains: z.array(z.string()).max(50).optional(),\n formats: z\n .array(z.enum(['image/avif', 'image/webp']))\n .max(4)\n .optional(),\n imageSizes: z\n .array(z.number().int().gte(1).lte(10000))\n .min(0)\n .max(25)\n .optional(),\n loader: z.enum(VALID_LOADERS).optional(),\n loaderFile: z.string().optional(),\n maximumDiskCacheSize: z.number().int().min(0).optional(),\n maximumRedirects: z.number().int().min(0).max(20).optional(),\n maximumResponseBody: z\n .number()\n .int()\n .min(1)\n .max(Number.MAX_SAFE_INTEGER)\n .optional(),\n minimumCacheTTL: z.number().int().gte(0).optional(),\n path: z.string().optional(),\n qualities: z\n .array(z.number().int().gte(1).lte(100))\n .min(1)\n .max(20)\n .optional(),\n })\n .optional(),\n logging: z\n .union([\n z.object({\n fetches: z\n .object({\n fullUrl: z.boolean().optional(),\n hmrRefreshes: z.boolean().optional(),\n })\n .optional(),\n incomingRequests: z\n .union([\n z.boolean(),\n z.object({\n ignore: z.array(z.instanceof(RegExp)),\n }),\n ])\n .optional(),\n serverFunctions: z.boolean().optional(),\n browserToTerminal: z\n .union([z.boolean(), z.enum(['error', 'warn'])])\n .optional(),\n }),\n z.literal(false),\n ])\n .optional(),\n modularizeImports: z\n .record(\n z.string(),\n z.object({\n transform: z.union([z.string(), z.record(z.string(), z.string())]),\n preventFullImport: z.boolean().optional(),\n skipDefaultConversion: z.boolean().optional(),\n })\n )\n .optional(),\n onDemandEntries: z\n .strictObject({\n maxInactiveAge: z.number().optional(),\n pagesBufferLength: z.number().optional(),\n })\n .optional(),\n output: z.enum(['standalone', 'export']).optional(),\n outputFileTracingRoot: z.string().optional(),\n outputFileTracingExcludes: z\n .record(z.string(), z.array(z.string()))\n .optional(),\n outputFileTracingIncludes: z\n .record(z.string(), z.array(z.string()))\n .optional(),\n pageExtensions: z.array(z.string()).min(1).optional(),\n instrumentationClientInject: z.array(z.string()).optional(),\n partialPrefetching: z\n .union([z.boolean(), z.literal('unstable_eager')])\n .optional(),\n poweredByHeader: z.boolean().optional(),\n productionBrowserSourceMaps: z.boolean().optional(),\n reactCompiler: z.union([\n z.boolean(),\n z\n .object({\n compilationMode: z.enum(['infer', 'annotation', 'all']).optional(),\n panicThreshold: z\n .enum(['none', 'critical_errors', 'all_errors'])\n .optional(),\n })\n .optional(),\n ]),\n reactProductionProfiling: z.boolean().optional(),\n reactStrictMode: z.boolean().nullable().optional(),\n reactMaxHeadersLength: z.number().nonnegative().int().optional(),\n redirects: z\n .function()\n .args()\n .returns(z.promise(z.array(zRedirect)))\n .optional(),\n rewrites: z\n .function()\n .args()\n .returns(\n z.promise(\n z.union([\n z.array(zRewrite),\n z.object({\n beforeFiles: z.array(zRewrite),\n afterFiles: z.array(zRewrite),\n fallback: z.array(zRewrite),\n }),\n ])\n )\n )\n .optional(),\n // sassOptions properties are unknown besides implementation, use z.any() here\n sassOptions: z\n .object({\n implementation: z.string().optional(),\n })\n .catchall(z.any())\n .optional(),\n serverExternalPackages: z.array(z.string()).optional(),\n skipMiddlewareUrlNormalize: z.boolean().optional(),\n skipProxyUrlNormalize: z.boolean().optional(),\n skipTrailingSlashRedirect: z.boolean().optional(),\n staticPageGenerationTimeout: z.number().optional(),\n expireTime: z.number().optional(),\n target: z.string().optional(),\n trailingSlash: z.boolean().optional(),\n transpilePackages: z.array(z.string()).optional(),\n turbopack: zTurbopackConfig.optional(),\n typescript: z\n .strictObject({\n ignoreBuildErrors: z.boolean().optional(),\n tsconfigPath: z.string().min(1).optional(),\n })\n .optional(),\n typedRoutes: z.boolean().optional(),\n useFileSystemPublicRoutes: z.boolean().optional(),\n // The webpack config type is unknown, use z.any() here\n webpack: z.any().nullable().optional(),\n watchOptions: z\n .strictObject({\n pollIntervalMs: z.number().positive().finite().optional(),\n })\n .optional(),\n })\n)\n"],"names":["configSchema","experimentalSchema","zSizeLimit","z","custom","val","zExportMap","record","string","object","page","query","any","_fallbackRouteParams","array","optional","_isAppDir","boolean","_isDynamicError","_isRoutePPREnabled","_allowEmptyStaticShell","_isFallbackUpgradeable","zRouteHas","union","type","enum","key","value","literal","undefined","zRewrite","source","destination","basePath","locale","has","missing","internal","zRedirect","and","statusCode","never","permanent","number","zHeader","headers","zTurbopackLoaderItem","strictObject","loader","options","zTurbopackLoaderBuiltinCondition","zTurbopackCondition","all","lazy","not","path","instanceof","RegExp","content","contentType","zTurbopackModuleType","zTurbopackRuleConfigItem","loaders","as","condition","zTurbopackRuleConfigCollection","zTurbopackConfig","rules","resolveAlias","resolveExtensions","root","debugIds","chunkLoadingGlobal","ignoreIssue","title","description","outputHashSalt","useSkewCookie","after","appNavFailHandling","appNewScrollHandler","preloadEntriesOnStart","allowedRevalidateHeaderKeys","staleTimes","dynamic","static","gte","cacheLife","stale","revalidate","expire","cacheHandlers","clientRouterFilter","clientRouterFilterRedirects","clientRouterFilterAllowedRate","cpus","memoryBasedWorkersCount","craCompat","caseSensitiveRoutes","clientParamParsingOrigins","cachedNavigations","dynamicOnHover","useOffline","optimisticRouting","instrumentationClientRouterTransitionEvents","appShells","varyParams","prefetchInlining","maxSize","maxBundleSize","disableOptimizedLoading","disablePostcssPresetEnv","cacheComponents","inlineCss","esmExternals","serverActions","bodySizeLimit","allowedOrigins","maxPostponedStateSize","extensionAlias","externalDir","externalMiddlewareRewritesResolve","externalProxyRewritesResolve","exposeTestingApiInProductionBuild","fallbackNodePolyfills","fetchCacheKeyPrefix","forceSwcTransforms","fullySpecified","gzipSize","imgOptConcurrency","int","nullable","imgOptOperationCache","imgOptTimeoutInSeconds","imgOptMaxInputPixels","imgOptSequentialRead","imgOptSkipMetadata","isrFlushToDisk","largePageDataBytes","linkNoTouchStart","manualClientBasePath","middlewarePrefetch","proxyPrefetch","middlewareClientMaxBodySize","proxyClientMaxBodySize","multiZoneDraftMode","cssChunking","requestCost","nonnegative","finite","moduleFactorCost","nextScriptWorkers","optimizeCss","optimisticClientCache","parallelServerCompiles","parallelServerBuildTraces","ppr","readonly","taint","blockingSSR","prerenderEarlyExit","proxyTimeout","rootParams","mcpServer","removeUncaughtErrorAndRejectionListeners","validateRSCRequestHeaders","scrollRestoration","sri","algorithm","swcPlugins","tuple","swcEnvOptions","mode","coreJs","skip","include","exclude","shippedProposals","forceAllTransforms","debug","loose","swcTraceProfiling","urlImports","viewTransition","workerThreads","webVitalsAttribution","mdxRs","development","jsxRuntime","jsxImportSource","providerImportSource","mdxType","transitionIndicator","gestureTransition","typedRoutes","webpackBuildWorker","webpackMemoryOptimizations","turbopackMemoryEviction","turbopackPluginRuntimeStrategy","turbopackMinify","turbopackFileSystemCacheForDev","turbopackFileSystemCacheForBuild","turbopackSourceMaps","turbopackInputSourceMaps","turbopackTreeShaking","turbopackRemoveUnusedImports","turbopackRemoveUnusedExports","turbopackScopeHoisting","turbopackWorkerAssetPrefix","turbopackClientSideNestedAsyncChunking","turbopackServerSideNestedAsyncChunking","turbopackImportTypeBytes","turbopackImportTypeText","turbopackUseBuiltinBabel","turbopackUseBuiltinSass","turbopackLocalPostcssConfig","turbopackModuleIds","turbopackInferModuleSideEffects","turbopackServerFastRefresh","optimizePackageImports","optimizeServerReact","strictRouteTypes","clientTraceMetadata","serverMinification","serverSourceMaps","useWasmBinary","useLightningcss","lightningCssFeatures","LIGHTNINGCSS_FEATURE_NAMES","testProxy","defaultTestRunner","SUPPORTED_TEST_RUNNERS_LIST","allowDevelopmentBuild","reactDebugChannel","instantInsights","validationLevel","staticGenerationRetryCount","staticGenerationMaxConcurrency","staticGenerationMinPagesPerWorker","typedEnv","serverComponentsHmrCache","authInterrupts","useCache","useCacheTimeout","positive","slowModuleDetection","buildTimeThresholdMs","globalNotFound","turbopackRustReactCompiler","browserDebugInfoInTerminal","level","depthLimit","edgeLimit","showSourceLocation","lockDistDir","hideLogsAfterAbort","runtimeServerDeploymentId","supportsImmutableAssets","deferredEntries","onBeforeDeferredEntries","function","returns","promise","void","reportSystemEnvInlining","adapterPath","agentRules","allowedDevOrigins","assetPrefix","bundlePagesRouterDependencies","cacheHandler","min","cacheMaxMemorySize","cleanDistDir","compiler","emotion","sourceMap","autoLabel","labelFormat","importMap","canonicalImport","styledBaseImport","reactRemoveProperties","properties","relay","src","artifactDirectory","language","eagerEsModules","removeConsole","styledComponents","displayName","topLevelImportPaths","ssr","fileName","meaninglessFileNames","minify","transpileTemplateLiterals","namespace","pure","cssProp","styledJsx","define","defineServer","runAfterProductionCompile","compress","configOrigin","crossOrigin","deploymentId","devIndicators","position","distDir","env","enablePrerenderSourceMaps","excludeDefaultMomentLocales","experimental","exportPathMap","args","dev","dir","outDir","buildId","generateBuildId","null","generateEtags","htmlLimitedBots","httpAgentOptions","keepAlive","i18n","defaultLocale","domains","domain","http","locales","localeDetection","images","localPatterns","pathname","search","max","remotePatterns","URL","hostname","port","protocol","unoptimized","customCacheHandler","contentSecurityPolicy","contentDispositionType","dangerouslyAllowSVG","dangerouslyAllowLocalIP","deviceSizes","lte","disableStaticImages","formats","imageSizes","VALID_LOADERS","loaderFile","maximumDiskCacheSize","maximumRedirects","maximumResponseBody","Number","MAX_SAFE_INTEGER","minimumCacheTTL","qualities","logging","fetches","fullUrl","hmrRefreshes","incomingRequests","ignore","serverFunctions","browserToTerminal","modularizeImports","transform","preventFullImport","skipDefaultConversion","onDemandEntries","maxInactiveAge","pagesBufferLength","output","outputFileTracingRoot","outputFileTracingExcludes","outputFileTracingIncludes","pageExtensions","instrumentationClientInject","partialPrefetching","poweredByHeader","productionBrowserSourceMaps","reactCompiler","compilationMode","panicThreshold","reactProductionProfiling","reactStrictMode","reactMaxHeadersLength","redirects","rewrites","beforeFiles","afterFiles","fallback","sassOptions","implementation","catchall","serverExternalPackages","skipMiddlewareUrlNormalize","skipProxyUrlNormalize","skipTrailingSlashRedirect","staticPageGenerationTimeout","expireTime","target","trailingSlash","transpilePackages","turbopack","typescript","ignoreBuildErrors","tsconfigPath","useFileSystemPublicRoutes","webpack","watchOptions","pollIntervalMs"],"mappings":";;;;;;;;;;;;;;;IAgdaA,YAAY;eAAZA;;IAjRAC,kBAAkB;eAAlBA;;;6BA9LiB;qBAEZ;8BAaX;0BAOqC;AAE5C,6CAA6C;AAC7C,MAAMC,aAAaC,MAAC,CAACC,MAAM,CAAY,CAACC;IACtC,IAAI,OAAOA,QAAQ,YAAY,OAAOA,QAAQ,UAAU;QACtD,OAAO;IACT;IACA,OAAO;AACT;AAEA,MAAMC,aAAyCH,MAAC,CAACI,MAAM,CACrDJ,MAAC,CAACK,MAAM,IACRL,MAAC,CAACM,MAAM,CAAC;IACPC,MAAMP,MAAC,CAACK,MAAM;IACdG,OAAOR,MAAC,CAACS,GAAG;IAEZ,8BAA8B;IAC9BC,sBAAsBV,MAAC,CAACW,KAAK,CAACX,MAAC,CAACS,GAAG,IAAIG,QAAQ;IAC/CC,WAAWb,MAAC,CAACc,OAAO,GAAGF,QAAQ;IAC/BG,iBAAiBf,MAAC,CAACc,OAAO,GAAGF,QAAQ;IACrCI,oBAAoBhB,MAAC,CAACc,OAAO,GAAGF,QAAQ;IACxCK,wBAAwBjB,MAAC,CAACc,OAAO,GAAGF,QAAQ;IAC5CM,wBAAwBlB,MAAC,CAACc,OAAO,GAAGF,QAAQ;AAC9C;AAGF,MAAMO,YAAmCnB,MAAC,CAACoB,KAAK,CAAC;IAC/CpB,MAAC,CAACM,MAAM,CAAC;QACPe,MAAMrB,MAAC,CAACsB,IAAI,CAAC;YAAC;YAAU;YAAS;SAAS;QAC1CC,KAAKvB,MAAC,CAACK,MAAM;QACbmB,OAAOxB,MAAC,CAACK,MAAM,GAAGO,QAAQ;IAC5B;IACAZ,MAAC,CAACM,MAAM,CAAC;QACPe,MAAMrB,MAAC,CAACyB,OAAO,CAAC;QAChB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C,GAAGhQ,QAAQ;QAC1C,GACCA,QAAQ;QACXmL,aAAa/L,MAAC,CAACc,OAAO,GAAGF,QAAQ;QACjCiZ,2BAA2B7Z,MAAC,CAACc,OAAO,GAAGF,QAAQ;QAC/C,uDAAuD;QACvDkZ,SAAS9Z,MAAC,CAACS,GAAG,GAAGuH,QAAQ,GAAGpH,QAAQ;QACpCmZ,cAAc/Z,MAAC,CACZ4C,YAAY,CAAC;YACZoX,gBAAgBha,MAAC,CAACwC,MAAM,GAAGyM,QAAQ,GAAG/F,MAAM,GAAGtI,QAAQ;QACzD,GACCA,QAAQ;IACb","ignoreList":[0]} | ||
| {"version":3,"sources":["../../src/server/config-schema.ts"],"sourcesContent":["import type { NextConfig } from './config'\nimport { VALID_LOADERS } from '../shared/lib/image-config'\n\nimport { z } from 'next/dist/compiled/zod'\nimport type zod from 'next/dist/compiled/zod'\n\nimport type { SizeLimit } from '../types'\nimport {\n LIGHTNINGCSS_FEATURE_NAMES,\n type ExportPathMap,\n type TurbopackLoaderItem,\n type TurbopackOptions,\n type TurbopackRuleConfigItem,\n type TurbopackRuleConfigCollection,\n type TurbopackRuleCondition,\n type TurbopackLoaderBuiltinCondition,\n} from './config-shared'\nimport type {\n Header,\n Rewrite,\n RouteHas,\n Redirect,\n} from '../lib/load-custom-routes'\nimport { SUPPORTED_TEST_RUNNERS_LIST } from '../cli/next-test'\n\n// A custom zod schema for the SizeLimit type\nconst zSizeLimit = z.custom<SizeLimit>((val) => {\n if (typeof val === 'number' || typeof val === 'string') {\n return true\n }\n return false\n})\n\nconst zExportMap: zod.ZodType<ExportPathMap> = z.record(\n z.string(),\n z.object({\n page: z.string(),\n query: z.any(), // NextParsedUrlQuery\n\n // private optional properties\n _fallbackRouteParams: z.array(z.any()).optional(),\n _isAppDir: z.boolean().optional(),\n _isDynamicError: z.boolean().optional(),\n _isRoutePPREnabled: z.boolean().optional(),\n _allowEmptyStaticShell: z.boolean().optional(),\n _isFallbackUpgradeable: z.boolean().optional(),\n })\n)\n\nconst zRouteHas: zod.ZodType<RouteHas> = z.union([\n z.object({\n type: z.enum(['header', 'query', 'cookie']),\n key: z.string(),\n value: z.string().optional(),\n }),\n z.object({\n type: z.literal('host'),\n key: z.undefined().optional(),\n value: z.string(),\n }),\n])\n\nconst zRewrite: zod.ZodType<Rewrite> = z.object({\n source: z.string(),\n destination: z.string(),\n basePath: z.literal(false).optional(),\n locale: z.literal(false).optional(),\n has: z.array(zRouteHas).optional(),\n missing: z.array(zRouteHas).optional(),\n internal: z.boolean().optional(),\n})\n\nconst zRedirect: zod.ZodType<Redirect> = z\n .object({\n source: z.string(),\n destination: z.string(),\n basePath: z.literal(false).optional(),\n locale: z.literal(false).optional(),\n has: z.array(zRouteHas).optional(),\n missing: z.array(zRouteHas).optional(),\n internal: z.boolean().optional(),\n })\n .and(\n z.union([\n z.object({\n statusCode: z.never().optional(),\n permanent: z.boolean(),\n }),\n z.object({\n statusCode: z.number(),\n permanent: z.never().optional(),\n }),\n ])\n )\n\nconst zHeader: zod.ZodType<Header> = z.object({\n source: z.string(),\n basePath: z.literal(false).optional(),\n locale: z.literal(false).optional(),\n headers: z.array(z.object({ key: z.string(), value: z.string() })),\n has: z.array(zRouteHas).optional(),\n missing: z.array(zRouteHas).optional(),\n\n internal: z.boolean().optional(),\n})\n\nconst zTurbopackLoaderItem: zod.ZodType<TurbopackLoaderItem> = z.union([\n z.string(),\n z.strictObject({\n loader: z.string(),\n // Any JSON value can be used as turbo loader options, so use z.any() here\n options: z.record(z.string(), z.any()).optional(),\n }),\n])\n\nconst zTurbopackLoaderBuiltinCondition: zod.ZodType<TurbopackLoaderBuiltinCondition> =\n z.union([\n z.literal('browser'),\n z.literal('foreign'),\n z.literal('development'),\n z.literal('production'),\n z.literal('node'),\n z.literal('edge-light'),\n ])\n\nconst zTurbopackCondition: zod.ZodType<TurbopackRuleCondition> = z.union([\n z.strictObject({ all: z.lazy(() => z.array(zTurbopackCondition)) }),\n z.strictObject({ any: z.lazy(() => z.array(zTurbopackCondition)) }),\n z.strictObject({ not: z.lazy(() => zTurbopackCondition) }),\n zTurbopackLoaderBuiltinCondition,\n z.strictObject({\n path: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n content: z.instanceof(RegExp).optional(),\n query: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n contentType: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n }),\n])\n\nconst zTurbopackModuleType = z.enum([\n 'asset',\n 'ecmascript',\n 'typescript',\n 'css',\n 'css-module',\n 'wasm',\n 'raw',\n 'node',\n 'bytes',\n])\n\nconst zTurbopackRuleConfigItem: zod.ZodType<TurbopackRuleConfigItem> =\n z.strictObject({\n loaders: z.array(zTurbopackLoaderItem).optional(),\n as: z.string().optional(),\n condition: zTurbopackCondition.optional(),\n type: zTurbopackModuleType.optional(),\n })\n\nconst zTurbopackRuleConfigCollection: zod.ZodType<TurbopackRuleConfigCollection> =\n z.union([\n zTurbopackRuleConfigItem,\n z.array(z.union([zTurbopackLoaderItem, zTurbopackRuleConfigItem])),\n ])\n\nconst zTurbopackConfig: zod.ZodType<TurbopackOptions> = z.strictObject({\n rules: z.record(z.string(), zTurbopackRuleConfigCollection).optional(),\n resolveAlias: z\n .record(\n z.string(),\n z.union([\n z.string(),\n z.array(z.string()),\n z.record(z.string(), z.union([z.string(), z.array(z.string())])),\n ])\n )\n .optional(),\n resolveExtensions: z.array(z.string()).optional(),\n root: z.string().optional(),\n debugIds: z.boolean().optional(),\n chunkLoadingGlobal: z.string().optional(),\n ignoreIssue: z\n .array(\n z.object({\n path: z.union([z.string(), z.instanceof(RegExp)]),\n title: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n description: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n })\n )\n .optional(),\n})\n\nexport const experimentalSchema = {\n outputHashSalt: z.string().optional(),\n useSkewCookie: z.boolean().optional(),\n after: z.boolean().optional(),\n appNavFailHandling: z.boolean().optional(),\n appNewScrollHandler: z.boolean().optional(),\n coldCacheBadge: z.boolean().optional(),\n preloadEntriesOnStart: z.boolean().optional(),\n allowedRevalidateHeaderKeys: z.array(z.string()).optional(),\n staleTimes: z\n .object({\n dynamic: z.number().optional(),\n static: z.number().gte(30).optional(),\n })\n .optional(),\n cacheLife: z\n .record(\n z.object({\n stale: z.number().optional(),\n revalidate: z.number().optional(),\n expire: z.number().optional(),\n })\n )\n .optional(),\n cacheHandlers: z.record(z.string(), z.string().optional()).optional(),\n clientRouterFilter: z.boolean().optional(),\n clientRouterFilterRedirects: z.boolean().optional(),\n clientRouterFilterAllowedRate: z.number().optional(),\n cpus: z.number().optional(),\n memoryBasedWorkersCount: z.boolean().optional(),\n craCompat: z.boolean().optional(),\n caseSensitiveRoutes: z.boolean().optional(),\n clientParamParsingOrigins: z.array(z.string()).optional(),\n cachedNavigations: z\n .union([z.boolean(), z.literal('allow-runtime')])\n .optional(),\n dynamicOnHover: z.boolean().optional(),\n useOffline: z.boolean().optional(),\n optimisticRouting: z.boolean().optional(),\n instrumentationClientRouterTransitionEvents: z.boolean().optional(),\n appShells: z.boolean().optional(),\n varyParams: z.boolean().optional(),\n prefetchInlining: z\n .union([\n z.boolean(),\n z.object({\n maxSize: z.number().optional(),\n maxBundleSize: z.number().optional(),\n }),\n ])\n .optional(),\n disableOptimizedLoading: z.boolean().optional(),\n disablePostcssPresetEnv: z.boolean().optional(),\n cacheComponents: z.boolean().optional(),\n inlineCss: z.boolean().optional(),\n esmExternals: z.union([z.boolean(), z.literal('loose')]).optional(),\n serverActions: z\n .object({\n bodySizeLimit: zSizeLimit.optional(),\n allowedOrigins: z.array(z.string()).optional(),\n })\n .optional(),\n maxPostponedStateSize: zSizeLimit.optional(),\n // The original type was Record<string, any>\n extensionAlias: z.record(z.string(), z.any()).optional(),\n externalDir: z.boolean().optional(),\n externalMiddlewareRewritesResolve: z.boolean().optional(),\n externalProxyRewritesResolve: z.boolean().optional(),\n exposeTestingApiInProductionBuild: z.boolean().optional(),\n fallbackNodePolyfills: z.literal(false).optional(),\n fetchCacheKeyPrefix: z.string().optional(),\n forceSwcTransforms: z.boolean().optional(),\n fullySpecified: z.boolean().optional(),\n gzipSize: z.boolean().optional(),\n imgOptConcurrency: z.number().int().optional().nullable(),\n imgOptOperationCache: z.boolean().optional().nullable(),\n imgOptTimeoutInSeconds: z.number().int().optional(),\n imgOptMaxInputPixels: z.number().int().optional(),\n imgOptSequentialRead: z.boolean().optional().nullable(),\n imgOptSkipMetadata: z.boolean().optional().nullable(),\n isrFlushToDisk: z.boolean().optional(),\n largePageDataBytes: z.number().optional(),\n linkNoTouchStart: z.boolean().optional(),\n manualClientBasePath: z.boolean().optional(),\n middlewarePrefetch: z.enum(['strict', 'flexible']).optional(),\n proxyPrefetch: z.enum(['strict', 'flexible']).optional(),\n middlewareClientMaxBodySize: zSizeLimit.optional(),\n proxyClientMaxBodySize: zSizeLimit.optional(),\n multiZoneDraftMode: z.boolean().optional(),\n cssChunking: z\n .union([\n z.boolean(),\n z.literal('strict'),\n z.literal('loose'),\n z.literal('graph'),\n z.strictObject({ type: z.literal('strict') }),\n z.strictObject({ type: z.literal('loose') }),\n z.strictObject({\n type: z.literal('graph'),\n requestCost: z.number().nonnegative().finite().optional(),\n moduleFactorCost: z.number().nonnegative().finite().optional(),\n }),\n ])\n .optional(),\n nextScriptWorkers: z.boolean().optional(),\n // The critter option is unknown, use z.any() here\n optimizeCss: z.union([z.boolean(), z.any()]).optional(),\n optimisticClientCache: z.boolean().optional(),\n parallelServerCompiles: z.boolean().optional(),\n parallelServerBuildTraces: z.boolean().optional(),\n ppr: z\n .union([z.boolean(), z.literal('incremental')])\n .readonly()\n .optional(),\n taint: z.boolean().optional(),\n blockingSSR: z.boolean().optional(),\n prerenderEarlyExit: z.boolean().optional(),\n proxyTimeout: z.number().gte(0).optional(),\n rootParams: z.boolean().optional(),\n mcpServer: z.boolean().optional(),\n removeUncaughtErrorAndRejectionListeners: z.boolean().optional(),\n validateRSCRequestHeaders: z.boolean().optional(),\n scrollRestoration: z.boolean().optional(),\n sri: z\n .object({\n algorithm: z.enum(['sha256', 'sha384', 'sha512']).optional(),\n })\n .optional(),\n swcPlugins: z\n // The specific swc plugin's option is unknown, use z.any() here\n .array(z.tuple([z.string(), z.record(z.string(), z.any())]))\n .optional(),\n swcEnvOptions: z\n .object({\n mode: z.enum(['usage', 'entry']).optional(),\n coreJs: z.string().optional(),\n skip: z.array(z.string()).optional(),\n include: z.array(z.string()).optional(),\n exclude: z.array(z.string()).optional(),\n shippedProposals: z.boolean().optional(),\n forceAllTransforms: z.boolean().optional(),\n debug: z.boolean().optional(),\n loose: z.boolean().optional(),\n })\n .optional(),\n swcTraceProfiling: z.boolean().optional(),\n // NonNullable<webpack.Configuration['experiments']>['buildHttp']\n urlImports: z.any().optional(),\n viewTransition: z.boolean().optional(),\n workerThreads: z.boolean().optional(),\n webVitalsAttribution: z\n .array(\n z.union([\n z.literal('CLS'),\n z.literal('FCP'),\n z.literal('FID'),\n z.literal('INP'),\n z.literal('LCP'),\n z.literal('TTFB'),\n ])\n )\n .optional(),\n // This is partial set of mdx-rs transform options we support, aligned\n // with next_core::next_config::MdxRsOptions. Ensure both types are kept in sync.\n mdxRs: z\n .union([\n z.boolean(),\n z.object({\n development: z.boolean().optional(),\n jsxRuntime: z.string().optional(),\n jsxImportSource: z.string().optional(),\n providerImportSource: z.string().optional(),\n mdxType: z.enum(['gfm', 'commonmark']).optional(),\n }),\n ])\n .optional(),\n transitionIndicator: z.boolean().optional(),\n gestureTransition: z.boolean().optional(),\n typedRoutes: z.boolean().optional(),\n webpackBuildWorker: z.boolean().optional(),\n webpackMemoryOptimizations: z.boolean().optional(),\n turbopackMemoryEviction: z\n .union([z.literal(false), z.literal('full')])\n .optional(),\n turbopackPluginRuntimeStrategy: z\n .enum(['workerThreads', 'childProcesses', 'forceWorkerThreads'])\n .optional(),\n turbopackMinify: z.boolean().optional(),\n turbopackFileSystemCacheForDev: z.boolean().optional(),\n turbopackFileSystemCacheForBuild: z.boolean().optional(),\n turbopackSourceMaps: z.boolean().optional(),\n turbopackInputSourceMaps: z.boolean().optional(),\n turbopackTreeShaking: z.boolean().optional(),\n turbopackRemoveUnusedImports: z.boolean().optional(),\n turbopackRemoveUnusedExports: z.boolean().optional(),\n turbopackScopeHoisting: z.boolean().optional(),\n turbopackWorkerAssetPrefix: z.string().optional(),\n turbopackClientSideNestedAsyncChunking: z.boolean().optional(),\n turbopackServerSideNestedAsyncChunking: z.boolean().optional(),\n turbopackImportTypeBytes: z.boolean().optional(),\n turbopackImportTypeText: z.boolean().optional(),\n turbopackUseBuiltinBabel: z.boolean().optional(),\n turbopackUseBuiltinSass: z.boolean().optional(),\n turbopackLocalPostcssConfig: z.boolean().optional(),\n turbopackModuleIds: z.enum(['named', 'deterministic']).optional(),\n turbopackInferModuleSideEffects: z.boolean().optional(),\n turbopackServerFastRefresh: z.boolean().optional(),\n optimizePackageImports: z.array(z.string()).optional(),\n optimizeServerReact: z.boolean().optional(),\n strictRouteTypes: z.boolean().optional(),\n clientTraceMetadata: z.array(z.string()).optional(),\n serverMinification: z.boolean().optional(),\n serverSourceMaps: z.boolean().optional(),\n useWasmBinary: z.boolean().optional(),\n useLightningcss: z.boolean().optional(),\n lightningCssFeatures: z\n .object({\n include: z.array(z.enum(LIGHTNINGCSS_FEATURE_NAMES)).optional(),\n exclude: z.array(z.enum(LIGHTNINGCSS_FEATURE_NAMES)).optional(),\n })\n .optional(),\n testProxy: z.boolean().optional(),\n defaultTestRunner: z.enum(SUPPORTED_TEST_RUNNERS_LIST).optional(),\n allowDevelopmentBuild: z.literal(true).optional(),\n\n reactDebugChannel: z.boolean().optional(),\n instantInsights: z\n .object({\n validationLevel: z\n .enum([\n 'warning',\n 'manual-warning',\n 'experimental-error',\n 'experimental-manual-error',\n ])\n .optional(),\n })\n .optional(),\n staticGenerationRetryCount: z.number().int().optional(),\n staticGenerationMaxConcurrency: z.number().int().optional(),\n staticGenerationMinPagesPerWorker: z.number().int().optional(),\n typedEnv: z.boolean().optional(),\n serverComponentsHmrCache: z.boolean().optional(),\n authInterrupts: z.boolean().optional(),\n useCache: z.boolean().optional(),\n useCacheTimeout: z.number().positive().optional(),\n slowModuleDetection: z\n .object({\n buildTimeThresholdMs: z.number().int(),\n })\n .optional(),\n globalNotFound: z.boolean().optional(),\n turbopackRustReactCompiler: z.boolean().optional(),\n browserDebugInfoInTerminal: z\n .union([\n z.boolean(),\n z.enum(['error', 'warn', 'verbose']),\n z.object({\n level: z.enum(['error', 'warn', 'verbose']).optional(),\n depthLimit: z.number().int().positive().optional(),\n edgeLimit: z.number().int().positive().optional(),\n showSourceLocation: z.boolean().optional(),\n }),\n ])\n .optional(),\n lockDistDir: z.boolean().optional(),\n hideLogsAfterAbort: z.boolean().optional(),\n runtimeServerDeploymentId: z.boolean().optional(),\n supportsImmutableAssets: z.boolean().optional(),\n deferredEntries: z.array(z.string()).optional(),\n onBeforeDeferredEntries: z.function().returns(z.promise(z.void())).optional(),\n reportSystemEnvInlining: z.enum(['warn', 'error']).optional(),\n}\n\nexport const configSchema: zod.ZodType<NextConfig> = z.lazy(() =>\n z.strictObject({\n adapterPath: z.string().optional(),\n agentRules: z.boolean().optional(),\n allowedDevOrigins: z.array(z.string()).optional(),\n assetPrefix: z.string().optional(),\n basePath: z.string().optional(),\n bundlePagesRouterDependencies: z.boolean().optional(),\n cacheComponents: z.boolean().optional(),\n cacheHandler: z.string().min(1).optional(),\n cacheHandlers: z.record(z.string(), z.string().optional()).optional(),\n cacheLife: z\n .record(\n z.object({\n stale: z.number().optional(),\n revalidate: z.number().optional(),\n expire: z.number().optional(),\n })\n )\n .optional(),\n cacheMaxMemorySize: z.number().optional(),\n cleanDistDir: z.boolean().optional(),\n compiler: z\n .strictObject({\n emotion: z\n .union([\n z.boolean(),\n z.object({\n sourceMap: z.boolean().optional(),\n autoLabel: z\n .union([\n z.literal('always'),\n z.literal('dev-only'),\n z.literal('never'),\n ])\n .optional(),\n labelFormat: z.string().min(1).optional(),\n importMap: z\n .record(\n z.string(),\n z.record(\n z.string(),\n z.object({\n canonicalImport: z\n .tuple([z.string(), z.string()])\n .optional(),\n styledBaseImport: z\n .tuple([z.string(), z.string()])\n .optional(),\n })\n )\n )\n .optional(),\n }),\n ])\n .optional(),\n reactRemoveProperties: z\n .union([\n z.boolean().optional(),\n z.object({\n properties: z.array(z.string()).optional(),\n }),\n ])\n .optional(),\n relay: z\n .object({\n src: z.string(),\n artifactDirectory: z.string().optional(),\n language: z.enum(['javascript', 'typescript', 'flow']).optional(),\n eagerEsModules: z.boolean().optional(),\n })\n .optional(),\n removeConsole: z\n .union([\n z.boolean().optional(),\n z.object({\n exclude: z.array(z.string()).min(1).optional(),\n }),\n ])\n .optional(),\n styledComponents: z.union([\n z.boolean().optional(),\n z.object({\n displayName: z.boolean().optional(),\n topLevelImportPaths: z.array(z.string()).optional(),\n ssr: z.boolean().optional(),\n fileName: z.boolean().optional(),\n meaninglessFileNames: z.array(z.string()).optional(),\n minify: z.boolean().optional(),\n transpileTemplateLiterals: z.boolean().optional(),\n namespace: z.string().min(1).optional(),\n pure: z.boolean().optional(),\n cssProp: z.boolean().optional(),\n }),\n ]),\n styledJsx: z.union([\n z.boolean().optional(),\n z.object({\n useLightningcss: z.boolean().optional(),\n }),\n ]),\n define: z\n .record(z.string(), z.union([z.string(), z.number(), z.boolean()]))\n .optional(),\n defineServer: z\n .record(z.string(), z.union([z.string(), z.number(), z.boolean()]))\n .optional(),\n runAfterProductionCompile: z\n .function()\n .returns(z.promise(z.void()))\n .optional(),\n })\n .optional(),\n compress: z.boolean().optional(),\n configOrigin: z.string().optional(),\n crossOrigin: z\n .union([z.literal('anonymous'), z.literal('use-credentials')])\n .optional(),\n deploymentId: z.string().optional(),\n devIndicators: z\n .union([\n z.object({\n position: z\n .union([\n z.literal('bottom-left'),\n z.literal('bottom-right'),\n z.literal('top-left'),\n z.literal('top-right'),\n ])\n .optional(),\n }),\n z.literal(false),\n ])\n .optional(),\n distDir: z.string().min(1).optional(),\n env: z.record(z.string(), z.union([z.string(), z.undefined()])).optional(),\n enablePrerenderSourceMaps: z.boolean().optional(),\n excludeDefaultMomentLocales: z.boolean().optional(),\n experimental: z.strictObject(experimentalSchema).optional(),\n exportPathMap: z\n .function()\n .args(\n zExportMap,\n z.object({\n dev: z.boolean(),\n dir: z.string(),\n outDir: z.string().nullable(),\n distDir: z.string(),\n buildId: z.string(),\n })\n )\n .returns(z.union([zExportMap, z.promise(zExportMap)]))\n .optional(),\n generateBuildId: z\n .function()\n .args()\n .returns(\n z.union([\n z.string(),\n z.null(),\n z.promise(z.union([z.string(), z.null()])),\n ])\n )\n .optional(),\n generateEtags: z.boolean().optional(),\n headers: z\n .function()\n .args()\n .returns(z.promise(z.array(zHeader)))\n .optional(),\n htmlLimitedBots: z.instanceof(RegExp).optional(),\n httpAgentOptions: z\n .strictObject({ keepAlive: z.boolean().optional() })\n .optional(),\n i18n: z\n .strictObject({\n defaultLocale: z.string().min(1),\n domains: z\n .array(\n z.strictObject({\n defaultLocale: z.string().min(1),\n domain: z.string().min(1),\n http: z.literal(true).optional(),\n locales: z.array(z.string().min(1)).optional(),\n })\n )\n .optional(),\n localeDetection: z.literal(false).optional(),\n locales: z.array(z.string().min(1)),\n })\n .nullable()\n .optional(),\n images: z\n .strictObject({\n localPatterns: z\n .array(\n z.strictObject({\n pathname: z.string().optional(),\n search: z.string().optional(),\n })\n )\n .max(25)\n .optional(),\n remotePatterns: z\n .array(\n z.union([\n z.instanceof(URL),\n z.strictObject({\n hostname: z.string(),\n pathname: z.string().optional(),\n port: z.string().max(5).optional(),\n protocol: z.enum(['http', 'https']).optional(),\n search: z.string().optional(),\n }),\n ])\n )\n .max(50)\n .optional(),\n unoptimized: z.boolean().optional(),\n customCacheHandler: z.boolean().optional(),\n contentSecurityPolicy: z.string().optional(),\n contentDispositionType: z.enum(['inline', 'attachment']).optional(),\n dangerouslyAllowSVG: z.boolean().optional(),\n dangerouslyAllowLocalIP: z.boolean().optional(),\n deviceSizes: z\n .array(z.number().int().gte(1).lte(10000))\n .max(25)\n .optional(),\n disableStaticImages: z.boolean().optional(),\n domains: z.array(z.string()).max(50).optional(),\n formats: z\n .array(z.enum(['image/avif', 'image/webp']))\n .max(4)\n .optional(),\n imageSizes: z\n .array(z.number().int().gte(1).lte(10000))\n .min(0)\n .max(25)\n .optional(),\n loader: z.enum(VALID_LOADERS).optional(),\n loaderFile: z.string().optional(),\n maximumDiskCacheSize: z.number().int().min(0).optional(),\n maximumRedirects: z.number().int().min(0).max(20).optional(),\n maximumResponseBody: z\n .number()\n .int()\n .min(1)\n .max(Number.MAX_SAFE_INTEGER)\n .optional(),\n minimumCacheTTL: z.number().int().gte(0).optional(),\n path: z.string().optional(),\n qualities: z\n .array(z.number().int().gte(1).lte(100))\n .min(1)\n .max(20)\n .optional(),\n })\n .optional(),\n logging: z\n .union([\n z.object({\n fetches: z\n .object({\n fullUrl: z.boolean().optional(),\n hmrRefreshes: z.boolean().optional(),\n })\n .optional(),\n incomingRequests: z\n .union([\n z.boolean(),\n z.object({\n ignore: z.array(z.instanceof(RegExp)),\n }),\n ])\n .optional(),\n serverFunctions: z.boolean().optional(),\n browserToTerminal: z\n .union([z.boolean(), z.enum(['error', 'warn'])])\n .optional(),\n }),\n z.literal(false),\n ])\n .optional(),\n modularizeImports: z\n .record(\n z.string(),\n z.object({\n transform: z.union([z.string(), z.record(z.string(), z.string())]),\n preventFullImport: z.boolean().optional(),\n skipDefaultConversion: z.boolean().optional(),\n })\n )\n .optional(),\n onDemandEntries: z\n .strictObject({\n maxInactiveAge: z.number().optional(),\n pagesBufferLength: z.number().optional(),\n })\n .optional(),\n output: z.enum(['standalone', 'export']).optional(),\n outputFileTracingRoot: z.string().optional(),\n outputFileTracingExcludes: z\n .record(z.string(), z.array(z.string()))\n .optional(),\n outputFileTracingIncludes: z\n .record(z.string(), z.array(z.string()))\n .optional(),\n pageExtensions: z.array(z.string()).min(1).optional(),\n instrumentationClientInject: z.array(z.string()).optional(),\n partialPrefetching: z\n .union([z.boolean(), z.literal('unstable_eager')])\n .optional(),\n poweredByHeader: z.boolean().optional(),\n productionBrowserSourceMaps: z.boolean().optional(),\n reactCompiler: z.union([\n z.boolean(),\n z\n .object({\n compilationMode: z.enum(['infer', 'annotation', 'all']).optional(),\n panicThreshold: z\n .enum(['none', 'critical_errors', 'all_errors'])\n .optional(),\n })\n .optional(),\n ]),\n reactProductionProfiling: z.boolean().optional(),\n reactStrictMode: z.boolean().nullable().optional(),\n reactMaxHeadersLength: z.number().nonnegative().int().optional(),\n redirects: z\n .function()\n .args()\n .returns(z.promise(z.array(zRedirect)))\n .optional(),\n rewrites: z\n .function()\n .args()\n .returns(\n z.promise(\n z.union([\n z.array(zRewrite),\n z.object({\n beforeFiles: z.array(zRewrite),\n afterFiles: z.array(zRewrite),\n fallback: z.array(zRewrite),\n }),\n ])\n )\n )\n .optional(),\n // sassOptions properties are unknown besides implementation, use z.any() here\n sassOptions: z\n .object({\n implementation: z.string().optional(),\n })\n .catchall(z.any())\n .optional(),\n serverExternalPackages: z.array(z.string()).optional(),\n skipMiddlewareUrlNormalize: z.boolean().optional(),\n skipProxyUrlNormalize: z.boolean().optional(),\n skipTrailingSlashRedirect: z.boolean().optional(),\n staticPageGenerationTimeout: z.number().optional(),\n expireTime: z.number().optional(),\n target: z.string().optional(),\n trailingSlash: z.boolean().optional(),\n transpilePackages: z.array(z.string()).optional(),\n turbopack: zTurbopackConfig.optional(),\n typescript: z\n .strictObject({\n ignoreBuildErrors: z.boolean().optional(),\n tsconfigPath: z.string().min(1).optional(),\n })\n .optional(),\n typedRoutes: z.boolean().optional(),\n useFileSystemPublicRoutes: z.boolean().optional(),\n // The webpack config type is unknown, use z.any() here\n webpack: z.any().nullable().optional(),\n watchOptions: z\n .strictObject({\n pollIntervalMs: z.number().positive().finite().optional(),\n })\n .optional(),\n })\n)\n"],"names":["configSchema","experimentalSchema","zSizeLimit","z","custom","val","zExportMap","record","string","object","page","query","any","_fallbackRouteParams","array","optional","_isAppDir","boolean","_isDynamicError","_isRoutePPREnabled","_allowEmptyStaticShell","_isFallbackUpgradeable","zRouteHas","union","type","enum","key","value","literal","undefined","zRewrite","source","destination","basePath","locale","has","missing","internal","zRedirect","and","statusCode","never","permanent","number","zHeader","headers","zTurbopackLoaderItem","strictObject","loader","options","zTurbopackLoaderBuiltinCondition","zTurbopackCondition","all","lazy","not","path","instanceof","RegExp","content","contentType","zTurbopackModuleType","zTurbopackRuleConfigItem","loaders","as","condition","zTurbopackRuleConfigCollection","zTurbopackConfig","rules","resolveAlias","resolveExtensions","root","debugIds","chunkLoadingGlobal","ignoreIssue","title","description","outputHashSalt","useSkewCookie","after","appNavFailHandling","appNewScrollHandler","coldCacheBadge","preloadEntriesOnStart","allowedRevalidateHeaderKeys","staleTimes","dynamic","static","gte","cacheLife","stale","revalidate","expire","cacheHandlers","clientRouterFilter","clientRouterFilterRedirects","clientRouterFilterAllowedRate","cpus","memoryBasedWorkersCount","craCompat","caseSensitiveRoutes","clientParamParsingOrigins","cachedNavigations","dynamicOnHover","useOffline","optimisticRouting","instrumentationClientRouterTransitionEvents","appShells","varyParams","prefetchInlining","maxSize","maxBundleSize","disableOptimizedLoading","disablePostcssPresetEnv","cacheComponents","inlineCss","esmExternals","serverActions","bodySizeLimit","allowedOrigins","maxPostponedStateSize","extensionAlias","externalDir","externalMiddlewareRewritesResolve","externalProxyRewritesResolve","exposeTestingApiInProductionBuild","fallbackNodePolyfills","fetchCacheKeyPrefix","forceSwcTransforms","fullySpecified","gzipSize","imgOptConcurrency","int","nullable","imgOptOperationCache","imgOptTimeoutInSeconds","imgOptMaxInputPixels","imgOptSequentialRead","imgOptSkipMetadata","isrFlushToDisk","largePageDataBytes","linkNoTouchStart","manualClientBasePath","middlewarePrefetch","proxyPrefetch","middlewareClientMaxBodySize","proxyClientMaxBodySize","multiZoneDraftMode","cssChunking","requestCost","nonnegative","finite","moduleFactorCost","nextScriptWorkers","optimizeCss","optimisticClientCache","parallelServerCompiles","parallelServerBuildTraces","ppr","readonly","taint","blockingSSR","prerenderEarlyExit","proxyTimeout","rootParams","mcpServer","removeUncaughtErrorAndRejectionListeners","validateRSCRequestHeaders","scrollRestoration","sri","algorithm","swcPlugins","tuple","swcEnvOptions","mode","coreJs","skip","include","exclude","shippedProposals","forceAllTransforms","debug","loose","swcTraceProfiling","urlImports","viewTransition","workerThreads","webVitalsAttribution","mdxRs","development","jsxRuntime","jsxImportSource","providerImportSource","mdxType","transitionIndicator","gestureTransition","typedRoutes","webpackBuildWorker","webpackMemoryOptimizations","turbopackMemoryEviction","turbopackPluginRuntimeStrategy","turbopackMinify","turbopackFileSystemCacheForDev","turbopackFileSystemCacheForBuild","turbopackSourceMaps","turbopackInputSourceMaps","turbopackTreeShaking","turbopackRemoveUnusedImports","turbopackRemoveUnusedExports","turbopackScopeHoisting","turbopackWorkerAssetPrefix","turbopackClientSideNestedAsyncChunking","turbopackServerSideNestedAsyncChunking","turbopackImportTypeBytes","turbopackImportTypeText","turbopackUseBuiltinBabel","turbopackUseBuiltinSass","turbopackLocalPostcssConfig","turbopackModuleIds","turbopackInferModuleSideEffects","turbopackServerFastRefresh","optimizePackageImports","optimizeServerReact","strictRouteTypes","clientTraceMetadata","serverMinification","serverSourceMaps","useWasmBinary","useLightningcss","lightningCssFeatures","LIGHTNINGCSS_FEATURE_NAMES","testProxy","defaultTestRunner","SUPPORTED_TEST_RUNNERS_LIST","allowDevelopmentBuild","reactDebugChannel","instantInsights","validationLevel","staticGenerationRetryCount","staticGenerationMaxConcurrency","staticGenerationMinPagesPerWorker","typedEnv","serverComponentsHmrCache","authInterrupts","useCache","useCacheTimeout","positive","slowModuleDetection","buildTimeThresholdMs","globalNotFound","turbopackRustReactCompiler","browserDebugInfoInTerminal","level","depthLimit","edgeLimit","showSourceLocation","lockDistDir","hideLogsAfterAbort","runtimeServerDeploymentId","supportsImmutableAssets","deferredEntries","onBeforeDeferredEntries","function","returns","promise","void","reportSystemEnvInlining","adapterPath","agentRules","allowedDevOrigins","assetPrefix","bundlePagesRouterDependencies","cacheHandler","min","cacheMaxMemorySize","cleanDistDir","compiler","emotion","sourceMap","autoLabel","labelFormat","importMap","canonicalImport","styledBaseImport","reactRemoveProperties","properties","relay","src","artifactDirectory","language","eagerEsModules","removeConsole","styledComponents","displayName","topLevelImportPaths","ssr","fileName","meaninglessFileNames","minify","transpileTemplateLiterals","namespace","pure","cssProp","styledJsx","define","defineServer","runAfterProductionCompile","compress","configOrigin","crossOrigin","deploymentId","devIndicators","position","distDir","env","enablePrerenderSourceMaps","excludeDefaultMomentLocales","experimental","exportPathMap","args","dev","dir","outDir","buildId","generateBuildId","null","generateEtags","htmlLimitedBots","httpAgentOptions","keepAlive","i18n","defaultLocale","domains","domain","http","locales","localeDetection","images","localPatterns","pathname","search","max","remotePatterns","URL","hostname","port","protocol","unoptimized","customCacheHandler","contentSecurityPolicy","contentDispositionType","dangerouslyAllowSVG","dangerouslyAllowLocalIP","deviceSizes","lte","disableStaticImages","formats","imageSizes","VALID_LOADERS","loaderFile","maximumDiskCacheSize","maximumRedirects","maximumResponseBody","Number","MAX_SAFE_INTEGER","minimumCacheTTL","qualities","logging","fetches","fullUrl","hmrRefreshes","incomingRequests","ignore","serverFunctions","browserToTerminal","modularizeImports","transform","preventFullImport","skipDefaultConversion","onDemandEntries","maxInactiveAge","pagesBufferLength","output","outputFileTracingRoot","outputFileTracingExcludes","outputFileTracingIncludes","pageExtensions","instrumentationClientInject","partialPrefetching","poweredByHeader","productionBrowserSourceMaps","reactCompiler","compilationMode","panicThreshold","reactProductionProfiling","reactStrictMode","reactMaxHeadersLength","redirects","rewrites","beforeFiles","afterFiles","fallback","sassOptions","implementation","catchall","serverExternalPackages","skipMiddlewareUrlNormalize","skipProxyUrlNormalize","skipTrailingSlashRedirect","staticPageGenerationTimeout","expireTime","target","trailingSlash","transpilePackages","turbopack","typescript","ignoreBuildErrors","tsconfigPath","useFileSystemPublicRoutes","webpack","watchOptions","pollIntervalMs"],"mappings":";;;;;;;;;;;;;;;IAidaA,YAAY;eAAZ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/C,uDAAuD;QACvDmZ,SAAS/Z,MAAC,CAACS,GAAG,GAAGwH,QAAQ,GAAGrH,QAAQ;QACpCoZ,cAAcha,MAAC,CACZ4C,YAAY,CAAC;YACZqX,gBAAgBja,MAAC,CAACwC,MAAM,GAAG0M,QAAQ,GAAG/F,MAAM,GAAGvI,QAAQ;QACzD,GACCA,QAAQ;IACb","ignoreList":[0]} |
@@ -195,2 +195,3 @@ "use strict"; | ||
| appNewScrollHandler: false, | ||
| coldCacheBadge: false, | ||
| useSkewCookie: false, | ||
@@ -197,0 +198,0 @@ cssChunking: true, |
@@ -94,3 +94,3 @@ "use strict"; | ||
| } | ||
| _log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"16.3.0-preview.4"}`))}${versionSuffix}`); | ||
| _log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"16.3.0-preview.5"}`))}${versionSuffix}`); | ||
| if (appUrl) { | ||
@@ -97,0 +97,0 @@ _log.bootstrap(`- Local: ${appUrl}`); |
@@ -8,3 +8,3 @@ import type { ManifestRoute } from '../../../build'; | ||
| export type FsOutput = { | ||
| type: 'appFile' | 'pageFile' | 'nextImage' | 'publicFolder' | 'nextStaticFolder' | 'legacyStaticFolder' | 'devVirtualFsItem'; | ||
| type: 'appFile' | 'pageFile' | 'nextImage' | 'publicFolder' | 'nextStaticFolder' | 'legacyStaticFolder' | 'serviceWorker' | 'devVirtualFsItem'; | ||
| itemPath: string; | ||
@@ -11,0 +11,0 @@ fsPath?: string; |
@@ -133,2 +133,3 @@ "use strict"; | ||
| const legacyStaticFolderItems = new Set(); | ||
| const serviceWorkerItems = new Set(); | ||
| const appFiles = new Set(); | ||
@@ -151,2 +152,3 @@ const pageFiles = new Set(); | ||
| const legacyStaticFolderPath = _path.default.join(opts.dir, 'static'); | ||
| const serviceWorkerFolderPath = _path.default.join(distDir, 'service-worker'); | ||
| let customRoutes = { | ||
@@ -206,2 +208,11 @@ redirects: [], | ||
| } | ||
| try { | ||
| for (const file of (await (0, _recursivereaddir.recursiveReadDir)(serviceWorkerFolderPath))){ | ||
| serviceWorkerItems.add((0, _encodeuripath.encodeURIPath)((0, _normalizepathsep.normalizePathSep)(file))); | ||
| } | ||
| } catch (err) { | ||
| if (err.code !== 'ENOENT') { | ||
| throw err; | ||
| } | ||
| } | ||
| const routesManifestPath = _path.default.join(distDir, _constants.ROUTES_MANIFEST); | ||
@@ -322,2 +333,3 @@ const prerenderManifestPath = _path.default.join(distDir, _constants.PRERENDER_MANIFEST); | ||
| debug('nextStaticFolderItems', nextStaticFolderItems); | ||
| debug('serviceWorkerItems', serviceWorkerItems); | ||
| debug('pageFiles', pageFiles); | ||
@@ -404,2 +416,6 @@ debug('appFiles', appFiles); | ||
| [ | ||
| serviceWorkerItems, | ||
| 'serviceWorker' | ||
| ], | ||
| [ | ||
| nextStaticFolderItems, | ||
@@ -511,2 +527,7 @@ 'nextStaticFolder' | ||
| } | ||
| case 'serviceWorker': | ||
| { | ||
| itemsRoot = serviceWorkerFolderPath; | ||
| break; | ||
| } | ||
| case 'appFile': | ||
@@ -534,3 +555,4 @@ case 'pageFile': | ||
| 'publicFolder', | ||
| 'legacyStaticFolder' | ||
| 'legacyStaticFolder', | ||
| 'serviceWorker' | ||
| ].includes(type); | ||
@@ -537,0 +559,0 @@ if (isStaticAsset && itemsRoot) { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/server/lib/router-utils/filesystem.ts"],"sourcesContent":["import type {\n FunctionsConfigManifest,\n ManifestRoute,\n PrerenderManifest,\n RoutesManifest,\n} from '../../../build'\nimport type { NextConfigRuntime } from '../../config-shared'\nimport type { MiddlewareManifest } from '../../../build/webpack/plugins/middleware-plugin'\nimport type { UnwrapPromise } from '../../../lib/coalesced-function'\nimport type { PatchMatcher } from '../../../shared/lib/router/utils/path-match'\nimport type { MiddlewareRouteMatch } from '../../../shared/lib/router/utils/middleware-route-matcher'\nimport type { __ApiPreviewProps } from '../../api-utils'\n\nimport path from 'path'\nimport fs from 'fs/promises'\nimport * as Log from '../../../build/output/log'\nimport setupDebug from 'next/dist/compiled/debug'\nimport { LRUCache } from '../lru-cache'\nimport loadCustomRoutes, { type Rewrite } from '../../../lib/load-custom-routes'\nimport { modifyRouteRegex } from '../../../lib/redirect-status'\nimport { FileType, fileExists } from '../../../lib/file-exists'\nimport { recursiveReadDir } from '../../../lib/recursive-readdir'\nimport { isDynamicRoute } from '../../../shared/lib/router/utils'\nimport { escapeStringRegexp } from '../../../shared/lib/escape-regexp'\nimport { getPathMatch } from '../../../shared/lib/router/utils/path-match'\nimport {\n getNamedRouteRegex,\n getRouteRegex,\n} from '../../../shared/lib/router/utils/route-regex'\nimport { getRouteMatcher } from '../../../shared/lib/router/utils/route-matcher'\nimport { pathHasPrefix } from '../../../shared/lib/router/utils/path-has-prefix'\nimport { normalizeLocalePath } from '../../../shared/lib/i18n/normalize-locale-path'\nimport { removePathPrefix } from '../../../shared/lib/router/utils/remove-path-prefix'\nimport { getMiddlewareRouteMatcher } from '../../../shared/lib/router/utils/middleware-route-matcher'\nimport {\n APP_PATH_ROUTES_MANIFEST,\n BUILD_ID_FILE,\n FUNCTIONS_CONFIG_MANIFEST,\n MIDDLEWARE_MANIFEST,\n PAGES_MANIFEST,\n PRERENDER_MANIFEST,\n ROUTES_MANIFEST,\n} from '../../../shared/lib/constants'\nimport { normalizePathSep } from '../../../shared/lib/page-path/normalize-path-sep'\nimport { normalizeMetadataRoute } from '../../../lib/metadata/get-metadata-route'\nimport { RSCPathnameNormalizer } from '../../normalizers/request/rsc'\nimport { encodeURIPath } from '../../../shared/lib/encode-uri-path'\nimport { isMetadataRouteFile } from '../../../lib/metadata/is-metadata-route'\n\nexport type FsOutput = {\n type:\n | 'appFile'\n | 'pageFile'\n | 'nextImage'\n | 'publicFolder'\n | 'nextStaticFolder'\n | 'legacyStaticFolder'\n | 'devVirtualFsItem'\n\n itemPath: string\n fsPath?: string\n itemsRoot?: string\n locale?: string\n}\n\nconst debug = setupDebug('next:router-server:filesystem')\n\nexport type FilesystemDynamicRoute = ManifestRoute & {\n /**\n * The path matcher that can be used to match paths against this route.\n */\n match: PatchMatcher\n}\n\nexport const buildCustomRoute = <T>(\n type: 'redirect' | 'header' | 'rewrite' | 'before_files_rewrite',\n item: T & { source: string },\n basePath?: string,\n caseSensitive?: boolean\n): T & { match: PatchMatcher; check?: boolean; regex: string } => {\n const restrictedRedirectPaths = ['/_next'].map((p) =>\n basePath ? `${basePath}${p}` : p\n )\n let builtRegex = ''\n const match = getPathMatch(item.source, {\n strict: true,\n removeUnnamedParams: true,\n regexModifier: (regex: string) => {\n if (!(item as any).internal) {\n regex = modifyRouteRegex(\n regex,\n type === 'redirect' ? restrictedRedirectPaths : undefined\n )\n }\n builtRegex = regex\n return builtRegex\n },\n sensitive: caseSensitive,\n })\n\n return {\n ...item,\n regex: builtRegex,\n ...(type === 'rewrite' ? { check: true } : {}),\n match,\n }\n}\n\nexport async function setupFsCheck(opts: {\n dir: string\n dev: boolean\n minimalMode?: boolean\n config: NextConfigRuntime\n}) {\n const getItemsLru = !opts.dev\n ? new LRUCache<FsOutput | null>(1024 * 1024, function length(value) {\n if (!value) {\n // Null entries (negative cache) still need a non-zero size for LRU eviction\n return 1\n }\n return (\n (value.fsPath || '').length +\n value.itemPath.length +\n value.type.length\n )\n })\n : undefined\n\n // routes that have _next/data endpoints (SSG/SSP)\n const nextDataRoutes = new Set<string>()\n const publicFolderItems = new Set<string>()\n const nextStaticFolderItems = new Set<string>()\n const legacyStaticFolderItems = new Set<string>()\n\n const appFiles = new Set<string>()\n const pageFiles = new Set<string>()\n // Map normalized path to the file path. This is essential\n // for parallel and group routes as their original path\n // cannot be restored from the request path.\n // Example:\n // [normalized-path] -> [file-path]\n // /icon-<hash>.png -> .../app/@parallel/icon.png\n // /icon-<hash>.png -> .../app/(group)/icon.png\n // /icon.png -> .../app/icon.png\n const staticMetadataFiles = new Map<string, string>()\n let dynamicRoutes: FilesystemDynamicRoute[] = []\n\n let middlewareMatcher:\n | ReturnType<typeof getMiddlewareRouteMatcher>\n | undefined = () => false\n\n const distDir = path.join(opts.dir, opts.config.distDir)\n const publicFolderPath = path.join(opts.dir, 'public')\n const nextStaticFolderPath = path.join(distDir, 'static')\n const legacyStaticFolderPath = path.join(opts.dir, 'static')\n let customRoutes: UnwrapPromise<ReturnType<typeof loadCustomRoutes>> = {\n redirects: [],\n rewrites: {\n beforeFiles: [],\n afterFiles: [],\n fallback: [],\n },\n onMatchHeaders: [],\n headers: [],\n }\n let buildId = 'development'\n let previewProps: __ApiPreviewProps\n\n if (!opts.dev) {\n const buildIdPath = path.join(opts.dir, opts.config.distDir, BUILD_ID_FILE)\n try {\n buildId = await fs.readFile(buildIdPath, 'utf8')\n } catch (err: any) {\n if (err.code !== 'ENOENT') throw err\n throw new Error(\n `Could not find a production build in the '${opts.config.distDir}' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id`\n )\n }\n\n try {\n for (const file of await recursiveReadDir(publicFolderPath)) {\n // Ensure filename is encoded and normalized.\n publicFolderItems.add(encodeURIPath(normalizePathSep(file)))\n }\n } catch (err: any) {\n if (err.code !== 'ENOENT') {\n throw err\n }\n }\n\n try {\n for (const file of await recursiveReadDir(legacyStaticFolderPath)) {\n // Ensure filename is encoded and normalized.\n legacyStaticFolderItems.add(encodeURIPath(normalizePathSep(file)))\n }\n Log.warn(\n `The static directory has been deprecated in favor of the public directory. https://nextjs.org/docs/messages/static-dir-deprecated`\n )\n } catch (err: any) {\n if (err.code !== 'ENOENT') {\n throw err\n }\n }\n\n try {\n for (const file of await recursiveReadDir(nextStaticFolderPath)) {\n // Ensure filename is encoded and normalized.\n nextStaticFolderItems.add(\n path.posix.join(\n '/_next/static',\n encodeURIPath(normalizePathSep(file))\n )\n )\n }\n } catch (err) {\n if (opts.config.output !== 'standalone') throw err\n }\n\n const routesManifestPath = path.join(distDir, ROUTES_MANIFEST)\n const prerenderManifestPath = path.join(distDir, PRERENDER_MANIFEST)\n const middlewareManifestPath = path.join(\n distDir,\n 'server',\n MIDDLEWARE_MANIFEST\n )\n const functionsConfigManifestPath = path.join(\n distDir,\n 'server',\n FUNCTIONS_CONFIG_MANIFEST\n )\n const pagesManifestPath = path.join(distDir, 'server', PAGES_MANIFEST)\n const appRoutesManifestPath = path.join(distDir, APP_PATH_ROUTES_MANIFEST)\n\n const routesManifest = JSON.parse(\n await fs.readFile(routesManifestPath, 'utf8')\n ) as RoutesManifest\n\n previewProps = (\n JSON.parse(\n await fs.readFile(prerenderManifestPath, 'utf8')\n ) as PrerenderManifest\n ).preview\n\n const middlewareManifest = JSON.parse(\n await fs.readFile(middlewareManifestPath, 'utf8').catch(() => '{}')\n ) as MiddlewareManifest\n\n const functionsConfigManifest = JSON.parse(\n await fs.readFile(functionsConfigManifestPath, 'utf8').catch(() => '{}')\n ) as FunctionsConfigManifest\n\n const pagesManifest = JSON.parse(\n await fs.readFile(pagesManifestPath, 'utf8')\n )\n const appRoutesManifest = JSON.parse(\n await fs.readFile(appRoutesManifestPath, 'utf8').catch(() => '{}')\n )\n\n for (const key of Object.keys(pagesManifest)) {\n // ensure the non-locale version is in the set\n if (opts.config.i18n) {\n pageFiles.add(\n normalizeLocalePath(key, opts.config.i18n.locales).pathname\n )\n } else {\n pageFiles.add(key)\n }\n }\n for (const key of Object.keys(appRoutesManifest)) {\n appFiles.add(appRoutesManifest[key])\n }\n\n const escapedBuildId = escapeStringRegexp(buildId)\n\n for (const route of routesManifest.dataRoutes) {\n if (isDynamicRoute(route.page)) {\n const routeRegex = getNamedRouteRegex(route.page, {\n prefixRouteKeys: true,\n })\n dynamicRoutes.push({\n ...route,\n regex: routeRegex.re.toString(),\n namedRegex: routeRegex.namedRegex,\n routeKeys: routeRegex.routeKeys,\n match: getRouteMatcher({\n // TODO: fix this in the manifest itself, must also be fixed in\n // upstream builder that relies on this\n re: opts.config.i18n\n ? new RegExp(\n route.dataRouteRegex.replace(\n `/${escapedBuildId}/`,\n `/${escapedBuildId}/(?<nextLocale>[^/]+?)/`\n )\n )\n : new RegExp(route.dataRouteRegex),\n groups: routeRegex.groups,\n }),\n })\n }\n nextDataRoutes.add(route.page)\n }\n\n for (const route of routesManifest.dynamicRoutes) {\n // If a route is marked as skipInternalRouting, it's not for the internal\n // router, and instead has been added to support external routers.\n if (route.skipInternalRouting) {\n continue\n }\n\n dynamicRoutes.push({\n ...route,\n match: getRouteMatcher(getRouteRegex(route.page)),\n })\n }\n\n if (middlewareManifest.middleware?.['/']?.matchers) {\n middlewareMatcher = getMiddlewareRouteMatcher(\n middlewareManifest.middleware?.['/']?.matchers\n )\n } else if (functionsConfigManifest?.functions['/_middleware']) {\n middlewareMatcher = getMiddlewareRouteMatcher(\n functionsConfigManifest.functions['/_middleware'].matchers ?? [\n { regexp: '.*', originalSource: '/:path*' },\n ]\n )\n }\n\n customRoutes = {\n redirects: routesManifest.redirects,\n rewrites: routesManifest.rewrites\n ? Array.isArray(routesManifest.rewrites)\n ? {\n beforeFiles: [],\n afterFiles: routesManifest.rewrites,\n fallback: [],\n }\n : routesManifest.rewrites\n : {\n beforeFiles: [],\n afterFiles: [],\n fallback: [],\n },\n headers: routesManifest.headers,\n onMatchHeaders: routesManifest.onMatchHeaders,\n }\n } else {\n // dev handling\n customRoutes = await loadCustomRoutes(opts.config)\n\n previewProps = {\n previewModeId: (require('crypto') as typeof import('crypto'))\n .randomBytes(16)\n .toString('hex'),\n previewModeSigningKey: (require('crypto') as typeof import('crypto'))\n .randomBytes(32)\n .toString('hex'),\n previewModeEncryptionKey: (require('crypto') as typeof import('crypto'))\n .randomBytes(32)\n .toString('hex'),\n }\n }\n\n const headers = customRoutes.headers.map((item) =>\n buildCustomRoute(\n 'header',\n item,\n opts.config.basePath,\n opts.config.experimental.caseSensitiveRoutes\n )\n )\n const onMatchHeaders = customRoutes.onMatchHeaders.map((item) =>\n buildCustomRoute(\n 'header',\n item,\n opts.config.basePath,\n opts.config.experimental.caseSensitiveRoutes\n )\n )\n const redirects = customRoutes.redirects.map((item) =>\n buildCustomRoute(\n 'redirect',\n item,\n opts.config.basePath,\n opts.config.experimental.caseSensitiveRoutes\n )\n )\n const rewrites = {\n beforeFiles: customRoutes.rewrites.beforeFiles.map((item) =>\n buildCustomRoute('before_files_rewrite', item)\n ),\n afterFiles: customRoutes.rewrites.afterFiles.map((item) =>\n buildCustomRoute(\n 'rewrite',\n item,\n opts.config.basePath,\n opts.config.experimental.caseSensitiveRoutes\n )\n ),\n fallback: customRoutes.rewrites.fallback.map((item) =>\n buildCustomRoute(\n 'rewrite',\n item,\n opts.config.basePath,\n opts.config.experimental.caseSensitiveRoutes\n )\n ),\n }\n\n const { i18n } = opts.config\n\n const handleLocale = (pathname: string, locales?: string[]) => {\n let locale: string | undefined\n\n if (i18n) {\n const i18nResult = normalizeLocalePath(pathname, locales || i18n.locales)\n\n pathname = i18nResult.pathname\n locale = i18nResult.detectedLocale\n }\n return { locale, pathname }\n }\n\n debug('nextDataRoutes', nextDataRoutes)\n debug('dynamicRoutes', dynamicRoutes)\n debug('customRoutes', customRoutes)\n debug('publicFolderItems', publicFolderItems)\n debug('nextStaticFolderItems', nextStaticFolderItems)\n debug('pageFiles', pageFiles)\n debug('appFiles', appFiles)\n\n let ensureFn: (item: FsOutput) => Promise<void> | undefined\n\n const normalizers = {\n // Because we can't know if the app directory is enabled or not at this\n // stage, we assume that it is.\n rsc: new RSCPathnameNormalizer(),\n }\n\n return {\n headers,\n onMatchHeaders,\n rewrites,\n redirects,\n\n buildId,\n handleLocale,\n\n appFiles,\n pageFiles,\n staticMetadataFiles,\n dynamicRoutes,\n nextDataRoutes,\n\n exportPathMapRoutes: undefined as\n | undefined\n | ReturnType<typeof buildCustomRoute<Rewrite>>[],\n\n devVirtualFsItems: new Set<string>(),\n\n previewProps,\n middlewareMatcher: middlewareMatcher as MiddlewareRouteMatch | undefined,\n\n ensureCallback(fn: typeof ensureFn) {\n ensureFn = fn\n },\n\n async getItem(itemPath: string): Promise<FsOutput | null> {\n const originalItemPath = itemPath\n const itemKey = originalItemPath\n const lruResult = getItemsLru?.get(itemKey)\n\n if (lruResult) {\n return lruResult\n }\n\n const { basePath } = opts.config\n\n const hasBasePath = pathHasPrefix(itemPath, basePath)\n\n // Return null if path doesn't start with basePath\n if (basePath && !hasBasePath) {\n return null\n }\n\n // Remove basePath if it exists.\n if (basePath && hasBasePath) {\n itemPath = removePathPrefix(itemPath, basePath) || '/'\n }\n\n // Simulate minimal mode requests by normalizing RSC and postponed\n // requests.\n if (opts.minimalMode) {\n if (normalizers.rsc.match(itemPath)) {\n itemPath = normalizers.rsc.normalize(itemPath, true)\n }\n }\n\n if (itemPath !== '/' && itemPath.endsWith('/')) {\n itemPath = itemPath.substring(0, itemPath.length - 1)\n }\n\n let decodedItemPath = itemPath\n\n try {\n decodedItemPath = decodeURIComponent(itemPath)\n } catch {}\n\n if (itemPath === '/_next/image') {\n return {\n itemPath,\n type: 'nextImage',\n }\n }\n\n if (opts.dev && isMetadataRouteFile(itemPath, [], false)) {\n const fsPath = staticMetadataFiles.get(itemPath)\n if (fsPath) {\n return {\n // \"nextStaticFolder\" sets Cache-Control \"no-store\" on dev.\n type: 'nextStaticFolder',\n fsPath,\n itemPath: fsPath,\n }\n }\n }\n\n const itemsToCheck: Array<[Set<string>, FsOutput['type']]> = [\n [this.devVirtualFsItems, 'devVirtualFsItem'],\n [nextStaticFolderItems, 'nextStaticFolder'],\n [legacyStaticFolderItems, 'legacyStaticFolder'],\n [publicFolderItems, 'publicFolder'],\n [appFiles, 'appFile'],\n [pageFiles, 'pageFile'],\n ]\n\n for (let [items, type] of itemsToCheck) {\n let locale: string | undefined\n let curItemPath = itemPath\n let curDecodedItemPath = decodedItemPath\n\n const isDynamicOutput = type === 'pageFile' || type === 'appFile'\n\n if (i18n) {\n const localeResult = handleLocale(\n itemPath,\n // legacy behavior allows visiting static assets under\n // default locale but no other locale\n isDynamicOutput\n ? undefined\n : [\n i18n?.defaultLocale,\n // default locales from domains need to be matched too\n ...(i18n.domains?.map((item) => item.defaultLocale) || []),\n ]\n )\n\n if (localeResult.pathname !== curItemPath) {\n curItemPath = localeResult.pathname\n locale = localeResult.locale\n\n try {\n curDecodedItemPath = decodeURIComponent(curItemPath)\n } catch {}\n }\n }\n\n if (type === 'legacyStaticFolder') {\n if (!pathHasPrefix(curItemPath, '/static')) {\n continue\n }\n curItemPath = curItemPath.substring('/static'.length)\n\n try {\n curDecodedItemPath = decodeURIComponent(curItemPath)\n } catch {}\n }\n\n if (\n type === 'nextStaticFolder' &&\n !pathHasPrefix(curItemPath, '/_next/static')\n ) {\n continue\n }\n\n const nextDataPrefix = `/_next/data/${buildId}/`\n\n if (\n type === 'pageFile' &&\n curItemPath.startsWith(nextDataPrefix) &&\n curItemPath.endsWith('.json')\n ) {\n items = nextDataRoutes\n // remove _next/data/<build-id> prefix\n curItemPath = curItemPath.substring(nextDataPrefix.length - 1)\n\n // remove .json postfix\n curItemPath = curItemPath.substring(\n 0,\n curItemPath.length - '.json'.length\n )\n const curLocaleResult = handleLocale(curItemPath)\n curItemPath =\n curLocaleResult.pathname === '/index'\n ? '/'\n : curLocaleResult.pathname\n\n locale = curLocaleResult.locale\n\n try {\n curDecodedItemPath = decodeURIComponent(curItemPath)\n } catch {}\n }\n\n let matchedItem = items.has(curItemPath)\n\n // check decoded variant as well\n if (!matchedItem && !opts.dev) {\n matchedItem = items.has(curDecodedItemPath)\n if (matchedItem) curItemPath = curDecodedItemPath\n else {\n // x-ref: https://github.com/vercel/next.js/issues/54008\n // There're cases that urls get decoded before requests, we should support both encoded and decoded ones.\n // e.g. nginx could decode the proxy urls, the below ones should be treated as the same:\n // decoded version: `/_next/static/chunks/pages/blog/[slug]-d4858831b91b69f6.js`\n // encoded version: `/_next/static/chunks/pages/blog/%5Bslug%5D-d4858831b91b69f6.js`\n try {\n // encode the special characters in the path and retrieve again to determine if path exists.\n const encodedCurItemPath = encodeURIPath(curItemPath)\n matchedItem = items.has(encodedCurItemPath)\n } catch {}\n }\n }\n\n if (matchedItem || opts.dev) {\n let fsPath: string | undefined\n let itemsRoot: string | undefined\n\n switch (type) {\n case 'nextStaticFolder': {\n itemsRoot = nextStaticFolderPath\n curItemPath = curItemPath.substring('/_next/static'.length)\n break\n }\n case 'legacyStaticFolder': {\n itemsRoot = legacyStaticFolderPath\n break\n }\n case 'publicFolder': {\n itemsRoot = publicFolderPath\n break\n }\n case 'appFile':\n case 'pageFile':\n case 'nextImage':\n case 'devVirtualFsItem': {\n break\n }\n default: {\n ;(type) satisfies never\n }\n }\n\n if (itemsRoot && curItemPath) {\n fsPath = path.posix.join(itemsRoot, curItemPath)\n }\n\n // dynamically check fs in development so we don't\n // have to wait on the watcher\n if (!matchedItem && opts.dev) {\n const isStaticAsset = (\n [\n 'nextStaticFolder',\n 'publicFolder',\n 'legacyStaticFolder',\n ] as (typeof type)[]\n ).includes(type)\n\n if (isStaticAsset && itemsRoot) {\n let found = fsPath && (await fileExists(fsPath, FileType.File))\n\n if (!found) {\n try {\n // In dev, we ensure encoded paths match\n // decoded paths on the filesystem so check\n // that variation as well\n const tempItemPath = decodeURIComponent(curItemPath)\n fsPath = path.posix.join(itemsRoot, tempItemPath)\n found = await fileExists(fsPath, FileType.File)\n } catch {}\n\n if (!found) {\n continue\n }\n }\n } else if (type === 'pageFile' || type === 'appFile') {\n const isAppFile = type === 'appFile'\n\n // Attempt to ensure the page/app file is compiled and ready\n if (ensureFn) {\n const ensureItemPath = isAppFile\n ? normalizeMetadataRoute(curItemPath)\n : curItemPath\n\n try {\n await ensureFn({ type, itemPath: ensureItemPath })\n } catch (error) {\n // If ensure failed, skip this item and continue to the next one\n continue\n }\n }\n } else {\n continue\n }\n }\n\n // i18n locales aren't matched for app dir\n if (type === 'appFile' && locale && locale !== i18n?.defaultLocale) {\n continue\n }\n\n const itemResult = {\n type,\n fsPath,\n locale,\n itemsRoot,\n itemPath: curItemPath,\n }\n\n getItemsLru?.set(itemKey, itemResult)\n return itemResult\n }\n }\n\n getItemsLru?.set(itemKey, null)\n return null\n },\n getDynamicRoutes() {\n // this should include data routes\n return this.dynamicRoutes\n },\n getMiddlewareMatchers() {\n return this.middlewareMatcher\n },\n }\n}\n"],"names":["buildCustomRoute","setupFsCheck","debug","setupDebug","type","item","basePath","caseSensitive","restrictedRedirectPaths","map","p","builtRegex","match","getPathMatch","source","strict","removeUnnamedParams","regexModifier","regex","internal","modifyRouteRegex","undefined","sensitive","check","opts","getItemsLru","dev","LRUCache","length","value","fsPath","itemPath","nextDataRoutes","Set","publicFolderItems","nextStaticFolderItems","legacyStaticFolderItems","appFiles","pageFiles","staticMetadataFiles","Map","dynamicRoutes","middlewareMatcher","distDir","path","join","dir","config","publicFolderPath","nextStaticFolderPath","legacyStaticFolderPath","customRoutes","redirects","rewrites","beforeFiles","afterFiles","fallback","onMatchHeaders","headers","buildId","previewProps","middlewareManifest","buildIdPath","BUILD_ID_FILE","fs","readFile","err","code","Error","file","recursiveReadDir","add","encodeURIPath","normalizePathSep","Log","warn","posix","output","routesManifestPath","ROUTES_MANIFEST","prerenderManifestPath","PRERENDER_MANIFEST","middlewareManifestPath","MIDDLEWARE_MANIFEST","functionsConfigManifestPath","FUNCTIONS_CONFIG_MANIFEST","pagesManifestPath","PAGES_MANIFEST","appRoutesManifestPath","APP_PATH_ROUTES_MANIFEST","routesManifest","JSON","parse","preview","catch","functionsConfigManifest","pagesManifest","appRoutesManifest","key","Object","keys","i18n","normalizeLocalePath","locales","pathname","escapedBuildId","escapeStringRegexp","route","dataRoutes","isDynamicRoute","page","routeRegex","getNamedRouteRegex","prefixRouteKeys","push","re","toString","namedRegex","routeKeys","getRouteMatcher","RegExp","dataRouteRegex","replace","groups","skipInternalRouting","getRouteRegex","middleware","matchers","getMiddlewareRouteMatcher","functions","regexp","originalSource","Array","isArray","loadCustomRoutes","previewModeId","require","randomBytes","previewModeSigningKey","previewModeEncryptionKey","experimental","caseSensitiveRoutes","handleLocale","locale","i18nResult","detectedLocale","ensureFn","normalizers","rsc","RSCPathnameNormalizer","exportPathMapRoutes","devVirtualFsItems","ensureCallback","fn","getItem","originalItemPath","itemKey","lruResult","get","hasBasePath","pathHasPrefix","removePathPrefix","minimalMode","normalize","endsWith","substring","decodedItemPath","decodeURIComponent","isMetadataRouteFile","itemsToCheck","items","curItemPath","curDecodedItemPath","isDynamicOutput","localeResult","defaultLocale","domains","nextDataPrefix","startsWith","curLocaleResult","matchedItem","has","encodedCurItemPath","itemsRoot","isStaticAsset","includes","found","fileExists","FileType","File","tempItemPath","isAppFile","ensureItemPath","normalizeMetadataRoute","error","itemResult","set","getDynamicRoutes","getMiddlewareMatchers"],"mappings":";;;;;;;;;;;;;;;IA0EaA,gBAAgB;eAAhBA;;IAkCSC,YAAY;eAAZA;;;6DA/FL;iEACF;6DACM;8DACE;0BACE;yEACsB;gCACd;4BACI;kCACJ;uBACF;8BACI;2BACN;4BAItB;8BACyB;+BACF;qCACM;kCACH;wCACS;2BASnC;kCAC0B;kCACM;qBACD;+BACR;iCACM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBpC,MAAMC,QAAQC,IAAAA,cAAU,EAAC;AASlB,MAAMH,mBAAmB,CAC9BI,MACAC,MACAC,UACAC;IAEA,MAAMC,0BAA0B;QAAC;KAAS,CAACC,GAAG,CAAC,CAACC,IAC9CJ,WAAW,GAAGA,WAAWI,GAAG,GAAGA;IAEjC,IAAIC,aAAa;IACjB,MAAMC,QAAQC,IAAAA,uBAAY,EAACR,KAAKS,MAAM,EAAE;QACtCC,QAAQ;QACRC,qBAAqB;QACrBC,eAAe,CAACC;YACd,IAAI,CAAC,AAACb,KAAac,QAAQ,EAAE;gBAC3BD,QAAQE,IAAAA,gCAAgB,EACtBF,OACAd,SAAS,aAAaI,0BAA0Ba;YAEpD;YACAV,aAAaO;YACb,OAAOP;QACT;QACAW,WAAWf;IACb;IAEA,OAAO;QACL,GAAGF,IAAI;QACPa,OAAOP;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sBAAU,EAAC7J,QAAQ8J,oBAAQ,CAACC,IAAI;gCAChD,EAAE,OAAM,CAAC;gCAET,IAAI,CAACH,OAAO;oCACV;gCACF;4BACF;wBACF,OAAO,IAAItL,SAAS,cAAcA,SAAS,WAAW;4BACpD,MAAM2L,YAAY3L,SAAS;4BAE3B,4DAA4D;4BAC5D,IAAI8I,UAAU;gCACZ,MAAM8C,iBAAiBD,YACnBE,IAAAA,wCAAsB,EAACtB,eACvBA;gCAEJ,IAAI;oCACF,MAAMzB,SAAS;wCAAE9I;wCAAM2B,UAAUiK;oCAAe;gCAClD,EAAE,OAAOE,OAAO;oCAEd;gCACF;4BACF;wBACF,OAAO;4BACL;wBACF;oBACF;oBAEA,0CAA0C;oBAC1C,IAAI9L,SAAS,aAAa2I,UAAUA,YAAW1C,wBAAAA,KAAM0E,aAAa,GAAE;wBAClE;oBACF;oBAEA,MAAMoB,aAAa;wBACjB/L;wBACA0B;wBACAiH;wBACAwC;wBACAxJ,UAAU4I;oBACZ;oBAEAlJ,+BAAAA,YAAa2K,GAAG,CAACxC,SAASuC;oBAC1B,OAAOA;gBACT;YACF;YAEA1K,+BAAAA,YAAa2K,GAAG,CAACxC,SAAS;YAC1B,OAAO;QACT;QACAyC;YACE,kCAAkC;YAClC,OAAO,IAAI,CAAC5J,aAAa;QAC3B;QACA6J;YACE,OAAO,IAAI,CAAC5J,iBAAiB;QAC/B;IACF;AACF","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/server/lib/router-utils/filesystem.ts"],"sourcesContent":["import type {\n FunctionsConfigManifest,\n ManifestRoute,\n PrerenderManifest,\n RoutesManifest,\n} from '../../../build'\nimport type { NextConfigRuntime } from '../../config-shared'\nimport type { MiddlewareManifest } from '../../../build/webpack/plugins/middleware-plugin'\nimport type { UnwrapPromise } from '../../../lib/coalesced-function'\nimport type { PatchMatcher } from '../../../shared/lib/router/utils/path-match'\nimport type { MiddlewareRouteMatch } from '../../../shared/lib/router/utils/middleware-route-matcher'\nimport type { __ApiPreviewProps } from '../../api-utils'\n\nimport path from 'path'\nimport fs from 'fs/promises'\nimport * as Log from '../../../build/output/log'\nimport setupDebug from 'next/dist/compiled/debug'\nimport { LRUCache } from '../lru-cache'\nimport loadCustomRoutes, { type Rewrite } from '../../../lib/load-custom-routes'\nimport { modifyRouteRegex } from '../../../lib/redirect-status'\nimport { FileType, fileExists } from '../../../lib/file-exists'\nimport { recursiveReadDir } from '../../../lib/recursive-readdir'\nimport { isDynamicRoute } from '../../../shared/lib/router/utils'\nimport { escapeStringRegexp } from '../../../shared/lib/escape-regexp'\nimport { getPathMatch } from '../../../shared/lib/router/utils/path-match'\nimport {\n getNamedRouteRegex,\n getRouteRegex,\n} from '../../../shared/lib/router/utils/route-regex'\nimport { getRouteMatcher } from '../../../shared/lib/router/utils/route-matcher'\nimport { pathHasPrefix } from '../../../shared/lib/router/utils/path-has-prefix'\nimport { normalizeLocalePath } from '../../../shared/lib/i18n/normalize-locale-path'\nimport { removePathPrefix } from '../../../shared/lib/router/utils/remove-path-prefix'\nimport { getMiddlewareRouteMatcher } from '../../../shared/lib/router/utils/middleware-route-matcher'\nimport {\n APP_PATH_ROUTES_MANIFEST,\n BUILD_ID_FILE,\n FUNCTIONS_CONFIG_MANIFEST,\n MIDDLEWARE_MANIFEST,\n PAGES_MANIFEST,\n PRERENDER_MANIFEST,\n ROUTES_MANIFEST,\n} from '../../../shared/lib/constants'\nimport { normalizePathSep } from '../../../shared/lib/page-path/normalize-path-sep'\nimport { normalizeMetadataRoute } from '../../../lib/metadata/get-metadata-route'\nimport { RSCPathnameNormalizer } from '../../normalizers/request/rsc'\nimport { encodeURIPath } from '../../../shared/lib/encode-uri-path'\nimport { isMetadataRouteFile } from '../../../lib/metadata/is-metadata-route'\n\nexport type FsOutput = {\n type:\n | 'appFile'\n | 'pageFile'\n | 'nextImage'\n | 'publicFolder'\n | 'nextStaticFolder'\n | 'legacyStaticFolder'\n | 'serviceWorker'\n | 'devVirtualFsItem'\n\n itemPath: string\n fsPath?: string\n itemsRoot?: string\n locale?: string\n}\n\nconst debug = setupDebug('next:router-server:filesystem')\n\nexport type FilesystemDynamicRoute = ManifestRoute & {\n /**\n * The path matcher that can be used to match paths against this route.\n */\n match: PatchMatcher\n}\n\nexport const buildCustomRoute = <T>(\n type: 'redirect' | 'header' | 'rewrite' | 'before_files_rewrite',\n item: T & { source: string },\n basePath?: string,\n caseSensitive?: boolean\n): T & { match: PatchMatcher; check?: boolean; regex: string } => {\n const restrictedRedirectPaths = ['/_next'].map((p) =>\n basePath ? `${basePath}${p}` : p\n )\n let builtRegex = ''\n const match = getPathMatch(item.source, {\n strict: true,\n removeUnnamedParams: true,\n regexModifier: (regex: string) => {\n if (!(item as any).internal) {\n regex = modifyRouteRegex(\n regex,\n type === 'redirect' ? restrictedRedirectPaths : undefined\n )\n }\n builtRegex = regex\n return builtRegex\n },\n sensitive: caseSensitive,\n })\n\n return {\n ...item,\n regex: builtRegex,\n ...(type === 'rewrite' ? { check: true } : {}),\n match,\n }\n}\n\nexport async function setupFsCheck(opts: {\n dir: string\n dev: boolean\n minimalMode?: boolean\n config: NextConfigRuntime\n}) {\n const getItemsLru = !opts.dev\n ? new LRUCache<FsOutput | null>(1024 * 1024, function length(value) {\n if (!value) {\n // Null entries (negative cache) still need a non-zero size for LRU eviction\n return 1\n }\n return (\n (value.fsPath || '').length +\n value.itemPath.length +\n value.type.length\n )\n })\n : undefined\n\n // routes that have _next/data endpoints (SSG/SSP)\n const nextDataRoutes = new Set<string>()\n const publicFolderItems = new Set<string>()\n const nextStaticFolderItems = new Set<string>()\n const legacyStaticFolderItems = new Set<string>()\n const serviceWorkerItems = new Set<string>()\n\n const appFiles = new Set<string>()\n const pageFiles = new Set<string>()\n // Map normalized path to the file path. This is essential\n // for parallel and group routes as their original path\n // cannot be restored from the request path.\n // Example:\n // [normalized-path] -> [file-path]\n // /icon-<hash>.png -> .../app/@parallel/icon.png\n // /icon-<hash>.png -> .../app/(group)/icon.png\n // /icon.png -> .../app/icon.png\n const staticMetadataFiles = new Map<string, string>()\n let dynamicRoutes: FilesystemDynamicRoute[] = []\n\n let middlewareMatcher:\n | ReturnType<typeof getMiddlewareRouteMatcher>\n | undefined = () => false\n\n const distDir = path.join(opts.dir, opts.config.distDir)\n const publicFolderPath = path.join(opts.dir, 'public')\n const nextStaticFolderPath = path.join(distDir, 'static')\n const legacyStaticFolderPath = path.join(opts.dir, 'static')\n const serviceWorkerFolderPath = path.join(distDir, 'service-worker')\n let customRoutes: UnwrapPromise<ReturnType<typeof loadCustomRoutes>> = {\n redirects: [],\n rewrites: {\n beforeFiles: [],\n afterFiles: [],\n fallback: [],\n },\n onMatchHeaders: [],\n headers: [],\n }\n let buildId = 'development'\n let previewProps: __ApiPreviewProps\n\n if (!opts.dev) {\n const buildIdPath = path.join(opts.dir, opts.config.distDir, BUILD_ID_FILE)\n try {\n buildId = await fs.readFile(buildIdPath, 'utf8')\n } catch (err: any) {\n if (err.code !== 'ENOENT') throw err\n throw new Error(\n `Could not find a production build in the '${opts.config.distDir}' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id`\n )\n }\n\n try {\n for (const file of await recursiveReadDir(publicFolderPath)) {\n // Ensure filename is encoded and normalized.\n publicFolderItems.add(encodeURIPath(normalizePathSep(file)))\n }\n } catch (err: any) {\n if (err.code !== 'ENOENT') {\n throw err\n }\n }\n\n try {\n for (const file of await recursiveReadDir(legacyStaticFolderPath)) {\n // Ensure filename is encoded and normalized.\n legacyStaticFolderItems.add(encodeURIPath(normalizePathSep(file)))\n }\n Log.warn(\n `The static directory has been deprecated in favor of the public directory. https://nextjs.org/docs/messages/static-dir-deprecated`\n )\n } catch (err: any) {\n if (err.code !== 'ENOENT') {\n throw err\n }\n }\n\n try {\n for (const file of await recursiveReadDir(nextStaticFolderPath)) {\n // Ensure filename is encoded and normalized.\n nextStaticFolderItems.add(\n path.posix.join(\n '/_next/static',\n encodeURIPath(normalizePathSep(file))\n )\n )\n }\n } catch (err) {\n if (opts.config.output !== 'standalone') throw err\n }\n\n try {\n for (const file of await recursiveReadDir(serviceWorkerFolderPath)) {\n serviceWorkerItems.add(encodeURIPath(normalizePathSep(file)))\n }\n } catch (err: any) {\n if (err.code !== 'ENOENT') {\n throw err\n }\n }\n\n const routesManifestPath = path.join(distDir, ROUTES_MANIFEST)\n const prerenderManifestPath = path.join(distDir, PRERENDER_MANIFEST)\n const middlewareManifestPath = path.join(\n distDir,\n 'server',\n MIDDLEWARE_MANIFEST\n )\n const functionsConfigManifestPath = path.join(\n distDir,\n 'server',\n FUNCTIONS_CONFIG_MANIFEST\n )\n const pagesManifestPath = path.join(distDir, 'server', PAGES_MANIFEST)\n const appRoutesManifestPath = path.join(distDir, APP_PATH_ROUTES_MANIFEST)\n\n const routesManifest = JSON.parse(\n await fs.readFile(routesManifestPath, 'utf8')\n ) as RoutesManifest\n\n previewProps = (\n JSON.parse(\n await fs.readFile(prerenderManifestPath, 'utf8')\n ) as PrerenderManifest\n ).preview\n\n const middlewareManifest = JSON.parse(\n await fs.readFile(middlewareManifestPath, 'utf8').catch(() => '{}')\n ) as MiddlewareManifest\n\n const functionsConfigManifest = JSON.parse(\n await fs.readFile(functionsConfigManifestPath, 'utf8').catch(() => '{}')\n ) as FunctionsConfigManifest\n\n const pagesManifest = JSON.parse(\n await fs.readFile(pagesManifestPath, 'utf8')\n )\n const appRoutesManifest = JSON.parse(\n await fs.readFile(appRoutesManifestPath, 'utf8').catch(() => '{}')\n )\n\n for (const key of Object.keys(pagesManifest)) {\n // ensure the non-locale version is in the set\n if (opts.config.i18n) {\n pageFiles.add(\n normalizeLocalePath(key, opts.config.i18n.locales).pathname\n )\n } else {\n pageFiles.add(key)\n }\n }\n for (const key of Object.keys(appRoutesManifest)) {\n appFiles.add(appRoutesManifest[key])\n }\n\n const escapedBuildId = escapeStringRegexp(buildId)\n\n for (const route of routesManifest.dataRoutes) {\n if (isDynamicRoute(route.page)) {\n const routeRegex = getNamedRouteRegex(route.page, {\n prefixRouteKeys: true,\n })\n dynamicRoutes.push({\n ...route,\n regex: routeRegex.re.toString(),\n namedRegex: routeRegex.namedRegex,\n routeKeys: routeRegex.routeKeys,\n match: getRouteMatcher({\n // TODO: fix this in the manifest itself, must also be fixed in\n // upstream builder that relies on this\n re: opts.config.i18n\n ? new RegExp(\n route.dataRouteRegex.replace(\n `/${escapedBuildId}/`,\n `/${escapedBuildId}/(?<nextLocale>[^/]+?)/`\n )\n )\n : new RegExp(route.dataRouteRegex),\n groups: routeRegex.groups,\n }),\n })\n }\n nextDataRoutes.add(route.page)\n }\n\n for (const route of routesManifest.dynamicRoutes) {\n // If a route is marked as skipInternalRouting, it's not for the internal\n // router, and instead has been added to support external routers.\n if (route.skipInternalRouting) {\n continue\n }\n\n dynamicRoutes.push({\n ...route,\n match: getRouteMatcher(getRouteRegex(route.page)),\n })\n }\n\n if (middlewareManifest.middleware?.['/']?.matchers) {\n middlewareMatcher = getMiddlewareRouteMatcher(\n middlewareManifest.middleware?.['/']?.matchers\n )\n } else if (functionsConfigManifest?.functions['/_middleware']) {\n middlewareMatcher = getMiddlewareRouteMatcher(\n functionsConfigManifest.functions['/_middleware'].matchers ?? [\n { regexp: '.*', originalSource: '/:path*' },\n ]\n )\n }\n\n customRoutes = {\n redirects: routesManifest.redirects,\n rewrites: routesManifest.rewrites\n ? Array.isArray(routesManifest.rewrites)\n ? {\n beforeFiles: [],\n afterFiles: routesManifest.rewrites,\n fallback: [],\n }\n : routesManifest.rewrites\n : {\n beforeFiles: [],\n afterFiles: [],\n fallback: [],\n },\n headers: routesManifest.headers,\n onMatchHeaders: routesManifest.onMatchHeaders,\n }\n } else {\n // dev handling\n customRoutes = await loadCustomRoutes(opts.config)\n\n previewProps = {\n previewModeId: (require('crypto') as typeof import('crypto'))\n .randomBytes(16)\n .toString('hex'),\n previewModeSigningKey: (require('crypto') as typeof import('crypto'))\n .randomBytes(32)\n .toString('hex'),\n previewModeEncryptionKey: (require('crypto') as typeof import('crypto'))\n .randomBytes(32)\n .toString('hex'),\n }\n }\n\n const headers = customRoutes.headers.map((item) =>\n buildCustomRoute(\n 'header',\n item,\n opts.config.basePath,\n opts.config.experimental.caseSensitiveRoutes\n )\n )\n const onMatchHeaders = customRoutes.onMatchHeaders.map((item) =>\n buildCustomRoute(\n 'header',\n item,\n opts.config.basePath,\n opts.config.experimental.caseSensitiveRoutes\n )\n )\n const redirects = customRoutes.redirects.map((item) =>\n buildCustomRoute(\n 'redirect',\n item,\n opts.config.basePath,\n opts.config.experimental.caseSensitiveRoutes\n )\n )\n const rewrites = {\n beforeFiles: customRoutes.rewrites.beforeFiles.map((item) =>\n buildCustomRoute('before_files_rewrite', item)\n ),\n afterFiles: customRoutes.rewrites.afterFiles.map((item) =>\n buildCustomRoute(\n 'rewrite',\n item,\n opts.config.basePath,\n opts.config.experimental.caseSensitiveRoutes\n )\n ),\n fallback: customRoutes.rewrites.fallback.map((item) =>\n buildCustomRoute(\n 'rewrite',\n item,\n opts.config.basePath,\n opts.config.experimental.caseSensitiveRoutes\n )\n ),\n }\n\n const { i18n } = opts.config\n\n const handleLocale = (pathname: string, locales?: string[]) => {\n let locale: string | undefined\n\n if (i18n) {\n const i18nResult = normalizeLocalePath(pathname, locales || i18n.locales)\n\n pathname = i18nResult.pathname\n locale = i18nResult.detectedLocale\n }\n return { locale, pathname }\n }\n\n debug('nextDataRoutes', nextDataRoutes)\n debug('dynamicRoutes', dynamicRoutes)\n debug('customRoutes', customRoutes)\n debug('publicFolderItems', publicFolderItems)\n debug('nextStaticFolderItems', nextStaticFolderItems)\n debug('serviceWorkerItems', serviceWorkerItems)\n debug('pageFiles', pageFiles)\n debug('appFiles', appFiles)\n\n let ensureFn: (item: FsOutput) => Promise<void> | undefined\n\n const normalizers = {\n // Because we can't know if the app directory is enabled or not at this\n // stage, we assume that it is.\n rsc: new RSCPathnameNormalizer(),\n }\n\n return {\n headers,\n onMatchHeaders,\n rewrites,\n redirects,\n\n buildId,\n handleLocale,\n\n appFiles,\n pageFiles,\n staticMetadataFiles,\n dynamicRoutes,\n nextDataRoutes,\n\n exportPathMapRoutes: undefined as\n | undefined\n | ReturnType<typeof buildCustomRoute<Rewrite>>[],\n\n devVirtualFsItems: new Set<string>(),\n\n previewProps,\n middlewareMatcher: middlewareMatcher as MiddlewareRouteMatch | undefined,\n\n ensureCallback(fn: typeof ensureFn) {\n ensureFn = fn\n },\n\n async getItem(itemPath: string): Promise<FsOutput | null> {\n const originalItemPath = itemPath\n const itemKey = originalItemPath\n const lruResult = getItemsLru?.get(itemKey)\n\n if (lruResult) {\n return lruResult\n }\n\n const { basePath } = opts.config\n\n const hasBasePath = pathHasPrefix(itemPath, basePath)\n\n // Return null if path doesn't start with basePath\n if (basePath && !hasBasePath) {\n return null\n }\n\n // Remove basePath if it exists.\n if (basePath && hasBasePath) {\n itemPath = removePathPrefix(itemPath, basePath) || '/'\n }\n\n // Simulate minimal mode requests by normalizing RSC and postponed\n // requests.\n if (opts.minimalMode) {\n if (normalizers.rsc.match(itemPath)) {\n itemPath = normalizers.rsc.normalize(itemPath, true)\n }\n }\n\n if (itemPath !== '/' && itemPath.endsWith('/')) {\n itemPath = itemPath.substring(0, itemPath.length - 1)\n }\n\n let decodedItemPath = itemPath\n\n try {\n decodedItemPath = decodeURIComponent(itemPath)\n } catch {}\n\n if (itemPath === '/_next/image') {\n return {\n itemPath,\n type: 'nextImage',\n }\n }\n\n if (opts.dev && isMetadataRouteFile(itemPath, [], false)) {\n const fsPath = staticMetadataFiles.get(itemPath)\n if (fsPath) {\n return {\n // \"nextStaticFolder\" sets Cache-Control \"no-store\" on dev.\n type: 'nextStaticFolder',\n fsPath,\n itemPath: fsPath,\n }\n }\n }\n\n const itemsToCheck: Array<[Set<string>, FsOutput['type']]> = [\n [this.devVirtualFsItems, 'devVirtualFsItem'],\n [serviceWorkerItems, 'serviceWorker'],\n [nextStaticFolderItems, 'nextStaticFolder'],\n [legacyStaticFolderItems, 'legacyStaticFolder'],\n [publicFolderItems, 'publicFolder'],\n [appFiles, 'appFile'],\n [pageFiles, 'pageFile'],\n ]\n\n for (let [items, type] of itemsToCheck) {\n let locale: string | undefined\n let curItemPath = itemPath\n let curDecodedItemPath = decodedItemPath\n\n const isDynamicOutput = type === 'pageFile' || type === 'appFile'\n\n if (i18n) {\n const localeResult = handleLocale(\n itemPath,\n // legacy behavior allows visiting static assets under\n // default locale but no other locale\n isDynamicOutput\n ? undefined\n : [\n i18n?.defaultLocale,\n // default locales from domains need to be matched too\n ...(i18n.domains?.map((item) => item.defaultLocale) || []),\n ]\n )\n\n if (localeResult.pathname !== curItemPath) {\n curItemPath = localeResult.pathname\n locale = localeResult.locale\n\n try {\n curDecodedItemPath = decodeURIComponent(curItemPath)\n } catch {}\n }\n }\n\n if (type === 'legacyStaticFolder') {\n if (!pathHasPrefix(curItemPath, '/static')) {\n continue\n }\n curItemPath = curItemPath.substring('/static'.length)\n\n try {\n curDecodedItemPath = decodeURIComponent(curItemPath)\n } catch {}\n }\n\n if (\n type === 'nextStaticFolder' &&\n !pathHasPrefix(curItemPath, '/_next/static')\n ) {\n continue\n }\n\n const nextDataPrefix = `/_next/data/${buildId}/`\n\n if (\n type === 'pageFile' &&\n curItemPath.startsWith(nextDataPrefix) &&\n curItemPath.endsWith('.json')\n ) {\n items = nextDataRoutes\n // remove _next/data/<build-id> prefix\n curItemPath = curItemPath.substring(nextDataPrefix.length - 1)\n\n // remove .json postfix\n curItemPath = curItemPath.substring(\n 0,\n curItemPath.length - '.json'.length\n )\n const curLocaleResult = handleLocale(curItemPath)\n curItemPath =\n curLocaleResult.pathname === '/index'\n ? '/'\n : curLocaleResult.pathname\n\n locale = curLocaleResult.locale\n\n try {\n curDecodedItemPath = decodeURIComponent(curItemPath)\n } catch {}\n }\n\n let matchedItem = items.has(curItemPath)\n\n // check decoded variant as well\n if (!matchedItem && !opts.dev) {\n matchedItem = items.has(curDecodedItemPath)\n if (matchedItem) curItemPath = curDecodedItemPath\n else {\n // x-ref: https://github.com/vercel/next.js/issues/54008\n // There're cases that urls get decoded before requests, we should support both encoded and decoded ones.\n // e.g. nginx could decode the proxy urls, the below ones should be treated as the same:\n // decoded version: `/_next/static/chunks/pages/blog/[slug]-d4858831b91b69f6.js`\n // encoded version: `/_next/static/chunks/pages/blog/%5Bslug%5D-d4858831b91b69f6.js`\n try {\n // encode the special characters in the path and retrieve again to determine if path exists.\n const encodedCurItemPath = encodeURIPath(curItemPath)\n matchedItem = items.has(encodedCurItemPath)\n } catch {}\n }\n }\n\n if (matchedItem || opts.dev) {\n let fsPath: string | undefined\n let itemsRoot: string | undefined\n\n switch (type) {\n case 'nextStaticFolder': {\n itemsRoot = nextStaticFolderPath\n curItemPath = curItemPath.substring('/_next/static'.length)\n break\n }\n case 'legacyStaticFolder': {\n itemsRoot = legacyStaticFolderPath\n break\n }\n case 'publicFolder': {\n itemsRoot = publicFolderPath\n break\n }\n case 'serviceWorker': {\n itemsRoot = serviceWorkerFolderPath\n break\n }\n case 'appFile':\n case 'pageFile':\n case 'nextImage':\n case 'devVirtualFsItem': {\n break\n }\n default: {\n ;(type) satisfies never\n }\n }\n\n if (itemsRoot && curItemPath) {\n fsPath = path.posix.join(itemsRoot, curItemPath)\n }\n\n // dynamically check fs in development so we don't\n // have to wait on the watcher\n if (!matchedItem && opts.dev) {\n const isStaticAsset = (\n [\n 'nextStaticFolder',\n 'publicFolder',\n 'legacyStaticFolder',\n 'serviceWorker',\n ] as (typeof type)[]\n ).includes(type)\n\n if (isStaticAsset && itemsRoot) {\n let found = fsPath && (await fileExists(fsPath, FileType.File))\n\n if (!found) {\n try {\n // In dev, we ensure encoded paths match\n // decoded paths on the filesystem so check\n // that variation as well\n const tempItemPath = decodeURIComponent(curItemPath)\n fsPath = path.posix.join(itemsRoot, tempItemPath)\n found = await fileExists(fsPath, FileType.File)\n } catch {}\n\n if (!found) {\n continue\n }\n }\n } else if (type === 'pageFile' || type === 'appFile') {\n const isAppFile = type === 'appFile'\n\n // Attempt to ensure the page/app file is compiled and ready\n if (ensureFn) {\n const ensureItemPath = isAppFile\n ? normalizeMetadataRoute(curItemPath)\n : curItemPath\n\n try {\n await ensureFn({ type, itemPath: ensureItemPath })\n } catch (error) {\n // If ensure failed, skip this item and continue to the next one\n continue\n }\n }\n } else {\n continue\n }\n }\n\n // i18n locales aren't matched for app dir\n if (type === 'appFile' && locale && locale !== i18n?.defaultLocale) {\n continue\n }\n\n const itemResult = {\n type,\n fsPath,\n locale,\n itemsRoot,\n itemPath: curItemPath,\n }\n\n getItemsLru?.set(itemKey, itemResult)\n return itemResult\n }\n }\n\n getItemsLru?.set(itemKey, null)\n return null\n },\n getDynamicRoutes() {\n // this should include data routes\n return this.dynamicRoutes\n },\n getMiddlewareMatchers() {\n return this.middlewareMatcher\n },\n }\n}\n"],"names":["buildCustomRoute","setupFsCheck","debug","setupDebug","type","item","basePath","caseSensitive","restrictedRedirectPaths","map","p","builtRegex","match","getPathMatch","source","strict","removeUnnamedParams","regexModifier","regex","internal","modifyRouteRegex","undefined","sensitive","check","opts","getItemsLru","dev","LRUCache","length","value","fsPath","itemPath","nextDataRoutes","Set","publicFolderItems","nextStaticFolderItems","legacyStaticFolderItems","serviceWorkerItems","appFiles","pageFiles","staticMetadataFiles","Map","dynamicRoutes","middlewareMatcher","distDir","path","join","dir","config","publicFolderPath","nextStaticFolderPath","legacyStaticFolderPath","serviceWorkerFolderPath","customRoutes","redirects","rewrites","beforeFiles","afterFiles","fallback","onMatchHeaders","headers","buildId","previewProps","middlewareManifest","buildIdPath","BUILD_ID_FILE","fs","readFile","err","code","Error","file","recursiveReadDir","add","encodeURIPath","normalizePathSep","Log","warn","posix","output","routesManifestPath","ROUTES_MANIFEST","prerenderManifestPath","PRERENDER_MANIFEST","middlewareManifestPath","MIDDLEWARE_MANIFEST","functionsConfigManifestPath","FUNCTIONS_CONFIG_MANIFEST","pagesManifestPath","PAGES_MANIFEST","appRoutesManifestPath","APP_PATH_ROUTES_MANIFEST","routesManifest","JSON","parse","preview","catch","functionsConfigManifest","pagesManifest","appRoutesManifest","key","Object","keys","i18n","normalizeLocalePath","locales","pathname","escapedBuildId","escapeStringRegexp","route","dataRoutes","isDynamicRoute","page","routeRegex","getNamedRouteRegex","prefixRouteKeys","push","re","toString","namedRegex","routeKeys","getRouteMatcher","RegExp","dataRouteRegex","replace","groups","skipInternalRouting","getRouteRegex","middleware","matchers","getMiddlewareRouteMatcher","functions","regexp","originalSource","Array","isArray","loadCustomRoutes","previewModeId","require","randomBytes","previewModeSigningKey","previewModeEncryptionKey","experimental","caseSensitiveRoutes","handleLocale","locale","i18nResult","detectedLocale","ensureFn","normalizers","rsc","RSCPathnameNormalizer","exportPathMapRoutes","devVirtualFsItems","ensureCallback","fn","getItem","originalItemPath","itemKey","lruResult","get","hasBasePath","pathHasPrefix","removePathPrefix","minimalMode","normalize","endsWith","substring","decodedItemPath","decodeURIComponent","isMetadataRouteFile","itemsToCheck","items","curItemPath","curDecodedItemPath","isDynamicOutput","localeResult","defaultLocale","domains","nextDataPrefix","startsWith","curLocaleResult","matchedItem","has","encodedCurItemPath","itemsRoot","isStaticAsset","includes","found","fileExists","FileType","File","tempItemPath","isAppFile","ensureItemPath","normalizeMetadataRoute","error","itemResult","set","getDynamicRoutes","getMiddlewareMatchers"],"mappings":";;;;;;;;;;;;;;;IA2EaA,gBAAgB;eAAhBA;;IAkCSC,YAAY;eAAZA;;;6DAhGL;iEACF;6DACM;8DACE;0BACE;yEACsB;gCACd;4BACI;kCACJ;uBACF;8BACI;2BACN;4BAItB;8BACyB;+BACF;qCACM;kCACH;wCACS;2BASnC;kCAC0B;kCACM;qBACD;+BACR;iCACM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBpC,MAAMC,QAAQC,IAAAA,cAAU,EAAC;AASlB,MAAMH,mBAAmB,CAC9BI,MACAC,MACAC,UACAC;IAEA,MAAMC,0BAA0B;QAAC;KAAS,CAACC,GAAG,CAAC,CAACC,IAC9CJ,WAAW,GAAGA,WAAWI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ACF;oBACF;oBAEA,0CAA0C;oBAC1C,IAAIhM,SAAS,aAAa6I,UAAUA,YAAW1C,wBAAAA,KAAM0E,aAAa,GAAE;wBAClE;oBACF;oBAEA,MAAMoB,aAAa;wBACjBjM;wBACA0B;wBACAmH;wBACAwC;wBACA1J,UAAU8I;oBACZ;oBAEApJ,+BAAAA,YAAa6K,GAAG,CAACxC,SAASuC;oBAC1B,OAAOA;gBACT;YACF;YAEA5K,+BAAAA,YAAa6K,GAAG,CAACxC,SAAS;YAC1B,OAAO;QACT;QACAyC;YACE,kCAAkC;YAClC,OAAO,IAAI,CAAC7J,aAAa;QAC3B;QACA8J;YACE,OAAO,IAAI,CAAC7J,iBAAiB;QAC/B;IACF;AACF","ignoreList":[0]} |
@@ -180,3 +180,3 @@ // Start CPU profile if it wasn't already started. | ||
| let { port } = serverOptions; | ||
| process.title = `next-server (v${"16.3.0-preview.4"})`; | ||
| process.title = `next-server (v${"16.3.0-preview.5"})`; | ||
| let handlersReady = ()=>{}; | ||
@@ -183,0 +183,0 @@ let handlersError = ()=>{}; |
@@ -12,2 +12,3 @@ "use strict"; | ||
| const _nodestream = require("node:stream"); | ||
| const _nodecrypto = require("node:crypto"); | ||
| const _invarianterror = require("../../shared/lib/invariant-error"); | ||
@@ -71,2 +72,3 @@ const _workasyncstorageexternal = require("../app-render/work-async-storage.external"); | ||
| } | ||
| const [element, options] = args; | ||
| // `createHangingInputAbortSignal` aborts once the prerender's cache-sourced | ||
@@ -127,3 +129,7 @@ // input is ready, so anything the serialization below is still awaiting past | ||
| try { | ||
| const { prelude } = await (0, _static.prerenderToNodeStream)(args, clientModules, { | ||
| // We serialize only the `element`. It's the part that needs Flight, to run | ||
| // its async Server Components once and to surface any dynamic input. The | ||
| // `options` are already-resolved plain data; they're folded into the cache | ||
| // key directly and passed to satori as-is below. | ||
| const { prelude } = await (0, _static.prerenderToNodeStream)(element, clientModules, { | ||
| signal: hangingInputAbortSignal, | ||
@@ -159,6 +165,14 @@ filterStackFrame: undefined, | ||
| } | ||
| const buffer = Buffer.concat(chunks); | ||
| // Base64-encode the serialized output to use it as a stable string key | ||
| // (the Flight stream is binary, so it isn't safe to treat as UTF-8 text). | ||
| const cacheKey = buffer.toString('base64'); | ||
| const elementBuffer = Buffer.concat(chunks); | ||
| // Derive a stable cache key from the serialized element plus the options. | ||
| // We hash rather than reuse the raw serialized bytes so the key stays | ||
| // compact even for large inputs (e.g. embedded fonts), and we fold the | ||
| // options in by content so two images that differ only in their options | ||
| // (size, fonts, ...) don't collide. The options are hashed directly here, | ||
| // never serialized through Flight, which would both bloat the key and apply | ||
| // `Buffer.prototype .toJSON` to font data. | ||
| const hash = (0, _nodecrypto.createHash)('sha256'); | ||
| hash.update(elementBuffer); | ||
| updateHashWithOptions(hash, options); | ||
| const cacheKey = hash.digest('base64'); | ||
| const cached = resumeDataCache.imageResponses.get(cacheKey); | ||
@@ -168,14 +182,8 @@ if (cached) { | ||
| } | ||
| // Deserialize the resolved tree and hand it to satori. Because the user's | ||
| // Deserialize the element and hand it to satori. Because the user's | ||
| // components already ran during serialization, satori only walks resolved | ||
| // host elements and never re-runs them, confining user-space I/O to the | ||
| // in-store serialization above. | ||
| // | ||
| // The Flight client hands back the output of an async Server Component as | ||
| // a `React.lazy` (sync components and plain host elements are inlined). | ||
| // satori can't unwrap lazies, so we resolve them into plain elements first. | ||
| // We only reach here once the serialization completed, so every lazy is | ||
| // already resolved and `_init` returns synchronously. | ||
| const resolvedArgs = resolveFlightLazies(await (0, _client.createFromNodeStream)(_nodestream.Readable.from([ | ||
| buffer | ||
| const deserializedElement = await (0, _client.createFromNodeStream)(_nodestream.Readable.from([ | ||
| elementBuffer | ||
| ]), { | ||
@@ -188,3 +196,19 @@ // We don't want to trigger preloads of client references here. | ||
| findSourceMapURL: undefined | ||
| })); | ||
| }); | ||
| // The Flight client hands back the output of an async Server Component as | ||
| // a `React.lazy` (sync components and plain host elements are inlined). | ||
| // satori can't unwrap lazies, so we resolve them into plain elements first. | ||
| // We only reach here once the serialization completed, so every lazy is | ||
| // already resolved and `_init` returns synchronously. | ||
| const resolvedElement = resolveFlightLazies(deserializedElement); | ||
| // Pair the resolved element with the original, in-memory `options`, which | ||
| // never went through Flight. This keeps the font `Buffer` intact: had it | ||
| // been serialized, Flight would apply the `toJSON` method that Node's | ||
| // `Buffer` carries, turning it into a `{ type: 'Buffer', data: [...] }` | ||
| // object that satori's font parser rejects (it needs an `ArrayBuffer` or a | ||
| // typed array). | ||
| const resolvedArgs = [ | ||
| resolvedElement, | ||
| options | ||
| ]; | ||
| // Render satori outside the prerender work-unit store. It does uncached | ||
@@ -204,2 +228,77 @@ // `fetch` calls (e.g. loading a font), and inside a Cache Components | ||
| } | ||
| /** | ||
| * Updates a hash with a stable encoding of the `ImageResponse` options so they | ||
| * can participate in the cache key without being serialized through Flight. | ||
| * Binary values (font `Buffer`s, `ArrayBuffer`s, typed arrays) are hashed by | ||
| * their raw bytes; objects are walked in sorted-key order. | ||
| * | ||
| * `ImageResponse` options are plain data: numbers, strings, booleans, nested | ||
| * plain objects/arrays, and binary font data. Exotic objects such as `Map` or | ||
| * `Date` keep their state outside their enumerable own keys, so the key walk | ||
| * below would hash them incorrectly. Options never contain these, but we warn | ||
| * if one ever shows up so a mis-keyed cache can be reported. | ||
| * | ||
| * The encoding is self-delimiting: every node starts with a type tag, and | ||
| * variable-length parts (byte runs, primitives, keys) are length-prefixed, | ||
| * while arrays and objects are count-prefixed. This makes it injective, so no | ||
| * concatenation of values can be mistaken for a differently shaped input. | ||
| */ function updateHashWithOptions(hash, value) { | ||
| if (value === undefined) { | ||
| hash.update('u'); | ||
| return; | ||
| } | ||
| if (value === null) { | ||
| hash.update('n'); | ||
| return; | ||
| } | ||
| const type = typeof value; | ||
| if (type !== 'object') { | ||
| // Tag with the primitive type so e.g. the number `1` and the string `'1'` | ||
| // don't hash the same. | ||
| updateHashWithBytes(hash, 'p', Buffer.from(`${type}:${String(value)}`)); | ||
| return; | ||
| } | ||
| if (value instanceof ArrayBuffer) { | ||
| updateHashWithBytes(hash, 'a', new Uint8Array(value)); | ||
| return; | ||
| } | ||
| if (ArrayBuffer.isView(value)) { | ||
| updateHashWithBytes(hash, 'v', new Uint8Array(value.buffer, value.byteOffset, value.byteLength)); | ||
| return; | ||
| } | ||
| if (Array.isArray(value)) { | ||
| hash.update(`[${value.length},`); | ||
| for (const item of value){ | ||
| updateHashWithOptions(hash, item); | ||
| } | ||
| return; | ||
| } | ||
| // The key walk below captures a plain object faithfully, but an exotic object | ||
| // keeps its state elsewhere (a `Map`'s/`Set`'s entries, a `Date`'s time), so | ||
| // two different values would hash the same and could return the wrong cached | ||
| // image. This shouldn't happen for `ImageResponse` options, so we warn rather | ||
| // than fail, then hash best-effort, so it can be reported. Not gated on | ||
| // `NODE_ENV`: this runs during the production `next build` prerender, where | ||
| // the warning is most useful. | ||
| const prototype = Object.getPrototypeOf(value); | ||
| if (prototype !== Object.prototype && prototype !== null) { | ||
| var _value_constructor; | ||
| const typeName = ((_value_constructor = value.constructor) == null ? void 0 : _value_constructor.name) ?? 'object'; | ||
| console.warn(`Cannot reliably include an \`ImageResponse\` option of type ` + `\`${typeName}\` in the cache key, so different images may collide and ` + `return an incorrect cached result. Please report this to the Next.js ` + `team.`); | ||
| } | ||
| const keys = Object.keys(value).sort(); | ||
| hash.update(`{${keys.length},`); | ||
| for (const key of keys){ | ||
| updateHashWithBytes(hash, 'k', Buffer.from(key)); | ||
| updateHashWithOptions(hash, value[key]); | ||
| } | ||
| } | ||
| /** | ||
| * Hashes a length-prefixed, tagged byte run: `<tag><byteLength>:<bytes>`. The | ||
| * length prefix keeps the run self-delimiting so it can't blend into adjacent | ||
| * nodes. | ||
| */ function updateHashWithBytes(hash, tag, bytes) { | ||
| hash.update(`${tag}${bytes.byteLength}:`); | ||
| hash.update(bytes); | ||
| } | ||
| async function renderImageResponseArrayBuffer(args) { | ||
@@ -206,0 +305,0 @@ const OGImageResponse = (await importOgModule()).ImageResponse; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/server/og/cache-image-response.ts"],"sourcesContent":["import { Readable } from 'node:stream'\n\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'\nimport { createHangingInputAbortSignal } from '../app-render/dynamic-rendering'\nimport { makeHangingPromise } from '../dynamic-rendering-utils'\nimport {\n getClientReferenceManifest,\n getServerModuleMap,\n} from '../app-render/manifests-singleton'\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport { prerenderToNodeStream } from 'react-server-dom-webpack/static'\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport { createFromNodeStream } from 'react-server-dom-webpack/client'\n\ntype OgModule = typeof import('next/dist/compiled/@vercel/og')\n\ntype ImageResponseArgs = ConstructorParameters<OgModule['ImageResponse']>\n\nfunction importOgModule(): Promise<OgModule> {\n // Cache Components is Node-only (rejected for the edge runtime at compile\n // time), so we always load the Node build. Loading it dynamically keeps the\n // heavy `@vercel/og` renderer (satori + WASM) off the module-load path, so\n // it's pulled in only when an image is actually rendered.\n return import('next/dist/compiled/@vercel/og/index.node.js')\n}\n\n/**\n * Builds the body for a Cache Components `ImageResponse`. The rendered image is\n * cached in the Resume Data Cache during a prerender, so the prospective\n * prerender renders it once and the final prerender retrieves it from memory\n * within microtasks. This lets metadata image routes be statically prerendered\n * under Cache Components instead of being treated as dynamic.\n *\n * The cache boundary is drawn around only the deterministic rasterization of\n * the element tree into an image. The `ImageResponse` element tree is rendered\n * with React Flight once, inside the prerender work-unit store, so any\n * user-space I/O (e.g. `cookies()` or an uncached `fetch`) runs in the correct\n * scope and is subject to the normal Cache Components rules. If that tree\n * needs dynamic input the serialization can't complete, and the route falls\n * back to dynamic. Otherwise the fully resolved tree is handed to satori,\n * which never re-runs the user's components.\n *\n * Outside of a prerender (normal requests) this just renders.\n */\nexport function getCachedImageResponseBody(\n args: ImageResponseArgs\n): ReadableStream<Uint8Array> {\n return new ReadableStream<Uint8Array>({\n async start(controller) {\n const arrayBuffer = await getCachedImageResponseArrayBuffer(args)\n if (arrayBuffer.byteLength > 0) {\n controller.enqueue(new Uint8Array(arrayBuffer))\n }\n controller.close()\n },\n })\n}\n\nasync function getCachedImageResponseArrayBuffer(\n args: ImageResponseArgs\n): Promise<ArrayBuffer> {\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n switch (workUnitStore?.type) {\n case 'prerender':\n // We only cache during a prerender. Metadata image routes compile to\n // route handlers, which use the `prerender` store.\n break\n case undefined:\n case 'request':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n case 'prerender-runtime':\n case 'prerender-client':\n case 'validation-client':\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'generate-static-params':\n return renderImageResponseArrayBuffer(args)\n default:\n return workUnitStore satisfies never\n }\n\n const { cacheSignal, resumeDataCache, renderSignal } = workUnitStore\n\n if (!resumeDataCache) {\n return renderImageResponseArrayBuffer(args)\n }\n\n const workStore = workAsyncStorage.getStore()\n\n if (!workStore) {\n throw new InvariantError(\n 'Expected a work store while caching an `ImageResponse` during prerendering.'\n )\n }\n\n // `createHangingInputAbortSignal` aborts once the prerender's cache-sourced\n // input is ready, so anything the serialization below is still awaiting past\n // that point can be treated as dynamic (non-cache) input. In the prospective\n // pass it aborts when `cacheSignal.inputReady()` resolves (no cache reads\n // in progress); in the final pass the caches are already filled, so it just\n // aborts on the next tick.\n const hangingInputAbortSignal = createHangingInputAbortSignal(workUnitStore)\n\n // We open the cache read lazily, once we know the serialization completed and\n // we're about to render and store the image. Opening it before serializing\n // would keep `cacheSignal.inputReady()` from resolving and thus prevent the\n // abort signal from ever firing, deadlocking the prospective prerender.\n let readState: 'ready' | 'pending' | 'done' = 'ready'\n\n function beginReadOnce() {\n if (readState === 'ready') {\n readState = 'pending'\n cacheSignal?.beginRead()\n }\n }\n\n function endReadIfStarted() {\n if (readState === 'pending') {\n cacheSignal?.endRead()\n }\n readState = 'done'\n }\n\n // We serialize the element tree with `prerenderToNodeStream` rather than\n // `renderToPipeableStream`. It's the right fit for prerendering, and it\n // schedules work deferred for size (`deferTask`) on microtasks, so a fully\n // static tree finishes flushing before the abort signal fires; a tree still\n // pending at abort time is then genuinely waiting on dynamic input rather\n // than just deferred.\n //\n // `renderToPipeableStream` would schedule that deferred work on\n // `setImmediate` instead, which isn't necessarily a deal-breaker: the\n // sequential-task scheme page rendering uses (`runInSequentialTasks`) drains\n // pending immediates at each task boundary, so deferred work still runs in\n // time. But route handler prerendering doesn't use that scheme, so here the\n // deferred immediates would race the abort.\n //\n // The prerender halts silently on abort, leaving unfulfilled references in\n // place rather than reporting through `onError`. So to tell a halt (the tree\n // needed dynamic input) apart from a normal completion, we record whether the\n // abort fired before the serialization finished. `abort()` runs this listener\n // synchronously, well before we read `resultIsPartial` below.\n let prerenderCompleted = false\n let resultIsPartial = false\n let serializationError: unknown\n\n hangingInputAbortSignal.addEventListener(\n 'abort',\n () => {\n if (!prerenderCompleted) {\n resultIsPartial = true\n }\n },\n { once: true }\n )\n\n const { clientModules, rscModuleMapping } = getClientReferenceManifest()\n\n try {\n const { prelude } = await prerenderToNodeStream(args, clientModules, {\n signal: hangingInputAbortSignal,\n filterStackFrame: undefined,\n onError(error) {\n // A halt (our deliberate abort) emits nothing, so this is only called\n // for genuine serialization errors. We surface the first one.\n if (serializationError === undefined && !resultIsPartial) {\n serializationError = error\n }\n },\n })\n\n prerenderCompleted = true\n\n if (serializationError !== undefined) {\n throw serializationError\n }\n\n if (resultIsPartial) {\n // The element tree needed dynamic input (e.g. `cookies()` or an uncached\n // `fetch`), so the image can't be produced statically. Return a hanging\n // promise: the body never resolves, and the final prerender's macrotask\n // budget then classifies the route as dynamic.\n return makeHangingPromise<ArrayBuffer>(\n renderSignal,\n workStore.route,\n 'dynamic `ImageResponse`'\n )\n }\n\n // The serialization finished before any dynamic input was needed, so we\n // will render and cache the image. Hold the cache read now, before the\n // stream is buffered and deserialized below, so that the prospective\n // prerender's `cacheReady()` waits for the image to be stored.\n beginReadOnce()\n\n const chunks: Buffer[] = []\n for await (const chunk of prelude) {\n chunks.push(chunk)\n }\n\n const buffer = Buffer.concat(chunks)\n // Base64-encode the serialized output to use it as a stable string key\n // (the Flight stream is binary, so it isn't safe to treat as UTF-8 text).\n const cacheKey = buffer.toString('base64')\n\n const cached = resumeDataCache.imageResponses.get(cacheKey)\n\n if (cached) {\n return await cached\n }\n\n // Deserialize the resolved tree and hand it to satori. Because the user's\n // components already ran during serialization, satori only walks resolved\n // host elements and never re-runs them, confining user-space I/O to the\n // in-store serialization above.\n //\n // The Flight client hands back the output of an async Server Component as\n // a `React.lazy` (sync components and plain host elements are inlined).\n // satori can't unwrap lazies, so we resolve them into plain elements first.\n // We only reach here once the serialization completed, so every lazy is\n // already resolved and `_init` returns synchronously.\n const resolvedArgs = resolveFlightLazies(\n await createFromNodeStream(\n Readable.from([buffer]),\n {\n // We don't want to trigger preloads of client references here.\n moduleLoading: null,\n moduleMap: rscModuleMapping,\n serverModuleMap: getServerModuleMap(),\n },\n { findSourceMapURL: undefined }\n )\n ) as ImageResponseArgs\n\n // Render satori outside the prerender work-unit store. It does uncached\n // `fetch` calls (e.g. loading a font), and inside a Cache Components\n // prerender an uncached `fetch` outside a cache scope becomes a hanging\n // promise. Those are framework fetches, not user I/O, so we let them\n // resolve normally with no store.\n const arrayBufferPromise = workUnitAsyncStorage.exit(() =>\n renderImageResponseArrayBuffer(resolvedArgs)\n )\n\n if (resumeDataCache.mutable) {\n resumeDataCache.imageResponses.set(cacheKey, arrayBufferPromise)\n }\n\n return await arrayBufferPromise\n } finally {\n endReadIfStarted()\n }\n}\n\nasync function renderImageResponseArrayBuffer(\n args: ImageResponseArgs\n): Promise<ArrayBuffer> {\n const OGImageResponse = (await importOgModule()).ImageResponse\n const imageResponse = new OGImageResponse(...args)\n\n if (!imageResponse.body) {\n return new ArrayBuffer(0)\n }\n\n return imageResponse.arrayBuffer()\n}\n\nconst REACT_LAZY_TYPE = Symbol.for('react.lazy')\n\n/**\n * Recursively replaces the `React.lazy` references that Flight emits for\n * resolved async Server Components with the elements they resolve to, so that\n * satori (which doesn't understand lazy nodes) can walk the tree. This must\n * only be called on a fully resolved (completed) Flight result, where each\n * lazy's `_init` returns synchronously rather than suspending.\n */\nfunction resolveFlightLazies(node: unknown): unknown {\n if (node === null || typeof node !== 'object') {\n return node\n }\n\n if ((node as { $$typeof?: symbol }).$$typeof === REACT_LAZY_TYPE) {\n const lazy = node as {\n _init: (payload: unknown) => unknown\n _payload: unknown\n }\n return resolveFlightLazies(lazy._init(lazy._payload))\n }\n\n if (Array.isArray(node)) {\n return node.map(resolveFlightLazies)\n }\n\n const element = node as { props?: { children?: unknown } }\n if (element.props && 'children' in element.props) {\n return {\n ...element,\n props: {\n ...element.props,\n children: resolveFlightLazies(element.props.children),\n },\n }\n }\n\n return node\n}\n"],"names":["getCachedImageResponseBody","importOgModule","args","ReadableStream","start","controller","arrayBuffer","getCachedImageResponseArrayBuffer","byteLength","enqueue","Uint8Array","close","workUnitStore","workUnitAsyncStorage","getStore","type","undefined","renderImageResponseArrayBuffer","cacheSignal","resumeDataCache","renderSignal","workStore","workAsyncStorage","InvariantError","hangingInputAbortSignal","createHangingInputAbortSignal","readState","beginReadOnce","beginRead","endReadIfStarted","endRead","prerenderCompleted","resultIsPartial","serializationError","addEventListener","once","clientModules","rscModuleMapping","getClientReferenceManifest","prelude","prerenderToNodeStream","signal","filterStackFrame","onError","error","makeHangingPromise","route","chunks","chunk","push","buffer","Buffer","concat","cacheKey","toString","cached","imageResponses","get","resolvedArgs","resolveFlightLazies","createFromNodeStream","Readable","from","moduleLoading","moduleMap","serverModuleMap","getServerModuleMap","findSourceMapURL","arrayBufferPromise","exit","mutable","set","OGImageResponse","ImageResponse","imageResponse","body","ArrayBuffer","REACT_LAZY_TYPE","Symbol","for","node","$$typeof","lazy","_init","_payload","Array","isArray","map","element","props","children"],"mappings":";;;;+BA8CgBA;;;eAAAA;;;4BA9CS;gCA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,SAASpB,oBAAoBqB,IAAa;IACxC,IAAIA,SAAS,QAAQ,OAAOA,SAAS,UAAU;QAC7C,OAAOA;IACT;IAEA,IAAI,AAACA,KAA+BC,QAAQ,KAAKJ,iBAAiB;QAChE,MAAMK,OAAOF;QAIb,OAAOrB,oBAAoBuB,KAAKC,KAAK,CAACD,KAAKE,QAAQ;IACrD;IAEA,IAAIC,MAAMC,OAAO,CAACN,OAAO;QACvB,OAAOA,KAAKO,GAAG,CAAC5B;IAClB;IAEA,MAAM6B,UAAUR;IAChB,IAAIQ,QAAQC,KAAK,IAAI,cAAcD,QAAQC,KAAK,EAAE;QAChD,OAAO;YACL,GAAGD,OAAO;YACVC,OAAO;gBACL,GAAGD,QAAQC,KAAK;gBAChBC,UAAU/B,oBAAoB6B,QAAQC,KAAK,CAACC,QAAQ;YACtD;QACF;IACF;IAEA,OAAOV;AACT","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/server/og/cache-image-response.ts"],"sourcesContent":["import { Readable } from 'node:stream'\nimport { createHash, type Hash } from 'node:crypto'\n\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'\nimport { createHangingInputAbortSignal } from '../app-render/dynamic-rendering'\nimport { makeHangingPromise } from '../dynamic-rendering-utils'\nimport {\n getClientReferenceManifest,\n getServerModuleMap,\n} from '../app-render/manifests-singleton'\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport { prerenderToNodeStream } from 'react-server-dom-webpack/static'\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport { createFromNodeStream } from 'react-server-dom-webpack/client'\n\ntype OgModule = typeof import('next/dist/compiled/@vercel/og')\n\ntype ImageResponseArgs = ConstructorParameters<OgModule['ImageResponse']>\n\nfunction importOgModule(): Promise<OgModule> {\n // Cache Components is Node-only (rejected for the edge runtime at compile\n // time), so we always load the Node build. Loading it dynamically keeps the\n // heavy `@vercel/og` renderer (satori + WASM) off the module-load path, so\n // it's pulled in only when an image is actually rendered.\n return import('next/dist/compiled/@vercel/og/index.node.js')\n}\n\n/**\n * Builds the body for a Cache Components `ImageResponse`. The rendered image is\n * cached in the Resume Data Cache during a prerender, so the prospective\n * prerender renders it once and the final prerender retrieves it from memory\n * within microtasks. This lets metadata image routes be statically prerendered\n * under Cache Components instead of being treated as dynamic.\n *\n * The cache boundary is drawn around only the deterministic rasterization of\n * the element tree into an image. The `ImageResponse` element tree is rendered\n * with React Flight once, inside the prerender work-unit store, so any\n * user-space I/O (e.g. `cookies()` or an uncached `fetch`) runs in the correct\n * scope and is subject to the normal Cache Components rules. If that tree\n * needs dynamic input the serialization can't complete, and the route falls\n * back to dynamic. Otherwise the fully resolved tree is handed to satori,\n * which never re-runs the user's components.\n *\n * Outside of a prerender (normal requests) this just renders.\n */\nexport function getCachedImageResponseBody(\n args: ImageResponseArgs\n): ReadableStream<Uint8Array> {\n return new ReadableStream<Uint8Array>({\n async start(controller) {\n const arrayBuffer = await getCachedImageResponseArrayBuffer(args)\n if (arrayBuffer.byteLength > 0) {\n controller.enqueue(new Uint8Array(arrayBuffer))\n }\n controller.close()\n },\n })\n}\n\nasync function getCachedImageResponseArrayBuffer(\n args: ImageResponseArgs\n): Promise<ArrayBuffer> {\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n switch (workUnitStore?.type) {\n case 'prerender':\n // We only cache during a prerender. Metadata image routes compile to\n // route handlers, which use the `prerender` store.\n break\n case undefined:\n case 'request':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n case 'prerender-runtime':\n case 'prerender-client':\n case 'validation-client':\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'generate-static-params':\n return renderImageResponseArrayBuffer(args)\n default:\n return workUnitStore satisfies never\n }\n\n const { cacheSignal, resumeDataCache, renderSignal } = workUnitStore\n\n if (!resumeDataCache) {\n return renderImageResponseArrayBuffer(args)\n }\n\n const workStore = workAsyncStorage.getStore()\n\n if (!workStore) {\n throw new InvariantError(\n 'Expected a work store while caching an `ImageResponse` during prerendering.'\n )\n }\n\n const [element, options] = args\n\n // `createHangingInputAbortSignal` aborts once the prerender's cache-sourced\n // input is ready, so anything the serialization below is still awaiting past\n // that point can be treated as dynamic (non-cache) input. In the prospective\n // pass it aborts when `cacheSignal.inputReady()` resolves (no cache reads\n // in progress); in the final pass the caches are already filled, so it just\n // aborts on the next tick.\n const hangingInputAbortSignal = createHangingInputAbortSignal(workUnitStore)\n\n // We open the cache read lazily, once we know the serialization completed and\n // we're about to render and store the image. Opening it before serializing\n // would keep `cacheSignal.inputReady()` from resolving and thus prevent the\n // abort signal from ever firing, deadlocking the prospective prerender.\n let readState: 'ready' | 'pending' | 'done' = 'ready'\n\n function beginReadOnce() {\n if (readState === 'ready') {\n readState = 'pending'\n cacheSignal?.beginRead()\n }\n }\n\n function endReadIfStarted() {\n if (readState === 'pending') {\n cacheSignal?.endRead()\n }\n readState = 'done'\n }\n\n // We serialize the element tree with `prerenderToNodeStream` rather than\n // `renderToPipeableStream`. It's the right fit for prerendering, and it\n // schedules work deferred for size (`deferTask`) on microtasks, so a fully\n // static tree finishes flushing before the abort signal fires; a tree still\n // pending at abort time is then genuinely waiting on dynamic input rather\n // than just deferred.\n //\n // `renderToPipeableStream` would schedule that deferred work on\n // `setImmediate` instead, which isn't necessarily a deal-breaker: the\n // sequential-task scheme page rendering uses (`runInSequentialTasks`) drains\n // pending immediates at each task boundary, so deferred work still runs in\n // time. But route handler prerendering doesn't use that scheme, so here the\n // deferred immediates would race the abort.\n //\n // The prerender halts silently on abort, leaving unfulfilled references in\n // place rather than reporting through `onError`. So to tell a halt (the tree\n // needed dynamic input) apart from a normal completion, we record whether the\n // abort fired before the serialization finished. `abort()` runs this listener\n // synchronously, well before we read `resultIsPartial` below.\n let prerenderCompleted = false\n let resultIsPartial = false\n let serializationError: unknown\n\n hangingInputAbortSignal.addEventListener(\n 'abort',\n () => {\n if (!prerenderCompleted) {\n resultIsPartial = true\n }\n },\n { once: true }\n )\n\n const { clientModules, rscModuleMapping } = getClientReferenceManifest()\n\n try {\n // We serialize only the `element`. It's the part that needs Flight, to run\n // its async Server Components once and to surface any dynamic input. The\n // `options` are already-resolved plain data; they're folded into the cache\n // key directly and passed to satori as-is below.\n const { prelude } = await prerenderToNodeStream(element, clientModules, {\n signal: hangingInputAbortSignal,\n filterStackFrame: undefined,\n onError(error) {\n // A halt (our deliberate abort) emits nothing, so this is only called\n // for genuine serialization errors. We surface the first one.\n if (serializationError === undefined && !resultIsPartial) {\n serializationError = error\n }\n },\n })\n\n prerenderCompleted = true\n\n if (serializationError !== undefined) {\n throw serializationError\n }\n\n if (resultIsPartial) {\n // The element tree needed dynamic input (e.g. `cookies()` or an uncached\n // `fetch`), so the image can't be produced statically. Return a hanging\n // promise: the body never resolves, and the final prerender's macrotask\n // budget then classifies the route as dynamic.\n return makeHangingPromise<ArrayBuffer>(\n renderSignal,\n workStore.route,\n 'dynamic `ImageResponse`'\n )\n }\n\n // The serialization finished before any dynamic input was needed, so we\n // will render and cache the image. Hold the cache read now, before the\n // stream is buffered and deserialized below, so that the prospective\n // prerender's `cacheReady()` waits for the image to be stored.\n beginReadOnce()\n\n const chunks: Buffer[] = []\n for await (const chunk of prelude) {\n chunks.push(chunk)\n }\n\n const elementBuffer = Buffer.concat(chunks)\n\n // Derive a stable cache key from the serialized element plus the options.\n // We hash rather than reuse the raw serialized bytes so the key stays\n // compact even for large inputs (e.g. embedded fonts), and we fold the\n // options in by content so two images that differ only in their options\n // (size, fonts, ...) don't collide. The options are hashed directly here,\n // never serialized through Flight, which would both bloat the key and apply\n // `Buffer.prototype .toJSON` to font data.\n const hash = createHash('sha256')\n hash.update(elementBuffer)\n updateHashWithOptions(hash, options)\n const cacheKey = hash.digest('base64')\n\n const cached = resumeDataCache.imageResponses.get(cacheKey)\n\n if (cached) {\n return await cached\n }\n\n // Deserialize the element and hand it to satori. Because the user's\n // components already ran during serialization, satori only walks resolved\n // host elements and never re-runs them, confining user-space I/O to the\n // in-store serialization above.\n const deserializedElement = await createFromNodeStream(\n Readable.from([elementBuffer]),\n {\n // We don't want to trigger preloads of client references here.\n moduleLoading: null,\n moduleMap: rscModuleMapping,\n serverModuleMap: getServerModuleMap(),\n },\n { findSourceMapURL: undefined }\n )\n\n // The Flight client hands back the output of an async Server Component as\n // a `React.lazy` (sync components and plain host elements are inlined).\n // satori can't unwrap lazies, so we resolve them into plain elements first.\n // We only reach here once the serialization completed, so every lazy is\n // already resolved and `_init` returns synchronously.\n const resolvedElement = resolveFlightLazies(deserializedElement)\n\n // Pair the resolved element with the original, in-memory `options`, which\n // never went through Flight. This keeps the font `Buffer` intact: had it\n // been serialized, Flight would apply the `toJSON` method that Node's\n // `Buffer` carries, turning it into a `{ type: 'Buffer', data: [...] }`\n // object that satori's font parser rejects (it needs an `ArrayBuffer` or a\n // typed array).\n const resolvedArgs = [resolvedElement, options] as ImageResponseArgs\n\n // Render satori outside the prerender work-unit store. It does uncached\n // `fetch` calls (e.g. loading a font), and inside a Cache Components\n // prerender an uncached `fetch` outside a cache scope becomes a hanging\n // promise. Those are framework fetches, not user I/O, so we let them\n // resolve normally with no store.\n const arrayBufferPromise = workUnitAsyncStorage.exit(() =>\n renderImageResponseArrayBuffer(resolvedArgs)\n )\n\n if (resumeDataCache.mutable) {\n resumeDataCache.imageResponses.set(cacheKey, arrayBufferPromise)\n }\n\n return await arrayBufferPromise\n } finally {\n endReadIfStarted()\n }\n}\n\n/**\n * Updates a hash with a stable encoding of the `ImageResponse` options so they\n * can participate in the cache key without being serialized through Flight.\n * Binary values (font `Buffer`s, `ArrayBuffer`s, typed arrays) are hashed by\n * their raw bytes; objects are walked in sorted-key order.\n *\n * `ImageResponse` options are plain data: numbers, strings, booleans, nested\n * plain objects/arrays, and binary font data. Exotic objects such as `Map` or\n * `Date` keep their state outside their enumerable own keys, so the key walk\n * below would hash them incorrectly. Options never contain these, but we warn\n * if one ever shows up so a mis-keyed cache can be reported.\n *\n * The encoding is self-delimiting: every node starts with a type tag, and\n * variable-length parts (byte runs, primitives, keys) are length-prefixed,\n * while arrays and objects are count-prefixed. This makes it injective, so no\n * concatenation of values can be mistaken for a differently shaped input.\n */\nfunction updateHashWithOptions(hash: Hash, value: unknown): void {\n if (value === undefined) {\n hash.update('u')\n return\n }\n\n if (value === null) {\n hash.update('n')\n return\n }\n\n const type = typeof value\n\n if (type !== 'object') {\n // Tag with the primitive type so e.g. the number `1` and the string `'1'`\n // don't hash the same.\n updateHashWithBytes(hash, 'p', Buffer.from(`${type}:${String(value)}`))\n return\n }\n\n if (value instanceof ArrayBuffer) {\n updateHashWithBytes(hash, 'a', new Uint8Array(value))\n return\n }\n\n if (ArrayBuffer.isView(value)) {\n updateHashWithBytes(\n hash,\n 'v',\n new Uint8Array(value.buffer, value.byteOffset, value.byteLength)\n )\n return\n }\n\n if (Array.isArray(value)) {\n hash.update(`[${value.length},`)\n for (const item of value) {\n updateHashWithOptions(hash, item)\n }\n return\n }\n\n // The key walk below captures a plain object faithfully, but an exotic object\n // keeps its state elsewhere (a `Map`'s/`Set`'s entries, a `Date`'s time), so\n // two different values would hash the same and could return the wrong cached\n // image. This shouldn't happen for `ImageResponse` options, so we warn rather\n // than fail, then hash best-effort, so it can be reported. Not gated on\n // `NODE_ENV`: this runs during the production `next build` prerender, where\n // the warning is most useful.\n const prototype = Object.getPrototypeOf(value)\n if (prototype !== Object.prototype && prototype !== null) {\n const typeName =\n (value as { constructor?: { name?: string } }).constructor?.name ??\n 'object'\n console.warn(\n `Cannot reliably include an \\`ImageResponse\\` option of type ` +\n `\\`${typeName}\\` in the cache key, so different images may collide and ` +\n `return an incorrect cached result. Please report this to the Next.js ` +\n `team.`\n )\n }\n\n const keys = Object.keys(value).sort()\n hash.update(`{${keys.length},`)\n for (const key of keys) {\n updateHashWithBytes(hash, 'k', Buffer.from(key))\n updateHashWithOptions(hash, (value as Record<string, unknown>)[key])\n }\n}\n\n/**\n * Hashes a length-prefixed, tagged byte run: `<tag><byteLength>:<bytes>`. The\n * length prefix keeps the run self-delimiting so it can't blend into adjacent\n * nodes.\n */\nfunction updateHashWithBytes(hash: Hash, tag: string, bytes: Uint8Array): void {\n hash.update(`${tag}${bytes.byteLength}:`)\n hash.update(bytes)\n}\n\nasync function renderImageResponseArrayBuffer(\n args: ImageResponseArgs\n): Promise<ArrayBuffer> {\n const OGImageResponse = (await importOgModule()).ImageResponse\n const imageResponse = new OGImageResponse(...args)\n\n if (!imageResponse.body) {\n return new ArrayBuffer(0)\n }\n\n return imageResponse.arrayBuffer()\n}\n\nconst REACT_LAZY_TYPE = Symbol.for('react.lazy')\n\n/**\n * Recursively replaces the `React.lazy` references that Flight emits for\n * resolved async Server Components with the elements they resolve to, so that\n * satori (which doesn't understand lazy nodes) can walk the tree. This must\n * only be called on a fully resolved (completed) Flight result, where each\n * lazy's `_init` returns synchronously rather than suspending.\n */\nfunction resolveFlightLazies(node: unknown): unknown {\n if (node === null || typeof node !== 'object') {\n return node\n }\n\n if ((node as { $$typeof?: symbol }).$$typeof === REACT_LAZY_TYPE) {\n const lazy = node as {\n _init: (payload: unknown) => unknown\n _payload: unknown\n }\n return resolveFlightLazies(lazy._init(lazy._payload))\n }\n\n if (Array.isArray(node)) {\n return node.map(resolveFlightLazies)\n }\n\n const element = node as { props?: { children?: unknown } }\n if (element.props && 'children' in element.props) {\n return {\n ...element,\n props: {\n ...element.props,\n children: resolveFlightLazies(element.props.children),\n },\n }\n }\n\n return node\n}\n"],"names":["getCachedImageResponseBody","importOgModule","args","ReadableStream","start","controller","arrayBuffer","getCachedImageResponseArrayBuffer","byteLength","enqueue","Uint8Array","close","workUnitStore","workUnitAsyncStorage","getStore","type","undefined","renderImageResponseArrayBuffer","cacheSignal","resumeDataCache","renderSignal","workStore","workAsyncStorage","InvariantError","element","options","hangingInputAbortSignal","createHangingInputAbortSignal","readState","beginReadOnce","beginRead","endReadIfStarted","endRead","prerenderCompleted","resultIsPartial","serializationError","addEventListener","once","clientModules","rscModuleMapping","getClientReferenceManifest","prelude","prerenderToNodeStream","signal","filterStackFrame","onError","error","makeHangingPromise","route","chunks","chunk","push","elementBuffer","Buffer","concat","hash","createHash","update","updateHashWithOptions","cacheKey","digest","cached","imageResponses","get","deserializedElement","createFromNodeStream","Readable","from","moduleLoading","moduleMap","serverModuleMap","getServerModuleMap","findSourceMapURL","resolvedElement","resolveFlightLazies","resolvedArgs","arrayBufferPromise","exit","mutable","set","value","updateHashWithBytes","String","ArrayBuffer","isView","buffer","byteOffset","Array","isArray","length","item","prototype","Object","getPrototypeOf","typeName","constructor","name","console","warn","keys","sort","key","tag","bytes","OGImageResponse","ImageResponse","imageResponse","body","REACT_LAZY_TYPE","Symbol","for","node","$$typeof","lazy","_init","_payload","map","props","children"],"mappings":";;;;+BA+CgBA;;;eAAAA;;;4BA/CS;4BACa;gCAEP;0CACE;8CACI;kCACS;uCACX;oCAI5B;wBAE+B;wBAED;AAMrC,SAASC;IACP,0EAA0E;IAC1E,4EAA4E;IAC5E,2EAA2E;IAC3E,0DAA0D;IAC1D,OAAO,MAAM,CAAC;AAChB;AAoBO,SAASD,2BACdE,IAAuB;IAEvB,OAAO,IAAIC,eAA2B;QACpC,MAAMC,OAAMC,UAAU;YACpB,MAAMC,cAAc,MAAMC,kCAAkCL;YAC5D,IAAII,YAAYE,UAAU,GAAG,GAAG;gBAC9BH,WAAWI,OAAO,CAAC,IAAIC,WAAWJ;YACpC;YACAD,WAAWM,KAAK;QAClB;IACF;AACF;AAEA,eAAeJ,kCACbL,IAAuB;IAEvB,MAAMU,gBAAgBC,kDAAoB,CAACC,QAAQ;IAEnD,OAAQF,iCAAAA,cAAeG,IAAI;QACzB,KAAK;YAGH;QACF,KAAKC;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;YACH,OAAOC,+BAA+Bf;QACxC;YACE,OAAOU;IACX;IAEA,MAAM,EAAEM,WAAW,EAA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aAAa;IAC9D,MAAMC,gBAAgB,IAAIF,mBAAmBtG;IAE7C,IAAI,CAACwG,cAAcC,IAAI,EAAE;QACvB,OAAO,IAAIxB,YAAY;IACzB;IAEA,OAAOuB,cAAcpG,WAAW;AAClC;AAEA,MAAMsG,kBAAkBC,OAAOC,GAAG,CAAC;AAEnC;;;;;;CAMC,GACD,SAASpC,oBAAoBqC,IAAa;IACxC,IAAIA,SAAS,QAAQ,OAAOA,SAAS,UAAU;QAC7C,OAAOA;IACT;IAEA,IAAI,AAACA,KAA+BC,QAAQ,KAAKJ,iBAAiB;QAChE,MAAMK,OAAOF;QAIb,OAAOrC,oBAAoBuC,KAAKC,KAAK,CAACD,KAAKE,QAAQ;IACrD;IAEA,IAAI5B,MAAMC,OAAO,CAACuB,OAAO;QACvB,OAAOA,KAAKK,GAAG,CAAC1C;IAClB;IAEA,MAAMlD,UAAUuF;IAChB,IAAIvF,QAAQ6F,KAAK,IAAI,cAAc7F,QAAQ6F,KAAK,EAAE;QAChD,OAAO;YACL,GAAG7F,OAAO;YACV6F,OAAO;gBACL,GAAG7F,QAAQ6F,KAAK;gBAChBC,UAAU5C,oBAAoBlD,QAAQ6F,KAAK,CAACC,QAAQ;YACtD;QACF;IACF;IAEA,OAAOP;AACT","ignoreList":[0]} |
@@ -141,3 +141,4 @@ /** | ||
| SubtreeHasRuntimePrefetch = 2048, | ||
| SubtreeHasEagerPrefetch = 4096 | ||
| SubtreeHasEagerPrefetch = 4096, | ||
| SubtreeHasInstantFalse = 8192 | ||
| } | ||
@@ -144,0 +145,0 @@ /** |
@@ -86,6 +86,12 @@ /** | ||
| PrefetchHint[PrefetchHint["SubtreeHasEagerPrefetch"] = 4096] = "SubtreeHasEagerPrefetch"; | ||
| // This segment or one of its descendants exports `instant = false`, | ||
| // explicitly opting out of Partial Prefetching. Propagates upward so the root | ||
| // reflects the entire subtree. Used only to suppress the dev-time | ||
| // `<Link prefetch={true}>` warning — unlike PrefetchDisabled, it has no effect | ||
| // on the actual prefetch behavior. | ||
| PrefetchHint[PrefetchHint["SubtreeHasInstantFalse"] = 8192] = "SubtreeHasInstantFalse"; | ||
| return PrefetchHint; | ||
| }({}); | ||
| const StaticPrefetchDisabled = 1 | 1024; | ||
| const SubtreePrefetchHints = 2 | 8 | 2048 | 4096; | ||
| const SubtreePrefetchHints = 2 | 8 | 2048 | 8192 | 4096; | ||
| function propagateSubtreeBits(parentHints, childHints) { | ||
@@ -109,2 +115,7 @@ if (childHints & 2) { | ||
| } | ||
| // And for `instant = false`. Like eager prefetch, the bit is set directly on | ||
| // each opted-out segment, so propagate it as-is. | ||
| if (childHints & 8192) { | ||
| parentHints |= 8192; | ||
| } | ||
| return parentHints; | ||
@@ -111,0 +122,0 @@ } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/shared/lib/app-router-types.ts"],"sourcesContent":["/**\n * App Router types - Client-safe types for the Next.js App Router\n *\n * This file contains type definitions that can be safely imported\n * by both client-side and server-side code without circular dependencies.\n */\n\nimport type React from 'react'\n\nexport type LoadingModuleData =\n | [React.JSX.Element, React.ReactNode, React.ReactNode]\n | null\n\nimport type { VaryParamsIterable } from './segment-cache/vary-params-decoding'\n\n/** viewport metadata node */\nexport type HeadData = React.ReactNode\n\n/**\n * Cache node used in app-router / layout-router.\n */\n\nexport type CacheNode = {\n /**\n * When rsc is not null, it represents the RSC data for the\n * corresponding segment.\n *\n * `null` is a valid React Node but because segment data is always a\n * <LayoutRouter> component, we can use `null` to represent empty. When it is\n * null, it represents missing data, and rendering should suspend.\n */\n rsc: React.ReactNode\n\n /**\n * Represents a static version of the segment that can be shown immediately,\n * and may or may not contain dynamic holes. It's prefetched before a\n * navigation occurs.\n *\n * During rendering, we will choose whether to render `rsc` or `prefetchRsc`\n * with `useDeferredValue`. As with the `rsc` field, a value of `null` means\n * no value was provided. In this case, the LayoutRouter will go straight to\n * rendering the `rsc` value; if that one is also missing, it will suspend and\n * trigger a lazy fetch.\n */\n prefetchRsc: React.ReactNode\n\n prefetchHead: HeadData | null\n\n head: HeadData\n\n slots: Record<string, CacheNode> | null\n\n /**\n * A shared mutable ref that tracks whether this segment should be scrolled\n * to. All new segments created during a single navigation share the same\n * ref. When any segment's scroll handler fires, it sets `current` to\n * `false` so no other segment scrolls for the same navigation.\n *\n * `null` means this segment is not a scroll target (e.g., a reused shared\n * layout segment).\n */\n scrollRef: ScrollRef | null\n\n /**\n * Globally-unique identifier minted from a monotonic counter when the\n * CacheNode is freshly created. Surfaced to user code as a string via\n * `useRouter().bfcacheId` and intended to be used as a React `key` to\n * opt out of Activity-based state preservation on fresh navigations.\n *\n * Preserved when the CacheNode is reused (shared layouts, refresh,\n * search/hash-only navigations) or restored from the BFCache during a\n * back/forward navigation.\n */\n bfcacheId: number\n}\n\n/**\n * A mutable ref shared across all new segments created during a single\n * navigation. Used to ensure that only one segment scrolls per navigation.\n */\nexport type ScrollRef = { current: boolean }\n\nexport type DynamicParamTypes =\n | 'catchall'\n | 'catchall-intercepted-(..)(..)'\n | 'catchall-intercepted-(.)'\n | 'catchall-intercepted-(..)'\n | 'catchall-intercepted-(...)'\n | 'optional-catchall'\n | 'dynamic'\n | 'dynamic-intercepted-(..)(..)'\n | 'dynamic-intercepted-(.)'\n | 'dynamic-intercepted-(..)'\n | 'dynamic-intercepted-(...)'\n\nexport type DynamicParamTypesShort =\n | 'c'\n | 'ci(..)(..)'\n | 'ci(.)'\n | 'ci(..)'\n | 'ci(...)'\n | 'oc'\n | 'd'\n | 'di(..)(..)'\n | 'di(.)'\n | 'di(..)'\n | 'di(...)'\n\n// The tuple form of a segment, used for dynamic route params\nexport type DynamicSegmentTuple = [\n // Param name\n paramName: string,\n // Param cache key (almost the same as the value, but arrays are\n // concatenated into strings)\n // TODO: We should change this to just be the value. Currently we convert\n // it back to a value when passing to useParams. It only needs to be\n // a string when converted to a a cache key, but that doesn't mean we\n // need to store it as that representation.\n paramCacheKey: string,\n // Dynamic param type\n dynamicParamType: DynamicParamTypesShort,\n // Static sibling segments at the same URL level. Used by the client\n // router to determine if a prefetch can be reused when navigating to\n // a static sibling of a dynamic route. For example, if the route is\n // /products/[id] and there's also /products/sale, then staticSiblings\n // would be ['sale']. null means the siblings are unknown (e.g. in\n // webpack dev mode).\n staticSiblings: readonly string[] | null,\n]\n\nexport type Segment = string | DynamicSegmentTuple\n\n/**\n * Router state\n */\nexport type FlightRouterState = [\n segment: Segment,\n parallelRoutes: { [parallelRouterKey: string]: FlightRouterState },\n refreshState?: CompressedRefreshState | null,\n /**\n * - \"refetch\" is used during a request to inform the server where rendering\n * should start from.\n *\n * - \"inside-shared-layout\" is used during a prefetch request to inform the\n * server that even if the segment matches, it should be treated as if it's\n * within the \"new\" part of a navigation — inside the shared layout. If\n * the segment doesn't match, then it has no effect, since it would be\n * treated as new regardless. If it does match, though, the server does not\n * need to render it, because the client already has it.\n *\n * - \"metadata-only\" instructs the server to skip rendering the segments and\n * only send the head data.\n *\n * A bit confusing, but that's because it has only one extremely narrow use\n * case — during a non-PPR prefetch, the server uses it to find the first\n * loading boundary beneath a shared layout.\n *\n * TODO: We should rethink the protocol for dynamic requests. It might not\n * make sense for the client to send a FlightRouterState, since this type is\n * overloaded with concerns.\n */\n refresh?: 'refetch' | 'inside-shared-layout' | 'metadata-only' | null,\n /**\n * Bitmask of PrefetchHint flags. Encodes route structure metadata:\n * root layout, loading boundaries, instant configs, and runtime prefetch\n * hints. Only set when non-zero.\n */\n prefetchHints?: number,\n]\n\n/**\n * When rendering a parallel route, some of the parallel paths may not match\n * the current URL. In that case, the Next client has to render something,\n * so it will render whichever was the last route to match that slot. We use\n * this type to track when this has happened. It's a tuple of the original\n * URL that was used to fetch the segment, and the (possibly rewritten) search\n * query that was rendered by the server. The URL is needed when performing\n * a refresh of the segment, and the search query is needed for looking up\n * matching entries in the segment cache.\n */\nexport type CompressedRefreshState = [url: string, renderedSearch: string]\n\nexport const enum PrefetchHint {\n // This segment has a runtime prefetch enabled (via instant with\n // prefetch: 'runtime'). Per-segment only, does not propagate to ancestors.\n HasRuntimePrefetch = 0b00001,\n // This segment or one of its descendants opts into Partial Prefetching.\n // Currently set when a truthy instant config is present on any\n // segment in the subtree (regardless of prefetch mode). Propagates upward\n // so the root segment reflects the entire subtree.\n SubtreeHasPartialPrefetching = 0b00010,\n // This segment itself has a loading.tsx boundary.\n SegmentHasLoadingBoundary = 0b00100,\n // A descendant segment (but not this one) has a loading.tsx boundary.\n // Propagates upward so the root reflects the entire subtree.\n SubtreeHasLoadingBoundary = 0b01000,\n // This segment is at or above the application's root layout — the root layout\n // segment itself and all of its ancestors. A dynamic param in one of these\n // segments is a \"root param\".\n IsRootLayoutOrAbove = 0b10000,\n // This segment's response includes its parent's data inlined into it.\n // Set at build time by the segment size measurement pass.\n ParentInlinedIntoSelf = 0b100000,\n // This segment's data is inlined into one of its children — don't fetch\n // it separately. Set at build time by the segment size measurement pass.\n InlinedIntoChild = 0b1000000,\n // On a __PAGE__: this page's response includes the head (metadata/viewport)\n // at the end of its SegmentPrefetch[] array.\n HeadInlinedIntoSelf = 0b10000000,\n // On the root hint node: the head was NOT inlined into any page — fetch\n // it separately. Absence of this bit means the head is bundled into a page.\n HeadOutlined = 0b100000000,\n // The inlining hints in this tree may be stale because the tree was\n // generated before collectPrefetchHints ran (e.g. the initial RSC payload\n // for a fully static page at build time). When writing this tree into the\n // cache, the route entry should be immediately expired so it gets\n // re-fetched with correct hints. Only set during build-time prerendering,\n // never at runtime.\n InliningHintsStale = 0b1000000000,\n // This segment has instant = false, opting out of all\n // prefetching entirely (neither static nor runtime).\n PrefetchDisabled = 0b10000000000,\n // This segment or one of its descendants has runtime prefetch enabled\n // (HasRuntimePrefetch). Propagates upward so the root reflects the\n // entire subtree.\n SubtreeHasRuntimePrefetch = 0b100000000000,\n // This segment or one of its descendants prefetches \"eagerly\" — i.e. its\n // effective prefetch strategy is anything other than 'partial' or\n // 'allow-runtime'. Used by App Shells: a non-eager subtree relies on the\n // shared app shell and skips its Speculative prefetch. Propagates upward so\n // the root reflects the entire subtree.\n SubtreeHasEagerPrefetch = 0b1000000000000,\n}\n\n/**\n * Bitmask for checking whether a segment's static prefetch is skipped. Matches\n * if EITHER bit is set — i.e. the segment uses runtime prefetching\n * (HasRuntimePrefetch) OR prefetching is disabled entirely (PrefetchDisabled,\n * e.g. instant = false). The segment participates in the bundle chain\n * but with null data.\n *\n * Usage: `(hints & StaticPrefetchDisabled) !== 0`\n */\nexport const StaticPrefetchDisabled =\n PrefetchHint.HasRuntimePrefetch | PrefetchHint.PrefetchDisabled\n\n/**\n * The subset of PrefetchHint bits that propagate upward from a child segment to\n * its ancestors (as opposed to segment-local bits like SegmentHasLoadingBoundary\n * or IsRootLayoutOrAbove). Used to clear stale propagated bits before re-deriving them\n * from a node's children.\n */\nexport const SubtreePrefetchHints =\n PrefetchHint.SubtreeHasPartialPrefetching |\n PrefetchHint.SubtreeHasLoadingBoundary |\n PrefetchHint.SubtreeHasRuntimePrefetch |\n PrefetchHint.SubtreeHasEagerPrefetch\n\n/**\n * Folds a child segment's prefetch hints into its parent's, propagating the\n * \"subtree\" flags. A child's segment-local flag (e.g. it has a loading boundary,\n * or it has a runtime prefetch) becomes the corresponding \"subtree\" flag on the\n * parent, so the root segment ends up reflecting the entire subtree.\n *\n * Used wherever a route tree is assembled bottom-up: on the server when building\n * a prefetch tree (createFlightRouterStateFromLoaderTree) and on the client when\n * merging a navigation patch into the existing tree (convertServerPatchToFullTree).\n * Keep these in sync by routing both through this helper.\n */\nexport function propagateSubtreeBits(\n parentHints: number,\n childHints: number\n): number {\n if (childHints & PrefetchHint.SubtreeHasPartialPrefetching) {\n parentHints |= PrefetchHint.SubtreeHasPartialPrefetching\n }\n // A child with a loading boundary (directly, or anywhere in its subtree) makes\n // this a SubtreeHasLoadingBoundary on the parent.\n if (\n childHints &\n (PrefetchHint.SegmentHasLoadingBoundary |\n PrefetchHint.SubtreeHasLoadingBoundary)\n ) {\n parentHints |= PrefetchHint.SubtreeHasLoadingBoundary\n }\n // Likewise for runtime prefetch.\n if (\n childHints &\n (PrefetchHint.HasRuntimePrefetch | PrefetchHint.SubtreeHasRuntimePrefetch)\n ) {\n parentHints |= PrefetchHint.SubtreeHasRuntimePrefetch\n }\n // And for eager prefetch. The bit is set directly on each eager segment, so\n // there's no separate segment-local flag — propagate it as-is.\n if (childHints & PrefetchHint.SubtreeHasEagerPrefetch) {\n parentHints |= PrefetchHint.SubtreeHasEagerPrefetch\n }\n return parentHints\n}\n\n/**\n * Individual Flight response path\n */\nexport type FlightSegmentPath =\n // Uses `any` as repeating pattern can't be typed.\n | any[]\n // Looks somewhat like this\n | [\n segment: Segment,\n parallelRouterKey: string,\n segment: Segment,\n parallelRouterKey: string,\n segment: Segment,\n parallelRouterKey: string,\n ]\n\n/**\n * Represents a tree of segments and the Flight data (i.e. React nodes) that\n * correspond to each one. The tree is isomorphic to the FlightRouterState;\n * however in the future we want to be able to fetch arbitrary partial segments\n * without having to fetch all its children. So this response format will\n * likely change.\n */\nexport type CacheNodeSeedData = [\n node: React.ReactNode | null,\n parallelRoutes: {\n [parallelRouterKey: string]: CacheNodeSeedData | null\n },\n // TODO: This field is no longer used. Remove it.\n loading: null,\n isPartial: boolean,\n /**\n * An AsyncIterable that yields the route params this segment accessed during\n * server rendering (one name per yield, deduped). Used by the client router\n * to determine cache key specificity - segments that only access certain\n * params can be reused across navigations where unaccessed params change.\n *\n * Does NOT include root params; those are emitted once at the top level of\n * the response (see `r` on the payload) and unioned in by the consumer.\n *\n * - null: tracking was not enabled for this render (e.g., not a prerender).\n * Treat conservatively - assume all params vary.\n * - Drains to empty Set: segment accesses no params (e.g., client components,\n * or server components that don't read params). Can be shared across all\n * param values.\n * - Drains to non-empty Set: segment depends on those params. Can only reuse\n * when those specific params match.\n */\n varyParams: VaryParamsIterable | null,\n]\n\nexport type FlightDataSegment = [\n /* segment of the rendered slice: */ Segment,\n /* treePatch */ FlightRouterState,\n /* cacheNodeSeedData */ CacheNodeSeedData | null, // Can be null during prefetch if there's no loading component\n /* head: viewport */ HeadData,\n /* isHeadPartial */ boolean,\n]\n\nexport type FlightDataPath =\n // Uses `any` as repeating pattern can't be typed.\n | any[]\n // Looks somewhat like this\n | [\n // Holds full path to the segment.\n ...FlightSegmentPath[],\n ...FlightDataSegment,\n ]\n\n/**\n * The Flight response data\n */\nexport type FlightData = Array<FlightDataPath> | string\n\n/**\n * Per-route prefetch hints computed at build time. Mirrors the shape of the\n * loader tree so hints can be traversed in parallel during router state\n * creation. Each node stores a bitmask of PrefetchHint flags\n * (ParentInlinedIntoSelf, InlinedIntoChild) computed by the segment size\n * measurement pass.\n *\n * Persisted to prefetch-hints.json as Record<string, PrefetchHints> (keyed\n * by route pattern) and loaded at server startup.\n */\nexport type PrefetchHints = {\n /** Bitmask of PrefetchHint flags for this segment. */\n hints: number\n /** Child hint nodes, keyed by parallel route key. */\n slots: Record<string, PrefetchHints> | null\n}\n\nexport type ActionResult = Promise<any>\n\nexport type InitialRSCPayload = {\n /** buildId, can be empty if the x-nextjs-build-id header is set */\n b?: string\n /** initialCanonicalUrlParts */\n c: string[]\n /** initialRenderedSearch */\n q: string\n /** couldBeIntercepted */\n i: boolean\n /** initialFlightData */\n f: FlightDataPath[]\n /** missingSlots */\n m: Set<string> | undefined\n /** GlobalError */\n G: [React.ComponentType<any>, React.ReactNode | undefined]\n /** supportsPerSegmentPrefetching */\n S: boolean\n /**\n * headVaryParams - vary params for the head (metadata) of the response.\n * Does not include root params (see `r`).\n */\n h: VaryParamsIterable | null\n /**\n * rootVaryParams - the root params accessed anywhere in the response, emitted\n * once. The client unions these into the head and every segment's vary\n * params, rather than the server folding them into each set.\n */\n r?: VaryParamsIterable\n /** staleTime in seconds - Only present when Cache Components is enabled. */\n s?: AsyncIterable<number>\n /** staticStageByteLength - Resolves when the static stage ends. */\n l?: Promise<number>\n /**\n * shellByteLength - Resolves when the shell stage ends.\n * If it resolves to null, then the shell is the same as the main response.\n * */\n a?: Promise<number | null>\n /** runtimePrefetchStream — Embedded runtime prefetch Flight stream. */\n p?: ReadableStream<Uint8Array>\n /**\n * dynamicStaleTime — Per-page BFCache stale time in seconds, from\n * `unstable_dynamicStaleTime`. Only included for dynamic renders. Controls\n * how long the client router cache retains dynamic navigation data. This is\n * distinct from the `s` field, which controls segment cache (prefetch)\n * staleness.\n */\n d?: number\n /**\n * revealAfter (dev only). Resolves once the server has flushed the\n * shell-stage content to the stream (static shell, or runtime-prefetchable\n * shell for runtime-prefetch routes), or earlier on a cache miss. The client\n * decodes this from the payload and defers resolving the response's deferred\n * RSCs on it, so a boundary's children aren't revealed before their row has\n * been decoded (which would flush a premature Suspense fallback). Its\n * resolution row follows the children's row in the payload, so the children\n * are decoded by the time the client unblocks. The HTML render gates on the\n * same signal server-side instead of reading this field.\n */\n _revealAfter?: Promise<void>\n}\n\n// Response from `createFromFetch` for normal rendering\nexport type NavigationFlightResponse = {\n /** buildId, can be empty if the x-nextjs-build-id header is set */\n b?: string\n /** flightData */\n f: FlightData\n /** supportsPerSegmentPrefetching */\n S: boolean\n /** renderedSearch */\n q: string\n /** couldBeIntercepted */\n i: boolean\n /** staleTime - Only present in dynamic runtime prefetch responses. */\n s?: AsyncIterable<number>\n /** staticStageByteLength - Resolves when the static stage ends. */\n l?: Promise<number>\n /**\n * shellByteLength - Resolves when the shell stage ends.\n * If it resolves to null, then the shell is the same as the main response.\n * */\n a?: Promise<number | null>\n /**\n * shellUsedSessionData - true if resolving session data\n * unblocked new content in the shell.\n * NOTE: only use this in runtime/session prefetch requests\n * where we have a proper session shell.\n * */\n u?: Promise<boolean>\n /** headVaryParams. Does not include root params (see `r`). */\n h: VaryParamsIterable | null\n /**\n * rootVaryParams - the root params accessed anywhere in the response, emitted\n * once. The client unions these into the head and every segment's vary\n * params.\n */\n r?: VaryParamsIterable\n /** runtimePrefetchStream — Embedded runtime prefetch Flight stream. */\n p?: ReadableStream<Uint8Array>\n /**\n * dynamicStaleTime — Per-page BFCache stale time in seconds, from\n * `unstable_dynamicStaleTime`. Only included for dynamic renders. Controls\n * how long the client router cache retains dynamic navigation data. This is\n * distinct from the `s` field, which controls segment cache (prefetch)\n * staleness.\n */\n d?: number\n /**\n * revealAfter (dev only). Resolves once the server has flushed the\n * shell-stage content to the stream (static shell, or runtime-prefetchable\n * shell for runtime-prefetch routes), or earlier on a cache miss. The client\n * decodes this from the payload and defers resolving the response's deferred\n * RSCs on it, so a boundary's children aren't revealed before their row has\n * been decoded (which would flush a premature Suspense fallback). Its\n * resolution row follows the children's row in the payload, so the children\n * are decoded by the time the client unblocks. The HTML render gates on the\n * same signal server-side instead of reading this field.\n */\n _revealAfter?: Promise<void>\n}\n\n// Response from `createFromFetch` for server actions. Action's flight data can be null\nexport type ActionFlightResponse = {\n /** actionResult */\n a: ActionResult\n /** buildId, can be empty if the x-nextjs-build-id header is set */\n b?: string\n /** flightData */\n f: FlightData\n /** renderedSearch */\n q: string\n /** couldBeIntercepted */\n i: boolean\n}\n\nexport type RSCPayload =\n | InitialRSCPayload\n | NavigationFlightResponse\n | ActionFlightResponse\n\nexport type InstantCookie =\n // pending (waiting to capture)\n | [captured: 0, id: string]\n // captured MPA page load\n | [captured: 1, id: string, state: null]\n // captured SPA navigation (from/to route trees)\n | [\n captured: 1,\n id: string,\n state: { from: FlightRouterState; to: FlightRouterState | null },\n ]\n"],"names":["PrefetchHint","StaticPrefetchDisabled","SubtreePrefetchHints","propagateSubtreeBits","parentHints","childHints"],"mappings":"AAAA;;;;;CAKC;;;;;;;;;;;;;;;;;IAiLiBA,YAAY;eAAZA;;IA6DLC,sBAAsB;eAAtBA;;IASAC,oBAAoB;eAApBA;;IAiBGC,oBAAoB;eAApBA;;;AAvFT,IAAA,AAAWH,sCAAAA;IAChB,gEAAgE;IAChE,2EAA2E;;IAE3E,wEAAwE;IACxE,+DAA+D;IAC/D,0EAA0E;IAC1E,mDAAmD;;IAEnD,kDAAkD;;IAElD,sEAAsE;IACtE,6DAA6D;;IAE7D,8EAA8E;IAC9E,2EAA2E;IAC3E,8BAA8B;;IAE9B,sEAAsE;IACtE,0DAA0D;;IAE1D,wEAAwE;IACxE,yEAAyE;;IAEzE,4EAA4E;IAC5E,6CAA6C;;IAE7C,wEAAwE;IACxE,4EAA4E;;IAE5E,oEAAoE;IACpE,0EAA0E;IAC1E,0EAA0E;IAC1E,kEAAkE;IAClE,0EAA0E;IAC1E,oBAAoB;;IAEpB,sDAAsD;IACtD,qDAAqD;;IAErD,sEAAsE;IACtE,mEAAmE;IACnE,kBAAkB;;IAElB,yEAAyE;IACzE,kEAAkE;IAClE,yEAAyE;IACzE,4EAA4E;IAC5E,wCAAwC;;WAhDxBA;;AA6DX,MAAMC,yBACXD;AAQK,MAAME,uBACXF;AAgBK,SAASG,qBACdC,WAAmB,EACnBC,UAAkB;IAElB,IAAIA,gBAAwD;QAC1DD;IACF;IACA,+EAA+E;IAC/E,kDAAkD;IAClD,IACEC,aACCL,CAAAA,KACsC,GACvC;QACAI;IACF;IACA,iCAAiC;IACjC,IACEC,aACCL,CAAAA,QAAuE,GACxE;QACAI;IACF;IACA,4EAA4E;IAC5E,+DAA+D;IAC/D,IAAIC,mBAAmD;QACrDD;IACF;IACA,OAAOA;AACT","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/shared/lib/app-router-types.ts"],"sourcesContent":["/**\n * App Router types - Client-safe types for the Next.js App Router\n *\n * This file contains type definitions that can be safely imported\n * by both client-side and server-side code without circular dependencies.\n */\n\nimport type React from 'react'\n\nexport type LoadingModuleData =\n | [React.JSX.Element, React.ReactNode, React.ReactNode]\n | null\n\nimport type { VaryParamsIterable } from './segment-cache/vary-params-decoding'\n\n/** viewport metadata node */\nexport type HeadData = React.ReactNode\n\n/**\n * Cache node used in app-router / layout-router.\n */\n\nexport type CacheNode = {\n /**\n * When rsc is not null, it represents the RSC data for the\n * corresponding segment.\n *\n * `null` is a valid React Node but because segment data is always a\n * <LayoutRouter> component, we can use `null` to represent empty. When it is\n * null, it represents missing data, and rendering should suspend.\n */\n rsc: React.ReactNode\n\n /**\n * Represents a static version of the segment that can be shown immediately,\n * and may or may not contain dynamic holes. It's prefetched before a\n * navigation occurs.\n *\n * During rendering, we will choose whether to render `rsc` or `prefetchRsc`\n * with `useDeferredValue`. As with the `rsc` field, a value of `null` means\n * no value was provided. In this case, the LayoutRouter will go straight to\n * rendering the `rsc` value; if that one is also missing, it will suspend and\n * trigger a lazy fetch.\n */\n prefetchRsc: React.ReactNode\n\n prefetchHead: HeadData | null\n\n head: HeadData\n\n slots: Record<string, CacheNode> | null\n\n /**\n * A shared mutable ref that tracks whether this segment should be scrolled\n * to. All new segments created during a single navigation share the same\n * ref. When any segment's scroll handler fires, it sets `current` to\n * `false` so no other segment scrolls for the same navigation.\n *\n * `null` means this segment is not a scroll target (e.g., a reused shared\n * layout segment).\n */\n scrollRef: ScrollRef | null\n\n /**\n * Globally-unique identifier minted from a monotonic counter when the\n * CacheNode is freshly created. Surfaced to user code as a string via\n * `useRouter().bfcacheId` and intended to be used as a React `key` to\n * opt out of Activity-based state preservation on fresh navigations.\n *\n * Preserved when the CacheNode is reused (shared layouts, refresh,\n * search/hash-only navigations) or restored from the BFCache during a\n * back/forward navigation.\n */\n bfcacheId: number\n}\n\n/**\n * A mutable ref shared across all new segments created during a single\n * navigation. Used to ensure that only one segment scrolls per navigation.\n */\nexport type ScrollRef = { current: boolean }\n\nexport type DynamicParamTypes =\n | 'catchall'\n | 'catchall-intercepted-(..)(..)'\n | 'catchall-intercepted-(.)'\n | 'catchall-intercepted-(..)'\n | 'catchall-intercepted-(...)'\n | 'optional-catchall'\n | 'dynamic'\n | 'dynamic-intercepted-(..)(..)'\n | 'dynamic-intercepted-(.)'\n | 'dynamic-intercepted-(..)'\n | 'dynamic-intercepted-(...)'\n\nexport type DynamicParamTypesShort =\n | 'c'\n | 'ci(..)(..)'\n | 'ci(.)'\n | 'ci(..)'\n | 'ci(...)'\n | 'oc'\n | 'd'\n | 'di(..)(..)'\n | 'di(.)'\n | 'di(..)'\n | 'di(...)'\n\n// The tuple form of a segment, used for dynamic route params\nexport type DynamicSegmentTuple = [\n // Param name\n paramName: string,\n // Param cache key (almost the same as the value, but arrays are\n // concatenated into strings)\n // TODO: We should change this to just be the value. Currently we convert\n // it back to a value when passing to useParams. It only needs to be\n // a string when converted to a a cache key, but that doesn't mean we\n // need to store it as that representation.\n paramCacheKey: string,\n // Dynamic param type\n dynamicParamType: DynamicParamTypesShort,\n // Static sibling segments at the same URL level. Used by the client\n // router to determine if a prefetch can be reused when navigating to\n // a static sibling of a dynamic route. For example, if the route is\n // /products/[id] and there's also /products/sale, then staticSiblings\n // would be ['sale']. null means the siblings are unknown (e.g. in\n // webpack dev mode).\n staticSiblings: readonly string[] | null,\n]\n\nexport type Segment = string | DynamicSegmentTuple\n\n/**\n * Router state\n */\nexport type FlightRouterState = [\n segment: Segment,\n parallelRoutes: { [parallelRouterKey: string]: FlightRouterState },\n refreshState?: CompressedRefreshState | null,\n /**\n * - \"refetch\" is used during a request to inform the server where rendering\n * should start from.\n *\n * - \"inside-shared-layout\" is used during a prefetch request to inform the\n * server that even if the segment matches, it should be treated as if it's\n * within the \"new\" part of a navigation — inside the shared layout. If\n * the segment doesn't match, then it has no effect, since it would be\n * treated as new regardless. If it does match, though, the server does not\n * need to render it, because the client already has it.\n *\n * - \"metadata-only\" instructs the server to skip rendering the segments and\n * only send the head data.\n *\n * A bit confusing, but that's because it has only one extremely narrow use\n * case — during a non-PPR prefetch, the server uses it to find the first\n * loading boundary beneath a shared layout.\n *\n * TODO: We should rethink the protocol for dynamic requests. It might not\n * make sense for the client to send a FlightRouterState, since this type is\n * overloaded with concerns.\n */\n refresh?: 'refetch' | 'inside-shared-layout' | 'metadata-only' | null,\n /**\n * Bitmask of PrefetchHint flags. Encodes route structure metadata:\n * root layout, loading boundaries, instant configs, and runtime prefetch\n * hints. Only set when non-zero.\n */\n prefetchHints?: number,\n]\n\n/**\n * When rendering a parallel route, some of the parallel paths may not match\n * the current URL. In that case, the Next client has to render something,\n * so it will render whichever was the last route to match that slot. We use\n * this type to track when this has happened. It's a tuple of the original\n * URL that was used to fetch the segment, and the (possibly rewritten) search\n * query that was rendered by the server. The URL is needed when performing\n * a refresh of the segment, and the search query is needed for looking up\n * matching entries in the segment cache.\n */\nexport type CompressedRefreshState = [url: string, renderedSearch: string]\n\nexport const enum PrefetchHint {\n // This segment has a runtime prefetch enabled (via instant with\n // prefetch: 'runtime'). Per-segment only, does not propagate to ancestors.\n HasRuntimePrefetch = 0b00001,\n // This segment or one of its descendants opts into Partial Prefetching.\n // Currently set when a truthy instant config is present on any\n // segment in the subtree (regardless of prefetch mode). Propagates upward\n // so the root segment reflects the entire subtree.\n SubtreeHasPartialPrefetching = 0b00010,\n // This segment itself has a loading.tsx boundary.\n SegmentHasLoadingBoundary = 0b00100,\n // A descendant segment (but not this one) has a loading.tsx boundary.\n // Propagates upward so the root reflects the entire subtree.\n SubtreeHasLoadingBoundary = 0b01000,\n // This segment is at or above the application's root layout — the root layout\n // segment itself and all of its ancestors. A dynamic param in one of these\n // segments is a \"root param\".\n IsRootLayoutOrAbove = 0b10000,\n // This segment's response includes its parent's data inlined into it.\n // Set at build time by the segment size measurement pass.\n ParentInlinedIntoSelf = 0b100000,\n // This segment's data is inlined into one of its children — don't fetch\n // it separately. Set at build time by the segment size measurement pass.\n InlinedIntoChild = 0b1000000,\n // On a __PAGE__: this page's response includes the head (metadata/viewport)\n // at the end of its SegmentPrefetch[] array.\n HeadInlinedIntoSelf = 0b10000000,\n // On the root hint node: the head was NOT inlined into any page — fetch\n // it separately. Absence of this bit means the head is bundled into a page.\n HeadOutlined = 0b100000000,\n // The inlining hints in this tree may be stale because the tree was\n // generated before collectPrefetchHints ran (e.g. the initial RSC payload\n // for a fully static page at build time). When writing this tree into the\n // cache, the route entry should be immediately expired so it gets\n // re-fetched with correct hints. Only set during build-time prerendering,\n // never at runtime.\n InliningHintsStale = 0b1000000000,\n // This segment has instant = false, opting out of all\n // prefetching entirely (neither static nor runtime).\n PrefetchDisabled = 0b10000000000,\n // This segment or one of its descendants has runtime prefetch enabled\n // (HasRuntimePrefetch). Propagates upward so the root reflects the\n // entire subtree.\n SubtreeHasRuntimePrefetch = 0b100000000000,\n // This segment or one of its descendants prefetches \"eagerly\" — i.e. its\n // effective prefetch strategy is anything other than 'partial' or\n // 'allow-runtime'. Used by App Shells: a non-eager subtree relies on the\n // shared app shell and skips its Speculative prefetch. Propagates upward so\n // the root reflects the entire subtree.\n SubtreeHasEagerPrefetch = 0b1000000000000,\n // This segment or one of its descendants exports `instant = false`,\n // explicitly opting out of Partial Prefetching. Propagates upward so the root\n // reflects the entire subtree. Used only to suppress the dev-time\n // `<Link prefetch={true}>` warning — unlike PrefetchDisabled, it has no effect\n // on the actual prefetch behavior.\n SubtreeHasInstantFalse = 0b10000000000000,\n}\n\n/**\n * Bitmask for checking whether a segment's static prefetch is skipped. Matches\n * if EITHER bit is set — i.e. the segment uses runtime prefetching\n * (HasRuntimePrefetch) OR prefetching is disabled entirely (PrefetchDisabled,\n * e.g. instant = false). The segment participates in the bundle chain\n * but with null data.\n *\n * Usage: `(hints & StaticPrefetchDisabled) !== 0`\n */\nexport const StaticPrefetchDisabled =\n PrefetchHint.HasRuntimePrefetch | PrefetchHint.PrefetchDisabled\n\n/**\n * The subset of PrefetchHint bits that propagate upward from a child segment to\n * its ancestors (as opposed to segment-local bits like SegmentHasLoadingBoundary\n * or IsRootLayoutOrAbove). Used to clear stale propagated bits before re-deriving them\n * from a node's children.\n */\nexport const SubtreePrefetchHints =\n PrefetchHint.SubtreeHasPartialPrefetching |\n PrefetchHint.SubtreeHasLoadingBoundary |\n PrefetchHint.SubtreeHasRuntimePrefetch |\n PrefetchHint.SubtreeHasInstantFalse |\n PrefetchHint.SubtreeHasEagerPrefetch\n\n/**\n * Folds a child segment's prefetch hints into its parent's, propagating the\n * \"subtree\" flags. A child's segment-local flag (e.g. it has a loading boundary,\n * or it has a runtime prefetch) becomes the corresponding \"subtree\" flag on the\n * parent, so the root segment ends up reflecting the entire subtree.\n *\n * Used wherever a route tree is assembled bottom-up: on the server when building\n * a prefetch tree (createFlightRouterStateFromLoaderTree) and on the client when\n * merging a navigation patch into the existing tree (convertServerPatchToFullTree).\n * Keep these in sync by routing both through this helper.\n */\nexport function propagateSubtreeBits(\n parentHints: number,\n childHints: number\n): number {\n if (childHints & PrefetchHint.SubtreeHasPartialPrefetching) {\n parentHints |= PrefetchHint.SubtreeHasPartialPrefetching\n }\n // A child with a loading boundary (directly, or anywhere in its subtree) makes\n // this a SubtreeHasLoadingBoundary on the parent.\n if (\n childHints &\n (PrefetchHint.SegmentHasLoadingBoundary |\n PrefetchHint.SubtreeHasLoadingBoundary)\n ) {\n parentHints |= PrefetchHint.SubtreeHasLoadingBoundary\n }\n // Likewise for runtime prefetch.\n if (\n childHints &\n (PrefetchHint.HasRuntimePrefetch | PrefetchHint.SubtreeHasRuntimePrefetch)\n ) {\n parentHints |= PrefetchHint.SubtreeHasRuntimePrefetch\n }\n // And for eager prefetch. The bit is set directly on each eager segment, so\n // there's no separate segment-local flag — propagate it as-is.\n if (childHints & PrefetchHint.SubtreeHasEagerPrefetch) {\n parentHints |= PrefetchHint.SubtreeHasEagerPrefetch\n }\n // And for `instant = false`. Like eager prefetch, the bit is set directly on\n // each opted-out segment, so propagate it as-is.\n if (childHints & PrefetchHint.SubtreeHasInstantFalse) {\n parentHints |= PrefetchHint.SubtreeHasInstantFalse\n }\n return parentHints\n}\n\n/**\n * Individual Flight response path\n */\nexport type FlightSegmentPath =\n // Uses `any` as repeating pattern can't be typed.\n | any[]\n // Looks somewhat like this\n | [\n segment: Segment,\n parallelRouterKey: string,\n segment: Segment,\n parallelRouterKey: string,\n segment: Segment,\n parallelRouterKey: string,\n ]\n\n/**\n * Represents a tree of segments and the Flight data (i.e. React nodes) that\n * correspond to each one. The tree is isomorphic to the FlightRouterState;\n * however in the future we want to be able to fetch arbitrary partial segments\n * without having to fetch all its children. So this response format will\n * likely change.\n */\nexport type CacheNodeSeedData = [\n node: React.ReactNode | null,\n parallelRoutes: {\n [parallelRouterKey: string]: CacheNodeSeedData | null\n },\n // TODO: This field is no longer used. Remove it.\n loading: null,\n isPartial: boolean,\n /**\n * An AsyncIterable that yields the route params this segment accessed during\n * server rendering (one name per yield, deduped). Used by the client router\n * to determine cache key specificity - segments that only access certain\n * params can be reused across navigations where unaccessed params change.\n *\n * Does NOT include root params; those are emitted once at the top level of\n * the response (see `r` on the payload) and unioned in by the consumer.\n *\n * - null: tracking was not enabled for this render (e.g., not a prerender).\n * Treat conservatively - assume all params vary.\n * - Drains to empty Set: segment accesses no params (e.g., client components,\n * or server components that don't read params). Can be shared across all\n * param values.\n * - Drains to non-empty Set: segment depends on those params. Can only reuse\n * when those specific params match.\n */\n varyParams: VaryParamsIterable | null,\n]\n\nexport type FlightDataSegment = [\n /* segment of the rendered slice: */ Segment,\n /* treePatch */ FlightRouterState,\n /* cacheNodeSeedData */ CacheNodeSeedData | null, // Can be null during prefetch if there's no loading component\n /* head: viewport */ HeadData,\n /* isHeadPartial */ boolean,\n]\n\nexport type FlightDataPath =\n // Uses `any` as repeating pattern can't be typed.\n | any[]\n // Looks somewhat like this\n | [\n // Holds full path to the segment.\n ...FlightSegmentPath[],\n ...FlightDataSegment,\n ]\n\n/**\n * The Flight response data\n */\nexport type FlightData = Array<FlightDataPath> | string\n\n/**\n * Per-route prefetch hints computed at build time. Mirrors the shape of the\n * loader tree so hints can be traversed in parallel during router state\n * creation. Each node stores a bitmask of PrefetchHint flags\n * (ParentInlinedIntoSelf, InlinedIntoChild) computed by the segment size\n * measurement pass.\n *\n * Persisted to prefetch-hints.json as Record<string, PrefetchHints> (keyed\n * by route pattern) and loaded at server startup.\n */\nexport type PrefetchHints = {\n /** Bitmask of PrefetchHint flags for this segment. */\n hints: number\n /** Child hint nodes, keyed by parallel route key. */\n slots: Record<string, PrefetchHints> | null\n}\n\nexport type ActionResult = Promise<any>\n\nexport type InitialRSCPayload = {\n /** buildId, can be empty if the x-nextjs-build-id header is set */\n b?: string\n /** initialCanonicalUrlParts */\n c: string[]\n /** initialRenderedSearch */\n q: string\n /** couldBeIntercepted */\n i: boolean\n /** initialFlightData */\n f: FlightDataPath[]\n /** missingSlots */\n m: Set<string> | undefined\n /** GlobalError */\n G: [React.ComponentType<any>, React.ReactNode | undefined]\n /** supportsPerSegmentPrefetching */\n S: boolean\n /**\n * headVaryParams - vary params for the head (metadata) of the response.\n * Does not include root params (see `r`).\n */\n h: VaryParamsIterable | null\n /**\n * rootVaryParams - the root params accessed anywhere in the response, emitted\n * once. The client unions these into the head and every segment's vary\n * params, rather than the server folding them into each set.\n */\n r?: VaryParamsIterable\n /** staleTime in seconds - Only present when Cache Components is enabled. */\n s?: AsyncIterable<number>\n /** staticStageByteLength - Resolves when the static stage ends. */\n l?: Promise<number>\n /**\n * shellByteLength - Resolves when the shell stage ends.\n * If it resolves to null, then the shell is the same as the main response.\n * */\n a?: Promise<number | null>\n /** runtimePrefetchStream — Embedded runtime prefetch Flight stream. */\n p?: ReadableStream<Uint8Array>\n /**\n * dynamicStaleTime — Per-page BFCache stale time in seconds, from\n * `unstable_dynamicStaleTime`. Only included for dynamic renders. Controls\n * how long the client router cache retains dynamic navigation data. This is\n * distinct from the `s` field, which controls segment cache (prefetch)\n * staleness.\n */\n d?: number\n /**\n * revealAfter (dev only). Resolves once the server has flushed the\n * shell-stage content to the stream (static shell, or runtime-prefetchable\n * shell for runtime-prefetch routes), or earlier on a cache miss. The client\n * decodes this from the payload and defers resolving the response's deferred\n * RSCs on it, so a boundary's children aren't revealed before their row has\n * been decoded (which would flush a premature Suspense fallback). Its\n * resolution row follows the children's row in the payload, so the children\n * are decoded by the time the client unblocks. The HTML render gates on the\n * same signal server-side instead of reading this field.\n */\n _revealAfter?: Promise<void>\n}\n\n// Response from `createFromFetch` for normal rendering\nexport type NavigationFlightResponse = {\n /** buildId, can be empty if the x-nextjs-build-id header is set */\n b?: string\n /** flightData */\n f: FlightData\n /** supportsPerSegmentPrefetching */\n S: boolean\n /** renderedSearch */\n q: string\n /** couldBeIntercepted */\n i: boolean\n /** staleTime - Only present in dynamic runtime prefetch responses. */\n s?: AsyncIterable<number>\n /** staticStageByteLength - Resolves when the static stage ends. */\n l?: Promise<number>\n /**\n * shellByteLength - Resolves when the shell stage ends.\n * If it resolves to null, then the shell is the same as the main response.\n * */\n a?: Promise<number | null>\n /**\n * shellUsedSessionData - true if resolving session data\n * unblocked new content in the shell.\n * NOTE: only use this in runtime/session prefetch requests\n * where we have a proper session shell.\n * */\n u?: Promise<boolean>\n /** headVaryParams. Does not include root params (see `r`). */\n h: VaryParamsIterable | null\n /**\n * rootVaryParams - the root params accessed anywhere in the response, emitted\n * once. The client unions these into the head and every segment's vary\n * params.\n */\n r?: VaryParamsIterable\n /** runtimePrefetchStream — Embedded runtime prefetch Flight stream. */\n p?: ReadableStream<Uint8Array>\n /**\n * dynamicStaleTime — Per-page BFCache stale time in seconds, from\n * `unstable_dynamicStaleTime`. Only included for dynamic renders. Controls\n * how long the client router cache retains dynamic navigation data. This is\n * distinct from the `s` field, which controls segment cache (prefetch)\n * staleness.\n */\n d?: number\n /**\n * revealAfter (dev only). Resolves once the server has flushed the\n * shell-stage content to the stream (static shell, or runtime-prefetchable\n * shell for runtime-prefetch routes), or earlier on a cache miss. The client\n * decodes this from the payload and defers resolving the response's deferred\n * RSCs on it, so a boundary's children aren't revealed before their row has\n * been decoded (which would flush a premature Suspense fallback). Its\n * resolution row follows the children's row in the payload, so the children\n * are decoded by the time the client unblocks. The HTML render gates on the\n * same signal server-side instead of reading this field.\n */\n _revealAfter?: Promise<void>\n}\n\n// Response from `createFromFetch` for server actions. Action's flight data can be null\nexport type ActionFlightResponse = {\n /** actionResult */\n a: ActionResult\n /** buildId, can be empty if the x-nextjs-build-id header is set */\n b?: string\n /** flightData */\n f: FlightData\n /** renderedSearch */\n q: string\n /** couldBeIntercepted */\n i: boolean\n}\n\nexport type RSCPayload =\n | InitialRSCPayload\n | NavigationFlightResponse\n | ActionFlightResponse\n\nexport type InstantCookie =\n // pending (waiting to capture)\n | [captured: 0, id: string]\n // captured MPA page load\n | [captured: 1, id: string, state: null]\n // captured SPA navigation (from/to route trees)\n | [\n captured: 1,\n id: string,\n state: { from: FlightRouterState; to: FlightRouterState | null },\n ]\n"],"names":["PrefetchHint","StaticPrefetchDisabled","SubtreePrefetchHints","propagateSubtreeBits","parentHints","childHints"],"mappings":"AAAA;;;;;CAKC;;;;;;;;;;;;;;;;;IAiLiBA,YAAY;eAAZA;;IAmELC,sBAAsB;eAAtBA;;IASAC,oBAAoB;eAApBA;;IAkBGC,oBAAoB;eAApBA;;;AA9FT,IAAA,AAAWH,sCAAAA;IAChB,gEAAgE;IAChE,2EAA2E;;IAE3E,wEAAwE;IACxE,+DAA+D;IAC/D,0EAA0E;IAC1E,mDAAmD;;IAEnD,kDAAkD;;IAElD,sEAAsE;IACtE,6DAA6D;;IAE7D,8EAA8E;IAC9E,2EAA2E;IAC3E,8BAA8B;;IAE9B,sEAAsE;IACtE,0DAA0D;;IAE1D,wEAAwE;IACxE,yEAAyE;;IAEzE,4EAA4E;IAC5E,6CAA6C;;IAE7C,wEAAwE;IACxE,4EAA4E;;IAE5E,oEAAoE;IACpE,0EAA0E;IAC1E,0EAA0E;IAC1E,kEAAkE;IAClE,0EAA0E;IAC1E,oBAAoB;;IAEpB,sDAAsD;IACtD,qDAAqD;;IAErD,sEAAsE;IACtE,mEAAmE;IACnE,kBAAkB;;IAElB,yEAAyE;IACzE,kEAAkE;IAClE,yEAAyE;IACzE,4EAA4E;IAC5E,wCAAwC;;IAExC,oEAAoE;IACpE,8EAA8E;IAC9E,kEAAkE;IAClE,+EAA+E;IAC/E,mCAAmC;;WAtDnBA;;AAmEX,MAAMC,yBACXD;AAQK,MAAME,uBACXF;AAiBK,SAASG,qBACdC,WAAmB,EACnBC,UAAkB;IAElB,IAAIA,gBAAwD;QAC1DD;IACF;IACA,+EAA+E;IAC/E,kDAAkD;IAClD,IACEC,aACCL,CAAAA,KACsC,GACvC;QACAI;IACF;IACA,iCAAiC;IACjC,IACEC,aACCL,CAAAA,QAAuE,GACxE;QACAI;IACF;IACA,4EAA4E;IAC5E,+DAA+D;IAC/D,IAAIC,mBAAmD;QACrDD;IACF;IACA,6EAA6E;IAC7E,iDAAiD;IACjD,IAAIC,mBAAkD;QACpDD;IACF;IACA,OAAOA;AACT","ignoreList":[0]} |
@@ -24,3 +24,3 @@ "use strict"; | ||
| function isStableBuild() { | ||
| return !"16.3.0-preview.4"?.includes('canary') && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV; | ||
| return !"16.3.0-preview.5"?.includes('canary') && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV; | ||
| } | ||
@@ -27,0 +27,0 @@ class CanaryOnlyConfigError extends Error { |
@@ -84,3 +84,3 @@ "use strict"; | ||
| ciName: _ciinfo.isCI && _ciinfo.name || null, | ||
| nextVersion: "16.3.0-preview.4" | ||
| nextVersion: "16.3.0-preview.5" | ||
| }; | ||
@@ -87,0 +87,0 @@ return traits; |
@@ -14,7 +14,7 @@ "use strict"; | ||
| // This should be an invariant, if it fails our build tooling is broken. | ||
| if (typeof "16.3.0-preview.4" !== 'string') { | ||
| if (typeof "16.3.0-preview.5" !== 'string') { | ||
| return []; | ||
| } | ||
| const payload = { | ||
| nextVersion: "16.3.0-preview.4", | ||
| nextVersion: "16.3.0-preview.5", | ||
| nodeVersion: process.version, | ||
@@ -21,0 +21,0 @@ cliCommand: event.cliCommand, |
@@ -41,3 +41,3 @@ "use strict"; | ||
| payload: { | ||
| nextVersion: "16.3.0-preview.4", | ||
| nextVersion: "16.3.0-preview.5", | ||
| glibcVersion, | ||
@@ -44,0 +44,0 @@ installedSwcPackages, |
@@ -15,3 +15,3 @@ "use strict"; | ||
| // This should be an invariant, if it fails our build tooling is broken. | ||
| if (typeof "16.3.0-preview.4" !== 'string') { | ||
| if (typeof "16.3.0-preview.5" !== 'string') { | ||
| return []; | ||
@@ -21,3 +21,3 @@ } | ||
| const payload = { | ||
| nextVersion: "16.3.0-preview.4", | ||
| nextVersion: "16.3.0-preview.5", | ||
| nodeVersion: process.version, | ||
@@ -24,0 +24,0 @@ cliCommand: event.cliCommand, |
+10
-10
| { | ||
| "name": "next", | ||
| "version": "16.3.0-preview.4", | ||
| "version": "16.3.0-preview.5", | ||
| "description": "The React Framework", | ||
@@ -84,3 +84,3 @@ "main": "./dist/server/next.js", | ||
| "dependencies": { | ||
| "@next/env": "16.3.0-preview.4", | ||
| "@next/env": "16.3.0-preview.5", | ||
| "@swc/helpers": "0.5.15", | ||
@@ -116,10 +116,10 @@ "baseline-browser-mapping": "^2.9.19", | ||
| "sharp": "^0.34.5", | ||
| "@next/swc-darwin-arm64": "16.3.0-preview.4", | ||
| "@next/swc-darwin-x64": "16.3.0-preview.4", | ||
| "@next/swc-linux-arm64-gnu": "16.3.0-preview.4", | ||
| "@next/swc-linux-arm64-musl": "16.3.0-preview.4", | ||
| "@next/swc-linux-x64-gnu": "16.3.0-preview.4", | ||
| "@next/swc-linux-x64-musl": "16.3.0-preview.4", | ||
| "@next/swc-win32-arm64-msvc": "16.3.0-preview.4", | ||
| "@next/swc-win32-x64-msvc": "16.3.0-preview.4" | ||
| "@next/swc-darwin-arm64": "16.3.0-preview.5", | ||
| "@next/swc-darwin-x64": "16.3.0-preview.5", | ||
| "@next/swc-linux-arm64-gnu": "16.3.0-preview.5", | ||
| "@next/swc-linux-arm64-musl": "16.3.0-preview.5", | ||
| "@next/swc-linux-x64-gnu": "16.3.0-preview.5", | ||
| "@next/swc-linux-x64-musl": "16.3.0-preview.5", | ||
| "@next/swc-win32-arm64-msvc": "16.3.0-preview.5", | ||
| "@next/swc-win32-x64-msvc": "16.3.0-preview.5" | ||
| }, | ||
@@ -126,0 +126,0 @@ "keywords": [ |
| self.__BUILD_MANIFEST = { | ||
| "__rewrites": { | ||
| "afterFiles": [], | ||
| "beforeFiles": [], | ||
| "fallback": [] | ||
| }, | ||
| "sortedPages": [ | ||
| "/_app", | ||
| "/_error" | ||
| ] | ||
| };self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB() |
| self.__MIDDLEWARE_MATCHERS = [];self.__MIDDLEWARE_MATCHERS_CB && self.__MIDDLEWARE_MATCHERS_CB() |
| self.__SSG_MANIFEST=new Set([]);self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB() |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Potential vulnerability
Supply chain riskInitial human review suggests the presence of a vulnerability in this package. It is pending further analysis and confirmation.
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 6 instances
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Potential vulnerability
Supply chain riskInitial human review suggests the presence of a vulnerability in this package. It is pending further analysis and confirmation.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 6 instances
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
169452525
0.22%1277375
0.09%4389
1.41%590
0.34%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated