| 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() |
@@ -81,3 +81,3 @@ "use strict"; | ||
| 'process.env.__NEXT_APP_NAV_FAIL_HANDLING': Boolean(config.experimental.appNavFailHandling), | ||
| 'process.env.__NEXT_TURBOPACK_SHARED_RUNTIME': config.experimental.turbopackSharedRuntime !== false, | ||
| 'process.env.__NEXT_TURBOPACK_SHARED_RUNTIME': Boolean(config.experimental.turbopackSharedRuntime), | ||
| 'process.env.__NEXT_CACHE_COMPONENTS': isCacheComponentsEnabled, | ||
@@ -84,0 +84,0 @@ 'process.env.__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS': Boolean(config.experimental.cachedNavigations), |
@@ -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 {\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 | NextConfigComplete['cacheLife']\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 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_TURBOPACK_SHARED_RUNTIME':\n config.experimental.turbopackSharedRuntime !== false,\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_REQUEST_INSIGHTS':\n dev && !!config.experimental.requestInsights,\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.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_SERVER_COMPONENTS_HMR_CANCELLATION': Boolean(\n config.experimental.serverComponentsHmrCancellation\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_VARY_PARAMS': config.experimental.varyParams ?? false,\n 'process.env.__NEXT_EXPOSE_TESTING_API':\n isCacheComponentsEnabled &&\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","isCacheComponentsEnabled","cacheComponents","isUseCacheEnabled","experimental","useCache","__NEXT_DEFINE_ENV","EdgeRuntime","process","env","NEXT_EDGE_RUNTIME_PROVIDER","NEXT_RSPACK","allowDevelopmentBuild","NEXT_PRIVATE_DISABLE_DEV_OVERLAY_UX","Boolean","appNavFailHandling","turbopackSharedRuntime","cachedNavigations","coldCacheBadge","requestInsights","supportsImmutableAssets","useSkewCookie","deploymentId","runtimeServerDeploymentId","__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING","manualClientBasePath","isNaN","Number","staleTimes","dynamic","static","clientRouterFilter","staticFilter","dynamicFilter","validateRSCRequestHeaders","serverComponentsHmrCancellation","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","varyParams","exposeTestingApiInProductionBuild","cacheLife","clientParamParsingOrigins","userDefines","compiler","define","hasOwnProperty","Error","userDefinesServer","defineServer","serializedDefineEnv","safeKey","split","pop"],"mappings":";;;;+BAwGgBA;;;eAAAA;;;iEAjGC;wCACsB;2BAIhC;;;;;;AA8BP,MAAMC,wBAAwBC,OAAO;AAqBrC;;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,CAAC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SAAS,CAACM,IAAI,GAAGyH,iBAAiB,CAACzH,IAAI;QACzC;IACF;IAEA,MAAM2H,sBAAsBlI,mBAAmBC;IAE/C,uDAAuD;IACvD,oDAAoD;IACpD,+BAA+B;IAC/B,IAAI,CAACY,OAAOuB,sBAAsB;QAChC,qDAAqD;QACrD,qDAAqD;QACrD,mDAAmD;QACnD,MAAM+F,UAAU,CAAC5H,MACfyB,WAAW,CAAC,OAAO,EAAEzB,IAAI6H,KAAK,CAAC,KAAKC,GAAG,IAAI,GAAG9H;QAEhD,IAAK,MAAMA,OAAO+B,cAAe;YAC/B4F,mBAAmB,CAAC3H,IAAI,GAAG4H,QAAQ5H;QACrC;QACA,IAAK,MAAMA,OAAOiC,cAAe;YAC/B0F,mBAAmB,CAAC3H,IAAI,GAAG4H,QAAQ5H;QACrC;QACA,IAAI,CAACK,OAAOiC,YAAY,CAACmB,yBAAyB,EAAE;YAClD,KAAK,MAAMzD,OAAO;gBAAC;aAAiC,CAAE;gBACpD2H,mBAAmB,CAAC3H,IAAI,GAAG4H,QAAQ5H;YACrC;QACF;IACF;IAEA,OAAO2H;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 {\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 | NextConfigComplete['cacheLife']\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 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_TURBOPACK_SHARED_RUNTIME': Boolean(\n config.experimental.turbopackSharedRuntime\n ),\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_REQUEST_INSIGHTS':\n dev && !!config.experimental.requestInsights,\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.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_SERVER_COMPONENTS_HMR_CANCELLATION': Boolean(\n config.experimental.serverComponentsHmrCancellation\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_VARY_PARAMS': config.experimental.varyParams ?? false,\n 'process.env.__NEXT_EXPOSE_TESTING_API':\n isCacheComponentsEnabled &&\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","isCacheComponentsEnabled","cacheComponents","isUseCacheEnabled","experimental","useCache","__NEXT_DEFINE_ENV","EdgeRuntime","process","env","NEXT_EDGE_RUNTIME_PROVIDER","NEXT_RSPACK","allowDevelopmentBuild","NEXT_PRIVATE_DISABLE_DEV_OVERLAY_UX","Boolean","appNavFailHandling","turbopackSharedRuntime","cachedNavigations","coldCacheBadge","requestInsights","supportsImmutableAssets","useSkewCookie","deploymentId","runtimeServerDeploymentId","__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING","manualClientBasePath","isNaN","Number","staleTimes","dynamic","static","clientRouterFilter","staticFilter","dynamicFilter","validateRSCRequestHeaders","serverComponentsHmrCancellation","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","varyParams","exposeTestingApiInProductionBuild","cacheLife","clientParamParsingOrigins","userDefines","compiler","define","hasOwnProperty","Error","userDefinesServer","defineServer","serializedDefineEnv","safeKey","split","pop"],"mappings":";;;;+BAwGgBA;;;eAAAA;;;iEAjGC;wCACsB;2BAIhC;;;;;;AA8BP,MAAMC,wBAAwBC,OAAO;AAqBrC;;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,CAAC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,CAACzH,IAAI;QACzC;IACF;IAEA,MAAM2H,sBAAsBlI,mBAAmBC;IAE/C,uDAAuD;IACvD,oDAAoD;IACpD,+BAA+B;IAC/B,IAAI,CAACY,OAAOuB,sBAAsB;QAChC,qDAAqD;QACrD,qDAAqD;QACrD,mDAAmD;QACnD,MAAM+F,UAAU,CAAC5H,MACfyB,WAAW,CAAC,OAAO,EAAEzB,IAAI6H,KAAK,CAAC,KAAKC,GAAG,IAAI,GAAG9H;QAEhD,IAAK,MAAMA,OAAO+B,cAAe;YAC/B4F,mBAAmB,CAAC3H,IAAI,GAAG4H,QAAQ5H;QACrC;QACA,IAAK,MAAMA,OAAOiC,cAAe;YAC/B0F,mBAAmB,CAAC3H,IAAI,GAAG4H,QAAQ5H;QACrC;QACA,IAAI,CAACK,OAAOiC,YAAY,CAACmB,yBAAyB,EAAE;YAClD,KAAK,MAAMzD,OAAO;gBAAC;aAAiC,CAAE;gBACpD2H,mBAAmB,CAAC3H,IAAI,GAAG4H,QAAQ5H;YACrC;QACF;IACF;IAEA,OAAO2H;AACT","ignoreList":[0]} |
@@ -71,2 +71,17 @@ "use strict"; | ||
| ]); | ||
| const PAGES_SUPPORT_ROUTES = new Set([ | ||
| '/_app', | ||
| '/_document', | ||
| '/_error', | ||
| '/404', | ||
| '/500' | ||
| ]); | ||
| const PAGES_FRAMEWORK_ROUTES = new Set([ | ||
| '/_app', | ||
| '/_document', | ||
| '/_error' | ||
| ]); | ||
| function isRenderablePagesRoute(page) { | ||
| return !PAGES_FRAMEWORK_ROUTES.has(page) && page !== '/api' && !page.startsWith('/api/'); | ||
| } | ||
| function removeSuffix(value, suffix) { | ||
@@ -276,3 +291,14 @@ return value.endsWith(suffix) ? value.slice(0, -suffix.length) : value; | ||
| const debugPathsSet = new Set(debugPaths); | ||
| return paths.filter((p)=>debugPathsSet.has(p)); | ||
| const filteredPaths = paths.filter((p)=>debugPathsSet.has(p)); | ||
| const hasPagesRoute = filteredPaths.some((p)=>isRenderablePagesRoute(getPageFromPath(p, pageExtensions))); | ||
| if (!hasPagesRoute) { | ||
| return filteredPaths; | ||
| } | ||
| const filteredPathsSet = new Set(filteredPaths); | ||
| for (const path of paths){ | ||
| if (PAGES_SUPPORT_ROUTES.has(getPageFromPath(path, pageExtensions))) { | ||
| filteredPathsSet.add(path); | ||
| } | ||
| } | ||
| return paths.filter((p)=>filteredPathsSet.has(p)); | ||
| } | ||
@@ -279,0 +305,0 @@ // Empty array means build none |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/build/route-discovery.ts"],"sourcesContent":["import { join } from 'path'\nimport { createValidFileMatcher } from '../server/lib/find-page-file'\nimport { recursiveReadDir } from '../lib/recursive-readdir'\nimport {\n APP_DIR_ALIAS,\n PAGES_DIR_ALIAS,\n ROOT_DIR_ALIAS,\n} from '../lib/constants'\nimport { normalizePathSep } from '../shared/lib/page-path/normalize-path-sep'\nimport { normalizeAppPath } from '../shared/lib/router/utils/app-paths'\nimport { ensureLeadingSlash } from '../shared/lib/page-path/ensure-leading-slash'\nimport { PAGE_TYPES } from '../lib/page-types'\nimport {\n extractSlotsFromRoutes,\n combineSlots,\n type SlotInfo,\n type RouteInfo,\n} from './file-classifier'\nimport {\n normalizeMetadataRoute,\n normalizeMetadataPageToRoute,\n} from '../lib/metadata/get-metadata-route'\nimport { isMetadataRouteFile } from '../lib/metadata/is-metadata-route'\nimport { getPageStaticInfo } from './analysis/get-page-static-info'\nimport {\n UNDERSCORE_NOT_FOUND_ROUTE,\n UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n UNDERSCORE_GLOBAL_ERROR_ROUTE,\n UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY,\n} from '../shared/lib/entry-constants'\nimport { isReservedPage } from './utils'\nimport type { PageExtensions } from './page-extensions-type'\nimport type { MappedPages } from './build-context'\n\nconst PRIVATE_PAGES_PREFIX_REGEX = /^private-next-pages\\//\nconst PRIVATE_APP_PREFIX_REGEX = /^private-next-app-dir\\//\nconst SKIP_ROUTES = new Set([\n UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY,\n])\n\nfunction removeSuffix(value: string, suffix: string): string {\n return value.endsWith(suffix) ? value.slice(0, -suffix.length) : value\n}\n\n/** Normalize a route for the app router */\nfunction normalizeAppRoute(pageName: string): string {\n return normalizeAppPath(normalizePathSep(pageName))\n}\n\n/** Normalize a layout route (strip /layout suffix) */\nfunction normalizeLayoutRoute(pageName: string): string {\n return ensureLeadingSlash(\n removeSuffix(normalizeAppPath(normalizePathSep(pageName)), '/layout')\n )\n}\n\n/**\n * For a given page path removes the provided extensions.\n */\nexport function getPageFromPath(\n pagePath: string,\n pageExtensions: PageExtensions\n) {\n let page = normalizePathSep(pagePath)\n // Try longer extensions first so compound extensions like 'page.js'\n // match before shorter ones like 'js'\n const sorted = [...pageExtensions].sort((a, b) => b.length - a.length)\n for (const extension of sorted) {\n const next = removeSuffix(page, `.${extension}`)\n if (next !== page) {\n page = next\n break\n }\n }\n\n page = removeSuffix(page, '/index')\n\n return page === '' ? '/' : page\n}\n\n/**\n * Collect app pages, layouts, and default files from the app directory\n */\nexport async function collectAppFiles(\n appDir: string,\n validFileMatcher: ReturnType<typeof createValidFileMatcher>\n): Promise<{\n appPaths: string[]\n layoutPaths: string[]\n defaultPaths: string[]\n}> {\n const allAppFiles = await recursiveReadDir(appDir, {\n pathnameFilter: (absolutePath) =>\n validFileMatcher.isAppRouterPage(absolutePath) ||\n validFileMatcher.isRootNotFound(absolutePath) ||\n validFileMatcher.isAppLayoutPage(absolutePath) ||\n validFileMatcher.isAppDefaultPage(absolutePath),\n ignorePartFilter: (part) => part.startsWith('_'),\n })\n\n const appPaths = allAppFiles.filter(\n (absolutePath) =>\n validFileMatcher.isAppRouterPage(absolutePath) ||\n validFileMatcher.isRootNotFound(absolutePath)\n )\n const layoutPaths = allAppFiles.filter((absolutePath) =>\n validFileMatcher.isAppLayoutPage(absolutePath)\n )\n const defaultPaths = allAppFiles.filter((absolutePath) =>\n validFileMatcher.isAppDefaultPage(absolutePath)\n )\n\n return { appPaths, layoutPaths, defaultPaths }\n}\n\n/**\n * Collect pages from the pages directory\n */\nexport async function collectPagesFiles(\n pagesDir: string,\n validFileMatcher: ReturnType<typeof createValidFileMatcher>\n): Promise<string[]> {\n return await recursiveReadDir(pagesDir, {\n pathnameFilter: validFileMatcher.isPageFile,\n })\n}\n\n/**\n * Create a relative file path from a mapped page path\n */\nexport function createRelativeFilePath(\n baseDir: string,\n filePath: string,\n prefix: 'pages' | 'app',\n isSrcDir: boolean\n): string {\n const privatePrefixRegex =\n prefix === 'pages' ? PRIVATE_PAGES_PREFIX_REGEX : PRIVATE_APP_PREFIX_REGEX\n const srcPrefix = isSrcDir ? 'src/' : ''\n return join(\n baseDir,\n filePath.replace(privatePrefixRegex, `${srcPrefix}${prefix}/`)\n )\n}\n\n/**\n * Process pages routes from mapped pages\n */\nexport function processPageRoutes(\n mappedPages: { [page: string]: string },\n baseDir: string,\n isSrcDir: boolean\n): {\n pageRoutes: RouteInfo[]\n pageApiRoutes: RouteInfo[]\n} {\n const pageRoutes: RouteInfo[] = []\n const pageApiRoutes: RouteInfo[] = []\n\n for (const [route, filePath] of Object.entries(mappedPages)) {\n const relativeFilePath = createRelativeFilePath(\n baseDir,\n filePath,\n 'pages',\n isSrcDir\n )\n\n if (route.startsWith('/api/')) {\n pageApiRoutes.push({\n route: normalizePathSep(route),\n filePath: relativeFilePath,\n })\n } else {\n if (isReservedPage(route)) continue\n\n pageRoutes.push({\n route: normalizePathSep(route),\n filePath: relativeFilePath,\n })\n }\n }\n\n return { pageRoutes, pageApiRoutes }\n}\n\n/**\n * Process app routes from mapped app pages\n */\nexport function processAppRoutes(\n mappedAppPages: { [page: string]: string },\n validFileMatcher: ReturnType<typeof createValidFileMatcher>,\n baseDir: string,\n isSrcDir: boolean\n): {\n appRoutes: RouteInfo[]\n appRouteHandlers: RouteInfo[]\n} {\n const appRoutes: RouteInfo[] = []\n const appRouteHandlers: RouteInfo[] = []\n\n for (const [page, filePath] of Object.entries(mappedAppPages)) {\n if (\n page === UNDERSCORE_NOT_FOUND_ROUTE_ENTRY ||\n page === UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY\n ) {\n continue\n }\n\n const relativeFilePath = createRelativeFilePath(\n baseDir,\n filePath,\n 'app',\n isSrcDir\n )\n const route = normalizeAppRoute(page)\n\n if (validFileMatcher.isAppRouterRoute(filePath)) {\n appRouteHandlers.push({ route, filePath: relativeFilePath })\n } else {\n appRoutes.push({ route, filePath: relativeFilePath })\n }\n }\n\n return { appRoutes, appRouteHandlers }\n}\n\n/**\n * Process layout routes from mapped app layouts\n */\nexport function processLayoutRoutes(\n mappedAppLayouts: { [page: string]: string },\n baseDir: string,\n isSrcDir: boolean\n): RouteInfo[] {\n return Object.entries(mappedAppLayouts).map(([route, filePath]) => ({\n route: normalizeLayoutRoute(route),\n filePath: createRelativeFilePath(baseDir, filePath, 'app', isSrcDir),\n }))\n}\n\n/**\n * Creates a mapping of route to page file path for a given list of page paths.\n */\nexport async function createPagesMapping({\n isDev,\n pageExtensions,\n pagePaths,\n pagesType,\n pagesDir,\n appDir,\n appDirOnly,\n}: {\n isDev: boolean\n pageExtensions: PageExtensions\n pagePaths: string[]\n pagesType: PAGE_TYPES\n pagesDir: string | undefined\n appDir: string | undefined\n appDirOnly: boolean\n}): Promise<MappedPages> {\n const isAppRoute = pagesType === 'app'\n\n const promises = pagePaths.map<Promise<[string, string] | undefined>>(\n async (pagePath) => {\n if (pagePath.endsWith('.d.ts') && pageExtensions.includes('ts')) {\n return\n }\n\n let pageKey = getPageFromPath(pagePath, pageExtensions)\n if (isAppRoute) {\n // Turbopack encodes '_' as '%5F' in app paths; normalize to underscores.\n pageKey = pageKey.replace(/%5F/g, '_')\n if (pageKey === UNDERSCORE_NOT_FOUND_ROUTE) {\n pageKey = UNDERSCORE_NOT_FOUND_ROUTE_ENTRY\n }\n if (pageKey === UNDERSCORE_GLOBAL_ERROR_ROUTE) {\n pageKey = UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY\n }\n }\n\n const normalizedPath = normalizePathSep(\n join(\n pagesType === PAGE_TYPES.PAGES\n ? PAGES_DIR_ALIAS\n : pagesType === PAGE_TYPES.APP\n ? APP_DIR_ALIAS\n : ROOT_DIR_ALIAS,\n pagePath\n )\n )\n\n let route =\n pagesType === PAGE_TYPES.APP ? normalizeMetadataRoute(pageKey) : pageKey\n\n if (\n pagesType === PAGE_TYPES.APP &&\n isMetadataRouteFile(pagePath, pageExtensions, true)\n ) {\n const filePath = join(appDir!, pagePath)\n const staticInfo = await getPageStaticInfo({\n nextConfig: {},\n pageFilePath: filePath,\n isDev,\n page: pageKey,\n pageType: pagesType,\n })\n\n route = normalizeMetadataPageToRoute(\n route,\n !!(staticInfo.generateImageMetadata || staticInfo.generateSitemaps)\n )\n }\n\n return [route, normalizedPath]\n }\n )\n\n const pages: MappedPages = Object.fromEntries(\n (await Promise.all(promises)).filter((entry) => entry != null)\n )\n\n switch (pagesType) {\n case PAGE_TYPES.ROOT: {\n return pages\n }\n case PAGE_TYPES.APP: {\n const hasAppPages = Object.keys(pages).length > 0\n const hasAppGlobalError = !isDev && appDirOnly\n return {\n ...(hasAppPages && {\n [UNDERSCORE_NOT_FOUND_ROUTE_ENTRY]: require.resolve(\n 'next/dist/client/components/builtin/global-not-found'\n ),\n }),\n ...(hasAppGlobalError && {\n [UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY]: require.resolve(\n 'next/dist/client/components/builtin/app-error'\n ),\n }),\n ...pages,\n }\n }\n case PAGE_TYPES.PAGES: {\n if (isDev) {\n delete pages['/_app']\n delete pages['/_error']\n delete pages['/_document']\n }\n\n const root = isDev && pagesDir ? PAGES_DIR_ALIAS : 'next/dist/pages'\n\n if (Object.keys(pages).length === 0 && !appDirOnly) {\n appDirOnly = true\n }\n\n return {\n ...((isDev || !appDirOnly) && {\n '/_app': `${root}/_app`,\n '/_error': `${root}/_error`,\n '/_document': `${root}/_document`,\n ...pages,\n }),\n }\n }\n default: {\n return {}\n }\n }\n}\n\nexport interface RouteDiscoveryOptions {\n appDir?: string\n pagesDir?: string\n pageExtensions: string[]\n isDev: boolean\n baseDir: string\n /** Whether the app/pages directories are under a /src directory. */\n isSrcDir?: boolean\n /** Override app-dir-only mode (e.g. from --experimental-app-only CLI flag) */\n appDirOnly?: boolean\n validFileMatcher?: ReturnType<typeof createValidFileMatcher>\n debugBuildPaths?: { app: string[]; pages: string[] }\n}\n\nexport interface RouteDiscoveryResult {\n appRoutes: RouteInfo[]\n appRouteHandlers: RouteInfo[]\n layoutRoutes: RouteInfo[]\n slots: SlotInfo[]\n pageRoutes: RouteInfo[]\n pageApiRoutes: RouteInfo[]\n mappedAppPages?: MappedPages\n mappedAppLayouts?: MappedPages\n mappedPages?: MappedPages\n /** Raw page file paths (post-filtering), useful for telemetry */\n pagesPaths: string[]\n /** Resolved app-dir-only state (may have been updated during discovery) */\n appDirOnly: boolean\n}\n\n/**\n * High-level API: Collect, map, and process all routes in one call\n */\nexport async function discoverRoutes(\n options: RouteDiscoveryOptions\n): Promise<RouteDiscoveryResult> {\n const {\n appDir,\n pagesDir,\n pageExtensions,\n isDev,\n baseDir,\n isSrcDir,\n debugBuildPaths,\n } = options\n\n const validFileMatcher =\n options.validFileMatcher || createValidFileMatcher(pageExtensions, appDir)\n\n let appDirOnly = options.appDirOnly ?? (!!appDir && !pagesDir)\n\n // Helper to reduce createPagesMapping boilerplate\n const mapPaths = (pagePaths: string[], pagesType: PAGE_TYPES) =>\n createPagesMapping({\n pagePaths,\n isDev,\n pagesType,\n pageExtensions,\n pagesDir,\n appDir,\n appDirOnly,\n })\n\n // Helper to apply debugBuildPaths filtering\n const applyDebugFilter = (\n paths: string[],\n debugPaths: string[]\n ): string[] => {\n if (debugPaths.length > 0) {\n const debugPathsSet = new Set(debugPaths)\n return paths.filter((p) => debugPathsSet.has(p))\n }\n // Empty array means build none\n return []\n }\n\n let pageRoutes: RouteInfo[] = []\n let pageApiRoutes: RouteInfo[] = []\n let mappedPages: MappedPages | undefined\n let pagesPaths: string[] = []\n\n if (pagesDir && !appDirOnly) {\n if (process.env.NEXT_PRIVATE_PAGE_PATHS) {\n pagesPaths = JSON.parse(process.env.NEXT_PRIVATE_PAGE_PATHS)\n } else {\n pagesPaths = await collectPagesFiles(pagesDir, validFileMatcher)\n\n if (debugBuildPaths) {\n pagesPaths = applyDebugFilter(pagesPaths, debugBuildPaths.pages)\n }\n }\n\n mappedPages = await mapPaths(pagesPaths, PAGE_TYPES.PAGES)\n\n // Update appDirOnly if no user page routes were found, so the\n // subsequent app mapping can emit the global error entry.\n if (Object.keys(mappedPages).length === 0) {\n appDirOnly = true\n }\n\n ;({ pageRoutes, pageApiRoutes } = processPageRoutes(\n mappedPages,\n baseDir,\n !!isSrcDir\n ))\n }\n\n let appRoutes: RouteInfo[] = []\n let appRouteHandlers: RouteInfo[] = []\n let layoutRoutes: RouteInfo[] = []\n let slots: SlotInfo[] = []\n let mappedAppPages: MappedPages | undefined\n let mappedAppLayouts: MappedPages | undefined\n\n if (appDir) {\n let appPaths: string[]\n let layoutPaths: string[]\n let defaultPaths: string[]\n\n if (process.env.NEXT_PRIVATE_APP_PATHS) {\n // Used for testing — override collected app paths\n appPaths = JSON.parse(process.env.NEXT_PRIVATE_APP_PATHS)\n layoutPaths = []\n defaultPaths = []\n } else {\n const result = await collectAppFiles(appDir, validFileMatcher)\n appPaths = result.appPaths\n layoutPaths = result.layoutPaths\n defaultPaths = result.defaultPaths\n\n if (debugBuildPaths) {\n appPaths = applyDebugFilter(appPaths, debugBuildPaths.app)\n }\n }\n\n // Map all app file types in parallel\n let mappedDefaultFiles: MappedPages\n ;[mappedAppPages, mappedAppLayouts, mappedDefaultFiles] = await Promise.all(\n [\n mapPaths(appPaths, PAGE_TYPES.APP),\n mapPaths(layoutPaths, PAGE_TYPES.APP),\n mapPaths(defaultPaths, PAGE_TYPES.APP),\n ]\n )\n\n // Extract slots from pages and default files\n slots = combineSlots(\n extractSlotsFromRoutes(mappedAppPages, SKIP_ROUTES),\n extractSlotsFromRoutes(mappedDefaultFiles)\n )\n\n // Process routes\n ;({ appRoutes, appRouteHandlers } = processAppRoutes(\n mappedAppPages,\n validFileMatcher,\n baseDir,\n !!isSrcDir\n ))\n layoutRoutes = processLayoutRoutes(mappedAppLayouts, baseDir, !!isSrcDir)\n }\n\n return {\n appRoutes,\n appRouteHandlers,\n layoutRoutes,\n slots,\n pageRoutes,\n pageApiRoutes,\n mappedAppPages,\n mappedAppLayouts,\n mappedPages,\n pagesPaths,\n appDirOnly,\n }\n}\n"],"names":["collectAppFiles","collectPagesFiles","createPagesMapping","createRelativeFilePath","discoverRoutes","getPageFromPath","processAppRoutes","processLayoutRoutes","processPageRoutes","PRIVATE_PAGES_PREFIX_REGEX","PRIVATE_APP_PREFIX_REGEX","SKIP_ROUTES","Set","UNDERSCORE_NOT_FOUND_ROUTE_ENTRY","UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY","removeSuffix","value","suffix","endsWith","slice","length","normalizeAppRoute","pageName","normalizeAppPath","normalizePathSep","normalizeLayoutRoute","ensureLeadingSlash","pagePath","pageExtensions","page","sorted","sort","a","b","extension","next","appDir","validFileMatcher","allAppFiles","recursiveReadDir","pathnameFilter","absolutePath","isAppRouterPage","isRootNotFound","isAppLayoutPage","isAppDefaultPage","ignorePartFilter","part","startsWith","appPaths","filter","layoutPaths","defaultPaths","pagesDir","isPageFile","baseDir","filePath","prefix","isSrcDir","privatePrefixRegex","srcPrefix","join","replace","mappedPages","pageRoutes","pageApiRoutes","route","Object","entries","relativeFilePath","push","isReservedPage","mappedAppPages","appRoutes","appRouteHandlers","isAppRouterRoute","mappedAppLayouts","map","isDev","pagePaths","pagesType","appDirOnly","isAppRoute","promises","includes","pageKey","UNDERSCORE_NOT_FOUND_ROUTE","UNDERSCORE_GLOBAL_ERROR_ROUTE","normalizedPath","PAGE_TYPES","PAGES","PAGES_DIR_ALIAS","APP","APP_DIR_ALIAS","ROOT_DIR_ALIAS","normalizeMetadataRoute","isMetadataRouteFile","staticInfo","getPageStaticInfo","nextConfig","pageFilePath","pageType","normalizeMetadataPageToRoute","generateImageMetadata","generateSitemaps","pages","fromEntries","Promise","all","entry","ROOT","hasAppPages","keys","hasAppGlobalError","require","resolve","root","options","debugBuildPaths","createValidFileMatcher","mapPaths","applyDebugFilter","paths","debugPaths","debugPathsSet","p","has","pagesPaths","process","env","NEXT_PRIVATE_PAGE_PATHS","JSON","parse","layoutRoutes","slots","NEXT_PRIVATE_APP_PATHS","result","app","mappedDefaultFiles","combineSlots","extractSlotsFromRoutes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;IAoFsBA,eAAe;eAAfA;;IAmCAC,iBAAiB;eAAjBA;;IA6HAC,kBAAkB;eAAlBA;;IAjHNC,sBAAsB;eAAtBA;;IAiRMC,cAAc;eAAdA;;IAxVNC,eAAe;eAAfA;;IAiIAC,gBAAgB;eAAhBA;;IAyCAC,mBAAmB;eAAnBA;;IAjFAC,iBAAiB;eAAjBA;;;sBArJK;8BACkB;kCACN;2BAK1B;kCAC0B;0BACA;oCACE;2BACR;gCAMpB;kCAIA;iCAC6B;mCACF;gCAM3B;uBACwB;AAI/B,MAAMC,6BAA6B;AACnC,MAAMC,2BAA2B;AACjC,MAAMC,cAAc,IAAIC,IAAI;IAC1BC,gDAAgC;IAChCC,mDAAmC;CACpC;AAED,SAASC,aAAaC,KAAa,EAAEC,MAAc;IACjD,OAAOD,MAAME,QAAQ,CAACD,UAAUD,MAAMG,KAAK,CAAC,GAAG,CAACF,OAAOG,MAAM,IAAIJ;AACnE;AAEA,yCAAyC,GACzC,SAASK,kBAAkBC,QAAgB;IACzC,OAAOC,IAAAA,0BAAgB,EAACC,IAAAA,kCAAgB,EAACF;AAC3C;AAEA,oDAAoD,GACpD,SAASG,qBAAqBH,QAAgB;IAC5C,OAAOI,IAAAA,sCAAkB,EACvBX,aAAaQ,IAAAA,0B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asC,qBAAU,CAACG,GAAG;YACpC4B,SAASpE,cAAcqC,qBAAU,CAACG,GAAG;SACtC;QAGH,6CAA6C;QAC7C0C,QAAQK,IAAAA,4BAAY,EAClBC,IAAAA,sCAAsB,EAACpE,gBAAgB7D,cACvCiI,IAAAA,sCAAsB,EAACF;QAIvB,CAAA,EAAEjE,SAAS,EAAEC,gBAAgB,EAAE,GAAGpE,iBAClCkE,gBACAnC,kBACAkB,SACA,CAAC,CAACG,SACJ;QACA2E,eAAe9H,oBAAoBqE,kBAAkBrB,SAAS,CAAC,CAACG;IAClE;IAEA,OAAO;QACLe;QACAC;QACA2D;QACAC;QACAtE;QACAC;QACAO;QACAI;QACAb;QACAgE;QACA9C;IACF;AACF","ignoreList":[0]} | ||
| {"version":3,"sources":["../../src/build/route-discovery.ts"],"sourcesContent":["import { join } from 'path'\nimport { createValidFileMatcher } from '../server/lib/find-page-file'\nimport { recursiveReadDir } from '../lib/recursive-readdir'\nimport {\n APP_DIR_ALIAS,\n PAGES_DIR_ALIAS,\n ROOT_DIR_ALIAS,\n} from '../lib/constants'\nimport { normalizePathSep } from '../shared/lib/page-path/normalize-path-sep'\nimport { normalizeAppPath } from '../shared/lib/router/utils/app-paths'\nimport { ensureLeadingSlash } from '../shared/lib/page-path/ensure-leading-slash'\nimport { PAGE_TYPES } from '../lib/page-types'\nimport {\n extractSlotsFromRoutes,\n combineSlots,\n type SlotInfo,\n type RouteInfo,\n} from './file-classifier'\nimport {\n normalizeMetadataRoute,\n normalizeMetadataPageToRoute,\n} from '../lib/metadata/get-metadata-route'\nimport { isMetadataRouteFile } from '../lib/metadata/is-metadata-route'\nimport { getPageStaticInfo } from './analysis/get-page-static-info'\nimport {\n UNDERSCORE_NOT_FOUND_ROUTE,\n UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n UNDERSCORE_GLOBAL_ERROR_ROUTE,\n UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY,\n} from '../shared/lib/entry-constants'\nimport { isReservedPage } from './utils'\nimport type { PageExtensions } from './page-extensions-type'\nimport type { MappedPages } from './build-context'\n\nconst PRIVATE_PAGES_PREFIX_REGEX = /^private-next-pages\\//\nconst PRIVATE_APP_PREFIX_REGEX = /^private-next-app-dir\\//\nconst SKIP_ROUTES = new Set([\n UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY,\n])\nconst PAGES_SUPPORT_ROUTES = new Set([\n '/_app',\n '/_document',\n '/_error',\n '/404',\n '/500',\n])\nconst PAGES_FRAMEWORK_ROUTES = new Set(['/_app', '/_document', '/_error'])\n\nfunction isRenderablePagesRoute(page: string): boolean {\n return (\n !PAGES_FRAMEWORK_ROUTES.has(page) &&\n page !== '/api' &&\n !page.startsWith('/api/')\n )\n}\n\nfunction removeSuffix(value: string, suffix: string): string {\n return value.endsWith(suffix) ? value.slice(0, -suffix.length) : value\n}\n\n/** Normalize a route for the app router */\nfunction normalizeAppRoute(pageName: string): string {\n return normalizeAppPath(normalizePathSep(pageName))\n}\n\n/** Normalize a layout route (strip /layout suffix) */\nfunction normalizeLayoutRoute(pageName: string): string {\n return ensureLeadingSlash(\n removeSuffix(normalizeAppPath(normalizePathSep(pageName)), '/layout')\n )\n}\n\n/**\n * For a given page path removes the provided extensions.\n */\nexport function getPageFromPath(\n pagePath: string,\n pageExtensions: PageExtensions\n) {\n let page = normalizePathSep(pagePath)\n // Try longer extensions first so compound extensions like 'page.js'\n // match before shorter ones like 'js'\n const sorted = [...pageExtensions].sort((a, b) => b.length - a.length)\n for (const extension of sorted) {\n const next = removeSuffix(page, `.${extension}`)\n if (next !== page) {\n page = next\n break\n }\n }\n\n page = removeSuffix(page, '/index')\n\n return page === '' ? '/' : page\n}\n\n/**\n * Collect app pages, layouts, and default files from the app directory\n */\nexport async function collectAppFiles(\n appDir: string,\n validFileMatcher: ReturnType<typeof createValidFileMatcher>\n): Promise<{\n appPaths: string[]\n layoutPaths: string[]\n defaultPaths: string[]\n}> {\n const allAppFiles = await recursiveReadDir(appDir, {\n pathnameFilter: (absolutePath) =>\n validFileMatcher.isAppRouterPage(absolutePath) ||\n validFileMatcher.isRootNotFound(absolutePath) ||\n validFileMatcher.isAppLayoutPage(absolutePath) ||\n validFileMatcher.isAppDefaultPage(absolutePath),\n ignorePartFilter: (part) => part.startsWith('_'),\n })\n\n const appPaths = allAppFiles.filter(\n (absolutePath) =>\n validFileMatcher.isAppRouterPage(absolutePath) ||\n validFileMatcher.isRootNotFound(absolutePath)\n )\n const layoutPaths = allAppFiles.filter((absolutePath) =>\n validFileMatcher.isAppLayoutPage(absolutePath)\n )\n const defaultPaths = allAppFiles.filter((absolutePath) =>\n validFileMatcher.isAppDefaultPage(absolutePath)\n )\n\n return { appPaths, layoutPaths, defaultPaths }\n}\n\n/**\n * Collect pages from the pages directory\n */\nexport async function collectPagesFiles(\n pagesDir: string,\n validFileMatcher: ReturnType<typeof createValidFileMatcher>\n): Promise<string[]> {\n return await recursiveReadDir(pagesDir, {\n pathnameFilter: validFileMatcher.isPageFile,\n })\n}\n\n/**\n * Create a relative file path from a mapped page path\n */\nexport function createRelativeFilePath(\n baseDir: string,\n filePath: string,\n prefix: 'pages' | 'app',\n isSrcDir: boolean\n): string {\n const privatePrefixRegex =\n prefix === 'pages' ? PRIVATE_PAGES_PREFIX_REGEX : PRIVATE_APP_PREFIX_REGEX\n const srcPrefix = isSrcDir ? 'src/' : ''\n return join(\n baseDir,\n filePath.replace(privatePrefixRegex, `${srcPrefix}${prefix}/`)\n )\n}\n\n/**\n * Process pages routes from mapped pages\n */\nexport function processPageRoutes(\n mappedPages: { [page: string]: string },\n baseDir: string,\n isSrcDir: boolean\n): {\n pageRoutes: RouteInfo[]\n pageApiRoutes: RouteInfo[]\n} {\n const pageRoutes: RouteInfo[] = []\n const pageApiRoutes: RouteInfo[] = []\n\n for (const [route, filePath] of Object.entries(mappedPages)) {\n const relativeFilePath = createRelativeFilePath(\n baseDir,\n filePath,\n 'pages',\n isSrcDir\n )\n\n if (route.startsWith('/api/')) {\n pageApiRoutes.push({\n route: normalizePathSep(route),\n filePath: relativeFilePath,\n })\n } else {\n if (isReservedPage(route)) continue\n\n pageRoutes.push({\n route: normalizePathSep(route),\n filePath: relativeFilePath,\n })\n }\n }\n\n return { pageRoutes, pageApiRoutes }\n}\n\n/**\n * Process app routes from mapped app pages\n */\nexport function processAppRoutes(\n mappedAppPages: { [page: string]: string },\n validFileMatcher: ReturnType<typeof createValidFileMatcher>,\n baseDir: string,\n isSrcDir: boolean\n): {\n appRoutes: RouteInfo[]\n appRouteHandlers: RouteInfo[]\n} {\n const appRoutes: RouteInfo[] = []\n const appRouteHandlers: RouteInfo[] = []\n\n for (const [page, filePath] of Object.entries(mappedAppPages)) {\n if (\n page === UNDERSCORE_NOT_FOUND_ROUTE_ENTRY ||\n page === UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY\n ) {\n continue\n }\n\n const relativeFilePath = createRelativeFilePath(\n baseDir,\n filePath,\n 'app',\n isSrcDir\n )\n const route = normalizeAppRoute(page)\n\n if (validFileMatcher.isAppRouterRoute(filePath)) {\n appRouteHandlers.push({ route, filePath: relativeFilePath })\n } else {\n appRoutes.push({ route, filePath: relativeFilePath })\n }\n }\n\n return { appRoutes, appRouteHandlers }\n}\n\n/**\n * Process layout routes from mapped app layouts\n */\nexport function processLayoutRoutes(\n mappedAppLayouts: { [page: string]: string },\n baseDir: string,\n isSrcDir: boolean\n): RouteInfo[] {\n return Object.entries(mappedAppLayouts).map(([route, filePath]) => ({\n route: normalizeLayoutRoute(route),\n filePath: createRelativeFilePath(baseDir, filePath, 'app', isSrcDir),\n }))\n}\n\n/**\n * Creates a mapping of route to page file path for a given list of page paths.\n */\nexport async function createPagesMapping({\n isDev,\n pageExtensions,\n pagePaths,\n pagesType,\n pagesDir,\n appDir,\n appDirOnly,\n}: {\n isDev: boolean\n pageExtensions: PageExtensions\n pagePaths: string[]\n pagesType: PAGE_TYPES\n pagesDir: string | undefined\n appDir: string | undefined\n appDirOnly: boolean\n}): Promise<MappedPages> {\n const isAppRoute = pagesType === 'app'\n\n const promises = pagePaths.map<Promise<[string, string] | undefined>>(\n async (pagePath) => {\n if (pagePath.endsWith('.d.ts') && pageExtensions.includes('ts')) {\n return\n }\n\n let pageKey = getPageFromPath(pagePath, pageExtensions)\n if (isAppRoute) {\n // Turbopack encodes '_' as '%5F' in app paths; normalize to underscores.\n pageKey = pageKey.replace(/%5F/g, '_')\n if (pageKey === UNDERSCORE_NOT_FOUND_ROUTE) {\n pageKey = UNDERSCORE_NOT_FOUND_ROUTE_ENTRY\n }\n if (pageKey === UNDERSCORE_GLOBAL_ERROR_ROUTE) {\n pageKey = UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY\n }\n }\n\n const normalizedPath = normalizePathSep(\n join(\n pagesType === PAGE_TYPES.PAGES\n ? PAGES_DIR_ALIAS\n : pagesType === PAGE_TYPES.APP\n ? APP_DIR_ALIAS\n : ROOT_DIR_ALIAS,\n pagePath\n )\n )\n\n let route =\n pagesType === PAGE_TYPES.APP ? normalizeMetadataRoute(pageKey) : pageKey\n\n if (\n pagesType === PAGE_TYPES.APP &&\n isMetadataRouteFile(pagePath, pageExtensions, true)\n ) {\n const filePath = join(appDir!, pagePath)\n const staticInfo = await getPageStaticInfo({\n nextConfig: {},\n pageFilePath: filePath,\n isDev,\n page: pageKey,\n pageType: pagesType,\n })\n\n route = normalizeMetadataPageToRoute(\n route,\n !!(staticInfo.generateImageMetadata || staticInfo.generateSitemaps)\n )\n }\n\n return [route, normalizedPath]\n }\n )\n\n const pages: MappedPages = Object.fromEntries(\n (await Promise.all(promises)).filter((entry) => entry != null)\n )\n\n switch (pagesType) {\n case PAGE_TYPES.ROOT: {\n return pages\n }\n case PAGE_TYPES.APP: {\n const hasAppPages = Object.keys(pages).length > 0\n const hasAppGlobalError = !isDev && appDirOnly\n return {\n ...(hasAppPages && {\n [UNDERSCORE_NOT_FOUND_ROUTE_ENTRY]: require.resolve(\n 'next/dist/client/components/builtin/global-not-found'\n ),\n }),\n ...(hasAppGlobalError && {\n [UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY]: require.resolve(\n 'next/dist/client/components/builtin/app-error'\n ),\n }),\n ...pages,\n }\n }\n case PAGE_TYPES.PAGES: {\n if (isDev) {\n delete pages['/_app']\n delete pages['/_error']\n delete pages['/_document']\n }\n\n const root = isDev && pagesDir ? PAGES_DIR_ALIAS : 'next/dist/pages'\n\n if (Object.keys(pages).length === 0 && !appDirOnly) {\n appDirOnly = true\n }\n\n return {\n ...((isDev || !appDirOnly) && {\n '/_app': `${root}/_app`,\n '/_error': `${root}/_error`,\n '/_document': `${root}/_document`,\n ...pages,\n }),\n }\n }\n default: {\n return {}\n }\n }\n}\n\nexport interface RouteDiscoveryOptions {\n appDir?: string\n pagesDir?: string\n pageExtensions: string[]\n isDev: boolean\n baseDir: string\n /** Whether the app/pages directories are under a /src directory. */\n isSrcDir?: boolean\n /** Override app-dir-only mode (e.g. from --experimental-app-only CLI flag) */\n appDirOnly?: boolean\n validFileMatcher?: ReturnType<typeof createValidFileMatcher>\n debugBuildPaths?: { app: string[]; pages: string[] }\n}\n\nexport interface RouteDiscoveryResult {\n appRoutes: RouteInfo[]\n appRouteHandlers: RouteInfo[]\n layoutRoutes: RouteInfo[]\n slots: SlotInfo[]\n pageRoutes: RouteInfo[]\n pageApiRoutes: RouteInfo[]\n mappedAppPages?: MappedPages\n mappedAppLayouts?: MappedPages\n mappedPages?: MappedPages\n /** Raw page file paths (post-filtering), useful for telemetry */\n pagesPaths: string[]\n /** Resolved app-dir-only state (may have been updated during discovery) */\n appDirOnly: boolean\n}\n\n/**\n * High-level API: Collect, map, and process all routes in one call\n */\nexport async function discoverRoutes(\n options: RouteDiscoveryOptions\n): Promise<RouteDiscoveryResult> {\n const {\n appDir,\n pagesDir,\n pageExtensions,\n isDev,\n baseDir,\n isSrcDir,\n debugBuildPaths,\n } = options\n\n const validFileMatcher =\n options.validFileMatcher || createValidFileMatcher(pageExtensions, appDir)\n\n let appDirOnly = options.appDirOnly ?? (!!appDir && !pagesDir)\n\n // Helper to reduce createPagesMapping boilerplate\n const mapPaths = (pagePaths: string[], pagesType: PAGE_TYPES) =>\n createPagesMapping({\n pagePaths,\n isDev,\n pagesType,\n pageExtensions,\n pagesDir,\n appDir,\n appDirOnly,\n })\n\n // Helper to apply debugBuildPaths filtering\n const applyDebugFilter = (\n paths: string[],\n debugPaths: string[]\n ): string[] => {\n if (debugPaths.length > 0) {\n const debugPathsSet = new Set(debugPaths)\n const filteredPaths = paths.filter((p) => debugPathsSet.has(p))\n const hasPagesRoute = filteredPaths.some((p) =>\n isRenderablePagesRoute(getPageFromPath(p, pageExtensions))\n )\n\n if (!hasPagesRoute) {\n return filteredPaths\n }\n\n const filteredPathsSet = new Set(filteredPaths)\n for (const path of paths) {\n if (PAGES_SUPPORT_ROUTES.has(getPageFromPath(path, pageExtensions))) {\n filteredPathsSet.add(path)\n }\n }\n\n return paths.filter((p) => filteredPathsSet.has(p))\n }\n // Empty array means build none\n return []\n }\n\n let pageRoutes: RouteInfo[] = []\n let pageApiRoutes: RouteInfo[] = []\n let mappedPages: MappedPages | undefined\n let pagesPaths: string[] = []\n\n if (pagesDir && !appDirOnly) {\n if (process.env.NEXT_PRIVATE_PAGE_PATHS) {\n pagesPaths = JSON.parse(process.env.NEXT_PRIVATE_PAGE_PATHS)\n } else {\n pagesPaths = await collectPagesFiles(pagesDir, validFileMatcher)\n\n if (debugBuildPaths) {\n pagesPaths = applyDebugFilter(pagesPaths, debugBuildPaths.pages)\n }\n }\n\n mappedPages = await mapPaths(pagesPaths, PAGE_TYPES.PAGES)\n\n // Update appDirOnly if no user page routes were found, so the\n // subsequent app mapping can emit the global error entry.\n if (Object.keys(mappedPages).length === 0) {\n appDirOnly = true\n }\n\n ;({ pageRoutes, pageApiRoutes } = processPageRoutes(\n mappedPages,\n baseDir,\n !!isSrcDir\n ))\n }\n\n let appRoutes: RouteInfo[] = []\n let appRouteHandlers: RouteInfo[] = []\n let layoutRoutes: RouteInfo[] = []\n let slots: SlotInfo[] = []\n let mappedAppPages: MappedPages | undefined\n let mappedAppLayouts: MappedPages | undefined\n\n if (appDir) {\n let appPaths: string[]\n let layoutPaths: string[]\n let defaultPaths: string[]\n\n if (process.env.NEXT_PRIVATE_APP_PATHS) {\n // Used for testing — override collected app paths\n appPaths = JSON.parse(process.env.NEXT_PRIVATE_APP_PATHS)\n layoutPaths = []\n defaultPaths = []\n } else {\n const result = await collectAppFiles(appDir, validFileMatcher)\n appPaths = result.appPaths\n layoutPaths = result.layoutPaths\n defaultPaths = result.defaultPaths\n\n if (debugBuildPaths) {\n appPaths = applyDebugFilter(appPaths, debugBuildPaths.app)\n }\n }\n\n // Map all app file types in parallel\n let mappedDefaultFiles: MappedPages\n ;[mappedAppPages, mappedAppLayouts, mappedDefaultFiles] = await Promise.all(\n [\n mapPaths(appPaths, PAGE_TYPES.APP),\n mapPaths(layoutPaths, PAGE_TYPES.APP),\n mapPaths(defaultPaths, PAGE_TYPES.APP),\n ]\n )\n\n // Extract slots from pages and default files\n slots = combineSlots(\n extractSlotsFromRoutes(mappedAppPages, SKIP_ROUTES),\n extractSlotsFromRoutes(mappedDefaultFiles)\n )\n\n // Process routes\n ;({ appRoutes, appRouteHandlers } = processAppRoutes(\n mappedAppPages,\n validFileMatcher,\n baseDir,\n !!isSrcDir\n ))\n layoutRoutes = processLayoutRoutes(mappedAppLayouts, baseDir, !!isSrcDir)\n }\n\n return {\n appRoutes,\n appRouteHandlers,\n layoutRoutes,\n slots,\n pageRoutes,\n pageApiRoutes,\n mappedAppPages,\n mappedAppLayouts,\n mappedPages,\n pagesPaths,\n appDirOnly,\n }\n}\n"],"names":["collectAppFiles","collectPagesFiles","createPagesMapping","createRelativeFilePath","discoverRoutes","getPageFromPath","processAppRoutes","processLayoutRoutes","processPageRoutes","PRIVATE_PAGES_PREFIX_REGEX","PRIVATE_APP_PREFIX_REGEX","SKIP_ROUTES","Set","UNDERSCORE_NOT_FOUND_ROUTE_ENTRY","UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY","PAGES_SUPPORT_ROUTES","PAGES_FRAMEWORK_ROUTES","isRenderablePagesRoute","page","has","startsWith","removeSuffix","value","suffix","endsWith","slice","length","normalizeAppRoute","pageName","normalizeAppPath","normalizePathSep","normalizeLayoutRoute","ensureLeadingSlash","pagePath","pageExtensions","sorted","sort","a","b","extension","next","appDir","validFileMatcher","allAppFiles","recursiveReadDir","pathnameFilter","absolutePath","isAppRouterPage","isRootNotFound","isAppLayoutPage","isAppDefaultPage","ignorePartFilter","part","appPaths","filter","layoutPaths","defaultPaths","pagesDir","isPageFile","baseDir","filePath","prefix","isSrcDir","privatePrefixRegex","srcPrefix","join","replace","mappedPages","pageRoutes","pageApiRoutes","route","Object","entries","relativeFilePath","push","isReservedPage","mappedAppPages","appRoutes","appRouteHandlers","isAppRouterRoute","mappedAppLayouts","map","isDev","pagePaths","pagesType","appDirOnly","isAppRoute","promises","includes","pageKey","UNDERSCORE_NOT_FOUND_ROUTE","UNDERSCORE_GLOBAL_ERROR_ROUTE","normalizedPath","PAGE_TYPES","PAGES","PAGES_DIR_ALIAS","APP","APP_DIR_ALIAS","ROOT_DIR_ALIAS","normalizeMetadataRoute","isMetadataRouteFile","staticInfo","getPageStaticInfo","nextConfig","pageFilePath","pageType","normalizeMetadataPageToRoute","generateImageMetadata","generateSitemaps","pages","fromEntries","Promise","all","entry","ROOT","hasAppPages","keys","hasAppGlobalError","require","resolve","root","options","debugBuildPaths","createValidFileMatcher","mapPaths","applyDebugFilter","paths","debugPaths","debugPathsSet","filteredPaths","p","hasPagesRoute","some","filteredPathsSet","path","add","pagesPaths","process","env","NEXT_PRIVATE_PAGE_PATHS","JSON","parse","layoutRoutes","slots","NEXT_PRIVATE_APP_PATHS","result","app","mappedDefaultFiles","combineSlots","extractSlotsFromRoutes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;IAoGsBA,eAAe;eAAfA;;IAmCA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;QACF;QAEA,qCAAqC;QACrC,IAAIC;QACH,CAACvE,gBAAgBI,kBAAkBmE,mBAAmB,GAAG,MAAMpC,QAAQC,GAAG,CACzE;YACEY,SAASvE,UAAUwC,qBAAU,CAACG,GAAG;YACjC4B,SAASrE,aAAasC,qBAAU,CAACG,GAAG;YACpC4B,SAASpE,cAAcqC,qBAAU,CAACG,GAAG;SACtC;QAGH,6CAA6C;QAC7C+C,QAAQK,IAAAA,4BAAY,EAClBC,IAAAA,sCAAsB,EAACzE,gBAAgBjE,cACvC0I,IAAAA,sCAAsB,EAACF;QAIvB,CAAA,EAAEtE,SAAS,EAAEC,gBAAgB,EAAE,GAAGxE,iBAClCsE,gBACAlC,kBACAiB,SACA,CAAC,CAACG,SACJ;QACAgF,eAAevI,oBAAoByE,kBAAkBrB,SAAS,CAAC,CAACG;IAClE;IAEA,OAAO;QACLe;QACAC;QACAgE;QACAC;QACA3E;QACAC;QACAO;QACAI;QACAb;QACAqE;QACAnD;IACF;AACF","ignoreList":[0]} |
@@ -142,3 +142,3 @@ "use strict"; | ||
| }({}); | ||
| const nextVersion = "16.3.1-canary.13"; | ||
| const nextVersion = "16.3.1-canary.14"; | ||
| const ArchName = (0, _os.arch)(); | ||
@@ -145,0 +145,0 @@ const PlatformName = (0, _os.platform)(); |
@@ -96,3 +96,3 @@ "use strict"; | ||
| isPersistentCachingEnabled: persistentCaching, | ||
| nextVersion: "16.3.1-canary.13" | ||
| nextVersion: "16.3.1-canary.14" | ||
| }, { | ||
@@ -99,0 +99,0 @@ turbopackMemoryEviction: config.experimental.turbopackMemoryEvictionMode, |
@@ -119,3 +119,3 @@ // Import cpu-profile first to start profiling early if enabled | ||
| deferredEntries: config.experimental.deferredEntries, | ||
| nextVersion: "16.3.1-canary.13" | ||
| nextVersion: "16.3.1-canary.14" | ||
| }; | ||
@@ -122,0 +122,0 @@ if (config.experimental.turbopackSeedCacheFromWorktree) { |
@@ -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/16s6g-zs4p3i7.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"sjV3vSFW8gzVuZR0aP_23"} | ||
| 0:{"rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/_next/static/chunks/16s6g-zs4p3i7.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"VzvKgv9k8K-iptijcpXUb"} | ||
| 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/09tfif45vshr2.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/16s6g-zs4p3i7.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":"sjV3vSFW8gzVuZR0aP_23"} | ||
| 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/09tfif45vshr2.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/16s6g-zs4p3i7.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":"VzvKgv9k8K-iptijcpXUb"} | ||
| 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":"sjV3vSFW8gzVuZR0aP_23"} | ||
| 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":"VzvKgv9k8K-iptijcpXUb"} |
@@ -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/09tfif45vshr2.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":"sjV3vSFW8gzVuZR0aP_23"} | ||
| 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/09tfif45vshr2.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":"VzvKgv9k8K-iptijcpXUb"} |
| :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":"sjV3vSFW8gzVuZR0aP_23"} | ||
| 0:{"tree":{"name":"","param":null,"prefetchHints":16,"slots":{"children":{"name":"__PAGE__","param":null,"prefetchHints":0,"slots":null}}},"staleTime":300,"buildId":"VzvKgv9k8K-iptijcpXUb"} |
@@ -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/0kor3_y3m.uh~.js"/><script src="/_next/static/chunks/0gto6h.7wfb54.js" async=""></script><script src="/_next/static/chunks/0o1qc.kvvuq1u.js" async=""></script><script src="/_next/static/chunks/turbopack-0vhvx5o96qn.d.js" async=""></script><script src="/_next/static/chunks/09tfif45vshr2.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/0kor3_y3m.uh~.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[85600,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"default\"]\n3:I[67998,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"default\"]\n4:I[12361,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[12361,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"ViewportBoundary\"]\na:I[12361,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"MetadataBoundary\"]\nc:I[90533,[\"/_next/static/chunks/09tfif45vshr2.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/09tfif45vshr2.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\":\"sjV3vSFW8gzVuZR0aP_23\"}\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/0kor3_y3m.uh~.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[85600,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"default\"]\n3:I[67998,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"default\"]\n4:I[12361,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[12361,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"ViewportBoundary\"]\na:I[12361,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"MetadataBoundary\"]\nc:I[90533,[\"/_next/static/chunks/09tfif45vshr2.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/09tfif45vshr2.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\":\"VzvKgv9k8K-iptijcpXUb\"}\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/09tfif45vshr2.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":"sjV3vSFW8gzVuZR0aP_23"} | ||
| 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/09tfif45vshr2.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":"VzvKgv9k8K-iptijcpXUb"} | ||
| 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/09tfif45vshr2.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":"sjV3vSFW8gzVuZR0aP_23"} | ||
| 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/09tfif45vshr2.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":"VzvKgv9k8K-iptijcpXUb"} | ||
| 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":"sjV3vSFW8gzVuZR0aP_23"} | ||
| 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":"VzvKgv9k8K-iptijcpXUb"} |
@@ -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/09tfif45vshr2.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":"sjV3vSFW8gzVuZR0aP_23"} | ||
| 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/09tfif45vshr2.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":"VzvKgv9k8K-iptijcpXUb"} |
| 1:"$Sreact.fragment" | ||
| 2:I[12361,["/_next/static/chunks/09tfif45vshr2.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":"sjV3vSFW8gzVuZR0aP_23"} | ||
| 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":"VzvKgv9k8K-iptijcpXUb"} | ||
| 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":"sjV3vSFW8gzVuZR0aP_23"} | ||
| 0:{"rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"isPartial":false,"staleTime":300,"varyParams":"$W4","buildId":"VzvKgv9k8K-iptijcpXUb"} |
| :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":"sjV3vSFW8gzVuZR0aP_23"} | ||
| 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":"VzvKgv9k8K-iptijcpXUb"} |
@@ -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/0kor3_y3m.uh~.js"/><script src="/_next/static/chunks/0gto6h.7wfb54.js" async=""></script><script src="/_next/static/chunks/0o1qc.kvvuq1u.js" async=""></script><script src="/_next/static/chunks/turbopack-0vhvx5o96qn.d.js" async=""></script><script src="/_next/static/chunks/09tfif45vshr2.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/0kor3_y3m.uh~.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[85600,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"default\"]\n3:I[67998,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"default\"]\n4:I[12361,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[12361,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"ViewportBoundary\"]\na:I[12361,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"MetadataBoundary\"]\nc:I[90533,[\"/_next/static/chunks/09tfif45vshr2.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/09tfif45vshr2.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\":\"sjV3vSFW8gzVuZR0aP_23\"}\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/0kor3_y3m.uh~.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[85600,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"default\"]\n3:I[67998,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"default\"]\n4:I[12361,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[12361,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"ViewportBoundary\"]\na:I[12361,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"MetadataBoundary\"]\nc:I[90533,[\"/_next/static/chunks/09tfif45vshr2.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/09tfif45vshr2.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\":\"VzvKgv9k8K-iptijcpXUb\"}\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/0kor3_y3m.uh~.js"/><script src="/_next/static/chunks/0gto6h.7wfb54.js" async=""></script><script src="/_next/static/chunks/0o1qc.kvvuq1u.js" async=""></script><script src="/_next/static/chunks/turbopack-0vhvx5o96qn.d.js" async=""></script><script src="/_next/static/chunks/09tfif45vshr2.js" async=""></script><script src="/_next/static/chunks/16s6g-zs4p3i7.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/0kor3_y3m.uh~.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[85600,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"default\"]\n3:I[67998,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"default\"]\n4:I[41813,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"ClientPageRoot\"]\n5:I[79331,[\"/_next/static/chunks/09tfif45vshr2.js\",\"/_next/static/chunks/16s6g-zs4p3i7.js\"],\"default\"]\n8:I[12361,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"OutletBoundary\"]\n9:\"$Sreact.suspense\"\nb:I[12361,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"ViewportBoundary\"]\nd:I[12361,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"MetadataBoundary\"]\nf:I[90533,[\"/_next/static/chunks/09tfif45vshr2.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/09tfif45vshr2.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/16s6g-zs4p3i7.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\":\"sjV3vSFW8gzVuZR0aP_23\"}\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/0kor3_y3m.uh~.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[85600,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"default\"]\n3:I[67998,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"default\"]\n4:I[41813,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"ClientPageRoot\"]\n5:I[79331,[\"/_next/static/chunks/09tfif45vshr2.js\",\"/_next/static/chunks/16s6g-zs4p3i7.js\"],\"default\"]\n8:I[12361,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"OutletBoundary\"]\n9:\"$Sreact.suspense\"\nb:I[12361,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"ViewportBoundary\"]\nd:I[12361,[\"/_next/static/chunks/09tfif45vshr2.js\"],\"MetadataBoundary\"]\nf:I[90533,[\"/_next/static/chunks/09tfif45vshr2.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/09tfif45vshr2.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/16s6g-zs4p3i7.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\":\"VzvKgv9k8K-iptijcpXUb\"}\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/09tfif45vshr2.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/16s6g-zs4p3i7.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":"sjV3vSFW8gzVuZR0aP_23"} | ||
| 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/09tfif45vshr2.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/16s6g-zs4p3i7.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":"VzvKgv9k8K-iptijcpXUb"} | ||
| 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.1-canary.13"})`; | ||
| process.title = `next-build (v${"16.3.1-canary.14"})`; | ||
| 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.1-canary.13"); | ||
| await bindings.turbo.databaseCompact(cachePath, "16.3.1-canary.14"); | ||
| 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.1-canary.13"; | ||
| const version = "16.3.1-canary.14"; | ||
| window.next = { | ||
@@ -21,0 +21,0 @@ version, |
@@ -13,2 +13,3 @@ import { type AppRouterState, type ReducerActions, type ReducerState, type NavigateAction, ScrollBehavior, type AppHistoryState } from './router-reducer/router-reducer-types'; | ||
| needsRefresh?: boolean; | ||
| wasPreempted?: boolean; | ||
| last: ActionQueueNode | null; | ||
@@ -15,0 +16,0 @@ }; |
@@ -66,9 +66,17 @@ "use strict"; | ||
| } | ||
| if (actionQueue.pending === null && actionQueue.needsRefresh) { | ||
| // The queue is idle; flush the refresh requested by a discarded server | ||
| // action that revalidated data. | ||
| actionQueue.needsRefresh = false; | ||
| actionQueue.dispatch({ | ||
| type: _routerreducertypes.ACTION_REFRESH | ||
| }, setState); | ||
| if (actionQueue.pending === null) { | ||
| if (actionQueue.wasPreempted) { | ||
| actionQueue.wasPreempted = false; | ||
| // When an action is preempted, later actions can update the queue's state without React rendering it. | ||
| // Once the queue is empty, publish the final state so the UI catches up. | ||
| (0, _react.startTransition)(()=>setState(actionQueue.state)); | ||
| } | ||
| if (actionQueue.needsRefresh) { | ||
| // The queue is idle; flush the refresh requested by a discarded server | ||
| // action that revalidated data. | ||
| actionQueue.needsRefresh = false; | ||
| actionQueue.dispatch({ | ||
| type: _routerreducertypes.ACTION_REFRESH | ||
| }, setState); | ||
| } | ||
| } | ||
@@ -152,2 +160,3 @@ } | ||
| actionQueue.pending.discarded = true; | ||
| actionQueue.wasPreempted = true; | ||
| // The rest of the current queue should still execute after this navigation. | ||
@@ -154,0 +163,0 @@ // (Note that it can't contain any earlier navigations, because we always put those into `actionQueue.pending` by calling `runAction`) |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/client/components/app-router-instance.ts"],"sourcesContent":["import {\n type AppRouterState,\n type ReducerActions,\n type ReducerState,\n ACTION_REFRESH,\n ACTION_SERVER_ACTION,\n ACTION_NAVIGATE,\n ACTION_RESTORE,\n type NavigateAction,\n ACTION_HMR_REFRESH,\n PrefetchKind,\n ScrollBehavior,\n type AppHistoryState,\n} from './router-reducer/router-reducer-types'\nimport { reducer } from './router-reducer/router-reducer'\nimport { addTransitionType, startTransition } from 'react'\nimport { isThenable } from '../../shared/lib/is-thenable'\nimport {\n FetchStrategy,\n type PrefetchTaskFetchStrategy,\n} from './segment-cache/types'\nimport { prefetch as prefetchWithSegmentCache } from './segment-cache/prefetch'\nimport { navigate } from './segment-cache/navigation'\nimport {\n dispatchAppRouterAction,\n dispatchGestureState,\n} from './use-action-queue'\nimport { resetKnownRoutes } from './segment-cache/optimistic-routes'\nimport { FreshnessPolicy } from './router-reducer/ppr-navigations'\nimport { addBasePath } from '../add-base-path'\nimport { isExternalURL } from './app-router-utils'\nimport type {\n AppRouterInstance,\n NavigateOptions,\n PrefetchOptions,\n} from '../../shared/lib/app-router-context.shared-runtime'\nimport { setLinkForCurrentNavigation, type LinkInstance } from './links'\nimport type { RouterTransitionPrefetchIntent } from '../router-transition-types'\nimport type { GlobalErrorComponent } from './builtin/global-error'\nimport { isJavaScriptURLString } from '../lib/javascript-url'\nimport { startRouterTransition } from './router-transition'\n\nexport type DispatchStatePromise = React.Dispatch<ReducerState>\n\nexport type AppRouterActionQueue = {\n state: AppRouterState\n dispatch: (payload: ReducerActions, setState: DispatchStatePromise) => void\n action: (state: AppRouterState, action: ReducerActions) => ReducerState\n\n pending: ActionQueueNode | null\n needsRefresh?: boolean\n last: ActionQueueNode | null\n}\n\nexport type GlobalErrorState = [\n GlobalError: GlobalErrorComponent,\n styles: React.ReactNode,\n]\n\nexport type ActionQueueNode = {\n payload: ReducerActions\n next: ActionQueueNode | null\n resolve: (value: ReducerState) => void\n reject: (err: Error) => void\n discarded?: boolean\n}\n\nfunction runRemainingActions(\n actionQueue: AppRouterActionQueue,\n settledAction: ActionQueueNode,\n setState: DispatchStatePromise\n) {\n // Only advance the queue if the settled action is still at its head. If a\n // navigation discarded this action, the navigation took its place and is\n // still in flight — starting the next queued action now would run it\n // against router state that doesn't include the navigation yet.\n if (actionQueue.pending === settledAction) {\n actionQueue.pending = settledAction.next\n if (actionQueue.pending !== null) {\n runAction({\n actionQueue,\n action: actionQueue.pending,\n setState,\n })\n return\n }\n }\n\n if (actionQueue.pending === null && actionQueue.needsRefresh) {\n // The queue is idle; flush the refresh requested by a discarded server\n // action that revalidated data.\n actionQueue.needsRefresh = false\n actionQueue.dispatch({ type: ACTION_REFRESH }, setState)\n }\n}\n\nasync function runAction({\n actionQueue,\n action,\n setState,\n}: {\n actionQueue: AppRouterActionQueue\n action: ActionQueueNode\n setState: DispatchStatePromise\n}) {\n const prevState = actionQueue.state\n\n actionQueue.pending = action\n\n const payload = action.payload\n const actionResult = actionQueue.action(prevState, payload)\n\n function handleResult(nextState: AppRouterState) {\n // if we discarded this action, the state should also be discarded\n if (action.discarded) {\n // Check if the discarded server action revalidated data\n if (\n action.payload.type === ACTION_SERVER_ACTION &&\n action.payload.didRevalidate\n ) {\n // The server action was discarded but it revalidated data,\n // mark that we need to refresh after all actions complete\n actionQueue.needsRefresh = true\n }\n // This can't advance the queue (this action is no longer its head), but\n // if the queue has already drained, it flushes the refresh now.\n runRemainingActions(actionQueue, action, setState)\n return\n }\n\n actionQueue.state = nextState\n\n runRemainingActions(actionQueue, action, setState)\n action.resolve(nextState)\n }\n\n // if the action is a promise, set up a callback to resolve it\n if (isThenable(actionResult)) {\n actionResult.then(handleResult, (err) => {\n runRemainingActions(actionQueue, action, setState)\n action.reject(err)\n })\n } else {\n handleResult(actionResult)\n }\n}\n\nfunction dispatchAction(\n actionQueue: AppRouterActionQueue,\n payload: ReducerActions,\n setState: DispatchStatePromise\n) {\n let resolvers: {\n resolve: (value: ReducerState) => void\n reject: (reason: any) => void\n } = { resolve: setState, reject: () => {} }\n\n // most of the action types are async with the exception of restore\n // it's important that restore is handled quickly since it's fired on the popstate event\n // and we don't want to add any delay on a back/forward nav\n // this only creates a promise for the async actions\n if (payload.type !== ACTION_RESTORE) {\n // Create the promise and assign the resolvers to the object.\n const deferredPromise = new Promise<AppRouterState>((resolve, reject) => {\n resolvers = { resolve, reject }\n })\n\n startTransition(() => {\n // we immediately notify React of the pending promise -- the resolver is attached to the action node\n // and will be called when the associated action promise resolves\n setState(deferredPromise)\n })\n }\n\n const newAction: ActionQueueNode = {\n payload,\n next: null,\n resolve: resolvers.resolve,\n reject: resolvers.reject,\n }\n\n // Check if the queue is empty\n if (actionQueue.pending === null) {\n // The queue is empty, so add the action and start it immediately\n // Mark this action as the last in the queue\n actionQueue.last = newAction\n\n runAction({\n actionQueue,\n action: newAction,\n setState,\n })\n } else if (\n payload.type === ACTION_NAVIGATE ||\n payload.type === ACTION_RESTORE\n ) {\n // Navigations (including back/forward) take priority over any pending actions.\n // Mark the pending action as discarded (so the state is never applied) and start the navigation action immediately.\n actionQueue.pending.discarded = true\n\n // The rest of the current queue should still execute after this navigation.\n // (Note that it can't contain any earlier navigations, because we always put those into `actionQueue.pending` by calling `runAction`)\n newAction.next = actionQueue.pending.next\n\n if (actionQueue.last === actionQueue.pending) {\n actionQueue.last = newAction\n }\n\n runAction({\n actionQueue,\n action: newAction,\n setState,\n })\n } else {\n // The queue is not empty, so add the action to the end of the queue\n // It will be started by runRemainingActions after the previous action finishes\n if (actionQueue.last !== null) {\n actionQueue.last.next = newAction\n }\n actionQueue.last = newAction\n }\n}\n\nlet globalActionQueue: AppRouterActionQueue | null = null\n\nexport function createMutableActionQueue(\n initialState: AppRouterState\n): AppRouterActionQueue {\n const actionQueue: AppRouterActionQueue = {\n state: initialState,\n dispatch: (payload: ReducerActions, setState: DispatchStatePromise) =>\n dispatchAction(actionQueue, payload, setState),\n action: async (state: AppRouterState, action: ReducerActions) => {\n const result = reducer(state, action)\n return result\n },\n pending: null,\n last: null,\n }\n\n if (typeof window !== 'undefined') {\n // The action queue is lazily created on hydration, but after that point\n // it doesn't change. So we can store it in a global rather than pass\n // it around everywhere via props/context.\n if (globalActionQueue !== null) {\n throw new Error(\n 'Internal Next.js Error: createMutableActionQueue was called more ' +\n 'than once'\n )\n }\n globalActionQueue = actionQueue\n }\n\n return actionQueue\n}\n\nexport function getCurrentAppRouterState(): AppRouterState | null {\n return globalActionQueue !== null ? globalActionQueue.state : null\n}\n\nfunction getAppRouterActionQueue(): AppRouterActionQueue {\n if (globalActionQueue === null) {\n throw new Error(\n 'Internal Next.js error: Router action dispatched before initialization.'\n )\n }\n return globalActionQueue\n}\n\nexport function dispatchNavigateAction(\n href: string,\n navigateType: NavigateAction['navigateType'],\n scrollBehavior: ScrollBehavior,\n linkInstanceRef: LinkInstance | null,\n transitionTypes: string[] | undefined,\n prefetchIntent: RouterTransitionPrefetchIntent | null\n): void {\n // TODO: This stuff could just go into the reducer. Leaving as-is for now\n // since we're about to rewrite all the router reducer stuff anyway.\n\n if (transitionTypes) {\n for (const type of transitionTypes) {\n addTransitionType(type)\n }\n }\n\n const url = new URL(addBasePath(href), location.href)\n if (process.env.__NEXT_APP_NAV_FAIL_HANDLING) {\n window.next.__pendingUrl = url\n }\n\n setLinkForCurrentNavigation(linkInstanceRef)\n startRouterTransition(\n href,\n navigateType,\n getAppRouterActionQueue().state.tree,\n prefetchIntent\n )\n\n dispatchAppRouterAction({\n type: ACTION_NAVIGATE,\n url,\n isExternalUrl: isExternalURL(url),\n locationSearch: location.search,\n scrollBehavior,\n navigateType,\n })\n}\n\nexport function dispatchTraverseAction(\n href: string,\n historyState: AppHistoryState | undefined\n) {\n startRouterTransition(\n href,\n 'traverse',\n getAppRouterActionQueue().state.tree,\n null\n )\n dispatchAppRouterAction({\n type: ACTION_RESTORE,\n url: new URL(href),\n historyState,\n })\n}\n\n/**\n * (Experimental) Perform a gesture navigation. This dispatches through React's\n * useOptimistic instead of the main action queue, allowing the state to be\n * shown during a gesture transition and discarded when the canonical navigation\n * completes.\n *\n * Only available when experimental.gestureTransition is enabled.\n */\nfunction gesturePush(href: string, options?: NavigateOptions): void {\n if (process.env.__NEXT_GESTURE_TRANSITION) {\n // TODO: Trigger a prefetch so the cache starts populating if there isn't\n // already a prefetch for this route.\n if (isJavaScriptURLString(href)) {\n throw new Error(\n 'Next.js has blocked a javascript: URL as a security precaution.'\n )\n }\n\n const state = getCurrentAppRouterState()\n if (state === null) {\n return\n }\n const url = new URL(addBasePath(href), location.href)\n if (isExternalURL(url)) {\n return\n }\n\n // Fork the router state for the duration of the gesture transition.\n const currentUrl = new URL(state.canonicalUrl, location.href)\n const scrollBehavior =\n options?.scroll === false\n ? ScrollBehavior.NoScroll\n : ScrollBehavior.Default\n // This is a special freshness policy that prevents dynamic requests from\n // being spawned. During the gesture, we should only show the cached\n // prefetched UI, not dynamic data.\n // TODO: In the case of navigations to an unknown route, this will still\n // end up performing a dynamic request. The plan is to do prefetch instead.\n // There's a separate TODO for this.\n const freshnessPolicy = FreshnessPolicy.Gesture\n const forkedGestureState = navigate(\n state,\n url,\n currentUrl,\n state.renderedSearch,\n state.cache,\n state.tree,\n state.nextUrl,\n freshnessPolicy,\n scrollBehavior,\n 'push'\n )\n dispatchGestureState(forkedGestureState)\n }\n}\n\n// Tracks the newest HMR refresh generation so that a newer refresh can abort\n// the request of the one it supersedes. Development only.\nlet activeHmrRefreshController: AbortController | null = null\n\n/**\n * The app router that is exposed through `useRouter`. These are public API\n * methods. Internal Next.js code should call the lower level methods directly\n * (although there's lots of existing code that doesn't do that).\n */\nexport const publicAppRouterInstance: AppRouterInstance = {\n back: () => window.history.back(),\n forward: () => window.history.forward(),\n prefetch:\n // Unlike the old implementation, the Segment Cache doesn't store its\n // data in the router reducer state; it writes into a global mutable\n // cache. So we don't need to dispatch an action.\n (href: string, options?: PrefetchOptions) => {\n if (isJavaScriptURLString(href)) {\n throw new Error(\n 'Next.js has blocked a javascript: URL as a security precaution.'\n )\n }\n const actionQueue = getAppRouterActionQueue()\n const prefetchKind = options?.kind ?? PrefetchKind.AUTO\n\n // We don't currently offer a way to issue a runtime prefetch via `router.prefetch()`.\n // This will be possible when we update its API to not take a PrefetchKind.\n let fetchStrategy: PrefetchTaskFetchStrategy\n switch (prefetchKind) {\n case PrefetchKind.AUTO: {\n // We default to PPR. We'll discover whether or not the route supports it with the initial prefetch.\n fetchStrategy = FetchStrategy.PPR\n break\n }\n case PrefetchKind.FULL: {\n fetchStrategy = FetchStrategy.Full\n break\n }\n default: {\n prefetchKind satisfies never\n // Despite typescript thinking that this can't happen,\n // we might get an unexpected value from user code.\n // We don't know what they want, but we know they want a prefetch,\n // so use the default.\n fetchStrategy = FetchStrategy.PPR\n }\n }\n\n prefetchWithSegmentCache(\n href,\n actionQueue.state.nextUrl,\n actionQueue.state.tree,\n fetchStrategy,\n options?.onInvalidate ?? null\n )\n },\n replace: (href: string, options?: NavigateOptions) => {\n if (isJavaScriptURLString(href)) {\n throw new Error(\n 'Next.js has blocked a javascript: URL as a security precaution.'\n )\n }\n startTransition(() => {\n dispatchNavigateAction(\n href,\n 'replace',\n options?.scroll === false\n ? ScrollBehavior.NoScroll\n : ScrollBehavior.Default,\n null,\n options?.transitionTypes,\n null\n )\n })\n },\n push: (href: string, options?: NavigateOptions) => {\n if (isJavaScriptURLString(href)) {\n throw new Error(\n 'Next.js has blocked a javascript: URL as a security precaution.'\n )\n }\n startTransition(() => {\n dispatchNavigateAction(\n href,\n 'push',\n options?.scroll === false\n ? ScrollBehavior.NoScroll\n : ScrollBehavior.Default,\n null,\n options?.transitionTypes,\n null\n )\n })\n },\n refresh: () => {\n startTransition(() => {\n dispatchAppRouterAction({\n type: ACTION_REFRESH,\n })\n })\n },\n hmrRefresh: () => {\n if (process.env.NODE_ENV !== 'development') {\n throw new Error(\n 'hmrRefresh can only be used in development mode. Please use refresh instead.'\n )\n } else {\n // Reset the known routes table so that route predictions are cleared\n // when routes change during development.\n resetKnownRoutes()\n let signal: AbortSignal | undefined\n if (process.env.__NEXT_SERVER_COMPONENTS_HMR_CANCELLATION) {\n // Abort the superseded generation before scheduling the new one, so its\n // request is torn down as early as possible. Halting (not rejecting)\n // makes the abort safe regardless of order.\n activeHmrRefreshController?.abort()\n activeHmrRefreshController = new AbortController()\n signal = activeHmrRefreshController.signal\n }\n startTransition(() => {\n dispatchAppRouterAction({\n type: ACTION_HMR_REFRESH,\n signal,\n })\n })\n }\n },\n // Default value. Each route segment provides its own value at runtime. Refer\n // to `useRouter()`.\n bfcacheId: '0',\n}\n\n// Conditionally add experimental_gesturePush when gestureTransition is enabled\nif (process.env.__NEXT_GESTURE_TRANSITION) {\n ;(publicAppRouterInstance as any).experimental_gesturePush = gesturePush\n}\n\n// Exists for debugging purposes. Don't use in application code.\nif (typeof window !== 'undefined' && window.next) {\n window.next.router = publicAppRouterInstance\n}\n"],"names":["createMutableActionQueue","dispatchNavigateAction","dispatchTraverseAction","getCurrentAppRouterState","publicAppRouterInstance","runRemainingActions","actionQueue","settledAction","setState","pending","next","runAction","action","needsRefresh","dispatch","type","ACTION_REFRESH","prevState","state","payload","actionResult","handleResult","nextState","discarded","ACTION_SERVER_ACTION","didRevalidate","resolve","isThenable","then","err","reject","dispatchAction","resolvers","ACTION_RESTORE","deferredPromise","Promise","startTransition","newAction","last","ACTION_NAVIGATE","globalActionQueue","initialState","result","reducer","window","Error","getAppRouterActionQueue","href","navigateType","scrollBehavior","linkInstanceRef","transitionTypes","prefetchIntent","addTransitionType","url","URL","addBasePath","location","process","env","__NEXT_APP_NAV_FAIL_HANDLING","__pendingUrl","setLinkForCurrentNavigation","startRouterTransition","tree","dispatchAppRouterAction","isExternalUrl","isExternalURL","locationSearch","search","historyState","gesturePush","options","__NEXT_GESTURE_TRANSITION","isJavaScriptURLString","currentUrl","canonicalUrl","scroll","ScrollBehavior","NoScroll","Default","freshnessPolicy","FreshnessPolicy","Gesture","forkedGestureState","navigate","renderedSearch","cache","nextUrl","dispatchGestureState","activeHmrRefreshController","back","history","forward","prefetch","prefetchKind","kind","PrefetchKind","AUTO","fetchStrategy","FetchStrategy","PPR","FULL","Full","prefetchWithSegmentCache","onInvalidate","replace","push","refresh","hmrRefresh","NODE_ENV","resetKnownRoutes","signal","__NEXT_SERVER_COMPONENTS_HMR_CANCELLATION","abort","AbortController","ACTION_HMR_REFRESH","bfcacheId","experimental_gesturePush","router"],"mappings":";;;;;;;;;;;;;;;;;;IAiOgBA,wBAAwB;eAAxBA;;IA4CAC,sBAAsB;eAAtBA;;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5CvB,4BAA4BwB;gBAC5BxB,6BAA6B,IAAIyB;gBACjCH,SAAStB,2BAA2BsB,MAAM;YAC5C;YACA5E,IAAAA,sBAAe,EAAC;gBACd6B,IAAAA,uCAAuB,EAAC;oBACtBlD,MAAMqG,sCAAkB;oBACxBJ;gBACF;YACF;QACF;IACF;IACA,6EAA6E;IAC7E,oBAAoB;IACpBK,WAAW;AACb;AAEA,+EAA+E;AAC/E,IAAI3D,QAAQC,GAAG,CAACc,yBAAyB,EAAE;;IACvCrE,wBAAgCkH,wBAAwB,GAAG/C;AAC/D;AAEA,gEAAgE;AAChE,IAAI,OAAO3B,WAAW,eAAeA,OAAOlC,IAAI,EAAE;IAChDkC,OAAOlC,IAAI,CAAC6G,MAAM,GAAGnH;AACvB","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/client/components/app-router-instance.ts"],"sourcesContent":["import {\n type AppRouterState,\n type ReducerActions,\n type ReducerState,\n ACTION_REFRESH,\n ACTION_SERVER_ACTION,\n ACTION_NAVIGATE,\n ACTION_RESTORE,\n type NavigateAction,\n ACTION_HMR_REFRESH,\n PrefetchKind,\n ScrollBehavior,\n type AppHistoryState,\n} from './router-reducer/router-reducer-types'\nimport { reducer } from './router-reducer/router-reducer'\nimport { addTransitionType, startTransition } from 'react'\nimport { isThenable } from '../../shared/lib/is-thenable'\nimport {\n FetchStrategy,\n type PrefetchTaskFetchStrategy,\n} from './segment-cache/types'\nimport { prefetch as prefetchWithSegmentCache } from './segment-cache/prefetch'\nimport { navigate } from './segment-cache/navigation'\nimport {\n dispatchAppRouterAction,\n dispatchGestureState,\n} from './use-action-queue'\nimport { resetKnownRoutes } from './segment-cache/optimistic-routes'\nimport { FreshnessPolicy } from './router-reducer/ppr-navigations'\nimport { addBasePath } from '../add-base-path'\nimport { isExternalURL } from './app-router-utils'\nimport type {\n AppRouterInstance,\n NavigateOptions,\n PrefetchOptions,\n} from '../../shared/lib/app-router-context.shared-runtime'\nimport { setLinkForCurrentNavigation, type LinkInstance } from './links'\nimport type { RouterTransitionPrefetchIntent } from '../router-transition-types'\nimport type { GlobalErrorComponent } from './builtin/global-error'\nimport { isJavaScriptURLString } from '../lib/javascript-url'\nimport { startRouterTransition } from './router-transition'\n\nexport type DispatchStatePromise = React.Dispatch<ReducerState>\n\nexport type AppRouterActionQueue = {\n state: AppRouterState\n dispatch: (payload: ReducerActions, setState: DispatchStatePromise) => void\n action: (state: AppRouterState, action: ReducerActions) => ReducerState\n\n pending: ActionQueueNode | null\n needsRefresh?: boolean\n wasPreempted?: boolean\n last: ActionQueueNode | null\n}\n\nexport type GlobalErrorState = [\n GlobalError: GlobalErrorComponent,\n styles: React.ReactNode,\n]\n\nexport type ActionQueueNode = {\n payload: ReducerActions\n next: ActionQueueNode | null\n resolve: (value: ReducerState) => void\n reject: (err: Error) => void\n discarded?: boolean\n}\n\nfunction runRemainingActions(\n actionQueue: AppRouterActionQueue,\n settledAction: ActionQueueNode,\n setState: DispatchStatePromise\n) {\n // Only advance the queue if the settled action is still at its head. If a\n // navigation discarded this action, the navigation took its place and is\n // still in flight — starting the next queued action now would run it\n // against router state that doesn't include the navigation yet.\n if (actionQueue.pending === settledAction) {\n actionQueue.pending = settledAction.next\n if (actionQueue.pending !== null) {\n runAction({\n actionQueue,\n action: actionQueue.pending,\n setState,\n })\n return\n }\n }\n\n if (actionQueue.pending === null) {\n if (actionQueue.wasPreempted) {\n actionQueue.wasPreempted = false\n // When an action is preempted, later actions can update the queue's state without React rendering it.\n // Once the queue is empty, publish the final state so the UI catches up.\n startTransition(() => setState(actionQueue.state))\n }\n\n if (actionQueue.needsRefresh) {\n // The queue is idle; flush the refresh requested by a discarded server\n // action that revalidated data.\n actionQueue.needsRefresh = false\n actionQueue.dispatch({ type: ACTION_REFRESH }, setState)\n }\n }\n}\n\nasync function runAction({\n actionQueue,\n action,\n setState,\n}: {\n actionQueue: AppRouterActionQueue\n action: ActionQueueNode\n setState: DispatchStatePromise\n}) {\n const prevState = actionQueue.state\n\n actionQueue.pending = action\n\n const payload = action.payload\n const actionResult = actionQueue.action(prevState, payload)\n\n function handleResult(nextState: AppRouterState) {\n // if we discarded this action, the state should also be discarded\n if (action.discarded) {\n // Check if the discarded server action revalidated data\n if (\n action.payload.type === ACTION_SERVER_ACTION &&\n action.payload.didRevalidate\n ) {\n // The server action was discarded but it revalidated data,\n // mark that we need to refresh after all actions complete\n actionQueue.needsRefresh = true\n }\n // This can't advance the queue (this action is no longer its head), but\n // if the queue has already drained, it flushes the refresh now.\n runRemainingActions(actionQueue, action, setState)\n return\n }\n\n actionQueue.state = nextState\n\n runRemainingActions(actionQueue, action, setState)\n action.resolve(nextState)\n }\n\n // if the action is a promise, set up a callback to resolve it\n if (isThenable(actionResult)) {\n actionResult.then(handleResult, (err) => {\n runRemainingActions(actionQueue, action, setState)\n action.reject(err)\n })\n } else {\n handleResult(actionResult)\n }\n}\n\nfunction dispatchAction(\n actionQueue: AppRouterActionQueue,\n payload: ReducerActions,\n setState: DispatchStatePromise\n) {\n let resolvers: {\n resolve: (value: ReducerState) => void\n reject: (reason: any) => void\n } = { resolve: setState, reject: () => {} }\n\n // most of the action types are async with the exception of restore\n // it's important that restore is handled quickly since it's fired on the popstate event\n // and we don't want to add any delay on a back/forward nav\n // this only creates a promise for the async actions\n if (payload.type !== ACTION_RESTORE) {\n // Create the promise and assign the resolvers to the object.\n const deferredPromise = new Promise<AppRouterState>((resolve, reject) => {\n resolvers = { resolve, reject }\n })\n\n startTransition(() => {\n // we immediately notify React of the pending promise -- the resolver is attached to the action node\n // and will be called when the associated action promise resolves\n setState(deferredPromise)\n })\n }\n\n const newAction: ActionQueueNode = {\n payload,\n next: null,\n resolve: resolvers.resolve,\n reject: resolvers.reject,\n }\n\n // Check if the queue is empty\n if (actionQueue.pending === null) {\n // The queue is empty, so add the action and start it immediately\n // Mark this action as the last in the queue\n actionQueue.last = newAction\n\n runAction({\n actionQueue,\n action: newAction,\n setState,\n })\n } else if (\n payload.type === ACTION_NAVIGATE ||\n payload.type === ACTION_RESTORE\n ) {\n // Navigations (including back/forward) take priority over any pending actions.\n // Mark the pending action as discarded (so the state is never applied) and start the navigation action immediately.\n actionQueue.pending.discarded = true\n actionQueue.wasPreempted = true\n\n // The rest of the current queue should still execute after this navigation.\n // (Note that it can't contain any earlier navigations, because we always put those into `actionQueue.pending` by calling `runAction`)\n newAction.next = actionQueue.pending.next\n\n if (actionQueue.last === actionQueue.pending) {\n actionQueue.last = newAction\n }\n\n runAction({\n actionQueue,\n action: newAction,\n setState,\n })\n } else {\n // The queue is not empty, so add the action to the end of the queue\n // It will be started by runRemainingActions after the previous action finishes\n if (actionQueue.last !== null) {\n actionQueue.last.next = newAction\n }\n actionQueue.last = newAction\n }\n}\n\nlet globalActionQueue: AppRouterActionQueue | null = null\n\nexport function createMutableActionQueue(\n initialState: AppRouterState\n): AppRouterActionQueue {\n const actionQueue: AppRouterActionQueue = {\n state: initialState,\n dispatch: (payload: ReducerActions, setState: DispatchStatePromise) =>\n dispatchAction(actionQueue, payload, setState),\n action: async (state: AppRouterState, action: ReducerActions) => {\n const result = reducer(state, action)\n return result\n },\n pending: null,\n last: null,\n }\n\n if (typeof window !== 'undefined') {\n // The action queue is lazily created on hydration, but after that point\n // it doesn't change. So we can store it in a global rather than pass\n // it around everywhere via props/context.\n if (globalActionQueue !== null) {\n throw new Error(\n 'Internal Next.js Error: createMutableActionQueue was called more ' +\n 'than once'\n )\n }\n globalActionQueue = actionQueue\n }\n\n return actionQueue\n}\n\nexport function getCurrentAppRouterState(): AppRouterState | null {\n return globalActionQueue !== null ? globalActionQueue.state : null\n}\n\nfunction getAppRouterActionQueue(): AppRouterActionQueue {\n if (globalActionQueue === null) {\n throw new Error(\n 'Internal Next.js error: Router action dispatched before initialization.'\n )\n }\n return globalActionQueue\n}\n\nexport function dispatchNavigateAction(\n href: string,\n navigateType: NavigateAction['navigateType'],\n scrollBehavior: ScrollBehavior,\n linkInstanceRef: LinkInstance | null,\n transitionTypes: string[] | undefined,\n prefetchIntent: RouterTransitionPrefetchIntent | null\n): void {\n // TODO: This stuff could just go into the reducer. Leaving as-is for now\n // since we're about to rewrite all the router reducer stuff anyway.\n\n if (transitionTypes) {\n for (const type of transitionTypes) {\n addTransitionType(type)\n }\n }\n\n const url = new URL(addBasePath(href), location.href)\n if (process.env.__NEXT_APP_NAV_FAIL_HANDLING) {\n window.next.__pendingUrl = url\n }\n\n setLinkForCurrentNavigation(linkInstanceRef)\n startRouterTransition(\n href,\n navigateType,\n getAppRouterActionQueue().state.tree,\n prefetchIntent\n )\n\n dispatchAppRouterAction({\n type: ACTION_NAVIGATE,\n url,\n isExternalUrl: isExternalURL(url),\n locationSearch: location.search,\n scrollBehavior,\n navigateType,\n })\n}\n\nexport function dispatchTraverseAction(\n href: string,\n historyState: AppHistoryState | undefined\n) {\n startRouterTransition(\n href,\n 'traverse',\n getAppRouterActionQueue().state.tree,\n null\n )\n dispatchAppRouterAction({\n type: ACTION_RESTORE,\n url: new URL(href),\n historyState,\n })\n}\n\n/**\n * (Experimental) Perform a gesture navigation. This dispatches through React's\n * useOptimistic instead of the main action queue, allowing the state to be\n * shown during a gesture transition and discarded when the canonical navigation\n * completes.\n *\n * Only available when experimental.gestureTransition is enabled.\n */\nfunction gesturePush(href: string, options?: NavigateOptions): void {\n if (process.env.__NEXT_GESTURE_TRANSITION) {\n // TODO: Trigger a prefetch so the cache starts populating if there isn't\n // already a prefetch for this route.\n if (isJavaScriptURLString(href)) {\n throw new Error(\n 'Next.js has blocked a javascript: URL as a security precaution.'\n )\n }\n\n const state = getCurrentAppRouterState()\n if (state === null) {\n return\n }\n const url = new URL(addBasePath(href), location.href)\n if (isExternalURL(url)) {\n return\n }\n\n // Fork the router state for the duration of the gesture transition.\n const currentUrl = new URL(state.canonicalUrl, location.href)\n const scrollBehavior =\n options?.scroll === false\n ? ScrollBehavior.NoScroll\n : ScrollBehavior.Default\n // This is a special freshness policy that prevents dynamic requests from\n // being spawned. During the gesture, we should only show the cached\n // prefetched UI, not dynamic data.\n // TODO: In the case of navigations to an unknown route, this will still\n // end up performing a dynamic request. The plan is to do prefetch instead.\n // There's a separate TODO for this.\n const freshnessPolicy = FreshnessPolicy.Gesture\n const forkedGestureState = navigate(\n state,\n url,\n currentUrl,\n state.renderedSearch,\n state.cache,\n state.tree,\n state.nextUrl,\n freshnessPolicy,\n scrollBehavior,\n 'push'\n )\n dispatchGestureState(forkedGestureState)\n }\n}\n\n// Tracks the newest HMR refresh generation so that a newer refresh can abort\n// the request of the one it supersedes. Development only.\nlet activeHmrRefreshController: AbortController | null = null\n\n/**\n * The app router that is exposed through `useRouter`. These are public API\n * methods. Internal Next.js code should call the lower level methods directly\n * (although there's lots of existing code that doesn't do that).\n */\nexport const publicAppRouterInstance: AppRouterInstance = {\n back: () => window.history.back(),\n forward: () => window.history.forward(),\n prefetch:\n // Unlike the old implementation, the Segment Cache doesn't store its\n // data in the router reducer state; it writes into a global mutable\n // cache. So we don't need to dispatch an action.\n (href: string, options?: PrefetchOptions) => {\n if (isJavaScriptURLString(href)) {\n throw new Error(\n 'Next.js has blocked a javascript: URL as a security precaution.'\n )\n }\n const actionQueue = getAppRouterActionQueue()\n const prefetchKind = options?.kind ?? PrefetchKind.AUTO\n\n // We don't currently offer a way to issue a runtime prefetch via `router.prefetch()`.\n // This will be possible when we update its API to not take a PrefetchKind.\n let fetchStrategy: PrefetchTaskFetchStrategy\n switch (prefetchKind) {\n case PrefetchKind.AUTO: {\n // We default to PPR. We'll discover whether or not the route supports it with the initial prefetch.\n fetchStrategy = FetchStrategy.PPR\n break\n }\n case PrefetchKind.FULL: {\n fetchStrategy = FetchStrategy.Full\n break\n }\n default: {\n prefetchKind satisfies never\n // Despite typescript thinking that this can't happen,\n // we might get an unexpected value from user code.\n // We don't know what they want, but we know they want a prefetch,\n // so use the default.\n fetchStrategy = FetchStrategy.PPR\n }\n }\n\n prefetchWithSegmentCache(\n href,\n actionQueue.state.nextUrl,\n actionQueue.state.tree,\n fetchStrategy,\n options?.onInvalidate ?? null\n )\n },\n replace: (href: string, options?: NavigateOptions) => {\n if (isJavaScriptURLString(href)) {\n throw new Error(\n 'Next.js has blocked a javascript: URL as a security precaution.'\n )\n }\n startTransition(() => {\n dispatchNavigateAction(\n href,\n 'replace',\n options?.scroll === false\n ? ScrollBehavior.NoScroll\n : ScrollBehavior.Default,\n null,\n options?.transitionTypes,\n null\n )\n })\n },\n push: (href: string, options?: NavigateOptions) => {\n if (isJavaScriptURLString(href)) {\n throw new Error(\n 'Next.js has blocked a javascript: URL as a security precaution.'\n )\n }\n startTransition(() => {\n dispatchNavigateAction(\n href,\n 'push',\n options?.scroll === false\n ? ScrollBehavior.NoScroll\n : ScrollBehavior.Default,\n null,\n options?.transitionTypes,\n null\n )\n })\n },\n refresh: () => {\n startTransition(() => {\n dispatchAppRouterAction({\n type: ACTION_REFRESH,\n })\n })\n },\n hmrRefresh: () => {\n if (process.env.NODE_ENV !== 'development') {\n throw new Error(\n 'hmrRefresh can only be used in development mode. Please use refresh instead.'\n )\n } else {\n // Reset the known routes table so that route predictions are cleared\n // when routes change during development.\n resetKnownRoutes()\n let signal: AbortSignal | undefined\n if (process.env.__NEXT_SERVER_COMPONENTS_HMR_CANCELLATION) {\n // Abort the superseded generation before scheduling the new one, so its\n // request is torn down as early as possible. Halting (not rejecting)\n // makes the abort safe regardless of order.\n activeHmrRefreshController?.abort()\n activeHmrRefreshController = new AbortController()\n signal = activeHmrRefreshController.signal\n }\n startTransition(() => {\n dispatchAppRouterAction({\n type: ACTION_HMR_REFRESH,\n signal,\n })\n })\n }\n },\n // Default value. Each route segment provides its own value at runtime. Refer\n // to `useRouter()`.\n bfcacheId: '0',\n}\n\n// Conditionally add experimental_gesturePush when gestureTransition is enabled\nif (process.env.__NEXT_GESTURE_TRANSITION) {\n ;(publicAppRouterInstance as any).experimental_gesturePush = gesturePush\n}\n\n// Exists for debugging purposes. Don't use in application code.\nif (typeof window !== 'undefined' && window.next) {\n window.next.router = publicAppRouterInstance\n}\n"],"names":["createMutableActionQueue","dispatchNavigateAction","dispatchTraverseAction","getCurrentAppRouterState","publicAppRouterInstance","runRemainingActions","actionQueue","settledAction","setState","pending","next","runAction","action","wasPreempted","startTransition","state","needsRefresh","dispatch","type","ACTION_REFRESH","prevState","payload","actionResult","handleResult","nextState","discarded","ACTION_SERVER_ACTION","didRevalidate","resolve","isThenable","then","err","reject","dispatchAction","resolvers","ACTION_RESTORE","deferredPromise","Promise","newAction","last","ACTION_NAVIGATE","globalActionQueue","initialState","result","reducer","window","Error","getAppRouterActionQueue","href","navigateType","scrollBehavior","linkInstanceRef","transitionTypes","prefetchIntent","addTransitionType","url","URL","addBasePath","location","process","env","__NEXT_APP_NAV_FAIL_HANDLING","__pendingUrl","setLinkForCurrentNavigation","startRouterTransition","tree","dispatchAppRouterAction","isExternalUrl","isExternalURL","locationSearch","search","historyState","gesturePush","options","__NEXT_GESTURE_TRANSITION","isJavaScriptURLString","currentUrl","canonicalUrl","scroll","ScrollBehavior","NoScroll","Default","freshnessPolicy","FreshnessPolicy","Gesture","forkedGestureState","navigate","renderedSearch","cache","nextUrl","dispatchGestureState","activeHmrRefreshController","back","history","forward","prefetch","prefetchKind","kind","PrefetchKind","AUTO","fetchStrategy","FetchStrategy","PPR","FULL","Full","prefetchWithSegmentCache","onInvalidate","replace","push","refresh","hmrRefresh","NODE_ENV","resetKnownRoutes","signal","__NEXT_SERVER_COMPONENTS_HMR_CANCELLATION","abort","AbortController","ACTION_HMR_REFRESH","bfcacheId","experimental_gesturePush","router"],"mappings":";;;;;;;;;;;;;;;;;;IA4OgBA,wBAAwB;eAAxBA;;IA4CAC,sBAAsB;eAAtBA;;IAwCAC,sBAAsB;eAAtBA;;IArDAC,wBAAwB;eAAxBA;;IAuIHC,uBAAuB;eAAvBA;;;oCArYN;+BACiB;uBAC2B;4BACxB;uBAIpB;0BAC8C;4BAC5B;gCAIlB;kCAC0B;gCACD;6BACJ;gCACE;uBAMiC;+BAGzB;kCACA;AA4BtC,SAASC,oBACPC,WAAiC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5BxB,6BAA6B,IAAIyB;gBACjCH,SAAStB,2BAA2BsB,MAAM;YAC5C;YACAnG,IAAAA,sBAAe,EAAC;gBACdoD,IAAAA,uCAAuB,EAAC;oBACtBhD,MAAMmG,sCAAkB;oBACxBJ;gBACF;YACF;QACF;IACF;IACA,6EAA6E;IAC7E,oBAAoB;IACpBK,WAAW;AACb;AAEA,+EAA+E;AAC/E,IAAI3D,QAAQC,GAAG,CAACc,yBAAyB,EAAE;;IACvCtE,wBAAgCmH,wBAAwB,GAAG/C;AAC/D;AAEA,gEAAgE;AAChE,IAAI,OAAO3B,WAAW,eAAeA,OAAOnC,IAAI,EAAE;IAChDmC,OAAOnC,IAAI,CAAC8G,MAAM,GAAGpH;AACvB","ignoreList":[0]} |
@@ -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.1-canary.13"; | ||
| const version = "16.3.1-canary.14"; | ||
| let router; | ||
@@ -66,0 +66,0 @@ const emitter = (0, _mitt.default)(); |
@@ -66,3 +66,3 @@ import path from 'node:path'; | ||
| 'process.env.__NEXT_APP_NAV_FAIL_HANDLING': Boolean(config.experimental.appNavFailHandling), | ||
| 'process.env.__NEXT_TURBOPACK_SHARED_RUNTIME': config.experimental.turbopackSharedRuntime !== false, | ||
| 'process.env.__NEXT_TURBOPACK_SHARED_RUNTIME': Boolean(config.experimental.turbopackSharedRuntime), | ||
| 'process.env.__NEXT_CACHE_COMPONENTS': isCacheComponentsEnabled, | ||
@@ -69,0 +69,0 @@ 'process.env.__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS': Boolean(config.experimental.cachedNavigations), |
@@ -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 {\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 | NextConfigComplete['cacheLife']\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 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_TURBOPACK_SHARED_RUNTIME':\n config.experimental.turbopackSharedRuntime !== false,\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_REQUEST_INSIGHTS':\n dev && !!config.experimental.requestInsights,\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.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_SERVER_COMPONENTS_HMR_CANCELLATION': Boolean(\n config.experimental.serverComponentsHmrCancellation\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_VARY_PARAMS': config.experimental.varyParams ?? false,\n 'process.env.__NEXT_EXPOSE_TESTING_API':\n isCacheComponentsEnabled &&\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","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","isCacheComponentsEnabled","cacheComponents","isUseCacheEnabled","experimental","useCache","__NEXT_DEFINE_ENV","EdgeRuntime","process","env","NEXT_EDGE_RUNTIME_PROVIDER","NEXT_RSPACK","allowDevelopmentBuild","NEXT_PRIVATE_DISABLE_DEV_OVERLAY_UX","Boolean","appNavFailHandling","turbopackSharedRuntime","cachedNavigations","coldCacheBadge","requestInsights","supportsImmutableAssets","useSkewCookie","deploymentId","runtimeServerDeploymentId","__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING","manualClientBasePath","isNaN","Number","staleTimes","dynamic","static","clientRouterFilter","staticFilter","dynamicFilter","validateRSCRequestHeaders","serverComponentsHmrCancellation","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","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,SACEC,gBAAgB,EAChBC,iCAAiC,QAC5B,oBAAmB;AA8B1B,MAAMC,wBAAwBC,OAAO;AAqBrC;;CAEC,GACD,SAASC,mBAAmBC,SAAoB;IAC9C,MAAMC,uBAA4CC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BAAgBD,cAAc;YACNrB;QAA1B,MAAMiH,oBAAoBjH,EAAAA,oBAAAA,OAAO6G,QAAQ,qBAAf7G,kBAAiBkH,YAAY,KAAI,CAAC;QAC5D,IAAK,MAAMvH,OAAOsH,kBAAmB;YACnC,IAAI5H,UAAU0H,cAAc,CAACpH,MAAM;gBACjC,MAAM,qBAEL,CAFK,IAAIqH,MACR,CAAC,oEAAoE,EAAErH,IAAI,yFAAyF,CAAC,GADjK,qBAAA;2BAAA;gCAAA;kCAAA;gBAEN;YACF;YACAN,SAAS,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,OAAO+B,YAAY,CAACmB,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 {\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 | NextConfigComplete['cacheLife']\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 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_TURBOPACK_SHARED_RUNTIME': Boolean(\n config.experimental.turbopackSharedRuntime\n ),\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_REQUEST_INSIGHTS':\n dev && !!config.experimental.requestInsights,\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.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_SERVER_COMPONENTS_HMR_CANCELLATION': Boolean(\n config.experimental.serverComponentsHmrCancellation\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_VARY_PARAMS': config.experimental.varyParams ?? false,\n 'process.env.__NEXT_EXPOSE_TESTING_API':\n isCacheComponentsEnabled &&\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","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","isCacheComponentsEnabled","cacheComponents","isUseCacheEnabled","experimental","useCache","__NEXT_DEFINE_ENV","EdgeRuntime","process","env","NEXT_EDGE_RUNTIME_PROVIDER","NEXT_RSPACK","allowDevelopmentBuild","NEXT_PRIVATE_DISABLE_DEV_OVERLAY_UX","Boolean","appNavFailHandling","turbopackSharedRuntime","cachedNavigations","coldCacheBadge","requestInsights","supportsImmutableAssets","useSkewCookie","deploymentId","runtimeServerDeploymentId","__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING","manualClientBasePath","isNaN","Number","staleTimes","dynamic","static","clientRouterFilter","staticFilter","dynamicFilter","validateRSCRequestHeaders","serverComponentsHmrCancellation","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","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,SACEC,gBAAgB,EAChBC,iCAAiC,QAC5B,oBAAmB;AA8B1B,MAAMC,wBAAwBC,OAAO;AAqBrC;;CAEC,GACD,SAASC,mBAAmBC,SAAoB;IAC9C,MAAMC,uBAA4CC,OAAOC,WAAW,CAClED,OAAOE,OA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A1B,MAAMiH,oBAAoBjH,EAAAA,oBAAAA,OAAO6G,QAAQ,qBAAf7G,kBAAiBkH,YAAY,KAAI,CAAC;QAC5D,IAAK,MAAMvH,OAAOsH,kBAAmB;YACnC,IAAI5H,UAAU0H,cAAc,CAACpH,MAAM;gBACjC,MAAM,qBAEL,CAFK,IAAIqH,MACR,CAAC,oEAAoE,EAAErH,IAAI,yFAAyF,CAAC,GADjK,qBAAA;2BAAA;gCAAA;kCAAA;gBAEN;YACF;YACAN,SAAS,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,OAAO+B,YAAY,CAACmB,yBAAyB,EAAE;YAClD,KAAK,MAAMvD,OAAO;gBAAC;aAAiC,CAAE;gBACpDwH,mBAAmB,CAACxH,IAAI,GAAGyH,QAAQzH;YACrC;QACF;IACF;IAEA,OAAOwH;AACT","ignoreList":[0]} |
@@ -21,2 +21,17 @@ import { join } from 'path'; | ||
| ]); | ||
| const PAGES_SUPPORT_ROUTES = new Set([ | ||
| '/_app', | ||
| '/_document', | ||
| '/_error', | ||
| '/404', | ||
| '/500' | ||
| ]); | ||
| const PAGES_FRAMEWORK_ROUTES = new Set([ | ||
| '/_app', | ||
| '/_document', | ||
| '/_error' | ||
| ]); | ||
| function isRenderablePagesRoute(page) { | ||
| return !PAGES_FRAMEWORK_ROUTES.has(page) && page !== '/api' && !page.startsWith('/api/'); | ||
| } | ||
| function removeSuffix(value, suffix) { | ||
@@ -244,3 +259,14 @@ return value.endsWith(suffix) ? value.slice(0, -suffix.length) : value; | ||
| const debugPathsSet = new Set(debugPaths); | ||
| return paths.filter((p)=>debugPathsSet.has(p)); | ||
| const filteredPaths = paths.filter((p)=>debugPathsSet.has(p)); | ||
| const hasPagesRoute = filteredPaths.some((p)=>isRenderablePagesRoute(getPageFromPath(p, pageExtensions))); | ||
| if (!hasPagesRoute) { | ||
| return filteredPaths; | ||
| } | ||
| const filteredPathsSet = new Set(filteredPaths); | ||
| for (const path of paths){ | ||
| if (PAGES_SUPPORT_ROUTES.has(getPageFromPath(path, pageExtensions))) { | ||
| filteredPathsSet.add(path); | ||
| } | ||
| } | ||
| return paths.filter((p)=>filteredPathsSet.has(p)); | ||
| } | ||
@@ -247,0 +273,0 @@ // Empty array means build none |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/build/route-discovery.ts"],"sourcesContent":["import { join } from 'path'\nimport { createValidFileMatcher } from '../server/lib/find-page-file'\nimport { recursiveReadDir } from '../lib/recursive-readdir'\nimport {\n APP_DIR_ALIAS,\n PAGES_DIR_ALIAS,\n ROOT_DIR_ALIAS,\n} from '../lib/constants'\nimport { normalizePathSep } from '../shared/lib/page-path/normalize-path-sep'\nimport { normalizeAppPath } from '../shared/lib/router/utils/app-paths'\nimport { ensureLeadingSlash } from '../shared/lib/page-path/ensure-leading-slash'\nimport { PAGE_TYPES } from '../lib/page-types'\nimport {\n extractSlotsFromRoutes,\n combineSlots,\n type SlotInfo,\n type RouteInfo,\n} from './file-classifier'\nimport {\n normalizeMetadataRoute,\n normalizeMetadataPageToRoute,\n} from '../lib/metadata/get-metadata-route'\nimport { isMetadataRouteFile } from '../lib/metadata/is-metadata-route'\nimport { getPageStaticInfo } from './analysis/get-page-static-info'\nimport {\n UNDERSCORE_NOT_FOUND_ROUTE,\n UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n UNDERSCORE_GLOBAL_ERROR_ROUTE,\n UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY,\n} from '../shared/lib/entry-constants'\nimport { isReservedPage } from './utils'\nimport type { PageExtensions } from './page-extensions-type'\nimport type { MappedPages } from './build-context'\n\nconst PRIVATE_PAGES_PREFIX_REGEX = /^private-next-pages\\//\nconst PRIVATE_APP_PREFIX_REGEX = /^private-next-app-dir\\//\nconst SKIP_ROUTES = new Set([\n UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY,\n])\n\nfunction removeSuffix(value: string, suffix: string): string {\n return value.endsWith(suffix) ? value.slice(0, -suffix.length) : value\n}\n\n/** Normalize a route for the app router */\nfunction normalizeAppRoute(pageName: string): string {\n return normalizeAppPath(normalizePathSep(pageName))\n}\n\n/** Normalize a layout route (strip /layout suffix) */\nfunction normalizeLayoutRoute(pageName: string): string {\n return ensureLeadingSlash(\n removeSuffix(normalizeAppPath(normalizePathSep(pageName)), '/layout')\n )\n}\n\n/**\n * For a given page path removes the provided extensions.\n */\nexport function getPageFromPath(\n pagePath: string,\n pageExtensions: PageExtensions\n) {\n let page = normalizePathSep(pagePath)\n // Try longer extensions first so compound extensions like 'page.js'\n // match before shorter ones like 'js'\n const sorted = [...pageExtensions].sort((a, b) => b.length - a.length)\n for (const extension of sorted) {\n const next = removeSuffix(page, `.${extension}`)\n if (next !== page) {\n page = next\n break\n }\n }\n\n page = removeSuffix(page, '/index')\n\n return page === '' ? '/' : page\n}\n\n/**\n * Collect app pages, layouts, and default files from the app directory\n */\nexport async function collectAppFiles(\n appDir: string,\n validFileMatcher: ReturnType<typeof createValidFileMatcher>\n): Promise<{\n appPaths: string[]\n layoutPaths: string[]\n defaultPaths: string[]\n}> {\n const allAppFiles = await recursiveReadDir(appDir, {\n pathnameFilter: (absolutePath) =>\n validFileMatcher.isAppRouterPage(absolutePath) ||\n validFileMatcher.isRootNotFound(absolutePath) ||\n validFileMatcher.isAppLayoutPage(absolutePath) ||\n validFileMatcher.isAppDefaultPage(absolutePath),\n ignorePartFilter: (part) => part.startsWith('_'),\n })\n\n const appPaths = allAppFiles.filter(\n (absolutePath) =>\n validFileMatcher.isAppRouterPage(absolutePath) ||\n validFileMatcher.isRootNotFound(absolutePath)\n )\n const layoutPaths = allAppFiles.filter((absolutePath) =>\n validFileMatcher.isAppLayoutPage(absolutePath)\n )\n const defaultPaths = allAppFiles.filter((absolutePath) =>\n validFileMatcher.isAppDefaultPage(absolutePath)\n )\n\n return { appPaths, layoutPaths, defaultPaths }\n}\n\n/**\n * Collect pages from the pages directory\n */\nexport async function collectPagesFiles(\n pagesDir: string,\n validFileMatcher: ReturnType<typeof createValidFileMatcher>\n): Promise<string[]> {\n return await recursiveReadDir(pagesDir, {\n pathnameFilter: validFileMatcher.isPageFile,\n })\n}\n\n/**\n * Create a relative file path from a mapped page path\n */\nexport function createRelativeFilePath(\n baseDir: string,\n filePath: string,\n prefix: 'pages' | 'app',\n isSrcDir: boolean\n): string {\n const privatePrefixRegex =\n prefix === 'pages' ? PRIVATE_PAGES_PREFIX_REGEX : PRIVATE_APP_PREFIX_REGEX\n const srcPrefix = isSrcDir ? 'src/' : ''\n return join(\n baseDir,\n filePath.replace(privatePrefixRegex, `${srcPrefix}${prefix}/`)\n )\n}\n\n/**\n * Process pages routes from mapped pages\n */\nexport function processPageRoutes(\n mappedPages: { [page: string]: string },\n baseDir: string,\n isSrcDir: boolean\n): {\n pageRoutes: RouteInfo[]\n pageApiRoutes: RouteInfo[]\n} {\n const pageRoutes: RouteInfo[] = []\n const pageApiRoutes: RouteInfo[] = []\n\n for (const [route, filePath] of Object.entries(mappedPages)) {\n const relativeFilePath = createRelativeFilePath(\n baseDir,\n filePath,\n 'pages',\n isSrcDir\n )\n\n if (route.startsWith('/api/')) {\n pageApiRoutes.push({\n route: normalizePathSep(route),\n filePath: relativeFilePath,\n })\n } else {\n if (isReservedPage(route)) continue\n\n pageRoutes.push({\n route: normalizePathSep(route),\n filePath: relativeFilePath,\n })\n }\n }\n\n return { pageRoutes, pageApiRoutes }\n}\n\n/**\n * Process app routes from mapped app pages\n */\nexport function processAppRoutes(\n mappedAppPages: { [page: string]: string },\n validFileMatcher: ReturnType<typeof createValidFileMatcher>,\n baseDir: string,\n isSrcDir: boolean\n): {\n appRoutes: RouteInfo[]\n appRouteHandlers: RouteInfo[]\n} {\n const appRoutes: RouteInfo[] = []\n const appRouteHandlers: RouteInfo[] = []\n\n for (const [page, filePath] of Object.entries(mappedAppPages)) {\n if (\n page === UNDERSCORE_NOT_FOUND_ROUTE_ENTRY ||\n page === UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY\n ) {\n continue\n }\n\n const relativeFilePath = createRelativeFilePath(\n baseDir,\n filePath,\n 'app',\n isSrcDir\n )\n const route = normalizeAppRoute(page)\n\n if (validFileMatcher.isAppRouterRoute(filePath)) {\n appRouteHandlers.push({ route, filePath: relativeFilePath })\n } else {\n appRoutes.push({ route, filePath: relativeFilePath })\n }\n }\n\n return { appRoutes, appRouteHandlers }\n}\n\n/**\n * Process layout routes from mapped app layouts\n */\nexport function processLayoutRoutes(\n mappedAppLayouts: { [page: string]: string },\n baseDir: string,\n isSrcDir: boolean\n): RouteInfo[] {\n return Object.entries(mappedAppLayouts).map(([route, filePath]) => ({\n route: normalizeLayoutRoute(route),\n filePath: createRelativeFilePath(baseDir, filePath, 'app', isSrcDir),\n }))\n}\n\n/**\n * Creates a mapping of route to page file path for a given list of page paths.\n */\nexport async function createPagesMapping({\n isDev,\n pageExtensions,\n pagePaths,\n pagesType,\n pagesDir,\n appDir,\n appDirOnly,\n}: {\n isDev: boolean\n pageExtensions: PageExtensions\n pagePaths: string[]\n pagesType: PAGE_TYPES\n pagesDir: string | undefined\n appDir: string | undefined\n appDirOnly: boolean\n}): Promise<MappedPages> {\n const isAppRoute = pagesType === 'app'\n\n const promises = pagePaths.map<Promise<[string, string] | undefined>>(\n async (pagePath) => {\n if (pagePath.endsWith('.d.ts') && pageExtensions.includes('ts')) {\n return\n }\n\n let pageKey = getPageFromPath(pagePath, pageExtensions)\n if (isAppRoute) {\n // Turbopack encodes '_' as '%5F' in app paths; normalize to underscores.\n pageKey = pageKey.replace(/%5F/g, '_')\n if (pageKey === UNDERSCORE_NOT_FOUND_ROUTE) {\n pageKey = UNDERSCORE_NOT_FOUND_ROUTE_ENTRY\n }\n if (pageKey === UNDERSCORE_GLOBAL_ERROR_ROUTE) {\n pageKey = UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY\n }\n }\n\n const normalizedPath = normalizePathSep(\n join(\n pagesType === PAGE_TYPES.PAGES\n ? PAGES_DIR_ALIAS\n : pagesType === PAGE_TYPES.APP\n ? APP_DIR_ALIAS\n : ROOT_DIR_ALIAS,\n pagePath\n )\n )\n\n let route =\n pagesType === PAGE_TYPES.APP ? normalizeMetadataRoute(pageKey) : pageKey\n\n if (\n pagesType === PAGE_TYPES.APP &&\n isMetadataRouteFile(pagePath, pageExtensions, true)\n ) {\n const filePath = join(appDir!, pagePath)\n const staticInfo = await getPageStaticInfo({\n nextConfig: {},\n pageFilePath: filePath,\n isDev,\n page: pageKey,\n pageType: pagesType,\n })\n\n route = normalizeMetadataPageToRoute(\n route,\n !!(staticInfo.generateImageMetadata || staticInfo.generateSitemaps)\n )\n }\n\n return [route, normalizedPath]\n }\n )\n\n const pages: MappedPages = Object.fromEntries(\n (await Promise.all(promises)).filter((entry) => entry != null)\n )\n\n switch (pagesType) {\n case PAGE_TYPES.ROOT: {\n return pages\n }\n case PAGE_TYPES.APP: {\n const hasAppPages = Object.keys(pages).length > 0\n const hasAppGlobalError = !isDev && appDirOnly\n return {\n ...(hasAppPages && {\n [UNDERSCORE_NOT_FOUND_ROUTE_ENTRY]: require.resolve(\n 'next/dist/client/components/builtin/global-not-found'\n ),\n }),\n ...(hasAppGlobalError && {\n [UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY]: require.resolve(\n 'next/dist/client/components/builtin/app-error'\n ),\n }),\n ...pages,\n }\n }\n case PAGE_TYPES.PAGES: {\n if (isDev) {\n delete pages['/_app']\n delete pages['/_error']\n delete pages['/_document']\n }\n\n const root = isDev && pagesDir ? PAGES_DIR_ALIAS : 'next/dist/pages'\n\n if (Object.keys(pages).length === 0 && !appDirOnly) {\n appDirOnly = true\n }\n\n return {\n ...((isDev || !appDirOnly) && {\n '/_app': `${root}/_app`,\n '/_error': `${root}/_error`,\n '/_document': `${root}/_document`,\n ...pages,\n }),\n }\n }\n default: {\n return {}\n }\n }\n}\n\nexport interface RouteDiscoveryOptions {\n appDir?: string\n pagesDir?: string\n pageExtensions: string[]\n isDev: boolean\n baseDir: string\n /** Whether the app/pages directories are under a /src directory. */\n isSrcDir?: boolean\n /** Override app-dir-only mode (e.g. from --experimental-app-only CLI flag) */\n appDirOnly?: boolean\n validFileMatcher?: ReturnType<typeof createValidFileMatcher>\n debugBuildPaths?: { app: string[]; pages: string[] }\n}\n\nexport interface RouteDiscoveryResult {\n appRoutes: RouteInfo[]\n appRouteHandlers: RouteInfo[]\n layoutRoutes: RouteInfo[]\n slots: SlotInfo[]\n pageRoutes: RouteInfo[]\n pageApiRoutes: RouteInfo[]\n mappedAppPages?: MappedPages\n mappedAppLayouts?: MappedPages\n mappedPages?: MappedPages\n /** Raw page file paths (post-filtering), useful for telemetry */\n pagesPaths: string[]\n /** Resolved app-dir-only state (may have been updated during discovery) */\n appDirOnly: boolean\n}\n\n/**\n * High-level API: Collect, map, and process all routes in one call\n */\nexport async function discoverRoutes(\n options: RouteDiscoveryOptions\n): Promise<RouteDiscoveryResult> {\n const {\n appDir,\n pagesDir,\n pageExtensions,\n isDev,\n baseDir,\n isSrcDir,\n debugBuildPaths,\n } = options\n\n const validFileMatcher =\n options.validFileMatcher || createValidFileMatcher(pageExtensions, appDir)\n\n let appDirOnly = options.appDirOnly ?? (!!appDir && !pagesDir)\n\n // Helper to reduce createPagesMapping boilerplate\n const mapPaths = (pagePaths: string[], pagesType: PAGE_TYPES) =>\n createPagesMapping({\n pagePaths,\n isDev,\n pagesType,\n pageExtensions,\n pagesDir,\n appDir,\n appDirOnly,\n })\n\n // Helper to apply debugBuildPaths filtering\n const applyDebugFilter = (\n paths: string[],\n debugPaths: string[]\n ): string[] => {\n if (debugPaths.length > 0) {\n const debugPathsSet = new Set(debugPaths)\n return paths.filter((p) => debugPathsSet.has(p))\n }\n // Empty array means build none\n return []\n }\n\n let pageRoutes: RouteInfo[] = []\n let pageApiRoutes: RouteInfo[] = []\n let mappedPages: MappedPages | undefined\n let pagesPaths: string[] = []\n\n if (pagesDir && !appDirOnly) {\n if (process.env.NEXT_PRIVATE_PAGE_PATHS) {\n pagesPaths = JSON.parse(process.env.NEXT_PRIVATE_PAGE_PATHS)\n } else {\n pagesPaths = await collectPagesFiles(pagesDir, validFileMatcher)\n\n if (debugBuildPaths) {\n pagesPaths = applyDebugFilter(pagesPaths, debugBuildPaths.pages)\n }\n }\n\n mappedPages = await mapPaths(pagesPaths, PAGE_TYPES.PAGES)\n\n // Update appDirOnly if no user page routes were found, so the\n // subsequent app mapping can emit the global error entry.\n if (Object.keys(mappedPages).length === 0) {\n appDirOnly = true\n }\n\n ;({ pageRoutes, pageApiRoutes } = processPageRoutes(\n mappedPages,\n baseDir,\n !!isSrcDir\n ))\n }\n\n let appRoutes: RouteInfo[] = []\n let appRouteHandlers: RouteInfo[] = []\n let layoutRoutes: RouteInfo[] = []\n let slots: SlotInfo[] = []\n let mappedAppPages: MappedPages | undefined\n let mappedAppLayouts: MappedPages | undefined\n\n if (appDir) {\n let appPaths: string[]\n let layoutPaths: string[]\n let defaultPaths: string[]\n\n if (process.env.NEXT_PRIVATE_APP_PATHS) {\n // Used for testing — override collected app paths\n appPaths = JSON.parse(process.env.NEXT_PRIVATE_APP_PATHS)\n layoutPaths = []\n defaultPaths = []\n } else {\n const result = await collectAppFiles(appDir, validFileMatcher)\n appPaths = result.appPaths\n layoutPaths = result.layoutPaths\n defaultPaths = result.defaultPaths\n\n if (debugBuildPaths) {\n appPaths = applyDebugFilter(appPaths, debugBuildPaths.app)\n }\n }\n\n // Map all app file types in parallel\n let mappedDefaultFiles: MappedPages\n ;[mappedAppPages, mappedAppLayouts, mappedDefaultFiles] = await Promise.all(\n [\n mapPaths(appPaths, PAGE_TYPES.APP),\n mapPaths(layoutPaths, PAGE_TYPES.APP),\n mapPaths(defaultPaths, PAGE_TYPES.APP),\n ]\n )\n\n // Extract slots from pages and default files\n slots = combineSlots(\n extractSlotsFromRoutes(mappedAppPages, SKIP_ROUTES),\n extractSlotsFromRoutes(mappedDefaultFiles)\n )\n\n // Process routes\n ;({ appRoutes, appRouteHandlers } = processAppRoutes(\n mappedAppPages,\n validFileMatcher,\n baseDir,\n !!isSrcDir\n ))\n layoutRoutes = processLayoutRoutes(mappedAppLayouts, baseDir, !!isSrcDir)\n }\n\n return {\n appRoutes,\n appRouteHandlers,\n layoutRoutes,\n slots,\n pageRoutes,\n pageApiRoutes,\n mappedAppPages,\n mappedAppLayouts,\n mappedPages,\n pagesPaths,\n appDirOnly,\n }\n}\n"],"names":["join","createValidFileMatcher","recursiveReadDir","APP_DIR_ALIAS","PAGES_DIR_ALIAS","ROOT_DIR_ALIAS","normalizePathSep","normalizeAppPath","ensureLeadingSlash","PAGE_TYPES","extractSlotsFromRoutes","combineSlots","normalizeMetadataRoute","normalizeMetadataPageToRoute","isMetadataRouteFile","getPageStaticInfo","UNDERSCORE_NOT_FOUND_ROUTE","UNDERSCORE_NOT_FOUND_ROUTE_ENTRY","UNDERSCORE_GLOBAL_ERROR_ROUTE","UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY","isReservedPage","PRIVATE_PAGES_PREFIX_REGEX","PRIVATE_APP_PREFIX_REGEX","SKIP_ROUTES","Set","removeSuffix","value","suffix","endsWith","slice","length","normalizeAppRoute","pageName","normalizeLayoutRoute","getPageFromPath","pagePath","pageExtensions","page","sorted","sort","a","b","extension","next","collectAppFiles","appDir","validFileMatcher","allAppFiles","pathnameFilter","absolutePath","isAppRouterPage","isRootNotFound","isAppLayoutPage","isAppDefaultPage","ignorePartFilter","part","startsWith","appPaths","filter","layoutPaths","defaultPaths","collectPagesFiles","pagesDir","isPageFile","createRelativeFilePath","baseDir","filePath","prefix","isSrcDir","privatePrefixRegex","srcPrefix","replace","processPageRoutes","mappedPages","pageRoutes","pageApiRoutes","route","Object","entries","relativeFilePath","push","processAppRoutes","mappedAppPages","appRoutes","appRouteHandlers","isAppRouterRoute","processLayoutRoutes","mappedAppLayouts","map","createPagesMapping","isDev","pagePaths","pagesType","appDirOnly","isAppRoute","promises","includes","pageKey","normalizedPath","PAGES","APP","staticInfo","nextConfig","pageFilePath","pageType","generateImageMetadata","generateSitemaps","pages","fromEntries","Promise","all","entry","ROOT","hasAppPages","keys","hasAppGlobalError","require","resolve","root","discoverRoutes","options","debugBuildPaths","mapPaths","applyDebugFilter","paths","debugPaths","debugPathsSet","p","has","pagesPaths","process","env","NEXT_PRIVATE_PAGE_PATHS","JSON","parse","layoutRoutes","slots","NEXT_PRIVATE_APP_PATHS","result","app","mappedDefaultFiles"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAM;AAC3B,SAASC,sBAAsB,QAAQ,+BAA8B;AACrE,SAASC,gBAAgB,QAAQ,2BAA0B;AAC3D,SACEC,aAAa,EACbC,eAAe,EACfC,cAAc,QACT,mBAAkB;AACzB,SAASC,gBAAgB,QAAQ,6CAA4C;AAC7E,SAASC,gBAAgB,QAAQ,uCAAsC;AACvE,SAASC,kBAAkB,QAAQ,+CAA8C;AACjF,SAASC,UAAU,QAAQ,oBAAmB;AAC9C,SACEC,sBAAsB,EACtBC,YAAY,QAGP,oBAAmB;AAC1B,SACEC,sBAAsB,EACtBC,4BAA4B,QACvB,qCAAoC;AAC3C,SAASC,mBAAmB,QAAQ,oCAAmC;AACvE,SAASC,iBAAiB,QAAQ,kC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AAWiF,OAAOjF,QAAQ;YAC1BE,cAAc+E,OAAO/E,WAAW;YAChCC,eAAe8E,OAAO9E,YAAY;YAElC,IAAI6D,iBAAiB;gBACnBhE,WAAWkE,iBAAiBlE,UAAUgE,gBAAgBkB,GAAG;YAC3D;QACF;QAEA,qCAAqC;QACrC,IAAIC;QACH,CAAC1D,gBAAgBK,kBAAkBqD,mBAAmB,GAAG,MAAM/B,QAAQC,GAAG,CACzE;YACEY,SAASjE,UAAUhD,WAAW2F,GAAG;YACjCsB,SAAS/D,aAAalD,WAAW2F,GAAG;YACpCsB,SAAS9D,cAAcnD,WAAW2F,GAAG;SACtC;QAGH,6CAA6C;QAC7CoC,QAAQ7H,aACND,uBAAuBwE,gBAAgB3D,cACvCb,uBAAuBkI;QAIvB,CAAA,EAAEzD,SAAS,EAAEC,gBAAgB,EAAE,GAAGH,iBAClCC,gBACApC,kBACAmB,SACA,CAAC,CAACG,SACJ;QACAmE,eAAejD,oBAAoBC,kBAAkBtB,SAAS,CAAC,CAACG;IAClE;IAEA,OAAO;QACLe;QACAC;QACAmD;QACAC;QACA9D;QACAC;QACAO;QACAK;QACAd;QACAwD;QACApC;IACF;AACF","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/build/route-discovery.ts"],"sourcesContent":["import { join } from 'path'\nimport { createValidFileMatcher } from '../server/lib/find-page-file'\nimport { recursiveReadDir } from '../lib/recursive-readdir'\nimport {\n APP_DIR_ALIAS,\n PAGES_DIR_ALIAS,\n ROOT_DIR_ALIAS,\n} from '../lib/constants'\nimport { normalizePathSep } from '../shared/lib/page-path/normalize-path-sep'\nimport { normalizeAppPath } from '../shared/lib/router/utils/app-paths'\nimport { ensureLeadingSlash } from '../shared/lib/page-path/ensure-leading-slash'\nimport { PAGE_TYPES } from '../lib/page-types'\nimport {\n extractSlotsFromRoutes,\n combineSlots,\n type SlotInfo,\n type RouteInfo,\n} from './file-classifier'\nimport {\n normalizeMetadataRoute,\n normalizeMetadataPageToRoute,\n} from '../lib/metadata/get-metadata-route'\nimport { isMetadataRouteFile } from '../lib/metadata/is-metadata-route'\nimport { getPageStaticInfo } from './analysis/get-page-static-info'\nimport {\n UNDERSCORE_NOT_FOUND_ROUTE,\n UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n UNDERSCORE_GLOBAL_ERROR_ROUTE,\n UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY,\n} from '../shared/lib/entry-constants'\nimport { isReservedPage } from './utils'\nimport type { PageExtensions } from './page-extensions-type'\nimport type { MappedPages } from './build-context'\n\nconst PRIVATE_PAGES_PREFIX_REGEX = /^private-next-pages\\//\nconst PRIVATE_APP_PREFIX_REGEX = /^private-next-app-dir\\//\nconst SKIP_ROUTES = new Set([\n UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY,\n])\nconst PAGES_SUPPORT_ROUTES = new Set([\n '/_app',\n '/_document',\n '/_error',\n '/404',\n '/500',\n])\nconst PAGES_FRAMEWORK_ROUTES = new Set(['/_app', '/_document', '/_error'])\n\nfunction isRenderablePagesRoute(page: string): boolean {\n return (\n !PAGES_FRAMEWORK_ROUTES.has(page) &&\n page !== '/api' &&\n !page.startsWith('/api/')\n )\n}\n\nfunction removeSuffix(value: string, suffix: string): string {\n return value.endsWith(suffix) ? value.slice(0, -suffix.length) : value\n}\n\n/** Normalize a route for the app router */\nfunction normalizeAppRoute(pageName: string): string {\n return normalizeAppPath(normalizePathSep(pageName))\n}\n\n/** Normalize a layout route (strip /layout suffix) */\nfunction normalizeLayoutRoute(pageName: string): string {\n return ensureLeadingSlash(\n removeSuffix(normalizeAppPath(normalizePathSep(pageName)), '/layout')\n )\n}\n\n/**\n * For a given page path removes the provided extensions.\n */\nexport function getPageFromPath(\n pagePath: string,\n pageExtensions: PageExtensions\n) {\n let page = normalizePathSep(pagePath)\n // Try longer extensions first so compound extensions like 'page.js'\n // match before shorter ones like 'js'\n const sorted = [...pageExtensions].sort((a, b) => b.length - a.length)\n for (const extension of sorted) {\n const next = removeSuffix(page, `.${extension}`)\n if (next !== page) {\n page = next\n break\n }\n }\n\n page = removeSuffix(page, '/index')\n\n return page === '' ? '/' : page\n}\n\n/**\n * Collect app pages, layouts, and default files from the app directory\n */\nexport async function collectAppFiles(\n appDir: string,\n validFileMatcher: ReturnType<typeof createValidFileMatcher>\n): Promise<{\n appPaths: string[]\n layoutPaths: string[]\n defaultPaths: string[]\n}> {\n const allAppFiles = await recursiveReadDir(appDir, {\n pathnameFilter: (absolutePath) =>\n validFileMatcher.isAppRouterPage(absolutePath) ||\n validFileMatcher.isRootNotFound(absolutePath) ||\n validFileMatcher.isAppLayoutPage(absolutePath) ||\n validFileMatcher.isAppDefaultPage(absolutePath),\n ignorePartFilter: (part) => part.startsWith('_'),\n })\n\n const appPaths = allAppFiles.filter(\n (absolutePath) =>\n validFileMatcher.isAppRouterPage(absolutePath) ||\n validFileMatcher.isRootNotFound(absolutePath)\n )\n const layoutPaths = allAppFiles.filter((absolutePath) =>\n validFileMatcher.isAppLayoutPage(absolutePath)\n )\n const defaultPaths = allAppFiles.filter((absolutePath) =>\n validFileMatcher.isAppDefaultPage(absolutePath)\n )\n\n return { appPaths, layoutPaths, defaultPaths }\n}\n\n/**\n * Collect pages from the pages directory\n */\nexport async function collectPagesFiles(\n pagesDir: string,\n validFileMatcher: ReturnType<typeof createValidFileMatcher>\n): Promise<string[]> {\n return await recursiveReadDir(pagesDir, {\n pathnameFilter: validFileMatcher.isPageFile,\n })\n}\n\n/**\n * Create a relative file path from a mapped page path\n */\nexport function createRelativeFilePath(\n baseDir: string,\n filePath: string,\n prefix: 'pages' | 'app',\n isSrcDir: boolean\n): string {\n const privatePrefixRegex =\n prefix === 'pages' ? PRIVATE_PAGES_PREFIX_REGEX : PRIVATE_APP_PREFIX_REGEX\n const srcPrefix = isSrcDir ? 'src/' : ''\n return join(\n baseDir,\n filePath.replace(privatePrefixRegex, `${srcPrefix}${prefix}/`)\n )\n}\n\n/**\n * Process pages routes from mapped pages\n */\nexport function processPageRoutes(\n mappedPages: { [page: string]: string },\n baseDir: string,\n isSrcDir: boolean\n): {\n pageRoutes: RouteInfo[]\n pageApiRoutes: RouteInfo[]\n} {\n const pageRoutes: RouteInfo[] = []\n const pageApiRoutes: RouteInfo[] = []\n\n for (const [route, filePath] of Object.entries(mappedPages)) {\n const relativeFilePath = createRelativeFilePath(\n baseDir,\n filePath,\n 'pages',\n isSrcDir\n )\n\n if (route.startsWith('/api/')) {\n pageApiRoutes.push({\n route: normalizePathSep(route),\n filePath: relativeFilePath,\n })\n } else {\n if (isReservedPage(route)) continue\n\n pageRoutes.push({\n route: normalizePathSep(route),\n filePath: relativeFilePath,\n })\n }\n }\n\n return { pageRoutes, pageApiRoutes }\n}\n\n/**\n * Process app routes from mapped app pages\n */\nexport function processAppRoutes(\n mappedAppPages: { [page: string]: string },\n validFileMatcher: ReturnType<typeof createValidFileMatcher>,\n baseDir: string,\n isSrcDir: boolean\n): {\n appRoutes: RouteInfo[]\n appRouteHandlers: RouteInfo[]\n} {\n const appRoutes: RouteInfo[] = []\n const appRouteHandlers: RouteInfo[] = []\n\n for (const [page, filePath] of Object.entries(mappedAppPages)) {\n if (\n page === UNDERSCORE_NOT_FOUND_ROUTE_ENTRY ||\n page === UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY\n ) {\n continue\n }\n\n const relativeFilePath = createRelativeFilePath(\n baseDir,\n filePath,\n 'app',\n isSrcDir\n )\n const route = normalizeAppRoute(page)\n\n if (validFileMatcher.isAppRouterRoute(filePath)) {\n appRouteHandlers.push({ route, filePath: relativeFilePath })\n } else {\n appRoutes.push({ route, filePath: relativeFilePath })\n }\n }\n\n return { appRoutes, appRouteHandlers }\n}\n\n/**\n * Process layout routes from mapped app layouts\n */\nexport function processLayoutRoutes(\n mappedAppLayouts: { [page: string]: string },\n baseDir: string,\n isSrcDir: boolean\n): RouteInfo[] {\n return Object.entries(mappedAppLayouts).map(([route, filePath]) => ({\n route: normalizeLayoutRoute(route),\n filePath: createRelativeFilePath(baseDir, filePath, 'app', isSrcDir),\n }))\n}\n\n/**\n * Creates a mapping of route to page file path for a given list of page paths.\n */\nexport async function createPagesMapping({\n isDev,\n pageExtensions,\n pagePaths,\n pagesType,\n pagesDir,\n appDir,\n appDirOnly,\n}: {\n isDev: boolean\n pageExtensions: PageExtensions\n pagePaths: string[]\n pagesType: PAGE_TYPES\n pagesDir: string | undefined\n appDir: string | undefined\n appDirOnly: boolean\n}): Promise<MappedPages> {\n const isAppRoute = pagesType === 'app'\n\n const promises = pagePaths.map<Promise<[string, string] | undefined>>(\n async (pagePath) => {\n if (pagePath.endsWith('.d.ts') && pageExtensions.includes('ts')) {\n return\n }\n\n let pageKey = getPageFromPath(pagePath, pageExtensions)\n if (isAppRoute) {\n // Turbopack encodes '_' as '%5F' in app paths; normalize to underscores.\n pageKey = pageKey.replace(/%5F/g, '_')\n if (pageKey === UNDERSCORE_NOT_FOUND_ROUTE) {\n pageKey = UNDERSCORE_NOT_FOUND_ROUTE_ENTRY\n }\n if (pageKey === UNDERSCORE_GLOBAL_ERROR_ROUTE) {\n pageKey = UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY\n }\n }\n\n const normalizedPath = normalizePathSep(\n join(\n pagesType === PAGE_TYPES.PAGES\n ? PAGES_DIR_ALIAS\n : pagesType === PAGE_TYPES.APP\n ? APP_DIR_ALIAS\n : ROOT_DIR_ALIAS,\n pagePath\n )\n )\n\n let route =\n pagesType === PAGE_TYPES.APP ? normalizeMetadataRoute(pageKey) : pageKey\n\n if (\n pagesType === PAGE_TYPES.APP &&\n isMetadataRouteFile(pagePath, pageExtensions, true)\n ) {\n const filePath = join(appDir!, pagePath)\n const staticInfo = await getPageStaticInfo({\n nextConfig: {},\n pageFilePath: filePath,\n isDev,\n page: pageKey,\n pageType: pagesType,\n })\n\n route = normalizeMetadataPageToRoute(\n route,\n !!(staticInfo.generateImageMetadata || staticInfo.generateSitemaps)\n )\n }\n\n return [route, normalizedPath]\n }\n )\n\n const pages: MappedPages = Object.fromEntries(\n (await Promise.all(promises)).filter((entry) => entry != null)\n )\n\n switch (pagesType) {\n case PAGE_TYPES.ROOT: {\n return pages\n }\n case PAGE_TYPES.APP: {\n const hasAppPages = Object.keys(pages).length > 0\n const hasAppGlobalError = !isDev && appDirOnly\n return {\n ...(hasAppPages && {\n [UNDERSCORE_NOT_FOUND_ROUTE_ENTRY]: require.resolve(\n 'next/dist/client/components/builtin/global-not-found'\n ),\n }),\n ...(hasAppGlobalError && {\n [UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY]: require.resolve(\n 'next/dist/client/components/builtin/app-error'\n ),\n }),\n ...pages,\n }\n }\n case PAGE_TYPES.PAGES: {\n if (isDev) {\n delete pages['/_app']\n delete pages['/_error']\n delete pages['/_document']\n }\n\n const root = isDev && pagesDir ? PAGES_DIR_ALIAS : 'next/dist/pages'\n\n if (Object.keys(pages).length === 0 && !appDirOnly) {\n appDirOnly = true\n }\n\n return {\n ...((isDev || !appDirOnly) && {\n '/_app': `${root}/_app`,\n '/_error': `${root}/_error`,\n '/_document': `${root}/_document`,\n ...pages,\n }),\n }\n }\n default: {\n return {}\n }\n }\n}\n\nexport interface RouteDiscoveryOptions {\n appDir?: string\n pagesDir?: string\n pageExtensions: string[]\n isDev: boolean\n baseDir: string\n /** Whether the app/pages directories are under a /src directory. */\n isSrcDir?: boolean\n /** Override app-dir-only mode (e.g. from --experimental-app-only CLI flag) */\n appDirOnly?: boolean\n validFileMatcher?: ReturnType<typeof createValidFileMatcher>\n debugBuildPaths?: { app: string[]; pages: string[] }\n}\n\nexport interface RouteDiscoveryResult {\n appRoutes: RouteInfo[]\n appRouteHandlers: RouteInfo[]\n layoutRoutes: RouteInfo[]\n slots: SlotInfo[]\n pageRoutes: RouteInfo[]\n pageApiRoutes: RouteInfo[]\n mappedAppPages?: MappedPages\n mappedAppLayouts?: MappedPages\n mappedPages?: MappedPages\n /** Raw page file paths (post-filtering), useful for telemetry */\n pagesPaths: string[]\n /** Resolved app-dir-only state (may have been updated during discovery) */\n appDirOnly: boolean\n}\n\n/**\n * High-level API: Collect, map, and process all routes in one call\n */\nexport async function discoverRoutes(\n options: RouteDiscoveryOptions\n): Promise<RouteDiscoveryResult> {\n const {\n appDir,\n pagesDir,\n pageExtensions,\n isDev,\n baseDir,\n isSrcDir,\n debugBuildPaths,\n } = options\n\n const validFileMatcher =\n options.validFileMatcher || createValidFileMatcher(pageExtensions, appDir)\n\n let appDirOnly = options.appDirOnly ?? (!!appDir && !pagesDir)\n\n // Helper to reduce createPagesMapping boilerplate\n const mapPaths = (pagePaths: string[], pagesType: PAGE_TYPES) =>\n createPagesMapping({\n pagePaths,\n isDev,\n pagesType,\n pageExtensions,\n pagesDir,\n appDir,\n appDirOnly,\n })\n\n // Helper to apply debugBuildPaths filtering\n const applyDebugFilter = (\n paths: string[],\n debugPaths: string[]\n ): string[] => {\n if (debugPaths.length > 0) {\n const debugPathsSet = new Set(debugPaths)\n const filteredPaths = paths.filter((p) => debugPathsSet.has(p))\n const hasPagesRoute = filteredPaths.some((p) =>\n isRenderablePagesRoute(getPageFromPath(p, pageExtensions))\n )\n\n if (!hasPagesRoute) {\n return filteredPaths\n }\n\n const filteredPathsSet = new Set(filteredPaths)\n for (const path of paths) {\n if (PAGES_SUPPORT_ROUTES.has(getPageFromPath(path, pageExtensions))) {\n filteredPathsSet.add(path)\n }\n }\n\n return paths.filter((p) => filteredPathsSet.has(p))\n }\n // Empty array means build none\n return []\n }\n\n let pageRoutes: RouteInfo[] = []\n let pageApiRoutes: RouteInfo[] = []\n let mappedPages: MappedPages | undefined\n let pagesPaths: string[] = []\n\n if (pagesDir && !appDirOnly) {\n if (process.env.NEXT_PRIVATE_PAGE_PATHS) {\n pagesPaths = JSON.parse(process.env.NEXT_PRIVATE_PAGE_PATHS)\n } else {\n pagesPaths = await collectPagesFiles(pagesDir, validFileMatcher)\n\n if (debugBuildPaths) {\n pagesPaths = applyDebugFilter(pagesPaths, debugBuildPaths.pages)\n }\n }\n\n mappedPages = await mapPaths(pagesPaths, PAGE_TYPES.PAGES)\n\n // Update appDirOnly if no user page routes were found, so the\n // subsequent app mapping can emit the global error entry.\n if (Object.keys(mappedPages).length === 0) {\n appDirOnly = true\n }\n\n ;({ pageRoutes, pageApiRoutes } = processPageRoutes(\n mappedPages,\n baseDir,\n !!isSrcDir\n ))\n }\n\n let appRoutes: RouteInfo[] = []\n let appRouteHandlers: RouteInfo[] = []\n let layoutRoutes: RouteInfo[] = []\n let slots: SlotInfo[] = []\n let mappedAppPages: MappedPages | undefined\n let mappedAppLayouts: MappedPages | undefined\n\n if (appDir) {\n let appPaths: string[]\n let layoutPaths: string[]\n let defaultPaths: string[]\n\n if (process.env.NEXT_PRIVATE_APP_PATHS) {\n // Used for testing — override collected app paths\n appPaths = JSON.parse(process.env.NEXT_PRIVATE_APP_PATHS)\n layoutPaths = []\n defaultPaths = []\n } else {\n const result = await collectAppFiles(appDir, validFileMatcher)\n appPaths = result.appPaths\n layoutPaths = result.layoutPaths\n defaultPaths = result.defaultPaths\n\n if (debugBuildPaths) {\n appPaths = applyDebugFilter(appPaths, debugBuildPaths.app)\n }\n }\n\n // Map all app file types in parallel\n let mappedDefaultFiles: MappedPages\n ;[mappedAppPages, mappedAppLayouts, mappedDefaultFiles] = await Promise.all(\n [\n mapPaths(appPaths, PAGE_TYPES.APP),\n mapPaths(layoutPaths, PAGE_TYPES.APP),\n mapPaths(defaultPaths, PAGE_TYPES.APP),\n ]\n )\n\n // Extract slots from pages and default files\n slots = combineSlots(\n extractSlotsFromRoutes(mappedAppPages, SKIP_ROUTES),\n extractSlotsFromRoutes(mappedDefaultFiles)\n )\n\n // Process routes\n ;({ appRoutes, appRouteHandlers } = processAppRoutes(\n mappedAppPages,\n validFileMatcher,\n baseDir,\n !!isSrcDir\n ))\n layoutRoutes = processLayoutRoutes(mappedAppLayouts, baseDir, !!isSrcDir)\n }\n\n return {\n appRoutes,\n appRouteHandlers,\n layoutRoutes,\n slots,\n pageRoutes,\n pageApiRoutes,\n mappedAppPages,\n mappedAppLayouts,\n mappedPages,\n pagesPaths,\n appDirOnly,\n }\n}\n"],"names":["join","createValidFileMatcher","recursiveReadDir","APP_DIR_ALIAS","PAGES_DIR_ALIAS","ROOT_DIR_ALIAS","normalizePathSep","normalizeAppPath","ensureLeadingSlash","PAGE_TYPES","extractSlotsFromRoutes","combineSlots","normalizeMetadataRoute","normalizeMetadataPageToRoute","isMetadataRouteFile","getPageStaticInfo","UNDERSCORE_NOT_FOUND_ROUTE","UNDERSCORE_NOT_FOUND_ROUTE_ENTRY","UNDERSCORE_GLOBAL_ERROR_ROUTE","UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY","isReservedPage","PRIVATE_PAGES_PREFIX_REGEX","PRIVATE_APP_PREFIX_REGEX","SKIP_ROUTES","Set","PAGES_SUPPORT_ROUTES","PAGES_FRAMEWORK_ROUTES","isRenderablePagesRoute","page","has","startsWith","removeSuffix","value","suffix","endsWith","slice","length","normalizeAppRoute","pageName","normalizeLayoutRoute","getPageFromPath","pagePath","pageExtensions","sorted","sort","a","b","extension","next","collectAppFiles","appDir","validFileMatcher","allAppFiles","pathnameFilter","absolutePath","isAppRouterPage","isRootNotFound","isAppLayoutPage","isAppDefaultPage","ignorePartFilter","part","appPaths","filter","layoutPaths","defaultPaths","collectPagesFiles","pagesDir","isPageFile","createRelativeFilePath","baseDir","filePath","prefix","isSrcDir","privatePrefixRegex","srcPrefix","replace","processPageRoutes","mappedPages","pageRoutes","pageApiRoutes","route","Object","entries","relativeFilePath","push","processAppRoutes","mappedAppPages","appRoutes","appRouteHandlers","isAppRouterRoute","processLayoutRoutes","mappedAppLayouts","map","createPagesMapping","isDev","pagePaths","pagesType","appDirOnly","isAppRoute","promises","includes","pageKey","normalizedPath","PAGES","APP","staticInfo","nextConfig","pageFilePath","pageType","generateImageMetadata","generateSitemaps","pages","fromEntries","Promise","all","entry","ROOT","hasAppPages","keys","hasAppGlobalError","require","resolve","root","discoverRoutes","options","debugBuildPaths","mapPaths","applyDebugFilter","paths","debugPaths","debugPathsSet","filteredPaths","p","hasPagesRoute","some","filteredPathsSet","path","add","pagesPaths","process","env","NEXT_PRIVATE_PAGE_PATHS","JSON","parse","layoutRoutes","slots","NEXT_PRIVATE_APP_PATHS","result","app","mappedDefaultFiles"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAM;AAC3B,SAASC,sBAAsB,QAAQ,+BAA8B;AACrE,SAASC,gBAAgB,QAAQ,2BAA0B;AAC3D,SACEC,aAAa,EACbC,eAAe,EACfC,cAAc,QACT,mBAAkB;AACzB,SAASC,gBAAgB,QAAQ,6CAA4C;AAC7E,SAASC,gBAAgB,QAAQ,uCAAsC;AACvE,SAASC,kBAAkB,QAAQ,+CAA8C;AACjF,SAASC,UAAU,QAAQ,oBAAmB;AAC9C,SACEC,sBAAsB,EACtBC,YAAY,QAGP,oBAAmB;AAC1B,SACEC,sBAAsB,EACtBC,4BAA4B,QACvB,qCAAoC;AAC3C,SAASC,mBAAmB,QAAQ,oCAAmC;AACvE,SAASC,iBAAiB,QAAQ,kCAAiC;AACnE,SACEC,0BAA0B,EAC1BC,gCAAgC,EAChCC,6BAA6B,EAC7BC,mCAAmC,QAC9B,gCAA+B;AACtC,SAASC,cAAc,QAAQ,UAAS;AAIxC,MAAMC,6BAA6B;AACnC,MAAMC,2BAA2B;AACjC,MAAMC,cAAc,IAAIC,IAAI;IAC1BP;IACAE;CACD;AACD,MAAMM,uBAAuB,IAAID,IAAI;IACnC;IACA;IACA;IACA;IACA;CACD;AACD,MAAME,yBAAyB,IAAIF,IAAI;IAAC;IAAS;IAAc;CAAU;AAEzE,SAASG,uBAAuBC,IAAY;IAC1C,OACE,CAACF,uBAAuBG,GAAG,CAACD,SAC5BA,SAAS,UACT,CAACA,KAAKE,UAAU,CAAC;AAErB;AAEA,SAASC,aAAaC,KAAa,EAAEC,MAAc;IACjD,OAAOD,MAAME,QAAQ,CAACD,UAAUD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cAAc,EAAE;YAChBC,eAAe,EAAE;QACnB,OAAO;YACL,MAAMmF,SAAS,MAAMlG,gBAAgBC,QAAQC;YAC7CU,WAAWsF,OAAOtF,QAAQ;YAC1BE,cAAcoF,OAAOpF,WAAW;YAChCC,eAAemF,OAAOnF,YAAY;YAElC,IAAI6D,iBAAiB;gBACnBhE,WAAWkE,iBAAiBlE,UAAUgE,gBAAgBuB,GAAG;YAC3D;QACF;QAEA,qCAAqC;QACrC,IAAIC;QACH,CAAC/D,gBAAgBK,kBAAkB0D,mBAAmB,GAAG,MAAMpC,QAAQC,GAAG,CACzE;YACEY,SAASjE,UAAUpD,WAAW+F,GAAG;YACjCsB,SAAS/D,aAAatD,WAAW+F,GAAG;YACpCsB,SAAS9D,cAAcvD,WAAW+F,GAAG;SACtC;QAGH,6CAA6C;QAC7CyC,QAAQtI,aACND,uBAAuB4E,gBAAgB/D,cACvCb,uBAAuB2I;QAIvB,CAAA,EAAE9D,SAAS,EAAEC,gBAAgB,EAAE,GAAGH,iBAClCC,gBACAnC,kBACAkB,SACA,CAAC,CAACG,SACJ;QACAwE,eAAetD,oBAAoBC,kBAAkBtB,SAAS,CAAC,CAACG;IAClE;IAEA,OAAO;QACLe;QACAC;QACAwD;QACAC;QACAnE;QACAC;QACAO;QACAK;QACAd;QACA6D;QACAzC;IACF;AACF","ignoreList":[0]} |
@@ -14,3 +14,3 @@ import path from 'path'; | ||
| }({}); | ||
| const nextVersion = "16.3.1-canary.13"; | ||
| const nextVersion = "16.3.1-canary.14"; | ||
| const ArchName = arch(); | ||
@@ -17,0 +17,0 @@ const PlatformName = platform(); |
@@ -69,3 +69,3 @@ import path from 'path'; | ||
| isPersistentCachingEnabled: persistentCaching, | ||
| nextVersion: "16.3.1-canary.13" | ||
| nextVersion: "16.3.1-canary.14" | ||
| }, { | ||
@@ -72,0 +72,0 @@ turbopackMemoryEviction: config.experimental.turbopackMemoryEvictionMode, |
@@ -88,3 +88,3 @@ // Import cpu-profile first to start profiling early if enabled | ||
| deferredEntries: config.experimental.deferredEntries, | ||
| nextVersion: "16.3.1-canary.13" | ||
| nextVersion: "16.3.1-canary.14" | ||
| }; | ||
@@ -91,0 +91,0 @@ if (config.experimental.turbopackSeedCacheFromWorktree) { |
@@ -8,3 +8,3 @@ /** | ||
| import { setAttributesFromProps } from './set-attributes-from-props'; | ||
| const version = "16.3.1-canary.13"; | ||
| const version = "16.3.1-canary.14"; | ||
| window.next = { | ||
@@ -11,0 +11,0 @@ version, |
@@ -32,9 +32,17 @@ import { ACTION_REFRESH, ACTION_SERVER_ACTION, ACTION_NAVIGATE, ACTION_RESTORE, ACTION_HMR_REFRESH, PrefetchKind, ScrollBehavior } from './router-reducer/router-reducer-types'; | ||
| } | ||
| if (actionQueue.pending === null && actionQueue.needsRefresh) { | ||
| // The queue is idle; flush the refresh requested by a discarded server | ||
| // action that revalidated data. | ||
| actionQueue.needsRefresh = false; | ||
| actionQueue.dispatch({ | ||
| type: ACTION_REFRESH | ||
| }, setState); | ||
| if (actionQueue.pending === null) { | ||
| if (actionQueue.wasPreempted) { | ||
| actionQueue.wasPreempted = false; | ||
| // When an action is preempted, later actions can update the queue's state without React rendering it. | ||
| // Once the queue is empty, publish the final state so the UI catches up. | ||
| startTransition(()=>setState(actionQueue.state)); | ||
| } | ||
| if (actionQueue.needsRefresh) { | ||
| // The queue is idle; flush the refresh requested by a discarded server | ||
| // action that revalidated data. | ||
| actionQueue.needsRefresh = false; | ||
| actionQueue.dispatch({ | ||
| type: ACTION_REFRESH | ||
| }, setState); | ||
| } | ||
| } | ||
@@ -118,2 +126,3 @@ } | ||
| actionQueue.pending.discarded = true; | ||
| actionQueue.wasPreempted = true; | ||
| // The rest of the current queue should still execute after this navigation. | ||
@@ -120,0 +129,0 @@ // (Note that it can't contain any earlier navigations, because we always put those into `actionQueue.pending` by calling `runAction`) |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/client/components/app-router-instance.ts"],"sourcesContent":["import {\n type AppRouterState,\n type ReducerActions,\n type ReducerState,\n ACTION_REFRESH,\n ACTION_SERVER_ACTION,\n ACTION_NAVIGATE,\n ACTION_RESTORE,\n type NavigateAction,\n ACTION_HMR_REFRESH,\n PrefetchKind,\n ScrollBehavior,\n type AppHistoryState,\n} from './router-reducer/router-reducer-types'\nimport { reducer } from './router-reducer/router-reducer'\nimport { addTransitionType, startTransition } from 'react'\nimport { isThenable } from '../../shared/lib/is-thenable'\nimport {\n FetchStrategy,\n type PrefetchTaskFetchStrategy,\n} from './segment-cache/types'\nimport { prefetch as prefetchWithSegmentCache } from './segment-cache/prefetch'\nimport { navigate } from './segment-cache/navigation'\nimport {\n dispatchAppRouterAction,\n dispatchGestureState,\n} from './use-action-queue'\nimport { resetKnownRoutes } from './segment-cache/optimistic-routes'\nimport { FreshnessPolicy } from './router-reducer/ppr-navigations'\nimport { addBasePath } from '../add-base-path'\nimport { isExternalURL } from './app-router-utils'\nimport type {\n AppRouterInstance,\n NavigateOptions,\n PrefetchOptions,\n} from '../../shared/lib/app-router-context.shared-runtime'\nimport { setLinkForCurrentNavigation, type LinkInstance } from './links'\nimport type { RouterTransitionPrefetchIntent } from '../router-transition-types'\nimport type { GlobalErrorComponent } from './builtin/global-error'\nimport { isJavaScriptURLString } from '../lib/javascript-url'\nimport { startRouterTransition } from './router-transition'\n\nexport type DispatchStatePromise = React.Dispatch<ReducerState>\n\nexport type AppRouterActionQueue = {\n state: AppRouterState\n dispatch: (payload: ReducerActions, setState: DispatchStatePromise) => void\n action: (state: AppRouterState, action: ReducerActions) => ReducerState\n\n pending: ActionQueueNode | null\n needsRefresh?: boolean\n last: ActionQueueNode | null\n}\n\nexport type GlobalErrorState = [\n GlobalError: GlobalErrorComponent,\n styles: React.ReactNode,\n]\n\nexport type ActionQueueNode = {\n payload: ReducerActions\n next: ActionQueueNode | null\n resolve: (value: ReducerState) => void\n reject: (err: Error) => void\n discarded?: boolean\n}\n\nfunction runRemainingActions(\n actionQueue: AppRouterActionQueue,\n settledAction: ActionQueueNode,\n setState: DispatchStatePromise\n) {\n // Only advance the queue if the settled action is still at its head. If a\n // navigation discarded this action, the navigation took its place and is\n // still in flight — starting the next queued action now would run it\n // against router state that doesn't include the navigation yet.\n if (actionQueue.pending === settledAction) {\n actionQueue.pending = settledAction.next\n if (actionQueue.pending !== null) {\n runAction({\n actionQueue,\n action: actionQueue.pending,\n setState,\n })\n return\n }\n }\n\n if (actionQueue.pending === null && actionQueue.needsRefresh) {\n // The queue is idle; flush the refresh requested by a discarded server\n // action that revalidated data.\n actionQueue.needsRefresh = false\n actionQueue.dispatch({ type: ACTION_REFRESH }, setState)\n }\n}\n\nasync function runAction({\n actionQueue,\n action,\n setState,\n}: {\n actionQueue: AppRouterActionQueue\n action: ActionQueueNode\n setState: DispatchStatePromise\n}) {\n const prevState = actionQueue.state\n\n actionQueue.pending = action\n\n const payload = action.payload\n const actionResult = actionQueue.action(prevState, payload)\n\n function handleResult(nextState: AppRouterState) {\n // if we discarded this action, the state should also be discarded\n if (action.discarded) {\n // Check if the discarded server action revalidated data\n if (\n action.payload.type === ACTION_SERVER_ACTION &&\n action.payload.didRevalidate\n ) {\n // The server action was discarded but it revalidated data,\n // mark that we need to refresh after all actions complete\n actionQueue.needsRefresh = true\n }\n // This can't advance the queue (this action is no longer its head), but\n // if the queue has already drained, it flushes the refresh now.\n runRemainingActions(actionQueue, action, setState)\n return\n }\n\n actionQueue.state = nextState\n\n runRemainingActions(actionQueue, action, setState)\n action.resolve(nextState)\n }\n\n // if the action is a promise, set up a callback to resolve it\n if (isThenable(actionResult)) {\n actionResult.then(handleResult, (err) => {\n runRemainingActions(actionQueue, action, setState)\n action.reject(err)\n })\n } else {\n handleResult(actionResult)\n }\n}\n\nfunction dispatchAction(\n actionQueue: AppRouterActionQueue,\n payload: ReducerActions,\n setState: DispatchStatePromise\n) {\n let resolvers: {\n resolve: (value: ReducerState) => void\n reject: (reason: any) => void\n } = { resolve: setState, reject: () => {} }\n\n // most of the action types are async with the exception of restore\n // it's important that restore is handled quickly since it's fired on the popstate event\n // and we don't want to add any delay on a back/forward nav\n // this only creates a promise for the async actions\n if (payload.type !== ACTION_RESTORE) {\n // Create the promise and assign the resolvers to the object.\n const deferredPromise = new Promise<AppRouterState>((resolve, reject) => {\n resolvers = { resolve, reject }\n })\n\n startTransition(() => {\n // we immediately notify React of the pending promise -- the resolver is attached to the action node\n // and will be called when the associated action promise resolves\n setState(deferredPromise)\n })\n }\n\n const newAction: ActionQueueNode = {\n payload,\n next: null,\n resolve: resolvers.resolve,\n reject: resolvers.reject,\n }\n\n // Check if the queue is empty\n if (actionQueue.pending === null) {\n // The queue is empty, so add the action and start it immediately\n // Mark this action as the last in the queue\n actionQueue.last = newAction\n\n runAction({\n actionQueue,\n action: newAction,\n setState,\n })\n } else if (\n payload.type === ACTION_NAVIGATE ||\n payload.type === ACTION_RESTORE\n ) {\n // Navigations (including back/forward) take priority over any pending actions.\n // Mark the pending action as discarded (so the state is never applied) and start the navigation action immediately.\n actionQueue.pending.discarded = true\n\n // The rest of the current queue should still execute after this navigation.\n // (Note that it can't contain any earlier navigations, because we always put those into `actionQueue.pending` by calling `runAction`)\n newAction.next = actionQueue.pending.next\n\n if (actionQueue.last === actionQueue.pending) {\n actionQueue.last = newAction\n }\n\n runAction({\n actionQueue,\n action: newAction,\n setState,\n })\n } else {\n // The queue is not empty, so add the action to the end of the queue\n // It will be started by runRemainingActions after the previous action finishes\n if (actionQueue.last !== null) {\n actionQueue.last.next = newAction\n }\n actionQueue.last = newAction\n }\n}\n\nlet globalActionQueue: AppRouterActionQueue | null = null\n\nexport function createMutableActionQueue(\n initialState: AppRouterState\n): AppRouterActionQueue {\n const actionQueue: AppRouterActionQueue = {\n state: initialState,\n dispatch: (payload: ReducerActions, setState: DispatchStatePromise) =>\n dispatchAction(actionQueue, payload, setState),\n action: async (state: AppRouterState, action: ReducerActions) => {\n const result = reducer(state, action)\n return result\n },\n pending: null,\n last: null,\n }\n\n if (typeof window !== 'undefined') {\n // The action queue is lazily created on hydration, but after that point\n // it doesn't change. So we can store it in a global rather than pass\n // it around everywhere via props/context.\n if (globalActionQueue !== null) {\n throw new Error(\n 'Internal Next.js Error: createMutableActionQueue was called more ' +\n 'than once'\n )\n }\n globalActionQueue = actionQueue\n }\n\n return actionQueue\n}\n\nexport function getCurrentAppRouterState(): AppRouterState | null {\n return globalActionQueue !== null ? globalActionQueue.state : null\n}\n\nfunction getAppRouterActionQueue(): AppRouterActionQueue {\n if (globalActionQueue === null) {\n throw new Error(\n 'Internal Next.js error: Router action dispatched before initialization.'\n )\n }\n return globalActionQueue\n}\n\nexport function dispatchNavigateAction(\n href: string,\n navigateType: NavigateAction['navigateType'],\n scrollBehavior: ScrollBehavior,\n linkInstanceRef: LinkInstance | null,\n transitionTypes: string[] | undefined,\n prefetchIntent: RouterTransitionPrefetchIntent | null\n): void {\n // TODO: This stuff could just go into the reducer. Leaving as-is for now\n // since we're about to rewrite all the router reducer stuff anyway.\n\n if (transitionTypes) {\n for (const type of transitionTypes) {\n addTransitionType(type)\n }\n }\n\n const url = new URL(addBasePath(href), location.href)\n if (process.env.__NEXT_APP_NAV_FAIL_HANDLING) {\n window.next.__pendingUrl = url\n }\n\n setLinkForCurrentNavigation(linkInstanceRef)\n startRouterTransition(\n href,\n navigateType,\n getAppRouterActionQueue().state.tree,\n prefetchIntent\n )\n\n dispatchAppRouterAction({\n type: ACTION_NAVIGATE,\n url,\n isExternalUrl: isExternalURL(url),\n locationSearch: location.search,\n scrollBehavior,\n navigateType,\n })\n}\n\nexport function dispatchTraverseAction(\n href: string,\n historyState: AppHistoryState | undefined\n) {\n startRouterTransition(\n href,\n 'traverse',\n getAppRouterActionQueue().state.tree,\n null\n )\n dispatchAppRouterAction({\n type: ACTION_RESTORE,\n url: new URL(href),\n historyState,\n })\n}\n\n/**\n * (Experimental) Perform a gesture navigation. This dispatches through React's\n * useOptimistic instead of the main action queue, allowing the state to be\n * shown during a gesture transition and discarded when the canonical navigation\n * completes.\n *\n * Only available when experimental.gestureTransition is enabled.\n */\nfunction gesturePush(href: string, options?: NavigateOptions): void {\n if (process.env.__NEXT_GESTURE_TRANSITION) {\n // TODO: Trigger a prefetch so the cache starts populating if there isn't\n // already a prefetch for this route.\n if (isJavaScriptURLString(href)) {\n throw new Error(\n 'Next.js has blocked a javascript: URL as a security precaution.'\n )\n }\n\n const state = getCurrentAppRouterState()\n if (state === null) {\n return\n }\n const url = new URL(addBasePath(href), location.href)\n if (isExternalURL(url)) {\n return\n }\n\n // Fork the router state for the duration of the gesture transition.\n const currentUrl = new URL(state.canonicalUrl, location.href)\n const scrollBehavior =\n options?.scroll === false\n ? ScrollBehavior.NoScroll\n : ScrollBehavior.Default\n // This is a special freshness policy that prevents dynamic requests from\n // being spawned. During the gesture, we should only show the cached\n // prefetched UI, not dynamic data.\n // TODO: In the case of navigations to an unknown route, this will still\n // end up performing a dynamic request. The plan is to do prefetch instead.\n // There's a separate TODO for this.\n const freshnessPolicy = FreshnessPolicy.Gesture\n const forkedGestureState = navigate(\n state,\n url,\n currentUrl,\n state.renderedSearch,\n state.cache,\n state.tree,\n state.nextUrl,\n freshnessPolicy,\n scrollBehavior,\n 'push'\n )\n dispatchGestureState(forkedGestureState)\n }\n}\n\n// Tracks the newest HMR refresh generation so that a newer refresh can abort\n// the request of the one it supersedes. Development only.\nlet activeHmrRefreshController: AbortController | null = null\n\n/**\n * The app router that is exposed through `useRouter`. These are public API\n * methods. Internal Next.js code should call the lower level methods directly\n * (although there's lots of existing code that doesn't do that).\n */\nexport const publicAppRouterInstance: AppRouterInstance = {\n back: () => window.history.back(),\n forward: () => window.history.forward(),\n prefetch:\n // Unlike the old implementation, the Segment Cache doesn't store its\n // data in the router reducer state; it writes into a global mutable\n // cache. So we don't need to dispatch an action.\n (href: string, options?: PrefetchOptions) => {\n if (isJavaScriptURLString(href)) {\n throw new Error(\n 'Next.js has blocked a javascript: URL as a security precaution.'\n )\n }\n const actionQueue = getAppRouterActionQueue()\n const prefetchKind = options?.kind ?? PrefetchKind.AUTO\n\n // We don't currently offer a way to issue a runtime prefetch via `router.prefetch()`.\n // This will be possible when we update its API to not take a PrefetchKind.\n let fetchStrategy: PrefetchTaskFetchStrategy\n switch (prefetchKind) {\n case PrefetchKind.AUTO: {\n // We default to PPR. We'll discover whether or not the route supports it with the initial prefetch.\n fetchStrategy = FetchStrategy.PPR\n break\n }\n case PrefetchKind.FULL: {\n fetchStrategy = FetchStrategy.Full\n break\n }\n default: {\n prefetchKind satisfies never\n // Despite typescript thinking that this can't happen,\n // we might get an unexpected value from user code.\n // We don't know what they want, but we know they want a prefetch,\n // so use the default.\n fetchStrategy = FetchStrategy.PPR\n }\n }\n\n prefetchWithSegmentCache(\n href,\n actionQueue.state.nextUrl,\n actionQueue.state.tree,\n fetchStrategy,\n options?.onInvalidate ?? null\n )\n },\n replace: (href: string, options?: NavigateOptions) => {\n if (isJavaScriptURLString(href)) {\n throw new Error(\n 'Next.js has blocked a javascript: URL as a security precaution.'\n )\n }\n startTransition(() => {\n dispatchNavigateAction(\n href,\n 'replace',\n options?.scroll === false\n ? ScrollBehavior.NoScroll\n : ScrollBehavior.Default,\n null,\n options?.transitionTypes,\n null\n )\n })\n },\n push: (href: string, options?: NavigateOptions) => {\n if (isJavaScriptURLString(href)) {\n throw new Error(\n 'Next.js has blocked a javascript: URL as a security precaution.'\n )\n }\n startTransition(() => {\n dispatchNavigateAction(\n href,\n 'push',\n options?.scroll === false\n ? ScrollBehavior.NoScroll\n : ScrollBehavior.Default,\n null,\n options?.transitionTypes,\n null\n )\n })\n },\n refresh: () => {\n startTransition(() => {\n dispatchAppRouterAction({\n type: ACTION_REFRESH,\n })\n })\n },\n hmrRefresh: () => {\n if (process.env.NODE_ENV !== 'development') {\n throw new Error(\n 'hmrRefresh can only be used in development mode. Please use refresh instead.'\n )\n } else {\n // Reset the known routes table so that route predictions are cleared\n // when routes change during development.\n resetKnownRoutes()\n let signal: AbortSignal | undefined\n if (process.env.__NEXT_SERVER_COMPONENTS_HMR_CANCELLATION) {\n // Abort the superseded generation before scheduling the new one, so its\n // request is torn down as early as possible. Halting (not rejecting)\n // makes the abort safe regardless of order.\n activeHmrRefreshController?.abort()\n activeHmrRefreshController = new AbortController()\n signal = activeHmrRefreshController.signal\n }\n startTransition(() => {\n dispatchAppRouterAction({\n type: ACTION_HMR_REFRESH,\n signal,\n })\n })\n }\n },\n // Default value. Each route segment provides its own value at runtime. Refer\n // to `useRouter()`.\n bfcacheId: '0',\n}\n\n// Conditionally add experimental_gesturePush when gestureTransition is enabled\nif (process.env.__NEXT_GESTURE_TRANSITION) {\n ;(publicAppRouterInstance as any).experimental_gesturePush = gesturePush\n}\n\n// Exists for debugging purposes. Don't use in application code.\nif (typeof window !== 'undefined' && window.next) {\n window.next.router = publicAppRouterInstance\n}\n"],"names":["ACTION_REFRESH","ACTION_SERVER_ACTION","ACTION_NAVIGATE","ACTION_RESTORE","ACTION_HMR_REFRESH","PrefetchKind","ScrollBehavior","reducer","addTransitionType","startTransition","isThenable","FetchStrategy","prefetch","prefetchWithSegmentCache","navigate","dispatchAppRouterAction","dispatchGestureState","resetKnownRoutes","FreshnessPolicy","addBasePath","isExternalURL","setLinkForCurrentNavigation","isJavaScriptURLString","startRouterTransition","runRemainingActions","actionQueue","settledAction","setState","pending","next","runAction","action","needsRefresh","dispatch","type","prevState","state","payload","actionResult","handleResult","nextState","discarded","didRevalidate","resolve","then","err","reject","dispatchAction","resolvers","deferredPromise","Promise","newAction","last","globalActionQueue","createMutableActionQueue","initialState","result","window","Error","getCurrentAppRouterState","getAppRouterActionQueue","dispatchNavigateAction","href","navigateType","scrollBehavior","linkInstanceRef","transitionTypes","prefetchIntent","url","URL","location","process","env","__NEXT_APP_NAV_FAIL_HANDLING","__pendingUrl","tree","isExternalUrl","locationSearch","search","dispatchTraverseAction","historyState","gesturePush","options","__NEXT_GESTURE_TRANSITION","currentUrl","canonicalUrl","scroll","NoScroll","Default","freshnessPolicy","Gesture","forkedGestureState","renderedSearch","cache","nextUrl","activeHmrRefreshController","publicAppRouterInstance","back","history","forward","prefetchKind","kind","AUTO","fetchStrategy","PPR","FULL","Full","onInvalidate","replace","push","refresh","hmrRefresh","NODE_ENV","signal","__NEXT_SERVER_COMPONENTS_HMR_CANCELLATION","abort","AbortController","bfcacheId","experimental_gesturePush","router"],"mappings":"AAAA,SAIEA,cAAc,EACdC,oBAAoB,EACpBC,eAAe,EACfC,cAAc,EAEdC,kBAAkB,EAClBC,YAAY,EACZC,cAAc,QAET,wCAAuC;AAC9C,SAASC,OAAO,QAAQ,kCAAiC;AACzD,SAASC,iBAAiB,EAAEC,eAAe,QAAQ,QAAO;AAC1D,SAASC,UAAU,QAAQ,+BAA8B;AACzD,SACEC,aAAa,QAER,wBAAuB;AAC9B,SAASC,YAAYC,wBAAwB,QAAQ,2BAA0B;AAC/E,SAASC,QAAQ,QAAQ,6BAA4B;AACrD,SACEC,uBAAuB,EACvBC,oBAAoB,QACf,qBAAoB;AAC3B,SAASC,gBAAgB,QAAQ,oCAAmC;AACpE,SAASC,eAAe,QAAQ,mCAAkC;AAClE,SAASC,WAAW,QAAQ,mBAAkB;AAC9C,SAASC,aAAa,QAAQ,qBAAoB;AAMlD,SAASC,2BAA2B,QAA2B,UAAS;AAGxE,SAASC,qBAAqB,QAAQ,wBAAuB;AAC7D,SAASC,qBAAqB,QAAQ,sBAAqB;AA2B3D,SAASC,oBACPC,WAAiC,EACjCC,aAA8B,EAC9BC,QAA8B;IAE9B,0EAA0E;IAC1E,yEAAyE;IACzE,qEAAqE;IACrE,gEAAgE;IAChE,IAAIF,YAAYG,OAAO,KAAKF,eAAe;QACzCD,YAAYG,OAAO,GAAGF,cAAcG,IAAI;QACxC,IAAIJ,YAAYG,OAAO,KAAK,MAAM;YAChCE,UAAU;gBACRL;gBACAM,QAAQN,YAAYG,OAAO;gBAC3BD;YACF;YACA;QACF;IACF;IAEA,IAAIF,YAAYG,OAAO,KAAK,QAAQH,YAAYO,YAAY,EAAE;QAC5D,uEAAuE;QACvE,gCA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K,eAAe;YAC1C,MAAM,qBAEL,CAFK,IAAItD,MACR,iFADI,qBAAA;uBAAA;4BAAA;8BAAA;YAEN;QACF,OAAO;YACL,qEAAqE;YACrE,yCAAyC;YACzCzC;YACA,IAAIgG;YACJ,IAAI1C,QAAQC,GAAG,CAAC0C,yCAAyC,EAAE;gBACzD,wEAAwE;gBACxE,qEAAqE;gBACrE,4CAA4C;gBAC5CnB,4BAA4BoB;gBAC5BpB,6BAA6B,IAAIqB;gBACjCH,SAASlB,2BAA2BkB,MAAM;YAC5C;YACAxG,gBAAgB;gBACdM,wBAAwB;oBACtBmB,MAAM9B;oBACN6G;gBACF;YACF;QACF;IACF;IACA,6EAA6E;IAC7E,oBAAoB;IACpBI,WAAW;AACb,EAAC;AAED,+EAA+E;AAC/E,IAAI9C,QAAQC,GAAG,CAACW,yBAAyB,EAAE;;IACvCa,wBAAgCsB,wBAAwB,GAAGrC;AAC/D;AAEA,gEAAgE;AAChE,IAAI,OAAOxB,WAAW,eAAeA,OAAO5B,IAAI,EAAE;IAChD4B,OAAO5B,IAAI,CAAC0F,MAAM,GAAGvB;AACvB","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/client/components/app-router-instance.ts"],"sourcesContent":["import {\n type AppRouterState,\n type ReducerActions,\n type ReducerState,\n ACTION_REFRESH,\n ACTION_SERVER_ACTION,\n ACTION_NAVIGATE,\n ACTION_RESTORE,\n type NavigateAction,\n ACTION_HMR_REFRESH,\n PrefetchKind,\n ScrollBehavior,\n type AppHistoryState,\n} from './router-reducer/router-reducer-types'\nimport { reducer } from './router-reducer/router-reducer'\nimport { addTransitionType, startTransition } from 'react'\nimport { isThenable } from '../../shared/lib/is-thenable'\nimport {\n FetchStrategy,\n type PrefetchTaskFetchStrategy,\n} from './segment-cache/types'\nimport { prefetch as prefetchWithSegmentCache } from './segment-cache/prefetch'\nimport { navigate } from './segment-cache/navigation'\nimport {\n dispatchAppRouterAction,\n dispatchGestureState,\n} from './use-action-queue'\nimport { resetKnownRoutes } from './segment-cache/optimistic-routes'\nimport { FreshnessPolicy } from './router-reducer/ppr-navigations'\nimport { addBasePath } from '../add-base-path'\nimport { isExternalURL } from './app-router-utils'\nimport type {\n AppRouterInstance,\n NavigateOptions,\n PrefetchOptions,\n} from '../../shared/lib/app-router-context.shared-runtime'\nimport { setLinkForCurrentNavigation, type LinkInstance } from './links'\nimport type { RouterTransitionPrefetchIntent } from '../router-transition-types'\nimport type { GlobalErrorComponent } from './builtin/global-error'\nimport { isJavaScriptURLString } from '../lib/javascript-url'\nimport { startRouterTransition } from './router-transition'\n\nexport type DispatchStatePromise = React.Dispatch<ReducerState>\n\nexport type AppRouterActionQueue = {\n state: AppRouterState\n dispatch: (payload: ReducerActions, setState: DispatchStatePromise) => void\n action: (state: AppRouterState, action: ReducerActions) => ReducerState\n\n pending: ActionQueueNode | null\n needsRefresh?: boolean\n wasPreempted?: boolean\n last: ActionQueueNode | null\n}\n\nexport type GlobalErrorState = [\n GlobalError: GlobalErrorComponent,\n styles: React.ReactNode,\n]\n\nexport type ActionQueueNode = {\n payload: ReducerActions\n next: ActionQueueNode | null\n resolve: (value: ReducerState) => void\n reject: (err: Error) => void\n discarded?: boolean\n}\n\nfunction runRemainingActions(\n actionQueue: AppRouterActionQueue,\n settledAction: ActionQueueNode,\n setState: DispatchStatePromise\n) {\n // Only advance the queue if the settled action is still at its head. If a\n // navigation discarded this action, the navigation took its place and is\n // still in flight — starting the next queued action now would run it\n // against router state that doesn't include the navigation yet.\n if (actionQueue.pending === settledAction) {\n actionQueue.pending = settledAction.next\n if (actionQueue.pending !== null) {\n runAction({\n actionQueue,\n action: actionQueue.pending,\n setState,\n })\n return\n }\n }\n\n if (actionQueue.pending === null) {\n if (actionQueue.wasPreempted) {\n actionQueue.wasPreempted = false\n // When an action is preempted, later actions can update the queue's state without React rendering it.\n // Once the queue is empty, publish the final state so the UI catches up.\n startTransition(() => setState(actionQueue.state))\n }\n\n if (actionQueue.needsRefresh) {\n // The queue is idle; flush the refresh requested by a discarded server\n // action that revalidated data.\n actionQueue.needsRefresh = false\n actionQueue.dispatch({ type: ACTION_REFRESH }, setState)\n }\n }\n}\n\nasync function runAction({\n actionQueue,\n action,\n setState,\n}: {\n actionQueue: AppRouterActionQueue\n action: ActionQueueNode\n setState: DispatchStatePromise\n}) {\n const prevState = actionQueue.state\n\n actionQueue.pending = action\n\n const payload = action.payload\n const actionResult = actionQueue.action(prevState, payload)\n\n function handleResult(nextState: AppRouterState) {\n // if we discarded this action, the state should also be discarded\n if (action.discarded) {\n // Check if the discarded server action revalidated data\n if (\n action.payload.type === ACTION_SERVER_ACTION &&\n action.payload.didRevalidate\n ) {\n // The server action was discarded but it revalidated data,\n // mark that we need to refresh after all actions complete\n actionQueue.needsRefresh = true\n }\n // This can't advance the queue (this action is no longer its head), but\n // if the queue has already drained, it flushes the refresh now.\n runRemainingActions(actionQueue, action, setState)\n return\n }\n\n actionQueue.state = nextState\n\n runRemainingActions(actionQueue, action, setState)\n action.resolve(nextState)\n }\n\n // if the action is a promise, set up a callback to resolve it\n if (isThenable(actionResult)) {\n actionResult.then(handleResult, (err) => {\n runRemainingActions(actionQueue, action, setState)\n action.reject(err)\n })\n } else {\n handleResult(actionResult)\n }\n}\n\nfunction dispatchAction(\n actionQueue: AppRouterActionQueue,\n payload: ReducerActions,\n setState: DispatchStatePromise\n) {\n let resolvers: {\n resolve: (value: ReducerState) => void\n reject: (reason: any) => void\n } = { resolve: setState, reject: () => {} }\n\n // most of the action types are async with the exception of restore\n // it's important that restore is handled quickly since it's fired on the popstate event\n // and we don't want to add any delay on a back/forward nav\n // this only creates a promise for the async actions\n if (payload.type !== ACTION_RESTORE) {\n // Create the promise and assign the resolvers to the object.\n const deferredPromise = new Promise<AppRouterState>((resolve, reject) => {\n resolvers = { resolve, reject }\n })\n\n startTransition(() => {\n // we immediately notify React of the pending promise -- the resolver is attached to the action node\n // and will be called when the associated action promise resolves\n setState(deferredPromise)\n })\n }\n\n const newAction: ActionQueueNode = {\n payload,\n next: null,\n resolve: resolvers.resolve,\n reject: resolvers.reject,\n }\n\n // Check if the queue is empty\n if (actionQueue.pending === null) {\n // The queue is empty, so add the action and start it immediately\n // Mark this action as the last in the queue\n actionQueue.last = newAction\n\n runAction({\n actionQueue,\n action: newAction,\n setState,\n })\n } else if (\n payload.type === ACTION_NAVIGATE ||\n payload.type === ACTION_RESTORE\n ) {\n // Navigations (including back/forward) take priority over any pending actions.\n // Mark the pending action as discarded (so the state is never applied) and start the navigation action immediately.\n actionQueue.pending.discarded = true\n actionQueue.wasPreempted = true\n\n // The rest of the current queue should still execute after this navigation.\n // (Note that it can't contain any earlier navigations, because we always put those into `actionQueue.pending` by calling `runAction`)\n newAction.next = actionQueue.pending.next\n\n if (actionQueue.last === actionQueue.pending) {\n actionQueue.last = newAction\n }\n\n runAction({\n actionQueue,\n action: newAction,\n setState,\n })\n } else {\n // The queue is not empty, so add the action to the end of the queue\n // It will be started by runRemainingActions after the previous action finishes\n if (actionQueue.last !== null) {\n actionQueue.last.next = newAction\n }\n actionQueue.last = newAction\n }\n}\n\nlet globalActionQueue: AppRouterActionQueue | null = null\n\nexport function createMutableActionQueue(\n initialState: AppRouterState\n): AppRouterActionQueue {\n const actionQueue: AppRouterActionQueue = {\n state: initialState,\n dispatch: (payload: ReducerActions, setState: DispatchStatePromise) =>\n dispatchAction(actionQueue, payload, setState),\n action: async (state: AppRouterState, action: ReducerActions) => {\n const result = reducer(state, action)\n return result\n },\n pending: null,\n last: null,\n }\n\n if (typeof window !== 'undefined') {\n // The action queue is lazily created on hydration, but after that point\n // it doesn't change. So we can store it in a global rather than pass\n // it around everywhere via props/context.\n if (globalActionQueue !== null) {\n throw new Error(\n 'Internal Next.js Error: createMutableActionQueue was called more ' +\n 'than once'\n )\n }\n globalActionQueue = actionQueue\n }\n\n return actionQueue\n}\n\nexport function getCurrentAppRouterState(): AppRouterState | null {\n return globalActionQueue !== null ? globalActionQueue.state : null\n}\n\nfunction getAppRouterActionQueue(): AppRouterActionQueue {\n if (globalActionQueue === null) {\n throw new Error(\n 'Internal Next.js error: Router action dispatched before initialization.'\n )\n }\n return globalActionQueue\n}\n\nexport function dispatchNavigateAction(\n href: string,\n navigateType: NavigateAction['navigateType'],\n scrollBehavior: ScrollBehavior,\n linkInstanceRef: LinkInstance | null,\n transitionTypes: string[] | undefined,\n prefetchIntent: RouterTransitionPrefetchIntent | null\n): void {\n // TODO: This stuff could just go into the reducer. Leaving as-is for now\n // since we're about to rewrite all the router reducer stuff anyway.\n\n if (transitionTypes) {\n for (const type of transitionTypes) {\n addTransitionType(type)\n }\n }\n\n const url = new URL(addBasePath(href), location.href)\n if (process.env.__NEXT_APP_NAV_FAIL_HANDLING) {\n window.next.__pendingUrl = url\n }\n\n setLinkForCurrentNavigation(linkInstanceRef)\n startRouterTransition(\n href,\n navigateType,\n getAppRouterActionQueue().state.tree,\n prefetchIntent\n )\n\n dispatchAppRouterAction({\n type: ACTION_NAVIGATE,\n url,\n isExternalUrl: isExternalURL(url),\n locationSearch: location.search,\n scrollBehavior,\n navigateType,\n })\n}\n\nexport function dispatchTraverseAction(\n href: string,\n historyState: AppHistoryState | undefined\n) {\n startRouterTransition(\n href,\n 'traverse',\n getAppRouterActionQueue().state.tree,\n null\n )\n dispatchAppRouterAction({\n type: ACTION_RESTORE,\n url: new URL(href),\n historyState,\n })\n}\n\n/**\n * (Experimental) Perform a gesture navigation. This dispatches through React's\n * useOptimistic instead of the main action queue, allowing the state to be\n * shown during a gesture transition and discarded when the canonical navigation\n * completes.\n *\n * Only available when experimental.gestureTransition is enabled.\n */\nfunction gesturePush(href: string, options?: NavigateOptions): void {\n if (process.env.__NEXT_GESTURE_TRANSITION) {\n // TODO: Trigger a prefetch so the cache starts populating if there isn't\n // already a prefetch for this route.\n if (isJavaScriptURLString(href)) {\n throw new Error(\n 'Next.js has blocked a javascript: URL as a security precaution.'\n )\n }\n\n const state = getCurrentAppRouterState()\n if (state === null) {\n return\n }\n const url = new URL(addBasePath(href), location.href)\n if (isExternalURL(url)) {\n return\n }\n\n // Fork the router state for the duration of the gesture transition.\n const currentUrl = new URL(state.canonicalUrl, location.href)\n const scrollBehavior =\n options?.scroll === false\n ? ScrollBehavior.NoScroll\n : ScrollBehavior.Default\n // This is a special freshness policy that prevents dynamic requests from\n // being spawned. During the gesture, we should only show the cached\n // prefetched UI, not dynamic data.\n // TODO: In the case of navigations to an unknown route, this will still\n // end up performing a dynamic request. The plan is to do prefetch instead.\n // There's a separate TODO for this.\n const freshnessPolicy = FreshnessPolicy.Gesture\n const forkedGestureState = navigate(\n state,\n url,\n currentUrl,\n state.renderedSearch,\n state.cache,\n state.tree,\n state.nextUrl,\n freshnessPolicy,\n scrollBehavior,\n 'push'\n )\n dispatchGestureState(forkedGestureState)\n }\n}\n\n// Tracks the newest HMR refresh generation so that a newer refresh can abort\n// the request of the one it supersedes. Development only.\nlet activeHmrRefreshController: AbortController | null = null\n\n/**\n * The app router that is exposed through `useRouter`. These are public API\n * methods. Internal Next.js code should call the lower level methods directly\n * (although there's lots of existing code that doesn't do that).\n */\nexport const publicAppRouterInstance: AppRouterInstance = {\n back: () => window.history.back(),\n forward: () => window.history.forward(),\n prefetch:\n // Unlike the old implementation, the Segment Cache doesn't store its\n // data in the router reducer state; it writes into a global mutable\n // cache. So we don't need to dispatch an action.\n (href: string, options?: PrefetchOptions) => {\n if (isJavaScriptURLString(href)) {\n throw new Error(\n 'Next.js has blocked a javascript: URL as a security precaution.'\n )\n }\n const actionQueue = getAppRouterActionQueue()\n const prefetchKind = options?.kind ?? PrefetchKind.AUTO\n\n // We don't currently offer a way to issue a runtime prefetch via `router.prefetch()`.\n // This will be possible when we update its API to not take a PrefetchKind.\n let fetchStrategy: PrefetchTaskFetchStrategy\n switch (prefetchKind) {\n case PrefetchKind.AUTO: {\n // We default to PPR. We'll discover whether or not the route supports it with the initial prefetch.\n fetchStrategy = FetchStrategy.PPR\n break\n }\n case PrefetchKind.FULL: {\n fetchStrategy = FetchStrategy.Full\n break\n }\n default: {\n prefetchKind satisfies never\n // Despite typescript thinking that this can't happen,\n // we might get an unexpected value from user code.\n // We don't know what they want, but we know they want a prefetch,\n // so use the default.\n fetchStrategy = FetchStrategy.PPR\n }\n }\n\n prefetchWithSegmentCache(\n href,\n actionQueue.state.nextUrl,\n actionQueue.state.tree,\n fetchStrategy,\n options?.onInvalidate ?? null\n )\n },\n replace: (href: string, options?: NavigateOptions) => {\n if (isJavaScriptURLString(href)) {\n throw new Error(\n 'Next.js has blocked a javascript: URL as a security precaution.'\n )\n }\n startTransition(() => {\n dispatchNavigateAction(\n href,\n 'replace',\n options?.scroll === false\n ? ScrollBehavior.NoScroll\n : ScrollBehavior.Default,\n null,\n options?.transitionTypes,\n null\n )\n })\n },\n push: (href: string, options?: NavigateOptions) => {\n if (isJavaScriptURLString(href)) {\n throw new Error(\n 'Next.js has blocked a javascript: URL as a security precaution.'\n )\n }\n startTransition(() => {\n dispatchNavigateAction(\n href,\n 'push',\n options?.scroll === false\n ? ScrollBehavior.NoScroll\n : ScrollBehavior.Default,\n null,\n options?.transitionTypes,\n null\n )\n })\n },\n refresh: () => {\n startTransition(() => {\n dispatchAppRouterAction({\n type: ACTION_REFRESH,\n })\n })\n },\n hmrRefresh: () => {\n if (process.env.NODE_ENV !== 'development') {\n throw new Error(\n 'hmrRefresh can only be used in development mode. Please use refresh instead.'\n )\n } else {\n // Reset the known routes table so that route predictions are cleared\n // when routes change during development.\n resetKnownRoutes()\n let signal: AbortSignal | undefined\n if (process.env.__NEXT_SERVER_COMPONENTS_HMR_CANCELLATION) {\n // Abort the superseded generation before scheduling the new one, so its\n // request is torn down as early as possible. Halting (not rejecting)\n // makes the abort safe regardless of order.\n activeHmrRefreshController?.abort()\n activeHmrRefreshController = new AbortController()\n signal = activeHmrRefreshController.signal\n }\n startTransition(() => {\n dispatchAppRouterAction({\n type: ACTION_HMR_REFRESH,\n signal,\n })\n })\n }\n },\n // Default value. Each route segment provides its own value at runtime. Refer\n // to `useRouter()`.\n bfcacheId: '0',\n}\n\n// Conditionally add experimental_gesturePush when gestureTransition is enabled\nif (process.env.__NEXT_GESTURE_TRANSITION) {\n ;(publicAppRouterInstance as any).experimental_gesturePush = gesturePush\n}\n\n// Exists for debugging purposes. Don't use in application code.\nif (typeof window !== 'undefined' && window.next) {\n window.next.router = publicAppRouterInstance\n}\n"],"names":["ACTION_REFRESH","ACTION_SERVER_ACTION","ACTION_NAVIGATE","ACTION_RESTORE","ACTION_HMR_REFRESH","PrefetchKind","ScrollBehavior","reducer","addTransitionType","startTransition","isThenable","FetchStrategy","prefetch","prefetchWithSegmentCache","navigate","dispatchAppRouterAction","dispatchGestureState","resetKnownRoutes","FreshnessPolicy","addBasePath","isExternalURL","setLinkForCurrentNavigation","isJavaScriptURLString","startRouterTransition","runRemainingActions","actionQueue","settledAction","setState","pending","next","runAction","action","wasPreempted","state","needsRefresh","dispatch","type","prevState","payload","actionResult","handleResult","nextState","discarded","didRevalidate","resolve","then","err","reject","dispatchAction","resolvers","deferredPromise","Promise","newAction","last","globalActionQueue","createMutableActionQueue","initialState","result","window","Error","getCurrentAppRouterState","getAppRouterActionQueue","dispatchNavigateAction","href","navigateType","scrollBehavior","linkInstanceRef","transitionTypes","prefetchIntent","url","URL","location","process","env","__NEXT_APP_NAV_FAIL_HANDLING","__pendingUrl","tree","isExternalUrl","locationSearch","search","dispatchTraverseAction","historyState","gesturePush","options","__NEXT_GESTURE_TRANSITION","currentUrl","canonicalUrl","scroll","NoScroll","Default","freshnessPolicy","Gesture","forkedGestureState","renderedSearch","cache","nextUrl","activeHmrRefreshController","publicAppRouterInstance","back","history","forward","prefetchKind","kind","AUTO","fetchStrategy","PPR","FULL","Full","onInvalidate","replace","push","refresh","hmrRefresh","NODE_ENV","signal","__NEXT_SERVER_COMPONENTS_HMR_CANCELLATION","abort","AbortController","bfcacheId","experimental_gesturePush","router"],"mappings":"AAAA,SAIEA,cAAc,EACdC,oBAAoB,EACpBC,eAAe,EACfC,cAAc,EAEdC,kBAAkB,EA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;YAEN;QACF,OAAO;YACL,qEAAqE;YACrE,yCAAyC;YACzC1C;YACA,IAAIiG;YACJ,IAAI1C,QAAQC,GAAG,CAAC0C,yCAAyC,EAAE;gBACzD,wEAAwE;gBACxE,qEAAqE;gBACrE,4CAA4C;gBAC5CnB,4BAA4BoB;gBAC5BpB,6BAA6B,IAAIqB;gBACjCH,SAASlB,2BAA2BkB,MAAM;YAC5C;YACAzG,gBAAgB;gBACdM,wBAAwB;oBACtBqB,MAAMhC;oBACN8G;gBACF;YACF;QACF;IACF;IACA,6EAA6E;IAC7E,oBAAoB;IACpBI,WAAW;AACb,EAAC;AAED,+EAA+E;AAC/E,IAAI9C,QAAQC,GAAG,CAACW,yBAAyB,EAAE;;IACvCa,wBAAgCsB,wBAAwB,GAAGrC;AAC/D;AAEA,gEAAgE;AAChE,IAAI,OAAOxB,WAAW,eAAeA,OAAO7B,IAAI,EAAE;IAChD6B,OAAO7B,IAAI,CAAC2F,MAAM,GAAGvB;AACvB","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.1-canary.13"; | ||
| export const version = "16.3.1-canary.14"; | ||
| 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.1-canary.13"]; | ||
| const versionData = data.versions["16.3.1-canary.14"]; | ||
| return { | ||
@@ -54,3 +54,3 @@ os: versionData.os, | ||
| lockfileParsed.dependencies[pkg] = { | ||
| version: "16.3.1-canary.13", | ||
| version: "16.3.1-canary.14", | ||
| resolved: pkgData.tarball, | ||
@@ -63,3 +63,3 @@ integrity: pkgData.integrity, | ||
| lockfileParsed.packages[pkg] = { | ||
| version: "16.3.1-canary.13", | ||
| version: "16.3.1-canary.14", | ||
| resolved: pkgData.tarball, | ||
@@ -66,0 +66,0 @@ integrity: pkgData.integrity, |
@@ -7,23 +7,32 @@ import { FLIGHT_HEADERS, NEXT_HTML_REQUEST_ID_HEADER, NEXT_REQUEST_ID_HEADER } from '../../client/components/app-router-headers'; | ||
| import { splitCookiesString } from '../web/utils'; | ||
| /** | ||
| * Internal request headers that userland `headers()` must not expose. They stay | ||
| * on the shared request headers for framework plumbing. | ||
| * | ||
| * Every internal header that the client can send must be listed here. The | ||
| * sealed userland view reads through to the shared request headers, so an | ||
| * omission leaks the header to userland. | ||
| * | ||
| * The names are lowercased because `HeadersAdapter.seal` matches them in | ||
| * lowercase. | ||
| */ const HIDDEN_REQUEST_HEADERS = new Set([ | ||
| ...FLIGHT_HEADERS, | ||
| // The client sends these dev-only request IDs so the server can route debug | ||
| // information back to the originating request. Like the flight headers, | ||
| // they are internal plumbing. | ||
| NEXT_REQUEST_ID_HEADER, | ||
| NEXT_HTML_REQUEST_ID_HEADER | ||
| ].map((header)=>header.toLowerCase())); | ||
| function getHeaders(headers) { | ||
| // `HeadersAdapter.from` wraps `IncomingHttpHeaders` (and returns a `Headers` | ||
| // instance unchanged) without copying, so the `delete` calls below would | ||
| // otherwise mutate the caller's underlying request headers. We copy first so | ||
| // that stripping internal headers only affects the sealed userland view, not | ||
| // the shared `req.headers`. The latter matters because the dev server reads | ||
| // the request-id headers from the raw request again (e.g. when rendering a | ||
| // redirect target after a server action), and mutating them there would break | ||
| // the dev debug channel routing. | ||
| const cleaned = HeadersAdapter.from(headers instanceof Headers ? new Headers(headers) : { | ||
| ...headers | ||
| }); | ||
| for (const header of FLIGHT_HEADERS){ | ||
| cleaned.delete(header); | ||
| } | ||
| // The client sends these dev-only request IDs so the server can route debug | ||
| // information back to the originating request. Like the flight headers, they | ||
| // are internal plumbing and must not be exposed to userland `headers()`. | ||
| cleaned.delete(NEXT_REQUEST_ID_HEADER); | ||
| cleaned.delete(NEXT_HTML_REQUEST_ID_HEADER); | ||
| return HeadersAdapter.seal(cleaned); | ||
| // The sealed userland view must not copy the request headers. | ||
| // `HeadersAdapter.from` returns a `Headers` instance unchanged, so the view | ||
| // reads through to `NextRequest.headers`. A copy detaches `headers()` from | ||
| // the writes that Proxy makes to `NextRequest.headers` afterwards. | ||
| // | ||
| // The view must also not delete the internal headers. Because | ||
| // `HeadersAdapter.from` does not copy, a delete removes them from the shared | ||
| // `req.headers`. The dev server reads the request-id headers from the raw | ||
| // request again, for example when it renders a redirect target after a server | ||
| // action. Their removal breaks the dev debug channel routing. | ||
| return HeadersAdapter.seal(HeadersAdapter.from(headers), HIDDEN_REQUEST_HEADERS); | ||
| } | ||
@@ -30,0 +39,0 @@ function getMutableCookies(headers, onUpdateCookies) { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/server/async-storage/request-store.ts"],"sourcesContent":["import type { BaseNextRequest, BaseNextResponse } from '../base-http'\nimport type { IncomingHttpHeaders } from 'http'\nimport type { RequestStore } from '../app-render/work-unit-async-storage.external'\nimport type { RenderOpts } from '../app-render/types'\nimport type { NextRequest } from '../web/spec-extension/request'\nimport type { __ApiPreviewProps } from '../api-utils'\n\nimport {\n FLIGHT_HEADERS,\n NEXT_HTML_REQUEST_ID_HEADER,\n NEXT_REQUEST_ID_HEADER,\n} from '../../client/components/app-router-headers'\nimport {\n HeadersAdapter,\n type ReadonlyHeaders,\n} from '../web/spec-extension/adapters/headers'\nimport {\n MutableRequestCookiesAdapter,\n RequestCookiesAdapter,\n responseCookiesToRequestCookies,\n createCookiesWithMutableAccessCheck,\n type ReadonlyRequestCookies,\n} from '../web/spec-extension/adapters/request-cookies'\nimport { ResponseCookies, RequestCookies } from '../web/spec-extension/cookies'\nimport { DraftModeProvider } from './draft-mode-provider'\nimport { splitCookiesString } from '../web/utils'\nimport type { ServerComponentsHmrCache } from '../response-cache'\nimport type { ResumeDataCache } from '../resume-data-cache/resume-data-cache'\nimport type { Params } from '../request/params'\nimport type { ImplicitTags } from '../lib/implicit-tags'\nimport type { OpaqueFallbackRouteParams } from '../request/fallback-params'\n\nfunction getHeaders(headers: Headers | IncomingHttpHeaders): ReadonlyHeaders {\n // `HeadersAdapter.from` wraps `IncomingHttpHeaders` (and returns a `Headers`\n // instance unchanged) without copying, so the `delete` calls below would\n // otherwise mutate the caller's underlying request headers. We copy first so\n // that stripping internal headers only affects the sealed userland view, not\n // the shared `req.headers`. The latter matters because the dev server reads\n // the request-id headers from the raw request again (e.g. when rendering a\n // redirect target after a server action), and mutating them there would break\n // the dev debug channel routing.\n const cleaned = HeadersAdapter.from(\n headers instanceof Headers ? new Headers(headers) : { ...headers }\n )\n for (const header of FLIGHT_HEADERS) {\n cleaned.delete(header)\n }\n\n // The client sends these dev-only request IDs so the server can route debug\n // information back to the originating request. Like the flight headers, they\n // are internal plumbing and must not be exposed to userland `headers()`.\n cleaned.delete(NEXT_REQUEST_ID_HEADER)\n cleaned.delete(NEXT_HTML_REQUEST_ID_HEADER)\n\n return HeadersAdapter.seal(cleaned)\n}\n\nfunction getMutableCookies(\n headers: Headers | IncomingHttpHeaders,\n onUpdateCookies?: (cookies: string[]) => void\n): ResponseCookies {\n const cookies = new RequestCookies(HeadersAdapter.from(headers))\n return MutableRequestCookiesAdapter.wrap(cookies, onUpdateCookies)\n}\n\nexport type WrapperRenderOpts = Partial<Pick<RenderOpts, 'onUpdateCookies'>> & {\n previewProps?: __ApiPreviewProps\n}\n\ntype RequestContext = RequestResponsePair & {\n /**\n * The URL of the request. This only specifies the pathname and the search\n * part of the URL. This is only undefined when generating static paths (ie,\n * there is no request in progress, nor do we know one).\n */\n url: {\n /**\n * The pathname of the requested URL.\n */\n pathname: string\n\n /**\n * The search part of the requested URL. If the request did not provide a\n * search part, this will be an empty string.\n */\n search?: string\n }\n phase: RequestStore['phase']\n renderOpts?: WrapperRenderOpts\n isHmrRefresh?: boolean\n serverComponentsHmrCache?: ServerComponentsHmrCache\n implicitTags: ImplicitTags\n}\n\ntype RequestResponsePair =\n | { req: BaseNextRequest; res: BaseNextResponse } // for an app page\n | { req: NextRequest; res: undefined } // in an api route or middleware\n\n/**\n * The fields the request store actually reads from `req` / `res`. Decoupling\n * the store's construction from `IncomingMessage` / `BaseNextRequest` /\n * `NextRequest` lets it be built without a real `req`/`res` (e.g. by the `'use\n * cache'` deadlock probe worker, which only has a serializable snapshot of the\n * outer request).\n */\nexport type RequestStoreInputs = {\n phase: RequestStore['phase']\n /**\n * Raw headers, either as a Web `Headers` instance or Node's\n * `IncomingHttpHeaders`.\n */\n headers: Headers | IncomingHttpHeaders\n /**\n * Called whenever userspace mutates cookies (via `cookies().set(...)` etc.).\n * Real renders wire this to `res.setHeader('Set-Cookie', cookies)`. Pass\n * `undefined` for callers without a response (e.g. probe workers). Cookie\n * writes during `'render'` are still gated by\n * `MutableRequestCookiesAdapter`'s phase guard, so leaving this off doesn't\n * silently accept writes that would otherwise be rejected.\n */\n onUpdateCookies: ((cookies: string[]) => void) | undefined\n url: { pathname: string; search?: string }\n rootParams: Params\n implicitTags: ImplicitTags\n resumeDataCache: ResumeDataCache | null\n previewProps: WrapperRenderOpts['previewProps']\n isHmrRefresh: boolean | undefined\n serverComponentsHmrCache: ServerComponentsHmrCache | undefined\n /**\n * The hash of the most recent server component change (dev only). Included in\n * `\"use cache\"` cache keys so that cached entries are revalidated after an\n * edit, for every client, regardless of whether it runs the HMR client.\n */\n hmrRefreshHash: string | undefined\n fallbackParams: OpaqueFallbackRouteParams | null | undefined\n}\n\n/**\n * If middleware set cookies in this request (indicated by `x-middleware-set-cookie`),\n * then merge those into the existing cookie object, so that when `cookies()` is accessed\n * it's able to read the newly set cookies.\n */\nfunction mergeMiddlewareCookies(\n headers: Headers | IncomingHttpHeaders,\n existingCookies: RequestCookies | ResponseCookies\n) {\n // TODO: this only fires for `IncomingHttpHeaders`; `Headers` instances\n // silently fall through (the `in` check and bracket access don't reach header\n // values stored in internal slots). Confirm whether edge / Web `Headers`\n // callers need this merge or already handle it elsewhere.\n if (\n 'x-middleware-set-cookie' in headers &&\n typeof headers['x-middleware-set-cookie'] === 'string'\n ) {\n const setCookieValue = headers['x-middleware-set-cookie']\n const responseHeaders = new Headers()\n\n for (const cookie of splitCookiesString(setCookieValue)) {\n responseHeaders.append('set-cookie', cookie)\n }\n\n const responseCookies = new ResponseCookies(responseHeaders)\n\n // Transfer cookies from ResponseCookies to RequestCookies\n for (const cookie of responseCookies.getAll()) {\n existingCookies.set(cookie)\n }\n }\n}\n\nexport function createRequestStoreForRender(\n req: RequestContext['req'],\n res: RequestContext['res'],\n url: RequestContext['url'],\n rootParams: Params,\n implicitTags: RequestContext['implicitTags'],\n onUpdateCookies: RenderOpts['onUpdateCookies'],\n previewProps: WrapperRenderOpts['previewProps'],\n isHmrRefresh: RequestContext['isHmrRefresh'],\n serverComponentsHmrCache: RequestContext['serverComponentsHmrCache'],\n resumeDataCache: ResumeDataCache | null,\n fallbackParams: OpaqueFallbackRouteParams | null,\n hmrRefreshHash: string | undefined\n): RequestStore {\n return createRequestStore({\n // Pages start in render phase by default\n phase: 'render',\n headers: req.headers,\n onUpdateCookies:\n onUpdateCookies ??\n (res\n ? (cookies: string[]) => {\n res.setHeader('Set-Cookie', cookies)\n }\n : undefined),\n url,\n rootParams,\n implicitTags,\n resumeDataCache,\n previewProps,\n isHmrRefresh,\n serverComponentsHmrCache,\n hmrRefreshHash,\n fallbackParams,\n })\n}\n\nexport function createRequestStoreForAPI(\n req: RequestContext['req'],\n url: RequestContext['url'],\n implicitTags: RequestContext['implicitTags'],\n onUpdateCookies: RenderOpts['onUpdateCookies'],\n previewProps: WrapperRenderOpts['previewProps'],\n hmrRefreshHash: string | undefined\n): RequestStore {\n return createRequestStore({\n // API routes start in action phase by default\n phase: 'action',\n headers: req.headers,\n onUpdateCookies,\n url,\n rootParams: {},\n implicitTags,\n resumeDataCache: null,\n previewProps,\n isHmrRefresh: false,\n serverComponentsHmrCache: undefined,\n hmrRefreshHash,\n fallbackParams: null,\n })\n}\n\n/**\n * Build a `RequestStore` from a serializable, request-shaped input. Used\n * directly by the existing `createRequestStoreForRender` /\n * `createRequestStoreForAPI` wrappers, and by side-process consumers like the\n * `'use cache'` deadlock probe worker that don't have a real `req`/`res` pair\n * but do have a forwarded snapshot of the outer request's headers etc.\n */\nexport function createRequestStore(inputs: RequestStoreInputs): RequestStore {\n const {\n phase,\n headers,\n onUpdateCookies,\n url,\n rootParams,\n implicitTags,\n resumeDataCache,\n previewProps,\n isHmrRefresh,\n serverComponentsHmrCache,\n hmrRefreshHash,\n fallbackParams,\n } = inputs\n\n const cache: {\n headers?: ReadonlyHeaders\n cookies?: ReadonlyRequestCookies\n mutableCookies?: ResponseCookies\n userspaceMutableCookies?: ResponseCookies\n draftMode?: DraftModeProvider\n } = {}\n\n return {\n type: 'request',\n phase,\n implicitTags,\n // Rather than just using the whole `url` here, we pull the parts we want\n // to ensure we don't use parts of the URL that we shouldn't. This also\n // lets us avoid requiring an empty string for `search` in the type.\n url: { pathname: url.pathname, search: url.search ?? '' },\n rootParams,\n get headers() {\n if (!cache.headers) {\n // Seal the headers object that'll freeze out any methods that could\n // mutate the underlying data.\n cache.headers = getHeaders(headers)\n }\n\n return cache.headers\n },\n get cookies() {\n if (!cache.cookies) {\n // if middleware is setting cookie(s), then include those in\n // the initial cached cookies so they can be read in render\n const requestCookies = new RequestCookies(HeadersAdapter.from(headers))\n\n mergeMiddlewareCookies(headers, requestCookies)\n\n // Seal the cookies object that'll freeze out any methods that could\n // mutate the underlying data.\n cache.cookies = RequestCookiesAdapter.seal(requestCookies)\n }\n\n return cache.cookies\n },\n set cookies(value: ReadonlyRequestCookies) {\n cache.cookies = value\n },\n get mutableCookies() {\n if (!cache.mutableCookies) {\n const mutableCookies = getMutableCookies(headers, onUpdateCookies)\n\n mergeMiddlewareCookies(headers, mutableCookies)\n\n cache.mutableCookies = mutableCookies\n }\n return cache.mutableCookies\n },\n get userspaceMutableCookies() {\n if (!cache.userspaceMutableCookies) {\n const userspaceMutableCookies =\n createCookiesWithMutableAccessCheck(this)\n cache.userspaceMutableCookies = userspaceMutableCookies\n }\n return cache.userspaceMutableCookies\n },\n get draftMode() {\n if (!cache.draftMode) {\n cache.draftMode = new DraftModeProvider(\n previewProps,\n headers,\n this.cookies,\n this.mutableCookies\n )\n }\n\n return cache.draftMode\n },\n resumeDataCache: resumeDataCache ?? null,\n isHmrRefresh,\n serverComponentsHmrCache:\n serverComponentsHmrCache ||\n (globalThis as any).__serverComponentsHmrCache,\n hmrRefreshHash,\n fallbackParams,\n }\n}\n\nexport function synchronizeMutableCookies(store: RequestStore) {\n // TODO: does this need to update headers as well?\n store.cookies = RequestCookiesAdapter.seal(\n responseCookiesToRequestCookies(store.mutableCookies)\n )\n}\n"],"names":["FLIGHT_HEADERS","NEXT_HTML_REQUEST_ID_HEADER","NEXT_REQUEST_ID_HEADER","HeadersAdapter","MutableRequestCookiesAdapter","RequestCookiesAdapter","responseCookiesToRequestCookies","createCookiesWithMutableAccessCheck","ResponseCookies","RequestCookies","DraftModeProvider","splitCookiesString","getHeaders","headers","cleaned","from","Headers","header","delete","seal","getMutableCookies","onUpdateCookies","cookies","wrap","mergeMiddlewareCookies","existingCookies","setCookieValue","responseHeaders","cookie","append","responseCookies","getAll","set","createRequestStoreForRender","req","res","url","rootParams","implicitTags","previewProps","isHmrRefresh","serverComponentsHmrCache","resumeDataCache","fallbackParams","hmrRefreshHash","createRequestStore","phase","setHeader","undefined","createRequestStoreForAPI","inputs","cache","type","pathname","search","requestCookies","value","mutableCookies","userspaceMutableCookies","draftMode","globalThis","__serverComponentsHmrCache","synchronizeMutableCookies","store"],"mappings":"AAOA,SACEA,cAAc,EACdC,2BAA2B,EAC3BC,sBAAsB,QACjB,6CAA4C;AACnD,SACEC,cAAc,QAET,yCAAwC;AAC/C,SACEC,4BAA4B,EAC5BC,qBAAqB,EACrBC,+BAA+B,EAC/BC,mCAAmC,QAE9B,iDAAgD;AACvD,SAASC,eAAe,EAAEC,cAAc,QAAQ,gCAA+B;AAC/E,SAASC,iBAAiB,QAAQ,wBAAuB;AACzD,SAASC,kBAAkB,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store.ts"],"sourcesContent":["import type { BaseNextRequest, BaseNextResponse } from '../base-http'\nimport type { IncomingHttpHeaders } from 'http'\nimport type { RequestStore } from '../app-render/work-unit-async-storage.external'\nimport type { RenderOpts } from '../app-render/types'\nimport type { NextRequest } from '../web/spec-extension/request'\nimport type { __ApiPreviewProps } from '../api-utils'\n\nimport {\n FLIGHT_HEADERS,\n NEXT_HTML_REQUEST_ID_HEADER,\n NEXT_REQUEST_ID_HEADER,\n} from '../../client/components/app-router-headers'\nimport {\n HeadersAdapter,\n type ReadonlyHeaders,\n} from '../web/spec-extension/adapters/headers'\nimport {\n MutableRequestCookiesAdapter,\n RequestCookiesAdapter,\n responseCookiesToRequestCookies,\n createCookiesWithMutableAccessCheck,\n type ReadonlyRequestCookies,\n} from '../web/spec-extension/adapters/request-cookies'\nimport { ResponseCookies, RequestCookies } from '../web/spec-extension/cookies'\nimport { DraftModeProvider } from './draft-mode-provider'\nimport { splitCookiesString } from '../web/utils'\nimport type { ServerComponentsHmrCache } from '../response-cache'\nimport type { ResumeDataCache } from '../resume-data-cache/resume-data-cache'\nimport type { Params } from '../request/params'\nimport type { ImplicitTags } from '../lib/implicit-tags'\nimport type { OpaqueFallbackRouteParams } from '../request/fallback-params'\n\n/**\n * Internal request headers that userland `headers()` must not expose. They stay\n * on the shared request headers for framework plumbing.\n *\n * Every internal header that the client can send must be listed here. The\n * sealed userland view reads through to the shared request headers, so an\n * omission leaks the header to userland.\n *\n * The names are lowercased because `HeadersAdapter.seal` matches them in\n * lowercase.\n */\nconst HIDDEN_REQUEST_HEADERS: ReadonlySet<string> = new Set(\n [\n ...FLIGHT_HEADERS,\n // The client sends these dev-only request IDs so the server can route debug\n // information back to the originating request. Like the flight headers,\n // they are internal plumbing.\n NEXT_REQUEST_ID_HEADER,\n NEXT_HTML_REQUEST_ID_HEADER,\n ].map((header) => header.toLowerCase())\n)\n\nfunction getHeaders(headers: Headers | IncomingHttpHeaders): ReadonlyHeaders {\n // The sealed userland view must not copy the request headers.\n // `HeadersAdapter.from` returns a `Headers` instance unchanged, so the view\n // reads through to `NextRequest.headers`. A copy detaches `headers()` from\n // the writes that Proxy makes to `NextRequest.headers` afterwards.\n //\n // The view must also not delete the internal headers. Because\n // `HeadersAdapter.from` does not copy, a delete removes them from the shared\n // `req.headers`. The dev server reads the request-id headers from the raw\n // request again, for example when it renders a redirect target after a server\n // action. Their removal breaks the dev debug channel routing.\n return HeadersAdapter.seal(\n HeadersAdapter.from(headers),\n HIDDEN_REQUEST_HEADERS\n )\n}\n\nfunction getMutableCookies(\n headers: Headers | IncomingHttpHeaders,\n onUpdateCookies?: (cookies: string[]) => void\n): ResponseCookies {\n const cookies = new RequestCookies(HeadersAdapter.from(headers))\n return MutableRequestCookiesAdapter.wrap(cookies, onUpdateCookies)\n}\n\nexport type WrapperRenderOpts = Partial<Pick<RenderOpts, 'onUpdateCookies'>> & {\n previewProps?: __ApiPreviewProps\n}\n\ntype RequestContext = RequestResponsePair & {\n /**\n * The URL of the request. This only specifies the pathname and the search\n * part of the URL. This is only undefined when generating static paths (ie,\n * there is no request in progress, nor do we know one).\n */\n url: {\n /**\n * The pathname of the requested URL.\n */\n pathname: string\n\n /**\n * The search part of the requested URL. If the request did not provide a\n * search part, this will be an empty string.\n */\n search?: string\n }\n phase: RequestStore['phase']\n renderOpts?: WrapperRenderOpts\n isHmrRefresh?: boolean\n serverComponentsHmrCache?: ServerComponentsHmrCache\n implicitTags: ImplicitTags\n}\n\ntype RequestResponsePair =\n | { req: BaseNextRequest; res: BaseNextResponse } // for an app page\n | { req: NextRequest; res: undefined } // in an api route or middleware\n\n/**\n * The fields the request store actually reads from `req` / `res`. Decoupling\n * the store's construction from `IncomingMessage` / `BaseNextRequest` /\n * `NextRequest` lets it be built without a real `req`/`res` (e.g. by the `'use\n * cache'` deadlock probe worker, which only has a serializable snapshot of the\n * outer request).\n */\nexport type RequestStoreInputs = {\n phase: RequestStore['phase']\n /**\n * Raw headers, either as a Web `Headers` instance or Node's\n * `IncomingHttpHeaders`.\n */\n headers: Headers | IncomingHttpHeaders\n /**\n * Called whenever userspace mutates cookies (via `cookies().set(...)` etc.).\n * Real renders wire this to `res.setHeader('Set-Cookie', cookies)`. Pass\n * `undefined` for callers without a response (e.g. probe workers). Cookie\n * writes during `'render'` are still gated by\n * `MutableRequestCookiesAdapter`'s phase guard, so leaving this off doesn't\n * silently accept writes that would otherwise be rejected.\n */\n onUpdateCookies: ((cookies: string[]) => void) | undefined\n url: { pathname: string; search?: string }\n rootParams: Params\n implicitTags: ImplicitTags\n resumeDataCache: ResumeDataCache | null\n previewProps: WrapperRenderOpts['previewProps']\n isHmrRefresh: boolean | undefined\n serverComponentsHmrCache: ServerComponentsHmrCache | undefined\n /**\n * The hash of the most recent server component change (dev only). Included in\n * `\"use cache\"` cache keys so that cached entries are revalidated after an\n * edit, for every client, regardless of whether it runs the HMR client.\n */\n hmrRefreshHash: string | undefined\n fallbackParams: OpaqueFallbackRouteParams | null | undefined\n}\n\n/**\n * If middleware set cookies in this request (indicated by `x-middleware-set-cookie`),\n * then merge those into the existing cookie object, so that when `cookies()` is accessed\n * it's able to read the newly set cookies.\n */\nfunction mergeMiddlewareCookies(\n headers: Headers | IncomingHttpHeaders,\n existingCookies: RequestCookies | ResponseCookies\n) {\n // TODO: this only fires for `IncomingHttpHeaders`; `Headers` instances\n // silently fall through (the `in` check and bracket access don't reach header\n // values stored in internal slots). Confirm whether edge / Web `Headers`\n // callers need this merge or already handle it elsewhere.\n if (\n 'x-middleware-set-cookie' in headers &&\n typeof headers['x-middleware-set-cookie'] === 'string'\n ) {\n const setCookieValue = headers['x-middleware-set-cookie']\n const responseHeaders = new Headers()\n\n for (const cookie of splitCookiesString(setCookieValue)) {\n responseHeaders.append('set-cookie', cookie)\n }\n\n const responseCookies = new ResponseCookies(responseHeaders)\n\n // Transfer cookies from ResponseCookies to RequestCookies\n for (const cookie of responseCookies.getAll()) {\n existingCookies.set(cookie)\n }\n }\n}\n\nexport function createRequestStoreForRender(\n req: RequestContext['req'],\n res: RequestContext['res'],\n url: RequestContext['url'],\n rootParams: Params,\n implicitTags: RequestContext['implicitTags'],\n onUpdateCookies: RenderOpts['onUpdateCookies'],\n previewProps: WrapperRenderOpts['previewProps'],\n isHmrRefresh: RequestContext['isHmrRefresh'],\n serverComponentsHmrCache: RequestContext['serverComponentsHmrCache'],\n resumeDataCache: ResumeDataCache | null,\n fallbackParams: OpaqueFallbackRouteParams | null,\n hmrRefreshHash: string | undefined\n): RequestStore {\n return createRequestStore({\n // Pages start in render phase by default\n phase: 'render',\n headers: req.headers,\n onUpdateCookies:\n onUpdateCookies ??\n (res\n ? (cookies: string[]) => {\n res.setHeader('Set-Cookie', cookies)\n }\n : undefined),\n url,\n rootParams,\n implicitTags,\n resumeDataCache,\n previewProps,\n isHmrRefresh,\n serverComponentsHmrCache,\n hmrRefreshHash,\n fallbackParams,\n })\n}\n\nexport function createRequestStoreForAPI(\n req: RequestContext['req'],\n url: RequestContext['url'],\n implicitTags: RequestContext['implicitTags'],\n onUpdateCookies: RenderOpts['onUpdateCookies'],\n previewProps: WrapperRenderOpts['previewProps'],\n hmrRefreshHash: string | undefined\n): RequestStore {\n return createRequestStore({\n // API routes start in action phase by default\n phase: 'action',\n headers: req.headers,\n onUpdateCookies,\n url,\n rootParams: {},\n implicitTags,\n resumeDataCache: null,\n previewProps,\n isHmrRefresh: false,\n serverComponentsHmrCache: undefined,\n hmrRefreshHash,\n fallbackParams: null,\n })\n}\n\n/**\n * Build a `RequestStore` from a serializable, request-shaped input. Used\n * directly by the existing `createRequestStoreForRender` /\n * `createRequestStoreForAPI` wrappers, and by side-process consumers like the\n * `'use cache'` deadlock probe worker that don't have a real `req`/`res` pair\n * but do have a forwarded snapshot of the outer request's headers etc.\n */\nexport function createRequestStore(inputs: RequestStoreInputs): RequestStore {\n const {\n phase,\n headers,\n onUpdateCookies,\n url,\n rootParams,\n implicitTags,\n resumeDataCache,\n previewProps,\n isHmrRefresh,\n serverComponentsHmrCache,\n hmrRefreshHash,\n fallbackParams,\n } = inputs\n\n const cache: {\n headers?: ReadonlyHeaders\n cookies?: ReadonlyRequestCookies\n mutableCookies?: ResponseCookies\n userspaceMutableCookies?: ResponseCookies\n draftMode?: DraftModeProvider\n } = {}\n\n return {\n type: 'request',\n phase,\n implicitTags,\n // Rather than just using the whole `url` here, we pull the parts we want\n // to ensure we don't use parts of the URL that we shouldn't. This also\n // lets us avoid requiring an empty string for `search` in the type.\n url: { pathname: url.pathname, search: url.search ?? '' },\n rootParams,\n get headers() {\n if (!cache.headers) {\n // Seal the headers object that'll freeze out any methods that could\n // mutate the underlying data.\n cache.headers = getHeaders(headers)\n }\n\n return cache.headers\n },\n get cookies() {\n if (!cache.cookies) {\n // if middleware is setting cookie(s), then include those in\n // the initial cached cookies so they can be read in render\n const requestCookies = new RequestCookies(HeadersAdapter.from(headers))\n\n mergeMiddlewareCookies(headers, requestCookies)\n\n // Seal the cookies object that'll freeze out any methods that could\n // mutate the underlying data.\n cache.cookies = RequestCookiesAdapter.seal(requestCookies)\n }\n\n return cache.cookies\n },\n set cookies(value: ReadonlyRequestCookies) {\n cache.cookies = value\n },\n get mutableCookies() {\n if (!cache.mutableCookies) {\n const mutableCookies = getMutableCookies(headers, onUpdateCookies)\n\n mergeMiddlewareCookies(headers, mutableCookies)\n\n cache.mutableCookies = mutableCookies\n }\n return cache.mutableCookies\n },\n get userspaceMutableCookies() {\n if (!cache.userspaceMutableCookies) {\n const userspaceMutableCookies =\n createCookiesWithMutableAccessCheck(this)\n cache.userspaceMutableCookies = userspaceMutableCookies\n }\n return cache.userspaceMutableCookies\n },\n get draftMode() {\n if (!cache.draftMode) {\n cache.draftMode = new DraftModeProvider(\n previewProps,\n headers,\n this.cookies,\n this.mutableCookies\n )\n }\n\n return cache.draftMode\n },\n resumeDataCache: resumeDataCache ?? null,\n isHmrRefresh,\n serverComponentsHmrCache:\n serverComponentsHmrCache ||\n (globalThis as any).__serverComponentsHmrCache,\n hmrRefreshHash,\n fallbackParams,\n }\n}\n\nexport function synchronizeMutableCookies(store: RequestStore) {\n // TODO: does this need to update headers as well?\n store.cookies = RequestCookiesAdapter.seal(\n responseCookiesToRequestCookies(store.mutableCookies)\n )\n}\n"],"names":["FLIGHT_HEADERS","NEXT_HTML_REQUEST_ID_HEADER","NEXT_REQUEST_ID_HEADER","HeadersAdapter","MutableRequestCookiesAdapter","RequestCookiesAdapter","responseCookiesToRequestCookies","createCookiesWithMutableAccessCheck","ResponseCookies","RequestCookies","DraftModeProvider","splitCookiesString","HIDDEN_REQUEST_HEADERS","Set","map","header","toLowerCase","getHeaders","headers","seal","from","getMutableCookies","onUpdateCookies","cookies","wrap","mergeMiddlewareCookies","existingCookies","setCookieValue","responseHeaders","Headers","cookie","append","responseCookies","getAll","set","createRequestStoreForRender","req","res","url","rootParams","implicitTags","previewProps","isHmrRefresh","serverComponentsHmrCache","resumeDataCache","fallbackParams","hmrRefreshHash","createRequestStore","phase","setHeader","undefined","createRequestStoreForAPI","inputs","cache","type","pathname","search","requestCookies","value","mutableCookies","userspaceMutableCookies","draftMode","globalThis","__serverComponentsHmrCache","synchronizeMutableCookies","store"],"mappings":"AAOA,SACEA,cAAc,EACdC,2BAA2B,EAC3BC,sBAAsB,QACjB,6CAA4C;AACnD,SACEC,cAAc,QAET,yCAAwC;AAC/C,SACEC,4BAA4B,EAC5BC,qBAAqB,EACrBC,+BAA+B,EAC/BC,mCAAmC,QAE9B,iDAAgD;AACvD,SAASC,eAAe,EAAEC,cAAc,QAAQ,gCAA+B;AAC/E,SAASC,iBAAiB,QAAQ,wBAAuB;AACzD,SAASC,kBAAkB,QAAQ,eAAc;AAOjD;;;;;;;;;;CAUC,GACD,MAAMC,yBAA8C,IAAIC,IACtD;OACKb;IACH,4EAA4E;IAC5E,wEAAwE;IACxE,8BAA8B;IAC9BE;IACAD;CACD,CAACa,GAAG,CAAC,CAACC,SAAWA,OAAOC,WAAW;AAGtC,SAASC,WAAWC,OAAsC;IACxD,8DAA8D;IAC9D,4E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C;YAC7C;YAEA,OAAOJ,MAAM9B,OAAO;QACtB;QACA,IAAIA,SAAQmC,MAA+B;YACzCL,MAAM9B,OAAO,GAAGmC;QAClB;QACA,IAAIC,kBAAiB;YACnB,IAAI,CAACN,MAAMM,cAAc,EAAE;gBACzB,MAAMA,iBAAiBtC,kBAAkBH,SAASI;gBAElDG,uBAAuBP,SAASyC;gBAEhCN,MAAMM,cAAc,GAAGA;YACzB;YACA,OAAON,MAAMM,cAAc;QAC7B;QACA,IAAIC,2BAA0B;YAC5B,IAAI,CAACP,MAAMO,uBAAuB,EAAE;gBAClC,MAAMA,0BACJrD,oCAAoC,IAAI;gBAC1C8C,MAAMO,uBAAuB,GAAGA;YAClC;YACA,OAAOP,MAAMO,uBAAuB;QACtC;QACA,IAAIC,aAAY;YACd,IAAI,CAACR,MAAMQ,SAAS,EAAE;gBACpBR,MAAMQ,SAAS,GAAG,IAAInD,kBACpB+B,cACAvB,SACA,IAAI,CAACK,OAAO,EACZ,IAAI,CAACoC,cAAc;YAEvB;YAEA,OAAON,MAAMQ,SAAS;QACxB;QACAjB,iBAAiBA,mBAAmB;QACpCF;QACAC,0BACEA,4BACA,AAACmB,WAAmBC,0BAA0B;QAChDjB;QACAD;IACF;AACF;AAEA,OAAO,SAASmB,0BAA0BC,KAAmB;IAC3D,kDAAkD;IAClDA,MAAM1C,OAAO,GAAGlB,sBAAsBc,IAAI,CACxCb,gCAAgC2D,MAAMN,cAAc;AAExD","ignoreList":[0]} |
| import os from 'os'; | ||
| import { imageConfigDefault } from '../shared/lib/image-config'; | ||
| import { INFINITE_CACHE } from '../lib/constants'; | ||
| import { isStableBuild } from '../shared/lib/errors/canary-only-config-error'; | ||
| /** | ||
@@ -253,3 +254,4 @@ * All recognized lightningcss feature names. | ||
| turbopackInferModuleSideEffects: true, | ||
| turbopackPluginRuntimeStrategy: 'childProcesses' | ||
| turbopackPluginRuntimeStrategy: 'childProcesses', | ||
| turbopackSharedRuntime: !isStableBuild() | ||
| }, | ||
@@ -256,0 +258,0 @@ htmlLimitedBots: undefined, |
@@ -14,3 +14,3 @@ import { loadEnvConfig } from '@next/env'; | ||
| const versionSuffix = logBundler ? ` (${bundlerName(getBundlerFromEnv())})` : ''; | ||
| Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"16.3.1-canary.13"}`))}${versionSuffix}`); | ||
| Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"16.3.1-canary.14"}`))}${versionSuffix}`); | ||
| if (appUrl) { | ||
@@ -17,0 +17,0 @@ Log.bootstrap(`- Local: ${appUrl}`); |
@@ -112,3 +112,3 @@ // Start CPU profile if it wasn't already started. | ||
| let { port } = serverOptions; | ||
| process.title = `next-server (v${"16.3.1-canary.13"})`; | ||
| process.title = `next-server (v${"16.3.1-canary.14"})`; | ||
| let handlersReady = ()=>{}; | ||
@@ -115,0 +115,0 @@ let handlersError = ()=>{}; |
@@ -17,2 +17,62 @@ import { ReflectAdapter } from './reflect'; | ||
| } | ||
| /** | ||
| * Builds the read methods for a sealed view that exposes all of `target`. | ||
| */ function createPassThroughMethods(target, sealed) { | ||
| return { | ||
| get: target.get.bind(target), | ||
| has: target.has.bind(target), | ||
| getSetCookie: target.getSetCookie.bind(target), | ||
| keys: target.keys.bind(target), | ||
| values: target.values.bind(target), | ||
| entries: target.entries.bind(target), | ||
| [Symbol.iterator]: target[Symbol.iterator].bind(target), | ||
| // The native method passes the unsealed target as the callback's `parent` | ||
| // argument. That is a mutable handle on the underlying headers. Pass the | ||
| // sealed view instead. | ||
| forEach (callbackfn, thisArg) { | ||
| for (const [name, value] of target.entries()){ | ||
| callbackfn.call(thisArg, value, name, sealed); | ||
| } | ||
| } | ||
| }; | ||
| } | ||
| /** | ||
| * Builds the read methods for a sealed view that omits the header names matched | ||
| * by `isHidden`. | ||
| */ function createHidingMethods(target, sealed, isHidden) { | ||
| function* entries() { | ||
| for (const entry of target.entries()){ | ||
| if (!isHidden(entry[0])) { | ||
| yield entry; | ||
| } | ||
| } | ||
| } | ||
| return { | ||
| entries, | ||
| [Symbol.iterator]: entries, | ||
| get: (name)=>isHidden(name) ? null : target.get(name), | ||
| has: (name)=>isHidden(name) ? false : target.has(name), | ||
| getSetCookie: ()=>isHidden('set-cookie') ? [] : target.getSetCookie(), | ||
| *keys () { | ||
| for (const name of target.keys()){ | ||
| if (!isHidden(name)) { | ||
| yield name; | ||
| } | ||
| } | ||
| }, | ||
| *values () { | ||
| for (const [, value] of entries()){ | ||
| yield value; | ||
| } | ||
| }, | ||
| // The native method passes the unsealed target as the callback's `parent` | ||
| // argument. That is a mutable handle on the underlying headers. Pass the | ||
| // sealed view instead. | ||
| forEach (callbackfn, thisArg) { | ||
| for (const [name, value] of entries()){ | ||
| callbackfn.call(thisArg, value, name, sealed); | ||
| } | ||
| } | ||
| }; | ||
| } | ||
| export class HeadersAdapter extends Headers { | ||
@@ -82,4 +142,18 @@ constructor(headers){ | ||
| * any mutating method is called. | ||
| */ static seal(headers) { | ||
| return new Proxy(headers, { | ||
| * | ||
| * The sealed view stays live. Later writes to `headers` remain visible | ||
| * through it. | ||
| * | ||
| * `hidden` omits the given header names from every read operation (`get`, | ||
| * `has`, `getSetCookie`, `forEach`, and iteration). The names must be | ||
| * lowercase. The underlying headers are neither copied nor mutated, so hidden | ||
| * headers remain available to the framework. | ||
| */ static seal(headers, hidden) { | ||
| const isHidden = hidden && hidden.size > 0 ? (name)=>hidden.has(name.toLowerCase()) : null; | ||
| // The methods are built once per sealed view and reused, so repeated access | ||
| // returns the same function instead of a fresh closure. They are assigned | ||
| // after the proxy exists because `forEach` hands the proxy to its callback. | ||
| // Creating the proxy runs no trap, so nothing can read them before then. | ||
| let methods; | ||
| const sealed = new Proxy(headers, { | ||
| get (target, prop, receiver) { | ||
@@ -91,2 +165,12 @@ switch(prop){ | ||
| return ReadonlyHeadersError.callable; | ||
| case Symbol.iterator: | ||
| return methods[Symbol.iterator]; | ||
| case 'get': | ||
| case 'has': | ||
| case 'getSetCookie': | ||
| case 'keys': | ||
| case 'values': | ||
| case 'entries': | ||
| case 'forEach': | ||
| return methods[prop]; | ||
| default: | ||
@@ -97,2 +181,4 @@ return ReflectAdapter.get(target, prop, receiver); | ||
| }); | ||
| methods = isHidden ? createHidingMethods(headers, sealed, isHidden) : createPassThroughMethods(headers, sealed); | ||
| return sealed; | ||
| } | ||
@@ -99,0 +185,0 @@ /** |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../../../src/server/web/spec-extension/adapters/headers.ts"],"sourcesContent":["import type { IncomingHttpHeaders } from 'http'\n\nimport { ReflectAdapter } from './reflect'\n\n/**\n * @internal\n */\nexport class ReadonlyHeadersError extends Error {\n constructor() {\n super(\n 'Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers'\n )\n }\n\n public static callable() {\n throw new ReadonlyHeadersError()\n }\n}\n\nexport type ReadonlyHeaders = Headers & {\n /** @deprecated Method unavailable on `ReadonlyHeaders`. Read more: https://nextjs.org/docs/app/api-reference/functions/headers */\n append(...args: any[]): void\n /** @deprecated Method unavailable on `ReadonlyHeaders`. Read more: https://nextjs.org/docs/app/api-reference/functions/headers */\n set(...args: any[]): void\n /** @deprecated Method unavailable on `ReadonlyHeaders`. Read more: https://nextjs.org/docs/app/api-reference/functions/headers */\n delete(...args: any[]): void\n}\nexport class HeadersAdapter extends Headers {\n private readonly headers: IncomingHttpHeaders\n\n constructor(headers: IncomingHttpHeaders) {\n // We've already overridden the methods that would be called, so we're just\n // calling the super constructor to ensure that the instanceof check works.\n super()\n\n this.headers = new Proxy(headers, {\n get(target, prop, receiver) {\n // Because this is just an object, we expect that all \"get\" operations\n // are for properties. If it's a \"get\" for a symbol, we'll just return\n // the symbol.\n if (typeof prop === 'symbol') {\n return ReflectAdapter.get(target, prop, receiver)\n }\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, return undefined.\n if (typeof original === 'undefined') return\n\n // If the original casing exists, return the value.\n return ReflectAdapter.get(target, original, receiver)\n },\n set(target, prop, value, receiver) {\n if (typeof prop === 'symbol') {\n return ReflectAdapter.set(target, prop, value, receiver)\n }\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, use the prop as the key.\n return ReflectAdapter.set(target, original ?? prop, value, receiver)\n },\n has(target, prop) {\n if (typeof prop === 'symbol') return ReflectAdapter.has(target, prop)\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, return false.\n if (typeof original === 'undefined') return false\n\n // If the original casing exists, return true.\n return ReflectAdapter.has(target, original)\n },\n deleteProperty(target, prop) {\n if (typeof prop === 'symbol')\n return ReflectAdapter.deleteProperty(target, prop)\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, return true.\n if (typeof original === 'undefined') return true\n\n // If the original casing exists, delete the property.\n return ReflectAdapter.deleteProperty(target, original)\n },\n })\n }\n\n /**\n * Seals a Headers instance to prevent modification by throwing an error when\n * any mutating method is called.\n */\n public static seal(headers: Headers): ReadonlyHeaders {\n return new Proxy<ReadonlyHeaders>(headers, {\n get(target, prop, receiver) {\n switch (prop) {\n case 'append':\n case 'delete':\n case 'set':\n return ReadonlyHeadersError.callable\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n })\n }\n\n /**\n * @param headers\n * @returns A fresh object identity backed by the original value\n */\n public static fresh(headers: ReadonlyHeaders): ReadonlyHeaders {\n return new Proxy<ReadonlyHeaders>(headers, {\n get(target, prop, receiver) {\n return ReflectAdapter.get(target, prop, receiver)\n },\n })\n }\n\n /**\n * Merges a header value into a string. This stores multiple values as an\n * array, so we need to merge them into a string.\n *\n * @param value a header value\n * @returns a merged header value (a string)\n */\n private merge(value: string | string[]): string {\n if (Array.isArray(value)) return value.join(', ')\n\n return value\n }\n\n /**\n * Creates a Headers instance from a plain object or a Headers instance.\n *\n * @param headers a plain object or a Headers instance\n * @returns a headers instance\n */\n public static from(headers: IncomingHttpHeaders | Headers): Headers {\n if (headers instanceof Headers) return headers\n\n return new HeadersAdapter(headers)\n }\n\n public append(name: string, value: string): void {\n const existing = this.headers[name]\n if (typeof existing === 'string') {\n this.headers[name] = [existing, value]\n } else if (Array.isArray(existing)) {\n existing.push(value)\n } else {\n this.headers[name] = value\n }\n }\n\n public delete(name: string): void {\n delete this.headers[name]\n }\n\n public get(name: string): string | null {\n const value = this.headers[name]\n if (typeof value !== 'undefined') return this.merge(value)\n\n return null\n }\n\n public has(name: string): boolean {\n return typeof this.headers[name] !== 'undefined'\n }\n\n public set(name: string, value: string): void {\n this.headers[name] = value\n }\n\n public forEach(\n callbackfn: (value: string, name: string, parent: Headers) => void,\n thisArg?: any\n ): void {\n for (const [name, value] of this.entries()) {\n callbackfn.call(thisArg, value, name, this)\n }\n }\n\n public *entries(): HeadersIterator<[string, string]> {\n for (const key of Object.keys(this.headers)) {\n const name = key.toLowerCase()\n // We assert here that this is a string because we got it from the\n // Object.keys() call above.\n const value = this.get(name) as string\n\n yield [name, value] as [string, string]\n }\n }\n\n public *keys(): HeadersIterator<string> {\n for (const key of Object.keys(this.headers)) {\n const name = key.toLowerCase()\n yield name\n }\n }\n\n public *values(): HeadersIterator<string> {\n for (const key of Object.keys(this.headers)) {\n // We assert here that this is a string because we got it from the\n // Object.keys() call above.\n const value = this.get(key) as string\n\n yield value\n }\n }\n\n public [Symbol.iterator](): HeadersIterator<[string, string]> {\n return this.entries()\n }\n}\n"],"names":["ReflectAdapter","ReadonlyHeadersError","Error","constructor","callable","HeadersAdapter","Headers","headers","Proxy","get","target","prop","receiver","lowercased","toLowerCase","original","Object","keys","find","o","set","value","has","deleteProperty","seal","fresh","merge","Array","isArray","join","from","append","name","existing","push","delete","forEach","callbackfn","thisArg","entries","call","key","values","Symbol","iterator"],"mappings":"AAEA,SAASA,cAAc,QAAQ,YAAW;AAE1C;;CAEC,GACD,OAAO,MAAMC,6BAA6BC;IACxCC,aAAc;QACZ,KAAK,CACH;QADF,qBAEC,CAFD,IAEC,EAFD,qBAAA;mBAAA;wBAAA;0BAAA;QAEA;IACF;IAEA,OAAcC,WAAW;QACvB,MAAM,IAAIH;IACZ;AACF;AAUA,OAAO,MAAMI,uBAAuBC;IAGlCH,YAAYI,OAA4B,CAAE;QACxC,2EAA2E;QAC3E,2EAA2E;QAC3E,KAAK;QAEL,IAAI,CAACA,OAAO,GAAG,IAAIC,MAAMD,SAAS;YAChCE,KAAIC,MAAM,EAAEC,IAAI,EAAEC,QAAQ;gBACxB,sEAAsE;gBACtE,sEAAsE;gBACtE,cAAc;gBACd,IAAI,OAAOD,SAAS,UAAU;oBAC5B,OAAOX,eAAeS,GAAG,CAACC,QAAQC,MAAMC;gBAC1C;gBAEA,MAAMC,aAAaF,KAAKG,WAAW;gBAEnC,wEAAwE;gBACxE,qEAAqE;gBACrE,kBAAkB;gBAClB,MAAMC,WAAWC,OAAOC,IAAI,CAACV,SAASW,IAAI,CACxC,CAACC,IAAMA,EAAEL,WAAW,OAAOD;gBAG7B,0DAA0D;gBAC1D,IAAI,OAAOE,aAAa,aAAa;gBAErC,mDAAmD;gBACnD,OAAOf,eAAeS,GAAG,CAACC,QAAQK,UAAUH;YAC9C;YACAQ,KAAIV,MAAM,EAAEC,IAAI,EAAEU,KAAK,EAAET,Q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KAAK,CAACL;QAEpD,OAAO;IACT;IAEOC,IAAIU,IAAY,EAAW;QAChC,OAAO,OAAO,IAAI,CAACzB,OAAO,CAACyB,KAAK,KAAK;IACvC;IAEOZ,IAAIY,IAAY,EAAEX,KAAa,EAAQ;QAC5C,IAAI,CAACd,OAAO,CAACyB,KAAK,GAAGX;IACvB;IAEOe,QACLC,UAAkE,EAClEC,OAAa,EACP;QACN,KAAK,MAAM,CAACN,MAAMX,MAAM,IAAI,IAAI,CAACkB,OAAO,GAAI;YAC1CF,WAAWG,IAAI,CAACF,SAASjB,OAAOW,MAAM,IAAI;QAC5C;IACF;IAEA,CAAQO,UAA6C;QACnD,KAAK,MAAME,OAAOzB,OAAOC,IAAI,CAAC,IAAI,CAACV,OAAO,EAAG;YAC3C,MAAMyB,OAAOS,IAAI3B,WAAW;YAC5B,kEAAkE;YAClE,4BAA4B;YAC5B,MAAMO,QAAQ,IAAI,CAACZ,GAAG,CAACuB;YAEvB,MAAM;gBAACA;gBAAMX;aAAM;QACrB;IACF;IAEA,CAAQJ,OAAgC;QACtC,KAAK,MAAMwB,OAAOzB,OAAOC,IAAI,CAAC,IAAI,CAACV,OAAO,EAAG;YAC3C,MAAMyB,OAAOS,IAAI3B,WAAW;YAC5B,MAAMkB;QACR;IACF;IAEA,CAAQU,SAAkC;QACxC,KAAK,MAAMD,OAAOzB,OAAOC,IAAI,CAAC,IAAI,CAACV,OAAO,EAAG;YAC3C,kEAAkE;YAClE,4BAA4B;YAC5B,MAAMc,QAAQ,IAAI,CAACZ,GAAG,CAACgC;YAEvB,MAAMpB;QACR;IACF;IAEO,CAACsB,OAAOC,QAAQ,CAAC,GAAsC;QAC5D,OAAO,IAAI,CAACL,OAAO;IACrB;AACF","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../../../src/server/web/spec-extension/adapters/headers.ts"],"sourcesContent":["import type { IncomingHttpHeaders } from 'http'\n\nimport { ReflectAdapter } from './reflect'\n\n/**\n * @internal\n */\nexport class ReadonlyHeadersError extends Error {\n constructor() {\n super(\n 'Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers'\n )\n }\n\n public static callable() {\n throw new ReadonlyHeadersError()\n }\n}\n\nexport type ReadonlyHeaders = Headers & {\n /** @deprecated Method unavailable on `ReadonlyHeaders`. Read more: https://nextjs.org/docs/app/api-reference/functions/headers */\n append(...args: any[]): void\n /** @deprecated Method unavailable on `ReadonlyHeaders`. Read more: https://nextjs.org/docs/app/api-reference/functions/headers */\n set(...args: any[]): void\n /** @deprecated Method unavailable on `ReadonlyHeaders`. Read more: https://nextjs.org/docs/app/api-reference/functions/headers */\n delete(...args: any[]): void\n}\n\n/**\n * The read methods that a sealed view provides itself instead of forwarding to\n * the underlying `Headers`. Deriving the type from `Headers` keeps the\n * implementations in step with the platform signatures.\n */\ntype SealedHeaderMethods = Pick<\n Headers,\n | 'get'\n | 'has'\n | 'getSetCookie'\n | 'keys'\n | 'values'\n | 'entries'\n | 'forEach'\n | typeof Symbol.iterator\n>\n\n/**\n * Builds the read methods for a sealed view that exposes all of `target`.\n */\nfunction createPassThroughMethods(\n target: Headers,\n sealed: ReadonlyHeaders\n): SealedHeaderMethods {\n return {\n get: target.get.bind(target),\n has: target.has.bind(target),\n getSetCookie: target.getSetCookie.bind(target),\n keys: target.keys.bind(target),\n values: target.values.bind(target),\n entries: target.entries.bind(target),\n [Symbol.iterator]: target[Symbol.iterator].bind(target),\n // The native method passes the unsealed target as the callback's `parent`\n // argument. That is a mutable handle on the underlying headers. Pass the\n // sealed view instead.\n forEach(callbackfn, thisArg) {\n for (const [name, value] of target.entries()) {\n callbackfn.call(thisArg, value, name, sealed)\n }\n },\n }\n}\n\n/**\n * Builds the read methods for a sealed view that omits the header names matched\n * by `isHidden`.\n */\nfunction createHidingMethods(\n target: Headers,\n sealed: ReadonlyHeaders,\n isHidden: (name: string) => boolean\n): SealedHeaderMethods {\n function* entries(): HeadersIterator<[string, string]> {\n for (const entry of target.entries()) {\n if (!isHidden(entry[0])) {\n yield entry\n }\n }\n }\n\n return {\n entries,\n [Symbol.iterator]: entries,\n get: (name) => (isHidden(name) ? null : target.get(name)),\n has: (name) => (isHidden(name) ? false : target.has(name)),\n getSetCookie: () => (isHidden('set-cookie') ? [] : target.getSetCookie()),\n *keys(): HeadersIterator<string> {\n for (const name of target.keys()) {\n if (!isHidden(name)) {\n yield name\n }\n }\n },\n *values(): HeadersIterator<string> {\n for (const [, value] of entries()) {\n yield value\n }\n },\n // The native method passes the unsealed target as the callback's `parent`\n // argument. That is a mutable handle on the underlying headers. Pass the\n // sealed view instead.\n forEach(callbackfn, thisArg) {\n for (const [name, value] of entries()) {\n callbackfn.call(thisArg, value, name, sealed)\n }\n },\n }\n}\n\nexport class HeadersAdapter extends Headers {\n private readonly headers: IncomingHttpHeaders\n\n constructor(headers: IncomingHttpHeaders) {\n // We've already overridden the methods that would be called, so we're just\n // calling the super constructor to ensure that the instanceof check works.\n super()\n\n this.headers = new Proxy(headers, {\n get(target, prop, receiver) {\n // Because this is just an object, we expect that all \"get\" operations\n // are for properties. If it's a \"get\" for a symbol, we'll just return\n // the symbol.\n if (typeof prop === 'symbol') {\n return ReflectAdapter.get(target, prop, receiver)\n }\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, return undefined.\n if (typeof original === 'undefined') return\n\n // If the original casing exists, return the value.\n return ReflectAdapter.get(target, original, receiver)\n },\n set(target, prop, value, receiver) {\n if (typeof prop === 'symbol') {\n return ReflectAdapter.set(target, prop, value, receiver)\n }\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, use the prop as the key.\n return ReflectAdapter.set(target, original ?? prop, value, receiver)\n },\n has(target, prop) {\n if (typeof prop === 'symbol') return ReflectAdapter.has(target, prop)\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, return false.\n if (typeof original === 'undefined') return false\n\n // If the original casing exists, return true.\n return ReflectAdapter.has(target, original)\n },\n deleteProperty(target, prop) {\n if (typeof prop === 'symbol')\n return ReflectAdapter.deleteProperty(target, prop)\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, return true.\n if (typeof original === 'undefined') return true\n\n // If the original casing exists, delete the property.\n return ReflectAdapter.deleteProperty(target, original)\n },\n })\n }\n\n /**\n * Seals a Headers instance to prevent modification by throwing an error when\n * any mutating method is called.\n *\n * The sealed view stays live. Later writes to `headers` remain visible\n * through it.\n *\n * `hidden` omits the given header names from every read operation (`get`,\n * `has`, `getSetCookie`, `forEach`, and iteration). The names must be\n * lowercase. The underlying headers are neither copied nor mutated, so hidden\n * headers remain available to the framework.\n */\n public static seal(\n headers: Headers,\n hidden?: ReadonlySet<string>\n ): ReadonlyHeaders {\n const isHidden =\n hidden && hidden.size > 0\n ? (name: string): boolean => hidden.has(name.toLowerCase())\n : null\n\n // The methods are built once per sealed view and reused, so repeated access\n // returns the same function instead of a fresh closure. They are assigned\n // after the proxy exists because `forEach` hands the proxy to its callback.\n // Creating the proxy runs no trap, so nothing can read them before then.\n let methods: SealedHeaderMethods\n\n const sealed: ReadonlyHeaders = new Proxy<ReadonlyHeaders>(headers, {\n get(target, prop, receiver) {\n switch (prop) {\n case 'append':\n case 'delete':\n case 'set':\n return ReadonlyHeadersError.callable\n case Symbol.iterator:\n return methods[Symbol.iterator]\n case 'get':\n case 'has':\n case 'getSetCookie':\n case 'keys':\n case 'values':\n case 'entries':\n case 'forEach':\n return methods[prop]\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n })\n\n methods = isHidden\n ? createHidingMethods(headers, sealed, isHidden)\n : createPassThroughMethods(headers, sealed)\n\n return sealed\n }\n\n /**\n * @param headers\n * @returns A fresh object identity backed by the original value\n */\n public static fresh(headers: ReadonlyHeaders): ReadonlyHeaders {\n return new Proxy<ReadonlyHeaders>(headers, {\n get(target, prop, receiver) {\n return ReflectAdapter.get(target, prop, receiver)\n },\n })\n }\n\n /**\n * Merges a header value into a string. This stores multiple values as an\n * array, so we need to merge them into a string.\n *\n * @param value a header value\n * @returns a merged header value (a string)\n */\n private merge(value: string | string[]): string {\n if (Array.isArray(value)) return value.join(', ')\n\n return value\n }\n\n /**\n * Creates a Headers instance from a plain object or a Headers instance.\n *\n * @param headers a plain object or a Headers instance\n * @returns a headers instance\n */\n public static from(headers: IncomingHttpHeaders | Headers): Headers {\n if (headers instanceof Headers) return headers\n\n return new HeadersAdapter(headers)\n }\n\n public append(name: string, value: string): void {\n const existing = this.headers[name]\n if (typeof existing === 'string') {\n this.headers[name] = [existing, value]\n } else if (Array.isArray(existing)) {\n existing.push(value)\n } else {\n this.headers[name] = value\n }\n }\n\n public delete(name: string): void {\n delete this.headers[name]\n }\n\n public get(name: string): string | null {\n const value = this.headers[name]\n if (typeof value !== 'undefined') return this.merge(value)\n\n return null\n }\n\n public has(name: string): boolean {\n return typeof this.headers[name] !== 'undefined'\n }\n\n public set(name: string, value: string): void {\n this.headers[name] = value\n }\n\n public forEach(\n callbackfn: (value: string, name: string, parent: Headers) => void,\n thisArg?: any\n ): void {\n for (const [name, value] of this.entries()) {\n callbackfn.call(thisArg, value, name, this)\n }\n }\n\n public *entries(): HeadersIterator<[string, string]> {\n for (const key of Object.keys(this.headers)) {\n const name = key.toLowerCase()\n // We assert here that this is a string because we got it from the\n // Object.keys() call above.\n const value = this.get(name) as string\n\n yield [name, value] as [string, string]\n }\n }\n\n public *keys(): HeadersIterator<string> {\n for (const key of Object.keys(this.headers)) {\n const name = key.toLowerCase()\n yield name\n }\n }\n\n public *values(): HeadersIterator<string> {\n for (const key of Object.keys(this.headers)) {\n // We assert here that this is a string because we got it from the\n // Object.keys() call above.\n const value = this.get(key) as string\n\n yield value\n }\n }\n\n public [Symbol.iterator](): HeadersIterator<[string, string]> {\n return this.entries()\n }\n}\n"],"names":["ReflectAdapter","ReadonlyHeadersError","Error","constructor","callable","createPassThroughMethods","target","sealed","get","bind","has","getSetCookie","keys","values","entries","Symbol","iterator","forEach","callbackfn","thisArg","name","value","call","createHidingMethods","isHidden","entry","HeadersAdapter","Headers","headers","Proxy","prop","receiver","lowercased","toLowerCase","original","Object","find","o","set","deleteProperty","seal","hidden","size","methods","fresh","merge","Array","isArray","join","from","append","existing","push","delete","key"],"mappings":"AAEA,SAASA,cAAc,QAAQ,YAAW;AAE1C;;CAEC,GACD,OAAO,MAAMC,6BAA6BC;IACxCC,aAAc;QACZ,KAAK,CACH;QADF,qBAEC,CAFD,IAEC,EAFD,qBAAA;mBAAA;wBAAA;0BAAA;QAEA;IACF;IAEA,OAAcC,WAAW;QACvB,MAAM,IAAIH;IACZ;AACF;AA4BA;;CAEC,GACD,SAASI,yBACPC,MAAe,EACfC,MAAuB;IAEvB,OAAO;QACLC,KAAKF,OAAOE,GAAG,CAACC,IAAI,CAACH;QACrBI,KAAKJ,OAAOI,GAAG,CAACD,IAAI,CAACH;QACrBK,cAAcL,OAAOK,YAAY,CAACF,IAAI,CAACH;QACvCM,MAAMN,OAAOM,IAAI,CAACH,IAAI,CAACH;QACvBO,QAAQP,OAAOO,MAAM,CAACJ,IAAI,CAACH;QAC3BQ,SAASR,OAAOQ,OAAO,CAACL,IAAI,CAACH;QAC7B,CAACS,OAAOC,QAAQ,CAAC,EAAEV,MAAM,C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CAACQ,OAAO,CAACR,KAAK,KAAK;IACvC;IAEOkB,IAAIlB,IAAY,EAAEC,KAAa,EAAQ;QAC5C,IAAI,CAACO,OAAO,CAACR,KAAK,GAAGC;IACvB;IAEOJ,QACLC,UAAkE,EAClEC,OAAa,EACP;QACN,KAAK,MAAM,CAACC,MAAMC,MAAM,IAAI,IAAI,CAACP,OAAO,GAAI;YAC1CI,WAAWI,IAAI,CAACH,SAASE,OAAOD,MAAM,IAAI;QAC5C;IACF;IAEA,CAAQN,UAA6C;QACnD,KAAK,MAAMwC,OAAOnB,OAAOvB,IAAI,CAAC,IAAI,CAACgB,OAAO,EAAG;YAC3C,MAAMR,OAAOkC,IAAIrB,WAAW;YAC5B,kEAAkE;YAClE,4BAA4B;YAC5B,MAAMZ,QAAQ,IAAI,CAACb,GAAG,CAACY;YAEvB,MAAM;gBAACA;gBAAMC;aAAM;QACrB;IACF;IAEA,CAAQT,OAAgC;QACtC,KAAK,MAAM0C,OAAOnB,OAAOvB,IAAI,CAAC,IAAI,CAACgB,OAAO,EAAG;YAC3C,MAAMR,OAAOkC,IAAIrB,WAAW;YAC5B,MAAMb;QACR;IACF;IAEA,CAAQP,SAAkC;QACxC,KAAK,MAAMyC,OAAOnB,OAAOvB,IAAI,CAAC,IAAI,CAACgB,OAAO,EAAG;YAC3C,kEAAkE;YAClE,4BAA4B;YAC5B,MAAMP,QAAQ,IAAI,CAACb,GAAG,CAAC8C;YAEvB,MAAMjC;QACR;IACF;IAEO,CAACN,OAAOC,QAAQ,CAAC,GAAsC;QAC5D,OAAO,IAAI,CAACF,OAAO;IACrB;AACF","ignoreList":[0]} |
| export function isStableBuild() { | ||
| return !"16.3.1-canary.13"?.includes('canary') && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV; | ||
| return !"16.3.1-canary.14"?.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.1-canary.13"]; | ||
| const versionData = data.versions["16.3.1-canary.14"]; | ||
| return { | ||
@@ -104,3 +104,3 @@ os: versionData.os, | ||
| lockfileParsed.dependencies[pkg] = { | ||
| version: "16.3.1-canary.13", | ||
| version: "16.3.1-canary.14", | ||
| resolved: pkgData.tarball, | ||
@@ -113,3 +113,3 @@ integrity: pkgData.integrity, | ||
| lockfileParsed.packages[pkg] = { | ||
| version: "16.3.1-canary.13", | ||
| version: "16.3.1-canary.14", | ||
| resolved: pkgData.tarball, | ||
@@ -116,0 +116,0 @@ integrity: pkgData.integrity, |
@@ -37,23 +37,32 @@ "use strict"; | ||
| const _utils = require("../web/utils"); | ||
| /** | ||
| * Internal request headers that userland `headers()` must not expose. They stay | ||
| * on the shared request headers for framework plumbing. | ||
| * | ||
| * Every internal header that the client can send must be listed here. The | ||
| * sealed userland view reads through to the shared request headers, so an | ||
| * omission leaks the header to userland. | ||
| * | ||
| * The names are lowercased because `HeadersAdapter.seal` matches them in | ||
| * lowercase. | ||
| */ const HIDDEN_REQUEST_HEADERS = new Set([ | ||
| ..._approuterheaders.FLIGHT_HEADERS, | ||
| // The client sends these dev-only request IDs so the server can route debug | ||
| // information back to the originating request. Like the flight headers, | ||
| // they are internal plumbing. | ||
| _approuterheaders.NEXT_REQUEST_ID_HEADER, | ||
| _approuterheaders.NEXT_HTML_REQUEST_ID_HEADER | ||
| ].map((header)=>header.toLowerCase())); | ||
| function getHeaders(headers) { | ||
| // `HeadersAdapter.from` wraps `IncomingHttpHeaders` (and returns a `Headers` | ||
| // instance unchanged) without copying, so the `delete` calls below would | ||
| // otherwise mutate the caller's underlying request headers. We copy first so | ||
| // that stripping internal headers only affects the sealed userland view, not | ||
| // the shared `req.headers`. The latter matters because the dev server reads | ||
| // the request-id headers from the raw request again (e.g. when rendering a | ||
| // redirect target after a server action), and mutating them there would break | ||
| // the dev debug channel routing. | ||
| const cleaned = _headers.HeadersAdapter.from(headers instanceof Headers ? new Headers(headers) : { | ||
| ...headers | ||
| }); | ||
| for (const header of _approuterheaders.FLIGHT_HEADERS){ | ||
| cleaned.delete(header); | ||
| } | ||
| // The client sends these dev-only request IDs so the server can route debug | ||
| // information back to the originating request. Like the flight headers, they | ||
| // are internal plumbing and must not be exposed to userland `headers()`. | ||
| cleaned.delete(_approuterheaders.NEXT_REQUEST_ID_HEADER); | ||
| cleaned.delete(_approuterheaders.NEXT_HTML_REQUEST_ID_HEADER); | ||
| return _headers.HeadersAdapter.seal(cleaned); | ||
| // The sealed userland view must not copy the request headers. | ||
| // `HeadersAdapter.from` returns a `Headers` instance unchanged, so the view | ||
| // reads through to `NextRequest.headers`. A copy detaches `headers()` from | ||
| // the writes that Proxy makes to `NextRequest.headers` afterwards. | ||
| // | ||
| // The view must also not delete the internal headers. Because | ||
| // `HeadersAdapter.from` does not copy, a delete removes them from the shared | ||
| // `req.headers`. The dev server reads the request-id headers from the raw | ||
| // request again, for example when it renders a redirect target after a server | ||
| // action. Their removal breaks the dev debug channel routing. | ||
| return _headers.HeadersAdapter.seal(_headers.HeadersAdapter.from(headers), HIDDEN_REQUEST_HEADERS); | ||
| } | ||
@@ -60,0 +69,0 @@ function getMutableCookies(headers, onUpdateCookies) { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/server/async-storage/request-store.ts"],"sourcesContent":["import type { BaseNextRequest, BaseNextResponse } from '../base-http'\nimport type { IncomingHttpHeaders } from 'http'\nimport type { RequestStore } from '../app-render/work-unit-async-storage.external'\nimport type { RenderOpts } from '../app-render/types'\nimport type { NextRequest } from '../web/spec-extension/request'\nimport type { __ApiPreviewProps } from '../api-utils'\n\nimport {\n FLIGHT_HEADERS,\n NEXT_HTML_REQUEST_ID_HEADER,\n NEXT_REQUEST_ID_HEADER,\n} from '../../client/components/app-router-headers'\nimport {\n HeadersAdapter,\n type ReadonlyHeaders,\n} from '../web/spec-extension/adapters/headers'\nimport {\n MutableRequestCookiesAdapter,\n RequestCookiesAdapter,\n responseCookiesToRequestCookies,\n createCookiesWithMutableAccessCheck,\n type ReadonlyRequestCookies,\n} from '../web/spec-extension/adapters/request-cookies'\nimport { ResponseCookies, RequestCookies } from '../web/spec-extension/cookies'\nimport { DraftModeProvider } from './draft-mode-provider'\nimport { splitCookiesString } from '../web/utils'\nimport type { ServerComponentsHmrCache } from '../response-cache'\nimport type { ResumeDataCache } from '../resume-data-cache/resume-data-cache'\nimport type { Params } from '../request/params'\nimport type { ImplicitTags } from '../lib/implicit-tags'\nimport type { OpaqueFallbackRouteParams } from '../request/fallback-params'\n\nfunction getHeaders(headers: Headers | IncomingHttpHeaders): ReadonlyHeaders {\n // `HeadersAdapter.from` wraps `IncomingHttpHeaders` (and returns a `Headers`\n // instance unchanged) without copying, so the `delete` calls below would\n // otherwise mutate the caller's underlying request headers. We copy first so\n // that stripping internal headers only affects the sealed userland view, not\n // the shared `req.headers`. The latter matters because the dev server reads\n // the request-id headers from the raw request again (e.g. when rendering a\n // redirect target after a server action), and mutating them there would break\n // the dev debug channel routing.\n const cleaned = HeadersAdapter.from(\n headers instanceof Headers ? new Headers(headers) : { ...headers }\n )\n for (const header of FLIGHT_HEADERS) {\n cleaned.delete(header)\n }\n\n // The client sends these dev-only request IDs so the server can route debug\n // information back to the originating request. Like the flight headers, they\n // are internal plumbing and must not be exposed to userland `headers()`.\n cleaned.delete(NEXT_REQUEST_ID_HEADER)\n cleaned.delete(NEXT_HTML_REQUEST_ID_HEADER)\n\n return HeadersAdapter.seal(cleaned)\n}\n\nfunction getMutableCookies(\n headers: Headers | IncomingHttpHeaders,\n onUpdateCookies?: (cookies: string[]) => void\n): ResponseCookies {\n const cookies = new RequestCookies(HeadersAdapter.from(headers))\n return MutableRequestCookiesAdapter.wrap(cookies, onUpdateCookies)\n}\n\nexport type WrapperRenderOpts = Partial<Pick<RenderOpts, 'onUpdateCookies'>> & {\n previewProps?: __ApiPreviewProps\n}\n\ntype RequestContext = RequestResponsePair & {\n /**\n * The URL of the request. This only specifies the pathname and the search\n * part of the URL. This is only undefined when generating static paths (ie,\n * there is no request in progress, nor do we know one).\n */\n url: {\n /**\n * The pathname of the requested URL.\n */\n pathname: string\n\n /**\n * The search part of the requested URL. If the request did not provide a\n * search part, this will be an empty string.\n */\n search?: string\n }\n phase: RequestStore['phase']\n renderOpts?: WrapperRenderOpts\n isHmrRefresh?: boolean\n serverComponentsHmrCache?: ServerComponentsHmrCache\n implicitTags: ImplicitTags\n}\n\ntype RequestResponsePair =\n | { req: BaseNextRequest; res: BaseNextResponse } // for an app page\n | { req: NextRequest; res: undefined } // in an api route or middleware\n\n/**\n * The fields the request store actually reads from `req` / `res`. Decoupling\n * the store's construction from `IncomingMessage` / `BaseNextRequest` /\n * `NextRequest` lets it be built without a real `req`/`res` (e.g. by the `'use\n * cache'` deadlock probe worker, which only has a serializable snapshot of the\n * outer request).\n */\nexport type RequestStoreInputs = {\n phase: RequestStore['phase']\n /**\n * Raw headers, either as a Web `Headers` instance or Node's\n * `IncomingHttpHeaders`.\n */\n headers: Headers | IncomingHttpHeaders\n /**\n * Called whenever userspace mutates cookies (via `cookies().set(...)` etc.).\n * Real renders wire this to `res.setHeader('Set-Cookie', cookies)`. Pass\n * `undefined` for callers without a response (e.g. probe workers). Cookie\n * writes during `'render'` are still gated by\n * `MutableRequestCookiesAdapter`'s phase guard, so leaving this off doesn't\n * silently accept writes that would otherwise be rejected.\n */\n onUpdateCookies: ((cookies: string[]) => void) | undefined\n url: { pathname: string; search?: string }\n rootParams: Params\n implicitTags: ImplicitTags\n resumeDataCache: ResumeDataCache | null\n previewProps: WrapperRenderOpts['previewProps']\n isHmrRefresh: boolean | undefined\n serverComponentsHmrCache: ServerComponentsHmrCache | undefined\n /**\n * The hash of the most recent server component change (dev only). Included in\n * `\"use cache\"` cache keys so that cached entries are revalidated after an\n * edit, for every client, regardless of whether it runs the HMR client.\n */\n hmrRefreshHash: string | undefined\n fallbackParams: OpaqueFallbackRouteParams | null | undefined\n}\n\n/**\n * If middleware set cookies in this request (indicated by `x-middleware-set-cookie`),\n * then merge those into the existing cookie object, so that when `cookies()` is accessed\n * it's able to read the newly set cookies.\n */\nfunction mergeMiddlewareCookies(\n headers: Headers | IncomingHttpHeaders,\n existingCookies: RequestCookies | ResponseCookies\n) {\n // TODO: this only fires for `IncomingHttpHeaders`; `Headers` instances\n // silently fall through (the `in` check and bracket access don't reach header\n // values stored in internal slots). Confirm whether edge / Web `Headers`\n // callers need this merge or already handle it elsewhere.\n if (\n 'x-middleware-set-cookie' in headers &&\n typeof headers['x-middleware-set-cookie'] === 'string'\n ) {\n const setCookieValue = headers['x-middleware-set-cookie']\n const responseHeaders = new Headers()\n\n for (const cookie of splitCookiesString(setCookieValue)) {\n responseHeaders.append('set-cookie', cookie)\n }\n\n const responseCookies = new ResponseCookies(responseHeaders)\n\n // Transfer cookies from ResponseCookies to RequestCookies\n for (const cookie of responseCookies.getAll()) {\n existingCookies.set(cookie)\n }\n }\n}\n\nexport function createRequestStoreForRender(\n req: RequestContext['req'],\n res: RequestContext['res'],\n url: RequestContext['url'],\n rootParams: Params,\n implicitTags: RequestContext['implicitTags'],\n onUpdateCookies: RenderOpts['onUpdateCookies'],\n previewProps: WrapperRenderOpts['previewProps'],\n isHmrRefresh: RequestContext['isHmrRefresh'],\n serverComponentsHmrCache: RequestContext['serverComponentsHmrCache'],\n resumeDataCache: ResumeDataCache | null,\n fallbackParams: OpaqueFallbackRouteParams | null,\n hmrRefreshHash: string | undefined\n): RequestStore {\n return createRequestStore({\n // Pages start in render phase by default\n phase: 'render',\n headers: req.headers,\n onUpdateCookies:\n onUpdateCookies ??\n (res\n ? (cookies: string[]) => {\n res.setHeader('Set-Cookie', cookies)\n }\n : undefined),\n url,\n rootParams,\n implicitTags,\n resumeDataCache,\n previewProps,\n isHmrRefresh,\n serverComponentsHmrCache,\n hmrRefreshHash,\n fallbackParams,\n })\n}\n\nexport function createRequestStoreForAPI(\n req: RequestContext['req'],\n url: RequestContext['url'],\n implicitTags: RequestContext['implicitTags'],\n onUpdateCookies: RenderOpts['onUpdateCookies'],\n previewProps: WrapperRenderOpts['previewProps'],\n hmrRefreshHash: string | undefined\n): RequestStore {\n return createRequestStore({\n // API routes start in action phase by default\n phase: 'action',\n headers: req.headers,\n onUpdateCookies,\n url,\n rootParams: {},\n implicitTags,\n resumeDataCache: null,\n previewProps,\n isHmrRefresh: false,\n serverComponentsHmrCache: undefined,\n hmrRefreshHash,\n fallbackParams: null,\n })\n}\n\n/**\n * Build a `RequestStore` from a serializable, request-shaped input. Used\n * directly by the existing `createRequestStoreForRender` /\n * `createRequestStoreForAPI` wrappers, and by side-process consumers like the\n * `'use cache'` deadlock probe worker that don't have a real `req`/`res` pair\n * but do have a forwarded snapshot of the outer request's headers etc.\n */\nexport function createRequestStore(inputs: RequestStoreInputs): RequestStore {\n const {\n phase,\n headers,\n onUpdateCookies,\n url,\n rootParams,\n implicitTags,\n resumeDataCache,\n previewProps,\n isHmrRefresh,\n serverComponentsHmrCache,\n hmrRefreshHash,\n fallbackParams,\n } = inputs\n\n const cache: {\n headers?: ReadonlyHeaders\n cookies?: ReadonlyRequestCookies\n mutableCookies?: ResponseCookies\n userspaceMutableCookies?: ResponseCookies\n draftMode?: DraftModeProvider\n } = {}\n\n return {\n type: 'request',\n phase,\n implicitTags,\n // Rather than just using the whole `url` here, we pull the parts we want\n // to ensure we don't use parts of the URL that we shouldn't. This also\n // lets us avoid requiring an empty string for `search` in the type.\n url: { pathname: url.pathname, search: url.search ?? '' },\n rootParams,\n get headers() {\n if (!cache.headers) {\n // Seal the headers object that'll freeze out any methods that could\n // mutate the underlying data.\n cache.headers = getHeaders(headers)\n }\n\n return cache.headers\n },\n get cookies() {\n if (!cache.cookies) {\n // if middleware is setting cookie(s), then include those in\n // the initial cached cookies so they can be read in render\n const requestCookies = new RequestCookies(HeadersAdapter.from(headers))\n\n mergeMiddlewareCookies(headers, requestCookies)\n\n // Seal the cookies object that'll freeze out any methods that could\n // mutate the underlying data.\n cache.cookies = RequestCookiesAdapter.seal(requestCookies)\n }\n\n return cache.cookies\n },\n set cookies(value: ReadonlyRequestCookies) {\n cache.cookies = value\n },\n get mutableCookies() {\n if (!cache.mutableCookies) {\n const mutableCookies = getMutableCookies(headers, onUpdateCookies)\n\n mergeMiddlewareCookies(headers, mutableCookies)\n\n cache.mutableCookies = mutableCookies\n }\n return cache.mutableCookies\n },\n get userspaceMutableCookies() {\n if (!cache.userspaceMutableCookies) {\n const userspaceMutableCookies =\n createCookiesWithMutableAccessCheck(this)\n cache.userspaceMutableCookies = userspaceMutableCookies\n }\n return cache.userspaceMutableCookies\n },\n get draftMode() {\n if (!cache.draftMode) {\n cache.draftMode = new DraftModeProvider(\n previewProps,\n headers,\n this.cookies,\n this.mutableCookies\n )\n }\n\n return cache.draftMode\n },\n resumeDataCache: resumeDataCache ?? null,\n isHmrRefresh,\n serverComponentsHmrCache:\n serverComponentsHmrCache ||\n (globalThis as any).__serverComponentsHmrCache,\n hmrRefreshHash,\n fallbackParams,\n }\n}\n\nexport function synchronizeMutableCookies(store: RequestStore) {\n // TODO: does this need to update headers as well?\n store.cookies = RequestCookiesAdapter.seal(\n responseCookiesToRequestCookies(store.mutableCookies)\n )\n}\n"],"names":["createRequestStore","createRequestStoreForAPI","createRequestStoreForRender","synchronizeMutableCookies","getHeaders","headers","cleaned","HeadersAdapter","from","Headers","header","FLIGHT_HEADERS","delete","NEXT_REQUEST_ID_HEADER","NEXT_HTML_REQUEST_ID_HEADER","seal","getMutableCookies","onUpdateCookies","cookies","RequestCookies","MutableRequestCookiesAdapter","wrap","mergeMiddlewareCookies","existingCookies","setCookieValue","responseHeaders","cookie","splitCookiesString","append","responseCookies","ResponseCookies","getAll","set","req","res","url","rootParams","implicitTags","previewProps","isHmrRefresh","serverComponentsHmrCache","resumeDataCache","fallbackParams","hmrRefreshHash","phase","setHeader","undefined","inputs","cache","type","pathname","search","requestCookies","RequestCookiesAdapter","value","mutableCookies","userspaceMutableCookies","createCookiesWithMutableAccessCheck","draftMode","DraftModeProvider","globalThis","__serverComponentsHmrCache","store","responseCookiesToRequestCookies"],"mappings":";;;;;;;;;;;;;;;;;IA+OgBA,kBAAkB;eAAlBA;;IAhCAC,wBAAwB;eAAxBA;;IArCAC,2BAA2B;eAA3BA;;IAyKAC,yBAAyB;eAAzBA;;;kCAxUT;yBAIA;gCAOA;yBACyC;mCACd;uBACC;AAOnC,SAASC,WAAWC,OAAsC;IACxD,6EAA6E;IAC7E,yEAAyE;IACzE,6EAA6E;IAC7E,6EAA6E;IAC7E,4EAA4E;IAC5E,2EAA2E;IAC3E,8EAA8E;IAC9E,iCAAiC;IACjC,MAAMC,UAAUC,uBAAc,CAACC,IAAI,CACjCH,mBAAmBI,UAAU,IAAIA,QAAQJ,WAAW;QAAE,GAAGA,OAAO;IAAC;IAEnE,KAAK,MAAMK,UAAUC,gCAAc,CAAE;QACnCL,QAAQM,MAAM,CAACF;IACjB;IAEA,4EAA4E;IAC5E,6EAA6E;IAC7E,yEAAyE;IACzEJ,QAAQM,MAAM,CAACC,wCAAsB;IACrCP,QAAQM,MAAM,CAACE,6CAA2B;IAE1C,OAAOP,uBAAc,CAACQ,IAAI,CAACT;AAC7B;AAEA,SAASU,kBACPX,OAAsC,EACtCY,eAA6C;IAE7C,MAAMC,UAAU,IAAIC,uBAAc,CAACZ,uBAAc,CAACC,IAAI,CAACH;IACvD,OAAOe,4CAA4B,CAACC,IAAI,CAACH,SAASD;AACpD;AA0EA;;;;CAIC,GACD,SAASK,uBACPjB,OAAsC,EACtCkB,eAAiD;IAEjD,uEAAuE;IACvE,8EAA8E;IAC9E,yEAAyE;IACzE,0DAA0D;IAC1D,IACE,6BAA6BlB,WAC7B,OAAOA,OAAO,CAAC,0BAA0B,KAAK,UAC9C;QACA,MAAMmB,iBAAiBnB,OAAO,CAAC,0BAA0B;QACzD,MAAMoB,kBAAkB,IAAIhB;QAE5B,KAAK,MA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A,IAAI,CAACa,OAAO,EACZ,IAAI,CAACqC,cAAc;YAEvB;YAEA,OAAOP,MAAMU,SAAS;QACxB;QACAjB,iBAAiBA,mBAAmB;QACpCF;QACAC,0BACEA,4BACA,AAACoB,WAAmBC,0BAA0B;QAChDlB;QACAD;IACF;AACF;AAEO,SAASvC,0BAA0B2D,KAAmB;IAC3D,kDAAkD;IAClDA,MAAM5C,OAAO,GAAGmC,qCAAqB,CAACtC,IAAI,CACxCgD,IAAAA,+CAA+B,EAACD,MAAMP,cAAc;AAExD","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/server/async-storage/request-store.ts"],"sourcesContent":["import type { BaseNextRequest, BaseNextResponse } from '../base-http'\nimport type { IncomingHttpHeaders } from 'http'\nimport type { RequestStore } from '../app-render/work-unit-async-storage.external'\nimport type { RenderOpts } from '../app-render/types'\nimport type { NextRequest } from '../web/spec-extension/request'\nimport type { __ApiPreviewProps } from '../api-utils'\n\nimport {\n FLIGHT_HEADERS,\n NEXT_HTML_REQUEST_ID_HEADER,\n NEXT_REQUEST_ID_HEADER,\n} from '../../client/components/app-router-headers'\nimport {\n HeadersAdapter,\n type ReadonlyHeaders,\n} from '../web/spec-extension/adapters/headers'\nimport {\n MutableRequestCookiesAdapter,\n RequestCookiesAdapter,\n responseCookiesToRequestCookies,\n createCookiesWithMutableAccessCheck,\n type ReadonlyRequestCookies,\n} from '../web/spec-extension/adapters/request-cookies'\nimport { ResponseCookies, RequestCookies } from '../web/spec-extension/cookies'\nimport { DraftModeProvider } from './draft-mode-provider'\nimport { splitCookiesString } from '../web/utils'\nimport type { ServerComponentsHmrCache } from '../response-cache'\nimport type { ResumeDataCache } from '../resume-data-cache/resume-data-cache'\nimport type { Params } from '../request/params'\nimport type { ImplicitTags } from '../lib/implicit-tags'\nimport type { OpaqueFallbackRouteParams } from '../request/fallback-params'\n\n/**\n * Internal request headers that userland `headers()` must not expose. They stay\n * on the shared request headers for framework plumbing.\n *\n * Every internal header that the client can send must be listed here. The\n * sealed userland view reads through to the shared request headers, so an\n * omission leaks the header to userland.\n *\n * The names are lowercased because `HeadersAdapter.seal` matches them in\n * lowercase.\n */\nconst HIDDEN_REQUEST_HEADERS: ReadonlySet<string> = new Set(\n [\n ...FLIGHT_HEADERS,\n // The client sends these dev-only request IDs so the server can route debug\n // information back to the originating request. Like the flight headers,\n // they are internal plumbing.\n NEXT_REQUEST_ID_HEADER,\n NEXT_HTML_REQUEST_ID_HEADER,\n ].map((header) => header.toLowerCase())\n)\n\nfunction getHeaders(headers: Headers | IncomingHttpHeaders): ReadonlyHeaders {\n // The sealed userland view must not copy the request headers.\n // `HeadersAdapter.from` returns a `Headers` instance unchanged, so the view\n // reads through to `NextRequest.headers`. A copy detaches `headers()` from\n // the writes that Proxy makes to `NextRequest.headers` afterwards.\n //\n // The view must also not delete the internal headers. Because\n // `HeadersAdapter.from` does not copy, a delete removes them from the shared\n // `req.headers`. The dev server reads the request-id headers from the raw\n // request again, for example when it renders a redirect target after a server\n // action. Their removal breaks the dev debug channel routing.\n return HeadersAdapter.seal(\n HeadersAdapter.from(headers),\n HIDDEN_REQUEST_HEADERS\n )\n}\n\nfunction getMutableCookies(\n headers: Headers | IncomingHttpHeaders,\n onUpdateCookies?: (cookies: string[]) => void\n): ResponseCookies {\n const cookies = new RequestCookies(HeadersAdapter.from(headers))\n return MutableRequestCookiesAdapter.wrap(cookies, onUpdateCookies)\n}\n\nexport type WrapperRenderOpts = Partial<Pick<RenderOpts, 'onUpdateCookies'>> & {\n previewProps?: __ApiPreviewProps\n}\n\ntype RequestContext = RequestResponsePair & {\n /**\n * The URL of the request. This only specifies the pathname and the search\n * part of the URL. This is only undefined when generating static paths (ie,\n * there is no request in progress, nor do we know one).\n */\n url: {\n /**\n * The pathname of the requested URL.\n */\n pathname: string\n\n /**\n * The search part of the requested URL. If the request did not provide a\n * search part, this will be an empty string.\n */\n search?: string\n }\n phase: RequestStore['phase']\n renderOpts?: WrapperRenderOpts\n isHmrRefresh?: boolean\n serverComponentsHmrCache?: ServerComponentsHmrCache\n implicitTags: ImplicitTags\n}\n\ntype RequestResponsePair =\n | { req: BaseNextRequest; res: BaseNextResponse } // for an app page\n | { req: NextRequest; res: undefined } // in an api route or middleware\n\n/**\n * The fields the request store actually reads from `req` / `res`. Decoupling\n * the store's construction from `IncomingMessage` / `BaseNextRequest` /\n * `NextRequest` lets it be built without a real `req`/`res` (e.g. by the `'use\n * cache'` deadlock probe worker, which only has a serializable snapshot of the\n * outer request).\n */\nexport type RequestStoreInputs = {\n phase: RequestStore['phase']\n /**\n * Raw headers, either as a Web `Headers` instance or Node's\n * `IncomingHttpHeaders`.\n */\n headers: Headers | IncomingHttpHeaders\n /**\n * Called whenever userspace mutates cookies (via `cookies().set(...)` etc.).\n * Real renders wire this to `res.setHeader('Set-Cookie', cookies)`. Pass\n * `undefined` for callers without a response (e.g. probe workers). Cookie\n * writes during `'render'` are still gated by\n * `MutableRequestCookiesAdapter`'s phase guard, so leaving this off doesn't\n * silently accept writes that would otherwise be rejected.\n */\n onUpdateCookies: ((cookies: string[]) => void) | undefined\n url: { pathname: string; search?: string }\n rootParams: Params\n implicitTags: ImplicitTags\n resumeDataCache: ResumeDataCache | null\n previewProps: WrapperRenderOpts['previewProps']\n isHmrRefresh: boolean | undefined\n serverComponentsHmrCache: ServerComponentsHmrCache | undefined\n /**\n * The hash of the most recent server component change (dev only). Included in\n * `\"use cache\"` cache keys so that cached entries are revalidated after an\n * edit, for every client, regardless of whether it runs the HMR client.\n */\n hmrRefreshHash: string | undefined\n fallbackParams: OpaqueFallbackRouteParams | null | undefined\n}\n\n/**\n * If middleware set cookies in this request (indicated by `x-middleware-set-cookie`),\n * then merge those into the existing cookie object, so that when `cookies()` is accessed\n * it's able to read the newly set cookies.\n */\nfunction mergeMiddlewareCookies(\n headers: Headers | IncomingHttpHeaders,\n existingCookies: RequestCookies | ResponseCookies\n) {\n // TODO: this only fires for `IncomingHttpHeaders`; `Headers` instances\n // silently fall through (the `in` check and bracket access don't reach header\n // values stored in internal slots). Confirm whether edge / Web `Headers`\n // callers need this merge or already handle it elsewhere.\n if (\n 'x-middleware-set-cookie' in headers &&\n typeof headers['x-middleware-set-cookie'] === 'string'\n ) {\n const setCookieValue = headers['x-middleware-set-cookie']\n const responseHeaders = new Headers()\n\n for (const cookie of splitCookiesString(setCookieValue)) {\n responseHeaders.append('set-cookie', cookie)\n }\n\n const responseCookies = new ResponseCookies(responseHeaders)\n\n // Transfer cookies from ResponseCookies to RequestCookies\n for (const cookie of responseCookies.getAll()) {\n existingCookies.set(cookie)\n }\n }\n}\n\nexport function createRequestStoreForRender(\n req: RequestContext['req'],\n res: RequestContext['res'],\n url: RequestContext['url'],\n rootParams: Params,\n implicitTags: RequestContext['implicitTags'],\n onUpdateCookies: RenderOpts['onUpdateCookies'],\n previewProps: WrapperRenderOpts['previewProps'],\n isHmrRefresh: RequestContext['isHmrRefresh'],\n serverComponentsHmrCache: RequestContext['serverComponentsHmrCache'],\n resumeDataCache: ResumeDataCache | null,\n fallbackParams: OpaqueFallbackRouteParams | null,\n hmrRefreshHash: string | undefined\n): RequestStore {\n return createRequestStore({\n // Pages start in render phase by default\n phase: 'render',\n headers: req.headers,\n onUpdateCookies:\n onUpdateCookies ??\n (res\n ? (cookies: string[]) => {\n res.setHeader('Set-Cookie', cookies)\n }\n : undefined),\n url,\n rootParams,\n implicitTags,\n resumeDataCache,\n previewProps,\n isHmrRefresh,\n serverComponentsHmrCache,\n hmrRefreshHash,\n fallbackParams,\n })\n}\n\nexport function createRequestStoreForAPI(\n req: RequestContext['req'],\n url: RequestContext['url'],\n implicitTags: RequestContext['implicitTags'],\n onUpdateCookies: RenderOpts['onUpdateCookies'],\n previewProps: WrapperRenderOpts['previewProps'],\n hmrRefreshHash: string | undefined\n): RequestStore {\n return createRequestStore({\n // API routes start in action phase by default\n phase: 'action',\n headers: req.headers,\n onUpdateCookies,\n url,\n rootParams: {},\n implicitTags,\n resumeDataCache: null,\n previewProps,\n isHmrRefresh: false,\n serverComponentsHmrCache: undefined,\n hmrRefreshHash,\n fallbackParams: null,\n })\n}\n\n/**\n * Build a `RequestStore` from a serializable, request-shaped input. Used\n * directly by the existing `createRequestStoreForRender` /\n * `createRequestStoreForAPI` wrappers, and by side-process consumers like the\n * `'use cache'` deadlock probe worker that don't have a real `req`/`res` pair\n * but do have a forwarded snapshot of the outer request's headers etc.\n */\nexport function createRequestStore(inputs: RequestStoreInputs): RequestStore {\n const {\n phase,\n headers,\n onUpdateCookies,\n url,\n rootParams,\n implicitTags,\n resumeDataCache,\n previewProps,\n isHmrRefresh,\n serverComponentsHmrCache,\n hmrRefreshHash,\n fallbackParams,\n } = inputs\n\n const cache: {\n headers?: ReadonlyHeaders\n cookies?: ReadonlyRequestCookies\n mutableCookies?: ResponseCookies\n userspaceMutableCookies?: ResponseCookies\n draftMode?: DraftModeProvider\n } = {}\n\n return {\n type: 'request',\n phase,\n implicitTags,\n // Rather than just using the whole `url` here, we pull the parts we want\n // to ensure we don't use parts of the URL that we shouldn't. This also\n // lets us avoid requiring an empty string for `search` in the type.\n url: { pathname: url.pathname, search: url.search ?? '' },\n rootParams,\n get headers() {\n if (!cache.headers) {\n // Seal the headers object that'll freeze out any methods that could\n // mutate the underlying data.\n cache.headers = getHeaders(headers)\n }\n\n return cache.headers\n },\n get cookies() {\n if (!cache.cookies) {\n // if middleware is setting cookie(s), then include those in\n // the initial cached cookies so they can be read in render\n const requestCookies = new RequestCookies(HeadersAdapter.from(headers))\n\n mergeMiddlewareCookies(headers, requestCookies)\n\n // Seal the cookies object that'll freeze out any methods that could\n // mutate the underlying data.\n cache.cookies = RequestCookiesAdapter.seal(requestCookies)\n }\n\n return cache.cookies\n },\n set cookies(value: ReadonlyRequestCookies) {\n cache.cookies = value\n },\n get mutableCookies() {\n if (!cache.mutableCookies) {\n const mutableCookies = getMutableCookies(headers, onUpdateCookies)\n\n mergeMiddlewareCookies(headers, mutableCookies)\n\n cache.mutableCookies = mutableCookies\n }\n return cache.mutableCookies\n },\n get userspaceMutableCookies() {\n if (!cache.userspaceMutableCookies) {\n const userspaceMutableCookies =\n createCookiesWithMutableAccessCheck(this)\n cache.userspaceMutableCookies = userspaceMutableCookies\n }\n return cache.userspaceMutableCookies\n },\n get draftMode() {\n if (!cache.draftMode) {\n cache.draftMode = new DraftModeProvider(\n previewProps,\n headers,\n this.cookies,\n this.mutableCookies\n )\n }\n\n return cache.draftMode\n },\n resumeDataCache: resumeDataCache ?? null,\n isHmrRefresh,\n serverComponentsHmrCache:\n serverComponentsHmrCache ||\n (globalThis as any).__serverComponentsHmrCache,\n hmrRefreshHash,\n fallbackParams,\n }\n}\n\nexport function synchronizeMutableCookies(store: RequestStore) {\n // TODO: does this need to update headers as well?\n store.cookies = RequestCookiesAdapter.seal(\n responseCookiesToRequestCookies(store.mutableCookies)\n )\n}\n"],"names":["createRequestStore","createRequestStoreForAPI","createRequestStoreForRender","synchronizeMutableCookies","HIDDEN_REQUEST_HEADERS","Set","FLIGHT_HEADERS","NEXT_REQUEST_ID_HEADER","NEXT_HTML_REQUEST_ID_HEADER","map","header","toLowerCase","getHeaders","headers","HeadersAdapter","seal","from","getMutableCookies","onUpdateCookies","cookies","RequestCookies","MutableRequestCookiesAdapter","wrap","mergeMiddlewareCookies","existingCookies","setCookieValue","responseHeaders","Headers","cookie","splitCookiesString","append","responseCookies","ResponseCookies","getAll","set","req","res","url","rootParams","implicitTags","previewProps","isHmrRefresh","serverComponentsHmrCache","resumeDataCache","fallbackParams","hmrRefreshHash","phase","setHeader","undefined","inputs","cache","type","pathname","search","requestCookies","RequestCookiesAdapter","value","mutableCookies","userspaceMutableCookies","createCookiesWithMutableAccessCheck","draftMode","DraftModeProvider","globalThis","__serverComponentsHmrCache","store","responseCookiesToRequestCookies"],"mappings":";;;;;;;;;;;;;;;;;IA6PgBA,kBAAkB;eAAlBA;;IAhCAC,wBAAwB;eAAxBA;;IArCAC,2BAA2B;eAA3BA;;IAyKAC,yBAAyB;eAAzBA;;;kCAtVT;yBAIA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,cAAc;AAExD","ignoreList":[0]} |
@@ -46,2 +46,3 @@ "use strict"; | ||
| const _constants = require("../lib/constants"); | ||
| const _canaryonlyconfigerror = require("../shared/lib/errors/canary-only-config-error"); | ||
| const _sizelimit = require("../shared/lib/size-limit"); | ||
@@ -285,3 +286,4 @@ function _interop_require_default(obj) { | ||
| turbopackInferModuleSideEffects: true, | ||
| turbopackPluginRuntimeStrategy: 'childProcesses' | ||
| turbopackPluginRuntimeStrategy: 'childProcesses', | ||
| turbopackSharedRuntime: !(0, _canaryonlyconfigerror.isStableBuild)() | ||
| }, | ||
@@ -288,0 +290,0 @@ htmlLimitedBots: undefined, |
@@ -82,3 +82,3 @@ "use strict"; | ||
| const versionSuffix = logBundler ? ` (${(0, _bundler.bundlerName)((0, _bundler.getBundlerFromEnv)())})` : ''; | ||
| _log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"16.3.1-canary.13"}`))}${versionSuffix}`); | ||
| _log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"16.3.1-canary.14"}`))}${versionSuffix}`); | ||
| if (appUrl) { | ||
@@ -85,0 +85,0 @@ _log.bootstrap(`- Local: ${appUrl}`); |
@@ -180,3 +180,3 @@ // Start CPU profile if it wasn't already started. | ||
| let { port } = serverOptions; | ||
| process.title = `next-server (v${"16.3.1-canary.13"})`; | ||
| process.title = `next-server (v${"16.3.1-canary.14"})`; | ||
| let handlersReady = ()=>{}; | ||
@@ -183,0 +183,0 @@ let handlersError = ()=>{}; |
@@ -16,4 +16,12 @@ import type { IncomingHttpHeaders } from 'http'; | ||
| * any mutating method is called. | ||
| * | ||
| * The sealed view stays live. Later writes to `headers` remain visible | ||
| * through it. | ||
| * | ||
| * `hidden` omits the given header names from every read operation (`get`, | ||
| * `has`, `getSetCookie`, `forEach`, and iteration). The names must be | ||
| * lowercase. The underlying headers are neither copied nor mutated, so hidden | ||
| * headers remain available to the framework. | ||
| */ | ||
| static seal(headers: Headers): ReadonlyHeaders; | ||
| static seal(headers: Headers, hidden?: ReadonlySet<string>): ReadonlyHeaders; | ||
| /** | ||
@@ -20,0 +28,0 @@ * @param headers |
@@ -37,2 +37,62 @@ "use strict"; | ||
| } | ||
| /** | ||
| * Builds the read methods for a sealed view that exposes all of `target`. | ||
| */ function createPassThroughMethods(target, sealed) { | ||
| return { | ||
| get: target.get.bind(target), | ||
| has: target.has.bind(target), | ||
| getSetCookie: target.getSetCookie.bind(target), | ||
| keys: target.keys.bind(target), | ||
| values: target.values.bind(target), | ||
| entries: target.entries.bind(target), | ||
| [Symbol.iterator]: target[Symbol.iterator].bind(target), | ||
| // The native method passes the unsealed target as the callback's `parent` | ||
| // argument. That is a mutable handle on the underlying headers. Pass the | ||
| // sealed view instead. | ||
| forEach (callbackfn, thisArg) { | ||
| for (const [name, value] of target.entries()){ | ||
| callbackfn.call(thisArg, value, name, sealed); | ||
| } | ||
| } | ||
| }; | ||
| } | ||
| /** | ||
| * Builds the read methods for a sealed view that omits the header names matched | ||
| * by `isHidden`. | ||
| */ function createHidingMethods(target, sealed, isHidden) { | ||
| function* entries() { | ||
| for (const entry of target.entries()){ | ||
| if (!isHidden(entry[0])) { | ||
| yield entry; | ||
| } | ||
| } | ||
| } | ||
| return { | ||
| entries, | ||
| [Symbol.iterator]: entries, | ||
| get: (name)=>isHidden(name) ? null : target.get(name), | ||
| has: (name)=>isHidden(name) ? false : target.has(name), | ||
| getSetCookie: ()=>isHidden('set-cookie') ? [] : target.getSetCookie(), | ||
| *keys () { | ||
| for (const name of target.keys()){ | ||
| if (!isHidden(name)) { | ||
| yield name; | ||
| } | ||
| } | ||
| }, | ||
| *values () { | ||
| for (const [, value] of entries()){ | ||
| yield value; | ||
| } | ||
| }, | ||
| // The native method passes the unsealed target as the callback's `parent` | ||
| // argument. That is a mutable handle on the underlying headers. Pass the | ||
| // sealed view instead. | ||
| forEach (callbackfn, thisArg) { | ||
| for (const [name, value] of entries()){ | ||
| callbackfn.call(thisArg, value, name, sealed); | ||
| } | ||
| } | ||
| }; | ||
| } | ||
| class HeadersAdapter extends Headers { | ||
@@ -102,4 +162,18 @@ constructor(headers){ | ||
| * any mutating method is called. | ||
| */ static seal(headers) { | ||
| return new Proxy(headers, { | ||
| * | ||
| * The sealed view stays live. Later writes to `headers` remain visible | ||
| * through it. | ||
| * | ||
| * `hidden` omits the given header names from every read operation (`get`, | ||
| * `has`, `getSetCookie`, `forEach`, and iteration). The names must be | ||
| * lowercase. The underlying headers are neither copied nor mutated, so hidden | ||
| * headers remain available to the framework. | ||
| */ static seal(headers, hidden) { | ||
| const isHidden = hidden && hidden.size > 0 ? (name)=>hidden.has(name.toLowerCase()) : null; | ||
| // The methods are built once per sealed view and reused, so repeated access | ||
| // returns the same function instead of a fresh closure. They are assigned | ||
| // after the proxy exists because `forEach` hands the proxy to its callback. | ||
| // Creating the proxy runs no trap, so nothing can read them before then. | ||
| let methods; | ||
| const sealed = new Proxy(headers, { | ||
| get (target, prop, receiver) { | ||
@@ -111,2 +185,12 @@ switch(prop){ | ||
| return ReadonlyHeadersError.callable; | ||
| case Symbol.iterator: | ||
| return methods[Symbol.iterator]; | ||
| case 'get': | ||
| case 'has': | ||
| case 'getSetCookie': | ||
| case 'keys': | ||
| case 'values': | ||
| case 'entries': | ||
| case 'forEach': | ||
| return methods[prop]; | ||
| default: | ||
@@ -117,2 +201,4 @@ return _reflect.ReflectAdapter.get(target, prop, receiver); | ||
| }); | ||
| methods = isHidden ? createHidingMethods(headers, sealed, isHidden) : createPassThroughMethods(headers, sealed); | ||
| return sealed; | ||
| } | ||
@@ -119,0 +205,0 @@ /** |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../../src/server/web/spec-extension/adapters/headers.ts"],"sourcesContent":["import type { IncomingHttpHeaders } from 'http'\n\nimport { ReflectAdapter } from './reflect'\n\n/**\n * @internal\n */\nexport class ReadonlyHeadersError extends Error {\n constructor() {\n super(\n 'Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers'\n )\n }\n\n public static callable() {\n throw new ReadonlyHeadersError()\n }\n}\n\nexport type ReadonlyHeaders = Headers & {\n /** @deprecated Method unavailable on `ReadonlyHeaders`. Read more: https://nextjs.org/docs/app/api-reference/functions/headers */\n append(...args: any[]): void\n /** @deprecated Method unavailable on `ReadonlyHeaders`. Read more: https://nextjs.org/docs/app/api-reference/functions/headers */\n set(...args: any[]): void\n /** @deprecated Method unavailable on `ReadonlyHeaders`. Read more: https://nextjs.org/docs/app/api-reference/functions/headers */\n delete(...args: any[]): void\n}\nexport class HeadersAdapter extends Headers {\n private readonly headers: IncomingHttpHeaders\n\n constructor(headers: IncomingHttpHeaders) {\n // We've already overridden the methods that would be called, so we're just\n // calling the super constructor to ensure that the instanceof check works.\n super()\n\n this.headers = new Proxy(headers, {\n get(target, prop, receiver) {\n // Because this is just an object, we expect that all \"get\" operations\n // are for properties. If it's a \"get\" for a symbol, we'll just return\n // the symbol.\n if (typeof prop === 'symbol') {\n return ReflectAdapter.get(target, prop, receiver)\n }\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, return undefined.\n if (typeof original === 'undefined') return\n\n // If the original casing exists, return the value.\n return ReflectAdapter.get(target, original, receiver)\n },\n set(target, prop, value, receiver) {\n if (typeof prop === 'symbol') {\n return ReflectAdapter.set(target, prop, value, receiver)\n }\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, use the prop as the key.\n return ReflectAdapter.set(target, original ?? prop, value, receiver)\n },\n has(target, prop) {\n if (typeof prop === 'symbol') return ReflectAdapter.has(target, prop)\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, return false.\n if (typeof original === 'undefined') return false\n\n // If the original casing exists, return true.\n return ReflectAdapter.has(target, original)\n },\n deleteProperty(target, prop) {\n if (typeof prop === 'symbol')\n return ReflectAdapter.deleteProperty(target, prop)\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, return true.\n if (typeof original === 'undefined') return true\n\n // If the original casing exists, delete the property.\n return ReflectAdapter.deleteProperty(target, original)\n },\n })\n }\n\n /**\n * Seals a Headers instance to prevent modification by throwing an error when\n * any mutating method is called.\n */\n public static seal(headers: Headers): ReadonlyHeaders {\n return new Proxy<ReadonlyHeaders>(headers, {\n get(target, prop, receiver) {\n switch (prop) {\n case 'append':\n case 'delete':\n case 'set':\n return ReadonlyHeadersError.callable\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n })\n }\n\n /**\n * @param headers\n * @returns A fresh object identity backed by the original value\n */\n public static fresh(headers: ReadonlyHeaders): ReadonlyHeaders {\n return new Proxy<ReadonlyHeaders>(headers, {\n get(target, prop, receiver) {\n return ReflectAdapter.get(target, prop, receiver)\n },\n })\n }\n\n /**\n * Merges a header value into a string. This stores multiple values as an\n * array, so we need to merge them into a string.\n *\n * @param value a header value\n * @returns a merged header value (a string)\n */\n private merge(value: string | string[]): string {\n if (Array.isArray(value)) return value.join(', ')\n\n return value\n }\n\n /**\n * Creates a Headers instance from a plain object or a Headers instance.\n *\n * @param headers a plain object or a Headers instance\n * @returns a headers instance\n */\n public static from(headers: IncomingHttpHeaders | Headers): Headers {\n if (headers instanceof Headers) return headers\n\n return new HeadersAdapter(headers)\n }\n\n public append(name: string, value: string): void {\n const existing = this.headers[name]\n if (typeof existing === 'string') {\n this.headers[name] = [existing, value]\n } else if (Array.isArray(existing)) {\n existing.push(value)\n } else {\n this.headers[name] = value\n }\n }\n\n public delete(name: string): void {\n delete this.headers[name]\n }\n\n public get(name: string): string | null {\n const value = this.headers[name]\n if (typeof value !== 'undefined') return this.merge(value)\n\n return null\n }\n\n public has(name: string): boolean {\n return typeof this.headers[name] !== 'undefined'\n }\n\n public set(name: string, value: string): void {\n this.headers[name] = value\n }\n\n public forEach(\n callbackfn: (value: string, name: string, parent: Headers) => void,\n thisArg?: any\n ): void {\n for (const [name, value] of this.entries()) {\n callbackfn.call(thisArg, value, name, this)\n }\n }\n\n public *entries(): HeadersIterator<[string, string]> {\n for (const key of Object.keys(this.headers)) {\n const name = key.toLowerCase()\n // We assert here that this is a string because we got it from the\n // Object.keys() call above.\n const value = this.get(name) as string\n\n yield [name, value] as [string, string]\n }\n }\n\n public *keys(): HeadersIterator<string> {\n for (const key of Object.keys(this.headers)) {\n const name = key.toLowerCase()\n yield name\n }\n }\n\n public *values(): HeadersIterator<string> {\n for (const key of Object.keys(this.headers)) {\n // We assert here that this is a string because we got it from the\n // Object.keys() call above.\n const value = this.get(key) as string\n\n yield value\n }\n }\n\n public [Symbol.iterator](): HeadersIterator<[string, string]> {\n return this.entries()\n }\n}\n"],"names":["HeadersAdapter","ReadonlyHeadersError","Error","constructor","callable","Headers","headers","Proxy","get","target","prop","receiver","ReflectAdapter","lowercased","toLowerCase","original","Object","keys","find","o","set","value","has","deleteProperty","seal","fresh","merge","Array","isArray","join","from","append","name","existing","push","delete","forEach","callbackfn","thisArg","entries","call","key","values","Symbol","iterator"],"mappings":";;;;;;;;;;;;;;;IA2BaA,cAAc;eAAdA;;IApBAC,oBAAoB;eAApBA;;;yBALkB;AAKxB,MAAMA,6BAA6BC;IACxCC,aAAc;QACZ,KAA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W,MAAM,IAAI;QAC5C;IACF;IAEA,CAAQO,UAA6C;QACnD,KAAK,MAAME,OAAOzB,OAAOC,IAAI,CAAC,IAAI,CAACX,OAAO,EAAG;YAC3C,MAAM0B,OAAOS,IAAI3B,WAAW;YAC5B,kEAAkE;YAClE,4BAA4B;YAC5B,MAAMO,QAAQ,IAAI,CAACb,GAAG,CAACwB;YAEvB,MAAM;gBAACA;gBAAMX;aAAM;QACrB;IACF;IAEA,CAAQJ,OAAgC;QACtC,KAAK,MAAMwB,OAAOzB,OAAOC,IAAI,CAAC,IAAI,CAACX,OAAO,EAAG;YAC3C,MAAM0B,OAAOS,IAAI3B,WAAW;YAC5B,MAAMkB;QACR;IACF;IAEA,CAAQU,SAAkC;QACxC,KAAK,MAAMD,OAAOzB,OAAOC,IAAI,CAAC,IAAI,CAACX,OAAO,EAAG;YAC3C,kEAAkE;YAClE,4BAA4B;YAC5B,MAAMe,QAAQ,IAAI,CAACb,GAAG,CAACiC;YAEvB,MAAMpB;QACR;IACF;IAEO,CAACsB,OAAOC,QAAQ,CAAC,GAAsC;QAC5D,OAAO,IAAI,CAACL,OAAO;IACrB;AACF","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../../src/server/web/spec-extension/adapters/headers.ts"],"sourcesContent":["import type { IncomingHttpHeaders } from 'http'\n\nimport { ReflectAdapter } from './reflect'\n\n/**\n * @internal\n */\nexport class ReadonlyHeadersError extends Error {\n constructor() {\n super(\n 'Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers'\n )\n }\n\n public static callable() {\n throw new ReadonlyHeadersError()\n }\n}\n\nexport type ReadonlyHeaders = Headers & {\n /** @deprecated Method unavailable on `ReadonlyHeaders`. Read more: https://nextjs.org/docs/app/api-reference/functions/headers */\n append(...args: any[]): void\n /** @deprecated Method unavailable on `ReadonlyHeaders`. Read more: https://nextjs.org/docs/app/api-reference/functions/headers */\n set(...args: any[]): void\n /** @deprecated Method unavailable on `ReadonlyHeaders`. Read more: https://nextjs.org/docs/app/api-reference/functions/headers */\n delete(...args: any[]): void\n}\n\n/**\n * The read methods that a sealed view provides itself instead of forwarding to\n * the underlying `Headers`. Deriving the type from `Headers` keeps the\n * implementations in step with the platform signatures.\n */\ntype SealedHeaderMethods = Pick<\n Headers,\n | 'get'\n | 'has'\n | 'getSetCookie'\n | 'keys'\n | 'values'\n | 'entries'\n | 'forEach'\n | typeof Symbol.iterator\n>\n\n/**\n * Builds the read methods for a sealed view that exposes all of `target`.\n */\nfunction createPassThroughMethods(\n target: Headers,\n sealed: ReadonlyHeaders\n): SealedHeaderMethods {\n return {\n get: target.get.bind(target),\n has: target.has.bind(target),\n getSetCookie: target.getSetCookie.bind(target),\n keys: target.keys.bind(target),\n values: target.values.bind(target),\n entries: target.entries.bind(target),\n [Symbol.iterator]: target[Symbol.iterator].bind(target),\n // The native method passes the unsealed target as the callback's `parent`\n // argument. That is a mutable handle on the underlying headers. Pass the\n // sealed view instead.\n forEach(callbackfn, thisArg) {\n for (const [name, value] of target.entries()) {\n callbackfn.call(thisArg, value, name, sealed)\n }\n },\n }\n}\n\n/**\n * Builds the read methods for a sealed view that omits the header names matched\n * by `isHidden`.\n */\nfunction createHidingMethods(\n target: Headers,\n sealed: ReadonlyHeaders,\n isHidden: (name: string) => boolean\n): SealedHeaderMethods {\n function* entries(): HeadersIterator<[string, string]> {\n for (const entry of target.entries()) {\n if (!isHidden(entry[0])) {\n yield entry\n }\n }\n }\n\n return {\n entries,\n [Symbol.iterator]: entries,\n get: (name) => (isHidden(name) ? null : target.get(name)),\n has: (name) => (isHidden(name) ? false : target.has(name)),\n getSetCookie: () => (isHidden('set-cookie') ? [] : target.getSetCookie()),\n *keys(): HeadersIterator<string> {\n for (const name of target.keys()) {\n if (!isHidden(name)) {\n yield name\n }\n }\n },\n *values(): HeadersIterator<string> {\n for (const [, value] of entries()) {\n yield value\n }\n },\n // The native method passes the unsealed target as the callback's `parent`\n // argument. That is a mutable handle on the underlying headers. Pass the\n // sealed view instead.\n forEach(callbackfn, thisArg) {\n for (const [name, value] of entries()) {\n callbackfn.call(thisArg, value, name, sealed)\n }\n },\n }\n}\n\nexport class HeadersAdapter extends Headers {\n private readonly headers: IncomingHttpHeaders\n\n constructor(headers: IncomingHttpHeaders) {\n // We've already overridden the methods that would be called, so we're just\n // calling the super constructor to ensure that the instanceof check works.\n super()\n\n this.headers = new Proxy(headers, {\n get(target, prop, receiver) {\n // Because this is just an object, we expect that all \"get\" operations\n // are for properties. If it's a \"get\" for a symbol, we'll just return\n // the symbol.\n if (typeof prop === 'symbol') {\n return ReflectAdapter.get(target, prop, receiver)\n }\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, return undefined.\n if (typeof original === 'undefined') return\n\n // If the original casing exists, return the value.\n return ReflectAdapter.get(target, original, receiver)\n },\n set(target, prop, value, receiver) {\n if (typeof prop === 'symbol') {\n return ReflectAdapter.set(target, prop, value, receiver)\n }\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, use the prop as the key.\n return ReflectAdapter.set(target, original ?? prop, value, receiver)\n },\n has(target, prop) {\n if (typeof prop === 'symbol') return ReflectAdapter.has(target, prop)\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, return false.\n if (typeof original === 'undefined') return false\n\n // If the original casing exists, return true.\n return ReflectAdapter.has(target, original)\n },\n deleteProperty(target, prop) {\n if (typeof prop === 'symbol')\n return ReflectAdapter.deleteProperty(target, prop)\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, return true.\n if (typeof original === 'undefined') return true\n\n // If the original casing exists, delete the property.\n return ReflectAdapter.deleteProperty(target, original)\n },\n })\n }\n\n /**\n * Seals a Headers instance to prevent modification by throwing an error when\n * any mutating method is called.\n *\n * The sealed view stays live. Later writes to `headers` remain visible\n * through it.\n *\n * `hidden` omits the given header names from every read operation (`get`,\n * `has`, `getSetCookie`, `forEach`, and iteration). The names must be\n * lowercase. The underlying headers are neither copied nor mutated, so hidden\n * headers remain available to the framework.\n */\n public static seal(\n headers: Headers,\n hidden?: ReadonlySet<string>\n ): ReadonlyHeaders {\n const isHidden =\n hidden && hidden.size > 0\n ? (name: string): boolean => hidden.has(name.toLowerCase())\n : null\n\n // The methods are built once per sealed view and reused, so repeated access\n // returns the same function instead of a fresh closure. They are assigned\n // after the proxy exists because `forEach` hands the proxy to its callback.\n // Creating the proxy runs no trap, so nothing can read them before then.\n let methods: SealedHeaderMethods\n\n const sealed: ReadonlyHeaders = new Proxy<ReadonlyHeaders>(headers, {\n get(target, prop, receiver) {\n switch (prop) {\n case 'append':\n case 'delete':\n case 'set':\n return ReadonlyHeadersError.callable\n case Symbol.iterator:\n return methods[Symbol.iterator]\n case 'get':\n case 'has':\n case 'getSetCookie':\n case 'keys':\n case 'values':\n case 'entries':\n case 'forEach':\n return methods[prop]\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n })\n\n methods = isHidden\n ? createHidingMethods(headers, sealed, isHidden)\n : createPassThroughMethods(headers, sealed)\n\n return sealed\n }\n\n /**\n * @param headers\n * @returns A fresh object identity backed by the original value\n */\n public static fresh(headers: ReadonlyHeaders): ReadonlyHeaders {\n return new Proxy<ReadonlyHeaders>(headers, {\n get(target, prop, receiver) {\n return ReflectAdapter.get(target, prop, receiver)\n },\n })\n }\n\n /**\n * Merges a header value into a string. This stores multiple values as an\n * array, so we need to merge them into a string.\n *\n * @param value a header value\n * @returns a merged header value (a string)\n */\n private merge(value: string | string[]): string {\n if (Array.isArray(value)) return value.join(', ')\n\n return value\n }\n\n /**\n * Creates a Headers instance from a plain object or a Headers instance.\n *\n * @param headers a plain object or a Headers instance\n * @returns a headers instance\n */\n public static from(headers: IncomingHttpHeaders | Headers): Headers {\n if (headers instanceof Headers) return headers\n\n return new HeadersAdapter(headers)\n }\n\n public append(name: string, value: string): void {\n const existing = this.headers[name]\n if (typeof existing === 'string') {\n this.headers[name] = [existing, value]\n } else if (Array.isArray(existing)) {\n existing.push(value)\n } else {\n this.headers[name] = value\n }\n }\n\n public delete(name: string): void {\n delete this.headers[name]\n }\n\n public get(name: string): string | null {\n const value = this.headers[name]\n if (typeof value !== 'undefined') return this.merge(value)\n\n return null\n }\n\n public has(name: string): boolean {\n return typeof this.headers[name] !== 'undefined'\n }\n\n public set(name: string, value: string): void {\n this.headers[name] = value\n }\n\n public forEach(\n callbackfn: (value: string, name: string, parent: Headers) => void,\n thisArg?: any\n ): void {\n for (const [name, value] of this.entries()) {\n callbackfn.call(thisArg, value, name, this)\n }\n }\n\n public *entries(): HeadersIterator<[string, string]> {\n for (const key of Object.keys(this.headers)) {\n const name = key.toLowerCase()\n // We assert here that this is a string because we got it from the\n // Object.keys() call above.\n const value = this.get(name) as string\n\n yield [name, value] as [string, string]\n }\n }\n\n public *keys(): HeadersIterator<string> {\n for (const key of Object.keys(this.headers)) {\n const name = key.toLowerCase()\n yield name\n }\n }\n\n public *values(): HeadersIterator<string> {\n for (const key of Object.keys(this.headers)) {\n // We assert here that this is a string because we got it from the\n // Object.keys() call above.\n const value = this.get(key) as string\n\n yield value\n }\n }\n\n public [Symbol.iterator](): HeadersIterator<[string, string]> {\n return this.entries()\n }\n}\n"],"names":["HeadersAdapter","ReadonlyHeadersError","Error","constructor","callable","createPassThroughMethods","target","sealed","get","bind","has","getSetCookie","keys","values","entries","Symbol","iterator","forEach","callbackfn","thisArg","name","value","call","createHidingMethods","isHidden","entry","Headers","headers","Proxy","prop","receiver","ReflectAdapter","lowercased","toLowerCase","original","Object","find","o","set","deleteProperty","seal","hidden","size","methods","fresh","merge","Array","isArray","join","from","append","existing","push","delete","key"],"mappings":";;;;;;;;;;;;;;;IAqHaA,cAAc;eAAdA;;IA9GAC,oBAAoB;eAApBA;;;yBALkB;AAKxB,MAAMA,6BAA6BC;IACxCC,aAAc;QACZ,KAAK,CACH;QADF,qBAEC,CAFD,IAEC,EAFD,qBAAA;mBAAA;wBAAA;0BAAA;QAEA;IACF;IAEA,OAAcC,WAAW;QACvB,MAAM,IAAIH;IACZ;AACF;AA4BA;;CAEC,GACD,SAASI,yBACPC,MAAe,EACfC,MAAuB;IAEvB,OAAO;QACLC,KAAKF,OAAOE,GAAG,CAACC,IAAI,CAACH;QACrBI,KAAKJ,OAAOI,GAAG,CAACD,IAAI,CAACH;QACrBK,cAAcL,OAAOK,YAAY,CAACF,IAAI,CAACH;QACvCM,MAAMN,OAAOM,IAAI,CAACH,IAAI,CAACH;QACvBO,QAAQP,OAAOO,MAAM,CAACJ,IAAI,CAACH;QAC3BQ,SAASR,OAAOQ,OAAO,CAACL,IAAI,CAACH;QAC7B,CAACS,OAAOC,QAAQ,CAAC,EAAEV,MAAM,CAACS,OAAOC,QAAQ,CAAC,CAACP,IAAI,CAACH;QAChD,0EAA0E;QAC1E,yEAAyE;QACzE,uBAAuB;QACvBW,SAAQC,UAAU,EAAEC,OAAO;YACzB,KAAK,MAAM,CAACC,MAAMC,MAAM,IAAIf,OAAOQ,OAAO,GAAI;gBAC5CI,WAAWI,IAAI,CAACH,SAASE,OAAOD,MAAMb;YACxC;QACF;IACF;AACF;AAEA;;;CAGC,GACD,SAASgB,oBACPjB,MAAe,EACfC,MAAuB,EACvBiB,QAAmC;IAEnC,UAAU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EA,CAAQN,UAA6C;QACnD,KAAK,MAAMwC,OAAOnB,OAAOvB,IAAI,CAAC,IAAI,CAACe,OAAO,EAAG;YAC3C,MAAMP,OAAOkC,IAAIrB,WAAW;YAC5B,kEAAkE;YAClE,4BAA4B;YAC5B,MAAMZ,QAAQ,IAAI,CAACb,GAAG,CAACY;YAEvB,MAAM;gBAACA;gBAAMC;aAAM;QACrB;IACF;IAEA,CAAQT,OAAgC;QACtC,KAAK,MAAM0C,OAAOnB,OAAOvB,IAAI,CAAC,IAAI,CAACe,OAAO,EAAG;YAC3C,MAAMP,OAAOkC,IAAIrB,WAAW;YAC5B,MAAMb;QACR;IACF;IAEA,CAAQP,SAAkC;QACxC,KAAK,MAAMyC,OAAOnB,OAAOvB,IAAI,CAAC,IAAI,CAACe,OAAO,EAAG;YAC3C,kEAAkE;YAClE,4BAA4B;YAC5B,MAAMN,QAAQ,IAAI,CAACb,GAAG,CAAC8C;YAEvB,MAAMjC;QACR;IACF;IAEO,CAACN,OAAOC,QAAQ,CAAC,GAAsC;QAC5D,OAAO,IAAI,CAACF,OAAO;IACrB;AACF","ignoreList":[0]} |
@@ -24,3 +24,3 @@ "use strict"; | ||
| function isStableBuild() { | ||
| return !"16.3.1-canary.13"?.includes('canary') && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV; | ||
| return !"16.3.1-canary.14"?.includes('canary') && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV; | ||
| } | ||
@@ -27,0 +27,0 @@ class CanaryOnlyConfigError extends Error { |
@@ -85,3 +85,3 @@ "use strict"; | ||
| ciName: _ciinfo.isCI && _ciinfo.name || null, | ||
| nextVersion: "16.3.1-canary.13", | ||
| nextVersion: "16.3.1-canary.14", | ||
| agentName: await (0, _agentname.getAgentName)() | ||
@@ -88,0 +88,0 @@ }; |
@@ -14,7 +14,7 @@ "use strict"; | ||
| // This should be an invariant, if it fails our build tooling is broken. | ||
| if (typeof "16.3.1-canary.13" !== 'string') { | ||
| if (typeof "16.3.1-canary.14" !== 'string') { | ||
| return []; | ||
| } | ||
| const payload = { | ||
| nextVersion: "16.3.1-canary.13", | ||
| nextVersion: "16.3.1-canary.14", | ||
| nodeVersion: process.version, | ||
@@ -21,0 +21,0 @@ cliCommand: event.cliCommand, |
@@ -41,3 +41,3 @@ "use strict"; | ||
| payload: { | ||
| nextVersion: "16.3.1-canary.13", | ||
| nextVersion: "16.3.1-canary.14", | ||
| 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.1-canary.13" !== 'string') { | ||
| if (typeof "16.3.1-canary.14" !== 'string') { | ||
| return []; | ||
@@ -21,3 +21,3 @@ } | ||
| const payload = { | ||
| nextVersion: "16.3.1-canary.13", | ||
| nextVersion: "16.3.1-canary.14", | ||
| nodeVersion: process.version, | ||
@@ -24,0 +24,0 @@ cliCommand: event.cliCommand, |
+10
-10
| { | ||
| "name": "next", | ||
| "version": "16.3.1-canary.13", | ||
| "version": "16.3.1-canary.14", | ||
| "description": "The React Framework", | ||
@@ -84,3 +84,3 @@ "main": "./dist/server/next.js", | ||
| "dependencies": { | ||
| "@next/env": "16.3.1-canary.13", | ||
| "@next/env": "16.3.1-canary.14", | ||
| "@swc/helpers": "0.5.23", | ||
@@ -116,10 +116,10 @@ "baseline-browser-mapping": "^2.9.19", | ||
| "sharp": "^0.35.3", | ||
| "@next/swc-darwin-arm64": "16.3.1-canary.13", | ||
| "@next/swc-darwin-x64": "16.3.1-canary.13", | ||
| "@next/swc-linux-arm64-gnu": "16.3.1-canary.13", | ||
| "@next/swc-linux-arm64-musl": "16.3.1-canary.13", | ||
| "@next/swc-linux-x64-gnu": "16.3.1-canary.13", | ||
| "@next/swc-linux-x64-musl": "16.3.1-canary.13", | ||
| "@next/swc-win32-arm64-msvc": "16.3.1-canary.13", | ||
| "@next/swc-win32-x64-msvc": "16.3.1-canary.13" | ||
| "@next/swc-darwin-arm64": "16.3.1-canary.14", | ||
| "@next/swc-darwin-x64": "16.3.1-canary.14", | ||
| "@next/swc-linux-arm64-gnu": "16.3.1-canary.14", | ||
| "@next/swc-linux-arm64-musl": "16.3.1-canary.14", | ||
| "@next/swc-linux-x64-gnu": "16.3.1-canary.14", | ||
| "@next/swc-linux-x64-musl": "16.3.1-canary.14", | ||
| "@next/swc-win32-arm64-msvc": "16.3.1-canary.14", | ||
| "@next/swc-win32-x64-msvc": "16.3.1-canary.14" | ||
| }, | ||
@@ -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 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.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 15 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 14 instances
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
184813534
0.14%1313873
0.03%4515
0.07%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated