| 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() |
| import type { FlightRouterState } from '../../shared/lib/app-router-types'; | ||
| import type { ClientInstrumentationModules, RouterTransitionPrefetchIntent, RouterTransitionType } from '../router-transition-types'; | ||
| export declare function initializeRouterTransitionModules(modules: ClientInstrumentationModules): void; | ||
| export declare function startRouterTransition(url: string, type: RouterTransitionType, fromTree: FlightRouterState, prefetchIntent: RouterTransitionPrefetchIntent | null): void; |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| 0 && (module.exports = { | ||
| initializeRouterTransitionModules: null, | ||
| startRouterTransition: null | ||
| }); | ||
| function _export(target, all) { | ||
| for(var name in all)Object.defineProperty(target, name, { | ||
| enumerable: true, | ||
| get: all[name] | ||
| }); | ||
| } | ||
| _export(exports, { | ||
| initializeRouterTransitionModules: function() { | ||
| return initializeRouterTransitionModules; | ||
| }, | ||
| startRouterTransition: function() { | ||
| return startRouterTransition; | ||
| } | ||
| }); | ||
| const _segment = require("../../shared/lib/segment"); | ||
| const _computechangedpath = require("./router-reducer/compute-changed-path"); | ||
| let instrumentationModules = []; | ||
| let nextTransitionId = 0; | ||
| function initializeRouterTransitionModules(modules) { | ||
| instrumentationModules = modules.filter((module1)=>module1 != null); | ||
| } | ||
| function callHooks(invoke) { | ||
| for (const hooks of instrumentationModules){ | ||
| try { | ||
| invoke(hooks); | ||
| } catch (error) { | ||
| console.error('An instrumentation-client router transition hook failed', error); | ||
| } | ||
| } | ||
| } | ||
| function timestamp() { | ||
| return performance.timeOrigin + performance.now(); | ||
| } | ||
| function startRouterTransition(url, type, fromTree, prefetchIntent) { | ||
| // Positive flag check so the instrumentation-only path is removed by DCE when disabled. | ||
| if (process.env.__NEXT_INSTRUMENTATION_CLIENT_ROUTER_TRANSITION_EVENTS) { | ||
| if (!instrumentationModules.some((hooks)=>typeof hooks.onRouterTransitionStart === 'function')) { | ||
| return; | ||
| } | ||
| const id = `${Date.now().toString(36)}-${(++nextTransitionId).toString(36)}`; | ||
| callHooks((hooks)=>hooks.onRouterTransitionStart?.(url, type, { | ||
| id, | ||
| timestamp: timestamp(), | ||
| fromRoutes: getActiveRoutePaths(fromTree), | ||
| prefetchIntent | ||
| })); | ||
| } else { | ||
| callHooks((hooks)=>hooks.onRouterTransitionStart?.(url, type, null)); | ||
| } | ||
| } | ||
| function classifySegment(segment) { | ||
| const sourceSegment = (0, _computechangedpath.segmentToSourcePagePathname)(segment); | ||
| if (sourceSegment === 'page') { | ||
| return { | ||
| path: null, | ||
| isPage: true | ||
| }; | ||
| } | ||
| if (sourceSegment === '' || sourceSegment === '(__SLOT__)' || (0, _segment.isGroupSegment)(sourceSegment)) { | ||
| return { | ||
| path: null, | ||
| isPage: false | ||
| }; | ||
| } | ||
| if (sourceSegment === _segment.DEFAULT_SEGMENT_KEY) { | ||
| return { | ||
| path: 'default', | ||
| isPage: false | ||
| }; | ||
| } | ||
| if (sourceSegment === _segment.NOT_FOUND_SEGMENT_KEY) { | ||
| return { | ||
| path: '_not-found', | ||
| isPage: false | ||
| }; | ||
| } | ||
| return { | ||
| path: sourceSegment, | ||
| isPage: false | ||
| }; | ||
| } | ||
| function getActiveRoutePaths(tree) { | ||
| const routes = []; | ||
| function visit(node, segments, primary) { | ||
| const segment = classifySegment(node[0]); | ||
| const nextSegments = segment.path === null ? segments : [ | ||
| ...segments, | ||
| segment.path | ||
| ]; | ||
| const parallelRoutes = node[1]; | ||
| const keys = Object.keys(parallelRoutes); | ||
| if (keys.length === 0 || segment.isPage) { | ||
| routes.push({ | ||
| path: `/${nextSegments.join('/')}`, | ||
| primary | ||
| }); | ||
| return; | ||
| } | ||
| if (parallelRoutes.children !== undefined) { | ||
| visit(parallelRoutes.children, nextSegments, primary); | ||
| } | ||
| for (const key of keys.sort()){ | ||
| if (key === 'children') { | ||
| continue; | ||
| } | ||
| visit(parallelRoutes[key], [ | ||
| ...nextSegments, | ||
| `@${key}` | ||
| ], false); | ||
| } | ||
| } | ||
| visit(tree, [], true); | ||
| return routes.sort((a, b)=>{ | ||
| if (a.primary !== b.primary) { | ||
| return a.primary ? -1 : 1; | ||
| } | ||
| return a.path.localeCompare(b.path); | ||
| }).map((route)=>route.path); | ||
| } | ||
| if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') { | ||
| Object.defineProperty(exports.default, '__esModule', { value: true }); | ||
| Object.assign(exports.default, exports); | ||
| module.exports = exports.default; | ||
| } | ||
| //# sourceMappingURL=router-transition.js.map |
| {"version":3,"sources":["../../../src/client/components/router-transition.ts"],"sourcesContent":["import type {\n FlightRouterState,\n Segment,\n} from '../../shared/lib/app-router-types'\nimport {\n DEFAULT_SEGMENT_KEY,\n isGroupSegment,\n NOT_FOUND_SEGMENT_KEY,\n} from '../../shared/lib/segment'\nimport { segmentToSourcePagePathname } from './router-reducer/compute-changed-path'\nimport type {\n ClientInstrumentationHooks,\n ClientInstrumentationModules,\n RouterTransitionPrefetchIntent,\n RouterTransitionType,\n} from '../router-transition-types'\n\nlet instrumentationModules: readonly ClientInstrumentationHooks[] = []\nlet nextTransitionId = 0\n\nexport function initializeRouterTransitionModules(\n modules: ClientInstrumentationModules\n): void {\n instrumentationModules = modules.filter(\n (module): module is ClientInstrumentationHooks => module != null\n )\n}\n\nfunction callHooks(invoke: (hooks: ClientInstrumentationHooks) => void): void {\n for (const hooks of instrumentationModules) {\n try {\n invoke(hooks)\n } catch (error) {\n console.error(\n 'An instrumentation-client router transition hook failed',\n error\n )\n }\n }\n}\n\nfunction timestamp(): number {\n return performance.timeOrigin + performance.now()\n}\n\nexport function startRouterTransition(\n url: string,\n type: RouterTransitionType,\n fromTree: FlightRouterState,\n prefetchIntent: RouterTransitionPrefetchIntent | null\n): void {\n // Positive flag check so the instrumentation-only path is removed by DCE when disabled.\n if (process.env.__NEXT_INSTRUMENTATION_CLIENT_ROUTER_TRANSITION_EVENTS) {\n if (\n !instrumentationModules.some(\n (hooks) => typeof hooks.onRouterTransitionStart === 'function'\n )\n ) {\n return\n }\n\n const id = `${Date.now().toString(36)}-${(++nextTransitionId).toString(36)}`\n\n callHooks((hooks) =>\n hooks.onRouterTransitionStart?.(url, type, {\n id,\n timestamp: timestamp(),\n fromRoutes: getActiveRoutePaths(fromTree),\n prefetchIntent,\n })\n )\n } else {\n callHooks((hooks) => hooks.onRouterTransitionStart?.(url, type, null))\n }\n}\n\nfunction classifySegment(segment: Segment): {\n path: string | null\n isPage: boolean\n} {\n const sourceSegment = segmentToSourcePagePathname(segment)\n if (sourceSegment === 'page') {\n return { path: null, isPage: true }\n }\n if (\n sourceSegment === '' ||\n sourceSegment === '(__SLOT__)' ||\n isGroupSegment(sourceSegment)\n ) {\n return { path: null, isPage: false }\n }\n if (sourceSegment === DEFAULT_SEGMENT_KEY) {\n return { path: 'default', isPage: false }\n }\n if (sourceSegment === NOT_FOUND_SEGMENT_KEY) {\n return { path: '_not-found', isPage: false }\n }\n return { path: sourceSegment, isPage: false }\n}\n\nfunction getActiveRoutePaths(tree: FlightRouterState): string[] {\n const routes: Array<{ path: string; primary: boolean }> = []\n\n function visit(\n node: FlightRouterState,\n segments: string[],\n primary: boolean\n ): void {\n const segment = classifySegment(node[0])\n const nextSegments =\n segment.path === null ? segments : [...segments, segment.path]\n const parallelRoutes = node[1]\n const keys = Object.keys(parallelRoutes)\n\n if (keys.length === 0 || segment.isPage) {\n routes.push({\n path: `/${nextSegments.join('/')}`,\n primary,\n })\n return\n }\n\n if (parallelRoutes.children !== undefined) {\n visit(parallelRoutes.children, nextSegments, primary)\n }\n\n for (const key of keys.sort()) {\n if (key === 'children') {\n continue\n }\n visit(parallelRoutes[key], [...nextSegments, `@${key}`], false)\n }\n }\n\n visit(tree, [], true)\n return routes\n .sort((a, b) => {\n if (a.primary !== b.primary) {\n return a.primary ? -1 : 1\n }\n return a.path.localeCompare(b.path)\n })\n .map((route) => route.path)\n}\n"],"names":["initializeRouterTransitionModules","startRouterTransition","instrumentationModules","nextTransitionId","modules","filter","module","callHooks","invoke","hooks","error","console","timestamp","performance","timeOrigin","now","url","type","fromTree","prefetchIntent","process","env","__NEXT_INSTRUMENTATION_CLIENT_ROUTER_TRANSITION_EVENTS","some","onRouterTransitionStart","id","Date","toString","fromRoutes","getActiveRoutePaths","classifySegment","segment","sourceSegment","segmentToSourcePagePathname","path","isPage","isGroupSegment","DEFAULT_SEGMENT_KEY","NOT_FOUND_SEGMENT_KEY","tree","routes","visit","node","segments","primary","nextSegments","parallelRoutes","keys","Object","length","push","join","children","undefined","key","sort","a","b","localeCompare","map","route"],"mappings":";;;;;;;;;;;;;;;IAoBgBA,iCAAiC;eAAjCA;;IAyBAC,qBAAqB;eAArBA;;;yBArCT;oCACqC;AAQ5C,IAAIC,yBAAgE,EAAE;AACtE,IAAIC,mBAAmB;AAEhB,SAASH,kCACdI,OAAqC;IAErCF,yBAAyBE,QAAQC,MAAM,CACrC,CAACC,UAAiDA,WAAU;AAEhE;AAEA,SAASC,UAAUC,MAAmD;IACpE,KAAK,MAAMC,SAASP,uBAAwB;QAC1C,IAAI;YACFM,OAAOC;QACT,EAAE,OAAOC,OAAO;YACdC,QAAQD,KAAK,CACX,2DACAA;QAEJ;IACF;AACF;AAEA,SAASE;IACP,OAAOC,YAAYC,UAAU,GAAGD,YAAYE,GAAG;AACjD;AAEO,SAASd,sBACde,GAAW,EACXC,IAA0B,EAC1BC,QAA2B,EAC3BC,cAAqD;IAErD,wFAAwF;IACxF,IAAIC,QAAQC,GAAG,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MY,iBAAiBJ,IAAI,CAAC,EAAE;QAC9B,MAAMK,OAAOC,OAAOD,IAAI,CAACD;QAEzB,IAAIC,KAAKE,MAAM,KAAK,KAAKlB,QAAQI,MAAM,EAAE;YACvCK,OAAOU,IAAI,CAAC;gBACVhB,MAAM,CAAC,CAAC,EAAEW,aAAaM,IAAI,CAAC,MAAM;gBAClCP;YACF;YACA;QACF;QAEA,IAAIE,eAAeM,QAAQ,KAAKC,WAAW;YACzCZ,MAAMK,eAAeM,QAAQ,EAAEP,cAAcD;QAC/C;QAEA,KAAK,MAAMU,OAAOP,KAAKQ,IAAI,GAAI;YAC7B,IAAID,QAAQ,YAAY;gBACtB;YACF;YACAb,MAAMK,cAAc,CAACQ,IAAI,EAAE;mBAAIT;gBAAc,CAAC,CAAC,EAAES,KAAK;aAAC,EAAE;QAC3D;IACF;IAEAb,MAAMF,MAAM,EAAE,EAAE;IAChB,OAAOC,OACJe,IAAI,CAAC,CAACC,GAAGC;QACR,IAAID,EAAEZ,OAAO,KAAKa,EAAEb,OAAO,EAAE;YAC3B,OAAOY,EAAEZ,OAAO,GAAG,CAAC,IAAI;QAC1B;QACA,OAAOY,EAAEtB,IAAI,CAACwB,aAAa,CAACD,EAAEvB,IAAI;IACpC,GACCyB,GAAG,CAAC,CAACC,QAAUA,MAAM1B,IAAI;AAC9B","ignoreList":[0]} |
| export type RouterTransitionType = 'push' | 'replace' | 'traverse'; | ||
| export type RouterTransitionPrefetchIntent = 'full' | 'auto' | 'none'; | ||
| export type RouterTransitionEvent = { | ||
| id: string; | ||
| timestamp: number; | ||
| }; | ||
| export type RouterTransitionStartEvent = RouterTransitionEvent & { | ||
| fromRoutes: string[]; | ||
| prefetchIntent: RouterTransitionPrefetchIntent | null; | ||
| }; | ||
| export type ClientInstrumentationHooks = { | ||
| onRouterTransitionStart?: (url: string, navigationType: RouterTransitionType, event: RouterTransitionStartEvent | null) => void; | ||
| }; | ||
| export type ClientInstrumentationModule = ClientInstrumentationHooks | null | undefined; | ||
| export type ClientInstrumentationModules = readonly ClientInstrumentationModule[]; |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') { | ||
| Object.defineProperty(exports.default, '__esModule', { value: true }); | ||
| Object.assign(exports.default, exports); | ||
| module.exports = exports.default; | ||
| } | ||
| //# sourceMappingURL=router-transition-types.js.map |
| {"version":3,"sources":[],"names":[],"mappings":"","ignoreList":[]} |
| import { DEFAULT_SEGMENT_KEY, isGroupSegment, NOT_FOUND_SEGMENT_KEY } from '../../shared/lib/segment'; | ||
| import { segmentToSourcePagePathname } from './router-reducer/compute-changed-path'; | ||
| let instrumentationModules = []; | ||
| let nextTransitionId = 0; | ||
| export function initializeRouterTransitionModules(modules) { | ||
| instrumentationModules = modules.filter((module)=>module != null); | ||
| } | ||
| function callHooks(invoke) { | ||
| for (const hooks of instrumentationModules){ | ||
| try { | ||
| invoke(hooks); | ||
| } catch (error) { | ||
| console.error('An instrumentation-client router transition hook failed', error); | ||
| } | ||
| } | ||
| } | ||
| function timestamp() { | ||
| return performance.timeOrigin + performance.now(); | ||
| } | ||
| export function startRouterTransition(url, type, fromTree, prefetchIntent) { | ||
| // Positive flag check so the instrumentation-only path is removed by DCE when disabled. | ||
| if (process.env.__NEXT_INSTRUMENTATION_CLIENT_ROUTER_TRANSITION_EVENTS) { | ||
| if (!instrumentationModules.some((hooks)=>typeof hooks.onRouterTransitionStart === 'function')) { | ||
| return; | ||
| } | ||
| const id = `${Date.now().toString(36)}-${(++nextTransitionId).toString(36)}`; | ||
| callHooks((hooks)=>hooks.onRouterTransitionStart?.(url, type, { | ||
| id, | ||
| timestamp: timestamp(), | ||
| fromRoutes: getActiveRoutePaths(fromTree), | ||
| prefetchIntent | ||
| })); | ||
| } else { | ||
| callHooks((hooks)=>hooks.onRouterTransitionStart?.(url, type, null)); | ||
| } | ||
| } | ||
| function classifySegment(segment) { | ||
| const sourceSegment = segmentToSourcePagePathname(segment); | ||
| if (sourceSegment === 'page') { | ||
| return { | ||
| path: null, | ||
| isPage: true | ||
| }; | ||
| } | ||
| if (sourceSegment === '' || sourceSegment === '(__SLOT__)' || isGroupSegment(sourceSegment)) { | ||
| return { | ||
| path: null, | ||
| isPage: false | ||
| }; | ||
| } | ||
| if (sourceSegment === DEFAULT_SEGMENT_KEY) { | ||
| return { | ||
| path: 'default', | ||
| isPage: false | ||
| }; | ||
| } | ||
| if (sourceSegment === NOT_FOUND_SEGMENT_KEY) { | ||
| return { | ||
| path: '_not-found', | ||
| isPage: false | ||
| }; | ||
| } | ||
| return { | ||
| path: sourceSegment, | ||
| isPage: false | ||
| }; | ||
| } | ||
| function getActiveRoutePaths(tree) { | ||
| const routes = []; | ||
| function visit(node, segments, primary) { | ||
| const segment = classifySegment(node[0]); | ||
| const nextSegments = segment.path === null ? segments : [ | ||
| ...segments, | ||
| segment.path | ||
| ]; | ||
| const parallelRoutes = node[1]; | ||
| const keys = Object.keys(parallelRoutes); | ||
| if (keys.length === 0 || segment.isPage) { | ||
| routes.push({ | ||
| path: `/${nextSegments.join('/')}`, | ||
| primary | ||
| }); | ||
| return; | ||
| } | ||
| if (parallelRoutes.children !== undefined) { | ||
| visit(parallelRoutes.children, nextSegments, primary); | ||
| } | ||
| for (const key of keys.sort()){ | ||
| if (key === 'children') { | ||
| continue; | ||
| } | ||
| visit(parallelRoutes[key], [ | ||
| ...nextSegments, | ||
| `@${key}` | ||
| ], false); | ||
| } | ||
| } | ||
| visit(tree, [], true); | ||
| return routes.sort((a, b)=>{ | ||
| if (a.primary !== b.primary) { | ||
| return a.primary ? -1 : 1; | ||
| } | ||
| return a.path.localeCompare(b.path); | ||
| }).map((route)=>route.path); | ||
| } | ||
| //# sourceMappingURL=router-transition.js.map |
| {"version":3,"sources":["../../../../src/client/components/router-transition.ts"],"sourcesContent":["import type {\n FlightRouterState,\n Segment,\n} from '../../shared/lib/app-router-types'\nimport {\n DEFAULT_SEGMENT_KEY,\n isGroupSegment,\n NOT_FOUND_SEGMENT_KEY,\n} from '../../shared/lib/segment'\nimport { segmentToSourcePagePathname } from './router-reducer/compute-changed-path'\nimport type {\n ClientInstrumentationHooks,\n ClientInstrumentationModules,\n RouterTransitionPrefetchIntent,\n RouterTransitionType,\n} from '../router-transition-types'\n\nlet instrumentationModules: readonly ClientInstrumentationHooks[] = []\nlet nextTransitionId = 0\n\nexport function initializeRouterTransitionModules(\n modules: ClientInstrumentationModules\n): void {\n instrumentationModules = modules.filter(\n (module): module is ClientInstrumentationHooks => module != null\n )\n}\n\nfunction callHooks(invoke: (hooks: ClientInstrumentationHooks) => void): void {\n for (const hooks of instrumentationModules) {\n try {\n invoke(hooks)\n } catch (error) {\n console.error(\n 'An instrumentation-client router transition hook failed',\n error\n )\n }\n }\n}\n\nfunction timestamp(): number {\n return performance.timeOrigin + performance.now()\n}\n\nexport function startRouterTransition(\n url: string,\n type: RouterTransitionType,\n fromTree: FlightRouterState,\n prefetchIntent: RouterTransitionPrefetchIntent | null\n): void {\n // Positive flag check so the instrumentation-only path is removed by DCE when disabled.\n if (process.env.__NEXT_INSTRUMENTATION_CLIENT_ROUTER_TRANSITION_EVENTS) {\n if (\n !instrumentationModules.some(\n (hooks) => typeof hooks.onRouterTransitionStart === 'function'\n )\n ) {\n return\n }\n\n const id = `${Date.now().toString(36)}-${(++nextTransitionId).toString(36)}`\n\n callHooks((hooks) =>\n hooks.onRouterTransitionStart?.(url, type, {\n id,\n timestamp: timestamp(),\n fromRoutes: getActiveRoutePaths(fromTree),\n prefetchIntent,\n })\n )\n } else {\n callHooks((hooks) => hooks.onRouterTransitionStart?.(url, type, null))\n }\n}\n\nfunction classifySegment(segment: Segment): {\n path: string | null\n isPage: boolean\n} {\n const sourceSegment = segmentToSourcePagePathname(segment)\n if (sourceSegment === 'page') {\n return { path: null, isPage: true }\n }\n if (\n sourceSegment === '' ||\n sourceSegment === '(__SLOT__)' ||\n isGroupSegment(sourceSegment)\n ) {\n return { path: null, isPage: false }\n }\n if (sourceSegment === DEFAULT_SEGMENT_KEY) {\n return { path: 'default', isPage: false }\n }\n if (sourceSegment === NOT_FOUND_SEGMENT_KEY) {\n return { path: '_not-found', isPage: false }\n }\n return { path: sourceSegment, isPage: false }\n}\n\nfunction getActiveRoutePaths(tree: FlightRouterState): string[] {\n const routes: Array<{ path: string; primary: boolean }> = []\n\n function visit(\n node: FlightRouterState,\n segments: string[],\n primary: boolean\n ): void {\n const segment = classifySegment(node[0])\n const nextSegments =\n segment.path === null ? segments : [...segments, segment.path]\n const parallelRoutes = node[1]\n const keys = Object.keys(parallelRoutes)\n\n if (keys.length === 0 || segment.isPage) {\n routes.push({\n path: `/${nextSegments.join('/')}`,\n primary,\n })\n return\n }\n\n if (parallelRoutes.children !== undefined) {\n visit(parallelRoutes.children, nextSegments, primary)\n }\n\n for (const key of keys.sort()) {\n if (key === 'children') {\n continue\n }\n visit(parallelRoutes[key], [...nextSegments, `@${key}`], false)\n }\n }\n\n visit(tree, [], true)\n return routes\n .sort((a, b) => {\n if (a.primary !== b.primary) {\n return a.primary ? -1 : 1\n }\n return a.path.localeCompare(b.path)\n })\n .map((route) => route.path)\n}\n"],"names":["DEFAULT_SEGMENT_KEY","isGroupSegment","NOT_FOUND_SEGMENT_KEY","segmentToSourcePagePathname","instrumentationModules","nextTransitionId","initializeRouterTransitionModules","modules","filter","module","callHooks","invoke","hooks","error","console","timestamp","performance","timeOrigin","now","startRouterTransition","url","type","fromTree","prefetchIntent","process","env","__NEXT_INSTRUMENTATION_CLIENT_ROUTER_TRANSITION_EVENTS","some","onRouterTransitionStart","id","Date","toString","fromRoutes","getActiveRoutePaths","classifySegment","segment","sourceSegment","path","isPage","tree","routes","visit","node","segments","primary","nextSegments","parallelRoutes","keys","Object","length","push","join","children","undefined","key","sort","a","b","localeCompare","map","route"],"mappings":"AAIA,SACEA,mBAAmB,EACnBC,cAAc,EACdC,qBAAqB,QAChB,2BAA0B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ACqB,aAAa,CAACD,EAAEpB,IAAI;IACpC,GACCsB,GAAG,CAAC,CAACC,QAAUA,MAAMvB,IAAI;AAC9B","ignoreList":[0]} |
| export { }; | ||
| //# sourceMappingURL=router-transition-types.js.map |
| {"version":3,"sources":["../../../src/client/router-transition-types.ts"],"sourcesContent":["export type RouterTransitionType = 'push' | 'replace' | 'traverse'\n\nexport type RouterTransitionPrefetchIntent = 'full' | 'auto' | 'none'\n\nexport type RouterTransitionEvent = {\n id: string\n timestamp: number\n}\n\nexport type RouterTransitionStartEvent = RouterTransitionEvent & {\n fromRoutes: string[]\n // `null` for non-prefetch transitions.\n prefetchIntent: RouterTransitionPrefetchIntent | null\n}\n\nexport type ClientInstrumentationHooks = {\n onRouterTransitionStart?: (\n url: string,\n navigationType: RouterTransitionType,\n event: RouterTransitionStartEvent | null\n ) => void\n}\n\nexport type ClientInstrumentationModule =\n | ClientInstrumentationHooks\n | null\n | undefined\n\nexport type ClientInstrumentationModules =\n readonly ClientInstrumentationModule[]\n"],"names":[],"mappings":"AA4BA,WACwC","ignoreList":[0]} |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/bin/next.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport '../server/require-hook'\n\nimport os from 'os'\nimport {\n Argument,\n Command,\n InvalidArgumentError,\n Option,\n} from 'next/dist/compiled/commander'\n\nimport { warn } from '../build/output/log'\nimport semver from 'next/dist/compiled/semver'\nimport { bold, cyan, italic } from '../lib/picocolors'\nimport { formatCliHelpOutput } from '../lib/format-cli-help-output'\nimport { NON_STANDARD_NODE_ENV } from '../lib/constants'\nimport {\n getParsedDebugAddress,\n parseValidPositiveInteger,\n type DebugAddress,\n} from '../server/lib/utils'\nimport {\n SUPPORTED_TEST_RUNNERS_LIST,\n type NextTestOptions,\n} from '../cli/next-test.js'\nimport type { NextTelemetryOptions } from '../cli/next-telemetry.js'\nimport type { NextStartOptions } from '../cli/next-start.js'\nimport type { NextInfoOptions } from '../cli/next-info.js'\nimport type { NextDevOptions } from '../cli/next-dev.js'\nimport type { NextAnalyzeOptions } from '../cli/next-analyze.js'\nimport type { NextBuildOptions } from '../cli/next-build.js'\nimport type { NextTypegenOptions } from '../cli/next-typegen.js'\nimport type { NextPostBuildOptions } from '../cli/next-post-build.js'\nimport { mkdirSync } from 'fs'\n\nif (process.env.NEXT_RSPACK) {\n // silent rspack's schema check\n process.env.RSPACK_CONFIG_VALIDATE = 'loose-silent'\n}\n\nif (\n !semver.satisfies(\n process.versions.node,\n process.env.__NEXT_REQUIRED_NODE_VERSION_RANGE!,\n { includePrerelease: true }\n )\n) {\n console.error(\n `You are using Node.js ${process.versions.node}. For Next.js, Node.js version \"${process.env.__NEXT_REQUIRED_NODE_VERSION_RANGE}\" is required.`\n )\n process.exit(1)\n}\n\nprocess.env.NEXT_PRIVATE_START_TIME = Date.now().toString()\n\nfor (const dependency of ['react', 'react-dom']) {\n try {\n // When 'npm link' is used it checks the clone location. Not the project.\n require.resolve(dependency)\n } catch (err) {\n console.warn(\n `The module '${dependency}' was not found. Next.js requires that you include it in 'dependencies' of your 'package.json'. To add it, run 'npm install ${dependency}'`\n )\n }\n}\n\nclass NextRootCommand extends Command {\n createCommand(name: string) {\n const command = new Command(name)\n\n command.hook('preAction', (event) => {\n const commandName = event.name()\n const defaultEnv = commandName === 'dev' ? 'development' : 'production'\n const standardEnv = ['production', 'development', 'test']\n\n if (process.env.NODE_ENV) {\n const isNotStandard = !standardEnv.includes(process.env.NODE_ENV)\n const shouldWarnCommands =\n process.env.NODE_ENV === 'development'\n ? ['start', 'build']\n : process.env.NODE_ENV === 'production'\n ? ['dev']\n : []\n\n if (isNotStandard || shouldWarnCommands.includes(commandName)) {\n warn(NON_STANDARD_NODE_ENV)\n }\n }\n\n ;(process.env as any).NODE_ENV = process.env.NODE_ENV || defaultEnv\n ;(process.env as any).NEXT_RUNTIME = 'nodejs'\n\n if (\n process.platform === 'darwin' &&\n process.arch === 'x64' &&\n os.cpus().some((cpu) => cpu.model.includes('Apple'))\n ) {\n warn(\n 'You are running Next.js on an Apple Silicon Mac with Rosetta 2 ' +\n 'translation, which may cause degraded performance. You may have ' +\n 'accidentally installed an x86-64 version of Node.js.'\n )\n }\n\n if (\n commandName !== 'dev' &&\n commandName !== 'start' &&\n event.getOptionValue('inspect') === true\n ) {\n console.error(\n `\\`--inspect\\` flag is deprecated. Use env variable NODE_OPTIONS instead: NODE_OPTIONS='--inspect' next ${commandName}`\n )\n process.exit(1)\n }\n })\n\n return command\n }\n}\n\nfunction parseValidInspectAddress(value: string): DebugAddress {\n const address = getParsedDebugAddress(value)\n\n if (Number.isNaN(address.port)) {\n throw new InvalidArgumentError(\n 'The given value is not a valid inspect address. ' +\n 'Did you mean to pass an app path?\\n' +\n `Try switching the order of the arguments or set the default address explicitly e.g.\\n` +\n `next dev ${value} --inspect\\n` +\n `next dev --inspect= ${value}`\n )\n }\n\n return address\n}\n\nconst program = new NextRootCommand()\n\nprogram\n .name('next')\n .description(\n 'The Next.js CLI allows you to develop, build, start your application, and more.'\n )\n .configureHelp({\n formatHelp: (cmd, helper) => formatCliHelpOutput(cmd, helper),\n subcommandTerm: (cmd) => `${cmd.name()} ${cmd.usage()}`,\n })\n .helpCommand(false)\n .helpOption('-h, --help', 'Displays this message.')\n .version(\n `Next.js v${process.env.__NEXT_VERSION}`,\n '-v, --version',\n 'Outputs the Next.js version.'\n )\n\nprogram\n .command('build')\n .description(\n 'Creates an optimized production build of your application. The output displays information about each route.'\n )\n .argument(\n '[directory]',\n `A directory on which to build the application. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .option(\n '--experimental-analyze',\n 'Analyze bundle output. Only compatible with Turbopack.'\n )\n .option('-d, --debug', 'Enables a more verbose build output.')\n .option(\n '--debug-prerender',\n 'Enables debug mode for prerendering. Not for production use!'\n )\n .option('--no-mangling', 'Disables mangling.')\n .option('--profile', 'Enables production profiling for React.')\n .option('--experimental-app-only', 'Builds only App Router routes.')\n .option('--turbo', 'Builds using Turbopack.')\n .option('--turbopack', 'Builds using Turbopack.')\n .option('--webpack', 'Builds using webpack.')\n .addOption(\n new Option(\n '--experimental-build-mode [mode]',\n 'Uses an experimental build mode.'\n )\n .choices(['compile', 'generate', 'generate-env'])\n .default('default')\n )\n .option(\n '--experimental-debug-memory-usage',\n 'Enables memory profiling features to debug memory consumption.'\n )\n .option(\n '--experimental-upload-trace, <traceUrl>',\n 'Reports a subset of the debugging trace to a remote HTTP URL. Includes sensitive data.'\n )\n .option(\n '--experimental-next-config-strip-types',\n 'Use Node.js native TypeScript resolution for next.config.(ts|mts)'\n )\n .option(\n '--debug-build-paths <patterns>',\n 'Comma-separated glob patterns or explicit paths for selective builds. Use \"!\" prefix to exclude. Examples: \"app/*\", \"app/page.tsx\", \"app/**/page.tsx\", \"app/**,!app/[slug]/**\"'\n )\n .option(\n '--experimental-cpu-prof',\n 'Enable CPU profiling. Profile is saved to .next-profiles/ on exit.'\n )\n .addOption(\n new Option(\n '--internal-trace [level]',\n 'Enable Turbopack tracing. \"all\" (default) enables turbo-tasks level tracing, \"overview\" enables overview tracing.'\n )\n .choices(['all', 'overview'])\n .preset('all')\n )\n .action((directory: string, options: NextBuildOptions) => {\n if (options.debugPrerender) {\n // @ts-expect-error not readonly\n process.env.NODE_ENV = 'development'\n }\n if (options.experimentalNextConfigStripTypes) {\n process.env.__NEXT_NODE_NATIVE_TS_LOADER_ENABLED = 'true'\n }\n if (options.experimentalCpuProf) {\n process.env.NEXT_CPU_PROF = '1'\n process.env.__NEXT_PRIVATE_CPU_PROFILE = 'build-main'\n const { join } = require('path') as typeof import('path')\n const dir = directory || process.cwd()\n const cpuProfileDir = join(dir, '.next-profiles')\n mkdirSync(cpuProfileDir, { recursive: true })\n process.env.NEXT_CPU_PROF_DIR = cpuProfileDir\n }\n if (options.internalTrace) {\n process.env.NEXT_TURBOPACK_TRACING =\n options.internalTrace === 'all'\n ? 'turbo-tasks'\n : String(options.internalTrace)\n }\n\n // ensure process exits after build completes so open handles/connections\n // don't cause process to hang\n return import('../cli/next-build.js').then((mod) =>\n mod.nextBuild(options, directory).then(async () => {\n // Save CPU profile before exiting if enabled\n if (options.experimentalCpuProf) {\n await mod.saveCpuProfile()\n }\n process.exit(0)\n })\n )\n })\n .usage('[directory] [options]')\n\nprogram\n .command('experimental-analyze')\n .description(\n 'Analyze production bundle output with an interactive web ui. Does not produce an application build. Only compatible with Turbopack.'\n )\n .argument(\n '[directory]',\n `A directory on which to analyze the application. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .option('--no-mangling', 'Disables mangling.')\n .option('--profile', 'Enables production profiling for React.')\n .option(\n '-o, --output',\n 'Only write analysis files to disk. Does not start the server.'\n )\n .addOption(\n new Option(\n '--port <port>',\n 'Specify a port number to serve the analyzer on.'\n )\n .implies({ serve: true })\n .argParser(parseValidPositiveInteger)\n .default(4000)\n .env('PORT')\n )\n .action((directory: string, options: NextAnalyzeOptions) => {\n return import('../cli/next-analyze.js')\n .then((mod) => mod.nextAnalyze(options, directory))\n .then(() => {\n if (options.output) {\n // The Next.js process is held open by something on the event loop. Exit manually like the `build` command does.\n // TODO: Fix the underlying issue so this is not necessary.\n process.exit(0)\n }\n })\n })\n\nprogram\n .command('dev', { isDefault: true })\n .description(\n 'Starts Next.js in development mode with hot-code reloading, error reporting, and more.'\n )\n .argument(\n '[directory]',\n `A directory on which to build the application. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .addOption(\n new Option(\n '--inspect [[host:]port]',\n 'Allows inspecting server-side code. See https://nextjs.org/docs/app/guides/debugging#server-side-code'\n ).argParser(parseValidInspectAddress)\n )\n .option('--turbo', 'Starts development mode using Turbopack.')\n .option('--turbopack', 'Starts development mode using Turbopack.')\n .option('--webpack', 'Starts development mode using webpack.')\n .addOption(\n new Option(\n '-p, --port <port>',\n 'Specify a port number on which to start the application.'\n )\n .argParser(parseValidPositiveInteger)\n .default(3000)\n .env('PORT')\n )\n .option(\n '-H, --hostname <hostname>',\n 'Specify a hostname on which to start the application (default: 0.0.0.0).'\n )\n .option(\n '--disable-source-maps',\n \"Don't start the Dev server with `--enable-source-maps`.\",\n false\n )\n .option(\n '--experimental-https',\n 'Starts the server with HTTPS and generates a self-signed certificate.'\n )\n .option('--experimental-https-key, <path>', 'Path to a HTTPS key file.')\n .option(\n '--experimental-https-cert, <path>',\n 'Path to a HTTPS certificate file.'\n )\n .option(\n '--experimental-https-ca, <path>',\n 'Path to a HTTPS certificate authority file.'\n )\n // `--server-fast-refresh` is hidden because it's the default behavior and\n // only needs to be explicitly passed to override a\n // `experimental.turbopackServerFastRefresh: false` in next.config. The\n // `--no-server-fast-refresh` negation is the meaningful user-facing flag.\n .addOption(new Option('--server-fast-refresh').default(undefined).hideHelp())\n .addOption(\n new Option('--no-server-fast-refresh', 'Disable server-side Fast Refresh')\n )\n .option(\n '--experimental-upload-trace, <traceUrl>',\n 'Reports a subset of the debugging trace to a remote HTTP URL. Includes sensitive data.'\n )\n .option(\n '--experimental-next-config-strip-types',\n 'Use Node.js native TypeScript resolution for next.config.(ts|mts)'\n )\n .option(\n '--experimental-cpu-prof',\n 'Enable CPU profiling. Profiles are saved to .next-profiles/ on exit.'\n )\n .addOption(\n new Option(\n '--internal-trace [level]',\n 'Enable Turbopack tracing. \"all\" (default) enables turbo-tasks level tracing, \"overview\" enables overview tracing.'\n )\n .choices(['all', 'overview'])\n .preset('all')\n )\n .action(\n (directory: string, options: NextDevOptions, { _optionValueSources }) => {\n if (options.experimentalNextConfigStripTypes) {\n process.env.__NEXT_NODE_NATIVE_TS_LOADER_ENABLED = 'true'\n }\n if (options.experimentalCpuProf) {\n process.env.NEXT_CPU_PROF = '1'\n process.env.__NEXT_PRIVATE_CPU_PROFILE = 'dev-main'\n const { join } = require('path') as typeof import('path')\n const dir = directory || process.cwd()\n const cpuProfileDir = join(dir, '.next-profiles')\n mkdirSync(cpuProfileDir, { recursive: true })\n process.env.NEXT_CPU_PROF_DIR = cpuProfileDir\n }\n if (options.internalTrace) {\n process.env.NEXT_TURBOPACK_TRACING =\n options.internalTrace === 'all'\n ? 'turbo-tasks'\n : String(options.internalTrace)\n }\n const portSource = _optionValueSources.port\n import('../cli/next-dev.js').then((mod) =>\n mod.nextDev(options, portSource, directory)\n )\n }\n )\n .usage('[directory] [options]')\n\nprogram\n .command('export', { hidden: true })\n .action(() => import('../cli/next-export.js').then((mod) => mod.nextExport()))\n .helpOption(false)\n\nprogram\n .command('info')\n .description(\n 'Prints relevant details about the current system which can be used to report Next.js bugs.'\n )\n .addHelpText(\n 'after',\n `\\nLearn more: ${cyan('https://nextjs.org/docs/api-reference/cli#info')}`\n )\n .option('--verbose', 'Collects additional information for debugging.')\n .action((options: NextInfoOptions) =>\n import('../cli/next-info.js').then((mod) => mod.nextInfo(options))\n )\n\nprogram\n .command('start')\n .description(\n 'Starts Next.js in production mode. The application should be compiled with `next build` first.'\n )\n .argument(\n '[directory]',\n `A directory on which to start the application. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .addOption(\n new Option(\n '-p, --port <port>',\n 'Specify a port number on which to start the application.'\n )\n .argParser(parseValidPositiveInteger)\n .default(3000)\n .env('PORT')\n )\n .option(\n '-H, --hostname <hostname>',\n 'Specify a hostname on which to start the application (default: 0.0.0.0).'\n )\n .addOption(\n new Option(\n '--inspect [[host:]port]',\n 'Allows inspecting server-side code. See https://nextjs.org/docs/app/guides/debugging#server-side-code'\n ).argParser(parseValidInspectAddress)\n )\n .addOption(\n new Option(\n '--keepAliveTimeout <keepAliveTimeout>',\n 'Specify the maximum amount of milliseconds to wait before closing inactive connections.'\n ).argParser(parseValidPositiveInteger)\n )\n .option(\n '--experimental-next-config-strip-types',\n 'Use Node.js native TypeScript resolution for next.config.(ts|mts)'\n )\n .option(\n '--experimental-cpu-prof',\n 'Enable CPU profiling. Profiles are saved to .next-profiles/ on exit.'\n )\n .action((directory: string, options: NextStartOptions) => {\n if (options.experimentalNextConfigStripTypes) {\n process.env.__NEXT_NODE_NATIVE_TS_LOADER_ENABLED = 'true'\n }\n if (options.experimentalCpuProf) {\n process.env.NEXT_CPU_PROF = '1'\n process.env.__NEXT_PRIVATE_CPU_PROFILE = 'start-main'\n const { join } = require('path') as typeof import('path')\n const dir = directory || process.cwd()\n const cpuProfileDir = join(dir, '.next-profiles')\n mkdirSync(cpuProfileDir, { recursive: true })\n process.env.NEXT_CPU_PROF_DIR = cpuProfileDir\n }\n return import('../cli/next-start.js').then((mod) =>\n mod.nextStart(options, directory)\n )\n })\n .usage('[directory] [options]')\n\nprogram\n .command('telemetry')\n .description(\n `Allows you to enable or disable Next.js' ${bold(\n 'completely anonymous'\n )} telemetry collection.`\n )\n .addArgument(new Argument('[arg]').choices(['disable', 'enable', 'status']))\n .addHelpText('after', `\\nLearn more: ${cyan('https://nextjs.org/telemetry')}`)\n .addOption(\n new Option('--enable', `Enables Next.js' telemetry collection.`).conflicts(\n 'disable'\n )\n )\n .option('--disable', `Disables Next.js' telemetry collection.`)\n .action((arg: string, options: NextTelemetryOptions) =>\n import('../cli/next-telemetry.js').then((mod) =>\n mod.nextTelemetry(options, arg)\n )\n )\n\nprogram\n .command('typegen')\n .description(\n 'Generate TypeScript definitions for routes, pages, and layouts without running a full build.'\n )\n .argument(\n '[directory]',\n `A directory on which to generate types. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .action((directory: string, options: NextTypegenOptions) =>\n // ensure process exits after typegen completes so open handles/connections\n // don't cause process to hang\n import('../cli/next-typegen.js').then((mod) =>\n mod\n .nextTypegen(options, directory)\n .then(() => process.exit(0))\n .catch((err: unknown) => {\n // Without this, a failed typegen (e.g. `next.config` throwing) is\n // swallowed as an unhandled rejection that exits 0; surface it with a\n // non-zero exit so `next typegen && tsc` halts instead of running\n // against missing route types.\n console.error(\n '\\n> Unexpected error while generating route types. Original error:\\n'\n )\n console.error(err)\n process.exit(1)\n })\n )\n )\n .usage('[directory] [options]')\n\nconst nextVersion = process.env.__NEXT_VERSION || 'unknown'\nprogram\n .command('upgrade')\n .description(\n 'Upgrade Next.js apps to desired versions with a single command.'\n )\n .argument(\n '[directory]',\n `A Next.js project directory to upgrade. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .usage('[directory] [options]')\n .option(\n '--revision <revision>',\n 'Specify the target Next.js version using an NPM dist tag (e.g. \"latest\", \"canary\", \"rc\", \"beta\") or an exact version number (e.g. \"15.0.0\").',\n nextVersion.includes('-canary.')\n ? 'canary'\n : nextVersion.includes('-rc.')\n ? 'rc'\n : nextVersion.includes('-beta.')\n ? 'beta'\n : 'latest'\n )\n .option('--verbose', 'Verbose output', false)\n .action(async (directory, options) => {\n const mod = await import('../cli/next-upgrade.js')\n mod.spawnNextUpgrade(directory, options)\n })\n\nprogram\n .command('experimental-test')\n .description(\n `Execute \\`next/experimental/testmode\\` tests using a specified test runner. The test runner defaults to 'playwright' if the \\`experimental.defaultTestRunner\\` configuration option or the \\`--test-runner\\` option are not set.`\n )\n .argument(\n '[directory]',\n `A Next.js project directory to execute the test runner on. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .argument(\n '[test-runner-args...]',\n 'Any additional arguments or options to pass down to the test runner `test` command.'\n )\n .option(\n '--test-runner [test-runner]',\n `Any supported test runner. Options: ${bold(\n SUPPORTED_TEST_RUNNERS_LIST.join(', ')\n )}. ${italic(\n \"If no test runner is provided, the Next.js config option `experimental.defaultTestRunner`, or 'playwright' will be used.\"\n )}`\n )\n .allowUnknownOption()\n .action(\n (directory: string, testRunnerArgs: string[], options: NextTestOptions) => {\n return import('../cli/next-test.js').then((mod) => {\n mod.nextTest(directory, testRunnerArgs, options)\n })\n }\n )\n .usage('[directory] [options]')\n\nconst internal = program\n .command('internal')\n .description(\n 'Internal debugging commands. Use with caution. Not covered by semver.'\n )\n\ninternal\n .command('trace')\n .alias('turbo-trace-server')\n .argument('file', 'Trace file to serve.')\n .addOption(\n new Option('-p, --port <port>', 'Override the port.').argParser(\n parseValidPositiveInteger\n )\n )\n .addOption(\n new Option(\n '--mcp-port <mcpPort>',\n 'Port for the MCP (Model Context Protocol) server. Defaults to --port + 1.'\n ).argParser(parseValidPositiveInteger)\n )\n .action(\n (\n file: string,\n options: { port: number | undefined; mcpPort: number | undefined }\n ) => {\n return import('../cli/internal/turbo-trace-server.js').then((mod) =>\n mod.startTurboTraceServerCli(file, options.port, options.mcpPort)\n )\n }\n )\n\ninternal\n .command('query-trace')\n .description(\n 'Query a running turbopack trace server (started with `next internal trace --mcp-port <port>`).'\n )\n .addOption(\n new Option(\n '--port <port>',\n 'MCP port of the running trace server. Defaults to 5748.'\n ).argParser(parseValidPositiveInteger)\n )\n .addOption(\n new Option(\n '--parent <parent>',\n 'Span ID to enumerate children of. Omit for root level.'\n )\n )\n .addOption(\n new Option(\n '--no-aggregated',\n 'Disable aggregation of spans by name (aggregated by default).'\n )\n )\n .addOption(\n new Option(\n '--sort <mode>',\n 'Sort mode: \"value\" for corrected duration descending, \"name\" for alphabetical.'\n ).choices(['value', 'name'])\n )\n .addOption(\n new Option('--search <search>', 'Substring filter on span name/category.')\n )\n .addOption(new Option('--json', 'Output as JSON instead of markdown.'))\n .addOption(\n new Option('--page <page>', 'Page number (1-based, default 1).').argParser(\n parseValidPositiveInteger\n )\n )\n .addHelpText('after', ({ command }) => {\n const port = (command.opts() as { port?: number }).port ?? 5748\n return `\\nExample:\\n next internal query-trace --port ${port} --parent <id>`\n })\n .action((options) =>\n import('../cli/internal/query-trace.js').then((mod) =>\n mod.queryTraceCli(options)\n )\n )\n\ninternal\n .command('post-build')\n .description(\n 'Runs post-build optimization steps (e.g. Turbopack database compaction).'\n )\n .argument(\n '[directory]',\n `A directory on which to run post-build steps. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .action((directory: string, options: NextPostBuildOptions) => {\n return (\n require('../cli/next-post-build.js') as typeof import('../cli/next-post-build.js')\n )\n .nextPostBuild(options, directory)\n .then(() => process.exit(0))\n })\n .usage('[directory] [options]')\n\ninternal\n .command('upload-trace')\n .description(\n 'Upload CPU profiles from .next-profiles/ to Vercel Blob storage.'\n )\n .argument(\n '[directory]',\n `The project directory containing .next-profiles/. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .action((directory: string) => {\n return import('../cli/internal/upload-trace.js').then((mod) =>\n mod.uploadTraceToBlob({ directory })\n )\n })\n .usage('[directory] [options]')\n\ninternal\n .command('static-routes-info')\n .description(\n 'Analyze a built Next.js app and report per-route bundle sizes across server bundled JS, server source maps, server unbundled, client JS, client source maps, and client CSS categories.'\n )\n .argument(\n '[directory]',\n `A directory containing the built Next.js application. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .option('--json', 'Output as JSON instead of markdown.')\n .option(\n '--limit <n>',\n 'Only show the first N routes after sorting (totals always reflect all routes).',\n parseInt\n )\n .option(\n '--sort <key>',\n 'Sort routes by: name (default, ascending), or one of client, client-js, client-css, client-map, server, server-bundled-js, server-unbundled, server-map, total (descending).'\n )\n .option(\n '--files',\n 'Include the list of files (relative to the output directory) per category in the JSON output. Requires --json.'\n )\n .action(\n (\n directory: string,\n options: {\n json?: boolean\n limit?: number\n sort?: string\n files?: boolean\n }\n ) => {\n return import('../cli/internal/static-routes-info.js').then((mod) =>\n mod.staticRoutesInfoCli(options, directory)\n )\n }\n )\n .usage('[directory] [options]')\n\nprogram.parse(process.argv)\n"],"names":["process","env","NEXT_RSPACK","RSPACK_CONFIG_VALIDATE","semver","satisfies","versions","node","__NEXT_REQUIRED_NODE_VERSION_RANGE","includePrerelease","console","error","exit","NEXT_PRIVATE_START_TIME","Date","now","toString","dependency","require","resolve","err","warn","NextRootCommand","Command","createCommand","name","command","hook","event","commandName","defaultEnv","standardEnv","NODE_ENV","isNotStandard","includes","shouldWarnCommands","NON_STANDARD_NODE_ENV","NEXT_RUNTIME","platform","arch","os","cpus","some","cpu","model","getOptionValue","parseValidInspectAddress","value","address","getParsedDebugAddress","Number","isNaN","port","InvalidArgumentError","program","description","configureHelp","formatHelp","cmd","helper","formatCliHelpOutput","subcommandTerm","usage","helpCommand","helpOption","version","__NEXT_VERSION","argument","italic","option","addOption","Option","choices","default","preset","action","directory","options","debugPrerender","experimentalNextConfigStripTypes","__NEXT_NODE_NATIVE_TS_LOADER_ENABLED","experimentalCpuProf","NEXT_CPU_PROF","__NEXT_PRIVATE_CPU_PROFILE","join","dir","cwd","cpuProfileDir","mkdirSync","recursive","NEXT_CPU_PROF_DIR","internalTrace","NEXT_TURBOPACK_TRACING","String","then","mod","nextBuild","saveCpuProfile","implies","serve","argParser","parseValidPositiveInteger","nextAnalyze","output","isDefault","undefined","hideHelp","_optionValueSources","portSource","nextDev","hidden","nextExport","addHelpText","cyan","nextInfo","nextStart","bold","addArgument","Argument","conflicts","arg","nextTelemetry","nextTypegen","catch","nextVersion","spawnNextUpgrade","SUPPORTED_TEST_RUNNERS_LIST","allowUnknownOption","testRunnerArgs","nextTest","internal","alias","file","startTurboTraceServerCli","mcpPort","opts","queryTraceCli","nextPostBuild","uploadTraceToBlob","parseInt","staticRoutesInfoCli","parse","argv"],"mappings":";;;;;QAEO;2DAEQ;2BAMR;qBAEc;+DACF;4BACgB;qCACC;2BACE;uBAK/B;0BAIA;oBASmB;;;;;;AAE1B,IAAIA,QAAQC,GAAG,CAACC,WAAW,EAAE;IAC3B,+BAA+B;IAC/BF,QAAQC,GAAG,CAACE,sBAAsB,GAAG;AACvC;AAEA,IACE,CAACC,eAAM,CAACC,SAAS,CACfL,QAAQM,QAAQ,CAACC,IAAI,EACrBP,QAAQC,GAAG,CAACO,kCAAkC,EAC9C;IAAEC,mBAAmB;AAAK,IAE5B;IACAC,QAAQC,KAAK,CACX,CAAC,sBAAsB,EAAEX,QAAQM,QAAQ,CAACC,IAAI,CAAC,gCAAgC,EAAEP,QAAQC,GAAG,CAACO,kCAAkC,CAAC,cAAc,CAAC;IAEjJR,QAAQY,IAAI,CAAC;AACf;AAEAZ,QAAQC,GAAG,CAACY,uBAAuB,GAAGC,KAAKC,GAAG,GAAGC,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,gBACR6B,WAAW,CACV,oEAEDY,QAAQ,CACP,eACA,CAAC,kDAAkD,EAAEC,IAAAA,kBAAM,EACzD,qEACC,EAEJO,MAAM,CAAC,CAACC;IACP,OAAO,MAAM,CAAC,mCAAmCkB,IAAI,CAAC,CAACC,MACrDA,IAAI2C,iBAAiB,CAAC;YAAE9D;QAAU;AAEtC,GACCd,KAAK,CAAC;AAEToE,SACGxG,OAAO,CAAC,sBACR6B,WAAW,CACV,2LAEDY,QAAQ,CACP,eACA,CAAC,sDAAsD,EAAEC,IAAAA,kBAAM,EAC7D,qEACC,EAEJC,MAAM,CAAC,UAAU,uCACjBA,MAAM,CACL,eACA,kFACAsE,UAEDtE,MAAM,CACL,gBACA,gLAEDA,MAAM,CACL,WACA,kHAEDM,MAAM,CACL,CACEC,WACAC;IAOA,OAAO,MAAM,CAAC,yCAAyCiB,IAAI,CAAC,CAACC,MAC3DA,IAAI6C,mBAAmB,CAAC/D,SAASD;AAErC,GAEDd,KAAK,CAAC;AAETR,QAAQuF,KAAK,CAAC7I,QAAQ8I,IAAI","ignoreList":[0]} | ||
| {"version":3,"sources":["../../src/bin/next.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport '../server/require-hook'\n\nimport os from 'os'\nimport {\n Argument,\n Command,\n InvalidArgumentError,\n Option,\n} from 'next/dist/compiled/commander'\n\nimport { warn } from '../build/output/log'\nimport semver from 'next/dist/compiled/semver'\nimport { bold, cyan, italic } from '../lib/picocolors'\nimport { formatCliHelpOutput } from '../lib/format-cli-help-output'\nimport { NON_STANDARD_NODE_ENV } from '../lib/constants'\nimport {\n getParsedDebugAddress,\n parseValidPositiveInteger,\n type DebugAddress,\n} from '../server/lib/utils'\nimport {\n SUPPORTED_TEST_RUNNERS_LIST,\n type NextTestOptions,\n} from '../cli/next-test.js'\nimport type { NextTelemetryOptions } from '../cli/next-telemetry.js'\nimport type { NextStartOptions } from '../cli/next-start.js'\nimport type { NextInfoOptions } from '../cli/next-info.js'\nimport type { NextDevOptions } from '../cli/next-dev.js'\nimport type { NextAnalyzeOptions } from '../cli/next-analyze.js'\nimport type { NextBuildOptions } from '../cli/next-build.js'\nimport type { NextTypegenOptions } from '../cli/next-typegen.js'\nimport type { NextPostBuildOptions } from '../cli/next-post-build.js'\nimport { mkdirSync } from 'fs'\n\nif (process.env.NEXT_RSPACK) {\n // silent rspack's schema check\n process.env.RSPACK_CONFIG_VALIDATE = 'loose-silent'\n}\n\nif (\n !semver.satisfies(\n process.versions.node,\n process.env.__NEXT_REQUIRED_NODE_VERSION_RANGE!,\n { includePrerelease: true }\n )\n) {\n console.error(\n `You are using Node.js ${process.versions.node}. For Next.js, Node.js version \"${process.env.__NEXT_REQUIRED_NODE_VERSION_RANGE}\" is required.`\n )\n process.exit(1)\n}\n\nprocess.env.NEXT_PRIVATE_START_TIME = Date.now().toString()\n\nfor (const dependency of ['react', 'react-dom']) {\n try {\n // When 'npm link' is used it checks the clone location. Not the project.\n require.resolve(dependency)\n } catch (err) {\n console.warn(\n `The module '${dependency}' was not found. Next.js requires that you include it in 'dependencies' of your 'package.json'. To add it, run 'npm install ${dependency}'`\n )\n }\n}\n\nclass NextRootCommand extends Command {\n createCommand(name: string) {\n const command = new Command(name)\n\n command.hook('preAction', (event) => {\n const commandName = event.name()\n const defaultEnv = commandName === 'dev' ? 'development' : 'production'\n const standardEnv = ['production', 'development', 'test']\n\n if (process.env.NODE_ENV) {\n const isNotStandard = !standardEnv.includes(process.env.NODE_ENV)\n const shouldWarnCommands =\n process.env.NODE_ENV === 'development'\n ? ['start', 'build']\n : process.env.NODE_ENV === 'production'\n ? ['dev']\n : []\n\n if (isNotStandard || shouldWarnCommands.includes(commandName)) {\n warn(NON_STANDARD_NODE_ENV)\n }\n }\n\n ;(process.env as any).NODE_ENV = process.env.NODE_ENV || defaultEnv\n ;(process.env as any).NEXT_RUNTIME = 'nodejs'\n\n if (\n process.platform === 'darwin' &&\n process.arch === 'x64' &&\n os.cpus().some((cpu) => cpu.model.includes('Apple'))\n ) {\n warn(\n 'You are running Next.js on an Apple Silicon Mac with Rosetta 2 ' +\n 'translation, which may cause degraded performance. You may have ' +\n 'accidentally installed an x86-64 version of Node.js.'\n )\n }\n\n if (\n commandName !== 'dev' &&\n commandName !== 'start' &&\n event.getOptionValue('inspect') === true\n ) {\n console.error(\n `\\`--inspect\\` flag is deprecated. Use env variable NODE_OPTIONS instead: NODE_OPTIONS='--inspect' next ${commandName}`\n )\n process.exit(1)\n }\n })\n\n return command\n }\n}\n\nfunction parseValidInspectAddress(value: string): DebugAddress {\n const address = getParsedDebugAddress(value)\n\n if (Number.isNaN(address.port)) {\n throw new InvalidArgumentError(\n 'The given value is not a valid inspect address. ' +\n 'Did you mean to pass an app path?\\n' +\n `Try switching the order of the arguments or set the default address explicitly e.g.\\n` +\n `next dev ${value} --inspect\\n` +\n `next dev --inspect= ${value}`\n )\n }\n\n return address\n}\n\nconst program = new NextRootCommand()\n\nprogram\n .name('next')\n .description(\n 'The Next.js CLI allows you to develop, build, start your application, and more.'\n )\n .configureHelp({\n formatHelp: (cmd, helper) => formatCliHelpOutput(cmd, helper),\n subcommandTerm: (cmd) => `${cmd.name()} ${cmd.usage()}`,\n })\n .helpCommand(false)\n .helpOption('-h, --help', 'Displays this message.')\n .version(\n `Next.js v${process.env.__NEXT_VERSION}`,\n '-v, --version',\n 'Outputs the Next.js version.'\n )\n\nprogram\n .command('build')\n .description(\n 'Creates an optimized production build of your application. The output displays information about each route.'\n )\n .argument(\n '[directory]',\n `A directory on which to build the application. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .option(\n '--experimental-analyze',\n 'Analyze bundle output. Only compatible with Turbopack.'\n )\n .option('-d, --debug', 'Enables a more verbose build output.')\n .option(\n '--debug-prerender',\n 'Enables debug mode for prerendering. Not for production use!'\n )\n .option('--no-mangling', 'Disables mangling.')\n .option('--profile', 'Enables production profiling for React.')\n .option('--experimental-app-only', 'Builds only App Router routes.')\n .option('--turbo', 'Builds using Turbopack.')\n .option('--turbopack', 'Builds using Turbopack.')\n .option('--webpack', 'Builds using webpack.')\n .addOption(\n new Option(\n '--experimental-build-mode [mode]',\n 'Uses an experimental build mode.'\n )\n .choices(['compile', 'generate', 'generate-env'])\n .default('default')\n )\n .option(\n '--experimental-debug-memory-usage',\n 'Enables memory profiling features to debug memory consumption.'\n )\n .option(\n '--experimental-upload-trace, <traceUrl>',\n 'Reports a subset of the debugging trace to a remote HTTP URL. Includes sensitive data.'\n )\n .option(\n '--experimental-next-config-strip-types',\n 'Use Node.js native TypeScript resolution for next.config.(ts|mts)'\n )\n .option(\n '--debug-build-paths <patterns>',\n 'Comma-separated glob patterns or explicit paths for selective builds. Use \"!\" prefix to exclude. Examples: \"app/*\", \"app/page.tsx\", \"app/**/page.tsx\", \"app/**,!app/[slug]/**\"'\n )\n .option(\n '--experimental-cpu-prof',\n 'Enable CPU profiling. Profile is saved to .next-profiles/ on exit.'\n )\n .addOption(\n new Option(\n '--internal-trace [level]',\n 'Enable Turbopack tracing. \"all\" (default) enables turbo-tasks level tracing, \"overview\" enables overview tracing.'\n )\n .choices(['all', 'overview'])\n .preset('all')\n )\n .action((directory: string, options: NextBuildOptions) => {\n if (options.debugPrerender) {\n // @ts-expect-error not readonly\n process.env.NODE_ENV = 'development'\n }\n if (options.experimentalNextConfigStripTypes) {\n process.env.__NEXT_NODE_NATIVE_TS_LOADER_ENABLED = 'true'\n }\n if (options.experimentalCpuProf) {\n process.env.NEXT_CPU_PROF = '1'\n process.env.__NEXT_PRIVATE_CPU_PROFILE = 'build-main'\n const { join } = require('path') as typeof import('path')\n const dir = directory || process.cwd()\n const cpuProfileDir = join(dir, '.next-profiles')\n mkdirSync(cpuProfileDir, { recursive: true })\n process.env.NEXT_CPU_PROF_DIR = cpuProfileDir\n }\n if (options.internalTrace) {\n process.env.NEXT_TURBOPACK_TRACING =\n options.internalTrace === 'all'\n ? 'turbo-tasks'\n : String(options.internalTrace)\n }\n\n // ensure process exits after build completes so open handles/connections\n // don't cause process to hang\n return import('../cli/next-build.js').then((mod) =>\n mod.nextBuild(options, directory).then(async () => {\n // Save CPU profile before exiting if enabled\n if (options.experimentalCpuProf) {\n await mod.saveCpuProfile()\n }\n process.exit(0)\n })\n )\n })\n .usage('[directory] [options]')\n\nprogram\n .command('experimental-analyze')\n .description(\n 'Analyze production bundle output with an interactive web ui. Does not produce an application build. Only compatible with Turbopack.'\n )\n .argument(\n '[directory]',\n `A directory on which to analyze the application. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .option('--no-mangling', 'Disables mangling.')\n .option('--profile', 'Enables production profiling for React.')\n .option(\n '-o, --output',\n 'Only write analysis files to disk. Does not start the server.'\n )\n .addOption(\n new Option(\n '--port <port>',\n 'Specify a port number to serve the analyzer on.'\n )\n .implies({ serve: true })\n .argParser(parseValidPositiveInteger)\n .default(4000)\n .env('PORT')\n )\n .action((directory: string, options: NextAnalyzeOptions) => {\n return import('../cli/next-analyze.js')\n .then((mod) => mod.nextAnalyze(options, directory))\n .then(() => {\n if (options.output) {\n // The Next.js process is held open by something on the event loop. Exit manually like the `build` command does.\n // TODO: Fix the underlying issue so this is not necessary.\n process.exit(0)\n }\n })\n })\n\nprogram\n .command('dev', { isDefault: true })\n .description(\n 'Starts Next.js in development mode with hot-code reloading, error reporting, and more.'\n )\n .argument(\n '[directory]',\n `A directory on which to build the application. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .addOption(\n new Option(\n '--inspect [[host:]port]',\n 'Allows inspecting server-side code. See https://nextjs.org/docs/app/guides/debugging#server-side-code'\n ).argParser(parseValidInspectAddress)\n )\n .option('--turbo', 'Starts development mode using Turbopack.')\n .option('--turbopack', 'Starts development mode using Turbopack.')\n .option('--webpack', 'Starts development mode using webpack.')\n .addOption(\n new Option(\n '-p, --port <port>',\n 'Specify a port number on which to start the application.'\n )\n .argParser(parseValidPositiveInteger)\n .default(3000)\n .env('PORT')\n )\n .option(\n '-H, --hostname <hostname>',\n 'Specify a hostname on which to start the application (default: 0.0.0.0).'\n )\n .option(\n '--disable-source-maps',\n \"Don't start the Dev server with `--enable-source-maps`.\",\n false\n )\n .option(\n '--experimental-https',\n 'Starts the server with HTTPS and generates a self-signed certificate.'\n )\n .option('--experimental-https-key, <path>', 'Path to a HTTPS key file.')\n .option(\n '--experimental-https-cert, <path>',\n 'Path to a HTTPS certificate file.'\n )\n .option(\n '--experimental-https-ca, <path>',\n 'Path to a HTTPS certificate authority file.'\n )\n // `--server-fast-refresh` is hidden because it's the default behavior and\n // only needs to be explicitly passed to override a\n // `experimental.turbopackServerFastRefresh: false` in next.config. The\n // `--no-server-fast-refresh` negation is the meaningful user-facing flag.\n .addOption(new Option('--server-fast-refresh').default(undefined).hideHelp())\n .addOption(\n new Option('--no-server-fast-refresh', 'Disable server-side Fast Refresh')\n )\n .option(\n '--experimental-upload-trace, <traceUrl>',\n 'Reports a subset of the debugging trace to a remote HTTP URL. Includes sensitive data.'\n )\n .option(\n '--experimental-next-config-strip-types',\n 'Use Node.js native TypeScript resolution for next.config.(ts|mts)'\n )\n .option(\n '--experimental-cpu-prof',\n 'Enable CPU profiling. Profiles are saved to .next-profiles/ on exit.'\n )\n .addOption(\n new Option(\n '--internal-trace [level]',\n 'Enable Turbopack tracing. \"all\" (default) enables turbo-tasks level tracing, \"overview\" enables overview tracing.'\n )\n .choices(['all', 'overview'])\n .preset('all')\n )\n .action(\n (directory: string, options: NextDevOptions, { _optionValueSources }) => {\n if (options.experimentalNextConfigStripTypes) {\n process.env.__NEXT_NODE_NATIVE_TS_LOADER_ENABLED = 'true'\n }\n if (options.experimentalCpuProf) {\n process.env.NEXT_CPU_PROF = '1'\n process.env.__NEXT_PRIVATE_CPU_PROFILE = 'dev-main'\n const { join } = require('path') as typeof import('path')\n const dir = directory || process.cwd()\n const cpuProfileDir = join(dir, '.next-profiles')\n mkdirSync(cpuProfileDir, { recursive: true })\n process.env.NEXT_CPU_PROF_DIR = cpuProfileDir\n }\n if (options.internalTrace) {\n process.env.NEXT_TURBOPACK_TRACING =\n options.internalTrace === 'all'\n ? 'turbo-tasks'\n : String(options.internalTrace)\n }\n const portSource = _optionValueSources.port\n import('../cli/next-dev.js').then((mod) =>\n mod.nextDev(options, portSource, directory)\n )\n }\n )\n .usage('[directory] [options]')\n\nprogram\n .command('export', { hidden: true })\n .action(() => import('../cli/next-export.js').then((mod) => mod.nextExport()))\n .helpOption(false)\n\nprogram\n .command('info')\n .description(\n 'Prints relevant details about the current system which can be used to report Next.js bugs.'\n )\n .addHelpText(\n 'after',\n `\\nLearn more: ${cyan('https://nextjs.org/docs/api-reference/cli#info')}`\n )\n .option('--verbose', 'Collects additional information for debugging.')\n .action((options: NextInfoOptions) =>\n import('../cli/next-info.js').then((mod) => mod.nextInfo(options))\n )\n\nprogram\n .command('start')\n .description(\n 'Starts Next.js in production mode. The application should be compiled with `next build` first.'\n )\n .argument(\n '[directory]',\n `A directory on which to start the application. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .addOption(\n new Option(\n '-p, --port <port>',\n 'Specify a port number on which to start the application.'\n )\n .argParser(parseValidPositiveInteger)\n .default(3000)\n .env('PORT')\n )\n .option(\n '-H, --hostname <hostname>',\n 'Specify a hostname on which to start the application (default: 0.0.0.0).'\n )\n .addOption(\n new Option(\n '--inspect [[host:]port]',\n 'Allows inspecting server-side code. See https://nextjs.org/docs/app/guides/debugging#server-side-code'\n ).argParser(parseValidInspectAddress)\n )\n .addOption(\n new Option(\n '--keepAliveTimeout <keepAliveTimeout>',\n 'Specify the maximum amount of milliseconds to wait before closing inactive connections.'\n ).argParser(parseValidPositiveInteger)\n )\n .option(\n '--experimental-next-config-strip-types',\n 'Use Node.js native TypeScript resolution for next.config.(ts|mts)'\n )\n .option(\n '--experimental-cpu-prof',\n 'Enable CPU profiling. Profiles are saved to .next-profiles/ on exit.'\n )\n .action((directory: string, options: NextStartOptions) => {\n if (options.experimentalNextConfigStripTypes) {\n process.env.__NEXT_NODE_NATIVE_TS_LOADER_ENABLED = 'true'\n }\n if (options.experimentalCpuProf) {\n process.env.NEXT_CPU_PROF = '1'\n process.env.__NEXT_PRIVATE_CPU_PROFILE = 'start-main'\n const { join } = require('path') as typeof import('path')\n const dir = directory || process.cwd()\n const cpuProfileDir = join(dir, '.next-profiles')\n mkdirSync(cpuProfileDir, { recursive: true })\n process.env.NEXT_CPU_PROF_DIR = cpuProfileDir\n }\n return import('../cli/next-start.js').then((mod) =>\n mod.nextStart(options, directory)\n )\n })\n .usage('[directory] [options]')\n\nprogram\n .command('telemetry')\n .description(\n `Allows you to enable or disable Next.js' ${bold(\n 'completely anonymous'\n )} telemetry collection.`\n )\n .addArgument(new Argument('[arg]').choices(['disable', 'enable', 'status']))\n .addHelpText('after', `\\nLearn more: ${cyan('https://nextjs.org/telemetry')}`)\n .addOption(\n new Option('--enable', `Enables Next.js' telemetry collection.`).conflicts(\n 'disable'\n )\n )\n .option('--disable', `Disables Next.js' telemetry collection.`)\n .action((arg: string, options: NextTelemetryOptions) =>\n import('../cli/next-telemetry.js').then((mod) =>\n mod.nextTelemetry(options, arg)\n )\n )\n\nprogram\n .command('typegen')\n .description(\n 'Generate TypeScript definitions for routes, pages, and layouts without running a full build.'\n )\n .argument(\n '[directory]',\n `A directory on which to generate types. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .option('--webpack', 'Use webpack when validating next.config.js')\n .action((directory: string, options: NextTypegenOptions) =>\n // ensure process exits after typegen completes so open handles/connections\n // don't cause process to hang\n import('../cli/next-typegen.js').then((mod) =>\n mod\n .nextTypegen(options, directory)\n .then(() => process.exit(0))\n .catch((err: unknown) => {\n // Without this, a failed typegen (e.g. `next.config` throwing) is\n // swallowed as an unhandled rejection that exits 0; surface it with a\n // non-zero exit so `next typegen && tsc` halts instead of running\n // against missing route types.\n console.error(\n '\\n> Unexpected error while generating route types. Original error:\\n'\n )\n console.error(err)\n process.exit(1)\n })\n )\n )\n .usage('[directory] [options]')\n\nconst nextVersion = process.env.__NEXT_VERSION || 'unknown'\nprogram\n .command('upgrade')\n .description(\n 'Upgrade Next.js apps to desired versions with a single command.'\n )\n .argument(\n '[directory]',\n `A Next.js project directory to upgrade. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .usage('[directory] [options]')\n .option(\n '--revision <revision>',\n 'Specify the target Next.js version using an NPM dist tag (e.g. \"latest\", \"canary\", \"rc\", \"beta\") or an exact version number (e.g. \"15.0.0\").',\n nextVersion.includes('-canary.')\n ? 'canary'\n : nextVersion.includes('-rc.')\n ? 'rc'\n : nextVersion.includes('-beta.')\n ? 'beta'\n : 'latest'\n )\n .option('--verbose', 'Verbose output', false)\n .action(async (directory, options) => {\n const mod = await import('../cli/next-upgrade.js')\n mod.spawnNextUpgrade(directory, options)\n })\n\nprogram\n .command('experimental-test')\n .description(\n `Execute \\`next/experimental/testmode\\` tests using a specified test runner. The test runner defaults to 'playwright' if the \\`experimental.defaultTestRunner\\` configuration option or the \\`--test-runner\\` option are not set.`\n )\n .argument(\n '[directory]',\n `A Next.js project directory to execute the test runner on. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .argument(\n '[test-runner-args...]',\n 'Any additional arguments or options to pass down to the test runner `test` command.'\n )\n .option(\n '--test-runner [test-runner]',\n `Any supported test runner. Options: ${bold(\n SUPPORTED_TEST_RUNNERS_LIST.join(', ')\n )}. ${italic(\n \"If no test runner is provided, the Next.js config option `experimental.defaultTestRunner`, or 'playwright' will be used.\"\n )}`\n )\n .allowUnknownOption()\n .action(\n (directory: string, testRunnerArgs: string[], options: NextTestOptions) => {\n return import('../cli/next-test.js').then((mod) => {\n mod.nextTest(directory, testRunnerArgs, options)\n })\n }\n )\n .usage('[directory] [options]')\n\nconst internal = program\n .command('internal')\n .description(\n 'Internal debugging commands. Use with caution. Not covered by semver.'\n )\n\ninternal\n .command('trace')\n .alias('turbo-trace-server')\n .argument('file', 'Trace file to serve.')\n .addOption(\n new Option('-p, --port <port>', 'Override the port.').argParser(\n parseValidPositiveInteger\n )\n )\n .addOption(\n new Option(\n '--mcp-port <mcpPort>',\n 'Port for the MCP (Model Context Protocol) server. Defaults to --port + 1.'\n ).argParser(parseValidPositiveInteger)\n )\n .action(\n (\n file: string,\n options: { port: number | undefined; mcpPort: number | undefined }\n ) => {\n return import('../cli/internal/turbo-trace-server.js').then((mod) =>\n mod.startTurboTraceServerCli(file, options.port, options.mcpPort)\n )\n }\n )\n\ninternal\n .command('query-trace')\n .description(\n 'Query a running turbopack trace server (started with `next internal trace --mcp-port <port>`).'\n )\n .addOption(\n new Option(\n '--port <port>',\n 'MCP port of the running trace server. Defaults to 5748.'\n ).argParser(parseValidPositiveInteger)\n )\n .addOption(\n new Option(\n '--parent <parent>',\n 'Span ID to enumerate children of. Omit for root level.'\n )\n )\n .addOption(\n new Option(\n '--no-aggregated',\n 'Disable aggregation of spans by name (aggregated by default).'\n )\n )\n .addOption(\n new Option(\n '--sort <mode>',\n 'Sort mode: \"value\" for corrected duration descending, \"name\" for alphabetical.'\n ).choices(['value', 'name'])\n )\n .addOption(\n new Option('--search <search>', 'Substring filter on span name/category.')\n )\n .addOption(new Option('--json', 'Output as JSON instead of markdown.'))\n .addOption(\n new Option('--page <page>', 'Page number (1-based, default 1).').argParser(\n parseValidPositiveInteger\n )\n )\n .addHelpText('after', ({ command }) => {\n const port = (command.opts() as { port?: number }).port ?? 5748\n return `\\nExample:\\n next internal query-trace --port ${port} --parent <id>`\n })\n .action((options) =>\n import('../cli/internal/query-trace.js').then((mod) =>\n mod.queryTraceCli(options)\n )\n )\n\ninternal\n .command('post-build')\n .description(\n 'Runs post-build optimization steps (e.g. Turbopack database compaction).'\n )\n .argument(\n '[directory]',\n `A directory on which to run post-build steps. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .action((directory: string, options: NextPostBuildOptions) => {\n return (\n require('../cli/next-post-build.js') as typeof import('../cli/next-post-build.js')\n )\n .nextPostBuild(options, directory)\n .then(() => process.exit(0))\n })\n .usage('[directory] [options]')\n\ninternal\n .command('upload-trace')\n .description(\n 'Upload CPU profiles from .next-profiles/ to Vercel Blob storage.'\n )\n .argument(\n '[directory]',\n `The project directory containing .next-profiles/. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .action((directory: string) => {\n return import('../cli/internal/upload-trace.js').then((mod) =>\n mod.uploadTraceToBlob({ directory })\n )\n })\n .usage('[directory] [options]')\n\ninternal\n .command('static-routes-info')\n .description(\n 'Analyze a built Next.js app and report per-route bundle sizes across server bundled JS, server source maps, server unbundled, client JS, client source maps, and client CSS categories.'\n )\n .argument(\n '[directory]',\n `A directory containing the built Next.js application. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .option('--json', 'Output as JSON instead of markdown.')\n .option(\n '--limit <n>',\n 'Only show the first N routes after sorting (totals always reflect all routes).',\n parseInt\n )\n .option(\n '--sort <key>',\n 'Sort routes by: name (default, ascending), or one of client, client-js, client-css, client-map, server, server-bundled-js, server-unbundled, server-map, total (descending).'\n )\n .option(\n '--files',\n 'Include the list of files (relative to the output directory) per category in the JSON output. Requires --json.'\n )\n .action(\n (\n directory: string,\n options: {\n json?: boolean\n limit?: number\n sort?: string\n files?: boolean\n }\n ) => {\n return import('../cli/internal/static-routes-info.js').then((mod) =>\n mod.staticRoutesInfoCli(options, directory)\n )\n }\n )\n .usage('[directory] [options]')\n\nprogram.parse(process.argv)\n"],"names":["process","env","NEXT_RSPACK","RSPACK_CONFIG_VALIDATE","semver","satisfies","versions","node","__NEXT_REQUIRED_NODE_VERSION_RANGE","includePrerelease","console","error","exit","NEXT_PRIVATE_START_TIME","Date","now","toString","dependency","require","resolve","err","warn","NextRootCommand","Command","createCommand","name","command","hook","event","commandName","defaultEnv","standardEnv","NODE_ENV","isNotStandard","includes","shouldWarnCommands","NON_STANDARD_NODE_ENV","NEXT_RUNTIME","platform","arch","os","cpus","some","cpu","model","getOptionValue","parseValidInspectAddress","value","address","getParsedDebugAddress","Number","isNaN","port","InvalidArgumentError","program","description","configureHelp","formatHelp","cmd","helper","formatCliHelpOutput","subcommandTerm","usage","helpCommand","helpOption","version","__NEXT_VERSION","argument","italic","option","addOption","Option","choices","default","preset","action","directory","options","debugPrerender","experimentalNextConfigStripTypes","__NEXT_NODE_NATIVE_TS_LOADER_ENABLED","experimentalCpuProf","NEXT_CPU_PROF","__NEXT_PRIVATE_CPU_PROFILE","join","dir","cwd","cpuProfileDir","mkdirSync","recursive","NEXT_CPU_PROF_DIR","internalTrace","NEXT_TURBOPACK_TRACING","String","then","mod","nextBuild","saveCpuProfile","implies","serve","argParser","parseValidPositiveInteger","nextAnalyze","output","isDefault","undefined","hideHelp","_optionValueSources","portSource","nextDev","hidden","nextExport","addHelpText","cyan","nextInfo","nextStart","bold","addArgument","Argument","conflicts","arg","nextTelemetry","nextTypegen","catch","nextVersion","spawnNextUpgrade","SUPPORTED_TEST_RUNNERS_LIST","allowUnknownOption","testRunnerArgs","nextTest","internal","alias","file","startTurboTraceServerCli","mcpPort","opts","queryTraceCli","nextPostBuild","uploadTraceToBlob","parseInt","staticRoutesInfoCli","parse","argv"],"mappings":";;;;;QAEO;2DAEQ;2BAMR;qBAEc;+DACF;4BACgB;qCACC;2BACE;uBAK/B;0BAIA;oBASmB;;;;;;AAE1B,IAAIA,QAAQC,GAAG,CAACC,WAAW,EAAE;IAC3B,+BAA+B;IAC/BF,QAAQC,GAAG,CAACE,sBAAsB,GAAG;AACvC;AAEA,IACE,CAACC,eAAM,CAACC,SAAS,CACfL,QAAQM,QAAQ,CAACC,IAAI,EACrBP,QAAQC,GAAG,CAACO,kCAAkC,EAC9C;IAAEC,mBAAmB;AAAK,IAE5B;IACAC,QAAQC,KAAK,CACX,CAAC,sBAAsB,EAAEX,QAAQM,QAAQ,CAACC,IAAI,CAAC,gCAAgC,EAAEP,QAAQC,GAAG,CAACO,kCAAkC,CAAC,cAAc,CAAC;IAEjJR,QAAQY,IAAI,CAAC;AACf;AAEAZ,QAAQC,GAAG,CAACY,uBAAuB,GAAGC,KAA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ACCkD,KAAK,CAAC;AAEToE,SACGxG,OAAO,CAAC,gBACR6B,WAAW,CACV,oEAEDY,QAAQ,CACP,eACA,CAAC,kDAAkD,EAAEC,IAAAA,kBAAM,EACzD,qEACC,EAEJO,MAAM,CAAC,CAACC;IACP,OAAO,MAAM,CAAC,mCAAmCkB,IAAI,CAAC,CAACC,MACrDA,IAAI2C,iBAAiB,CAAC;YAAE9D;QAAU;AAEtC,GACCd,KAAK,CAAC;AAEToE,SACGxG,OAAO,CAAC,sBACR6B,WAAW,CACV,2LAEDY,QAAQ,CACP,eACA,CAAC,sDAAsD,EAAEC,IAAAA,kBAAM,EAC7D,qEACC,EAEJC,MAAM,CAAC,UAAU,uCACjBA,MAAM,CACL,eACA,kFACAsE,UAEDtE,MAAM,CACL,gBACA,gLAEDA,MAAM,CACL,WACA,kHAEDM,MAAM,CACL,CACEC,WACAC;IAOA,OAAO,MAAM,CAAC,yCAAyCiB,IAAI,CAAC,CAACC,MAC3DA,IAAI6C,mBAAmB,CAAC/D,SAASD;AAErC,GAEDd,KAAK,CAAC;AAETR,QAAQuF,KAAK,CAAC7I,QAAQ8I,IAAI","ignoreList":[0]} |
@@ -173,7 +173,6 @@ "use strict"; | ||
| // `next-instrumentation-client-loader` (registered via a | ||
| // `module.rules` entry in webpack-config.ts). The emitted module | ||
| // requires each `instrumentationClientInject` entry for side effects, | ||
| // then re-exports the user's `instrumentation-client.{pageExt}` file | ||
| // (resolved through the `private-next-instrumentation-client-user` | ||
| // alias below). | ||
| // `module.rules` entry in webpack-config.ts). The emitted module lists | ||
| // each configured instrumentation module, followed by the user's | ||
| // `instrumentation-client.{pageExt}` file (resolved through the | ||
| // `private-next-instrumentation-client-user` alias below). | ||
| 'private-next-instrumentation-client': INSTRUMENTATION_CLIENT_STUB_PATH, | ||
@@ -180,0 +179,0 @@ 'private-next-instrumentation-client-user': [ |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/build/create-compiler-aliases.ts"],"sourcesContent":["import path from 'path'\nimport * as React from 'react'\nimport {\n DOT_NEXT_ALIAS,\n PAGES_DIR_ALIAS,\n ROOT_DIR_ALIAS,\n APP_DIR_ALIAS,\n RSC_ACTION_PROXY_ALIAS,\n RSC_ACTION_CLIENT_WRAPPER_ALIAS,\n RSC_ACTION_VALIDATE_ALIAS,\n RSC_ACTION_ENCRYPTION_ALIAS,\n RSC_CACHE_WRAPPER_ALIAS,\n type WebpackLayerName,\n RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS,\n} from '../lib/constants'\nimport type { NextConfigComplete } from '../server/config-shared'\nimport { defaultOverrides } from '../server/require-hook'\nimport { hasExternalOtelApiPackage } from './webpack-config'\nimport { NEXT_PROJECT_ROOT } from './next-dir-paths'\nimport { shouldUseReactServerCondition } from './utils'\n\ninterface CompilerAliases {\n [alias: string]: string | string[]\n}\n\nconst isReact19 = typeof React.use === 'function'\n\n/**\n * Absolute path to the placeholder file that `private-next-instrumentation-client`\n * resolves to. Its contents are replaced at build time by\n * `next-instrumentation-client-loader` via a `module.rules` entry in\n * `webpack-config.ts`.\n */\nconst INSTRUMENTATION_CLIENT_STUB_PATH = path.join(\n NEXT_PROJECT_ROOT,\n 'dist/build/webpack/loaders/instrumentation-client-stub.js'\n)\n\nexport function createWebpackAliases({\n distDir,\n isClient,\n isEdgeServer,\n dev,\n config,\n pagesDir,\n appDir,\n dir,\n reactProductionProfiling,\n}: {\n distDir: string\n isClient: boolean\n isEdgeServer: boolean\n dev: boolean\n config: NextConfigComplete\n pagesDir: string | undefined\n appDir: string | undefined\n dir: string\n reactProductionProfiling: boolean\n}): CompilerAliases {\n const pageExtensions = config.pageExtensions\n const customAppAliases: CompilerAliases = {}\n const customDocumentAliases: CompilerAliases = {}\n\n // tell webpack where to look for _app and _document\n // using aliases to allow falling back to the default\n // version when removed or not present\n if (dev) {\n const nextDistPath = 'next/dist/' + (isEdgeServer ? 'esm/' : '')\n customAppAliases[`${PAGES_DIR_ALIAS}/_app`] = [\n ...(pagesDir\n ? pageExtensions.reduce((prev, ext) => {\n prev.push(path.join(pagesDir, `_app.${ext}`))\n return prev\n }, [] as string[])\n : []),\n `${nextDistPath}pages/_app.js`,\n ]\n customAppAliases[`${PAGES_DIR_ALIAS}/_error`] = [\n ...(pagesDir\n ? pageExtensions.reduce((prev, ext) => {\n prev.push(path.join(pagesDir, `_error.${ext}`))\n return prev\n }, [] as string[])\n : []),\n `${nextDistPath}pages/_error.js`,\n ]\n customDocumentAliases[`${PAGES_DIR_ALIAS}/_document`] = [\n ...(pagesDir\n ? pageExtensions.reduce((prev, ext) => {\n prev.push(path.join(pagesDir, `_document.${ext}`))\n return prev\n }, [] as string[])\n : []),\n `${nextDistPath}pages/_document.js`,\n ]\n }\n\n return {\n '@vercel/og$': 'next/dist/server/og/image-response',\n\n // Avoid bundling both entrypoints in React 19 when we just need one.\n // Also avoids bundler warnings in React 18 where react-dom/server.edge doesn't exist.\n 'next/dist/server/ReactDOMServerPages': isReact19\n ? 'react-dom/server.edge'\n : 'react-dom/server.browser',\n\n // Alias next/dist imports to next/dist/esm assets,\n // let this alias hit before `next` alias.\n ...(isEdgeServer\n ? {\n 'next/dist/api': 'next/dist/esm/api',\n 'next/dist/build': 'next/dist/esm/build',\n 'next/dist/client': 'next/dist/esm/client',\n 'next/dist/shared': 'next/dist/esm/shared',\n 'next/dist/pages': 'next/dist/esm/pages',\n 'next/dist/lib': 'next/dist/esm/lib',\n 'next/dist/server': 'next/dist/esm/server',\n\n ...createNextApiEsmAliases(),\n }\n : undefined),\n\n // For RSC server bundle\n ...(!hasExternalOtelApiPackage() && {\n '@opentelemetry/api': 'next/dist/compiled/@opentelemetry/api',\n }),\n\n ...(config.images.loaderFile\n ? {\n 'next/dist/shared/lib/image-loader': config.images.loaderFile,\n ...(isEdgeServer && {\n 'next/dist/esm/shared/lib/image-loader': config.images.loaderFile,\n }),\n }\n : undefined),\n\n 'styled-jsx/style$': defaultOverrides['styled-jsx/style'],\n 'styled-jsx$': defaultOverrides['styled-jsx'],\n\n 'next/dist/compiled/next-devtools': isClient\n ? 'next/dist/compiled/next-devtools'\n : 'next/dist/next-devtools/dev-overlay.shim.js',\n\n ...customAppAliases,\n ...customDocumentAliases,\n\n ...(pagesDir ? { [PAGES_DIR_ALIAS]: pagesDir } : {}),\n ...(appDir ? { [APP_DIR_ALIAS]: appDir } : {}),\n [ROOT_DIR_ALIAS]: dir,\n ...(isClient\n ? {\n // `private-next-instrumentation-client` resolves to a placeholder\n // file whose contents are replaced at build time by\n // `next-instrumentation-client-loader` (registered via a\n // `module.rules` entry in webpack-config.ts). The emitted module\n // requires each `instrumentationClientInject` entry for side effects,\n // then re-exports the user's `instrumentation-client.{pageExt}` file\n // (resolved through the `private-next-instrumentation-client-user`\n // alias below).\n 'private-next-instrumentation-client':\n INSTRUMENTATION_CLIENT_STUB_PATH,\n 'private-next-instrumentation-client-user': [\n path.join(dir, 'src', 'instrumentation-client'),\n path.join(dir, 'instrumentation-client'),\n 'private-next-empty-module',\n ],\n\n // disable typechecker, webpack5 allows aliases to be set to false to create a no-op module\n 'private-next-empty-module': false as any,\n }\n : {}),\n\n [DOT_NEXT_ALIAS]: distDir,\n ...(isClient || isEdgeServer ? getOptimizedModuleAliases() : {}),\n ...(reactProductionProfiling ? getReactProfilingInProduction() : {}),\n\n [RSC_ACTION_VALIDATE_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/action-validate',\n\n [RSC_ACTION_CLIENT_WRAPPER_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/action-client-wrapper',\n\n [RSC_ACTION_PROXY_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/server-reference',\n\n [RSC_ACTION_ENCRYPTION_ALIAS]: 'next/dist/server/app-render/encryption',\n\n [RSC_CACHE_WRAPPER_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/cache-wrapper',\n [RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/track-dynamic-import',\n\n '@swc/helpers/_': path.join(\n path.dirname(require.resolve('@swc/helpers/package.json')),\n '_'\n ),\n\n setimmediate: 'next/dist/compiled/setimmediate',\n }\n}\n\nexport function createServerOnlyClientOnlyAliases(\n isServer: boolean\n): CompilerAliases {\n return isServer\n ? {\n 'server-only$': 'next/dist/compiled/server-only/empty',\n 'client-only$': 'next/dist/compiled/client-only/error',\n 'next/dist/compiled/server-only$':\n 'next/dist/compiled/server-only/empty',\n 'next/dist/compiled/client-only$':\n 'next/dist/compiled/client-only/error',\n }\n : {\n 'server-only$': 'next/dist/compiled/server-only/index',\n 'client-only$': 'next/dist/compiled/client-only/index',\n 'next/dist/compiled/client-only$':\n 'next/dist/compiled/client-only/index',\n 'next/dist/compiled/server-only':\n 'next/dist/compiled/server-only/index',\n }\n}\n\nexport function createNextApiEsmAliases() {\n const mapping = {\n error: 'next/dist/api/error',\n head: 'next/dist/api/head',\n image: 'next/dist/api/image',\n constants: 'next/dist/api/constants',\n router: 'next/dist/api/router',\n dynamic: 'next/dist/api/dynamic',\n script: 'next/dist/api/script',\n link: 'next/dist/api/link',\n form: 'next/dist/api/form',\n navigation: 'next/dist/api/navigation',\n headers: 'next/dist/api/headers',\n og: 'next/dist/api/og',\n server: 'next/dist/api/server',\n // pages api\n document: 'next/dist/api/document',\n app: 'next/dist/api/app',\n }\n const aliasMap: Record<string, string> = {}\n // Handle fully specified imports like `next/image.js`\n for (const [key, value] of Object.entries(mapping)) {\n const nextApiFilePath = path.join(NEXT_PROJECT_ROOT, key)\n aliasMap[nextApiFilePath + '.js'] = value\n }\n\n return aliasMap\n}\n\nexport function createAppRouterApiAliases(isServerOnlyLayer: boolean) {\n const mapping: Record<string, string> = {\n head: 'next/dist/client/components/noop-head',\n dynamic: 'next/dist/api/app-dynamic',\n link: 'next/dist/client/app-dir/link',\n form: 'next/dist/client/app-dir/form',\n }\n\n if (isServerOnlyLayer) {\n mapping['error'] = 'next/dist/api/error.react-server'\n mapping['navigation'] = 'next/dist/api/navigation.react-server'\n mapping['link'] = 'next/dist/client/app-dir/link.react-server'\n }\n\n const aliasMap: Record<string, string> = {}\n for (const [key, value] of Object.entries(mapping)) {\n const nextApiFilePath = path.join(NEXT_PROJECT_ROOT, key)\n aliasMap[nextApiFilePath + '.js'] = value\n }\n return aliasMap\n}\n\n// file:///./../compiled/react/package.json\ntype ReactEntrypoint = 'jsx-runtime' | 'jsx-dev-runtime' | 'compiler-runtime'\n// file:///./../compiled/react-dom/package.json\ntype ReactDOMEntrypoint =\n | 'client'\n | 'server'\n | 'server.edge'\n | 'server.browser'\n // TODO: server.node\n | 'static'\n | 'static.browser'\n | 'static.edge'\n// TODO: static.node\n\n// file:///./../compiled/react-server-dom-webpack/package.json\ntype ReactServerDOMWebpackEntrypoint =\n | 'client'\n // TODO: client.browser\n // TODO: client.edge\n // TODO: client.node\n | 'server'\n // TODO: server.browser\n // TODO: server.edge\n | 'server.node'\n | 'static'\n// TODO: static.browser\n// TODO: static.edge\n// TODO: static.node\n\ntype ReactPackagesEntryPoint =\n | 'react'\n | `react/${ReactEntrypoint}`\n | 'react-dom'\n | `react-dom/${ReactDOMEntrypoint}`\n | `react-server-dom-webpack/${ReactServerDOMWebpackEntrypoint}`\n\ntype BundledReactChannel = '' | '-experimental'\n\ntype ReactAliases = {\n [K in `${ReactPackagesEntryPoint}$`]: string\n} & {\n // Edge Runtime does not use next-server runtime.\n // This means we rely on rewritten import sources in compiled React.\n // We need to alias those rewritten import sources.\n [K in\n | `next/dist/compiled/react${BundledReactChannel}$`\n | `next/dist/compiled/react${BundledReactChannel}/${ReactEntrypoint}$`\n | `next/dist/compiled/react-dom${BundledReactChannel}$`]?: string\n}\n\nexport function createVendoredReactAliases(\n bundledReactChannel: BundledReactChannel,\n {\n layer,\n isBrowser,\n isEdgeServer,\n reactProductionProfiling,\n }: {\n layer: WebpackLayerName\n isBrowser: boolean\n isEdgeServer: boolean\n reactProductionProfiling: boolean\n }\n): CompilerAliases {\n const environmentCondition = isBrowser\n ? 'browser'\n : isEdgeServer\n ? 'edge'\n : 'nodejs'\n const reactCondition = shouldUseReactServerCondition(layer)\n ? 'server'\n : 'client'\n\n // ✅ Correct alias\n // ❌ Incorrect alias i.e. importing this entrypoint should throw an error.\n // ❔ Alias that may produce correct code in certain conditions.Keep until react-markup is available.\n\n let reactAlias: ReactAliases\n if (environmentCondition === 'browser' && reactCondition === 'client') {\n // prettier-ignore\n reactAlias = {\n // file:///./../compiled/react/package.json\n react$: /* ✅ */ `next/dist/compiled/react${bundledReactChannel}`,\n 'react/compiler-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/compiler-runtime`,\n 'react/jsx-dev-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime`,\n 'react/jsx-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/jsx-runtime`,\n // file:///./../compiled/react-dom/package.json\n 'react-dom$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}`,\n 'react-dom/client$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/client`,\n 'react-dom/server$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n 'react-dom/server.browser$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n // optimizations to ignore the legacy build of react-dom/server in `server.edge` build\n 'react-dom/server.edge$': /* ❌ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/static$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.browser$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.edge$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n // file:///./../compiled/react-server-dom-webpack/package.json\n 'react-server-dom-webpack/client$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client.browser`,\n 'react-server-dom-webpack/server$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.browser`,\n 'react-server-dom-webpack/server.node$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.node`,\n 'react-server-dom-webpack/static$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/static.browser`,\n }\n } else if (\n environmentCondition === 'browser' &&\n reactCondition === 'server'\n ) {\n // prettier-ignore\n reactAlias = {\n // file:///./../compiled/react/package.json\n react$: /* ❌ */ `next/dist/compiled/react${bundledReactChannel}`,\n 'react/compiler-runtime$': /* ❌ */ `next/dist/compiled/react${bundledReactChannel}/compiler-runtime`,\n 'react/jsx-dev-runtime$': /* ❌ */ `next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime`,\n 'react/jsx-runtime$': /* ❌ */ `next/dist/compiled/react${bundledReactChannel}/jsx-runtime`,\n // file:///./../compiled/react-dom/package.json\n 'react-dom$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}`,\n 'react-dom/client$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/client`,\n 'react-dom/server$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n 'react-dom/server.browser$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n // optimizations to ignore the legacy build of react-dom/server in `server.edge` build\n 'react-dom/server.edge$': /* ❌ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/static$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.browser$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.edge$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n // file:///./../compiled/react-server-dom-webpack/package.json\n 'react-server-dom-webpack/client$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client.browser`,\n 'react-server-dom-webpack/server$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.browser`,\n 'react-server-dom-webpack/server.node$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.node`,\n 'react-server-dom-webpack/static$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/static.browser`,\n }\n } else if (environmentCondition === 'nodejs' && reactCondition === 'client') {\n // prettier-ignore\n reactAlias = {\n // file:///./../compiled/react/package.json\n react$: /* ✅ */ `next/dist/server/route-modules/app-page/vendored/ssr/react`,\n 'react/compiler-runtime$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/ssr/react-compiler-runtime`,\n 'react/jsx-dev-runtime$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-dev-runtime`,\n 'react/jsx-runtime$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime`,\n // file:///./../compiled/react-dom/package.json\n 'react-dom$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/ssr/react-dom`,\n 'react-dom/client$': /* ❔ */ `next/dist/compiled/react-dom${bundledReactChannel}/client`,\n 'react-dom/server$': /* ❔ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.node`,\n 'react-dom/server.browser$': /* ❔ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n // optimizations to ignore the legacy build of react-dom/server in `server.edge` build\n 'react-dom/server.edge$': /* ✅ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/static$': /* ❔ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.node`,\n 'react-dom/static.browser$': /* ❔ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.edge$': /* ❔ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n // file:///./../compiled/react-server-dom-webpack/package.json\n 'react-server-dom-webpack/client$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/ssr/react-server-dom-webpack-client`,\n 'react-server-dom-webpack/server$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.node`,\n 'react-server-dom-webpack/server.node$':/* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.node`,\n 'react-server-dom-webpack/static$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/static.node`,\n }\n } else if (environmentCondition === 'nodejs' && reactCondition === 'server') {\n // prettier-ignore\n reactAlias = {\n // file:///./../compiled/react/package.json\n react$: /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react`,\n 'react/compiler-runtime$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react-compiler-runtime`,\n 'react/jsx-dev-runtime$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-dev-runtime`,\n 'react/jsx-runtime$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime`,\n // file:///./../compiled/react-dom/package.json\n 'react-dom$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react-dom`,\n 'react-dom/client$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/client`,\n 'react-dom/server$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.node`,\n 'react-dom/server.browser$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n // optimizations to ignore the legacy build of react-dom/server in `server.edge` build\n 'react-dom/server.edge$': /* ❌ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/static$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.node`,\n 'react-dom/static.browser$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.edge$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n // file:///./../compiled/react-server-dom-webpack/package.json\n 'react-server-dom-webpack/client$': /* ❔ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client.node`,\n 'react-server-dom-webpack/server$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-webpack-server`,\n 'react-server-dom-webpack/server.node$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-webpack-server`,\n 'react-server-dom-webpack/static$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-webpack-static`,\n }\n } else if (environmentCondition === 'edge' && reactCondition === 'client') {\n // prettier-ignore\n reactAlias = {\n // file:///./../compiled/react/package.json\n react$: /* ✅ */ `next/dist/compiled/react${bundledReactChannel}`,\n 'react/compiler-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/compiler-runtime`,\n 'react/jsx-dev-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime`,\n 'react/jsx-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/jsx-runtime`,\n // file:///./../compiled/react-dom/package.json\n 'react-dom$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}`,\n 'react-dom/client$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/client`,\n 'react-dom/server$': /* ✅ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/server.browser$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n // optimizations to ignore the legacy build of react-dom/server in `server.edge` build\n 'react-dom/server.edge$': /* ✅ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/static$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n 'react-dom/static.browser$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.edge$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n // file:///./../compiled/react-server-dom-webpack/package.json\n 'react-server-dom-webpack/client$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client.edge`,\n 'react-server-dom-webpack/server$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.edge`,\n 'react-server-dom-webpack/server.node$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.node`,\n 'react-server-dom-webpack/static$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/static.edge`,\n }\n } else if (environmentCondition === 'edge' && reactCondition === 'server') {\n // prettier-ignore\n reactAlias = {\n // file:///./../compiled/react/package.json\n react$: /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/react.react-server`,\n 'react/compiler-runtime$': /* ❌ */ `next/dist/compiled/react${bundledReactChannel}/compiler-runtime`,\n 'react/jsx-dev-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime.react-server`,\n 'react/jsx-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/jsx-runtime.react-server`,\n // file:///./../compiled/react-dom/package.json\n 'react-dom$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/react-dom.react-server`,\n 'react-dom/client$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/client`,\n 'react-dom/server$': /* ❌ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/server.browser$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n // optimizations to ignore the legacy build of react-dom/server in `server.edge` build\n 'react-dom/server.edge$': /* ❌ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/static$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n 'react-dom/static.browser$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.edge$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n // file:///./../compiled/react-server-dom-webpack/package.json\n 'react-server-dom-webpack/client$': /* ❔ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client.edge`,\n 'react-server-dom-webpack/server$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.edge`,\n 'react-server-dom-webpack/server.node$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.node`,\n 'react-server-dom-webpack/static$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/static.edge`,\n }\n\n // prettier-ignore\n reactAlias[`next/dist/compiled/react${bundledReactChannel}$` ] = reactAlias[`react$`]\n // prettier-ignore\n reactAlias[`next/dist/compiled/react${bundledReactChannel}/compiler-runtime$`] = reactAlias[`react/compiler-runtime$`]\n // prettier-ignore\n reactAlias[`next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime$` ] = reactAlias[`react/jsx-dev-runtime$`]\n // prettier-ignore\n reactAlias[`next/dist/compiled/react${bundledReactChannel}/jsx-runtime$` ] = reactAlias[`react/jsx-runtime$`]\n // prettier-ignore\n reactAlias[`next/dist/compiled/react-dom${bundledReactChannel}$` ] = reactAlias[`react-dom$`]\n } else {\n throw new Error(\n `Unsupported environment condition \"${environmentCondition}\" and react condition \"${reactCondition}\". This is a bug in Next.js.`\n )\n }\n\n if (reactProductionProfiling) {\n reactAlias['react-dom/client$'] =\n `next/dist/compiled/react-dom${bundledReactChannel}/profiling`\n }\n\n const alias: CompilerAliases = reactAlias\n\n alias[\n '@vercel/turbopack-ecmascript-runtime/browser/dev/hmr-client/hmr-client.ts'\n ] = `next/dist/client/dev/noop-turbopack-hmr`\n\n return alias\n}\n\n// Insert aliases for Next.js stubs of fetch, object-assign, and url\n// Keep in sync with insert_optimized_module_aliases in import_map.rs\nexport function getOptimizedModuleAliases(): CompilerAliases {\n return {\n unfetch: require.resolve('next/dist/build/polyfills/fetch/index.js'),\n 'isomorphic-unfetch': require.resolve(\n 'next/dist/build/polyfills/fetch/index.js'\n ),\n 'whatwg-fetch': require.resolve(\n 'next/dist/build/polyfills/fetch/whatwg-fetch.js'\n ),\n 'object-assign': require.resolve(\n 'next/dist/build/polyfills/object-assign.js'\n ),\n 'object.assign/auto': require.resolve(\n 'next/dist/build/polyfills/object.assign/auto.js'\n ),\n 'object.assign/implementation': require.resolve(\n 'next/dist/build/polyfills/object.assign/implementation.js'\n ),\n 'object.assign/polyfill': require.resolve(\n 'next/dist/build/polyfills/object.assign/polyfill.js'\n ),\n 'object.assign/shim': require.resolve(\n 'next/dist/build/polyfills/object.assign/shim.js'\n ),\n url: require.resolve('next/dist/compiled/native-url'),\n }\n}\n\nfunction getReactProfilingInProduction(): CompilerAliases {\n return {\n 'react-dom/client$': 'react-dom/profiling',\n }\n}\n"],"names":["createAppRouterApiAliases","createNextApiEsmAliases","createServerOnlyClientOnlyAliases","createVendoredReactAliases","createWebpackAliases","getOptimizedModuleAliases","isReact19","React","use","INSTRUMENTATION_CLIENT_STUB_PATH","path","join","NEXT_PROJECT_ROOT","distDir","isClient","isEdgeServer","dev","config","pagesDir","appDir","dir","reactProductionProfiling","pageExtensions","customAppAliases","customDocumentAliases","nextDistPath","PAGES_DIR_ALIAS","reduce","prev","ext","push","undefined","hasExternalOtelApiPackage","images","loaderFile","defaultOverrides","APP_DIR_ALIAS","ROOT_DIR_ALIAS","DOT_NEXT_ALIAS","getReactProfilingInProduction","RSC_ACTION_VALIDATE_ALIAS","RSC_ACTION_CLIENT_WRAPPER_ALIAS","RSC_ACTION_PROXY_ALIAS","RSC_ACTION_ENCRYPTION_ALIAS","RSC_CACHE_WRAPPER_ALIAS","RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS","dirname","require","resolve","setimmediate","isServer","mapping","error","head","image","constants","router","dynamic","script","link","form","navigation","headers","og","server","document","app","aliasMap","key","value","Object","entries","nextApiFilePath","isServerOnlyLayer","bundledReactChannel","layer","isBrowser","environmentCondition","reactCondition","shouldUseReactServerCondition","reactAlias","react$","Error","alias","unfetch","url"],"mappings":";;;;;;;;;;;;;;;;;;;IA4PgBA,yBAAyB;eAA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,qBAEL,CAFK,IAAIE,MACR,CAAC,mCAAmC,EAAEL,qBAAqB,uBAAuB,EAAEC,eAAe,4BAA4B,CAAC,GAD5H,qBAAA;mBAAA;wBAAA;0BAAA;QAEN;IACF;IAEA,IAAIzD,0BAA0B;QAC5B2D,UAAU,CAAC,oBAAoB,GAC7B,CAAC,4BAA4B,EAAEN,oBAAoB,UAAU,CAAC;IAClE;IAEA,MAAMS,QAAyBH;IAE/BG,KAAK,CACH,4EACD,GAAG,CAAC,uCAAuC,CAAC;IAE7C,OAAOA;AACT;AAIO,SAAS9E;IACd,OAAO;QACL+E,SAASrC,QAAQC,OAAO,CAAC;QACzB,sBAAsBD,QAAQC,OAAO,CACnC;QAEF,gBAAgBD,QAAQC,OAAO,CAC7B;QAEF,iBAAiBD,QAAQC,OAAO,CAC9B;QAEF,sBAAsBD,QAAQC,OAAO,CACnC;QAEF,gCAAgCD,QAAQC,OAAO,CAC7C;QAEF,0BAA0BD,QAAQC,OAAO,CACvC;QAEF,sBAAsBD,QAAQC,OAAO,CACnC;QAEFqC,KAAKtC,QAAQC,OAAO,CAAC;IACvB;AACF;AAEA,SAAST;IACP,OAAO;QACL,qBAAqB;IACvB;AACF","ignoreList":[0]} | ||
| {"version":3,"sources":["../../src/build/create-compiler-aliases.ts"],"sourcesContent":["import path from 'path'\nimport * as React from 'react'\nimport {\n DOT_NEXT_ALIAS,\n PAGES_DIR_ALIAS,\n ROOT_DIR_ALIAS,\n APP_DIR_ALIAS,\n RSC_ACTION_PROXY_ALIAS,\n RSC_ACTION_CLIENT_WRAPPER_ALIAS,\n RSC_ACTION_VALIDATE_ALIAS,\n RSC_ACTION_ENCRYPTION_ALIAS,\n RSC_CACHE_WRAPPER_ALIAS,\n type WebpackLayerName,\n RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS,\n} from '../lib/constants'\nimport type { NextConfigComplete } from '../server/config-shared'\nimport { defaultOverrides } from '../server/require-hook'\nimport { hasExternalOtelApiPackage } from './webpack-config'\nimport { NEXT_PROJECT_ROOT } from './next-dir-paths'\nimport { shouldUseReactServerCondition } from './utils'\n\ninterface CompilerAliases {\n [alias: string]: string | string[]\n}\n\nconst isReact19 = typeof React.use === 'function'\n\n/**\n * Absolute path to the placeholder file that `private-next-instrumentation-client`\n * resolves to. Its contents are replaced at build time by\n * `next-instrumentation-client-loader` via a `module.rules` entry in\n * `webpack-config.ts`.\n */\nconst INSTRUMENTATION_CLIENT_STUB_PATH = path.join(\n NEXT_PROJECT_ROOT,\n 'dist/build/webpack/loaders/instrumentation-client-stub.js'\n)\n\nexport function createWebpackAliases({\n distDir,\n isClient,\n isEdgeServer,\n dev,\n config,\n pagesDir,\n appDir,\n dir,\n reactProductionProfiling,\n}: {\n distDir: string\n isClient: boolean\n isEdgeServer: boolean\n dev: boolean\n config: NextConfigComplete\n pagesDir: string | undefined\n appDir: string | undefined\n dir: string\n reactProductionProfiling: boolean\n}): CompilerAliases {\n const pageExtensions = config.pageExtensions\n const customAppAliases: CompilerAliases = {}\n const customDocumentAliases: CompilerAliases = {}\n\n // tell webpack where to look for _app and _document\n // using aliases to allow falling back to the default\n // version when removed or not present\n if (dev) {\n const nextDistPath = 'next/dist/' + (isEdgeServer ? 'esm/' : '')\n customAppAliases[`${PAGES_DIR_ALIAS}/_app`] = [\n ...(pagesDir\n ? pageExtensions.reduce((prev, ext) => {\n prev.push(path.join(pagesDir, `_app.${ext}`))\n return prev\n }, [] as string[])\n : []),\n `${nextDistPath}pages/_app.js`,\n ]\n customAppAliases[`${PAGES_DIR_ALIAS}/_error`] = [\n ...(pagesDir\n ? pageExtensions.reduce((prev, ext) => {\n prev.push(path.join(pagesDir, `_error.${ext}`))\n return prev\n }, [] as string[])\n : []),\n `${nextDistPath}pages/_error.js`,\n ]\n customDocumentAliases[`${PAGES_DIR_ALIAS}/_document`] = [\n ...(pagesDir\n ? pageExtensions.reduce((prev, ext) => {\n prev.push(path.join(pagesDir, `_document.${ext}`))\n return prev\n }, [] as string[])\n : []),\n `${nextDistPath}pages/_document.js`,\n ]\n }\n\n return {\n '@vercel/og$': 'next/dist/server/og/image-response',\n\n // Avoid bundling both entrypoints in React 19 when we just need one.\n // Also avoids bundler warnings in React 18 where react-dom/server.edge doesn't exist.\n 'next/dist/server/ReactDOMServerPages': isReact19\n ? 'react-dom/server.edge'\n : 'react-dom/server.browser',\n\n // Alias next/dist imports to next/dist/esm assets,\n // let this alias hit before `next` alias.\n ...(isEdgeServer\n ? {\n 'next/dist/api': 'next/dist/esm/api',\n 'next/dist/build': 'next/dist/esm/build',\n 'next/dist/client': 'next/dist/esm/client',\n 'next/dist/shared': 'next/dist/esm/shared',\n 'next/dist/pages': 'next/dist/esm/pages',\n 'next/dist/lib': 'next/dist/esm/lib',\n 'next/dist/server': 'next/dist/esm/server',\n\n ...createNextApiEsmAliases(),\n }\n : undefined),\n\n // For RSC server bundle\n ...(!hasExternalOtelApiPackage() && {\n '@opentelemetry/api': 'next/dist/compiled/@opentelemetry/api',\n }),\n\n ...(config.images.loaderFile\n ? {\n 'next/dist/shared/lib/image-loader': config.images.loaderFile,\n ...(isEdgeServer && {\n 'next/dist/esm/shared/lib/image-loader': config.images.loaderFile,\n }),\n }\n : undefined),\n\n 'styled-jsx/style$': defaultOverrides['styled-jsx/style'],\n 'styled-jsx$': defaultOverrides['styled-jsx'],\n\n 'next/dist/compiled/next-devtools': isClient\n ? 'next/dist/compiled/next-devtools'\n : 'next/dist/next-devtools/dev-overlay.shim.js',\n\n ...customAppAliases,\n ...customDocumentAliases,\n\n ...(pagesDir ? { [PAGES_DIR_ALIAS]: pagesDir } : {}),\n ...(appDir ? { [APP_DIR_ALIAS]: appDir } : {}),\n [ROOT_DIR_ALIAS]: dir,\n ...(isClient\n ? {\n // `private-next-instrumentation-client` resolves to a placeholder\n // file whose contents are replaced at build time by\n // `next-instrumentation-client-loader` (registered via a\n // `module.rules` entry in webpack-config.ts). The emitted module lists\n // each configured instrumentation module, followed by the user's\n // `instrumentation-client.{pageExt}` file (resolved through the\n // `private-next-instrumentation-client-user` alias below).\n 'private-next-instrumentation-client':\n INSTRUMENTATION_CLIENT_STUB_PATH,\n 'private-next-instrumentation-client-user': [\n path.join(dir, 'src', 'instrumentation-client'),\n path.join(dir, 'instrumentation-client'),\n 'private-next-empty-module',\n ],\n\n // disable typechecker, webpack5 allows aliases to be set to false to create a no-op module\n 'private-next-empty-module': false as any,\n }\n : {}),\n\n [DOT_NEXT_ALIAS]: distDir,\n ...(isClient || isEdgeServer ? getOptimizedModuleAliases() : {}),\n ...(reactProductionProfiling ? getReactProfilingInProduction() : {}),\n\n [RSC_ACTION_VALIDATE_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/action-validate',\n\n [RSC_ACTION_CLIENT_WRAPPER_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/action-client-wrapper',\n\n [RSC_ACTION_PROXY_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/server-reference',\n\n [RSC_ACTION_ENCRYPTION_ALIAS]: 'next/dist/server/app-render/encryption',\n\n [RSC_CACHE_WRAPPER_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/cache-wrapper',\n [RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/track-dynamic-import',\n\n '@swc/helpers/_': path.join(\n path.dirname(require.resolve('@swc/helpers/package.json')),\n '_'\n ),\n\n setimmediate: 'next/dist/compiled/setimmediate',\n }\n}\n\nexport function createServerOnlyClientOnlyAliases(\n isServer: boolean\n): CompilerAliases {\n return isServer\n ? {\n 'server-only$': 'next/dist/compiled/server-only/empty',\n 'client-only$': 'next/dist/compiled/client-only/error',\n 'next/dist/compiled/server-only$':\n 'next/dist/compiled/server-only/empty',\n 'next/dist/compiled/client-only$':\n 'next/dist/compiled/client-only/error',\n }\n : {\n 'server-only$': 'next/dist/compiled/server-only/index',\n 'client-only$': 'next/dist/compiled/client-only/index',\n 'next/dist/compiled/client-only$':\n 'next/dist/compiled/client-only/index',\n 'next/dist/compiled/server-only':\n 'next/dist/compiled/server-only/index',\n }\n}\n\nexport function createNextApiEsmAliases() {\n const mapping = {\n error: 'next/dist/api/error',\n head: 'next/dist/api/head',\n image: 'next/dist/api/image',\n constants: 'next/dist/api/constants',\n router: 'next/dist/api/router',\n dynamic: 'next/dist/api/dynamic',\n script: 'next/dist/api/script',\n link: 'next/dist/api/link',\n form: 'next/dist/api/form',\n navigation: 'next/dist/api/navigation',\n headers: 'next/dist/api/headers',\n og: 'next/dist/api/og',\n server: 'next/dist/api/server',\n // pages api\n document: 'next/dist/api/document',\n app: 'next/dist/api/app',\n }\n const aliasMap: Record<string, string> = {}\n // Handle fully specified imports like `next/image.js`\n for (const [key, value] of Object.entries(mapping)) {\n const nextApiFilePath = path.join(NEXT_PROJECT_ROOT, key)\n aliasMap[nextApiFilePath + '.js'] = value\n }\n\n return aliasMap\n}\n\nexport function createAppRouterApiAliases(isServerOnlyLayer: boolean) {\n const mapping: Record<string, string> = {\n head: 'next/dist/client/components/noop-head',\n dynamic: 'next/dist/api/app-dynamic',\n link: 'next/dist/client/app-dir/link',\n form: 'next/dist/client/app-dir/form',\n }\n\n if (isServerOnlyLayer) {\n mapping['error'] = 'next/dist/api/error.react-server'\n mapping['navigation'] = 'next/dist/api/navigation.react-server'\n mapping['link'] = 'next/dist/client/app-dir/link.react-server'\n }\n\n const aliasMap: Record<string, string> = {}\n for (const [key, value] of Object.entries(mapping)) {\n const nextApiFilePath = path.join(NEXT_PROJECT_ROOT, key)\n aliasMap[nextApiFilePath + '.js'] = value\n }\n return aliasMap\n}\n\n// file:///./../compiled/react/package.json\ntype ReactEntrypoint = 'jsx-runtime' | 'jsx-dev-runtime' | 'compiler-runtime'\n// file:///./../compiled/react-dom/package.json\ntype ReactDOMEntrypoint =\n | 'client'\n | 'server'\n | 'server.edge'\n | 'server.browser'\n // TODO: server.node\n | 'static'\n | 'static.browser'\n | 'static.edge'\n// TODO: static.node\n\n// file:///./../compiled/react-server-dom-webpack/package.json\ntype ReactServerDOMWebpackEntrypoint =\n | 'client'\n // TODO: client.browser\n // TODO: client.edge\n // TODO: client.node\n | 'server'\n // TODO: server.browser\n // TODO: server.edge\n | 'server.node'\n | 'static'\n// TODO: static.browser\n// TODO: static.edge\n// TODO: static.node\n\ntype ReactPackagesEntryPoint =\n | 'react'\n | `react/${ReactEntrypoint}`\n | 'react-dom'\n | `react-dom/${ReactDOMEntrypoint}`\n | `react-server-dom-webpack/${ReactServerDOMWebpackEntrypoint}`\n\ntype BundledReactChannel = '' | '-experimental'\n\ntype ReactAliases = {\n [K in `${ReactPackagesEntryPoint}$`]: string\n} & {\n // Edge Runtime does not use next-server runtime.\n // This means we rely on rewritten import sources in compiled React.\n // We need to alias those rewritten import sources.\n [K in\n | `next/dist/compiled/react${BundledReactChannel}$`\n | `next/dist/compiled/react${BundledReactChannel}/${ReactEntrypoint}$`\n | `next/dist/compiled/react-dom${BundledReactChannel}$`]?: string\n}\n\nexport function createVendoredReactAliases(\n bundledReactChannel: BundledReactChannel,\n {\n layer,\n isBrowser,\n isEdgeServer,\n reactProductionProfiling,\n }: {\n layer: WebpackLayerName\n isBrowser: boolean\n isEdgeServer: boolean\n reactProductionProfiling: boolean\n }\n): CompilerAliases {\n const environmentCondition = isBrowser\n ? 'browser'\n : isEdgeServer\n ? 'edge'\n : 'nodejs'\n const reactCondition = shouldUseReactServerCondition(layer)\n ? 'server'\n : 'client'\n\n // ✅ Correct alias\n // ❌ Incorrect alias i.e. importing this entrypoint should throw an error.\n // ❔ Alias that may produce correct code in certain conditions.Keep until react-markup is available.\n\n let reactAlias: ReactAliases\n if (environmentCondition === 'browser' && reactCondition === 'client') {\n // prettier-ignore\n reactAlias = {\n // file:///./../compiled/react/package.json\n react$: /* ✅ */ `next/dist/compiled/react${bundledReactChannel}`,\n 'react/compiler-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/compiler-runtime`,\n 'react/jsx-dev-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime`,\n 'react/jsx-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/jsx-runtime`,\n // file:///./../compiled/react-dom/package.json\n 'react-dom$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}`,\n 'react-dom/client$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/client`,\n 'react-dom/server$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n 'react-dom/server.browser$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n // optimizations to ignore the legacy build of react-dom/server in `server.edge` build\n 'react-dom/server.edge$': /* ❌ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/static$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.browser$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.edge$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n // file:///./../compiled/react-server-dom-webpack/package.json\n 'react-server-dom-webpack/client$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client.browser`,\n 'react-server-dom-webpack/server$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.browser`,\n 'react-server-dom-webpack/server.node$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.node`,\n 'react-server-dom-webpack/static$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/static.browser`,\n }\n } else if (\n environmentCondition === 'browser' &&\n reactCondition === 'server'\n ) {\n // prettier-ignore\n reactAlias = {\n // file:///./../compiled/react/package.json\n react$: /* ❌ */ `next/dist/compiled/react${bundledReactChannel}`,\n 'react/compiler-runtime$': /* ❌ */ `next/dist/compiled/react${bundledReactChannel}/compiler-runtime`,\n 'react/jsx-dev-runtime$': /* ❌ */ `next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime`,\n 'react/jsx-runtime$': /* ❌ */ `next/dist/compiled/react${bundledReactChannel}/jsx-runtime`,\n // file:///./../compiled/react-dom/package.json\n 'react-dom$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}`,\n 'react-dom/client$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/client`,\n 'react-dom/server$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n 'react-dom/server.browser$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n // optimizations to ignore the legacy build of react-dom/server in `server.edge` build\n 'react-dom/server.edge$': /* ❌ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/static$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.browser$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.edge$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n // file:///./../compiled/react-server-dom-webpack/package.json\n 'react-server-dom-webpack/client$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client.browser`,\n 'react-server-dom-webpack/server$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.browser`,\n 'react-server-dom-webpack/server.node$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.node`,\n 'react-server-dom-webpack/static$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/static.browser`,\n }\n } else if (environmentCondition === 'nodejs' && reactCondition === 'client') {\n // prettier-ignore\n reactAlias = {\n // file:///./../compiled/react/package.json\n react$: /* ✅ */ `next/dist/server/route-modules/app-page/vendored/ssr/react`,\n 'react/compiler-runtime$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/ssr/react-compiler-runtime`,\n 'react/jsx-dev-runtime$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-dev-runtime`,\n 'react/jsx-runtime$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime`,\n // file:///./../compiled/react-dom/package.json\n 'react-dom$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/ssr/react-dom`,\n 'react-dom/client$': /* ❔ */ `next/dist/compiled/react-dom${bundledReactChannel}/client`,\n 'react-dom/server$': /* ❔ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.node`,\n 'react-dom/server.browser$': /* ❔ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n // optimizations to ignore the legacy build of react-dom/server in `server.edge` build\n 'react-dom/server.edge$': /* ✅ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/static$': /* ❔ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.node`,\n 'react-dom/static.browser$': /* ❔ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.edge$': /* ❔ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n // file:///./../compiled/react-server-dom-webpack/package.json\n 'react-server-dom-webpack/client$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/ssr/react-server-dom-webpack-client`,\n 'react-server-dom-webpack/server$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.node`,\n 'react-server-dom-webpack/server.node$':/* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.node`,\n 'react-server-dom-webpack/static$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/static.node`,\n }\n } else if (environmentCondition === 'nodejs' && reactCondition === 'server') {\n // prettier-ignore\n reactAlias = {\n // file:///./../compiled/react/package.json\n react$: /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react`,\n 'react/compiler-runtime$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react-compiler-runtime`,\n 'react/jsx-dev-runtime$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-dev-runtime`,\n 'react/jsx-runtime$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime`,\n // file:///./../compiled/react-dom/package.json\n 'react-dom$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react-dom`,\n 'react-dom/client$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/client`,\n 'react-dom/server$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.node`,\n 'react-dom/server.browser$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n // optimizations to ignore the legacy build of react-dom/server in `server.edge` build\n 'react-dom/server.edge$': /* ❌ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/static$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.node`,\n 'react-dom/static.browser$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.edge$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n // file:///./../compiled/react-server-dom-webpack/package.json\n 'react-server-dom-webpack/client$': /* ❔ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client.node`,\n 'react-server-dom-webpack/server$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-webpack-server`,\n 'react-server-dom-webpack/server.node$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-webpack-server`,\n 'react-server-dom-webpack/static$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-webpack-static`,\n }\n } else if (environmentCondition === 'edge' && reactCondition === 'client') {\n // prettier-ignore\n reactAlias = {\n // file:///./../compiled/react/package.json\n react$: /* ✅ */ `next/dist/compiled/react${bundledReactChannel}`,\n 'react/compiler-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/compiler-runtime`,\n 'react/jsx-dev-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime`,\n 'react/jsx-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/jsx-runtime`,\n // file:///./../compiled/react-dom/package.json\n 'react-dom$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}`,\n 'react-dom/client$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/client`,\n 'react-dom/server$': /* ✅ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/server.browser$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n // optimizations to ignore the legacy build of react-dom/server in `server.edge` build\n 'react-dom/server.edge$': /* ✅ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/static$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n 'react-dom/static.browser$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.edge$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n // file:///./../compiled/react-server-dom-webpack/package.json\n 'react-server-dom-webpack/client$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client.edge`,\n 'react-server-dom-webpack/server$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.edge`,\n 'react-server-dom-webpack/server.node$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.node`,\n 'react-server-dom-webpack/static$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/static.edge`,\n }\n } else if (environmentCondition === 'edge' && reactCondition === 'server') {\n // prettier-ignore\n reactAlias = {\n // file:///./../compiled/react/package.json\n react$: /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/react.react-server`,\n 'react/compiler-runtime$': /* ❌ */ `next/dist/compiled/react${bundledReactChannel}/compiler-runtime`,\n 'react/jsx-dev-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime.react-server`,\n 'react/jsx-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/jsx-runtime.react-server`,\n // file:///./../compiled/react-dom/package.json\n 'react-dom$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/react-dom.react-server`,\n 'react-dom/client$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/client`,\n 'react-dom/server$': /* ❌ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/server.browser$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n // optimizations to ignore the legacy build of react-dom/server in `server.edge` build\n 'react-dom/server.edge$': /* ❌ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/static$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n 'react-dom/static.browser$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.edge$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n // file:///./../compiled/react-server-dom-webpack/package.json\n 'react-server-dom-webpack/client$': /* ❔ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client.edge`,\n 'react-server-dom-webpack/server$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.edge`,\n 'react-server-dom-webpack/server.node$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.node`,\n 'react-server-dom-webpack/static$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/static.edge`,\n }\n\n // prettier-ignore\n reactAlias[`next/dist/compiled/react${bundledReactChannel}$` ] = reactAlias[`react$`]\n // prettier-ignore\n reactAlias[`next/dist/compiled/react${bundledReactChannel}/compiler-runtime$`] = reactAlias[`react/compiler-runtime$`]\n // prettier-ignore\n reactAlias[`next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime$` ] = reactAlias[`react/jsx-dev-runtime$`]\n // prettier-ignore\n reactAlias[`next/dist/compiled/react${bundledReactChannel}/jsx-runtime$` ] = reactAlias[`react/jsx-runtime$`]\n // prettier-ignore\n reactAlias[`next/dist/compiled/react-dom${bundledReactChannel}$` ] = reactAlias[`react-dom$`]\n } else {\n throw new Error(\n `Unsupported environment condition \"${environmentCondition}\" and react condition \"${reactCondition}\". This is a bug in Next.js.`\n )\n }\n\n if (reactProductionProfiling) {\n reactAlias['react-dom/client$'] =\n `next/dist/compiled/react-dom${bundledReactChannel}/profiling`\n }\n\n const alias: CompilerAliases = reactAlias\n\n alias[\n '@vercel/turbopack-ecmascript-runtime/browser/dev/hmr-client/hmr-client.ts'\n ] = `next/dist/client/dev/noop-turbopack-hmr`\n\n return alias\n}\n\n// Insert aliases for Next.js stubs of fetch, object-assign, and url\n// Keep in sync with insert_optimized_module_aliases in import_map.rs\nexport function getOptimizedModuleAliases(): CompilerAliases {\n return {\n unfetch: require.resolve('next/dist/build/polyfills/fetch/index.js'),\n 'isomorphic-unfetch': require.resolve(\n 'next/dist/build/polyfills/fetch/index.js'\n ),\n 'whatwg-fetch': require.resolve(\n 'next/dist/build/polyfills/fetch/whatwg-fetch.js'\n ),\n 'object-assign': require.resolve(\n 'next/dist/build/polyfills/object-assign.js'\n ),\n 'object.assign/auto': require.resolve(\n 'next/dist/build/polyfills/object.assign/auto.js'\n ),\n 'object.assign/implementation': require.resolve(\n 'next/dist/build/polyfills/object.assign/implementation.js'\n ),\n 'object.assign/polyfill': require.resolve(\n 'next/dist/build/polyfills/object.assign/polyfill.js'\n ),\n 'object.assign/shim': require.resolve(\n 'next/dist/build/polyfills/object.assign/shim.js'\n ),\n url: require.resolve('next/dist/compiled/native-url'),\n }\n}\n\nfunction getReactProfilingInProduction(): CompilerAliases {\n return {\n 'react-dom/client$': 'react-dom/profiling',\n }\n}\n"],"names":["createAppRouterApiAliases","createNextApiEsmAliases","createServerOnlyClientOnlyAliases","createVendoredReactAliases","createWebpackAliases","getOptimizedModuleAliases","isReact19","React","use","INSTRUMENTATION_CLIENT_STUB_PATH","path","join","NEXT_PROJECT_ROOT","distDir","isClient","isEdgeServer","dev","config","pagesDir","appDir","dir","reactProductionProfiling","pageExtensions","customAppAliases","customDocumentAliases","nextDistPath","PAGES_DIR_ALIAS","reduce","prev","ext","push","undefined","hasExternalOtelApiPackage","images","loaderFile","defaultOverrides","APP_DIR_ALIAS","ROOT_DIR_ALIAS","DOT_NEXT_ALIAS","getReactProfilingInProduction","RSC_ACTION_VALIDATE_ALIAS","RSC_ACTION_CLIENT_WRAPPER_ALIAS","RSC_ACTION_PROXY_ALIAS","RSC_ACTION_ENCRYPTION_ALIAS","RSC_CACHE_WRAPPER_ALIAS","RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS","dirname","require","resolve","setimmediate","isServer","mapping","error","head","image","constants","router","dynamic","script","link","form","navigation","headers","og","server","document","app","aliasMap","key","value","Object","entries","nextApiFilePath","isServerOnlyLayer","bundledReactChannel","layer","isBrowser","environmentCondition","reactCondition","shouldUseReactServerCondition","reactAlias","react$","Error","alias","unfetch","url"],"mappings":";;;;;;;;;;;;;;;;;;;IA2PgBA,yBAAyB;eAAzBA;;IA7BAC,uBAAuB;eAAvBA;;IAtBAC,iCAAiC;eAAjCA;;IA2HAC,0BAA0B;eAA1BA;;IA7RAC,oBAAoB;eAApBA;;IA6eAC,yBAAyB;eAAzBA;;;6DAnhBC;+DACM;2BAahB;6BAE0B;+BACS;8BACR;uBACY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAM9C,MAAMC,YAAY,OAAOC,OAAMC,GAAG,KAAK;AAEvC;;;;;CAKC,GACD,MAAMC,mCAAmCC,aAAI,CAACC,IAAI,CAChDC,+BAAiB,EACjB;AAGK,SAASR,qBAAqB,EACnCS,OAAO,EACPC,QAAQ,EACRC,YAAY,EACZC,GAA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QAAQC,OAAO,CAC7B;QAEF,iBAAiBD,QAAQC,OAAO,CAC9B;QAEF,sBAAsBD,QAAQC,OAAO,CACnC;QAEF,gCAAgCD,QAAQC,OAAO,CAC7C;QAEF,0BAA0BD,QAAQC,OAAO,CACvC;QAEF,sBAAsBD,QAAQC,OAAO,CACnC;QAEFqC,KAAKtC,QAAQC,OAAO,CAAC;IACvB;AACF;AAEA,SAAST;IACP,OAAO;QACL,qBAAqB;IACvB;AACF","ignoreList":[0]} |
@@ -202,2 +202,3 @@ "use strict"; | ||
| 'process.env.__NEXT_OPTIMISTIC_ROUTING': config.experimental.optimisticRouting ?? false, | ||
| 'process.env.__NEXT_INSTRUMENTATION_CLIENT_ROUTER_TRANSITION_EVENTS': config.experimental.instrumentationClientRouterTransitionEvents ?? false, | ||
| 'process.env.__NEXT_APP_SHELLS': config.experimental.appShells ?? false, | ||
@@ -204,0 +205,0 @@ 'process.env.__NEXT_VARY_PARAMS': config.experimental.varyParams ?? false, |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/build/define-env.ts"],"sourcesContent":["import type {\n I18NConfig,\n I18NDomains,\n NextConfigComplete,\n} from '../server/config-shared'\nimport type { ProxyMatcher } from './analysis/get-page-static-info'\nimport type { Rewrite } from '../lib/load-custom-routes'\nimport path from 'node:path'\nimport { needsExperimentalReact } from '../lib/needs-experimental-react'\nimport { checkIsAppPPREnabled } from '../server/lib/experimental/ppr'\nimport {\n getNextConfigEnv,\n getNextPublicEnvironmentVariables,\n} from '../lib/static-env'\n\ntype BloomFilter = ReturnType<\n import('../shared/lib/bloom-filter').BloomFilter['export']\n>\n\nexport interface DefineEnvOptions {\n isTurbopack: boolean\n clientRouterFilters?: {\n staticFilter: BloomFilter\n dynamicFilter: BloomFilter\n }\n config: NextConfigComplete\n dev: boolean\n distDir: string\n projectPath: string\n fetchCacheKeyPrefix: string | undefined\n hasRewrites: boolean\n isClient: boolean\n isEdgeServer: boolean\n isNodeServer: boolean\n middlewareMatchers: ProxyMatcher[] | undefined\n omitNonDeterministic?: boolean\n rewrites: {\n beforeFiles: Rewrite[]\n afterFiles: Rewrite[]\n fallback: Rewrite[]\n }\n}\n\nconst DEFINE_ENV_EXPRESSION = Symbol('DEFINE_ENV_EXPRESSION')\n\ninterface DefineEnv {\n [key: string]:\n | string\n | number\n | string[]\n | boolean\n | { [DEFINE_ENV_EXPRESSION]: string }\n | ProxyMatcher[]\n | BloomFilter\n | Partial<NextConfigComplete['images']>\n | I18NDomains\n | I18NConfig\n}\n\ninterface SerializedDefineEnv {\n [key: string]: string\n}\n\n/**\n * Serializes the DefineEnv config so that it can be inserted into the code by Webpack/Turbopack, JSON stringifies each value.\n */\nfunction serializeDefineEnv(defineEnv: DefineEnv): SerializedDefineEnv {\n const defineEnvStringified: SerializedDefineEnv = Object.fromEntries(\n Object.entries(defineEnv).map(([key, value]) => [\n key,\n typeof value === 'object' && DEFINE_ENV_EXPRESSION in value\n ? value[DEFINE_ENV_EXPRESSION]\n : JSON.stringify(value),\n ])\n )\n return defineEnvStringified\n}\n\nfunction getImageConfig(\n config: NextConfigComplete,\n dev: boolean\n): { 'process.env.__NEXT_IMAGE_OPTS': Partial<NextConfigComplete['images']> } {\n return {\n 'process.env.__NEXT_IMAGE_OPTS': {\n deviceSizes: config.images.deviceSizes,\n imageSizes: config.images.imageSizes,\n qualities: config.images.qualities,\n path: config.images.path,\n loader: config.images.loader,\n dangerouslyAllowSVG: config.images.dangerouslyAllowSVG,\n unoptimized: config?.images?.unoptimized,\n ...(dev\n ? {\n // additional config in dev to allow validating on the client\n domains: config.images.domains,\n remotePatterns: config.images?.remotePatterns,\n localPatterns: config.images?.localPatterns,\n output: config.output,\n }\n : {}),\n },\n }\n}\n\nexport function getDefineEnv({\n isTurbopack,\n clientRouterFilters,\n config,\n dev,\n distDir,\n projectPath,\n fetchCacheKeyPrefix,\n hasRewrites,\n isClient,\n isEdgeServer,\n isNodeServer,\n middlewareMatchers,\n omitNonDeterministic,\n rewrites,\n}: DefineEnvOptions): SerializedDefineEnv {\n const nextPublicEnv = getNextPublicEnvironmentVariables()\n const nextConfigEnv = getNextConfigEnv(config)\n\n const isPPREnabled = checkIsAppPPREnabled(config.experimental.ppr)\n const isCacheComponentsEnabled = !!config.cacheComponents\n const isUseCacheEnabled = !!config.experimental.useCache\n\n const defineEnv: DefineEnv = {\n // internal field to identify the plugin config\n __NEXT_DEFINE_ENV: true,\n\n ...nextPublicEnv,\n ...nextConfigEnv,\n ...(!isEdgeServer\n ? {}\n : {\n EdgeRuntime:\n /**\n * Cloud providers can set this environment variable to allow users\n * and library authors to have different implementations based on\n * the runtime they are running with, if it's not using `edge-runtime`\n */\n process.env.NEXT_EDGE_RUNTIME_PROVIDER ?? 'edge-runtime',\n\n // process should be only { env: {...} } for edge runtime.\n // For ignore avoid warn on `process.emit` usage but directly omit it.\n 'process.emit': false,\n }),\n 'process.turbopack': isTurbopack,\n 'process.env.TURBOPACK': isTurbopack,\n 'process.env.__NEXT_BUNDLER': isTurbopack\n ? 'Turbopack'\n : process.env.NEXT_RSPACK\n ? 'Rspack'\n : 'Webpack',\n // TODO: enforce `NODE_ENV` on `process.env`, and add a test:\n 'process.env.NODE_ENV':\n dev || config.experimental.allowDevelopmentBuild\n ? 'development'\n : 'production',\n 'process.env.__NEXT_DEV_SERVER': dev ? '1' : '',\n 'process.env.__NEXT_DISABLE_DEV_OVERLAY_UX':\n process.env.NEXT_PRIVATE_DISABLE_DEV_OVERLAY_UX === '1',\n 'process.env.NEXT_RUNTIME': isEdgeServer\n ? 'edge'\n : isNodeServer\n ? 'nodejs'\n : '',\n 'process.env.NEXT_MINIMAL': '',\n 'process.env.__NEXT_APP_NAV_FAIL_HANDLING': Boolean(\n config.experimental.appNavFailHandling\n ),\n 'process.env.__NEXT_APP_NEW_SCROLL_HANDLER': Boolean(\n config.experimental.appNewScrollHandler\n ),\n 'process.env.__NEXT_PPR': isPPREnabled,\n 'process.env.__NEXT_CACHE_COMPONENTS': isCacheComponentsEnabled,\n 'process.env.__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS': Boolean(\n config.experimental.cachedNavigations\n ),\n 'process.env.__NEXT_INSTANT_NAV_TOGGLE': isCacheComponentsEnabled,\n 'process.env.__NEXT_USE_CACHE': isUseCacheEnabled,\n 'process.env.__NEXT_USE_NODE_STREAMS': isEdgeServer ? false : true,\n\n 'process.env.NEXT_SUPPORTS_IMMUTABLE_ASSETS':\n config.experimental.supportsImmutableAssets || false,\n\n ...(config.experimental?.useSkewCookie || !config.deploymentId\n ? {\n 'process.env.NEXT_DEPLOYMENT_ID': false,\n }\n : isClient\n ? isTurbopack\n ? {\n // This is set at runtime by packages/next/src/client/register-deployment-id-global.ts\n 'process.env.NEXT_DEPLOYMENT_ID': {\n [DEFINE_ENV_EXPRESSION]: 'globalThis.NEXT_DEPLOYMENT_ID',\n },\n }\n : {\n // For Webpack, we currently don't use the non-inlining globalThis.NEXT_DEPLOYMENT_ID\n // approach because we cannot forward this global variable to web workers easily.\n 'process.env.NEXT_DEPLOYMENT_ID': config.deploymentId || false,\n }\n : config.experimental?.runtimeServerDeploymentId\n ? {\n // Don't inline at all, keep process.env.NEXT_DEPLOYMENT_ID as is\n }\n : {\n 'process.env.NEXT_DEPLOYMENT_ID': config.deploymentId || false,\n }),\n\n // Propagates the `__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING` environment\n // variable to the client.\n 'process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING':\n process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING || false,\n 'process.env.__NEXT_FETCH_CACHE_KEY_PREFIX': fetchCacheKeyPrefix ?? '',\n ...(isTurbopack\n ? {}\n : {\n 'process.env.__NEXT_MIDDLEWARE_MATCHERS': middlewareMatchers ?? [],\n }),\n 'process.env.__NEXT_MANUAL_CLIENT_BASE_PATH':\n config.experimental.manualClientBasePath ?? false,\n 'process.env.__NEXT_CLIENT_ROUTER_DYNAMIC_STALETIME': JSON.stringify(\n isNaN(Number(config.experimental.staleTimes?.dynamic))\n ? 0\n : config.experimental.staleTimes?.dynamic\n ),\n 'process.env.__NEXT_CLIENT_ROUTER_STATIC_STALETIME': JSON.stringify(\n isNaN(Number(config.experimental.staleTimes?.static))\n ? 5 * 60 // 5 minutes\n : config.experimental.staleTimes?.static\n ),\n 'process.env.__NEXT_CLIENT_ROUTER_FILTER_ENABLED':\n config.experimental.clientRouterFilter ?? true,\n 'process.env.__NEXT_CLIENT_ROUTER_S_FILTER':\n clientRouterFilters?.staticFilter ?? false,\n 'process.env.__NEXT_CLIENT_ROUTER_D_FILTER':\n clientRouterFilters?.dynamicFilter ?? false,\n 'process.env.__NEXT_CLIENT_VALIDATE_RSC_REQUEST_HEADERS': Boolean(\n config.experimental.validateRSCRequestHeaders\n ),\n 'process.env.__NEXT_DYNAMIC_ON_HOVER': Boolean(\n config.experimental.dynamicOnHover\n ),\n 'process.env.__NEXT_USE_OFFLINE': Boolean(config.experimental.useOffline),\n 'process.env.__NEXT_PREFETCH_INLINING': Boolean(\n config.experimental.prefetchInlining\n ),\n 'process.env.__NEXT_OPTIMISTIC_CLIENT_CACHE':\n config.experimental.optimisticClientCache ?? true,\n 'process.env.__NEXT_MIDDLEWARE_PREFETCH':\n config.experimental.proxyPrefetch ?? 'flexible',\n 'process.env.__NEXT_CROSS_ORIGIN': config.crossOrigin,\n 'process.browser': isClient,\n 'process.env.__NEXT_TEST_MODE': process.env.__NEXT_TEST_MODE ?? false,\n // This is used in client/dev-error-overlay/hot-dev-client.js to replace the dist directory\n ...(dev && (isClient ?? isEdgeServer)\n ? {\n 'process.env.__NEXT_DIST_DIR': distDir,\n }\n : {}),\n // This is used in devtools to strip the project path in edge runtime,\n // as there's only a dummy `dir` value (`.`) as edge runtime doesn't have concept of file system.\n ...(dev && isEdgeServer\n ? {\n 'process.env.__NEXT_EDGE_PROJECT_DIR': isTurbopack\n ? path.relative(process.cwd(), projectPath)\n : projectPath,\n }\n : {}),\n 'process.env.__NEXT_BASE_PATH': config.basePath,\n 'process.env.__NEXT_CASE_SENSITIVE_ROUTES': Boolean(\n config.experimental.caseSensitiveRoutes\n ),\n 'process.env.__NEXT_REWRITES': rewrites as any,\n 'process.env.__NEXT_TRAILING_SLASH': config.trailingSlash,\n 'process.env.__NEXT_DEV_INDICATOR': config.devIndicators !== false,\n 'process.env.__NEXT_DEV_INDICATOR_POSITION':\n config.devIndicators === false\n ? 'bottom-left' // This will not be used as the indicator is disabled.\n : (config.devIndicators.position ?? 'bottom-left'),\n 'process.env.__NEXT_STRICT_MODE':\n config.reactStrictMode === null ? false : config.reactStrictMode,\n 'process.env.__NEXT_STRICT_MODE_APP':\n // When next.config.js does not have reactStrictMode it's enabled by default.\n config.reactStrictMode === null ? true : config.reactStrictMode,\n 'process.env.__NEXT_OPTIMIZE_CSS':\n (config.experimental.optimizeCss && !dev) ?? false,\n 'process.env.__NEXT_SCRIPT_WORKERS':\n (config.experimental.nextScriptWorkers && !dev) ?? false,\n 'process.env.__NEXT_SCROLL_RESTORATION':\n config.experimental.scrollRestoration ?? false,\n ...getImageConfig(config, dev),\n 'process.env.__NEXT_ROUTER_BASEPATH': config.basePath,\n 'process.env.__NEXT_HAS_REWRITES': hasRewrites,\n 'process.env.__NEXT_CONFIG_OUTPUT': config.output,\n 'process.env.__NEXT_I18N_SUPPORT': !!config.i18n,\n 'process.env.__NEXT_I18N_DOMAINS': config.i18n?.domains ?? false,\n 'process.env.__NEXT_I18N_CONFIG': config.i18n || '',\n 'process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE':\n config.skipProxyUrlNormalize,\n 'process.env.__NEXT_EXTERNAL_MIDDLEWARE_REWRITE_RESOLVE':\n config.experimental.externalProxyRewritesResolve ?? false,\n 'process.env.__NEXT_MANUAL_TRAILING_SLASH':\n config.skipTrailingSlashRedirect,\n 'process.env.__NEXT_HAS_WEB_VITALS_ATTRIBUTION':\n (config.experimental.webVitalsAttribution &&\n config.experimental.webVitalsAttribution.length > 0) ??\n false,\n 'process.env.__NEXT_WEB_VITALS_ATTRIBUTION':\n config.experimental.webVitalsAttribution ?? false,\n 'process.env.__NEXT_LINK_NO_TOUCH_START':\n config.experimental.linkNoTouchStart ?? false,\n 'process.env.__NEXT_ASSET_PREFIX': config.assetPrefix,\n 'process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS':\n !!config.experimental.authInterrupts,\n 'process.env.__NEXT_TELEMETRY_DISABLED': Boolean(\n process.env.NEXT_TELEMETRY_DISABLED\n ),\n ...(isNodeServer || isEdgeServer\n ? {\n // Fix bad-actors in the npm ecosystem (e.g. `node-formidable`)\n // This is typically found in unmaintained modules from the\n // pre-webpack era (common in server-side code)\n 'global.GENTLY': false,\n }\n : undefined),\n ...(isNodeServer || isEdgeServer\n ? {\n 'process.env.__NEXT_EXPERIMENTAL_REACT':\n needsExperimentalReact(config),\n }\n : undefined),\n\n 'process.env.__NEXT_MULTI_ZONE_DRAFT_MODE':\n config.experimental.multiZoneDraftMode ?? false,\n 'process.env.__NEXT_TRUST_HOST_HEADER':\n config.experimental.trustHostHeader ?? false,\n 'process.env.__NEXT_ALLOWED_REVALIDATE_HEADERS':\n config.experimental.allowedRevalidateHeaderKeys ?? [],\n ...(isNodeServer || isEdgeServer\n ? {\n 'process.env.__NEXT_RELATIVE_DIST_DIR': config.distDir,\n 'process.env.__NEXT_RELATIVE_PROJECT_DIR': path.relative(\n process.cwd(),\n projectPath\n ),\n }\n : {}),\n\n 'process.env.__NEXT_BROWSER_DEBUG_INFO_IN_TERMINAL': JSON.stringify(\n (config.logging && config.logging.browserToTerminal) || false\n ),\n 'process.env.__NEXT_MCP_SERVER': !!config.experimental.mcpServer,\n\n // The devtools need to know whether or not to show an option to clear the\n // bundler cache. This option may be removed later once Turbopack's\n // filesystem cache feature is more stable.\n //\n // This environment value is currently best-effort:\n // - It's possible to disable the webpack filesystem cache, but it's\n // unlikely for a user to do that.\n // - Rspack's filesystem cache is unstable and requires a different\n // configuration than webpack to enable (which we don't do).\n //\n // In the worst case we'll show an option to clear the cache, but it'll be a\n // no-op that just restarts the development server.\n 'process.env.__NEXT_BUNDLER_HAS_PERSISTENT_CACHE':\n !isTurbopack ||\n (config.experimental.turbopackFileSystemCacheForDev ?? false),\n 'process.env.__NEXT_REACT_DEBUG_CHANNEL':\n config.experimental.reactDebugChannel ?? false,\n 'process.env.__NEXT_TRANSITION_INDICATOR':\n config.experimental.transitionIndicator ?? false,\n 'process.env.__NEXT_GESTURE_TRANSITION':\n config.experimental.gestureTransition ?? false,\n 'process.env.__NEXT_OPTIMISTIC_ROUTING':\n config.experimental.optimisticRouting ?? false,\n 'process.env.__NEXT_APP_SHELLS': config.experimental.appShells ?? false,\n 'process.env.__NEXT_VARY_PARAMS': config.experimental.varyParams ?? false,\n 'process.env.__NEXT_EXPOSE_TESTING_API':\n dev || config.experimental.exposeTestingApiInProductionBuild === true,\n 'process.env.__NEXT_CACHE_LIFE': config.cacheLife,\n 'process.env.__NEXT_CLIENT_PARAM_PARSING_ORIGINS':\n config.experimental.clientParamParsingOrigins || [],\n }\n\n const userDefines = config.compiler?.define ?? {}\n for (const key in userDefines) {\n if (defineEnv.hasOwnProperty(key)) {\n throw new Error(\n `The \\`compiler.define\\` option is configured to replace the \\`${key}\\` variable. This variable is either part of a Next.js built-in or is already configured.`\n )\n }\n defineEnv[key] = userDefines[key]\n }\n\n if (isNodeServer || isEdgeServer) {\n const userDefinesServer = config.compiler?.defineServer ?? {}\n for (const key in userDefinesServer) {\n if (defineEnv.hasOwnProperty(key)) {\n throw new Error(\n `The \\`compiler.defineServer\\` option is configured to replace the \\`${key}\\` variable. This variable is either part of a Next.js built-in or is already configured.`\n )\n }\n defineEnv[key] = userDefinesServer[key]\n }\n }\n\n const serializedDefineEnv = serializeDefineEnv(defineEnv)\n\n // we delay inlining these values until after the build\n // with flying shuttle enabled so we can update them\n // without invalidating entries\n if (!dev && omitNonDeterministic) {\n // client uses window. instead of leaving process.env\n // in case process isn't polyfilled on client already\n // since by this point it won't be added by webpack\n const safeKey = (key: string) =>\n isClient ? `window.${key.split('.').pop()}` : key\n\n for (const key in nextPublicEnv) {\n serializedDefineEnv[key] = safeKey(key)\n }\n for (const key in nextConfigEnv) {\n serializedDefineEnv[key] = safeKey(key)\n }\n if (!config.experimental.runtimeServerDeploymentId) {\n for (const key of ['process.env.NEXT_DEPLOYMENT_ID']) {\n serializedDefineEnv[key] = safeKey(key)\n }\n }\n }\n\n return serializedDefineEnv\n}\n"],"names":["getDefineEnv","DEFINE_ENV_EXPRESSION","Symbol","serializeDefineEnv","defineEnv","defineEnvStringified","Object","fromEntries","entries","map","key","value","JSON","stringify","getImageConfig","config","dev","deviceSizes","images","imageSizes","qualities","path","loader","dangerouslyAllowSVG","unoptimized","domains","remotePatterns","localPatterns","output","isTurbopack","clientRouterFilters","distDir","projectPath","fetchCacheKeyPrefix","hasRewrites","isClient","isEdgeServer","isNodeServer","middlewareMatchers","omitNonDeterministic","rewrites","nextPublicEnv","getNextPublicEnvironmentVariables","nextConfigEnv","getNextConfigEnv","isPPREnabled","checkIsAppPPREnabled","experimental","ppr","isCacheComponentsEnabled","cacheComponents","isUseCacheEnabled","useCache","__NEXT_DEFINE_ENV","EdgeRuntime","process","env","NEXT_EDGE_RUNTIME_PROVIDER","NEXT_RSPACK","allowDevelopmentBuild","NEXT_PRIVATE_DISABLE_DEV_OVERLAY_UX","Boolean","appNavFailHandling","appNewScrollHandler","cachedNavigations","supportsImmutableAssets","useSkewCookie","deploymentId","runtimeServerDeploymentId","__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING","manualClientBasePath","isNaN","Number","staleTimes","dynamic","static","clientRouterFilter","staticFilter","dynamicFilter","validateRSCRequestHeaders","dynamicOnHover","useOffline","prefetchInlining","optimisticClientCache","proxyPrefetch","crossOrigin","__NEXT_TEST_MODE","relative","cwd","basePath","caseSensitiveRoutes","trailingSlash","devIndicators","position","reactStrictMode","optimizeCss","nextScriptWorkers","scrollRestoration","i18n","skipProxyUrlNormalize","externalProxyRewritesResolve","skipTrailingSlashRedirect","webVitalsAttribution","length","linkNoTouchStart","assetPrefix","authInterrupts","NEXT_TELEMETRY_DISABLED","undefined","needsExperimentalReact","multiZoneDraftMode","trustHostHeader","allowedRevalidateHeaderKeys","logging","browserToTerminal","mcpServer","turbopackFileSystemCacheForDev","reactDebugChannel","transitionIndicator","gestureTransition","optimisticRouting","appShells","varyParams","exposeTestingApiInProductionBuild","cacheLife","clientParamParsingOrigins","userDefines","compiler","define","hasOwnProperty","Error","userDefinesServer","defineServer","serializedDefineEnv","safeKey","split","pop"],"mappings":";;;;+BAwGgBA;;;eAAAA;;;iEAjGC;wCACsB;qBACF;2BAI9B;;;;;;AA8BP,MAAMC,wBAAwBC,OAAO;AAoBrC;;CAEC,GACD,SAASC,mBAAmBC,SAAoB;IAC9C,MAAMC,uBAA4CC,OAAOC,WAAW,CAClED,OAAOE,OAAO,CAACJ,WAAWK,GAAG,CAAC,CAAC,CAACC,KAAKC,MAAM,GAAK;YAC9CD;YACA,OAAOC,UAAU,YAAYV,yBAAyBU,QAClDA,KAAK,CAACV,sBAAsB,GAC5BW,KAAKC,SAAS,CAACF;SACpB;IAEH,OAAON;AACT;AAEA,SAASS,eACPC,MAA0B,EAC1BC,GAAY;QAUKD,gBAKSA,iBACDA;IAdzB,OAAO;QACL,iCAAiC;YAC/BE,aAAaF,OAAOG,MAAM,CAACD,WAAW;YACtCE,YAAYJ,OAAOG,MAAM,CAACC,UAAU;YACpCC,WAAWL,OAAOG,MAAM,CAACE,SAAS;YAClCC,MAAMN,OAAOG,MAAM,CAACG,IAAI;YACxBC,QAAQP,OAAOG,MAAM,CAACI,MAAM;YAC5BC,qBAAqBR,OAAOG,MAAM,CAACK,mBAAmB;YACtDC,WAAW,EAAET,2BAAAA,iBAAAA,OAAQG,MAAM,qBAAdH,eAAgBS,WAAW;YACxC,GAAIR,MACA;gBACE,6DAA6D;gBAC7DS,SAASV,OAAOG,MAAM,CAACO,OAAO;gBAC9BC,cAAc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;QACrC;QACA,IAAK,MAAMA,OAAOiC,cAAe;YAC/B0F,mBAAmB,CAAC3H,IAAI,GAAG4H,QAAQ5H;QACrC;QACA,IAAI,CAACK,OAAOgC,YAAY,CAACqB,yBAAyB,EAAE;YAClD,KAAK,MAAM1D,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 { checkIsAppPPREnabled } from '../server/lib/experimental/ppr'\nimport {\n getNextConfigEnv,\n getNextPublicEnvironmentVariables,\n} from '../lib/static-env'\n\ntype BloomFilter = ReturnType<\n import('../shared/lib/bloom-filter').BloomFilter['export']\n>\n\nexport interface DefineEnvOptions {\n isTurbopack: boolean\n clientRouterFilters?: {\n staticFilter: BloomFilter\n dynamicFilter: BloomFilter\n }\n config: NextConfigComplete\n dev: boolean\n distDir: string\n projectPath: string\n fetchCacheKeyPrefix: string | undefined\n hasRewrites: boolean\n isClient: boolean\n isEdgeServer: boolean\n isNodeServer: boolean\n middlewareMatchers: ProxyMatcher[] | undefined\n omitNonDeterministic?: boolean\n rewrites: {\n beforeFiles: Rewrite[]\n afterFiles: Rewrite[]\n fallback: Rewrite[]\n }\n}\n\nconst DEFINE_ENV_EXPRESSION = Symbol('DEFINE_ENV_EXPRESSION')\n\ninterface DefineEnv {\n [key: string]:\n | string\n | number\n | string[]\n | boolean\n | { [DEFINE_ENV_EXPRESSION]: string }\n | ProxyMatcher[]\n | BloomFilter\n | Partial<NextConfigComplete['images']>\n | I18NDomains\n | I18NConfig\n}\n\ninterface SerializedDefineEnv {\n [key: string]: string\n}\n\n/**\n * Serializes the DefineEnv config so that it can be inserted into the code by Webpack/Turbopack, JSON stringifies each value.\n */\nfunction serializeDefineEnv(defineEnv: DefineEnv): SerializedDefineEnv {\n const defineEnvStringified: SerializedDefineEnv = Object.fromEntries(\n Object.entries(defineEnv).map(([key, value]) => [\n key,\n typeof value === 'object' && DEFINE_ENV_EXPRESSION in value\n ? value[DEFINE_ENV_EXPRESSION]\n : JSON.stringify(value),\n ])\n )\n return defineEnvStringified\n}\n\nfunction getImageConfig(\n config: NextConfigComplete,\n dev: boolean\n): { 'process.env.__NEXT_IMAGE_OPTS': Partial<NextConfigComplete['images']> } {\n return {\n 'process.env.__NEXT_IMAGE_OPTS': {\n deviceSizes: config.images.deviceSizes,\n imageSizes: config.images.imageSizes,\n qualities: config.images.qualities,\n path: config.images.path,\n loader: config.images.loader,\n dangerouslyAllowSVG: config.images.dangerouslyAllowSVG,\n unoptimized: config?.images?.unoptimized,\n ...(dev\n ? {\n // additional config in dev to allow validating on the client\n domains: config.images.domains,\n remotePatterns: config.images?.remotePatterns,\n localPatterns: config.images?.localPatterns,\n output: config.output,\n }\n : {}),\n },\n }\n}\n\nexport function getDefineEnv({\n isTurbopack,\n clientRouterFilters,\n config,\n dev,\n distDir,\n projectPath,\n fetchCacheKeyPrefix,\n hasRewrites,\n isClient,\n isEdgeServer,\n isNodeServer,\n middlewareMatchers,\n omitNonDeterministic,\n rewrites,\n}: DefineEnvOptions): SerializedDefineEnv {\n const nextPublicEnv = getNextPublicEnvironmentVariables()\n const nextConfigEnv = getNextConfigEnv(config)\n\n const isPPREnabled = checkIsAppPPREnabled(config.experimental.ppr)\n const isCacheComponentsEnabled = !!config.cacheComponents\n const isUseCacheEnabled = !!config.experimental.useCache\n\n const defineEnv: DefineEnv = {\n // internal field to identify the plugin config\n __NEXT_DEFINE_ENV: true,\n\n ...nextPublicEnv,\n ...nextConfigEnv,\n ...(!isEdgeServer\n ? {}\n : {\n EdgeRuntime:\n /**\n * Cloud providers can set this environment variable to allow users\n * and library authors to have different implementations based on\n * the runtime they are running with, if it's not using `edge-runtime`\n */\n process.env.NEXT_EDGE_RUNTIME_PROVIDER ?? 'edge-runtime',\n\n // process should be only { env: {...} } for edge runtime.\n // For ignore avoid warn on `process.emit` usage but directly omit it.\n 'process.emit': false,\n }),\n 'process.turbopack': isTurbopack,\n 'process.env.TURBOPACK': isTurbopack,\n 'process.env.__NEXT_BUNDLER': isTurbopack\n ? 'Turbopack'\n : process.env.NEXT_RSPACK\n ? 'Rspack'\n : 'Webpack',\n // TODO: enforce `NODE_ENV` on `process.env`, and add a test:\n 'process.env.NODE_ENV':\n dev || config.experimental.allowDevelopmentBuild\n ? 'development'\n : 'production',\n 'process.env.__NEXT_DEV_SERVER': dev ? '1' : '',\n 'process.env.__NEXT_DISABLE_DEV_OVERLAY_UX':\n process.env.NEXT_PRIVATE_DISABLE_DEV_OVERLAY_UX === '1',\n 'process.env.NEXT_RUNTIME': isEdgeServer\n ? 'edge'\n : isNodeServer\n ? 'nodejs'\n : '',\n 'process.env.NEXT_MINIMAL': '',\n 'process.env.__NEXT_APP_NAV_FAIL_HANDLING': Boolean(\n config.experimental.appNavFailHandling\n ),\n 'process.env.__NEXT_APP_NEW_SCROLL_HANDLER': Boolean(\n config.experimental.appNewScrollHandler\n ),\n 'process.env.__NEXT_PPR': isPPREnabled,\n 'process.env.__NEXT_CACHE_COMPONENTS': isCacheComponentsEnabled,\n 'process.env.__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS': Boolean(\n config.experimental.cachedNavigations\n ),\n 'process.env.__NEXT_INSTANT_NAV_TOGGLE': isCacheComponentsEnabled,\n 'process.env.__NEXT_USE_CACHE': isUseCacheEnabled,\n 'process.env.__NEXT_USE_NODE_STREAMS': isEdgeServer ? false : true,\n\n 'process.env.NEXT_SUPPORTS_IMMUTABLE_ASSETS':\n config.experimental.supportsImmutableAssets || false,\n\n ...(config.experimental?.useSkewCookie || !config.deploymentId\n ? {\n 'process.env.NEXT_DEPLOYMENT_ID': false,\n }\n : isClient\n ? isTurbopack\n ? {\n // This is set at runtime by packages/next/src/client/register-deployment-id-global.ts\n 'process.env.NEXT_DEPLOYMENT_ID': {\n [DEFINE_ENV_EXPRESSION]: 'globalThis.NEXT_DEPLOYMENT_ID',\n },\n }\n : {\n // For Webpack, we currently don't use the non-inlining globalThis.NEXT_DEPLOYMENT_ID\n // approach because we cannot forward this global variable to web workers easily.\n 'process.env.NEXT_DEPLOYMENT_ID': config.deploymentId || false,\n }\n : config.experimental?.runtimeServerDeploymentId\n ? {\n // Don't inline at all, keep process.env.NEXT_DEPLOYMENT_ID as is\n }\n : {\n 'process.env.NEXT_DEPLOYMENT_ID': config.deploymentId || false,\n }),\n\n // Propagates the `__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING` environment\n // variable to the client.\n 'process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING':\n process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING || false,\n 'process.env.__NEXT_FETCH_CACHE_KEY_PREFIX': fetchCacheKeyPrefix ?? '',\n ...(isTurbopack\n ? {}\n : {\n 'process.env.__NEXT_MIDDLEWARE_MATCHERS': middlewareMatchers ?? [],\n }),\n 'process.env.__NEXT_MANUAL_CLIENT_BASE_PATH':\n config.experimental.manualClientBasePath ?? false,\n 'process.env.__NEXT_CLIENT_ROUTER_DYNAMIC_STALETIME': JSON.stringify(\n isNaN(Number(config.experimental.staleTimes?.dynamic))\n ? 0\n : config.experimental.staleTimes?.dynamic\n ),\n 'process.env.__NEXT_CLIENT_ROUTER_STATIC_STALETIME': JSON.stringify(\n isNaN(Number(config.experimental.staleTimes?.static))\n ? 5 * 60 // 5 minutes\n : config.experimental.staleTimes?.static\n ),\n 'process.env.__NEXT_CLIENT_ROUTER_FILTER_ENABLED':\n config.experimental.clientRouterFilter ?? true,\n 'process.env.__NEXT_CLIENT_ROUTER_S_FILTER':\n clientRouterFilters?.staticFilter ?? false,\n 'process.env.__NEXT_CLIENT_ROUTER_D_FILTER':\n clientRouterFilters?.dynamicFilter ?? false,\n 'process.env.__NEXT_CLIENT_VALIDATE_RSC_REQUEST_HEADERS': Boolean(\n config.experimental.validateRSCRequestHeaders\n ),\n 'process.env.__NEXT_DYNAMIC_ON_HOVER': Boolean(\n config.experimental.dynamicOnHover\n ),\n 'process.env.__NEXT_USE_OFFLINE': Boolean(config.experimental.useOffline),\n 'process.env.__NEXT_PREFETCH_INLINING': Boolean(\n config.experimental.prefetchInlining\n ),\n 'process.env.__NEXT_OPTIMISTIC_CLIENT_CACHE':\n config.experimental.optimisticClientCache ?? true,\n 'process.env.__NEXT_MIDDLEWARE_PREFETCH':\n config.experimental.proxyPrefetch ?? 'flexible',\n 'process.env.__NEXT_CROSS_ORIGIN': config.crossOrigin,\n 'process.browser': isClient,\n 'process.env.__NEXT_TEST_MODE': process.env.__NEXT_TEST_MODE ?? false,\n // This is used in client/dev-error-overlay/hot-dev-client.js to replace the dist directory\n ...(dev && (isClient ?? isEdgeServer)\n ? {\n 'process.env.__NEXT_DIST_DIR': distDir,\n }\n : {}),\n // This is used in devtools to strip the project path in edge runtime,\n // as there's only a dummy `dir` value (`.`) as edge runtime doesn't have concept of file system.\n ...(dev && isEdgeServer\n ? {\n 'process.env.__NEXT_EDGE_PROJECT_DIR': isTurbopack\n ? path.relative(process.cwd(), projectPath)\n : projectPath,\n }\n : {}),\n 'process.env.__NEXT_BASE_PATH': config.basePath,\n 'process.env.__NEXT_CASE_SENSITIVE_ROUTES': Boolean(\n config.experimental.caseSensitiveRoutes\n ),\n 'process.env.__NEXT_REWRITES': rewrites as any,\n 'process.env.__NEXT_TRAILING_SLASH': config.trailingSlash,\n 'process.env.__NEXT_DEV_INDICATOR': config.devIndicators !== false,\n 'process.env.__NEXT_DEV_INDICATOR_POSITION':\n config.devIndicators === false\n ? 'bottom-left' // This will not be used as the indicator is disabled.\n : (config.devIndicators.position ?? 'bottom-left'),\n 'process.env.__NEXT_STRICT_MODE':\n config.reactStrictMode === null ? false : config.reactStrictMode,\n 'process.env.__NEXT_STRICT_MODE_APP':\n // When next.config.js does not have reactStrictMode it's enabled by default.\n config.reactStrictMode === null ? true : config.reactStrictMode,\n 'process.env.__NEXT_OPTIMIZE_CSS':\n (config.experimental.optimizeCss && !dev) ?? false,\n 'process.env.__NEXT_SCRIPT_WORKERS':\n (config.experimental.nextScriptWorkers && !dev) ?? false,\n 'process.env.__NEXT_SCROLL_RESTORATION':\n config.experimental.scrollRestoration ?? false,\n ...getImageConfig(config, dev),\n 'process.env.__NEXT_ROUTER_BASEPATH': config.basePath,\n 'process.env.__NEXT_HAS_REWRITES': hasRewrites,\n 'process.env.__NEXT_CONFIG_OUTPUT': config.output,\n 'process.env.__NEXT_I18N_SUPPORT': !!config.i18n,\n 'process.env.__NEXT_I18N_DOMAINS': config.i18n?.domains ?? false,\n 'process.env.__NEXT_I18N_CONFIG': config.i18n || '',\n 'process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE':\n config.skipProxyUrlNormalize,\n 'process.env.__NEXT_EXTERNAL_MIDDLEWARE_REWRITE_RESOLVE':\n config.experimental.externalProxyRewritesResolve ?? false,\n 'process.env.__NEXT_MANUAL_TRAILING_SLASH':\n config.skipTrailingSlashRedirect,\n 'process.env.__NEXT_HAS_WEB_VITALS_ATTRIBUTION':\n (config.experimental.webVitalsAttribution &&\n config.experimental.webVitalsAttribution.length > 0) ??\n false,\n 'process.env.__NEXT_WEB_VITALS_ATTRIBUTION':\n config.experimental.webVitalsAttribution ?? false,\n 'process.env.__NEXT_LINK_NO_TOUCH_START':\n config.experimental.linkNoTouchStart ?? false,\n 'process.env.__NEXT_ASSET_PREFIX': config.assetPrefix,\n 'process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS':\n !!config.experimental.authInterrupts,\n 'process.env.__NEXT_TELEMETRY_DISABLED': Boolean(\n process.env.NEXT_TELEMETRY_DISABLED\n ),\n ...(isNodeServer || isEdgeServer\n ? {\n // Fix bad-actors in the npm ecosystem (e.g. `node-formidable`)\n // This is typically found in unmaintained modules from the\n // pre-webpack era (common in server-side code)\n 'global.GENTLY': false,\n }\n : undefined),\n ...(isNodeServer || isEdgeServer\n ? {\n 'process.env.__NEXT_EXPERIMENTAL_REACT':\n needsExperimentalReact(config),\n }\n : undefined),\n\n 'process.env.__NEXT_MULTI_ZONE_DRAFT_MODE':\n config.experimental.multiZoneDraftMode ?? false,\n 'process.env.__NEXT_TRUST_HOST_HEADER':\n config.experimental.trustHostHeader ?? false,\n 'process.env.__NEXT_ALLOWED_REVALIDATE_HEADERS':\n config.experimental.allowedRevalidateHeaderKeys ?? [],\n ...(isNodeServer || isEdgeServer\n ? {\n 'process.env.__NEXT_RELATIVE_DIST_DIR': config.distDir,\n 'process.env.__NEXT_RELATIVE_PROJECT_DIR': path.relative(\n process.cwd(),\n projectPath\n ),\n }\n : {}),\n\n 'process.env.__NEXT_BROWSER_DEBUG_INFO_IN_TERMINAL': JSON.stringify(\n (config.logging && config.logging.browserToTerminal) || false\n ),\n 'process.env.__NEXT_MCP_SERVER': !!config.experimental.mcpServer,\n\n // The devtools need to know whether or not to show an option to clear the\n // bundler cache. This option may be removed later once Turbopack's\n // filesystem cache feature is more stable.\n //\n // This environment value is currently best-effort:\n // - It's possible to disable the webpack filesystem cache, but it's\n // unlikely for a user to do that.\n // - Rspack's filesystem cache is unstable and requires a different\n // configuration than webpack to enable (which we don't do).\n //\n // In the worst case we'll show an option to clear the cache, but it'll be a\n // no-op that just restarts the development server.\n 'process.env.__NEXT_BUNDLER_HAS_PERSISTENT_CACHE':\n !isTurbopack ||\n (config.experimental.turbopackFileSystemCacheForDev ?? false),\n 'process.env.__NEXT_REACT_DEBUG_CHANNEL':\n config.experimental.reactDebugChannel ?? false,\n 'process.env.__NEXT_TRANSITION_INDICATOR':\n config.experimental.transitionIndicator ?? false,\n 'process.env.__NEXT_GESTURE_TRANSITION':\n config.experimental.gestureTransition ?? false,\n 'process.env.__NEXT_OPTIMISTIC_ROUTING':\n config.experimental.optimisticRouting ?? false,\n 'process.env.__NEXT_INSTRUMENTATION_CLIENT_ROUTER_TRANSITION_EVENTS':\n config.experimental.instrumentationClientRouterTransitionEvents ?? false,\n 'process.env.__NEXT_APP_SHELLS': config.experimental.appShells ?? false,\n 'process.env.__NEXT_VARY_PARAMS': config.experimental.varyParams ?? false,\n 'process.env.__NEXT_EXPOSE_TESTING_API':\n dev || config.experimental.exposeTestingApiInProductionBuild === true,\n 'process.env.__NEXT_CACHE_LIFE': config.cacheLife,\n 'process.env.__NEXT_CLIENT_PARAM_PARSING_ORIGINS':\n config.experimental.clientParamParsingOrigins || [],\n }\n\n const userDefines = config.compiler?.define ?? {}\n for (const key in userDefines) {\n if (defineEnv.hasOwnProperty(key)) {\n throw new Error(\n `The \\`compiler.define\\` option is configured to replace the \\`${key}\\` variable. This variable is either part of a Next.js built-in or is already configured.`\n )\n }\n defineEnv[key] = userDefines[key]\n }\n\n if (isNodeServer || isEdgeServer) {\n const userDefinesServer = config.compiler?.defineServer ?? {}\n for (const key in userDefinesServer) {\n if (defineEnv.hasOwnProperty(key)) {\n throw new Error(\n `The \\`compiler.defineServer\\` option is configured to replace the \\`${key}\\` variable. This variable is either part of a Next.js built-in or is already configured.`\n )\n }\n defineEnv[key] = userDefinesServer[key]\n }\n }\n\n const serializedDefineEnv = serializeDefineEnv(defineEnv)\n\n // we delay inlining these values until after the build\n // with flying shuttle enabled so we can update them\n // without invalidating entries\n if (!dev && omitNonDeterministic) {\n // client uses window. instead of leaving process.env\n // in case process isn't polyfilled on client already\n // since by this point it won't be added by webpack\n const safeKey = (key: string) =>\n isClient ? `window.${key.split('.').pop()}` : key\n\n for (const key in nextPublicEnv) {\n serializedDefineEnv[key] = safeKey(key)\n }\n for (const key in nextConfigEnv) {\n serializedDefineEnv[key] = safeKey(key)\n }\n if (!config.experimental.runtimeServerDeploymentId) {\n for (const key of ['process.env.NEXT_DEPLOYMENT_ID']) {\n serializedDefineEnv[key] = safeKey(key)\n }\n }\n }\n\n return serializedDefineEnv\n}\n"],"names":["getDefineEnv","DEFINE_ENV_EXPRESSION","Symbol","serializeDefineEnv","defineEnv","defineEnvStringified","Object","fromEntries","entries","map","key","value","JSON","stringify","getImageConfig","config","dev","deviceSizes","images","imageSizes","qualities","path","loader","dangerouslyAllowSVG","unoptimized","domains","remotePatterns","localPatterns","output","isTurbopack","clientRouterFilters","distDir","projectPath","fetchCacheKeyPrefix","hasRewrites","isClient","isEdgeServer","isNodeServer","middlewareMatchers","omitNonDeterministic","rewrites","nextPublicEnv","getNextPublicEnvironmentVariables","nextConfigEnv","getNextConfigEnv","isPPREnabled","checkIsAppPPREnabled","experimental","ppr","isCacheComponentsEnabled","cacheComponents","isUseCacheEnabled","useCache","__NEXT_DEFINE_ENV","EdgeRuntime","process","env","NEXT_EDGE_RUNTIME_PROVIDER","NEXT_RSPACK","allowDevelopmentBuild","NEXT_PRIVATE_DISABLE_DEV_OVERLAY_UX","Boolean","appNavFailHandling","appNewScrollHandler","cachedNavigations","supportsImmutableAssets","useSkewCookie","deploymentId","runtimeServerDeploymentId","__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING","manualClientBasePath","isNaN","Number","staleTimes","dynamic","static","clientRouterFilter","staticFilter","dynamicFilter","validateRSCRequestHeaders","dynamicOnHover","useOffline","prefetchInlining","optimisticClientCache","proxyPrefetch","crossOrigin","__NEXT_TEST_MODE","relative","cwd","basePath","caseSensitiveRoutes","trailingSlash","devIndicators","position","reactStrictMode","optimizeCss","nextScriptWorkers","scrollRestoration","i18n","skipProxyUrlNormalize","externalProxyRewritesResolve","skipTrailingSlashRedirect","webVitalsAttribution","length","linkNoTouchStart","assetPrefix","authInterrupts","NEXT_TELEMETRY_DISABLED","undefined","needsExperimentalReact","multiZoneDraftMode","trustHostHeader","allowedRevalidateHeaderKeys","logging","browserToTerminal","mcpServer","turbopackFileSystemCacheForDev","reactDebugChannel","transitionIndicator","gestureTransition","optimisticRouting","instrumentationClientRouterTransitionEvents","appShells","varyParams","exposeTestingApiInProductionBuild","cacheLife","clientParamParsingOrigins","userDefines","compiler","define","hasOwnProperty","Error","userDefinesServer","defineServer","serializedDefineEnv","safeKey","split","pop"],"mappings":";;;;+BAwGgBA;;;eAAAA;;;iEAjGC;wCACsB;qBACF;2BAI9B;;;;;;AA8BP,MAAMC,wBAAwBC,OAAO;AAoBrC;;CAEC,GACD,SAASC,mBAAmBC,SAAoB;IAC9C,MAAMC,uBAA4CC,OAAOC,WAAW,CAClED,OAAOE,OAAO,CAACJ,WAAWK,GAAG,CAAC,CAAC,CAACC,KAAKC,MAAM,GAAK;YAC9CD;YACA,OAAOC,UAAU,YAAYV,yBAAyBU,QAClDA,KAAK,CAACV,sBAAsB,GAC5BW,KAAKC,SAAS,CAACF;SACpB;IAEH,OAAON;AACT;AAEA,SAASS,eACPC,MAA0B,EAC1BC,GAAY;QAUKD,gBAKSA,iBACDA;IAdzB,OAAO;QACL,iCAAiC;YAC/BE,aAAaF,OAAOG,MAAM,CAACD,WAAW;YACtCE,YAAYJ,OAAOG,MAAM,CAACC,UAAU;YACpCC,WAAWL,OAAOG,MAAM,CAACE,SAAS;YAClCC,MAAMN,OAAOG,MAAM,CAACG,IAAI;YACxBC,QAAQP,OAAOG,MAAM,CAACI,MAAM;YAC5BC,qBAAqBR,OAAOG,MAAM,CAACK,mBAAmB;YACtDC,WAAW,EAAET,2BAAAA,iBAAAA,OAAQG,MAAM,qBAAdH,eAAgBS,WAAW;YACxC,GAAIR,MACA;gBACE,6DAA6D;gBAC7DS,SAASV,OAAOG,MAAM,CAACO,OAAO;gBAC9BC,cAAc,GAAEX,kBAAAA,OAAOG,MAAM,qBAAbH,gBAAeW,cAAc;gBAC7CC,aAAa,GAAEZ,kBAAAA,OAAOG,MAAM,qBAAbH,gBAAeY,aAAa;gBAC3CC,QAAQb,OAAOa,MAAM;YACvB,IACA,CAAC,CAAC;QACR;IACF;AACF;AAEO,SAAS5B,aAAa,EAC3B6B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AM1D,OAAO;gBAAC;aAAiC,CAAE;gBACpD4H,mBAAmB,CAAC5H,IAAI,GAAG6H,QAAQ7H;YACrC;QACF;IACF;IAEA,OAAO4H;AACT","ignoreList":[0]} |
@@ -138,3 +138,3 @@ "use strict"; | ||
| }({}); | ||
| const nextVersion = "16.3.0-canary.58"; | ||
| const nextVersion = "16.3.0-canary.59"; | ||
| const ArchName = (0, _os.arch)(); | ||
@@ -141,0 +141,0 @@ const PlatformName = (0, _os.platform)(); |
@@ -96,3 +96,3 @@ "use strict"; | ||
| isPersistentCachingEnabled: persistentCaching, | ||
| nextVersion: "16.3.0-canary.58" | ||
| nextVersion: "16.3.0-canary.59" | ||
| }, { | ||
@@ -99,0 +99,0 @@ turbopackMemoryEviction: config.experimental.turbopackMemoryEvictionMode, |
@@ -118,3 +118,3 @@ // Import cpu-profile first to start profiling early if enabled | ||
| deferredEntries: config.experimental.deferredEntries, | ||
| nextVersion: "16.3.0-canary.58" | ||
| nextVersion: "16.3.0-canary.59" | ||
| }; | ||
@@ -121,0 +121,0 @@ const sharedTurboOptions = { |
| import type { webpack } from 'next/dist/compiled/webpack/webpack'; | ||
| /** | ||
| * Loader options for `next-instrumentation-client-loader`. The list of inject | ||
| * specifiers is JSON-stringified so it can travel through the loader query | ||
| * string. | ||
| */ | ||
| export type InstrumentationClientLoaderOptions = { | ||
| /** JSON-stringified `string[]` of module specifiers. */ | ||
| injects: string; | ||
| modules: string[]; | ||
| }; | ||
| declare const NextInstrumentationClientLoader: webpack.LoaderDefinitionFunction<InstrumentationClientLoaderOptions>; | ||
| export default NextInstrumentationClientLoader; |
@@ -11,36 +11,19 @@ "use strict"; | ||
| }); | ||
| const _util = require("util"); | ||
| const NextInstrumentationClientLoader = function() { | ||
| const callback = this.async(); | ||
| const { injects: injectsStringified } = this.getOptions(); | ||
| const injects = JSON.parse(injectsStringified || '[]'); | ||
| // No injects: the alias is a transparent passthrough to the user's | ||
| // `instrumentation-client.{pageExt}` (or the empty module fallback). | ||
| if (injects.length === 0) { | ||
| callback(null, `module.exports = require('private-next-instrumentation-client-user');\n`); | ||
| return; | ||
| const NextInstrumentationClientLoader = async function() { | ||
| const { modules } = this.getOptions(); | ||
| if (modules.length === 0) { | ||
| return `module.exports = require('private-next-instrumentation-client-user');\n`; | ||
| } | ||
| // Resolve each inject specifier against the project root so the emitted | ||
| // Resolve each module specifier against the project root so the emitted | ||
| // `require()` calls don't get resolved relative to the stub's location | ||
| // inside `node_modules/next/`. Bare specifiers (npm package names) are | ||
| // resolved against the project's `node_modules`. | ||
| const resolve = (0, _util.promisify)(this.resolve); | ||
| const resolve = this.getResolve(); | ||
| const rootContext = this.rootContext; | ||
| Promise.all(injects.map((spec)=>resolve(rootContext, spec))).then((resolvedInjects)=>{ | ||
| const allModules = [ | ||
| ...resolvedInjects, | ||
| 'private-next-instrumentation-client-user' | ||
| ]; | ||
| const lines = []; | ||
| allModules.forEach((spec, i)=>{ | ||
| lines.push(`var mod_${i} = require(${JSON.stringify(spec)});`); | ||
| }); | ||
| // Compose a single `onRouterTransitionStart` that fans out to every | ||
| // module's hook (when exported), in array order, with the user file's | ||
| // hook running last. | ||
| const hookCalls = allModules.map(// Webpack doesn't transpile this, so use a manual version of optional chaining. | ||
| (_, i)=>` mod_${i} && mod_${i}.onRouterTransitionStart && mod_${i}.onRouterTransitionStart(url, type);`).join('\n'); | ||
| lines.push(`module.exports = {`, ` onRouterTransitionStart: function (url, type) {`, hookCalls, ` },`, `};`); | ||
| callback(null, lines.join('\n') + '\n'); | ||
| }).catch((err)=>callback(err)); | ||
| const resolvedModules = await Promise.all(modules.map((spec)=>resolve(rootContext, spec))); | ||
| const allModules = [ | ||
| ...resolvedModules, | ||
| 'private-next-instrumentation-client-user' | ||
| ]; | ||
| return `module.exports = [${allModules.map((spec)=>`require(${JSON.stringify(spec)})`).join(',')}];\n`; | ||
| }; | ||
@@ -47,0 +30,0 @@ const _default = NextInstrumentationClientLoader; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/build/webpack/loaders/next-instrumentation-client-loader.ts"],"sourcesContent":["import { promisify } from 'util'\nimport type { webpack } from 'next/dist/compiled/webpack/webpack'\n\n/**\n * Loader options for `next-instrumentation-client-loader`. The list of inject\n * specifiers is JSON-stringified so it can travel through the loader query\n * string.\n */\nexport type InstrumentationClientLoaderOptions = {\n /** JSON-stringified `string[]` of module specifiers. */\n injects: string\n}\n\nconst NextInstrumentationClientLoader: webpack.LoaderDefinitionFunction<InstrumentationClientLoaderOptions> =\n function () {\n const callback = this.async()\n const { injects: injectsStringified } = this.getOptions()\n const injects = JSON.parse(injectsStringified || '[]') as string[]\n\n // No injects: the alias is a transparent passthrough to the user's\n // `instrumentation-client.{pageExt}` (or the empty module fallback).\n if (injects.length === 0) {\n callback(\n null,\n `module.exports = require('private-next-instrumentation-client-user');\\n`\n )\n return\n }\n\n // Resolve each inject specifier against the project root so the emitted\n // `require()` calls don't get resolved relative to the stub's location\n // inside `node_modules/next/`. Bare specifiers (npm package names) are\n // resolved against the project's `node_modules`.\n const resolve = promisify(this.resolve)\n const rootContext = this.rootContext\n\n Promise.all(injects.map((spec) => resolve(rootContext, spec)))\n .then((resolvedInjects) => {\n const allModules = [\n ...resolvedInjects,\n 'private-next-instrumentation-client-user',\n ]\n\n const lines: string[] = []\n allModules.forEach((spec, i) => {\n lines.push(`var mod_${i} = require(${JSON.stringify(spec)});`)\n })\n\n // Compose a single `onRouterTransitionStart` that fans out to every\n // module's hook (when exported), in array order, with the user file's\n // hook running last.\n const hookCalls = allModules\n .map(\n // Webpack doesn't transpile this, so use a manual version of optional chaining.\n (_, i) =>\n ` mod_${i} && mod_${i}.onRouterTransitionStart && mod_${i}.onRouterTransitionStart(url, type);`\n )\n .join('\\n')\n\n lines.push(\n `module.exports = {`,\n ` onRouterTransitionStart: function (url, type) {`,\n hookCalls,\n ` },`,\n `};`\n )\n\n callback(null, lines.join('\\n') + '\\n')\n })\n .catch((err) => callback(err))\n }\n\nexport default NextInstrumentationClientLoader\n"],"names":["NextInstrumentationClientLoader","callback","async","injects","injectsStringified","getOptions","JSON","parse","length","resolve","promisify","rootContext","Promise","all","map","spec","then","resolvedInjects","allModules","lines","forEach","i","push","stringify","hookCalls","_","join","catch","err"],"mappings":";;;;+BAwEA;;;eAAA;;;sBAxE0B;AAa1B,MAAMA,kCACJ;IACE,MAAMC,WAAW,IAAI,CAACC,KAAK;IAC3B,MAAM,EAAEC,SAASC,kBAAkB,EAAE,GAAG,IAAI,CAACC,UAAU;IACvD,MAAMF,UAAUG,KAAKC,KAAK,CAACH,sBAAsB;IAEjD,mEAAmE;IACnE,qEAAqE;IACrE,IAAID,QAAQK,MAAM,KAAK,GAAG;QACxBP,SACE,MACA,CAAC,uEAAuE,CAAC;QAE3E;IACF;IAEA,wEAAwE;IACxE,uEAAuE;IACvE,uEAAuE;IACvE,iDAAiD;IACjD,MAAMQ,UAAUC,IAAAA,eAAS,EAAC,IAAI,CAACD,OAAO;IACtC,MAAME,cAAc,IAAI,CAACA,WAAW;IAEpCC,QAAQC,GAAG,CAACV,QAAQW,GAAG,CAAC,CAACC,OAASN,QAAQE,aAAaI,QACpDC,IAAI,CAAC,CAACC;QACL,MAAMC,aAAa;eACdD;YACH;SACD;QAED,MAAME,QAAkB,EAAE;QAC1BD,WAAWE,OAAO,CAAC,CAACL,MAAMM;YACxBF,MAAMG,IAAI,CAAC,CAAC,QAAQ,EAAED,EAAE,WAAW,EAAEf,KAAKiB,SAAS,CAACR,MAAM,EAAE,CAAC;QAC/D;QAEA,oEAAoE;QACpE,sEAAsE;QACtE,qBAAqB;QACrB,MAAMS,YAAYN,WACfJ,GAAG,CACF,gFAAgF;QAChF,CAACW,GAAGJ,IACF,CAAC,QAAQ,EAAEA,EAAE,QAAQ,EAAEA,EAAE,gCAAgC,EAAEA,EAAE,oCAAoC,CAAC,EAErGK,IAAI,CAAC;QAERP,MAAMG,IAAI,CACR,CAAC,kBAAkB,CAAC,EACpB,CAAC,iDAAiD,CAAC,EACnDE,WACA,CAAC,IAAI,CAAC,EACN,CAAC,EAAE,CAAC;QAGNvB,SAAS,MAAMkB,MAAMO,IAAI,CAAC,QAAQ;IACpC,GACCC,KAAK,CAAC,CAACC,MAAQ3B,SAAS2B;AAC7B;MAEF,WAAe5B","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/build/webpack/loaders/next-instrumentation-client-loader.ts"],"sourcesContent":["import type { webpack } from 'next/dist/compiled/webpack/webpack'\n\nexport type InstrumentationClientLoaderOptions = {\n modules: string[]\n}\n\nconst NextInstrumentationClientLoader: webpack.LoaderDefinitionFunction<InstrumentationClientLoaderOptions> =\n async function () {\n const { modules } = this.getOptions()\n\n if (modules.length === 0) {\n return `module.exports = require('private-next-instrumentation-client-user');\\n`\n }\n\n // Resolve each module specifier against the project root so the emitted\n // `require()` calls don't get resolved relative to the stub's location\n // inside `node_modules/next/`. Bare specifiers (npm package names) are\n // resolved against the project's `node_modules`.\n const resolve = this.getResolve()\n const rootContext = this.rootContext\n const resolvedModules = await Promise.all(\n modules.map((spec) => resolve(rootContext, spec))\n )\n const allModules = [\n ...resolvedModules,\n 'private-next-instrumentation-client-user',\n ]\n\n return `module.exports = [${allModules\n .map((spec) => `require(${JSON.stringify(spec)})`)\n .join(',')}];\\n`\n }\n\nexport default NextInstrumentationClientLoader\n"],"names":["NextInstrumentationClientLoader","modules","getOptions","length","resolve","getResolve","rootContext","resolvedModules","Promise","all","map","spec","allModules","JSON","stringify","join"],"mappings":";;;;+BAiCA;;;eAAA;;;AA3BA,MAAMA,kCACJ;IACE,MAAM,EAAEC,OAAO,EAAE,GAAG,IAAI,CAACC,UAAU;IAEnC,IAAID,QAAQE,MAAM,KAAK,GAAG;QACxB,OAAO,CAAC,uEAAuE,CAAC;IAClF;IAEA,wEAAwE;IACxE,uEAAuE;IACvE,uEAAuE;IACvE,iDAAiD;IACjD,MAAMC,UAAU,IAAI,CAACC,UAAU;IAC/B,MAAMC,cAAc,IAAI,CAACA,WAAW;IACpC,MAAMC,kBAAkB,MAAMC,QAAQC,GAAG,CACvCR,QAAQS,GAAG,CAAC,CAACC,OAASP,QAAQE,aAAaK;IAE7C,MAAMC,aAAa;WACdL;QACH;KACD;IAED,OAAO,CAAC,kBAAkB,EAAEK,WACzBF,GAAG,CAAC,CAACC,OAAS,CAAC,QAAQ,EAAEE,KAAKC,SAAS,CAACH,MAAM,CAAC,CAAC,EAChDI,IAAI,CAAC,KAAK,IAAI,CAAC;AACpB;MAEF,WAAef","ignoreList":[0]} |
@@ -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/05b_gcbgceui8.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"lQumeogqGj9rLwutx5Cdz"} | ||
| 0:{"rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/_next/static/chunks/05b_gcbgceui8.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"sRXB6WuUB643rtLbdeXT2"} | ||
| 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/0mazty1qdo6b-.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/05b_gcbgceui8.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":"lQumeogqGj9rLwutx5Cdz"} | ||
| 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/0mazty1qdo6b-.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/05b_gcbgceui8.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":"sRXB6WuUB643rtLbdeXT2"} | ||
| 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":"lQumeogqGj9rLwutx5Cdz"} | ||
| 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":"sRXB6WuUB643rtLbdeXT2"} |
@@ -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/0mazty1qdo6b-.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":"lQumeogqGj9rLwutx5Cdz"} | ||
| 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/0mazty1qdo6b-.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":"sRXB6WuUB643rtLbdeXT2"} |
| :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":"lQumeogqGj9rLwutx5Cdz"} | ||
| 0:{"tree":{"name":"","param":null,"prefetchHints":16,"slots":{"children":{"name":"__PAGE__","param":null,"prefetchHints":0,"slots":null}}},"staleTime":300,"buildId":"sRXB6WuUB643rtLbdeXT2"} |
@@ -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/0~u.m.zgvqht8.js"/><script src="/_next/static/chunks/0md3m_jk0kgle.js" async=""></script><script src="/_next/static/chunks/0-kd1riygc62h.js" async=""></script><script src="/_next/static/chunks/turbopack-17734tu~jcil6.js" async=""></script><script src="/_next/static/chunks/0mazty1qdo6b-.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/0~u.m.zgvqht8.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[41707,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"default\"]\n3:I[17783,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"default\"]\n4:I[71929,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[71929,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"ViewportBoundary\"]\na:I[71929,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"MetadataBoundary\"]\nc:I[24930,[\"/_next/static/chunks/0mazty1qdo6b-.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/0mazty1qdo6b-.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\":\"lQumeogqGj9rLwutx5Cdz\"}\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/0~u.m.zgvqht8.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[41707,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"default\"]\n3:I[17783,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"default\"]\n4:I[71929,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[71929,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"ViewportBoundary\"]\na:I[71929,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"MetadataBoundary\"]\nc:I[24930,[\"/_next/static/chunks/0mazty1qdo6b-.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/0mazty1qdo6b-.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\":\"sRXB6WuUB643rtLbdeXT2\"}\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/0mazty1qdo6b-.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":"lQumeogqGj9rLwutx5Cdz"} | ||
| 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/0mazty1qdo6b-.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":"sRXB6WuUB643rtLbdeXT2"} | ||
| 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/0mazty1qdo6b-.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":"lQumeogqGj9rLwutx5Cdz"} | ||
| 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/0mazty1qdo6b-.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":"sRXB6WuUB643rtLbdeXT2"} | ||
| 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":"lQumeogqGj9rLwutx5Cdz"} | ||
| 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":"sRXB6WuUB643rtLbdeXT2"} |
@@ -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/0mazty1qdo6b-.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":"lQumeogqGj9rLwutx5Cdz"} | ||
| 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/0mazty1qdo6b-.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":"sRXB6WuUB643rtLbdeXT2"} |
| 1:"$Sreact.fragment" | ||
| 2:I[71929,["/_next/static/chunks/0mazty1qdo6b-.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":"lQumeogqGj9rLwutx5Cdz"} | ||
| 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":"sRXB6WuUB643rtLbdeXT2"} | ||
| 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":"lQumeogqGj9rLwutx5Cdz"} | ||
| 0:{"rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"isPartial":false,"staleTime":300,"varyParams":"$W4","buildId":"sRXB6WuUB643rtLbdeXT2"} |
| :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":"lQumeogqGj9rLwutx5Cdz"} | ||
| 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":"sRXB6WuUB643rtLbdeXT2"} |
@@ -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/0~u.m.zgvqht8.js"/><script src="/_next/static/chunks/0md3m_jk0kgle.js" async=""></script><script src="/_next/static/chunks/0-kd1riygc62h.js" async=""></script><script src="/_next/static/chunks/turbopack-17734tu~jcil6.js" async=""></script><script src="/_next/static/chunks/0mazty1qdo6b-.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/0~u.m.zgvqht8.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[41707,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"default\"]\n3:I[17783,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"default\"]\n4:I[71929,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[71929,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"ViewportBoundary\"]\na:I[71929,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"MetadataBoundary\"]\nc:I[24930,[\"/_next/static/chunks/0mazty1qdo6b-.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/0mazty1qdo6b-.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\":\"lQumeogqGj9rLwutx5Cdz\"}\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/0~u.m.zgvqht8.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[41707,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"default\"]\n3:I[17783,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"default\"]\n4:I[71929,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[71929,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"ViewportBoundary\"]\na:I[71929,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"MetadataBoundary\"]\nc:I[24930,[\"/_next/static/chunks/0mazty1qdo6b-.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/0mazty1qdo6b-.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\":\"sRXB6WuUB643rtLbdeXT2\"}\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/0~u.m.zgvqht8.js"/><script src="/_next/static/chunks/0md3m_jk0kgle.js" async=""></script><script src="/_next/static/chunks/0-kd1riygc62h.js" async=""></script><script src="/_next/static/chunks/turbopack-17734tu~jcil6.js" async=""></script><script src="/_next/static/chunks/0mazty1qdo6b-.js" async=""></script><script src="/_next/static/chunks/05b_gcbgceui8.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/0~u.m.zgvqht8.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[41707,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"default\"]\n3:I[17783,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"default\"]\n4:I[73336,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"ClientPageRoot\"]\n5:I[79331,[\"/_next/static/chunks/0mazty1qdo6b-.js\",\"/_next/static/chunks/05b_gcbgceui8.js\"],\"default\"]\n8:I[71929,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"OutletBoundary\"]\n9:\"$Sreact.suspense\"\nb:I[71929,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"ViewportBoundary\"]\nd:I[71929,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"MetadataBoundary\"]\nf:I[24930,[\"/_next/static/chunks/0mazty1qdo6b-.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/0mazty1qdo6b-.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/05b_gcbgceui8.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\":\"lQumeogqGj9rLwutx5Cdz\"}\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/0~u.m.zgvqht8.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[41707,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"default\"]\n3:I[17783,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"default\"]\n4:I[73336,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"ClientPageRoot\"]\n5:I[79331,[\"/_next/static/chunks/0mazty1qdo6b-.js\",\"/_next/static/chunks/05b_gcbgceui8.js\"],\"default\"]\n8:I[71929,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"OutletBoundary\"]\n9:\"$Sreact.suspense\"\nb:I[71929,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"ViewportBoundary\"]\nd:I[71929,[\"/_next/static/chunks/0mazty1qdo6b-.js\"],\"MetadataBoundary\"]\nf:I[24930,[\"/_next/static/chunks/0mazty1qdo6b-.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/0mazty1qdo6b-.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/05b_gcbgceui8.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\":\"sRXB6WuUB643rtLbdeXT2\"}\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/0mazty1qdo6b-.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/05b_gcbgceui8.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":"lQumeogqGj9rLwutx5Cdz"} | ||
| 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/0mazty1qdo6b-.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/05b_gcbgceui8.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":"sRXB6WuUB643rtLbdeXT2"} | ||
| 6:{} | ||
@@ -15,0 +15,0 @@ 7:"$0:f:0:1:1:children:0:props:children:0:props:serverProvidedParams:params" |
@@ -42,3 +42,3 @@ #!/usr/bin/env node | ||
| const nextBuild = async (options, directory)=>{ | ||
| process.title = `next-build (v${"16.3.0-canary.58"})`; | ||
| process.title = `next-build (v${"16.3.0-canary.59"})`; | ||
| process.on('SIGTERM', ()=>{ | ||
@@ -45,0 +45,0 @@ (0, _cpuprofile.saveCpuProfile)(); |
@@ -43,3 +43,3 @@ #!/usr/bin/env node | ||
| const bindings = await (0, _swc.loadBindings)((_config_experimental1 = config.experimental) == null ? void 0 : _config_experimental1.useWasmBinary); | ||
| await bindings.turbo.databaseCompact(cachePath, "16.3.0-canary.58"); | ||
| await bindings.turbo.databaseCompact(cachePath, "16.3.0-canary.59"); | ||
| console.log('Turbopack database compaction complete.'); | ||
@@ -46,0 +46,0 @@ }; |
| #!/usr/bin/env node | ||
| export type NextTypegenOptions = { | ||
| dir?: string; | ||
| webpack?: boolean; | ||
| }; | ||
| declare const nextTypegen: (_options: NextTypegenOptions, directory?: string) => Promise<void>; | ||
| declare const nextTypegen: (options: NextTypegenOptions, directory?: string) => Promise<void>; | ||
| export { nextTypegen }; |
@@ -22,2 +22,3 @@ #!/usr/bin/env node | ||
| const _routediscovery = require("../build/route-discovery"); | ||
| const _bundler = require("../lib/bundler"); | ||
| const _routetypesutils = require("../server/lib/router-utils/route-types-utils"); | ||
@@ -73,4 +74,5 @@ const _cachelifetypeutils = require("../server/lib/router-utils/cache-life-type-utils"); | ||
| } | ||
| const nextTypegen = async (_options, directory)=>{ | ||
| const nextTypegen = async (options, directory)=>{ | ||
| var _nextConfig_experimental; | ||
| (0, _bundler.parseBundlerArgs)(options); | ||
| const baseDir = (0, _getprojectdir.getProjectDir)(directory); | ||
@@ -77,0 +79,0 @@ // Check if the provided directory exists |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/cli/next-typegen.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { existsSync } from 'fs'\nimport path, { join } from 'path'\nimport { mkdir } from 'fs/promises'\n\nimport loadConfig from '../server/config'\nimport { printAndExit } from '../server/lib/utils'\nimport { PHASE_PRODUCTION_BUILD } from '../shared/lib/constants'\nimport { getProjectDir } from '../lib/get-project-dir'\nimport { findPagesDir } from '../lib/find-pages-dir'\nimport { verifyAndRunTypeScript } from '../lib/verify-typescript-setup'\nimport { discoverRoutes } from '../build/route-discovery'\n\nimport {\n createRouteTypesManifest,\n writeRouteTypesManifest,\n writeValidatorFile,\n} from '../server/lib/router-utils/route-types-utils'\nimport { writeCacheLifeTypes } from '../server/lib/router-utils/cache-life-type-utils'\nimport { writeRootParamsTypes } from '../server/lib/router-utils/root-params-type-utils'\nimport { installBindings } from '../build/swc/install-bindings'\n\nexport type NextTypegenOptions = {\n dir?: string\n}\n\nconst nextTypegen = async (\n _options: NextTypegenOptions,\n directory?: string\n) => {\n const baseDir = getProjectDir(directory)\n\n // Check if the provided directory exists\n if (!existsSync(baseDir)) {\n printAndExit(`> No such directory exists as the project root: ${baseDir}`)\n }\n\n const nextConfig = await loadConfig(PHASE_PRODUCTION_BUILD, baseDir)\n await installBindings(nextConfig.experimental?.useWasmBinary)\n const distDir = join(baseDir, nextConfig.distDir)\n const { pagesDir, appDir } = findPagesDir(baseDir)\n\n const strictRouteTypes = Boolean(nextConfig.experimental.strictRouteTypes)\n\n await verifyAndRunTypeScript({\n dir: baseDir,\n distDir: nextConfig.distDir,\n strictRouteTypes,\n shouldRunTypeCheck: false,\n tsconfigPath: nextConfig.typescript.tsconfigPath,\n typedRoutes: Boolean(nextConfig.typedRoutes),\n disableStaticImages: nextConfig.images.disableStaticImages,\n hasAppDir: !!appDir,\n hasPagesDir: !!pagesDir,\n appDir: appDir || undefined,\n pagesDir: pagesDir || undefined,\n })\n\n console.log('Generating route types...')\n\n const routeTypesFilePath = join(distDir, 'types', 'routes.d.ts')\n const validatorFilePath = join(distDir, 'types', 'validator.ts')\n await mkdir(join(distDir, 'types'), { recursive: true })\n\n const isSrcDir = path\n .relative(baseDir, pagesDir || appDir || '')\n .startsWith('src')\n\n // Build all routes (pages + app + slots)\n const {\n pageRoutes,\n pageApiRoutes,\n appRoutes,\n appRouteHandlers,\n layoutRoutes,\n slots,\n } = await discoverRoutes({\n appDir: appDir || undefined,\n pagesDir: pagesDir || undefined,\n pageExtensions: nextConfig.pageExtensions,\n isDev: false,\n baseDir,\n isSrcDir,\n })\n\n const routeTypesManifest = await createRouteTypesManifest({\n dir: baseDir,\n pageRoutes,\n appRoutes,\n appRouteHandlers,\n pageApiRoutes,\n layoutRoutes,\n slots,\n redirects: nextConfig.redirects,\n rewrites: nextConfig.rewrites,\n validatorFilePath,\n })\n\n await writeRouteTypesManifest(\n routeTypesManifest,\n routeTypesFilePath,\n nextConfig\n )\n\n await writeValidatorFile(\n routeTypesManifest,\n validatorFilePath,\n strictRouteTypes\n )\n\n // Generate cache-life types if cacheLife config exists\n const cacheLifeFilePath = join(distDir, 'types', 'cache-life.d.ts')\n writeCacheLifeTypes(nextConfig.cacheLife, cacheLifeFilePath)\n\n await writeRootParamsTypes(\n routeTypesManifest,\n join(distDir, 'types', 'root-params.d.ts')\n )\n\n console.log('✓ Types generated successfully')\n}\n\nexport { nextTypegen }\n"],"names":["nextTypegen","_options","directory","nextConfig","baseDir","getProjectDir","existsSync","printAndExit","loadConfig","PHASE_PRODUCTION_BUILD","installBindings","experimental","useWasmBinary","distDir","join","pagesDir","appDir","findPagesDir","strictRouteTypes","Boolean","verifyAndRunTypeScript","dir","shouldRunTypeCheck","tsconfigPath","typescript","typedRoutes","disableStaticImages","images","hasAppDir","hasPagesDir","undefined","console","log","routeTypesFilePath","validatorFilePath","mkdir","recursive","isSrcDir","path","relative","startsWith","pageRoutes","pageApiRoutes","appRoutes","appRouteHandlers","layoutRoutes","slots","discoverRoutes","pageExtensions","isDev","routeTypesManifest","createRouteTypesManifest","redirects","rewrites","writeRouteTypesManifest","writeValidatorFile","cacheLifeFilePath","writeCacheLifeTypes","cacheLife","writeRootParamsTypes"],"mappings":";;;;;+BA2HSA;;;eAAAA;;;oBAzHkB;8DACA;0BACL;+DAEC;uBACM;2BACU;+BACT;8BACD;uCACU;gCACR;iCAMxB;oCAC6B;qCACC;iCACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMhC,MAAMA,cAAc,OAClBC,UACAC;QAUsBC;IARtB,MAAMC,UAAUC,IAAAA,4BAAa,EAACH;IAE9B,yCAAyC;IACzC,IAAI,CAACI,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QAClBf,UAAUA,YAAYe;QACtBkB,gBAAgB7C,WAAW6C,cAAc;QACzCC,OAAO;QACP7C;QACAiC;IACF;IAEA,MAAMa,qBAAqB,MAAMC,IAAAA,yCAAwB,EAAC;QACxD9B,KAAKjB;QACLqC;QACAE;QACAC;QACAF;QACAG;QACAC;QACAM,WAAWjD,WAAWiD,SAAS;QAC/BC,UAAUlD,WAAWkD,QAAQ;QAC7BnB;IACF;IAEA,MAAMoB,IAAAA,wCAAuB,EAC3BJ,oBACAjB,oBACA9B;IAGF,MAAMoD,IAAAA,mCAAkB,EACtBL,oBACAhB,mBACAhB;IAGF,uDAAuD;IACvD,MAAMsC,oBAAoB1C,IAAAA,UAAI,EAACD,SAAS,SAAS;IACjD4C,IAAAA,uCAAmB,EAACtD,WAAWuD,SAAS,EAAEF;IAE1C,MAAMG,IAAAA,yCAAoB,EACxBT,oBACApC,IAAAA,UAAI,EAACD,SAAS,SAAS;IAGzBkB,QAAQC,GAAG,CAAC;AACd","ignoreList":[0]} | ||
| {"version":3,"sources":["../../src/cli/next-typegen.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { existsSync } from 'fs'\nimport path, { join } from 'path'\nimport { mkdir } from 'fs/promises'\n\nimport loadConfig from '../server/config'\nimport { printAndExit } from '../server/lib/utils'\nimport { PHASE_PRODUCTION_BUILD } from '../shared/lib/constants'\nimport { getProjectDir } from '../lib/get-project-dir'\nimport { findPagesDir } from '../lib/find-pages-dir'\nimport { verifyAndRunTypeScript } from '../lib/verify-typescript-setup'\nimport { discoverRoutes } from '../build/route-discovery'\nimport { parseBundlerArgs } from '../lib/bundler'\n\nimport {\n createRouteTypesManifest,\n writeRouteTypesManifest,\n writeValidatorFile,\n} from '../server/lib/router-utils/route-types-utils'\nimport { writeCacheLifeTypes } from '../server/lib/router-utils/cache-life-type-utils'\nimport { writeRootParamsTypes } from '../server/lib/router-utils/root-params-type-utils'\nimport { installBindings } from '../build/swc/install-bindings'\n\nexport type NextTypegenOptions = {\n dir?: string\n webpack?: boolean\n}\n\nconst nextTypegen = async (options: NextTypegenOptions, directory?: string) => {\n parseBundlerArgs(options)\n\n const baseDir = getProjectDir(directory)\n\n // Check if the provided directory exists\n if (!existsSync(baseDir)) {\n printAndExit(`> No such directory exists as the project root: ${baseDir}`)\n }\n\n const nextConfig = await loadConfig(PHASE_PRODUCTION_BUILD, baseDir)\n await installBindings(nextConfig.experimental?.useWasmBinary)\n const distDir = join(baseDir, nextConfig.distDir)\n const { pagesDir, appDir } = findPagesDir(baseDir)\n\n const strictRouteTypes = Boolean(nextConfig.experimental.strictRouteTypes)\n\n await verifyAndRunTypeScript({\n dir: baseDir,\n distDir: nextConfig.distDir,\n strictRouteTypes,\n shouldRunTypeCheck: false,\n tsconfigPath: nextConfig.typescript.tsconfigPath,\n typedRoutes: Boolean(nextConfig.typedRoutes),\n disableStaticImages: nextConfig.images.disableStaticImages,\n hasAppDir: !!appDir,\n hasPagesDir: !!pagesDir,\n appDir: appDir || undefined,\n pagesDir: pagesDir || undefined,\n })\n\n console.log('Generating route types...')\n\n const routeTypesFilePath = join(distDir, 'types', 'routes.d.ts')\n const validatorFilePath = join(distDir, 'types', 'validator.ts')\n await mkdir(join(distDir, 'types'), { recursive: true })\n\n const isSrcDir = path\n .relative(baseDir, pagesDir || appDir || '')\n .startsWith('src')\n\n // Build all routes (pages + app + slots)\n const {\n pageRoutes,\n pageApiRoutes,\n appRoutes,\n appRouteHandlers,\n layoutRoutes,\n slots,\n } = await discoverRoutes({\n appDir: appDir || undefined,\n pagesDir: pagesDir || undefined,\n pageExtensions: nextConfig.pageExtensions,\n isDev: false,\n baseDir,\n isSrcDir,\n })\n\n const routeTypesManifest = await createRouteTypesManifest({\n dir: baseDir,\n pageRoutes,\n appRoutes,\n appRouteHandlers,\n pageApiRoutes,\n layoutRoutes,\n slots,\n redirects: nextConfig.redirects,\n rewrites: nextConfig.rewrites,\n validatorFilePath,\n })\n\n await writeRouteTypesManifest(\n routeTypesManifest,\n routeTypesFilePath,\n nextConfig\n )\n\n await writeValidatorFile(\n routeTypesManifest,\n validatorFilePath,\n strictRouteTypes\n )\n\n // Generate cache-life types if cacheLife config exists\n const cacheLifeFilePath = join(distDir, 'types', 'cache-life.d.ts')\n writeCacheLifeTypes(nextConfig.cacheLife, cacheLifeFilePath)\n\n await writeRootParamsTypes(\n routeTypesManifest,\n join(distDir, 'types', 'root-params.d.ts')\n )\n\n console.log('✓ Types generated successfully')\n}\n\nexport { nextTypegen }\n"],"names":["nextTypegen","options","directory","nextConfig","parseBundlerArgs","baseDir","getProjectDir","existsSync","printAndExit","loadConfig","PHASE_PRODUCTION_BUILD","installBindings","experimental","useWasmBinary","distDir","join","pagesDir","appDir","findPagesDir","strictRouteTypes","Boolean","verifyAndRunTypeScript","dir","shouldRunTypeCheck","tsconfigPath","typescript","typedRoutes","disableStaticImages","images","hasAppDir","hasPagesDir","undefined","console","log","routeTypesFilePath","validatorFilePath","mkdir","recursive","isSrcDir","path","relative","startsWith","pageRoutes","pageApiRoutes","appRoutes","appRouteHandlers","layoutRoutes","slots","discoverRoutes","pageExtensions","isDev","routeTypesManifest","createRouteTypesManifest","redirects","rewrites","writeRouteTypesManifest","writeValidatorFile","cacheLifeFilePath","writeCacheLifeTypes","cacheLife","writeRootParamsTypes"],"mappings":";;;;;+BA4HSA;;;eAAAA;;;oBA1HkB;8DACA;0BACL;+DAEC;uBACM;2BACU;+BACT;8BACD;uCACU;gCACR;yBACE;iCAM1B;oCAC6B;qCACC;iCACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOhC,MAAMA,cAAc,OAAOC,SAA6BC;QAWhCC;IAVtBC,IAAAA,yBAAgB,EAACH;IAEjB,MAAMI,UAAUC,IAAAA,4BAAa,EAACJ;IAE9B,yCAAyC;IACzC,IAAI,CAACK,IAAAA,cAAU,EAACF,UAAU;QACxBG,IAAAA,mBAAY,EAAC,CAAC,gDAAgD,EAAEH,SAAS;IAC3E;IAEA,MAAMF,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AAqB,MAAMC,IAAAA,yCAAwB,EAAC;QACxD9B,KAAKjB;QACLqC;QACAE;QACAC;QACAF;QACAG;QACAC;QACAM,WAAWlD,WAAWkD,SAAS;QAC/BC,UAAUnD,WAAWmD,QAAQ;QAC7BnB;IACF;IAEA,MAAMoB,IAAAA,wCAAuB,EAC3BJ,oBACAjB,oBACA/B;IAGF,MAAMqD,IAAAA,mCAAkB,EACtBL,oBACAhB,mBACAhB;IAGF,uDAAuD;IACvD,MAAMsC,oBAAoB1C,IAAAA,UAAI,EAACD,SAAS,SAAS;IACjD4C,IAAAA,uCAAmB,EAACvD,WAAWwD,SAAS,EAAEF;IAE1C,MAAMG,IAAAA,yCAAoB,EACxBT,oBACApC,IAAAA,UAAI,EAACD,SAAS,SAAS;IAGzBkB,QAAQC,GAAG,CAAC;AACd","ignoreList":[0]} |
@@ -18,3 +18,3 @@ /** | ||
| const _setattributesfromprops = require("./set-attributes-from-props"); | ||
| const version = "16.3.0-canary.58"; | ||
| const version = "16.3.0-canary.59"; | ||
| window.next = { | ||
@@ -21,0 +21,0 @@ version, |
@@ -51,3 +51,3 @@ 'use client'; | ||
| } | ||
| function linkClicked(e, href, linkInstanceRef, replace, scroll, onNavigate, transitionTypes) { | ||
| function linkClicked(e, href, linkInstanceRef, replace, scroll, onNavigate, transitionTypes, prefetchIntent = 'none') { | ||
| if (typeof window !== 'undefined') { | ||
@@ -85,3 +85,3 @@ const { nodeName } = e.currentTarget; | ||
| _react.default.startTransition(()=>{ | ||
| dispatchNavigateAction(href, replace ? 'replace' : 'push', scroll === false ? _routerreducertypes.ScrollBehavior.NoScroll : _routerreducertypes.ScrollBehavior.Default, linkInstanceRef.current, transitionTypes); | ||
| dispatchNavigateAction(href, replace ? 'replace' : 'push', scroll === false ? _routerreducertypes.ScrollBehavior.NoScroll : _routerreducertypes.ScrollBehavior.Default, linkInstanceRef.current, transitionTypes, prefetchIntent); | ||
| }); | ||
@@ -109,3 +109,4 @@ } | ||
| const prefetchEnabled = prefetchProp !== false; | ||
| const fetchStrategy = prefetchProp !== false ? getFetchStrategyFromPrefetchProp(prefetchProp) : _types.FetchStrategy.PPR; | ||
| const prefetchIntent = prefetchProp === false ? 'none' : prefetchProp === true ? 'full' : 'auto'; | ||
| const fetchStrategy = prefetchIntent !== 'none' ? getFetchStrategyFromPrefetchIntent(prefetchIntent) : _types.FetchStrategy.PPR; | ||
| if (process.env.NODE_ENV !== 'production') { | ||
@@ -339,3 +340,3 @@ function createPropError(args) { | ||
| } | ||
| linkClicked(e, formattedHref, linkInstanceRef, replace, scroll, onNavigate, transitionTypes); | ||
| linkClicked(e, formattedHref, linkInstanceRef, replace, scroll, onNavigate, transitionTypes, prefetchIntent); | ||
| }, | ||
@@ -404,15 +405,12 @@ onMouseEnter (e) { | ||
| }; | ||
| function getFetchStrategyFromPrefetchProp(prefetchProp) { | ||
| function getFetchStrategyFromPrefetchIntent(prefetchIntent) { | ||
| if (process.env.__NEXT_CACHE_COMPONENTS) { | ||
| if (prefetchProp === true) { | ||
| if (prefetchIntent === 'full') { | ||
| return _types.FetchStrategy.Full; | ||
| } | ||
| // `null` or `"auto"`: this is the default "auto" mode, where we will prefetch partially if the link is in the viewport. | ||
| // This will also include invalid prop values that don't match the types specified here. | ||
| // (although those should've been filtered out by prop validation in dev) | ||
| prefetchProp; | ||
| // `"auto"`: the default mode, where we will prefetch partially if the link is in the viewport. | ||
| prefetchIntent; | ||
| return _types.FetchStrategy.PPR; | ||
| } else { | ||
| return prefetchProp === null || prefetchProp === 'auto' ? _types.FetchStrategy.PPR : // To preserve backwards-compatibility, anything other than `false`, `null`, or `"auto"` results in a full prefetch. | ||
| // (although invalid values should've been filtered out by prop validation in dev) | ||
| return prefetchIntent === 'auto' ? _types.FetchStrategy.PPR : // data to be prefetched, preserving backwards-compatibility. | ||
| _types.FetchStrategy.Full; | ||
@@ -419,0 +417,0 @@ } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/client/app-dir/link.tsx"],"sourcesContent":["'use client'\n\nimport React, { createContext, useContext, useOptimistic, useRef } from 'react'\nimport type { UrlObject } from 'url'\nimport { formatUrl } from '../../shared/lib/router/utils/format-url'\nimport { AppRouterContext } from '../../shared/lib/app-router-context.shared-runtime'\nimport { useMergedRef } from '../use-merged-ref'\nimport { isAbsoluteUrl } from '../../shared/lib/utils'\nimport { addBasePath } from '../add-base-path'\nimport { ScrollBehavior } from '../components/router-reducer/router-reducer-types'\nimport type { PENDING_LINK_STATUS } from '../components/links'\nimport {\n IDLE_LINK_STATUS,\n mountLinkInstance,\n onNavigationIntent,\n unmountLinkForCurrentNavigation,\n unmountPrefetchableInstance,\n type LinkInstance,\n} from '../components/links'\nimport { isLocalURL } from '../../shared/lib/router/utils/is-local-url'\nimport {\n FetchStrategy,\n type PrefetchTaskFetchStrategy,\n} from '../components/segment-cache/types'\n\ntype Url = string | UrlObject\ntype RequiredKeys<T> = {\n [K in keyof T]-?: {} extends Pick<T, K> ? never : K\n}[keyof T]\ntype OptionalKeys<T> = {\n [K in keyof T]-?: {} extends Pick<T, K> ? K : never\n}[keyof T]\n\ntype OnNavigateEventHandler = (event: { preventDefault: () => void }) => void\n\ntype InternalLinkProps = {\n /**\n * **Required**. The path or URL to navigate to. It can also be an object (similar to `URL`).\n *\n * @example\n * ```tsx\n * // Navigate to /dashboard:\n * <Link href=\"/dashboard\">Dashboard</Link>\n *\n * // Navigate to /about?name=test:\n * <Link href={{ pathname: '/about', query: { name: 'test' } }}>\n * About\n * </Link>\n * ```\n *\n * @remarks\n * - For external URLs, use a fully qualified URL such as `https://...`.\n * - In the App Router, dynamic routes must not include bracketed segments in `href`.\n */\n href: Url\n\n /**\n * @deprecated v10.0.0: `href` props pointing to a dynamic route are\n * automatically resolved and no longer require the `as` prop.\n */\n as?: Url\n\n /**\n * Replace the current `history` state instead of adding a new URL into the stack.\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/about\" replace>\n * About (replaces the history state)\n * </Link>\n * ```\n */\n replace?: boolean\n\n /**\n * Whether to override the default scroll behavior. If `true`, Next.js attempts to maintain\n * the scroll position if the newly navigated page is still visible. If not, it scrolls to the top.\n *\n * If `false`, Next.js will not modify the scroll behavior at all.\n *\n * @defaultValue `true`\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" scroll={false}>\n * No auto scroll\n * </Link>\n * ```\n */\n scroll?: boolean\n\n /**\n * Update the path of the current page without rerunning data fetching methods\n * like `getStaticProps`, `getServerSideProps`, or `getInitialProps`.\n *\n * @remarks\n * `shallow` only applies to the Pages Router. For the App Router, see the\n * [following documentation](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#using-the-native-history-api).\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/blog\" shallow>\n * Shallow navigation\n * </Link>\n * ```\n */\n shallow?: boolean\n\n /**\n * Forces `Link` to pass its `href` to the child component. Useful if the child is a custom\n * component that wraps an `<a>` tag, or if you're using certain styling libraries.\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" passHref legacyBehavior>\n * <MyStyledAnchor>Dashboard</MyStyledAnchor>\n * </Link>\n * ```\n */\n passHref?: boolean\n\n /**\n * Prefetch the page in the background.\n * Any `<Link />` that is in the viewport (initially or through scroll) will be prefetched.\n * Prefetch can be disabled by passing `prefetch={false}`.\n *\n * @remarks\n * Prefetching is only enabled in production.\n *\n * - In the **App Router**:\n * - `\"auto\"`, `null`, `undefined` (default): Prefetch behavior depends on static vs dynamic routes:\n * - Static routes: fully prefetched\n * - Dynamic routes: partial prefetch to the nearest segment with a `loading.js`\n * - `true`: Always prefetch the full route and data.\n * - `false`: Disable prefetching on both viewport and hover.\n * - In the **Pages Router**:\n * - `true` (default): Prefetches the route and data in the background on viewport or hover.\n * - `false`: Prefetch only on hover, not on viewport.\n *\n * @defaultValue `true` (Pages Router) or `null` (App Router)\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" prefetch={false}>\n * Dashboard\n * </Link>\n * ```\n */\n prefetch?: boolean | 'auto' | null\n\n /**\n * (unstable) Switch to a full prefetch on hover. Effectively the same as\n * updating the prefetch prop to `true` in a mouse event.\n */\n unstable_dynamicOnHover?: boolean\n\n /**\n * The active locale is automatically prepended in the Pages Router. `locale` allows for providing\n * a different locale, or can be set to `false` to opt out of automatic locale behavior.\n *\n * @remarks\n * Note: locale only applies in the Pages Router and is ignored in the App Router.\n *\n * @example\n * ```tsx\n * // Use the 'fr' locale:\n * <Link href=\"/about\" locale=\"fr\">\n * About (French)\n * </Link>\n *\n * // Disable locale prefix:\n * <Link href=\"/about\" locale={false}>\n * About (no locale prefix)\n * </Link>\n * ```\n */\n locale?: string | false\n\n /**\n * Enable legacy link behavior.\n *\n * @deprecated This will be removed in a future version\n * @defaultValue `false`\n * @see https://github.com/vercel/next.js/commit/489e65ed98544e69b0afd7e0cfc3f9f6c2b803b7\n */\n legacyBehavior?: boolean\n\n /**\n * Optional event handler for when the mouse pointer is moved onto the `<Link>`.\n */\n onMouseEnter?: React.MouseEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is touched.\n */\n onTouchStart?: React.TouchEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is clicked.\n */\n onClick?: React.MouseEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is navigated.\n */\n onNavigate?: OnNavigateEventHandler\n\n /**\n * Transition types to apply when navigating. These types are passed to\n * [`React.addTransitionType`](https://react.dev/reference/react/addTransitionType)\n * inside the navigation transition, enabling\n * [`<ViewTransition>`](https://react.dev/reference/react/ViewTransition) components\n * to apply different animations based on the type of navigation.\n *\n * @example\n * ```tsx\n * <Link href=\"/about\" transitionTypes={['slide-in']}>About</Link>\n * ```\n */\n transitionTypes?: string[]\n}\n\n// TODO-APP: Include the full set of Anchor props\n// adding this to the publicly exported type currently breaks existing apps\n\n// `RouteInferType` is a stub here to avoid breaking `typedRoutes` when the type\n// isn't generated yet. It will be replaced when type generation runs.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type LinkProps<RouteInferType = any> = InternalLinkProps\ntype LinkPropsRequired = RequiredKeys<LinkProps>\ntype LinkPropsOptional = OptionalKeys<Omit<InternalLinkProps, 'locale'>>\n\nfunction isModifiedEvent(event: React.MouseEvent): boolean {\n const eventTarget = event.currentTarget as HTMLAnchorElement | SVGAElement\n const target = eventTarget.getAttribute('target')\n return (\n (target && target !== '_self') ||\n event.metaKey ||\n event.ctrlKey ||\n event.shiftKey ||\n event.altKey || // triggers resource download\n (event.nativeEvent && event.nativeEvent.which === 2)\n )\n}\n\nfunction linkClicked(\n e: React.MouseEvent,\n href: string,\n linkInstanceRef: React.RefObject<LinkInstance | null>,\n replace?: boolean,\n scroll?: boolean,\n onNavigate?: OnNavigateEventHandler,\n transitionTypes?: string[]\n): void {\n if (typeof window !== 'undefined') {\n const { nodeName } = e.currentTarget\n\n // anchors inside an svg have a lowercase nodeName\n const isAnchorNodeName = nodeName.toUpperCase() === 'A'\n if (\n (isAnchorNodeName && isModifiedEvent(e)) ||\n e.currentTarget.hasAttribute('download')\n ) {\n // ignore click for browser’s default behavior\n return\n }\n\n if (!isLocalURL(href)) {\n if (replace) {\n // browser default behavior does not replace the history state\n // so we need to do it manually\n e.preventDefault()\n location.replace(href)\n }\n\n // ignore click for browser’s default behavior\n return\n }\n\n e.preventDefault()\n\n if (onNavigate) {\n let isDefaultPrevented = false\n\n onNavigate({\n preventDefault: () => {\n isDefaultPrevented = true\n },\n })\n\n if (isDefaultPrevented) {\n return\n }\n }\n\n const { dispatchNavigateAction } =\n require('../components/app-router-instance') as typeof import('../components/app-router-instance')\n\n React.startTransition(() => {\n dispatchNavigateAction(\n href,\n replace ? 'replace' : 'push',\n scroll === false ? ScrollBehavior.NoScroll : ScrollBehavior.Default,\n linkInstanceRef.current,\n transitionTypes\n )\n })\n }\n}\n\nfunction formatStringOrUrl(urlObjOrString: UrlObject | string): string {\n if (typeof urlObjOrString === 'string') {\n return urlObjOrString\n }\n\n return formatUrl(urlObjOrString)\n}\n\n/**\n * A React component that extends the HTML `<a>` element to provide\n * [prefetching](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#2-prefetching)\n * and client-side navigation. This is the primary way to navigate between routes in Next.js.\n *\n * @remarks\n * - Prefetching is only enabled in production.\n *\n * @see https://nextjs.org/docs/app/api-reference/components/link\n */\nexport default function LinkComponent(\n props: LinkProps & {\n children: React.ReactNode\n ref: React.Ref<HTMLAnchorElement>\n }\n) {\n const [linkStatus, setOptimisticLinkStatus] = useOptimistic(IDLE_LINK_STATUS)\n\n let children: React.ReactNode\n\n const linkInstanceRef = useRef<LinkInstance | null>(null)\n\n const {\n href: hrefProp,\n as: asProp,\n children: childrenProp,\n prefetch: prefetchProp = null,\n passHref,\n replace,\n shallow,\n scroll,\n onClick,\n onMouseEnter: onMouseEnterProp,\n onTouchStart: onTouchStartProp,\n legacyBehavior = false,\n onNavigate,\n transitionTypes,\n ref: forwardedRef,\n unstable_dynamicOnHover,\n ...restProps\n } = props\n\n children = childrenProp\n\n if (\n legacyBehavior &&\n (typeof children === 'string' || typeof children === 'number')\n ) {\n children = <a>{children}</a>\n }\n\n const router = React.useContext(AppRouterContext)\n\n const prefetchEnabled = prefetchProp !== false\n\n const fetchStrategy =\n prefetchProp !== false\n ? getFetchStrategyFromPrefetchProp(prefetchProp)\n : // TODO: it makes no sense to assign a fetchStrategy when prefetching is disabled.\n FetchStrategy.PPR\n\n if (process.env.NODE_ENV !== 'production') {\n function createPropError(args: {\n key: string\n expected: string\n actual: string\n }) {\n return new Error(\n `Failed prop type: The prop \\`${args.key}\\` expects a ${args.expected} in \\`<Link>\\`, but got \\`${args.actual}\\` instead.` +\n (typeof window !== 'undefined'\n ? \"\\nOpen your browser's console to view the Component stack trace.\"\n : '')\n )\n }\n\n // TypeScript trick for type-guarding:\n const requiredPropsGuard: Record<LinkPropsRequired, true> = {\n href: true,\n } as const\n const requiredProps: LinkPropsRequired[] = Object.keys(\n requiredPropsGuard\n ) as LinkPropsRequired[]\n requiredProps.forEach((key: LinkPropsRequired) => {\n if (key === 'href') {\n if (\n props[key] == null ||\n (typeof props[key] !== 'string' && typeof props[key] !== 'object')\n ) {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual: props[key] === null ? 'null' : typeof props[key],\n })\n }\n } else {\n // TypeScript trick for type-guarding:\n const _: never = key\n }\n })\n\n // TypeScript trick for type-guarding:\n const optionalPropsGuard: Record<LinkPropsOptional, true> = {\n as: true,\n replace: true,\n scroll: true,\n shallow: true,\n passHref: true,\n prefetch: true,\n unstable_dynamicOnHover: true,\n onClick: true,\n onMouseEnter: true,\n onTouchStart: true,\n legacyBehavior: true,\n onNavigate: true,\n transitionTypes: true,\n } as const\n const optionalProps: LinkPropsOptional[] = Object.keys(\n optionalPropsGuard\n ) as LinkPropsOptional[]\n optionalProps.forEach((key: LinkPropsOptional) => {\n const valType = typeof props[key]\n\n if (key === 'as') {\n if (props[key] && valType !== 'string' && valType !== 'object') {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual: valType,\n })\n }\n } else if (\n key === 'onClick' ||\n key === 'onMouseEnter' ||\n key === 'onTouchStart' ||\n key === 'onNavigate'\n ) {\n if (props[key] && valType !== 'function') {\n throw createPropError({\n key,\n expected: '`function`',\n actual: valType,\n })\n }\n } else if (\n key === 'replace' ||\n key === 'scroll' ||\n key === 'shallow' ||\n key === 'passHref' ||\n key === 'legacyBehavior' ||\n key === 'unstable_dynamicOnHover'\n ) {\n if (props[key] != null && valType !== 'boolean') {\n throw createPropError({\n key,\n expected: '`boolean`',\n actual: valType,\n })\n }\n } else if (key === 'prefetch') {\n if (\n props[key] != null &&\n valType !== 'boolean' &&\n props[key] !== 'auto'\n ) {\n throw createPropError({\n key,\n expected: '`boolean | \"auto\"`',\n actual: valType,\n })\n }\n } else if (key === 'transitionTypes') {\n if (props[key] != null && !Array.isArray(props[key])) {\n throw createPropError({\n key,\n expected: '`string[]`',\n actual: valType,\n })\n }\n } else {\n // TypeScript trick for type-guarding:\n const _: never = key\n }\n })\n }\n\n const resolvedHref = asProp || hrefProp\n const formattedHref = formatStringOrUrl(resolvedHref)\n\n if (process.env.NODE_ENV !== 'production') {\n const { warnOnce } =\n require('../../shared/lib/utils/warn-once') as typeof import('../../shared/lib/utils/warn-once')\n if (props.locale) {\n warnOnce(\n 'The `locale` prop is not supported in `next/link` while using the `app` router. Read more about app router internalization: https://nextjs.org/docs/app/building-your-application/routing/internationalization'\n )\n }\n if (!asProp) {\n let href: string | undefined\n if (typeof resolvedHref === 'string') {\n href = resolvedHref\n } else if (\n typeof resolvedHref === 'object' &&\n typeof resolvedHref.pathname === 'string'\n ) {\n href = resolvedHref.pathname\n }\n\n if (href) {\n const hasDynamicSegment = href\n .split('/')\n .some((segment) => segment.startsWith('[') && segment.endsWith(']'))\n\n if (hasDynamicSegment) {\n throw new Error(\n `Dynamic href \\`${href}\\` found in <Link> while using the \\`/app\\` router, this is not supported. Read more: https://nextjs.org/docs/messages/app-dir-dynamic-href`\n )\n }\n }\n }\n }\n\n // This will return the first child, if multiple are provided it will throw an error\n let child: any\n if (legacyBehavior) {\n if ((children as any)?.$$typeof === Symbol.for('react.lazy')) {\n throw new Error(\n `\\`<Link legacyBehavior>\\` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's \\`<a>\\` tag.`\n )\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (onClick) {\n console.warn(\n `\"onClick\" was passed to <Link> with \\`href\\` of \\`${formattedHref}\\` but \"legacyBehavior\" was set. The legacy behavior requires onClick be set on the child of next/link`\n )\n }\n if (onMouseEnterProp) {\n console.warn(\n `\"onMouseEnter\" was passed to <Link> with \\`href\\` of \\`${formattedHref}\\` but \"legacyBehavior\" was set. The legacy behavior requires onMouseEnter be set on the child of next/link`\n )\n }\n try {\n child = React.Children.only(children)\n } catch (err) {\n if (!children) {\n throw new Error(\n `No children were passed to <Link> with \\`href\\` of \\`${formattedHref}\\` but one child is required https://nextjs.org/docs/messages/link-no-children`\n )\n }\n throw new Error(\n `Multiple children were passed to <Link> with \\`href\\` of \\`${formattedHref}\\` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children` +\n (typeof window !== 'undefined'\n ? \" \\nOpen your browser's console to view the Component stack trace.\"\n : '')\n )\n }\n } else {\n child = React.Children.only(children)\n }\n } else {\n if (process.env.NODE_ENV === 'development') {\n if ((children as any)?.type === 'a') {\n throw new Error(\n 'Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>.\\nLearn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor'\n )\n }\n }\n }\n\n const childRef: any = legacyBehavior\n ? child && typeof child === 'object' && child.ref\n : forwardedRef\n\n // Capture the Owner Stack during render so dev-only warnings emitted later\n // at navigation time can be associated with the JSX that created\n // this <Link>.\n const ownerStack =\n process.env.NODE_ENV !== 'production' && process.env.__NEXT_CACHE_COMPONENTS\n ? // eslint-disable-next-line react-hooks/rules-of-hooks -- build time variables\n React.useMemo(() => {\n // Only capture when a warning might actually need it. Otherwise leave\n // it `undefined` so consumers can detect the opt-out and degrade\n // gracefully.\n if (fetchStrategy === FetchStrategy.Full) {\n return React.captureOwnerStack()\n }\n return undefined\n }, [fetchStrategy])\n : undefined\n\n // Use a callback ref to attach an IntersectionObserver to the anchor tag on\n // mount. In the future we will also use this to keep track of all the\n // currently mounted <Link> instances, e.g. so we can re-prefetch them after\n // a revalidation or refresh.\n const observeLinkVisibilityOnMount = React.useCallback(\n (element: HTMLAnchorElement | SVGAElement) => {\n if (router !== null) {\n linkInstanceRef.current = mountLinkInstance(\n element,\n formattedHref,\n router,\n fetchStrategy,\n prefetchEnabled,\n setOptimisticLinkStatus,\n ownerStack\n )\n }\n\n return () => {\n if (linkInstanceRef.current) {\n unmountLinkForCurrentNavigation(linkInstanceRef.current)\n linkInstanceRef.current = null\n }\n unmountPrefetchableInstance(element)\n }\n },\n [\n prefetchEnabled,\n formattedHref,\n router,\n fetchStrategy,\n setOptimisticLinkStatus,\n ownerStack,\n ]\n )\n\n const mergedRef = useMergedRef(observeLinkVisibilityOnMount, childRef)\n\n const childProps: {\n onTouchStart?: React.TouchEventHandler<HTMLAnchorElement>\n onMouseEnter: React.MouseEventHandler<HTMLAnchorElement>\n onClick: React.MouseEventHandler<HTMLAnchorElement>\n href?: string\n ref?: any\n } = {\n ref: mergedRef,\n onClick(e) {\n if (process.env.NODE_ENV !== 'production') {\n if (!e) {\n throw new Error(\n `Component rendered inside next/link has to pass click event to \"onClick\" prop.`\n )\n }\n }\n\n if (!legacyBehavior && typeof onClick === 'function') {\n onClick(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onClick === 'function'\n ) {\n child.props.onClick(e)\n }\n\n if (!router) {\n return\n }\n if (e.defaultPrevented) {\n return\n }\n linkClicked(\n e,\n formattedHref,\n linkInstanceRef,\n replace,\n scroll,\n onNavigate,\n transitionTypes\n )\n },\n onMouseEnter(e) {\n if (!legacyBehavior && typeof onMouseEnterProp === 'function') {\n onMouseEnterProp(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onMouseEnter === 'function'\n ) {\n child.props.onMouseEnter(e)\n }\n\n if (!router) {\n return\n }\n if (!prefetchEnabled || process.env.NODE_ENV === 'development') {\n return\n }\n\n const upgradeToDynamicPrefetch = unstable_dynamicOnHover === true\n onNavigationIntent(\n e.currentTarget as HTMLAnchorElement | SVGAElement,\n upgradeToDynamicPrefetch\n )\n },\n onTouchStart: process.env.__NEXT_LINK_NO_TOUCH_START\n ? undefined\n : function onTouchStart(e) {\n if (!legacyBehavior && typeof onTouchStartProp === 'function') {\n onTouchStartProp(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onTouchStart === 'function'\n ) {\n child.props.onTouchStart(e)\n }\n\n if (!router) {\n return\n }\n if (!prefetchEnabled) {\n return\n }\n\n const upgradeToDynamicPrefetch = unstable_dynamicOnHover === true\n onNavigationIntent(\n e.currentTarget as HTMLAnchorElement | SVGAElement,\n upgradeToDynamicPrefetch\n )\n },\n }\n\n // If the url is absolute, we can bypass the logic to prepend the basePath.\n if (isAbsoluteUrl(formattedHref)) {\n childProps.href = formattedHref\n } else if (\n !legacyBehavior ||\n passHref ||\n (child.type === 'a' && !('href' in child.props))\n ) {\n childProps.href = addBasePath(formattedHref)\n }\n\n let link: React.ReactNode\n\n if (legacyBehavior) {\n if (process.env.NODE_ENV === 'development') {\n const { errorOnce } =\n require('../../shared/lib/utils/error-once') as typeof import('../../shared/lib/utils/error-once')\n errorOnce(\n '`legacyBehavior` is deprecated and will be removed in a future ' +\n 'release. A codemod is available to upgrade your components:\\n\\n' +\n 'npx @next/codemod@latest new-link .\\n\\n' +\n 'Learn more: https://nextjs.org/docs/app/building-your-application/upgrading/codemods#remove-a-tags-from-link-components'\n )\n }\n link = React.cloneElement(child, childProps)\n } else {\n link = (\n <a {...restProps} {...childProps}>\n {children}\n </a>\n )\n }\n\n return (\n <LinkStatusContext.Provider value={linkStatus}>\n {link}\n </LinkStatusContext.Provider>\n )\n}\n\nconst LinkStatusContext = createContext<\n typeof PENDING_LINK_STATUS | typeof IDLE_LINK_STATUS\n>(IDLE_LINK_STATUS)\n\nexport const useLinkStatus = () => {\n return useContext(LinkStatusContext)\n}\n\nfunction getFetchStrategyFromPrefetchProp(\n prefetchProp: Exclude<LinkProps['prefetch'], undefined | false>\n): PrefetchTaskFetchStrategy {\n if (process.env.__NEXT_CACHE_COMPONENTS) {\n if (prefetchProp === true) {\n return FetchStrategy.Full\n }\n\n // `null` or `\"auto\"`: this is the default \"auto\" mode, where we will prefetch partially if the link is in the viewport.\n // This will also include invalid prop values that don't match the types specified here.\n // (although those should've been filtered out by prop validation in dev)\n prefetchProp satisfies null | 'auto'\n return FetchStrategy.PPR\n } else {\n return prefetchProp === null || prefetchProp === 'auto'\n ? // We default to PPR, and we'll discover whether or not the route supports it with the initial prefetch.\n FetchStrategy.PPR\n : // In the old implementation without runtime prefetches, `prefetch={true}` forces all dynamic data to be prefetched.\n // To preserve backwards-compatibility, anything other than `false`, `null`, or `\"auto\"` results in a full prefetch.\n // (although invalid values should've been filtered out by prop validation in dev)\n FetchStrategy.Full\n }\n}\n"],"names":["LinkComponent","useLinkStatus","isModifiedEvent","event","eventTarget","currentTarget","target","getAttribute","metaKey","ctrlKey","shiftKey","altKey","nativeEvent","which","linkClicked","e","href","linkInstanceRef","replace","scroll","onNavigate","transitionTypes","window","nodeName","isAnchorNodeName","toUpperCase","hasAttribute","isLocalURL","preventDefault","location","isDefaultPrevented","dispatchNavigateAction","require","React","startTransition","ScrollBehavior","NoScroll","Default","current","formatStringOrUrl","urlObjOrString","formatUrl","props","linkStatus","setOptimisticLinkStatus","useOptimistic","IDLE_LINK_STATUS","children","useRef","hrefProp","as","asProp","childrenProp","prefetch","prefetchProp","passHref","shallow","onClick","onMouseEnter","onMouseEnterProp","onTouchStart","onTouchStartProp","legacyBehavior","ref","forwardedRef","unstable_dynamicOnHover","restProps","a","router","useContext","AppRouterContext","prefetchEnabled","fetchStrategy","getFetchStrategyFromPrefetchProp","FetchStrategy","PPR","process","env","NODE_ENV","createPropError","args","Error","key","expected","actual","requiredPropsGuard","requiredProps","Object","keys","forEach","_","optionalPropsGuard","optionalProps","valType","Array","isArray","resolvedHref","formattedHref","warnOnce","locale","pathname","hasDynamicSegment","split","some","segment","startsWith","endsWith","child","$$typeof","Symbol","for","console","warn","Children","only","err","type","childRef","ownerStack","__NEXT_CACHE_COMPONENTS","useMemo","Full","captureOwnerStack","undefined","observeLinkVisibilityOnMount","useCallback","element","mountLinkInstance","unmountLinkForCurrentNavigation","unmountPrefetchableInstance","mergedRef","useMergedRef","childProps","defaultPrevented","upgradeToDynamicPrefetch","onNavigationIntent","__NEXT_LINK_NO_TOUCH_START","isAbsoluteUrl","addBasePath","link","errorOnce","cloneElement","LinkStatusContext","Provider","value","createContext"],"mappings":"AAAA;;;;;;;;;;;;;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AAG;IAC1B,OAAO;QACL,OAAOrB,iBAAiB,QAAQA,iBAAiB,SAE7CoB,oBAAa,CAACC,GAAG,GAEjB,oHAAoH;QACpH,kFAAkF;QAClFD,oBAAa,CAAC+C,IAAI;IACxB;AACF","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/client/app-dir/link.tsx"],"sourcesContent":["'use client'\n\nimport React, { createContext, useContext, useOptimistic, useRef } from 'react'\nimport type { UrlObject } from 'url'\nimport { formatUrl } from '../../shared/lib/router/utils/format-url'\nimport { AppRouterContext } from '../../shared/lib/app-router-context.shared-runtime'\nimport { useMergedRef } from '../use-merged-ref'\nimport { isAbsoluteUrl } from '../../shared/lib/utils'\nimport { addBasePath } from '../add-base-path'\nimport { ScrollBehavior } from '../components/router-reducer/router-reducer-types'\nimport type { PENDING_LINK_STATUS } from '../components/links'\nimport {\n IDLE_LINK_STATUS,\n mountLinkInstance,\n onNavigationIntent,\n unmountLinkForCurrentNavigation,\n unmountPrefetchableInstance,\n type LinkInstance,\n} from '../components/links'\nimport { isLocalURL } from '../../shared/lib/router/utils/is-local-url'\nimport {\n FetchStrategy,\n type PrefetchTaskFetchStrategy,\n} from '../components/segment-cache/types'\nimport type { RouterTransitionPrefetchIntent } from '../router-transition-types'\n\ntype Url = string | UrlObject\ntype RequiredKeys<T> = {\n [K in keyof T]-?: {} extends Pick<T, K> ? never : K\n}[keyof T]\ntype OptionalKeys<T> = {\n [K in keyof T]-?: {} extends Pick<T, K> ? K : never\n}[keyof T]\n\ntype OnNavigateEventHandler = (event: { preventDefault: () => void }) => void\n\ntype InternalLinkProps = {\n /**\n * **Required**. The path or URL to navigate to. It can also be an object (similar to `URL`).\n *\n * @example\n * ```tsx\n * // Navigate to /dashboard:\n * <Link href=\"/dashboard\">Dashboard</Link>\n *\n * // Navigate to /about?name=test:\n * <Link href={{ pathname: '/about', query: { name: 'test' } }}>\n * About\n * </Link>\n * ```\n *\n * @remarks\n * - For external URLs, use a fully qualified URL such as `https://...`.\n * - In the App Router, dynamic routes must not include bracketed segments in `href`.\n */\n href: Url\n\n /**\n * @deprecated v10.0.0: `href` props pointing to a dynamic route are\n * automatically resolved and no longer require the `as` prop.\n */\n as?: Url\n\n /**\n * Replace the current `history` state instead of adding a new URL into the stack.\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/about\" replace>\n * About (replaces the history state)\n * </Link>\n * ```\n */\n replace?: boolean\n\n /**\n * Whether to override the default scroll behavior. If `true`, Next.js attempts to maintain\n * the scroll position if the newly navigated page is still visible. If not, it scrolls to the top.\n *\n * If `false`, Next.js will not modify the scroll behavior at all.\n *\n * @defaultValue `true`\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" scroll={false}>\n * No auto scroll\n * </Link>\n * ```\n */\n scroll?: boolean\n\n /**\n * Update the path of the current page without rerunning data fetching methods\n * like `getStaticProps`, `getServerSideProps`, or `getInitialProps`.\n *\n * @remarks\n * `shallow` only applies to the Pages Router. For the App Router, see the\n * [following documentation](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#using-the-native-history-api).\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/blog\" shallow>\n * Shallow navigation\n * </Link>\n * ```\n */\n shallow?: boolean\n\n /**\n * Forces `Link` to pass its `href` to the child component. Useful if the child is a custom\n * component that wraps an `<a>` tag, or if you're using certain styling libraries.\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" passHref legacyBehavior>\n * <MyStyledAnchor>Dashboard</MyStyledAnchor>\n * </Link>\n * ```\n */\n passHref?: boolean\n\n /**\n * Prefetch the page in the background.\n * Any `<Link />` that is in the viewport (initially or through scroll) will be prefetched.\n * Prefetch can be disabled by passing `prefetch={false}`.\n *\n * @remarks\n * Prefetching is only enabled in production.\n *\n * - In the **App Router**:\n * - `\"auto\"`, `null`, `undefined` (default): Prefetch behavior depends on static vs dynamic routes:\n * - Static routes: fully prefetched\n * - Dynamic routes: partial prefetch to the nearest segment with a `loading.js`\n * - `true`: Always prefetch the full route and data.\n * - `false`: Disable prefetching on both viewport and hover.\n * - In the **Pages Router**:\n * - `true` (default): Prefetches the route and data in the background on viewport or hover.\n * - `false`: Prefetch only on hover, not on viewport.\n *\n * @defaultValue `true` (Pages Router) or `null` (App Router)\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" prefetch={false}>\n * Dashboard\n * </Link>\n * ```\n */\n prefetch?: boolean | 'auto' | null\n\n /**\n * (unstable) Switch to a full prefetch on hover. Effectively the same as\n * updating the prefetch prop to `true` in a mouse event.\n */\n unstable_dynamicOnHover?: boolean\n\n /**\n * The active locale is automatically prepended in the Pages Router. `locale` allows for providing\n * a different locale, or can be set to `false` to opt out of automatic locale behavior.\n *\n * @remarks\n * Note: locale only applies in the Pages Router and is ignored in the App Router.\n *\n * @example\n * ```tsx\n * // Use the 'fr' locale:\n * <Link href=\"/about\" locale=\"fr\">\n * About (French)\n * </Link>\n *\n * // Disable locale prefix:\n * <Link href=\"/about\" locale={false}>\n * About (no locale prefix)\n * </Link>\n * ```\n */\n locale?: string | false\n\n /**\n * Enable legacy link behavior.\n *\n * @deprecated This will be removed in a future version\n * @defaultValue `false`\n * @see https://github.com/vercel/next.js/commit/489e65ed98544e69b0afd7e0cfc3f9f6c2b803b7\n */\n legacyBehavior?: boolean\n\n /**\n * Optional event handler for when the mouse pointer is moved onto the `<Link>`.\n */\n onMouseEnter?: React.MouseEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is touched.\n */\n onTouchStart?: React.TouchEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is clicked.\n */\n onClick?: React.MouseEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is navigated.\n */\n onNavigate?: OnNavigateEventHandler\n\n /**\n * Transition types to apply when navigating. These types are passed to\n * [`React.addTransitionType`](https://react.dev/reference/react/addTransitionType)\n * inside the navigation transition, enabling\n * [`<ViewTransition>`](https://react.dev/reference/react/ViewTransition) components\n * to apply different animations based on the type of navigation.\n *\n * @example\n * ```tsx\n * <Link href=\"/about\" transitionTypes={['slide-in']}>About</Link>\n * ```\n */\n transitionTypes?: string[]\n}\n\n// TODO-APP: Include the full set of Anchor props\n// adding this to the publicly exported type currently breaks existing apps\n\n// `RouteInferType` is a stub here to avoid breaking `typedRoutes` when the type\n// isn't generated yet. It will be replaced when type generation runs.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type LinkProps<RouteInferType = any> = InternalLinkProps\ntype LinkPropsRequired = RequiredKeys<LinkProps>\ntype LinkPropsOptional = OptionalKeys<Omit<InternalLinkProps, 'locale'>>\n\nfunction isModifiedEvent(event: React.MouseEvent): boolean {\n const eventTarget = event.currentTarget as HTMLAnchorElement | SVGAElement\n const target = eventTarget.getAttribute('target')\n return (\n (target && target !== '_self') ||\n event.metaKey ||\n event.ctrlKey ||\n event.shiftKey ||\n event.altKey || // triggers resource download\n (event.nativeEvent && event.nativeEvent.which === 2)\n )\n}\n\nfunction linkClicked(\n e: React.MouseEvent,\n href: string,\n linkInstanceRef: React.RefObject<LinkInstance | null>,\n replace?: boolean,\n scroll?: boolean,\n onNavigate?: OnNavigateEventHandler,\n transitionTypes?: string[],\n prefetchIntent: RouterTransitionPrefetchIntent = 'none'\n): void {\n if (typeof window !== 'undefined') {\n const { nodeName } = e.currentTarget\n\n // anchors inside an svg have a lowercase nodeName\n const isAnchorNodeName = nodeName.toUpperCase() === 'A'\n if (\n (isAnchorNodeName && isModifiedEvent(e)) ||\n e.currentTarget.hasAttribute('download')\n ) {\n // ignore click for browser’s default behavior\n return\n }\n\n if (!isLocalURL(href)) {\n if (replace) {\n // browser default behavior does not replace the history state\n // so we need to do it manually\n e.preventDefault()\n location.replace(href)\n }\n\n // ignore click for browser’s default behavior\n return\n }\n\n e.preventDefault()\n\n if (onNavigate) {\n let isDefaultPrevented = false\n\n onNavigate({\n preventDefault: () => {\n isDefaultPrevented = true\n },\n })\n\n if (isDefaultPrevented) {\n return\n }\n }\n\n const { dispatchNavigateAction } =\n require('../components/app-router-instance') as typeof import('../components/app-router-instance')\n\n React.startTransition(() => {\n dispatchNavigateAction(\n href,\n replace ? 'replace' : 'push',\n scroll === false ? ScrollBehavior.NoScroll : ScrollBehavior.Default,\n linkInstanceRef.current,\n transitionTypes,\n prefetchIntent\n )\n })\n }\n}\n\nfunction formatStringOrUrl(urlObjOrString: UrlObject | string): string {\n if (typeof urlObjOrString === 'string') {\n return urlObjOrString\n }\n\n return formatUrl(urlObjOrString)\n}\n\n/**\n * A React component that extends the HTML `<a>` element to provide\n * [prefetching](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#2-prefetching)\n * and client-side navigation. This is the primary way to navigate between routes in Next.js.\n *\n * @remarks\n * - Prefetching is only enabled in production.\n *\n * @see https://nextjs.org/docs/app/api-reference/components/link\n */\nexport default function LinkComponent(\n props: LinkProps & {\n children: React.ReactNode\n ref: React.Ref<HTMLAnchorElement>\n }\n) {\n const [linkStatus, setOptimisticLinkStatus] = useOptimistic(IDLE_LINK_STATUS)\n\n let children: React.ReactNode\n\n const linkInstanceRef = useRef<LinkInstance | null>(null)\n\n const {\n href: hrefProp,\n as: asProp,\n children: childrenProp,\n prefetch: prefetchProp = null,\n passHref,\n replace,\n shallow,\n scroll,\n onClick,\n onMouseEnter: onMouseEnterProp,\n onTouchStart: onTouchStartProp,\n legacyBehavior = false,\n onNavigate,\n transitionTypes,\n ref: forwardedRef,\n unstable_dynamicOnHover,\n ...restProps\n } = props\n\n children = childrenProp\n\n if (\n legacyBehavior &&\n (typeof children === 'string' || typeof children === 'number')\n ) {\n children = <a>{children}</a>\n }\n\n const router = React.useContext(AppRouterContext)\n\n const prefetchEnabled = prefetchProp !== false\n const prefetchIntent: RouterTransitionPrefetchIntent =\n prefetchProp === false ? 'none' : prefetchProp === true ? 'full' : 'auto'\n\n const fetchStrategy =\n prefetchIntent !== 'none'\n ? getFetchStrategyFromPrefetchIntent(prefetchIntent)\n : // TODO: it makes no sense to assign a fetchStrategy when prefetching is disabled.\n FetchStrategy.PPR\n\n if (process.env.NODE_ENV !== 'production') {\n function createPropError(args: {\n key: string\n expected: string\n actual: string\n }) {\n return new Error(\n `Failed prop type: The prop \\`${args.key}\\` expects a ${args.expected} in \\`<Link>\\`, but got \\`${args.actual}\\` instead.` +\n (typeof window !== 'undefined'\n ? \"\\nOpen your browser's console to view the Component stack trace.\"\n : '')\n )\n }\n\n // TypeScript trick for type-guarding:\n const requiredPropsGuard: Record<LinkPropsRequired, true> = {\n href: true,\n } as const\n const requiredProps: LinkPropsRequired[] = Object.keys(\n requiredPropsGuard\n ) as LinkPropsRequired[]\n requiredProps.forEach((key: LinkPropsRequired) => {\n if (key === 'href') {\n if (\n props[key] == null ||\n (typeof props[key] !== 'string' && typeof props[key] !== 'object')\n ) {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual: props[key] === null ? 'null' : typeof props[key],\n })\n }\n } else {\n // TypeScript trick for type-guarding:\n const _: never = key\n }\n })\n\n // TypeScript trick for type-guarding:\n const optionalPropsGuard: Record<LinkPropsOptional, true> = {\n as: true,\n replace: true,\n scroll: true,\n shallow: true,\n passHref: true,\n prefetch: true,\n unstable_dynamicOnHover: true,\n onClick: true,\n onMouseEnter: true,\n onTouchStart: true,\n legacyBehavior: true,\n onNavigate: true,\n transitionTypes: true,\n } as const\n const optionalProps: LinkPropsOptional[] = Object.keys(\n optionalPropsGuard\n ) as LinkPropsOptional[]\n optionalProps.forEach((key: LinkPropsOptional) => {\n const valType = typeof props[key]\n\n if (key === 'as') {\n if (props[key] && valType !== 'string' && valType !== 'object') {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual: valType,\n })\n }\n } else if (\n key === 'onClick' ||\n key === 'onMouseEnter' ||\n key === 'onTouchStart' ||\n key === 'onNavigate'\n ) {\n if (props[key] && valType !== 'function') {\n throw createPropError({\n key,\n expected: '`function`',\n actual: valType,\n })\n }\n } else if (\n key === 'replace' ||\n key === 'scroll' ||\n key === 'shallow' ||\n key === 'passHref' ||\n key === 'legacyBehavior' ||\n key === 'unstable_dynamicOnHover'\n ) {\n if (props[key] != null && valType !== 'boolean') {\n throw createPropError({\n key,\n expected: '`boolean`',\n actual: valType,\n })\n }\n } else if (key === 'prefetch') {\n if (\n props[key] != null &&\n valType !== 'boolean' &&\n props[key] !== 'auto'\n ) {\n throw createPropError({\n key,\n expected: '`boolean | \"auto\"`',\n actual: valType,\n })\n }\n } else if (key === 'transitionTypes') {\n if (props[key] != null && !Array.isArray(props[key])) {\n throw createPropError({\n key,\n expected: '`string[]`',\n actual: valType,\n })\n }\n } else {\n // TypeScript trick for type-guarding:\n const _: never = key\n }\n })\n }\n\n const resolvedHref = asProp || hrefProp\n const formattedHref = formatStringOrUrl(resolvedHref)\n\n if (process.env.NODE_ENV !== 'production') {\n const { warnOnce } =\n require('../../shared/lib/utils/warn-once') as typeof import('../../shared/lib/utils/warn-once')\n if (props.locale) {\n warnOnce(\n 'The `locale` prop is not supported in `next/link` while using the `app` router. Read more about app router internalization: https://nextjs.org/docs/app/building-your-application/routing/internationalization'\n )\n }\n if (!asProp) {\n let href: string | undefined\n if (typeof resolvedHref === 'string') {\n href = resolvedHref\n } else if (\n typeof resolvedHref === 'object' &&\n typeof resolvedHref.pathname === 'string'\n ) {\n href = resolvedHref.pathname\n }\n\n if (href) {\n const hasDynamicSegment = href\n .split('/')\n .some((segment) => segment.startsWith('[') && segment.endsWith(']'))\n\n if (hasDynamicSegment) {\n throw new Error(\n `Dynamic href \\`${href}\\` found in <Link> while using the \\`/app\\` router, this is not supported. Read more: https://nextjs.org/docs/messages/app-dir-dynamic-href`\n )\n }\n }\n }\n }\n\n // This will return the first child, if multiple are provided it will throw an error\n let child: any\n if (legacyBehavior) {\n if ((children as any)?.$$typeof === Symbol.for('react.lazy')) {\n throw new Error(\n `\\`<Link legacyBehavior>\\` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's \\`<a>\\` tag.`\n )\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (onClick) {\n console.warn(\n `\"onClick\" was passed to <Link> with \\`href\\` of \\`${formattedHref}\\` but \"legacyBehavior\" was set. The legacy behavior requires onClick be set on the child of next/link`\n )\n }\n if (onMouseEnterProp) {\n console.warn(\n `\"onMouseEnter\" was passed to <Link> with \\`href\\` of \\`${formattedHref}\\` but \"legacyBehavior\" was set. The legacy behavior requires onMouseEnter be set on the child of next/link`\n )\n }\n try {\n child = React.Children.only(children)\n } catch (err) {\n if (!children) {\n throw new Error(\n `No children were passed to <Link> with \\`href\\` of \\`${formattedHref}\\` but one child is required https://nextjs.org/docs/messages/link-no-children`\n )\n }\n throw new Error(\n `Multiple children were passed to <Link> with \\`href\\` of \\`${formattedHref}\\` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children` +\n (typeof window !== 'undefined'\n ? \" \\nOpen your browser's console to view the Component stack trace.\"\n : '')\n )\n }\n } else {\n child = React.Children.only(children)\n }\n } else {\n if (process.env.NODE_ENV === 'development') {\n if ((children as any)?.type === 'a') {\n throw new Error(\n 'Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>.\\nLearn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor'\n )\n }\n }\n }\n\n const childRef: any = legacyBehavior\n ? child && typeof child === 'object' && child.ref\n : forwardedRef\n\n // Capture the Owner Stack during render so dev-only warnings emitted later\n // at navigation time can be associated with the JSX that created\n // this <Link>.\n const ownerStack =\n process.env.NODE_ENV !== 'production' && process.env.__NEXT_CACHE_COMPONENTS\n ? // eslint-disable-next-line react-hooks/rules-of-hooks -- build time variables\n React.useMemo(() => {\n // Only capture when a warning might actually need it. Otherwise leave\n // it `undefined` so consumers can detect the opt-out and degrade\n // gracefully.\n if (fetchStrategy === FetchStrategy.Full) {\n return React.captureOwnerStack()\n }\n return undefined\n }, [fetchStrategy])\n : undefined\n\n // Use a callback ref to attach an IntersectionObserver to the anchor tag on\n // mount. In the future we will also use this to keep track of all the\n // currently mounted <Link> instances, e.g. so we can re-prefetch them after\n // a revalidation or refresh.\n const observeLinkVisibilityOnMount = React.useCallback(\n (element: HTMLAnchorElement | SVGAElement) => {\n if (router !== null) {\n linkInstanceRef.current = mountLinkInstance(\n element,\n formattedHref,\n router,\n fetchStrategy,\n prefetchEnabled,\n setOptimisticLinkStatus,\n ownerStack\n )\n }\n\n return () => {\n if (linkInstanceRef.current) {\n unmountLinkForCurrentNavigation(linkInstanceRef.current)\n linkInstanceRef.current = null\n }\n unmountPrefetchableInstance(element)\n }\n },\n [\n prefetchEnabled,\n formattedHref,\n router,\n fetchStrategy,\n setOptimisticLinkStatus,\n ownerStack,\n ]\n )\n\n const mergedRef = useMergedRef(observeLinkVisibilityOnMount, childRef)\n\n const childProps: {\n onTouchStart?: React.TouchEventHandler<HTMLAnchorElement>\n onMouseEnter: React.MouseEventHandler<HTMLAnchorElement>\n onClick: React.MouseEventHandler<HTMLAnchorElement>\n href?: string\n ref?: any\n } = {\n ref: mergedRef,\n onClick(e) {\n if (process.env.NODE_ENV !== 'production') {\n if (!e) {\n throw new Error(\n `Component rendered inside next/link has to pass click event to \"onClick\" prop.`\n )\n }\n }\n\n if (!legacyBehavior && typeof onClick === 'function') {\n onClick(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onClick === 'function'\n ) {\n child.props.onClick(e)\n }\n\n if (!router) {\n return\n }\n if (e.defaultPrevented) {\n return\n }\n linkClicked(\n e,\n formattedHref,\n linkInstanceRef,\n replace,\n scroll,\n onNavigate,\n transitionTypes,\n prefetchIntent\n )\n },\n onMouseEnter(e) {\n if (!legacyBehavior && typeof onMouseEnterProp === 'function') {\n onMouseEnterProp(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onMouseEnter === 'function'\n ) {\n child.props.onMouseEnter(e)\n }\n\n if (!router) {\n return\n }\n if (!prefetchEnabled || process.env.NODE_ENV === 'development') {\n return\n }\n\n const upgradeToDynamicPrefetch = unstable_dynamicOnHover === true\n onNavigationIntent(\n e.currentTarget as HTMLAnchorElement | SVGAElement,\n upgradeToDynamicPrefetch\n )\n },\n onTouchStart: process.env.__NEXT_LINK_NO_TOUCH_START\n ? undefined\n : function onTouchStart(e) {\n if (!legacyBehavior && typeof onTouchStartProp === 'function') {\n onTouchStartProp(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onTouchStart === 'function'\n ) {\n child.props.onTouchStart(e)\n }\n\n if (!router) {\n return\n }\n if (!prefetchEnabled) {\n return\n }\n\n const upgradeToDynamicPrefetch = unstable_dynamicOnHover === true\n onNavigationIntent(\n e.currentTarget as HTMLAnchorElement | SVGAElement,\n upgradeToDynamicPrefetch\n )\n },\n }\n\n // If the url is absolute, we can bypass the logic to prepend the basePath.\n if (isAbsoluteUrl(formattedHref)) {\n childProps.href = formattedHref\n } else if (\n !legacyBehavior ||\n passHref ||\n (child.type === 'a' && !('href' in child.props))\n ) {\n childProps.href = addBasePath(formattedHref)\n }\n\n let link: React.ReactNode\n\n if (legacyBehavior) {\n if (process.env.NODE_ENV === 'development') {\n const { errorOnce } =\n require('../../shared/lib/utils/error-once') as typeof import('../../shared/lib/utils/error-once')\n errorOnce(\n '`legacyBehavior` is deprecated and will be removed in a future ' +\n 'release. A codemod is available to upgrade your components:\\n\\n' +\n 'npx @next/codemod@latest new-link .\\n\\n' +\n 'Learn more: https://nextjs.org/docs/app/building-your-application/upgrading/codemods#remove-a-tags-from-link-components'\n )\n }\n link = React.cloneElement(child, childProps)\n } else {\n link = (\n <a {...restProps} {...childProps}>\n {children}\n </a>\n )\n }\n\n return (\n <LinkStatusContext.Provider value={linkStatus}>\n {link}\n </LinkStatusContext.Provider>\n )\n}\n\nconst LinkStatusContext = createContext<\n typeof PENDING_LINK_STATUS | typeof IDLE_LINK_STATUS\n>(IDLE_LINK_STATUS)\n\nexport const useLinkStatus = () => {\n return useContext(LinkStatusContext)\n}\n\nfunction getFetchStrategyFromPrefetchIntent(\n prefetchIntent: Exclude<RouterTransitionPrefetchIntent, 'none'>\n): PrefetchTaskFetchStrategy {\n if (process.env.__NEXT_CACHE_COMPONENTS) {\n if (prefetchIntent === 'full') {\n return FetchStrategy.Full\n }\n\n // `\"auto\"`: the default mode, where we will prefetch partially if the link is in the viewport.\n prefetchIntent satisfies 'auto'\n return FetchStrategy.PPR\n } else {\n return prefetchIntent === 'auto'\n ? // We default to PPR, and we'll discover whether or not the route supports it with the initial prefetch.\n FetchStrategy.PPR\n : // In the old implementation without runtime prefetches, `prefetch={true}` (`'full'`) forces all dynamic\n // data to be prefetched, preserving backwards-compatibility.\n FetchStrategy.Full\n }\n}\n"],"names":["LinkComponent","useLinkStatus","isModifiedEvent","event","eventTarget","currentTarget","target","getAttribute","metaKey","ctrlKey","shiftKey","altKey","nativeEvent","which","linkClicked","e","href","linkInstanceRef","replace","scroll","onNavigate","transitionTypes","prefetchIntent","window","nodeName","isAnchorNodeName","toUpperCase","hasAttribute","isLocalURL","preventDefault","location","isDefaultPrevented","dispatchNavigateAction","require","React","startTransition","ScrollBehavior","NoScroll","Default","current","formatStringOrUrl","urlObjOrString","formatUrl","props","linkStatus","setOptimisticLinkStatus","useOptimistic","IDLE_LINK_STATUS","children","useRef","hrefProp","as","asProp","childrenProp","prefetch","prefetchProp","passHref","shallow","onClick","onMouseEnter","onMouseEnterProp","onTouchStart","onTouchStartProp","legacyBehavior","ref","forwardedRef","unstable_dynamicOnHover","restProps","a","router","useContext","AppRouterContext","prefetchEnabled","fetchStrategy","getFetchStrategyFromPrefetchIntent","FetchStrategy","PPR","process","env","NODE_ENV","createPropError","args","Error","key","expected","actual","requiredPropsGuard","requiredProps","Object","keys","forEach","_","optionalPropsGuard","optionalProps","valType","Array","isArray","resolvedHref","formattedHref","warnOnce","locale","pathname","hasDynamicSegment","split","some","segment","startsWith","endsWith","child","$$typeof","Symbol","for","console","warn","Children","only","err","type","childRef","ownerStack","__NEXT_CACHE_COMPONENTS","useMemo","Full","captureOwnerStack","undefined","observeLinkVisibilityOnMount","useCallback","element","mountLinkInstance","unmountLinkForCurrentNavigation","unmountPrefetchableInstance","mergedRef","useMergedRef","childProps","defaultPrevented","upgradeToDynamicPrefetch","onNavigationIntent","__NEXT_LINK_NO_TOUCH_START","isAbsoluteUrl","addBasePath","link","errorOnce","cloneElement","LinkStatusContext","Provider","value","createContext"],"mappings":"AAAA;;;;;;;;;;;;;;;;IAuUA;;;;;;;;;CASC,GACD,OA4cC;eA5cuBA;;IAkdXC,aAAa;eAAbA;;;;;iEAjyB2D;2BAE9C;+CACO;8BACJ;uBACC;6BACF;oCACG;uBASxB;4BACoB;uBAIpB;AAwNP,SAASC,gBAAgBC,KAAuB;IAC9C,MAAMC,cAAcD,MAAME,aAAa;IACvC,MAAMC,SAASF,YAAYG,YAAY,CAAC;IACxC,OACE,AAACD,UAAUA,WAAW,WACtBH,MAAMK,OAAO,IACbL,MAAMM,OAAO,IACbN,MAAMO,QAAQ,IACdP,MAAMQ,MAAM,IAAI,6BAA6B;IAC5CR,MAAMS,WAAW,IAAIT,MAAMS,WAAW,CAACC,KAAK,KAAK;AAEtD;AAEA,SAASC,YACPC,CAAmB,EACnBC,IAAY,EACZC,eAAqD,EACrDC,OAAiB,EACjBC,MAAgB,EAChBC,UAAmC,EACnCC,eAA0B,EAC1BC,iBAAiD,MAAM;IAEvD,IAAI,OAAOC,WAAW,aAAa;QACjC,MAAM,EAAEC,QAAQ,EAAE,GAAGT,EAAEV,aAAa;QAEpC,kDAAkD;QAClD,MAAMoB,mBAAmBD,SAASE,WAAW,OAAO;QACpD,IACE,AAACD,oBAAoBvB,gBAAgBa,MACrCA,EAAEV,aAAa,CAACsB,YAAY,CAAC,aAC7B;YACA,8CAA8C;YAC9C;QACF;QAEA,IAAI,CAACC,IAAAA,sBAAU,EAACZ,OAAO;YACrB,IAAIE,SAAS;gBACX,8DAA8D;gBAC9D,+BAA+B;gBAC/BH,EAAEc,cAAc;gBACh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AAOrG;kBAChCgG;;AAGP;AAEA,MAAMG,kCAAoBG,IAAAA,oBAAa,EAErCnG,uBAAgB;AAEX,MAAM9C,gBAAgB;IAC3B,OAAOqE,IAAAA,iBAAU,EAACyE;AACpB;AAEA,SAASrE,mCACPpD,cAA+D;IAE/D,IAAIuD,QAAQC,GAAG,CAAC0C,uBAAuB,EAAE;QACvC,IAAIlG,mBAAmB,QAAQ;YAC7B,OAAOqD,oBAAa,CAAC+C,IAAI;QAC3B;QAEA,+FAA+F;QAC/FpG;QACA,OAAOqD,oBAAa,CAACC,GAAG;IAC1B,OAAO;QACL,OAAOtD,mBAAmB,SAEtBqD,oBAAa,CAACC,GAAG,GAEjB,6DAA6D;QAC7DD,oBAAa,CAAC+C,IAAI;IACxB;AACF","ignoreList":[0]} |
| import './app-globals'; | ||
| import type { ClientInstrumentationModules } from './router-transition-types'; | ||
| type FlightSegment = [isBootStrap: 0] | [isNotBootstrap: 1, responsePartial: string] | [isFormState: 2, formState: any] | [isBinary: 3, responseBase64Partial: string]; | ||
@@ -15,6 +16,3 @@ type NextFlight = Omit<Array<FlightSegment>, 'push'> & { | ||
| } | ||
| export type ClientInstrumentationHooks = { | ||
| onRouterTransitionStart?: (url: string, navigationType: 'push' | 'replace' | 'traverse') => void; | ||
| }; | ||
| export declare function hydrate(instrumentationHooks: ClientInstrumentationHooks | null, assetPrefix: string): Promise<void>; | ||
| export declare function hydrate(instrumentationModules: ClientInstrumentationModules, assetPrefix: string): Promise<void>; | ||
| export {}; |
@@ -29,2 +29,3 @@ "use strict"; | ||
| const _navigationbuildid = require("./navigation-build-id"); | ||
| const _routertransition = require("./components/router-transition"); | ||
| /// <reference types="react-dom/experimental" /> | ||
@@ -240,3 +241,3 @@ const createFromReadableStream = _client1.createFromReadableStream; | ||
| }; | ||
| async function hydrate(instrumentationHooks, assetPrefix) { | ||
| async function hydrate(instrumentationModules, assetPrefix) { | ||
| let staticIndicatorState; | ||
@@ -265,2 +266,3 @@ let webSocket; | ||
| } | ||
| (0, _routertransition.initializeRouterTransitionModules)(instrumentationModules); | ||
| const initialTimestamp = Date.now(); | ||
@@ -272,3 +274,3 @@ const actionQueue = (0, _approuterinstance.createMutableActionQueue)((0, _createinitialrouterstate.createInitialRouterState)({ | ||
| location: window.location | ||
| }), instrumentationHooks); | ||
| })); | ||
| const reactEl = /*#__PURE__*/ (0, _jsxruntime.jsx)(StrictModeIfEnabled, { | ||
@@ -275,0 +277,0 @@ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_headmanagercontextsharedruntime.HeadManagerContext.Provider, { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/client/app-index.tsx"],"sourcesContent":["import './app-globals'\nimport ReactDOMClient from 'react-dom/client'\nimport React from 'react'\n// TODO: Explicitly import from client.browser\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport {\n createFromReadableStream as createFromReadableStreamBrowser,\n createFromFetch as createFromFetchBrowser,\n} from 'react-server-dom-webpack/client'\nimport { HeadManagerContext } from '../shared/lib/head-manager-context.shared-runtime'\nimport { onRecoverableError } from './react-client-callbacks/on-recoverable-error'\nimport {\n onCaughtError,\n onUncaughtError,\n} from './react-client-callbacks/error-boundary-callbacks'\nimport { callServer } from './app-call-server'\nimport { findSourceMapURL } from './app-find-source-map-url'\nimport {\n type AppRouterActionQueue,\n createMutableActionQueue,\n} from './components/app-router-instance'\nimport AppRouter from './components/app-router'\nimport type { InitialRSCPayload } from '../shared/lib/app-router-types'\nimport { createInitialRouterState } from './components/router-reducer/create-initial-router-state'\nimport { MissingSlotContext } from '../shared/lib/app-router-context.shared-runtime'\nimport type { StaticIndicatorState } from './dev/hot-reloader/app/hot-reloader-app'\nimport { createInitialRSCPayloadFromFallbackPrerender } from './flight-data-helpers'\nimport { getDeploymentId } from '../shared/lib/deployment-id'\nimport { setNavigationBuildId } from './navigation-build-id'\n\n/// <reference types=\"react-dom/experimental\" />\n\nconst createFromReadableStream =\n createFromReadableStreamBrowser as (typeof import('react-server-dom-webpack/client.browser'))['createFromReadableStream']\nconst createFromFetch =\n createFromFetchBrowser as (typeof import('react-server-dom-webpack/client.browser'))['createFromFetch']\n\nconst appElement: HTMLElement | Document = document\n\n// Instant Navigation Testing API: captured once at module init. When truthy,\n// this is the fetch promise for the static RSC payload (set by an injected\n// <script> tag in the static shell HTML).\nconst instantTestStaticFetch: Promise<Response> | undefined =\n self.__next_instant_test\n ? (self.__next_instant_test as unknown as Promise<Response>)\n : undefined\n\nconst encoder = new TextEncoder()\n\nlet initialServerDataBuffer: (string | Uint8Array)[] | undefined = undefined\nlet initialServerDataWriter: ReadableStreamDefaultController | undefined =\n undefined\nlet initialServerDataLoaded = false\nlet initialServerDataFlushed = false\n\nlet initialFormStateData: null | any = null\n\ntype FlightSegment =\n | [isBootStrap: 0]\n | [isNotBootstrap: 1, responsePartial: string]\n | [isFormState: 2, formState: any]\n | [isBinary: 3, responseBase64Partial: string]\n\ntype NextFlight = Omit<Array<FlightSegment>, 'push'> & {\n push: (seg: FlightSegment) => void\n}\n\ndeclare global {\n // If you're working in a browser environment\n interface Window {\n /**\n * request ID, dev-only\n */\n __next_r?: string\n __next_f: NextFlight\n }\n}\n\nfunction nextServerDataCallback(seg: FlightSegment): void {\n if (seg[0] === 0) {\n initialServerDataBuffer = []\n } else if (seg[0] === 1) {\n if (!initialServerDataBuffer)\n throw new Error('Unexpected server data: missing bootstrap script.')\n\n if (initialServerDataWriter) {\n initialServerDataWriter.enqueue(encoder.encode(seg[1]))\n } else {\n initialServerDataBuffer.push(seg[1])\n }\n } else if (seg[0] === 2) {\n initialFormStateData = seg[1]\n } else if (seg[0] === 3) {\n if (!initialServerDataBuffer)\n throw new Error('Unexpected server data: missing bootstrap script.')\n\n // Decode the base64 string back to binary data.\n const binaryString = atob(seg[1])\n const decodedChunk = new Uint8Array(binaryString.length)\n for (var i = 0; i < binaryString.length; i++) {\n decodedChunk[i] = binaryString.charCodeAt(i)\n }\n\n if (initialServerDataWriter) {\n initialServerDataWriter.enqueue(decodedChunk)\n } else {\n initialServerDataBuffer.push(decodedChunk)\n }\n }\n}\n\nfunction isStreamErrorOrUnfinished(ctr: ReadableStreamDefaultController) {\n // If `desiredSize` is null, it means the stream is closed or errored. If it is lower than 0, the stream is still unfinished.\n return ctr.desiredSize === null || ctr.desiredSize < 0\n}\n\n// There might be race conditions between `nextServerDataRegisterWriter` and\n// `DOMContentLoaded`. The former will be called when React starts to hydrate\n// the root, the latter will be called when the DOM is fully loaded.\n// For streaming, the former is called first due to partial hydration.\n// For non-streaming, the latter can be called first.\n// Hence, we use two variables `initialServerDataLoaded` and\n// `initialServerDataFlushed` to make sure the writer will be closed and\n// `initialServerDataBuffer` will be cleared in the right time.\nfunction nextServerDataRegisterWriter(ctr: ReadableStreamDefaultController) {\n if (initialServerDataBuffer) {\n initialServerDataBuffer.forEach((val) => {\n ctr.enqueue(typeof val === 'string' ? encoder.encode(val) : val)\n })\n if (initialServerDataLoaded && !initialServerDataFlushed) {\n // Instant Navigation Testing API: don't close or error the inline\n // Flight stream. The static shell has no inline Flight data, so the\n // stream is empty. Closing it would cause React to log an error about\n // missing data. Leaving it open lets React treat any holes as\n // \"still suspended.\" Hydration uses the separately fetched RSC payload\n // (self.__next_instant_test), not this stream.\n if (isStreamErrorOrUnfinished(ctr)) {\n if (!instantTestStaticFetch) {\n ctr.error(\n new Error(\n 'The connection to the page was unexpectedly closed, possibly due to the stop button being clicked, loss of Wi-Fi, or an unstable internet connection.'\n )\n )\n }\n } else {\n ctr.close()\n }\n initialServerDataFlushed = true\n initialServerDataBuffer = undefined\n }\n }\n\n initialServerDataWriter = ctr\n}\n\n// When `DOMContentLoaded`, we can close all pending writers to finish hydration.\nconst DOMContentLoaded = function () {\n if (initialServerDataWriter && !initialServerDataFlushed) {\n initialServerDataWriter.close()\n initialServerDataFlushed = true\n initialServerDataBuffer = undefined\n }\n initialServerDataLoaded = true\n}\n\n// It's possible that the DOM is already loaded.\nif (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', DOMContentLoaded, false)\n} else {\n // Delayed in marco task to ensure it's executed later than hydration\n setTimeout(DOMContentLoaded)\n}\n\nconst nextServerDataLoadingGlobal = (self.__next_f = self.__next_f || [])\n\n// Consume all buffered chunks and clear the global data array right after to release memory.\n// Otherwise it will be retained indefinitely.\nnextServerDataLoadingGlobal.forEach(nextServerDataCallback)\nnextServerDataLoadingGlobal.length = 0\n\n// Patch its push method so subsequent chunks are handled (but not actually pushed to the array).\nnextServerDataLoadingGlobal.push = nextServerDataCallback\n\nlet readable: ReadableStream<Uint8Array> = new ReadableStream({\n start(controller) {\n nextServerDataRegisterWriter(controller)\n },\n})\nif (process.env.NODE_ENV !== 'production') {\n // @ts-expect-error\n readable.name = 'hydration'\n}\n\n// When Cache Components is enabled, tee the inlined Flight stream so we can\n// truncate a clone at the static stage byte boundary and cache it. We don't\n// know if `l` is present until React decodes the payload, so always tee and\n// cancel the clone if not needed.\nlet initialFlightStreamForCache: ReadableStream<Uint8Array> | null = null\nif (\n process.env.__NEXT_CACHE_COMPONENTS &&\n process.env.__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS\n) {\n const [forReact, forCache] = readable.tee()\n readable = forReact\n initialFlightStreamForCache = forCache\n}\n\nlet debugChannel:\n | { readable?: ReadableStream; writable?: WritableStream }\n | undefined\n\nif (\n process.env.__NEXT_DEV_SERVER &&\n process.env.__NEXT_REACT_DEBUG_CHANNEL &&\n typeof window !== 'undefined'\n) {\n const { createDebugChannel } =\n require('./dev/debug-channel') as typeof import('./dev/debug-channel')\n\n debugChannel = createDebugChannel(undefined)\n}\n\nlet initialServerResponse: Promise<InitialRSCPayload>\nif (instantTestStaticFetch) {\n // Instant Navigation Testing API: hydrate from the static RSC payload\n // fetch kicked off by an injected <script> tag, instead of the inline\n // Flight data (which is not present in the static shell).\n initialServerResponse = Promise.resolve(\n createFromFetch<InitialRSCPayload>(instantTestStaticFetch, {\n callServer,\n findSourceMapURL,\n debugChannel,\n // The static fetch response is a partial stream (static-only Flight\n // data with no dynamic content). Allow it to close without error so\n // React treats dynamic holes as still-suspended rather than\n // triggering error recovery.\n unstable_allowPartialStream: true,\n })\n ).then(async (initialRSCPayload) => {\n return createInitialRSCPayloadFromFallbackPrerender(\n await instantTestStaticFetch,\n initialRSCPayload\n )\n })\n} else if (\n // @ts-expect-error\n window.__NEXT_CLIENT_RESUME\n) {\n const clientResumeFetch: Promise<Response> =\n // @ts-expect-error\n window.__NEXT_CLIENT_RESUME\n initialServerResponse = Promise.resolve(\n createFromFetch<InitialRSCPayload>(clientResumeFetch, {\n callServer,\n findSourceMapURL,\n debugChannel,\n })\n ).then(async (fallbackInitialRSCPayload) =>\n createInitialRSCPayloadFromFallbackPrerender(\n await clientResumeFetch,\n fallbackInitialRSCPayload\n )\n )\n} else {\n initialServerResponse = createFromReadableStream<InitialRSCPayload>(\n readable,\n {\n callServer,\n findSourceMapURL,\n debugChannel,\n startTime: 0,\n }\n )\n}\n\nfunction ServerRoot({\n initialRSCPayload,\n actionQueue,\n webSocket,\n staticIndicatorState,\n}: {\n initialRSCPayload: InitialRSCPayload\n actionQueue: AppRouterActionQueue\n webSocket: WebSocket | undefined\n staticIndicatorState: StaticIndicatorState | undefined\n}): React.ReactNode {\n const router = (\n <AppRouter\n actionQueue={actionQueue}\n globalErrorState={initialRSCPayload.G}\n webSocket={webSocket}\n staticIndicatorState={staticIndicatorState}\n />\n )\n\n if (process.env.NODE_ENV === 'development' && initialRSCPayload.m) {\n // We provide missing slot information in a context provider only during development\n // as we log some additional information about the missing slots in the console.\n return (\n <MissingSlotContext value={initialRSCPayload.m}>\n {router}\n </MissingSlotContext>\n )\n }\n\n return router\n}\n\nconst StrictModeIfEnabled = process.env.__NEXT_STRICT_MODE_APP\n ? React.StrictMode\n : React.Fragment\n\nfunction Root({ children }: React.PropsWithChildren<{}>) {\n if (process.env.__NEXT_TEST_MODE) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n window.__NEXT_HYDRATED = true\n window.__NEXT_HYDRATED_AT = performance.now()\n window.__NEXT_HYDRATED_CB?.()\n }, [])\n }\n\n return children\n}\n\nconst enableTransitionIndicator = process.env.__NEXT_TRANSITION_INDICATOR\n\nfunction noDefaultTransitionIndicator() {\n return () => {}\n}\n\nconst reactRootOptions: ReactDOMClient.RootOptions = {\n onDefaultTransitionIndicator: enableTransitionIndicator\n ? // TODO: Compose default with user-configureable (e.g. nprogress)\n undefined\n : noDefaultTransitionIndicator,\n onRecoverableError,\n onCaughtError,\n onUncaughtError,\n}\n\nexport type ClientInstrumentationHooks = {\n onRouterTransitionStart?: (\n url: string,\n navigationType: 'push' | 'replace' | 'traverse'\n ) => void\n}\n\nexport async function hydrate(\n instrumentationHooks: ClientInstrumentationHooks | null,\n assetPrefix: string\n) {\n let staticIndicatorState: StaticIndicatorState | undefined\n let webSocket: WebSocket | undefined\n\n if (process.env.__NEXT_DEV_SERVER) {\n const { createWebSocket } =\n require('./dev/hot-reloader/app/web-socket') as typeof import('./dev/hot-reloader/app/web-socket')\n\n staticIndicatorState = { pathname: null, appIsrManifest: null }\n webSocket = createWebSocket(assetPrefix, staticIndicatorState)\n }\n const initialRSCPayload = await initialServerResponse\n\n // Initialize the offline module to register browser event listeners\n // (offline/online) before any components hydrate.\n if (process.env.__NEXT_USE_OFFLINE) {\n require('./components/offline') as typeof import('./components/offline')\n }\n\n // setNavigationBuildId should be called only once, during JS initialization\n // and before any components have hydrated.\n if (initialRSCPayload.b) {\n setNavigationBuildId(initialRSCPayload.b!)\n } else {\n setNavigationBuildId(getDeploymentId()!)\n }\n\n const initialTimestamp = Date.now()\n const actionQueue: AppRouterActionQueue = createMutableActionQueue(\n createInitialRouterState({\n navigatedAt: initialTimestamp,\n initialRSCPayload,\n initialFlightStreamForCache,\n location: window.location,\n }),\n instrumentationHooks\n )\n\n const reactEl = (\n <StrictModeIfEnabled>\n <HeadManagerContext.Provider value={{ appDir: true }}>\n <Root>\n <ServerRoot\n initialRSCPayload={initialRSCPayload}\n actionQueue={actionQueue}\n webSocket={webSocket}\n staticIndicatorState={staticIndicatorState}\n />\n </Root>\n </HeadManagerContext.Provider>\n </StrictModeIfEnabled>\n )\n\n if (document.documentElement.id === '__next_error__') {\n let element = reactEl\n // Server rendering failed, fall back to client-side rendering\n if (process.env.NODE_ENV !== 'production') {\n const { RootLevelDevOverlayElement } =\n require('../next-devtools/userspace/app/client-entry') as typeof import('../next-devtools/userspace/app/client-entry')\n\n // Note this won't cause hydration mismatch because we are doing CSR w/o hydration\n element = (\n <RootLevelDevOverlayElement>{element}</RootLevelDevOverlayElement>\n )\n }\n\n ReactDOMClient.createRoot(appElement, reactRootOptions).render(element)\n } else {\n React.startTransition(() => {\n ReactDOMClient.hydrateRoot(appElement, reactEl, {\n ...reactRootOptions,\n formState: initialFormStateData,\n })\n })\n }\n\n // TODO-APP: Remove this logic when Float has GC built-in in development.\n if (process.env.__NEXT_DEV_SERVER) {\n const { linkGc } =\n require('./app-link-gc') as typeof import('./app-link-gc')\n linkGc()\n }\n}\n"],"names":["hydrate","createFromReadableStream","createFromReadableStreamBrowser","createFromFetch","createFromFetchBrowser","appElement","document","instantTestStaticFetch","self","__next_instant_test","undefined","encoder","TextEncoder","initialServerDataBuffer","initialServerDataWriter","initialServerDataLoaded","initialServerDataFlushed","initialFormStateData","nextServerDataCallback","seg","Error","enqueue","encode","push","binaryString","atob","decodedChunk","Uint8Array","length","i","charCodeAt","isStreamErrorOrUnfinished","ctr","desiredSize","nextServerDataRegisterWriter","forEach","val","error","close","DOMContentLoaded","readyState","addEventListener","setTimeout","nextServerDataLoadingGlobal","__next_f","readable","ReadableStream","start","controller","process","env","NODE_ENV","name","initialFlightStreamForCache","__NEXT_CACHE_COMPONENTS","__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS","forReact","forCache","tee","debugChannel","__NEXT_DEV_SERVER","__NEXT_REACT_DEBUG_CHANNEL","window","createDebugChannel","require","initialServerResponse","Promise","resolve","callServer","findSourceMapURL","unstable_allowPartialStream","then","initialRSCPayload","createInitialRSCPayloadFromFallbackPrerender","__NEXT_CLIENT_RESUME","clientResumeFetch","fallbackInitialRSCPayload","startTime","ServerRoot","actionQueue","webSocket","staticIndicatorState","router","AppRouter","globalErrorState","G","m","MissingSlotContext","value","StrictModeIfEnabled","__NEXT_STRICT_MODE_APP","React","StrictMode","Fragment","Root","children","__NEXT_TEST_MODE","useEffect","__NEXT_HYDRATED","__NEXT_HYDRATED_AT","performance","now","__NEXT_HYDRATED_CB","enableTransitionIndicator","__NEXT_TRANSITION_INDICATOR","noDefaultTransitionIndicator","reactRootOptions","onDefaultTransitionIndicator","onRecoverableError","onCaughtError","onUncaughtError","instrumentationHooks","assetPrefix","createWebSocket","pathname","appIsrManifest","__NEXT_USE_OFFLINE","b","setNavigationBuildId","getDeploymentId","initialTimestamp","Date","createMutableActionQueue","createInitialRouterState","navigatedAt","location","reactEl","HeadManagerContext","Provider","appDir","documentElement","id","element","RootLevelDevOverlayElement","ReactDOMClient","createRoot","render","startTransition","hydrateRoot","formState","linkGc"],"mappings":";;;;+BA4VsBA;;;eAAAA;;;;;QA5Vf;iEACoB;gEACT;yBAMX;iDAC4B;oCACA;wCAI5B;+BACoB;qCACM;mCAI1B;oEACe;0CAEmB;+CACN;mCAE0B;8BAC7B;mCACK;AAErC,gDAAgD;AAEhD,MAAMC,2BACJC,iCAA+B;AACjC,MAAMC,kBACJC,wBAAsB;AAExB,MAAMC,aAAqCC;AAE3C,6EAA6E;AAC7E,2EAA2E;AAC3E,0CAA0C;AAC1C,MAAMC,yBACJC,KAAKC,mBAAmB,GACnBD,KAAKC,mBAAmB,GACzBC;AAEN,MAAMC,UAAU,IAAIC;AAEpB,IAAIC,0BAA+DH;AACnE,IAAII,0BACFJ;AACF,IAAIK,0BAA0B;AAC9B,IAAIC,2BAA2B;AAE/B,IAAIC,uBAAmC;AAuBvC,SAASC,uBAAuBC,GAAkB;IAChD,IAAIA,GAAG,CAAC,EAAE,KAAK,GAAG;QAChBN,0BAA0B,EAAE;IA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reList":[0]} | ||
| {"version":3,"sources":["../../src/client/app-index.tsx"],"sourcesContent":["import './app-globals'\nimport ReactDOMClient from 'react-dom/client'\nimport React from 'react'\n// TODO: Explicitly import from client.browser\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport {\n createFromReadableStream as createFromReadableStreamBrowser,\n createFromFetch as createFromFetchBrowser,\n} from 'react-server-dom-webpack/client'\nimport { HeadManagerContext } from '../shared/lib/head-manager-context.shared-runtime'\nimport { onRecoverableError } from './react-client-callbacks/on-recoverable-error'\nimport {\n onCaughtError,\n onUncaughtError,\n} from './react-client-callbacks/error-boundary-callbacks'\nimport { callServer } from './app-call-server'\nimport { findSourceMapURL } from './app-find-source-map-url'\nimport {\n type AppRouterActionQueue,\n createMutableActionQueue,\n} from './components/app-router-instance'\nimport AppRouter from './components/app-router'\nimport type { InitialRSCPayload } from '../shared/lib/app-router-types'\nimport { createInitialRouterState } from './components/router-reducer/create-initial-router-state'\nimport { MissingSlotContext } from '../shared/lib/app-router-context.shared-runtime'\nimport type { StaticIndicatorState } from './dev/hot-reloader/app/hot-reloader-app'\nimport { createInitialRSCPayloadFromFallbackPrerender } from './flight-data-helpers'\nimport { getDeploymentId } from '../shared/lib/deployment-id'\nimport { setNavigationBuildId } from './navigation-build-id'\nimport type { ClientInstrumentationModules } from './router-transition-types'\nimport { initializeRouterTransitionModules } from './components/router-transition'\n\n/// <reference types=\"react-dom/experimental\" />\n\nconst createFromReadableStream =\n createFromReadableStreamBrowser as (typeof import('react-server-dom-webpack/client.browser'))['createFromReadableStream']\nconst createFromFetch =\n createFromFetchBrowser as (typeof import('react-server-dom-webpack/client.browser'))['createFromFetch']\n\nconst appElement: HTMLElement | Document = document\n\n// Instant Navigation Testing API: captured once at module init. When truthy,\n// this is the fetch promise for the static RSC payload (set by an injected\n// <script> tag in the static shell HTML).\nconst instantTestStaticFetch: Promise<Response> | undefined =\n self.__next_instant_test\n ? (self.__next_instant_test as unknown as Promise<Response>)\n : undefined\n\nconst encoder = new TextEncoder()\n\nlet initialServerDataBuffer: (string | Uint8Array)[] | undefined = undefined\nlet initialServerDataWriter: ReadableStreamDefaultController | undefined =\n undefined\nlet initialServerDataLoaded = false\nlet initialServerDataFlushed = false\n\nlet initialFormStateData: null | any = null\n\ntype FlightSegment =\n | [isBootStrap: 0]\n | [isNotBootstrap: 1, responsePartial: string]\n | [isFormState: 2, formState: any]\n | [isBinary: 3, responseBase64Partial: string]\n\ntype NextFlight = Omit<Array<FlightSegment>, 'push'> & {\n push: (seg: FlightSegment) => void\n}\n\ndeclare global {\n // If you're working in a browser environment\n interface Window {\n /**\n * request ID, dev-only\n */\n __next_r?: string\n __next_f: NextFlight\n }\n}\n\nfunction nextServerDataCallback(seg: FlightSegment): void {\n if (seg[0] === 0) {\n initialServerDataBuffer = []\n } else if (seg[0] === 1) {\n if (!initialServerDataBuffer)\n throw new Error('Unexpected server data: missing bootstrap script.')\n\n if (initialServerDataWriter) {\n initialServerDataWriter.enqueue(encoder.encode(seg[1]))\n } else {\n initialServerDataBuffer.push(seg[1])\n }\n } else if (seg[0] === 2) {\n initialFormStateData = seg[1]\n } else if (seg[0] === 3) {\n if (!initialServerDataBuffer)\n throw new Error('Unexpected server data: missing bootstrap script.')\n\n // Decode the base64 string back to binary data.\n const binaryString = atob(seg[1])\n const decodedChunk = new Uint8Array(binaryString.length)\n for (var i = 0; i < binaryString.length; i++) {\n decodedChunk[i] = binaryString.charCodeAt(i)\n }\n\n if (initialServerDataWriter) {\n initialServerDataWriter.enqueue(decodedChunk)\n } else {\n initialServerDataBuffer.push(decodedChunk)\n }\n }\n}\n\nfunction isStreamErrorOrUnfinished(ctr: ReadableStreamDefaultController) {\n // If `desiredSize` is null, it means the stream is closed or errored. If it is lower than 0, the stream is still unfinished.\n return ctr.desiredSize === null || ctr.desiredSize < 0\n}\n\n// There might be race conditions between `nextServerDataRegisterWriter` and\n// `DOMContentLoaded`. The former will be called when React starts to hydrate\n// the root, the latter will be called when the DOM is fully loaded.\n// For streaming, the former is called first due to partial hydration.\n// For non-streaming, the latter can be called first.\n// Hence, we use two variables `initialServerDataLoaded` and\n// `initialServerDataFlushed` to make sure the writer will be closed and\n// `initialServerDataBuffer` will be cleared in the right time.\nfunction nextServerDataRegisterWriter(ctr: ReadableStreamDefaultController) {\n if (initialServerDataBuffer) {\n initialServerDataBuffer.forEach((val) => {\n ctr.enqueue(typeof val === 'string' ? encoder.encode(val) : val)\n })\n if (initialServerDataLoaded && !initialServerDataFlushed) {\n // Instant Navigation Testing API: don't close or error the inline\n // Flight stream. The static shell has no inline Flight data, so the\n // stream is empty. Closing it would cause React to log an error about\n // missing data. Leaving it open lets React treat any holes as\n // \"still suspended.\" Hydration uses the separately fetched RSC payload\n // (self.__next_instant_test), not this stream.\n if (isStreamErrorOrUnfinished(ctr)) {\n if (!instantTestStaticFetch) {\n ctr.error(\n new Error(\n 'The connection to the page was unexpectedly closed, possibly due to the stop button being clicked, loss of Wi-Fi, or an unstable internet connection.'\n )\n )\n }\n } else {\n ctr.close()\n }\n initialServerDataFlushed = true\n initialServerDataBuffer = undefined\n }\n }\n\n initialServerDataWriter = ctr\n}\n\n// When `DOMContentLoaded`, we can close all pending writers to finish hydration.\nconst DOMContentLoaded = function () {\n if (initialServerDataWriter && !initialServerDataFlushed) {\n initialServerDataWriter.close()\n initialServerDataFlushed = true\n initialServerDataBuffer = undefined\n }\n initialServerDataLoaded = true\n}\n\n// It's possible that the DOM is already loaded.\nif (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', DOMContentLoaded, false)\n} else {\n // Delayed in marco task to ensure it's executed later than hydration\n setTimeout(DOMContentLoaded)\n}\n\nconst nextServerDataLoadingGlobal = (self.__next_f = self.__next_f || [])\n\n// Consume all buffered chunks and clear the global data array right after to release memory.\n// Otherwise it will be retained indefinitely.\nnextServerDataLoadingGlobal.forEach(nextServerDataCallback)\nnextServerDataLoadingGlobal.length = 0\n\n// Patch its push method so subsequent chunks are handled (but not actually pushed to the array).\nnextServerDataLoadingGlobal.push = nextServerDataCallback\n\nlet readable: ReadableStream<Uint8Array> = new ReadableStream({\n start(controller) {\n nextServerDataRegisterWriter(controller)\n },\n})\nif (process.env.NODE_ENV !== 'production') {\n // @ts-expect-error\n readable.name = 'hydration'\n}\n\n// When Cache Components is enabled, tee the inlined Flight stream so we can\n// truncate a clone at the static stage byte boundary and cache it. We don't\n// know if `l` is present until React decodes the payload, so always tee and\n// cancel the clone if not needed.\nlet initialFlightStreamForCache: ReadableStream<Uint8Array> | null = null\nif (\n process.env.__NEXT_CACHE_COMPONENTS &&\n process.env.__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS\n) {\n const [forReact, forCache] = readable.tee()\n readable = forReact\n initialFlightStreamForCache = forCache\n}\n\nlet debugChannel:\n | { readable?: ReadableStream; writable?: WritableStream }\n | undefined\n\nif (\n process.env.__NEXT_DEV_SERVER &&\n process.env.__NEXT_REACT_DEBUG_CHANNEL &&\n typeof window !== 'undefined'\n) {\n const { createDebugChannel } =\n require('./dev/debug-channel') as typeof import('./dev/debug-channel')\n\n debugChannel = createDebugChannel(undefined)\n}\n\nlet initialServerResponse: Promise<InitialRSCPayload>\nif (instantTestStaticFetch) {\n // Instant Navigation Testing API: hydrate from the static RSC payload\n // fetch kicked off by an injected <script> tag, instead of the inline\n // Flight data (which is not present in the static shell).\n initialServerResponse = Promise.resolve(\n createFromFetch<InitialRSCPayload>(instantTestStaticFetch, {\n callServer,\n findSourceMapURL,\n debugChannel,\n // The static fetch response is a partial stream (static-only Flight\n // data with no dynamic content). Allow it to close without error so\n // React treats dynamic holes as still-suspended rather than\n // triggering error recovery.\n unstable_allowPartialStream: true,\n })\n ).then(async (initialRSCPayload) => {\n return createInitialRSCPayloadFromFallbackPrerender(\n await instantTestStaticFetch,\n initialRSCPayload\n )\n })\n} else if (\n // @ts-expect-error\n window.__NEXT_CLIENT_RESUME\n) {\n const clientResumeFetch: Promise<Response> =\n // @ts-expect-error\n window.__NEXT_CLIENT_RESUME\n initialServerResponse = Promise.resolve(\n createFromFetch<InitialRSCPayload>(clientResumeFetch, {\n callServer,\n findSourceMapURL,\n debugChannel,\n })\n ).then(async (fallbackInitialRSCPayload) =>\n createInitialRSCPayloadFromFallbackPrerender(\n await clientResumeFetch,\n fallbackInitialRSCPayload\n )\n )\n} else {\n initialServerResponse = createFromReadableStream<InitialRSCPayload>(\n readable,\n {\n callServer,\n findSourceMapURL,\n debugChannel,\n startTime: 0,\n }\n )\n}\n\nfunction ServerRoot({\n initialRSCPayload,\n actionQueue,\n webSocket,\n staticIndicatorState,\n}: {\n initialRSCPayload: InitialRSCPayload\n actionQueue: AppRouterActionQueue\n webSocket: WebSocket | undefined\n staticIndicatorState: StaticIndicatorState | undefined\n}): React.ReactNode {\n const router = (\n <AppRouter\n actionQueue={actionQueue}\n globalErrorState={initialRSCPayload.G}\n webSocket={webSocket}\n staticIndicatorState={staticIndicatorState}\n />\n )\n\n if (process.env.NODE_ENV === 'development' && initialRSCPayload.m) {\n // We provide missing slot information in a context provider only during development\n // as we log some additional information about the missing slots in the console.\n return (\n <MissingSlotContext value={initialRSCPayload.m}>\n {router}\n </MissingSlotContext>\n )\n }\n\n return router\n}\n\nconst StrictModeIfEnabled = process.env.__NEXT_STRICT_MODE_APP\n ? React.StrictMode\n : React.Fragment\n\nfunction Root({ children }: React.PropsWithChildren<{}>) {\n if (process.env.__NEXT_TEST_MODE) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n window.__NEXT_HYDRATED = true\n window.__NEXT_HYDRATED_AT = performance.now()\n window.__NEXT_HYDRATED_CB?.()\n }, [])\n }\n\n return children\n}\n\nconst enableTransitionIndicator = process.env.__NEXT_TRANSITION_INDICATOR\n\nfunction noDefaultTransitionIndicator() {\n return () => {}\n}\n\nconst reactRootOptions: ReactDOMClient.RootOptions = {\n onDefaultTransitionIndicator: enableTransitionIndicator\n ? // TODO: Compose default with user-configureable (e.g. nprogress)\n undefined\n : noDefaultTransitionIndicator,\n onRecoverableError,\n onCaughtError,\n onUncaughtError,\n}\n\nexport async function hydrate(\n instrumentationModules: ClientInstrumentationModules,\n assetPrefix: string\n) {\n let staticIndicatorState: StaticIndicatorState | undefined\n let webSocket: WebSocket | undefined\n\n if (process.env.__NEXT_DEV_SERVER) {\n const { createWebSocket } =\n require('./dev/hot-reloader/app/web-socket') as typeof import('./dev/hot-reloader/app/web-socket')\n\n staticIndicatorState = { pathname: null, appIsrManifest: null }\n webSocket = createWebSocket(assetPrefix, staticIndicatorState)\n }\n const initialRSCPayload = await initialServerResponse\n\n // Initialize the offline module to register browser event listeners\n // (offline/online) before any components hydrate.\n if (process.env.__NEXT_USE_OFFLINE) {\n require('./components/offline') as typeof import('./components/offline')\n }\n\n // setNavigationBuildId should be called only once, during JS initialization\n // and before any components have hydrated.\n if (initialRSCPayload.b) {\n setNavigationBuildId(initialRSCPayload.b!)\n } else {\n setNavigationBuildId(getDeploymentId()!)\n }\n\n initializeRouterTransitionModules(instrumentationModules)\n\n const initialTimestamp = Date.now()\n const actionQueue: AppRouterActionQueue = createMutableActionQueue(\n createInitialRouterState({\n navigatedAt: initialTimestamp,\n initialRSCPayload,\n initialFlightStreamForCache,\n location: window.location,\n })\n )\n\n const reactEl = (\n <StrictModeIfEnabled>\n <HeadManagerContext.Provider value={{ appDir: true }}>\n <Root>\n <ServerRoot\n initialRSCPayload={initialRSCPayload}\n actionQueue={actionQueue}\n webSocket={webSocket}\n staticIndicatorState={staticIndicatorState}\n />\n </Root>\n </HeadManagerContext.Provider>\n </StrictModeIfEnabled>\n )\n\n if (document.documentElement.id === '__next_error__') {\n let element = reactEl\n // Server rendering failed, fall back to client-side rendering\n if (process.env.NODE_ENV !== 'production') {\n const { RootLevelDevOverlayElement } =\n require('../next-devtools/userspace/app/client-entry') as typeof import('../next-devtools/userspace/app/client-entry')\n\n // Note this won't cause hydration mismatch because we are doing CSR w/o hydration\n element = (\n <RootLevelDevOverlayElement>{element}</RootLevelDevOverlayElement>\n )\n }\n\n ReactDOMClient.createRoot(appElement, reactRootOptions).render(element)\n } else {\n React.startTransition(() => {\n ReactDOMClient.hydrateRoot(appElement, reactEl, {\n ...reactRootOptions,\n formState: initialFormStateData,\n })\n })\n }\n\n // TODO-APP: Remove this logic when Float has GC built-in in development.\n if (process.env.__NEXT_DEV_SERVER) {\n const { linkGc } =\n require('./app-link-gc') as typeof import('./app-link-gc')\n linkGc()\n }\n}\n"],"names":["hydrate","createFromReadableStream","createFromReadableStreamBrowser","createFromFetch","createFromFetchBrowser","appElement","document","instantTestStaticFetch","self","__next_instant_test","undefined","encoder","TextEncoder","initialServerDataBuffer","initialServerDataWriter","initialServerDataLoaded","initialServerDataFlushed","initialFormStateData","nextServerDataCallback","seg","Error","enqueue","encode","push","binaryString","atob","decodedChunk","Uint8Array","length","i","charCodeAt","isStreamErrorOrUnfinished","ctr","desiredSize","nextServerDataRegisterWriter","forEach","val","error","close","DOMContentLoaded","readyState","addEventListener","setTimeout","nextServerDataLoadingGlobal","__next_f","readable","ReadableStream","start","controller","process","env","NODE_ENV","name","initialFlightStreamForCache","__NEXT_CACHE_COMPONENTS","__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS","forReact","forCache","tee","debugChannel","__NEXT_DEV_SERVER","__NEXT_REACT_DEBUG_CHANNEL","window","createDebugChannel","require","initialServerResponse","Promise","resolve","callServer","findSourceMapURL","unstable_allowPartialStream","then","initialRSCPayload","createInitialRSCPayloadFromFallbackPrerender","__NEXT_CLIENT_RESUME","clientResumeFetch","fallbackInitialRSCPayload","startTime","ServerRoot","actionQueue","webSocket","staticIndicatorState","router","AppRouter","globalErrorState","G","m","MissingSlotContext","value","StrictModeIfEnabled","__NEXT_STRICT_MODE_APP","React","StrictMode","Fragment","Root","children","__NEXT_TEST_MODE","useEffect","__NEXT_HYDRATED","__NEXT_HYDRATED_AT","performance","now","__NEXT_HYDRATED_CB","enableTransitionIndicator","__NEXT_TRANSITION_INDICATOR","noDefaultTransitionIndicator","reactRootOptions","onDefaultTransitionIndicator","onRecoverableError","onCaughtError","onUncaughtError","instrumentationModules","assetPrefix","createWebSocket","pathname","appIsrManifest","__NEXT_USE_OFFLINE","b","setNavigationBuildId","getDeploymentId","initializeRouterTransitionModules","initialTimestamp","Date","createMutableActionQueue","createInitialRouterState","navigatedAt","location","reactEl","HeadManagerContext","Provider","appDir","documentElement","id","element","RootLevelDevOverlayElement","ReactDOMClient","createRoot","render","startTransition","hydrateRoot","formState","linkGc"],"mappings":";;;;+BAuVsBA;;;eAAAA;;;;;QAvVf;iEACoB;gEACT;yBAMX;iDAC4B;oCACA;wCAI5B;+BACoB;qCACM;mCAI1B;oEACe;0CAEmB;+CACN;mCAE0B;8BAC7B;mCACK;kCAEa;AAElD,gDAAgD;AAEhD,MAAMC,2BACJC,iCAA+B;AACjC,MAAMC,kBACJC,wBAAsB;AAExB,MAAMC,aAAqCC;AAE3C,6EAA6E;AAC7E,2EAA2E;AAC3E,0CAA0C;AAC1C,MAAMC,yBACJC,KAAKC,mBAAmB,GACnBD,KAAKC,mBAAmB,GACzBC;AAEN,MAAMC,UAAU,IAAIC;AAEpB,IAAIC,0BAA+DH;AACnE,IAAII,0BACFJ;AACF,IAAIK,0BAA0B;AAC9B,IAAIC,2BAA2B;AAE/B,IAAIC,uBAAmC;AAuBvC,SAASC,uBAAuBC,GAAkB;IAChD,IAAIA,GAAG,CAAC,EAAE,KAAK,GAAG;QAChBN,0BAA0B,EAAE;IAC9B,OAAO,IAAIM,GAAG,CAAC,EAAE,KAAK,GAAG;QACvB,IAAI,CAACN,yBACH,MAAM,qBAA8D,CAA9D,IAAIO,MAAM,sDAAV,qBAAA;mBAAA;wBAAA;0BAAA;QAA6D;QAErE,IAAIN,yBAAyB;YAC3BA,wBAAwBO,OAAO,CAACV,QAAQW,MAAM,CAACH,GAAG,CAAC,EAAE;QACvD,OAAO;YACLN,wBAAwBU,IAAI,CAACJ,GAAG,CAAC,EAAE;QACrC;IACF,OAAO,IAAIA,GAAG,CAAC,EAAE,KAAK,GAAG;QACv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AAA,kDAAwB,EAAC;QACvBC,aAAaJ;QACbjD;QACAnB;QACAyE,UAAUhE,OAAOgE,QAAQ;IAC3B;IAGF,MAAMC,wBACJ,qBAACtC;kBACC,cAAA,qBAACuC,mDAAkB,CAACC,QAAQ;YAACzC,OAAO;gBAAE0C,QAAQ;YAAK;sBACjD,cAAA,qBAACpC;0BACC,cAAA,qBAAChB;oBACCN,mBAAmBA;oBACnBO,aAAaA;oBACbC,WAAWA;oBACXC,sBAAsBA;;;;;IAOhC,IAAI3E,SAAS6H,eAAe,CAACC,EAAE,KAAK,kBAAkB;QACpD,IAAIC,UAAUN;QACd,8DAA8D;QAC9D,IAAI9E,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;YACzC,MAAM,EAAEmF,0BAA0B,EAAE,GAClCtE,QAAQ;YAEV,kFAAkF;YAClFqE,wBACE,qBAACC;0BAA4BD;;QAEjC;QAEAE,eAAc,CAACC,UAAU,CAACnI,YAAYqG,kBAAkB+B,MAAM,CAACJ;IACjE,OAAO;QACL1C,cAAK,CAAC+C,eAAe,CAAC;YACpBH,eAAc,CAACI,WAAW,CAACtI,YAAY0H,SAAS;gBAC9C,GAAGrB,gBAAgB;gBACnBkC,WAAW3H;YACb;QACF;IACF;IAEA,yEAAyE;IACzE,IAAIgC,QAAQC,GAAG,CAACU,iBAAiB,EAAE;QACjC,MAAM,EAAEiF,MAAM,EAAE,GACd7E,QAAQ;QACV6E;IACF;AACF","ignoreList":[0]} |
@@ -12,3 +12,3 @@ // TODO-APP: hydration warning | ||
| // eslint-disable-next-line @next/internal/typechecked-require | ||
| const instrumentationHooks = require('../lib/require-instrumentation-client'); | ||
| const instrumentationModules = require('../lib/require-instrumentation-client'); | ||
| (0, _appbootstrap.appBootstrap)((assetPrefix)=>{ | ||
@@ -18,3 +18,3 @@ const enableCacheIndicator = process.env.__NEXT_CACHE_COMPONENTS; | ||
| try { | ||
| hydrate(instrumentationHooks, assetPrefix); | ||
| hydrate(instrumentationModules, assetPrefix); | ||
| } finally{ | ||
@@ -21,0 +21,0 @@ (0, _nextdevtools.renderAppDevOverlay)(_stitchederror.getOwnerStack, _onrecoverableerror.isRecoverableError, enableCacheIndicator); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/client/app-next-dev.ts"],"sourcesContent":["// TODO-APP: hydration warning\n\nimport './app-webpack'\n\nimport { renderAppDevOverlay } from 'next/dist/compiled/next-devtools'\nimport { appBootstrap } from './app-bootstrap'\nimport { getOwnerStack } from '../next-devtools/userspace/app/errors/stitched-error'\nimport { isRecoverableError } from './react-client-callbacks/on-recoverable-error'\n\n// eslint-disable-next-line @next/internal/typechecked-require\nconst instrumentationHooks = require('../lib/require-instrumentation-client')\n\nappBootstrap((assetPrefix) => {\n const enableCacheIndicator = process.env.__NEXT_CACHE_COMPONENTS\n\n const { hydrate } = require('./app-index') as typeof import('./app-index')\n try {\n hydrate(instrumentationHooks, assetPrefix)\n } finally {\n renderAppDevOverlay(getOwnerStack, isRecoverableError, enableCacheIndicator)\n }\n})\n"],"names":["instrumentationHooks","require","appBootstrap","assetPrefix","enableCacheIndicator","process","env","__NEXT_CACHE_COMPONENTS","hydrate","renderAppDevOverlay","getOwnerStack","isRecoverableError"],"mappings":"AAAA,8BAA8B;;;;;QAEvB;8BAE6B;8BACP;+BACC;oCACK;AAEnC,8DAA8D;AAC9D,MAAMA,uBAAuBC,QAAQ;AAErCC,IAAAA,0BAAY,EAAC,CAACC;IACZ,MAAMC,uBAAuBC,QAAQC,GAAG,CAACC,uBAAuB;IAEhE,MAAM,EAAEC,OAAO,EAAE,GAAGP,QAAQ;IAC5B,IAAI;QACFO,QAAQR,sBAAsBG;IAChC,SAAU;QACRM,IAAAA,iCAAmB,EAACC,4BAAa,EAAEC,sCAAkB,EAAEP;IACzD;AACF","ignoreList":[0]} | ||
| {"version":3,"sources":["../../src/client/app-next-dev.ts"],"sourcesContent":["// TODO-APP: hydration warning\n\nimport './app-webpack'\n\nimport { renderAppDevOverlay } from 'next/dist/compiled/next-devtools'\nimport { appBootstrap } from './app-bootstrap'\nimport { getOwnerStack } from '../next-devtools/userspace/app/errors/stitched-error'\nimport { isRecoverableError } from './react-client-callbacks/on-recoverable-error'\n\n// eslint-disable-next-line @next/internal/typechecked-require\nconst instrumentationModules = require('../lib/require-instrumentation-client')\n\nappBootstrap((assetPrefix) => {\n const enableCacheIndicator = process.env.__NEXT_CACHE_COMPONENTS\n\n const { hydrate } = require('./app-index') as typeof import('./app-index')\n try {\n hydrate(instrumentationModules, assetPrefix)\n } finally {\n renderAppDevOverlay(getOwnerStack, isRecoverableError, enableCacheIndicator)\n }\n})\n"],"names":["instrumentationModules","require","appBootstrap","assetPrefix","enableCacheIndicator","process","env","__NEXT_CACHE_COMPONENTS","hydrate","renderAppDevOverlay","getOwnerStack","isRecoverableError"],"mappings":"AAAA,8BAA8B;;;;;QAEvB;8BAE6B;8BACP;+BACC;oCACK;AAEnC,8DAA8D;AAC9D,MAAMA,yBAAyBC,QAAQ;AAEvCC,IAAAA,0BAAY,EAAC,CAACC;IACZ,MAAMC,uBAAuBC,QAAQC,GAAG,CAACC,uBAAuB;IAEhE,MAAM,EAAEC,OAAO,EAAE,GAAGP,QAAQ;IAC5B,IAAI;QACFO,QAAQR,wBAAwBG;IAClC,SAAU;QACRM,IAAAA,iCAAmB,EAACC,4BAAa,EAAEC,sCAAkB,EAAEP;IACzD;AACF","ignoreList":[0]} |
@@ -11,7 +11,7 @@ "use strict"; | ||
| // eslint-disable-next-line @next/internal/typechecked-require | ||
| const instrumentationHooks = require('../lib/require-instrumentation-client'); | ||
| const instrumentationModules = require('../lib/require-instrumentation-client'); | ||
| (0, _appbootstrap.appBootstrap)((assetPrefix)=>{ | ||
| const { hydrate } = require('./app-index'); | ||
| try { | ||
| hydrate(instrumentationHooks, assetPrefix); | ||
| hydrate(instrumentationModules, assetPrefix); | ||
| } finally{ | ||
@@ -18,0 +18,0 @@ if (process.env.__NEXT_DEV_SERVER) { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/client/app-next-turbopack.ts"],"sourcesContent":["import './register-deployment-id-global'\nimport { appBootstrap } from './app-bootstrap'\nimport { isRecoverableError } from './react-client-callbacks/on-recoverable-error'\n\nwindow.next.turbopack = true\n;(self as any).__webpack_hash__ = ''\n\n// eslint-disable-next-line @next/internal/typechecked-require\nconst instrumentationHooks = require('../lib/require-instrumentation-client')\n\nappBootstrap((assetPrefix) => {\n const { hydrate } = require('./app-index') as typeof import('./app-index')\n try {\n hydrate(instrumentationHooks, assetPrefix)\n } finally {\n if (process.env.__NEXT_DEV_SERVER) {\n const enableCacheIndicator = process.env.__NEXT_CACHE_COMPONENTS\n const { getOwnerStack } =\n require('../next-devtools/userspace/app/errors/stitched-error') as typeof import('../next-devtools/userspace/app/errors/stitched-error')\n const { renderAppDevOverlay } =\n require('next/dist/compiled/next-devtools') as typeof import('next/dist/compiled/next-devtools')\n renderAppDevOverlay(\n getOwnerStack,\n isRecoverableError,\n enableCacheIndicator\n )\n }\n }\n})\n"],"names":["window","next","turbopack","self","__webpack_hash__","instrumentationHooks","require","appBootstrap","assetPrefix","hydrate","process","env","__NEXT_DEV_SERVER","enableCacheIndicator","__NEXT_CACHE_COMPONENTS","getOwnerStack","renderAppDevOverlay","isRecoverableError"],"mappings":";;;;QAAO;8BACsB;oCACM;AAEnCA,OAAOC,IAAI,CAACC,SAAS,GAAG;AACtBC,KAAaC,gBAAgB,GAAG;AAElC,8DAA8D;AAC9D,MAAMC,uBAAuBC,QAAQ;AAErCC,IAAAA,0BAAY,EAAC,CAACC;IACZ,MAAM,EAAEC,OAAO,EAAE,GAAGH,QAAQ;IAC5B,IAAI;QACFG,QAAQJ,sBAAsBG;IAChC,SAAU;QACR,IAAIE,QAAQC,GAAG,CAACC,iBAAiB,EAAE;YACjC,MAAMC,uBAAuBH,QAAQC,GAAG,CAACG,uBAAuB;YAChE,MAAM,EAAEC,aAAa,EAAE,GACrBT,QAAQ;YACV,MAAM,EAAEU,mBAAmB,EAAE,GAC3BV,QAAQ;YACVU,oBACED,eACAE,sCAAkB,EAClBJ;QAEJ;IACF;AACF","ignoreList":[0]} | ||
| {"version":3,"sources":["../../src/client/app-next-turbopack.ts"],"sourcesContent":["import './register-deployment-id-global'\nimport { appBootstrap } from './app-bootstrap'\nimport { isRecoverableError } from './react-client-callbacks/on-recoverable-error'\n\nwindow.next.turbopack = true\n;(self as any).__webpack_hash__ = ''\n\n// eslint-disable-next-line @next/internal/typechecked-require\nconst instrumentationModules = require('../lib/require-instrumentation-client')\n\nappBootstrap((assetPrefix) => {\n const { hydrate } = require('./app-index') as typeof import('./app-index')\n try {\n hydrate(instrumentationModules, assetPrefix)\n } finally {\n if (process.env.__NEXT_DEV_SERVER) {\n const enableCacheIndicator = process.env.__NEXT_CACHE_COMPONENTS\n const { getOwnerStack } =\n require('../next-devtools/userspace/app/errors/stitched-error') as typeof import('../next-devtools/userspace/app/errors/stitched-error')\n const { renderAppDevOverlay } =\n require('next/dist/compiled/next-devtools') as typeof import('next/dist/compiled/next-devtools')\n renderAppDevOverlay(\n getOwnerStack,\n isRecoverableError,\n enableCacheIndicator\n )\n }\n }\n})\n"],"names":["window","next","turbopack","self","__webpack_hash__","instrumentationModules","require","appBootstrap","assetPrefix","hydrate","process","env","__NEXT_DEV_SERVER","enableCacheIndicator","__NEXT_CACHE_COMPONENTS","getOwnerStack","renderAppDevOverlay","isRecoverableError"],"mappings":";;;;QAAO;8BACsB;oCACM;AAEnCA,OAAOC,IAAI,CAACC,SAAS,GAAG;AACtBC,KAAaC,gBAAgB,GAAG;AAElC,8DAA8D;AAC9D,MAAMC,yBAAyBC,QAAQ;AAEvCC,IAAAA,0BAAY,EAAC,CAACC;IACZ,MAAM,EAAEC,OAAO,EAAE,GAAGH,QAAQ;IAC5B,IAAI;QACFG,QAAQJ,wBAAwBG;IAClC,SAAU;QACR,IAAIE,QAAQC,GAAG,CAACC,iBAAiB,EAAE;YACjC,MAAMC,uBAAuBH,QAAQC,GAAG,CAACG,uBAAuB;YAChE,MAAM,EAAEC,aAAa,EAAE,GACrBT,QAAQ;YACV,MAAM,EAAEU,mBAAmB,EAAE,GAC3BV,QAAQ;YACVU,oBACED,eACAE,sCAAkB,EAClBJ;QAEJ;IACF;AACF","ignoreList":[0]} |
@@ -9,3 +9,3 @@ // This import must go first because it needs to patch webpack chunk loading | ||
| const _appbootstrap = require("./app-bootstrap"); | ||
| const instrumentationHooks = // eslint-disable-next-line @next/internal/typechecked-require -- not a module | ||
| const instrumentationModules = // eslint-disable-next-line @next/internal/typechecked-require -- not a module | ||
| require('../lib/require-instrumentation-client'); | ||
@@ -19,3 +19,3 @@ (0, _appbootstrap.appBootstrap)((assetPrefix)=>{ | ||
| require('next/dist/client/components/layout-router'); | ||
| hydrate(instrumentationHooks, assetPrefix); | ||
| hydrate(instrumentationModules, assetPrefix); | ||
| }); | ||
@@ -22,0 +22,0 @@ |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/client/app-next.ts"],"sourcesContent":["// This import must go first because it needs to patch webpack chunk loading\n// before React patches chunk loading.\nimport './app-webpack'\nimport { appBootstrap } from './app-bootstrap'\n\nconst instrumentationHooks =\n // eslint-disable-next-line @next/internal/typechecked-require -- not a module\n require('../lib/require-instrumentation-client')\n\nappBootstrap((assetPrefix) => {\n const { hydrate } = require('./app-index') as typeof import('./app-index')\n // Include app-router and layout-router in the main chunk\n // eslint-disable-next-line @next/internal/typechecked-require -- Why not relative imports?\n require('next/dist/client/components/app-router')\n // eslint-disable-next-line @next/internal/typechecked-require -- Why not relative imports?\n require('next/dist/client/components/layout-router')\n hydrate(instrumentationHooks, assetPrefix)\n})\n"],"names":["instrumentationHooks","require","appBootstrap","assetPrefix","hydrate"],"mappings":"AAAA,4EAA4E;AAC5E,sCAAsC;;;;;QAC/B;8BACsB;AAE7B,MAAMA,uBACJ,8EAA8E;AAC9EC,QAAQ;AAEVC,IAAAA,0BAAY,EAAC,CAACC;IACZ,MAAM,EAAEC,OAAO,EAAE,GAAGH,QAAQ;IAC5B,yDAAyD;IACzD,2FAA2F;IAC3FA,QAAQ;IACR,2FAA2F;IAC3FA,QAAQ;IACRG,QAAQJ,sBAAsBG;AAChC","ignoreList":[0]} | ||
| {"version":3,"sources":["../../src/client/app-next.ts"],"sourcesContent":["// This import must go first because it needs to patch webpack chunk loading\n// before React patches chunk loading.\nimport './app-webpack'\nimport { appBootstrap } from './app-bootstrap'\n\nconst instrumentationModules =\n // eslint-disable-next-line @next/internal/typechecked-require -- not a module\n require('../lib/require-instrumentation-client')\n\nappBootstrap((assetPrefix) => {\n const { hydrate } = require('./app-index') as typeof import('./app-index')\n // Include app-router and layout-router in the main chunk\n // eslint-disable-next-line @next/internal/typechecked-require -- Why not relative imports?\n require('next/dist/client/components/app-router')\n // eslint-disable-next-line @next/internal/typechecked-require -- Why not relative imports?\n require('next/dist/client/components/layout-router')\n hydrate(instrumentationModules, assetPrefix)\n})\n"],"names":["instrumentationModules","require","appBootstrap","assetPrefix","hydrate"],"mappings":"AAAA,4EAA4E;AAC5E,sCAAsC;;;;;QAC/B;8BACsB;AAE7B,MAAMA,yBACJ,8EAA8E;AAC9EC,QAAQ;AAEVC,IAAAA,0BAAY,EAAC,CAACC;IACZ,MAAM,EAAEC,OAAO,EAAE,GAAGH,QAAQ;IAC5B,yDAAyD;IACzD,2FAA2F;IAC3FA,QAAQ;IACR,2FAA2F;IAC3FA,QAAQ;IACRG,QAAQJ,wBAAwBG;AAClC","ignoreList":[0]} |
| import { type AppRouterState, type ReducerActions, type ReducerState, type NavigateAction, ScrollBehavior, type AppHistoryState } from './router-reducer/router-reducer-types'; | ||
| import type { AppRouterInstance } from '../../shared/lib/app-router-context.shared-runtime'; | ||
| import { type LinkInstance } from './links'; | ||
| import type { ClientInstrumentationHooks } from '../app-index'; | ||
| import type { RouterTransitionPrefetchIntent } from '../router-transition-types'; | ||
| import type { GlobalErrorComponent } from './builtin/global-error'; | ||
@@ -11,3 +11,2 @@ export type DispatchStatePromise = React.Dispatch<ReducerState>; | ||
| action: (state: AppRouterState, action: ReducerActions) => ReducerState; | ||
| onRouterTransitionStart: ((url: string, type: 'push' | 'replace' | 'traverse') => void) | null; | ||
| pending: ActionQueueNode | null; | ||
@@ -28,5 +27,5 @@ needsRefresh?: boolean; | ||
| }; | ||
| export declare function createMutableActionQueue(initialState: AppRouterState, instrumentationHooks: ClientInstrumentationHooks | null): AppRouterActionQueue; | ||
| export declare function createMutableActionQueue(initialState: AppRouterState): AppRouterActionQueue; | ||
| export declare function getCurrentAppRouterState(): AppRouterState | null; | ||
| export declare function dispatchNavigateAction(href: string, navigateType: NavigateAction['navigateType'], scrollBehavior: ScrollBehavior, linkInstanceRef: LinkInstance | null, transitionTypes: string[] | undefined): void; | ||
| export declare function dispatchNavigateAction(href: string, navigateType: NavigateAction['navigateType'], scrollBehavior: ScrollBehavior, linkInstanceRef: LinkInstance | null, transitionTypes: string[] | undefined, prefetchIntent: RouterTransitionPrefetchIntent | null): void; | ||
| export declare function dispatchTraverseAction(href: string, historyState: AppHistoryState | undefined): void; | ||
@@ -33,0 +32,0 @@ /** |
@@ -49,2 +49,3 @@ "use strict"; | ||
| const _javascripturl = require("../lib/javascript-url"); | ||
| const _routertransition = require("./router-transition"); | ||
| function runRemainingActions(actionQueue, setState) { | ||
@@ -166,3 +167,3 @@ if (actionQueue.pending !== null) { | ||
| let globalActionQueue = null; | ||
| function createMutableActionQueue(initialState, instrumentationHooks) { | ||
| function createMutableActionQueue(initialState) { | ||
| const actionQueue = { | ||
@@ -176,4 +177,3 @@ state: initialState, | ||
| pending: null, | ||
| last: null, | ||
| onRouterTransitionStart: instrumentationHooks !== null && typeof instrumentationHooks.onRouterTransitionStart === 'function' ? instrumentationHooks.onRouterTransitionStart : null | ||
| last: null | ||
| }; | ||
@@ -208,9 +208,3 @@ if (typeof window !== 'undefined') { | ||
| } | ||
| function getProfilingHookForOnNavigationStart() { | ||
| if (globalActionQueue !== null) { | ||
| return globalActionQueue.onRouterTransitionStart; | ||
| } | ||
| return null; | ||
| } | ||
| function dispatchNavigateAction(href, navigateType, scrollBehavior, linkInstanceRef, transitionTypes) { | ||
| function dispatchNavigateAction(href, navigateType, scrollBehavior, linkInstanceRef, transitionTypes, prefetchIntent) { | ||
| // TODO: This stuff could just go into the reducer. Leaving as-is for now | ||
@@ -228,6 +222,3 @@ // since we're about to rewrite all the router reducer stuff anyway. | ||
| (0, _links.setLinkForCurrentNavigation)(linkInstanceRef); | ||
| const onRouterTransitionStart = getProfilingHookForOnNavigationStart(); | ||
| if (onRouterTransitionStart !== null) { | ||
| onRouterTransitionStart(href, navigateType); | ||
| } | ||
| (0, _routertransition.startRouterTransition)(href, navigateType, getAppRouterActionQueue().state.tree, prefetchIntent); | ||
| (0, _useactionqueue.dispatchAppRouterAction)({ | ||
@@ -243,6 +234,3 @@ type: _routerreducertypes.ACTION_NAVIGATE, | ||
| function dispatchTraverseAction(href, historyState) { | ||
| const onRouterTransitionStart = getProfilingHookForOnNavigationStart(); | ||
| if (onRouterTransitionStart !== null) { | ||
| onRouterTransitionStart(href, 'traverse'); | ||
| } | ||
| (0, _routertransition.startRouterTransition)(href, 'traverse', getAppRouterActionQueue().state.tree, null); | ||
| (0, _useactionqueue.dispatchAppRouterAction)({ | ||
@@ -346,3 +334,3 @@ type: _routerreducertypes.ACTION_RESTORE, | ||
| (0, _react.startTransition)(()=>{ | ||
| dispatchNavigateAction(href, 'replace', options?.scroll === false ? _routerreducertypes.ScrollBehavior.NoScroll : _routerreducertypes.ScrollBehavior.Default, null, options?.transitionTypes); | ||
| dispatchNavigateAction(href, 'replace', options?.scroll === false ? _routerreducertypes.ScrollBehavior.NoScroll : _routerreducertypes.ScrollBehavior.Default, null, options?.transitionTypes, null); | ||
| }); | ||
@@ -359,3 +347,3 @@ }, | ||
| (0, _react.startTransition)(()=>{ | ||
| dispatchNavigateAction(href, 'push', options?.scroll === false ? _routerreducertypes.ScrollBehavior.NoScroll : _routerreducertypes.ScrollBehavior.Default, null, options?.transitionTypes); | ||
| dispatchNavigateAction(href, 'push', options?.scroll === false ? _routerreducertypes.ScrollBehavior.NoScroll : _routerreducertypes.ScrollBehavior.Default, null, options?.transitionTypes, null); | ||
| }); | ||
@@ -362,0 +350,0 @@ }, |
@@ -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 { ClientInstrumentationHooks } from '../app-index'\nimport type { GlobalErrorComponent } from './builtin/global-error'\nimport { isJavaScriptURLString } from '../lib/javascript-url'\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 onRouterTransitionStart:\n | ((url: string, type: 'push' | 'replace' | 'traverse') => void)\n | null\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 setState: DispatchStatePromise\n) {\n if (actionQueue.pending !== null) {\n actionQueue.pending = actionQueue.pending.next\n if (actionQueue.pending !== null) {\n runAction({\n actionQueue,\n action: actionQueue.pending,\n setState,\n })\n }\n } else {\n // Check for refresh when pending is already null\n // This handles the case where a discarded server action completes\n // after the navigation has already finished and the queue is empty\n if (actionQueue.needsRefresh) {\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 // Still need to run remaining actions even for discarded actions\n // to potentially trigger the refresh\n runRemainingActions(actionQueue, setState)\n return\n }\n\n actionQueue.state = nextState\n\n runRemainingActions(actionQueue, 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, 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 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 instrumentationHooks: ClientInstrumentationHooks | null\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 onRouterTransitionStart:\n instrumentationHooks !== null &&\n typeof instrumentationHooks.onRouterTransitionStart === 'function'\n ? // This profiling hook will be called at the start of every navigation.\n instrumentationHooks.onRouterTransitionStart\n : 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\nfunction getProfilingHookForOnNavigationStart() {\n if (globalActionQueue !== null) {\n return globalActionQueue.onRouterTransitionStart\n }\n return null\n}\n\nexport function dispatchNavigateAction(\n href: string,\n navigateType: NavigateAction['navigateType'],\n scrollBehavior: ScrollBehavior,\n linkInstanceRef: LinkInstance | null,\n transitionTypes: string[] | undefined\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\n const onRouterTransitionStart = getProfilingHookForOnNavigationStart()\n if (onRouterTransitionStart !== null) {\n onRouterTransitionStart(href, navigateType)\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 const onRouterTransitionStart = getProfilingHookForOnNavigationStart()\n if (onRouterTransitionStart !== null) {\n onRouterTransitionStart(href, 'traverse')\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/**\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 )\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 )\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 startTransition(() => {\n dispatchAppRouterAction({\n type: ACTION_HMR_REFRESH,\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","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","instrumentationHooks","result","reducer","onRouterTransitionStart","window","Error","getAppRouterActionQueue","getProfilingHookForOnNavigationStart","href","navigateType","scrollBehavior","linkInstanceRef","transitionTypes","addTransitionType","url","URL","addBasePath","location","process","env","__NEXT_APP_NAV_FAIL_HANDLING","__pendingUrl","setLinkForCurrentNavigation","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","tree","nextUrl","dispatchGestureState","back","history","forward","prefetch","prefetchKind","kind","PrefetchKind","AUTO","fetchStrategy","FetchStrategy","PPR","FULL","Full","prefetchWithSegmentCache","onInvalidate","replace","push","refresh","hmrRefresh","NODE_ENV","resetKnownRoutes","ACTION_HMR_REFRESH","bfcacheId","experimental_gesturePush","router"],"mappings":";;;;;;;;;;;;;;;;;;IA2NgBA,wBAAwB;eAAxBA;;IA0DAC,sBAAsB;eAAtBA;;IAsCAC,sBAAsB;eAAtBA;;IA1DAC,wBAAwB;eAAxBA;;IAsIHC,uBAAuB;eAAvBA;;;oCA1XN;+BACiB;uBAC2B;4BACxB;uBAIpB;0BAC8C;4BAC5B;gCAIlB;kCAC0B;gCACD;6BACJ;gCACE;uBAMiC;+BAGzB;AA+BtC,SAASC,oBACPC,WAAiC,EACjCC,QAA8B;IAE9B,IAAID,YAAYE,OAAO,KAAK,MAAM;QAChCF,YAAYE,OAAO,GAAGF,YAAYE,OAAO,CAACC,IAAI;QAC9C,IAAIH,YAAYE,OAAO,KAAK,MAAM;YAChCE,UAAU;gBACRJ;gBACAK,QAAQL,YAAYE,OAAO;gBAC3BD;YACF;QACF;IACF,OAAO;QACL,iDAAiD;QACjD,kEAAkE;QAClE,mEAAmE;QACnE,IAAID,YAAYM,YAAY,EAAE;YAC5BN,YAAYM,YAAY,GAAG;YAC3BN,YAAYO,QAAQ,CAAC;gBAAEC,MAAMC,kCAAc;YAAC,GAAGR;QACjD;IACF;AACF;AAEA,eAAeG,UAAU,EACvBJ,WAAW,EACXK,MAAM,EACNJ,QAAQ,EAKT;IACC,MAAMS,YAAYV,YAAYW,KAAK;IAEnCX,YAAYE,OAAO,GAAGG;IAEtB,MAAMO,UAAUP,OAAOO,OAAO;IAC9B,MAAMC,eAAeb,YAAYK,MAAM,CAACK,WAAWE;IAEnD,SAASE,aAAaC,SAAyB;QAC7C,kEAAkE;QAClE,IAAIV,OAAOW,SAAS,EAAE;YACpB,wDAAwD;YACxD,IACEX,OAAOO,OAAO,CAACJ,IAAI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AA;YAEN;QACF,OAAO;YACL,qEAAqE;YACrE,yCAAyC;YACzCgE,IAAAA,kCAAgB;YAChB3E,IAAAA,sBAAe,EAAC;gBACd6B,IAAAA,uCAAuB,EAAC;oBACtBlD,MAAMiG,sCAAkB;gBAC1B;YACF;QACF;IACF;IACA,6EAA6E;IAC7E,oBAAoB;IACpBC,WAAW;AACb;AAEA,+EAA+E;AAC/E,IAAIrD,QAAQC,GAAG,CAACY,yBAAyB,EAAE;;IACvCpE,wBAAgC6G,wBAAwB,GAAG3C;AAC/D;AAEA,gEAAgE;AAChE,IAAI,OAAOzB,WAAW,eAAeA,OAAOpC,IAAI,EAAE;IAChDoC,OAAOpC,IAAI,CAACyG,MAAM,GAAG9G;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 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 setState: DispatchStatePromise\n) {\n if (actionQueue.pending !== null) {\n actionQueue.pending = actionQueue.pending.next\n if (actionQueue.pending !== null) {\n runAction({\n actionQueue,\n action: actionQueue.pending,\n setState,\n })\n }\n } else {\n // Check for refresh when pending is already null\n // This handles the case where a discarded server action completes\n // after the navigation has already finished and the queue is empty\n if (actionQueue.needsRefresh) {\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 // Still need to run remaining actions even for discarded actions\n // to potentially trigger the refresh\n runRemainingActions(actionQueue, setState)\n return\n }\n\n actionQueue.state = nextState\n\n runRemainingActions(actionQueue, 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, 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 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/**\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 startTransition(() => {\n dispatchAppRouterAction({\n type: ACTION_HMR_REFRESH,\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","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","back","history","forward","prefetch","prefetchKind","kind","PrefetchKind","AUTO","fetchStrategy","FetchStrategy","PPR","FULL","Full","prefetchWithSegmentCache","onInvalidate","replace","push","refresh","hmrRefresh","NODE_ENV","resetKnownRoutes","ACTION_HMR_REFRESH","bfcacheId","experimental_gesturePush","router"],"mappings":";;;;;;;;;;;;;;;;;;IAwNgBA,wBAAwB;eAAxBA;;IA4CAC,sBAAsB;eAAtBA;;IAwCAC,sBAAsB;eAAtBA;;IArDAC,wBAAwB;eAAxBA;;IAmIHC,uBAAuB;eAAvBA;;;oCA7WN;+BACiB;uBAC2B;4BACxB;uBAIpB;0BAC8C;4BAC5B;gCAIlB;kCAC0B;gCACD;6BACJ;gCACE;uBAMiC;+BAGzB;kCACA;AA2BtC,SAASC,oBACPC,WAAiC,EACjCC,QAA8B;IAE9B,IAAID,YAAYE,OAAO,KAAK,MAAM;QAChCF,YAAYE,OAAO,GAAGF,YAAYE,OAAO,CAACC,IAAI;QAC9C,IAAIH,YAAYE,OAAO,KAAK,MAAM;YAChCE,UAAU;gBACRJ;gBACAK,QAAQL,YAAYE,OAAO;gBAC3BD;YACF;QACF;IACF,OAAO;QACL,iDAAiD;QACjD,kEAAkE;QAClE,mEAAmE;QACnE,IAAID,YAAYM,YAAY,EAAE;YAC5BN,YAAYM,YAAY,GAAG;YAC3BN,YAAYO,QAAQ,CAAC;gBAAEC,MAAMC,kCAAc;YAAC,GAAGR;QACjD;IACF;AACF;AAEA,eAAeG,UAAU,EACvBJ,WAAW,EACXK,MAAM,EACNJ,QAAQ,EAKT;IACC,MAAMS,YAAYV,YAAYW,KAAK;IAEnCX,YAAYE,OAAO,GAAGG;IAEtB,MAAMO,UAAUP,OAAOO,OAAO;IAC9B,MAAMC,eAAeb,YAAYK,MAAM,CAACK,WAAWE;IAEnD,SAASE,aAAaC,SAAyB;QAC7C,kEAAkE;QAClE,IAAIV,OAAOW,SAAS,EAAE;YACpB,wDAAwD;YACxD,IACEX,OAAOO,OAAO,CAACJ,IAAI,KAAKS,wC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;IACF;IACA,6EAA6E;IAC7E,oBAAoB;IACpBC,WAAW;AACb;AAEA,+EAA+E;AAC/E,IAAItD,QAAQC,GAAG,CAACc,yBAAyB,EAAE;;IACvCpE,wBAAgC4G,wBAAwB,GAAG1C;AAC/D;AAEA,gEAAgE;AAChE,IAAI,OAAO3B,WAAW,eAAeA,OAAOlC,IAAI,EAAE;IAChDkC,OAAOlC,IAAI,CAACwG,MAAM,GAAG7G;AACvB","ignoreList":[0]} |
@@ -1,3 +0,4 @@ | ||
| import type { FlightRouterState } from '../../../shared/lib/app-router-types'; | ||
| import type { FlightRouterState, Segment } from '../../../shared/lib/app-router-types'; | ||
| import type { Params } from '../../../server/request/params'; | ||
| export declare const segmentToSourcePagePathname: (segment: Segment) => string; | ||
| export declare function extractPathFromFlightRouterState(flightRouterState: FlightRouterState): string | undefined; | ||
@@ -4,0 +5,0 @@ export declare function extractSourcePageFromFlightRouterState(flightRouterState: FlightRouterState): string | undefined; |
@@ -9,3 +9,4 @@ "use strict"; | ||
| extractSourcePageFromFlightRouterState: null, | ||
| getSelectedParams: null | ||
| getSelectedParams: null, | ||
| segmentToSourcePagePathname: null | ||
| }); | ||
@@ -30,2 +31,5 @@ function _export(target, all) { | ||
| return getSelectedParams; | ||
| }, | ||
| segmentToSourcePagePathname: function() { | ||
| return segmentToSourcePagePathname; | ||
| } | ||
@@ -32,0 +36,0 @@ }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/client/components/router-reducer/compute-changed-path.ts"],"sourcesContent":["import type {\n FlightRouterState,\n Segment,\n} from '../../../shared/lib/app-router-types'\nimport { INTERCEPTION_ROUTE_MARKERS } from '../../../shared/lib/router/utils/interception-routes'\nimport type { Params } from '../../../server/request/params'\nimport {\n isGroupSegment,\n DEFAULT_SEGMENT_KEY,\n PAGE_SEGMENT_KEY,\n} from '../../../shared/lib/segment'\nimport { matchSegment } from '../match-segments'\n\nconst removeLeadingSlash = (segment: string): string => {\n return segment[0] === '/' ? segment.slice(1) : segment\n}\n\nconst segmentToPathname = (segment: Segment): string => {\n if (typeof segment === 'string') {\n // 'children' is not a valid path -- it's technically a parallel route that corresponds with the current segment's page\n // if we don't skip it, then the computed pathname might be something like `/children` which doesn't make sense.\n if (segment === 'children') return ''\n\n return segment\n }\n\n return segment[1]\n}\n\nconst segmentToSourcePagePathname = (segment: Segment): string => {\n if (typeof segment === 'string') {\n if (segment === 'children') return ''\n if (segment.startsWith(PAGE_SEGMENT_KEY)) return 'page'\n return segment\n }\n\n const [paramName, , dynamicParamType] = segment\n\n switch (dynamicParamType) {\n case 'c':\n return `[...${paramName}]`\n case 'ci(..)(..)':\n return `(..)(..)[...${paramName}]`\n case 'ci(.)':\n return `(.)[...${paramName}]`\n case 'ci(..)':\n return `(..)[...${paramName}]`\n case 'ci(...)':\n return `(...)[...${paramName}]`\n case 'oc':\n return `[[...${paramName}]]`\n case 'd':\n return `[${paramName}]`\n case 'di(..)(..)':\n return `(..)(..)[${paramName}]`\n case 'di(.)':\n return `(.)[${paramName}]`\n case 'di(..)':\n return `(..)[${paramName}]`\n case 'di(...)':\n return `(...)[${paramName}]`\n default:\n dynamicParamType satisfies never\n return `[${paramName}]`\n }\n}\n\nfunction normalizeSegments(segments: string[]): string {\n return (\n segments.reduce((acc, segment) => {\n segment = removeLeadingSlash(segment)\n if (segment === '' || isGroupSegment(segment)) {\n return acc\n }\n\n return `${acc}/${segment}`\n }, '') || '/'\n )\n}\n\nexport function extractPathFromFlightRouterState(\n flightRouterState: FlightRouterState\n): string | undefined {\n const segment = Array.isArray(flightRouterState[0])\n ? flightRouterState[0][1]\n : flightRouterState[0]\n\n if (\n segment === DEFAULT_SEGMENT_KEY ||\n INTERCEPTION_ROUTE_MARKERS.some((m) => segment.startsWith(m))\n )\n return undefined\n\n if (segment.startsWith(PAGE_SEGMENT_KEY)) return ''\n\n const segments = [segmentToPathname(segment)]\n const parallelRoutes = flightRouterState[1] ?? {}\n\n const childrenPath = parallelRoutes.children\n ? extractPathFromFlightRouterState(parallelRoutes.children)\n : undefined\n\n if (childrenPath !== undefined) {\n segments.push(childrenPath)\n } else {\n for (const [key, value] of Object.entries(parallelRoutes)) {\n if (key === 'children') continue\n\n const childPath = extractPathFromFlightRouterState(value)\n\n if (childPath !== undefined) {\n segments.push(childPath)\n }\n }\n }\n\n return normalizeSegments(segments)\n}\n\nfunction extractSourcePageSegmentsFromFlightRouterState(\n flightRouterState: FlightRouterState\n): string[] | undefined {\n const segment = segmentToSourcePagePathname(flightRouterState[0])\n\n if (segment === DEFAULT_SEGMENT_KEY) {\n return undefined\n }\n\n if (segment === 'page') {\n return [segment]\n }\n\n const parallelRoutes = flightRouterState[1] ?? {}\n\n const childrenPath = parallelRoutes.children\n ? extractSourcePageSegmentsFromFlightRouterState(parallelRoutes.children)\n : undefined\n\n if (childrenPath !== undefined) {\n return segment === ''\n ? childrenPath\n : [removeLeadingSlash(segment), ...childrenPath]\n }\n\n for (const [key, value] of Object.entries(parallelRoutes)) {\n if (key === 'children') continue\n\n const childPath = extractSourcePageSegmentsFromFlightRouterState(value)\n\n if (childPath !== undefined) {\n return segment === ''\n ? childPath\n : [removeLeadingSlash(segment), ...childPath]\n }\n }\n\n return undefined\n}\n\nexport function extractSourcePageFromFlightRouterState(\n flightRouterState: FlightRouterState\n): string | undefined {\n const sourcePageSegments =\n extractSourcePageSegmentsFromFlightRouterState(flightRouterState)\n\n return sourcePageSegments ? `/${sourcePageSegments.join('/')}` : undefined\n}\n\nfunction computeChangedPathImpl(\n treeA: FlightRouterState,\n treeB: FlightRouterState\n): string | null {\n const [segmentA, parallelRoutesA] = treeA\n const [segmentB, parallelRoutesB] = treeB\n\n const normalizedSegmentA = segmentToPathname(segmentA)\n const normalizedSegmentB = segmentToPathname(segmentB)\n\n if (\n INTERCEPTION_ROUTE_MARKERS.some(\n (m) =>\n normalizedSegmentA.startsWith(m) || normalizedSegmentB.startsWith(m)\n )\n ) {\n return ''\n }\n\n if (!matchSegment(segmentA, segmentB)) {\n // once we find where the tree changed, we compute the rest of the path by traversing the tree\n return extractPathFromFlightRouterState(treeB) ?? ''\n }\n\n for (const parallelRouterKey in parallelRoutesA) {\n if (parallelRoutesB[parallelRouterKey]) {\n const changedPath = computeChangedPathImpl(\n parallelRoutesA[parallelRouterKey],\n parallelRoutesB[parallelRouterKey]\n )\n if (changedPath !== null) {\n return `${segmentToPathname(segmentB)}/${changedPath}`\n }\n }\n }\n\n return null\n}\n\nexport function computeChangedPath(\n treeA: FlightRouterState,\n treeB: FlightRouterState\n): string | null {\n const changedPath = computeChangedPathImpl(treeA, treeB)\n\n if (changedPath == null || changedPath === '/') {\n return changedPath\n }\n\n // lightweight normalization to remove route groups\n return normalizeSegments(changedPath.split('/'))\n}\n\n/**\n * Recursively extracts dynamic parameters from FlightRouterState.\n */\nexport function getSelectedParams(\n currentTree: FlightRouterState,\n params: Params = {}\n): Params {\n const parallelRoutes = currentTree[1]\n\n for (const parallelRoute of Object.values(parallelRoutes)) {\n const segment = parallelRoute[0]\n const isDynamicParameter = Array.isArray(segment)\n const segmentValue = isDynamicParameter ? segment[1] : segment\n if (!segmentValue || segmentValue.startsWith(PAGE_SEGMENT_KEY)) continue\n\n // Ensure catchAll and optional catchall are turned into an array\n const isCatchAll =\n isDynamicParameter && (segment[2] === 'c' || segment[2] === 'oc')\n\n if (isCatchAll) {\n params[segment[0]] = segment[1].split('/')\n } else if (isDynamicParameter) {\n params[segment[0]] = segment[1]\n }\n\n params = getSelectedParams(parallelRoute, params)\n }\n\n return params\n}\n"],"names":["computeChangedPath","extractPathFromFlightRouterState","extractSourcePageFromFlightRouterState","getSelectedParams","removeLeadingSlash","segment","slice","segmentToPathname","segmentToSourcePagePathname","startsWith","PAGE_SEGMENT_KEY","paramName","dynamicParamType","normalizeSegments","segments","reduce","acc","isGroupSegment","flightRouterState","Array","isArray","DEFAULT_SEGMENT_KEY","INTERCEPTION_ROUTE_MARKERS","some","m","undefined","parallelRoutes","childrenPath","children","push","key","value","Object","entries","childPath","extractSourcePageSegmentsFromFlightRouterState","sourcePageSegments","join","computeChangedPathImpl","treeA","treeB","segmentA","parallelRoutesA","segmentB","parallelRoutesB","normalizedSegmentA","normalizedSegmentB","matchSegment","parallelRouterKey","changedPath","split","currentTree","params","parallelRoute","values","isDynamicParameter","segmentValue","isCatchAll"],"mappings":";;;;;;;;;;;;;;;;;IA+MgBA,kBAAkB;eAAlBA;;IA/HAC,gCAAgC;eAAhCA;;IA+EAC,sCAAsC;eAAtCA;;IAiEAC,iBAAiB;eAAjBA;;;oCA5N2B;yBAMpC;+BACsB;AAE7B,MAAMC,qBAAqB,CAACC;IAC1B,OAAOA,OAAO,CAAC,EAAE,KAAK,MAAMA,QAAQC,KAAK,CAAC,KAAKD;AACjD;AAEA,MAAME,oBAAoB,CAACF;IACzB,IAAI,OAAOA,YAAY,UAAU;QAC/B,uHAAuH;QACvH,gHAAgH;QAChH,IAAIA,YAAY,YAAY,OAAO;QAEnC,OAAOA;IACT;IAEA,OAAOA,OAAO,CAAC,EAAE;AACnB;AAEA,MAAMG,8BAA8B,CAACH;IACnC,IAAI,OAAOA,YAAY,UAAU;QAC/B,IAAIA,YAAY,YAAY,OAAO;QACnC,IAAIA,QAAQI,UAAU,CAACC,yBAAgB,GAAG,OAAO;QACjD,OAAOL;IACT;IAEA,MAAM,CAACM,aAAaC,iBAAiB,GAAGP;IAExC,OAAQO;QACN,KAAK;YACH,OAAO,CAAC,IAAI,EAAED,UAAU,CAAC,CAAC;QAC5B,KAAK;YACH,OAAO,CAAC,YAAY,EAAEA,UAAU,CAAC,CAAC;QACpC,KAAK;YACH,OAAO,CAAC,OAAO,EAAEA,UAAU,CAAC,CAAC;QAC/B,KAAK;YACH,OAAO,CAAC,QAAQ,EAAEA,UAAU,CAAC,CAAC;QAChC,KAAK;YACH,OAAO,CAAC,SAAS,EAAEA,UAAU,CAAC,CAAC;QACjC,KAAK;YACH,OAAO,CAAC,KAAK,EAAEA,UAAU,EAAE,CAAC;QAC9B,KAAK;YACH,OAA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A,OAAO,CAAC,EAAE,CAAC6C,KAAK,CAAC;QACxC,OAAO,IAAIK,oBAAoB;YAC7BH,MAAM,CAAC/C,OAAO,CAAC,EAAE,CAAC,GAAGA,OAAO,CAAC,EAAE;QACjC;QAEA+C,SAASjD,kBAAkBkD,eAAeD;IAC5C;IAEA,OAAOA;AACT","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/client/components/router-reducer/compute-changed-path.ts"],"sourcesContent":["import type {\n FlightRouterState,\n Segment,\n} from '../../../shared/lib/app-router-types'\nimport { INTERCEPTION_ROUTE_MARKERS } from '../../../shared/lib/router/utils/interception-routes'\nimport type { Params } from '../../../server/request/params'\nimport {\n isGroupSegment,\n DEFAULT_SEGMENT_KEY,\n PAGE_SEGMENT_KEY,\n} from '../../../shared/lib/segment'\nimport { matchSegment } from '../match-segments'\n\nconst removeLeadingSlash = (segment: string): string => {\n return segment[0] === '/' ? segment.slice(1) : segment\n}\n\nconst segmentToPathname = (segment: Segment): string => {\n if (typeof segment === 'string') {\n // 'children' is not a valid path -- it's technically a parallel route that corresponds with the current segment's page\n // if we don't skip it, then the computed pathname might be something like `/children` which doesn't make sense.\n if (segment === 'children') return ''\n\n return segment\n }\n\n return segment[1]\n}\n\nexport const segmentToSourcePagePathname = (segment: Segment): string => {\n if (typeof segment === 'string') {\n if (segment === 'children') return ''\n if (segment.startsWith(PAGE_SEGMENT_KEY)) return 'page'\n return segment\n }\n\n const [paramName, , dynamicParamType] = segment\n\n switch (dynamicParamType) {\n case 'c':\n return `[...${paramName}]`\n case 'ci(..)(..)':\n return `(..)(..)[...${paramName}]`\n case 'ci(.)':\n return `(.)[...${paramName}]`\n case 'ci(..)':\n return `(..)[...${paramName}]`\n case 'ci(...)':\n return `(...)[...${paramName}]`\n case 'oc':\n return `[[...${paramName}]]`\n case 'd':\n return `[${paramName}]`\n case 'di(..)(..)':\n return `(..)(..)[${paramName}]`\n case 'di(.)':\n return `(.)[${paramName}]`\n case 'di(..)':\n return `(..)[${paramName}]`\n case 'di(...)':\n return `(...)[${paramName}]`\n default:\n dynamicParamType satisfies never\n return `[${paramName}]`\n }\n}\n\nfunction normalizeSegments(segments: string[]): string {\n return (\n segments.reduce((acc, segment) => {\n segment = removeLeadingSlash(segment)\n if (segment === '' || isGroupSegment(segment)) {\n return acc\n }\n\n return `${acc}/${segment}`\n }, '') || '/'\n )\n}\n\nexport function extractPathFromFlightRouterState(\n flightRouterState: FlightRouterState\n): string | undefined {\n const segment = Array.isArray(flightRouterState[0])\n ? flightRouterState[0][1]\n : flightRouterState[0]\n\n if (\n segment === DEFAULT_SEGMENT_KEY ||\n INTERCEPTION_ROUTE_MARKERS.some((m) => segment.startsWith(m))\n )\n return undefined\n\n if (segment.startsWith(PAGE_SEGMENT_KEY)) return ''\n\n const segments = [segmentToPathname(segment)]\n const parallelRoutes = flightRouterState[1] ?? {}\n\n const childrenPath = parallelRoutes.children\n ? extractPathFromFlightRouterState(parallelRoutes.children)\n : undefined\n\n if (childrenPath !== undefined) {\n segments.push(childrenPath)\n } else {\n for (const [key, value] of Object.entries(parallelRoutes)) {\n if (key === 'children') continue\n\n const childPath = extractPathFromFlightRouterState(value)\n\n if (childPath !== undefined) {\n segments.push(childPath)\n }\n }\n }\n\n return normalizeSegments(segments)\n}\n\nfunction extractSourcePageSegmentsFromFlightRouterState(\n flightRouterState: FlightRouterState\n): string[] | undefined {\n const segment = segmentToSourcePagePathname(flightRouterState[0])\n\n if (segment === DEFAULT_SEGMENT_KEY) {\n return undefined\n }\n\n if (segment === 'page') {\n return [segment]\n }\n\n const parallelRoutes = flightRouterState[1] ?? {}\n\n const childrenPath = parallelRoutes.children\n ? extractSourcePageSegmentsFromFlightRouterState(parallelRoutes.children)\n : undefined\n\n if (childrenPath !== undefined) {\n return segment === ''\n ? childrenPath\n : [removeLeadingSlash(segment), ...childrenPath]\n }\n\n for (const [key, value] of Object.entries(parallelRoutes)) {\n if (key === 'children') continue\n\n const childPath = extractSourcePageSegmentsFromFlightRouterState(value)\n\n if (childPath !== undefined) {\n return segment === ''\n ? childPath\n : [removeLeadingSlash(segment), ...childPath]\n }\n }\n\n return undefined\n}\n\nexport function extractSourcePageFromFlightRouterState(\n flightRouterState: FlightRouterState\n): string | undefined {\n const sourcePageSegments =\n extractSourcePageSegmentsFromFlightRouterState(flightRouterState)\n\n return sourcePageSegments ? `/${sourcePageSegments.join('/')}` : undefined\n}\n\nfunction computeChangedPathImpl(\n treeA: FlightRouterState,\n treeB: FlightRouterState\n): string | null {\n const [segmentA, parallelRoutesA] = treeA\n const [segmentB, parallelRoutesB] = treeB\n\n const normalizedSegmentA = segmentToPathname(segmentA)\n const normalizedSegmentB = segmentToPathname(segmentB)\n\n if (\n INTERCEPTION_ROUTE_MARKERS.some(\n (m) =>\n normalizedSegmentA.startsWith(m) || normalizedSegmentB.startsWith(m)\n )\n ) {\n return ''\n }\n\n if (!matchSegment(segmentA, segmentB)) {\n // once we find where the tree changed, we compute the rest of the path by traversing the tree\n return extractPathFromFlightRouterState(treeB) ?? ''\n }\n\n for (const parallelRouterKey in parallelRoutesA) {\n if (parallelRoutesB[parallelRouterKey]) {\n const changedPath = computeChangedPathImpl(\n parallelRoutesA[parallelRouterKey],\n parallelRoutesB[parallelRouterKey]\n )\n if (changedPath !== null) {\n return `${segmentToPathname(segmentB)}/${changedPath}`\n }\n }\n }\n\n return null\n}\n\nexport function computeChangedPath(\n treeA: FlightRouterState,\n treeB: FlightRouterState\n): string | null {\n const changedPath = computeChangedPathImpl(treeA, treeB)\n\n if (changedPath == null || changedPath === '/') {\n return changedPath\n }\n\n // lightweight normalization to remove route groups\n return normalizeSegments(changedPath.split('/'))\n}\n\n/**\n * Recursively extracts dynamic parameters from FlightRouterState.\n */\nexport function getSelectedParams(\n currentTree: FlightRouterState,\n params: Params = {}\n): Params {\n const parallelRoutes = currentTree[1]\n\n for (const parallelRoute of Object.values(parallelRoutes)) {\n const segment = parallelRoute[0]\n const isDynamicParameter = Array.isArray(segment)\n const segmentValue = isDynamicParameter ? segment[1] : segment\n if (!segmentValue || segmentValue.startsWith(PAGE_SEGMENT_KEY)) continue\n\n // Ensure catchAll and optional catchall are turned into an array\n const isCatchAll =\n isDynamicParameter && (segment[2] === 'c' || segment[2] === 'oc')\n\n if (isCatchAll) {\n params[segment[0]] = segment[1].split('/')\n } else if (isDynamicParameter) {\n params[segment[0]] = segment[1]\n }\n\n params = getSelectedParams(parallelRoute, params)\n }\n\n return params\n}\n"],"names":["computeChangedPath","extractPathFromFlightRouterState","extractSourcePageFromFlightRouterState","getSelectedParams","segmentToSourcePagePathname","removeLeadingSlash","segment","slice","segmentToPathname","startsWith","PAGE_SEGMENT_KEY","paramName","dynamicParamType","normalizeSegments","segments","reduce","acc","isGroupSegment","flightRouterState","Array","isArray","DEFAULT_SEGMENT_KEY","INTERCEPTION_ROUTE_MARKERS","some","m","undefined","parallelRoutes","childrenPath","children","push","key","value","Object","entries","childPath","extractSourcePageSegmentsFromFlightRouterState","sourcePageSegments","join","computeChangedPathImpl","treeA","treeB","segmentA","parallelRoutesA","segmentB","parallelRoutesB","normalizedSegmentA","normalizedSegmentB","matchSegment","parallelRouterKey","changedPath","split","currentTree","params","parallelRoute","values","isDynamicParameter","segmentValue","isCatchAll"],"mappings":";;;;;;;;;;;;;;;;;;IA+MgBA,kBAAkB;eAAlBA;;IA/HAC,gCAAgC;eAAhCA;;IA+EAC,sCAAsC;eAAtCA;;IAiEAC,iBAAiB;eAAjBA;;IAnMHC,2BAA2B;eAA3BA;;;oCAzB8B;yBAMpC;+BACsB;AAE7B,MAAMC,qBAAqB,CAACC;IAC1B,OAAOA,OAAO,CAAC,EAAE,KAAK,MAAMA,QAAQC,KAAK,CAAC,KAAKD;AACjD;AAEA,MAAME,oBAAoB,CAACF;IACzB,IAAI,OAAOA,YAAY,UAAU;QAC/B,uHAAuH;QACvH,gHAAgH;QAChH,IAAIA,YAAY,YAAY,OAAO;QAEnC,OAAOA;IACT;IAEA,OAAOA,OAAO,CAAC,EAAE;AACnB;AAE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,OAAOpC,kBAAkBoC,YAAYC,KAAK,CAAC;AAC7C;AAKO,SAAS/C,kBACdgD,WAA8B,EAC9BC,SAAiB,CAAC,CAAC;IAEnB,MAAM1B,iBAAiByB,WAAW,CAAC,EAAE;IAErC,KAAK,MAAME,iBAAiBrB,OAAOsB,MAAM,CAAC5B,gBAAiB;QACzD,MAAMpB,UAAU+C,aAAa,CAAC,EAAE;QAChC,MAAME,qBAAqBpC,MAAMC,OAAO,CAACd;QACzC,MAAMkD,eAAeD,qBAAqBjD,OAAO,CAAC,EAAE,GAAGA;QACvD,IAAI,CAACkD,gBAAgBA,aAAa/C,UAAU,CAACC,yBAAgB,GAAG;QAEhE,iEAAiE;QACjE,MAAM+C,aACJF,sBAAuBjD,CAAAA,OAAO,CAAC,EAAE,KAAK,OAAOA,OAAO,CAAC,EAAE,KAAK,IAAG;QAEjE,IAAImD,YAAY;YACdL,MAAM,CAAC9C,OAAO,CAAC,EAAE,CAAC,GAAGA,OAAO,CAAC,EAAE,CAAC4C,KAAK,CAAC;QACxC,OAAO,IAAIK,oBAAoB;YAC7BH,MAAM,CAAC9C,OAAO,CAAC,EAAE,CAAC,GAAGA,OAAO,CAAC,EAAE;QACjC;QAEA8C,SAASjD,kBAAkBkD,eAAeD;IAC5C;IAEA,OAAOA;AACT","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.0-canary.58"; | ||
| const version = "16.3.0-canary.59"; | ||
| let router; | ||
@@ -66,0 +66,0 @@ const emitter = (0, _mitt.default)(); |
@@ -46,13 +46,38 @@ --- | ||
| You can export an `onRouterTransitionStart` function to receive notifications when navigation begins: | ||
| You can export `onRouterTransitionStart` to observe the start of App Router navigations: | ||
| ```ts filename="instrumentation-client.ts" | ||
| export function onRouterTransitionStart( | ||
| url: string, | ||
| navigationType: 'push' | 'replace' | 'traverse' | ||
| ) { | ||
| console.log(url, navigationType) | ||
| } | ||
| ``` | ||
| Additional router transition information is experimental. Enable it to receive a third `event` argument: | ||
| ```ts filename="next.config.ts" | ||
| import type { NextConfig } from 'next' | ||
| const nextConfig: NextConfig = { | ||
| experimental: { | ||
| instrumentationClientRouterTransitionEvents: true, | ||
| }, | ||
| } | ||
| export default nextConfig | ||
| ``` | ||
| The event includes the transition metadata and source context known when the navigation is dispatched: | ||
| ```ts filename="instrumentation-client.ts" switcher | ||
| performance.mark('app-init') | ||
| import type { RouterTransitionStartEvent, RouterTransitionType } from 'next' | ||
| export function onRouterTransitionStart( | ||
| url: string, | ||
| navigationType: 'push' | 'replace' | 'traverse' | ||
| navigationType: RouterTransitionType, | ||
| { id, timestamp, fromRoutes, prefetchIntent }: RouterTransitionStartEvent | ||
| ) { | ||
| console.log(`Navigation started: ${navigationType} to ${url}`) | ||
| performance.mark(`nav-start-${Date.now()}`) | ||
| console.log(id, timestamp, url, navigationType, fromRoutes, prefetchIntent) | ||
| } | ||
@@ -62,15 +87,27 @@ ``` | ||
| ```js filename="instrumentation-client.js" switcher | ||
| performance.mark('app-init') | ||
| export function onRouterTransitionStart(url, navigationType) { | ||
| console.log(`Navigation started: ${navigationType} to ${url}`) | ||
| performance.mark(`nav-start-${Date.now()}`) | ||
| export function onRouterTransitionStart(url, navigationType, event) { | ||
| console.log( | ||
| event.id, | ||
| event.timestamp, | ||
| url, | ||
| navigationType, | ||
| event.fromRoutes, | ||
| event.prefetchIntent | ||
| ) | ||
| } | ||
| ``` | ||
| The `onRouterTransitionStart` function receives two parameters: | ||
| `onRouterTransitionStart` receives: | ||
| - `url: string` - The URL being navigated to | ||
| - `navigationType: 'push' | 'replace' | 'traverse'` - The type of navigation | ||
| - `event.id` - An opaque ID shared by events for this transition | ||
| - `event.timestamp` - A framework-captured Unix timestamp in milliseconds | ||
| - `event.fromRoutes` - Route patterns visible before navigation. The primary `children` route is first, followed by parallel slots in deterministic order | ||
| - `event.prefetchIntent` - For link navigations, whether the clicked link requested full prefetching (`full`), used automatic prefetching (`auto`), or did not request prefetching (`none`). For navigations with no associated link (programmatic `router.push()`/`router.replace()`, or browser back/forward) this is `null`, since no link prefetch intent applies | ||
| Route entries use filesystem-style patterns, so a navigation away from `/blog/hello` may report `/blog/[slug]`. | ||
| Hook errors are isolated and do not affect navigation or other hooks. | ||
| ## Performance considerations | ||
@@ -94,3 +131,3 @@ | ||
| `next.config.js` plugins (for example, wrappers like `withSentry`) can register their own client instrumentation module via the [`instrumentationClientInject`](/docs/app/api-reference/config/next-config-js/instrumentationClientInject) option. Injected modules run before this file, in array order, and may export their own `onRouterTransitionStart`. Application code should continue to use this file convention directly. | ||
| `next.config.js` plugins (for example, wrappers like `withSentry`) can register their own client instrumentation module via the [`instrumentationClientInject`](/docs/app/api-reference/config/next-config-js/instrumentationClientInject) option. Injected modules run before this file, in array order, and may export the same router transition start hook. Application code should continue to use this file convention directly. | ||
@@ -229,4 +266,5 @@ ## Examples | ||
| | Version | Changes | | ||
| | ------- | ----------------------------------- | | ||
| | `v15.3` | `instrumentation-client` introduced | | ||
| | Version | Changes | | ||
| | --------- | ----------------------------------------------------- | | ||
| | `v16.3.0` | Experimental router transition start event introduced | | ||
| | `v15.3` | `instrumentation-client` introduced | |
@@ -89,7 +89,6 @@ import path from 'path'; | ||
| // `next-instrumentation-client-loader` (registered via a | ||
| // `module.rules` entry in webpack-config.ts). The emitted module | ||
| // requires each `instrumentationClientInject` entry for side effects, | ||
| // then re-exports the user's `instrumentation-client.{pageExt}` file | ||
| // (resolved through the `private-next-instrumentation-client-user` | ||
| // alias below). | ||
| // `module.rules` entry in webpack-config.ts). The emitted module lists | ||
| // each configured instrumentation module, followed by the user's | ||
| // `instrumentation-client.{pageExt}` file (resolved through the | ||
| // `private-next-instrumentation-client-user` alias below). | ||
| 'private-next-instrumentation-client': INSTRUMENTATION_CLIENT_STUB_PATH, | ||
@@ -96,0 +95,0 @@ 'private-next-instrumentation-client-user': [ |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/build/create-compiler-aliases.ts"],"sourcesContent":["import path from 'path'\nimport * as React from 'react'\nimport {\n DOT_NEXT_ALIAS,\n PAGES_DIR_ALIAS,\n ROOT_DIR_ALIAS,\n APP_DIR_ALIAS,\n RSC_ACTION_PROXY_ALIAS,\n RSC_ACTION_CLIENT_WRAPPER_ALIAS,\n RSC_ACTION_VALIDATE_ALIAS,\n RSC_ACTION_ENCRYPTION_ALIAS,\n RSC_CACHE_WRAPPER_ALIAS,\n type WebpackLayerName,\n RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS,\n} from '../lib/constants'\nimport type { NextConfigComplete } from '../server/config-shared'\nimport { defaultOverrides } from '../server/require-hook'\nimport { hasExternalOtelApiPackage } from './webpack-config'\nimport { NEXT_PROJECT_ROOT } from './next-dir-paths'\nimport { shouldUseReactServerCondition } from './utils'\n\ninterface CompilerAliases {\n [alias: string]: string | string[]\n}\n\nconst isReact19 = typeof React.use === 'function'\n\n/**\n * Absolute path to the placeholder file that `private-next-instrumentation-client`\n * resolves to. Its contents are replaced at build time by\n * `next-instrumentation-client-loader` via a `module.rules` entry in\n * `webpack-config.ts`.\n */\nconst INSTRUMENTATION_CLIENT_STUB_PATH = path.join(\n NEXT_PROJECT_ROOT,\n 'dist/build/webpack/loaders/instrumentation-client-stub.js'\n)\n\nexport function createWebpackAliases({\n distDir,\n isClient,\n isEdgeServer,\n dev,\n config,\n pagesDir,\n appDir,\n dir,\n reactProductionProfiling,\n}: {\n distDir: string\n isClient: boolean\n isEdgeServer: boolean\n dev: boolean\n config: NextConfigComplete\n pagesDir: string | undefined\n appDir: string | undefined\n dir: string\n reactProductionProfiling: boolean\n}): CompilerAliases {\n const pageExtensions = config.pageExtensions\n const customAppAliases: CompilerAliases = {}\n const customDocumentAliases: CompilerAliases = {}\n\n // tell webpack where to look for _app and _document\n // using aliases to allow falling back to the default\n // version when removed or not present\n if (dev) {\n const nextDistPath = 'next/dist/' + (isEdgeServer ? 'esm/' : '')\n customAppAliases[`${PAGES_DIR_ALIAS}/_app`] = [\n ...(pagesDir\n ? pageExtensions.reduce((prev, ext) => {\n prev.push(path.join(pagesDir, `_app.${ext}`))\n return prev\n }, [] as string[])\n : []),\n `${nextDistPath}pages/_app.js`,\n ]\n customAppAliases[`${PAGES_DIR_ALIAS}/_error`] = [\n ...(pagesDir\n ? pageExtensions.reduce((prev, ext) => {\n prev.push(path.join(pagesDir, `_error.${ext}`))\n return prev\n }, [] as string[])\n : []),\n `${nextDistPath}pages/_error.js`,\n ]\n customDocumentAliases[`${PAGES_DIR_ALIAS}/_document`] = [\n ...(pagesDir\n ? pageExtensions.reduce((prev, ext) => {\n prev.push(path.join(pagesDir, `_document.${ext}`))\n return prev\n }, [] as string[])\n : []),\n `${nextDistPath}pages/_document.js`,\n ]\n }\n\n return {\n '@vercel/og$': 'next/dist/server/og/image-response',\n\n // Avoid bundling both entrypoints in React 19 when we just need one.\n // Also avoids bundler warnings in React 18 where react-dom/server.edge doesn't exist.\n 'next/dist/server/ReactDOMServerPages': isReact19\n ? 'react-dom/server.edge'\n : 'react-dom/server.browser',\n\n // Alias next/dist imports to next/dist/esm assets,\n // let this alias hit before `next` alias.\n ...(isEdgeServer\n ? {\n 'next/dist/api': 'next/dist/esm/api',\n 'next/dist/build': 'next/dist/esm/build',\n 'next/dist/client': 'next/dist/esm/client',\n 'next/dist/shared': 'next/dist/esm/shared',\n 'next/dist/pages': 'next/dist/esm/pages',\n 'next/dist/lib': 'next/dist/esm/lib',\n 'next/dist/server': 'next/dist/esm/server',\n\n ...createNextApiEsmAliases(),\n }\n : undefined),\n\n // For RSC server bundle\n ...(!hasExternalOtelApiPackage() && {\n '@opentelemetry/api': 'next/dist/compiled/@opentelemetry/api',\n }),\n\n ...(config.images.loaderFile\n ? {\n 'next/dist/shared/lib/image-loader': config.images.loaderFile,\n ...(isEdgeServer && {\n 'next/dist/esm/shared/lib/image-loader': config.images.loaderFile,\n }),\n }\n : undefined),\n\n 'styled-jsx/style$': defaultOverrides['styled-jsx/style'],\n 'styled-jsx$': defaultOverrides['styled-jsx'],\n\n 'next/dist/compiled/next-devtools': isClient\n ? 'next/dist/compiled/next-devtools'\n : 'next/dist/next-devtools/dev-overlay.shim.js',\n\n ...customAppAliases,\n ...customDocumentAliases,\n\n ...(pagesDir ? { [PAGES_DIR_ALIAS]: pagesDir } : {}),\n ...(appDir ? { [APP_DIR_ALIAS]: appDir } : {}),\n [ROOT_DIR_ALIAS]: dir,\n ...(isClient\n ? {\n // `private-next-instrumentation-client` resolves to a placeholder\n // file whose contents are replaced at build time by\n // `next-instrumentation-client-loader` (registered via a\n // `module.rules` entry in webpack-config.ts). The emitted module\n // requires each `instrumentationClientInject` entry for side effects,\n // then re-exports the user's `instrumentation-client.{pageExt}` file\n // (resolved through the `private-next-instrumentation-client-user`\n // alias below).\n 'private-next-instrumentation-client':\n INSTRUMENTATION_CLIENT_STUB_PATH,\n 'private-next-instrumentation-client-user': [\n path.join(dir, 'src', 'instrumentation-client'),\n path.join(dir, 'instrumentation-client'),\n 'private-next-empty-module',\n ],\n\n // disable typechecker, webpack5 allows aliases to be set to false to create a no-op module\n 'private-next-empty-module': false as any,\n }\n : {}),\n\n [DOT_NEXT_ALIAS]: distDir,\n ...(isClient || isEdgeServer ? getOptimizedModuleAliases() : {}),\n ...(reactProductionProfiling ? getReactProfilingInProduction() : {}),\n\n [RSC_ACTION_VALIDATE_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/action-validate',\n\n [RSC_ACTION_CLIENT_WRAPPER_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/action-client-wrapper',\n\n [RSC_ACTION_PROXY_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/server-reference',\n\n [RSC_ACTION_ENCRYPTION_ALIAS]: 'next/dist/server/app-render/encryption',\n\n [RSC_CACHE_WRAPPER_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/cache-wrapper',\n [RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/track-dynamic-import',\n\n '@swc/helpers/_': path.join(\n path.dirname(require.resolve('@swc/helpers/package.json')),\n '_'\n ),\n\n setimmediate: 'next/dist/compiled/setimmediate',\n }\n}\n\nexport function createServerOnlyClientOnlyAliases(\n isServer: boolean\n): CompilerAliases {\n return isServer\n ? {\n 'server-only$': 'next/dist/compiled/server-only/empty',\n 'client-only$': 'next/dist/compiled/client-only/error',\n 'next/dist/compiled/server-only$':\n 'next/dist/compiled/server-only/empty',\n 'next/dist/compiled/client-only$':\n 'next/dist/compiled/client-only/error',\n }\n : {\n 'server-only$': 'next/dist/compiled/server-only/index',\n 'client-only$': 'next/dist/compiled/client-only/index',\n 'next/dist/compiled/client-only$':\n 'next/dist/compiled/client-only/index',\n 'next/dist/compiled/server-only':\n 'next/dist/compiled/server-only/index',\n }\n}\n\nexport function createNextApiEsmAliases() {\n const mapping = {\n error: 'next/dist/api/error',\n head: 'next/dist/api/head',\n image: 'next/dist/api/image',\n constants: 'next/dist/api/constants',\n router: 'next/dist/api/router',\n dynamic: 'next/dist/api/dynamic',\n script: 'next/dist/api/script',\n link: 'next/dist/api/link',\n form: 'next/dist/api/form',\n navigation: 'next/dist/api/navigation',\n headers: 'next/dist/api/headers',\n og: 'next/dist/api/og',\n server: 'next/dist/api/server',\n // pages api\n document: 'next/dist/api/document',\n app: 'next/dist/api/app',\n }\n const aliasMap: Record<string, string> = {}\n // Handle fully specified imports like `next/image.js`\n for (const [key, value] of Object.entries(mapping)) {\n const nextApiFilePath = path.join(NEXT_PROJECT_ROOT, key)\n aliasMap[nextApiFilePath + '.js'] = value\n }\n\n return aliasMap\n}\n\nexport function createAppRouterApiAliases(isServerOnlyLayer: boolean) {\n const mapping: Record<string, string> = {\n head: 'next/dist/client/components/noop-head',\n dynamic: 'next/dist/api/app-dynamic',\n link: 'next/dist/client/app-dir/link',\n form: 'next/dist/client/app-dir/form',\n }\n\n if (isServerOnlyLayer) {\n mapping['error'] = 'next/dist/api/error.react-server'\n mapping['navigation'] = 'next/dist/api/navigation.react-server'\n mapping['link'] = 'next/dist/client/app-dir/link.react-server'\n }\n\n const aliasMap: Record<string, string> = {}\n for (const [key, value] of Object.entries(mapping)) {\n const nextApiFilePath = path.join(NEXT_PROJECT_ROOT, key)\n aliasMap[nextApiFilePath + '.js'] = value\n }\n return aliasMap\n}\n\n// file:///./../compiled/react/package.json\ntype ReactEntrypoint = 'jsx-runtime' | 'jsx-dev-runtime' | 'compiler-runtime'\n// file:///./../compiled/react-dom/package.json\ntype ReactDOMEntrypoint =\n | 'client'\n | 'server'\n | 'server.edge'\n | 'server.browser'\n // TODO: server.node\n | 'static'\n | 'static.browser'\n | 'static.edge'\n// TODO: static.node\n\n// file:///./../compiled/react-server-dom-webpack/package.json\ntype ReactServerDOMWebpackEntrypoint =\n | 'client'\n // TODO: client.browser\n // TODO: client.edge\n // TODO: client.node\n | 'server'\n // TODO: server.browser\n // TODO: server.edge\n | 'server.node'\n | 'static'\n// TODO: static.browser\n// TODO: static.edge\n// TODO: static.node\n\ntype ReactPackagesEntryPoint =\n | 'react'\n | `react/${ReactEntrypoint}`\n | 'react-dom'\n | `react-dom/${ReactDOMEntrypoint}`\n | `react-server-dom-webpack/${ReactServerDOMWebpackEntrypoint}`\n\ntype BundledReactChannel = '' | '-experimental'\n\ntype ReactAliases = {\n [K in `${ReactPackagesEntryPoint}$`]: string\n} & {\n // Edge Runtime does not use next-server runtime.\n // This means we rely on rewritten import sources in compiled React.\n // We need to alias those rewritten import sources.\n [K in\n | `next/dist/compiled/react${BundledReactChannel}$`\n | `next/dist/compiled/react${BundledReactChannel}/${ReactEntrypoint}$`\n | `next/dist/compiled/react-dom${BundledReactChannel}$`]?: string\n}\n\nexport function createVendoredReactAliases(\n bundledReactChannel: BundledReactChannel,\n {\n layer,\n isBrowser,\n isEdgeServer,\n reactProductionProfiling,\n }: {\n layer: WebpackLayerName\n isBrowser: boolean\n isEdgeServer: boolean\n reactProductionProfiling: boolean\n }\n): CompilerAliases {\n const environmentCondition = isBrowser\n ? 'browser'\n : isEdgeServer\n ? 'edge'\n : 'nodejs'\n const reactCondition = shouldUseReactServerCondition(layer)\n ? 'server'\n : 'client'\n\n // ✅ Correct alias\n // ❌ Incorrect alias i.e. importing this entrypoint should throw an error.\n // ❔ Alias that may produce correct code in certain conditions.Keep until react-markup is available.\n\n let reactAlias: ReactAliases\n if (environmentCondition === 'browser' && reactCondition === 'client') {\n // prettier-ignore\n reactAlias = {\n // file:///./../compiled/react/package.json\n react$: /* ✅ */ `next/dist/compiled/react${bundledReactChannel}`,\n 'react/compiler-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/compiler-runtime`,\n 'react/jsx-dev-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime`,\n 'react/jsx-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/jsx-runtime`,\n // file:///./../compiled/react-dom/package.json\n 'react-dom$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}`,\n 'react-dom/client$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/client`,\n 'react-dom/server$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n 'react-dom/server.browser$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n // optimizations to ignore the legacy build of react-dom/server in `server.edge` build\n 'react-dom/server.edge$': /* ❌ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/static$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.browser$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.edge$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n // file:///./../compiled/react-server-dom-webpack/package.json\n 'react-server-dom-webpack/client$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client.browser`,\n 'react-server-dom-webpack/server$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.browser`,\n 'react-server-dom-webpack/server.node$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.node`,\n 'react-server-dom-webpack/static$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/static.browser`,\n }\n } else if (\n environmentCondition === 'browser' &&\n reactCondition === 'server'\n ) {\n // prettier-ignore\n reactAlias = {\n // file:///./../compiled/react/package.json\n react$: /* ❌ */ `next/dist/compiled/react${bundledReactChannel}`,\n 'react/compiler-runtime$': /* ❌ */ `next/dist/compiled/react${bundledReactChannel}/compiler-runtime`,\n 'react/jsx-dev-runtime$': /* ❌ */ `next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime`,\n 'react/jsx-runtime$': /* ❌ */ `next/dist/compiled/react${bundledReactChannel}/jsx-runtime`,\n // file:///./../compiled/react-dom/package.json\n 'react-dom$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}`,\n 'react-dom/client$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/client`,\n 'react-dom/server$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n 'react-dom/server.browser$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n // optimizations to ignore the legacy build of react-dom/server in `server.edge` build\n 'react-dom/server.edge$': /* ❌ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/static$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.browser$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.edge$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n // file:///./../compiled/react-server-dom-webpack/package.json\n 'react-server-dom-webpack/client$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client.browser`,\n 'react-server-dom-webpack/server$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.browser`,\n 'react-server-dom-webpack/server.node$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.node`,\n 'react-server-dom-webpack/static$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/static.browser`,\n }\n } else if (environmentCondition === 'nodejs' && reactCondition === 'client') {\n // prettier-ignore\n reactAlias = {\n // file:///./../compiled/react/package.json\n react$: /* ✅ */ `next/dist/server/route-modules/app-page/vendored/ssr/react`,\n 'react/compiler-runtime$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/ssr/react-compiler-runtime`,\n 'react/jsx-dev-runtime$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-dev-runtime`,\n 'react/jsx-runtime$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime`,\n // file:///./../compiled/react-dom/package.json\n 'react-dom$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/ssr/react-dom`,\n 'react-dom/client$': /* ❔ */ `next/dist/compiled/react-dom${bundledReactChannel}/client`,\n 'react-dom/server$': /* ❔ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.node`,\n 'react-dom/server.browser$': /* ❔ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n // optimizations to ignore the legacy build of react-dom/server in `server.edge` build\n 'react-dom/server.edge$': /* ✅ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/static$': /* ❔ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.node`,\n 'react-dom/static.browser$': /* ❔ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.edge$': /* ❔ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n // file:///./../compiled/react-server-dom-webpack/package.json\n 'react-server-dom-webpack/client$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/ssr/react-server-dom-webpack-client`,\n 'react-server-dom-webpack/server$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.node`,\n 'react-server-dom-webpack/server.node$':/* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.node`,\n 'react-server-dom-webpack/static$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/static.node`,\n }\n } else if (environmentCondition === 'nodejs' && reactCondition === 'server') {\n // prettier-ignore\n reactAlias = {\n // file:///./../compiled/react/package.json\n react$: /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react`,\n 'react/compiler-runtime$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react-compiler-runtime`,\n 'react/jsx-dev-runtime$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-dev-runtime`,\n 'react/jsx-runtime$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime`,\n // file:///./../compiled/react-dom/package.json\n 'react-dom$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react-dom`,\n 'react-dom/client$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/client`,\n 'react-dom/server$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.node`,\n 'react-dom/server.browser$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n // optimizations to ignore the legacy build of react-dom/server in `server.edge` build\n 'react-dom/server.edge$': /* ❌ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/static$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.node`,\n 'react-dom/static.browser$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.edge$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n // file:///./../compiled/react-server-dom-webpack/package.json\n 'react-server-dom-webpack/client$': /* ❔ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client.node`,\n 'react-server-dom-webpack/server$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-webpack-server`,\n 'react-server-dom-webpack/server.node$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-webpack-server`,\n 'react-server-dom-webpack/static$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-webpack-static`,\n }\n } else if (environmentCondition === 'edge' && reactCondition === 'client') {\n // prettier-ignore\n reactAlias = {\n // file:///./../compiled/react/package.json\n react$: /* ✅ */ `next/dist/compiled/react${bundledReactChannel}`,\n 'react/compiler-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/compiler-runtime`,\n 'react/jsx-dev-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime`,\n 'react/jsx-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/jsx-runtime`,\n // file:///./../compiled/react-dom/package.json\n 'react-dom$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}`,\n 'react-dom/client$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/client`,\n 'react-dom/server$': /* ✅ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/server.browser$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n // optimizations to ignore the legacy build of react-dom/server in `server.edge` build\n 'react-dom/server.edge$': /* ✅ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/static$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n 'react-dom/static.browser$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.edge$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n // file:///./../compiled/react-server-dom-webpack/package.json\n 'react-server-dom-webpack/client$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client.edge`,\n 'react-server-dom-webpack/server$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.edge`,\n 'react-server-dom-webpack/server.node$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.node`,\n 'react-server-dom-webpack/static$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/static.edge`,\n }\n } else if (environmentCondition === 'edge' && reactCondition === 'server') {\n // prettier-ignore\n reactAlias = {\n // file:///./../compiled/react/package.json\n react$: /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/react.react-server`,\n 'react/compiler-runtime$': /* ❌ */ `next/dist/compiled/react${bundledReactChannel}/compiler-runtime`,\n 'react/jsx-dev-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime.react-server`,\n 'react/jsx-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/jsx-runtime.react-server`,\n // file:///./../compiled/react-dom/package.json\n 'react-dom$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/react-dom.react-server`,\n 'react-dom/client$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/client`,\n 'react-dom/server$': /* ❌ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/server.browser$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n // optimizations to ignore the legacy build of react-dom/server in `server.edge` build\n 'react-dom/server.edge$': /* ❌ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/static$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n 'react-dom/static.browser$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.edge$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n // file:///./../compiled/react-server-dom-webpack/package.json\n 'react-server-dom-webpack/client$': /* ❔ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client.edge`,\n 'react-server-dom-webpack/server$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.edge`,\n 'react-server-dom-webpack/server.node$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.node`,\n 'react-server-dom-webpack/static$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/static.edge`,\n }\n\n // prettier-ignore\n reactAlias[`next/dist/compiled/react${bundledReactChannel}$` ] = reactAlias[`react$`]\n // prettier-ignore\n reactAlias[`next/dist/compiled/react${bundledReactChannel}/compiler-runtime$`] = reactAlias[`react/compiler-runtime$`]\n // prettier-ignore\n reactAlias[`next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime$` ] = reactAlias[`react/jsx-dev-runtime$`]\n // prettier-ignore\n reactAlias[`next/dist/compiled/react${bundledReactChannel}/jsx-runtime$` ] = reactAlias[`react/jsx-runtime$`]\n // prettier-ignore\n reactAlias[`next/dist/compiled/react-dom${bundledReactChannel}$` ] = reactAlias[`react-dom$`]\n } else {\n throw new Error(\n `Unsupported environment condition \"${environmentCondition}\" and react condition \"${reactCondition}\". This is a bug in Next.js.`\n )\n }\n\n if (reactProductionProfiling) {\n reactAlias['react-dom/client$'] =\n `next/dist/compiled/react-dom${bundledReactChannel}/profiling`\n }\n\n const alias: CompilerAliases = reactAlias\n\n alias[\n '@vercel/turbopack-ecmascript-runtime/browser/dev/hmr-client/hmr-client.ts'\n ] = `next/dist/client/dev/noop-turbopack-hmr`\n\n return alias\n}\n\n// Insert aliases for Next.js stubs of fetch, object-assign, and url\n// Keep in sync with insert_optimized_module_aliases in import_map.rs\nexport function getOptimizedModuleAliases(): CompilerAliases {\n return {\n unfetch: require.resolve('next/dist/build/polyfills/fetch/index.js'),\n 'isomorphic-unfetch': require.resolve(\n 'next/dist/build/polyfills/fetch/index.js'\n ),\n 'whatwg-fetch': require.resolve(\n 'next/dist/build/polyfills/fetch/whatwg-fetch.js'\n ),\n 'object-assign': require.resolve(\n 'next/dist/build/polyfills/object-assign.js'\n ),\n 'object.assign/auto': require.resolve(\n 'next/dist/build/polyfills/object.assign/auto.js'\n ),\n 'object.assign/implementation': require.resolve(\n 'next/dist/build/polyfills/object.assign/implementation.js'\n ),\n 'object.assign/polyfill': require.resolve(\n 'next/dist/build/polyfills/object.assign/polyfill.js'\n ),\n 'object.assign/shim': require.resolve(\n 'next/dist/build/polyfills/object.assign/shim.js'\n ),\n url: require.resolve('next/dist/compiled/native-url'),\n }\n}\n\nfunction getReactProfilingInProduction(): CompilerAliases {\n return {\n 'react-dom/client$': 'react-dom/profiling',\n }\n}\n"],"names":["path","React","DOT_NEXT_ALIAS","PAGES_DIR_ALIAS","ROOT_DIR_ALIAS","APP_DIR_ALIAS","RSC_ACTION_PROXY_ALIAS","RSC_ACTION_CLIENT_WRAPPER_ALIAS","RSC_ACTION_VALIDATE_ALIAS","RSC_ACTION_ENCRYPTION_ALIAS","RSC_CACHE_WRAPPER_ALIAS","RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS","defaultOverrides","hasExternalOtelApiPackage","NEXT_PROJECT_ROOT","shouldUseReactServerCondition","isReact19","use","INSTRUMENTATION_CLIENT_STUB_PATH","join","createWebpackAliases","distDir","isClient","isEdgeServer","dev","config","pagesDir","appDir","dir","reactProductionProfiling","pageExtensions","customAppAliases","customDocumentAliases","nextDistPath","reduce","prev","ext","push","createNextApiEsmAliases","undefined","images","loaderFile","getOptimizedModuleAliases","getReactProfilingInProduction","dirname","require","resolve","setimmediate","createServerOnlyClientOnlyAliases","isServer","mapping","error","head","image","constants","router","dynamic","script","link","form","navigation","headers","og","server","document","app","aliasMap","key","value","Object","entries","nextApiFilePath","createAppRouterApiAliases","isServerOnlyLayer","createVendoredReactAliases","bundledReactChannel","layer","isBrowser","environmentCondition","reactCondition","reactAlias","react$","Error","alias","unfetch","url"],"m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,qBAEL,CAFK,IAAIE,MACR,CAAC,mCAAmC,EAAEJ,qBAAqB,uBAAuB,EAAEC,eAAe,4BAA4B,CAAC,GAD5H,qBAAA;mBAAA;wBAAA;0BAAA;QAEN;IACF;IAEA,IAAIlD,0BAA0B;QAC5BmD,UAAU,CAAC,oBAAoB,GAC7B,CAAC,4BAA4B,EAAEL,oBAAoB,UAAU,CAAC;IAClE;IAEA,MAAMQ,QAAyBH;IAE/BG,KAAK,CACH,4EACD,GAAG,CAAC,uCAAuC,CAAC;IAE7C,OAAOA;AACT;AAEA,oEAAoE;AACpE,qEAAqE;AACrE,OAAO,SAASzC;IACd,OAAO;QACL0C,SAASvC,QAAQC,OAAO,CAAC;QACzB,sBAAsBD,QAAQC,OAAO,CACnC;QAEF,gBAAgBD,QAAQC,OAAO,CAC7B;QAEF,iBAAiBD,QAAQC,OAAO,CAC9B;QAEF,sBAAsBD,QAAQC,OAAO,CACnC;QAEF,gCAAgCD,QAAQC,OAAO,CAC7C;QAEF,0BAA0BD,QAAQC,OAAO,CACvC;QAEF,sBAAsBD,QAAQC,OAAO,CACnC;QAEFuC,KAAKxC,QAAQC,OAAO,CAAC;IACvB;AACF;AAEA,SAASH;IACP,OAAO;QACL,qBAAqB;IACvB;AACF","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/build/create-compiler-aliases.ts"],"sourcesContent":["import path from 'path'\nimport * as React from 'react'\nimport {\n DOT_NEXT_ALIAS,\n PAGES_DIR_ALIAS,\n ROOT_DIR_ALIAS,\n APP_DIR_ALIAS,\n RSC_ACTION_PROXY_ALIAS,\n RSC_ACTION_CLIENT_WRAPPER_ALIAS,\n RSC_ACTION_VALIDATE_ALIAS,\n RSC_ACTION_ENCRYPTION_ALIAS,\n RSC_CACHE_WRAPPER_ALIAS,\n type WebpackLayerName,\n RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS,\n} from '../lib/constants'\nimport type { NextConfigComplete } from '../server/config-shared'\nimport { defaultOverrides } from '../server/require-hook'\nimport { hasExternalOtelApiPackage } from './webpack-config'\nimport { NEXT_PROJECT_ROOT } from './next-dir-paths'\nimport { shouldUseReactServerCondition } from './utils'\n\ninterface CompilerAliases {\n [alias: string]: string | string[]\n}\n\nconst isReact19 = typeof React.use === 'function'\n\n/**\n * Absolute path to the placeholder file that `private-next-instrumentation-client`\n * resolves to. Its contents are replaced at build time by\n * `next-instrumentation-client-loader` via a `module.rules` entry in\n * `webpack-config.ts`.\n */\nconst INSTRUMENTATION_CLIENT_STUB_PATH = path.join(\n NEXT_PROJECT_ROOT,\n 'dist/build/webpack/loaders/instrumentation-client-stub.js'\n)\n\nexport function createWebpackAliases({\n distDir,\n isClient,\n isEdgeServer,\n dev,\n config,\n pagesDir,\n appDir,\n dir,\n reactProductionProfiling,\n}: {\n distDir: string\n isClient: boolean\n isEdgeServer: boolean\n dev: boolean\n config: NextConfigComplete\n pagesDir: string | undefined\n appDir: string | undefined\n dir: string\n reactProductionProfiling: boolean\n}): CompilerAliases {\n const pageExtensions = config.pageExtensions\n const customAppAliases: CompilerAliases = {}\n const customDocumentAliases: CompilerAliases = {}\n\n // tell webpack where to look for _app and _document\n // using aliases to allow falling back to the default\n // version when removed or not present\n if (dev) {\n const nextDistPath = 'next/dist/' + (isEdgeServer ? 'esm/' : '')\n customAppAliases[`${PAGES_DIR_ALIAS}/_app`] = [\n ...(pagesDir\n ? pageExtensions.reduce((prev, ext) => {\n prev.push(path.join(pagesDir, `_app.${ext}`))\n return prev\n }, [] as string[])\n : []),\n `${nextDistPath}pages/_app.js`,\n ]\n customAppAliases[`${PAGES_DIR_ALIAS}/_error`] = [\n ...(pagesDir\n ? pageExtensions.reduce((prev, ext) => {\n prev.push(path.join(pagesDir, `_error.${ext}`))\n return prev\n }, [] as string[])\n : []),\n `${nextDistPath}pages/_error.js`,\n ]\n customDocumentAliases[`${PAGES_DIR_ALIAS}/_document`] = [\n ...(pagesDir\n ? pageExtensions.reduce((prev, ext) => {\n prev.push(path.join(pagesDir, `_document.${ext}`))\n return prev\n }, [] as string[])\n : []),\n `${nextDistPath}pages/_document.js`,\n ]\n }\n\n return {\n '@vercel/og$': 'next/dist/server/og/image-response',\n\n // Avoid bundling both entrypoints in React 19 when we just need one.\n // Also avoids bundler warnings in React 18 where react-dom/server.edge doesn't exist.\n 'next/dist/server/ReactDOMServerPages': isReact19\n ? 'react-dom/server.edge'\n : 'react-dom/server.browser',\n\n // Alias next/dist imports to next/dist/esm assets,\n // let this alias hit before `next` alias.\n ...(isEdgeServer\n ? {\n 'next/dist/api': 'next/dist/esm/api',\n 'next/dist/build': 'next/dist/esm/build',\n 'next/dist/client': 'next/dist/esm/client',\n 'next/dist/shared': 'next/dist/esm/shared',\n 'next/dist/pages': 'next/dist/esm/pages',\n 'next/dist/lib': 'next/dist/esm/lib',\n 'next/dist/server': 'next/dist/esm/server',\n\n ...createNextApiEsmAliases(),\n }\n : undefined),\n\n // For RSC server bundle\n ...(!hasExternalOtelApiPackage() && {\n '@opentelemetry/api': 'next/dist/compiled/@opentelemetry/api',\n }),\n\n ...(config.images.loaderFile\n ? {\n 'next/dist/shared/lib/image-loader': config.images.loaderFile,\n ...(isEdgeServer && {\n 'next/dist/esm/shared/lib/image-loader': config.images.loaderFile,\n }),\n }\n : undefined),\n\n 'styled-jsx/style$': defaultOverrides['styled-jsx/style'],\n 'styled-jsx$': defaultOverrides['styled-jsx'],\n\n 'next/dist/compiled/next-devtools': isClient\n ? 'next/dist/compiled/next-devtools'\n : 'next/dist/next-devtools/dev-overlay.shim.js',\n\n ...customAppAliases,\n ...customDocumentAliases,\n\n ...(pagesDir ? { [PAGES_DIR_ALIAS]: pagesDir } : {}),\n ...(appDir ? { [APP_DIR_ALIAS]: appDir } : {}),\n [ROOT_DIR_ALIAS]: dir,\n ...(isClient\n ? {\n // `private-next-instrumentation-client` resolves to a placeholder\n // file whose contents are replaced at build time by\n // `next-instrumentation-client-loader` (registered via a\n // `module.rules` entry in webpack-config.ts). The emitted module lists\n // each configured instrumentation module, followed by the user's\n // `instrumentation-client.{pageExt}` file (resolved through the\n // `private-next-instrumentation-client-user` alias below).\n 'private-next-instrumentation-client':\n INSTRUMENTATION_CLIENT_STUB_PATH,\n 'private-next-instrumentation-client-user': [\n path.join(dir, 'src', 'instrumentation-client'),\n path.join(dir, 'instrumentation-client'),\n 'private-next-empty-module',\n ],\n\n // disable typechecker, webpack5 allows aliases to be set to false to create a no-op module\n 'private-next-empty-module': false as any,\n }\n : {}),\n\n [DOT_NEXT_ALIAS]: distDir,\n ...(isClient || isEdgeServer ? getOptimizedModuleAliases() : {}),\n ...(reactProductionProfiling ? getReactProfilingInProduction() : {}),\n\n [RSC_ACTION_VALIDATE_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/action-validate',\n\n [RSC_ACTION_CLIENT_WRAPPER_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/action-client-wrapper',\n\n [RSC_ACTION_PROXY_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/server-reference',\n\n [RSC_ACTION_ENCRYPTION_ALIAS]: 'next/dist/server/app-render/encryption',\n\n [RSC_CACHE_WRAPPER_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/cache-wrapper',\n [RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/track-dynamic-import',\n\n '@swc/helpers/_': path.join(\n path.dirname(require.resolve('@swc/helpers/package.json')),\n '_'\n ),\n\n setimmediate: 'next/dist/compiled/setimmediate',\n }\n}\n\nexport function createServerOnlyClientOnlyAliases(\n isServer: boolean\n): CompilerAliases {\n return isServer\n ? {\n 'server-only$': 'next/dist/compiled/server-only/empty',\n 'client-only$': 'next/dist/compiled/client-only/error',\n 'next/dist/compiled/server-only$':\n 'next/dist/compiled/server-only/empty',\n 'next/dist/compiled/client-only$':\n 'next/dist/compiled/client-only/error',\n }\n : {\n 'server-only$': 'next/dist/compiled/server-only/index',\n 'client-only$': 'next/dist/compiled/client-only/index',\n 'next/dist/compiled/client-only$':\n 'next/dist/compiled/client-only/index',\n 'next/dist/compiled/server-only':\n 'next/dist/compiled/server-only/index',\n }\n}\n\nexport function createNextApiEsmAliases() {\n const mapping = {\n error: 'next/dist/api/error',\n head: 'next/dist/api/head',\n image: 'next/dist/api/image',\n constants: 'next/dist/api/constants',\n router: 'next/dist/api/router',\n dynamic: 'next/dist/api/dynamic',\n script: 'next/dist/api/script',\n link: 'next/dist/api/link',\n form: 'next/dist/api/form',\n navigation: 'next/dist/api/navigation',\n headers: 'next/dist/api/headers',\n og: 'next/dist/api/og',\n server: 'next/dist/api/server',\n // pages api\n document: 'next/dist/api/document',\n app: 'next/dist/api/app',\n }\n const aliasMap: Record<string, string> = {}\n // Handle fully specified imports like `next/image.js`\n for (const [key, value] of Object.entries(mapping)) {\n const nextApiFilePath = path.join(NEXT_PROJECT_ROOT, key)\n aliasMap[nextApiFilePath + '.js'] = value\n }\n\n return aliasMap\n}\n\nexport function createAppRouterApiAliases(isServerOnlyLayer: boolean) {\n const mapping: Record<string, string> = {\n head: 'next/dist/client/components/noop-head',\n dynamic: 'next/dist/api/app-dynamic',\n link: 'next/dist/client/app-dir/link',\n form: 'next/dist/client/app-dir/form',\n }\n\n if (isServerOnlyLayer) {\n mapping['error'] = 'next/dist/api/error.react-server'\n mapping['navigation'] = 'next/dist/api/navigation.react-server'\n mapping['link'] = 'next/dist/client/app-dir/link.react-server'\n }\n\n const aliasMap: Record<string, string> = {}\n for (const [key, value] of Object.entries(mapping)) {\n const nextApiFilePath = path.join(NEXT_PROJECT_ROOT, key)\n aliasMap[nextApiFilePath + '.js'] = value\n }\n return aliasMap\n}\n\n// file:///./../compiled/react/package.json\ntype ReactEntrypoint = 'jsx-runtime' | 'jsx-dev-runtime' | 'compiler-runtime'\n// file:///./../compiled/react-dom/package.json\ntype ReactDOMEntrypoint =\n | 'client'\n | 'server'\n | 'server.edge'\n | 'server.browser'\n // TODO: server.node\n | 'static'\n | 'static.browser'\n | 'static.edge'\n// TODO: static.node\n\n// file:///./../compiled/react-server-dom-webpack/package.json\ntype ReactServerDOMWebpackEntrypoint =\n | 'client'\n // TODO: client.browser\n // TODO: client.edge\n // TODO: client.node\n | 'server'\n // TODO: server.browser\n // TODO: server.edge\n | 'server.node'\n | 'static'\n// TODO: static.browser\n// TODO: static.edge\n// TODO: static.node\n\ntype ReactPackagesEntryPoint =\n | 'react'\n | `react/${ReactEntrypoint}`\n | 'react-dom'\n | `react-dom/${ReactDOMEntrypoint}`\n | `react-server-dom-webpack/${ReactServerDOMWebpackEntrypoint}`\n\ntype BundledReactChannel = '' | '-experimental'\n\ntype ReactAliases = {\n [K in `${ReactPackagesEntryPoint}$`]: string\n} & {\n // Edge Runtime does not use next-server runtime.\n // This means we rely on rewritten import sources in compiled React.\n // We need to alias those rewritten import sources.\n [K in\n | `next/dist/compiled/react${BundledReactChannel}$`\n | `next/dist/compiled/react${BundledReactChannel}/${ReactEntrypoint}$`\n | `next/dist/compiled/react-dom${BundledReactChannel}$`]?: string\n}\n\nexport function createVendoredReactAliases(\n bundledReactChannel: BundledReactChannel,\n {\n layer,\n isBrowser,\n isEdgeServer,\n reactProductionProfiling,\n }: {\n layer: WebpackLayerName\n isBrowser: boolean\n isEdgeServer: boolean\n reactProductionProfiling: boolean\n }\n): CompilerAliases {\n const environmentCondition = isBrowser\n ? 'browser'\n : isEdgeServer\n ? 'edge'\n : 'nodejs'\n const reactCondition = shouldUseReactServerCondition(layer)\n ? 'server'\n : 'client'\n\n // ✅ Correct alias\n // ❌ Incorrect alias i.e. importing this entrypoint should throw an error.\n // ❔ Alias that may produce correct code in certain conditions.Keep until react-markup is available.\n\n let reactAlias: ReactAliases\n if (environmentCondition === 'browser' && reactCondition === 'client') {\n // prettier-ignore\n reactAlias = {\n // file:///./../compiled/react/package.json\n react$: /* ✅ */ `next/dist/compiled/react${bundledReactChannel}`,\n 'react/compiler-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/compiler-runtime`,\n 'react/jsx-dev-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime`,\n 'react/jsx-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/jsx-runtime`,\n // file:///./../compiled/react-dom/package.json\n 'react-dom$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}`,\n 'react-dom/client$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/client`,\n 'react-dom/server$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n 'react-dom/server.browser$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n // optimizations to ignore the legacy build of react-dom/server in `server.edge` build\n 'react-dom/server.edge$': /* ❌ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/static$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.browser$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.edge$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n // file:///./../compiled/react-server-dom-webpack/package.json\n 'react-server-dom-webpack/client$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client.browser`,\n 'react-server-dom-webpack/server$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.browser`,\n 'react-server-dom-webpack/server.node$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.node`,\n 'react-server-dom-webpack/static$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/static.browser`,\n }\n } else if (\n environmentCondition === 'browser' &&\n reactCondition === 'server'\n ) {\n // prettier-ignore\n reactAlias = {\n // file:///./../compiled/react/package.json\n react$: /* ❌ */ `next/dist/compiled/react${bundledReactChannel}`,\n 'react/compiler-runtime$': /* ❌ */ `next/dist/compiled/react${bundledReactChannel}/compiler-runtime`,\n 'react/jsx-dev-runtime$': /* ❌ */ `next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime`,\n 'react/jsx-runtime$': /* ❌ */ `next/dist/compiled/react${bundledReactChannel}/jsx-runtime`,\n // file:///./../compiled/react-dom/package.json\n 'react-dom$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}`,\n 'react-dom/client$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/client`,\n 'react-dom/server$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n 'react-dom/server.browser$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n // optimizations to ignore the legacy build of react-dom/server in `server.edge` build\n 'react-dom/server.edge$': /* ❌ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/static$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.browser$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.edge$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n // file:///./../compiled/react-server-dom-webpack/package.json\n 'react-server-dom-webpack/client$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client.browser`,\n 'react-server-dom-webpack/server$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.browser`,\n 'react-server-dom-webpack/server.node$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.node`,\n 'react-server-dom-webpack/static$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/static.browser`,\n }\n } else if (environmentCondition === 'nodejs' && reactCondition === 'client') {\n // prettier-ignore\n reactAlias = {\n // file:///./../compiled/react/package.json\n react$: /* ✅ */ `next/dist/server/route-modules/app-page/vendored/ssr/react`,\n 'react/compiler-runtime$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/ssr/react-compiler-runtime`,\n 'react/jsx-dev-runtime$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-dev-runtime`,\n 'react/jsx-runtime$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime`,\n // file:///./../compiled/react-dom/package.json\n 'react-dom$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/ssr/react-dom`,\n 'react-dom/client$': /* ❔ */ `next/dist/compiled/react-dom${bundledReactChannel}/client`,\n 'react-dom/server$': /* ❔ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.node`,\n 'react-dom/server.browser$': /* ❔ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n // optimizations to ignore the legacy build of react-dom/server in `server.edge` build\n 'react-dom/server.edge$': /* ✅ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/static$': /* ❔ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.node`,\n 'react-dom/static.browser$': /* ❔ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.edge$': /* ❔ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n // file:///./../compiled/react-server-dom-webpack/package.json\n 'react-server-dom-webpack/client$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/ssr/react-server-dom-webpack-client`,\n 'react-server-dom-webpack/server$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.node`,\n 'react-server-dom-webpack/server.node$':/* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.node`,\n 'react-server-dom-webpack/static$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/static.node`,\n }\n } else if (environmentCondition === 'nodejs' && reactCondition === 'server') {\n // prettier-ignore\n reactAlias = {\n // file:///./../compiled/react/package.json\n react$: /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react`,\n 'react/compiler-runtime$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react-compiler-runtime`,\n 'react/jsx-dev-runtime$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-dev-runtime`,\n 'react/jsx-runtime$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime`,\n // file:///./../compiled/react-dom/package.json\n 'react-dom$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react-dom`,\n 'react-dom/client$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/client`,\n 'react-dom/server$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.node`,\n 'react-dom/server.browser$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n // optimizations to ignore the legacy build of react-dom/server in `server.edge` build\n 'react-dom/server.edge$': /* ❌ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/static$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.node`,\n 'react-dom/static.browser$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.edge$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n // file:///./../compiled/react-server-dom-webpack/package.json\n 'react-server-dom-webpack/client$': /* ❔ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client.node`,\n 'react-server-dom-webpack/server$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-webpack-server`,\n 'react-server-dom-webpack/server.node$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-webpack-server`,\n 'react-server-dom-webpack/static$': /* ✅ */ `next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-webpack-static`,\n }\n } else if (environmentCondition === 'edge' && reactCondition === 'client') {\n // prettier-ignore\n reactAlias = {\n // file:///./../compiled/react/package.json\n react$: /* ✅ */ `next/dist/compiled/react${bundledReactChannel}`,\n 'react/compiler-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/compiler-runtime`,\n 'react/jsx-dev-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime`,\n 'react/jsx-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/jsx-runtime`,\n // file:///./../compiled/react-dom/package.json\n 'react-dom$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}`,\n 'react-dom/client$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/client`,\n 'react-dom/server$': /* ✅ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/server.browser$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n // optimizations to ignore the legacy build of react-dom/server in `server.edge` build\n 'react-dom/server.edge$': /* ✅ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/static$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n 'react-dom/static.browser$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.edge$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n // file:///./../compiled/react-server-dom-webpack/package.json\n 'react-server-dom-webpack/client$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client.edge`,\n 'react-server-dom-webpack/server$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.edge`,\n 'react-server-dom-webpack/server.node$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.node`,\n 'react-server-dom-webpack/static$': /* ❌ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/static.edge`,\n }\n } else if (environmentCondition === 'edge' && reactCondition === 'server') {\n // prettier-ignore\n reactAlias = {\n // file:///./../compiled/react/package.json\n react$: /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/react.react-server`,\n 'react/compiler-runtime$': /* ❌ */ `next/dist/compiled/react${bundledReactChannel}/compiler-runtime`,\n 'react/jsx-dev-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime.react-server`,\n 'react/jsx-runtime$': /* ✅ */ `next/dist/compiled/react${bundledReactChannel}/jsx-runtime.react-server`,\n // file:///./../compiled/react-dom/package.json\n 'react-dom$': /* ✅ */ `next/dist/compiled/react-dom${bundledReactChannel}/react-dom.react-server`,\n 'react-dom/client$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/client`,\n 'react-dom/server$': /* ❌ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/server.browser$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n // optimizations to ignore the legacy build of react-dom/server in `server.edge` build\n 'react-dom/server.edge$': /* ❌ */ `next/dist/build/webpack/alias/react-dom-server${bundledReactChannel}.js`,\n 'react-dom/static$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n 'react-dom/static.browser$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n 'react-dom/static.edge$': /* ❌ */ `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n // file:///./../compiled/react-server-dom-webpack/package.json\n 'react-server-dom-webpack/client$': /* ❔ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client.edge`,\n 'react-server-dom-webpack/server$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.edge`,\n 'react-server-dom-webpack/server.node$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.node`,\n 'react-server-dom-webpack/static$': /* ✅ */ `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/static.edge`,\n }\n\n // prettier-ignore\n reactAlias[`next/dist/compiled/react${bundledReactChannel}$` ] = reactAlias[`react$`]\n // prettier-ignore\n reactAlias[`next/dist/compiled/react${bundledReactChannel}/compiler-runtime$`] = reactAlias[`react/compiler-runtime$`]\n // prettier-ignore\n reactAlias[`next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime$` ] = reactAlias[`react/jsx-dev-runtime$`]\n // prettier-ignore\n reactAlias[`next/dist/compiled/react${bundledReactChannel}/jsx-runtime$` ] = reactAlias[`react/jsx-runtime$`]\n // prettier-ignore\n reactAlias[`next/dist/compiled/react-dom${bundledReactChannel}$` ] = reactAlias[`react-dom$`]\n } else {\n throw new Error(\n `Unsupported environment condition \"${environmentCondition}\" and react condition \"${reactCondition}\". This is a bug in Next.js.`\n )\n }\n\n if (reactProductionProfiling) {\n reactAlias['react-dom/client$'] =\n `next/dist/compiled/react-dom${bundledReactChannel}/profiling`\n }\n\n const alias: CompilerAliases = reactAlias\n\n alias[\n '@vercel/turbopack-ecmascript-runtime/browser/dev/hmr-client/hmr-client.ts'\n ] = `next/dist/client/dev/noop-turbopack-hmr`\n\n return alias\n}\n\n// Insert aliases for Next.js stubs of fetch, object-assign, and url\n// Keep in sync with insert_optimized_module_aliases in import_map.rs\nexport function getOptimizedModuleAliases(): CompilerAliases {\n return {\n unfetch: require.resolve('next/dist/build/polyfills/fetch/index.js'),\n 'isomorphic-unfetch': require.resolve(\n 'next/dist/build/polyfills/fetch/index.js'\n ),\n 'whatwg-fetch': require.resolve(\n 'next/dist/build/polyfills/fetch/whatwg-fetch.js'\n ),\n 'object-assign': require.resolve(\n 'next/dist/build/polyfills/object-assign.js'\n ),\n 'object.assign/auto': require.resolve(\n 'next/dist/build/polyfills/object.assign/auto.js'\n ),\n 'object.assign/implementation': require.resolve(\n 'next/dist/build/polyfills/object.assign/implementation.js'\n ),\n 'object.assign/polyfill': require.resolve(\n 'next/dist/build/polyfills/object.assign/polyfill.js'\n ),\n 'object.assign/shim': require.resolve(\n 'next/dist/build/polyfills/object.assign/shim.js'\n ),\n url: require.resolve('next/dist/compiled/native-url'),\n }\n}\n\nfunction getReactProfilingInProduction(): CompilerAliases {\n return {\n 'react-dom/client$': 'react-dom/profiling',\n }\n}\n"],"names":["path","React","DOT_NEXT_ALIAS","PAGES_DIR_ALIAS","ROOT_DIR_ALIAS","APP_DIR_ALIAS","RSC_ACTION_PROXY_ALIAS","RSC_ACTION_CLIENT_WRAPPER_ALIAS","RSC_ACTION_VALIDATE_ALIAS","RSC_ACTION_ENCRYPTION_ALIAS","RSC_CACHE_WRAPPER_ALIAS","RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS","defaultOverrides","hasExternalOtelApiPackage","NEXT_PROJECT_ROOT","shouldUseReactServerCondition","isReact19","use","INSTRUMENTATION_CLIENT_STUB_PATH","join","createWebpackAliases","distDir","isClient","isEdgeServer","dev","config","pagesDir","appDir","dir","reactProductionProfiling","pageExtensions","customAppAliases","customDocumentAliases","nextDistPath","reduce","prev","ext","push","createNextApiEsmAliases","undefined","images","loaderFile","getOptimizedModuleAliases","getReactProfilingInProduction","dirname","require","resolve","setimmediate","createServerOnlyClientOnlyAliases","isServer","mapping","error","head","image","constants","router","dynamic","script","link","form","navigation","headers","og","server","document","app","aliasMap","key","value","Object","entries","nextApiFilePath","createAppRouterApiAliases","isServerOnlyLayer","createVendoredReactAliases","bundledReactChannel","layer","isBrowser","environmentCondition","reactCondition","reactAlias","react$","Error","alias","unfetch","url"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AACvB,YAAYC,WAAW,QAAO;AAC9B,SACEC,cAAc,EACdC,eAAe,EACfC,cAAc,EACdC,aAAa,EACbC,sBAAsB,EACtBC,+BAA+B,EAC/BC,yBAAyB,EACzBC,2BAA2B,EAC3BC,uBAAuB,EAEvBC,gCAAgC,QAC3B,mBAAkB;AAEzB,SAASC,gBAAgB,QAAQ,yBAAwB;AACzD,SAASC,yBAAyB,QAAQ,mBAAkB;AAC5D,SAASC,iBAAiB,QAAQ,mBAAkB;AACpD,SAASC,6BAA6B,QAAQ,UAAS;AAMvD,MAAMC,YAAY,OAAOf,MAAMgB,GAAG,KAAK;AAEvC;;;;;CAKC,GACD,MAAMC,mCA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O,CACnC;QAEF,gBAAgBD,QAAQC,OAAO,CAC7B;QAEF,iBAAiBD,QAAQC,OAAO,CAC9B;QAEF,sBAAsBD,QAAQC,OAAO,CACnC;QAEF,gCAAgCD,QAAQC,OAAO,CAC7C;QAEF,0BAA0BD,QAAQC,OAAO,CACvC;QAEF,sBAAsBD,QAAQC,OAAO,CACnC;QAEFuC,KAAKxC,QAAQC,OAAO,CAAC;IACvB;AACF;AAEA,SAASH;IACP,OAAO;QACL,qBAAqB;IACvB;AACF","ignoreList":[0]} |
@@ -187,2 +187,3 @@ import path from 'node:path'; | ||
| 'process.env.__NEXT_OPTIMISTIC_ROUTING': config.experimental.optimisticRouting ?? false, | ||
| 'process.env.__NEXT_INSTRUMENTATION_CLIENT_ROUTER_TRANSITION_EVENTS': config.experimental.instrumentationClientRouterTransitionEvents ?? false, | ||
| 'process.env.__NEXT_APP_SHELLS': config.experimental.appShells ?? false, | ||
@@ -189,0 +190,0 @@ 'process.env.__NEXT_VARY_PARAMS': config.experimental.varyParams ?? false, |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/build/define-env.ts"],"sourcesContent":["import type {\n I18NConfig,\n I18NDomains,\n NextConfigComplete,\n} from '../server/config-shared'\nimport type { ProxyMatcher } from './analysis/get-page-static-info'\nimport type { Rewrite } from '../lib/load-custom-routes'\nimport path from 'node:path'\nimport { needsExperimentalReact } from '../lib/needs-experimental-react'\nimport { checkIsAppPPREnabled } from '../server/lib/experimental/ppr'\nimport {\n getNextConfigEnv,\n getNextPublicEnvironmentVariables,\n} from '../lib/static-env'\n\ntype BloomFilter = ReturnType<\n import('../shared/lib/bloom-filter').BloomFilter['export']\n>\n\nexport interface DefineEnvOptions {\n isTurbopack: boolean\n clientRouterFilters?: {\n staticFilter: BloomFilter\n dynamicFilter: BloomFilter\n }\n config: NextConfigComplete\n dev: boolean\n distDir: string\n projectPath: string\n fetchCacheKeyPrefix: string | undefined\n hasRewrites: boolean\n isClient: boolean\n isEdgeServer: boolean\n isNodeServer: boolean\n middlewareMatchers: ProxyMatcher[] | undefined\n omitNonDeterministic?: boolean\n rewrites: {\n beforeFiles: Rewrite[]\n afterFiles: Rewrite[]\n fallback: Rewrite[]\n }\n}\n\nconst DEFINE_ENV_EXPRESSION = Symbol('DEFINE_ENV_EXPRESSION')\n\ninterface DefineEnv {\n [key: string]:\n | string\n | number\n | string[]\n | boolean\n | { [DEFINE_ENV_EXPRESSION]: string }\n | ProxyMatcher[]\n | BloomFilter\n | Partial<NextConfigComplete['images']>\n | I18NDomains\n | I18NConfig\n}\n\ninterface SerializedDefineEnv {\n [key: string]: string\n}\n\n/**\n * Serializes the DefineEnv config so that it can be inserted into the code by Webpack/Turbopack, JSON stringifies each value.\n */\nfunction serializeDefineEnv(defineEnv: DefineEnv): SerializedDefineEnv {\n const defineEnvStringified: SerializedDefineEnv = Object.fromEntries(\n Object.entries(defineEnv).map(([key, value]) => [\n key,\n typeof value === 'object' && DEFINE_ENV_EXPRESSION in value\n ? value[DEFINE_ENV_EXPRESSION]\n : JSON.stringify(value),\n ])\n )\n return defineEnvStringified\n}\n\nfunction getImageConfig(\n config: NextConfigComplete,\n dev: boolean\n): { 'process.env.__NEXT_IMAGE_OPTS': Partial<NextConfigComplete['images']> } {\n return {\n 'process.env.__NEXT_IMAGE_OPTS': {\n deviceSizes: config.images.deviceSizes,\n imageSizes: config.images.imageSizes,\n qualities: config.images.qualities,\n path: config.images.path,\n loader: config.images.loader,\n dangerouslyAllowSVG: config.images.dangerouslyAllowSVG,\n unoptimized: config?.images?.unoptimized,\n ...(dev\n ? {\n // additional config in dev to allow validating on the client\n domains: config.images.domains,\n remotePatterns: config.images?.remotePatterns,\n localPatterns: config.images?.localPatterns,\n output: config.output,\n }\n : {}),\n },\n }\n}\n\nexport function getDefineEnv({\n isTurbopack,\n clientRouterFilters,\n config,\n dev,\n distDir,\n projectPath,\n fetchCacheKeyPrefix,\n hasRewrites,\n isClient,\n isEdgeServer,\n isNodeServer,\n middlewareMatchers,\n omitNonDeterministic,\n rewrites,\n}: DefineEnvOptions): SerializedDefineEnv {\n const nextPublicEnv = getNextPublicEnvironmentVariables()\n const nextConfigEnv = getNextConfigEnv(config)\n\n const isPPREnabled = checkIsAppPPREnabled(config.experimental.ppr)\n const isCacheComponentsEnabled = !!config.cacheComponents\n const isUseCacheEnabled = !!config.experimental.useCache\n\n const defineEnv: DefineEnv = {\n // internal field to identify the plugin config\n __NEXT_DEFINE_ENV: true,\n\n ...nextPublicEnv,\n ...nextConfigEnv,\n ...(!isEdgeServer\n ? {}\n : {\n EdgeRuntime:\n /**\n * Cloud providers can set this environment variable to allow users\n * and library authors to have different implementations based on\n * the runtime they are running with, if it's not using `edge-runtime`\n */\n process.env.NEXT_EDGE_RUNTIME_PROVIDER ?? 'edge-runtime',\n\n // process should be only { env: {...} } for edge runtime.\n // For ignore avoid warn on `process.emit` usage but directly omit it.\n 'process.emit': false,\n }),\n 'process.turbopack': isTurbopack,\n 'process.env.TURBOPACK': isTurbopack,\n 'process.env.__NEXT_BUNDLER': isTurbopack\n ? 'Turbopack'\n : process.env.NEXT_RSPACK\n ? 'Rspack'\n : 'Webpack',\n // TODO: enforce `NODE_ENV` on `process.env`, and add a test:\n 'process.env.NODE_ENV':\n dev || config.experimental.allowDevelopmentBuild\n ? 'development'\n : 'production',\n 'process.env.__NEXT_DEV_SERVER': dev ? '1' : '',\n 'process.env.__NEXT_DISABLE_DEV_OVERLAY_UX':\n process.env.NEXT_PRIVATE_DISABLE_DEV_OVERLAY_UX === '1',\n 'process.env.NEXT_RUNTIME': isEdgeServer\n ? 'edge'\n : isNodeServer\n ? 'nodejs'\n : '',\n 'process.env.NEXT_MINIMAL': '',\n 'process.env.__NEXT_APP_NAV_FAIL_HANDLING': Boolean(\n config.experimental.appNavFailHandling\n ),\n 'process.env.__NEXT_APP_NEW_SCROLL_HANDLER': Boolean(\n config.experimental.appNewScrollHandler\n ),\n 'process.env.__NEXT_PPR': isPPREnabled,\n 'process.env.__NEXT_CACHE_COMPONENTS': isCacheComponentsEnabled,\n 'process.env.__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS': Boolean(\n config.experimental.cachedNavigations\n ),\n 'process.env.__NEXT_INSTANT_NAV_TOGGLE': isCacheComponentsEnabled,\n 'process.env.__NEXT_USE_CACHE': isUseCacheEnabled,\n 'process.env.__NEXT_USE_NODE_STREAMS': isEdgeServer ? false : true,\n\n 'process.env.NEXT_SUPPORTS_IMMUTABLE_ASSETS':\n config.experimental.supportsImmutableAssets || false,\n\n ...(config.experimental?.useSkewCookie || !config.deploymentId\n ? {\n 'process.env.NEXT_DEPLOYMENT_ID': false,\n }\n : isClient\n ? isTurbopack\n ? {\n // This is set at runtime by packages/next/src/client/register-deployment-id-global.ts\n 'process.env.NEXT_DEPLOYMENT_ID': {\n [DEFINE_ENV_EXPRESSION]: 'globalThis.NEXT_DEPLOYMENT_ID',\n },\n }\n : {\n // For Webpack, we currently don't use the non-inlining globalThis.NEXT_DEPLOYMENT_ID\n // approach because we cannot forward this global variable to web workers easily.\n 'process.env.NEXT_DEPLOYMENT_ID': config.deploymentId || false,\n }\n : config.experimental?.runtimeServerDeploymentId\n ? {\n // Don't inline at all, keep process.env.NEXT_DEPLOYMENT_ID as is\n }\n : {\n 'process.env.NEXT_DEPLOYMENT_ID': config.deploymentId || false,\n }),\n\n // Propagates the `__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING` environment\n // variable to the client.\n 'process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING':\n process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING || false,\n 'process.env.__NEXT_FETCH_CACHE_KEY_PREFIX': fetchCacheKeyPrefix ?? '',\n ...(isTurbopack\n ? {}\n : {\n 'process.env.__NEXT_MIDDLEWARE_MATCHERS': middlewareMatchers ?? [],\n }),\n 'process.env.__NEXT_MANUAL_CLIENT_BASE_PATH':\n config.experimental.manualClientBasePath ?? false,\n 'process.env.__NEXT_CLIENT_ROUTER_DYNAMIC_STALETIME': JSON.stringify(\n isNaN(Number(config.experimental.staleTimes?.dynamic))\n ? 0\n : config.experimental.staleTimes?.dynamic\n ),\n 'process.env.__NEXT_CLIENT_ROUTER_STATIC_STALETIME': JSON.stringify(\n isNaN(Number(config.experimental.staleTimes?.static))\n ? 5 * 60 // 5 minutes\n : config.experimental.staleTimes?.static\n ),\n 'process.env.__NEXT_CLIENT_ROUTER_FILTER_ENABLED':\n config.experimental.clientRouterFilter ?? true,\n 'process.env.__NEXT_CLIENT_ROUTER_S_FILTER':\n clientRouterFilters?.staticFilter ?? false,\n 'process.env.__NEXT_CLIENT_ROUTER_D_FILTER':\n clientRouterFilters?.dynamicFilter ?? false,\n 'process.env.__NEXT_CLIENT_VALIDATE_RSC_REQUEST_HEADERS': Boolean(\n config.experimental.validateRSCRequestHeaders\n ),\n 'process.env.__NEXT_DYNAMIC_ON_HOVER': Boolean(\n config.experimental.dynamicOnHover\n ),\n 'process.env.__NEXT_USE_OFFLINE': Boolean(config.experimental.useOffline),\n 'process.env.__NEXT_PREFETCH_INLINING': Boolean(\n config.experimental.prefetchInlining\n ),\n 'process.env.__NEXT_OPTIMISTIC_CLIENT_CACHE':\n config.experimental.optimisticClientCache ?? true,\n 'process.env.__NEXT_MIDDLEWARE_PREFETCH':\n config.experimental.proxyPrefetch ?? 'flexible',\n 'process.env.__NEXT_CROSS_ORIGIN': config.crossOrigin,\n 'process.browser': isClient,\n 'process.env.__NEXT_TEST_MODE': process.env.__NEXT_TEST_MODE ?? false,\n // This is used in client/dev-error-overlay/hot-dev-client.js to replace the dist directory\n ...(dev && (isClient ?? isEdgeServer)\n ? {\n 'process.env.__NEXT_DIST_DIR': distDir,\n }\n : {}),\n // This is used in devtools to strip the project path in edge runtime,\n // as there's only a dummy `dir` value (`.`) as edge runtime doesn't have concept of file system.\n ...(dev && isEdgeServer\n ? {\n 'process.env.__NEXT_EDGE_PROJECT_DIR': isTurbopack\n ? path.relative(process.cwd(), projectPath)\n : projectPath,\n }\n : {}),\n 'process.env.__NEXT_BASE_PATH': config.basePath,\n 'process.env.__NEXT_CASE_SENSITIVE_ROUTES': Boolean(\n config.experimental.caseSensitiveRoutes\n ),\n 'process.env.__NEXT_REWRITES': rewrites as any,\n 'process.env.__NEXT_TRAILING_SLASH': config.trailingSlash,\n 'process.env.__NEXT_DEV_INDICATOR': config.devIndicators !== false,\n 'process.env.__NEXT_DEV_INDICATOR_POSITION':\n config.devIndicators === false\n ? 'bottom-left' // This will not be used as the indicator is disabled.\n : (config.devIndicators.position ?? 'bottom-left'),\n 'process.env.__NEXT_STRICT_MODE':\n config.reactStrictMode === null ? false : config.reactStrictMode,\n 'process.env.__NEXT_STRICT_MODE_APP':\n // When next.config.js does not have reactStrictMode it's enabled by default.\n config.reactStrictMode === null ? true : config.reactStrictMode,\n 'process.env.__NEXT_OPTIMIZE_CSS':\n (config.experimental.optimizeCss && !dev) ?? false,\n 'process.env.__NEXT_SCRIPT_WORKERS':\n (config.experimental.nextScriptWorkers && !dev) ?? false,\n 'process.env.__NEXT_SCROLL_RESTORATION':\n config.experimental.scrollRestoration ?? false,\n ...getImageConfig(config, dev),\n 'process.env.__NEXT_ROUTER_BASEPATH': config.basePath,\n 'process.env.__NEXT_HAS_REWRITES': hasRewrites,\n 'process.env.__NEXT_CONFIG_OUTPUT': config.output,\n 'process.env.__NEXT_I18N_SUPPORT': !!config.i18n,\n 'process.env.__NEXT_I18N_DOMAINS': config.i18n?.domains ?? false,\n 'process.env.__NEXT_I18N_CONFIG': config.i18n || '',\n 'process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE':\n config.skipProxyUrlNormalize,\n 'process.env.__NEXT_EXTERNAL_MIDDLEWARE_REWRITE_RESOLVE':\n config.experimental.externalProxyRewritesResolve ?? false,\n 'process.env.__NEXT_MANUAL_TRAILING_SLASH':\n config.skipTrailingSlashRedirect,\n 'process.env.__NEXT_HAS_WEB_VITALS_ATTRIBUTION':\n (config.experimental.webVitalsAttribution &&\n config.experimental.webVitalsAttribution.length > 0) ??\n false,\n 'process.env.__NEXT_WEB_VITALS_ATTRIBUTION':\n config.experimental.webVitalsAttribution ?? false,\n 'process.env.__NEXT_LINK_NO_TOUCH_START':\n config.experimental.linkNoTouchStart ?? false,\n 'process.env.__NEXT_ASSET_PREFIX': config.assetPrefix,\n 'process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS':\n !!config.experimental.authInterrupts,\n 'process.env.__NEXT_TELEMETRY_DISABLED': Boolean(\n process.env.NEXT_TELEMETRY_DISABLED\n ),\n ...(isNodeServer || isEdgeServer\n ? {\n // Fix bad-actors in the npm ecosystem (e.g. `node-formidable`)\n // This is typically found in unmaintained modules from the\n // pre-webpack era (common in server-side code)\n 'global.GENTLY': false,\n }\n : undefined),\n ...(isNodeServer || isEdgeServer\n ? {\n 'process.env.__NEXT_EXPERIMENTAL_REACT':\n needsExperimentalReact(config),\n }\n : undefined),\n\n 'process.env.__NEXT_MULTI_ZONE_DRAFT_MODE':\n config.experimental.multiZoneDraftMode ?? false,\n 'process.env.__NEXT_TRUST_HOST_HEADER':\n config.experimental.trustHostHeader ?? false,\n 'process.env.__NEXT_ALLOWED_REVALIDATE_HEADERS':\n config.experimental.allowedRevalidateHeaderKeys ?? [],\n ...(isNodeServer || isEdgeServer\n ? {\n 'process.env.__NEXT_RELATIVE_DIST_DIR': config.distDir,\n 'process.env.__NEXT_RELATIVE_PROJECT_DIR': path.relative(\n process.cwd(),\n projectPath\n ),\n }\n : {}),\n\n 'process.env.__NEXT_BROWSER_DEBUG_INFO_IN_TERMINAL': JSON.stringify(\n (config.logging && config.logging.browserToTerminal) || false\n ),\n 'process.env.__NEXT_MCP_SERVER': !!config.experimental.mcpServer,\n\n // The devtools need to know whether or not to show an option to clear the\n // bundler cache. This option may be removed later once Turbopack's\n // filesystem cache feature is more stable.\n //\n // This environment value is currently best-effort:\n // - It's possible to disable the webpack filesystem cache, but it's\n // unlikely for a user to do that.\n // - Rspack's filesystem cache is unstable and requires a different\n // configuration than webpack to enable (which we don't do).\n //\n // In the worst case we'll show an option to clear the cache, but it'll be a\n // no-op that just restarts the development server.\n 'process.env.__NEXT_BUNDLER_HAS_PERSISTENT_CACHE':\n !isTurbopack ||\n (config.experimental.turbopackFileSystemCacheForDev ?? false),\n 'process.env.__NEXT_REACT_DEBUG_CHANNEL':\n config.experimental.reactDebugChannel ?? false,\n 'process.env.__NEXT_TRANSITION_INDICATOR':\n config.experimental.transitionIndicator ?? false,\n 'process.env.__NEXT_GESTURE_TRANSITION':\n config.experimental.gestureTransition ?? false,\n 'process.env.__NEXT_OPTIMISTIC_ROUTING':\n config.experimental.optimisticRouting ?? false,\n 'process.env.__NEXT_APP_SHELLS': config.experimental.appShells ?? false,\n 'process.env.__NEXT_VARY_PARAMS': config.experimental.varyParams ?? false,\n 'process.env.__NEXT_EXPOSE_TESTING_API':\n dev || config.experimental.exposeTestingApiInProductionBuild === true,\n 'process.env.__NEXT_CACHE_LIFE': config.cacheLife,\n 'process.env.__NEXT_CLIENT_PARAM_PARSING_ORIGINS':\n config.experimental.clientParamParsingOrigins || [],\n }\n\n const userDefines = config.compiler?.define ?? {}\n for (const key in userDefines) {\n if (defineEnv.hasOwnProperty(key)) {\n throw new Error(\n `The \\`compiler.define\\` option is configured to replace the \\`${key}\\` variable. This variable is either part of a Next.js built-in or is already configured.`\n )\n }\n defineEnv[key] = userDefines[key]\n }\n\n if (isNodeServer || isEdgeServer) {\n const userDefinesServer = config.compiler?.defineServer ?? {}\n for (const key in userDefinesServer) {\n if (defineEnv.hasOwnProperty(key)) {\n throw new Error(\n `The \\`compiler.defineServer\\` option is configured to replace the \\`${key}\\` variable. This variable is either part of a Next.js built-in or is already configured.`\n )\n }\n defineEnv[key] = userDefinesServer[key]\n }\n }\n\n const serializedDefineEnv = serializeDefineEnv(defineEnv)\n\n // we delay inlining these values until after the build\n // with flying shuttle enabled so we can update them\n // without invalidating entries\n if (!dev && omitNonDeterministic) {\n // client uses window. instead of leaving process.env\n // in case process isn't polyfilled on client already\n // since by this point it won't be added by webpack\n const safeKey = (key: string) =>\n isClient ? `window.${key.split('.').pop()}` : key\n\n for (const key in nextPublicEnv) {\n serializedDefineEnv[key] = safeKey(key)\n }\n for (const key in nextConfigEnv) {\n serializedDefineEnv[key] = safeKey(key)\n }\n if (!config.experimental.runtimeServerDeploymentId) {\n for (const key of ['process.env.NEXT_DEPLOYMENT_ID']) {\n serializedDefineEnv[key] = safeKey(key)\n }\n }\n }\n\n return serializedDefineEnv\n}\n"],"names":["path","needsExperimentalReact","checkIsAppPPREnabled","getNextConfigEnv","getNextPublicEnvironmentVariables","DEFINE_ENV_EXPRESSION","Symbol","serializeDefineEnv","defineEnv","defineEnvStringified","Object","fromEntries","entries","map","key","value","JSON","stringify","getImageConfig","config","dev","deviceSizes","images","imageSizes","qualities","loader","dangerouslyAllowSVG","unoptimized","domains","remotePatterns","localPatterns","output","getDefineEnv","isTurbopack","clientRouterFilters","distDir","projectPath","fetchCacheKeyPrefix","hasRewrites","isClient","isEdgeServer","isNodeServer","middlewareMatchers","omitNonDeterministic","rewrites","nextPublicEnv","nextConfigEnv","isPPREnabled","experimental","ppr","isCacheComponentsEnabled","cacheComponents","isUseCacheEnabled","useCache","__NEXT_DEFINE_ENV","EdgeRuntime","process","env","NEXT_EDGE_RUNTIME_PROVIDER","NEXT_RSPACK","allowDevelopmentBuild","NEXT_PRIVATE_DISABLE_DEV_OVERLAY_UX","Boolean","appNavFailHandling","appNewScrollHandler","cachedNavigations","supportsImmutableAssets","useSkewCookie","deploymentId","runtimeServerDeploymentId","__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING","manualClientBasePath","isNaN","Number","staleTimes","dynamic","static","clientRouterFilter","staticFilter","dynamicFilter","validateRSCRequestHeaders","dynamicOnHover","useOffline","prefetchInlining","optimisticClientCache","proxyPrefetch","crossOrigin","__NEXT_TEST_MODE","relative","cwd","basePath","caseSensitiveRoutes","trailingSlash","devIndicators","position","reactStrictMode","optimizeCss","nextScriptWorkers","scrollRestoration","i18n","skipProxyUrlNormalize","externalProxyRewritesResolve","skipTrailingSlashRedirect","webVitalsAttribution","length","linkNoTouchStart","assetPrefix","authInterrupts","NEXT_TELEMETRY_DISABLED","undefined","multiZoneDraftMode","trustHostHeader","allowedRevalidateHeaderKeys","logging","browserToTerminal","mcpServer","turbopackFileSystemCacheForDev","reactDebugChannel","transitionIndicator","gestureTransition","optimisticRouting","appShells","varyParams","exposeTestingApiInProductionBuild","cacheLife","clientParamParsingOrigins","userDefines","compiler","define","hasOwnProperty","Error","userDefinesServer","defineServer","serializedDefineEnv","safeKey","split","pop"],"mappings":"AAOA,OAAOA,UAAU,YAAW;AAC5B,SAASC,sBAAsB,QAAQ,kCAAiC;AACxE,SAASC,oBAAoB,QAAQ,iCAAgC;AACrE,SACEC,gBAAgB,EAChBC,iCAAiC,QAC5B,oBAAmB;AA8B1B,MAAMC,wBAAwBC,OAAO;AAoBrC;;CAEC,GACD,SAASC,mBAAmBC,SAAoB;IAC9C,MAAMC,uBAA4CC,OAAOC,WAAW,CAClED,OAAOE,OAAO,CAACJ,WAAWK,GAAG,CAAC,CAAC,CAACC,KAAKC,MAAM,GAAK;YAC9CD;YACA,OAAOC,UAAU,YAAYV,yBAAyBU,QAClDA,KAAK,CAACV,sBAAsB,GAC5BW,KAAKC,SAAS,CAACF;SACpB;IAEH,OAAON;AACT;AAEA,SAASS,eACPC,MAA0B,EAC1BC,GAAY;QAUKD,gBAKSA,iBACDA;IAdzB,OAAO;QACL,iCAAiC;YAC/BE,aAAaF,OAAOG,MAAM,CAACD,WAAW;YACtCE,YAAYJ,OAAOG,MAAM,CAACC,UAAU;YACpCC,WAAWL,OAAOG,MAAM,CAACE,SAAS;YAClCxB,MAAMmB,OAAOG,MAAM,CAACtB,IAAI;YACxByB,QAAQN,OAAOG,MAAM,CAACG,MAAM;YAC5BC,qBAAqBP,OAAOG,MAAM,CAACI,mBAAmB;YACtDC,WAAW,EAAER,2BAAAA,iBAAAA,O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MA,OAAO+B,cAAe;YAC/BwF,mBAAmB,CAACvH,IAAI,GAAGwH,QAAQxH;QACrC;QACA,IAAK,MAAMA,OAAOgC,cAAe;YAC/BuF,mBAAmB,CAACvH,IAAI,GAAGwH,QAAQxH;QACrC;QACA,IAAI,CAACK,OAAO6B,YAAY,CAACqB,yBAAyB,EAAE;YAClD,KAAK,MAAMvD,OAAO;gBAAC;aAAiC,CAAE;gBACpDuH,mBAAmB,CAACvH,IAAI,GAAGwH,QAAQxH;YACrC;QACF;IACF;IAEA,OAAOuH;AACT","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/build/define-env.ts"],"sourcesContent":["import type {\n I18NConfig,\n I18NDomains,\n NextConfigComplete,\n} from '../server/config-shared'\nimport type { ProxyMatcher } from './analysis/get-page-static-info'\nimport type { Rewrite } from '../lib/load-custom-routes'\nimport path from 'node:path'\nimport { needsExperimentalReact } from '../lib/needs-experimental-react'\nimport { checkIsAppPPREnabled } from '../server/lib/experimental/ppr'\nimport {\n getNextConfigEnv,\n getNextPublicEnvironmentVariables,\n} from '../lib/static-env'\n\ntype BloomFilter = ReturnType<\n import('../shared/lib/bloom-filter').BloomFilter['export']\n>\n\nexport interface DefineEnvOptions {\n isTurbopack: boolean\n clientRouterFilters?: {\n staticFilter: BloomFilter\n dynamicFilter: BloomFilter\n }\n config: NextConfigComplete\n dev: boolean\n distDir: string\n projectPath: string\n fetchCacheKeyPrefix: string | undefined\n hasRewrites: boolean\n isClient: boolean\n isEdgeServer: boolean\n isNodeServer: boolean\n middlewareMatchers: ProxyMatcher[] | undefined\n omitNonDeterministic?: boolean\n rewrites: {\n beforeFiles: Rewrite[]\n afterFiles: Rewrite[]\n fallback: Rewrite[]\n }\n}\n\nconst DEFINE_ENV_EXPRESSION = Symbol('DEFINE_ENV_EXPRESSION')\n\ninterface DefineEnv {\n [key: string]:\n | string\n | number\n | string[]\n | boolean\n | { [DEFINE_ENV_EXPRESSION]: string }\n | ProxyMatcher[]\n | BloomFilter\n | Partial<NextConfigComplete['images']>\n | I18NDomains\n | I18NConfig\n}\n\ninterface SerializedDefineEnv {\n [key: string]: string\n}\n\n/**\n * Serializes the DefineEnv config so that it can be inserted into the code by Webpack/Turbopack, JSON stringifies each value.\n */\nfunction serializeDefineEnv(defineEnv: DefineEnv): SerializedDefineEnv {\n const defineEnvStringified: SerializedDefineEnv = Object.fromEntries(\n Object.entries(defineEnv).map(([key, value]) => [\n key,\n typeof value === 'object' && DEFINE_ENV_EXPRESSION in value\n ? value[DEFINE_ENV_EXPRESSION]\n : JSON.stringify(value),\n ])\n )\n return defineEnvStringified\n}\n\nfunction getImageConfig(\n config: NextConfigComplete,\n dev: boolean\n): { 'process.env.__NEXT_IMAGE_OPTS': Partial<NextConfigComplete['images']> } {\n return {\n 'process.env.__NEXT_IMAGE_OPTS': {\n deviceSizes: config.images.deviceSizes,\n imageSizes: config.images.imageSizes,\n qualities: config.images.qualities,\n path: config.images.path,\n loader: config.images.loader,\n dangerouslyAllowSVG: config.images.dangerouslyAllowSVG,\n unoptimized: config?.images?.unoptimized,\n ...(dev\n ? {\n // additional config in dev to allow validating on the client\n domains: config.images.domains,\n remotePatterns: config.images?.remotePatterns,\n localPatterns: config.images?.localPatterns,\n output: config.output,\n }\n : {}),\n },\n }\n}\n\nexport function getDefineEnv({\n isTurbopack,\n clientRouterFilters,\n config,\n dev,\n distDir,\n projectPath,\n fetchCacheKeyPrefix,\n hasRewrites,\n isClient,\n isEdgeServer,\n isNodeServer,\n middlewareMatchers,\n omitNonDeterministic,\n rewrites,\n}: DefineEnvOptions): SerializedDefineEnv {\n const nextPublicEnv = getNextPublicEnvironmentVariables()\n const nextConfigEnv = getNextConfigEnv(config)\n\n const isPPREnabled = checkIsAppPPREnabled(config.experimental.ppr)\n const isCacheComponentsEnabled = !!config.cacheComponents\n const isUseCacheEnabled = !!config.experimental.useCache\n\n const defineEnv: DefineEnv = {\n // internal field to identify the plugin config\n __NEXT_DEFINE_ENV: true,\n\n ...nextPublicEnv,\n ...nextConfigEnv,\n ...(!isEdgeServer\n ? {}\n : {\n EdgeRuntime:\n /**\n * Cloud providers can set this environment variable to allow users\n * and library authors to have different implementations based on\n * the runtime they are running with, if it's not using `edge-runtime`\n */\n process.env.NEXT_EDGE_RUNTIME_PROVIDER ?? 'edge-runtime',\n\n // process should be only { env: {...} } for edge runtime.\n // For ignore avoid warn on `process.emit` usage but directly omit it.\n 'process.emit': false,\n }),\n 'process.turbopack': isTurbopack,\n 'process.env.TURBOPACK': isTurbopack,\n 'process.env.__NEXT_BUNDLER': isTurbopack\n ? 'Turbopack'\n : process.env.NEXT_RSPACK\n ? 'Rspack'\n : 'Webpack',\n // TODO: enforce `NODE_ENV` on `process.env`, and add a test:\n 'process.env.NODE_ENV':\n dev || config.experimental.allowDevelopmentBuild\n ? 'development'\n : 'production',\n 'process.env.__NEXT_DEV_SERVER': dev ? '1' : '',\n 'process.env.__NEXT_DISABLE_DEV_OVERLAY_UX':\n process.env.NEXT_PRIVATE_DISABLE_DEV_OVERLAY_UX === '1',\n 'process.env.NEXT_RUNTIME': isEdgeServer\n ? 'edge'\n : isNodeServer\n ? 'nodejs'\n : '',\n 'process.env.NEXT_MINIMAL': '',\n 'process.env.__NEXT_APP_NAV_FAIL_HANDLING': Boolean(\n config.experimental.appNavFailHandling\n ),\n 'process.env.__NEXT_APP_NEW_SCROLL_HANDLER': Boolean(\n config.experimental.appNewScrollHandler\n ),\n 'process.env.__NEXT_PPR': isPPREnabled,\n 'process.env.__NEXT_CACHE_COMPONENTS': isCacheComponentsEnabled,\n 'process.env.__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS': Boolean(\n config.experimental.cachedNavigations\n ),\n 'process.env.__NEXT_INSTANT_NAV_TOGGLE': isCacheComponentsEnabled,\n 'process.env.__NEXT_USE_CACHE': isUseCacheEnabled,\n 'process.env.__NEXT_USE_NODE_STREAMS': isEdgeServer ? false : true,\n\n 'process.env.NEXT_SUPPORTS_IMMUTABLE_ASSETS':\n config.experimental.supportsImmutableAssets || false,\n\n ...(config.experimental?.useSkewCookie || !config.deploymentId\n ? {\n 'process.env.NEXT_DEPLOYMENT_ID': false,\n }\n : isClient\n ? isTurbopack\n ? {\n // This is set at runtime by packages/next/src/client/register-deployment-id-global.ts\n 'process.env.NEXT_DEPLOYMENT_ID': {\n [DEFINE_ENV_EXPRESSION]: 'globalThis.NEXT_DEPLOYMENT_ID',\n },\n }\n : {\n // For Webpack, we currently don't use the non-inlining globalThis.NEXT_DEPLOYMENT_ID\n // approach because we cannot forward this global variable to web workers easily.\n 'process.env.NEXT_DEPLOYMENT_ID': config.deploymentId || false,\n }\n : config.experimental?.runtimeServerDeploymentId\n ? {\n // Don't inline at all, keep process.env.NEXT_DEPLOYMENT_ID as is\n }\n : {\n 'process.env.NEXT_DEPLOYMENT_ID': config.deploymentId || false,\n }),\n\n // Propagates the `__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING` environment\n // variable to the client.\n 'process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING':\n process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING || false,\n 'process.env.__NEXT_FETCH_CACHE_KEY_PREFIX': fetchCacheKeyPrefix ?? '',\n ...(isTurbopack\n ? {}\n : {\n 'process.env.__NEXT_MIDDLEWARE_MATCHERS': middlewareMatchers ?? [],\n }),\n 'process.env.__NEXT_MANUAL_CLIENT_BASE_PATH':\n config.experimental.manualClientBasePath ?? false,\n 'process.env.__NEXT_CLIENT_ROUTER_DYNAMIC_STALETIME': JSON.stringify(\n isNaN(Number(config.experimental.staleTimes?.dynamic))\n ? 0\n : config.experimental.staleTimes?.dynamic\n ),\n 'process.env.__NEXT_CLIENT_ROUTER_STATIC_STALETIME': JSON.stringify(\n isNaN(Number(config.experimental.staleTimes?.static))\n ? 5 * 60 // 5 minutes\n : config.experimental.staleTimes?.static\n ),\n 'process.env.__NEXT_CLIENT_ROUTER_FILTER_ENABLED':\n config.experimental.clientRouterFilter ?? true,\n 'process.env.__NEXT_CLIENT_ROUTER_S_FILTER':\n clientRouterFilters?.staticFilter ?? false,\n 'process.env.__NEXT_CLIENT_ROUTER_D_FILTER':\n clientRouterFilters?.dynamicFilter ?? false,\n 'process.env.__NEXT_CLIENT_VALIDATE_RSC_REQUEST_HEADERS': Boolean(\n config.experimental.validateRSCRequestHeaders\n ),\n 'process.env.__NEXT_DYNAMIC_ON_HOVER': Boolean(\n config.experimental.dynamicOnHover\n ),\n 'process.env.__NEXT_USE_OFFLINE': Boolean(config.experimental.useOffline),\n 'process.env.__NEXT_PREFETCH_INLINING': Boolean(\n config.experimental.prefetchInlining\n ),\n 'process.env.__NEXT_OPTIMISTIC_CLIENT_CACHE':\n config.experimental.optimisticClientCache ?? true,\n 'process.env.__NEXT_MIDDLEWARE_PREFETCH':\n config.experimental.proxyPrefetch ?? 'flexible',\n 'process.env.__NEXT_CROSS_ORIGIN': config.crossOrigin,\n 'process.browser': isClient,\n 'process.env.__NEXT_TEST_MODE': process.env.__NEXT_TEST_MODE ?? false,\n // This is used in client/dev-error-overlay/hot-dev-client.js to replace the dist directory\n ...(dev && (isClient ?? isEdgeServer)\n ? {\n 'process.env.__NEXT_DIST_DIR': distDir,\n }\n : {}),\n // This is used in devtools to strip the project path in edge runtime,\n // as there's only a dummy `dir` value (`.`) as edge runtime doesn't have concept of file system.\n ...(dev && isEdgeServer\n ? {\n 'process.env.__NEXT_EDGE_PROJECT_DIR': isTurbopack\n ? path.relative(process.cwd(), projectPath)\n : projectPath,\n }\n : {}),\n 'process.env.__NEXT_BASE_PATH': config.basePath,\n 'process.env.__NEXT_CASE_SENSITIVE_ROUTES': Boolean(\n config.experimental.caseSensitiveRoutes\n ),\n 'process.env.__NEXT_REWRITES': rewrites as any,\n 'process.env.__NEXT_TRAILING_SLASH': config.trailingSlash,\n 'process.env.__NEXT_DEV_INDICATOR': config.devIndicators !== false,\n 'process.env.__NEXT_DEV_INDICATOR_POSITION':\n config.devIndicators === false\n ? 'bottom-left' // This will not be used as the indicator is disabled.\n : (config.devIndicators.position ?? 'bottom-left'),\n 'process.env.__NEXT_STRICT_MODE':\n config.reactStrictMode === null ? false : config.reactStrictMode,\n 'process.env.__NEXT_STRICT_MODE_APP':\n // When next.config.js does not have reactStrictMode it's enabled by default.\n config.reactStrictMode === null ? true : config.reactStrictMode,\n 'process.env.__NEXT_OPTIMIZE_CSS':\n (config.experimental.optimizeCss && !dev) ?? false,\n 'process.env.__NEXT_SCRIPT_WORKERS':\n (config.experimental.nextScriptWorkers && !dev) ?? false,\n 'process.env.__NEXT_SCROLL_RESTORATION':\n config.experimental.scrollRestoration ?? false,\n ...getImageConfig(config, dev),\n 'process.env.__NEXT_ROUTER_BASEPATH': config.basePath,\n 'process.env.__NEXT_HAS_REWRITES': hasRewrites,\n 'process.env.__NEXT_CONFIG_OUTPUT': config.output,\n 'process.env.__NEXT_I18N_SUPPORT': !!config.i18n,\n 'process.env.__NEXT_I18N_DOMAINS': config.i18n?.domains ?? false,\n 'process.env.__NEXT_I18N_CONFIG': config.i18n || '',\n 'process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE':\n config.skipProxyUrlNormalize,\n 'process.env.__NEXT_EXTERNAL_MIDDLEWARE_REWRITE_RESOLVE':\n config.experimental.externalProxyRewritesResolve ?? false,\n 'process.env.__NEXT_MANUAL_TRAILING_SLASH':\n config.skipTrailingSlashRedirect,\n 'process.env.__NEXT_HAS_WEB_VITALS_ATTRIBUTION':\n (config.experimental.webVitalsAttribution &&\n config.experimental.webVitalsAttribution.length > 0) ??\n false,\n 'process.env.__NEXT_WEB_VITALS_ATTRIBUTION':\n config.experimental.webVitalsAttribution ?? false,\n 'process.env.__NEXT_LINK_NO_TOUCH_START':\n config.experimental.linkNoTouchStart ?? false,\n 'process.env.__NEXT_ASSET_PREFIX': config.assetPrefix,\n 'process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS':\n !!config.experimental.authInterrupts,\n 'process.env.__NEXT_TELEMETRY_DISABLED': Boolean(\n process.env.NEXT_TELEMETRY_DISABLED\n ),\n ...(isNodeServer || isEdgeServer\n ? {\n // Fix bad-actors in the npm ecosystem (e.g. `node-formidable`)\n // This is typically found in unmaintained modules from the\n // pre-webpack era (common in server-side code)\n 'global.GENTLY': false,\n }\n : undefined),\n ...(isNodeServer || isEdgeServer\n ? {\n 'process.env.__NEXT_EXPERIMENTAL_REACT':\n needsExperimentalReact(config),\n }\n : undefined),\n\n 'process.env.__NEXT_MULTI_ZONE_DRAFT_MODE':\n config.experimental.multiZoneDraftMode ?? false,\n 'process.env.__NEXT_TRUST_HOST_HEADER':\n config.experimental.trustHostHeader ?? false,\n 'process.env.__NEXT_ALLOWED_REVALIDATE_HEADERS':\n config.experimental.allowedRevalidateHeaderKeys ?? [],\n ...(isNodeServer || isEdgeServer\n ? {\n 'process.env.__NEXT_RELATIVE_DIST_DIR': config.distDir,\n 'process.env.__NEXT_RELATIVE_PROJECT_DIR': path.relative(\n process.cwd(),\n projectPath\n ),\n }\n : {}),\n\n 'process.env.__NEXT_BROWSER_DEBUG_INFO_IN_TERMINAL': JSON.stringify(\n (config.logging && config.logging.browserToTerminal) || false\n ),\n 'process.env.__NEXT_MCP_SERVER': !!config.experimental.mcpServer,\n\n // The devtools need to know whether or not to show an option to clear the\n // bundler cache. This option may be removed later once Turbopack's\n // filesystem cache feature is more stable.\n //\n // This environment value is currently best-effort:\n // - It's possible to disable the webpack filesystem cache, but it's\n // unlikely for a user to do that.\n // - Rspack's filesystem cache is unstable and requires a different\n // configuration than webpack to enable (which we don't do).\n //\n // In the worst case we'll show an option to clear the cache, but it'll be a\n // no-op that just restarts the development server.\n 'process.env.__NEXT_BUNDLER_HAS_PERSISTENT_CACHE':\n !isTurbopack ||\n (config.experimental.turbopackFileSystemCacheForDev ?? false),\n 'process.env.__NEXT_REACT_DEBUG_CHANNEL':\n config.experimental.reactDebugChannel ?? false,\n 'process.env.__NEXT_TRANSITION_INDICATOR':\n config.experimental.transitionIndicator ?? false,\n 'process.env.__NEXT_GESTURE_TRANSITION':\n config.experimental.gestureTransition ?? false,\n 'process.env.__NEXT_OPTIMISTIC_ROUTING':\n config.experimental.optimisticRouting ?? false,\n 'process.env.__NEXT_INSTRUMENTATION_CLIENT_ROUTER_TRANSITION_EVENTS':\n config.experimental.instrumentationClientRouterTransitionEvents ?? false,\n 'process.env.__NEXT_APP_SHELLS': config.experimental.appShells ?? false,\n 'process.env.__NEXT_VARY_PARAMS': config.experimental.varyParams ?? false,\n 'process.env.__NEXT_EXPOSE_TESTING_API':\n dev || config.experimental.exposeTestingApiInProductionBuild === true,\n 'process.env.__NEXT_CACHE_LIFE': config.cacheLife,\n 'process.env.__NEXT_CLIENT_PARAM_PARSING_ORIGINS':\n config.experimental.clientParamParsingOrigins || [],\n }\n\n const userDefines = config.compiler?.define ?? {}\n for (const key in userDefines) {\n if (defineEnv.hasOwnProperty(key)) {\n throw new Error(\n `The \\`compiler.define\\` option is configured to replace the \\`${key}\\` variable. This variable is either part of a Next.js built-in or is already configured.`\n )\n }\n defineEnv[key] = userDefines[key]\n }\n\n if (isNodeServer || isEdgeServer) {\n const userDefinesServer = config.compiler?.defineServer ?? {}\n for (const key in userDefinesServer) {\n if (defineEnv.hasOwnProperty(key)) {\n throw new Error(\n `The \\`compiler.defineServer\\` option is configured to replace the \\`${key}\\` variable. This variable is either part of a Next.js built-in or is already configured.`\n )\n }\n defineEnv[key] = userDefinesServer[key]\n }\n }\n\n const serializedDefineEnv = serializeDefineEnv(defineEnv)\n\n // we delay inlining these values until after the build\n // with flying shuttle enabled so we can update them\n // without invalidating entries\n if (!dev && omitNonDeterministic) {\n // client uses window. instead of leaving process.env\n // in case process isn't polyfilled on client already\n // since by this point it won't be added by webpack\n const safeKey = (key: string) =>\n isClient ? `window.${key.split('.').pop()}` : key\n\n for (const key in nextPublicEnv) {\n serializedDefineEnv[key] = safeKey(key)\n }\n for (const key in nextConfigEnv) {\n serializedDefineEnv[key] = safeKey(key)\n }\n if (!config.experimental.runtimeServerDeploymentId) {\n for (const key of ['process.env.NEXT_DEPLOYMENT_ID']) {\n serializedDefineEnv[key] = safeKey(key)\n }\n }\n }\n\n return serializedDefineEnv\n}\n"],"names":["path","needsExperimentalReact","checkIsAppPPREnabled","getNextConfigEnv","getNextPublicEnvironmentVariables","DEFINE_ENV_EXPRESSION","Symbol","serializeDefineEnv","defineEnv","defineEnvStringified","Object","fromEntries","entries","map","key","value","JSON","stringify","getImageConfig","config","dev","deviceSizes","images","imageSizes","qualities","loader","dangerouslyAllowSVG","unoptimized","domains","remotePatterns","localPatterns","output","getDefineEnv","isTurbopack","clientRouterFilters","distDir","projectPath","fetchCacheKeyPrefix","hasRewrites","isClient","isEdgeServer","isNodeServer","middlewareMatchers","omitNonDeterministic","rewrites","nextPublicEnv","nextConfigEnv","isPPREnabled","experimental","ppr","isCacheComponentsEnabled","cacheComponents","isUseCacheEnabled","useCache","__NEXT_DEFINE_ENV","EdgeRuntime","process","env","NEXT_EDGE_RUNTIME_PROVIDER","NEXT_RSPACK","allowDevelopmentBuild","NEXT_PRIVATE_DISABLE_DEV_OVERLAY_UX","Boolean","appNavFailHandling","appNewScrollHandler","cachedNavigations","supportsImmutableAssets","useSkewCookie","deploymentId","runtimeServerDeploymentId","__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING","manualClientBasePath","isNaN","Number","staleTimes","dynamic","static","clientRouterFilter","staticFilter","dynamicFilter","validateRSCRequestHeaders","dynamicOnHover","useOffline","prefetchInlining","optimisticClientCache","proxyPrefetch","crossOrigin","__NEXT_TEST_MODE","relative","cwd","basePath","caseSensitiveRoutes","trailingSlash","devIndicators","position","reactStrictMode","optimizeCss","nextScriptWorkers","scrollRestoration","i18n","skipProxyUrlNormalize","externalProxyRewritesResolve","skipTrailingSlashRedirect","webVitalsAttribution","length","linkNoTouchStart","assetPrefix","authInterrupts","NEXT_TELEMETRY_DISABLED","undefined","multiZoneDraftMode","trustHostHeader","allowedRevalidateHeaderKeys","logging","browserToTerminal","mcpServer","turbopackFileSystemCacheForDev","reactDebugChannel","transitionIndicator","gestureTransition","optimisticRouting","instrumentationClientRouterTransitionEvents","appShells","varyParams","exposeTestingApiInProductionBuild","cacheLife","clientParamParsingOrigins","userDefines","compiler","define","hasOwnProperty","Error","userDefinesServer","defineServer","serializedDefineEnv","safeKey","split","pop"],"mappings":"AAOA,OAAOA,UAAU,YAAW;AAC5B,SAASC,sBAAsB,QAAQ,kCAAiC;AACxE,SAASC,oBAAoB,QAAQ,iCAAgC;AACrE,SACEC,gBAAgB,EAChBC,iCAAiC,QAC5B,oBAAmB;AA8B1B,MAAMC,wBAAwBC,OAAO;AAoBrC;;CAEC,GACD,SAASC,mBAAmBC,SAAoB;IAC9C,MAAMC,uBAA4CC,OAAOC,WAAW,CAClED,OAAOE,OAAO,CAACJ,WAAWK,GAAG,CAAC,CAAC,CAACC,KAAKC,MAAM,GAAK;YAC9CD;YACA,OAAOC,UAAU,YAAYV,yBAAyBU,QAClDA,KAAK,CAACV,sBAAsB,GAC5BW,KAAKC,SAAS,CAACF;SACpB;IAEH,OAAON;AACT;AAEA,SAASS,eACPC,MAA0B,EAC1BC,GAAY;QAUKD,gBAKSA,iBACDA;IAdzB,OAAO;QACL,iCAAiC;YAC/BE,aAAaF,OAAOG,MAAM,CAACD,WAAW;YACtCE,YAAYJ,OAAOG,MAAM,CAACC,UAAU;YACpCC,WAAWL,OAAOG,MAAM,CAACE,SAAS;YAClCxB,MAAMmB,OAAOG,MAAM,CAACtB,IAAI;YACxByB,QAAQN,OAAOG,MAAM,CAACG,MAAM;YAC5BC,qBAAqBP,OAAOG,MAAM,CAACI,mBAAmB;YACtDC,WAAW,EAAER,2BAAAA,iBAAAA,OAAQG,MAAM,qBAAdH,eAAgBQ,WAAW;YACxC,GAAIP,MACA;gBACE,6DAA6D;gBAC7DQ,SAAST,OAAOG,MAAM,CAACM,OAAO;gBAC9BC,cAAc,GAAEV,kBAAAA,OAAOG,MAAM,qBAAbH,gBAAeU,cAAc;gBAC7CC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AAGyH,QAAQzH;QACrC;QACA,IAAI,CAACK,OAAO6B,YAAY,CAACqB,yBAAyB,EAAE;YAClD,KAAK,MAAMvD,OAAO;gBAAC;aAAiC,CAAE;gBACpDwH,mBAAmB,CAACxH,IAAI,GAAGyH,QAAQzH;YACrC;QACF;IACF;IAEA,OAAOwH;AACT","ignoreList":[0]} |
@@ -14,3 +14,3 @@ import path from 'path'; | ||
| }({}); | ||
| const nextVersion = "16.3.0-canary.58"; | ||
| const nextVersion = "16.3.0-canary.59"; | ||
| const ArchName = arch(); | ||
@@ -17,0 +17,0 @@ const PlatformName = platform(); |
@@ -69,3 +69,3 @@ import path from 'path'; | ||
| isPersistentCachingEnabled: persistentCaching, | ||
| nextVersion: "16.3.0-canary.58" | ||
| nextVersion: "16.3.0-canary.59" | ||
| }, { | ||
@@ -72,0 +72,0 @@ turbopackMemoryEviction: config.experimental.turbopackMemoryEvictionMode, |
@@ -87,3 +87,3 @@ // Import cpu-profile first to start profiling early if enabled | ||
| deferredEntries: config.experimental.deferredEntries, | ||
| nextVersion: "16.3.0-canary.58" | ||
| nextVersion: "16.3.0-canary.59" | ||
| }; | ||
@@ -90,0 +90,0 @@ const sharedTurboOptions = { |
@@ -1,35 +0,18 @@ | ||
| import { promisify } from 'util'; | ||
| const NextInstrumentationClientLoader = function() { | ||
| const callback = this.async(); | ||
| const { injects: injectsStringified } = this.getOptions(); | ||
| const injects = JSON.parse(injectsStringified || '[]'); | ||
| // No injects: the alias is a transparent passthrough to the user's | ||
| // `instrumentation-client.{pageExt}` (or the empty module fallback). | ||
| if (injects.length === 0) { | ||
| callback(null, `module.exports = require('private-next-instrumentation-client-user');\n`); | ||
| return; | ||
| const NextInstrumentationClientLoader = async function() { | ||
| const { modules } = this.getOptions(); | ||
| if (modules.length === 0) { | ||
| return `module.exports = require('private-next-instrumentation-client-user');\n`; | ||
| } | ||
| // Resolve each inject specifier against the project root so the emitted | ||
| // Resolve each module specifier against the project root so the emitted | ||
| // `require()` calls don't get resolved relative to the stub's location | ||
| // inside `node_modules/next/`. Bare specifiers (npm package names) are | ||
| // resolved against the project's `node_modules`. | ||
| const resolve = promisify(this.resolve); | ||
| const resolve = this.getResolve(); | ||
| const rootContext = this.rootContext; | ||
| Promise.all(injects.map((spec)=>resolve(rootContext, spec))).then((resolvedInjects)=>{ | ||
| const allModules = [ | ||
| ...resolvedInjects, | ||
| 'private-next-instrumentation-client-user' | ||
| ]; | ||
| const lines = []; | ||
| allModules.forEach((spec, i)=>{ | ||
| lines.push(`var mod_${i} = require(${JSON.stringify(spec)});`); | ||
| }); | ||
| // Compose a single `onRouterTransitionStart` that fans out to every | ||
| // module's hook (when exported), in array order, with the user file's | ||
| // hook running last. | ||
| const hookCalls = allModules.map(// Webpack doesn't transpile this, so use a manual version of optional chaining. | ||
| (_, i)=>` mod_${i} && mod_${i}.onRouterTransitionStart && mod_${i}.onRouterTransitionStart(url, type);`).join('\n'); | ||
| lines.push(`module.exports = {`, ` onRouterTransitionStart: function (url, type) {`, hookCalls, ` },`, `};`); | ||
| callback(null, lines.join('\n') + '\n'); | ||
| }).catch((err)=>callback(err)); | ||
| const resolvedModules = await Promise.all(modules.map((spec)=>resolve(rootContext, spec))); | ||
| const allModules = [ | ||
| ...resolvedModules, | ||
| 'private-next-instrumentation-client-user' | ||
| ]; | ||
| return `module.exports = [${allModules.map((spec)=>`require(${JSON.stringify(spec)})`).join(',')}];\n`; | ||
| }; | ||
@@ -36,0 +19,0 @@ export default NextInstrumentationClientLoader; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../../src/build/webpack/loaders/next-instrumentation-client-loader.ts"],"sourcesContent":["import { promisify } from 'util'\nimport type { webpack } from 'next/dist/compiled/webpack/webpack'\n\n/**\n * Loader options for `next-instrumentation-client-loader`. The list of inject\n * specifiers is JSON-stringified so it can travel through the loader query\n * string.\n */\nexport type InstrumentationClientLoaderOptions = {\n /** JSON-stringified `string[]` of module specifiers. */\n injects: string\n}\n\nconst NextInstrumentationClientLoader: webpack.LoaderDefinitionFunction<InstrumentationClientLoaderOptions> =\n function () {\n const callback = this.async()\n const { injects: injectsStringified } = this.getOptions()\n const injects = JSON.parse(injectsStringified || '[]') as string[]\n\n // No injects: the alias is a transparent passthrough to the user's\n // `instrumentation-client.{pageExt}` (or the empty module fallback).\n if (injects.length === 0) {\n callback(\n null,\n `module.exports = require('private-next-instrumentation-client-user');\\n`\n )\n return\n }\n\n // Resolve each inject specifier against the project root so the emitted\n // `require()` calls don't get resolved relative to the stub's location\n // inside `node_modules/next/`. Bare specifiers (npm package names) are\n // resolved against the project's `node_modules`.\n const resolve = promisify(this.resolve)\n const rootContext = this.rootContext\n\n Promise.all(injects.map((spec) => resolve(rootContext, spec)))\n .then((resolvedInjects) => {\n const allModules = [\n ...resolvedInjects,\n 'private-next-instrumentation-client-user',\n ]\n\n const lines: string[] = []\n allModules.forEach((spec, i) => {\n lines.push(`var mod_${i} = require(${JSON.stringify(spec)});`)\n })\n\n // Compose a single `onRouterTransitionStart` that fans out to every\n // module's hook (when exported), in array order, with the user file's\n // hook running last.\n const hookCalls = allModules\n .map(\n // Webpack doesn't transpile this, so use a manual version of optional chaining.\n (_, i) =>\n ` mod_${i} && mod_${i}.onRouterTransitionStart && mod_${i}.onRouterTransitionStart(url, type);`\n )\n .join('\\n')\n\n lines.push(\n `module.exports = {`,\n ` onRouterTransitionStart: function (url, type) {`,\n hookCalls,\n ` },`,\n `};`\n )\n\n callback(null, lines.join('\\n') + '\\n')\n })\n .catch((err) => callback(err))\n }\n\nexport default NextInstrumentationClientLoader\n"],"names":["promisify","NextInstrumentationClientLoader","callback","async","injects","injectsStringified","getOptions","JSON","parse","length","resolve","rootContext","Promise","all","map","spec","then","resolvedInjects","allModules","lines","forEach","i","push","stringify","hookCalls","_","join","catch","err"],"mappings":"AAAA,SAASA,SAAS,QAAQ,OAAM;AAahC,MAAMC,kCACJ;IACE,MAAMC,WAAW,IAAI,CAACC,KAAK;IAC3B,MAAM,EAAEC,SAASC,kBAAkB,EAAE,GAAG,IAAI,CAACC,UAAU;IACvD,MAAMF,UAAUG,KAAKC,KAAK,CAACH,sBAAsB;IAEjD,mEAAmE;IACnE,qEAAqE;IACrE,IAAID,QAAQK,MAAM,KAAK,GAAG;QACxBP,SACE,MACA,CAAC,uEAAuE,CAAC;QAE3E;IACF;IAEA,wEAAwE;IACxE,uEAAuE;IACvE,uEAAuE;IACvE,iDAAiD;IACjD,MAAMQ,UAAUV,UAAU,IAAI,CAACU,OAAO;IACtC,MAAMC,cAAc,IAAI,CAACA,WAAW;IAEpCC,QAAQC,GAAG,CAACT,QAAQU,GAAG,CAAC,CAACC,OAASL,QAAQC,aAAaI,QACpDC,IAAI,CAAC,CAACC;QACL,MAAMC,aAAa;eACdD;YACH;SACD;QAED,MAAME,QAAkB,EAAE;QAC1BD,WAAWE,OAAO,CAAC,CAACL,MAAMM;YACxBF,MAAMG,IAAI,CAAC,CAAC,QAAQ,EAAED,EAAE,WAAW,EAAEd,KAAKgB,SAAS,CAACR,MAAM,EAAE,CAAC;QAC/D;QAEA,oEAAoE;QACpE,sEAAsE;QACtE,qBAAqB;QACrB,MAAMS,YAAYN,WACfJ,GAAG,CACF,gFAAgF;QAChF,CAACW,GAAGJ,IACF,CAAC,QAAQ,EAAEA,EAAE,QAAQ,EAAEA,EAAE,gCAAgC,EAAEA,EAAE,oCAAoC,CAAC,EAErGK,IAAI,CAAC;QAERP,MAAMG,IAAI,CACR,CAAC,kBAAkB,CAAC,EACpB,CAAC,iDAAiD,CAAC,EACnDE,WACA,CAAC,IAAI,CAAC,EACN,CAAC,EAAE,CAAC;QAGNtB,SAAS,MAAMiB,MAAMO,IAAI,CAAC,QAAQ;IACpC,GACCC,KAAK,CAAC,CAACC,MAAQ1B,SAAS0B;AAC7B;AAEF,eAAe3B,gCAA+B","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../../src/build/webpack/loaders/next-instrumentation-client-loader.ts"],"sourcesContent":["import type { webpack } from 'next/dist/compiled/webpack/webpack'\n\nexport type InstrumentationClientLoaderOptions = {\n modules: string[]\n}\n\nconst NextInstrumentationClientLoader: webpack.LoaderDefinitionFunction<InstrumentationClientLoaderOptions> =\n async function () {\n const { modules } = this.getOptions()\n\n if (modules.length === 0) {\n return `module.exports = require('private-next-instrumentation-client-user');\\n`\n }\n\n // Resolve each module specifier against the project root so the emitted\n // `require()` calls don't get resolved relative to the stub's location\n // inside `node_modules/next/`. Bare specifiers (npm package names) are\n // resolved against the project's `node_modules`.\n const resolve = this.getResolve()\n const rootContext = this.rootContext\n const resolvedModules = await Promise.all(\n modules.map((spec) => resolve(rootContext, spec))\n )\n const allModules = [\n ...resolvedModules,\n 'private-next-instrumentation-client-user',\n ]\n\n return `module.exports = [${allModules\n .map((spec) => `require(${JSON.stringify(spec)})`)\n .join(',')}];\\n`\n }\n\nexport default NextInstrumentationClientLoader\n"],"names":["NextInstrumentationClientLoader","modules","getOptions","length","resolve","getResolve","rootContext","resolvedModules","Promise","all","map","spec","allModules","JSON","stringify","join"],"mappings":"AAMA,MAAMA,kCACJ;IACE,MAAM,EAAEC,OAAO,EAAE,GAAG,IAAI,CAACC,UAAU;IAEnC,IAAID,QAAQE,MAAM,KAAK,GAAG;QACxB,OAAO,CAAC,uEAAuE,CAAC;IAClF;IAEA,wEAAwE;IACxE,uEAAuE;IACvE,uEAAuE;IACvE,iDAAiD;IACjD,MAAMC,UAAU,IAAI,CAACC,UAAU;IAC/B,MAAMC,cAAc,IAAI,CAACA,WAAW;IACpC,MAAMC,kBAAkB,MAAMC,QAAQC,GAAG,CACvCR,QAAQS,GAAG,CAAC,CAACC,OAASP,QAAQE,aAAaK;IAE7C,MAAMC,aAAa;WACdL;QACH;KACD;IAED,OAAO,CAAC,kBAAkB,EAAEK,WACzBF,GAAG,CAAC,CAACC,OAAS,CAAC,QAAQ,EAAEE,KAAKC,SAAS,CAACH,MAAM,CAAC,CAAC,EAChDI,IAAI,CAAC,KAAK,IAAI,CAAC;AACpB;AAEF,eAAef,gCAA+B","ignoreList":[0]} |
@@ -8,3 +8,3 @@ /** | ||
| import { setAttributesFromProps } from './set-attributes-from-props'; | ||
| const version = "16.3.0-canary.58"; | ||
| const version = "16.3.0-canary.59"; | ||
| window.next = { | ||
@@ -11,0 +11,0 @@ version, |
@@ -19,3 +19,3 @@ 'use client'; | ||
| } | ||
| function linkClicked(e, href, linkInstanceRef, replace, scroll, onNavigate, transitionTypes) { | ||
| function linkClicked(e, href, linkInstanceRef, replace, scroll, onNavigate, transitionTypes, prefetchIntent = 'none') { | ||
| if (typeof window !== 'undefined') { | ||
@@ -53,3 +53,3 @@ const { nodeName } = e.currentTarget; | ||
| React.startTransition(()=>{ | ||
| dispatchNavigateAction(href, replace ? 'replace' : 'push', scroll === false ? ScrollBehavior.NoScroll : ScrollBehavior.Default, linkInstanceRef.current, transitionTypes); | ||
| dispatchNavigateAction(href, replace ? 'replace' : 'push', scroll === false ? ScrollBehavior.NoScroll : ScrollBehavior.Default, linkInstanceRef.current, transitionTypes, prefetchIntent); | ||
| }); | ||
@@ -86,3 +86,4 @@ } | ||
| const prefetchEnabled = prefetchProp !== false; | ||
| const fetchStrategy = prefetchProp !== false ? getFetchStrategyFromPrefetchProp(prefetchProp) : FetchStrategy.PPR; | ||
| const prefetchIntent = prefetchProp === false ? 'none' : prefetchProp === true ? 'full' : 'auto'; | ||
| const fetchStrategy = prefetchIntent !== 'none' ? getFetchStrategyFromPrefetchIntent(prefetchIntent) : FetchStrategy.PPR; | ||
| if (process.env.NODE_ENV !== 'production') { | ||
@@ -316,3 +317,3 @@ function createPropError(args) { | ||
| } | ||
| linkClicked(e, formattedHref, linkInstanceRef, replace, scroll, onNavigate, transitionTypes); | ||
| linkClicked(e, formattedHref, linkInstanceRef, replace, scroll, onNavigate, transitionTypes, prefetchIntent); | ||
| }, | ||
@@ -381,15 +382,12 @@ onMouseEnter (e) { | ||
| }; | ||
| function getFetchStrategyFromPrefetchProp(prefetchProp) { | ||
| function getFetchStrategyFromPrefetchIntent(prefetchIntent) { | ||
| if (process.env.__NEXT_CACHE_COMPONENTS) { | ||
| if (prefetchProp === true) { | ||
| if (prefetchIntent === 'full') { | ||
| return FetchStrategy.Full; | ||
| } | ||
| // `null` or `"auto"`: this is the default "auto" mode, where we will prefetch partially if the link is in the viewport. | ||
| // This will also include invalid prop values that don't match the types specified here. | ||
| // (although those should've been filtered out by prop validation in dev) | ||
| prefetchProp; | ||
| // `"auto"`: the default mode, where we will prefetch partially if the link is in the viewport. | ||
| prefetchIntent; | ||
| return FetchStrategy.PPR; | ||
| } else { | ||
| return prefetchProp === null || prefetchProp === 'auto' ? FetchStrategy.PPR : // To preserve backwards-compatibility, anything other than `false`, `null`, or `"auto"` results in a full prefetch. | ||
| // (although invalid values should've been filtered out by prop validation in dev) | ||
| return prefetchIntent === 'auto' ? FetchStrategy.PPR : // data to be prefetched, preserving backwards-compatibility. | ||
| FetchStrategy.Full; | ||
@@ -396,0 +394,0 @@ } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/client/app-dir/link.tsx"],"sourcesContent":["'use client'\n\nimport React, { createContext, useContext, useOptimistic, useRef } from 'react'\nimport type { UrlObject } from 'url'\nimport { formatUrl } from '../../shared/lib/router/utils/format-url'\nimport { AppRouterContext } from '../../shared/lib/app-router-context.shared-runtime'\nimport { useMergedRef } from '../use-merged-ref'\nimport { isAbsoluteUrl } from '../../shared/lib/utils'\nimport { addBasePath } from '../add-base-path'\nimport { ScrollBehavior } from '../components/router-reducer/router-reducer-types'\nimport type { PENDING_LINK_STATUS } from '../components/links'\nimport {\n IDLE_LINK_STATUS,\n mountLinkInstance,\n onNavigationIntent,\n unmountLinkForCurrentNavigation,\n unmountPrefetchableInstance,\n type LinkInstance,\n} from '../components/links'\nimport { isLocalURL } from '../../shared/lib/router/utils/is-local-url'\nimport {\n FetchStrategy,\n type PrefetchTaskFetchStrategy,\n} from '../components/segment-cache/types'\n\ntype Url = string | UrlObject\ntype RequiredKeys<T> = {\n [K in keyof T]-?: {} extends Pick<T, K> ? never : K\n}[keyof T]\ntype OptionalKeys<T> = {\n [K in keyof T]-?: {} extends Pick<T, K> ? K : never\n}[keyof T]\n\ntype OnNavigateEventHandler = (event: { preventDefault: () => void }) => void\n\ntype InternalLinkProps = {\n /**\n * **Required**. The path or URL to navigate to. It can also be an object (similar to `URL`).\n *\n * @example\n * ```tsx\n * // Navigate to /dashboard:\n * <Link href=\"/dashboard\">Dashboard</Link>\n *\n * // Navigate to /about?name=test:\n * <Link href={{ pathname: '/about', query: { name: 'test' } }}>\n * About\n * </Link>\n * ```\n *\n * @remarks\n * - For external URLs, use a fully qualified URL such as `https://...`.\n * - In the App Router, dynamic routes must not include bracketed segments in `href`.\n */\n href: Url\n\n /**\n * @deprecated v10.0.0: `href` props pointing to a dynamic route are\n * automatically resolved and no longer require the `as` prop.\n */\n as?: Url\n\n /**\n * Replace the current `history` state instead of adding a new URL into the stack.\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/about\" replace>\n * About (replaces the history state)\n * </Link>\n * ```\n */\n replace?: boolean\n\n /**\n * Whether to override the default scroll behavior. If `true`, Next.js attempts to maintain\n * the scroll position if the newly navigated page is still visible. If not, it scrolls to the top.\n *\n * If `false`, Next.js will not modify the scroll behavior at all.\n *\n * @defaultValue `true`\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" scroll={false}>\n * No auto scroll\n * </Link>\n * ```\n */\n scroll?: boolean\n\n /**\n * Update the path of the current page without rerunning data fetching methods\n * like `getStaticProps`, `getServerSideProps`, or `getInitialProps`.\n *\n * @remarks\n * `shallow` only applies to the Pages Router. For the App Router, see the\n * [following documentation](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#using-the-native-history-api).\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/blog\" shallow>\n * Shallow navigation\n * </Link>\n * ```\n */\n shallow?: boolean\n\n /**\n * Forces `Link` to pass its `href` to the child component. Useful if the child is a custom\n * component that wraps an `<a>` tag, or if you're using certain styling libraries.\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" passHref legacyBehavior>\n * <MyStyledAnchor>Dashboard</MyStyledAnchor>\n * </Link>\n * ```\n */\n passHref?: boolean\n\n /**\n * Prefetch the page in the background.\n * Any `<Link />` that is in the viewport (initially or through scroll) will be prefetched.\n * Prefetch can be disabled by passing `prefetch={false}`.\n *\n * @remarks\n * Prefetching is only enabled in production.\n *\n * - In the **App Router**:\n * - `\"auto\"`, `null`, `undefined` (default): Prefetch behavior depends on static vs dynamic routes:\n * - Static routes: fully prefetched\n * - Dynamic routes: partial prefetch to the nearest segment with a `loading.js`\n * - `true`: Always prefetch the full route and data.\n * - `false`: Disable prefetching on both viewport and hover.\n * - In the **Pages Router**:\n * - `true` (default): Prefetches the route and data in the background on viewport or hover.\n * - `false`: Prefetch only on hover, not on viewport.\n *\n * @defaultValue `true` (Pages Router) or `null` (App Router)\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" prefetch={false}>\n * Dashboard\n * </Link>\n * ```\n */\n prefetch?: boolean | 'auto' | null\n\n /**\n * (unstable) Switch to a full prefetch on hover. Effectively the same as\n * updating the prefetch prop to `true` in a mouse event.\n */\n unstable_dynamicOnHover?: boolean\n\n /**\n * The active locale is automatically prepended in the Pages Router. `locale` allows for providing\n * a different locale, or can be set to `false` to opt out of automatic locale behavior.\n *\n * @remarks\n * Note: locale only applies in the Pages Router and is ignored in the App Router.\n *\n * @example\n * ```tsx\n * // Use the 'fr' locale:\n * <Link href=\"/about\" locale=\"fr\">\n * About (French)\n * </Link>\n *\n * // Disable locale prefix:\n * <Link href=\"/about\" locale={false}>\n * About (no locale prefix)\n * </Link>\n * ```\n */\n locale?: string | false\n\n /**\n * Enable legacy link behavior.\n *\n * @deprecated This will be removed in a future version\n * @defaultValue `false`\n * @see https://github.com/vercel/next.js/commit/489e65ed98544e69b0afd7e0cfc3f9f6c2b803b7\n */\n legacyBehavior?: boolean\n\n /**\n * Optional event handler for when the mouse pointer is moved onto the `<Link>`.\n */\n onMouseEnter?: React.MouseEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is touched.\n */\n onTouchStart?: React.TouchEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is clicked.\n */\n onClick?: React.MouseEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is navigated.\n */\n onNavigate?: OnNavigateEventHandler\n\n /**\n * Transition types to apply when navigating. These types are passed to\n * [`React.addTransitionType`](https://react.dev/reference/react/addTransitionType)\n * inside the navigation transition, enabling\n * [`<ViewTransition>`](https://react.dev/reference/react/ViewTransition) components\n * to apply different animations based on the type of navigation.\n *\n * @example\n * ```tsx\n * <Link href=\"/about\" transitionTypes={['slide-in']}>About</Link>\n * ```\n */\n transitionTypes?: string[]\n}\n\n// TODO-APP: Include the full set of Anchor props\n// adding this to the publicly exported type currently breaks existing apps\n\n// `RouteInferType` is a stub here to avoid breaking `typedRoutes` when the type\n// isn't generated yet. It will be replaced when type generation runs.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type LinkProps<RouteInferType = any> = InternalLinkProps\ntype LinkPropsRequired = RequiredKeys<LinkProps>\ntype LinkPropsOptional = OptionalKeys<Omit<InternalLinkProps, 'locale'>>\n\nfunction isModifiedEvent(event: React.MouseEvent): boolean {\n const eventTarget = event.currentTarget as HTMLAnchorElement | SVGAElement\n const target = eventTarget.getAttribute('target')\n return (\n (target && target !== '_self') ||\n event.metaKey ||\n event.ctrlKey ||\n event.shiftKey ||\n event.altKey || // triggers resource download\n (event.nativeEvent && event.nativeEvent.which === 2)\n )\n}\n\nfunction linkClicked(\n e: React.MouseEvent,\n href: string,\n linkInstanceRef: React.RefObject<LinkInstance | null>,\n replace?: boolean,\n scroll?: boolean,\n onNavigate?: OnNavigateEventHandler,\n transitionTypes?: string[]\n): void {\n if (typeof window !== 'undefined') {\n const { nodeName } = e.currentTarget\n\n // anchors inside an svg have a lowercase nodeName\n const isAnchorNodeName = nodeName.toUpperCase() === 'A'\n if (\n (isAnchorNodeName && isModifiedEvent(e)) ||\n e.currentTarget.hasAttribute('download')\n ) {\n // ignore click for browser’s default behavior\n return\n }\n\n if (!isLocalURL(href)) {\n if (replace) {\n // browser default behavior does not replace the history state\n // so we need to do it manually\n e.preventDefault()\n location.replace(href)\n }\n\n // ignore click for browser’s default behavior\n return\n }\n\n e.preventDefault()\n\n if (onNavigate) {\n let isDefaultPrevented = false\n\n onNavigate({\n preventDefault: () => {\n isDefaultPrevented = true\n },\n })\n\n if (isDefaultPrevented) {\n return\n }\n }\n\n const { dispatchNavigateAction } =\n require('../components/app-router-instance') as typeof import('../components/app-router-instance')\n\n React.startTransition(() => {\n dispatchNavigateAction(\n href,\n replace ? 'replace' : 'push',\n scroll === false ? ScrollBehavior.NoScroll : ScrollBehavior.Default,\n linkInstanceRef.current,\n transitionTypes\n )\n })\n }\n}\n\nfunction formatStringOrUrl(urlObjOrString: UrlObject | string): string {\n if (typeof urlObjOrString === 'string') {\n return urlObjOrString\n }\n\n return formatUrl(urlObjOrString)\n}\n\n/**\n * A React component that extends the HTML `<a>` element to provide\n * [prefetching](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#2-prefetching)\n * and client-side navigation. This is the primary way to navigate between routes in Next.js.\n *\n * @remarks\n * - Prefetching is only enabled in production.\n *\n * @see https://nextjs.org/docs/app/api-reference/components/link\n */\nexport default function LinkComponent(\n props: LinkProps & {\n children: React.ReactNode\n ref: React.Ref<HTMLAnchorElement>\n }\n) {\n const [linkStatus, setOptimisticLinkStatus] = useOptimistic(IDLE_LINK_STATUS)\n\n let children: React.ReactNode\n\n const linkInstanceRef = useRef<LinkInstance | null>(null)\n\n const {\n href: hrefProp,\n as: asProp,\n children: childrenProp,\n prefetch: prefetchProp = null,\n passHref,\n replace,\n shallow,\n scroll,\n onClick,\n onMouseEnter: onMouseEnterProp,\n onTouchStart: onTouchStartProp,\n legacyBehavior = false,\n onNavigate,\n transitionTypes,\n ref: forwardedRef,\n unstable_dynamicOnHover,\n ...restProps\n } = props\n\n children = childrenProp\n\n if (\n legacyBehavior &&\n (typeof children === 'string' || typeof children === 'number')\n ) {\n children = <a>{children}</a>\n }\n\n const router = React.useContext(AppRouterContext)\n\n const prefetchEnabled = prefetchProp !== false\n\n const fetchStrategy =\n prefetchProp !== false\n ? getFetchStrategyFromPrefetchProp(prefetchProp)\n : // TODO: it makes no sense to assign a fetchStrategy when prefetching is disabled.\n FetchStrategy.PPR\n\n if (process.env.NODE_ENV !== 'production') {\n function createPropError(args: {\n key: string\n expected: string\n actual: string\n }) {\n return new Error(\n `Failed prop type: The prop \\`${args.key}\\` expects a ${args.expected} in \\`<Link>\\`, but got \\`${args.actual}\\` instead.` +\n (typeof window !== 'undefined'\n ? \"\\nOpen your browser's console to view the Component stack trace.\"\n : '')\n )\n }\n\n // TypeScript trick for type-guarding:\n const requiredPropsGuard: Record<LinkPropsRequired, true> = {\n href: true,\n } as const\n const requiredProps: LinkPropsRequired[] = Object.keys(\n requiredPropsGuard\n ) as LinkPropsRequired[]\n requiredProps.forEach((key: LinkPropsRequired) => {\n if (key === 'href') {\n if (\n props[key] == null ||\n (typeof props[key] !== 'string' && typeof props[key] !== 'object')\n ) {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual: props[key] === null ? 'null' : typeof props[key],\n })\n }\n } else {\n // TypeScript trick for type-guarding:\n const _: never = key\n }\n })\n\n // TypeScript trick for type-guarding:\n const optionalPropsGuard: Record<LinkPropsOptional, true> = {\n as: true,\n replace: true,\n scroll: true,\n shallow: true,\n passHref: true,\n prefetch: true,\n unstable_dynamicOnHover: true,\n onClick: true,\n onMouseEnter: true,\n onTouchStart: true,\n legacyBehavior: true,\n onNavigate: true,\n transitionTypes: true,\n } as const\n const optionalProps: LinkPropsOptional[] = Object.keys(\n optionalPropsGuard\n ) as LinkPropsOptional[]\n optionalProps.forEach((key: LinkPropsOptional) => {\n const valType = typeof props[key]\n\n if (key === 'as') {\n if (props[key] && valType !== 'string' && valType !== 'object') {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual: valType,\n })\n }\n } else if (\n key === 'onClick' ||\n key === 'onMouseEnter' ||\n key === 'onTouchStart' ||\n key === 'onNavigate'\n ) {\n if (props[key] && valType !== 'function') {\n throw createPropError({\n key,\n expected: '`function`',\n actual: valType,\n })\n }\n } else if (\n key === 'replace' ||\n key === 'scroll' ||\n key === 'shallow' ||\n key === 'passHref' ||\n key === 'legacyBehavior' ||\n key === 'unstable_dynamicOnHover'\n ) {\n if (props[key] != null && valType !== 'boolean') {\n throw createPropError({\n key,\n expected: '`boolean`',\n actual: valType,\n })\n }\n } else if (key === 'prefetch') {\n if (\n props[key] != null &&\n valType !== 'boolean' &&\n props[key] !== 'auto'\n ) {\n throw createPropError({\n key,\n expected: '`boolean | \"auto\"`',\n actual: valType,\n })\n }\n } else if (key === 'transitionTypes') {\n if (props[key] != null && !Array.isArray(props[key])) {\n throw createPropError({\n key,\n expected: '`string[]`',\n actual: valType,\n })\n }\n } else {\n // TypeScript trick for type-guarding:\n const _: never = key\n }\n })\n }\n\n const resolvedHref = asProp || hrefProp\n const formattedHref = formatStringOrUrl(resolvedHref)\n\n if (process.env.NODE_ENV !== 'production') {\n const { warnOnce } =\n require('../../shared/lib/utils/warn-once') as typeof import('../../shared/lib/utils/warn-once')\n if (props.locale) {\n warnOnce(\n 'The `locale` prop is not supported in `next/link` while using the `app` router. Read more about app router internalization: https://nextjs.org/docs/app/building-your-application/routing/internationalization'\n )\n }\n if (!asProp) {\n let href: string | undefined\n if (typeof resolvedHref === 'string') {\n href = resolvedHref\n } else if (\n typeof resolvedHref === 'object' &&\n typeof resolvedHref.pathname === 'string'\n ) {\n href = resolvedHref.pathname\n }\n\n if (href) {\n const hasDynamicSegment = href\n .split('/')\n .some((segment) => segment.startsWith('[') && segment.endsWith(']'))\n\n if (hasDynamicSegment) {\n throw new Error(\n `Dynamic href \\`${href}\\` found in <Link> while using the \\`/app\\` router, this is not supported. Read more: https://nextjs.org/docs/messages/app-dir-dynamic-href`\n )\n }\n }\n }\n }\n\n // This will return the first child, if multiple are provided it will throw an error\n let child: any\n if (legacyBehavior) {\n if ((children as any)?.$$typeof === Symbol.for('react.lazy')) {\n throw new Error(\n `\\`<Link legacyBehavior>\\` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's \\`<a>\\` tag.`\n )\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (onClick) {\n console.warn(\n `\"onClick\" was passed to <Link> with \\`href\\` of \\`${formattedHref}\\` but \"legacyBehavior\" was set. The legacy behavior requires onClick be set on the child of next/link`\n )\n }\n if (onMouseEnterProp) {\n console.warn(\n `\"onMouseEnter\" was passed to <Link> with \\`href\\` of \\`${formattedHref}\\` but \"legacyBehavior\" was set. The legacy behavior requires onMouseEnter be set on the child of next/link`\n )\n }\n try {\n child = React.Children.only(children)\n } catch (err) {\n if (!children) {\n throw new Error(\n `No children were passed to <Link> with \\`href\\` of \\`${formattedHref}\\` but one child is required https://nextjs.org/docs/messages/link-no-children`\n )\n }\n throw new Error(\n `Multiple children were passed to <Link> with \\`href\\` of \\`${formattedHref}\\` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children` +\n (typeof window !== 'undefined'\n ? \" \\nOpen your browser's console to view the Component stack trace.\"\n : '')\n )\n }\n } else {\n child = React.Children.only(children)\n }\n } else {\n if (process.env.NODE_ENV === 'development') {\n if ((children as any)?.type === 'a') {\n throw new Error(\n 'Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>.\\nLearn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor'\n )\n }\n }\n }\n\n const childRef: any = legacyBehavior\n ? child && typeof child === 'object' && child.ref\n : forwardedRef\n\n // Capture the Owner Stack during render so dev-only warnings emitted later\n // at navigation time can be associated with the JSX that created\n // this <Link>.\n const ownerStack =\n process.env.NODE_ENV !== 'production' && process.env.__NEXT_CACHE_COMPONENTS\n ? // eslint-disable-next-line react-hooks/rules-of-hooks -- build time variables\n React.useMemo(() => {\n // Only capture when a warning might actually need it. Otherwise leave\n // it `undefined` so consumers can detect the opt-out and degrade\n // gracefully.\n if (fetchStrategy === FetchStrategy.Full) {\n return React.captureOwnerStack()\n }\n return undefined\n }, [fetchStrategy])\n : undefined\n\n // Use a callback ref to attach an IntersectionObserver to the anchor tag on\n // mount. In the future we will also use this to keep track of all the\n // currently mounted <Link> instances, e.g. so we can re-prefetch them after\n // a revalidation or refresh.\n const observeLinkVisibilityOnMount = React.useCallback(\n (element: HTMLAnchorElement | SVGAElement) => {\n if (router !== null) {\n linkInstanceRef.current = mountLinkInstance(\n element,\n formattedHref,\n router,\n fetchStrategy,\n prefetchEnabled,\n setOptimisticLinkStatus,\n ownerStack\n )\n }\n\n return () => {\n if (linkInstanceRef.current) {\n unmountLinkForCurrentNavigation(linkInstanceRef.current)\n linkInstanceRef.current = null\n }\n unmountPrefetchableInstance(element)\n }\n },\n [\n prefetchEnabled,\n formattedHref,\n router,\n fetchStrategy,\n setOptimisticLinkStatus,\n ownerStack,\n ]\n )\n\n const mergedRef = useMergedRef(observeLinkVisibilityOnMount, childRef)\n\n const childProps: {\n onTouchStart?: React.TouchEventHandler<HTMLAnchorElement>\n onMouseEnter: React.MouseEventHandler<HTMLAnchorElement>\n onClick: React.MouseEventHandler<HTMLAnchorElement>\n href?: string\n ref?: any\n } = {\n ref: mergedRef,\n onClick(e) {\n if (process.env.NODE_ENV !== 'production') {\n if (!e) {\n throw new Error(\n `Component rendered inside next/link has to pass click event to \"onClick\" prop.`\n )\n }\n }\n\n if (!legacyBehavior && typeof onClick === 'function') {\n onClick(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onClick === 'function'\n ) {\n child.props.onClick(e)\n }\n\n if (!router) {\n return\n }\n if (e.defaultPrevented) {\n return\n }\n linkClicked(\n e,\n formattedHref,\n linkInstanceRef,\n replace,\n scroll,\n onNavigate,\n transitionTypes\n )\n },\n onMouseEnter(e) {\n if (!legacyBehavior && typeof onMouseEnterProp === 'function') {\n onMouseEnterProp(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onMouseEnter === 'function'\n ) {\n child.props.onMouseEnter(e)\n }\n\n if (!router) {\n return\n }\n if (!prefetchEnabled || process.env.NODE_ENV === 'development') {\n return\n }\n\n const upgradeToDynamicPrefetch = unstable_dynamicOnHover === true\n onNavigationIntent(\n e.currentTarget as HTMLAnchorElement | SVGAElement,\n upgradeToDynamicPrefetch\n )\n },\n onTouchStart: process.env.__NEXT_LINK_NO_TOUCH_START\n ? undefined\n : function onTouchStart(e) {\n if (!legacyBehavior && typeof onTouchStartProp === 'function') {\n onTouchStartProp(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onTouchStart === 'function'\n ) {\n child.props.onTouchStart(e)\n }\n\n if (!router) {\n return\n }\n if (!prefetchEnabled) {\n return\n }\n\n const upgradeToDynamicPrefetch = unstable_dynamicOnHover === true\n onNavigationIntent(\n e.currentTarget as HTMLAnchorElement | SVGAElement,\n upgradeToDynamicPrefetch\n )\n },\n }\n\n // If the url is absolute, we can bypass the logic to prepend the basePath.\n if (isAbsoluteUrl(formattedHref)) {\n childProps.href = formattedHref\n } else if (\n !legacyBehavior ||\n passHref ||\n (child.type === 'a' && !('href' in child.props))\n ) {\n childProps.href = addBasePath(formattedHref)\n }\n\n let link: React.ReactNode\n\n if (legacyBehavior) {\n if (process.env.NODE_ENV === 'development') {\n const { errorOnce } =\n require('../../shared/lib/utils/error-once') as typeof import('../../shared/lib/utils/error-once')\n errorOnce(\n '`legacyBehavior` is deprecated and will be removed in a future ' +\n 'release. A codemod is available to upgrade your components:\\n\\n' +\n 'npx @next/codemod@latest new-link .\\n\\n' +\n 'Learn more: https://nextjs.org/docs/app/building-your-application/upgrading/codemods#remove-a-tags-from-link-components'\n )\n }\n link = React.cloneElement(child, childProps)\n } else {\n link = (\n <a {...restProps} {...childProps}>\n {children}\n </a>\n )\n }\n\n return (\n <LinkStatusContext.Provider value={linkStatus}>\n {link}\n </LinkStatusContext.Provider>\n )\n}\n\nconst LinkStatusContext = createContext<\n typeof PENDING_LINK_STATUS | typeof IDLE_LINK_STATUS\n>(IDLE_LINK_STATUS)\n\nexport const useLinkStatus = () => {\n return useContext(LinkStatusContext)\n}\n\nfunction getFetchStrategyFromPrefetchProp(\n prefetchProp: Exclude<LinkProps['prefetch'], undefined | false>\n): PrefetchTaskFetchStrategy {\n if (process.env.__NEXT_CACHE_COMPONENTS) {\n if (prefetchProp === true) {\n return FetchStrategy.Full\n }\n\n // `null` or `\"auto\"`: this is the default \"auto\" mode, where we will prefetch partially if the link is in the viewport.\n // This will also include invalid prop values that don't match the types specified here.\n // (although those should've been filtered out by prop validation in dev)\n prefetchProp satisfies null | 'auto'\n return FetchStrategy.PPR\n } else {\n return prefetchProp === null || prefetchProp === 'auto'\n ? // We default to PPR, and we'll discover whether or not the route supports it with the initial prefetch.\n FetchStrategy.PPR\n : // In the old implementation without runtime prefetches, `prefetch={true}` forces all dynamic data to be prefetched.\n // To preserve backwards-compatibility, anything other than `false`, `null`, or `\"auto\"` results in a full prefetch.\n // (although invalid values should've been filtered out by prop validation in dev)\n FetchStrategy.Full\n }\n}\n"],"names":["React","createContext","useContext","useOptimistic","useRef","formatUrl","AppRouterContext","useMergedRef","isAbsoluteUrl","addBasePath","ScrollBehavior","IDLE_LINK_STATUS","mountLinkInstance","onNavigationIntent","unmountLinkForCurrentNavigation","unmountPrefetchableInstance","isLocalURL","FetchStrategy","isModifiedEvent","event","eventTarget","currentTarget","target","getAttribute","metaKey","ctrlKey","shiftKey","altKey","nativeEvent","which","linkClicked","e","href","linkInstanceRef","replace","scroll","onNavigate","transitionTypes","window","nodeName","isAnchorNodeName","toUpperCase","hasAttribute","preventDefault","location","isDefaultPrevented","dispatchNavigateAction","require","startTransition","NoScroll","Default","current","formatStringOrUrl","urlObjOrString","LinkComponent","props","linkStatus","setOptimisticLinkStatus","children","hrefProp","as","asProp","childrenProp","prefetch","prefetchProp","passHref","shallow","onClick","onMouseEnter","onMouseEnterProp","onTouchStart","onTouchStartProp","legacyBehavior","ref","forwardedRef","unstable_dynamicOnHover","restProps","a","router","prefetchEnabled","fetchStrategy","getFetchStrategyFromPrefetchProp","PPR","process","env","NODE_ENV","createPropError","args","Error","key","expected","actual","requiredPropsGuard","requiredProps","Object","keys","forEach","_","optionalPropsGuard","optionalProps","valType","Array","isArray","resolvedHref","formattedHref","warnOnce","locale","pathname","hasDynamicSegment","split","some","segment","startsWith","endsWith","child","$$typeof","Symbol","for","console","warn","Children","only","err","type","childRef","ownerStack","__NEXT_CACHE_COMPONENTS","useMemo","Full","captureOwnerStack","undefined","observeLinkVisibilityOnMount","useCallback","element","mergedRef","childProps","defaultPrevented","upgradeToDynamicPrefetch","__NEXT_LINK_NO_TOUCH_START","link","errorOnce","cloneElement","LinkStatusContext","Provider","value","useLinkStatus"],"mappings":"AAAA;;AAEA,OAAOA,SAASC,aAAa,EAAEC,UAAU,EAAEC,aAAa,EAAEC,MAAM,QAAQ,QAAO;AAE/E,SAASC,SAAS,QAAQ,2CAA0C;AACpE,SAASC,gBAAgB,QAAQ,qDAAoD;AACrF,SAASC,YAAY,QAAQ,oBAAmB;AAChD,SAASC,aAAa,QAAQ,yBAAwB;AACtD,SAASC,WAAW,QAAQ,mBAAkB;AAC9C,SAASC,cAAc,QAAQ,oDAAmD;AAElF,SACEC,gBAAgB,EAChBC,iBAAiB,EACjBC,kBAAkB,EAClBC,+BAA+B,EAC/BC,2BAA2B,QAEtB,sBAAqB;AAC5B,SAASC,UAAU,QAAQ,6CAA4C;AACvE,SACEC,aAAa,QAER,oCAAmC;AAuN1C,SAASC,gBAAgBC,KAAuB;IAC9C,MAAMC,cAAcD,MAAME,aAAa;IACvC,MAAMC,SAASF,YAAYG,YAAY,CAAC;IACxC,OACE,AAACD,UAAUA,WAAW,WACtB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AAImC;IAEJ,IAAInE,gBAAgB;QAClB,IAAIW,QAAQC,GAAG,CAACC,QAAQ,KAAK,eAAe;YAC1C,MAAM,EAAEuD,SAAS,EAAE,GACjB7F,QAAQ;YACV6F,UACE,oEACE,oEACA,4CACA;QAEN;QACAD,qBAAO3I,MAAM6I,YAAY,CAAC3B,OAAOqB;IACnC,OAAO;QACLI,qBACE,KAAC9D;YAAG,GAAGD,SAAS;YAAG,GAAG2D,UAAU;sBAC7B7E;;IAGP;IAEA,qBACE,KAACoF,kBAAkBC,QAAQ;QAACC,OAAOxF;kBAChCmF;;AAGP;AAEA,MAAMG,kCAAoB7I,cAExBU;AAEF,OAAO,MAAMsI,gBAAgB;IAC3B,OAAO/I,WAAW4I;AACpB,EAAC;AAED,SAAS7D,iCACPjB,YAA+D;IAE/D,IAAImB,QAAQC,GAAG,CAAC0C,uBAAuB,EAAE;QACvC,IAAI9D,iBAAiB,MAAM;YACzB,OAAO/C,cAAc+G,IAAI;QAC3B;QAEA,wHAAwH;QACxH,wFAAwF;QACxF,yEAAyE;QACzEhE;QACA,OAAO/C,cAAciE,GAAG;IAC1B,OAAO;QACL,OAAOlB,iBAAiB,QAAQA,iBAAiB,SAE7C/C,cAAciE,GAAG,GAEjB,oHAAoH;QACpH,kFAAkF;QAClFjE,cAAc+G,IAAI;IACxB;AACF","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/client/app-dir/link.tsx"],"sourcesContent":["'use client'\n\nimport React, { createContext, useContext, useOptimistic, useRef } from 'react'\nimport type { UrlObject } from 'url'\nimport { formatUrl } from '../../shared/lib/router/utils/format-url'\nimport { AppRouterContext } from '../../shared/lib/app-router-context.shared-runtime'\nimport { useMergedRef } from '../use-merged-ref'\nimport { isAbsoluteUrl } from '../../shared/lib/utils'\nimport { addBasePath } from '../add-base-path'\nimport { ScrollBehavior } from '../components/router-reducer/router-reducer-types'\nimport type { PENDING_LINK_STATUS } from '../components/links'\nimport {\n IDLE_LINK_STATUS,\n mountLinkInstance,\n onNavigationIntent,\n unmountLinkForCurrentNavigation,\n unmountPrefetchableInstance,\n type LinkInstance,\n} from '../components/links'\nimport { isLocalURL } from '../../shared/lib/router/utils/is-local-url'\nimport {\n FetchStrategy,\n type PrefetchTaskFetchStrategy,\n} from '../components/segment-cache/types'\nimport type { RouterTransitionPrefetchIntent } from '../router-transition-types'\n\ntype Url = string | UrlObject\ntype RequiredKeys<T> = {\n [K in keyof T]-?: {} extends Pick<T, K> ? never : K\n}[keyof T]\ntype OptionalKeys<T> = {\n [K in keyof T]-?: {} extends Pick<T, K> ? K : never\n}[keyof T]\n\ntype OnNavigateEventHandler = (event: { preventDefault: () => void }) => void\n\ntype InternalLinkProps = {\n /**\n * **Required**. The path or URL to navigate to. It can also be an object (similar to `URL`).\n *\n * @example\n * ```tsx\n * // Navigate to /dashboard:\n * <Link href=\"/dashboard\">Dashboard</Link>\n *\n * // Navigate to /about?name=test:\n * <Link href={{ pathname: '/about', query: { name: 'test' } }}>\n * About\n * </Link>\n * ```\n *\n * @remarks\n * - For external URLs, use a fully qualified URL such as `https://...`.\n * - In the App Router, dynamic routes must not include bracketed segments in `href`.\n */\n href: Url\n\n /**\n * @deprecated v10.0.0: `href` props pointing to a dynamic route are\n * automatically resolved and no longer require the `as` prop.\n */\n as?: Url\n\n /**\n * Replace the current `history` state instead of adding a new URL into the stack.\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/about\" replace>\n * About (replaces the history state)\n * </Link>\n * ```\n */\n replace?: boolean\n\n /**\n * Whether to override the default scroll behavior. If `true`, Next.js attempts to maintain\n * the scroll position if the newly navigated page is still visible. If not, it scrolls to the top.\n *\n * If `false`, Next.js will not modify the scroll behavior at all.\n *\n * @defaultValue `true`\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" scroll={false}>\n * No auto scroll\n * </Link>\n * ```\n */\n scroll?: boolean\n\n /**\n * Update the path of the current page without rerunning data fetching methods\n * like `getStaticProps`, `getServerSideProps`, or `getInitialProps`.\n *\n * @remarks\n * `shallow` only applies to the Pages Router. For the App Router, see the\n * [following documentation](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#using-the-native-history-api).\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/blog\" shallow>\n * Shallow navigation\n * </Link>\n * ```\n */\n shallow?: boolean\n\n /**\n * Forces `Link` to pass its `href` to the child component. Useful if the child is a custom\n * component that wraps an `<a>` tag, or if you're using certain styling libraries.\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" passHref legacyBehavior>\n * <MyStyledAnchor>Dashboard</MyStyledAnchor>\n * </Link>\n * ```\n */\n passHref?: boolean\n\n /**\n * Prefetch the page in the background.\n * Any `<Link />` that is in the viewport (initially or through scroll) will be prefetched.\n * Prefetch can be disabled by passing `prefetch={false}`.\n *\n * @remarks\n * Prefetching is only enabled in production.\n *\n * - In the **App Router**:\n * - `\"auto\"`, `null`, `undefined` (default): Prefetch behavior depends on static vs dynamic routes:\n * - Static routes: fully prefetched\n * - Dynamic routes: partial prefetch to the nearest segment with a `loading.js`\n * - `true`: Always prefetch the full route and data.\n * - `false`: Disable prefetching on both viewport and hover.\n * - In the **Pages Router**:\n * - `true` (default): Prefetches the route and data in the background on viewport or hover.\n * - `false`: Prefetch only on hover, not on viewport.\n *\n * @defaultValue `true` (Pages Router) or `null` (App Router)\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" prefetch={false}>\n * Dashboard\n * </Link>\n * ```\n */\n prefetch?: boolean | 'auto' | null\n\n /**\n * (unstable) Switch to a full prefetch on hover. Effectively the same as\n * updating the prefetch prop to `true` in a mouse event.\n */\n unstable_dynamicOnHover?: boolean\n\n /**\n * The active locale is automatically prepended in the Pages Router. `locale` allows for providing\n * a different locale, or can be set to `false` to opt out of automatic locale behavior.\n *\n * @remarks\n * Note: locale only applies in the Pages Router and is ignored in the App Router.\n *\n * @example\n * ```tsx\n * // Use the 'fr' locale:\n * <Link href=\"/about\" locale=\"fr\">\n * About (French)\n * </Link>\n *\n * // Disable locale prefix:\n * <Link href=\"/about\" locale={false}>\n * About (no locale prefix)\n * </Link>\n * ```\n */\n locale?: string | false\n\n /**\n * Enable legacy link behavior.\n *\n * @deprecated This will be removed in a future version\n * @defaultValue `false`\n * @see https://github.com/vercel/next.js/commit/489e65ed98544e69b0afd7e0cfc3f9f6c2b803b7\n */\n legacyBehavior?: boolean\n\n /**\n * Optional event handler for when the mouse pointer is moved onto the `<Link>`.\n */\n onMouseEnter?: React.MouseEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is touched.\n */\n onTouchStart?: React.TouchEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is clicked.\n */\n onClick?: React.MouseEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is navigated.\n */\n onNavigate?: OnNavigateEventHandler\n\n /**\n * Transition types to apply when navigating. These types are passed to\n * [`React.addTransitionType`](https://react.dev/reference/react/addTransitionType)\n * inside the navigation transition, enabling\n * [`<ViewTransition>`](https://react.dev/reference/react/ViewTransition) components\n * to apply different animations based on the type of navigation.\n *\n * @example\n * ```tsx\n * <Link href=\"/about\" transitionTypes={['slide-in']}>About</Link>\n * ```\n */\n transitionTypes?: string[]\n}\n\n// TODO-APP: Include the full set of Anchor props\n// adding this to the publicly exported type currently breaks existing apps\n\n// `RouteInferType` is a stub here to avoid breaking `typedRoutes` when the type\n// isn't generated yet. It will be replaced when type generation runs.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type LinkProps<RouteInferType = any> = InternalLinkProps\ntype LinkPropsRequired = RequiredKeys<LinkProps>\ntype LinkPropsOptional = OptionalKeys<Omit<InternalLinkProps, 'locale'>>\n\nfunction isModifiedEvent(event: React.MouseEvent): boolean {\n const eventTarget = event.currentTarget as HTMLAnchorElement | SVGAElement\n const target = eventTarget.getAttribute('target')\n return (\n (target && target !== '_self') ||\n event.metaKey ||\n event.ctrlKey ||\n event.shiftKey ||\n event.altKey || // triggers resource download\n (event.nativeEvent && event.nativeEvent.which === 2)\n )\n}\n\nfunction linkClicked(\n e: React.MouseEvent,\n href: string,\n linkInstanceRef: React.RefObject<LinkInstance | null>,\n replace?: boolean,\n scroll?: boolean,\n onNavigate?: OnNavigateEventHandler,\n transitionTypes?: string[],\n prefetchIntent: RouterTransitionPrefetchIntent = 'none'\n): void {\n if (typeof window !== 'undefined') {\n const { nodeName } = e.currentTarget\n\n // anchors inside an svg have a lowercase nodeName\n const isAnchorNodeName = nodeName.toUpperCase() === 'A'\n if (\n (isAnchorNodeName && isModifiedEvent(e)) ||\n e.currentTarget.hasAttribute('download')\n ) {\n // ignore click for browser’s default behavior\n return\n }\n\n if (!isLocalURL(href)) {\n if (replace) {\n // browser default behavior does not replace the history state\n // so we need to do it manually\n e.preventDefault()\n location.replace(href)\n }\n\n // ignore click for browser’s default behavior\n return\n }\n\n e.preventDefault()\n\n if (onNavigate) {\n let isDefaultPrevented = false\n\n onNavigate({\n preventDefault: () => {\n isDefaultPrevented = true\n },\n })\n\n if (isDefaultPrevented) {\n return\n }\n }\n\n const { dispatchNavigateAction } =\n require('../components/app-router-instance') as typeof import('../components/app-router-instance')\n\n React.startTransition(() => {\n dispatchNavigateAction(\n href,\n replace ? 'replace' : 'push',\n scroll === false ? ScrollBehavior.NoScroll : ScrollBehavior.Default,\n linkInstanceRef.current,\n transitionTypes,\n prefetchIntent\n )\n })\n }\n}\n\nfunction formatStringOrUrl(urlObjOrString: UrlObject | string): string {\n if (typeof urlObjOrString === 'string') {\n return urlObjOrString\n }\n\n return formatUrl(urlObjOrString)\n}\n\n/**\n * A React component that extends the HTML `<a>` element to provide\n * [prefetching](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#2-prefetching)\n * and client-side navigation. This is the primary way to navigate between routes in Next.js.\n *\n * @remarks\n * - Prefetching is only enabled in production.\n *\n * @see https://nextjs.org/docs/app/api-reference/components/link\n */\nexport default function LinkComponent(\n props: LinkProps & {\n children: React.ReactNode\n ref: React.Ref<HTMLAnchorElement>\n }\n) {\n const [linkStatus, setOptimisticLinkStatus] = useOptimistic(IDLE_LINK_STATUS)\n\n let children: React.ReactNode\n\n const linkInstanceRef = useRef<LinkInstance | null>(null)\n\n const {\n href: hrefProp,\n as: asProp,\n children: childrenProp,\n prefetch: prefetchProp = null,\n passHref,\n replace,\n shallow,\n scroll,\n onClick,\n onMouseEnter: onMouseEnterProp,\n onTouchStart: onTouchStartProp,\n legacyBehavior = false,\n onNavigate,\n transitionTypes,\n ref: forwardedRef,\n unstable_dynamicOnHover,\n ...restProps\n } = props\n\n children = childrenProp\n\n if (\n legacyBehavior &&\n (typeof children === 'string' || typeof children === 'number')\n ) {\n children = <a>{children}</a>\n }\n\n const router = React.useContext(AppRouterContext)\n\n const prefetchEnabled = prefetchProp !== false\n const prefetchIntent: RouterTransitionPrefetchIntent =\n prefetchProp === false ? 'none' : prefetchProp === true ? 'full' : 'auto'\n\n const fetchStrategy =\n prefetchIntent !== 'none'\n ? getFetchStrategyFromPrefetchIntent(prefetchIntent)\n : // TODO: it makes no sense to assign a fetchStrategy when prefetching is disabled.\n FetchStrategy.PPR\n\n if (process.env.NODE_ENV !== 'production') {\n function createPropError(args: {\n key: string\n expected: string\n actual: string\n }) {\n return new Error(\n `Failed prop type: The prop \\`${args.key}\\` expects a ${args.expected} in \\`<Link>\\`, but got \\`${args.actual}\\` instead.` +\n (typeof window !== 'undefined'\n ? \"\\nOpen your browser's console to view the Component stack trace.\"\n : '')\n )\n }\n\n // TypeScript trick for type-guarding:\n const requiredPropsGuard: Record<LinkPropsRequired, true> = {\n href: true,\n } as const\n const requiredProps: LinkPropsRequired[] = Object.keys(\n requiredPropsGuard\n ) as LinkPropsRequired[]\n requiredProps.forEach((key: LinkPropsRequired) => {\n if (key === 'href') {\n if (\n props[key] == null ||\n (typeof props[key] !== 'string' && typeof props[key] !== 'object')\n ) {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual: props[key] === null ? 'null' : typeof props[key],\n })\n }\n } else {\n // TypeScript trick for type-guarding:\n const _: never = key\n }\n })\n\n // TypeScript trick for type-guarding:\n const optionalPropsGuard: Record<LinkPropsOptional, true> = {\n as: true,\n replace: true,\n scroll: true,\n shallow: true,\n passHref: true,\n prefetch: true,\n unstable_dynamicOnHover: true,\n onClick: true,\n onMouseEnter: true,\n onTouchStart: true,\n legacyBehavior: true,\n onNavigate: true,\n transitionTypes: true,\n } as const\n const optionalProps: LinkPropsOptional[] = Object.keys(\n optionalPropsGuard\n ) as LinkPropsOptional[]\n optionalProps.forEach((key: LinkPropsOptional) => {\n const valType = typeof props[key]\n\n if (key === 'as') {\n if (props[key] && valType !== 'string' && valType !== 'object') {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual: valType,\n })\n }\n } else if (\n key === 'onClick' ||\n key === 'onMouseEnter' ||\n key === 'onTouchStart' ||\n key === 'onNavigate'\n ) {\n if (props[key] && valType !== 'function') {\n throw createPropError({\n key,\n expected: '`function`',\n actual: valType,\n })\n }\n } else if (\n key === 'replace' ||\n key === 'scroll' ||\n key === 'shallow' ||\n key === 'passHref' ||\n key === 'legacyBehavior' ||\n key === 'unstable_dynamicOnHover'\n ) {\n if (props[key] != null && valType !== 'boolean') {\n throw createPropError({\n key,\n expected: '`boolean`',\n actual: valType,\n })\n }\n } else if (key === 'prefetch') {\n if (\n props[key] != null &&\n valType !== 'boolean' &&\n props[key] !== 'auto'\n ) {\n throw createPropError({\n key,\n expected: '`boolean | \"auto\"`',\n actual: valType,\n })\n }\n } else if (key === 'transitionTypes') {\n if (props[key] != null && !Array.isArray(props[key])) {\n throw createPropError({\n key,\n expected: '`string[]`',\n actual: valType,\n })\n }\n } else {\n // TypeScript trick for type-guarding:\n const _: never = key\n }\n })\n }\n\n const resolvedHref = asProp || hrefProp\n const formattedHref = formatStringOrUrl(resolvedHref)\n\n if (process.env.NODE_ENV !== 'production') {\n const { warnOnce } =\n require('../../shared/lib/utils/warn-once') as typeof import('../../shared/lib/utils/warn-once')\n if (props.locale) {\n warnOnce(\n 'The `locale` prop is not supported in `next/link` while using the `app` router. Read more about app router internalization: https://nextjs.org/docs/app/building-your-application/routing/internationalization'\n )\n }\n if (!asProp) {\n let href: string | undefined\n if (typeof resolvedHref === 'string') {\n href = resolvedHref\n } else if (\n typeof resolvedHref === 'object' &&\n typeof resolvedHref.pathname === 'string'\n ) {\n href = resolvedHref.pathname\n }\n\n if (href) {\n const hasDynamicSegment = href\n .split('/')\n .some((segment) => segment.startsWith('[') && segment.endsWith(']'))\n\n if (hasDynamicSegment) {\n throw new Error(\n `Dynamic href \\`${href}\\` found in <Link> while using the \\`/app\\` router, this is not supported. Read more: https://nextjs.org/docs/messages/app-dir-dynamic-href`\n )\n }\n }\n }\n }\n\n // This will return the first child, if multiple are provided it will throw an error\n let child: any\n if (legacyBehavior) {\n if ((children as any)?.$$typeof === Symbol.for('react.lazy')) {\n throw new Error(\n `\\`<Link legacyBehavior>\\` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's \\`<a>\\` tag.`\n )\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (onClick) {\n console.warn(\n `\"onClick\" was passed to <Link> with \\`href\\` of \\`${formattedHref}\\` but \"legacyBehavior\" was set. The legacy behavior requires onClick be set on the child of next/link`\n )\n }\n if (onMouseEnterProp) {\n console.warn(\n `\"onMouseEnter\" was passed to <Link> with \\`href\\` of \\`${formattedHref}\\` but \"legacyBehavior\" was set. The legacy behavior requires onMouseEnter be set on the child of next/link`\n )\n }\n try {\n child = React.Children.only(children)\n } catch (err) {\n if (!children) {\n throw new Error(\n `No children were passed to <Link> with \\`href\\` of \\`${formattedHref}\\` but one child is required https://nextjs.org/docs/messages/link-no-children`\n )\n }\n throw new Error(\n `Multiple children were passed to <Link> with \\`href\\` of \\`${formattedHref}\\` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children` +\n (typeof window !== 'undefined'\n ? \" \\nOpen your browser's console to view the Component stack trace.\"\n : '')\n )\n }\n } else {\n child = React.Children.only(children)\n }\n } else {\n if (process.env.NODE_ENV === 'development') {\n if ((children as any)?.type === 'a') {\n throw new Error(\n 'Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>.\\nLearn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor'\n )\n }\n }\n }\n\n const childRef: any = legacyBehavior\n ? child && typeof child === 'object' && child.ref\n : forwardedRef\n\n // Capture the Owner Stack during render so dev-only warnings emitted later\n // at navigation time can be associated with the JSX that created\n // this <Link>.\n const ownerStack =\n process.env.NODE_ENV !== 'production' && process.env.__NEXT_CACHE_COMPONENTS\n ? // eslint-disable-next-line react-hooks/rules-of-hooks -- build time variables\n React.useMemo(() => {\n // Only capture when a warning might actually need it. Otherwise leave\n // it `undefined` so consumers can detect the opt-out and degrade\n // gracefully.\n if (fetchStrategy === FetchStrategy.Full) {\n return React.captureOwnerStack()\n }\n return undefined\n }, [fetchStrategy])\n : undefined\n\n // Use a callback ref to attach an IntersectionObserver to the anchor tag on\n // mount. In the future we will also use this to keep track of all the\n // currently mounted <Link> instances, e.g. so we can re-prefetch them after\n // a revalidation or refresh.\n const observeLinkVisibilityOnMount = React.useCallback(\n (element: HTMLAnchorElement | SVGAElement) => {\n if (router !== null) {\n linkInstanceRef.current = mountLinkInstance(\n element,\n formattedHref,\n router,\n fetchStrategy,\n prefetchEnabled,\n setOptimisticLinkStatus,\n ownerStack\n )\n }\n\n return () => {\n if (linkInstanceRef.current) {\n unmountLinkForCurrentNavigation(linkInstanceRef.current)\n linkInstanceRef.current = null\n }\n unmountPrefetchableInstance(element)\n }\n },\n [\n prefetchEnabled,\n formattedHref,\n router,\n fetchStrategy,\n setOptimisticLinkStatus,\n ownerStack,\n ]\n )\n\n const mergedRef = useMergedRef(observeLinkVisibilityOnMount, childRef)\n\n const childProps: {\n onTouchStart?: React.TouchEventHandler<HTMLAnchorElement>\n onMouseEnter: React.MouseEventHandler<HTMLAnchorElement>\n onClick: React.MouseEventHandler<HTMLAnchorElement>\n href?: string\n ref?: any\n } = {\n ref: mergedRef,\n onClick(e) {\n if (process.env.NODE_ENV !== 'production') {\n if (!e) {\n throw new Error(\n `Component rendered inside next/link has to pass click event to \"onClick\" prop.`\n )\n }\n }\n\n if (!legacyBehavior && typeof onClick === 'function') {\n onClick(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onClick === 'function'\n ) {\n child.props.onClick(e)\n }\n\n if (!router) {\n return\n }\n if (e.defaultPrevented) {\n return\n }\n linkClicked(\n e,\n formattedHref,\n linkInstanceRef,\n replace,\n scroll,\n onNavigate,\n transitionTypes,\n prefetchIntent\n )\n },\n onMouseEnter(e) {\n if (!legacyBehavior && typeof onMouseEnterProp === 'function') {\n onMouseEnterProp(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onMouseEnter === 'function'\n ) {\n child.props.onMouseEnter(e)\n }\n\n if (!router) {\n return\n }\n if (!prefetchEnabled || process.env.NODE_ENV === 'development') {\n return\n }\n\n const upgradeToDynamicPrefetch = unstable_dynamicOnHover === true\n onNavigationIntent(\n e.currentTarget as HTMLAnchorElement | SVGAElement,\n upgradeToDynamicPrefetch\n )\n },\n onTouchStart: process.env.__NEXT_LINK_NO_TOUCH_START\n ? undefined\n : function onTouchStart(e) {\n if (!legacyBehavior && typeof onTouchStartProp === 'function') {\n onTouchStartProp(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onTouchStart === 'function'\n ) {\n child.props.onTouchStart(e)\n }\n\n if (!router) {\n return\n }\n if (!prefetchEnabled) {\n return\n }\n\n const upgradeToDynamicPrefetch = unstable_dynamicOnHover === true\n onNavigationIntent(\n e.currentTarget as HTMLAnchorElement | SVGAElement,\n upgradeToDynamicPrefetch\n )\n },\n }\n\n // If the url is absolute, we can bypass the logic to prepend the basePath.\n if (isAbsoluteUrl(formattedHref)) {\n childProps.href = formattedHref\n } else if (\n !legacyBehavior ||\n passHref ||\n (child.type === 'a' && !('href' in child.props))\n ) {\n childProps.href = addBasePath(formattedHref)\n }\n\n let link: React.ReactNode\n\n if (legacyBehavior) {\n if (process.env.NODE_ENV === 'development') {\n const { errorOnce } =\n require('../../shared/lib/utils/error-once') as typeof import('../../shared/lib/utils/error-once')\n errorOnce(\n '`legacyBehavior` is deprecated and will be removed in a future ' +\n 'release. A codemod is available to upgrade your components:\\n\\n' +\n 'npx @next/codemod@latest new-link .\\n\\n' +\n 'Learn more: https://nextjs.org/docs/app/building-your-application/upgrading/codemods#remove-a-tags-from-link-components'\n )\n }\n link = React.cloneElement(child, childProps)\n } else {\n link = (\n <a {...restProps} {...childProps}>\n {children}\n </a>\n )\n }\n\n return (\n <LinkStatusContext.Provider value={linkStatus}>\n {link}\n </LinkStatusContext.Provider>\n )\n}\n\nconst LinkStatusContext = createContext<\n typeof PENDING_LINK_STATUS | typeof IDLE_LINK_STATUS\n>(IDLE_LINK_STATUS)\n\nexport const useLinkStatus = () => {\n return useContext(LinkStatusContext)\n}\n\nfunction getFetchStrategyFromPrefetchIntent(\n prefetchIntent: Exclude<RouterTransitionPrefetchIntent, 'none'>\n): PrefetchTaskFetchStrategy {\n if (process.env.__NEXT_CACHE_COMPONENTS) {\n if (prefetchIntent === 'full') {\n return FetchStrategy.Full\n }\n\n // `\"auto\"`: the default mode, where we will prefetch partially if the link is in the viewport.\n prefetchIntent satisfies 'auto'\n return FetchStrategy.PPR\n } else {\n return prefetchIntent === 'auto'\n ? // We default to PPR, and we'll discover whether or not the route supports it with the initial prefetch.\n FetchStrategy.PPR\n : // In the old implementation without runtime prefetches, `prefetch={true}` (`'full'`) forces all dynamic\n // data to be prefetched, preserving backwards-compatibility.\n FetchStrategy.Full\n }\n}\n"],"names":["React","createContext","useContext","useOptimistic","useRef","formatUrl","AppRouterContext","useMergedRef","isAbsoluteUrl","addBasePath","ScrollBehavior","IDLE_LINK_STATUS","mountLinkInstance","onNavigationIntent","unmountLinkForCurrentNavigation","unmountPrefetchableInstance","isLocalURL","FetchStrategy","isModifiedEvent","event","eventTarget","currentTarget","target","getAttribute","metaKey","ctrlKey","shiftKey","altKey","nativeEvent","which","linkClicked","e","href","linkInstanceRef","replace","scroll","onNavigate","transitionTypes","prefetchIntent","window","nodeName","isAnchorNodeName","toUpperCase","hasAttribute","preventDefault","location","isDefaultPrevented","dispatchNavigateAction","require","startTransition","NoScroll","Default","current","formatStringOrUrl","urlObjOrString","LinkComponent","props","linkStatus","setOptimisticLinkStatus","children","hrefProp","as","asProp","childrenProp","prefetch","prefetchProp","passHref","shallow","onClick","onMouseEnter","onMouseEnterProp","onTouchStart","onTouchStartProp","legacyBehavior","ref","forwardedRef","unstable_dynamicOnHover","restProps","a","router","prefetchEnabled","fetchStrategy","getFetchStrategyFromPrefetchIntent","PPR","process","env","NODE_ENV","createPropError","args","Error","key","expected","actual","requiredPropsGuard","requiredProps","Object","keys","forEach","_","optionalPropsGuard","optionalProps","valType","Array","isArray","resolvedHref","formattedHref","warnOnce","locale","pathname","hasDynamicSegment","split","some","segment","startsWith","endsWith","child","$$typeof","Symbol","for","console","warn","Children","only","err","type","childRef","ownerStack","__NEXT_CACHE_COMPONENTS","useMemo","Full","captureOwnerStack","undefined","observeLinkVisibilityOnMount","useCallback","element","mergedRef","childProps","defaultPrevented","upgradeToDynamicPrefetch","__NEXT_LINK_NO_TOUCH_START","link","errorOnce","cloneElement","LinkStatusContext","Provider","value","useLinkStatus"],"mappings":"AAAA;;AAEA,OAAOA,SAASC,aAAa,EAAEC,UAAU,EAAEC,aAAa,EAAEC,MAAM,QAAQ,QAAO;AAE/E,SAASC,SAAS,QAAQ,2CAA0C;AACpE,SAASC,gBAAgB,QAAQ,qDAAoD;AACrF,SAASC,YAAY,QAAQ,oBAAmB;AAChD,SAASC,aAAa,QAAQ,yBAAwB;AACtD,SAASC,WAAW,QAAQ,mBAAkB;AAC9C,SAASC,cAAc,QAAQ,oDAAmD;AAElF,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-runtime"; | ||
| import { setNavigationBuildId } from './navigation-build-id'; | ||
| import { initializeRouterTransitionModules } from './components/router-transition'; | ||
| /// <reference types="react-dom/experimental" /> | ||
@@ -231,3 +232,3 @@ const createFromReadableStream = createFromReadableStreamBrowser; | ||
| }; | ||
| export async function hydrate(instrumentationHooks, assetPrefix) { | ||
| export async function hydrate(instrumentationModules, assetPrefix) { | ||
| let staticIndicatorState; | ||
@@ -256,2 +257,3 @@ let webSocket; | ||
| } | ||
| initializeRouterTransitionModules(instrumentationModules); | ||
| const initialTimestamp = Date.now(); | ||
@@ -263,3 +265,3 @@ const actionQueue = createMutableActionQueue(createInitialRouterState({ | ||
| location: window.location | ||
| }), instrumentationHooks); | ||
| })); | ||
| const reactEl = /*#__PURE__*/ _jsx(StrictModeIfEnabled, { | ||
@@ -266,0 +268,0 @@ children: /*#__PURE__*/ _jsx(HeadManagerContext.Provider, { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/client/app-index.tsx"],"sourcesContent":["import './app-globals'\nimport ReactDOMClient from 'react-dom/client'\nimport React from 'react'\n// TODO: Explicitly import from client.browser\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport {\n createFromReadableStream as createFromReadableStreamBrowser,\n createFromFetch as createFromFetchBrowser,\n} from 'react-server-dom-webpack/client'\nimport { HeadManagerContext } from '../shared/lib/head-manager-context.shared-runtime'\nimport { onRecoverableError } from './react-client-callbacks/on-recoverable-error'\nimport {\n onCaughtError,\n onUncaughtError,\n} from './react-client-callbacks/error-boundary-callbacks'\nimport { callServer } from './app-call-server'\nimport { findSourceMapURL } from './app-find-source-map-url'\nimport {\n type AppRouterActionQueue,\n createMutableActionQueue,\n} from './components/app-router-instance'\nimport AppRouter from './components/app-router'\nimport type { InitialRSCPayload } from '../shared/lib/app-router-types'\nimport { createInitialRouterState } from './components/router-reducer/create-initial-router-state'\nimport { MissingSlotContext } from '../shared/lib/app-router-context.shared-runtime'\nimport type { StaticIndicatorState } from './dev/hot-reloader/app/hot-reloader-app'\nimport { createInitialRSCPayloadFromFallbackPrerender } from './flight-data-helpers'\nimport { getDeploymentId } from '../shared/lib/deployment-id'\nimport { setNavigationBuildId } from './navigation-build-id'\n\n/// <reference types=\"react-dom/experimental\" />\n\nconst createFromReadableStream =\n createFromReadableStreamBrowser as (typeof import('react-server-dom-webpack/client.browser'))['createFromReadableStream']\nconst createFromFetch =\n createFromFetchBrowser as (typeof import('react-server-dom-webpack/client.browser'))['createFromFetch']\n\nconst appElement: HTMLElement | Document = document\n\n// Instant Navigation Testing API: captured once at module init. When truthy,\n// this is the fetch promise for the static RSC payload (set by an injected\n// <script> tag in the static shell HTML).\nconst instantTestStaticFetch: Promise<Response> | undefined =\n self.__next_instant_test\n ? (self.__next_instant_test as unknown as Promise<Response>)\n : undefined\n\nconst encoder = new TextEncoder()\n\nlet initialServerDataBuffer: (string | Uint8Array)[] | undefined = undefined\nlet initialServerDataWriter: ReadableStreamDefaultController | undefined =\n undefined\nlet initialServerDataLoaded = false\nlet initialServerDataFlushed = false\n\nlet initialFormStateData: null | any = null\n\ntype FlightSegment =\n | [isBootStrap: 0]\n | [isNotBootstrap: 1, responsePartial: string]\n | [isFormState: 2, formState: any]\n | [isBinary: 3, responseBase64Partial: string]\n\ntype NextFlight = Omit<Array<FlightSegment>, 'push'> & {\n push: (seg: FlightSegment) => void\n}\n\ndeclare global {\n // If you're working in a browser environment\n interface Window {\n /**\n * request ID, dev-only\n */\n __next_r?: string\n __next_f: NextFlight\n }\n}\n\nfunction nextServerDataCallback(seg: FlightSegment): void {\n if (seg[0] === 0) {\n initialServerDataBuffer = []\n } else if (seg[0] === 1) {\n if (!initialServerDataBuffer)\n throw new Error('Unexpected server data: missing bootstrap script.')\n\n if (initialServerDataWriter) {\n initialServerDataWriter.enqueue(encoder.encode(seg[1]))\n } else {\n initialServerDataBuffer.push(seg[1])\n }\n } else if (seg[0] === 2) {\n initialFormStateData = seg[1]\n } else if (seg[0] === 3) {\n if (!initialServerDataBuffer)\n throw new Error('Unexpected server data: missing bootstrap script.')\n\n // Decode the base64 string back to binary data.\n const binaryString = atob(seg[1])\n const decodedChunk = new Uint8Array(binaryString.length)\n for (var i = 0; i < binaryString.length; i++) {\n decodedChunk[i] = binaryString.charCodeAt(i)\n }\n\n if (initialServerDataWriter) {\n initialServerDataWriter.enqueue(decodedChunk)\n } else {\n initialServerDataBuffer.push(decodedChunk)\n }\n }\n}\n\nfunction isStreamErrorOrUnfinished(ctr: ReadableStreamDefaultController) {\n // If `desiredSize` is null, it means the stream is closed or errored. If it is lower than 0, the stream is still unfinished.\n return ctr.desiredSize === null || ctr.desiredSize < 0\n}\n\n// There might be race conditions between `nextServerDataRegisterWriter` and\n// `DOMContentLoaded`. The former will be called when React starts to hydrate\n// the root, the latter will be called when the DOM is fully loaded.\n// For streaming, the former is called first due to partial hydration.\n// For non-streaming, the latter can be called first.\n// Hence, we use two variables `initialServerDataLoaded` and\n// `initialServerDataFlushed` to make sure the writer will be closed and\n// `initialServerDataBuffer` will be cleared in the right time.\nfunction nextServerDataRegisterWriter(ctr: ReadableStreamDefaultController) {\n if (initialServerDataBuffer) {\n initialServerDataBuffer.forEach((val) => {\n ctr.enqueue(typeof val === 'string' ? encoder.encode(val) : val)\n })\n if (initialServerDataLoaded && !initialServerDataFlushed) {\n // Instant Navigation Testing API: don't close or error the inline\n // Flight stream. The static shell has no inline Flight data, so the\n // stream is empty. Closing it would cause React to log an error about\n // missing data. Leaving it open lets React treat any holes as\n // \"still suspended.\" Hydration uses the separately fetched RSC payload\n // (self.__next_instant_test), not this stream.\n if (isStreamErrorOrUnfinished(ctr)) {\n if (!instantTestStaticFetch) {\n ctr.error(\n new Error(\n 'The connection to the page was unexpectedly closed, possibly due to the stop button being clicked, loss of Wi-Fi, or an unstable internet connection.'\n )\n )\n }\n } else {\n ctr.close()\n }\n initialServerDataFlushed = true\n initialServerDataBuffer = undefined\n }\n }\n\n initialServerDataWriter = ctr\n}\n\n// When `DOMContentLoaded`, we can close all pending writers to finish hydration.\nconst DOMContentLoaded = function () {\n if (initialServerDataWriter && !initialServerDataFlushed) {\n initialServerDataWriter.close()\n initialServerDataFlushed = true\n initialServerDataBuffer = undefined\n }\n initialServerDataLoaded = true\n}\n\n// It's possible that the DOM is already loaded.\nif (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', DOMContentLoaded, false)\n} else {\n // Delayed in marco task to ensure it's executed later than hydration\n setTimeout(DOMContentLoaded)\n}\n\nconst nextServerDataLoadingGlobal = (self.__next_f = self.__next_f || [])\n\n// Consume all buffered chunks and clear the global data array right after to release memory.\n// Otherwise it will be retained indefinitely.\nnextServerDataLoadingGlobal.forEach(nextServerDataCallback)\nnextServerDataLoadingGlobal.length = 0\n\n// Patch its push method so subsequent chunks are handled (but not actually pushed to the array).\nnextServerDataLoadingGlobal.push = nextServerDataCallback\n\nlet readable: ReadableStream<Uint8Array> = new ReadableStream({\n start(controller) {\n nextServerDataRegisterWriter(controller)\n },\n})\nif (process.env.NODE_ENV !== 'production') {\n // @ts-expect-error\n readable.name = 'hydration'\n}\n\n// When Cache Components is enabled, tee the inlined Flight stream so we can\n// truncate a clone at the static stage byte boundary and cache it. We don't\n// know if `l` is present until React decodes the payload, so always tee and\n// cancel the clone if not needed.\nlet initialFlightStreamForCache: ReadableStream<Uint8Array> | null = null\nif (\n process.env.__NEXT_CACHE_COMPONENTS &&\n process.env.__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS\n) {\n const [forReact, forCache] = readable.tee()\n readable = forReact\n initialFlightStreamForCache = forCache\n}\n\nlet debugChannel:\n | { readable?: ReadableStream; writable?: WritableStream }\n | undefined\n\nif (\n process.env.__NEXT_DEV_SERVER &&\n process.env.__NEXT_REACT_DEBUG_CHANNEL &&\n typeof window !== 'undefined'\n) {\n const { createDebugChannel } =\n require('./dev/debug-channel') as typeof import('./dev/debug-channel')\n\n debugChannel = createDebugChannel(undefined)\n}\n\nlet initialServerResponse: Promise<InitialRSCPayload>\nif (instantTestStaticFetch) {\n // Instant Navigation Testing API: hydrate from the static RSC payload\n // fetch kicked off by an injected <script> tag, instead of the inline\n // Flight data (which is not present in the static shell).\n initialServerResponse = Promise.resolve(\n createFromFetch<InitialRSCPayload>(instantTestStaticFetch, {\n callServer,\n findSourceMapURL,\n debugChannel,\n // The static fetch response is a partial stream (static-only Flight\n // data with no dynamic content). Allow it to close without error so\n // React treats dynamic holes as still-suspended rather than\n // triggering error recovery.\n unstable_allowPartialStream: true,\n })\n ).then(async (initialRSCPayload) => {\n return createInitialRSCPayloadFromFallbackPrerender(\n await instantTestStaticFetch,\n initialRSCPayload\n )\n })\n} else if (\n // @ts-expect-error\n window.__NEXT_CLIENT_RESUME\n) {\n const clientResumeFetch: Promise<Response> =\n // @ts-expect-error\n window.__NEXT_CLIENT_RESUME\n initialServerResponse = Promise.resolve(\n createFromFetch<InitialRSCPayload>(clientResumeFetch, {\n callServer,\n findSourceMapURL,\n debugChannel,\n })\n ).then(async (fallbackInitialRSCPayload) =>\n createInitialRSCPayloadFromFallbackPrerender(\n await clientResumeFetch,\n fallbackInitialRSCPayload\n )\n )\n} else {\n initialServerResponse = createFromReadableStream<InitialRSCPayload>(\n readable,\n {\n callServer,\n findSourceMapURL,\n debugChannel,\n startTime: 0,\n }\n )\n}\n\nfunction ServerRoot({\n initialRSCPayload,\n actionQueue,\n webSocket,\n staticIndicatorState,\n}: {\n initialRSCPayload: InitialRSCPayload\n actionQueue: AppRouterActionQueue\n webSocket: WebSocket | undefined\n staticIndicatorState: StaticIndicatorState | undefined\n}): React.ReactNode {\n const router = (\n <AppRouter\n actionQueue={actionQueue}\n globalErrorState={initialRSCPayload.G}\n webSocket={webSocket}\n staticIndicatorState={staticIndicatorState}\n />\n )\n\n if (process.env.NODE_ENV === 'development' && initialRSCPayload.m) {\n // We provide missing slot information in a context provider only during development\n // as we log some additional information about the missing slots in the console.\n return (\n <MissingSlotContext value={initialRSCPayload.m}>\n {router}\n </MissingSlotContext>\n )\n }\n\n return router\n}\n\nconst StrictModeIfEnabled = process.env.__NEXT_STRICT_MODE_APP\n ? React.StrictMode\n : React.Fragment\n\nfunction Root({ children }: React.PropsWithChildren<{}>) {\n if (process.env.__NEXT_TEST_MODE) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n window.__NEXT_HYDRATED = true\n window.__NEXT_HYDRATED_AT = performance.now()\n window.__NEXT_HYDRATED_CB?.()\n }, [])\n }\n\n return children\n}\n\nconst enableTransitionIndicator = process.env.__NEXT_TRANSITION_INDICATOR\n\nfunction noDefaultTransitionIndicator() {\n return () => {}\n}\n\nconst reactRootOptions: ReactDOMClient.RootOptions = {\n onDefaultTransitionIndicator: enableTransitionIndicator\n ? // TODO: Compose default with user-configureable (e.g. nprogress)\n undefined\n : noDefaultTransitionIndicator,\n onRecoverableError,\n onCaughtError,\n onUncaughtError,\n}\n\nexport type ClientInstrumentationHooks = {\n onRouterTransitionStart?: (\n url: string,\n navigationType: 'push' | 'replace' | 'traverse'\n ) => void\n}\n\nexport async function hydrate(\n instrumentationHooks: ClientInstrumentationHooks | null,\n assetPrefix: string\n) {\n let staticIndicatorState: StaticIndicatorState | undefined\n let webSocket: WebSocket | undefined\n\n if (process.env.__NEXT_DEV_SERVER) {\n const { createWebSocket } =\n require('./dev/hot-reloader/app/web-socket') as typeof import('./dev/hot-reloader/app/web-socket')\n\n staticIndicatorState = { pathname: null, appIsrManifest: null }\n webSocket = createWebSocket(assetPrefix, staticIndicatorState)\n }\n const initialRSCPayload = await initialServerResponse\n\n // Initialize the offline module to register browser event listeners\n // (offline/online) before any components hydrate.\n if (process.env.__NEXT_USE_OFFLINE) {\n require('./components/offline') as typeof import('./components/offline')\n }\n\n // setNavigationBuildId should be called only once, during JS initialization\n // and before any components have hydrated.\n if (initialRSCPayload.b) {\n setNavigationBuildId(initialRSCPayload.b!)\n } else {\n setNavigationBuildId(getDeploymentId()!)\n }\n\n const initialTimestamp = Date.now()\n const actionQueue: AppRouterActionQueue = createMutableActionQueue(\n createInitialRouterState({\n navigatedAt: initialTimestamp,\n initialRSCPayload,\n initialFlightStreamForCache,\n location: window.location,\n }),\n instrumentationHooks\n )\n\n const reactEl = (\n <StrictModeIfEnabled>\n <HeadManagerContext.Provider value={{ appDir: true }}>\n <Root>\n <ServerRoot\n initialRSCPayload={initialRSCPayload}\n actionQueue={actionQueue}\n webSocket={webSocket}\n staticIndicatorState={staticIndicatorState}\n />\n </Root>\n </HeadManagerContext.Provider>\n </StrictModeIfEnabled>\n )\n\n if (document.documentElement.id === '__next_error__') {\n let element = reactEl\n // Server rendering failed, fall back to client-side rendering\n if (process.env.NODE_ENV !== 'production') {\n const { RootLevelDevOverlayElement } =\n require('../next-devtools/userspace/app/client-entry') as typeof import('../next-devtools/userspace/app/client-entry')\n\n // Note this won't cause hydration mismatch because we are doing CSR w/o hydration\n element = (\n <RootLevelDevOverlayElement>{element}</RootLevelDevOverlayElement>\n )\n }\n\n ReactDOMClient.createRoot(appElement, reactRootOptions).render(element)\n } else {\n React.startTransition(() => {\n ReactDOMClient.hydrateRoot(appElement, reactEl, {\n ...reactRootOptions,\n formState: initialFormStateData,\n })\n })\n }\n\n // TODO-APP: Remove this logic when Float has GC built-in in development.\n if (process.env.__NEXT_DEV_SERVER) {\n const { linkGc } =\n require('./app-link-gc') as typeof import('./app-link-gc')\n linkGc()\n }\n}\n"],"names":["ReactDOMClient","React","createFromReadableStream","createFromReadableStreamBrowser","createFromFetch","createFromFetchBrowser","HeadManagerContext","onRecoverableError","onCaughtError","onUncaughtError","callServer","findSourceMapURL","createMutableActionQueue","AppRouter","createInitialRouterState","MissingSlotContext","createInitialRSCPayloadFromFallbackPrerender","getDeploymentId","setNavigationBuildId","appElement","document","instantTestStaticFetch","self","__next_instant_test","undefined","encoder","TextEncoder","initialServerDataBuffer","initialServerDataWriter","initialServerDataLoaded","initialServerDataFlushed","initialFormStateData","nextServerDataCallback","seg","Error","enqueue","encode","push","binaryString","atob","decodedChunk","Uint8Array","length","i","charCodeAt","isStreamErrorOrUnfinished","ctr","desiredSize","nextServerDataRegisterWriter","forEach","val","error","close","DOMContentLoaded","readyState","addEventListener","setTimeout","nextServerDataLoadingGlobal","__next_f","readable","ReadableStream","start","controller","process","env","NODE_ENV","name","initialFlightStreamForCache","__NEXT_CACHE_COMPONENTS","__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS","forReact","forCache","tee","debugChannel","__NEXT_DEV_SERVER","__NEXT_REACT_DEBUG_CHANNEL","window","createDebugChannel","require","initialServerResponse","Promise","resolve","unstable_allowPartialStream","then","initialRSCPayload","__NEXT_CLIENT_RESUME","clientResumeFetch","fallbackInitialRSCPayload","startTime","ServerRoot","actionQueue","webSocket","staticIndicatorState","router","globalErrorState","G","m","value","StrictModeIfEnabled","__NEXT_STRICT_MODE_APP","StrictMode","Fragment","Root","children","__NEXT_TEST_MODE","useEffect","__NEXT_HYDRATED","__NEXT_HYDRATED_AT","performance","now","__NEXT_HYDRATED_CB","enableTransitionIndicator","__NEXT_TRANSITION_INDICATOR","noDefaultTransitionIndicator","reactRootOptions","onDefaultTransitionIndicator","hydrate","instrumentationHooks","assetPrefix","createWebSocket","pathname","appIsrManifest","__NEXT_USE_OFFLINE","b","initialTimestamp","Date","navigatedAt","location","reactEl","Provider","appDir","documentElement","id","element","RootLevelDevOverlayElement","createRoot","render","startTransition","hydrateRoot","formState","linkGc"],"mappings":";AAAA,OAAO,gBAAe;AACtB,OAAOA,oBAAoB,mBAAkB;AAC7C,OAAOC,WAAW,QAAO;AACzB,8CAA8C;AAC9C,6DAA6D;AAC7D,SACEC,4BAA4BC,+BAA+B,EAC3DC,mBAAmBC,sBAAsB,QACpC,kCAAiC;AACxC,SAASC,kBAAkB,QAAQ,oDAAmD;AACtF,SAASC,kBAAkB,QAAQ,gDAA+C;AAClF,SACEC,aAAa,EACbC,eAAe,QACV,oDAAmD;AAC1D,SAASC,UAAU,QAAQ,oBAAmB;AAC9C,SAASC,gBAAgB,QAAQ,4BAA2B;AAC5D,SAEEC,wBA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;YAEV,kFAAkF;YAClFuD,wBACE,KAACC;0BAA4BD;;QAEjC;QAEArI,eAAeuI,UAAU,CAACpH,YAAY+F,kBAAkBsB,MAAM,CAACH;IACjE,OAAO;QACLpI,MAAMwI,eAAe,CAAC;YACpBzI,eAAe0I,WAAW,CAACvH,YAAY6G,SAAS;gBAC9C,GAAGd,gBAAgB;gBACnByB,WAAW5G;YACb;QACF;IACF;IAEA,yEAAyE;IACzE,IAAIgC,QAAQC,GAAG,CAACU,iBAAiB,EAAE;QACjC,MAAM,EAAEkE,MAAM,EAAE,GACd9D,QAAQ;QACV8D;IACF;AACF","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/client/app-index.tsx"],"sourcesContent":["import './app-globals'\nimport ReactDOMClient from 'react-dom/client'\nimport React from 'react'\n// TODO: Explicitly import from client.browser\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport {\n createFromReadableStream as createFromReadableStreamBrowser,\n createFromFetch as createFromFetchBrowser,\n} from 'react-server-dom-webpack/client'\nimport { HeadManagerContext } from '../shared/lib/head-manager-context.shared-runtime'\nimport { onRecoverableError } from './react-client-callbacks/on-recoverable-error'\nimport {\n onCaughtError,\n onUncaughtError,\n} from './react-client-callbacks/error-boundary-callbacks'\nimport { callServer } from './app-call-server'\nimport { findSourceMapURL } from './app-find-source-map-url'\nimport {\n type AppRouterActionQueue,\n createMutableActionQueue,\n} from './components/app-router-instance'\nimport AppRouter from './components/app-router'\nimport type { InitialRSCPayload } from '../shared/lib/app-router-types'\nimport { createInitialRouterState } from './components/router-reducer/create-initial-router-state'\nimport { MissingSlotContext } from '../shared/lib/app-router-context.shared-runtime'\nimport type { StaticIndicatorState } from './dev/hot-reloader/app/hot-reloader-app'\nimport { createInitialRSCPayloadFromFallbackPrerender } from './flight-data-helpers'\nimport { getDeploymentId } from '../shared/lib/deployment-id'\nimport { setNavigationBuildId } from './navigation-build-id'\nimport type { ClientInstrumentationModules } from './router-transition-types'\nimport { initializeRouterTransitionModules } from './components/router-transition'\n\n/// <reference types=\"react-dom/experimental\" />\n\nconst createFromReadableStream =\n createFromReadableStreamBrowser as (typeof import('react-server-dom-webpack/client.browser'))['createFromReadableStream']\nconst createFromFetch =\n createFromFetchBrowser as (typeof import('react-server-dom-webpack/client.browser'))['createFromFetch']\n\nconst appElement: HTMLElement | Document = document\n\n// Instant Navigation Testing API: captured once at module init. When truthy,\n// this is the fetch promise for the static RSC payload (set by an injected\n// <script> tag in the static shell HTML).\nconst instantTestStaticFetch: Promise<Response> | undefined =\n self.__next_instant_test\n ? (self.__next_instant_test as unknown as Promise<Response>)\n : undefined\n\nconst encoder = new TextEncoder()\n\nlet initialServerDataBuffer: (string | Uint8Array)[] | undefined = undefined\nlet initialServerDataWriter: ReadableStreamDefaultController | undefined =\n undefined\nlet initialServerDataLoaded = false\nlet initialServerDataFlushed = false\n\nlet initialFormStateData: null | any = null\n\ntype FlightSegment =\n | [isBootStrap: 0]\n | [isNotBootstrap: 1, responsePartial: string]\n | [isFormState: 2, formState: any]\n | [isBinary: 3, responseBase64Partial: string]\n\ntype NextFlight = Omit<Array<FlightSegment>, 'push'> & {\n push: (seg: FlightSegment) => void\n}\n\ndeclare global {\n // If you're working in a browser environment\n interface Window {\n /**\n * request ID, dev-only\n */\n __next_r?: string\n __next_f: NextFlight\n }\n}\n\nfunction nextServerDataCallback(seg: FlightSegment): void {\n if (seg[0] === 0) {\n initialServerDataBuffer = []\n } else if (seg[0] === 1) {\n if (!initialServerDataBuffer)\n throw new Error('Unexpected server data: missing bootstrap script.')\n\n if (initialServerDataWriter) {\n initialServerDataWriter.enqueue(encoder.encode(seg[1]))\n } else {\n initialServerDataBuffer.push(seg[1])\n }\n } else if (seg[0] === 2) {\n initialFormStateData = seg[1]\n } else if (seg[0] === 3) {\n if (!initialServerDataBuffer)\n throw new Error('Unexpected server data: missing bootstrap script.')\n\n // Decode the base64 string back to binary data.\n const binaryString = atob(seg[1])\n const decodedChunk = new Uint8Array(binaryString.length)\n for (var i = 0; i < binaryString.length; i++) {\n decodedChunk[i] = binaryString.charCodeAt(i)\n }\n\n if (initialServerDataWriter) {\n initialServerDataWriter.enqueue(decodedChunk)\n } else {\n initialServerDataBuffer.push(decodedChunk)\n }\n }\n}\n\nfunction isStreamErrorOrUnfinished(ctr: ReadableStreamDefaultController) {\n // If `desiredSize` is null, it means the stream is closed or errored. If it is lower than 0, the stream is still unfinished.\n return ctr.desiredSize === null || ctr.desiredSize < 0\n}\n\n// There might be race conditions between `nextServerDataRegisterWriter` and\n// `DOMContentLoaded`. The former will be called when React starts to hydrate\n// the root, the latter will be called when the DOM is fully loaded.\n// For streaming, the former is called first due to partial hydration.\n// For non-streaming, the latter can be called first.\n// Hence, we use two variables `initialServerDataLoaded` and\n// `initialServerDataFlushed` to make sure the writer will be closed and\n// `initialServerDataBuffer` will be cleared in the right time.\nfunction nextServerDataRegisterWriter(ctr: ReadableStreamDefaultController) {\n if (initialServerDataBuffer) {\n initialServerDataBuffer.forEach((val) => {\n ctr.enqueue(typeof val === 'string' ? encoder.encode(val) : val)\n })\n if (initialServerDataLoaded && !initialServerDataFlushed) {\n // Instant Navigation Testing API: don't close or error the inline\n // Flight stream. The static shell has no inline Flight data, so the\n // stream is empty. Closing it would cause React to log an error about\n // missing data. Leaving it open lets React treat any holes as\n // \"still suspended.\" Hydration uses the separately fetched RSC payload\n // (self.__next_instant_test), not this stream.\n if (isStreamErrorOrUnfinished(ctr)) {\n if (!instantTestStaticFetch) {\n ctr.error(\n new Error(\n 'The connection to the page was unexpectedly closed, possibly due to the stop button being clicked, loss of Wi-Fi, or an unstable internet connection.'\n )\n )\n }\n } else {\n ctr.close()\n }\n initialServerDataFlushed = true\n initialServerDataBuffer = undefined\n }\n }\n\n initialServerDataWriter = ctr\n}\n\n// When `DOMContentLoaded`, we can close all pending writers to finish hydration.\nconst DOMContentLoaded = function () {\n if (initialServerDataWriter && !initialServerDataFlushed) {\n initialServerDataWriter.close()\n initialServerDataFlushed = true\n initialServerDataBuffer = undefined\n }\n initialServerDataLoaded = true\n}\n\n// It's possible that the DOM is already loaded.\nif (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', DOMContentLoaded, false)\n} else {\n // Delayed in marco task to ensure it's executed later than hydration\n setTimeout(DOMContentLoaded)\n}\n\nconst nextServerDataLoadingGlobal = (self.__next_f = self.__next_f || [])\n\n// Consume all buffered chunks and clear the global data array right after to release memory.\n// Otherwise it will be retained indefinitely.\nnextServerDataLoadingGlobal.forEach(nextServerDataCallback)\nnextServerDataLoadingGlobal.length = 0\n\n// Patch its push method so subsequent chunks are handled (but not actually pushed to the array).\nnextServerDataLoadingGlobal.push = nextServerDataCallback\n\nlet readable: ReadableStream<Uint8Array> = new ReadableStream({\n start(controller) {\n nextServerDataRegisterWriter(controller)\n },\n})\nif (process.env.NODE_ENV !== 'production') {\n // @ts-expect-error\n readable.name = 'hydration'\n}\n\n// When Cache Components is enabled, tee the inlined Flight stream so we can\n// truncate a clone at the static stage byte boundary and cache it. We don't\n// know if `l` is present until React decodes the payload, so always tee and\n// cancel the clone if not needed.\nlet initialFlightStreamForCache: ReadableStream<Uint8Array> | null = null\nif (\n process.env.__NEXT_CACHE_COMPONENTS &&\n process.env.__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS\n) {\n const [forReact, forCache] = readable.tee()\n readable = forReact\n initialFlightStreamForCache = forCache\n}\n\nlet debugChannel:\n | { readable?: ReadableStream; writable?: WritableStream }\n | undefined\n\nif (\n process.env.__NEXT_DEV_SERVER &&\n process.env.__NEXT_REACT_DEBUG_CHANNEL &&\n typeof window !== 'undefined'\n) {\n const { createDebugChannel } =\n require('./dev/debug-channel') as typeof import('./dev/debug-channel')\n\n debugChannel = createDebugChannel(undefined)\n}\n\nlet initialServerResponse: Promise<InitialRSCPayload>\nif (instantTestStaticFetch) {\n // Instant Navigation Testing API: hydrate from the static RSC payload\n // fetch kicked off by an injected <script> tag, instead of the inline\n // Flight data (which is not present in the static shell).\n initialServerResponse = Promise.resolve(\n createFromFetch<InitialRSCPayload>(instantTestStaticFetch, {\n callServer,\n findSourceMapURL,\n debugChannel,\n // The static fetch response is a partial stream (static-only Flight\n // data with no dynamic content). Allow it to close without error so\n // React treats dynamic holes as still-suspended rather than\n // triggering error recovery.\n unstable_allowPartialStream: true,\n })\n ).then(async (initialRSCPayload) => {\n return createInitialRSCPayloadFromFallbackPrerender(\n await instantTestStaticFetch,\n initialRSCPayload\n )\n })\n} else if (\n // @ts-expect-error\n window.__NEXT_CLIENT_RESUME\n) {\n const clientResumeFetch: Promise<Response> =\n // @ts-expect-error\n window.__NEXT_CLIENT_RESUME\n initialServerResponse = Promise.resolve(\n createFromFetch<InitialRSCPayload>(clientResumeFetch, {\n callServer,\n findSourceMapURL,\n debugChannel,\n })\n ).then(async (fallbackInitialRSCPayload) =>\n createInitialRSCPayloadFromFallbackPrerender(\n await clientResumeFetch,\n fallbackInitialRSCPayload\n )\n )\n} else {\n initialServerResponse = createFromReadableStream<InitialRSCPayload>(\n readable,\n {\n callServer,\n findSourceMapURL,\n debugChannel,\n startTime: 0,\n }\n )\n}\n\nfunction ServerRoot({\n initialRSCPayload,\n actionQueue,\n webSocket,\n staticIndicatorState,\n}: {\n initialRSCPayload: InitialRSCPayload\n actionQueue: AppRouterActionQueue\n webSocket: WebSocket | undefined\n staticIndicatorState: StaticIndicatorState | undefined\n}): React.ReactNode {\n const router = (\n <AppRouter\n actionQueue={actionQueue}\n globalErrorState={initialRSCPayload.G}\n webSocket={webSocket}\n staticIndicatorState={staticIndicatorState}\n />\n )\n\n if (process.env.NODE_ENV === 'development' && initialRSCPayload.m) {\n // We provide missing slot information in a context provider only during development\n // as we log some additional information about the missing slots in the console.\n return (\n <MissingSlotContext value={initialRSCPayload.m}>\n {router}\n </MissingSlotContext>\n )\n }\n\n return router\n}\n\nconst StrictModeIfEnabled = process.env.__NEXT_STRICT_MODE_APP\n ? React.StrictMode\n : React.Fragment\n\nfunction Root({ children }: React.PropsWithChildren<{}>) {\n if (process.env.__NEXT_TEST_MODE) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n window.__NEXT_HYDRATED = true\n window.__NEXT_HYDRATED_AT = performance.now()\n window.__NEXT_HYDRATED_CB?.()\n }, [])\n }\n\n return children\n}\n\nconst enableTransitionIndicator = process.env.__NEXT_TRANSITION_INDICATOR\n\nfunction noDefaultTransitionIndicator() {\n return () => {}\n}\n\nconst reactRootOptions: ReactDOMClient.RootOptions = {\n onDefaultTransitionIndicator: enableTransitionIndicator\n ? // TODO: Compose default with user-configureable (e.g. nprogress)\n undefined\n : noDefaultTransitionIndicator,\n onRecoverableError,\n onCaughtError,\n onUncaughtError,\n}\n\nexport async function hydrate(\n instrumentationModules: ClientInstrumentationModules,\n assetPrefix: string\n) {\n let staticIndicatorState: StaticIndicatorState | undefined\n let webSocket: WebSocket | undefined\n\n if (process.env.__NEXT_DEV_SERVER) {\n const { createWebSocket } =\n require('./dev/hot-reloader/app/web-socket') as typeof import('./dev/hot-reloader/app/web-socket')\n\n staticIndicatorState = { pathname: null, appIsrManifest: null }\n webSocket = createWebSocket(assetPrefix, staticIndicatorState)\n }\n const initialRSCPayload = await initialServerResponse\n\n // Initialize the offline module to register browser event listeners\n // (offline/online) before any components hydrate.\n if (process.env.__NEXT_USE_OFFLINE) {\n require('./components/offline') as typeof import('./components/offline')\n }\n\n // setNavigationBuildId should be called only once, during JS initialization\n // and before any components have hydrated.\n if (initialRSCPayload.b) {\n setNavigationBuildId(initialRSCPayload.b!)\n } else {\n setNavigationBuildId(getDeploymentId()!)\n }\n\n initializeRouterTransitionModules(instrumentationModules)\n\n const initialTimestamp = Date.now()\n const actionQueue: AppRouterActionQueue = createMutableActionQueue(\n createInitialRouterState({\n navigatedAt: initialTimestamp,\n initialRSCPayload,\n initialFlightStreamForCache,\n location: window.location,\n })\n )\n\n const reactEl = (\n <StrictModeIfEnabled>\n <HeadManagerContext.Provider value={{ appDir: true }}>\n <Root>\n <ServerRoot\n initialRSCPayload={initialRSCPayload}\n actionQueue={actionQueue}\n webSocket={webSocket}\n staticIndicatorState={staticIndicatorState}\n />\n </Root>\n </HeadManagerContext.Provider>\n </StrictModeIfEnabled>\n )\n\n if (document.documentElement.id === '__next_error__') {\n let element = reactEl\n // Server rendering failed, fall back to client-side rendering\n if (process.env.NODE_ENV !== 'production') {\n const { RootLevelDevOverlayElement } =\n require('../next-devtools/userspace/app/client-entry') as typeof import('../next-devtools/userspace/app/client-entry')\n\n // Note this won't cause hydration mismatch because we are doing CSR w/o hydration\n element = (\n <RootLevelDevOverlayElement>{element}</RootLevelDevOverlayElement>\n )\n }\n\n ReactDOMClient.createRoot(appElement, reactRootOptions).render(element)\n } else {\n React.startTransition(() => {\n ReactDOMClient.hydrateRoot(appElement, reactEl, {\n ...reactRootOptions,\n formState: initialFormStateData,\n })\n })\n }\n\n // TODO-APP: Remove this logic when Float has GC built-in in development.\n if (process.env.__NEXT_DEV_SERVER) {\n const { linkGc } =\n require('./app-link-gc') as typeof import('./app-link-gc')\n linkGc()\n }\n}\n"],"names":["ReactDOMClient","React","createFromReadableStream","createFromReadableStreamBrowser","createFromFetch","createFromFetchBrowser","HeadManagerContext","onRecoverableError","onCaughtError","onUncaughtError","callServer","findSourceMapURL","createMutableActionQueue","AppRouter","createInitialRouterState","MissingSlotContext","createInitialRSCPayloadFromFallbackPrerender","getDeploymentId","setNavigationBuildId","initializeRouterTransitionModules","appElement","document","instantTestStaticFetch","self","__next_instant_test","undefined","encoder","TextEncoder","initialServerDataBuffer","initialServerDataWriter","initialServerDataLoaded","initialServerDataFlushed","initialFormStateData","nextServerDataCallback","seg","Error","enqueue","encode","push","binaryString","atob","decodedChunk","Uint8Array","length","i","charCodeAt","isStreamErrorOrUnfinished","ctr","desiredSize","nextServerDataRegisterWriter","forEach","val","error","close","DOMContentLoaded","readyState","addEventListener","setTimeout","nextServerDataLoadingGlobal","__next_f","readable","ReadableStream","start","controller","process","env","NODE_ENV","name","initialFlightStreamForCache","__NEXT_CACHE_COMPONENTS","__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS","forReact","forCache","tee","debugChannel","__NEXT_DEV_SERVER","__NEXT_REACT_DEBUG_CHANNEL","window","createDebugChannel","require","initialServerResponse","Promise","resolve","unstable_allowPartialStream","then","initialRSCPayload","__NEXT_CLIENT_RESUME","clientResumeFetch","fallbackInitialRSCPayload","startTime","ServerRoot","actionQueue","webSocket","staticIndicatorState","router","globalErrorState","G","m","value","StrictModeIfEnabled","__NEXT_STRICT_MODE_APP","StrictMode","Fragment","Root","children","__NEXT_TEST_MODE","useEffect","__NEXT_HYDRATED","__NEXT_HYDRATED_AT","performance","now","__NEXT_HYDRATED_CB","enableTransitionIndicator","__NEXT_TRANSITION_INDICATOR","noDefaultTransitionIndicator","reactRootOptions","onDefaultTransitionIndicator","hydrate","instrumentationModules","assetPrefix","createWebSocket","pathname","appIsrManifest","__NEXT_USE_OFFLINE","b","initialTimestamp","Date","navigatedAt","location","reactEl","Provider","appDir","documentElement","id","element","RootLevelDevOverlayElement","createRoot","render","startTransition","hydrateRoot","formState","linkGc"],"mappings":";AAAA,OAAO,gBAAe;AACtB,OAAOA,oBAAoB,mBAAkB;AAC7C,OAAOC,WAAW,QAAO;AACzB,8CAA8C;AAC9C,6DAA6D;AAC7D,SACEC,4BAA4BC,+BAA+B,EAC3DC,mBAAmBC,sBAAsB,QACpC,kCAAiC;AACxC,SAASC,kBAAkB,QAAQ,oDAAmD;AACtF,SAASC,kBAAkB,QAAQ,gDAA+C;AAClF,SACEC,aAAa,EACbC,eAAe,QACV,oDAAmD;AAC1D,SAASC,UAAU,QAAQ,oBAAmB;AAC9C,SAASC,gBAAgB,QAAQ,4BAA2B;AAC5D,SAEEC,wBAAwB,QACnB,mCAAkC;AACzC,OAAOC,eAAe,0BAAyB;AAE/C,SAASC,wBAAwB,QAAQ,0DAAyD;AAClG,SAASC,kBAAkB,QAAQ,kDAAiD;AAEpF,SAASC,4CAA4C,QAAQ,wBAAuB;AACpF,SAASC,eAAe,QAAQ,8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AAMyI,eAAe,CAAC;YACpB1I,eAAe2I,WAAW,CAACvH,YAAY6G,SAAS;gBAC9C,GAAGd,gBAAgB;gBACnByB,WAAW5G;YACb;QACF;IACF;IAEA,yEAAyE;IACzE,IAAIgC,QAAQC,GAAG,CAACU,iBAAiB,EAAE;QACjC,MAAM,EAAEkE,MAAM,EAAE,GACd9D,QAAQ;QACV8D;IACF;AACF","ignoreList":[0]} |
@@ -8,3 +8,3 @@ // TODO-APP: hydration warning | ||
| // eslint-disable-next-line @next/internal/typechecked-require | ||
| const instrumentationHooks = require('../lib/require-instrumentation-client'); | ||
| const instrumentationModules = require('../lib/require-instrumentation-client'); | ||
| appBootstrap((assetPrefix)=>{ | ||
@@ -14,3 +14,3 @@ const enableCacheIndicator = process.env.__NEXT_CACHE_COMPONENTS; | ||
| try { | ||
| hydrate(instrumentationHooks, assetPrefix); | ||
| hydrate(instrumentationModules, assetPrefix); | ||
| } finally{ | ||
@@ -17,0 +17,0 @@ renderAppDevOverlay(getOwnerStack, isRecoverableError, enableCacheIndicator); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/client/app-next-dev.ts"],"sourcesContent":["// TODO-APP: hydration warning\n\nimport './app-webpack'\n\nimport { renderAppDevOverlay } from 'next/dist/compiled/next-devtools'\nimport { appBootstrap } from './app-bootstrap'\nimport { getOwnerStack } from '../next-devtools/userspace/app/errors/stitched-error'\nimport { isRecoverableError } from './react-client-callbacks/on-recoverable-error'\n\n// eslint-disable-next-line @next/internal/typechecked-require\nconst instrumentationHooks = require('../lib/require-instrumentation-client')\n\nappBootstrap((assetPrefix) => {\n const enableCacheIndicator = process.env.__NEXT_CACHE_COMPONENTS\n\n const { hydrate } = require('./app-index') as typeof import('./app-index')\n try {\n hydrate(instrumentationHooks, assetPrefix)\n } finally {\n renderAppDevOverlay(getOwnerStack, isRecoverableError, enableCacheIndicator)\n }\n})\n"],"names":["renderAppDevOverlay","appBootstrap","getOwnerStack","isRecoverableError","instrumentationHooks","require","assetPrefix","enableCacheIndicator","process","env","__NEXT_CACHE_COMPONENTS","hydrate"],"mappings":"AAAA,8BAA8B;AAE9B,OAAO,gBAAe;AAEtB,SAASA,mBAAmB,QAAQ,mCAAkC;AACtE,SAASC,YAAY,QAAQ,kBAAiB;AAC9C,SAASC,aAAa,QAAQ,uDAAsD;AACpF,SAASC,kBAAkB,QAAQ,gDAA+C;AAElF,8DAA8D;AAC9D,MAAMC,uBAAuBC,QAAQ;AAErCJ,aAAa,CAACK;IACZ,MAAMC,uBAAuBC,QAAQC,GAAG,CAACC,uBAAuB;IAEhE,MAAM,EAAEC,OAAO,EAAE,GAAGN,QAAQ;IAC5B,IAAI;QACFM,QAAQP,sBAAsBE;IAChC,SAAU;QACRN,oBAAoBE,eAAeC,oBAAoBI;IACzD;AACF","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/client/app-next-dev.ts"],"sourcesContent":["// TODO-APP: hydration warning\n\nimport './app-webpack'\n\nimport { renderAppDevOverlay } from 'next/dist/compiled/next-devtools'\nimport { appBootstrap } from './app-bootstrap'\nimport { getOwnerStack } from '../next-devtools/userspace/app/errors/stitched-error'\nimport { isRecoverableError } from './react-client-callbacks/on-recoverable-error'\n\n// eslint-disable-next-line @next/internal/typechecked-require\nconst instrumentationModules = require('../lib/require-instrumentation-client')\n\nappBootstrap((assetPrefix) => {\n const enableCacheIndicator = process.env.__NEXT_CACHE_COMPONENTS\n\n const { hydrate } = require('./app-index') as typeof import('./app-index')\n try {\n hydrate(instrumentationModules, assetPrefix)\n } finally {\n renderAppDevOverlay(getOwnerStack, isRecoverableError, enableCacheIndicator)\n }\n})\n"],"names":["renderAppDevOverlay","appBootstrap","getOwnerStack","isRecoverableError","instrumentationModules","require","assetPrefix","enableCacheIndicator","process","env","__NEXT_CACHE_COMPONENTS","hydrate"],"mappings":"AAAA,8BAA8B;AAE9B,OAAO,gBAAe;AAEtB,SAASA,mBAAmB,QAAQ,mCAAkC;AACtE,SAASC,YAAY,QAAQ,kBAAiB;AAC9C,SAASC,aAAa,QAAQ,uDAAsD;AACpF,SAASC,kBAAkB,QAAQ,gDAA+C;AAElF,8DAA8D;AAC9D,MAAMC,yBAAyBC,QAAQ;AAEvCJ,aAAa,CAACK;IACZ,MAAMC,uBAAuBC,QAAQC,GAAG,CAACC,uBAAuB;IAEhE,MAAM,EAAEC,OAAO,EAAE,GAAGN,QAAQ;IAC5B,IAAI;QACFM,QAAQP,wBAAwBE;IAClC,SAAU;QACRN,oBAAoBE,eAAeC,oBAAoBI;IACzD;AACF","ignoreList":[0]} |
@@ -7,7 +7,7 @@ import './register-deployment-id-global'; | ||
| // eslint-disable-next-line @next/internal/typechecked-require | ||
| const instrumentationHooks = require('../lib/require-instrumentation-client'); | ||
| const instrumentationModules = require('../lib/require-instrumentation-client'); | ||
| appBootstrap((assetPrefix)=>{ | ||
| const { hydrate } = require('./app-index'); | ||
| try { | ||
| hydrate(instrumentationHooks, assetPrefix); | ||
| hydrate(instrumentationModules, assetPrefix); | ||
| } finally{ | ||
@@ -14,0 +14,0 @@ if (process.env.__NEXT_DEV_SERVER) { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/client/app-next-turbopack.ts"],"sourcesContent":["import './register-deployment-id-global'\nimport { appBootstrap } from './app-bootstrap'\nimport { isRecoverableError } from './react-client-callbacks/on-recoverable-error'\n\nwindow.next.turbopack = true\n;(self as any).__webpack_hash__ = ''\n\n// eslint-disable-next-line @next/internal/typechecked-require\nconst instrumentationHooks = require('../lib/require-instrumentation-client')\n\nappBootstrap((assetPrefix) => {\n const { hydrate } = require('./app-index') as typeof import('./app-index')\n try {\n hydrate(instrumentationHooks, assetPrefix)\n } finally {\n if (process.env.__NEXT_DEV_SERVER) {\n const enableCacheIndicator = process.env.__NEXT_CACHE_COMPONENTS\n const { getOwnerStack } =\n require('../next-devtools/userspace/app/errors/stitched-error') as typeof import('../next-devtools/userspace/app/errors/stitched-error')\n const { renderAppDevOverlay } =\n require('next/dist/compiled/next-devtools') as typeof import('next/dist/compiled/next-devtools')\n renderAppDevOverlay(\n getOwnerStack,\n isRecoverableError,\n enableCacheIndicator\n )\n }\n }\n})\n"],"names":["appBootstrap","isRecoverableError","window","next","turbopack","self","__webpack_hash__","instrumentationHooks","require","assetPrefix","hydrate","process","env","__NEXT_DEV_SERVER","enableCacheIndicator","__NEXT_CACHE_COMPONENTS","getOwnerStack","renderAppDevOverlay"],"mappings":"AAAA,OAAO,kCAAiC;AACxC,SAASA,YAAY,QAAQ,kBAAiB;AAC9C,SAASC,kBAAkB,QAAQ,gDAA+C;AAElFC,OAAOC,IAAI,CAACC,SAAS,GAAG;AACtBC,KAAaC,gBAAgB,GAAG;AAElC,8DAA8D;AAC9D,MAAMC,uBAAuBC,QAAQ;AAErCR,aAAa,CAACS;IACZ,MAAM,EAAEC,OAAO,EAAE,GAAGF,QAAQ;IAC5B,IAAI;QACFE,QAAQH,sBAAsBE;IAChC,SAAU;QACR,IAAIE,QAAQC,GAAG,CAACC,iBAAiB,EAAE;YACjC,MAAMC,uBAAuBH,QAAQC,GAAG,CAACG,uBAAuB;YAChE,MAAM,EAAEC,aAAa,EAAE,GACrBR,QAAQ;YACV,MAAM,EAAES,mBAAmB,EAAE,GAC3BT,QAAQ;YACVS,oBACED,eACAf,oBACAa;QAEJ;IACF;AACF","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/client/app-next-turbopack.ts"],"sourcesContent":["import './register-deployment-id-global'\nimport { appBootstrap } from './app-bootstrap'\nimport { isRecoverableError } from './react-client-callbacks/on-recoverable-error'\n\nwindow.next.turbopack = true\n;(self as any).__webpack_hash__ = ''\n\n// eslint-disable-next-line @next/internal/typechecked-require\nconst instrumentationModules = require('../lib/require-instrumentation-client')\n\nappBootstrap((assetPrefix) => {\n const { hydrate } = require('./app-index') as typeof import('./app-index')\n try {\n hydrate(instrumentationModules, assetPrefix)\n } finally {\n if (process.env.__NEXT_DEV_SERVER) {\n const enableCacheIndicator = process.env.__NEXT_CACHE_COMPONENTS\n const { getOwnerStack } =\n require('../next-devtools/userspace/app/errors/stitched-error') as typeof import('../next-devtools/userspace/app/errors/stitched-error')\n const { renderAppDevOverlay } =\n require('next/dist/compiled/next-devtools') as typeof import('next/dist/compiled/next-devtools')\n renderAppDevOverlay(\n getOwnerStack,\n isRecoverableError,\n enableCacheIndicator\n )\n }\n }\n})\n"],"names":["appBootstrap","isRecoverableError","window","next","turbopack","self","__webpack_hash__","instrumentationModules","require","assetPrefix","hydrate","process","env","__NEXT_DEV_SERVER","enableCacheIndicator","__NEXT_CACHE_COMPONENTS","getOwnerStack","renderAppDevOverlay"],"mappings":"AAAA,OAAO,kCAAiC;AACxC,SAASA,YAAY,QAAQ,kBAAiB;AAC9C,SAASC,kBAAkB,QAAQ,gDAA+C;AAElFC,OAAOC,IAAI,CAACC,SAAS,GAAG;AACtBC,KAAaC,gBAAgB,GAAG;AAElC,8DAA8D;AAC9D,MAAMC,yBAAyBC,QAAQ;AAEvCR,aAAa,CAACS;IACZ,MAAM,EAAEC,OAAO,EAAE,GAAGF,QAAQ;IAC5B,IAAI;QACFE,QAAQH,wBAAwBE;IAClC,SAAU;QACR,IAAIE,QAAQC,GAAG,CAACC,iBAAiB,EAAE;YACjC,MAAMC,uBAAuBH,QAAQC,GAAG,CAACG,uBAAuB;YAChE,MAAM,EAAEC,aAAa,EAAE,GACrBR,QAAQ;YACV,MAAM,EAAES,mBAAmB,EAAE,GAC3BT,QAAQ;YACVS,oBACED,eACAf,oBACAa;QAEJ;IACF;AACF","ignoreList":[0]} |
@@ -5,3 +5,3 @@ // This import must go first because it needs to patch webpack chunk loading | ||
| import { appBootstrap } from './app-bootstrap'; | ||
| const instrumentationHooks = // eslint-disable-next-line @next/internal/typechecked-require -- not a module | ||
| const instrumentationModules = // eslint-disable-next-line @next/internal/typechecked-require -- not a module | ||
| require('../lib/require-instrumentation-client'); | ||
@@ -15,5 +15,5 @@ appBootstrap((assetPrefix)=>{ | ||
| require('next/dist/client/components/layout-router'); | ||
| hydrate(instrumentationHooks, assetPrefix); | ||
| hydrate(instrumentationModules, assetPrefix); | ||
| }); | ||
| //# sourceMappingURL=app-next.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/client/app-next.ts"],"sourcesContent":["// This import must go first because it needs to patch webpack chunk loading\n// before React patches chunk loading.\nimport './app-webpack'\nimport { appBootstrap } from './app-bootstrap'\n\nconst instrumentationHooks =\n // eslint-disable-next-line @next/internal/typechecked-require -- not a module\n require('../lib/require-instrumentation-client')\n\nappBootstrap((assetPrefix) => {\n const { hydrate } = require('./app-index') as typeof import('./app-index')\n // Include app-router and layout-router in the main chunk\n // eslint-disable-next-line @next/internal/typechecked-require -- Why not relative imports?\n require('next/dist/client/components/app-router')\n // eslint-disable-next-line @next/internal/typechecked-require -- Why not relative imports?\n require('next/dist/client/components/layout-router')\n hydrate(instrumentationHooks, assetPrefix)\n})\n"],"names":["appBootstrap","instrumentationHooks","require","assetPrefix","hydrate"],"mappings":"AAAA,4EAA4E;AAC5E,sCAAsC;AACtC,OAAO,gBAAe;AACtB,SAASA,YAAY,QAAQ,kBAAiB;AAE9C,MAAMC,uBACJ,8EAA8E;AAC9EC,QAAQ;AAEVF,aAAa,CAACG;IACZ,MAAM,EAAEC,OAAO,EAAE,GAAGF,QAAQ;IAC5B,yDAAyD;IACzD,2FAA2F;IAC3FA,QAAQ;IACR,2FAA2F;IAC3FA,QAAQ;IACRE,QAAQH,sBAAsBE;AAChC","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/client/app-next.ts"],"sourcesContent":["// This import must go first because it needs to patch webpack chunk loading\n// before React patches chunk loading.\nimport './app-webpack'\nimport { appBootstrap } from './app-bootstrap'\n\nconst instrumentationModules =\n // eslint-disable-next-line @next/internal/typechecked-require -- not a module\n require('../lib/require-instrumentation-client')\n\nappBootstrap((assetPrefix) => {\n const { hydrate } = require('./app-index') as typeof import('./app-index')\n // Include app-router and layout-router in the main chunk\n // eslint-disable-next-line @next/internal/typechecked-require -- Why not relative imports?\n require('next/dist/client/components/app-router')\n // eslint-disable-next-line @next/internal/typechecked-require -- Why not relative imports?\n require('next/dist/client/components/layout-router')\n hydrate(instrumentationModules, assetPrefix)\n})\n"],"names":["appBootstrap","instrumentationModules","require","assetPrefix","hydrate"],"mappings":"AAAA,4EAA4E;AAC5E,sCAAsC;AACtC,OAAO,gBAAe;AACtB,SAASA,YAAY,QAAQ,kBAAiB;AAE9C,MAAMC,yBACJ,8EAA8E;AAC9EC,QAAQ;AAEVF,aAAa,CAACG;IACZ,MAAM,EAAEC,OAAO,EAAE,GAAGF,QAAQ;IAC5B,yDAAyD;IACzD,2FAA2F;IAC3FA,QAAQ;IACR,2FAA2F;IAC3FA,QAAQ;IACRE,QAAQH,wBAAwBE;AAClC","ignoreList":[0]} |
@@ -15,2 +15,3 @@ import { ACTION_REFRESH, ACTION_SERVER_ACTION, ACTION_NAVIGATE, ACTION_RESTORE, ACTION_HMR_REFRESH, PrefetchKind, ScrollBehavior } from './router-reducer/router-reducer-types'; | ||
| import { isJavaScriptURLString } from '../lib/javascript-url'; | ||
| import { startRouterTransition } from './router-transition'; | ||
| function runRemainingActions(actionQueue, setState) { | ||
@@ -132,3 +133,3 @@ if (actionQueue.pending !== null) { | ||
| let globalActionQueue = null; | ||
| export function createMutableActionQueue(initialState, instrumentationHooks) { | ||
| export function createMutableActionQueue(initialState) { | ||
| const actionQueue = { | ||
@@ -142,4 +143,3 @@ state: initialState, | ||
| pending: null, | ||
| last: null, | ||
| onRouterTransitionStart: instrumentationHooks !== null && typeof instrumentationHooks.onRouterTransitionStart === 'function' ? instrumentationHooks.onRouterTransitionStart : null | ||
| last: null | ||
| }; | ||
@@ -174,9 +174,3 @@ if (typeof window !== 'undefined') { | ||
| } | ||
| function getProfilingHookForOnNavigationStart() { | ||
| if (globalActionQueue !== null) { | ||
| return globalActionQueue.onRouterTransitionStart; | ||
| } | ||
| return null; | ||
| } | ||
| export function dispatchNavigateAction(href, navigateType, scrollBehavior, linkInstanceRef, transitionTypes) { | ||
| export function dispatchNavigateAction(href, navigateType, scrollBehavior, linkInstanceRef, transitionTypes, prefetchIntent) { | ||
| // TODO: This stuff could just go into the reducer. Leaving as-is for now | ||
@@ -194,6 +188,3 @@ // since we're about to rewrite all the router reducer stuff anyway. | ||
| setLinkForCurrentNavigation(linkInstanceRef); | ||
| const onRouterTransitionStart = getProfilingHookForOnNavigationStart(); | ||
| if (onRouterTransitionStart !== null) { | ||
| onRouterTransitionStart(href, navigateType); | ||
| } | ||
| startRouterTransition(href, navigateType, getAppRouterActionQueue().state.tree, prefetchIntent); | ||
| dispatchAppRouterAction({ | ||
@@ -209,6 +200,3 @@ type: ACTION_NAVIGATE, | ||
| export function dispatchTraverseAction(href, historyState) { | ||
| const onRouterTransitionStart = getProfilingHookForOnNavigationStart(); | ||
| if (onRouterTransitionStart !== null) { | ||
| onRouterTransitionStart(href, 'traverse'); | ||
| } | ||
| startRouterTransition(href, 'traverse', getAppRouterActionQueue().state.tree, null); | ||
| dispatchAppRouterAction({ | ||
@@ -316,3 +304,3 @@ type: ACTION_RESTORE, | ||
| startTransition(()=>{ | ||
| dispatchNavigateAction(href, 'replace', options?.scroll === false ? ScrollBehavior.NoScroll : ScrollBehavior.Default, null, options?.transitionTypes); | ||
| dispatchNavigateAction(href, 'replace', options?.scroll === false ? ScrollBehavior.NoScroll : ScrollBehavior.Default, null, options?.transitionTypes, null); | ||
| }); | ||
@@ -329,3 +317,3 @@ }, | ||
| startTransition(()=>{ | ||
| dispatchNavigateAction(href, 'push', options?.scroll === false ? ScrollBehavior.NoScroll : ScrollBehavior.Default, null, options?.transitionTypes); | ||
| dispatchNavigateAction(href, 'push', options?.scroll === false ? ScrollBehavior.NoScroll : ScrollBehavior.Default, null, options?.transitionTypes, null); | ||
| }); | ||
@@ -332,0 +320,0 @@ }, |
@@ -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 { ClientInstrumentationHooks } from '../app-index'\nimport type { GlobalErrorComponent } from './builtin/global-error'\nimport { isJavaScriptURLString } from '../lib/javascript-url'\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 onRouterTransitionStart:\n | ((url: string, type: 'push' | 'replace' | 'traverse') => void)\n | null\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 setState: DispatchStatePromise\n) {\n if (actionQueue.pending !== null) {\n actionQueue.pending = actionQueue.pending.next\n if (actionQueue.pending !== null) {\n runAction({\n actionQueue,\n action: actionQueue.pending,\n setState,\n })\n }\n } else {\n // Check for refresh when pending is already null\n // This handles the case where a discarded server action completes\n // after the navigation has already finished and the queue is empty\n if (actionQueue.needsRefresh) {\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 // Still need to run remaining actions even for discarded actions\n // to potentially trigger the refresh\n runRemainingActions(actionQueue, setState)\n return\n }\n\n actionQueue.state = nextState\n\n runRemainingActions(actionQueue, 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, 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 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 instrumentationHooks: ClientInstrumentationHooks | null\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 onRouterTransitionStart:\n instrumentationHooks !== null &&\n typeof instrumentationHooks.onRouterTransitionStart === 'function'\n ? // This profiling hook will be called at the start of every navigation.\n instrumentationHooks.onRouterTransitionStart\n : 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\nfunction getProfilingHookForOnNavigationStart() {\n if (globalActionQueue !== null) {\n return globalActionQueue.onRouterTransitionStart\n }\n return null\n}\n\nexport function dispatchNavigateAction(\n href: string,\n navigateType: NavigateAction['navigateType'],\n scrollBehavior: ScrollBehavior,\n linkInstanceRef: LinkInstance | null,\n transitionTypes: string[] | undefined\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\n const onRouterTransitionStart = getProfilingHookForOnNavigationStart()\n if (onRouterTransitionStart !== null) {\n onRouterTransitionStart(href, navigateType)\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 const onRouterTransitionStart = getProfilingHookForOnNavigationStart()\n if (onRouterTransitionStart !== null) {\n onRouterTransitionStart(href, 'traverse')\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/**\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 )\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 )\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 startTransition(() => {\n dispatchAppRouterAction({\n type: ACTION_HMR_REFRESH,\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","runRemainingActions","actionQueue","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","instrumentationHooks","result","onRouterTransitionStart","window","Error","getCurrentAppRouterState","getAppRouterActionQueue","getProfilingHookForOnNavigationStart","dispatchNavigateAction","href","navigateType","scrollBehavior","linkInstanceRef","transitionTypes","url","URL","location","process","env","__NEXT_APP_NAV_FAIL_HANDLING","__pendingUrl","isExternalUrl","locationSearch","search","dispatchTraverseAction","historyState","gesturePush","options","__NEXT_GESTURE_TRANSITION","currentUrl","canonicalUrl","scroll","NoScroll","Default","freshnessPolicy","Gesture","forkedGestureState","renderedSearch","cache","tree","nextUrl","publicAppRouterInstance","back","history","forward","prefetchKind","kind","AUTO","fetchStrategy","PPR","FULL","Full","onInvalidate","replace","push","refresh","hmrRefresh","NODE_ENV","bfcacheId","experimental_gesturePush","router"],"mappings":"AAAA,SAIEA,cAAc,EACdC,oBAAoB,EACpBC,eAAe,EAC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,wBAAwB,GAAGjC;AAC/D;AAEA,gEAAgE;AAChE,IAAI,OAAOvB,WAAW,eAAeA,OAAO9B,IAAI,EAAE;IAChD8B,OAAO9B,IAAI,CAACuF,MAAM,GAAGnB;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 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 setState: DispatchStatePromise\n) {\n if (actionQueue.pending !== null) {\n actionQueue.pending = actionQueue.pending.next\n if (actionQueue.pending !== null) {\n runAction({\n actionQueue,\n action: actionQueue.pending,\n setState,\n })\n }\n } else {\n // Check for refresh when pending is already null\n // This handles the case where a discarded server action completes\n // after the navigation has already finished and the queue is empty\n if (actionQueue.needsRefresh) {\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 // Still need to run remaining actions even for discarded actions\n // to potentially trigger the refresh\n runRemainingActions(actionQueue, setState)\n return\n }\n\n actionQueue.state = nextState\n\n runRemainingActions(actionQueue, 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, 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 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/**\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 startTransition(() => {\n dispatchAppRouterAction({\n type: ACTION_HMR_REFRESH,\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","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","publicAppRouterInstance","back","history","forward","prefetchKind","kind","AUTO","fetchStrategy","PPR","FULL","Full","onInvalidate","replace","push","refresh","hmrRefresh","NODE_ENV","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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AAI3D,sBAAsBuC,OAAO;YAC/B,MAAM,qBAEL,CAFK,IAAIJ,MACR,oEADI,qBAAA;uBAAA;4BAAA;8BAAA;YAEN;QACF;QACAhD,gBAAgB;YACdmD,uBACEC,MACA,WACAoB,SAASI,WAAW,QAChB/E,eAAegF,QAAQ,GACvBhF,eAAeiF,OAAO,EAC1B,MACAN,SAAShB,iBACT;QAEJ;IACF;IACA0C,MAAM,CAAC9C,MAAcoB;QACnB,IAAI3D,sBAAsBuC,OAAO;YAC/B,MAAM,qBAEL,CAFK,IAAIJ,MACR,oEADI,qBAAA;uBAAA;4BAAA;8BAAA;YAEN;QACF;QACAhD,gBAAgB;YACdmD,uBACEC,MACA,QACAoB,SAASI,WAAW,QAChB/E,eAAegF,QAAQ,GACvBhF,eAAeiF,OAAO,EAC1B,MACAN,SAAShB,iBACT;QAEJ;IACF;IACA2C,SAAS;QACPnG,gBAAgB;YACdM,wBAAwB;gBACtBkB,MAAMjC;YACR;QACF;IACF;IACA6G,YAAY;QACV,IAAIvC,QAAQC,GAAG,CAACuC,QAAQ,KAAK,eAAe;YAC1C,MAAM,qBAEL,CAFK,IAAIrD,MACR,iFADI,qBAAA;uBAAA;4BAAA;8BAAA;YAEN;QACF,OAAO;YACL,qEAAqE;YACrE,yCAAyC;YACzCxC;YACAR,gBAAgB;gBACdM,wBAAwB;oBACtBkB,MAAM7B;gBACR;YACF;QACF;IACF;IACA,6EAA6E;IAC7E,oBAAoB;IACpB2G,WAAW;AACb,EAAC;AAED,+EAA+E;AAC/E,IAAIzC,QAAQC,GAAG,CAACW,yBAAyB,EAAE;;IACvCY,wBAAgCkB,wBAAwB,GAAGhC;AAC/D;AAEA,gEAAgE;AAChE,IAAI,OAAOxB,WAAW,eAAeA,OAAO5B,IAAI,EAAE;IAChD4B,OAAO5B,IAAI,CAACqF,MAAM,GAAGnB;AACvB","ignoreList":[0]} |
@@ -16,3 +16,3 @@ import { INTERCEPTION_ROUTE_MARKERS } from '../../../shared/lib/router/utils/interception-routes'; | ||
| }; | ||
| const segmentToSourcePagePathname = (segment)=>{ | ||
| export const segmentToSourcePagePathname = (segment)=>{ | ||
| if (typeof segment === 'string') { | ||
@@ -19,0 +19,0 @@ if (segment === 'children') return ''; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../../src/client/components/router-reducer/compute-changed-path.ts"],"sourcesContent":["import type {\n FlightRouterState,\n Segment,\n} from '../../../shared/lib/app-router-types'\nimport { INTERCEPTION_ROUTE_MARKERS } from '../../../shared/lib/router/utils/interception-routes'\nimport type { Params } from '../../../server/request/params'\nimport {\n isGroupSegment,\n DEFAULT_SEGMENT_KEY,\n PAGE_SEGMENT_KEY,\n} from '../../../shared/lib/segment'\nimport { matchSegment } from '../match-segments'\n\nconst removeLeadingSlash = (segment: string): string => {\n return segment[0] === '/' ? segment.slice(1) : segment\n}\n\nconst segmentToPathname = (segment: Segment): string => {\n if (typeof segment === 'string') {\n // 'children' is not a valid path -- it's technically a parallel route that corresponds with the current segment's page\n // if we don't skip it, then the computed pathname might be something like `/children` which doesn't make sense.\n if (segment === 'children') return ''\n\n return segment\n }\n\n return segment[1]\n}\n\nconst segmentToSourcePagePathname = (segment: Segment): string => {\n if (typeof segment === 'string') {\n if (segment === 'children') return ''\n if (segment.startsWith(PAGE_SEGMENT_KEY)) return 'page'\n return segment\n }\n\n const [paramName, , dynamicParamType] = segment\n\n switch (dynamicParamType) {\n case 'c':\n return `[...${paramName}]`\n case 'ci(..)(..)':\n return `(..)(..)[...${paramName}]`\n case 'ci(.)':\n return `(.)[...${paramName}]`\n case 'ci(..)':\n return `(..)[...${paramName}]`\n case 'ci(...)':\n return `(...)[...${paramName}]`\n case 'oc':\n return `[[...${paramName}]]`\n case 'd':\n return `[${paramName}]`\n case 'di(..)(..)':\n return `(..)(..)[${paramName}]`\n case 'di(.)':\n return `(.)[${paramName}]`\n case 'di(..)':\n return `(..)[${paramName}]`\n case 'di(...)':\n return `(...)[${paramName}]`\n default:\n dynamicParamType satisfies never\n return `[${paramName}]`\n }\n}\n\nfunction normalizeSegments(segments: string[]): string {\n return (\n segments.reduce((acc, segment) => {\n segment = removeLeadingSlash(segment)\n if (segment === '' || isGroupSegment(segment)) {\n return acc\n }\n\n return `${acc}/${segment}`\n }, '') || '/'\n )\n}\n\nexport function extractPathFromFlightRouterState(\n flightRouterState: FlightRouterState\n): string | undefined {\n const segment = Array.isArray(flightRouterState[0])\n ? flightRouterState[0][1]\n : flightRouterState[0]\n\n if (\n segment === DEFAULT_SEGMENT_KEY ||\n INTERCEPTION_ROUTE_MARKERS.some((m) => segment.startsWith(m))\n )\n return undefined\n\n if (segment.startsWith(PAGE_SEGMENT_KEY)) return ''\n\n const segments = [segmentToPathname(segment)]\n const parallelRoutes = flightRouterState[1] ?? {}\n\n const childrenPath = parallelRoutes.children\n ? extractPathFromFlightRouterState(parallelRoutes.children)\n : undefined\n\n if (childrenPath !== undefined) {\n segments.push(childrenPath)\n } else {\n for (const [key, value] of Object.entries(parallelRoutes)) {\n if (key === 'children') continue\n\n const childPath = extractPathFromFlightRouterState(value)\n\n if (childPath !== undefined) {\n segments.push(childPath)\n }\n }\n }\n\n return normalizeSegments(segments)\n}\n\nfunction extractSourcePageSegmentsFromFlightRouterState(\n flightRouterState: FlightRouterState\n): string[] | undefined {\n const segment = segmentToSourcePagePathname(flightRouterState[0])\n\n if (segment === DEFAULT_SEGMENT_KEY) {\n return undefined\n }\n\n if (segment === 'page') {\n return [segment]\n }\n\n const parallelRoutes = flightRouterState[1] ?? {}\n\n const childrenPath = parallelRoutes.children\n ? extractSourcePageSegmentsFromFlightRouterState(parallelRoutes.children)\n : undefined\n\n if (childrenPath !== undefined) {\n return segment === ''\n ? childrenPath\n : [removeLeadingSlash(segment), ...childrenPath]\n }\n\n for (const [key, value] of Object.entries(parallelRoutes)) {\n if (key === 'children') continue\n\n const childPath = extractSourcePageSegmentsFromFlightRouterState(value)\n\n if (childPath !== undefined) {\n return segment === ''\n ? childPath\n : [removeLeadingSlash(segment), ...childPath]\n }\n }\n\n return undefined\n}\n\nexport function extractSourcePageFromFlightRouterState(\n flightRouterState: FlightRouterState\n): string | undefined {\n const sourcePageSegments =\n extractSourcePageSegmentsFromFlightRouterState(flightRouterState)\n\n return sourcePageSegments ? `/${sourcePageSegments.join('/')}` : undefined\n}\n\nfunction computeChangedPathImpl(\n treeA: FlightRouterState,\n treeB: FlightRouterState\n): string | null {\n const [segmentA, parallelRoutesA] = treeA\n const [segmentB, parallelRoutesB] = treeB\n\n const normalizedSegmentA = segmentToPathname(segmentA)\n const normalizedSegmentB = segmentToPathname(segmentB)\n\n if (\n INTERCEPTION_ROUTE_MARKERS.some(\n (m) =>\n normalizedSegmentA.startsWith(m) || normalizedSegmentB.startsWith(m)\n )\n ) {\n return ''\n }\n\n if (!matchSegment(segmentA, segmentB)) {\n // once we find where the tree changed, we compute the rest of the path by traversing the tree\n return extractPathFromFlightRouterState(treeB) ?? ''\n }\n\n for (const parallelRouterKey in parallelRoutesA) {\n if (parallelRoutesB[parallelRouterKey]) {\n const changedPath = computeChangedPathImpl(\n parallelRoutesA[parallelRouterKey],\n parallelRoutesB[parallelRouterKey]\n )\n if (changedPath !== null) {\n return `${segmentToPathname(segmentB)}/${changedPath}`\n }\n }\n }\n\n return null\n}\n\nexport function computeChangedPath(\n treeA: FlightRouterState,\n treeB: FlightRouterState\n): string | null {\n const changedPath = computeChangedPathImpl(treeA, treeB)\n\n if (changedPath == null || changedPath === '/') {\n return changedPath\n }\n\n // lightweight normalization to remove route groups\n return normalizeSegments(changedPath.split('/'))\n}\n\n/**\n * Recursively extracts dynamic parameters from FlightRouterState.\n */\nexport function getSelectedParams(\n currentTree: FlightRouterState,\n params: Params = {}\n): Params {\n const parallelRoutes = currentTree[1]\n\n for (const parallelRoute of Object.values(parallelRoutes)) {\n const segment = parallelRoute[0]\n const isDynamicParameter = Array.isArray(segment)\n const segmentValue = isDynamicParameter ? segment[1] : segment\n if (!segmentValue || segmentValue.startsWith(PAGE_SEGMENT_KEY)) continue\n\n // Ensure catchAll and optional catchall are turned into an array\n const isCatchAll =\n isDynamicParameter && (segment[2] === 'c' || segment[2] === 'oc')\n\n if (isCatchAll) {\n params[segment[0]] = segment[1].split('/')\n } else if (isDynamicParameter) {\n params[segment[0]] = segment[1]\n }\n\n params = getSelectedParams(parallelRoute, params)\n }\n\n return params\n}\n"],"names":["INTERCEPTION_ROUTE_MARKERS","isGroupSegment","DEFAULT_SEGMENT_KEY","PAGE_SEGMENT_KEY","matchSegment","removeLeadingSlash","segment","slice","segmentToPathname","segmentToSourcePagePathname","startsWith","paramName","dynamicParamType","normalizeSegments","segments","reduce","acc","extractPathFromFlightRouterState","flightRouterState","Array","isArray","some","m","undefined","parallelRoutes","childrenPath","children","push","key","value","Object","entries","childPath","extractSourcePageSegmentsFromFlightRouterState","extractSourcePageFromFlightRouterState","sourcePageSegments","join","computeChangedPathImpl","treeA","treeB","segmentA","parallelRoutesA","segmentB","parallelRoutesB","normalizedSegmentA","normalizedSegmentB","parallelRouterKey","changedPath","computeChangedPath","split","getSelectedParams","currentTree","params","parallelRoute","values","isDynamicParameter","segmentValue","isCatchAll"],"mappings":"AAIA,SAASA,0BAA0B,QAAQ,uDAAsD;AAEjG,SACEC,cAAc,EACdC,mBAAmB,EACnBC,gBAAgB,QACX,8BAA6B;AACpC,SAASC,YAAY,QAAQ,oBAAmB;AAEhD,MAAMC,qBAAqB,CAACC;IAC1B,OAAOA,OAAO,CAAC,EAAE,KAAK,MAAMA,QAAQC,KAAK,CAAC,KAAKD;AACjD;AAEA,MAAME,oBAAoB,CAACF;IACzB,IAAI,OAAOA,YAAY,UAAU;QAC/B,uHAAuH;QACvH,gHAAgH;QAChH,IAAIA,YAAY,YAAY,OAAO;QAEnC,OAAOA;IACT;IAEA,OAAOA,OAAO,CAAC,EAAE;AACnB;AAEA,MAAMG,8BAA8B,CAACH;IACnC,IAAI,OAAOA,YAAY,UAAU;QAC/B,IAAIA,YAAY,YAAY,OAAO;QACnC,IAAIA,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AAC,EAAE;IAErC,KAAK,MAAME,iBAAiBvB,OAAOwB,MAAM,CAAC9B,gBAAiB;QACzD,MAAMlB,UAAU+C,aAAa,CAAC,EAAE;QAChC,MAAME,qBAAqBpC,MAAMC,OAAO,CAACd;QACzC,MAAMkD,eAAeD,qBAAqBjD,OAAO,CAAC,EAAE,GAAGA;QACvD,IAAI,CAACkD,gBAAgBA,aAAa9C,UAAU,CAACP,mBAAmB;QAEhE,iEAAiE;QACjE,MAAMsD,aACJF,sBAAuBjD,CAAAA,OAAO,CAAC,EAAE,KAAK,OAAOA,OAAO,CAAC,EAAE,KAAK,IAAG;QAEjE,IAAImD,YAAY;YACdL,MAAM,CAAC9C,OAAO,CAAC,EAAE,CAAC,GAAGA,OAAO,CAAC,EAAE,CAAC2C,KAAK,CAAC;QACxC,OAAO,IAAIM,oBAAoB;YAC7BH,MAAM,CAAC9C,OAAO,CAAC,EAAE,CAAC,GAAGA,OAAO,CAAC,EAAE;QACjC;QAEA8C,SAASF,kBAAkBG,eAAeD;IAC5C;IAEA,OAAOA;AACT","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../../src/client/components/router-reducer/compute-changed-path.ts"],"sourcesContent":["import type {\n FlightRouterState,\n Segment,\n} from '../../../shared/lib/app-router-types'\nimport { INTERCEPTION_ROUTE_MARKERS } from '../../../shared/lib/router/utils/interception-routes'\nimport type { Params } from '../../../server/request/params'\nimport {\n isGroupSegment,\n DEFAULT_SEGMENT_KEY,\n PAGE_SEGMENT_KEY,\n} from '../../../shared/lib/segment'\nimport { matchSegment } from '../match-segments'\n\nconst removeLeadingSlash = (segment: string): string => {\n return segment[0] === '/' ? segment.slice(1) : segment\n}\n\nconst segmentToPathname = (segment: Segment): string => {\n if (typeof segment === 'string') {\n // 'children' is not a valid path -- it's technically a parallel route that corresponds with the current segment's page\n // if we don't skip it, then the computed pathname might be something like `/children` which doesn't make sense.\n if (segment === 'children') return ''\n\n return segment\n }\n\n return segment[1]\n}\n\nexport const segmentToSourcePagePathname = (segment: Segment): string => {\n if (typeof segment === 'string') {\n if (segment === 'children') return ''\n if (segment.startsWith(PAGE_SEGMENT_KEY)) return 'page'\n return segment\n }\n\n const [paramName, , dynamicParamType] = segment\n\n switch (dynamicParamType) {\n case 'c':\n return `[...${paramName}]`\n case 'ci(..)(..)':\n return `(..)(..)[...${paramName}]`\n case 'ci(.)':\n return `(.)[...${paramName}]`\n case 'ci(..)':\n return `(..)[...${paramName}]`\n case 'ci(...)':\n return `(...)[...${paramName}]`\n case 'oc':\n return `[[...${paramName}]]`\n case 'd':\n return `[${paramName}]`\n case 'di(..)(..)':\n return `(..)(..)[${paramName}]`\n case 'di(.)':\n return `(.)[${paramName}]`\n case 'di(..)':\n return `(..)[${paramName}]`\n case 'di(...)':\n return `(...)[${paramName}]`\n default:\n dynamicParamType satisfies never\n return `[${paramName}]`\n }\n}\n\nfunction normalizeSegments(segments: string[]): string {\n return (\n segments.reduce((acc, segment) => {\n segment = removeLeadingSlash(segment)\n if (segment === '' || isGroupSegment(segment)) {\n return acc\n }\n\n return `${acc}/${segment}`\n }, '') || '/'\n )\n}\n\nexport function extractPathFromFlightRouterState(\n flightRouterState: FlightRouterState\n): string | undefined {\n const segment = Array.isArray(flightRouterState[0])\n ? flightRouterState[0][1]\n : flightRouterState[0]\n\n if (\n segment === DEFAULT_SEGMENT_KEY ||\n INTERCEPTION_ROUTE_MARKERS.some((m) => segment.startsWith(m))\n )\n return undefined\n\n if (segment.startsWith(PAGE_SEGMENT_KEY)) return ''\n\n const segments = [segmentToPathname(segment)]\n const parallelRoutes = flightRouterState[1] ?? {}\n\n const childrenPath = parallelRoutes.children\n ? extractPathFromFlightRouterState(parallelRoutes.children)\n : undefined\n\n if (childrenPath !== undefined) {\n segments.push(childrenPath)\n } else {\n for (const [key, value] of Object.entries(parallelRoutes)) {\n if (key === 'children') continue\n\n const childPath = extractPathFromFlightRouterState(value)\n\n if (childPath !== undefined) {\n segments.push(childPath)\n }\n }\n }\n\n return normalizeSegments(segments)\n}\n\nfunction extractSourcePageSegmentsFromFlightRouterState(\n flightRouterState: FlightRouterState\n): string[] | undefined {\n const segment = segmentToSourcePagePathname(flightRouterState[0])\n\n if (segment === DEFAULT_SEGMENT_KEY) {\n return undefined\n }\n\n if (segment === 'page') {\n return [segment]\n }\n\n const parallelRoutes = flightRouterState[1] ?? {}\n\n const childrenPath = parallelRoutes.children\n ? extractSourcePageSegmentsFromFlightRouterState(parallelRoutes.children)\n : undefined\n\n if (childrenPath !== undefined) {\n return segment === ''\n ? childrenPath\n : [removeLeadingSlash(segment), ...childrenPath]\n }\n\n for (const [key, value] of Object.entries(parallelRoutes)) {\n if (key === 'children') continue\n\n const childPath = extractSourcePageSegmentsFromFlightRouterState(value)\n\n if (childPath !== undefined) {\n return segment === ''\n ? childPath\n : [removeLeadingSlash(segment), ...childPath]\n }\n }\n\n return undefined\n}\n\nexport function extractSourcePageFromFlightRouterState(\n flightRouterState: FlightRouterState\n): string | undefined {\n const sourcePageSegments =\n extractSourcePageSegmentsFromFlightRouterState(flightRouterState)\n\n return sourcePageSegments ? `/${sourcePageSegments.join('/')}` : undefined\n}\n\nfunction computeChangedPathImpl(\n treeA: FlightRouterState,\n treeB: FlightRouterState\n): string | null {\n const [segmentA, parallelRoutesA] = treeA\n const [segmentB, parallelRoutesB] = treeB\n\n const normalizedSegmentA = segmentToPathname(segmentA)\n const normalizedSegmentB = segmentToPathname(segmentB)\n\n if (\n INTERCEPTION_ROUTE_MARKERS.some(\n (m) =>\n normalizedSegmentA.startsWith(m) || normalizedSegmentB.startsWith(m)\n )\n ) {\n return ''\n }\n\n if (!matchSegment(segmentA, segmentB)) {\n // once we find where the tree changed, we compute the rest of the path by traversing the tree\n return extractPathFromFlightRouterState(treeB) ?? ''\n }\n\n for (const parallelRouterKey in parallelRoutesA) {\n if (parallelRoutesB[parallelRouterKey]) {\n const changedPath = computeChangedPathImpl(\n parallelRoutesA[parallelRouterKey],\n parallelRoutesB[parallelRouterKey]\n )\n if (changedPath !== null) {\n return `${segmentToPathname(segmentB)}/${changedPath}`\n }\n }\n }\n\n return null\n}\n\nexport function computeChangedPath(\n treeA: FlightRouterState,\n treeB: FlightRouterState\n): string | null {\n const changedPath = computeChangedPathImpl(treeA, treeB)\n\n if (changedPath == null || changedPath === '/') {\n return changedPath\n }\n\n // lightweight normalization to remove route groups\n return normalizeSegments(changedPath.split('/'))\n}\n\n/**\n * Recursively extracts dynamic parameters from FlightRouterState.\n */\nexport function getSelectedParams(\n currentTree: FlightRouterState,\n params: Params = {}\n): Params {\n const parallelRoutes = currentTree[1]\n\n for (const parallelRoute of Object.values(parallelRoutes)) {\n const segment = parallelRoute[0]\n const isDynamicParameter = Array.isArray(segment)\n const segmentValue = isDynamicParameter ? segment[1] : segment\n if (!segmentValue || segmentValue.startsWith(PAGE_SEGMENT_KEY)) continue\n\n // Ensure catchAll and optional catchall are turned into an array\n const isCatchAll =\n isDynamicParameter && (segment[2] === 'c' || segment[2] === 'oc')\n\n if (isCatchAll) {\n params[segment[0]] = segment[1].split('/')\n } else if (isDynamicParameter) {\n params[segment[0]] = segment[1]\n }\n\n params = getSelectedParams(parallelRoute, params)\n }\n\n return params\n}\n"],"names":["INTERCEPTION_ROUTE_MARKERS","isGroupSegment","DEFAULT_SEGMENT_KEY","PAGE_SEGMENT_KEY","matchSegment","removeLeadingSlash","segment","slice","segmentToPathname","segmentToSourcePagePathname","startsWith","paramName","dynamicParamType","normalizeSegments","segments","reduce","acc","extractPathFromFlightRouterState","flightRouterState","Array","isArray","some","m","undefined","parallelRoutes","childrenPath","children","push","key","value","Object","entries","childPath","extractSourcePageSegmentsFromFlightRouterState","extractSourcePageFromFlightRouterState","sourcePageSegments","join","computeChangedPathImpl","treeA","treeB","segmentA","parallelRoutesA","segmentB","parallelRoutesB","normalizedSegmentA","normalizedSegmentB","parallelRouterKey","changedPath","computeChangedPath","split","getSelectedParams","currentTree","params","parallelRoute","values","isDynamicParameter","segmentValue","isCatchAll"],"mappings":"AAIA,SAASA,0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polyfill-module` after build. | ||
| import { isNextRouterError } from './components/is-next-router-error'; | ||
| export const version = "16.3.0-canary.58"; | ||
| export const version = "16.3.0-canary.59"; | ||
| export let router; | ||
@@ -31,0 +31,0 @@ export const emitter = mitt(); |
@@ -20,3 +20,3 @@ import { readFileSync, writeFileSync } from 'fs'; | ||
| const data = await res.json(); | ||
| const versionData = data.versions["16.3.0-canary.58"]; | ||
| const versionData = data.versions["16.3.0-canary.59"]; | ||
| return { | ||
@@ -54,3 +54,3 @@ os: versionData.os, | ||
| lockfileParsed.dependencies[pkg] = { | ||
| version: "16.3.0-canary.58", | ||
| version: "16.3.0-canary.59", | ||
| resolved: pkgData.tarball, | ||
@@ -63,3 +63,3 @@ integrity: pkgData.integrity, | ||
| lockfileParsed.packages[pkg] = { | ||
| version: "16.3.0-canary.58", | ||
| version: "16.3.0-canary.59", | ||
| resolved: pkgData.tarball, | ||
@@ -66,0 +66,0 @@ integrity: pkgData.integrity, |
| /** | ||
| * This module imports the client instrumentation hook from the project root. | ||
| * This module imports the configured client instrumentation modules. | ||
| * | ||
| * The `private-next-instrumentation-client` module is automatically aliased to | ||
| * the `instrumentation-client.ts` file in the project root by webpack or turbopack. | ||
| * either the user's instrumentation module or a generated module array. | ||
| */ if (process.env.NODE_ENV === 'development') { | ||
@@ -10,3 +10,6 @@ const measureName = 'Client Instrumentation Hook'; | ||
| // eslint-disable-next-line @next/internal/typechecked-require -- Not a module. | ||
| module.exports = require('private-next-instrumentation-client'); | ||
| const instrumentationClient = require('private-next-instrumentation-client'); | ||
| module.exports = Array.isArray(instrumentationClient) ? instrumentationClient : [ | ||
| instrumentationClient | ||
| ]; | ||
| const endTime = performance.now(); | ||
@@ -23,5 +26,8 @@ const duration = endTime - startTime; | ||
| // eslint-disable-next-line @next/internal/typechecked-require -- Not a module. | ||
| module.exports = require('private-next-instrumentation-client'); | ||
| const instrumentationClient = require('private-next-instrumentation-client'); | ||
| module.exports = Array.isArray(instrumentationClient) ? instrumentationClient : [ | ||
| instrumentationClient | ||
| ]; | ||
| } | ||
| //# sourceMappingURL=require-instrumentation-client.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/lib/require-instrumentation-client.ts"],"sourcesContent":["/**\n * This module imports the client instrumentation hook from the project root.\n *\n * The `private-next-instrumentation-client` module is automatically aliased to\n * the `instrumentation-client.ts` file in the project root by webpack or turbopack.\n */\nif (process.env.NODE_ENV === 'development') {\n const measureName = 'Client Instrumentation Hook'\n const startTime = performance.now()\n // eslint-disable-next-line @next/internal/typechecked-require -- Not a module.\n module.exports = require('private-next-instrumentation-client')\n const endTime = performance.now()\n const duration = endTime - startTime\n\n // Using 16ms threshold as it represents one frame (1000ms/60fps)\n // This helps identify if the instrumentation hook initialization\n // could potentially cause frame drops during development.\n const THRESHOLD = 16\n if (duration > THRESHOLD) {\n console.log(\n `[${measureName}] Slow execution detected: ${duration.toFixed(0)}ms (Note: Code download overhead is not included in this measurement)`\n )\n }\n} else {\n // eslint-disable-next-line @next/internal/typechecked-require -- Not a module.\n module.exports = require('private-next-instrumentation-client')\n}\n"],"names":["process","env","NODE_ENV","measureName","startTime","performance","now","module","exports","require","endTime","duration","THRESHOLD","console","log","toFixed"],"mappings":"AAAA;;;;;CAKC,GACD,IAAIA,QAAQC,GAAG,CAACC,QAAQ,KAAK,eAAe;IAC1C,MAAMC,cAAc;IACpB,MAAMC,YAAYC,YAAYC,GAAG;IACjC,+EAA+E;IAC/EC,OAAOC,OAAO,GAAGC,QAAQ;IACzB,MAAMC,UAAUL,YAAYC,GAAG;IAC/B,MAAMK,WAAWD,UAAUN;IAE3B,iEAAiE;IACjE,iEAAiE;IACjE,0DAA0D;IAC1D,MAAMQ,YAAY;IAClB,IAAID,WAAWC,WAAW;QACxBC,QAAQC,GAAG,CACT,CAAC,CAAC,EAAEX,YAAY,2BAA2B,EAAEQ,SAASI,OAAO,CAAC,GAAG,qEAAqE,CAAC;IAE3I;AACF,OAAO;IACL,+EAA+E;IAC/ER,OAAOC,OAAO,GAAGC,QAAQ;AAC3B","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/lib/require-instrumentation-client.ts"],"sourcesContent":["/**\n * This module imports the configured client instrumentation modules.\n *\n * The `private-next-instrumentation-client` module is automatically aliased to\n * either the user's instrumentation module or a generated module array.\n */\nif (process.env.NODE_ENV === 'development') {\n const measureName = 'Client Instrumentation Hook'\n const startTime = performance.now()\n // eslint-disable-next-line @next/internal/typechecked-require -- Not a module.\n const instrumentationClient = require('private-next-instrumentation-client')\n module.exports = Array.isArray(instrumentationClient)\n ? instrumentationClient\n : [instrumentationClient]\n const endTime = performance.now()\n const duration = endTime - startTime\n\n // Using 16ms threshold as it represents one frame (1000ms/60fps)\n // This helps identify if the instrumentation hook initialization\n // could potentially cause frame drops during development.\n const THRESHOLD = 16\n if (duration > THRESHOLD) {\n console.log(\n `[${measureName}] Slow execution detected: ${duration.toFixed(0)}ms (Note: Code download overhead is not included in this measurement)`\n )\n }\n} else {\n // eslint-disable-next-line @next/internal/typechecked-require -- Not a module.\n const instrumentationClient = require('private-next-instrumentation-client')\n module.exports = Array.isArray(instrumentationClient)\n ? instrumentationClient\n : [instrumentationClient]\n}\n"],"names":["process","env","NODE_ENV","measureName","startTime","performance","now","instrumentationClient","require","module","exports","Array","isArray","endTime","duration","THRESHOLD","console","log","toFixed"],"mappings":"AAAA;;;;;CAKC,GACD,IAAIA,QAAQC,GAAG,CAACC,QAAQ,KAAK,eAAe;IAC1C,MAAMC,cAAc;IACpB,MAAMC,YAAYC,YAAYC,GAAG;IACjC,+EAA+E;IAC/E,MAAMC,wBAAwBC,QAAQ;IACtCC,OAAOC,OAAO,GAAGC,MAAMC,OAAO,CAACL,yBAC3BA,wBACA;QAACA;KAAsB;IAC3B,MAAMM,UAAUR,YAAYC,GAAG;IAC/B,MAAMQ,WAAWD,UAAUT;IAE3B,iEAAiE;IACjE,iEAAiE;IACjE,0DAA0D;IAC1D,MAAMW,YAAY;IAClB,IAAID,WAAWC,WAAW;QACxBC,QAAQC,GAAG,CACT,CAAC,CAAC,EAAEd,YAAY,2BAA2B,EAAEW,SAASI,OAAO,CAAC,GAAG,qEAAqE,CAAC;IAE3I;AACF,OAAO;IACL,+EAA+E;IAC/E,MAAMX,wBAAwBC,QAAQ;IACtCC,OAAOC,OAAO,GAAGC,MAAMC,OAAO,CAACL,yBAC3BA,wBACA;QAACA;KAAsB;AAC7B","ignoreList":[0]} |
@@ -7,6 +7,8 @@ import PromiseQueue from 'next/dist/compiled/p-queue'; | ||
| import { bindSnapshot } from '../app-render/async-local-storage'; | ||
| import { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'; | ||
| import { afterTaskAsyncStorage } from '../app-render/after-task-async-storage.external'; | ||
| import { scheduleImmediate } from '../../lib/scheduler'; | ||
| export class AfterContext { | ||
| constructor({ waitUntil, onClose, onTaskError }){ | ||
| this.isRequestClosed = false; | ||
| this.initialOnCloseError = null; | ||
| this.workUnitStores = new Set(); | ||
@@ -18,12 +20,35 @@ this.waitUntil = waitUntil; | ||
| this.callbackQueue.pause(); | ||
| try { | ||
| onClose(()=>{ | ||
| this.isRequestClosed = true; | ||
| // TODO(after): it's not ideal that we'll only switch the `phase` of a WorkUnitStore | ||
| // if `after()` was called inside it. We should probably track this whenever a store is created | ||
| for (const workUnitStore of this.workUnitStores){ | ||
| workUnitStore.phase = 'after'; | ||
| } | ||
| }); | ||
| } catch (err) { | ||
| // If onClose is broken, report errors lazily, when after() is called. | ||
| this.initialOnCloseError = { | ||
| error: err | ||
| }; | ||
| } | ||
| } | ||
| after(task) { | ||
| after(task, workUnitStore) { | ||
| if (this.initialOnCloseError) { | ||
| throw Object.defineProperty(new InvariantError(`An onClose call failed, which means after() can't work correctly.`, { | ||
| cause: this.initialOnCloseError.error | ||
| }), "__NEXT_ERROR_CODE", { | ||
| value: "E1368", | ||
| enumerable: false, | ||
| configurable: true | ||
| }); | ||
| } | ||
| // Save the workUnitStore so we can switch its phase later. | ||
| this.workUnitStores.add(workUnitStore); | ||
| if (isThenable(task)) { | ||
| if (!this.waitUntil) { | ||
| errorWaitUntilNotAvailable(); | ||
| } | ||
| this.waitUntil(task.catch((error)=>this.reportTaskError('promise', error))); | ||
| this.addThenable(task); | ||
| } else if (typeof task === 'function') { | ||
| // TODO(after): implement tracing | ||
| this.addCallback(task); | ||
| this.addCallback(task, workUnitStore); | ||
| } else { | ||
@@ -37,3 +62,16 @@ throw Object.defineProperty(new Error('`after()`: Argument must be a promise or a function'), "__NEXT_ERROR_CODE", { | ||
| } | ||
| addCallback(callback) { | ||
| addThenable(thenable) { | ||
| if (!this.waitUntil) { | ||
| errorWaitUntilNotAvailable(); | ||
| } | ||
| this.waitUntil(new Promise((resolve)=>{ | ||
| thenable.then(()=>{ | ||
| resolve(); | ||
| }, (error)=>{ | ||
| resolve(); | ||
| this.reportTaskError('promise', error); | ||
| }); | ||
| })); | ||
| } | ||
| addCallback(callback, workUnitStore) { | ||
| // if something is wrong, throw synchronously, bubbling up to the `after` callsite. | ||
@@ -43,6 +81,2 @@ if (!this.waitUntil) { | ||
| } | ||
| const workUnitStore = workUnitAsyncStorage.getStore(); | ||
| if (workUnitStore) { | ||
| this.workUnitStores.add(workUnitStore); | ||
| } | ||
| const afterTaskStore = afterTaskAsyncStorage.getStore(); | ||
@@ -54,3 +88,3 @@ // This is used for checking if request APIs can be called inside `after`. | ||
| const rootTaskSpawnPhase = afterTaskStore ? afterTaskStore.rootTaskSpawnPhase // nested after | ||
| : workUnitStore == null ? void 0 : workUnitStore.phase // topmost after | ||
| : workUnitStore.phase // topmost after | ||
| ; | ||
@@ -81,3 +115,10 @@ // this should only happen once. | ||
| async runCallbacksOnClose() { | ||
| await new Promise((resolve)=>this.onClose(resolve)); | ||
| if (!this.isRequestClosed) { | ||
| await new Promise((resolve)=>this.onClose(resolve)); | ||
| } else { | ||
| // The request is already closed. | ||
| // Avoid running the callbacks too quickly to prevent userspace from | ||
| // e.g. relying on `after` being microtasky somewhere. | ||
| await new Promise((resolve)=>scheduleImmediate(resolve)); | ||
| } | ||
| return this.runCallbacks(); | ||
@@ -87,5 +128,2 @@ } | ||
| if (this.callbackQueue.size === 0) return; | ||
| for (const workUnitStore of this.workUnitStores){ | ||
| workUnitStore.phase = 'after'; | ||
| } | ||
| const workStore = workAsyncStorage.getStore(); | ||
@@ -92,0 +130,0 @@ if (!workStore) { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/server/after/after-context.ts"],"sourcesContent":["import PromiseQueue from 'next/dist/compiled/p-queue'\nimport type { RequestLifecycleOpts } from '../base-server'\nimport type { AfterCallback, AfterTask } from './after'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { isThenable } from '../../shared/lib/is-thenable'\nimport { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { withExecuteRevalidates } from '../revalidation-utils'\nimport { bindSnapshot } from '../app-render/async-local-storage'\nimport {\n workUnitAsyncStorage,\n type WorkUnitStore,\n} from '../app-render/work-unit-async-storage.external'\nimport { afterTaskAsyncStorage } from '../app-render/after-task-async-storage.external'\n\nexport type AfterContextOpts = {\n waitUntil: RequestLifecycleOpts['waitUntil'] | undefined\n onClose: RequestLifecycleOpts['onClose']\n onTaskError: RequestLifecycleOpts['onAfterTaskError'] | undefined\n}\n\nexport class AfterContext {\n private waitUntil: RequestLifecycleOpts['waitUntil'] | undefined\n private onClose: RequestLifecycleOpts['onClose']\n private onTaskError: RequestLifecycleOpts['onAfterTaskError'] | undefined\n\n private runCallbacksOnClosePromise: Promise<void> | undefined\n private callbackQueue: PromiseQueue\n private workUnitStores = new Set<WorkUnitStore>()\n\n constructor({ waitUntil, onClose, onTaskError }: AfterContextOpts) {\n this.waitUntil = waitUntil\n this.onClose = onClose\n this.onTaskError = onTaskError\n\n this.callbackQueue = new PromiseQueue()\n this.callbackQueue.pause()\n }\n\n public after(task: AfterTask): void {\n if (isThenable(task)) {\n if (!this.waitUntil) {\n errorWaitUntilNotAvailable()\n }\n this.waitUntil(\n task.catch((error) => this.reportTaskError('promise', error))\n )\n } else if (typeof task === 'function') {\n // TODO(after): implement tracing\n this.addCallback(task)\n } else {\n throw new Error('`after()`: Argument must be a promise or a function')\n }\n }\n\n private addCallback(callback: AfterCallback) {\n // if something is wrong, throw synchronously, bubbling up to the `after` callsite.\n if (!this.waitUntil) {\n errorWaitUntilNotAvailable()\n }\n\n const workUnitStore = workUnitAsyncStorage.getStore()\n if (workUnitStore) {\n this.workUnitStores.add(workUnitStore)\n }\n\n const afterTaskStore = afterTaskAsyncStorage.getStore()\n\n // This is used for checking if request APIs can be called inside `after`.\n // Note that we need to check the phase in which the *topmost* `after` was called (which should be \"action\"),\n // not the current phase (which might be \"after\" if we're in a nested after).\n // Otherwise, we might allow `after(() => headers())`, but not `after(() => after(() => headers()))`.\n const rootTaskSpawnPhase = afterTaskStore\n ? afterTaskStore.rootTaskSpawnPhase // nested after\n : workUnitStore?.phase // topmost after\n\n // this should only happen once.\n if (!this.runCallbacksOnClosePromise) {\n this.runCallbacksOnClosePromise = this.runCallbacksOnClose()\n this.waitUntil(this.runCallbacksOnClosePromise)\n }\n\n // Bind the callback to the current execution context (i.e. preserve all currently available ALS-es).\n // We do this because we want all of these to be equivalent in every regard except timing:\n // after(() => x())\n // after(x())\n // await x()\n const wrappedCallback = bindSnapshot(\n // WARNING: Don't make this a named function. It must be anonymous.\n // See: https://github.com/facebook/react/pull/34911\n async () => {\n try {\n await afterTaskAsyncStorage.run({ rootTaskSpawnPhase }, () =>\n callback()\n )\n } catch (error) {\n this.reportTaskError('function', error)\n }\n }\n )\n\n this.callbackQueue.add(wrappedCallback)\n }\n\n private async runCallbacksOnClose() {\n await new Promise<void>((resolve) => this.onClose!(resolve))\n return this.runCallbacks()\n }\n\n private async runCallbacks(): Promise<void> {\n if (this.callbackQueue.size === 0) return\n\n for (const workUnitStore of this.workUnitStores) {\n workUnitStore.phase = 'after'\n }\n\n const workStore = workAsyncStorage.getStore()\n if (!workStore) {\n throw new InvariantError('Missing workStore in AfterContext.runCallbacks')\n }\n\n return withExecuteRevalidates(workStore, () => {\n this.callbackQueue.start()\n return this.callbackQueue.onIdle()\n })\n }\n\n private reportTaskError(taskKind: 'promise' | 'function', error: unknown) {\n // TODO(after): this is fine for now, but will need better intergration with our error reporting.\n // TODO(after): should we log this if we have a onTaskError callback?\n console.error(\n taskKind === 'promise'\n ? `A promise passed to \\`after()\\` rejected:`\n : `An error occurred in a function passed to \\`after()\\`:`,\n error\n )\n if (this.onTaskError) {\n // this is very defensive, but we really don't want anything to blow up in an error handler\n try {\n this.onTaskError?.(error)\n } catch (handlerError) {\n console.error(\n new InvariantError(\n '`onTaskError` threw while handling an error thrown from an `after` task',\n {\n cause: handlerError,\n }\n )\n )\n }\n }\n }\n}\n\nfunction errorWaitUntilNotAvailable(): never {\n throw new Error(\n '`after()` will not work correctly, because `waitUntil` is not available in the current environment.'\n )\n}\n"],"names":["PromiseQueue","InvariantError","isThenable","workAsyncStorage","withExecuteRevalidates","bindSnapshot","workUnitAsyncStorage","afterTaskAsyncStorage","AfterContext","constructor","waitUntil","onClose","onTaskError","workUnitStores","Set","callbackQueue","pause","after","task","errorWaitUntilNotAvailable","catch","error","reportTaskError","addCallback","Error","callback","workUnitStore","getStore","add","afterTaskStore","rootTaskSpawnPhase","phase","runCallbacksOnClosePromise","runCallbacksOnClose","wrappedCallback","run","Promise","resolve","runCallbacks","size","workStore","start","onIdle","taskKind","console","handlerError","cause"],"mappings":"AAAA,OAAOA,kBAAkB,6BAA4B;AAGrD,SAASC,cAAc,QAAQ,mCAAkC;AACjE,SAASC,UAAU,QAAQ,+BAA8B;AACzD,SAASC,gBAAgB,QAAQ,4CAA2C;AAC5E,SAASC,sBAAsB,QAAQ,wBAAuB;AAC9D,SAASC,YAAY,QAAQ,oCAAmC;AAChE,SACEC,oBAAoB,QAEf,iDAAgD;AACvD,SAASC,qBAAqB,QAAQ,kDAAiD;AAQvF,OAAO,MAAMC;IASXC,YAAY,EAAEC,SAAS,EAAEC,OAAO,EAAEC,WA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AKC,CALD,IAAIpB,eACF,2EACA;oBACE6C,OAAOD;gBACT,IAJF,qBAAA;2BAAA;gCAAA;kCAAA;gBAKA;YAEJ;QACF;IACF;AACF;AAEA,SAAS1B;IACP,MAAM,qBAEL,CAFK,IAAIK,MACR,wGADI,qBAAA;eAAA;oBAAA;sBAAA;IAEN;AACF","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/server/after/after-context.ts"],"sourcesContent":["import PromiseQueue from 'next/dist/compiled/p-queue'\nimport type { RequestLifecycleOpts } from '../base-server'\nimport type { AfterCallback, AfterTask } from './after'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { isThenable } from '../../shared/lib/is-thenable'\nimport { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { withExecuteRevalidates } from '../revalidation-utils'\nimport { bindSnapshot } from '../app-render/async-local-storage'\nimport type { WorkUnitStore } from '../app-render/work-unit-async-storage.external'\nimport { afterTaskAsyncStorage } from '../app-render/after-task-async-storage.external'\nimport { scheduleImmediate } from '../../lib/scheduler'\n\nexport type AfterContextOpts = {\n waitUntil: RequestLifecycleOpts['waitUntil'] | undefined\n onClose: RequestLifecycleOpts['onClose']\n onTaskError: RequestLifecycleOpts['onAfterTaskError'] | undefined\n}\n\nexport class AfterContext {\n private waitUntil: RequestLifecycleOpts['waitUntil'] | undefined\n private onClose: RequestLifecycleOpts['onClose']\n private onTaskError: RequestLifecycleOpts['onAfterTaskError'] | undefined\n\n private isRequestClosed: boolean = false\n private initialOnCloseError: null | { error: unknown } = null\n\n private runCallbacksOnClosePromise: Promise<void> | undefined\n private callbackQueue: PromiseQueue\n private workUnitStores = new Set<WorkUnitStore>()\n\n constructor({ waitUntil, onClose, onTaskError }: AfterContextOpts) {\n this.waitUntil = waitUntil\n this.onClose = onClose\n this.onTaskError = onTaskError\n\n this.callbackQueue = new PromiseQueue()\n this.callbackQueue.pause()\n\n try {\n onClose(() => {\n this.isRequestClosed = true\n\n // TODO(after): it's not ideal that we'll only switch the `phase` of a WorkUnitStore\n // if `after()` was called inside it. We should probably track this whenever a store is created\n for (const workUnitStore of this.workUnitStores) {\n workUnitStore.phase = 'after'\n }\n })\n } catch (err) {\n // If onClose is broken, report errors lazily, when after() is called.\n this.initialOnCloseError = { error: err }\n }\n }\n\n public after(task: AfterTask, workUnitStore: WorkUnitStore): void {\n if (this.initialOnCloseError) {\n throw new InvariantError(\n `An onClose call failed, which means after() can't work correctly.`,\n { cause: this.initialOnCloseError.error }\n )\n }\n\n // Save the workUnitStore so we can switch its phase later.\n this.workUnitStores.add(workUnitStore)\n\n if (isThenable(task)) {\n this.addThenable(task)\n } else if (typeof task === 'function') {\n // TODO(after): implement tracing\n this.addCallback(task, workUnitStore)\n } else {\n throw new Error('`after()`: Argument must be a promise or a function')\n }\n }\n\n private addThenable(thenable: PromiseLike<any>) {\n if (!this.waitUntil) {\n errorWaitUntilNotAvailable()\n }\n this.waitUntil(\n new Promise<void>((resolve) => {\n thenable.then(\n () => {\n resolve()\n },\n (error) => {\n resolve()\n this.reportTaskError('promise', error)\n }\n )\n })\n )\n }\n\n private addCallback(callback: AfterCallback, workUnitStore: WorkUnitStore) {\n // if something is wrong, throw synchronously, bubbling up to the `after` callsite.\n if (!this.waitUntil) {\n errorWaitUntilNotAvailable()\n }\n\n const afterTaskStore = afterTaskAsyncStorage.getStore()\n\n // This is used for checking if request APIs can be called inside `after`.\n // Note that we need to check the phase in which the *topmost* `after` was called (which should be \"action\"),\n // not the current phase (which might be \"after\" if we're in a nested after).\n // Otherwise, we might allow `after(() => headers())`, but not `after(() => after(() => headers()))`.\n const rootTaskSpawnPhase = afterTaskStore\n ? afterTaskStore.rootTaskSpawnPhase // nested after\n : workUnitStore.phase // topmost after\n\n // this should only happen once.\n if (!this.runCallbacksOnClosePromise) {\n this.runCallbacksOnClosePromise = this.runCallbacksOnClose()\n this.waitUntil(this.runCallbacksOnClosePromise)\n }\n\n // Bind the callback to the current execution context (i.e. preserve all currently available ALS-es).\n // We do this because we want all of these to be equivalent in every regard except timing:\n // after(() => x())\n // after(x())\n // await x()\n const wrappedCallback = bindSnapshot(\n // WARNING: Don't make this a named function. It must be anonymous.\n // See: https://github.com/facebook/react/pull/34911\n async () => {\n try {\n await afterTaskAsyncStorage.run({ rootTaskSpawnPhase }, () =>\n callback()\n )\n } catch (error) {\n this.reportTaskError('function', error)\n }\n }\n )\n\n this.callbackQueue.add(wrappedCallback)\n }\n\n private async runCallbacksOnClose() {\n if (!this.isRequestClosed) {\n await new Promise<void>((resolve) => this.onClose(resolve))\n } else {\n // The request is already closed.\n // Avoid running the callbacks too quickly to prevent userspace from\n // e.g. relying on `after` being microtasky somewhere.\n await new Promise<void>((resolve) => scheduleImmediate(resolve))\n }\n return this.runCallbacks()\n }\n\n private async runCallbacks(): Promise<void> {\n if (this.callbackQueue.size === 0) return\n\n const workStore = workAsyncStorage.getStore()\n if (!workStore) {\n throw new InvariantError('Missing workStore in AfterContext.runCallbacks')\n }\n\n return withExecuteRevalidates(workStore, () => {\n this.callbackQueue.start()\n return this.callbackQueue.onIdle()\n })\n }\n\n private reportTaskError(taskKind: 'promise' | 'function', error: unknown) {\n // TODO(after): this is fine for now, but will need better intergration with our error reporting.\n // TODO(after): should we log this if we have a onTaskError callback?\n console.error(\n taskKind === 'promise'\n ? `A promise passed to \\`after()\\` rejected:`\n : `An error occurred in a function passed to \\`after()\\`:`,\n error\n )\n if (this.onTaskError) {\n // this is very defensive, but we really don't want anything to blow up in an error handler\n try {\n this.onTaskError?.(error)\n } catch (handlerError) {\n console.error(\n new InvariantError(\n '`onTaskError` threw while handling an error thrown from an `after` task',\n {\n cause: handlerError,\n }\n )\n )\n }\n }\n }\n}\n\nfunction errorWaitUntilNotAvailable(): never {\n throw new Error(\n '`after()` will not work correctly, because `waitUntil` is not available in the current environment.'\n )\n}\n"],"names":["PromiseQueue","InvariantError","isThenable","workAsyncStorage","withExecuteRevalidates","bindSnapshot","afterTaskAsyncStorage","scheduleImmediate","AfterContext","constructor","waitUntil","onClose","onTaskError","isRequestClosed","initialOnCloseError","workUnitStores","Set","callbackQueue","pause","workUnitStore","phase","err","error","after","task","cause","add","addThenable","addCallback","Error","thenable","errorWaitUntilNotAvailable","Promise","resolve","then","reportTaskError","callback","afterTaskStore","getStore","rootTaskSpawnPhase","runCallbacksOnClosePromise","runCallbacksOnClose","wrappedCallback","run","runCallbacks","size","workStore","start","onIdle","taskKind","console","handlerError"],"mappings":"AAAA,OAAOA,kBAAkB,6BAA4B;AAGrD,SAASC,cAAc,QAAQ,mCAAkC;AACjE,SAASC,UAAU,QAAQ,+BAA8B;AACzD,SAASC,gBAAgB,QAAQ,4CAA2C;AAC5E,SAASC,sBAAsB,QAAQ,wBAAuB;AAC9D,SAASC,YAAY,QAAQ,oCAAmC;AAEhE,SAASC,qBAAqB,QAAQ,kDAAiD;AACvF,SAASC,iBAAiB,QAAQ,sBAAqB;AAQvD,OAAO,MAAMC;IAYXC,YAAY,EAAEC,SAAS,EAAEC,OAAO,EAAEC,WAAW,EAAoB,CAAE;aAP3DC,kBAA2B;aAC3BC,sBAAiD;aAIjDC,iBAAiB,IAAIC;QAG3B,IAAI,CAACN,SAAS,GAAGA;QACjB,IAAI,CAACC,OAAO,GAAGA;QACf,IAAI,CAACC,WAAW,GAAGA;QAEnB,IAAI,CAACK,aAAa,GAAG,IAAIjB;QACzB,IAAI,CAACiB,aAAa,CAACC,KAAK;QAExB,IAAI;YACFP,QAAQ;gBACN,IAAI,CAACE,eAAe,GAAG;gBAEvB,oFAAoF;gBACpF,+FAA+F;gBAC/F,KAAK,MAAMM,iBAAiB,IAAI,CAACJ,cAAc,CAAE;oBAC/CI,cAAcC,KAAK,GAAG;gBACxB;YACF;QACF,EAAE,OAAOC,KAAK;YACZ,sEAAsE;YACtE,IAAI,CAACP,mBAAmB,GAAG;gBAAEQ,OAAOD;YAAI;QAC1C;IACF;IAEOE,MAAMC,IAAe,EAAEL,aAA4B,EAAQ;QAChE,IAAI,IAAI,CAACL,mBAAmB,EAAE;YAC5B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W,MAAhB,IAAI,EAAeU;YACrB,EAAE,OAAO6B,cAAc;gBACrBD,QAAQ5B,KAAK,CACX,qBAKC,CALD,IAAIrB,eACF,2EACA;oBACEwB,OAAO0B;gBACT,IAJF,qBAAA;2BAAA;gCAAA;kCAAA;gBAKA;YAEJ;QACF;IACF;AACF;AAEA,SAASpB;IACP,MAAM,qBAEL,CAFK,IAAIF,MACR,wGADI,qBAAA;eAAA;oBAAA;sBAAA;IAEN;AACF","ignoreList":[0]} |
| import { workAsyncStorage } from '../app-render/work-async-storage.external'; | ||
| import { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'; | ||
| /** | ||
@@ -6,3 +7,4 @@ * This function allows you to schedule callbacks to be executed after the current request finishes. | ||
| const workStore = workAsyncStorage.getStore(); | ||
| if (!workStore) { | ||
| const workUnitStore = workUnitAsyncStorage.getStore(); | ||
| if (!workStore || !workUnitStore) { | ||
| // TODO(after): the linked docs page talks about *dynamic* APIs, which after soon won't be anymore | ||
@@ -16,5 +18,5 @@ throw Object.defineProperty(new Error('`after` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context'), "__NEXT_ERROR_CODE", { | ||
| const { afterContext } = workStore; | ||
| return afterContext.after(task); | ||
| return afterContext.after(task, workUnitStore); | ||
| } | ||
| //# sourceMappingURL=after.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/server/after/after.ts"],"sourcesContent":["import { workAsyncStorage } from '../app-render/work-async-storage.external'\n\nexport type AfterTask<T = unknown> = Promise<T> | AfterCallback<T>\nexport type AfterCallback<T = unknown> = () => T | Promise<T>\n\n/**\n * This function allows you to schedule callbacks to be executed after the current request finishes.\n */\nexport function after<T>(task: AfterTask<T>): void {\n const workStore = workAsyncStorage.getStore()\n\n if (!workStore) {\n // TODO(after): the linked docs page talks about *dynamic* APIs, which after soon won't be anymore\n throw new Error(\n '`after` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context'\n )\n }\n\n const { afterContext } = workStore\n return afterContext.after(task)\n}\n"],"names":["workAsyncStorage","after","task","workStore","getStore","Error","afterContext"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,4CAA2C;AAK5E;;CAEC,GACD,OAAO,SAASC,MAASC,IAAkB;IACzC,MAAMC,YAAYH,iBAAiBI,QAAQ;IAE3C,IAAI,CAACD,WAAW;QACd,kGAAkG;QAClG,MAAM,qBAEL,CAFK,IAAIE,MACR,2HADI,qBAAA;mBAAA;wBAAA;0BAAA;QAEN;IACF;IAEA,MAAM,EAAEC,YAAY,EAAE,GAAGH;IACzB,OAAOG,aAAaL,KAAK,CAACC;AAC5B","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/server/after/after.ts"],"sourcesContent":["import { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'\n\nexport type AfterTask<T = unknown> = Promise<T> | AfterCallback<T>\nexport type AfterCallback<T = unknown> = () => T | Promise<T>\n\n/**\n * This function allows you to schedule callbacks to be executed after the current request finishes.\n */\nexport function after<T>(task: AfterTask<T>): void {\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (!workStore || !workUnitStore) {\n // TODO(after): the linked docs page talks about *dynamic* APIs, which after soon won't be anymore\n throw new Error(\n '`after` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context'\n )\n }\n\n const { afterContext } = workStore\n return afterContext.after(task, workUnitStore)\n}\n"],"names":["workAsyncStorage","workUnitAsyncStorage","after","task","workStore","getStore","workUnitStore","Error","afterContext"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,4CAA2C;AAC5E,SAASC,oBAAoB,QAAQ,iDAAgD;AAKrF;;CAEC,GACD,OAAO,SAASC,MAASC,IAAkB;IACzC,MAAMC,YAAYJ,iBAAiBK,QAAQ;IAC3C,MAAMC,gBAAgBL,qBAAqBI,QAAQ;IAEnD,IAAI,CAACD,aAAa,CAACE,eAAe;QAChC,kGAAkG;QAClG,MAAM,qBAEL,CAFK,IAAIC,MACR,2HADI,qBAAA;mBAAA;wBAAA;0BAAA;QAEN;IACF;IAEA,MAAM,EAAEC,YAAY,EAAE,GAAGJ;IACzB,OAAOI,aAAaN,KAAK,CAACC,MAAMG;AAClC","ignoreList":[0]} |
@@ -762,8 +762,8 @@ import { RSC_HEADER, RSC_CONTENT_TYPE_HEADER, NEXT_ROUTER_STATE_TREE_HEADER, ACTION_HEADER, NEXT_ACTION_NOT_FOUND_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_ROUTER_SEGMENT_PREFETCH_HEADER, NEXT_URL, NEXT_ACTION_REVALIDATED_HEADER } from '../../client/components/app-router-headers'; | ||
| type: 'done', | ||
| result: await generateFlight(req, ctx, requestStore, { | ||
| actionResult: Promise.resolve(actionResult), | ||
| skipPageRendering, | ||
| temporaryReferences, | ||
| waitUntil: maybeRevalidatesPromise === false ? undefined : maybeRevalidatesPromise | ||
| }) | ||
| result: await actionAsyncStorage.exit(()=>generateFlight(req, ctx, requestStore, { | ||
| actionResult: Promise.resolve(actionResult), | ||
| skipPageRendering, | ||
| temporaryReferences, | ||
| waitUntil: maybeRevalidatesPromise === false ? undefined : maybeRevalidatesPromise | ||
| })) | ||
| }; | ||
@@ -770,0 +770,0 @@ } else { |
@@ -405,3 +405,3 @@ /** | ||
| })); | ||
| await shellReady.promise; | ||
| await getTracer().trace(AppRenderSpan.waitShellReady, ()=>shellReady.promise); | ||
| if (!deferPipe) { | ||
@@ -408,0 +408,0 @@ await waitAtLeastOneReactRenderTask(); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/server/app-render/stream-ops.node.ts"],"sourcesContent":["/**\n * Node.js stream operations for the rendering pipeline.\n * Loaded by stream-ops.ts when process.env.__NEXT_USE_NODE_STREAMS is true.\n *\n * AnyStream = AnyStreamType so the exported type surface matches stream-ops.web.ts,\n * allowing the switcher to assign either module without casts.\n * Rendering uses pipeable APIs; continue functions wrap the existing web\n * transforms via Readable.fromWeb() on their output.\n */\n\nimport type { PostponedState, PrerenderOptions } from 'react-dom/static'\nimport {\n renderToPipeableStream,\n resumeToPipeableStream,\n} from 'react-dom/server'\nimport { prerender } from 'react-dom/static'\nimport { PassThrough, Readable, Transform } from 'node:stream'\nimport { isUtf8 } from 'node:buffer'\n\nimport {\n continueStaticPrerender as webContinueStaticPrerender,\n continueDynamicPrerender as webContinueDynamicPrerender,\n continueStaticFallbackPrerender as webContinueStaticFallbackPrerender,\n continueDynamicHTMLResume as webContinueDynamicHTMLResume,\n streamToBuffer as webStreamToBuffer,\n streamToString as webStreamToString,\n createDocumentClosingStream as webCreateDocumentClosingStream,\n createRuntimePrefetchTransformStream,\n CLOSE_TAG,\n} from '../stream-utils/node-web-streams-helper'\nimport { indexOfUint8Array } from '../stream-utils/uint8array-helpers'\nimport { ENCODED_TAGS } from '../stream-utils/encoded-tags'\nimport { createNodeBufferedTransformStream } from '../stream-utils/node-buffered-transform-stream'\nimport { MISSING_ROOT_TAGS_ERROR } from '../../shared/lib/errors/constants'\nimport {\n htmlEscapeAttributeString,\n htmlEscapeJsonString,\n} from '../../shared/lib/htmlescape'\nimport { createInlinedDataReadableStream } from './use-flight-response'\nimport {\n ReplayableNodeStream,\n type AnyStream as AnyStreamType,\n} from './app-render-prerender-utils'\nimport { DetachedPromise } from '../../lib/detached-promise'\nimport { getTracer } from '../lib/trace/tracer'\nimport { AppRenderSpan } from '../lib/trace/constants'\nimport {\n atLeastOneTask,\n waitAtLeastOneReactRenderTask,\n} from '../../lib/scheduler'\n\n// ---------------------------------------------------------------------------\n// Re-export shared types from the web module\n// ---------------------------------------------------------------------------\n\nexport type {\n ContinueStreamSharedOptions,\n ContinueFizzStreamOptions,\n ContinueStaticPrerenderOptions,\n ContinueDynamicHTMLResumeOptions,\n ServerPrerenderComponentMod,\n FlightPayload,\n FlightClientModules,\n FlightRenderOptions,\n} from './stream-ops.web'\n\n// ---------------------------------------------------------------------------\n// AnyStream matches stream-ops.web.ts so both modules have the same type surface\n// ---------------------------------------------------------------------------\n\nexport type AnyStream = AnyStreamType\n\nexport type FlightComponentMod = {\n renderToReadableStream: (\n model: any,\n webpackMap: any,\n options?: any\n ) => ReadableStream<Uint8Array>\n renderToPipeableStream?: (\n model: any,\n webpackMap: any,\n options?: any\n ) => {\n pipe<Writable extends NodeJS.WritableStream>(\n destination: Writable\n ): Writable\n abort(reason?: unknown): void\n }\n}\n\nexport type FizzStreamResult = {\n stream: AnyStream\n allReady: Promise<void>\n abort?: (reason?: unknown) => void\n}\n\n// ---------------------------------------------------------------------------\n// Internal helpers\n// ---------------------------------------------------------------------------\n\ntype WebReadableStream = import('stream/web').ReadableStream\n\nfunction nodeReadableToWebReadableStream(\n stream: Readable | ReadableStream<Uint8Array>\n): ReadableStream<Uint8Array> {\n if (stream instanceof ReadableStream) {\n return stream\n }\n // Readable.toWeb returns stream/web ReadableStream which is structurally\n // identical to the global ReadableStream<Uint8Array>.\n return Readable.toWeb(stream) as unknown as ReadableStream<Uint8Array>\n}\n\nfunction webToReadable(\n stream: ReadableStream<Uint8Array> | Readable\n): Readable {\n if (stream instanceof Readable) {\n return stream\n }\n return Readable.fromWeb(stream as WebReadableStream)\n}\n\n// ---------------------------------------------------------------------------\n// Flight data injection – Node.js Transform that passes HTML chunks through\n// while pulling from a separate data stream and interleaving its chunks.\n// ---------------------------------------------------------------------------\n\nfunction createFlightDataInjectionTransform(\n dataStream: Readable,\n delayDataUntilFirstHtmlChunk: boolean\n): Transform {\n let htmlStreamFinished = false\n let pull: Promise<void> | null = null\n let donePulling = false\n\n function startOrContinuePulling(target: Transform) {\n if (!pull) {\n pull = startPulling(target)\n }\n return pull\n }\n\n async function startPulling(target: Transform) {\n if (delayDataUntilFirstHtmlChunk) {\n // Buffer the inlined data stream until we've left the current Task so\n // it's inserted after flushing the shell.\n await atLeastOneTask()\n }\n\n try {\n const iterator = dataStream[Symbol.asyncIterator]()\n while (true) {\n const { done, value } = await iterator.next()\n if (done) {\n donePulling = true\n return\n }\n\n // Prioritize HTML over RSC data: the SSR render produces HTML from\n // the same RSC stream, so yield a task to let HTML flush first.\n if (!delayDataUntilFirstHtmlChunk && !htmlStreamFinished) {\n await atLeastOneTask()\n }\n target.push(value)\n }\n } catch (err) {\n target.destroy(err as Error)\n }\n }\n\n const nodeTransform = new Transform({\n transform(chunk, _encoding, callback) {\n this.push(chunk)\n if (delayDataUntilFirstHtmlChunk) {\n startOrContinuePulling(this)\n }\n callback()\n },\n flush(callback) {\n htmlStreamFinished = true\n if (donePulling) {\n callback()\n return\n }\n startOrContinuePulling(this).then(\n () => callback(),\n (err) => callback(err as Error)\n )\n },\n })\n\n if (!delayDataUntilFirstHtmlChunk) {\n startOrContinuePulling(nodeTransform)\n }\n\n return nodeTransform\n}\n\n// ---------------------------------------------------------------------------\n// Head insertion – Node.js Transform that inserts server-generated HTML\n// (e.g. <script>, <style>) right before </head>, or prepends it if no\n// </head> tag is found (PPR resume case).\n// ---------------------------------------------------------------------------\n\nfunction createHeadInsertionTransform(\n insert: () => Promise<string>\n): Transform {\n let inserted = false\n let hasBytes = false\n\n return new Transform({\n async transform(chunk, _encoding, callback) {\n hasBytes = true\n\n try {\n const insertion = await insert()\n if (inserted) {\n if (insertion) {\n this.push(Buffer.from(insertion))\n }\n this.push(chunk)\n } else {\n const index = indexOfUint8Array(chunk, ENCODED_TAGS.CLOSED.HEAD)\n if (index !== -1) {\n if (insertion) {\n const encodedInsertion = Buffer.from(insertion)\n const merged = Buffer.allocUnsafe(\n chunk.length + encodedInsertion.length\n )\n merged.set(chunk.slice(0, index))\n merged.set(encodedInsertion, index)\n merged.set(chunk.slice(index), index + encodedInsertion.length)\n this.push(merged)\n } else {\n this.push(chunk)\n }\n inserted = true\n } else {\n if (insertion) {\n this.push(Buffer.from(insertion))\n }\n this.push(chunk)\n inserted = true\n }\n }\n callback()\n } catch (err) {\n callback(err as Error)\n }\n },\n async flush(callback) {\n try {\n if (hasBytes) {\n const insertion = await insert()\n if (insertion) {\n this.push(Buffer.from(insertion))\n }\n }\n callback()\n } catch (err) {\n callback(err as Error)\n }\n },\n })\n}\n\n// ---------------------------------------------------------------------------\n// Metadata transform – Node.js Transform that finds the «nxt-icon» meta mark\n// and replaces it with a script tag (or removes it if inside <head>).\n// ---------------------------------------------------------------------------\n\nfunction createMetadataTransform(\n insert: () => Promise<string> | string\n): Transform {\n let chunkIndex = -1\n let isMarkRemoved = false\n\n return new Transform({\n async transform(chunk, _encoding, callback) {\n let iconMarkIndex = -1\n let closedHeadIndex = -1\n chunkIndex++\n\n if (isMarkRemoved) {\n this.push(chunk)\n callback()\n return\n }\n\n try {\n let iconMarkLength = 0\n iconMarkIndex = indexOfUint8Array(chunk, ENCODED_TAGS.META.ICON_MARK)\n if (iconMarkIndex === -1) {\n this.push(chunk)\n callback()\n return\n }\n\n iconMarkLength = ENCODED_TAGS.META.ICON_MARK.length\n if (chunk[iconMarkIndex + iconMarkLength] === 47) {\n iconMarkLength += 2\n } else {\n iconMarkLength++\n }\n\n if (chunkIndex === 0) {\n closedHeadIndex = indexOfUint8Array(chunk, ENCODED_TAGS.CLOSED.HEAD)\n if (iconMarkIndex < closedHeadIndex) {\n const replaced = Buffer.allocUnsafe(chunk.length - iconMarkLength)\n replaced.set(chunk.subarray(0, iconMarkIndex))\n replaced.set(\n chunk.subarray(iconMarkIndex + iconMarkLength),\n iconMarkIndex\n )\n chunk = replaced\n } else {\n const insertion = await insert()\n const encodedInsertion = Buffer.from(insertion)\n const insertionLength = encodedInsertion.length\n const replaced = Buffer.allocUnsafe(\n chunk.length - iconMarkLength + insertionLength\n )\n replaced.set(chunk.subarray(0, iconMarkIndex))\n replaced.set(encodedInsertion, iconMarkIndex)\n replaced.set(\n chunk.subarray(iconMarkIndex + iconMarkLength),\n iconMarkIndex + insertionLength\n )\n chunk = replaced\n }\n isMarkRemoved = true\n } else {\n const insertion = await insert()\n const encodedInsertion = Buffer.from(insertion)\n const insertionLength = encodedInsertion.length\n const replaced = Buffer.allocUnsafe(\n chunk.length - iconMarkLength + insertionLength\n )\n replaced.set(chunk.subarray(0, iconMarkIndex))\n replaced.set(encodedInsertion, iconMarkIndex)\n replaced.set(\n chunk.subarray(iconMarkIndex + iconMarkLength),\n iconMarkIndex + insertionLength\n )\n chunk = replaced\n isMarkRemoved = true\n }\n this.push(chunk)\n callback()\n } catch (err) {\n callback(err as Error)\n }\n },\n })\n}\n\n// ---------------------------------------------------------------------------\n// Deferred suffix – Node.js Transform that appends a suffix string after the\n// first HTML chunk, deferring via queueMicrotask so the chunk flushes first.\n// ---------------------------------------------------------------------------\n\nfunction createDeferredSuffixTransform(suffix: string): Transform {\n let flushed = false\n const encodedSuffix = Buffer.from(suffix)\n\n return new Transform({\n transform(chunk, _encoding, callback) {\n this.push(chunk)\n\n if (!flushed) {\n flushed = true\n queueMicrotask(() => {\n this.push(encodedSuffix)\n })\n }\n callback()\n },\n flush(callback) {\n if (!flushed) {\n this.push(encodedSuffix)\n }\n callback()\n },\n })\n}\n\n// ---------------------------------------------------------------------------\n// Move suffix – Node.js Transform that strips </body></html> from its\n// original position and re-appends it at the very end of the stream, so any\n// content injected after the suffix still appears before the closing tags.\n// ---------------------------------------------------------------------------\n\nfunction createMoveSuffixTransform(): Transform {\n let foundSuffix = false\n\n return new Transform({\n transform(chunk, _encoding, callback) {\n if (foundSuffix) {\n this.push(chunk)\n callback()\n return\n }\n\n const index = indexOfUint8Array(chunk, ENCODED_TAGS.CLOSED.BODY_AND_HTML)\n if (index > -1) {\n foundSuffix = true\n\n if (chunk.length === ENCODED_TAGS.CLOSED.BODY_AND_HTML.length) {\n callback()\n return\n }\n\n const before = chunk.slice(0, index)\n this.push(before)\n\n if (chunk.length > ENCODED_TAGS.CLOSED.BODY_AND_HTML.length + index) {\n const after = chunk.slice(\n index + ENCODED_TAGS.CLOSED.BODY_AND_HTML.length\n )\n this.push(after)\n }\n } else {\n this.push(chunk)\n }\n callback()\n },\n flush(callback) {\n this.push(ENCODED_TAGS.CLOSED.BODY_AND_HTML)\n callback()\n },\n })\n}\n\n// ---------------------------------------------------------------------------\n// data-dpl-id insertion – Node.js Transform that inserts a `data-dpl-id`\n// attribute on the opening <html tag for deployment identification.\n// ---------------------------------------------------------------------------\n\nfunction createHtmlDataDplIdTransform(dplId: string): Transform {\n let didTransform = false\n\n return new Transform({\n transform(chunk, _encoding, callback) {\n if (didTransform) {\n this.push(chunk)\n callback()\n return\n }\n\n const htmlTagIndex = indexOfUint8Array(chunk, ENCODED_TAGS.OPENING.HTML)\n if (htmlTagIndex === -1) {\n this.push(chunk)\n callback()\n return\n }\n\n const insertionPoint = htmlTagIndex + ENCODED_TAGS.OPENING.HTML.length\n const encodedAttribute = Buffer.from(` data-dpl-id=\"${dplId}\"`)\n const modified = Buffer.allocUnsafe(\n chunk.length + encodedAttribute.length\n )\n\n modified.set(chunk.subarray(0, insertionPoint))\n modified.set(encodedAttribute, insertionPoint)\n modified.set(\n chunk.subarray(insertionPoint),\n insertionPoint + encodedAttribute.length\n )\n\n this.push(modified)\n didTransform = true\n callback()\n },\n })\n}\n\n// ---------------------------------------------------------------------------\n// Root layout validator – Node.js Transform that checks whether <html> and\n// <body> tags are present in the streamed output. Dev-only; appends an\n// error template when tags are missing so the error overlay can display it.\n// ---------------------------------------------------------------------------\n\nfunction createRootLayoutValidatorTransform(): Transform {\n let foundHtml = false\n let foundBody = false\n\n return new Transform({\n transform(chunk, _encoding, callback) {\n if (\n !foundHtml &&\n indexOfUint8Array(chunk, ENCODED_TAGS.OPENING.HTML) > -1\n ) {\n foundHtml = true\n }\n if (\n !foundBody &&\n indexOfUint8Array(chunk, ENCODED_TAGS.OPENING.BODY) > -1\n ) {\n foundBody = true\n }\n this.push(chunk)\n callback()\n },\n flush(callback) {\n const missingTags: ('html' | 'body')[] = []\n if (!foundHtml) missingTags.push('html')\n if (!foundBody) missingTags.push('body')\n\n if (missingTags.length) {\n this.push(\n Buffer.from(\n `<html id=\"__next_error__\">\n <template\n data-next-error-message=\"Missing ${missingTags\n .map((c) => `<${c}>`)\n .join(\n missingTags.length > 1 ? ' and ' : ''\n )} tags in the root layout.\\nRead more at https://nextjs.org/docs/messages/missing-root-layout-tags\"\n data-next-error-digest=\"${MISSING_ROOT_TAGS_ERROR}\"\n data-next-error-stack=\"\"\n ></template>\n `\n )\n )\n }\n callback()\n },\n })\n}\n\n// ---------------------------------------------------------------------------\n// Rendering functions (output Node Readable natively via PassThrough)\n// ---------------------------------------------------------------------------\n\nexport { renderToWebFlightStream } from './stream-ops.web'\n\nexport function renderToNodeFlightStream(\n ComponentMod: FlightComponentMod,\n payload: any,\n clientModules: any,\n opts: any\n): AnyStream {\n if (!ComponentMod.renderToPipeableStream) {\n throw new Error('renderToPipeableStream is not implemented')\n }\n\n const pt = new PassThrough()\n const pipeable = ComponentMod.renderToPipeableStream!(\n payload,\n clientModules,\n opts\n )\n pipeable.pipe(pt)\n return pt\n}\n\nexport { renderToWebFizzStream } from './stream-ops.web'\n\nexport async function renderToNodeFizzStream(\n element: React.ReactElement,\n streamOptions: any,\n options?: { waitForAllReady?: boolean }\n): Promise<FizzStreamResult> {\n const pt = new PassThrough()\n const shellReady = new DetachedPromise<void>()\n const allReady = new DetachedPromise<void>()\n const deferPipe = options?.waitForAllReady === true\n\n const pipeable = getTracer().trace(AppRenderSpan.renderToReadableStream, () =>\n renderToPipeableStream(element, {\n ...streamOptions,\n onHeaders: streamOptions?.onHeaders,\n onShellReady() {\n streamOptions?.onShellReady?.()\n shellReady.resolve()\n },\n onShellError(error: unknown) {\n streamOptions?.onShellError?.(error)\n shellReady.reject(error)\n },\n onAllReady() {\n streamOptions?.onAllReady?.()\n if (deferPipe) {\n pipeable.pipe(pt)\n }\n allReady.resolve()\n },\n onError: streamOptions?.onError,\n })\n )\n\n await shellReady.promise\n\n if (!deferPipe) {\n await waitAtLeastOneReactRenderTask()\n pipeable.pipe(pt)\n }\n\n return {\n stream: pt,\n allReady: allReady.promise,\n abort: (reason?: unknown) => pipeable.abort(reason),\n }\n}\n\nexport async function resumeToFizzStream(\n element: React.ReactElement,\n postponedState: PostponedState,\n streamOptions: any,\n runInContext?: <T>(fn: () => T) => T\n): Promise<FizzStreamResult> {\n const run: <T>(fn: () => T) => T = runInContext ?? ((fn) => fn())\n\n const pt = new PassThrough()\n const shellReady = new DetachedPromise<void>()\n const allReady = new DetachedPromise<void>()\n\n const pipeable = await run(() =>\n resumeToPipeableStream(element, postponedState, {\n ...streamOptions,\n onShellReady() {\n streamOptions?.onShellReady?.()\n shellReady.resolve()\n },\n onShellError(error: unknown) {\n streamOptions?.onShellError?.(error)\n shellReady.reject(error)\n },\n onAllReady() {\n streamOptions?.onAllReady?.()\n allReady.resolve()\n },\n })\n )\n\n pipeable.pipe(pt)\n await shellReady.promise\n\n return {\n stream: pt,\n allReady: allReady.promise,\n abort: (reason?: unknown) => pipeable.abort(reason),\n }\n}\n\nexport async function resumeAndAbort(\n element: React.ReactElement,\n postponed: PostponedState | null,\n opts: any\n): Promise<AnyStream> {\n const pt = new PassThrough()\n const pipeable = await resumeToPipeableStream(\n element,\n postponed as PostponedState,\n opts\n )\n pipeable.pipe(pt)\n pipeable.abort(opts?.signal?.reason)\n return pt\n}\n\n// ---------------------------------------------------------------------------\n// Continue function wrappers\n// Bridge Node Readable → web, apply existing web transforms, Readable.fromWeb()\n// ---------------------------------------------------------------------------\n\nexport async function continueFizzStream(\n renderStream: AnyStream,\n {\n suffix,\n inlinedDataStream,\n isStaticGeneration,\n allReady,\n deploymentId,\n getServerInsertedHTML,\n getServerInsertedMetadata,\n validateRootLayout,\n }: import('./stream-ops.web').ContinueFizzStreamOptions\n): Promise<Readable> {\n // Suffix itself might contain close tags at the end, so we need to split it.\n const suffixUnclosed = suffix ? suffix.split(CLOSE_TAG, 1)[0] : null\n\n if (isStaticGeneration) {\n if (allReady) {\n await allReady\n }\n } else {\n // Otherwise, we want to make sure Fizz is done with all microtasky work\n // before we start pulling the stream and cause a flush.\n await waitAtLeastOneReactRenderTask()\n }\n\n // Pipe the render stream through Node.js Transforms:\n // 1. Buffer – coalesces chunks written in the same microtask into one Uint8Array\n // 2. Flight data injection – interleaves RSC data chunks with the HTML stream\n // 3. Head insertion – inserts server-generated HTML before </head>\n const buffered = createNodeBufferedTransformStream()\n webToReadable(renderStream).pipe(buffered)\n\n let source: Readable = buffered\n\n if (deploymentId) {\n const dplId = createHtmlDataDplIdTransform(deploymentId)\n source.pipe(dplId)\n source = dplId\n }\n\n // Metadata (icon mark replacement)\n const metadata = createMetadataTransform(getServerInsertedMetadata)\n source.pipe(metadata)\n source = metadata\n\n // Insert suffix content\n if (suffixUnclosed != null && suffixUnclosed.length > 0) {\n const deferredSuffix = createDeferredSuffixTransform(suffixUnclosed)\n source.pipe(deferredSuffix)\n source = deferredSuffix\n }\n\n // Flight data injection – interleaves RSC data chunks with the HTML stream\n if (inlinedDataStream) {\n const flightInjection = createFlightDataInjectionTransform(\n webToReadable(inlinedDataStream),\n true\n )\n source.pipe(flightInjection)\n source = flightInjection\n }\n\n if (validateRootLayout) {\n const rootLayoutValidator = createRootLayoutValidatorTransform()\n source.pipe(rootLayoutValidator)\n source = rootLayoutValidator\n }\n\n // Close tags should always be deferred to the end\n const moveSuffix = createMoveSuffixTransform()\n source.pipe(moveSuffix)\n source = moveSuffix\n\n // Head insertion – inserts server-generated HTML before </head>\n const headInsertion = createHeadInsertionTransform(getServerInsertedHTML)\n source.pipe(headInsertion)\n source = headInsertion\n\n return source\n}\n\nexport async function continueStaticPrerender(\n prerenderStream: AnyStream,\n opts: import('./stream-ops.web').ContinueStaticPrerenderOptions\n): Promise<AnyStream> {\n const webResult = await webContinueStaticPrerender(\n nodeReadableToWebReadableStream(prerenderStream),\n {\n ...opts,\n inlinedDataStream: nodeReadableToWebReadableStream(\n opts.inlinedDataStream\n ),\n }\n )\n return webToReadable(webResult)\n}\n\nexport async function continueDynamicPrerender(\n prerenderStream: AnyStream,\n opts: {\n getServerInsertedHTML: () => Promise<string>\n getServerInsertedMetadata: () => Promise<string>\n deploymentId: string | undefined\n }\n): Promise<AnyStream> {\n const webResult = await webContinueDynamicPrerender(\n nodeReadableToWebReadableStream(prerenderStream),\n opts\n )\n return webToReadable(webResult)\n}\n\nexport async function continueStaticFallbackPrerender(\n prerenderStream: AnyStream,\n opts: import('./stream-ops.web').ContinueStaticPrerenderOptions\n): Promise<AnyStream> {\n const webResult = await webContinueStaticFallbackPrerender(\n nodeReadableToWebReadableStream(prerenderStream),\n {\n ...opts,\n inlinedDataStream: nodeReadableToWebReadableStream(\n opts.inlinedDataStream\n ),\n }\n )\n return webToReadable(webResult)\n}\n\nexport async function continueDynamicHTMLResumeNode(\n renderStream: AnyStream,\n {\n delayDataUntilFirstHtmlChunk,\n inlinedDataStream,\n getServerInsertedHTML,\n getServerInsertedMetadata,\n deploymentId,\n }: import('./stream-ops.web').ContinueDynamicHTMLResumeOptions\n): Promise<AnyStream> {\n await waitAtLeastOneReactRenderTask()\n\n const buffered = createNodeBufferedTransformStream()\n webToReadable(renderStream).pipe(buffered)\n\n let source: Readable = buffered\n\n if (deploymentId) {\n const dplId = createHtmlDataDplIdTransform(deploymentId)\n source.pipe(dplId)\n source = dplId\n }\n\n const headInsertion = createHeadInsertionTransform(getServerInsertedHTML)\n source.pipe(headInsertion)\n source = headInsertion\n\n const metadata = createMetadataTransform(getServerInsertedMetadata)\n source.pipe(metadata)\n source = metadata\n\n const flightInjection = createFlightDataInjectionTransform(\n webToReadable(inlinedDataStream),\n delayDataUntilFirstHtmlChunk\n )\n source.pipe(flightInjection)\n source = flightInjection\n\n const moveSuffix = createMoveSuffixTransform()\n source.pipe(moveSuffix)\n source = moveSuffix\n\n return source\n}\n\nexport async function continueDynamicHTMLResumeWeb(\n renderStream: AnyStream,\n opts: import('./stream-ops.web').ContinueDynamicHTMLResumeOptions\n): Promise<AnyStream> {\n const webResult = await webContinueDynamicHTMLResume(\n nodeReadableToWebReadableStream(renderStream),\n {\n ...opts,\n inlinedDataStream: nodeReadableToWebReadableStream(\n opts.inlinedDataStream\n ),\n }\n )\n return webToReadable(webResult)\n}\n\n// ---------------------------------------------------------------------------\n// Utility functions (Node-native)\n// ---------------------------------------------------------------------------\n\nexport function chainStreams(...streams: AnyStream[]): AnyStream {\n if (streams.length === 0) {\n const pt = new PassThrough()\n pt.end()\n return pt\n }\n\n if (streams.length === 1) {\n return streams[0]\n }\n\n const out = new PassThrough()\n let i = 0\n\n function pipeNext() {\n if (i >= streams.length) {\n out.end()\n return\n }\n const current = webToReadable(streams[i++])\n current.pipe(out, { end: false })\n current.on('end', pipeNext)\n current.on('error', (err) => out.destroy(err))\n }\n\n pipeNext()\n return out\n}\n\nexport async function streamToBuffer(stream: AnyStream): Promise<Buffer> {\n return webStreamToBuffer(nodeReadableToWebReadableStream(stream))\n}\n\nexport async function streamToString(stream: AnyStream): Promise<string> {\n return webStreamToString(nodeReadableToWebReadableStream(stream))\n}\n\nexport function createWebInlinedDataStream(\n source: AnyStream,\n nonce: string | undefined,\n formState: unknown | null\n): AnyStream {\n const webSource = nodeReadableToWebReadableStream(source)\n const webResult = createInlinedDataReadableStream(webSource, nonce, formState)\n return webToReadable(webResult)\n}\n\nexport function createNodeInlinedDataStream(\n source: AnyStream,\n nonce: string | undefined,\n formState: unknown | null\n): AnyStream {\n const startScriptTag = nonce\n ? `<script nonce=\"${htmlEscapeAttributeString(nonce)}\">`\n : '<script>'\n\n const dataStream = webToReadable(source)\n const pt = new PassThrough()\n\n // Write initial bootstrap instructions\n let scriptContents = `(self.__next_f=self.__next_f||[]).push(${htmlEscapeJsonString(\n JSON.stringify([INLINE_FLIGHT_PAYLOAD_BOOTSTRAP])\n )})`\n if (formState != null) {\n scriptContents += `;self.__next_f.push(${htmlEscapeJsonString(\n JSON.stringify([INLINE_FLIGHT_PAYLOAD_FORM_STATE, formState])\n )})`\n }\n pt.push(Buffer.from(`${startScriptTag}${scriptContents}</script>`))\n\n // Pull from the flight data stream and wrap each chunk in a <script> tag\n pullFlightData(dataStream, pt, startScriptTag)\n\n return pt\n}\n\nconst INLINE_FLIGHT_PAYLOAD_BOOTSTRAP = 0\nconst INLINE_FLIGHT_PAYLOAD_DATA = 1\nconst INLINE_FLIGHT_PAYLOAD_FORM_STATE = 2\nconst INLINE_FLIGHT_PAYLOAD_BINARY = 3\n\nasync function pullFlightData(\n dataStream: Readable,\n output: PassThrough,\n startScriptTag: string\n): Promise<void> {\n function waitForReadableOrEnd(): Promise<void> {\n if (dataStream.readableLength > 0 || dataStream.readableEnded) {\n return Promise.resolve()\n }\n return new Promise<void>((resolve, reject) => {\n function cleanup() {\n dataStream.removeListener('readable', onDone)\n dataStream.removeListener('end', onDone)\n dataStream.removeListener('error', onError)\n }\n function onDone() {\n cleanup()\n resolve()\n }\n function onError(err: Error) {\n cleanup()\n reject(err)\n }\n dataStream.on('readable', onDone)\n dataStream.on('end', onDone)\n dataStream.on('error', onError)\n })\n }\n\n try {\n while (true) {\n const chunk: Buffer | null = dataStream.read()\n if (chunk !== null) {\n let htmlInlinedData: string\n if (isUtf8(chunk)) {\n const decodedString = chunk.toString('utf-8')\n htmlInlinedData = htmlEscapeJsonString(\n JSON.stringify([INLINE_FLIGHT_PAYLOAD_DATA, decodedString])\n )\n } else {\n const base64 = Buffer.from(\n chunk.buffer,\n chunk.byteOffset,\n chunk.byteLength\n ).toString('base64')\n htmlInlinedData = htmlEscapeJsonString(\n JSON.stringify([INLINE_FLIGHT_PAYLOAD_BINARY, base64])\n )\n }\n output.push(\n Buffer.from(\n `${startScriptTag}self.__next_f.push(${htmlInlinedData})</script>`\n )\n )\n continue\n }\n\n if (dataStream.readableEnded) {\n output.end()\n return\n }\n\n await waitForReadableOrEnd()\n }\n } catch (err) {\n output.destroy(err as Error)\n }\n}\n\nexport function createPendingStream(): AnyStream {\n return new PassThrough()\n}\n\nexport function createDocumentClosingStream(): AnyStream {\n const webStream = webCreateDocumentClosingStream()\n return webToReadable(webStream)\n}\n\nexport function createOnHeadersCallback(\n appendHeader: (key: string, value: string) => void\n): NonNullable<PrerenderOptions['onHeaders']> {\n return (headers: Headers) => {\n headers.forEach((value, key) => {\n appendHeader(key, value)\n })\n }\n}\n\nexport function pipeRuntimePrefetchTransform(\n stream: AnyStream,\n sentinel: number,\n isPartial: boolean,\n staleTime: number\n): AnyStream {\n const webStream = nodeReadableToWebReadableStream(stream)\n const transformed = webStream.pipeThrough(\n createRuntimePrefetchTransformStream(sentinel, isPartial, staleTime)\n )\n return webToReadable(transformed)\n}\n\n// ---------------------------------------------------------------------------\n// Re-exports (no stream involvement, identical to web)\n// ---------------------------------------------------------------------------\n\nexport async function processPrelude(unprocessedPrelude: AnyStream) {\n const [prelude, peek] =\n nodeReadableToWebReadableStream(unprocessedPrelude).tee()\n\n const reader = peek.getReader()\n const firstResult = await reader.read()\n reader.cancel()\n\n return {\n prelude: webToReadable(prelude) as AnyStream,\n preludeIsEmpty: firstResult.done === true,\n }\n}\n\nexport function getServerPrerender(ComponentMod: {\n prerender: (...args: any[]) => Promise<any>\n}): (...args: any[]) => any {\n return ComponentMod.prerender\n}\n\nexport const getClientPrerender: typeof import('react-dom/static').prerender =\n prerender\n\n// Node counterpart of the web `teeStream`. Like the web version it assumes the\n// stream type matching its build — here a Node `Readable` — and fans out\n// through `ReplayableNodeStream`. Need three or more consumers from one source?\n// Use `ReplayableNodeStream` directly (N `createReplayStream()` calls) to avoid\n// nesting tees.\nexport function teeStream(stream: AnyStream): [AnyStream, AnyStream] {\n const replayable = new ReplayableNodeStream(stream as Readable)\n return [replayable.createReplayStream(), replayable.createReplayStream()]\n}\n"],"names":["renderToPipeableStream","resumeToPipeableStream","prerender","PassThrough","Readable","Transform","isUtf8","continueStaticPrerender","webContinueStaticPrerender","continueDynamicPrerender","webContinueDynamicPrerender","continueStaticFallbackPrerender","webContinueStaticFallbackPrerender","continueDynamicHTMLResume","webContinueDynamicHTMLResume","streamToBuffer","webStreamToBuffer","streamToString","webStreamToString","createDocumentClosingStream","webCreateDocumentClosingStream","createRuntimePrefetchTransformStream","CLOSE_TAG","indexOfUint8Array","ENCODED_TAGS","createNodeBufferedTransformStream","MISSING_ROOT_TAGS_ERROR","htmlEscapeAttributeString","htmlEscapeJsonString","createInlinedDataReadableStream","ReplayableNodeStream","DetachedPromise","getTracer","AppRenderSpan","atLeastOneTask","waitAtLeastOneReactRenderTask","nodeReadableToWebReadableStream","stream","ReadableStream","toWeb","webToReadable","fromWeb","createFlightDataInjectionTransform","dataStream","delayDataUntilFirstHtmlChunk","htmlStreamFinished","pull","donePulling","startOrContinuePulling","target","startPulling","iterator","Symbol","asyncIterator","done","value","next","push","err","destroy","nodeTransform","transform","chunk","_encoding","callback","flush","then","createHeadInsertionTransform","insert","inserted","hasBytes","insertion","Buffer","from","index","CLOSED","HEAD","encodedInsertion","merged","allocUnsafe","length","set","slice","createMetadataTransform","chunkIndex","isMarkRemoved","iconMarkIndex","closedHeadIndex","iconMarkLength","META","ICON_MARK","replaced","subarray","insertionLength","createDeferredSuffixTransform","suffix","flushed","encodedSuffix","queueMicrotask","createMoveSuffixTransform","foundSuffix","BODY_AND_HTML","before","after","createHtmlDataDplIdTransform","dplId","didTransform","htmlTagIndex","OPENING","HTML","insertionPoint","encodedAttribute","modified","createRootLayoutValidatorTransform","foundHtml","foundBody","BODY","missingTags","map","c","join","renderToWebFlightStream","renderToNodeFlightStream","ComponentMod","payload","clientModules","opts","Error","pt","pipeable","pipe","renderToWebFizzStream","renderToNodeFizzStream","element","streamOptions","options","shellReady","allReady","deferPipe","waitForAllReady","trace","renderToReadableStream","onHeaders","onShellReady","resolve","onShellError","error","reject","onAllReady","onError","promise","abort","reason","resumeToFizzStream","postponedState","runInContext","run","fn","resumeAndAbort","postponed","signal","continueFizzStream","renderStream","inlinedDataStream","isStaticGeneration","deploymentId","getServerInsertedHTML","getServerInsertedMetadata","validateRootLayout","suffixUnclosed","split","buffered","source","metadata","deferredSuffix","flightInjection","rootLayoutValidator","moveSuffix","headInsertion","prerenderStream","webResult","continueDynamicHTMLResumeNode","continueDynamicHTMLResumeWeb","chainStreams","streams","end","out","i","pipeNext","current","on","createWebInlinedDataStream","nonce","formState","webSource","createNodeInlinedDataStream","startScriptTag","scriptContents","JSON","stringify","INLINE_FLIGHT_PAYLOAD_BOOTSTRAP","INLINE_FLIGHT_PAYLOAD_FORM_STATE","pullFlightData","INLINE_FLIGHT_PAYLOAD_DATA","INLINE_FLIGHT_PAYLOAD_BINARY","output","waitForReadableOrEnd","readableLength","readableEnded","Promise","cleanup","removeListener","onDone","read","htmlInlinedData","decodedString","toString","base64","buffer","byteOffset","byteLength","createPendingStream","webStream","createOnHeadersCallback","appendHeader","headers","forEach","key","pipeRuntimePrefetchTransform","sentinel","isPartial","staleTime","transformed","pipeThrough","processPrelude","unprocessedPrelude","prelude","peek","tee","reader","getReader","firstResult","cancel","preludeIsEmpty","getServerPrerender","getClientPrerender","teeStream","replayable","createReplayStream"],"mappings":"AAAA;;;;;;;;CAQC,GAGD,SACEA,sBAAsB,EACtBC,sBAAsB,QACjB,mBAAkB;AACzB,SAASC,SAAS,QAAQ,mBAAkB;AAC5C,SAASC,WAAW,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,cAAa;AAC9D,SAASC,MAAM,QAAQ,cAAa;AAEpC,SACEC,2BAA2BC,0BAA0B,EACrDC,4BAA4BC,2BAA2B,EACvDC,mCAAmCC,kCAAkC,EACrEC,6BAA6BC,4BAA4B,EACzDC,kBAAkBC,iBAAiB,EACnCC,kBAAkBC,iBAAiB,EACnCC,+BAA+BC,8BAA8B,EAC7DC,oCAAoC,EACpCC,SAAS,QACJ,0CAAyC;AAChD,SAASC,iBAAiB,QAAQ,qCAAoC;AACtE,SAASC,YAAY,QAAQ,+BAA8B;AAC3D,SAASC,iCAAiC,QAAQ,iDAAgD;AAClG,SAASC,uBAAuB,QAAQ,oCAAmC;AAC3E,SACEC,yBAAyB,EACzBC,oBAAoB,QACf,8BAA6B;AACpC,SAASC,+BAA+B,QAAQ,wBAAuB;AACvE,SACEC,oBAAoB,QAEf,+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YAElC;IACC,OAAOA,aAAazH,SAAS;AAC/B;AAEA,OAAO,MAAMmP,qBACXnP,UAAS;AAEX,+EAA+E;AAC/E,yEAAyE;AACzE,gFAAgF;AAChF,gFAAgF;AAChF,gBAAgB;AAChB,OAAO,SAASoP,UAAUjN,MAAiB;IACzC,MAAMkN,aAAa,IAAIzN,qBAAqBO;IAC5C,OAAO;QAACkN,WAAWC,kBAAkB;QAAID,WAAWC,kBAAkB;KAAG;AAC3E","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/server/app-render/stream-ops.node.ts"],"sourcesContent":["/**\n * Node.js stream operations for the rendering pipeline.\n * Loaded by stream-ops.ts when process.env.__NEXT_USE_NODE_STREAMS is true.\n *\n * AnyStream = AnyStreamType so the exported type surface matches stream-ops.web.ts,\n * allowing the switcher to assign either module without casts.\n * Rendering uses pipeable APIs; continue functions wrap the existing web\n * transforms via Readable.fromWeb() on their output.\n */\n\nimport type { PostponedState, PrerenderOptions } from 'react-dom/static'\nimport {\n renderToPipeableStream,\n resumeToPipeableStream,\n} from 'react-dom/server'\nimport { prerender } from 'react-dom/static'\nimport { PassThrough, Readable, Transform } from 'node:stream'\nimport { isUtf8 } from 'node:buffer'\n\nimport {\n continueStaticPrerender as webContinueStaticPrerender,\n continueDynamicPrerender as webContinueDynamicPrerender,\n continueStaticFallbackPrerender as webContinueStaticFallbackPrerender,\n continueDynamicHTMLResume as webContinueDynamicHTMLResume,\n streamToBuffer as webStreamToBuffer,\n streamToString as webStreamToString,\n createDocumentClosingStream as webCreateDocumentClosingStream,\n createRuntimePrefetchTransformStream,\n CLOSE_TAG,\n} from '../stream-utils/node-web-streams-helper'\nimport { indexOfUint8Array } from '../stream-utils/uint8array-helpers'\nimport { ENCODED_TAGS } from '../stream-utils/encoded-tags'\nimport { createNodeBufferedTransformStream } from '../stream-utils/node-buffered-transform-stream'\nimport { MISSING_ROOT_TAGS_ERROR } from '../../shared/lib/errors/constants'\nimport {\n htmlEscapeAttributeString,\n htmlEscapeJsonString,\n} from '../../shared/lib/htmlescape'\nimport { createInlinedDataReadableStream } from './use-flight-response'\nimport {\n ReplayableNodeStream,\n type AnyStream as AnyStreamType,\n} from './app-render-prerender-utils'\nimport { DetachedPromise } from '../../lib/detached-promise'\nimport { getTracer } from '../lib/trace/tracer'\nimport { AppRenderSpan } from '../lib/trace/constants'\nimport {\n atLeastOneTask,\n waitAtLeastOneReactRenderTask,\n} from '../../lib/scheduler'\n\n// ---------------------------------------------------------------------------\n// Re-export shared types from the web module\n// ---------------------------------------------------------------------------\n\nexport type {\n ContinueStreamSharedOptions,\n ContinueFizzStreamOptions,\n ContinueStaticPrerenderOptions,\n ContinueDynamicHTMLResumeOptions,\n ServerPrerenderComponentMod,\n FlightPayload,\n FlightClientModules,\n FlightRenderOptions,\n} from './stream-ops.web'\n\n// ---------------------------------------------------------------------------\n// AnyStream matches stream-ops.web.ts so both modules have the same type surface\n// ---------------------------------------------------------------------------\n\nexport type AnyStream = AnyStreamType\n\nexport type FlightComponentMod = {\n renderToReadableStream: (\n model: any,\n webpackMap: any,\n options?: any\n ) => ReadableStream<Uint8Array>\n renderToPipeableStream?: (\n model: any,\n webpackMap: any,\n options?: any\n ) => {\n pipe<Writable extends NodeJS.WritableStream>(\n destination: Writable\n ): Writable\n abort(reason?: unknown): void\n }\n}\n\nexport type FizzStreamResult = {\n stream: AnyStream\n allReady: Promise<void>\n abort?: (reason?: unknown) => void\n}\n\n// ---------------------------------------------------------------------------\n// Internal helpers\n// ---------------------------------------------------------------------------\n\ntype WebReadableStream = import('stream/web').ReadableStream\n\nfunction nodeReadableToWebReadableStream(\n stream: Readable | ReadableStream<Uint8Array>\n): ReadableStream<Uint8Array> {\n if (stream instanceof ReadableStream) {\n return stream\n }\n // Readable.toWeb returns stream/web ReadableStream which is structurally\n // identical to the global ReadableStream<Uint8Array>.\n return Readable.toWeb(stream) as unknown as ReadableStream<Uint8Array>\n}\n\nfunction webToReadable(\n stream: ReadableStream<Uint8Array> | Readable\n): Readable {\n if (stream instanceof Readable) {\n return stream\n }\n return Readable.fromWeb(stream as WebReadableStream)\n}\n\n// ---------------------------------------------------------------------------\n// Flight data injection – Node.js Transform that passes HTML chunks through\n// while pulling from a separate data stream and interleaving its chunks.\n// ---------------------------------------------------------------------------\n\nfunction createFlightDataInjectionTransform(\n dataStream: Readable,\n delayDataUntilFirstHtmlChunk: boolean\n): Transform {\n let htmlStreamFinished = false\n let pull: Promise<void> | null = null\n let donePulling = false\n\n function startOrContinuePulling(target: Transform) {\n if (!pull) {\n pull = startPulling(target)\n }\n return pull\n }\n\n async function startPulling(target: Transform) {\n if (delayDataUntilFirstHtmlChunk) {\n // Buffer the inlined data stream until we've left the current Task so\n // it's inserted after flushing the shell.\n await atLeastOneTask()\n }\n\n try {\n const iterator = dataStream[Symbol.asyncIterator]()\n while (true) {\n const { done, value } = await iterator.next()\n if (done) {\n donePulling = true\n return\n }\n\n // Prioritize HTML over RSC data: the SSR render produces HTML from\n // the same RSC stream, so yield a task to let HTML flush first.\n if (!delayDataUntilFirstHtmlChunk && !htmlStreamFinished) {\n await atLeastOneTask()\n }\n target.push(value)\n }\n } catch (err) {\n target.destroy(err as Error)\n }\n }\n\n const nodeTransform = new Transform({\n transform(chunk, _encoding, callback) {\n this.push(chunk)\n if (delayDataUntilFirstHtmlChunk) {\n startOrContinuePulling(this)\n }\n callback()\n },\n flush(callback) {\n htmlStreamFinished = true\n if (donePulling) {\n callback()\n return\n }\n startOrContinuePulling(this).then(\n () => callback(),\n (err) => callback(err as Error)\n )\n },\n })\n\n if (!delayDataUntilFirstHtmlChunk) {\n startOrContinuePulling(nodeTransform)\n }\n\n return nodeTransform\n}\n\n// ---------------------------------------------------------------------------\n// Head insertion – Node.js Transform that inserts server-generated HTML\n// (e.g. <script>, <style>) right before </head>, or prepends it if no\n// </head> tag is found (PPR resume case).\n// ---------------------------------------------------------------------------\n\nfunction createHeadInsertionTransform(\n insert: () => Promise<string>\n): Transform {\n let inserted = false\n let hasBytes = false\n\n return new Transform({\n async transform(chunk, _encoding, callback) {\n hasBytes = true\n\n try {\n const insertion = await insert()\n if (inserted) {\n if (insertion) {\n this.push(Buffer.from(insertion))\n }\n this.push(chunk)\n } else {\n const index = indexOfUint8Array(chunk, ENCODED_TAGS.CLOSED.HEAD)\n if (index !== -1) {\n if (insertion) {\n const encodedInsertion = Buffer.from(insertion)\n const merged = Buffer.allocUnsafe(\n chunk.length + encodedInsertion.length\n )\n merged.set(chunk.slice(0, index))\n merged.set(encodedInsertion, index)\n merged.set(chunk.slice(index), index + encodedInsertion.length)\n this.push(merged)\n } else {\n this.push(chunk)\n }\n inserted = true\n } else {\n if (insertion) {\n this.push(Buffer.from(insertion))\n }\n this.push(chunk)\n inserted = true\n }\n }\n callback()\n } catch (err) {\n callback(err as Error)\n }\n },\n async flush(callback) {\n try {\n if (hasBytes) {\n const insertion = await insert()\n if (insertion) {\n this.push(Buffer.from(insertion))\n }\n }\n callback()\n } catch (err) {\n callback(err as Error)\n }\n },\n })\n}\n\n// ---------------------------------------------------------------------------\n// Metadata transform – Node.js Transform that finds the «nxt-icon» meta mark\n// and replaces it with a script tag (or removes it if inside <head>).\n// ---------------------------------------------------------------------------\n\nfunction createMetadataTransform(\n insert: () => Promise<string> | string\n): Transform {\n let chunkIndex = -1\n let isMarkRemoved = false\n\n return new Transform({\n async transform(chunk, _encoding, callback) {\n let iconMarkIndex = -1\n let closedHeadIndex = -1\n chunkIndex++\n\n if (isMarkRemoved) {\n this.push(chunk)\n callback()\n return\n }\n\n try {\n let iconMarkLength = 0\n iconMarkIndex = indexOfUint8Array(chunk, ENCODED_TAGS.META.ICON_MARK)\n if (iconMarkIndex === -1) {\n this.push(chunk)\n callback()\n return\n }\n\n iconMarkLength = ENCODED_TAGS.META.ICON_MARK.length\n if (chunk[iconMarkIndex + iconMarkLength] === 47) {\n iconMarkLength += 2\n } else {\n iconMarkLength++\n }\n\n if (chunkIndex === 0) {\n closedHeadIndex = indexOfUint8Array(chunk, ENCODED_TAGS.CLOSED.HEAD)\n if (iconMarkIndex < closedHeadIndex) {\n const replaced = Buffer.allocUnsafe(chunk.length - iconMarkLength)\n replaced.set(chunk.subarray(0, iconMarkIndex))\n replaced.set(\n chunk.subarray(iconMarkIndex + iconMarkLength),\n iconMarkIndex\n )\n chunk = replaced\n } else {\n const insertion = await insert()\n const encodedInsertion = Buffer.from(insertion)\n const insertionLength = encodedInsertion.length\n const replaced = Buffer.allocUnsafe(\n chunk.length - iconMarkLength + insertionLength\n )\n replaced.set(chunk.subarray(0, iconMarkIndex))\n replaced.set(encodedInsertion, iconMarkIndex)\n replaced.set(\n chunk.subarray(iconMarkIndex + iconMarkLength),\n iconMarkIndex + insertionLength\n )\n chunk = replaced\n }\n isMarkRemoved = true\n } else {\n const insertion = await insert()\n const encodedInsertion = Buffer.from(insertion)\n const insertionLength = encodedInsertion.length\n const replaced = Buffer.allocUnsafe(\n chunk.length - iconMarkLength + insertionLength\n )\n replaced.set(chunk.subarray(0, iconMarkIndex))\n replaced.set(encodedInsertion, iconMarkIndex)\n replaced.set(\n chunk.subarray(iconMarkIndex + iconMarkLength),\n iconMarkIndex + insertionLength\n )\n chunk = replaced\n isMarkRemoved = true\n }\n this.push(chunk)\n callback()\n } catch (err) {\n callback(err as Error)\n }\n },\n })\n}\n\n// ---------------------------------------------------------------------------\n// Deferred suffix – Node.js Transform that appends a suffix string after the\n// first HTML chunk, deferring via queueMicrotask so the chunk flushes first.\n// ---------------------------------------------------------------------------\n\nfunction createDeferredSuffixTransform(suffix: string): Transform {\n let flushed = false\n const encodedSuffix = Buffer.from(suffix)\n\n return new Transform({\n transform(chunk, _encoding, callback) {\n this.push(chunk)\n\n if (!flushed) {\n flushed = true\n queueMicrotask(() => {\n this.push(encodedSuffix)\n })\n }\n callback()\n },\n flush(callback) {\n if (!flushed) {\n this.push(encodedSuffix)\n }\n callback()\n },\n })\n}\n\n// ---------------------------------------------------------------------------\n// Move suffix – Node.js Transform that strips </body></html> from its\n// original position and re-appends it at the very end of the stream, so any\n// content injected after the suffix still appears before the closing tags.\n// ---------------------------------------------------------------------------\n\nfunction createMoveSuffixTransform(): Transform {\n let foundSuffix = false\n\n return new Transform({\n transform(chunk, _encoding, callback) {\n if (foundSuffix) {\n this.push(chunk)\n callback()\n return\n }\n\n const index = indexOfUint8Array(chunk, ENCODED_TAGS.CLOSED.BODY_AND_HTML)\n if (index > -1) {\n foundSuffix = true\n\n if (chunk.length === ENCODED_TAGS.CLOSED.BODY_AND_HTML.length) {\n callback()\n return\n }\n\n const before = chunk.slice(0, index)\n this.push(before)\n\n if (chunk.length > ENCODED_TAGS.CLOSED.BODY_AND_HTML.length + index) {\n const after = chunk.slice(\n index + ENCODED_TAGS.CLOSED.BODY_AND_HTML.length\n )\n this.push(after)\n }\n } else {\n this.push(chunk)\n }\n callback()\n },\n flush(callback) {\n this.push(ENCODED_TAGS.CLOSED.BODY_AND_HTML)\n callback()\n },\n })\n}\n\n// ---------------------------------------------------------------------------\n// data-dpl-id insertion – Node.js Transform that inserts a `data-dpl-id`\n// attribute on the opening <html tag for deployment identification.\n// ---------------------------------------------------------------------------\n\nfunction createHtmlDataDplIdTransform(dplId: string): Transform {\n let didTransform = false\n\n return new Transform({\n transform(chunk, _encoding, callback) {\n if (didTransform) {\n this.push(chunk)\n callback()\n return\n }\n\n const htmlTagIndex = indexOfUint8Array(chunk, ENCODED_TAGS.OPENING.HTML)\n if (htmlTagIndex === -1) {\n this.push(chunk)\n callback()\n return\n }\n\n const insertionPoint = htmlTagIndex + ENCODED_TAGS.OPENING.HTML.length\n const encodedAttribute = Buffer.from(` data-dpl-id=\"${dplId}\"`)\n const modified = Buffer.allocUnsafe(\n chunk.length + encodedAttribute.length\n )\n\n modified.set(chunk.subarray(0, insertionPoint))\n modified.set(encodedAttribute, insertionPoint)\n modified.set(\n chunk.subarray(insertionPoint),\n insertionPoint + encodedAttribute.length\n )\n\n this.push(modified)\n didTransform = true\n callback()\n },\n })\n}\n\n// ---------------------------------------------------------------------------\n// Root layout validator – Node.js Transform that checks whether <html> and\n// <body> tags are present in the streamed output. Dev-only; appends an\n// error template when tags are missing so the error overlay can display it.\n// ---------------------------------------------------------------------------\n\nfunction createRootLayoutValidatorTransform(): Transform {\n let foundHtml = false\n let foundBody = false\n\n return new Transform({\n transform(chunk, _encoding, callback) {\n if (\n !foundHtml &&\n indexOfUint8Array(chunk, ENCODED_TAGS.OPENING.HTML) > -1\n ) {\n foundHtml = true\n }\n if (\n !foundBody &&\n indexOfUint8Array(chunk, ENCODED_TAGS.OPENING.BODY) > -1\n ) {\n foundBody = true\n }\n this.push(chunk)\n callback()\n },\n flush(callback) {\n const missingTags: ('html' | 'body')[] = []\n if (!foundHtml) missingTags.push('html')\n if (!foundBody) missingTags.push('body')\n\n if (missingTags.length) {\n this.push(\n Buffer.from(\n `<html id=\"__next_error__\">\n <template\n data-next-error-message=\"Missing ${missingTags\n .map((c) => `<${c}>`)\n .join(\n missingTags.length > 1 ? ' and ' : ''\n )} tags in the root layout.\\nRead more at https://nextjs.org/docs/messages/missing-root-layout-tags\"\n data-next-error-digest=\"${MISSING_ROOT_TAGS_ERROR}\"\n data-next-error-stack=\"\"\n ></template>\n `\n )\n )\n }\n callback()\n },\n })\n}\n\n// ---------------------------------------------------------------------------\n// Rendering functions (output Node Readable natively via PassThrough)\n// ---------------------------------------------------------------------------\n\nexport { renderToWebFlightStream } from './stream-ops.web'\n\nexport function renderToNodeFlightStream(\n ComponentMod: FlightComponentMod,\n payload: any,\n clientModules: any,\n opts: any\n): AnyStream {\n if (!ComponentMod.renderToPipeableStream) {\n throw new Error('renderToPipeableStream is not implemented')\n }\n\n const pt = new PassThrough()\n const pipeable = ComponentMod.renderToPipeableStream!(\n payload,\n clientModules,\n opts\n )\n pipeable.pipe(pt)\n return pt\n}\n\nexport { renderToWebFizzStream } from './stream-ops.web'\n\nexport async function renderToNodeFizzStream(\n element: React.ReactElement,\n streamOptions: any,\n options?: { waitForAllReady?: boolean }\n): Promise<FizzStreamResult> {\n const pt = new PassThrough()\n const shellReady = new DetachedPromise<void>()\n const allReady = new DetachedPromise<void>()\n const deferPipe = options?.waitForAllReady === true\n\n const pipeable = getTracer().trace(AppRenderSpan.renderToReadableStream, () =>\n renderToPipeableStream(element, {\n ...streamOptions,\n onHeaders: streamOptions?.onHeaders,\n onShellReady() {\n streamOptions?.onShellReady?.()\n shellReady.resolve()\n },\n onShellError(error: unknown) {\n streamOptions?.onShellError?.(error)\n shellReady.reject(error)\n },\n onAllReady() {\n streamOptions?.onAllReady?.()\n if (deferPipe) {\n pipeable.pipe(pt)\n }\n allReady.resolve()\n },\n onError: streamOptions?.onError,\n })\n )\n\n await getTracer().trace(\n AppRenderSpan.waitShellReady,\n () => shellReady.promise\n )\n\n if (!deferPipe) {\n await waitAtLeastOneReactRenderTask()\n pipeable.pipe(pt)\n }\n\n return {\n stream: pt,\n allReady: allReady.promise,\n abort: (reason?: unknown) => pipeable.abort(reason),\n }\n}\n\nexport async function resumeToFizzStream(\n element: React.ReactElement,\n postponedState: PostponedState,\n streamOptions: any,\n runInContext?: <T>(fn: () => T) => T\n): Promise<FizzStreamResult> {\n const run: <T>(fn: () => T) => T = runInContext ?? ((fn) => fn())\n\n const pt = new PassThrough()\n const shellReady = new DetachedPromise<void>()\n const allReady = new DetachedPromise<void>()\n\n const pipeable = await run(() =>\n resumeToPipeableStream(element, postponedState, {\n ...streamOptions,\n onShellReady() {\n streamOptions?.onShellReady?.()\n shellReady.resolve()\n },\n onShellError(error: unknown) {\n streamOptions?.onShellError?.(error)\n shellReady.reject(error)\n },\n onAllReady() {\n streamOptions?.onAllReady?.()\n allReady.resolve()\n },\n })\n )\n\n pipeable.pipe(pt)\n await shellReady.promise\n\n return {\n stream: pt,\n allReady: allReady.promise,\n abort: (reason?: unknown) => pipeable.abort(reason),\n }\n}\n\nexport async function resumeAndAbort(\n element: React.ReactElement,\n postponed: PostponedState | null,\n opts: any\n): Promise<AnyStream> {\n const pt = new PassThrough()\n const pipeable = await resumeToPipeableStream(\n element,\n postponed as PostponedState,\n opts\n )\n pipeable.pipe(pt)\n pipeable.abort(opts?.signal?.reason)\n return pt\n}\n\n// ---------------------------------------------------------------------------\n// Continue function wrappers\n// Bridge Node Readable → web, apply existing web transforms, Readable.fromWeb()\n// ---------------------------------------------------------------------------\n\nexport async function continueFizzStream(\n renderStream: AnyStream,\n {\n suffix,\n inlinedDataStream,\n isStaticGeneration,\n allReady,\n deploymentId,\n getServerInsertedHTML,\n getServerInsertedMetadata,\n validateRootLayout,\n }: import('./stream-ops.web').ContinueFizzStreamOptions\n): Promise<Readable> {\n // Suffix itself might contain close tags at the end, so we need to split it.\n const suffixUnclosed = suffix ? suffix.split(CLOSE_TAG, 1)[0] : null\n\n if (isStaticGeneration) {\n if (allReady) {\n await allReady\n }\n } else {\n // Otherwise, we want to make sure Fizz is done with all microtasky work\n // before we start pulling the stream and cause a flush.\n await waitAtLeastOneReactRenderTask()\n }\n\n // Pipe the render stream through Node.js Transforms:\n // 1. Buffer – coalesces chunks written in the same microtask into one Uint8Array\n // 2. Flight data injection – interleaves RSC data chunks with the HTML stream\n // 3. Head insertion – inserts server-generated HTML before </head>\n const buffered = createNodeBufferedTransformStream()\n webToReadable(renderStream).pipe(buffered)\n\n let source: Readable = buffered\n\n if (deploymentId) {\n const dplId = createHtmlDataDplIdTransform(deploymentId)\n source.pipe(dplId)\n source = dplId\n }\n\n // Metadata (icon mark replacement)\n const metadata = createMetadataTransform(getServerInsertedMetadata)\n source.pipe(metadata)\n source = metadata\n\n // Insert suffix content\n if (suffixUnclosed != null && suffixUnclosed.length > 0) {\n const deferredSuffix = createDeferredSuffixTransform(suffixUnclosed)\n source.pipe(deferredSuffix)\n source = deferredSuffix\n }\n\n // Flight data injection – interleaves RSC data chunks with the HTML stream\n if (inlinedDataStream) {\n const flightInjection = createFlightDataInjectionTransform(\n webToReadable(inlinedDataStream),\n true\n )\n source.pipe(flightInjection)\n source = flightInjection\n }\n\n if (validateRootLayout) {\n const rootLayoutValidator = createRootLayoutValidatorTransform()\n source.pipe(rootLayoutValidator)\n source = rootLayoutValidator\n }\n\n // Close tags should always be deferred to the end\n const moveSuffix = createMoveSuffixTransform()\n source.pipe(moveSuffix)\n source = moveSuffix\n\n // Head insertion – inserts server-generated HTML before </head>\n const headInsertion = createHeadInsertionTransform(getServerInsertedHTML)\n source.pipe(headInsertion)\n source = headInsertion\n\n return source\n}\n\nexport async function continueStaticPrerender(\n prerenderStream: AnyStream,\n opts: import('./stream-ops.web').ContinueStaticPrerenderOptions\n): Promise<AnyStream> {\n const webResult = await webContinueStaticPrerender(\n nodeReadableToWebReadableStream(prerenderStream),\n {\n ...opts,\n inlinedDataStream: nodeReadableToWebReadableStream(\n opts.inlinedDataStream\n ),\n }\n )\n return webToReadable(webResult)\n}\n\nexport async function continueDynamicPrerender(\n prerenderStream: AnyStream,\n opts: {\n getServerInsertedHTML: () => Promise<string>\n getServerInsertedMetadata: () => Promise<string>\n deploymentId: string | undefined\n }\n): Promise<AnyStream> {\n const webResult = await webContinueDynamicPrerender(\n nodeReadableToWebReadableStream(prerenderStream),\n opts\n )\n return webToReadable(webResult)\n}\n\nexport async function continueStaticFallbackPrerender(\n prerenderStream: AnyStream,\n opts: import('./stream-ops.web').ContinueStaticPrerenderOptions\n): Promise<AnyStream> {\n const webResult = await webContinueStaticFallbackPrerender(\n nodeReadableToWebReadableStream(prerenderStream),\n {\n ...opts,\n inlinedDataStream: nodeReadableToWebReadableStream(\n opts.inlinedDataStream\n ),\n }\n )\n return webToReadable(webResult)\n}\n\nexport async function continueDynamicHTMLResumeNode(\n renderStream: AnyStream,\n {\n delayDataUntilFirstHtmlChunk,\n inlinedDataStream,\n getServerInsertedHTML,\n getServerInsertedMetadata,\n deploymentId,\n }: import('./stream-ops.web').ContinueDynamicHTMLResumeOptions\n): Promise<AnyStream> {\n await waitAtLeastOneReactRenderTask()\n\n const buffered = createNodeBufferedTransformStream()\n webToReadable(renderStream).pipe(buffered)\n\n let source: Readable = buffered\n\n if (deploymentId) {\n const dplId = createHtmlDataDplIdTransform(deploymentId)\n source.pipe(dplId)\n source = dplId\n }\n\n const headInsertion = createHeadInsertionTransform(getServerInsertedHTML)\n source.pipe(headInsertion)\n source = headInsertion\n\n const metadata = createMetadataTransform(getServerInsertedMetadata)\n source.pipe(metadata)\n source = metadata\n\n const flightInjection = createFlightDataInjectionTransform(\n webToReadable(inlinedDataStream),\n delayDataUntilFirstHtmlChunk\n )\n source.pipe(flightInjection)\n source = flightInjection\n\n const moveSuffix = createMoveSuffixTransform()\n source.pipe(moveSuffix)\n source = moveSuffix\n\n return source\n}\n\nexport async function continueDynamicHTMLResumeWeb(\n renderStream: AnyStream,\n opts: import('./stream-ops.web').ContinueDynamicHTMLResumeOptions\n): Promise<AnyStream> {\n const webResult = await webContinueDynamicHTMLResume(\n nodeReadableToWebReadableStream(renderStream),\n {\n ...opts,\n inlinedDataStream: nodeReadableToWebReadableStream(\n opts.inlinedDataStream\n ),\n }\n )\n return webToReadable(webResult)\n}\n\n// ---------------------------------------------------------------------------\n// Utility functions (Node-native)\n// ---------------------------------------------------------------------------\n\nexport function chainStreams(...streams: AnyStream[]): AnyStream {\n if (streams.length === 0) {\n const pt = new PassThrough()\n pt.end()\n return pt\n }\n\n if (streams.length === 1) {\n return streams[0]\n }\n\n const out = new PassThrough()\n let i = 0\n\n function pipeNext() {\n if (i >= streams.length) {\n out.end()\n return\n }\n const current = webToReadable(streams[i++])\n current.pipe(out, { end: false })\n current.on('end', pipeNext)\n current.on('error', (err) => out.destroy(err))\n }\n\n pipeNext()\n return out\n}\n\nexport async function streamToBuffer(stream: AnyStream): Promise<Buffer> {\n return webStreamToBuffer(nodeReadableToWebReadableStream(stream))\n}\n\nexport async function streamToString(stream: AnyStream): Promise<string> {\n return webStreamToString(nodeReadableToWebReadableStream(stream))\n}\n\nexport function createWebInlinedDataStream(\n source: AnyStream,\n nonce: string | undefined,\n formState: unknown | null\n): AnyStream {\n const webSource = nodeReadableToWebReadableStream(source)\n const webResult = createInlinedDataReadableStream(webSource, nonce, formState)\n return webToReadable(webResult)\n}\n\nexport function createNodeInlinedDataStream(\n source: AnyStream,\n nonce: string | undefined,\n formState: unknown | null\n): AnyStream {\n const startScriptTag = nonce\n ? `<script nonce=\"${htmlEscapeAttributeString(nonce)}\">`\n : '<script>'\n\n const dataStream = webToReadable(source)\n const pt = new PassThrough()\n\n // Write initial bootstrap instructions\n let scriptContents = `(self.__next_f=self.__next_f||[]).push(${htmlEscapeJsonString(\n JSON.stringify([INLINE_FLIGHT_PAYLOAD_BOOTSTRAP])\n )})`\n if (formState != null) {\n scriptContents += `;self.__next_f.push(${htmlEscapeJsonString(\n JSON.stringify([INLINE_FLIGHT_PAYLOAD_FORM_STATE, formState])\n )})`\n }\n pt.push(Buffer.from(`${startScriptTag}${scriptContents}</script>`))\n\n // Pull from the flight data stream and wrap each chunk in a <script> tag\n pullFlightData(dataStream, pt, startScriptTag)\n\n return pt\n}\n\nconst INLINE_FLIGHT_PAYLOAD_BOOTSTRAP = 0\nconst INLINE_FLIGHT_PAYLOAD_DATA = 1\nconst INLINE_FLIGHT_PAYLOAD_FORM_STATE = 2\nconst INLINE_FLIGHT_PAYLOAD_BINARY = 3\n\nasync function pullFlightData(\n dataStream: Readable,\n output: PassThrough,\n startScriptTag: string\n): Promise<void> {\n function waitForReadableOrEnd(): Promise<void> {\n if (dataStream.readableLength > 0 || dataStream.readableEnded) {\n return Promise.resolve()\n }\n return new Promise<void>((resolve, reject) => {\n function cleanup() {\n dataStream.removeListener('readable', onDone)\n dataStream.removeListener('end', onDone)\n dataStream.removeListener('error', onError)\n }\n function onDone() {\n cleanup()\n resolve()\n }\n function onError(err: Error) {\n cleanup()\n reject(err)\n }\n dataStream.on('readable', onDone)\n dataStream.on('end', onDone)\n dataStream.on('error', onError)\n })\n }\n\n try {\n while (true) {\n const chunk: Buffer | null = dataStream.read()\n if (chunk !== null) {\n let htmlInlinedData: string\n if (isUtf8(chunk)) {\n const decodedString = chunk.toString('utf-8')\n htmlInlinedData = htmlEscapeJsonString(\n JSON.stringify([INLINE_FLIGHT_PAYLOAD_DATA, decodedString])\n )\n } else {\n const base64 = Buffer.from(\n chunk.buffer,\n chunk.byteOffset,\n chunk.byteLength\n ).toString('base64')\n htmlInlinedData = htmlEscapeJsonString(\n JSON.stringify([INLINE_FLIGHT_PAYLOAD_BINARY, base64])\n )\n }\n output.push(\n Buffer.from(\n `${startScriptTag}self.__next_f.push(${htmlInlinedData})</script>`\n )\n )\n continue\n }\n\n if (dataStream.readableEnded) {\n output.end()\n return\n }\n\n await waitForReadableOrEnd()\n }\n } catch (err) {\n output.destroy(err as Error)\n }\n}\n\nexport function createPendingStream(): AnyStream {\n return new PassThrough()\n}\n\nexport function createDocumentClosingStream(): AnyStream {\n const webStream = webCreateDocumentClosingStream()\n return webToReadable(webStream)\n}\n\nexport function createOnHeadersCallback(\n appendHeader: (key: string, value: string) => void\n): NonNullable<PrerenderOptions['onHeaders']> {\n return (headers: Headers) => {\n headers.forEach((value, key) => {\n appendHeader(key, value)\n })\n }\n}\n\nexport function pipeRuntimePrefetchTransform(\n stream: AnyStream,\n sentinel: number,\n isPartial: boolean,\n staleTime: number\n): AnyStream {\n const webStream = nodeReadableToWebReadableStream(stream)\n const transformed = webStream.pipeThrough(\n createRuntimePrefetchTransformStream(sentinel, isPartial, staleTime)\n )\n return webToReadable(transformed)\n}\n\n// ---------------------------------------------------------------------------\n// Re-exports (no stream involvement, identical to web)\n// ---------------------------------------------------------------------------\n\nexport async function processPrelude(unprocessedPrelude: AnyStream) {\n const [prelude, peek] =\n nodeReadableToWebReadableStream(unprocessedPrelude).tee()\n\n const reader = peek.getReader()\n const firstResult = await reader.read()\n reader.cancel()\n\n return {\n prelude: webToReadable(prelude) as AnyStream,\n preludeIsEmpty: firstResult.done === true,\n }\n}\n\nexport function getServerPrerender(ComponentMod: {\n prerender: (...args: any[]) => Promise<any>\n}): (...args: any[]) => any {\n return ComponentMod.prerender\n}\n\nexport const getClientPrerender: typeof import('react-dom/static').prerender =\n prerender\n\n// Node counterpart of the web `teeStream`. Like the web version it assumes the\n// stream type matching its build — here a Node `Readable` — and fans out\n// through `ReplayableNodeStream`. Need three or more consumers from one source?\n// Use `ReplayableNodeStream` directly (N `createReplayStream()` calls) to avoid\n// nesting tees.\nexport function teeStream(stream: AnyStream): [AnyStream, AnyStream] {\n const replayable = new ReplayableNodeStream(stream as Readable)\n return [replayable.createReplayStream(), replayable.createReplayStream()]\n}\n"],"names":["renderToPipeableStream","resumeToPipeableStream","prerender","PassThrough","Readable","Transform","isUtf8","continueStaticPrerender","webContinueStaticPrerender","continueDynamicPrerender","webContinueDynamicPrerender","continueStaticFallbackPrerender","webContinueStaticFallbackPrerender","continueDynamicHTMLResume","webContinueDynamicHTMLResume","streamToBuffer","webStreamToBuffer","streamToString","webStreamToString","createDocumentClosingStream","webCreateDocumentClosingStream","createRuntimePrefetchTransformStream","CLOSE_TAG","indexOfUint8Array","ENCODED_TAGS","createNodeBufferedTransformStream","MISSING_ROOT_TAGS_ERROR","htmlEscapeAttributeString","htmlEscapeJsonString","createInlinedDataReadableStream","ReplayableNodeStream","DetachedPromise","getTracer","AppRenderSpan","atLeastOneTask","waitAtLeastOneReactRenderTask","nodeReadableToWebReadableStream","stream","ReadableStream","toWeb","webToReadable","fromWeb","createFlightDataInjectionTransform","dataStream","delayDataUntilFirstHtmlChunk","htmlStreamFinished","pull","donePulling","startOrContinuePulling","target","startPulling","iterator","Symbol","asyncIterator","done","value","next","push","err","destroy","nodeTransform","transform","chunk","_encoding","callback","flush","then","createHeadInsertionTransform","insert","inserted","hasBytes","insertion","Buffer","from","index","CLOSED","HEAD","encodedInsertion","merged","allocUnsafe","length","set","slice","createMetadataTransform","chunkIndex","isMarkRemoved","iconMarkIndex","closedHeadIndex","iconMarkLength","META","ICON_MARK","replaced","subarray","insertionLength","createDeferredSuffixTransform","suffix","flushed","encodedSuffix","queueMicrotask","createMoveSuffixTransform","foundSuffix","BODY_AND_HTML","before","after","createHtmlDataDplIdTransform","dplId","didTransform","htmlTagIndex","OPENING","HTML","insertionPoint","encodedAttribute","modified","createRootLayoutValidatorTransform","foundHtml","foundBody","BODY","missingTags","map","c","join","renderToWebFlightStream","renderToNodeFlightStream","ComponentMod","payload","clientModules","opts","Error","pt","pipeable","pipe","renderToWebFizzStream","renderToNodeFizzStream","element","streamOptions","options","shellReady","allReady","deferPipe","waitForAllReady","trace","renderToReadableStream","onHeaders","onShellReady","resolve","onShellError","error","reject","onAllReady","onError","waitShellReady","promise","abort","reason","resumeToFizzStream","postponedState","runInContext","run","fn","resumeAndAbort","postponed","signal","continueFizzStream","renderStream","inlinedDataStream","isStaticGeneration","deploymentId","getServerInsertedHTML","getServerInsertedMetadata","validateRootLayout","suffixUnclosed","split","buffered","source","metadata","deferredSuffix","flightInjection","rootLayoutValidator","moveSuffix","headInsertion","prerenderStream","webResult","continueDynamicHTMLResumeNode","continueDynamicHTMLResumeWeb","chainStreams","streams","end","out","i","pipeNext","current","on","createWebInlinedDataStream","nonce","formState","webSource","createNodeInlinedDataStream","startScriptTag","scriptContents","JSON","stringify","INLINE_FLIGHT_PAYLOAD_BOOTSTRAP","INLINE_FLIGHT_PAYLOAD_FORM_STATE","pullFlightData","INLINE_FLIGHT_PAYLOAD_DATA","INLINE_FLIGHT_PAYLOAD_BINARY","output","waitForReadableOrEnd","readableLength","readableEnded","Promise","cleanup","removeListener","onDone","read","htmlInlinedData","decodedString","toString","base64","buffer","byteOffset","byteLength","createPendingStream","webStream","createOnHeadersCallback","appendHeader","headers","forEach","key","pipeRuntimePrefetchTransform","sentinel","isPartial","staleTime","transformed","pipeThrough","processPrelude","unprocessedPrelude","prelude","peek","tee","reader","getReader","firstResult","cancel","preludeIsEmpty","getServerPrerender","getClientPrerender","teeStream","replayable","createReplayStream"],"mappings":"AAAA;;;;;;;;CAQC,GAGD,SACEA,sBAAsB,EACtBC,sBAAsB,QACjB,mBAAkB;AACzB,SAASC,SAAS,QAAQ,mBAAkB;AAC5C,SAASC,WA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,OAAO6K;YACtBH,aAAaG,KAAK7K;QACpB;IACF;AACF;AAEA,OAAO,SAAS8K,6BACdhM,MAAiB,EACjBiM,QAAgB,EAChBC,SAAkB,EAClBC,SAAiB;IAEjB,MAAMT,YAAY3L,gCAAgCC;IAClD,MAAMoM,cAAcV,UAAUW,WAAW,CACvCrN,qCAAqCiN,UAAUC,WAAWC;IAE5D,OAAOhM,cAAciM;AACvB;AAEA,8EAA8E;AAC9E,uDAAuD;AACvD,8EAA8E;AAE9E,OAAO,eAAeE,eAAeC,kBAA6B;IAChE,MAAM,CAACC,SAASC,KAAK,GACnB1M,gCAAgCwM,oBAAoBG,GAAG;IAEzD,MAAMC,SAASF,KAAKG,SAAS;IAC7B,MAAMC,cAAc,MAAMF,OAAO1B,IAAI;IACrC0B,OAAOG,MAAM;IAEb,OAAO;QACLN,SAASrM,cAAcqM;QACvBO,gBAAgBF,YAAY5L,IAAI,KAAK;IACvC;AACF;AAEA,OAAO,SAAS+L,mBAAmB1H,YAElC;IACC,OAAOA,aAAazH,SAAS;AAC/B;AAEA,OAAO,MAAMoP,qBACXpP,UAAS;AAEX,+EAA+E;AAC/E,yEAAyE;AACzE,gFAAgF;AAChF,gFAAgF;AAChF,gBAAgB;AAChB,OAAO,SAASqP,UAAUlN,MAAiB;IACzC,MAAMmN,aAAa,IAAI1N,qBAAqBO;IAC5C,OAAO;QAACmN,WAAWC,kBAAkB;QAAID,WAAWC,kBAAkB;KAAG;AAC3E","ignoreList":[0]} |
@@ -203,2 +203,3 @@ import { VALID_LOADERS } from '../shared/lib/image-config'; | ||
| optimisticRouting: z.boolean().optional(), | ||
| instrumentationClientRouterTransitionEvents: z.boolean().optional(), | ||
| appShells: z.boolean().optional(), | ||
@@ -205,0 +206,0 @@ varyParams: z.boolean().optional(), |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/server/config-schema.ts"],"sourcesContent":["import type { NextConfig } from './config'\nimport { VALID_LOADERS } from '../shared/lib/image-config'\n\nimport { z } from 'next/dist/compiled/zod'\nimport type zod from 'next/dist/compiled/zod'\n\nimport type { SizeLimit } from '../types'\nimport {\n LIGHTNINGCSS_FEATURE_NAMES,\n type ExportPathMap,\n type TurbopackLoaderItem,\n type TurbopackOptions,\n type TurbopackRuleConfigItem,\n type TurbopackRuleConfigCollection,\n type TurbopackRuleCondition,\n type TurbopackLoaderBuiltinCondition,\n} from './config-shared'\nimport type {\n Header,\n Rewrite,\n RouteHas,\n Redirect,\n} from '../lib/load-custom-routes'\nimport { SUPPORTED_TEST_RUNNERS_LIST } from '../cli/next-test'\n\n// A custom zod schema for the SizeLimit type\nconst zSizeLimit = z.custom<SizeLimit>((val) => {\n if (typeof val === 'number' || typeof val === 'string') {\n return true\n }\n return false\n})\n\nconst zExportMap: zod.ZodType<ExportPathMap> = z.record(\n z.string(),\n z.object({\n page: z.string(),\n query: z.any(), // NextParsedUrlQuery\n\n // private optional properties\n _fallbackRouteParams: z.array(z.any()).optional(),\n _isAppDir: z.boolean().optional(),\n _isDynamicError: z.boolean().optional(),\n _isRoutePPREnabled: z.boolean().optional(),\n _allowEmptyStaticShell: z.boolean().optional(),\n })\n)\n\nconst zRouteHas: zod.ZodType<RouteHas> = z.union([\n z.object({\n type: z.enum(['header', 'query', 'cookie']),\n key: z.string(),\n value: z.string().optional(),\n }),\n z.object({\n type: z.literal('host'),\n key: z.undefined().optional(),\n value: z.string(),\n }),\n])\n\nconst zRewrite: zod.ZodType<Rewrite> = z.object({\n source: z.string(),\n destination: z.string(),\n basePath: z.literal(false).optional(),\n locale: z.literal(false).optional(),\n has: z.array(zRouteHas).optional(),\n missing: z.array(zRouteHas).optional(),\n internal: z.boolean().optional(),\n})\n\nconst zRedirect: zod.ZodType<Redirect> = z\n .object({\n source: z.string(),\n destination: z.string(),\n basePath: z.literal(false).optional(),\n locale: z.literal(false).optional(),\n has: z.array(zRouteHas).optional(),\n missing: z.array(zRouteHas).optional(),\n internal: z.boolean().optional(),\n })\n .and(\n z.union([\n z.object({\n statusCode: z.never().optional(),\n permanent: z.boolean(),\n }),\n z.object({\n statusCode: z.number(),\n permanent: z.never().optional(),\n }),\n ])\n )\n\nconst zHeader: zod.ZodType<Header> = z.object({\n source: z.string(),\n basePath: z.literal(false).optional(),\n locale: z.literal(false).optional(),\n headers: z.array(z.object({ key: z.string(), value: z.string() })),\n has: z.array(zRouteHas).optional(),\n missing: z.array(zRouteHas).optional(),\n\n internal: z.boolean().optional(),\n})\n\nconst zTurbopackLoaderItem: zod.ZodType<TurbopackLoaderItem> = z.union([\n z.string(),\n z.strictObject({\n loader: z.string(),\n // Any JSON value can be used as turbo loader options, so use z.any() here\n options: z.record(z.string(), z.any()).optional(),\n }),\n])\n\nconst zTurbopackLoaderBuiltinCondition: zod.ZodType<TurbopackLoaderBuiltinCondition> =\n z.union([\n z.literal('browser'),\n z.literal('foreign'),\n z.literal('development'),\n z.literal('production'),\n z.literal('node'),\n z.literal('edge-light'),\n ])\n\nconst zTurbopackCondition: zod.ZodType<TurbopackRuleCondition> = z.union([\n z.strictObject({ all: z.lazy(() => z.array(zTurbopackCondition)) }),\n z.strictObject({ any: z.lazy(() => z.array(zTurbopackCondition)) }),\n z.strictObject({ not: z.lazy(() => zTurbopackCondition) }),\n zTurbopackLoaderBuiltinCondition,\n z.strictObject({\n path: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n content: z.instanceof(RegExp).optional(),\n query: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n contentType: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n }),\n])\n\nconst zTurbopackModuleType = z.enum([\n 'asset',\n 'ecmascript',\n 'typescript',\n 'css',\n 'css-module',\n 'wasm',\n 'raw',\n 'node',\n 'bytes',\n])\n\nconst zTurbopackRuleConfigItem: zod.ZodType<TurbopackRuleConfigItem> =\n z.strictObject({\n loaders: z.array(zTurbopackLoaderItem).optional(),\n as: z.string().optional(),\n condition: zTurbopackCondition.optional(),\n type: zTurbopackModuleType.optional(),\n })\n\nconst zTurbopackRuleConfigCollection: zod.ZodType<TurbopackRuleConfigCollection> =\n z.union([\n zTurbopackRuleConfigItem,\n z.array(z.union([zTurbopackLoaderItem, zTurbopackRuleConfigItem])),\n ])\n\nconst zTurbopackConfig: zod.ZodType<TurbopackOptions> = z.strictObject({\n rules: z.record(z.string(), zTurbopackRuleConfigCollection).optional(),\n resolveAlias: z\n .record(\n z.string(),\n z.union([\n z.string(),\n z.array(z.string()),\n z.record(z.string(), z.union([z.string(), z.array(z.string())])),\n ])\n )\n .optional(),\n resolveExtensions: z.array(z.string()).optional(),\n root: z.string().optional(),\n debugIds: z.boolean().optional(),\n chunkLoadingGlobal: z.string().optional(),\n ignoreIssue: z\n .array(\n z.object({\n path: z.union([z.string(), z.instanceof(RegExp)]),\n title: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n description: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n })\n )\n .optional(),\n})\n\nexport const experimentalSchema = {\n outputHashSalt: z.string().optional(),\n useSkewCookie: z.boolean().optional(),\n after: z.boolean().optional(),\n appNavFailHandling: z.boolean().optional(),\n appNewScrollHandler: z.boolean().optional(),\n preloadEntriesOnStart: z.boolean().optional(),\n allowedRevalidateHeaderKeys: z.array(z.string()).optional(),\n staleTimes: z\n .object({\n dynamic: z.number().optional(),\n static: z.number().gte(30).optional(),\n })\n .optional(),\n cacheLife: z\n .record(\n z.object({\n stale: z.number().optional(),\n revalidate: z.number().optional(),\n expire: z.number().optional(),\n })\n )\n .optional(),\n cacheHandlers: z.record(z.string(), z.string().optional()).optional(),\n clientRouterFilter: z.boolean().optional(),\n clientRouterFilterRedirects: z.boolean().optional(),\n clientRouterFilterAllowedRate: z.number().optional(),\n cpus: z.number().optional(),\n memoryBasedWorkersCount: z.boolean().optional(),\n craCompat: z.boolean().optional(),\n caseSensitiveRoutes: z.boolean().optional(),\n clientParamParsingOrigins: z.array(z.string()).optional(),\n cachedNavigations: z.boolean().optional(),\n dynamicOnHover: z.boolean().optional(),\n useOffline: z.boolean().optional(),\n optimisticRouting: z.boolean().optional(),\n appShells: z.boolean().optional(),\n varyParams: z.boolean().optional(),\n prefetchInlining: z\n .union([\n z.boolean(),\n z.object({\n maxSize: z.number().optional(),\n maxBundleSize: z.number().optional(),\n }),\n ])\n .optional(),\n disableOptimizedLoading: z.boolean().optional(),\n disablePostcssPresetEnv: z.boolean().optional(),\n cacheComponents: z.boolean().optional(),\n inlineCss: z.boolean().optional(),\n esmExternals: z.union([z.boolean(), z.literal('loose')]).optional(),\n serverActions: z\n .object({\n bodySizeLimit: zSizeLimit.optional(),\n allowedOrigins: z.array(z.string()).optional(),\n })\n .optional(),\n maxPostponedStateSize: zSizeLimit.optional(),\n // The original type was Record<string, any>\n extensionAlias: z.record(z.string(), z.any()).optional(),\n externalDir: z.boolean().optional(),\n externalMiddlewareRewritesResolve: z.boolean().optional(),\n externalProxyRewritesResolve: z.boolean().optional(),\n exposeTestingApiInProductionBuild: z.boolean().optional(),\n fallbackNodePolyfills: z.literal(false).optional(),\n fetchCacheKeyPrefix: z.string().optional(),\n forceSwcTransforms: z.boolean().optional(),\n fullySpecified: z.boolean().optional(),\n gzipSize: z.boolean().optional(),\n imgOptConcurrency: z.number().int().optional().nullable(),\n imgOptOperationCache: z.boolean().optional().nullable(),\n imgOptTimeoutInSeconds: z.number().int().optional(),\n imgOptMaxInputPixels: z.number().int().optional(),\n imgOptSequentialRead: z.boolean().optional().nullable(),\n imgOptSkipMetadata: z.boolean().optional().nullable(),\n isrFlushToDisk: z.boolean().optional(),\n largePageDataBytes: z.number().optional(),\n linkNoTouchStart: z.boolean().optional(),\n manualClientBasePath: z.boolean().optional(),\n middlewarePrefetch: z.enum(['strict', 'flexible']).optional(),\n proxyPrefetch: z.enum(['strict', 'flexible']).optional(),\n middlewareClientMaxBodySize: zSizeLimit.optional(),\n proxyClientMaxBodySize: zSizeLimit.optional(),\n multiZoneDraftMode: z.boolean().optional(),\n cssChunking: z\n .union([\n z.boolean(),\n z.literal('strict'),\n z.literal('loose'),\n z.literal('graph'),\n z.strictObject({ type: z.literal('strict') }),\n z.strictObject({ type: z.literal('loose') }),\n z.strictObject({\n type: z.literal('graph'),\n requestCost: z.number().nonnegative().finite().optional(),\n moduleFactorCost: z.number().nonnegative().finite().optional(),\n }),\n ])\n .optional(),\n nextScriptWorkers: z.boolean().optional(),\n // The critter option is unknown, use z.any() here\n optimizeCss: z.union([z.boolean(), z.any()]).optional(),\n optimisticClientCache: z.boolean().optional(),\n parallelServerCompiles: z.boolean().optional(),\n parallelServerBuildTraces: z.boolean().optional(),\n ppr: z\n .union([z.boolean(), z.literal('incremental')])\n .readonly()\n .optional(),\n taint: z.boolean().optional(),\n blockingSSR: z.boolean().optional(),\n prerenderEarlyExit: z.boolean().optional(),\n proxyTimeout: z.number().gte(0).optional(),\n rootParams: z.boolean().optional(),\n mcpServer: z.boolean().optional(),\n removeUncaughtErrorAndRejectionListeners: z.boolean().optional(),\n validateRSCRequestHeaders: z.boolean().optional(),\n scrollRestoration: z.boolean().optional(),\n sri: z\n .object({\n algorithm: z.enum(['sha256', 'sha384', 'sha512']).optional(),\n })\n .optional(),\n swcPlugins: z\n // The specific swc plugin's option is unknown, use z.any() here\n .array(z.tuple([z.string(), z.record(z.string(), z.any())]))\n .optional(),\n swcEnvOptions: z\n .object({\n mode: z.enum(['usage', 'entry']).optional(),\n coreJs: z.string().optional(),\n skip: z.array(z.string()).optional(),\n include: z.array(z.string()).optional(),\n exclude: z.array(z.string()).optional(),\n shippedProposals: z.boolean().optional(),\n forceAllTransforms: z.boolean().optional(),\n debug: z.boolean().optional(),\n loose: z.boolean().optional(),\n })\n .optional(),\n swcTraceProfiling: z.boolean().optional(),\n // NonNullable<webpack.Configuration['experiments']>['buildHttp']\n urlImports: z.any().optional(),\n viewTransition: z.boolean().optional(),\n workerThreads: z.boolean().optional(),\n webVitalsAttribution: z\n .array(\n z.union([\n z.literal('CLS'),\n z.literal('FCP'),\n z.literal('FID'),\n z.literal('INP'),\n z.literal('LCP'),\n z.literal('TTFB'),\n ])\n )\n .optional(),\n // This is partial set of mdx-rs transform options we support, aligned\n // with next_core::next_config::MdxRsOptions. Ensure both types are kept in sync.\n mdxRs: z\n .union([\n z.boolean(),\n z.object({\n development: z.boolean().optional(),\n jsxRuntime: z.string().optional(),\n jsxImportSource: z.string().optional(),\n providerImportSource: z.string().optional(),\n mdxType: z.enum(['gfm', 'commonmark']).optional(),\n }),\n ])\n .optional(),\n transitionIndicator: z.boolean().optional(),\n gestureTransition: z.boolean().optional(),\n typedRoutes: z.boolean().optional(),\n webpackBuildWorker: z.boolean().optional(),\n webpackMemoryOptimizations: z.boolean().optional(),\n turbopackMemoryEviction: z\n .union([z.literal(false), z.literal('full')])\n .optional(),\n turbopackPluginRuntimeStrategy: z\n .enum(['workerThreads', 'childProcesses', 'forceWorkerThreads'])\n .optional(),\n turbopackMinify: z.boolean().optional(),\n turbopackFileSystemCacheForDev: z.boolean().optional(),\n turbopackFileSystemCacheForBuild: z.boolean().optional(),\n turbopackSourceMaps: z.boolean().optional(),\n turbopackInputSourceMaps: z.boolean().optional(),\n turbopackTreeShaking: z.boolean().optional(),\n turbopackRemoveUnusedImports: z.boolean().optional(),\n turbopackRemoveUnusedExports: z.boolean().optional(),\n turbopackScopeHoisting: z.boolean().optional(),\n turbopackWorkerAssetPrefix: z.string().optional(),\n turbopackClientSideNestedAsyncChunking: z.boolean().optional(),\n turbopackServerSideNestedAsyncChunking: z.boolean().optional(),\n turbopackImportTypeBytes: z.boolean().optional(),\n turbopackImportTypeText: z.boolean().optional(),\n turbopackUseBuiltinBabel: z.boolean().optional(),\n turbopackUseBuiltinSass: z.boolean().optional(),\n turbopackLocalPostcssConfig: z.boolean().optional(),\n turbopackModuleIds: z.enum(['named', 'deterministic']).optional(),\n turbopackInferModuleSideEffects: z.boolean().optional(),\n turbopackServerFastRefresh: z.boolean().optional(),\n optimizePackageImports: z.array(z.string()).optional(),\n optimizeServerReact: z.boolean().optional(),\n strictRouteTypes: z.boolean().optional(),\n clientTraceMetadata: z.array(z.string()).optional(),\n serverMinification: z.boolean().optional(),\n serverSourceMaps: z.boolean().optional(),\n useWasmBinary: z.boolean().optional(),\n useLightningcss: z.boolean().optional(),\n lightningCssFeatures: z\n .object({\n include: z.array(z.enum(LIGHTNINGCSS_FEATURE_NAMES)).optional(),\n exclude: z.array(z.enum(LIGHTNINGCSS_FEATURE_NAMES)).optional(),\n })\n .optional(),\n testProxy: z.boolean().optional(),\n defaultTestRunner: z.enum(SUPPORTED_TEST_RUNNERS_LIST).optional(),\n allowDevelopmentBuild: z.literal(true).optional(),\n\n reactDebugChannel: z.boolean().optional(),\n instantInsights: z\n .object({\n validationLevel: z\n .enum([\n 'warning',\n 'manual-warning',\n 'experimental-error',\n 'experimental-manual-error',\n ])\n .optional(),\n })\n .optional(),\n staticGenerationRetryCount: z.number().int().optional(),\n staticGenerationMaxConcurrency: z.number().int().optional(),\n staticGenerationMinPagesPerWorker: z.number().int().optional(),\n typedEnv: z.boolean().optional(),\n serverComponentsHmrCache: z.boolean().optional(),\n authInterrupts: z.boolean().optional(),\n useCache: z.boolean().optional(),\n useCacheTimeout: z.number().positive().optional(),\n slowModuleDetection: z\n .object({\n buildTimeThresholdMs: z.number().int(),\n })\n .optional(),\n globalNotFound: z.boolean().optional(),\n turbopackRustReactCompiler: z.boolean().optional(),\n browserDebugInfoInTerminal: z\n .union([\n z.boolean(),\n z.enum(['error', 'warn', 'verbose']),\n z.object({\n level: z.enum(['error', 'warn', 'verbose']).optional(),\n depthLimit: z.number().int().positive().optional(),\n edgeLimit: z.number().int().positive().optional(),\n showSourceLocation: z.boolean().optional(),\n }),\n ])\n .optional(),\n lockDistDir: z.boolean().optional(),\n hideLogsAfterAbort: z.boolean().optional(),\n runtimeServerDeploymentId: z.boolean().optional(),\n supportsImmutableAssets: z.boolean().optional(),\n deferredEntries: z.array(z.string()).optional(),\n onBeforeDeferredEntries: z.function().returns(z.promise(z.void())).optional(),\n reportSystemEnvInlining: z.enum(['warn', 'error']).optional(),\n}\n\nexport const configSchema: zod.ZodType<NextConfig> = z.lazy(() =>\n z.strictObject({\n adapterPath: z.string().optional(),\n agentRules: z.boolean().optional(),\n allowedDevOrigins: z.array(z.string()).optional(),\n assetPrefix: z.string().optional(),\n basePath: z.string().optional(),\n bundlePagesRouterDependencies: z.boolean().optional(),\n cacheComponents: z.boolean().optional(),\n cacheHandler: z.string().min(1).optional(),\n cacheHandlers: z.record(z.string(), z.string().optional()).optional(),\n cacheLife: z\n .record(\n z.object({\n stale: z.number().optional(),\n revalidate: z.number().optional(),\n expire: z.number().optional(),\n })\n )\n .optional(),\n cacheMaxMemorySize: z.number().optional(),\n cleanDistDir: z.boolean().optional(),\n compiler: z\n .strictObject({\n emotion: z\n .union([\n z.boolean(),\n z.object({\n sourceMap: z.boolean().optional(),\n autoLabel: z\n .union([\n z.literal('always'),\n z.literal('dev-only'),\n z.literal('never'),\n ])\n .optional(),\n labelFormat: z.string().min(1).optional(),\n importMap: z\n .record(\n z.string(),\n z.record(\n z.string(),\n z.object({\n canonicalImport: z\n .tuple([z.string(), z.string()])\n .optional(),\n styledBaseImport: z\n .tuple([z.string(), z.string()])\n .optional(),\n })\n )\n )\n .optional(),\n }),\n ])\n .optional(),\n reactRemoveProperties: z\n .union([\n z.boolean().optional(),\n z.object({\n properties: z.array(z.string()).optional(),\n }),\n ])\n .optional(),\n relay: z\n .object({\n src: z.string(),\n artifactDirectory: z.string().optional(),\n language: z.enum(['javascript', 'typescript', 'flow']).optional(),\n eagerEsModules: z.boolean().optional(),\n })\n .optional(),\n removeConsole: z\n .union([\n z.boolean().optional(),\n z.object({\n exclude: z.array(z.string()).min(1).optional(),\n }),\n ])\n .optional(),\n styledComponents: z.union([\n z.boolean().optional(),\n z.object({\n displayName: z.boolean().optional(),\n topLevelImportPaths: z.array(z.string()).optional(),\n ssr: z.boolean().optional(),\n fileName: z.boolean().optional(),\n meaninglessFileNames: z.array(z.string()).optional(),\n minify: z.boolean().optional(),\n transpileTemplateLiterals: z.boolean().optional(),\n namespace: z.string().min(1).optional(),\n pure: z.boolean().optional(),\n cssProp: z.boolean().optional(),\n }),\n ]),\n styledJsx: z.union([\n z.boolean().optional(),\n z.object({\n useLightningcss: z.boolean().optional(),\n }),\n ]),\n define: z\n .record(z.string(), z.union([z.string(), z.number(), z.boolean()]))\n .optional(),\n defineServer: z\n .record(z.string(), z.union([z.string(), z.number(), z.boolean()]))\n .optional(),\n runAfterProductionCompile: z\n .function()\n .returns(z.promise(z.void()))\n .optional(),\n })\n .optional(),\n compress: z.boolean().optional(),\n configOrigin: z.string().optional(),\n crossOrigin: z\n .union([z.literal('anonymous'), z.literal('use-credentials')])\n .optional(),\n deploymentId: z.string().optional(),\n devIndicators: z\n .union([\n z.object({\n position: z\n .union([\n z.literal('bottom-left'),\n z.literal('bottom-right'),\n z.literal('top-left'),\n z.literal('top-right'),\n ])\n .optional(),\n }),\n z.literal(false),\n ])\n .optional(),\n distDir: z.string().min(1).optional(),\n env: z.record(z.string(), z.union([z.string(), z.undefined()])).optional(),\n enablePrerenderSourceMaps: z.boolean().optional(),\n excludeDefaultMomentLocales: z.boolean().optional(),\n experimental: z.strictObject(experimentalSchema).optional(),\n exportPathMap: z\n .function()\n .args(\n zExportMap,\n z.object({\n dev: z.boolean(),\n dir: z.string(),\n outDir: z.string().nullable(),\n distDir: z.string(),\n buildId: z.string(),\n })\n )\n .returns(z.union([zExportMap, z.promise(zExportMap)]))\n .optional(),\n generateBuildId: z\n .function()\n .args()\n .returns(\n z.union([\n z.string(),\n z.null(),\n z.promise(z.union([z.string(), z.null()])),\n ])\n )\n .optional(),\n generateEtags: z.boolean().optional(),\n headers: z\n .function()\n .args()\n .returns(z.promise(z.array(zHeader)))\n .optional(),\n htmlLimitedBots: z.instanceof(RegExp).optional(),\n httpAgentOptions: z\n .strictObject({ keepAlive: z.boolean().optional() })\n .optional(),\n i18n: z\n .strictObject({\n defaultLocale: z.string().min(1),\n domains: z\n .array(\n z.strictObject({\n defaultLocale: z.string().min(1),\n domain: z.string().min(1),\n http: z.literal(true).optional(),\n locales: z.array(z.string().min(1)).optional(),\n })\n )\n .optional(),\n localeDetection: z.literal(false).optional(),\n locales: z.array(z.string().min(1)),\n })\n .nullable()\n .optional(),\n images: z\n .strictObject({\n localPatterns: z\n .array(\n z.strictObject({\n pathname: z.string().optional(),\n search: z.string().optional(),\n })\n )\n .max(25)\n .optional(),\n remotePatterns: z\n .array(\n z.union([\n z.instanceof(URL),\n z.strictObject({\n hostname: z.string(),\n pathname: z.string().optional(),\n port: z.string().max(5).optional(),\n protocol: z.enum(['http', 'https']).optional(),\n search: z.string().optional(),\n }),\n ])\n )\n .max(50)\n .optional(),\n unoptimized: z.boolean().optional(),\n customCacheHandler: z.boolean().optional(),\n contentSecurityPolicy: z.string().optional(),\n contentDispositionType: z.enum(['inline', 'attachment']).optional(),\n dangerouslyAllowSVG: z.boolean().optional(),\n dangerouslyAllowLocalIP: z.boolean().optional(),\n deviceSizes: z\n .array(z.number().int().gte(1).lte(10000))\n .max(25)\n .optional(),\n disableStaticImages: z.boolean().optional(),\n domains: z.array(z.string()).max(50).optional(),\n formats: z\n .array(z.enum(['image/avif', 'image/webp']))\n .max(4)\n .optional(),\n imageSizes: z\n .array(z.number().int().gte(1).lte(10000))\n .min(0)\n .max(25)\n .optional(),\n loader: z.enum(VALID_LOADERS).optional(),\n loaderFile: z.string().optional(),\n maximumDiskCacheSize: z.number().int().min(0).optional(),\n maximumRedirects: z.number().int().min(0).max(20).optional(),\n maximumResponseBody: z\n .number()\n .int()\n .min(1)\n .max(Number.MAX_SAFE_INTEGER)\n .optional(),\n minimumCacheTTL: z.number().int().gte(0).optional(),\n path: z.string().optional(),\n qualities: z\n .array(z.number().int().gte(1).lte(100))\n .min(1)\n .max(20)\n .optional(),\n })\n .optional(),\n logging: z\n .union([\n z.object({\n fetches: z\n .object({\n fullUrl: z.boolean().optional(),\n hmrRefreshes: z.boolean().optional(),\n })\n .optional(),\n incomingRequests: z\n .union([\n z.boolean(),\n z.object({\n ignore: z.array(z.instanceof(RegExp)),\n }),\n ])\n .optional(),\n serverFunctions: z.boolean().optional(),\n browserToTerminal: z\n .union([z.boolean(), z.enum(['error', 'warn'])])\n .optional(),\n }),\n z.literal(false),\n ])\n .optional(),\n modularizeImports: z\n .record(\n z.string(),\n z.object({\n transform: z.union([z.string(), z.record(z.string(), z.string())]),\n preventFullImport: z.boolean().optional(),\n skipDefaultConversion: z.boolean().optional(),\n })\n )\n .optional(),\n onDemandEntries: z\n .strictObject({\n maxInactiveAge: z.number().optional(),\n pagesBufferLength: z.number().optional(),\n })\n .optional(),\n output: z.enum(['standalone', 'export']).optional(),\n outputFileTracingRoot: z.string().optional(),\n outputFileTracingExcludes: z\n .record(z.string(), z.array(z.string()))\n .optional(),\n outputFileTracingIncludes: z\n .record(z.string(), z.array(z.string()))\n .optional(),\n pageExtensions: z.array(z.string()).min(1).optional(),\n instrumentationClientInject: z.array(z.string()).optional(),\n partialPrefetching: z\n .union([z.boolean(), z.literal('unstable_eager')])\n .optional(),\n poweredByHeader: z.boolean().optional(),\n productionBrowserSourceMaps: z.boolean().optional(),\n reactCompiler: z.union([\n z.boolean(),\n z\n .object({\n compilationMode: z.enum(['infer', 'annotation', 'all']).optional(),\n panicThreshold: z\n .enum(['none', 'critical_errors', 'all_errors'])\n .optional(),\n })\n .optional(),\n ]),\n reactProductionProfiling: z.boolean().optional(),\n reactStrictMode: z.boolean().nullable().optional(),\n reactMaxHeadersLength: z.number().nonnegative().int().optional(),\n redirects: z\n .function()\n .args()\n .returns(z.promise(z.array(zRedirect)))\n .optional(),\n rewrites: z\n .function()\n .args()\n .returns(\n z.promise(\n z.union([\n z.array(zRewrite),\n z.object({\n beforeFiles: z.array(zRewrite),\n afterFiles: z.array(zRewrite),\n fallback: z.array(zRewrite),\n }),\n ])\n )\n )\n .optional(),\n // sassOptions properties are unknown besides implementation, use z.any() here\n sassOptions: z\n .object({\n implementation: z.string().optional(),\n })\n .catchall(z.any())\n .optional(),\n serverExternalPackages: z.array(z.string()).optional(),\n skipMiddlewareUrlNormalize: z.boolean().optional(),\n skipProxyUrlNormalize: z.boolean().optional(),\n skipTrailingSlashRedirect: z.boolean().optional(),\n staticPageGenerationTimeout: z.number().optional(),\n expireTime: z.number().optional(),\n target: z.string().optional(),\n trailingSlash: z.boolean().optional(),\n transpilePackages: z.array(z.string()).optional(),\n turbopack: zTurbopackConfig.optional(),\n typescript: z\n .strictObject({\n ignoreBuildErrors: z.boolean().optional(),\n tsconfigPath: z.string().min(1).optional(),\n })\n .optional(),\n typedRoutes: z.boolean().optional(),\n useFileSystemPublicRoutes: z.boolean().optional(),\n // The webpack config type is unknown, use z.any() here\n webpack: z.any().nullable().optional(),\n watchOptions: z\n .strictObject({\n pollIntervalMs: z.number().positive().finite().optional(),\n })\n .optional(),\n })\n)\n"],"names":["VALID_LOADERS","z","LIGHTNINGCSS_FEATURE_NAMES","SUPPORTED_TEST_RUNNERS_LIST","zSizeLimit","custom","val","zExportMap","record","string","object","page","query","any","_fallbackRouteParams","array","optional","_isAppDir","boolean","_isDynamicError","_isRoutePPREnabled","_allowEmptyStaticShell","zRouteHas","union","type","enum","key","value","literal","undefined","zRewrite","source","destination","basePath","locale","has","missing","internal","zRedirect","and","statusCode","never","permanent","number","zHeader","headers","zTurbopackLoaderItem","strictObject","loader","options","zTurbopackLoaderBuiltinCondition","zTurbopackCondition","all","lazy","not","path","instanceof","RegExp","content","contentType","zTurbopackModuleType","zTurbopackRuleConfigItem","loaders","as","condition","zTurbopackRuleConfigCollection","zTurbopackConfig","rules","resolveAlias","resolveExtensions","root","debugIds","chunkLoadingGlobal","ignoreIssue","title","description","experimentalSchema","outputHashSalt","useSkewCookie","after","appNavFailHandling","appNewScrollHandler","preloadEntriesOnStart","allowedRevalidateHeaderKeys","staleTimes","dynamic","static","gte","cacheLife","stale","revalidate","expire","cacheHandlers","clientRouterFilter","clientRouterFilterRedirects","clientRouterFilterAllowedRate","cpus","memoryBasedWorkersCount","craCompat","caseSensitiveRoutes","clientParamParsingOrigins","cachedNavigations","dynamicOnHover","useOffline","optimisticRouting","appShells","varyParams","prefetchInlining","maxSize","maxBundleSize","disableOptimizedLoading","disablePostcssPresetEnv","cacheComponents","inlineCss","esmExternals","serverActions","bodySizeLimit","allowedOrigins","maxPostponedStateSize","extensionAlias","externalDir","externalMiddlewareRewritesResolve","externalProxyRewritesResolve","exposeTestingApiInProductionBuild","fallbackNodePolyfills","fetchCacheKeyPrefix","forceSwcTransforms","fullySpecified","gzipSize","imgOptConcurrency","int","nullable","imgOptOperationCache","imgOptTimeoutInSeconds","imgOptMaxInputPixels","imgOptSequentialRead","imgOptSkipMetadata","isrFlushToDisk","largePageDataBytes","linkNoTouchStart","manualClientBasePath","middlewarePrefetch","proxyPrefetch","middlewareClientMaxBodySize","proxyClientMaxBodySize","multiZoneDraftMode","cssChunking","requestCost","nonnegative","finite","moduleFactorCost","nextScriptWorkers","optimizeCss","optimisticClientCache","parallelServerCompiles","parallelServerBuildTraces","ppr","readonly","taint","blockingSSR","prerenderEarlyExit","proxyTimeout","rootParams","mcpServer","removeUncaughtErrorAndRejectionListeners","validateRSCRequestHeaders","scrollRestoration","sri","algorithm","swcPlugins","tuple","swcEnvOptions","mode","coreJs","skip","include","exclude","shippedProposals","forceAllTransforms","debug","loose","swcTraceProfiling","urlImports","viewTransition","workerThreads","webVitalsAttribution","mdxRs","development","jsxRuntime","jsxImportSource","providerImportSource","mdxType","transitionIndicator","gestureTransition","typedRoutes","webpackBuildWorker","webpackMemoryOptimizations","turbopackMemoryEviction","turbopackPluginRuntimeStrategy","turbopackMinify","turbopackFileSystemCacheForDev","turbopackFileSystemCacheForBuild","turbopackSourceMaps","turbopackInputSourceMaps","turbopackTreeShaking","turbopackRemoveUnusedImports","turbopackRemoveUnusedExports","turbopackScopeHoisting","turbopackWorkerAssetPrefix","turbopackClientSideNestedAsyncChunking","turbopackServerSideNestedAsyncChunking","turbopackImportTypeBytes","turbopackImportTypeText","turbopackUseBuiltinBabel","turbopackUseBuiltinSass","turbopackLocalPostcssConfig","turbopackModuleIds","turbopackInferModuleSideEffects","turbopackServerFastRefresh","optimizePackageImports","optimizeServerReact","strictRouteTypes","clientTraceMetadata","serverMinification","serverSourceMaps","useWasmBinary","useLightningcss","lightningCssFeatures","testProxy","defaultTestRunner","allowDevelopmentBuild","reactDebugChannel","instantInsights","validationLevel","staticGenerationRetryCount","staticGenerationMaxConcurrency","staticGenerationMinPagesPerWorker","typedEnv","serverComponentsHmrCache","authInterrupts","useCache","useCacheTimeout","positive","slowModuleDetection","buildTimeThresholdMs","globalNotFound","turbopackRustReactCompiler","browserDebugInfoInTerminal","level","depthLimit","edgeLimit","showSourceLocation","lockDistDir","hideLogsAfterAbort","runtimeServerDeploymentId","supportsImmutableAssets","deferredEntries","onBeforeDeferredEntries","function","returns","promise","void","reportSystemEnvInlining","configSchema","adapterPath","agentRules","allowedDevOrigins","assetPrefix","bundlePagesRouterDependencies","cacheHandler","min","cacheMaxMemorySize","cleanDistDir","compiler","emotion","sourceMap","autoLabel","labelFormat","importMap","canonicalImport","styledBaseImport","reactRemoveProperties","properties","relay","src","artifactDirectory","language","eagerEsModules","removeConsole","styledComponents","displayName","topLevelImportPaths","ssr","fileName","meaninglessFileNames","minify","transpileTemplateLiterals","namespace","pure","cssProp","styledJsx","define","defineServer","runAfterProductionCompile","compress","configOrigin","crossOrigin","deploymentId","devIndicators","position","distDir","env","enablePrerenderSourceMaps","excludeDefaultMomentLocales","experimental","exportPathMap","args","dev","dir","outDir","buildId","generateBuildId","null","generateEtags","htmlLimitedBots","httpAgentOptions","keepAlive","i18n","defaultLocale","domains","domain","http","locales","localeDetection","images","localPatterns","pathname","search","max","remotePatterns","URL","hostname","port","protocol","unoptimized","customCacheHandler","contentSecurityPolicy","contentDispositionType","dangerouslyAllowSVG","dangerouslyAllowLocalIP","deviceSizes","lte","disableStaticImages","formats","imageSizes","loaderFile","maximumDiskCacheSize","maximumRedirects","maximumResponseBody","Number","MAX_SAFE_INTEGER","minimumCacheTTL","qualities","logging","fetches","fullUrl","hmrRefreshes","incomingRequests","ignore","serverFunctions","browserToTerminal","modularizeImports","transform","preventFullImport","skipDefaultConversion","onDemandEntries","maxInactiveAge","pagesBufferLength","output","outputFileTracingRoot","outputFileTracingExcludes","outputFileTracingIncludes","pageExtensions","instrumentationClientInject","partialPrefetching","poweredByHeader","productionBrowserSourceMaps","reactCompiler","compilationMode","panicThreshold","reactProductionProfiling","reactStrictMode","reactMaxHeadersLength","redirects","rewrites","beforeFiles","afterFiles","fallback","sassOptions","implementation","catchall","serverExternalPackages","skipMiddlewareUrlNormalize","skipProxyUrlNormalize","skipTrailingSlashRedirect","staticPageGenerationTimeout","expireTime","target","trailingSlash","transpilePackages","turbopack","typescript","ignoreBuildErrors","tsconfigPath","useFileSystemPublicRoutes","webpack","watchOptions","pollIntervalMs"],"mappings":"AACA,SAASA,aAAa,QAAQ,6BAA4B;AAE1D,SAASC,CAAC,QAAQ,yBAAwB;AAI1C,SACEC,0BAA0B,QAQrB,kBAAiB;AAOxB,SAASC,2BAA2B,QAAQ,mBAAkB;AAE9D,6CAA6C;AAC7C,MAAMC,aAAaH,EAAEI,MAAM,CAAY,CAACC;IACtC,IAAI,OAAOA,QAAQ,YAAY,OAAOA,QAAQ,UAAU;QACtD,OAAO;IACT;IACA,OAAO;AACT;AAEA,MAAMC,aAAyCN,EAAEO,MAAM,CACrDP,EAAEQ,MAAM,IACRR,EAAES,MAAM,CAAC;IACPC,MAAMV,EAAEQ,MAAM;IACdG,OAAOX,EAAEY,GAAG;IAEZ,8BAA8B;IAC9BC,sBAAsBb,EAAEc,KAAK,CAACd,EAAEY,GAAG,IAAIG,QAAQ;IAC/CC,WAAWhB,EAAEiB,OAAO,GAAGF,QAAQ;IAC/BG,iBAAiBlB,EAAEiB,OAAO,GAAGF,QAAQ;IACrCI,oBAAoBnB,EAAEiB,OAAO,GAAGF,QAAQ;IACxCK,wBAAwBpB,EAAEiB,OAAO,GAAGF,QAAQ;AAC9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C,uDAAuD;QACvD+Y,SAAS9Z,EAAEY,GAAG,GAAGsH,QAAQ,GAAGnH,QAAQ;QACpCgZ,cAAc/Z,EACX8C,YAAY,CAAC;YACZkX,gBAAgBha,EAAE0C,MAAM,GAAGuM,QAAQ,GAAG7F,MAAM,GAAGrI,QAAQ;QACzD,GACCA,QAAQ;IACb,IACD","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/server/config-schema.ts"],"sourcesContent":["import type { NextConfig } from './config'\nimport { VALID_LOADERS } from '../shared/lib/image-config'\n\nimport { z } from 'next/dist/compiled/zod'\nimport type zod from 'next/dist/compiled/zod'\n\nimport type { SizeLimit } from '../types'\nimport {\n LIGHTNINGCSS_FEATURE_NAMES,\n type ExportPathMap,\n type TurbopackLoaderItem,\n type TurbopackOptions,\n type TurbopackRuleConfigItem,\n type TurbopackRuleConfigCollection,\n type TurbopackRuleCondition,\n type TurbopackLoaderBuiltinCondition,\n} from './config-shared'\nimport type {\n Header,\n Rewrite,\n RouteHas,\n Redirect,\n} from '../lib/load-custom-routes'\nimport { SUPPORTED_TEST_RUNNERS_LIST } from '../cli/next-test'\n\n// A custom zod schema for the SizeLimit type\nconst zSizeLimit = z.custom<SizeLimit>((val) => {\n if (typeof val === 'number' || typeof val === 'string') {\n return true\n }\n return false\n})\n\nconst zExportMap: zod.ZodType<ExportPathMap> = z.record(\n z.string(),\n z.object({\n page: z.string(),\n query: z.any(), // NextParsedUrlQuery\n\n // private optional properties\n _fallbackRouteParams: z.array(z.any()).optional(),\n _isAppDir: z.boolean().optional(),\n _isDynamicError: z.boolean().optional(),\n _isRoutePPREnabled: z.boolean().optional(),\n _allowEmptyStaticShell: z.boolean().optional(),\n })\n)\n\nconst zRouteHas: zod.ZodType<RouteHas> = z.union([\n z.object({\n type: z.enum(['header', 'query', 'cookie']),\n key: z.string(),\n value: z.string().optional(),\n }),\n z.object({\n type: z.literal('host'),\n key: z.undefined().optional(),\n value: z.string(),\n }),\n])\n\nconst zRewrite: zod.ZodType<Rewrite> = z.object({\n source: z.string(),\n destination: z.string(),\n basePath: z.literal(false).optional(),\n locale: z.literal(false).optional(),\n has: z.array(zRouteHas).optional(),\n missing: z.array(zRouteHas).optional(),\n internal: z.boolean().optional(),\n})\n\nconst zRedirect: zod.ZodType<Redirect> = z\n .object({\n source: z.string(),\n destination: z.string(),\n basePath: z.literal(false).optional(),\n locale: z.literal(false).optional(),\n has: z.array(zRouteHas).optional(),\n missing: z.array(zRouteHas).optional(),\n internal: z.boolean().optional(),\n })\n .and(\n z.union([\n z.object({\n statusCode: z.never().optional(),\n permanent: z.boolean(),\n }),\n z.object({\n statusCode: z.number(),\n permanent: z.never().optional(),\n }),\n ])\n )\n\nconst zHeader: zod.ZodType<Header> = z.object({\n source: z.string(),\n basePath: z.literal(false).optional(),\n locale: z.literal(false).optional(),\n headers: z.array(z.object({ key: z.string(), value: z.string() })),\n has: z.array(zRouteHas).optional(),\n missing: z.array(zRouteHas).optional(),\n\n internal: z.boolean().optional(),\n})\n\nconst zTurbopackLoaderItem: zod.ZodType<TurbopackLoaderItem> = z.union([\n z.string(),\n z.strictObject({\n loader: z.string(),\n // Any JSON value can be used as turbo loader options, so use z.any() here\n options: z.record(z.string(), z.any()).optional(),\n }),\n])\n\nconst zTurbopackLoaderBuiltinCondition: zod.ZodType<TurbopackLoaderBuiltinCondition> =\n z.union([\n z.literal('browser'),\n z.literal('foreign'),\n z.literal('development'),\n z.literal('production'),\n z.literal('node'),\n z.literal('edge-light'),\n ])\n\nconst zTurbopackCondition: zod.ZodType<TurbopackRuleCondition> = z.union([\n z.strictObject({ all: z.lazy(() => z.array(zTurbopackCondition)) }),\n z.strictObject({ any: z.lazy(() => z.array(zTurbopackCondition)) }),\n z.strictObject({ not: z.lazy(() => zTurbopackCondition) }),\n zTurbopackLoaderBuiltinCondition,\n z.strictObject({\n path: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n content: z.instanceof(RegExp).optional(),\n query: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n contentType: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n }),\n])\n\nconst zTurbopackModuleType = z.enum([\n 'asset',\n 'ecmascript',\n 'typescript',\n 'css',\n 'css-module',\n 'wasm',\n 'raw',\n 'node',\n 'bytes',\n])\n\nconst zTurbopackRuleConfigItem: zod.ZodType<TurbopackRuleConfigItem> =\n z.strictObject({\n loaders: z.array(zTurbopackLoaderItem).optional(),\n as: z.string().optional(),\n condition: zTurbopackCondition.optional(),\n type: zTurbopackModuleType.optional(),\n })\n\nconst zTurbopackRuleConfigCollection: zod.ZodType<TurbopackRuleConfigCollection> =\n z.union([\n zTurbopackRuleConfigItem,\n z.array(z.union([zTurbopackLoaderItem, zTurbopackRuleConfigItem])),\n ])\n\nconst zTurbopackConfig: zod.ZodType<TurbopackOptions> = z.strictObject({\n rules: z.record(z.string(), zTurbopackRuleConfigCollection).optional(),\n resolveAlias: z\n .record(\n z.string(),\n z.union([\n z.string(),\n z.array(z.string()),\n z.record(z.string(), z.union([z.string(), z.array(z.string())])),\n ])\n )\n .optional(),\n resolveExtensions: z.array(z.string()).optional(),\n root: z.string().optional(),\n debugIds: z.boolean().optional(),\n chunkLoadingGlobal: z.string().optional(),\n ignoreIssue: z\n .array(\n z.object({\n path: z.union([z.string(), z.instanceof(RegExp)]),\n title: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n description: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n })\n )\n .optional(),\n})\n\nexport const experimentalSchema = {\n outputHashSalt: z.string().optional(),\n useSkewCookie: z.boolean().optional(),\n after: z.boolean().optional(),\n appNavFailHandling: z.boolean().optional(),\n appNewScrollHandler: z.boolean().optional(),\n preloadEntriesOnStart: z.boolean().optional(),\n allowedRevalidateHeaderKeys: z.array(z.string()).optional(),\n staleTimes: z\n .object({\n dynamic: z.number().optional(),\n static: z.number().gte(30).optional(),\n })\n .optional(),\n cacheLife: z\n .record(\n z.object({\n stale: z.number().optional(),\n revalidate: z.number().optional(),\n expire: z.number().optional(),\n })\n )\n .optional(),\n cacheHandlers: z.record(z.string(), z.string().optional()).optional(),\n clientRouterFilter: z.boolean().optional(),\n clientRouterFilterRedirects: z.boolean().optional(),\n clientRouterFilterAllowedRate: z.number().optional(),\n cpus: z.number().optional(),\n memoryBasedWorkersCount: z.boolean().optional(),\n craCompat: z.boolean().optional(),\n caseSensitiveRoutes: z.boolean().optional(),\n clientParamParsingOrigins: z.array(z.string()).optional(),\n cachedNavigations: z.boolean().optional(),\n dynamicOnHover: z.boolean().optional(),\n useOffline: z.boolean().optional(),\n optimisticRouting: z.boolean().optional(),\n instrumentationClientRouterTransitionEvents: z.boolean().optional(),\n appShells: z.boolean().optional(),\n varyParams: z.boolean().optional(),\n prefetchInlining: z\n .union([\n z.boolean(),\n z.object({\n maxSize: z.number().optional(),\n maxBundleSize: z.number().optional(),\n }),\n ])\n .optional(),\n disableOptimizedLoading: z.boolean().optional(),\n disablePostcssPresetEnv: z.boolean().optional(),\n cacheComponents: z.boolean().optional(),\n inlineCss: z.boolean().optional(),\n esmExternals: z.union([z.boolean(), z.literal('loose')]).optional(),\n serverActions: z\n .object({\n bodySizeLimit: zSizeLimit.optional(),\n allowedOrigins: z.array(z.string()).optional(),\n })\n .optional(),\n maxPostponedStateSize: zSizeLimit.optional(),\n // The original type was Record<string, any>\n extensionAlias: z.record(z.string(), z.any()).optional(),\n externalDir: z.boolean().optional(),\n externalMiddlewareRewritesResolve: z.boolean().optional(),\n externalProxyRewritesResolve: z.boolean().optional(),\n exposeTestingApiInProductionBuild: z.boolean().optional(),\n fallbackNodePolyfills: z.literal(false).optional(),\n fetchCacheKeyPrefix: z.string().optional(),\n forceSwcTransforms: z.boolean().optional(),\n fullySpecified: z.boolean().optional(),\n gzipSize: z.boolean().optional(),\n imgOptConcurrency: z.number().int().optional().nullable(),\n imgOptOperationCache: z.boolean().optional().nullable(),\n imgOptTimeoutInSeconds: z.number().int().optional(),\n imgOptMaxInputPixels: z.number().int().optional(),\n imgOptSequentialRead: z.boolean().optional().nullable(),\n imgOptSkipMetadata: z.boolean().optional().nullable(),\n isrFlushToDisk: z.boolean().optional(),\n largePageDataBytes: z.number().optional(),\n linkNoTouchStart: z.boolean().optional(),\n manualClientBasePath: z.boolean().optional(),\n middlewarePrefetch: z.enum(['strict', 'flexible']).optional(),\n proxyPrefetch: z.enum(['strict', 'flexible']).optional(),\n middlewareClientMaxBodySize: zSizeLimit.optional(),\n proxyClientMaxBodySize: zSizeLimit.optional(),\n multiZoneDraftMode: z.boolean().optional(),\n cssChunking: z\n .union([\n z.boolean(),\n z.literal('strict'),\n z.literal('loose'),\n z.literal('graph'),\n z.strictObject({ type: z.literal('strict') }),\n z.strictObject({ type: z.literal('loose') }),\n z.strictObject({\n type: z.literal('graph'),\n requestCost: z.number().nonnegative().finite().optional(),\n moduleFactorCost: z.number().nonnegative().finite().optional(),\n }),\n ])\n .optional(),\n nextScriptWorkers: z.boolean().optional(),\n // The critter option is unknown, use z.any() here\n optimizeCss: z.union([z.boolean(), z.any()]).optional(),\n optimisticClientCache: z.boolean().optional(),\n parallelServerCompiles: z.boolean().optional(),\n parallelServerBuildTraces: z.boolean().optional(),\n ppr: z\n .union([z.boolean(), z.literal('incremental')])\n .readonly()\n .optional(),\n taint: z.boolean().optional(),\n blockingSSR: z.boolean().optional(),\n prerenderEarlyExit: z.boolean().optional(),\n proxyTimeout: z.number().gte(0).optional(),\n rootParams: z.boolean().optional(),\n mcpServer: z.boolean().optional(),\n removeUncaughtErrorAndRejectionListeners: z.boolean().optional(),\n validateRSCRequestHeaders: z.boolean().optional(),\n scrollRestoration: z.boolean().optional(),\n sri: z\n .object({\n algorithm: z.enum(['sha256', 'sha384', 'sha512']).optional(),\n })\n .optional(),\n swcPlugins: z\n // The specific swc plugin's option is unknown, use z.any() here\n .array(z.tuple([z.string(), z.record(z.string(), z.any())]))\n .optional(),\n swcEnvOptions: z\n .object({\n mode: z.enum(['usage', 'entry']).optional(),\n coreJs: z.string().optional(),\n skip: z.array(z.string()).optional(),\n include: z.array(z.string()).optional(),\n exclude: z.array(z.string()).optional(),\n shippedProposals: z.boolean().optional(),\n forceAllTransforms: z.boolean().optional(),\n debug: z.boolean().optional(),\n loose: z.boolean().optional(),\n })\n .optional(),\n swcTraceProfiling: z.boolean().optional(),\n // NonNullable<webpack.Configuration['experiments']>['buildHttp']\n urlImports: z.any().optional(),\n viewTransition: z.boolean().optional(),\n workerThreads: z.boolean().optional(),\n webVitalsAttribution: z\n .array(\n z.union([\n z.literal('CLS'),\n z.literal('FCP'),\n z.literal('FID'),\n z.literal('INP'),\n z.literal('LCP'),\n z.literal('TTFB'),\n ])\n )\n .optional(),\n // This is partial set of mdx-rs transform options we support, aligned\n // with next_core::next_config::MdxRsOptions. Ensure both types are kept in sync.\n mdxRs: z\n .union([\n z.boolean(),\n z.object({\n development: z.boolean().optional(),\n jsxRuntime: z.string().optional(),\n jsxImportSource: z.string().optional(),\n providerImportSource: z.string().optional(),\n mdxType: z.enum(['gfm', 'commonmark']).optional(),\n }),\n ])\n .optional(),\n transitionIndicator: z.boolean().optional(),\n gestureTransition: z.boolean().optional(),\n typedRoutes: z.boolean().optional(),\n webpackBuildWorker: z.boolean().optional(),\n webpackMemoryOptimizations: z.boolean().optional(),\n turbopackMemoryEviction: z\n .union([z.literal(false), z.literal('full')])\n .optional(),\n turbopackPluginRuntimeStrategy: z\n .enum(['workerThreads', 'childProcesses', 'forceWorkerThreads'])\n .optional(),\n turbopackMinify: z.boolean().optional(),\n turbopackFileSystemCacheForDev: z.boolean().optional(),\n turbopackFileSystemCacheForBuild: z.boolean().optional(),\n turbopackSourceMaps: z.boolean().optional(),\n turbopackInputSourceMaps: z.boolean().optional(),\n turbopackTreeShaking: z.boolean().optional(),\n turbopackRemoveUnusedImports: z.boolean().optional(),\n turbopackRemoveUnusedExports: z.boolean().optional(),\n turbopackScopeHoisting: z.boolean().optional(),\n turbopackWorkerAssetPrefix: z.string().optional(),\n turbopackClientSideNestedAsyncChunking: z.boolean().optional(),\n turbopackServerSideNestedAsyncChunking: z.boolean().optional(),\n turbopackImportTypeBytes: z.boolean().optional(),\n turbopackImportTypeText: z.boolean().optional(),\n turbopackUseBuiltinBabel: z.boolean().optional(),\n turbopackUseBuiltinSass: z.boolean().optional(),\n turbopackLocalPostcssConfig: z.boolean().optional(),\n turbopackModuleIds: z.enum(['named', 'deterministic']).optional(),\n turbopackInferModuleSideEffects: z.boolean().optional(),\n turbopackServerFastRefresh: z.boolean().optional(),\n optimizePackageImports: z.array(z.string()).optional(),\n optimizeServerReact: z.boolean().optional(),\n strictRouteTypes: z.boolean().optional(),\n clientTraceMetadata: z.array(z.string()).optional(),\n serverMinification: z.boolean().optional(),\n serverSourceMaps: z.boolean().optional(),\n useWasmBinary: z.boolean().optional(),\n useLightningcss: z.boolean().optional(),\n lightningCssFeatures: z\n .object({\n include: z.array(z.enum(LIGHTNINGCSS_FEATURE_NAMES)).optional(),\n exclude: z.array(z.enum(LIGHTNINGCSS_FEATURE_NAMES)).optional(),\n })\n .optional(),\n testProxy: z.boolean().optional(),\n defaultTestRunner: z.enum(SUPPORTED_TEST_RUNNERS_LIST).optional(),\n allowDevelopmentBuild: z.literal(true).optional(),\n\n reactDebugChannel: z.boolean().optional(),\n instantInsights: z\n .object({\n validationLevel: z\n .enum([\n 'warning',\n 'manual-warning',\n 'experimental-error',\n 'experimental-manual-error',\n ])\n .optional(),\n })\n .optional(),\n staticGenerationRetryCount: z.number().int().optional(),\n staticGenerationMaxConcurrency: z.number().int().optional(),\n staticGenerationMinPagesPerWorker: z.number().int().optional(),\n typedEnv: z.boolean().optional(),\n serverComponentsHmrCache: z.boolean().optional(),\n authInterrupts: z.boolean().optional(),\n useCache: z.boolean().optional(),\n useCacheTimeout: z.number().positive().optional(),\n slowModuleDetection: z\n .object({\n buildTimeThresholdMs: z.number().int(),\n })\n .optional(),\n globalNotFound: z.boolean().optional(),\n turbopackRustReactCompiler: z.boolean().optional(),\n browserDebugInfoInTerminal: z\n .union([\n z.boolean(),\n z.enum(['error', 'warn', 'verbose']),\n z.object({\n level: z.enum(['error', 'warn', 'verbose']).optional(),\n depthLimit: z.number().int().positive().optional(),\n edgeLimit: z.number().int().positive().optional(),\n showSourceLocation: z.boolean().optional(),\n }),\n ])\n .optional(),\n lockDistDir: z.boolean().optional(),\n hideLogsAfterAbort: z.boolean().optional(),\n runtimeServerDeploymentId: z.boolean().optional(),\n supportsImmutableAssets: z.boolean().optional(),\n deferredEntries: z.array(z.string()).optional(),\n onBeforeDeferredEntries: z.function().returns(z.promise(z.void())).optional(),\n reportSystemEnvInlining: z.enum(['warn', 'error']).optional(),\n}\n\nexport const configSchema: zod.ZodType<NextConfig> = z.lazy(() =>\n z.strictObject({\n adapterPath: z.string().optional(),\n agentRules: z.boolean().optional(),\n allowedDevOrigins: z.array(z.string()).optional(),\n assetPrefix: z.string().optional(),\n basePath: z.string().optional(),\n bundlePagesRouterDependencies: z.boolean().optional(),\n cacheComponents: z.boolean().optional(),\n cacheHandler: z.string().min(1).optional(),\n cacheHandlers: z.record(z.string(), z.string().optional()).optional(),\n cacheLife: z\n .record(\n z.object({\n stale: z.number().optional(),\n revalidate: z.number().optional(),\n expire: z.number().optional(),\n })\n )\n .optional(),\n cacheMaxMemorySize: z.number().optional(),\n cleanDistDir: z.boolean().optional(),\n compiler: z\n .strictObject({\n emotion: z\n .union([\n z.boolean(),\n z.object({\n sourceMap: z.boolean().optional(),\n autoLabel: z\n .union([\n z.literal('always'),\n z.literal('dev-only'),\n z.literal('never'),\n ])\n .optional(),\n labelFormat: z.string().min(1).optional(),\n importMap: z\n .record(\n z.string(),\n z.record(\n z.string(),\n z.object({\n canonicalImport: z\n .tuple([z.string(), z.string()])\n .optional(),\n styledBaseImport: z\n .tuple([z.string(), z.string()])\n .optional(),\n })\n )\n )\n .optional(),\n }),\n ])\n .optional(),\n reactRemoveProperties: z\n .union([\n z.boolean().optional(),\n z.object({\n properties: z.array(z.string()).optional(),\n }),\n ])\n .optional(),\n relay: z\n .object({\n src: z.string(),\n artifactDirectory: z.string().optional(),\n language: z.enum(['javascript', 'typescript', 'flow']).optional(),\n eagerEsModules: z.boolean().optional(),\n })\n .optional(),\n removeConsole: z\n .union([\n z.boolean().optional(),\n z.object({\n exclude: z.array(z.string()).min(1).optional(),\n }),\n ])\n .optional(),\n styledComponents: z.union([\n z.boolean().optional(),\n z.object({\n displayName: z.boolean().optional(),\n topLevelImportPaths: z.array(z.string()).optional(),\n ssr: z.boolean().optional(),\n fileName: z.boolean().optional(),\n meaninglessFileNames: z.array(z.string()).optional(),\n minify: z.boolean().optional(),\n transpileTemplateLiterals: z.boolean().optional(),\n namespace: z.string().min(1).optional(),\n pure: z.boolean().optional(),\n cssProp: z.boolean().optional(),\n }),\n ]),\n styledJsx: z.union([\n z.boolean().optional(),\n z.object({\n useLightningcss: z.boolean().optional(),\n }),\n ]),\n define: z\n .record(z.string(), z.union([z.string(), z.number(), z.boolean()]))\n .optional(),\n defineServer: z\n .record(z.string(), z.union([z.string(), z.number(), z.boolean()]))\n .optional(),\n runAfterProductionCompile: z\n .function()\n .returns(z.promise(z.void()))\n .optional(),\n })\n .optional(),\n compress: z.boolean().optional(),\n configOrigin: z.string().optional(),\n crossOrigin: z\n .union([z.literal('anonymous'), z.literal('use-credentials')])\n .optional(),\n deploymentId: z.string().optional(),\n devIndicators: z\n .union([\n z.object({\n position: z\n .union([\n z.literal('bottom-left'),\n z.literal('bottom-right'),\n z.literal('top-left'),\n z.literal('top-right'),\n ])\n .optional(),\n }),\n z.literal(false),\n ])\n .optional(),\n distDir: z.string().min(1).optional(),\n env: z.record(z.string(), z.union([z.string(), z.undefined()])).optional(),\n enablePrerenderSourceMaps: z.boolean().optional(),\n excludeDefaultMomentLocales: z.boolean().optional(),\n experimental: z.strictObject(experimentalSchema).optional(),\n exportPathMap: z\n .function()\n .args(\n zExportMap,\n z.object({\n dev: z.boolean(),\n dir: z.string(),\n outDir: z.string().nullable(),\n distDir: z.string(),\n buildId: z.string(),\n })\n )\n .returns(z.union([zExportMap, z.promise(zExportMap)]))\n .optional(),\n generateBuildId: z\n .function()\n .args()\n .returns(\n z.union([\n z.string(),\n z.null(),\n z.promise(z.union([z.string(), z.null()])),\n ])\n )\n .optional(),\n generateEtags: z.boolean().optional(),\n headers: z\n .function()\n .args()\n .returns(z.promise(z.array(zHeader)))\n .optional(),\n htmlLimitedBots: z.instanceof(RegExp).optional(),\n httpAgentOptions: z\n .strictObject({ keepAlive: z.boolean().optional() })\n .optional(),\n i18n: z\n .strictObject({\n defaultLocale: z.string().min(1),\n domains: z\n .array(\n z.strictObject({\n defaultLocale: z.string().min(1),\n domain: z.string().min(1),\n http: z.literal(true).optional(),\n locales: z.array(z.string().min(1)).optional(),\n })\n )\n .optional(),\n localeDetection: z.literal(false).optional(),\n locales: z.array(z.string().min(1)),\n })\n .nullable()\n .optional(),\n images: z\n .strictObject({\n localPatterns: z\n .array(\n z.strictObject({\n pathname: z.string().optional(),\n search: z.string().optional(),\n })\n )\n .max(25)\n .optional(),\n remotePatterns: z\n .array(\n z.union([\n z.instanceof(URL),\n z.strictObject({\n hostname: z.string(),\n pathname: z.string().optional(),\n port: z.string().max(5).optional(),\n protocol: z.enum(['http', 'https']).optional(),\n search: z.string().optional(),\n }),\n ])\n )\n .max(50)\n .optional(),\n unoptimized: z.boolean().optional(),\n customCacheHandler: z.boolean().optional(),\n contentSecurityPolicy: z.string().optional(),\n contentDispositionType: z.enum(['inline', 'attachment']).optional(),\n dangerouslyAllowSVG: z.boolean().optional(),\n dangerouslyAllowLocalIP: z.boolean().optional(),\n deviceSizes: z\n .array(z.number().int().gte(1).lte(10000))\n .max(25)\n .optional(),\n disableStaticImages: z.boolean().optional(),\n domains: z.array(z.string()).max(50).optional(),\n formats: z\n .array(z.enum(['image/avif', 'image/webp']))\n .max(4)\n .optional(),\n imageSizes: z\n .array(z.number().int().gte(1).lte(10000))\n .min(0)\n .max(25)\n .optional(),\n loader: z.enum(VALID_LOADERS).optional(),\n loaderFile: z.string().optional(),\n maximumDiskCacheSize: z.number().int().min(0).optional(),\n maximumRedirects: z.number().int().min(0).max(20).optional(),\n maximumResponseBody: z\n .number()\n .int()\n .min(1)\n .max(Number.MAX_SAFE_INTEGER)\n .optional(),\n minimumCacheTTL: z.number().int().gte(0).optional(),\n path: z.string().optional(),\n qualities: z\n .array(z.number().int().gte(1).lte(100))\n .min(1)\n .max(20)\n .optional(),\n })\n .optional(),\n logging: z\n .union([\n z.object({\n fetches: z\n .object({\n fullUrl: z.boolean().optional(),\n hmrRefreshes: z.boolean().optional(),\n })\n .optional(),\n incomingRequests: z\n .union([\n z.boolean(),\n z.object({\n ignore: z.array(z.instanceof(RegExp)),\n }),\n ])\n .optional(),\n serverFunctions: z.boolean().optional(),\n browserToTerminal: z\n .union([z.boolean(), z.enum(['error', 'warn'])])\n .optional(),\n }),\n z.literal(false),\n ])\n .optional(),\n modularizeImports: z\n .record(\n z.string(),\n z.object({\n transform: z.union([z.string(), z.record(z.string(), z.string())]),\n preventFullImport: z.boolean().optional(),\n skipDefaultConversion: z.boolean().optional(),\n })\n )\n .optional(),\n onDemandEntries: z\n .strictObject({\n maxInactiveAge: z.number().optional(),\n pagesBufferLength: z.number().optional(),\n })\n .optional(),\n output: z.enum(['standalone', 'export']).optional(),\n outputFileTracingRoot: z.string().optional(),\n outputFileTracingExcludes: z\n .record(z.string(), z.array(z.string()))\n .optional(),\n outputFileTracingIncludes: z\n .record(z.string(), z.array(z.string()))\n .optional(),\n pageExtensions: z.array(z.string()).min(1).optional(),\n instrumentationClientInject: z.array(z.string()).optional(),\n partialPrefetching: z\n .union([z.boolean(), z.literal('unstable_eager')])\n .optional(),\n poweredByHeader: z.boolean().optional(),\n productionBrowserSourceMaps: z.boolean().optional(),\n reactCompiler: z.union([\n z.boolean(),\n z\n .object({\n compilationMode: z.enum(['infer', 'annotation', 'all']).optional(),\n panicThreshold: z\n .enum(['none', 'critical_errors', 'all_errors'])\n .optional(),\n })\n .optional(),\n ]),\n reactProductionProfiling: z.boolean().optional(),\n reactStrictMode: z.boolean().nullable().optional(),\n reactMaxHeadersLength: z.number().nonnegative().int().optional(),\n redirects: z\n .function()\n .args()\n .returns(z.promise(z.array(zRedirect)))\n .optional(),\n rewrites: z\n .function()\n .args()\n .returns(\n z.promise(\n z.union([\n z.array(zRewrite),\n z.object({\n beforeFiles: z.array(zRewrite),\n afterFiles: z.array(zRewrite),\n fallback: z.array(zRewrite),\n }),\n ])\n )\n )\n .optional(),\n // sassOptions properties are unknown besides implementation, use z.any() here\n sassOptions: z\n .object({\n implementation: z.string().optional(),\n })\n .catchall(z.any())\n .optional(),\n serverExternalPackages: z.array(z.string()).optional(),\n skipMiddlewareUrlNormalize: z.boolean().optional(),\n skipProxyUrlNormalize: z.boolean().optional(),\n skipTrailingSlashRedirect: z.boolean().optional(),\n staticPageGenerationTimeout: z.number().optional(),\n expireTime: z.number().optional(),\n target: z.string().optional(),\n trailingSlash: z.boolean().optional(),\n transpilePackages: z.array(z.string()).optional(),\n turbopack: zTurbopackConfig.optional(),\n typescript: z\n .strictObject({\n ignoreBuildErrors: z.boolean().optional(),\n tsconfigPath: z.string().min(1).optional(),\n })\n .optional(),\n typedRoutes: z.boolean().optional(),\n useFileSystemPublicRoutes: z.boolean().optional(),\n // The webpack config type is unknown, use z.any() here\n webpack: z.any().nullable().optional(),\n watchOptions: z\n .strictObject({\n pollIntervalMs: z.number().positive().finite().optional(),\n })\n .optional(),\n })\n)\n"],"names":["VALID_LOADERS","z","LIGHTNINGCSS_FEATURE_NAMES","SUPPORTED_TEST_RUNNERS_LIST","zSizeLimit","custom","val","zExportMap","record","string","object","page","query","any","_fallbackRouteParams","array","optional","_isAppDir","boolean","_isDynamicError","_isRoutePPREnabled","_allowEmptyStaticShell","zRouteHas","union","type","enum","key","value","literal","undefined","zRewrite","source","destination","basePath","locale","has","missing","internal","zRedirect","and","statusCode","never","permanent","number","zHeader","headers","zTurbopackLoaderItem","strictObject","loader","options","zTurbopackLoaderBuiltinCondition","zTurbopackCondition","all","lazy","not","path","instanceof","RegExp","content","contentType","zTurbopackModuleType","zTurbopackRuleConfigItem","loaders","as","condition","zTurbopackRuleConfigCollection","zTurbopackConfig","rules","resolveAlias","resolveExtensions","root","debugIds","chunkLoadingGlobal","ignoreIssue","title","description","experimentalSchema","outputHashSalt","useSkewCookie","after","appNavFailHandling","appNewScrollHandler","preloadEntriesOnStart","allowedRevalidateHeaderKeys","staleTimes","dynamic","static","gte","cacheLife","stale","revalidate","expire","cacheHandlers","clientRouterFilter","clientRouterFilterRedirects","clientRouterFilterAllowedRate","cpus","memoryBasedWorkersCount","craCompat","caseSensitiveRoutes","clientParamParsingOrigins","cachedNavigations","dynamicOnHover","useOffline","optimisticRouting","instrumentationClientRouterTransitionEvents","appShells","varyParams","prefetchInlining","maxSize","maxBundleSize","disableOptimizedLoading","disablePostcssPresetEnv","cacheComponents","inlineCss","esmExternals","serverActions","bodySizeLimit","allowedOrigins","maxPostponedStateSize","extensionAlias","externalDir","externalMiddlewareRewritesResolve","externalProxyRewritesResolve","exposeTestingApiInProductionBuild","fallbackNodePolyfills","fetchCacheKeyPrefix","forceSwcTransforms","fullySpecified","gzipSize","imgOptConcurrency","int","nullable","imgOptOperationCache","imgOptTimeoutInSeconds","imgOptMaxInputPixels","imgOptSequentialRead","imgOptSkipMetadata","isrFlushToDisk","largePageDataBytes","linkNoTouchStart","manualClientBasePath","middlewarePrefetch","proxyPrefetch","middlewareClientMaxBodySize","proxyClientMaxBodySize","multiZoneDraftMode","cssChunking","requestCost","nonnegative","finite","moduleFactorCost","nextScriptWorkers","optimizeCss","optimisticClientCache","parallelServerCompiles","parallelServerBuildTraces","ppr","readonly","taint","blockingSSR","prerenderEarlyExit","proxyTimeout","rootParams","mcpServer","removeUncaughtErrorAndRejectionListeners","validateRSCRequestHeaders","scrollRestoration","sri","algorithm","swcPlugins","tuple","swcEnvOptions","mode","coreJs","skip","include","exclude","shippedProposals","forceAllTransforms","debug","loose","swcTraceProfiling","urlImports","viewTransition","workerThreads","webVitalsAttribution","mdxRs","development","jsxRuntime","jsxImportSource","providerImportSource","mdxType","transitionIndicator","gestureTransition","typedRoutes","webpackBuildWorker","webpackMemoryOptimizations","turbopackMemoryEviction","turbopackPluginRuntimeStrategy","turbopackMinify","turbopackFileSystemCacheForDev","turbopackFileSystemCacheForBuild","turbopackSourceMaps","turbopackInputSourceMaps","turbopackTreeShaking","turbopackRemoveUnusedImports","turbopackRemoveUnusedExports","turbopackScopeHoisting","turbopackWorkerAssetPrefix","turbopackClientSideNestedAsyncChunking","turbopackServerSideNestedAsyncChunking","turbopackImportTypeBytes","turbopackImportTypeText","turbopackUseBuiltinBabel","turbopackUseBuiltinSass","turbopackLocalPostcssConfig","turbopackModuleIds","turbopackInferModuleSideEffects","turbopackServerFastRefresh","optimizePackageImports","optimizeServerReact","strictRouteTypes","clientTraceMetadata","serverMinification","serverSourceMaps","useWasmBinary","useLightningcss","lightningCssFeatures","testProxy","defaultTestRunner","allowDevelopmentBuild","reactDebugChannel","instantInsights","validationLevel","staticGenerationRetryCount","staticGenerationMaxConcurrency","staticGenerationMinPagesPerWorker","typedEnv","serverComponentsHmrCache","authInterrupts","useCache","useCacheTimeout","positive","slowModuleDetection","buildTimeThresholdMs","globalNotFound","turbopackRustReactCompiler","browserDebugInfoInTerminal","level","depthLimit","edgeLimit","showSourceLocation","lockDistDir","hideLogsAfterAbort","runtimeServerDeploymentId","supportsImmutableAssets","deferredEntries","onBeforeDeferredEntries","function","returns","promise","void","reportSystemEnvInlining","configSchema","adapterPath","agentRules","allowedDevOrigins","assetPrefix","bundlePagesRouterDependencies","cacheHandler","min","cacheMaxMemorySize","cleanDistDir","compiler","emotion","sourceMap","autoLabel","labelFormat","importMap","canonicalImport","styledBaseImport","reactRemoveProperties","properties","relay","src","artifactDirectory","language","eagerEsModules","removeConsole","styledComponents","displayName","topLevelImportPaths","ssr","fileName","meaninglessFileNames","minify","transpileTemplateLiterals","namespace","pure","cssProp","styledJsx","define","defineServer","runAfterProductionCompile","compress","configOrigin","crossOrigin","deploymentId","devIndicators","position","distDir","env","enablePrerenderSourceMaps","excludeDefaultMomentLocales","experimental","exportPathMap","args","dev","dir","outDir","buildId","generateBuildId","null","generateEtags","htmlLimitedBots","httpAgentOptions","keepAlive","i18n","defaultLocale","domains","domain","http","locales","localeDetection","images","localPatterns","pathname","search","max","remotePatterns","URL","hostname","port","protocol","unoptimized","customCacheHandler","contentSecurityPolicy","contentDispositionType","dangerouslyAllowSVG","dangerouslyAllowLocalIP","deviceSizes","lte","disableStaticImages","formats","imageSizes","loaderFile","maximumDiskCacheSize","maximumRedirects","maximumResponseBody","Number","MAX_SAFE_INTEGER","minimumCacheTTL","qualities","logging","fetches","fullUrl","hmrRefreshes","incomingRequests","ignore","serverFunctions","browserToTerminal","modularizeImports","transform","preventFullImport","skipDefaultConversion","onDemandEntries","maxInactiveAge","pagesBufferLength","output","outputFileTracingRoot","outputFileTracingExcludes","outputFileTracingIncludes","pageExtensions","instrumentationClientInject","partialPrefetching","poweredByHeader","productionBrowserSourceMaps","reactCompiler","compilationMode","panicThreshold","reactProductionProfiling","reactStrictMode","reactMaxHeadersLength","redirects","rewrites","beforeFiles","afterFiles","fallback","sassOptions","implementation","catchall","serverExternalPackages","skipMiddlewareUrlNormalize","skipProxyUrlNormalize","skipTrailingSlashRedirect","staticPageGenerationTimeout","expireTime","target","trailingSlash","transpilePackages","turbopack","typescript","ignoreBuildErrors","tsconfigPath","useFileSystemPublicRoutes","webpack","watchOptions","pollIntervalMs"],"mappings":"AACA,SAASA,aAAa,QAAQ,6BAA4B;AAE1D,SAASC,CAAC,QAAQ,yBAAwB;AAI1C,SACEC,0BAA0B,QAQrB,kBAAiB;AAOxB,SAASC,2BAA2B,QAAQ,mBAAkB;AAE9D,6CAA6C;AAC7C,MAAMC,aAAaH,EAAEI,MAAM,CAAY,CAACC;IACtC,IAAI,OAAOA,QAAQ,YAAY,OAAOA,QAAQ,UAAU;QACtD,OAAO;IACT;IACA,OAAO;AACT;AAEA,MAAMC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MAAM,GAAGO,QAAQ;QAC3ByY,eAAexZ,EAAEiB,OAAO,GAAGF,QAAQ;QACnC0Y,mBAAmBzZ,EAAEc,KAAK,CAACd,EAAEQ,MAAM,IAAIO,QAAQ;QAC/C2Y,WAAWzV,iBAAiBlD,QAAQ;QACpC4Y,YAAY3Z,EACT8C,YAAY,CAAC;YACZ8W,mBAAmB5Z,EAAEiB,OAAO,GAAGF,QAAQ;YACvC8Y,cAAc7Z,EAAEQ,MAAM,GAAGsQ,GAAG,CAAC,GAAG/P,QAAQ;QAC1C,GACCA,QAAQ;QACXmL,aAAalM,EAAEiB,OAAO,GAAGF,QAAQ;QACjC+Y,2BAA2B9Z,EAAEiB,OAAO,GAAGF,QAAQ;QAC/C,uDAAuD;QACvDgZ,SAAS/Z,EAAEY,GAAG,GAAGuH,QAAQ,GAAGpH,QAAQ;QACpCiZ,cAAcha,EACX8C,YAAY,CAAC;YACZmX,gBAAgBja,EAAE0C,MAAM,GAAGwM,QAAQ,GAAG7F,MAAM,GAAGtI,QAAQ;QACzD,GACCA,QAAQ;IACb,IACD","ignoreList":[0]} |
@@ -178,2 +178,3 @@ import os from 'os'; | ||
| optimisticRouting: true, | ||
| instrumentationClientRouterTransitionEvents: false, | ||
| prefetchInlining: true, | ||
@@ -180,0 +181,0 @@ preloadEntriesOnStart: true, |
@@ -26,3 +26,3 @@ import { loadEnvConfig } from '@next/env'; | ||
| } | ||
| Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"16.3.0-canary.58"}`))}${versionSuffix}`); | ||
| Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"16.3.0-canary.59"}`))}${versionSuffix}`); | ||
| if (appUrl) { | ||
@@ -29,0 +29,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.0-canary.58"})`; | ||
| process.title = `next-server (v${"16.3.0-canary.59"})`; | ||
| let handlersReady = ()=>{}; | ||
@@ -115,0 +115,0 @@ let handlersError = ()=>{}; |
@@ -86,2 +86,4 @@ /** | ||
| AppRenderSpan["fetch"] = "AppRender.fetch"; | ||
| AppRenderSpan["waitShellReady"] = "AppRender.waitShellReady"; | ||
| AppRenderSpan["renderToNodeFizzStream"] = "AppRender.renderToNodeFizzStream"; | ||
| return AppRenderSpan; | ||
@@ -88,0 +90,0 @@ }(AppRenderSpan || {}); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../../src/server/lib/trace/constants.ts"],"sourcesContent":["/**\n * Contains predefined constants for the trace span name in next/server.\n *\n * Currently, next/server/tracer is internal implementation only for tracking\n * next.js's implementation only with known span names defined here.\n **/\n\n// eslint typescript has a bug with TS enums\n\nenum BaseServerSpan {\n handleRequest = 'BaseServer.handleRequest',\n run = 'BaseServer.run',\n pipe = 'BaseServer.pipe',\n getStaticHTML = 'BaseServer.getStaticHTML',\n render = 'BaseServer.render',\n renderToResponseWithComponents = 'BaseServer.renderToResponseWithComponents',\n renderToResponse = 'BaseServer.renderToResponse',\n renderToHTML = 'BaseServer.renderToHTML',\n renderError = 'BaseServer.renderError',\n renderErrorToResponse = 'BaseServer.renderErrorToResponse',\n renderErrorToHTML = 'BaseServer.renderErrorToHTML',\n render404 = 'BaseServer.render404',\n}\n\nenum LoadComponentsSpan {\n loadDefaultErrorComponents = 'LoadComponents.loadDefaultErrorComponents',\n loadComponents = 'LoadComponents.loadComponents',\n}\n\nenum NextServerSpan {\n getRequestHandler = 'NextServer.getRequestHandler',\n getRequestHandlerWithMetadata = 'NextServer.getRequestHandlerWithMetadata',\n getServer = 'NextServer.getServer',\n getServerRequestHandler = 'NextServer.getServerRequestHandler',\n createServer = 'createServer.createServer',\n}\n\nenum NextNodeServerSpan {\n compression = 'NextNodeServer.compression',\n getBuildId = 'NextNodeServer.getBuildId',\n createComponentTree = 'NextNodeServer.createComponentTree',\n clientComponentLoading = 'NextNodeServer.clientComponentLoading',\n getLayoutOrPageModule = 'NextNodeServer.getLayoutOrPageModule',\n generateStaticRoutes = 'NextNodeServer.generateStaticRoutes',\n generateFsStaticRoutes = 'NextNodeServer.generateFsStaticRoutes',\n generatePublicRoutes = 'NextNodeServer.generatePublicRoutes',\n generateImageRoutes = 'NextNodeServer.generateImageRoutes.route',\n sendRenderResult = 'NextNodeServer.sendRenderResult',\n proxyRequest = 'NextNodeServer.proxyRequest',\n runApi = 'NextNodeServer.runApi',\n render = 'NextNodeServer.render',\n renderHTML = 'NextNodeServer.renderHTML',\n imageOptimizer = 'NextNodeServer.imageOptimizer',\n getPagePath = 'NextNodeServer.getPagePath',\n getRoutesManifest = 'NextNodeServer.getRoutesManifest',\n findPageComponents = 'NextNodeServer.findPageComponents',\n getFontManifest = 'NextNodeServer.getFontManifest',\n getServerComponentManifest = 'NextNodeServer.getServerComponentManifest',\n getRequestHandler = 'NextNodeServer.getRequestHandler',\n renderToHTML = 'NextNodeServer.renderToHTML',\n renderError = 'NextNodeServer.renderError',\n renderErrorToHTML = 'NextNodeServer.renderErrorToHTML',\n render404 = 'NextNodeServer.render404',\n startResponse = 'NextNodeServer.startResponse',\n\n // nested inner span, does not require parent scope name\n route = 'route',\n onProxyReq = 'onProxyReq',\n apiResolver = 'apiResolver',\n internalFetch = 'internalFetch',\n}\n\nenum StartServerSpan {\n startServer = 'startServer.startServer',\n}\n\nenum RenderSpan {\n getServerSideProps = 'Render.getServerSideProps',\n getStaticProps = 'Render.getStaticProps',\n renderToString = 'Render.renderToString',\n renderDocument = 'Render.renderDocument',\n createBodyResult = 'Render.createBodyResult',\n}\n\nenum AppRenderSpan {\n renderToString = 'AppRender.renderToString',\n renderToReadableStream = 'AppRender.renderToReadableStream',\n getBodyResult = 'AppRender.getBodyResult',\n fetch = 'AppRender.fetch',\n}\n\nenum RouterSpan {\n executeRoute = 'Router.executeRoute',\n}\n\nenum NodeSpan {\n runHandler = 'Node.runHandler',\n}\n\nenum AppRouteRouteHandlersSpan {\n runHandler = 'AppRouteRouteHandlers.runHandler',\n}\n\nenum ResolveMetadataSpan {\n generateMetadata = 'ResolveMetadata.generateMetadata',\n generateViewport = 'ResolveMetadata.generateViewport',\n}\n\nenum MiddlewareSpan {\n execute = 'Middleware.execute',\n}\n\ntype SpanTypes =\n | `${BaseServerSpan}`\n | `${LoadComponentsSpan}`\n | `${NextServerSpan}`\n | `${StartServerSpan}`\n | `${NextNodeServerSpan}`\n | `${RenderSpan}`\n | `${RouterSpan}`\n | `${AppRenderSpan}`\n | `${NodeSpan}`\n | `${AppRouteRouteHandlersSpan}`\n | `${ResolveMetadataSpan}`\n | `${MiddlewareSpan}`\n\n// This list is used to filter out spans that are not relevant to the user\nexport const NextVanillaSpanAllowlist = new Set([\n MiddlewareSpan.execute,\n BaseServerSpan.handleRequest,\n RenderSpan.getServerSideProps,\n RenderSpan.getStaticProps,\n AppRenderSpan.fetch,\n AppRenderSpan.getBodyResult,\n RenderSpan.renderDocument,\n NodeSpan.runHandler,\n AppRouteRouteHandlersSpan.runHandler,\n ResolveMetadataSpan.generateMetadata,\n ResolveMetadataSpan.generateViewport,\n NextNodeServerSpan.createComponentTree,\n NextNodeServerSpan.findPageComponents,\n NextNodeServerSpan.getLayoutOrPageModule,\n NextNodeServerSpan.startResponse,\n NextNodeServerSpan.clientComponentLoading,\n])\n\n// These Spans are allowed to be always logged\n// when the otel log prefix env is set\nexport const LogSpanAllowList = new Set([\n NextNodeServerSpan.findPageComponents,\n NextNodeServerSpan.createComponentTree,\n NextNodeServerSpan.clientComponentLoading,\n])\n\nexport {\n BaseServerSpan,\n LoadComponentsSpan,\n NextServerSpan,\n NextNodeServerSpan,\n StartServerSpan,\n RenderSpan,\n RouterSpan,\n AppRenderSpan,\n NodeSpan,\n AppRouteRouteHandlersSpan,\n ResolveMetadataSpan,\n MiddlewareSpan,\n}\n\nexport type { SpanTypes }\n"],"names":["BaseServerSpan","LoadComponentsSpan","NextServerSpan","NextNodeServerSpan","StartServerSpan","RenderSpan","AppRenderSpan","RouterSpan","NodeSpan","AppRouteRouteHandlersSpan","ResolveMetadataSpan","MiddlewareSpan","NextVanillaSpanAllowlist","Set","LogSpanAllowList"],"mappings":"AAAA;;;;;EAKE,GAEF,4CAA4C;AAE5C,IAAA,AAAKA,wCAAAA;;;;;;;;;;;;;WAAAA;EAAAA;AAeL,IAAA,AAAKC,4CAAAA;;;WAAAA;EAAAA;AAKL,IAAA,AAAKC,wCAAAA;;;;;;WAAAA;EAAAA;AAQL,IAAA,AAAKC,4CAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;IA4BH,wDAAwD;;;;;WA5BrDA;EAAAA;AAmCL,IAAA,AAAKC,yCAAAA;;WAAAA;EAAAA;AAIL,IAAA,AAAKC,oCAAAA;;;;;;WAAAA;EAAAA;AAQL,IAAA,AAAKC,uCAAAA;;;;;WAAAA;EAAAA;AAOL,IAAA,AAAKC,oCAAAA;;WAAAA;EAAAA;AAIL,IAAA,AAAKC,kCAAAA;;WAAAA;EAAAA;AAIL,IAAA,AAAKC,mDAAAA;;WAAAA;EAAAA;AAIL,IAAA,AAAKC,6CAAAA;;;WAAAA;EAAAA;AAKL,IAAA,AAAKC,wCAAAA;;WAAAA;EAAAA;AAkBL,0EAA0E;AAC1E,OAAO,MAAMC,2BAA2B,IAAIC,IAAI;;;;;;;;;;;;;;;;;CAiB/C,EAAC;AAEF,8CAA8C;AAC9C,sCAAsC;AACtC,OAAO,MAAMC,mBAAmB,IAAID,IAAI;;;;CAIvC,EAAC;AAEF,SACEb,cAAc,EACdC,kBAAkB,EAClBC,cAAc,EACdC,kBAAkB,EAClBC,eAAe,EACfC,UAAU,EACVE,UAAU,EACVD,aAAa,EACbE,QAAQ,EACRC,yBAAyB,EACzBC,mBAAmB,EACnBC,cAAc,KACf","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../../src/server/lib/trace/constants.ts"],"sourcesContent":["/**\n * Contains predefined constants for the trace span name in next/server.\n *\n * Currently, next/server/tracer is internal implementation only for tracking\n * next.js's implementation only with known span names defined here.\n **/\n\n// eslint typescript has a bug with TS enums\n\nenum BaseServerSpan {\n handleRequest = 'BaseServer.handleRequest',\n run = 'BaseServer.run',\n pipe = 'BaseServer.pipe',\n getStaticHTML = 'BaseServer.getStaticHTML',\n render = 'BaseServer.render',\n renderToResponseWithComponents = 'BaseServer.renderToResponseWithComponents',\n renderToResponse = 'BaseServer.renderToResponse',\n renderToHTML = 'BaseServer.renderToHTML',\n renderError = 'BaseServer.renderError',\n renderErrorToResponse = 'BaseServer.renderErrorToResponse',\n renderErrorToHTML = 'BaseServer.renderErrorToHTML',\n render404 = 'BaseServer.render404',\n}\n\nenum LoadComponentsSpan {\n loadDefaultErrorComponents = 'LoadComponents.loadDefaultErrorComponents',\n loadComponents = 'LoadComponents.loadComponents',\n}\n\nenum NextServerSpan {\n getRequestHandler = 'NextServer.getRequestHandler',\n getRequestHandlerWithMetadata = 'NextServer.getRequestHandlerWithMetadata',\n getServer = 'NextServer.getServer',\n getServerRequestHandler = 'NextServer.getServerRequestHandler',\n createServer = 'createServer.createServer',\n}\n\nenum NextNodeServerSpan {\n compression = 'NextNodeServer.compression',\n getBuildId = 'NextNodeServer.getBuildId',\n createComponentTree = 'NextNodeServer.createComponentTree',\n clientComponentLoading = 'NextNodeServer.clientComponentLoading',\n getLayoutOrPageModule = 'NextNodeServer.getLayoutOrPageModule',\n generateStaticRoutes = 'NextNodeServer.generateStaticRoutes',\n generateFsStaticRoutes = 'NextNodeServer.generateFsStaticRoutes',\n generatePublicRoutes = 'NextNodeServer.generatePublicRoutes',\n generateImageRoutes = 'NextNodeServer.generateImageRoutes.route',\n sendRenderResult = 'NextNodeServer.sendRenderResult',\n proxyRequest = 'NextNodeServer.proxyRequest',\n runApi = 'NextNodeServer.runApi',\n render = 'NextNodeServer.render',\n renderHTML = 'NextNodeServer.renderHTML',\n imageOptimizer = 'NextNodeServer.imageOptimizer',\n getPagePath = 'NextNodeServer.getPagePath',\n getRoutesManifest = 'NextNodeServer.getRoutesManifest',\n findPageComponents = 'NextNodeServer.findPageComponents',\n getFontManifest = 'NextNodeServer.getFontManifest',\n getServerComponentManifest = 'NextNodeServer.getServerComponentManifest',\n getRequestHandler = 'NextNodeServer.getRequestHandler',\n renderToHTML = 'NextNodeServer.renderToHTML',\n renderError = 'NextNodeServer.renderError',\n renderErrorToHTML = 'NextNodeServer.renderErrorToHTML',\n render404 = 'NextNodeServer.render404',\n startResponse = 'NextNodeServer.startResponse',\n\n // nested inner span, does not require parent scope name\n route = 'route',\n onProxyReq = 'onProxyReq',\n apiResolver = 'apiResolver',\n internalFetch = 'internalFetch',\n}\n\nenum StartServerSpan {\n startServer = 'startServer.startServer',\n}\n\nenum RenderSpan {\n getServerSideProps = 'Render.getServerSideProps',\n getStaticProps = 'Render.getStaticProps',\n renderToString = 'Render.renderToString',\n renderDocument = 'Render.renderDocument',\n createBodyResult = 'Render.createBodyResult',\n}\n\nenum AppRenderSpan {\n renderToString = 'AppRender.renderToString',\n renderToReadableStream = 'AppRender.renderToReadableStream',\n getBodyResult = 'AppRender.getBodyResult',\n fetch = 'AppRender.fetch',\n waitShellReady = 'AppRender.waitShellReady',\n renderToNodeFizzStream = 'AppRender.renderToNodeFizzStream',\n}\n\nenum RouterSpan {\n executeRoute = 'Router.executeRoute',\n}\n\nenum NodeSpan {\n runHandler = 'Node.runHandler',\n}\n\nenum AppRouteRouteHandlersSpan {\n runHandler = 'AppRouteRouteHandlers.runHandler',\n}\n\nenum ResolveMetadataSpan {\n generateMetadata = 'ResolveMetadata.generateMetadata',\n generateViewport = 'ResolveMetadata.generateViewport',\n}\n\nenum MiddlewareSpan {\n execute = 'Middleware.execute',\n}\n\ntype SpanTypes =\n | `${BaseServerSpan}`\n | `${LoadComponentsSpan}`\n | `${NextServerSpan}`\n | `${StartServerSpan}`\n | `${NextNodeServerSpan}`\n | `${RenderSpan}`\n | `${RouterSpan}`\n | `${AppRenderSpan}`\n | `${NodeSpan}`\n | `${AppRouteRouteHandlersSpan}`\n | `${ResolveMetadataSpan}`\n | `${MiddlewareSpan}`\n\n// This list is used to filter out spans that are not relevant to the user\nexport const NextVanillaSpanAllowlist = new Set([\n MiddlewareSpan.execute,\n BaseServerSpan.handleRequest,\n RenderSpan.getServerSideProps,\n RenderSpan.getStaticProps,\n AppRenderSpan.fetch,\n AppRenderSpan.getBodyResult,\n RenderSpan.renderDocument,\n NodeSpan.runHandler,\n AppRouteRouteHandlersSpan.runHandler,\n ResolveMetadataSpan.generateMetadata,\n ResolveMetadataSpan.generateViewport,\n NextNodeServerSpan.createComponentTree,\n NextNodeServerSpan.findPageComponents,\n NextNodeServerSpan.getLayoutOrPageModule,\n NextNodeServerSpan.startResponse,\n NextNodeServerSpan.clientComponentLoading,\n])\n\n// These Spans are allowed to be always logged\n// when the otel log prefix env is set\nexport const LogSpanAllowList = new Set([\n NextNodeServerSpan.findPageComponents,\n NextNodeServerSpan.createComponentTree,\n NextNodeServerSpan.clientComponentLoading,\n])\n\nexport {\n BaseServerSpan,\n LoadComponentsSpan,\n NextServerSpan,\n NextNodeServerSpan,\n StartServerSpan,\n RenderSpan,\n RouterSpan,\n AppRenderSpan,\n NodeSpan,\n AppRouteRouteHandlersSpan,\n ResolveMetadataSpan,\n MiddlewareSpan,\n}\n\nexport type { SpanTypes }\n"],"names":["BaseServerSpan","LoadComponentsSpan","NextServerSpan","NextNodeServerSpan","StartServerSpan","RenderSpan","AppRenderSpan","RouterSpan","NodeSpan","AppRouteRouteHandlersSpan","ResolveMetadataSpan","MiddlewareSpan","NextVanillaSpanAllowlist","Set","LogSpanAllowList"],"mappings":"AAAA;;;;;EAKE,GAEF,4CAA4C;AAE5C,IAAA,AAAKA,wCAAAA;;;;;;;;;;;;;WAAAA;EAAAA;AAeL,IAAA,AAAKC,4CAAAA;;;WAAAA;EAAAA;AAKL,IAAA,AAAKC,wCAAAA;;;;;;WAAAA;EAAAA;AAQL,IAAA,AAAKC,4CAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;IA4BH,wDAAwD;;;;;WA5BrDA;EAAAA;AAmCL,IAAA,AAAKC,yCAAAA;;WAAAA;EAAAA;AAIL,IAAA,AAAKC,oCAAAA;;;;;;WAAAA;EAAAA;AAQL,IAAA,AAAKC,uCAAAA;;;;;;;WAAAA;EAAAA;AASL,IAAA,AAAKC,oCAAAA;;WAAAA;EAAAA;AAIL,IAAA,AAAKC,kCAAAA;;WAAAA;EAAAA;AAIL,IAAA,AAAKC,mDAAAA;;WAAAA;EAAAA;AAIL,IAAA,AAAKC,6CAAAA;;;WAAAA;EAAAA;AAKL,IAAA,AAAKC,wCAAAA;;WAAAA;EAAAA;AAkBL,0EAA0E;AAC1E,OAAO,MAAMC,2BAA2B,IAAIC,IAAI;;;;;;;;;;;;;;;;;CAiB/C,EAAC;AAEF,8CAA8C;AAC9C,sCAAsC;AACtC,OAAO,MAAMC,mBAAmB,IAAID,IAAI;;;;CAIvC,EAAC;AAEF,SACEb,cAAc,EACdC,kBAAkB,EAClBC,cAAc,EACdC,kBAAkB,EAClBC,eAAe,EACfC,UAAU,EACVE,UAAU,EACVD,aAAa,EACbE,QAAQ,EACRC,yBAAyB,EACzBC,mBAAmB,EACnBC,cAAc,KACf","ignoreList":[0]} |
@@ -6,3 +6,3 @@ import { workAsyncStorage } from '../app-render/work-async-storage.external'; | ||
| import { makeHangingPromise, makeDevtoolsIOAwarePromise } from '../dynamic-rendering-utils'; | ||
| import { isRequestAPICallableInsideAfter } from './utils'; | ||
| import { isRequestApiAllowedInCurrentPhase } from './utils'; | ||
| import { applyOwnerStack } from '../dynamic-rendering-utils'; | ||
@@ -20,5 +20,5 @@ import { RenderStage } from '../app-render/staged-rendering'; | ||
| if (workStore) { | ||
| if (workUnitStore && workUnitStore.phase === 'after' && !isRequestAPICallableInsideAfter()) { | ||
| throw Object.defineProperty(new Error(`Route ${workStore.route} used \`connection()\` inside \`after()\`. The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but \`after()\` executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { | ||
| value: "E827", | ||
| if (workUnitStore && !isRequestApiAllowedInCurrentPhase(workUnitStore)) { | ||
| throw Object.defineProperty(new Error(`Route ${workStore.route} used \`connection()\` inside \`after()\` while rendering. The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but \`after()\` executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { | ||
| value: "E1369", | ||
| enumerable: false, | ||
@@ -25,0 +25,0 @@ configurable: true |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/server/request/connection.ts"],"sourcesContent":["import { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport {\n throwForMissingRequestStore,\n workUnitAsyncStorage,\n} from '../app-render/work-unit-async-storage.external'\nimport {\n postponeWithTracking,\n throwToInterruptStaticGeneration,\n trackDynamicDataInDynamicRender,\n} from '../app-render/dynamic-rendering'\nimport { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport {\n makeHangingPromise,\n makeDevtoolsIOAwarePromise,\n} from '../dynamic-rendering-utils'\nimport { isRequestAPICallableInsideAfter } from './utils'\nimport { applyOwnerStack } from '../dynamic-rendering-utils'\nimport { RenderStage } from '../app-render/staged-rendering'\nimport { InvariantError } from '../../shared/lib/invariant-error'\n\n/**\n * This function allows you to indicate that you require an actual user Request before continuing.\n *\n * During prerendering it will never resolve and during rendering it resolves immediately.\n */\nexport function connection(): Promise<void> {\n const callingExpression = 'connection'\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workStore) {\n if (\n workUnitStore &&\n workUnitStore.phase === 'after' &&\n !isRequestAPICallableInsideAfter()\n ) {\n throw new Error(\n `Route ${workStore.route} used \\`connection()\\` inside \\`after()\\`. The \\`connection()\\` function is used to indicate the subsequent code must only run when there is an actual Request, but \\`after()\\` executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`\n )\n }\n\n if (workStore.forceStatic) {\n // When using forceStatic, we override all other logic and always just\n // return a resolving promise without tracking.\n return Promise.resolve(undefined)\n }\n\n if (workStore.dynamicShouldError) {\n throw new StaticGenBailoutError(\n `Route ${workStore.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`connection()\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'cache': {\n const error = new Error(\n `Route ${workStore.route} used \\`connection()\\` inside \"use cache\". The \\`connection()\\` function is used to indicate the subsequent code must only run when there is an actual request, but caches must be able to be produced before a request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n Error.captureStackTrace(error, connection)\n applyOwnerStack(error)\n workStore.invalidDynamicUsageError ??= error\n throw error\n }\n case 'private-cache': {\n // It might not be intuitive to throw for private caches as well, but\n // we don't consider runtime prefetches as \"actual requests\" (in the\n // navigation sense), despite allowing them to read cookies.\n const error = new Error(\n `Route ${workStore.route} used \\`connection()\\` inside \"use cache: private\". The \\`connection()\\` function is used to indicate the subsequent code must only run when there is an actual navigation request, but caches must be able to be produced before a navigation request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n Error.captureStackTrace(error, connection)\n applyOwnerStack(error)\n workStore.invalidDynamicUsageError ??= error\n throw error\n }\n case 'unstable-cache':\n throw new Error(\n `Route ${workStore.route} used \\`connection()\\` inside a function cached with \\`unstable_cache()\\`. The \\`connection()\\` function is used to indicate the subsequent code must only run when there is an actual Request, but caches must be able to be produced before a Request so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`\n )\n case 'generate-static-params':\n throw new Error(\n `Route ${workStore.route} used \\`connection()\\` inside \\`generateStaticParams\\`. This is not supported because \\`generateStaticParams\\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`\n )\n case 'prerender':\n case 'prerender-client':\n case 'prerender-runtime':\n // We return a promise that never resolves to allow the prerender to\n // stall at this point.\n return makeHangingPromise(\n workUnitStore.renderSignal,\n workStore.route,\n '`connection()`'\n )\n case 'validation-client': {\n // TODO(NAR-789): make this consistent with the actual browser behavior when we change it.\n // Until then, erroring is fine.\n const exportName = '`connection`'\n throw new InvariantError(\n `${exportName} must not be used within a Client Component. Next.js should be preventing ${exportName} from being included in Client Components statically, but did not in this case.`\n )\n }\n case 'prerender-ppr':\n // We use React's postpone API to interrupt rendering here to create a\n // dynamic hole\n return postponeWithTracking(\n workStore.route,\n 'connection',\n workUnitStore.dynamicTracking\n )\n case 'prerender-legacy':\n // We throw an error here to interrupt prerendering to mark the route\n // as dynamic\n return throwToInterruptStaticGeneration(\n 'connection',\n workStore,\n workUnitStore\n )\n case 'request':\n trackDynamicDataInDynamicRender(workUnitStore)\n if (process.env.NODE_ENV === 'development') {\n // Semantically we only need the dev tracking when running in `next dev`\n // but since you would never use next dev with production NODE_ENV we use this\n // as a proxy so we can statically exclude this code from production builds.\n if (workUnitStore.asyncApiPromises) {\n return workUnitStore.asyncApiPromises.connection\n }\n return makeDevtoolsIOAwarePromise(\n undefined,\n workUnitStore,\n RenderStage.Dynamic\n )\n } else if (workUnitStore.asyncApiPromises) {\n return workUnitStore.asyncApiPromises.connection\n } else {\n return Promise.resolve(undefined)\n }\n default:\n workUnitStore satisfies never\n }\n }\n }\n\n // If we end up here, there was no work store or work unit store present.\n // TODO(NAR-789): connection() is not currently statically prevented from being imported in client components,\n // so we always error about a missing work unit store.\n throwForMissingRequestStore(callingExpression)\n}\n"],"names":["workAsyncStorage","throwForMissingRequestStore","workUnitAsyncStorage","postponeWithTracking","throwToInterruptStaticGeneration","trackDynamicDataInDynamicRender","StaticGenBailoutError","makeHangingPromise","makeDevtoolsIOAwarePromise","isRequestAPICallableInsideAfter","applyOwnerStack","RenderStage","InvariantError","connection","callingExpression","workStore","getStore","workUnitStore","phase","Error","route","forceStatic","Promise","resolve","undefined","dynamicShouldError","type","error","captureStackTrace","invalidDynamicUsageError","renderSignal","exportName","dynamicTracking","process","env","NODE_ENV","asyncApiPromises","Dynamic"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,4CAA2C;AAC5E,SACEC,2BAA2B,EAC3BC,oBAAoB,QACf,iDAAgD;AACvD,SACEC,oBAAoB,EACpBC,gCAAgC,EAChCC,+BAA+B,QAC1B,kCAAiC;AACxC,SAASC,qBAAqB,QAAQ,oDAAmD;AACzF,SACEC,kBAAkB,EAClBC,0BAA0B,QACrB,6BAA4B;AACnC,SAASC,+BAA+B,QAAQ,UAAS;AACzD,SAASC,eAAe,QAAQ,6BAA4B;AAC5D,SAASC,WAAW,QAAQ,iCAAgC;AAC5D,SAASC,cAAc,QAAQ,mCAAkC;AAEjE;;;;CAIC,GACD,OAAO,SAASC;IACd,MAAMC,oBAAoB;IAC1B,MAAMC,YAAYf,iBAAiBgB,QAAQ;IAC3C,MAAMC,gBAAgBf,qBAAqBc,QAAQ;IAEnD,IAAID,WAAW;QACb,IACEE,iBACAA,cAAcC,KAAK,KAAK,WACxB,CAACT,mCACD;YACA,MAAM,qBAEL,CAFK,IAAIU,MACR,CAAC,MAAM,EAAEJ,UAAUK,KAAK,CAAC,wUAAwU,CAAC,GAD9V,qBAAA;uBAAA;4BAAA;8BAAA;YAEN;QACF;QAEA,IAAIL,UAAUM,WAAW,EAAE;YACzB,sEAAsE;YACtE,+CAA+C;YAC/C,OAAOC,QAAQC,OAAO,CAACC;QACzB;QAEA,IAAIT,UAAUU,kBAAkB,EAAE;YAChC,MAAM,qBAEL,CAFK,IAAInB,sBACR,CAAC,MAAM,EAAES,UAAUK,KAAK,CAAC,sNAAsN,CAAC,GAD5O,qBAAA;uBAAA;4BAAA;8BAAA;YAEN;QACF;QAEA,IAAIH,eAAe;YACjB,OAAQA,cAAcS,IAAI;gBACxB,KAAK;oBAAS;wBACZ,M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E,eAAe;oBACf,OAAO5B,qBACLY,UAAUK,KAAK,EACf,cACAH,cAAce,eAAe;gBAEjC,KAAK;oBACH,qEAAqE;oBACrE,aAAa;oBACb,OAAO5B,iCACL,cACAW,WACAE;gBAEJ,KAAK;oBACHZ,gCAAgCY;oBAChC,IAAIgB,QAAQC,GAAG,CAACC,QAAQ,KAAK,eAAe;wBAC1C,wEAAwE;wBACxE,8EAA8E;wBAC9E,4EAA4E;wBAC5E,IAAIlB,cAAcmB,gBAAgB,EAAE;4BAClC,OAAOnB,cAAcmB,gBAAgB,CAACvB,UAAU;wBAClD;wBACA,OAAOL,2BACLgB,WACAP,eACAN,YAAY0B,OAAO;oBAEvB,OAAO,IAAIpB,cAAcmB,gBAAgB,EAAE;wBACzC,OAAOnB,cAAcmB,gBAAgB,CAACvB,UAAU;oBAClD,OAAO;wBACL,OAAOS,QAAQC,OAAO,CAACC;oBACzB;gBACF;oBACEP;YACJ;QACF;IACF;IAEA,yEAAyE;IACzE,8GAA8G;IAC9G,sDAAsD;IACtDhB,4BAA4Ba;AAC9B","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/server/request/connection.ts"],"sourcesContent":["import { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport {\n throwForMissingRequestStore,\n workUnitAsyncStorage,\n} from '../app-render/work-unit-async-storage.external'\nimport {\n postponeWithTracking,\n throwToInterruptStaticGeneration,\n trackDynamicDataInDynamicRender,\n} from '../app-render/dynamic-rendering'\nimport { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport {\n makeHangingPromise,\n makeDevtoolsIOAwarePromise,\n} from '../dynamic-rendering-utils'\nimport { isRequestApiAllowedInCurrentPhase } from './utils'\nimport { applyOwnerStack } from '../dynamic-rendering-utils'\nimport { RenderStage } from '../app-render/staged-rendering'\nimport { InvariantError } from '../../shared/lib/invariant-error'\n\n/**\n * This function allows you to indicate that you require an actual user Request before continuing.\n *\n * During prerendering it will never resolve and during rendering it resolves immediately.\n */\nexport function connection(): Promise<void> {\n const callingExpression = 'connection'\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workStore) {\n if (workUnitStore && !isRequestApiAllowedInCurrentPhase(workUnitStore)) {\n throw new Error(\n `Route ${workStore.route} used \\`connection()\\` inside \\`after()\\` while rendering. The \\`connection()\\` function is used to indicate the subsequent code must only run when there is an actual Request, but \\`after()\\` executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`\n )\n }\n\n if (workStore.forceStatic) {\n // When using forceStatic, we override all other logic and always just\n // return a resolving promise without tracking.\n return Promise.resolve(undefined)\n }\n\n if (workStore.dynamicShouldError) {\n throw new StaticGenBailoutError(\n `Route ${workStore.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`connection()\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'cache': {\n const error = new Error(\n `Route ${workStore.route} used \\`connection()\\` inside \"use cache\". The \\`connection()\\` function is used to indicate the subsequent code must only run when there is an actual request, but caches must be able to be produced before a request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n Error.captureStackTrace(error, connection)\n applyOwnerStack(error)\n workStore.invalidDynamicUsageError ??= error\n throw error\n }\n case 'private-cache': {\n // It might not be intuitive to throw for private caches as well, but\n // we don't consider runtime prefetches as \"actual requests\" (in the\n // navigation sense), despite allowing them to read cookies.\n const error = new Error(\n `Route ${workStore.route} used \\`connection()\\` inside \"use cache: private\". The \\`connection()\\` function is used to indicate the subsequent code must only run when there is an actual navigation request, but caches must be able to be produced before a navigation request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n Error.captureStackTrace(error, connection)\n applyOwnerStack(error)\n workStore.invalidDynamicUsageError ??= error\n throw error\n }\n case 'unstable-cache':\n throw new Error(\n `Route ${workStore.route} used \\`connection()\\` inside a function cached with \\`unstable_cache()\\`. The \\`connection()\\` function is used to indicate the subsequent code must only run when there is an actual Request, but caches must be able to be produced before a Request so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`\n )\n case 'generate-static-params':\n throw new Error(\n `Route ${workStore.route} used \\`connection()\\` inside \\`generateStaticParams\\`. This is not supported because \\`generateStaticParams\\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`\n )\n case 'prerender':\n case 'prerender-client':\n case 'prerender-runtime':\n // We return a promise that never resolves to allow the prerender to\n // stall at this point.\n return makeHangingPromise(\n workUnitStore.renderSignal,\n workStore.route,\n '`connection()`'\n )\n case 'validation-client': {\n // TODO(NAR-789): make this consistent with the actual browser behavior when we change it.\n // Until then, erroring is fine.\n const exportName = '`connection`'\n throw new InvariantError(\n `${exportName} must not be used within a Client Component. Next.js should be preventing ${exportName} from being included in Client Components statically, but did not in this case.`\n )\n }\n case 'prerender-ppr':\n // We use React's postpone API to interrupt rendering here to create a\n // dynamic hole\n return postponeWithTracking(\n workStore.route,\n 'connection',\n workUnitStore.dynamicTracking\n )\n case 'prerender-legacy':\n // We throw an error here to interrupt prerendering to mark the route\n // as dynamic\n return throwToInterruptStaticGeneration(\n 'connection',\n workStore,\n workUnitStore\n )\n case 'request':\n trackDynamicDataInDynamicRender(workUnitStore)\n if (process.env.NODE_ENV === 'development') {\n // Semantically we only need the dev tracking when running in `next dev`\n // but since you would never use next dev with production NODE_ENV we use this\n // as a proxy so we can statically exclude this code from production builds.\n if (workUnitStore.asyncApiPromises) {\n return workUnitStore.asyncApiPromises.connection\n }\n return makeDevtoolsIOAwarePromise(\n undefined,\n workUnitStore,\n RenderStage.Dynamic\n )\n } else if (workUnitStore.asyncApiPromises) {\n return workUnitStore.asyncApiPromises.connection\n } else {\n return Promise.resolve(undefined)\n }\n default:\n workUnitStore satisfies never\n }\n }\n }\n\n // If we end up here, there was no work store or work unit store present.\n // TODO(NAR-789): connection() is not currently statically prevented from being imported in client components,\n // so we always error about a missing work unit store.\n throwForMissingRequestStore(callingExpression)\n}\n"],"names":["workAsyncStorage","throwForMissingRequestStore","workUnitAsyncStorage","postponeWithTracking","throwToInterruptStaticGeneration","trackDynamicDataInDynamicRender","StaticGenBailoutError","makeHangingPromise","makeDevtoolsIOAwarePromise","isRequestApiAllowedInCurrentPhase","applyOwnerStack","RenderStage","InvariantError","connection","callingExpression","workStore","getStore","workUnitStore","Error","route","forceStatic","Promise","resolve","undefined","dynamicShouldError","type","error","captureStackTrace","invalidDynamicUsageError","renderSignal","exportName","dynamicTracking","process","env","NODE_ENV","asyncApiPromises","Dynamic"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,4CAA2C;AAC5E,SACEC,2BAA2B,EAC3BC,oBAAoB,QACf,iDAAgD;AACvD,SACEC,oBAAoB,EACpBC,gCAAgC,EAChCC,+BAA+B,QAC1B,kCAAiC;AACxC,SAASC,qBAAqB,QAAQ,oDAAmD;AACzF,SACEC,kBAAkB,EAClBC,0BAA0B,QACrB,6BAA4B;AACnC,SAASC,iCAAiC,QAAQ,UAAS;AAC3D,SAASC,eAAe,QAAQ,6BAA4B;AAC5D,SAASC,WAAW,QAAQ,iCAAgC;AAC5D,SAASC,cAAc,QAAQ,mCAAkC;AAEjE;;;;CAIC,GACD,OAAO,SAASC;IACd,MAAMC,oBAAoB;IAC1B,MAAMC,YAAYf,iBAAiBgB,QAAQ;IAC3C,MAAMC,gBAAgBf,qBAAqBc,QAAQ;IAEnD,IAAID,WAAW;QACb,IAAIE,iBAAiB,CAACR,kCAAkCQ,gBAAgB;YACtE,MAAM,qBAEL,CAFK,IAAIC,MACR,CAAC,MAAM,EAAEH,UAAUI,KAAK,CAAC,wVAAwV,CAAC,GAD9W,qBAAA;uBAAA;4BAAA;8BAAA;YAEN;QACF;QAEA,IAAIJ,UAAUK,WAAW,EAAE;YACzB,sEAAsE;YACtE,+CAA+C;YAC/C,OAAOC,QAA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bd,UAAUI,KAAK,EACf;gBAEJ,KAAK;oBAAqB;wBACxB,0FAA0F;wBAC1F,gCAAgC;wBAChC,MAAMW,aAAa;wBACnB,MAAM,qBAEL,CAFK,IAAIlB,eACR,GAAGkB,WAAW,0EAA0E,EAAEA,WAAW,+EAA+E,CAAC,GADjL,qBAAA;mCAAA;wCAAA;0CAAA;wBAEN;oBACF;gBACA,KAAK;oBACH,sEAAsE;oBACtE,eAAe;oBACf,OAAO3B,qBACLY,UAAUI,KAAK,EACf,cACAF,cAAcc,eAAe;gBAEjC,KAAK;oBACH,qEAAqE;oBACrE,aAAa;oBACb,OAAO3B,iCACL,cACAW,WACAE;gBAEJ,KAAK;oBACHZ,gCAAgCY;oBAChC,IAAIe,QAAQC,GAAG,CAACC,QAAQ,KAAK,eAAe;wBAC1C,wEAAwE;wBACxE,8EAA8E;wBAC9E,4EAA4E;wBAC5E,IAAIjB,cAAckB,gBAAgB,EAAE;4BAClC,OAAOlB,cAAckB,gBAAgB,CAACtB,UAAU;wBAClD;wBACA,OAAOL,2BACLe,WACAN,eACAN,YAAYyB,OAAO;oBAEvB,OAAO,IAAInB,cAAckB,gBAAgB,EAAE;wBACzC,OAAOlB,cAAckB,gBAAgB,CAACtB,UAAU;oBAClD,OAAO;wBACL,OAAOQ,QAAQC,OAAO,CAACC;oBACzB;gBACF;oBACEN;YACJ;QACF;IACF;IAEA,yEAAyE;IACzE,8GAA8G;IAC9G,sDAAsD;IACtDhB,4BAA4Ba;AAC9B","ignoreList":[0]} |
@@ -9,3 +9,3 @@ import { areCookiesMutableInCurrentPhase, RequestCookiesAdapter } from '../web/spec-extension/adapters/request-cookies'; | ||
| import { createDedupedByCallsiteServerErrorLoggerDev } from '../create-deduped-by-callsite-server-error-logger'; | ||
| import { isRequestAPICallableInsideAfter } from './utils'; | ||
| import { isRequestApiAllowedInCurrentPhase } from './utils'; | ||
| import { applyOwnerStack } from '../dynamic-rendering-utils'; | ||
@@ -19,6 +19,5 @@ import { InvariantError } from '../../shared/lib/invariant-error'; | ||
| if (workStore) { | ||
| if (workUnitStore && workUnitStore.phase === 'after' && !isRequestAPICallableInsideAfter()) { | ||
| throw Object.defineProperty(new Error(// TODO(after): clarify that this only applies to pages? | ||
| `Route ${workStore.route} used \`cookies()\` inside \`after()\`. This is not supported. If you need this data inside an \`after()\` callback, use \`cookies()\` outside of the callback. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { | ||
| value: "E843", | ||
| if (workUnitStore && !isRequestApiAllowedInCurrentPhase(workUnitStore)) { | ||
| throw Object.defineProperty(new Error(`Route ${workStore.route} used \`cookies()\` inside \`after()\` while rendering. This is not supported. If you need this data inside an \`after()\` callback, use \`cookies()\` outside of the callback. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { | ||
| value: "E1373", | ||
| enumerable: false, | ||
@@ -25,0 +24,0 @@ configurable: true |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/server/request/cookies.ts"],"sourcesContent":["import {\n type ReadonlyRequestCookies,\n areCookiesMutableInCurrentPhase,\n RequestCookiesAdapter,\n} from '../web/spec-extension/adapters/request-cookies'\nimport { RequestCookies } from '../web/spec-extension/cookies'\nimport {\n workAsyncStorage,\n type WorkStore,\n} from '../app-render/work-async-storage.external'\nimport {\n throwForMissingRequestStore,\n workUnitAsyncStorage,\n type PrerenderStoreModern,\n type RequestStore,\n isInEarlyRenderStage,\n} from '../app-render/work-unit-async-storage.external'\nimport {\n postponeWithTracking,\n throwToInterruptStaticGeneration,\n trackDynamicDataInDynamicRender,\n} from '../app-render/dynamic-rendering'\nimport { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport {\n makeDevtoolsIOAwarePromise,\n makeHangingPromise,\n getSessionDataStage,\n} from '../dynamic-rendering-utils'\nimport { createDedupedByCallsiteServerErrorLoggerDev } from '../create-deduped-by-callsite-server-error-logger'\nimport { isRequestAPICallableInsideAfter } from './utils'\nimport { applyOwnerStack } from '../dynamic-rendering-utils'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { RenderStage } from '../app-render/staged-rendering'\n\nexport function cookies(): Promise<ReadonlyRequestCookies> {\n const callingExpression = 'cookies'\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workStore) {\n if (\n workUnitStore &&\n workUnitStore.phase === 'after' &&\n !isRequestAPICallableInsideAfter()\n ) {\n throw new Error(\n // TODO(after): clarify that this only applies to pages?\n `Route ${workStore.route} used \\`cookies()\\` inside \\`after()\\`. This is not supported. If you need this data inside an \\`after()\\` callback, use \\`cookies()\\` outside of the callback. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`\n )\n }\n\n if (workStore.forceStatic) {\n // When using forceStatic we override all other logic and always just return an empty\n // cookies object without tracking\n const underlyingCookies = createEmptyCookies()\n return makeUntrackedCookies(underlyingCookies)\n }\n\n if (workStore.dynamicShouldError) {\n throw new StaticGenBailoutError(\n `Route ${workStore.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`cookies()\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'cache':\n const error = new Error(\n `Route ${workStore.route} used \\`cookies()\\` inside \"use cache\". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \\`cookies()\\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n Error.captureStackTrace(error, cookies)\n applyOwnerStack(error)\n workStore.invalidDynamicUsageError ??= error\n throw error\n case 'unstable-cache':\n throw new Error(\n `Route ${workStore.route} used \\`cookies()\\` inside a function cached with \\`unstable_cache()\\`. Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \\`cookies()\\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`\n )\n case 'generate-static-params':\n throw new Error(\n `Route ${workStore.route} used \\`cookies()\\` inside \\`generateStaticParams\\`. This is not supported because \\`generateStaticParams\\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`\n )\n case 'prerender':\n return makeHangingCookies(workStore, workUnitStore)\n case 'prerender-client':\n case 'validation-client':\n const exportName = '`cookies`'\n throw new InvariantError(\n `${exportName} must not be used within a Client Component. Next.js should be preventing ${exportName} from being included in Client Components statically, but did not in this case.`\n )\n case 'prerender-ppr':\n // We need track dynamic access here eagerly to keep continuity with\n // how cookies has worked in PPR without cacheComponents.\n return postponeWithTracking(\n workStore.route,\n callingExpression,\n workUnitStore.dynamicTracking\n )\n case 'prerender-legacy':\n // We track dynamic access here so we don't need to wrap the cookies\n // in individual property access tracking.\n return throwToInterruptStaticGeneration(\n callingExpression,\n workStore,\n workUnitStore\n )\n case 'prerender-runtime': {\n const { stagedRendering } = workUnitStore\n if (stagedRendering) {\n return stagedRendering.delayUntilStage(\n getSessionDataStage(stagedRendering),\n 'cookies',\n workUnitStore.cookies\n )\n } else {\n return makeUntrackedCookies(workUnitStore.cookies)\n }\n }\n case 'private-cache':\n // Private caches are delayed until the runtime stage in use-cache-wrapper,\n // so we don't need an additional delay here.\n return makeUntrackedCookies(workUnitStore.cookies)\n case 'request':\n trackDynamicDataInDynamicRender(workUnitStore)\n\n let underlyingCookies: ReadonlyRequestCookies\n\n if (areCookiesMutableInCurrentPhase(workUnitStore)) {\n // We can't conditionally return different types here based on the context.\n // To avoid confusion, we always return the readonly type here.\n underlyingCookies =\n workUnitStore.userspaceMutableCookies as unknown as ReadonlyRequestCookies\n } else {\n underlyingCookies = workUnitStore.cookies\n }\n\n if (process.env.NODE_ENV === 'development') {\n // Semantically we only need the dev tracking when running in `next dev`\n // but since you would never use next dev with production NODE_ENV we use this\n // as a proxy so we can statically exclude this code from production builds.\n return makeUntrackedCookiesWithDevWarnings(\n workUnitStore,\n underlyingCookies,\n workStore?.route\n )\n } else if (workUnitStore.asyncApiPromises) {\n const early = isInEarlyRenderStage(workUnitStore)\n if (underlyingCookies === workUnitStore.mutableCookies) {\n return early\n ? workUnitStore.asyncApiPromises.earlyMutableCookies\n : workUnitStore.asyncApiPromises.mutableCookies\n } else {\n return early\n ? workUnitStore.asyncApiPromises.earlyCookies\n : workUnitStore.asyncApiPromises.cookies\n }\n } else {\n return makeUntrackedCookies(underlyingCookies)\n }\n default:\n workUnitStore satisfies never\n }\n }\n }\n\n // If we end up here, there was no work store or work unit store present.\n throwForMissingRequestStore(callingExpression)\n}\n\nfunction createEmptyCookies(): ReadonlyRequestCookies {\n return RequestCookiesAdapter.seal(new RequestCookies(new Headers({})))\n}\n\ninterface CacheLifetime {}\nconst CachedCookies = new WeakMap<\n CacheLifetime,\n Promise<ReadonlyRequestCookies>\n>()\n\nfunction makeHangingCookies(\n workStore: WorkStore,\n prerenderStore: PrerenderStoreModern\n): Promise<ReadonlyRequestCookies> {\n const cachedPromise = CachedCookies.get(prerenderStore)\n if (cachedPromise) {\n return cachedPromise\n }\n\n const promise = makeHangingPromise<ReadonlyRequestCookies>(\n prerenderStore.renderSignal,\n workStore.route,\n '`cookies()`'\n )\n CachedCookies.set(prerenderStore, promise)\n\n return promise\n}\n\nfunction makeUntrackedCookies(\n underlyingCookies: ReadonlyRequestCookies\n): Promise<ReadonlyRequestCookies> {\n const cachedCookies = CachedCookies.get(underlyingCookies)\n if (cachedCookies) {\n return cachedCookies\n }\n\n const promise = Promise.resolve(underlyingCookies)\n CachedCookies.set(underlyingCookies, promise)\n\n return promise\n}\n\nfunction makeUntrackedCookiesWithDevWarnings(\n requestStore: RequestStore,\n underlyingCookies: ReadonlyRequestCookies,\n route?: string\n): Promise<ReadonlyRequestCookies> {\n if (requestStore.asyncApiPromises) {\n const early = isInEarlyRenderStage(requestStore)\n let promise: Promise<ReadonlyRequestCookies>\n if (underlyingCookies === requestStore.mutableCookies) {\n promise = early\n ? requestStore.asyncApiPromises.earlyMutableCookies\n : requestStore.asyncApiPromises.mutableCookies\n } else if (underlyingCookies === requestStore.cookies) {\n promise = early\n ? requestStore.asyncApiPromises.earlyCookies\n : requestStore.asyncApiPromises.cookies\n } else {\n throw new InvariantError(\n 'Received an underlying cookies object that does not match either `cookies` or `mutableCookies`'\n )\n }\n return instrumentCookiesPromiseWithDevWarnings(promise, route)\n }\n\n const cachedCookies = CachedCookies.get(underlyingCookies)\n if (cachedCookies) {\n return cachedCookies\n }\n\n const promise = makeDevtoolsIOAwarePromise(\n underlyingCookies,\n requestStore,\n RenderStage.ShellRuntime\n )\n\n const proxiedPromise = instrumentCookiesPromiseWithDevWarnings(promise, route)\n\n CachedCookies.set(underlyingCookies, proxiedPromise)\n\n return proxiedPromise\n}\n\nconst warnForSyncAccess = createDedupedByCallsiteServerErrorLoggerDev(\n createCookiesAccessError\n)\n\nfunction instrumentCookiesPromiseWithDevWarnings(\n promise: Promise<ReadonlyRequestCookies>,\n route: string | undefined\n) {\n Object.defineProperties(promise, {\n [Symbol.iterator]: replaceableWarningDescriptorForSymbolIterator(\n promise,\n route\n ),\n size: replaceableWarningDescriptor(promise, 'size', route),\n get: replaceableWarningDescriptor(promise, 'get', route),\n getAll: replaceableWarningDescriptor(promise, 'getAll', route),\n has: replaceableWarningDescriptor(promise, 'has', route),\n set: replaceableWarningDescriptor(promise, 'set', route),\n delete: replaceableWarningDescriptor(promise, 'delete', route),\n clear: replaceableWarningDescriptor(promise, 'clear', route),\n toString: replaceableWarningDescriptor(promise, 'toString', route),\n })\n return promise\n}\n\nfunction replaceableWarningDescriptor(\n target: unknown,\n prop: string,\n route: string | undefined\n) {\n return {\n enumerable: false,\n get() {\n warnForSyncAccess(route, `\\`cookies().${prop}\\``)\n return undefined\n },\n set(value: unknown) {\n Object.defineProperty(target, prop, {\n value,\n writable: true,\n configurable: true,\n })\n },\n configurable: true,\n }\n}\n\nfunction replaceableWarningDescriptorForSymbolIterator(\n target: unknown,\n route: string | undefined\n) {\n return {\n enumerable: false,\n get() {\n warnForSyncAccess(route, '`...cookies()` or similar iteration')\n return undefined\n },\n set(value: unknown) {\n Object.defineProperty(target, Symbol.iterator, {\n value,\n writable: true,\n enumerable: true,\n configurable: true,\n })\n },\n configurable: true,\n }\n}\n\nfunction createCookiesAccessError(\n route: string | undefined,\n expression: string\n) {\n const prefix = route ? `Route \"${route}\" ` : 'This route '\n return new Error(\n `${prefix}used ${expression}. ` +\n `\\`cookies()\\` returns a Promise and must be unwrapped with \\`await\\` or \\`React.use()\\` before accessing its properties. ` +\n `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`\n )\n}\n"],"names":["areCookiesMutableInCurrentPhase","RequestCookiesAdapter","RequestCookies","workAsyncStorage","throwForMissingRequestStore","workUnitAsyncStorage","isInEarlyRenderStage","postponeWithTracking","throwToInterruptStaticGeneration","trackDynamicDataInDynamicRender","StaticGenBailoutError","makeDevtoolsIOAwarePromise","makeHangingPromise","getSessionDataStage","createDedupedByCallsiteServerErrorLoggerDev","isRequestAPICallableInsideAfter","applyOwnerStack","InvariantError","RenderStage","cookies","callingExpression","workStore","getStore","workUnitStore","phase","Error","route","forceStatic","underlyingCookies","createEmptyCookies","makeUntrackedCookies","dynamicShouldError","type","error","captureStackTrace","invalidDynamicUsageError","makeHangingCookies","exportName","dynamicTracking","stagedRendering","delayUntilStage","userspaceMutableCookies","process","env","NODE_ENV","makeUntrackedCookiesWithDevWarnings","asyncApiPromises","early","mutableCookies","earlyMutableCookies","earlyCookies","seal","Headers","CachedCookies","WeakMap","prerenderStore","cachedPromise","get","promise","renderSignal","set","cachedCookies","Promise","resolve","requestStore","instrumentCookiesPromiseWithDevWarnings","ShellRuntime","proxiedPromise","warnForSyncAccess","createCookiesAccessError","Object","defineProperties","Symbol","iterator","replaceableWarningDescriptorForSymbolIterator","size","replaceableWarningDescriptor","getAll","has","delete","clear","toString","target","prop","enumerable","undefined","value","defineProperty","writable","configurable","expression","prefix"],"mappings":"AAAA,SAEEA,+BAA+B,EAC/BC,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QACxDoD,KAAKF,6BAA6BlB,SAAS,OAAOhC;QAClDkC,KAAKgB,6BAA6BlB,SAAS,OAAOhC;QAClDqD,QAAQH,6BAA6BlB,SAAS,UAAUhC;QACxDsD,OAAOJ,6BAA6BlB,SAAS,SAAShC;QACtDuD,UAAUL,6BAA6BlB,SAAS,YAAYhC;IAC9D;IACA,OAAOgC;AACT;AAEA,SAASkB,6BACPM,MAAe,EACfC,IAAY,EACZzD,KAAyB;IAEzB,OAAO;QACL0D,YAAY;QACZ3B;YACEW,kBAAkB1C,OAAO,CAAC,YAAY,EAAEyD,KAAK,EAAE,CAAC;YAChD,OAAOE;QACT;QACAzB,KAAI0B,KAAc;YAChBhB,OAAOiB,cAAc,CAACL,QAAQC,MAAM;gBAClCG;gBACAE,UAAU;gBACVC,cAAc;YAChB;QACF;QACAA,cAAc;IAChB;AACF;AAEA,SAASf,8CACPQ,MAAe,EACfxD,KAAyB;IAEzB,OAAO;QACL0D,YAAY;QACZ3B;YACEW,kBAAkB1C,OAAO;YACzB,OAAO2D;QACT;QACAzB,KAAI0B,KAAc;YAChBhB,OAAOiB,cAAc,CAACL,QAAQV,OAAOC,QAAQ,EAAE;gBAC7Ca;gBACAE,UAAU;gBACVJ,YAAY;gBACZK,cAAc;YAChB;QACF;QACAA,cAAc;IAChB;AACF;AAEA,SAASpB,yBACP3C,KAAyB,EACzBgE,UAAkB;IAElB,MAAMC,SAASjE,QAAQ,CAAC,OAAO,EAAEA,MAAM,EAAE,CAAC,GAAG;IAC7C,OAAO,qBAIN,CAJM,IAAID,MACT,GAAGkE,OAAO,KAAK,EAAED,WAAW,EAAE,CAAC,GAC7B,CAAC,yHAAyH,CAAC,GAC3H,CAAC,8DAA8D,CAAC,GAH7D,qBAAA;eAAA;oBAAA;sBAAA;IAIP;AACF","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/server/request/cookies.ts"],"sourcesContent":["import {\n type ReadonlyRequestCookies,\n areCookiesMutableInCurrentPhase,\n RequestCookiesAdapter,\n} from '../web/spec-extension/adapters/request-cookies'\nimport { RequestCookies } from '../web/spec-extension/cookies'\nimport {\n workAsyncStorage,\n type WorkStore,\n} from '../app-render/work-async-storage.external'\nimport {\n throwForMissingRequestStore,\n workUnitAsyncStorage,\n type PrerenderStoreModern,\n type RequestStore,\n isInEarlyRenderStage,\n} from '../app-render/work-unit-async-storage.external'\nimport {\n postponeWithTracking,\n throwToInterruptStaticGeneration,\n trackDynamicDataInDynamicRender,\n} from '../app-render/dynamic-rendering'\nimport { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport {\n makeDevtoolsIOAwarePromise,\n makeHangingPromise,\n getSessionDataStage,\n} from '../dynamic-rendering-utils'\nimport { createDedupedByCallsiteServerErrorLoggerDev } from '../create-deduped-by-callsite-server-error-logger'\nimport { isRequestApiAllowedInCurrentPhase } from './utils'\nimport { applyOwnerStack } from '../dynamic-rendering-utils'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { RenderStage } from '../app-render/staged-rendering'\n\nexport function cookies(): Promise<ReadonlyRequestCookies> {\n const callingExpression = 'cookies'\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workStore) {\n if (workUnitStore && !isRequestApiAllowedInCurrentPhase(workUnitStore)) {\n throw new Error(\n `Route ${workStore.route} used \\`cookies()\\` inside \\`after()\\` while rendering. This is not supported. If you need this data inside an \\`after()\\` callback, use \\`cookies()\\` outside of the callback. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`\n )\n }\n\n if (workStore.forceStatic) {\n // When using forceStatic we override all other logic and always just return an empty\n // cookies object without tracking\n const underlyingCookies = createEmptyCookies()\n return makeUntrackedCookies(underlyingCookies)\n }\n\n if (workStore.dynamicShouldError) {\n throw new StaticGenBailoutError(\n `Route ${workStore.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`cookies()\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'cache':\n const error = new Error(\n `Route ${workStore.route} used \\`cookies()\\` inside \"use cache\". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \\`cookies()\\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n Error.captureStackTrace(error, cookies)\n applyOwnerStack(error)\n workStore.invalidDynamicUsageError ??= error\n throw error\n case 'unstable-cache':\n throw new Error(\n `Route ${workStore.route} used \\`cookies()\\` inside a function cached with \\`unstable_cache()\\`. Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \\`cookies()\\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`\n )\n case 'generate-static-params':\n throw new Error(\n `Route ${workStore.route} used \\`cookies()\\` inside \\`generateStaticParams\\`. This is not supported because \\`generateStaticParams\\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`\n )\n case 'prerender':\n return makeHangingCookies(workStore, workUnitStore)\n case 'prerender-client':\n case 'validation-client':\n const exportName = '`cookies`'\n throw new InvariantError(\n `${exportName} must not be used within a Client Component. Next.js should be preventing ${exportName} from being included in Client Components statically, but did not in this case.`\n )\n case 'prerender-ppr':\n // We need track dynamic access here eagerly to keep continuity with\n // how cookies has worked in PPR without cacheComponents.\n return postponeWithTracking(\n workStore.route,\n callingExpression,\n workUnitStore.dynamicTracking\n )\n case 'prerender-legacy':\n // We track dynamic access here so we don't need to wrap the cookies\n // in individual property access tracking.\n return throwToInterruptStaticGeneration(\n callingExpression,\n workStore,\n workUnitStore\n )\n case 'prerender-runtime': {\n const { stagedRendering } = workUnitStore\n if (stagedRendering) {\n return stagedRendering.delayUntilStage(\n getSessionDataStage(stagedRendering),\n 'cookies',\n workUnitStore.cookies\n )\n } else {\n return makeUntrackedCookies(workUnitStore.cookies)\n }\n }\n case 'private-cache':\n // Private caches are delayed until the runtime stage in use-cache-wrapper,\n // so we don't need an additional delay here.\n return makeUntrackedCookies(workUnitStore.cookies)\n case 'request':\n trackDynamicDataInDynamicRender(workUnitStore)\n\n let underlyingCookies: ReadonlyRequestCookies\n\n if (areCookiesMutableInCurrentPhase(workUnitStore)) {\n // We can't conditionally return different types here based on the context.\n // To avoid confusion, we always return the readonly type here.\n underlyingCookies =\n workUnitStore.userspaceMutableCookies as unknown as ReadonlyRequestCookies\n } else {\n underlyingCookies = workUnitStore.cookies\n }\n\n if (process.env.NODE_ENV === 'development') {\n // Semantically we only need the dev tracking when running in `next dev`\n // but since you would never use next dev with production NODE_ENV we use this\n // as a proxy so we can statically exclude this code from production builds.\n return makeUntrackedCookiesWithDevWarnings(\n workUnitStore,\n underlyingCookies,\n workStore?.route\n )\n } else if (workUnitStore.asyncApiPromises) {\n const early = isInEarlyRenderStage(workUnitStore)\n if (underlyingCookies === workUnitStore.mutableCookies) {\n return early\n ? workUnitStore.asyncApiPromises.earlyMutableCookies\n : workUnitStore.asyncApiPromises.mutableCookies\n } else {\n return early\n ? workUnitStore.asyncApiPromises.earlyCookies\n : workUnitStore.asyncApiPromises.cookies\n }\n } else {\n return makeUntrackedCookies(underlyingCookies)\n }\n default:\n workUnitStore satisfies never\n }\n }\n }\n\n // If we end up here, there was no work store or work unit store present.\n throwForMissingRequestStore(callingExpression)\n}\n\nfunction createEmptyCookies(): ReadonlyRequestCookies {\n return RequestCookiesAdapter.seal(new RequestCookies(new Headers({})))\n}\n\ninterface CacheLifetime {}\nconst CachedCookies = new WeakMap<\n CacheLifetime,\n Promise<ReadonlyRequestCookies>\n>()\n\nfunction makeHangingCookies(\n workStore: WorkStore,\n prerenderStore: PrerenderStoreModern\n): Promise<ReadonlyRequestCookies> {\n const cachedPromise = CachedCookies.get(prerenderStore)\n if (cachedPromise) {\n return cachedPromise\n }\n\n const promise = makeHangingPromise<ReadonlyRequestCookies>(\n prerenderStore.renderSignal,\n workStore.route,\n '`cookies()`'\n )\n CachedCookies.set(prerenderStore, promise)\n\n return promise\n}\n\nfunction makeUntrackedCookies(\n underlyingCookies: ReadonlyRequestCookies\n): Promise<ReadonlyRequestCookies> {\n const cachedCookies = CachedCookies.get(underlyingCookies)\n if (cachedCookies) {\n return cachedCookies\n }\n\n const promise = Promise.resolve(underlyingCookies)\n CachedCookies.set(underlyingCookies, promise)\n\n return promise\n}\n\nfunction makeUntrackedCookiesWithDevWarnings(\n requestStore: RequestStore,\n underlyingCookies: ReadonlyRequestCookies,\n route?: string\n): Promise<ReadonlyRequestCookies> {\n if (requestStore.asyncApiPromises) {\n const early = isInEarlyRenderStage(requestStore)\n let promise: Promise<ReadonlyRequestCookies>\n if (underlyingCookies === requestStore.mutableCookies) {\n promise = early\n ? requestStore.asyncApiPromises.earlyMutableCookies\n : requestStore.asyncApiPromises.mutableCookies\n } else if (underlyingCookies === requestStore.cookies) {\n promise = early\n ? requestStore.asyncApiPromises.earlyCookies\n : requestStore.asyncApiPromises.cookies\n } else {\n throw new InvariantError(\n 'Received an underlying cookies object that does not match either `cookies` or `mutableCookies`'\n )\n }\n return instrumentCookiesPromiseWithDevWarnings(promise, route)\n }\n\n const cachedCookies = CachedCookies.get(underlyingCookies)\n if (cachedCookies) {\n return cachedCookies\n }\n\n const promise = makeDevtoolsIOAwarePromise(\n underlyingCookies,\n requestStore,\n RenderStage.ShellRuntime\n )\n\n const proxiedPromise = instrumentCookiesPromiseWithDevWarnings(promise, route)\n\n CachedCookies.set(underlyingCookies, proxiedPromise)\n\n return proxiedPromise\n}\n\nconst warnForSyncAccess = createDedupedByCallsiteServerErrorLoggerDev(\n createCookiesAccessError\n)\n\nfunction instrumentCookiesPromiseWithDevWarnings(\n promise: Promise<ReadonlyRequestCookies>,\n route: string | undefined\n) {\n Object.defineProperties(promise, {\n [Symbol.iterator]: replaceableWarningDescriptorForSymbolIterator(\n promise,\n route\n ),\n size: replaceableWarningDescriptor(promise, 'size', route),\n get: replaceableWarningDescriptor(promise, 'get', route),\n getAll: replaceableWarningDescriptor(promise, 'getAll', route),\n has: replaceableWarningDescriptor(promise, 'has', route),\n set: replaceableWarningDescriptor(promise, 'set', route),\n delete: replaceableWarningDescriptor(promise, 'delete', route),\n clear: replaceableWarningDescriptor(promise, 'clear', route),\n toString: replaceableWarningDescriptor(promise, 'toString', route),\n })\n return promise\n}\n\nfunction replaceableWarningDescriptor(\n target: unknown,\n prop: string,\n route: string | undefined\n) {\n return {\n enumerable: false,\n get() {\n warnForSyncAccess(route, `\\`cookies().${prop}\\``)\n return undefined\n },\n set(value: unknown) {\n Object.defineProperty(target, prop, {\n value,\n writable: true,\n configurable: true,\n })\n },\n configurable: true,\n }\n}\n\nfunction replaceableWarningDescriptorForSymbolIterator(\n target: unknown,\n route: string | undefined\n) {\n return {\n enumerable: false,\n get() {\n warnForSyncAccess(route, '`...cookies()` or similar iteration')\n return undefined\n },\n set(value: unknown) {\n Object.defineProperty(target, Symbol.iterator, {\n value,\n writable: true,\n enumerable: true,\n configurable: true,\n })\n },\n configurable: true,\n }\n}\n\nfunction createCookiesAccessError(\n route: string | undefined,\n expression: string\n) {\n const prefix = route ? `Route \"${route}\" ` : 'This route '\n return new Error(\n `${prefix}used ${expression}. ` +\n `\\`cookies()\\` returns a Promise and must be unwrapped with \\`await\\` or \\`React.use()\\` before accessing its properties. ` +\n `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`\n )\n}\n"],"names":["areCookiesMutableInCurrentPhase","RequestCookiesAdapter","RequestCookies","workAsyncStorage","throwForMissingRequestStore","workUnitAsyncStorage","isInEarlyRenderStage","postponeWithTracking","throwToInterruptStaticGeneration","trackDynamicDataInDynamicRender","StaticGenBailoutError","makeDevtoolsIOAwarePromise","makeHangingPromise","getSessionDataStage","createDedupedByCallsiteServerErrorLoggerDev","isRequestApiAllowedInCurrentPhase","applyOwnerStack","InvariantError","RenderStage","cookies","callingExpression","workStore","getStore","workUnitStore","Error","route","forceStatic","underlyingCookies","createEmptyCookies","makeUntrackedCookies","dynamicShouldError","type","error","captureStackTrace","invalidDynamicUsageError","makeHangingCookies","exportName","dynamicTracking","stagedRendering","delayUntilStage","userspaceMutableCookies","process","env","NODE_ENV","makeUntrackedCookiesWithDevWarnings","asyncApiPromises","early","mutableCookies","earlyMutableCookies","earlyCookies","seal","Headers","CachedCookies","WeakMap","prerenderStore","cachedPromise","get","promise","renderSignal","set","cachedCookies","Promise","resolve","requestStore","instrumentCookiesPromiseWithDevWarnings","ShellRuntime","proxiedPromise","warnForSyncAccess","createCookiesAccessError","Object","defineProperties","Symbol","iterator","replaceableWarningDescriptorForSymbolIterator","size","replaceableWarningDescriptor","getAll","has","delete","clear","toString","target","prop","enumerable","undefined","value","defineProperty","writable","configurable","expression","prefix"],"mappings":"AAAA,SAEEA,+BAA+B,EAC/BC,qBAAqB,QAChB,iDAAgD;AACvD,SAASC,cAAc,QAAQ,gCAA+B;AAC9D,SACEC,gBAAgB,QAEX,4CAA2C;AAClD,SACEC,2BAA2B,EAC3BC,oBAAoB,EAGpBC,oBAAoB,QACf,iDAAgD;AACvD,SACEC,oBAAoB,EACpBC,gCAAgC,EAChCC,+BAA+B,QAC1B,kCAAiC;AACxC,SAASC,qBAAqB,QAAQ,oDAAmD;AACzF,SACEC,0BAA0B,EAC1BC,kBAAkB,EAClBC,mBAAmB,QACd,6BAA4B;AACnC,SAASC,2CAA2C,QAAQ,oDAAmD;AAC/G,SAASC,iCAAiC,QAAQ,UAAS;AAC3D,SAASC,eAAe,QAAQ,6BAA4B;AAC5D,SAASC,cAAc,QAAQ,mCAAkC;AACjE,SAASC,WAAW,QAAQ,iCAAgC;AAE5D,OAAO,SAASC;IACd,MAAMC,oBAAoB;IAC1B,MAAMC,YAAYlB,iBAAiBmB,QAAQ;IAC3C,MAAMC,gBAAgBlB,qBAAqBiB,QAAQ;IAEnD,IAAID,WAAW;QACb,IAAIE,iBAAiB,CAACR,kCAAkCQ,gBAAgB;YACtE,MAAM,qBAEL,CAFK,IAAIC,MACR,CAAC,MAA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,cAAc;YAChB;QACF;QACAA,cAAc;IAChB;AACF;AAEA,SAASpB,yBACP3C,KAAyB,EACzBgE,UAAkB;IAElB,MAAMC,SAASjE,QAAQ,CAAC,OAAO,EAAEA,MAAM,EAAE,CAAC,GAAG;IAC7C,OAAO,qBAIN,CAJM,IAAID,MACT,GAAGkE,OAAO,KAAK,EAAED,WAAW,EAAE,CAAC,GAC7B,CAAC,yHAAyH,CAAC,GAC3H,CAAC,8DAA8D,CAAC,GAH7D,qBAAA;eAAA;oBAAA;sBAAA;IAIP;AACF","ignoreList":[0]} |
@@ -8,3 +8,3 @@ import { HeadersAdapter } from '../web/spec-extension/adapters/headers'; | ||
| import { createDedupedByCallsiteServerErrorLoggerDev } from '../create-deduped-by-callsite-server-error-logger'; | ||
| import { isRequestAPICallableInsideAfter } from './utils'; | ||
| import { isRequestApiAllowedInCurrentPhase } from './utils'; | ||
| import { applyOwnerStack } from '../dynamic-rendering-utils'; | ||
@@ -26,5 +26,5 @@ import { InvariantError } from '../../shared/lib/invariant-error'; | ||
| if (workStore) { | ||
| if (workUnitStore && workUnitStore.phase === 'after' && !isRequestAPICallableInsideAfter()) { | ||
| throw Object.defineProperty(new Error(`Route ${workStore.route} used \`headers()\` inside \`after()\`. This is not supported. If you need this data inside an \`after()\` callback, use \`headers()\` outside of the callback. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { | ||
| value: "E839", | ||
| if (workUnitStore && !isRequestApiAllowedInCurrentPhase(workUnitStore)) { | ||
| throw Object.defineProperty(new Error(`Route ${workStore.route} used \`headers()\` inside \`after()\` while rendering. This is not supported. If you need this data inside an \`after()\` callback, use \`headers()\` outside of the callback. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { | ||
| value: "E1370", | ||
| enumerable: false, | ||
@@ -31,0 +31,0 @@ configurable: true |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/server/request/headers.ts"],"sourcesContent":["import {\n HeadersAdapter,\n type ReadonlyHeaders,\n} from '../web/spec-extension/adapters/headers'\nimport {\n workAsyncStorage,\n type WorkStore,\n} from '../app-render/work-async-storage.external'\nimport {\n throwForMissingRequestStore,\n workUnitAsyncStorage,\n type PrerenderStoreModern,\n type RequestStore,\n isInEarlyRenderStage,\n} from '../app-render/work-unit-async-storage.external'\nimport {\n postponeWithTracking,\n throwToInterruptStaticGeneration,\n trackDynamicDataInDynamicRender,\n} from '../app-render/dynamic-rendering'\nimport { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport {\n makeDevtoolsIOAwarePromise,\n makeHangingPromise,\n getSessionDataStage,\n} from '../dynamic-rendering-utils'\nimport { createDedupedByCallsiteServerErrorLoggerDev } from '../create-deduped-by-callsite-server-error-logger'\nimport { isRequestAPICallableInsideAfter } from './utils'\nimport { applyOwnerStack } from '../dynamic-rendering-utils'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { RenderStage } from '../app-render/staged-rendering'\n\n/**\n * This function allows you to read the HTTP incoming request headers in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers) and\n * [Middleware](https://nextjs.org/docs/app/building-your-application/routing/middleware).\n *\n * Read more: [Next.js Docs: `headers`](https://nextjs.org/docs/app/api-reference/functions/headers)\n */\nexport function headers(): Promise<ReadonlyHeaders> {\n const callingExpression = 'headers'\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workStore) {\n if (\n workUnitStore &&\n workUnitStore.phase === 'after' &&\n !isRequestAPICallableInsideAfter()\n ) {\n throw new Error(\n `Route ${workStore.route} used \\`headers()\\` inside \\`after()\\`. This is not supported. If you need this data inside an \\`after()\\` callback, use \\`headers()\\` outside of the callback. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`\n )\n }\n\n if (workStore.forceStatic) {\n // When using forceStatic we override all other logic and always just return an empty\n // headers object without tracking\n const underlyingHeaders = HeadersAdapter.seal(new Headers({}))\n return makeUntrackedHeaders(underlyingHeaders)\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'cache': {\n const error = new Error(\n `Route ${workStore.route} used \\`headers()\\` inside \"use cache\". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \\`headers()\\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n Error.captureStackTrace(error, headers)\n applyOwnerStack(error)\n workStore.invalidDynamicUsageError ??= error\n throw error\n }\n case 'unstable-cache':\n throw new Error(\n `Route ${workStore.route} used \\`headers()\\` inside a function cached with \\`unstable_cache()\\`. Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \\`headers()\\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`\n )\n case 'generate-static-params':\n throw new Error(\n `Route ${workStore.route} used \\`headers()\\` inside \\`generateStaticParams\\`. This is not supported because \\`generateStaticParams\\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`\n )\n case 'prerender':\n case 'prerender-client':\n case 'validation-client':\n case 'private-cache':\n case 'prerender-runtime':\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'request':\n break\n default:\n workUnitStore satisfies never\n }\n }\n\n if (workStore.dynamicShouldError) {\n throw new StaticGenBailoutError(\n `Route ${workStore.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`headers()\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender':\n return makeHangingHeaders(workStore, workUnitStore)\n case 'prerender-client':\n case 'validation-client':\n const exportName = '`headers`'\n throw new InvariantError(\n `${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`\n )\n case 'prerender-ppr':\n // PPR Prerender (no cacheComponents)\n // We are prerendering with PPR. We need track dynamic access here eagerly\n // to keep continuity with how headers has worked in PPR without cacheComponents.\n // TODO consider switching the semantic to throw on property access instead\n return postponeWithTracking(\n workStore.route,\n callingExpression,\n workUnitStore.dynamicTracking\n )\n case 'prerender-legacy':\n // Legacy Prerender\n // We are in a legacy static generation mode while prerendering\n // We track dynamic access here so we don't need to wrap the headers in\n // individual property access tracking.\n return throwToInterruptStaticGeneration(\n callingExpression,\n workStore,\n workUnitStore\n )\n case 'prerender-runtime': {\n const { stagedRendering } = workUnitStore\n if (stagedRendering) {\n return stagedRendering.delayUntilStage(\n getSessionDataStage(stagedRendering),\n 'headers',\n workUnitStore.headers\n )\n } else {\n return makeUntrackedHeaders(workUnitStore.headers)\n }\n }\n case 'private-cache':\n // Private caches are delayed until the runtime stage in use-cache-wrapper,\n // so we don't need an additional delay here.\n return makeUntrackedHeaders(workUnitStore.headers)\n case 'request':\n trackDynamicDataInDynamicRender(workUnitStore)\n\n if (process.env.NODE_ENV === 'development') {\n // Semantically we only need the dev tracking when running in `next dev`\n // but since you would never use next dev with production NODE_ENV we use this\n // as a proxy so we can statically exclude this code from production builds.\n return makeUntrackedHeadersWithDevWarnings(\n workUnitStore.headers,\n workStore?.route,\n workUnitStore\n )\n } else if (workUnitStore.asyncApiPromises) {\n return isInEarlyRenderStage(workUnitStore)\n ? workUnitStore.asyncApiPromises.earlyHeaders\n : workUnitStore.asyncApiPromises.headers\n } else {\n return makeUntrackedHeaders(workUnitStore.headers)\n }\n break\n default:\n workUnitStore satisfies never\n }\n }\n }\n\n // If we end up here, there was no work store or work unit store present.\n throwForMissingRequestStore(callingExpression)\n}\n\ninterface CacheLifetime {}\nconst CachedHeaders = new WeakMap<CacheLifetime, Promise<ReadonlyHeaders>>()\n\nfunction makeHangingHeaders(\n workStore: WorkStore,\n prerenderStore: PrerenderStoreModern\n): Promise<ReadonlyHeaders> {\n const cachedHeaders = CachedHeaders.get(prerenderStore)\n if (cachedHeaders) {\n return cachedHeaders\n }\n\n const promise = makeHangingPromise<ReadonlyHeaders>(\n prerenderStore.renderSignal,\n workStore.route,\n '`headers()`'\n )\n CachedHeaders.set(prerenderStore, promise)\n\n return promise\n}\n\nfunction makeUntrackedHeaders(\n underlyingHeaders: ReadonlyHeaders\n): Promise<ReadonlyHeaders> {\n const cachedHeaders = CachedHeaders.get(underlyingHeaders)\n if (cachedHeaders) {\n return cachedHeaders\n }\n\n const promise = Promise.resolve(underlyingHeaders)\n CachedHeaders.set(underlyingHeaders, promise)\n\n return promise\n}\n\nfunction makeUntrackedHeadersWithDevWarnings(\n underlyingHeaders: ReadonlyHeaders,\n route: string | undefined,\n requestStore: RequestStore\n): Promise<ReadonlyHeaders> {\n if (requestStore.asyncApiPromises) {\n const promise = isInEarlyRenderStage(requestStore)\n ? requestStore.asyncApiPromises.earlyHeaders\n : requestStore.asyncApiPromises.headers\n return instrumentHeadersPromiseWithDevWarnings(promise, route)\n }\n\n const cachedHeaders = CachedHeaders.get(underlyingHeaders)\n if (cachedHeaders) {\n return cachedHeaders\n }\n\n const promise = makeDevtoolsIOAwarePromise(\n underlyingHeaders,\n requestStore,\n RenderStage.Runtime\n )\n\n const proxiedPromise = instrumentHeadersPromiseWithDevWarnings(promise, route)\n\n CachedHeaders.set(underlyingHeaders, proxiedPromise)\n\n return proxiedPromise\n}\n\nconst warnForSyncAccess = createDedupedByCallsiteServerErrorLoggerDev(\n createHeadersAccessError\n)\n\nfunction instrumentHeadersPromiseWithDevWarnings(\n promise: Promise<ReadonlyHeaders>,\n route: string | undefined\n) {\n Object.defineProperties(promise, {\n [Symbol.iterator]: replaceableWarningDescriptorForSymbolIterator(\n promise,\n route\n ),\n append: replaceableWarningDescriptor(promise, 'append', route),\n delete: replaceableWarningDescriptor(promise, 'delete', route),\n get: replaceableWarningDescriptor(promise, 'get', route),\n has: replaceableWarningDescriptor(promise, 'has', route),\n set: replaceableWarningDescriptor(promise, 'set', route),\n getSetCookie: replaceableWarningDescriptor(promise, 'getSetCookie', route),\n forEach: replaceableWarningDescriptor(promise, 'forEach', route),\n keys: replaceableWarningDescriptor(promise, 'keys', route),\n values: replaceableWarningDescriptor(promise, 'values', route),\n entries: replaceableWarningDescriptor(promise, 'entries', route),\n })\n return promise\n}\n\nfunction replaceableWarningDescriptor(\n target: unknown,\n prop: string,\n route: string | undefined\n) {\n return {\n enumerable: false,\n get() {\n warnForSyncAccess(route, `\\`headers().${prop}\\``)\n return undefined\n },\n set(value: unknown) {\n Object.defineProperty(target, prop, {\n value,\n writable: true,\n configurable: true,\n })\n },\n configurable: true,\n }\n}\n\nfunction replaceableWarningDescriptorForSymbolIterator(\n target: unknown,\n route: string | undefined\n) {\n return {\n enumerable: false,\n get() {\n warnForSyncAccess(route, '`...headers()` or similar iteration')\n return undefined\n },\n set(value: unknown) {\n Object.defineProperty(target, Symbol.iterator, {\n value,\n writable: true,\n enumerable: true,\n configurable: true,\n })\n },\n configurable: true,\n }\n}\n\nfunction createHeadersAccessError(\n route: string | undefined,\n expression: string\n) {\n const prefix = route ? `Route \"${route}\" ` : 'This route '\n return new Error(\n `${prefix}used ${expression}. ` +\n `\\`headers()\\` returns a Promise and must be unwrapped with \\`await\\` or \\`React.use()\\` before accessing its properties. ` +\n `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`\n )\n}\n"],"names":["HeadersAdapter","workAsyncStorage","throwForMissingRequestStore","workUnitAsyncStorage","isInEarlyRenderStage","postponeWithTracking","throwToInterruptStaticGeneration","trackDynamicDataInDynamicRender","StaticGenBailoutError","makeDevtoolsIOAwarePromise","makeHangingPromise","getSessionDataStage","createDedupedByCallsiteServerErrorLoggerDev","isRequestAPICallableInsideAfter","applyOwnerStack","InvariantError","RenderStage","headers","callingExpression","workStore","getStore","workUnitStore","phase","Error","route","forceStatic","underlyingHeaders","seal","Headers","makeUntrackedHeaders","type","error","captureStackTrace","invalidDynamicUsageError","dynamicShouldError","makeHangingHeaders","exportName","dynamicTracking","stagedRendering","delayUntilStage","process","env","NODE_ENV","makeUntrackedHeadersWithDevWarnings","asyncApiPromises","earlyHeaders","CachedHeaders","WeakMap","prerenderStore","cachedHeaders","get","promise","renderSignal","set","Promise","resolve","requestStore","instrumentHeadersPromiseWithDevWarnings","Runtime","proxiedPromise","warnForSyncAccess","createHeadersAccessError","Object","defineProperties","Symbol","iterator","replaceableWarningDescriptorForSymbolIterator","append","replaceableWarningDescriptor","delete","has","getSetCookie","forEach","keys","values","entries","target","prop","enumerable","undefined","value","defineProperty","writable","configurable","expression","prefix"],"mappings":"AAAA,SACEA,cAAc,QAET,yCAAwC;AAC/C,SACEC,gBAAgB,QAEX,4CAA2C;AAClD,SACEC,2BAA2B,EAC3BC,oBAAoB,EAGpBC,oBAAoB,QACf,iDAAgD;AACvD,SACEC,oBAAoB,EACpBC,gCAAgC,EAChCC,+BAA+B,QAC1B,kCAAiC;AACxC,SAASC,qBAAqB,QAAQ,oDAAmD;AACzF,SACEC,0BAA0B,EAC1BC,kBAAkB,EAClBC,mBAAmB,QACd,6BAA4B;AACnC,SAASC,2CAA2C,QAAQ,oDAAmD;AAC/G,SAASC,+BAA+B,QAAQ,UAAS;AACzD,SAASC,eAAe,QAAQ,6BAA4B;AAC5D,SAASC,cAAc,QAAQ,mCAAkC;AACjE,SAASC,WAAW,QAAQ,iCAAgC;AAE5D;;;;;;;;CAQC,GACD,OAAO,SAASC;IACd,MAAMC,oBAAoB;IAC1B,MAAMC,YAAYlB,iBAAiBmB,QAAQ;IAC3C,MAAMC,gBAAgBlB,qBAAqBiB,QAAQ;IAEnD,IAAID,WAAW;QACb,IACEE,iBACAA,cAAcC,KAAK,KAAK,WACxB,CAACT,mCACD;YACA,MAAM,qBAEL,CAFK,IAAIU,MACR,CAAC,MAAM,EAAEJ,UAAUK,KAAK,CAAC,6OAA6O,CAAC,GADnQ,qBAAA;uBAAA;4BAAA;8BAAA;YAEN;QACF;QAEA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AAS,OAAO3B;QAClD6B,KAAKe,6BAA6BjB,SAAS,OAAO3B;QAClD+C,cAAcH,6BAA6BjB,SAAS,gBAAgB3B;QACpEgD,SAASJ,6BAA6BjB,SAAS,WAAW3B;QAC1DiD,MAAML,6BAA6BjB,SAAS,QAAQ3B;QACpDkD,QAAQN,6BAA6BjB,SAAS,UAAU3B;QACxDmD,SAASP,6BAA6BjB,SAAS,WAAW3B;IAC5D;IACA,OAAO2B;AACT;AAEA,SAASiB,6BACPQ,MAAe,EACfC,IAAY,EACZrD,KAAyB;IAEzB,OAAO;QACLsD,YAAY;QACZ5B;YACEU,kBAAkBpC,OAAO,CAAC,YAAY,EAAEqD,KAAK,EAAE,CAAC;YAChD,OAAOE;QACT;QACA1B,KAAI2B,KAAc;YAChBlB,OAAOmB,cAAc,CAACL,QAAQC,MAAM;gBAClCG;gBACAE,UAAU;gBACVC,cAAc;YAChB;QACF;QACAA,cAAc;IAChB;AACF;AAEA,SAASjB,8CACPU,MAAe,EACfpD,KAAyB;IAEzB,OAAO;QACLsD,YAAY;QACZ5B;YACEU,kBAAkBpC,OAAO;YACzB,OAAOuD;QACT;QACA1B,KAAI2B,KAAc;YAChBlB,OAAOmB,cAAc,CAACL,QAAQZ,OAAOC,QAAQ,EAAE;gBAC7Ce;gBACAE,UAAU;gBACVJ,YAAY;gBACZK,cAAc;YAChB;QACF;QACAA,cAAc;IAChB;AACF;AAEA,SAAStB,yBACPrC,KAAyB,EACzB4D,UAAkB;IAElB,MAAMC,SAAS7D,QAAQ,CAAC,OAAO,EAAEA,MAAM,EAAE,CAAC,GAAG;IAC7C,OAAO,qBAIN,CAJM,IAAID,MACT,GAAG8D,OAAO,KAAK,EAAED,WAAW,EAAE,CAAC,GAC7B,CAAC,yHAAyH,CAAC,GAC3H,CAAC,8DAA8D,CAAC,GAH7D,qBAAA;eAAA;oBAAA;sBAAA;IAIP;AACF","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/server/request/headers.ts"],"sourcesContent":["import {\n HeadersAdapter,\n type ReadonlyHeaders,\n} from '../web/spec-extension/adapters/headers'\nimport {\n workAsyncStorage,\n type WorkStore,\n} from '../app-render/work-async-storage.external'\nimport {\n throwForMissingRequestStore,\n workUnitAsyncStorage,\n type PrerenderStoreModern,\n type RequestStore,\n isInEarlyRenderStage,\n} from '../app-render/work-unit-async-storage.external'\nimport {\n postponeWithTracking,\n throwToInterruptStaticGeneration,\n trackDynamicDataInDynamicRender,\n} from '../app-render/dynamic-rendering'\nimport { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport {\n makeDevtoolsIOAwarePromise,\n makeHangingPromise,\n getSessionDataStage,\n} from '../dynamic-rendering-utils'\nimport { createDedupedByCallsiteServerErrorLoggerDev } from '../create-deduped-by-callsite-server-error-logger'\nimport { isRequestApiAllowedInCurrentPhase } from './utils'\nimport { applyOwnerStack } from '../dynamic-rendering-utils'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { RenderStage } from '../app-render/staged-rendering'\n\n/**\n * This function allows you to read the HTTP incoming request headers in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers) and\n * [Middleware](https://nextjs.org/docs/app/building-your-application/routing/middleware).\n *\n * Read more: [Next.js Docs: `headers`](https://nextjs.org/docs/app/api-reference/functions/headers)\n */\nexport function headers(): Promise<ReadonlyHeaders> {\n const callingExpression = 'headers'\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workStore) {\n if (workUnitStore && !isRequestApiAllowedInCurrentPhase(workUnitStore)) {\n throw new Error(\n `Route ${workStore.route} used \\`headers()\\` inside \\`after()\\` while rendering. This is not supported. If you need this data inside an \\`after()\\` callback, use \\`headers()\\` outside of the callback. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`\n )\n }\n\n if (workStore.forceStatic) {\n // When using forceStatic we override all other logic and always just return an empty\n // headers object without tracking\n const underlyingHeaders = HeadersAdapter.seal(new Headers({}))\n return makeUntrackedHeaders(underlyingHeaders)\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'cache': {\n const error = new Error(\n `Route ${workStore.route} used \\`headers()\\` inside \"use cache\". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \\`headers()\\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n Error.captureStackTrace(error, headers)\n applyOwnerStack(error)\n workStore.invalidDynamicUsageError ??= error\n throw error\n }\n case 'unstable-cache':\n throw new Error(\n `Route ${workStore.route} used \\`headers()\\` inside a function cached with \\`unstable_cache()\\`. Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \\`headers()\\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`\n )\n case 'generate-static-params':\n throw new Error(\n `Route ${workStore.route} used \\`headers()\\` inside \\`generateStaticParams\\`. This is not supported because \\`generateStaticParams\\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`\n )\n case 'prerender':\n case 'prerender-client':\n case 'validation-client':\n case 'private-cache':\n case 'prerender-runtime':\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'request':\n break\n default:\n workUnitStore satisfies never\n }\n }\n\n if (workStore.dynamicShouldError) {\n throw new StaticGenBailoutError(\n `Route ${workStore.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`headers()\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender':\n return makeHangingHeaders(workStore, workUnitStore)\n case 'prerender-client':\n case 'validation-client':\n const exportName = '`headers`'\n throw new InvariantError(\n `${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`\n )\n case 'prerender-ppr':\n // PPR Prerender (no cacheComponents)\n // We are prerendering with PPR. We need track dynamic access here eagerly\n // to keep continuity with how headers has worked in PPR without cacheComponents.\n // TODO consider switching the semantic to throw on property access instead\n return postponeWithTracking(\n workStore.route,\n callingExpression,\n workUnitStore.dynamicTracking\n )\n case 'prerender-legacy':\n // Legacy Prerender\n // We are in a legacy static generation mode while prerendering\n // We track dynamic access here so we don't need to wrap the headers in\n // individual property access tracking.\n return throwToInterruptStaticGeneration(\n callingExpression,\n workStore,\n workUnitStore\n )\n case 'prerender-runtime': {\n const { stagedRendering } = workUnitStore\n if (stagedRendering) {\n return stagedRendering.delayUntilStage(\n getSessionDataStage(stagedRendering),\n 'headers',\n workUnitStore.headers\n )\n } else {\n return makeUntrackedHeaders(workUnitStore.headers)\n }\n }\n case 'private-cache':\n // Private caches are delayed until the runtime stage in use-cache-wrapper,\n // so we don't need an additional delay here.\n return makeUntrackedHeaders(workUnitStore.headers)\n case 'request':\n trackDynamicDataInDynamicRender(workUnitStore)\n\n if (process.env.NODE_ENV === 'development') {\n // Semantically we only need the dev tracking when running in `next dev`\n // but since you would never use next dev with production NODE_ENV we use this\n // as a proxy so we can statically exclude this code from production builds.\n return makeUntrackedHeadersWithDevWarnings(\n workUnitStore.headers,\n workStore?.route,\n workUnitStore\n )\n } else if (workUnitStore.asyncApiPromises) {\n return isInEarlyRenderStage(workUnitStore)\n ? workUnitStore.asyncApiPromises.earlyHeaders\n : workUnitStore.asyncApiPromises.headers\n } else {\n return makeUntrackedHeaders(workUnitStore.headers)\n }\n break\n default:\n workUnitStore satisfies never\n }\n }\n }\n\n // If we end up here, there was no work store or work unit store present.\n throwForMissingRequestStore(callingExpression)\n}\n\ninterface CacheLifetime {}\nconst CachedHeaders = new WeakMap<CacheLifetime, Promise<ReadonlyHeaders>>()\n\nfunction makeHangingHeaders(\n workStore: WorkStore,\n prerenderStore: PrerenderStoreModern\n): Promise<ReadonlyHeaders> {\n const cachedHeaders = CachedHeaders.get(prerenderStore)\n if (cachedHeaders) {\n return cachedHeaders\n }\n\n const promise = makeHangingPromise<ReadonlyHeaders>(\n prerenderStore.renderSignal,\n workStore.route,\n '`headers()`'\n )\n CachedHeaders.set(prerenderStore, promise)\n\n return promise\n}\n\nfunction makeUntrackedHeaders(\n underlyingHeaders: ReadonlyHeaders\n): Promise<ReadonlyHeaders> {\n const cachedHeaders = CachedHeaders.get(underlyingHeaders)\n if (cachedHeaders) {\n return cachedHeaders\n }\n\n const promise = Promise.resolve(underlyingHeaders)\n CachedHeaders.set(underlyingHeaders, promise)\n\n return promise\n}\n\nfunction makeUntrackedHeadersWithDevWarnings(\n underlyingHeaders: ReadonlyHeaders,\n route: string | undefined,\n requestStore: RequestStore\n): Promise<ReadonlyHeaders> {\n if (requestStore.asyncApiPromises) {\n const promise = isInEarlyRenderStage(requestStore)\n ? requestStore.asyncApiPromises.earlyHeaders\n : requestStore.asyncApiPromises.headers\n return instrumentHeadersPromiseWithDevWarnings(promise, route)\n }\n\n const cachedHeaders = CachedHeaders.get(underlyingHeaders)\n if (cachedHeaders) {\n return cachedHeaders\n }\n\n const promise = makeDevtoolsIOAwarePromise(\n underlyingHeaders,\n requestStore,\n RenderStage.Runtime\n )\n\n const proxiedPromise = instrumentHeadersPromiseWithDevWarnings(promise, route)\n\n CachedHeaders.set(underlyingHeaders, proxiedPromise)\n\n return proxiedPromise\n}\n\nconst warnForSyncAccess = createDedupedByCallsiteServerErrorLoggerDev(\n createHeadersAccessError\n)\n\nfunction instrumentHeadersPromiseWithDevWarnings(\n promise: Promise<ReadonlyHeaders>,\n route: string | undefined\n) {\n Object.defineProperties(promise, {\n [Symbol.iterator]: replaceableWarningDescriptorForSymbolIterator(\n promise,\n route\n ),\n append: replaceableWarningDescriptor(promise, 'append', route),\n delete: replaceableWarningDescriptor(promise, 'delete', route),\n get: replaceableWarningDescriptor(promise, 'get', route),\n has: replaceableWarningDescriptor(promise, 'has', route),\n set: replaceableWarningDescriptor(promise, 'set', route),\n getSetCookie: replaceableWarningDescriptor(promise, 'getSetCookie', route),\n forEach: replaceableWarningDescriptor(promise, 'forEach', route),\n keys: replaceableWarningDescriptor(promise, 'keys', route),\n values: replaceableWarningDescriptor(promise, 'values', route),\n entries: replaceableWarningDescriptor(promise, 'entries', route),\n })\n return promise\n}\n\nfunction replaceableWarningDescriptor(\n target: unknown,\n prop: string,\n route: string | undefined\n) {\n return {\n enumerable: false,\n get() {\n warnForSyncAccess(route, `\\`headers().${prop}\\``)\n return undefined\n },\n set(value: unknown) {\n Object.defineProperty(target, prop, {\n value,\n writable: true,\n configurable: true,\n })\n },\n configurable: true,\n }\n}\n\nfunction replaceableWarningDescriptorForSymbolIterator(\n target: unknown,\n route: string | undefined\n) {\n return {\n enumerable: false,\n get() {\n warnForSyncAccess(route, '`...headers()` or similar iteration')\n return undefined\n },\n set(value: unknown) {\n Object.defineProperty(target, Symbol.iterator, {\n value,\n writable: true,\n enumerable: true,\n configurable: true,\n })\n },\n configurable: true,\n }\n}\n\nfunction createHeadersAccessError(\n route: string | undefined,\n expression: string\n) {\n const prefix = route ? `Route \"${route}\" ` : 'This route '\n return new Error(\n `${prefix}used ${expression}. ` +\n `\\`headers()\\` returns a Promise and must be unwrapped with \\`await\\` or \\`React.use()\\` before accessing its properties. ` +\n `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`\n )\n}\n"],"names":["HeadersAdapter","workAsyncStorage","throwForMissingRequestStore","workUnitAsyncStorage","isInEarlyRenderStage","postponeWithTracking","throwToInterruptStaticGeneration","trackDynamicDataInDynamicRender","StaticGenBailoutError","makeDevtoolsIOAwarePromise","makeHangingPromise","getSessionDataStage","createDedupedByCallsiteServerErrorLoggerDev","isRequestApiAllowedInCurrentPhase","applyOwnerStack","InvariantError","RenderStage","headers","callingExpression","workStore","getStore","workUnitStore","Error","route","forceStatic","underlyingHeaders","seal","Headers","makeUntrackedHeaders","type","error","captureStackTrace","invalidDynamicUsageError","dynamicShouldError","makeHangingHeaders","exportName","dynamicTracking","stagedRendering","delayUntilStage","process","env","NODE_ENV","makeUntrackedHeadersWithDevWarnings","asyncApiPromises","earlyHeaders","CachedHeaders","WeakMap","prerenderStore","cachedHeaders","get","promise","renderSignal","set","Promise","resolve","requestStore","instrumentHeadersPromiseWithDevWarnings","Runtime","proxiedPromise","warnForSyncAccess","createHeadersAccessError","Object","defineProperties","Symbol","iterator","replaceableWarningDescriptorForSymbolIterator","append","replaceableWarningDescriptor","delete","has","getSetCookie","forEach","keys","values","entries","target","prop","enumerable","undefined","value","defineProperty","writable","configurable","expression","prefix"],"mappings":"AAAA,SACEA,cAAc,QAET,yCAAwC;AAC/C,SACEC,gBAAgB,QAEX,4CAA2C;AAClD,SACEC,2BAA2B,EAC3BC,oBAAoB,EAGpBC,oBAAoB,QACf,iDAAgD;AACvD,SACEC,oBAAoB,EACpBC,gCAAgC,EAChCC,+BAA+B,QAC1B,kCAAiC;AACxC,SAASC,qBAAqB,QAAQ,oDAAmD;AACzF,SACEC,0BAA0B,EAC1BC,kBAAkB,EAClBC,mBAAmB,QACd,6BAA4B;AACnC,SAASC,2CAA2C,QAAQ,oDAAmD;AAC/G,SAASC,iCAAiC,QAAQ,UAAS;AAC3D,SAASC,eAAe,QAAQ,6BAA4B;AAC5D,SAASC,cAAc,QAAQ,mCAAkC;AACjE,SAASC,WAAW,QAAQ,iCAAgC;AAE5D;;;;;;;;CAQC,GACD,OAAO,SAASC;IACd,MAAMC,oBAAoB;IAC1B,MAAMC,YAAYlB,iBAAiBmB,QAAQ;IAC3C,MAAMC,gBAAgBlB,qBAAqBiB,QAAQ;IAEnD,IAAID,WAAW;QACb,IAAIE,iBAAiB,CAACR,kCAAkCQ,gBAAgB;YACtE,MAAM,qBAEL,CAFK,IAAIC,MACR,CAAC,MAAM,EAAEH,UAAUI,KAAK,CAAC,6PAA6P,CAAC,GADnR,qBAAA;uBAAA;4BAAA;8BAAA;YAEN;QACF;QAEA,IAAIJ,UAAUK,WAA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AKe,6BAA6BjB,SAAS,OAAO3B;QAClD+C,cAAcH,6BAA6BjB,SAAS,gBAAgB3B;QACpEgD,SAASJ,6BAA6BjB,SAAS,WAAW3B;QAC1DiD,MAAML,6BAA6BjB,SAAS,QAAQ3B;QACpDkD,QAAQN,6BAA6BjB,SAAS,UAAU3B;QACxDmD,SAASP,6BAA6BjB,SAAS,WAAW3B;IAC5D;IACA,OAAO2B;AACT;AAEA,SAASiB,6BACPQ,MAAe,EACfC,IAAY,EACZrD,KAAyB;IAEzB,OAAO;QACLsD,YAAY;QACZ5B;YACEU,kBAAkBpC,OAAO,CAAC,YAAY,EAAEqD,KAAK,EAAE,CAAC;YAChD,OAAOE;QACT;QACA1B,KAAI2B,KAAc;YAChBlB,OAAOmB,cAAc,CAACL,QAAQC,MAAM;gBAClCG;gBACAE,UAAU;gBACVC,cAAc;YAChB;QACF;QACAA,cAAc;IAChB;AACF;AAEA,SAASjB,8CACPU,MAAe,EACfpD,KAAyB;IAEzB,OAAO;QACLsD,YAAY;QACZ5B;YACEU,kBAAkBpC,OAAO;YACzB,OAAOuD;QACT;QACA1B,KAAI2B,KAAc;YAChBlB,OAAOmB,cAAc,CAACL,QAAQZ,OAAOC,QAAQ,EAAE;gBAC7Ce;gBACAE,UAAU;gBACVJ,YAAY;gBACZK,cAAc;YAChB;QACF;QACAA,cAAc;IAChB;AACF;AAEA,SAAStB,yBACPrC,KAAyB,EACzB4D,UAAkB;IAElB,MAAMC,SAAS7D,QAAQ,CAAC,OAAO,EAAEA,MAAM,EAAE,CAAC,GAAG;IAC7C,OAAO,qBAIN,CAJM,IAAID,MACT,GAAG8D,OAAO,KAAK,EAAED,WAAW,EAAE,CAAC,GAC7B,CAAC,yHAAyH,CAAC,GAC3H,CAAC,8DAA8D,CAAC,GAH7D,qBAAA;eAAA;oBAAA;sBAAA;IAIP;AACF","ignoreList":[0]} |
@@ -6,2 +6,3 @@ import { workAsyncStorage } from '../app-render/work-async-storage.external'; | ||
| import { throwPrerenderPPRRemovedError } from '../../shared/lib/ppr-removed-error'; | ||
| import { isRequestApiAllowedInCurrentPhase } from './utils'; | ||
| // A fulfilled thenable that React can unwrap synchronously via `use()` without | ||
@@ -26,2 +27,9 @@ // ever suspending. Reusing a single instance avoids allocating on every call. | ||
| if (workStore && workUnitStore) { | ||
| if (workUnitStore && !isRequestApiAllowedInCurrentPhase(workUnitStore)) { | ||
| throw Object.defineProperty(new Error(`Route ${workStore.route} used \`io()\` inside \`after()\` while rendering. The \`io()\` function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { | ||
| value: "E1372", | ||
| enumerable: false, | ||
| configurable: true | ||
| }); | ||
| } | ||
| switch(workUnitStore.type){ | ||
@@ -28,0 +36,0 @@ case 'request': |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/server/request/io.ts"],"sourcesContent":["import { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'\nimport {\n makeHangingPromise,\n makeDevtoolsIOAwarePromise,\n} from '../dynamic-rendering-utils'\nimport { RenderStage } from '../app-render/staged-rendering'\nimport { throwPrerenderPPRRemovedError } from '../../shared/lib/ppr-removed-error'\n\n// A fulfilled thenable that React can unwrap synchronously via `use()` without\n// ever suspending. Reusing a single instance avoids allocating on every call.\nconst resolvedIOPromise: Promise<void> = Promise.resolve(undefined)\n;(resolvedIOPromise as any).status = 'fulfilled'\n;(resolvedIOPromise as any).value = undefined\n\n/**\n * This function allows you to indicate that the code following it performs\n * I/O or accesses dynamic data sources such as `new Date()` or `Math.random()`.\n *\n * During prerendering it will prevent the prerender from continuing past this\n * point, creating a dynamic boundary. Inside `\"use cache\"` scopes or during\n * a real request it resolves immediately.\n *\n * Unlike `connection()`, `io()` does not require an actual HTTP request and\n * can be used freely inside cache scopes and client components.\n */\nexport function io(): Promise<void> {\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workStore && workUnitStore) {\n switch (workUnitStore.type) {\n case 'request':\n // For dev renders we instrument the promise so it will show up in\n // React Suspense Devtools and, if also doing `instant` validation,\n // ensure it resolves in the right stage for staged rendering\n // In production we just let it resolve immediately because we're doing\n // a dynamic SSR or resume render and have no need to delay anything\n // after this call\n if (process.env.NODE_ENV === 'development') {\n if (workUnitStore.asyncApiPromises) {\n return workUnitStore.asyncApiPromises.io\n }\n return makeDevtoolsIOAwarePromise(\n undefined,\n workUnitStore,\n RenderStage.Dynamic\n )\n } else if (workUnitStore.asyncApiPromises) {\n return workUnitStore.asyncApiPromises.io\n }\n return resolvedIOPromise\n case 'prerender':\n case 'prerender-client':\n case 'prerender-runtime':\n // When prerendering with Cache Components we consider `io()` to be\n // actual IO if not in a cache scope and we can avoid actually executing\n // anything after it by making it return a hanging promise.\n return makeHangingPromise(\n workUnitStore.renderSignal,\n workStore.route,\n '`io()`'\n )\n case 'prerender-ppr':\n // Dead code to be removed when we eliminate legacy ppr code\n throwPrerenderPPRRemovedError()\n break\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n // Inside cache scopes, io() resolves immediately.\n // Caches can contain IO-dependent code like new Date() — it will\n // simply return the value at cache-fill time.\n // ...\n // intentional fallthrough\n case 'generate-static-params':\n // generateStaticParams runs at build time. There is no prerender\n // to stall so we resolve immediately.\n // ...\n // intentional fallthrough\n case 'validation-client':\n // io() is usable in client components, resolve immediately.\n // The reason we take this position is most io shielding you would do\n // in a browser is for sync IO as there aren't many non-fetch based IO\n // operations you can do in the browser that have meaningful latency.\n // So while you might use\n // ...\n // intentional fallthrough\n case 'prerender-legacy':\n // Without cache components, IO is not inherently dynamic.\n // Resolve immediately rather than interrupting static generation.\n return resolvedIOPromise\n default:\n workUnitStore satisfies never\n }\n }\n\n // No work store — we're outside the Next.js rendering context (e.g. in\n // a client component on the browser or in a standalone script). Resolve\n // immediately.\n return resolvedIOPromise\n}\n"],"names":["workAsyncStorage","workUnitAsyncStorage","makeHangingPromise","makeDevtoolsIOAwarePromise","RenderStage","throwPrerenderPPRRemovedError","resolvedIOPromise","Promise","resolve","undefined","status","value","io","workStore","getStore","workUnitStore","type","process","env","NODE_ENV","asyncApiPromises","Dynamic","renderSignal","route"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,4CAA2C;AAC5E,SAASC,oBAAoB,QAAQ,iDAAgD;AACrF,SACEC,kBAAkB,EAClBC,0BAA0B,QACrB,6BAA4B;AACnC,SAASC,WAAW,QAAQ,iCAAgC;AAC5D,SAASC,6BAA6B,QAAQ,qCAAoC;AAElF,+EAA+E;AAC/E,8EAA8E;AAC9E,MAAMC,oBAAmCC,QAAQC,OAAO,CAACC;AACvDH,kBAA0BI,MAAM,GAAG;AACnCJ,kBAA0BK,KAAK,GAAGF;AAEpC;;;;;;;;;;CAUC,GACD,OAAO,SAASG;IACd,MAAMC,YAAYb,iBAAiBc,QAAQ;IAC3C,MAAMC,gBAAgBd,qBAAqBa,QAAQ;IAEnD,IAAID,aAAaE,eAAe;QAC9B,OAAQA,cAAcC,IAAI;YACxB,KAAK;gBACH,kEAAkE;gBAClE,mEAAmE;gBACnE,6DAA6D;gBAC7D,uEAAuE;gBACvE,oEAAoE;gBACpE,kBAAkB;gBAClB,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,eAAe;oBAC1C,IAAIJ,cAAcK,gBAAgB,EAAE;wBAClC,OAAOL,cAAcK,gBAAgB,CAACR,EAAE;oBAC1C;oBACA,OAAOT,2BACLM,WACAM,eACAX,YAAYiB,OAAO;gBAEvB,OAAO,IAAIN,cAAcK,gBAAgB,EAAE;oBACzC,OAAOL,cAAcK,gBAAgB,CAACR,EAAE;gBAC1C;gBACA,OAAON;YACT,KAAK;YACL,KAAK;YACL,KAAK;gBACH,mEAAmE;gBACnE,wEAAwE;gBACxE,2DAA2D;gBAC3D,OAAOJ,mBACLa,cAAcO,YAAY,EAC1BT,UAAUU,KAAK,EACf;YAEJ,KAAK;gBACH,4DAA4D;gBAC5DlB;gBACA;YACF,KAAK;YACL,KAAK;YACL,KAAK;YACL,kDAAkD;YAClD,iEAAiE;YACjE,8CAA8C;YAC9C,MAAM;YACN,0BAA0B;YAC1B,KAAK;YACL,iEAAiE;YACjE,sCAAsC;YACtC,MAAM;YACN,0BAA0B;YAC1B,KAAK;YACL,4DAA4D;YAC5D,qEAAqE;YACrE,sEAAsE;YACtE,qEAAqE;YACrE,yBAAyB;YACzB,MAAM;YACN,0BAA0B;YAC1B,KAAK;gBACH,0DAA0D;gBAC1D,kEAAkE;gBAClE,OAAOC;YACT;gBACES;QACJ;IACF;IAEA,uEAAuE;IACvE,wEAAwE;IACxE,eAAe;IACf,OAAOT;AACT","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/server/request/io.ts"],"sourcesContent":["import { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'\nimport {\n makeHangingPromise,\n makeDevtoolsIOAwarePromise,\n} from '../dynamic-rendering-utils'\nimport { RenderStage } from '../app-render/staged-rendering'\nimport { throwPrerenderPPRRemovedError } from '../../shared/lib/ppr-removed-error'\nimport { isRequestApiAllowedInCurrentPhase } from './utils'\n\n// A fulfilled thenable that React can unwrap synchronously via `use()` without\n// ever suspending. Reusing a single instance avoids allocating on every call.\nconst resolvedIOPromise: Promise<void> = Promise.resolve(undefined)\n;(resolvedIOPromise as any).status = 'fulfilled'\n;(resolvedIOPromise as any).value = undefined\n\n/**\n * This function allows you to indicate that the code following it performs\n * I/O or accesses dynamic data sources such as `new Date()` or `Math.random()`.\n *\n * During prerendering it will prevent the prerender from continuing past this\n * point, creating a dynamic boundary. Inside `\"use cache\"` scopes or during\n * a real request it resolves immediately.\n *\n * Unlike `connection()`, `io()` does not require an actual HTTP request and\n * can be used freely inside cache scopes and client components.\n */\nexport function io(): Promise<void> {\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workStore && workUnitStore) {\n if (workUnitStore && !isRequestApiAllowedInCurrentPhase(workUnitStore)) {\n throw new Error(\n `Route ${workStore.route} used \\`io()\\` inside \\`after()\\` while rendering. The \\`io()\\` function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`\n )\n }\n switch (workUnitStore.type) {\n case 'request':\n // For dev renders we instrument the promise so it will show up in\n // React Suspense Devtools and, if also doing `instant` validation,\n // ensure it resolves in the right stage for staged rendering\n // In production we just let it resolve immediately because we're doing\n // a dynamic SSR or resume render and have no need to delay anything\n // after this call\n if (process.env.NODE_ENV === 'development') {\n if (workUnitStore.asyncApiPromises) {\n return workUnitStore.asyncApiPromises.io\n }\n return makeDevtoolsIOAwarePromise(\n undefined,\n workUnitStore,\n RenderStage.Dynamic\n )\n } else if (workUnitStore.asyncApiPromises) {\n return workUnitStore.asyncApiPromises.io\n }\n return resolvedIOPromise\n case 'prerender':\n case 'prerender-client':\n case 'prerender-runtime':\n // When prerendering with Cache Components we consider `io()` to be\n // actual IO if not in a cache scope and we can avoid actually executing\n // anything after it by making it return a hanging promise.\n return makeHangingPromise(\n workUnitStore.renderSignal,\n workStore.route,\n '`io()`'\n )\n case 'prerender-ppr':\n // Dead code to be removed when we eliminate legacy ppr code\n throwPrerenderPPRRemovedError()\n break\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n // Inside cache scopes, io() resolves immediately.\n // Caches can contain IO-dependent code like new Date() — it will\n // simply return the value at cache-fill time.\n // ...\n // intentional fallthrough\n case 'generate-static-params':\n // generateStaticParams runs at build time. There is no prerender\n // to stall so we resolve immediately.\n // ...\n // intentional fallthrough\n case 'validation-client':\n // io() is usable in client components, resolve immediately.\n // The reason we take this position is most io shielding you would do\n // in a browser is for sync IO as there aren't many non-fetch based IO\n // operations you can do in the browser that have meaningful latency.\n // So while you might use\n // ...\n // intentional fallthrough\n case 'prerender-legacy':\n // Without cache components, IO is not inherently dynamic.\n // Resolve immediately rather than interrupting static generation.\n return resolvedIOPromise\n default:\n workUnitStore satisfies never\n }\n }\n\n // No work store — we're outside the Next.js rendering context (e.g. in\n // a client component on the browser or in a standalone script). Resolve\n // immediately.\n return resolvedIOPromise\n}\n"],"names":["workAsyncStorage","workUnitAsyncStorage","makeHangingPromise","makeDevtoolsIOAwarePromise","RenderStage","throwPrerenderPPRRemovedError","isRequestApiAllowedInCurrentPhase","resolvedIOPromise","Promise","resolve","undefined","status","value","io","workStore","getStore","workUnitStore","Error","route","type","process","env","NODE_ENV","asyncApiPromises","Dynamic","renderSignal"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,4CAA2C;AAC5E,SAASC,oBAAoB,QAAQ,iDAAgD;AACrF,SACEC,kBAAkB,EAClBC,0BAA0B,QACrB,6BAA4B;AACnC,SAASC,WAAW,QAAQ,iCAAgC;AAC5D,SAASC,6BAA6B,QAAQ,qCAAoC;AAClF,SAASC,iCAAiC,QAAQ,UAAS;AAE3D,+EAA+E;AAC/E,8EAA8E;AAC9E,MAAMC,oBAAmCC,QAAQC,OAAO,CAACC;AACvDH,kBAA0BI,MAAM,GAAG;AACnCJ,kBAA0BK,KAAK,GAAGF;AAEpC;;;;;;;;;;CAUC,GACD,OAAO,SAASG;IACd,MAAMC,YAAYd,iBAAiBe,QAAQ;IAC3C,MAAMC,gBAAgBf,qBAAqBc,QAAQ;IAEnD,IAAID,aAAaE,eAAe;QAC9B,IAAIA,iBAAiB,CAACV,kCAAkCU,gBAAgB;YACtE,MAAM,qBAEL,CAFK,IAAIC,MACR,CAAC,MAAM,EAAEH,UAAUI,KAAK,CAAC,oLAAoL,CAAC,GAD1M,qBAAA;uBAAA;4BAAA;8BAAA;YAEN;QACF;QACA,OAAQF,cAAcG,IAAI;YACxB,KAAK;gBACH,kEAAkE;gBAClE,mEAAmE;gBACnE,6DAA6D;gBAC7D,uEAAuE;gBACvE,oEAAoE;gBACpE,kBAAkB;gBAClB,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,eAAe;oBAC1C,IAAIN,cAAcO,gBAAgB,EAAE;wBAClC,OAAOP,cAAcO,gBAAgB,CAACV,EAAE;oBAC1C;oBACA,OAAOV,2BACLO,WACAM,eACAZ,YAAYoB,OAAO;gBAEvB,OAAO,IAAIR,cAAcO,gBAAgB,EAAE;oBACzC,OAAOP,cAAcO,gBAAgB,CAACV,EAAE;gBAC1C;gBACA,OAAON;YACT,KAAK;YACL,KAAK;YACL,KAAK;gBACH,mEAAmE;gBACnE,wEAAwE;gBACxE,2DAA2D;gBAC3D,OAAOL,mBACLc,cAAcS,YAAY,EAC1BX,UAAUI,KAAK,EACf;YAEJ,KAAK;gBACH,4DAA4D;gBAC5Db;gBACA;YACF,KAAK;YACL,KAAK;YACL,KAAK;YACL,kDAAkD;YAClD,iEAAiE;YACjE,8CAA8C;YAC9C,MAAM;YACN,0BAA0B;YAC1B,KAAK;YACL,iEAAiE;YACjE,sCAAsC;YACtC,MAAM;YACN,0BAA0B;YAC1B,KAAK;YACL,4DAA4D;YAC5D,qEAAqE;YACrE,sEAAsE;YACtE,qEAAqE;YACrE,yBAAyB;YACzB,MAAM;YACN,0BAA0B;YAC1B,KAAK;gBACH,0DAA0D;gBAC1D,kEAAkE;gBAClE,OAAOE;YACT;gBACES;QACJ;IACF;IAEA,uEAAuE;IACvE,wEAAwE;IACxE,eAAe;IACf,OAAOT;AACT","ignoreList":[0]} |
| import { StaticGenBailoutError } from '../../client/components/static-generation-bailout'; | ||
| import { actionAsyncStorage } from '../app-render/action-async-storage.external'; | ||
| import { afterTaskAsyncStorage } from '../app-render/after-task-async-storage.external'; | ||
@@ -20,7 +21,39 @@ export function throwWithStaticGenerationBailoutErrorWithDynamicError(route, expression) { | ||
| } | ||
| export function isRequestAPICallableInsideAfter() { | ||
| const afterTaskStore = afterTaskAsyncStorage.getStore(); | ||
| return (afterTaskStore == null ? void 0 : afterTaskStore.rootTaskSpawnPhase) === 'action'; | ||
| export function isRequestApiAllowedInCurrentPhase(workUnitStore) { | ||
| switch(workUnitStore.phase){ | ||
| case 'action': | ||
| case 'render': | ||
| { | ||
| // The request is still in progress. The API may be disallowed for other reasons, | ||
| // but not because of phase. | ||
| return true; | ||
| } | ||
| case 'after': | ||
| { | ||
| // The request has finished. | ||
| // If we're in a Route Handler or a Server Action, | ||
| // request APIs can be called everywhere, even in after(). | ||
| const actionStore = actionAsyncStorage.getStore(); | ||
| if (actionStore && (actionStore.isAppRoute || actionStore.isAction)) { | ||
| return true; | ||
| } | ||
| const afterTaskStore = afterTaskAsyncStorage.getStore(); | ||
| if (afterTaskStore) { | ||
| // We're in an `after` callback. Request APIs are callable if | ||
| // the `after()` call happened in an action phase: | ||
| // - in a Route Handler | ||
| // - in a Server Action's body (but not the render after) | ||
| // | ||
| // TODO(after): Is it even possible to have `phase === 'action'` but no `actionStore`? | ||
| // We should revisit this setup and simplify this. | ||
| return afterTaskStore.rootTaskSpawnPhase === 'action'; | ||
| } | ||
| // Otherwise, we must be in a page, in the `after` phase. | ||
| // We don't allow calling request APIs here because we'd miss | ||
| // them during prerendering and wouldn't know that the page is dynamic. | ||
| return false; | ||
| } | ||
| } | ||
| } | ||
| //# sourceMappingURL=utils.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/server/request/utils.ts"],"sourcesContent":["import { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport { afterTaskAsyncStorage } from '../app-render/after-task-async-storage.external'\nimport type { WorkStore } from '../app-render/work-async-storage.external'\n\nexport function throwWithStaticGenerationBailoutErrorWithDynamicError(\n route: string,\n expression: string\n): never {\n throw new StaticGenBailoutError(\n `Route ${route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used ${expression}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n}\n\nexport function throwForSearchParamsAccessInUseCache(\n workStore: WorkStore,\n constructorOpt: Function\n): never {\n const error = new Error(\n `Route ${workStore.route} used \\`searchParams\\` inside \"use cache\". Accessing dynamic request data inside a cache scope is not supported. If you need some search params inside a cached function await \\`searchParams\\` outside of the cached function and pass only the required search params as arguments to the cached function. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n\n Error.captureStackTrace(error, constructorOpt)\n workStore.invalidDynamicUsageError ??= error\n\n throw error\n}\n\nexport function isRequestAPICallableInsideAfter() {\n const afterTaskStore = afterTaskAsyncStorage.getStore()\n return afterTaskStore?.rootTaskSpawnPhase === 'action'\n}\n"],"names":["StaticGenBailoutError","afterTaskAsyncStorage","throwWithStaticGenerationBailoutErrorWithDynamicError","route","expression","throwForSearchParamsAccessInUseCache","workStore","constructorOpt","error","Error","captureStackTrace","invalidDynamicUsageError","isRequestAPICallableInsideAfter","afterTaskStore","getStore","rootTaskSpawnPhase"],"mappings":"AAAA,SAASA,qBAAqB,QAAQ,oDAAmD;AACzF,SAASC,qBAAqB,QAAQ,kDAAiD;AAGvF,OAAO,SAASC,sDACdC,KAAa,EACbC,UAAkB;IAElB,MAAM,qBAEL,CAFK,IAAIJ,sBACR,CAAC,MAAM,EAAEG,MAAM,4EAA4E,EAAEC,WAAW,0HAA0H,CAAC,GAD/N,qBAAA;eAAA;oBAAA;sBAAA;IAEN;AACF;AAEA,OAAO,SAASC,qCACdC,SAAoB,EACpBC,cAAwB;IAExB,MAAMC,QAAQ,qBAEb,CAFa,IAAIC,MAChB,CAAC,MAAM,EAAEH,UAAUH,KAAK,CAAC,2XAA2X,CAAC,GADzY,qBAAA;eAAA;oBAAA;sBAAA;IAEd;IAEAM,MAAMC,iBAAiB,CAACF,OAAOD;IAC/BD,UAAUK,wBAAwB,KAAKH;IAEvC,MAAMA;AACR;AAEA,OAAO,SAASI;IACd,MAAMC,iBAAiBZ,sBAAsBa,QAAQ;IACrD,OAAOD,CAAAA,kCAAAA,eAAgBE,kBAAkB,MAAK;AAChD","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/server/request/utils.ts"],"sourcesContent":["import { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport { actionAsyncStorage } from '../app-render/action-async-storage.external'\nimport { afterTaskAsyncStorage } from '../app-render/after-task-async-storage.external'\nimport type { WorkStore } from '../app-render/work-async-storage.external'\nimport type { WorkUnitStore } from '../app-render/work-unit-async-storage.external'\n\nexport function throwWithStaticGenerationBailoutErrorWithDynamicError(\n route: string,\n expression: string\n): never {\n throw new StaticGenBailoutError(\n `Route ${route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used ${expression}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n}\n\nexport function throwForSearchParamsAccessInUseCache(\n workStore: WorkStore,\n constructorOpt: Function\n): never {\n const error = new Error(\n `Route ${workStore.route} used \\`searchParams\\` inside \"use cache\". Accessing dynamic request data inside a cache scope is not supported. If you need some search params inside a cached function await \\`searchParams\\` outside of the cached function and pass only the required search params as arguments to the cached function. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n\n Error.captureStackTrace(error, constructorOpt)\n workStore.invalidDynamicUsageError ??= error\n\n throw error\n}\n\nexport function isRequestApiAllowedInCurrentPhase(\n workUnitStore: WorkUnitStore\n): boolean {\n switch (workUnitStore.phase) {\n case 'action':\n case 'render': {\n // The request is still in progress. The API may be disallowed for other reasons,\n // but not because of phase.\n return true\n }\n case 'after': {\n // The request has finished.\n\n // If we're in a Route Handler or a Server Action,\n // request APIs can be called everywhere, even in after().\n const actionStore = actionAsyncStorage.getStore()\n if (actionStore && (actionStore.isAppRoute || actionStore.isAction)) {\n return true\n }\n\n const afterTaskStore = afterTaskAsyncStorage.getStore()\n if (afterTaskStore) {\n // We're in an `after` callback. Request APIs are callable if\n // the `after()` call happened in an action phase:\n // - in a Route Handler\n // - in a Server Action's body (but not the render after)\n //\n // TODO(after): Is it even possible to have `phase === 'action'` but no `actionStore`?\n // We should revisit this setup and simplify this.\n return afterTaskStore.rootTaskSpawnPhase === 'action'\n }\n\n // Otherwise, we must be in a page, in the `after` phase.\n // We don't allow calling request APIs here because we'd miss\n // them during prerendering and wouldn't know that the page is dynamic.\n return false\n }\n }\n}\n"],"names":["StaticGenBailoutError","actionAsyncStorage","afterTaskAsyncStorage","throwWithStaticGenerationBailoutErrorWithDynamicError","route","expression","throwForSearchParamsAccessInUseCache","workStore","constructorOpt","error","Error","captureStackTrace","invalidDynamicUsageError","isRequestApiAllowedInCurrentPhase","workUnitStore","phase","actionStore","getStore","isAppRoute","isAction","afterTaskStore","rootTaskSpawnPhase"],"mappings":"AAAA,SAASA,qBAAqB,QAAQ,oDAAmD;AACzF,SAASC,kBAAkB,QAAQ,8CAA6C;AAChF,SAASC,qBAAqB,QAAQ,kDAAiD;AAIvF,OAAO,SAASC,sDACdC,KAAa,EACbC,UAAkB;IAElB,MAAM,qBAEL,CAFK,IAAIL,sBACR,CAAC,MAAM,EAAEI,MAAM,4EAA4E,EAAEC,WAAW,0HAA0H,CAAC,GAD/N,qBAAA;eAAA;oBAAA;sBAAA;IAEN;AACF;AAEA,OAAO,SAASC,qCACdC,SAAoB,EACpBC,cAAwB;IAExB,MAAMC,QAAQ,qBAEb,CAFa,IAAIC,MAChB,CAAC,MAAM,EAAEH,UAAUH,KAAK,CAAC,2XAA2X,CAAC,GADzY,qBAAA;eAAA;oBAAA;sBAAA;IAEd;IAEAM,MAAMC,iBAAiB,CAACF,OAAOD;IAC/BD,UAAUK,wBAAwB,KAAKH;IAEvC,MAAMA;AACR;AAEA,OAAO,SAASI,kCACdC,aAA4B;IAE5B,OAAQA,cAAcC,KAAK;QACzB,KAAK;QACL,KAAK;YAAU;gBACb,iFAAiF;gBACjF,4BAA4B;gBAC5B,OAAO;YACT;QACA,KAAK;YAAS;gBACZ,4BAA4B;gBAE5B,kDAAkD;gBAClD,0DAA0D;gBAC1D,MAAMC,cAAcf,mBAAmBgB,QAAQ;gBAC/C,IAAID,eAAgBA,CAAAA,YAAYE,UAAU,IAAIF,YAAYG,QAAQ,AAAD,GAAI;oBACnE,OAAO;gBACT;gBAEA,MAAMC,iBAAiBlB,sBAAsBe,QAAQ;gBACrD,IAAIG,gBAAgB;oBAClB,6DAA6D;oBAC7D,kDAAkD;oBAClD,uBAAuB;oBACvB,yDAAyD;oBACzD,EAAE;oBACF,sFAAsF;oBACtF,kDAAkD;oBAClD,OAAOA,eAAeC,kBAAkB,KAAK;gBAC/C;gBAEA,yDAAyD;gBACzD,6DAA6D;gBAC7D,uEAAuE;gBACvE,OAAO;YACT;IACF;AACF","ignoreList":[0]} |
| export function isStableBuild() { | ||
| return !"16.3.0-canary.58"?.includes('canary') && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV; | ||
| return !"16.3.0-canary.59"?.includes('canary') && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV; | ||
| } | ||
@@ -4,0 +4,0 @@ export class CanaryOnlyConfigError extends Error { |
@@ -75,3 +75,3 @@ "use strict"; | ||
| const data = await res.json(); | ||
| const versionData = data.versions["16.3.0-canary.58"]; | ||
| const versionData = data.versions["16.3.0-canary.59"]; | ||
| return { | ||
@@ -104,3 +104,3 @@ os: versionData.os, | ||
| lockfileParsed.dependencies[pkg] = { | ||
| version: "16.3.0-canary.58", | ||
| version: "16.3.0-canary.59", | ||
| resolved: pkgData.tarball, | ||
@@ -113,3 +113,3 @@ integrity: pkgData.integrity, | ||
| lockfileParsed.packages[pkg] = { | ||
| version: "16.3.0-canary.58", | ||
| version: "16.3.0-canary.59", | ||
| resolved: pkgData.tarball, | ||
@@ -116,0 +116,0 @@ integrity: pkgData.integrity, |
| /** | ||
| * This module imports the client instrumentation hook from the project root. | ||
| * This module imports the configured client instrumentation modules. | ||
| * | ||
| * The `private-next-instrumentation-client` module is automatically aliased to | ||
| * the `instrumentation-client.ts` file in the project root by webpack or turbopack. | ||
| * either the user's instrumentation module or a generated module array. | ||
| */ "use strict"; | ||
@@ -11,3 +11,6 @@ if (process.env.NODE_ENV === 'development') { | ||
| // eslint-disable-next-line @next/internal/typechecked-require -- Not a module. | ||
| module.exports = require('private-next-instrumentation-client'); | ||
| const instrumentationClient = require('private-next-instrumentation-client'); | ||
| module.exports = Array.isArray(instrumentationClient) ? instrumentationClient : [ | ||
| instrumentationClient | ||
| ]; | ||
| const endTime = performance.now(); | ||
@@ -24,5 +27,8 @@ const duration = endTime - startTime; | ||
| // eslint-disable-next-line @next/internal/typechecked-require -- Not a module. | ||
| module.exports = require('private-next-instrumentation-client'); | ||
| const instrumentationClient = require('private-next-instrumentation-client'); | ||
| module.exports = Array.isArray(instrumentationClient) ? instrumentationClient : [ | ||
| instrumentationClient | ||
| ]; | ||
| } | ||
| //# sourceMappingURL=require-instrumentation-client.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/lib/require-instrumentation-client.ts"],"sourcesContent":["/**\n * This module imports the client instrumentation hook from the project root.\n *\n * The `private-next-instrumentation-client` module is automatically aliased to\n * the `instrumentation-client.ts` file in the project root by webpack or turbopack.\n */\nif (process.env.NODE_ENV === 'development') {\n const measureName = 'Client Instrumentation Hook'\n const startTime = performance.now()\n // eslint-disable-next-line @next/internal/typechecked-require -- Not a module.\n module.exports = require('private-next-instrumentation-client')\n const endTime = performance.now()\n const duration = endTime - startTime\n\n // Using 16ms threshold as it represents one frame (1000ms/60fps)\n // This helps identify if the instrumentation hook initialization\n // could potentially cause frame drops during development.\n const THRESHOLD = 16\n if (duration > THRESHOLD) {\n console.log(\n `[${measureName}] Slow execution detected: ${duration.toFixed(0)}ms (Note: Code download overhead is not included in this measurement)`\n )\n }\n} else {\n // eslint-disable-next-line @next/internal/typechecked-require -- Not a module.\n module.exports = require('private-next-instrumentation-client')\n}\n"],"names":["process","env","NODE_ENV","measureName","startTime","performance","now","module","exports","require","endTime","duration","THRESHOLD","console","log","toFixed"],"mappings":"AAAA;;;;;CAKC;AACD,IAAIA,QAAQC,GAAG,CAACC,QAAQ,KAAK,eAAe;IAC1C,MAAMC,cAAc;IACpB,MAAMC,YAAYC,YAAYC,GAAG;IACjC,+EAA+E;IAC/EC,OAAOC,OAAO,GAAGC,QAAQ;IACzB,MAAMC,UAAUL,YAAYC,GAAG;IAC/B,MAAMK,WAAWD,UAAUN;IAE3B,iEAAiE;IACjE,iEAAiE;IACjE,0DAA0D;IAC1D,MAAMQ,YAAY;IAClB,IAAID,WAAWC,WAAW;QACxBC,QAAQC,GAAG,CACT,CAAC,CAAC,EAAEX,YAAY,2BAA2B,EAAEQ,SAASI,OAAO,CAAC,GAAG,qEAAqE,CAAC;IAE3I;AACF,OAAO;IACL,+EAA+E;IAC/ER,OAAOC,OAAO,GAAGC,QAAQ;AAC3B","ignoreList":[0]} | ||
| {"version":3,"sources":["../../src/lib/require-instrumentation-client.ts"],"sourcesContent":["/**\n * This module imports the configured client instrumentation modules.\n *\n * The `private-next-instrumentation-client` module is automatically aliased to\n * either the user's instrumentation module or a generated module array.\n */\nif (process.env.NODE_ENV === 'development') {\n const measureName = 'Client Instrumentation Hook'\n const startTime = performance.now()\n // eslint-disable-next-line @next/internal/typechecked-require -- Not a module.\n const instrumentationClient = require('private-next-instrumentation-client')\n module.exports = Array.isArray(instrumentationClient)\n ? instrumentationClient\n : [instrumentationClient]\n const endTime = performance.now()\n const duration = endTime - startTime\n\n // Using 16ms threshold as it represents one frame (1000ms/60fps)\n // This helps identify if the instrumentation hook initialization\n // could potentially cause frame drops during development.\n const THRESHOLD = 16\n if (duration > THRESHOLD) {\n console.log(\n `[${measureName}] Slow execution detected: ${duration.toFixed(0)}ms (Note: Code download overhead is not included in this measurement)`\n )\n }\n} else {\n // eslint-disable-next-line @next/internal/typechecked-require -- Not a module.\n const instrumentationClient = require('private-next-instrumentation-client')\n module.exports = Array.isArray(instrumentationClient)\n ? instrumentationClient\n : [instrumentationClient]\n}\n"],"names":["process","env","NODE_ENV","measureName","startTime","performance","now","instrumentationClient","require","module","exports","Array","isArray","endTime","duration","THRESHOLD","console","log","toFixed"],"mappings":"AAAA;;;;;CAKC;AACD,IAAIA,QAAQC,GAAG,CAACC,QAAQ,KAAK,eAAe;IAC1C,MAAMC,cAAc;IACpB,MAAMC,YAAYC,YAAYC,GAAG;IACjC,+EAA+E;IAC/E,MAAMC,wBAAwBC,QAAQ;IACtCC,OAAOC,OAAO,GAAGC,MAAMC,OAAO,CAACL,yBAC3BA,wBACA;QAACA;KAAsB;IAC3B,MAAMM,UAAUR,YAAYC,GAAG;IAC/B,MAAMQ,WAAWD,UAAUT;IAE3B,iEAAiE;IACjE,iEAAiE;IACjE,0DAA0D;IAC1D,MAAMW,YAAY;IAClB,IAAID,WAAWC,WAAW;QACxBC,QAAQC,GAAG,CACT,CAAC,CAAC,EAAEd,YAAY,2BAA2B,EAAEW,SAASI,OAAO,CAAC,GAAG,qEAAqE,CAAC;IAE3I;AACF,OAAO;IACL,+EAA+E;IAC/E,MAAMX,wBAAwBC,QAAQ;IACtCC,OAAOC,OAAO,GAAGC,MAAMC,OAAO,CAACL,yBAC3BA,wBACA;QAACA;KAAsB;AAC7B","ignoreList":[0]} |
| import type { RequestLifecycleOpts } from '../base-server'; | ||
| import type { AfterTask } from './after'; | ||
| import type { WorkUnitStore } from '../app-render/work-unit-async-storage.external'; | ||
| export type AfterContextOpts = { | ||
@@ -12,2 +13,4 @@ waitUntil: RequestLifecycleOpts['waitUntil'] | undefined; | ||
| private onTaskError; | ||
| private isRequestClosed; | ||
| private initialOnCloseError; | ||
| private runCallbacksOnClosePromise; | ||
@@ -17,3 +20,4 @@ private callbackQueue; | ||
| constructor({ waitUntil, onClose, onTaskError }: AfterContextOpts); | ||
| after(task: AfterTask): void; | ||
| after(task: AfterTask, workUnitStore: WorkUnitStore): void; | ||
| private addThenable; | ||
| private addCallback; | ||
@@ -20,0 +24,0 @@ private runCallbacksOnClose; |
@@ -17,4 +17,4 @@ "use strict"; | ||
| const _asynclocalstorage = require("../app-render/async-local-storage"); | ||
| const _workunitasyncstorageexternal = require("../app-render/work-unit-async-storage.external"); | ||
| const _aftertaskasyncstorageexternal = require("../app-render/after-task-async-storage.external"); | ||
| const _scheduler = require("../../lib/scheduler"); | ||
| function _interop_require_default(obj) { | ||
@@ -27,2 +27,4 @@ return obj && obj.__esModule ? obj : { | ||
| constructor({ waitUntil, onClose, onTaskError }){ | ||
| this.isRequestClosed = false; | ||
| this.initialOnCloseError = null; | ||
| this.workUnitStores = new Set(); | ||
@@ -34,12 +36,35 @@ this.waitUntil = waitUntil; | ||
| this.callbackQueue.pause(); | ||
| try { | ||
| onClose(()=>{ | ||
| this.isRequestClosed = true; | ||
| // TODO(after): it's not ideal that we'll only switch the `phase` of a WorkUnitStore | ||
| // if `after()` was called inside it. We should probably track this whenever a store is created | ||
| for (const workUnitStore of this.workUnitStores){ | ||
| workUnitStore.phase = 'after'; | ||
| } | ||
| }); | ||
| } catch (err) { | ||
| // If onClose is broken, report errors lazily, when after() is called. | ||
| this.initialOnCloseError = { | ||
| error: err | ||
| }; | ||
| } | ||
| } | ||
| after(task) { | ||
| after(task, workUnitStore) { | ||
| if (this.initialOnCloseError) { | ||
| throw Object.defineProperty(new _invarianterror.InvariantError(`An onClose call failed, which means after() can't work correctly.`, { | ||
| cause: this.initialOnCloseError.error | ||
| }), "__NEXT_ERROR_CODE", { | ||
| value: "E1368", | ||
| enumerable: false, | ||
| configurable: true | ||
| }); | ||
| } | ||
| // Save the workUnitStore so we can switch its phase later. | ||
| this.workUnitStores.add(workUnitStore); | ||
| if ((0, _isthenable.isThenable)(task)) { | ||
| if (!this.waitUntil) { | ||
| errorWaitUntilNotAvailable(); | ||
| } | ||
| this.waitUntil(task.catch((error)=>this.reportTaskError('promise', error))); | ||
| this.addThenable(task); | ||
| } else if (typeof task === 'function') { | ||
| // TODO(after): implement tracing | ||
| this.addCallback(task); | ||
| this.addCallback(task, workUnitStore); | ||
| } else { | ||
@@ -53,3 +78,16 @@ throw Object.defineProperty(new Error('`after()`: Argument must be a promise or a function'), "__NEXT_ERROR_CODE", { | ||
| } | ||
| addCallback(callback) { | ||
| addThenable(thenable) { | ||
| if (!this.waitUntil) { | ||
| errorWaitUntilNotAvailable(); | ||
| } | ||
| this.waitUntil(new Promise((resolve)=>{ | ||
| thenable.then(()=>{ | ||
| resolve(); | ||
| }, (error)=>{ | ||
| resolve(); | ||
| this.reportTaskError('promise', error); | ||
| }); | ||
| })); | ||
| } | ||
| addCallback(callback, workUnitStore) { | ||
| // if something is wrong, throw synchronously, bubbling up to the `after` callsite. | ||
@@ -59,6 +97,2 @@ if (!this.waitUntil) { | ||
| } | ||
| const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); | ||
| if (workUnitStore) { | ||
| this.workUnitStores.add(workUnitStore); | ||
| } | ||
| const afterTaskStore = _aftertaskasyncstorageexternal.afterTaskAsyncStorage.getStore(); | ||
@@ -70,3 +104,3 @@ // This is used for checking if request APIs can be called inside `after`. | ||
| const rootTaskSpawnPhase = afterTaskStore ? afterTaskStore.rootTaskSpawnPhase // nested after | ||
| : workUnitStore == null ? void 0 : workUnitStore.phase // topmost after | ||
| : workUnitStore.phase // topmost after | ||
| ; | ||
@@ -97,3 +131,10 @@ // this should only happen once. | ||
| async runCallbacksOnClose() { | ||
| await new Promise((resolve)=>this.onClose(resolve)); | ||
| if (!this.isRequestClosed) { | ||
| await new Promise((resolve)=>this.onClose(resolve)); | ||
| } else { | ||
| // The request is already closed. | ||
| // Avoid running the callbacks too quickly to prevent userspace from | ||
| // e.g. relying on `after` being microtasky somewhere. | ||
| await new Promise((resolve)=>(0, _scheduler.scheduleImmediate)(resolve)); | ||
| } | ||
| return this.runCallbacks(); | ||
@@ -103,5 +144,2 @@ } | ||
| if (this.callbackQueue.size === 0) return; | ||
| for (const workUnitStore of this.workUnitStores){ | ||
| workUnitStore.phase = 'after'; | ||
| } | ||
| const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); | ||
@@ -108,0 +146,0 @@ if (!workStore) { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/server/after/after-context.ts"],"sourcesContent":["import PromiseQueue from 'next/dist/compiled/p-queue'\nimport type { RequestLifecycleOpts } from '../base-server'\nimport type { AfterCallback, AfterTask } from './after'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { isThenable } from '../../shared/lib/is-thenable'\nimport { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { withExecuteRevalidates } from '../revalidation-utils'\nimport { bindSnapshot } from '../app-render/async-local-storage'\nimport {\n workUnitAsyncStorage,\n type WorkUnitStore,\n} from '../app-render/work-unit-async-storage.external'\nimport { afterTaskAsyncStorage } from '../app-render/after-task-async-storage.external'\n\nexport type AfterContextOpts = {\n waitUntil: RequestLifecycleOpts['waitUntil'] | undefined\n onClose: RequestLifecycleOpts['onClose']\n onTaskError: RequestLifecycleOpts['onAfterTaskError'] | undefined\n}\n\nexport class AfterContext {\n private waitUntil: RequestLifecycleOpts['waitUntil'] | undefined\n private onClose: RequestLifecycleOpts['onClose']\n private onTaskError: RequestLifecycleOpts['onAfterTaskError'] | undefined\n\n private runCallbacksOnClosePromise: Promise<void> | undefined\n private callbackQueue: PromiseQueue\n private workUnitStores = new Set<WorkUnitStore>()\n\n constructor({ waitUntil, onClose, onTaskError }: AfterContextOpts) {\n this.waitUntil = waitUntil\n this.onClose = onClose\n this.onTaskError = onTaskError\n\n this.callbackQueue = new PromiseQueue()\n this.callbackQueue.pause()\n }\n\n public after(task: AfterTask): void {\n if (isThenable(task)) {\n if (!this.waitUntil) {\n errorWaitUntilNotAvailable()\n }\n this.waitUntil(\n task.catch((error) => this.reportTaskError('promise', error))\n )\n } else if (typeof task === 'function') {\n // TODO(after): implement tracing\n this.addCallback(task)\n } else {\n throw new Error('`after()`: Argument must be a promise or a function')\n }\n }\n\n private addCallback(callback: AfterCallback) {\n // if something is wrong, throw synchronously, bubbling up to the `after` callsite.\n if (!this.waitUntil) {\n errorWaitUntilNotAvailable()\n }\n\n const workUnitStore = workUnitAsyncStorage.getStore()\n if (workUnitStore) {\n this.workUnitStores.add(workUnitStore)\n }\n\n const afterTaskStore = afterTaskAsyncStorage.getStore()\n\n // This is used for checking if request APIs can be called inside `after`.\n // Note that we need to check the phase in which the *topmost* `after` was called (which should be \"action\"),\n // not the current phase (which might be \"after\" if we're in a nested after).\n // Otherwise, we might allow `after(() => headers())`, but not `after(() => after(() => headers()))`.\n const rootTaskSpawnPhase = afterTaskStore\n ? afterTaskStore.rootTaskSpawnPhase // nested after\n : workUnitStore?.phase // topmost after\n\n // this should only happen once.\n if (!this.runCallbacksOnClosePromise) {\n this.runCallbacksOnClosePromise = this.runCallbacksOnClose()\n this.waitUntil(this.runCallbacksOnClosePromise)\n }\n\n // Bind the callback to the current execution context (i.e. preserve all currently available ALS-es).\n // We do this because we want all of these to be equivalent in every regard except timing:\n // after(() => x())\n // after(x())\n // await x()\n const wrappedCallback = bindSnapshot(\n // WARNING: Don't make this a named function. It must be anonymous.\n // See: https://github.com/facebook/react/pull/34911\n async () => {\n try {\n await afterTaskAsyncStorage.run({ rootTaskSpawnPhase }, () =>\n callback()\n )\n } catch (error) {\n this.reportTaskError('function', error)\n }\n }\n )\n\n this.callbackQueue.add(wrappedCallback)\n }\n\n private async runCallbacksOnClose() {\n await new Promise<void>((resolve) => this.onClose!(resolve))\n return this.runCallbacks()\n }\n\n private async runCallbacks(): Promise<void> {\n if (this.callbackQueue.size === 0) return\n\n for (const workUnitStore of this.workUnitStores) {\n workUnitStore.phase = 'after'\n }\n\n const workStore = workAsyncStorage.getStore()\n if (!workStore) {\n throw new InvariantError('Missing workStore in AfterContext.runCallbacks')\n }\n\n return withExecuteRevalidates(workStore, () => {\n this.callbackQueue.start()\n return this.callbackQueue.onIdle()\n })\n }\n\n private reportTaskError(taskKind: 'promise' | 'function', error: unknown) {\n // TODO(after): this is fine for now, but will need better intergration with our error reporting.\n // TODO(after): should we log this if we have a onTaskError callback?\n console.error(\n taskKind === 'promise'\n ? `A promise passed to \\`after()\\` rejected:`\n : `An error occurred in a function passed to \\`after()\\`:`,\n error\n )\n if (this.onTaskError) {\n // this is very defensive, but we really don't want anything to blow up in an error handler\n try {\n this.onTaskError?.(error)\n } catch (handlerError) {\n console.error(\n new InvariantError(\n '`onTaskError` threw while handling an error thrown from an `after` task',\n {\n cause: handlerError,\n }\n )\n )\n }\n }\n }\n}\n\nfunction errorWaitUntilNotAvailable(): never {\n throw new Error(\n '`after()` will not work correctly, because `waitUntil` is not available in the current environment.'\n )\n}\n"],"names":["AfterContext","constructor","waitUntil","onClose","onTaskError","workUnitStores","Set","callbackQueue","PromiseQueue","pause","after","task","isThenable","errorWaitUntilNotAvailable","catch","error","reportTaskError","addCallback","Error","callback","workUnitStore","workUnitAsyncStorage","getStore","add","afterTaskStore","afterTaskAsyncStorage","rootTaskSpawnPhase","phase","runCallbacksOnClosePromise","runCallbacksOnClose","wrappedCallback","bindSnapshot","run","Promise","resolve","runCallbacks","size","workStore","workAsyncStorage","InvariantError","withExecuteRevalidates","start","onIdle","taskKind","console","handlerError","cause"],"mappings":";;;;+BAoBaA;;;eAAAA;;;+DApBY;gCAGM;4BACJ;0CACM;mCACM;mCACV;8CAItB;+CAC+B;;;;;;AAQ/B,MAAMA;IASXC,YAAY,EAAEC,SAAS,EAAEC,OAAO,EAAEC,WAAW,EAAoB,CAAE;aAF3DC,iBAAiB,IAAIC;QAG3B,IAAI,CAACJ,SAAS,GAAGA;QACjB,IAAI,CAACC,OAAO,GAAGA;QACf,IAAI,CAACC,WAAW,GAAGA;QAEnB,IAAI,CAACG,aAAa,GAAG,IAAIC,eAAY;QACrC,IAAI,CAACD,aAAa,CAACE,KAAK;IAC1B;IAEOC,MAAMC,IAAe,EAAQ;QAClC,IAAIC,IAAAA,sBAAU,EAACD,OAAO;YACpB,IAAI,CAAC,IAAI,CAACT,SAAS,EAAE;gBACnBW;YACF;YACA,IAAI,CAACX,SAAS,CACZS,KAAKG,KAAK,CAAC,CAACC,QAAU,IAAI,CAACC,eAAe,CAAC,WAAWD;QAE1D,OAAO,IAAI,OAAOJ,SAAS,YAAY;YACrC,iCAAiC;YACjC,IAAI,CAACM,WAAW,CAACN;QACnB,OAAO;YACL,MAAM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EnC,KAAK,MAAMhB,iBAAiB,IAAI,CAACf,cAAc,CAAE;YAC/Ce,cAAcO,KAAK,GAAG;QACxB;QAEA,MAAMU,YAAYC,0CAAgB,CAAChB,QAAQ;QAC3C,IAAI,CAACe,WAAW;YACd,MAAM,qBAAoE,CAApE,IAAIE,8BAAc,CAAC,mDAAnB,qBAAA;uBAAA;4BAAA;8BAAA;YAAmE;QAC3E;QAEA,OAAOC,IAAAA,yCAAsB,EAACH,WAAW;YACvC,IAAI,CAAC9B,aAAa,CAACkC,KAAK;YACxB,OAAO,IAAI,CAAClC,aAAa,CAACmC,MAAM;QAClC;IACF;IAEQ1B,gBAAgB2B,QAAgC,EAAE5B,KAAc,EAAE;QACxE,iGAAiG;QACjG,qEAAqE;QACrE6B,QAAQ7B,KAAK,CACX4B,aAAa,YACT,CAAC,yCAAyC,CAAC,GAC3C,CAAC,sDAAsD,CAAC,EAC5D5B;QAEF,IAAI,IAAI,CAACX,WAAW,EAAE;YACpB,2FAA2F;YAC3F,IAAI;gBACF,IAAI,CAACA,WAAW,oBAAhB,IAAI,CAACA,WAAW,MAAhB,IAAI,EAAeW;YACrB,EAAE,OAAO8B,cAAc;gBACrBD,QAAQ7B,KAAK,CACX,qBAKC,CALD,IAAIwB,8BAAc,CAChB,2EACA;oBACEO,OAAOD;gBACT,IAJF,qBAAA;2BAAA;gCAAA;kCAAA;gBAKA;YAEJ;QACF;IACF;AACF;AAEA,SAAShC;IACP,MAAM,qBAEL,CAFK,IAAIK,MACR,wGADI,qBAAA;eAAA;oBAAA;sBAAA;IAEN;AACF","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/server/after/after-context.ts"],"sourcesContent":["import PromiseQueue from 'next/dist/compiled/p-queue'\nimport type { RequestLifecycleOpts } from '../base-server'\nimport type { AfterCallback, AfterTask } from './after'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { isThenable } from '../../shared/lib/is-thenable'\nimport { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { withExecuteRevalidates } from '../revalidation-utils'\nimport { bindSnapshot } from '../app-render/async-local-storage'\nimport type { WorkUnitStore } from '../app-render/work-unit-async-storage.external'\nimport { afterTaskAsyncStorage } from '../app-render/after-task-async-storage.external'\nimport { scheduleImmediate } from '../../lib/scheduler'\n\nexport type AfterContextOpts = {\n waitUntil: RequestLifecycleOpts['waitUntil'] | undefined\n onClose: RequestLifecycleOpts['onClose']\n onTaskError: RequestLifecycleOpts['onAfterTaskError'] | undefined\n}\n\nexport class AfterContext {\n private waitUntil: RequestLifecycleOpts['waitUntil'] | undefined\n private onClose: RequestLifecycleOpts['onClose']\n private onTaskError: RequestLifecycleOpts['onAfterTaskError'] | undefined\n\n private isRequestClosed: boolean = false\n private initialOnCloseError: null | { error: unknown } = null\n\n private runCallbacksOnClosePromise: Promise<void> | undefined\n private callbackQueue: PromiseQueue\n private workUnitStores = new Set<WorkUnitStore>()\n\n constructor({ waitUntil, onClose, onTaskError }: AfterContextOpts) {\n this.waitUntil = waitUntil\n this.onClose = onClose\n this.onTaskError = onTaskError\n\n this.callbackQueue = new PromiseQueue()\n this.callbackQueue.pause()\n\n try {\n onClose(() => {\n this.isRequestClosed = true\n\n // TODO(after): it's not ideal that we'll only switch the `phase` of a WorkUnitStore\n // if `after()` was called inside it. We should probably track this whenever a store is created\n for (const workUnitStore of this.workUnitStores) {\n workUnitStore.phase = 'after'\n }\n })\n } catch (err) {\n // If onClose is broken, report errors lazily, when after() is called.\n this.initialOnCloseError = { error: err }\n }\n }\n\n public after(task: AfterTask, workUnitStore: WorkUnitStore): void {\n if (this.initialOnCloseError) {\n throw new InvariantError(\n `An onClose call failed, which means after() can't work correctly.`,\n { cause: this.initialOnCloseError.error }\n )\n }\n\n // Save the workUnitStore so we can switch its phase later.\n this.workUnitStores.add(workUnitStore)\n\n if (isThenable(task)) {\n this.addThenable(task)\n } else if (typeof task === 'function') {\n // TODO(after): implement tracing\n this.addCallback(task, workUnitStore)\n } else {\n throw new Error('`after()`: Argument must be a promise or a function')\n }\n }\n\n private addThenable(thenable: PromiseLike<any>) {\n if (!this.waitUntil) {\n errorWaitUntilNotAvailable()\n }\n this.waitUntil(\n new Promise<void>((resolve) => {\n thenable.then(\n () => {\n resolve()\n },\n (error) => {\n resolve()\n this.reportTaskError('promise', error)\n }\n )\n })\n )\n }\n\n private addCallback(callback: AfterCallback, workUnitStore: WorkUnitStore) {\n // if something is wrong, throw synchronously, bubbling up to the `after` callsite.\n if (!this.waitUntil) {\n errorWaitUntilNotAvailable()\n }\n\n const afterTaskStore = afterTaskAsyncStorage.getStore()\n\n // This is used for checking if request APIs can be called inside `after`.\n // Note that we need to check the phase in which the *topmost* `after` was called (which should be \"action\"),\n // not the current phase (which might be \"after\" if we're in a nested after).\n // Otherwise, we might allow `after(() => headers())`, but not `after(() => after(() => headers()))`.\n const rootTaskSpawnPhase = afterTaskStore\n ? afterTaskStore.rootTaskSpawnPhase // nested after\n : workUnitStore.phase // topmost after\n\n // this should only happen once.\n if (!this.runCallbacksOnClosePromise) {\n this.runCallbacksOnClosePromise = this.runCallbacksOnClose()\n this.waitUntil(this.runCallbacksOnClosePromise)\n }\n\n // Bind the callback to the current execution context (i.e. preserve all currently available ALS-es).\n // We do this because we want all of these to be equivalent in every regard except timing:\n // after(() => x())\n // after(x())\n // await x()\n const wrappedCallback = bindSnapshot(\n // WARNING: Don't make this a named function. It must be anonymous.\n // See: https://github.com/facebook/react/pull/34911\n async () => {\n try {\n await afterTaskAsyncStorage.run({ rootTaskSpawnPhase }, () =>\n callback()\n )\n } catch (error) {\n this.reportTaskError('function', error)\n }\n }\n )\n\n this.callbackQueue.add(wrappedCallback)\n }\n\n private async runCallbacksOnClose() {\n if (!this.isRequestClosed) {\n await new Promise<void>((resolve) => this.onClose(resolve))\n } else {\n // The request is already closed.\n // Avoid running the callbacks too quickly to prevent userspace from\n // e.g. relying on `after` being microtasky somewhere.\n await new Promise<void>((resolve) => scheduleImmediate(resolve))\n }\n return this.runCallbacks()\n }\n\n private async runCallbacks(): Promise<void> {\n if (this.callbackQueue.size === 0) return\n\n const workStore = workAsyncStorage.getStore()\n if (!workStore) {\n throw new InvariantError('Missing workStore in AfterContext.runCallbacks')\n }\n\n return withExecuteRevalidates(workStore, () => {\n this.callbackQueue.start()\n return this.callbackQueue.onIdle()\n })\n }\n\n private reportTaskError(taskKind: 'promise' | 'function', error: unknown) {\n // TODO(after): this is fine for now, but will need better intergration with our error reporting.\n // TODO(after): should we log this if we have a onTaskError callback?\n console.error(\n taskKind === 'promise'\n ? `A promise passed to \\`after()\\` rejected:`\n : `An error occurred in a function passed to \\`after()\\`:`,\n error\n )\n if (this.onTaskError) {\n // this is very defensive, but we really don't want anything to blow up in an error handler\n try {\n this.onTaskError?.(error)\n } catch (handlerError) {\n console.error(\n new InvariantError(\n '`onTaskError` threw while handling an error thrown from an `after` task',\n {\n cause: handlerError,\n }\n )\n )\n }\n }\n }\n}\n\nfunction errorWaitUntilNotAvailable(): never {\n throw new Error(\n '`after()` will not work correctly, because `waitUntil` is not available in the current environment.'\n )\n}\n"],"names":["AfterContext","constructor","waitUntil","onClose","onTaskError","isRequestClosed","initialOnCloseError","workUnitStores","Set","callbackQueue","PromiseQueue","pause","workUnitStore","phase","err","error","after","task","InvariantError","cause","add","isThenable","addThenable","addCallback","Error","thenable","errorWaitUntilNotAvailable","Promise","resolve","then","reportTaskError","callback","afterTaskStore","afterTaskAsyncStorage","getStore","rootTaskSpawnPhase","runCallbacksOnClosePromise","runCallbacksOnClose","wrappedCallback","bindSnapshot","run","scheduleImmediate","runCallbacks","size","workStore","workAsyncStorage","withExecuteRevalidates","start","onIdle","taskKind","console","handlerError"],"mappings":";;;;+BAkBaA;;;eAAAA;;;+DAlBY;gCAGM;4BACJ;0CACM;mCACM;mCACV;+CAES;2BACJ;;;;;;AAQ3B,MAAMA;IAYXC,YAAY,EAAEC,SAAS,EAAEC,OAAO,EAAEC,WAAW,EAAoB,CAAE;aAP3DC,kBAA2B;aAC3BC,sBAAiD;aAIjDC,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C,aAAa,CAACkC,IAAI,KAAK,GAAG;QAEnC,MAAMC,YAAYC,0CAAgB,CAACX,QAAQ;QAC3C,IAAI,CAACU,WAAW;YACd,MAAM,qBAAoE,CAApE,IAAI1B,8BAAc,CAAC,mDAAnB,qBAAA;uBAAA;4BAAA;8BAAA;YAAmE;QAC3E;QAEA,OAAO4B,IAAAA,yCAAsB,EAACF,WAAW;YACvC,IAAI,CAACnC,aAAa,CAACsC,KAAK;YACxB,OAAO,IAAI,CAACtC,aAAa,CAACuC,MAAM;QAClC;IACF;IAEQlB,gBAAgBmB,QAAgC,EAAElC,KAAc,EAAE;QACxE,iGAAiG;QACjG,qEAAqE;QACrEmC,QAAQnC,KAAK,CACXkC,aAAa,YACT,CAAC,yCAAyC,CAAC,GAC3C,CAAC,sDAAsD,CAAC,EAC5DlC;QAEF,IAAI,IAAI,CAACX,WAAW,EAAE;YACpB,2FAA2F;YAC3F,IAAI;gBACF,IAAI,CAACA,WAAW,oBAAhB,IAAI,CAACA,WAAW,MAAhB,IAAI,EAAeW;YACrB,EAAE,OAAOoC,cAAc;gBACrBD,QAAQnC,KAAK,CACX,qBAKC,CALD,IAAIG,8BAAc,CAChB,2EACA;oBACEC,OAAOgC;gBACT,IAJF,qBAAA;2BAAA;gCAAA;kCAAA;gBAKA;YAEJ;QACF;IACF;AACF;AAEA,SAASzB;IACP,MAAM,qBAEL,CAFK,IAAIF,MACR,wGADI,qBAAA;eAAA;oBAAA;sBAAA;IAEN;AACF","ignoreList":[0]} |
@@ -12,5 +12,7 @@ "use strict"; | ||
| const _workasyncstorageexternal = require("../app-render/work-async-storage.external"); | ||
| const _workunitasyncstorageexternal = require("../app-render/work-unit-async-storage.external"); | ||
| function after(task) { | ||
| const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); | ||
| if (!workStore) { | ||
| const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); | ||
| if (!workStore || !workUnitStore) { | ||
| // TODO(after): the linked docs page talks about *dynamic* APIs, which after soon won't be anymore | ||
@@ -24,5 +26,5 @@ throw Object.defineProperty(new Error('`after` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context'), "__NEXT_ERROR_CODE", { | ||
| const { afterContext } = workStore; | ||
| return afterContext.after(task); | ||
| return afterContext.after(task, workUnitStore); | ||
| } | ||
| //# sourceMappingURL=after.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/server/after/after.ts"],"sourcesContent":["import { workAsyncStorage } from '../app-render/work-async-storage.external'\n\nexport type AfterTask<T = unknown> = Promise<T> | AfterCallback<T>\nexport type AfterCallback<T = unknown> = () => T | Promise<T>\n\n/**\n * This function allows you to schedule callbacks to be executed after the current request finishes.\n */\nexport function after<T>(task: AfterTask<T>): void {\n const workStore = workAsyncStorage.getStore()\n\n if (!workStore) {\n // TODO(after): the linked docs page talks about *dynamic* APIs, which after soon won't be anymore\n throw new Error(\n '`after` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context'\n )\n }\n\n const { afterContext } = workStore\n return afterContext.after(task)\n}\n"],"names":["after","task","workStore","workAsyncStorage","getStore","Error","afterContext"],"mappings":";;;;+BAQgBA;;;eAAAA;;;0CARiB;AAQ1B,SAASA,MAASC,IAAkB;IACzC,MAAMC,YAAYC,0CAAgB,CAACC,QAAQ;IAE3C,IAAI,CAACF,WAAW;QACd,kGAAkG;QAClG,MAAM,qBAEL,CAFK,IAAIG,MACR,2HADI,qBAAA;mBAAA;wBAAA;0BAAA;QAEN;IACF;IAEA,MAAM,EAAEC,YAAY,EAAE,GAAGJ;IACzB,OAAOI,aAAaN,KAAK,CAACC;AAC5B","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/server/after/after.ts"],"sourcesContent":["import { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'\n\nexport type AfterTask<T = unknown> = Promise<T> | AfterCallback<T>\nexport type AfterCallback<T = unknown> = () => T | Promise<T>\n\n/**\n * This function allows you to schedule callbacks to be executed after the current request finishes.\n */\nexport function after<T>(task: AfterTask<T>): void {\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (!workStore || !workUnitStore) {\n // TODO(after): the linked docs page talks about *dynamic* APIs, which after soon won't be anymore\n throw new Error(\n '`after` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context'\n )\n }\n\n const { afterContext } = workStore\n return afterContext.after(task, workUnitStore)\n}\n"],"names":["after","task","workStore","workAsyncStorage","getStore","workUnitStore","workUnitAsyncStorage","Error","afterContext"],"mappings":";;;;+BASgBA;;;eAAAA;;;0CATiB;8CACI;AAQ9B,SAASA,MAASC,IAAkB;IACzC,MAAMC,YAAYC,0CAAgB,CAACC,QAAQ;IAC3C,MAAMC,gBAAgBC,kDAAoB,CAACF,QAAQ;IAEnD,IAAI,CAACF,aAAa,CAACG,eAAe;QAChC,kGAAkG;QAClG,MAAM,qBAEL,CAFK,IAAIE,MACR,2HADI,qBAAA;mBAAA;wBAAA;0BAAA;QAEN;IACF;IAEA,MAAM,EAAEC,YAAY,EAAE,GAAGN;IACzB,OAAOM,aAAaR,KAAK,CAACC,MAAMI;AAClC","ignoreList":[0]} |
@@ -789,8 +789,8 @@ "use strict"; | ||
| type: 'done', | ||
| result: await generateFlight(req, ctx, requestStore, { | ||
| actionResult: Promise.resolve(actionResult), | ||
| skipPageRendering, | ||
| temporaryReferences, | ||
| waitUntil: maybeRevalidatesPromise === false ? undefined : maybeRevalidatesPromise | ||
| }) | ||
| result: await _actionasyncstorageexternal.actionAsyncStorage.exit(()=>generateFlight(req, ctx, requestStore, { | ||
| actionResult: Promise.resolve(actionResult), | ||
| skipPageRendering, | ||
| temporaryReferences, | ||
| waitUntil: maybeRevalidatesPromise === false ? undefined : maybeRevalidatesPromise | ||
| })) | ||
| }; | ||
@@ -797,0 +797,0 @@ } else { |
@@ -515,3 +515,3 @@ /** | ||
| })); | ||
| await shellReady.promise; | ||
| await (0, _tracer.getTracer)().trace(_constants1.AppRenderSpan.waitShellReady, ()=>shellReady.promise); | ||
| if (!deferPipe) { | ||
@@ -518,0 +518,0 @@ await (0, _scheduler.waitAtLeastOneReactRenderTask)(); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/server/app-render/stream-ops.node.ts"],"sourcesContent":["/**\n * Node.js stream operations for the rendering pipeline.\n * Loaded by stream-ops.ts when process.env.__NEXT_USE_NODE_STREAMS is true.\n *\n * AnyStream = AnyStreamType so the exported type surface matches stream-ops.web.ts,\n * allowing the switcher to assign either module without casts.\n * Rendering uses pipeable APIs; continue functions wrap the existing web\n * transforms via Readable.fromWeb() on their output.\n */\n\nimport type { PostponedState, PrerenderOptions } from 'react-dom/static'\nimport {\n renderToPipeableStream,\n resumeToPipeableStream,\n} from 'react-dom/server'\nimport { prerender } from 'react-dom/static'\nimport { PassThrough, Readable, Transform } from 'node:stream'\nimport { isUtf8 } from 'node:buffer'\n\nimport {\n continueStaticPrerender as webContinueStaticPrerender,\n continueDynamicPrerender as webContinueDynamicPrerender,\n continueStaticFallbackPrerender as webContinueStaticFallbackPrerender,\n continueDynamicHTMLResume as webContinueDynamicHTMLResume,\n streamToBuffer as webStreamToBuffer,\n streamToString as webStreamToString,\n createDocumentClosingStream as webCreateDocumentClosingStream,\n createRuntimePrefetchTransformStream,\n CLOSE_TAG,\n} from '../stream-utils/node-web-streams-helper'\nimport { indexOfUint8Array } from '../stream-utils/uint8array-helpers'\nimport { ENCODED_TAGS } from '../stream-utils/encoded-tags'\nimport { createNodeBufferedTransformStream } from '../stream-utils/node-buffered-transform-stream'\nimport { MISSING_ROOT_TAGS_ERROR } from '../../shared/lib/errors/constants'\nimport {\n htmlEscapeAttributeString,\n htmlEscapeJsonString,\n} from '../../shared/lib/htmlescape'\nimport { createInlinedDataReadableStream } from './use-flight-response'\nimport {\n ReplayableNodeStream,\n type AnyStream as AnyStreamType,\n} from './app-render-prerender-utils'\nimport { DetachedPromise } from '../../lib/detached-promise'\nimport { getTracer } from '../lib/trace/tracer'\nimport { AppRenderSpan } from '../lib/trace/constants'\nimport {\n atLeastOneTask,\n waitAtLeastOneReactRenderTask,\n} from '../../lib/scheduler'\n\n// ---------------------------------------------------------------------------\n// Re-export shared types from the web module\n// ---------------------------------------------------------------------------\n\nexport type {\n ContinueStreamSharedOptions,\n ContinueFizzStreamOptions,\n ContinueStaticPrerenderOptions,\n ContinueDynamicHTMLResumeOptions,\n ServerPrerenderComponentMod,\n FlightPayload,\n FlightClientModules,\n FlightRenderOptions,\n} from './stream-ops.web'\n\n// ---------------------------------------------------------------------------\n// AnyStream matches stream-ops.web.ts so both modules have the same type surface\n// ---------------------------------------------------------------------------\n\nexport type AnyStream = AnyStreamType\n\nexport type FlightComponentMod = {\n renderToReadableStream: (\n model: any,\n webpackMap: any,\n options?: any\n ) => ReadableStream<Uint8Array>\n renderToPipeableStream?: (\n model: any,\n webpackMap: any,\n options?: any\n ) => {\n pipe<Writable extends NodeJS.WritableStream>(\n destination: Writable\n ): Writable\n abort(reason?: unknown): void\n }\n}\n\nexport type FizzStreamResult = {\n stream: AnyStream\n allReady: Promise<void>\n abort?: (reason?: unknown) => void\n}\n\n// ---------------------------------------------------------------------------\n// Internal helpers\n// ---------------------------------------------------------------------------\n\ntype WebReadableStream = import('stream/web').ReadableStream\n\nfunction nodeReadableToWebReadableStream(\n stream: Readable | ReadableStream<Uint8Array>\n): ReadableStream<Uint8Array> {\n if (stream instanceof ReadableStream) {\n return stream\n }\n // Readable.toWeb returns stream/web ReadableStream which is structurally\n // identical to the global ReadableStream<Uint8Array>.\n return Readable.toWeb(stream) as unknown as ReadableStream<Uint8Array>\n}\n\nfunction webToReadable(\n stream: ReadableStream<Uint8Array> | Readable\n): Readable {\n if (stream instanceof Readable) {\n return stream\n }\n return Readable.fromWeb(stream as WebReadableStream)\n}\n\n// ---------------------------------------------------------------------------\n// Flight data injection – Node.js Transform that passes HTML chunks through\n// while pulling from a separate data stream and interleaving its chunks.\n// ---------------------------------------------------------------------------\n\nfunction createFlightDataInjectionTransform(\n dataStream: Readable,\n delayDataUntilFirstHtmlChunk: boolean\n): Transform {\n let htmlStreamFinished = false\n let pull: Promise<void> | null = null\n let donePulling = false\n\n function startOrContinuePulling(target: Transform) {\n if (!pull) {\n pull = startPulling(target)\n }\n return pull\n }\n\n async function startPulling(target: Transform) {\n if (delayDataUntilFirstHtmlChunk) {\n // Buffer the inlined data stream until we've left the current Task so\n // it's inserted after flushing the shell.\n await atLeastOneTask()\n }\n\n try {\n const iterator = dataStream[Symbol.asyncIterator]()\n while (true) {\n const { done, value } = await iterator.next()\n if (done) {\n donePulling = true\n return\n }\n\n // Prioritize HTML over RSC data: the SSR render produces HTML from\n // the same RSC stream, so yield a task to let HTML flush first.\n if (!delayDataUntilFirstHtmlChunk && !htmlStreamFinished) {\n await atLeastOneTask()\n }\n target.push(value)\n }\n } catch (err) {\n target.destroy(err as Error)\n }\n }\n\n const nodeTransform = new Transform({\n transform(chunk, _encoding, callback) {\n this.push(chunk)\n if (delayDataUntilFirstHtmlChunk) {\n startOrContinuePulling(this)\n }\n callback()\n },\n flush(callback) {\n htmlStreamFinished = true\n if (donePulling) {\n callback()\n return\n }\n startOrContinuePulling(this).then(\n () => callback(),\n (err) => callback(err as Error)\n )\n },\n })\n\n if (!delayDataUntilFirstHtmlChunk) {\n startOrContinuePulling(nodeTransform)\n }\n\n return nodeTransform\n}\n\n// ---------------------------------------------------------------------------\n// Head insertion – Node.js Transform that inserts server-generated HTML\n// (e.g. <script>, <style>) right before </head>, or prepends it if no\n// </head> tag is found (PPR resume case).\n// ---------------------------------------------------------------------------\n\nfunction createHeadInsertionTransform(\n insert: () => Promise<string>\n): Transform {\n let inserted = false\n let hasBytes = false\n\n return new Transform({\n async transform(chunk, _encoding, callback) {\n hasBytes = true\n\n try {\n const insertion = await insert()\n if (inserted) {\n if (insertion) {\n this.push(Buffer.from(insertion))\n }\n this.push(chunk)\n } else {\n const index = indexOfUint8Array(chunk, ENCODED_TAGS.CLOSED.HEAD)\n if (index !== -1) {\n if (insertion) {\n const encodedInsertion = Buffer.from(insertion)\n const merged = Buffer.allocUnsafe(\n chunk.length + encodedInsertion.length\n )\n merged.set(chunk.slice(0, index))\n merged.set(encodedInsertion, index)\n merged.set(chunk.slice(index), index + encodedInsertion.length)\n this.push(merged)\n } else {\n this.push(chunk)\n }\n inserted = true\n } else {\n if (insertion) {\n this.push(Buffer.from(insertion))\n }\n this.push(chunk)\n inserted = true\n }\n }\n callback()\n } catch (err) {\n callback(err as Error)\n }\n },\n async flush(callback) {\n try {\n if (hasBytes) {\n const insertion = await insert()\n if (insertion) {\n this.push(Buffer.from(insertion))\n }\n }\n callback()\n } catch (err) {\n callback(err as Error)\n }\n },\n })\n}\n\n// ---------------------------------------------------------------------------\n// Metadata transform – Node.js Transform that finds the «nxt-icon» meta mark\n// and replaces it with a script tag (or removes it if inside <head>).\n// ---------------------------------------------------------------------------\n\nfunction createMetadataTransform(\n insert: () => Promise<string> | string\n): Transform {\n let chunkIndex = -1\n let isMarkRemoved = false\n\n return new Transform({\n async transform(chunk, _encoding, callback) {\n let iconMarkIndex = -1\n let closedHeadIndex = -1\n chunkIndex++\n\n if (isMarkRemoved) {\n this.push(chunk)\n callback()\n return\n }\n\n try {\n let iconMarkLength = 0\n iconMarkIndex = indexOfUint8Array(chunk, ENCODED_TAGS.META.ICON_MARK)\n if (iconMarkIndex === -1) {\n this.push(chunk)\n callback()\n return\n }\n\n iconMarkLength = ENCODED_TAGS.META.ICON_MARK.length\n if (chunk[iconMarkIndex + iconMarkLength] === 47) {\n iconMarkLength += 2\n } else {\n iconMarkLength++\n }\n\n if (chunkIndex === 0) {\n closedHeadIndex = indexOfUint8Array(chunk, ENCODED_TAGS.CLOSED.HEAD)\n if (iconMarkIndex < closedHeadIndex) {\n const replaced = Buffer.allocUnsafe(chunk.length - iconMarkLength)\n replaced.set(chunk.subarray(0, iconMarkIndex))\n replaced.set(\n chunk.subarray(iconMarkIndex + iconMarkLength),\n iconMarkIndex\n )\n chunk = replaced\n } else {\n const insertion = await insert()\n const encodedInsertion = Buffer.from(insertion)\n const insertionLength = encodedInsertion.length\n const replaced = Buffer.allocUnsafe(\n chunk.length - iconMarkLength + insertionLength\n )\n replaced.set(chunk.subarray(0, iconMarkIndex))\n replaced.set(encodedInsertion, iconMarkIndex)\n replaced.set(\n chunk.subarray(iconMarkIndex + iconMarkLength),\n iconMarkIndex + insertionLength\n )\n chunk = replaced\n }\n isMarkRemoved = true\n } else {\n const insertion = await insert()\n const encodedInsertion = Buffer.from(insertion)\n const insertionLength = encodedInsertion.length\n const replaced = Buffer.allocUnsafe(\n chunk.length - iconMarkLength + insertionLength\n )\n replaced.set(chunk.subarray(0, iconMarkIndex))\n replaced.set(encodedInsertion, iconMarkIndex)\n replaced.set(\n chunk.subarray(iconMarkIndex + iconMarkLength),\n iconMarkIndex + insertionLength\n )\n chunk = replaced\n isMarkRemoved = true\n }\n this.push(chunk)\n callback()\n } catch (err) {\n callback(err as Error)\n }\n },\n })\n}\n\n// ---------------------------------------------------------------------------\n// Deferred suffix – Node.js Transform that appends a suffix string after the\n// first HTML chunk, deferring via queueMicrotask so the chunk flushes first.\n// ---------------------------------------------------------------------------\n\nfunction createDeferredSuffixTransform(suffix: string): Transform {\n let flushed = false\n const encodedSuffix = Buffer.from(suffix)\n\n return new Transform({\n transform(chunk, _encoding, callback) {\n this.push(chunk)\n\n if (!flushed) {\n flushed = true\n queueMicrotask(() => {\n this.push(encodedSuffix)\n })\n }\n callback()\n },\n flush(callback) {\n if (!flushed) {\n this.push(encodedSuffix)\n }\n callback()\n },\n })\n}\n\n// ---------------------------------------------------------------------------\n// Move suffix – Node.js Transform that strips </body></html> from its\n// original position and re-appends it at the very end of the stream, so any\n// content injected after the suffix still appears before the closing tags.\n// ---------------------------------------------------------------------------\n\nfunction createMoveSuffixTransform(): Transform {\n let foundSuffix = false\n\n return new Transform({\n transform(chunk, _encoding, callback) {\n if (foundSuffix) {\n this.push(chunk)\n callback()\n return\n }\n\n const index = indexOfUint8Array(chunk, ENCODED_TAGS.CLOSED.BODY_AND_HTML)\n if (index > -1) {\n foundSuffix = true\n\n if (chunk.length === ENCODED_TAGS.CLOSED.BODY_AND_HTML.length) {\n callback()\n return\n }\n\n const before = chunk.slice(0, index)\n this.push(before)\n\n if (chunk.length > ENCODED_TAGS.CLOSED.BODY_AND_HTML.length + index) {\n const after = chunk.slice(\n index + ENCODED_TAGS.CLOSED.BODY_AND_HTML.length\n )\n this.push(after)\n }\n } else {\n this.push(chunk)\n }\n callback()\n },\n flush(callback) {\n this.push(ENCODED_TAGS.CLOSED.BODY_AND_HTML)\n callback()\n },\n })\n}\n\n// ---------------------------------------------------------------------------\n// data-dpl-id insertion – Node.js Transform that inserts a `data-dpl-id`\n// attribute on the opening <html tag for deployment identification.\n// ---------------------------------------------------------------------------\n\nfunction createHtmlDataDplIdTransform(dplId: string): Transform {\n let didTransform = false\n\n return new Transform({\n transform(chunk, _encoding, callback) {\n if (didTransform) {\n this.push(chunk)\n callback()\n return\n }\n\n const htmlTagIndex = indexOfUint8Array(chunk, ENCODED_TAGS.OPENING.HTML)\n if (htmlTagIndex === -1) {\n this.push(chunk)\n callback()\n return\n }\n\n const insertionPoint = htmlTagIndex + ENCODED_TAGS.OPENING.HTML.length\n const encodedAttribute = Buffer.from(` data-dpl-id=\"${dplId}\"`)\n const modified = Buffer.allocUnsafe(\n chunk.length + encodedAttribute.length\n )\n\n modified.set(chunk.subarray(0, insertionPoint))\n modified.set(encodedAttribute, insertionPoint)\n modified.set(\n chunk.subarray(insertionPoint),\n insertionPoint + encodedAttribute.length\n )\n\n this.push(modified)\n didTransform = true\n callback()\n },\n })\n}\n\n// ---------------------------------------------------------------------------\n// Root layout validator – Node.js Transform that checks whether <html> and\n// <body> tags are present in the streamed output. Dev-only; appends an\n// error template when tags are missing so the error overlay can display it.\n// ---------------------------------------------------------------------------\n\nfunction createRootLayoutValidatorTransform(): Transform {\n let foundHtml = false\n let foundBody = false\n\n return new Transform({\n transform(chunk, _encoding, callback) {\n if (\n !foundHtml &&\n indexOfUint8Array(chunk, ENCODED_TAGS.OPENING.HTML) > -1\n ) {\n foundHtml = true\n }\n if (\n !foundBody &&\n indexOfUint8Array(chunk, ENCODED_TAGS.OPENING.BODY) > -1\n ) {\n foundBody = true\n }\n this.push(chunk)\n callback()\n },\n flush(callback) {\n const missingTags: ('html' | 'body')[] = []\n if (!foundHtml) missingTags.push('html')\n if (!foundBody) missingTags.push('body')\n\n if (missingTags.length) {\n this.push(\n Buffer.from(\n `<html id=\"__next_error__\">\n <template\n data-next-error-message=\"Missing ${missingTags\n .map((c) => `<${c}>`)\n .join(\n missingTags.length > 1 ? ' and ' : ''\n )} tags in the root layout.\\nRead more at https://nextjs.org/docs/messages/missing-root-layout-tags\"\n data-next-error-digest=\"${MISSING_ROOT_TAGS_ERROR}\"\n data-next-error-stack=\"\"\n ></template>\n `\n )\n )\n }\n callback()\n },\n })\n}\n\n// ---------------------------------------------------------------------------\n// Rendering functions (output Node Readable natively via PassThrough)\n// ---------------------------------------------------------------------------\n\nexport { renderToWebFlightStream } from './stream-ops.web'\n\nexport function renderToNodeFlightStream(\n ComponentMod: FlightComponentMod,\n payload: any,\n clientModules: any,\n opts: any\n): AnyStream {\n if (!ComponentMod.renderToPipeableStream) {\n throw new Error('renderToPipeableStream is not implemented')\n }\n\n const pt = new PassThrough()\n const pipeable = ComponentMod.renderToPipeableStream!(\n payload,\n clientModules,\n opts\n )\n pipeable.pipe(pt)\n return pt\n}\n\nexport { renderToWebFizzStream } from './stream-ops.web'\n\nexport async function renderToNodeFizzStream(\n element: React.ReactElement,\n streamOptions: any,\n options?: { waitForAllReady?: boolean }\n): Promise<FizzStreamResult> {\n const pt = new PassThrough()\n const shellReady = new DetachedPromise<void>()\n const allReady = new DetachedPromise<void>()\n const deferPipe = options?.waitForAllReady === true\n\n const pipeable = getTracer().trace(AppRenderSpan.renderToReadableStream, () =>\n renderToPipeableStream(element, {\n ...streamOptions,\n onHeaders: streamOptions?.onHeaders,\n onShellReady() {\n streamOptions?.onShellReady?.()\n shellReady.resolve()\n },\n onShellError(error: unknown) {\n streamOptions?.onShellError?.(error)\n shellReady.reject(error)\n },\n onAllReady() {\n streamOptions?.onAllReady?.()\n if (deferPipe) {\n pipeable.pipe(pt)\n }\n allReady.resolve()\n },\n onError: streamOptions?.onError,\n })\n )\n\n await shellReady.promise\n\n if (!deferPipe) {\n await waitAtLeastOneReactRenderTask()\n pipeable.pipe(pt)\n }\n\n return {\n stream: pt,\n allReady: allReady.promise,\n abort: (reason?: unknown) => pipeable.abort(reason),\n }\n}\n\nexport async function resumeToFizzStream(\n element: React.ReactElement,\n postponedState: PostponedState,\n streamOptions: any,\n runInContext?: <T>(fn: () => T) => T\n): Promise<FizzStreamResult> {\n const run: <T>(fn: () => T) => T = runInContext ?? ((fn) => fn())\n\n const pt = new PassThrough()\n const shellReady = new DetachedPromise<void>()\n const allReady = new DetachedPromise<void>()\n\n const pipeable = await run(() =>\n resumeToPipeableStream(element, postponedState, {\n ...streamOptions,\n onShellReady() {\n streamOptions?.onShellReady?.()\n shellReady.resolve()\n },\n onShellError(error: unknown) {\n streamOptions?.onShellError?.(error)\n shellReady.reject(error)\n },\n onAllReady() {\n streamOptions?.onAllReady?.()\n allReady.resolve()\n },\n })\n )\n\n pipeable.pipe(pt)\n await shellReady.promise\n\n return {\n stream: pt,\n allReady: allReady.promise,\n abort: (reason?: unknown) => pipeable.abort(reason),\n }\n}\n\nexport async function resumeAndAbort(\n element: React.ReactElement,\n postponed: PostponedState | null,\n opts: any\n): Promise<AnyStream> {\n const pt = new PassThrough()\n const pipeable = await resumeToPipeableStream(\n element,\n postponed as PostponedState,\n opts\n )\n pipeable.pipe(pt)\n pipeable.abort(opts?.signal?.reason)\n return pt\n}\n\n// ---------------------------------------------------------------------------\n// Continue function wrappers\n// Bridge Node Readable → web, apply existing web transforms, Readable.fromWeb()\n// ---------------------------------------------------------------------------\n\nexport async function continueFizzStream(\n renderStream: AnyStream,\n {\n suffix,\n inlinedDataStream,\n isStaticGeneration,\n allReady,\n deploymentId,\n getServerInsertedHTML,\n getServerInsertedMetadata,\n validateRootLayout,\n }: import('./stream-ops.web').ContinueFizzStreamOptions\n): Promise<Readable> {\n // Suffix itself might contain close tags at the end, so we need to split it.\n const suffixUnclosed = suffix ? suffix.split(CLOSE_TAG, 1)[0] : null\n\n if (isStaticGeneration) {\n if (allReady) {\n await allReady\n }\n } else {\n // Otherwise, we want to make sure Fizz is done with all microtasky work\n // before we start pulling the stream and cause a flush.\n await waitAtLeastOneReactRenderTask()\n }\n\n // Pipe the render stream through Node.js Transforms:\n // 1. Buffer – coalesces chunks written in the same microtask into one Uint8Array\n // 2. Flight data injection – interleaves RSC data chunks with the HTML stream\n // 3. Head insertion – inserts server-generated HTML before </head>\n const buffered = createNodeBufferedTransformStream()\n webToReadable(renderStream).pipe(buffered)\n\n let source: Readable = buffered\n\n if (deploymentId) {\n const dplId = createHtmlDataDplIdTransform(deploymentId)\n source.pipe(dplId)\n source = dplId\n }\n\n // Metadata (icon mark replacement)\n const metadata = createMetadataTransform(getServerInsertedMetadata)\n source.pipe(metadata)\n source = metadata\n\n // Insert suffix content\n if (suffixUnclosed != null && suffixUnclosed.length > 0) {\n const deferredSuffix = createDeferredSuffixTransform(suffixUnclosed)\n source.pipe(deferredSuffix)\n source = deferredSuffix\n }\n\n // Flight data injection – interleaves RSC data chunks with the HTML stream\n if (inlinedDataStream) {\n const flightInjection = createFlightDataInjectionTransform(\n webToReadable(inlinedDataStream),\n true\n )\n source.pipe(flightInjection)\n source = flightInjection\n }\n\n if (validateRootLayout) {\n const rootLayoutValidator = createRootLayoutValidatorTransform()\n source.pipe(rootLayoutValidator)\n source = rootLayoutValidator\n }\n\n // Close tags should always be deferred to the end\n const moveSuffix = createMoveSuffixTransform()\n source.pipe(moveSuffix)\n source = moveSuffix\n\n // Head insertion – inserts server-generated HTML before </head>\n const headInsertion = createHeadInsertionTransform(getServerInsertedHTML)\n source.pipe(headInsertion)\n source = headInsertion\n\n return source\n}\n\nexport async function continueStaticPrerender(\n prerenderStream: AnyStream,\n opts: import('./stream-ops.web').ContinueStaticPrerenderOptions\n): Promise<AnyStream> {\n const webResult = await webContinueStaticPrerender(\n nodeReadableToWebReadableStream(prerenderStream),\n {\n ...opts,\n inlinedDataStream: nodeReadableToWebReadableStream(\n opts.inlinedDataStream\n ),\n }\n )\n return webToReadable(webResult)\n}\n\nexport async function continueDynamicPrerender(\n prerenderStream: AnyStream,\n opts: {\n getServerInsertedHTML: () => Promise<string>\n getServerInsertedMetadata: () => Promise<string>\n deploymentId: string | undefined\n }\n): Promise<AnyStream> {\n const webResult = await webContinueDynamicPrerender(\n nodeReadableToWebReadableStream(prerenderStream),\n opts\n )\n return webToReadable(webResult)\n}\n\nexport async function continueStaticFallbackPrerender(\n prerenderStream: AnyStream,\n opts: import('./stream-ops.web').ContinueStaticPrerenderOptions\n): Promise<AnyStream> {\n const webResult = await webContinueStaticFallbackPrerender(\n nodeReadableToWebReadableStream(prerenderStream),\n {\n ...opts,\n inlinedDataStream: nodeReadableToWebReadableStream(\n opts.inlinedDataStream\n ),\n }\n )\n return webToReadable(webResult)\n}\n\nexport async function continueDynamicHTMLResumeNode(\n renderStream: AnyStream,\n {\n delayDataUntilFirstHtmlChunk,\n inlinedDataStream,\n getServerInsertedHTML,\n getServerInsertedMetadata,\n deploymentId,\n }: import('./stream-ops.web').ContinueDynamicHTMLResumeOptions\n): Promise<AnyStream> {\n await waitAtLeastOneReactRenderTask()\n\n const buffered = createNodeBufferedTransformStream()\n webToReadable(renderStream).pipe(buffered)\n\n let source: Readable = buffered\n\n if (deploymentId) {\n const dplId = createHtmlDataDplIdTransform(deploymentId)\n source.pipe(dplId)\n source = dplId\n }\n\n const headInsertion = createHeadInsertionTransform(getServerInsertedHTML)\n source.pipe(headInsertion)\n source = headInsertion\n\n const metadata = createMetadataTransform(getServerInsertedMetadata)\n source.pipe(metadata)\n source = metadata\n\n const flightInjection = createFlightDataInjectionTransform(\n webToReadable(inlinedDataStream),\n delayDataUntilFirstHtmlChunk\n )\n source.pipe(flightInjection)\n source = flightInjection\n\n const moveSuffix = createMoveSuffixTransform()\n source.pipe(moveSuffix)\n source = moveSuffix\n\n return source\n}\n\nexport async function continueDynamicHTMLResumeWeb(\n renderStream: AnyStream,\n opts: import('./stream-ops.web').ContinueDynamicHTMLResumeOptions\n): Promise<AnyStream> {\n const webResult = await webContinueDynamicHTMLResume(\n nodeReadableToWebReadableStream(renderStream),\n {\n ...opts,\n inlinedDataStream: nodeReadableToWebReadableStream(\n opts.inlinedDataStream\n ),\n }\n )\n return webToReadable(webResult)\n}\n\n// ---------------------------------------------------------------------------\n// Utility functions (Node-native)\n// ---------------------------------------------------------------------------\n\nexport function chainStreams(...streams: AnyStream[]): AnyStream {\n if (streams.length === 0) {\n const pt = new PassThrough()\n pt.end()\n return pt\n }\n\n if (streams.length === 1) {\n return streams[0]\n }\n\n const out = new PassThrough()\n let i = 0\n\n function pipeNext() {\n if (i >= streams.length) {\n out.end()\n return\n }\n const current = webToReadable(streams[i++])\n current.pipe(out, { end: false })\n current.on('end', pipeNext)\n current.on('error', (err) => out.destroy(err))\n }\n\n pipeNext()\n return out\n}\n\nexport async function streamToBuffer(stream: AnyStream): Promise<Buffer> {\n return webStreamToBuffer(nodeReadableToWebReadableStream(stream))\n}\n\nexport async function streamToString(stream: AnyStream): Promise<string> {\n return webStreamToString(nodeReadableToWebReadableStream(stream))\n}\n\nexport function createWebInlinedDataStream(\n source: AnyStream,\n nonce: string | undefined,\n formState: unknown | null\n): AnyStream {\n const webSource = nodeReadableToWebReadableStream(source)\n const webResult = createInlinedDataReadableStream(webSource, nonce, formState)\n return webToReadable(webResult)\n}\n\nexport function createNodeInlinedDataStream(\n source: AnyStream,\n nonce: string | undefined,\n formState: unknown | null\n): AnyStream {\n const startScriptTag = nonce\n ? `<script nonce=\"${htmlEscapeAttributeString(nonce)}\">`\n : '<script>'\n\n const dataStream = webToReadable(source)\n const pt = new PassThrough()\n\n // Write initial bootstrap instructions\n let scriptContents = `(self.__next_f=self.__next_f||[]).push(${htmlEscapeJsonString(\n JSON.stringify([INLINE_FLIGHT_PAYLOAD_BOOTSTRAP])\n )})`\n if (formState != null) {\n scriptContents += `;self.__next_f.push(${htmlEscapeJsonString(\n JSON.stringify([INLINE_FLIGHT_PAYLOAD_FORM_STATE, formState])\n )})`\n }\n pt.push(Buffer.from(`${startScriptTag}${scriptContents}</script>`))\n\n // Pull from the flight data stream and wrap each chunk in a <script> tag\n pullFlightData(dataStream, pt, startScriptTag)\n\n return pt\n}\n\nconst INLINE_FLIGHT_PAYLOAD_BOOTSTRAP = 0\nconst INLINE_FLIGHT_PAYLOAD_DATA = 1\nconst INLINE_FLIGHT_PAYLOAD_FORM_STATE = 2\nconst INLINE_FLIGHT_PAYLOAD_BINARY = 3\n\nasync function pullFlightData(\n dataStream: Readable,\n output: PassThrough,\n startScriptTag: string\n): Promise<void> {\n function waitForReadableOrEnd(): Promise<void> {\n if (dataStream.readableLength > 0 || dataStream.readableEnded) {\n return Promise.resolve()\n }\n return new Promise<void>((resolve, reject) => {\n function cleanup() {\n dataStream.removeListener('readable', onDone)\n dataStream.removeListener('end', onDone)\n dataStream.removeListener('error', onError)\n }\n function onDone() {\n cleanup()\n resolve()\n }\n function onError(err: Error) {\n cleanup()\n reject(err)\n }\n dataStream.on('readable', onDone)\n dataStream.on('end', onDone)\n dataStream.on('error', onError)\n })\n }\n\n try {\n while (true) {\n const chunk: Buffer | null = dataStream.read()\n if (chunk !== null) {\n let htmlInlinedData: string\n if (isUtf8(chunk)) {\n const decodedString = chunk.toString('utf-8')\n htmlInlinedData = htmlEscapeJsonString(\n JSON.stringify([INLINE_FLIGHT_PAYLOAD_DATA, decodedString])\n )\n } else {\n const base64 = Buffer.from(\n chunk.buffer,\n chunk.byteOffset,\n chunk.byteLength\n ).toString('base64')\n htmlInlinedData = htmlEscapeJsonString(\n JSON.stringify([INLINE_FLIGHT_PAYLOAD_BINARY, base64])\n )\n }\n output.push(\n Buffer.from(\n `${startScriptTag}self.__next_f.push(${htmlInlinedData})</script>`\n )\n )\n continue\n }\n\n if (dataStream.readableEnded) {\n output.end()\n return\n }\n\n await waitForReadableOrEnd()\n }\n } catch (err) {\n output.destroy(err as Error)\n }\n}\n\nexport function createPendingStream(): AnyStream {\n return new PassThrough()\n}\n\nexport function createDocumentClosingStream(): AnyStream {\n const webStream = webCreateDocumentClosingStream()\n return webToReadable(webStream)\n}\n\nexport function createOnHeadersCallback(\n appendHeader: (key: string, value: string) => void\n): NonNullable<PrerenderOptions['onHeaders']> {\n return (headers: Headers) => {\n headers.forEach((value, key) => {\n appendHeader(key, value)\n })\n }\n}\n\nexport function pipeRuntimePrefetchTransform(\n stream: AnyStream,\n sentinel: number,\n isPartial: boolean,\n staleTime: number\n): AnyStream {\n const webStream = nodeReadableToWebReadableStream(stream)\n const transformed = webStream.pipeThrough(\n createRuntimePrefetchTransformStream(sentinel, isPartial, staleTime)\n )\n return webToReadable(transformed)\n}\n\n// ---------------------------------------------------------------------------\n// Re-exports (no stream involvement, identical to web)\n// ---------------------------------------------------------------------------\n\nexport async function processPrelude(unprocessedPrelude: AnyStream) {\n const [prelude, peek] =\n nodeReadableToWebReadableStream(unprocessedPrelude).tee()\n\n const reader = peek.getReader()\n const firstResult = await reader.read()\n reader.cancel()\n\n return {\n prelude: webToReadable(prelude) as AnyStream,\n preludeIsEmpty: firstResult.done === true,\n }\n}\n\nexport function getServerPrerender(ComponentMod: {\n prerender: (...args: any[]) => Promise<any>\n}): (...args: any[]) => any {\n return ComponentMod.prerender\n}\n\nexport const getClientPrerender: typeof import('react-dom/static').prerender =\n prerender\n\n// Node counterpart of the web `teeStream`. Like the web version it assumes the\n// stream type matching its build — here a Node `Readable` — and fans out\n// through `ReplayableNodeStream`. Need three or more consumers from one source?\n// Use `ReplayableNodeStream` directly (N `createReplayStream()` calls) to avoid\n// nesting tees.\nexport function teeStream(stream: AnyStream): [AnyStream, AnyStream] {\n const replayable = new ReplayableNodeStream(stream as Readable)\n return [replayable.createReplayStream(), replayable.createReplayStream()]\n}\n"],"names":["chainStreams","continueDynamicHTMLResumeNode","continueDynamicHTMLResumeWeb","continueDynamicPrerender","continueFizzStream","continueStaticFallbackPrerender","continueStaticPrerender","createDocumentClosingStream","createNodeInlinedDataStream","createOnHeadersCallback","createPendingStream","createWebInlinedDataStream","getClientPrerender","getServerPrerender","pipeRuntimePrefetchTransform","processPrelude","renderToNodeFizzStream","renderToNodeFlightStream","renderToWebFizzStream","renderToWebFlightStream","resumeAndAbort","resumeToFizzStream","streamToBuffer","streamToString","teeStream","nodeReadableToWebReadableStream","stream","ReadableStream","Readable","toWeb","webToReadable","fromWeb","createFlightDataInjectionTransform","dataStream","delayDataUntilFirstHtmlChunk","htmlStreamFinished","pull","donePulling","startOrContinuePulling","target","startPulling","atLeastOneTask","iterator","Symbol","asyncIterator","done","value","next","push","err","destroy","nodeTransform","Transform","transform","chunk","_encoding","callback","flush","then","createHeadInsertionTransform","insert","inserted","hasBytes","insertion","Buffer","from","index","indexOfUint8Array","ENCODED_TAGS","CLOSED","HEAD","encodedInsertion","merged","allocUnsafe","length","set","slice","createMetadataTransform","chunkIndex","isMarkRemoved","iconMarkIndex","closedHeadIndex","iconMarkLength","META","ICON_MARK","replaced","subarray","insertionLength","createDeferredSuffixTransform","suffix","flushed","encodedSuffix","queueMicrotask","createMoveSuffixTransform","foundSuffix","BODY_AND_HTML","before","after","createHtmlDataDplIdTransform","dplId","didTransform","htmlTagIndex","OPENING","HTML","insertionPoint","encodedAttribute","modified","createRootLayoutValidatorTransform","foundHtml","foundBody","BODY","missingTags","map","c","join","MISSING_ROOT_TAGS_ERROR","ComponentMod","payload","clientModules","opts","renderToPipeableStream","Error","pt","PassThrough","pipeable","pipe","element","streamOptions","options","shellReady","DetachedPromise","allReady","deferPipe","waitForAllReady","getTracer","trace","AppRenderSpan","renderToReadableStream","onHeaders","onShellReady","resolve","onShellError","error","reject","onAllReady","onError","promise","waitAtLeastOneReactRenderTask","abort","reason","postponedState","runInContext","run","fn","resumeToPipeableStream","postponed","signal","renderStream","inlinedDataStream","isStaticGeneration","deploymentId","getServerInsertedHTML","getServerInsertedMetadata","validateRootLayout","suffixUnclosed","split","CLOSE_TAG","buffered","createNodeBufferedTransformStream","source","metadata","deferredSuffix","flightInjection","rootLayoutValidator","moveSuffix","headInsertion","prerenderStream","webResult","webContinueStaticPrerender","webContinueDynamicPrerender","webContinueStaticFallbackPrerender","webContinueDynamicHTMLResume","streams","end","out","i","pipeNext","current","on","webStreamToBuffer","webStreamToString","nonce","formState","webSource","createInlinedDataReadableStream","startScriptTag","htmlEscapeAttributeString","scriptContents","htmlEscapeJsonString","JSON","stringify","INLINE_FLIGHT_PAYLOAD_BOOTSTRAP","INLINE_FLIGHT_PAYLOAD_FORM_STATE","pullFlightData","INLINE_FLIGHT_PAYLOAD_DATA","INLINE_FLIGHT_PAYLOAD_BINARY","output","waitForReadableOrEnd","readableLength","readableEnded","Promise","cleanup","removeListener","onDone","read","htmlInlinedData","isUtf8","decodedString","toString","base64","buffer","byteOffset","byteLength","webStream","webCreateDocumentClosingStream","appendHeader","headers","forEach","key","sentinel","isPartial","staleTime","transformed","pipeThrough","createRuntimePrefetchTransformStream","unprocessedPrelude","prelude","peek","tee","reader","getReader","firstResult","cancel","preludeIsEmpty","prerender","replayable","ReplayableNodeStream","createReplayStream"],"mappings":"AAAA;;;;;;;;CAQC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAo1BeA,YAAY;eAAZA;;IAjEMC,6BAA6B;eAA7BA;;IA6CAC,4BAA4B;eAA5BA;;IA5EAC,wBAAwB;eAAxBA;;IAlGAC,kBAAkB;eAAlBA;;IAiHAC,+BAA+B;eAA/BA;;IA/BAC,uBAAuB;eAAvBA;;IA0QNC,2BAA2B;eAA3BA;;IA3GAC,2BAA2B;eAA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AOlM,cAAciM;AACvB;AAEO,SAAStN,wBACdwN,YAAkD;IAElD,OAAO,CAACC;QACNA,QAAQC,OAAO,CAAC,CAACrL,OAAOsL;YACtBH,aAAaG,KAAKtL;QACpB;IACF;AACF;AAEO,SAAShC,6BACdY,MAAiB,EACjB2M,QAAgB,EAChBC,SAAkB,EAClBC,SAAiB;IAEjB,MAAMR,YAAYtM,gCAAgCC;IAClD,MAAM8M,cAAcT,UAAUU,WAAW,CACvCC,IAAAA,0DAAoC,EAACL,UAAUC,WAAWC;IAE5D,OAAOzM,cAAc0M;AACvB;AAMO,eAAezN,eAAe4N,kBAA6B;IAChE,MAAM,CAACC,SAASC,KAAK,GACnBpN,gCAAgCkN,oBAAoBG,GAAG;IAEzD,MAAMC,SAASF,KAAKG,SAAS;IAC7B,MAAMC,cAAc,MAAMF,OAAOzB,IAAI;IACrCyB,OAAOG,MAAM;IAEb,OAAO;QACLN,SAAS9M,cAAc8M;QACvBO,gBAAgBF,YAAYpM,IAAI,KAAK;IACvC;AACF;AAEO,SAAShC,mBAAmBuG,YAElC;IACC,OAAOA,aAAagI,SAAS;AAC/B;AAEO,MAAMxO,qBACXwO,iBAAS;AAOJ,SAAS5N,UAAUE,MAAiB;IACzC,MAAM2N,aAAa,IAAIC,6CAAoB,CAAC5N;IAC5C,OAAO;QAAC2N,WAAWE,kBAAkB;QAAIF,WAAWE,kBAAkB;KAAG;AAC3E","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/server/app-render/stream-ops.node.ts"],"sourcesContent":["/**\n * Node.js stream operations for the rendering pipeline.\n * Loaded by stream-ops.ts when process.env.__NEXT_USE_NODE_STREAMS is true.\n *\n * AnyStream = AnyStreamType so the exported type surface matches stream-ops.web.ts,\n * allowing the switcher to assign either module without casts.\n * Rendering uses pipeable APIs; continue functions wrap the existing web\n * transforms via Readable.fromWeb() on their output.\n */\n\nimport type { PostponedState, PrerenderOptions } from 'react-dom/static'\nimport {\n renderToPipeableStream,\n resumeToPipeableStream,\n} from 'react-dom/server'\nimport { prerender } from 'react-dom/static'\nimport { PassThrough, Readable, Transform } from 'node:stream'\nimport { isUtf8 } from 'node:buffer'\n\nimport {\n continueStaticPrerender as webContinueStaticPrerender,\n continueDynamicPrerender as webContinueDynamicPrerender,\n continueStaticFallbackPrerender as webContinueStaticFallbackPrerender,\n continueDynamicHTMLResume as webContinueDynamicHTMLResume,\n streamToBuffer as webStreamToBuffer,\n streamToString as webStreamToString,\n createDocumentClosingStream as webCreateDocumentClosingStream,\n createRuntimePrefetchTransformStream,\n CLOSE_TAG,\n} from '../stream-utils/node-web-streams-helper'\nimport { indexOfUint8Array } from '../stream-utils/uint8array-helpers'\nimport { ENCODED_TAGS } from '../stream-utils/encoded-tags'\nimport { createNodeBufferedTransformStream } from '../stream-utils/node-buffered-transform-stream'\nimport { MISSING_ROOT_TAGS_ERROR } from '../../shared/lib/errors/constants'\nimport {\n htmlEscapeAttributeString,\n htmlEscapeJsonString,\n} from '../../shared/lib/htmlescape'\nimport { createInlinedDataReadableStream } from './use-flight-response'\nimport {\n ReplayableNodeStream,\n type AnyStream as AnyStreamType,\n} from './app-render-prerender-utils'\nimport { DetachedPromise } from '../../lib/detached-promise'\nimport { getTracer } from '../lib/trace/tracer'\nimport { AppRenderSpan } from '../lib/trace/constants'\nimport {\n atLeastOneTask,\n waitAtLeastOneReactRenderTask,\n} from '../../lib/scheduler'\n\n// ---------------------------------------------------------------------------\n// Re-export shared types from the web module\n// ---------------------------------------------------------------------------\n\nexport type {\n ContinueStreamSharedOptions,\n ContinueFizzStreamOptions,\n ContinueStaticPrerenderOptions,\n ContinueDynamicHTMLResumeOptions,\n ServerPrerenderComponentMod,\n FlightPayload,\n FlightClientModules,\n FlightRenderOptions,\n} from './stream-ops.web'\n\n// ---------------------------------------------------------------------------\n// AnyStream matches stream-ops.web.ts so both modules have the same type surface\n// ---------------------------------------------------------------------------\n\nexport type AnyStream = AnyStreamType\n\nexport type FlightComponentMod = {\n renderToReadableStream: (\n model: any,\n webpackMap: any,\n options?: any\n ) => ReadableStream<Uint8Array>\n renderToPipeableStream?: (\n model: any,\n webpackMap: any,\n options?: any\n ) => {\n pipe<Writable extends NodeJS.WritableStream>(\n destination: Writable\n ): Writable\n abort(reason?: unknown): void\n }\n}\n\nexport type FizzStreamResult = {\n stream: AnyStream\n allReady: Promise<void>\n abort?: (reason?: unknown) => void\n}\n\n// ---------------------------------------------------------------------------\n// Internal helpers\n// ---------------------------------------------------------------------------\n\ntype WebReadableStream = import('stream/web').ReadableStream\n\nfunction nodeReadableToWebReadableStream(\n stream: Readable | ReadableStream<Uint8Array>\n): ReadableStream<Uint8Array> {\n if (stream instanceof ReadableStream) {\n return stream\n }\n // Readable.toWeb returns stream/web ReadableStream which is structurally\n // identical to the global ReadableStream<Uint8Array>.\n return Readable.toWeb(stream) as unknown as ReadableStream<Uint8Array>\n}\n\nfunction webToReadable(\n stream: ReadableStream<Uint8Array> | Readable\n): Readable {\n if (stream instanceof Readable) {\n return stream\n }\n return Readable.fromWeb(stream as WebReadableStream)\n}\n\n// ---------------------------------------------------------------------------\n// Flight data injection – Node.js Transform that passes HTML chunks through\n// while pulling from a separate data stream and interleaving its chunks.\n// ---------------------------------------------------------------------------\n\nfunction createFlightDataInjectionTransform(\n dataStream: Readable,\n delayDataUntilFirstHtmlChunk: boolean\n): Transform {\n let htmlStreamFinished = false\n let pull: Promise<void> | null = null\n let donePulling = false\n\n function startOrContinuePulling(target: Transform) {\n if (!pull) {\n pull = startPulling(target)\n }\n return pull\n }\n\n async function startPulling(target: Transform) {\n if (delayDataUntilFirstHtmlChunk) {\n // Buffer the inlined data stream until we've left the current Task so\n // it's inserted after flushing the shell.\n await atLeastOneTask()\n }\n\n try {\n const iterator = dataStream[Symbol.asyncIterator]()\n while (true) {\n const { done, value } = await iterator.next()\n if (done) {\n donePulling = true\n return\n }\n\n // Prioritize HTML over RSC data: the SSR render produces HTML from\n // the same RSC stream, so yield a task to let HTML flush first.\n if (!delayDataUntilFirstHtmlChunk && !htmlStreamFinished) {\n await atLeastOneTask()\n }\n target.push(value)\n }\n } catch (err) {\n target.destroy(err as Error)\n }\n }\n\n const nodeTransform = new Transform({\n transform(chunk, _encoding, callback) {\n this.push(chunk)\n if (delayDataUntilFirstHtmlChunk) {\n startOrContinuePulling(this)\n }\n callback()\n },\n flush(callback) {\n htmlStreamFinished = true\n if (donePulling) {\n callback()\n return\n }\n startOrContinuePulling(this).then(\n () => callback(),\n (err) => callback(err as Error)\n )\n },\n })\n\n if (!delayDataUntilFirstHtmlChunk) {\n startOrContinuePulling(nodeTransform)\n }\n\n return nodeTransform\n}\n\n// ---------------------------------------------------------------------------\n// Head insertion – Node.js Transform that inserts server-generated HTML\n// (e.g. <script>, <style>) right before </head>, or prepends it if no\n// </head> tag is found (PPR resume case).\n// ---------------------------------------------------------------------------\n\nfunction createHeadInsertionTransform(\n insert: () => Promise<string>\n): Transform {\n let inserted = false\n let hasBytes = false\n\n return new Transform({\n async transform(chunk, _encoding, callback) {\n hasBytes = true\n\n try {\n const insertion = await insert()\n if (inserted) {\n if (insertion) {\n this.push(Buffer.from(insertion))\n }\n this.push(chunk)\n } else {\n const index = indexOfUint8Array(chunk, ENCODED_TAGS.CLOSED.HEAD)\n if (index !== -1) {\n if (insertion) {\n const encodedInsertion = Buffer.from(insertion)\n const merged = Buffer.allocUnsafe(\n chunk.length + encodedInsertion.length\n )\n merged.set(chunk.slice(0, index))\n merged.set(encodedInsertion, index)\n merged.set(chunk.slice(index), index + encodedInsertion.length)\n this.push(merged)\n } else {\n this.push(chunk)\n }\n inserted = true\n } else {\n if (insertion) {\n this.push(Buffer.from(insertion))\n }\n this.push(chunk)\n inserted = true\n }\n }\n callback()\n } catch (err) {\n callback(err as Error)\n }\n },\n async flush(callback) {\n try {\n if (hasBytes) {\n const insertion = await insert()\n if (insertion) {\n this.push(Buffer.from(insertion))\n }\n }\n callback()\n } catch (err) {\n callback(err as Error)\n }\n },\n })\n}\n\n// ---------------------------------------------------------------------------\n// Metadata transform – Node.js Transform that finds the «nxt-icon» meta mark\n// and replaces it with a script tag (or removes it if inside <head>).\n// ---------------------------------------------------------------------------\n\nfunction createMetadataTransform(\n insert: () => Promise<string> | string\n): Transform {\n let chunkIndex = -1\n let isMarkRemoved = false\n\n return new Transform({\n async transform(chunk, _encoding, callback) {\n let iconMarkIndex = -1\n let closedHeadIndex = -1\n chunkIndex++\n\n if (isMarkRemoved) {\n this.push(chunk)\n callback()\n return\n }\n\n try {\n let iconMarkLength = 0\n iconMarkIndex = indexOfUint8Array(chunk, ENCODED_TAGS.META.ICON_MARK)\n if (iconMarkIndex === -1) {\n this.push(chunk)\n callback()\n return\n }\n\n iconMarkLength = ENCODED_TAGS.META.ICON_MARK.length\n if (chunk[iconMarkIndex + iconMarkLength] === 47) {\n iconMarkLength += 2\n } else {\n iconMarkLength++\n }\n\n if (chunkIndex === 0) {\n closedHeadIndex = indexOfUint8Array(chunk, ENCODED_TAGS.CLOSED.HEAD)\n if (iconMarkIndex < closedHeadIndex) {\n const replaced = Buffer.allocUnsafe(chunk.length - iconMarkLength)\n replaced.set(chunk.subarray(0, iconMarkIndex))\n replaced.set(\n chunk.subarray(iconMarkIndex + iconMarkLength),\n iconMarkIndex\n )\n chunk = replaced\n } else {\n const insertion = await insert()\n const encodedInsertion = Buffer.from(insertion)\n const insertionLength = encodedInsertion.length\n const replaced = Buffer.allocUnsafe(\n chunk.length - iconMarkLength + insertionLength\n )\n replaced.set(chunk.subarray(0, iconMarkIndex))\n replaced.set(encodedInsertion, iconMarkIndex)\n replaced.set(\n chunk.subarray(iconMarkIndex + iconMarkLength),\n iconMarkIndex + insertionLength\n )\n chunk = replaced\n }\n isMarkRemoved = true\n } else {\n const insertion = await insert()\n const encodedInsertion = Buffer.from(insertion)\n const insertionLength = encodedInsertion.length\n const replaced = Buffer.allocUnsafe(\n chunk.length - iconMarkLength + insertionLength\n )\n replaced.set(chunk.subarray(0, iconMarkIndex))\n replaced.set(encodedInsertion, iconMarkIndex)\n replaced.set(\n chunk.subarray(iconMarkIndex + iconMarkLength),\n iconMarkIndex + insertionLength\n )\n chunk = replaced\n isMarkRemoved = true\n }\n this.push(chunk)\n callback()\n } catch (err) {\n callback(err as Error)\n }\n },\n })\n}\n\n// ---------------------------------------------------------------------------\n// Deferred suffix – Node.js Transform that appends a suffix string after the\n// first HTML chunk, deferring via queueMicrotask so the chunk flushes first.\n// ---------------------------------------------------------------------------\n\nfunction createDeferredSuffixTransform(suffix: string): Transform {\n let flushed = false\n const encodedSuffix = Buffer.from(suffix)\n\n return new Transform({\n transform(chunk, _encoding, callback) {\n this.push(chunk)\n\n if (!flushed) {\n flushed = true\n queueMicrotask(() => {\n this.push(encodedSuffix)\n })\n }\n callback()\n },\n flush(callback) {\n if (!flushed) {\n this.push(encodedSuffix)\n }\n callback()\n },\n })\n}\n\n// ---------------------------------------------------------------------------\n// Move suffix – Node.js Transform that strips </body></html> from its\n// original position and re-appends it at the very end of the stream, so any\n// content injected after the suffix still appears before the closing tags.\n// ---------------------------------------------------------------------------\n\nfunction createMoveSuffixTransform(): Transform {\n let foundSuffix = false\n\n return new Transform({\n transform(chunk, _encoding, callback) {\n if (foundSuffix) {\n this.push(chunk)\n callback()\n return\n }\n\n const index = indexOfUint8Array(chunk, ENCODED_TAGS.CLOSED.BODY_AND_HTML)\n if (index > -1) {\n foundSuffix = true\n\n if (chunk.length === ENCODED_TAGS.CLOSED.BODY_AND_HTML.length) {\n callback()\n return\n }\n\n const before = chunk.slice(0, index)\n this.push(before)\n\n if (chunk.length > ENCODED_TAGS.CLOSED.BODY_AND_HTML.length + index) {\n const after = chunk.slice(\n index + ENCODED_TAGS.CLOSED.BODY_AND_HTML.length\n )\n this.push(after)\n }\n } else {\n this.push(chunk)\n }\n callback()\n },\n flush(callback) {\n this.push(ENCODED_TAGS.CLOSED.BODY_AND_HTML)\n callback()\n },\n })\n}\n\n// ---------------------------------------------------------------------------\n// data-dpl-id insertion – Node.js Transform that inserts a `data-dpl-id`\n// attribute on the opening <html tag for deployment identification.\n// ---------------------------------------------------------------------------\n\nfunction createHtmlDataDplIdTransform(dplId: string): Transform {\n let didTransform = false\n\n return new Transform({\n transform(chunk, _encoding, callback) {\n if (didTransform) {\n this.push(chunk)\n callback()\n return\n }\n\n const htmlTagIndex = indexOfUint8Array(chunk, ENCODED_TAGS.OPENING.HTML)\n if (htmlTagIndex === -1) {\n this.push(chunk)\n callback()\n return\n }\n\n const insertionPoint = htmlTagIndex + ENCODED_TAGS.OPENING.HTML.length\n const encodedAttribute = Buffer.from(` data-dpl-id=\"${dplId}\"`)\n const modified = Buffer.allocUnsafe(\n chunk.length + encodedAttribute.length\n )\n\n modified.set(chunk.subarray(0, insertionPoint))\n modified.set(encodedAttribute, insertionPoint)\n modified.set(\n chunk.subarray(insertionPoint),\n insertionPoint + encodedAttribute.length\n )\n\n this.push(modified)\n didTransform = true\n callback()\n },\n })\n}\n\n// ---------------------------------------------------------------------------\n// Root layout validator – Node.js Transform that checks whether <html> and\n// <body> tags are present in the streamed output. Dev-only; appends an\n// error template when tags are missing so the error overlay can display it.\n// ---------------------------------------------------------------------------\n\nfunction createRootLayoutValidatorTransform(): Transform {\n let foundHtml = false\n let foundBody = false\n\n return new Transform({\n transform(chunk, _encoding, callback) {\n if (\n !foundHtml &&\n indexOfUint8Array(chunk, ENCODED_TAGS.OPENING.HTML) > -1\n ) {\n foundHtml = true\n }\n if (\n !foundBody &&\n indexOfUint8Array(chunk, ENCODED_TAGS.OPENING.BODY) > -1\n ) {\n foundBody = true\n }\n this.push(chunk)\n callback()\n },\n flush(callback) {\n const missingTags: ('html' | 'body')[] = []\n if (!foundHtml) missingTags.push('html')\n if (!foundBody) missingTags.push('body')\n\n if (missingTags.length) {\n this.push(\n Buffer.from(\n `<html id=\"__next_error__\">\n <template\n data-next-error-message=\"Missing ${missingTags\n .map((c) => `<${c}>`)\n .join(\n missingTags.length > 1 ? ' and ' : ''\n )} tags in the root layout.\\nRead more at https://nextjs.org/docs/messages/missing-root-layout-tags\"\n data-next-error-digest=\"${MISSING_ROOT_TAGS_ERROR}\"\n data-next-error-stack=\"\"\n ></template>\n `\n )\n )\n }\n callback()\n },\n })\n}\n\n// ---------------------------------------------------------------------------\n// Rendering functions (output Node Readable natively via PassThrough)\n// ---------------------------------------------------------------------------\n\nexport { renderToWebFlightStream } from './stream-ops.web'\n\nexport function renderToNodeFlightStream(\n ComponentMod: FlightComponentMod,\n payload: any,\n clientModules: any,\n opts: any\n): AnyStream {\n if (!ComponentMod.renderToPipeableStream) {\n throw new Error('renderToPipeableStream is not implemented')\n }\n\n const pt = new PassThrough()\n const pipeable = ComponentMod.renderToPipeableStream!(\n payload,\n clientModules,\n opts\n )\n pipeable.pipe(pt)\n return pt\n}\n\nexport { renderToWebFizzStream } from './stream-ops.web'\n\nexport async function renderToNodeFizzStream(\n element: React.ReactElement,\n streamOptions: any,\n options?: { waitForAllReady?: boolean }\n): Promise<FizzStreamResult> {\n const pt = new PassThrough()\n const shellReady = new DetachedPromise<void>()\n const allReady = new DetachedPromise<void>()\n const deferPipe = options?.waitForAllReady === true\n\n const pipeable = getTracer().trace(AppRenderSpan.renderToReadableStream, () =>\n renderToPipeableStream(element, {\n ...streamOptions,\n onHeaders: streamOptions?.onHeaders,\n onShellReady() {\n streamOptions?.onShellReady?.()\n shellReady.resolve()\n },\n onShellError(error: unknown) {\n streamOptions?.onShellError?.(error)\n shellReady.reject(error)\n },\n onAllReady() {\n streamOptions?.onAllReady?.()\n if (deferPipe) {\n pipeable.pipe(pt)\n }\n allReady.resolve()\n },\n onError: streamOptions?.onError,\n })\n )\n\n await getTracer().trace(\n AppRenderSpan.waitShellReady,\n () => shellReady.promise\n )\n\n if (!deferPipe) {\n await waitAtLeastOneReactRenderTask()\n pipeable.pipe(pt)\n }\n\n return {\n stream: pt,\n allReady: allReady.promise,\n abort: (reason?: unknown) => pipeable.abort(reason),\n }\n}\n\nexport async function resumeToFizzStream(\n element: React.ReactElement,\n postponedState: PostponedState,\n streamOptions: any,\n runInContext?: <T>(fn: () => T) => T\n): Promise<FizzStreamResult> {\n const run: <T>(fn: () => T) => T = runInContext ?? ((fn) => fn())\n\n const pt = new PassThrough()\n const shellReady = new DetachedPromise<void>()\n const allReady = new DetachedPromise<void>()\n\n const pipeable = await run(() =>\n resumeToPipeableStream(element, postponedState, {\n ...streamOptions,\n onShellReady() {\n streamOptions?.onShellReady?.()\n shellReady.resolve()\n },\n onShellError(error: unknown) {\n streamOptions?.onShellError?.(error)\n shellReady.reject(error)\n },\n onAllReady() {\n streamOptions?.onAllReady?.()\n allReady.resolve()\n },\n })\n )\n\n pipeable.pipe(pt)\n await shellReady.promise\n\n return {\n stream: pt,\n allReady: allReady.promise,\n abort: (reason?: unknown) => pipeable.abort(reason),\n }\n}\n\nexport async function resumeAndAbort(\n element: React.ReactElement,\n postponed: PostponedState | null,\n opts: any\n): Promise<AnyStream> {\n const pt = new PassThrough()\n const pipeable = await resumeToPipeableStream(\n element,\n postponed as PostponedState,\n opts\n )\n pipeable.pipe(pt)\n pipeable.abort(opts?.signal?.reason)\n return pt\n}\n\n// ---------------------------------------------------------------------------\n// Continue function wrappers\n// Bridge Node Readable → web, apply existing web transforms, Readable.fromWeb()\n// ---------------------------------------------------------------------------\n\nexport async function continueFizzStream(\n renderStream: AnyStream,\n {\n suffix,\n inlinedDataStream,\n isStaticGeneration,\n allReady,\n deploymentId,\n getServerInsertedHTML,\n getServerInsertedMetadata,\n validateRootLayout,\n }: import('./stream-ops.web').ContinueFizzStreamOptions\n): Promise<Readable> {\n // Suffix itself might contain close tags at the end, so we need to split it.\n const suffixUnclosed = suffix ? suffix.split(CLOSE_TAG, 1)[0] : null\n\n if (isStaticGeneration) {\n if (allReady) {\n await allReady\n }\n } else {\n // Otherwise, we want to make sure Fizz is done with all microtasky work\n // before we start pulling the stream and cause a flush.\n await waitAtLeastOneReactRenderTask()\n }\n\n // Pipe the render stream through Node.js Transforms:\n // 1. Buffer – coalesces chunks written in the same microtask into one Uint8Array\n // 2. Flight data injection – interleaves RSC data chunks with the HTML stream\n // 3. Head insertion – inserts server-generated HTML before </head>\n const buffered = createNodeBufferedTransformStream()\n webToReadable(renderStream).pipe(buffered)\n\n let source: Readable = buffered\n\n if (deploymentId) {\n const dplId = createHtmlDataDplIdTransform(deploymentId)\n source.pipe(dplId)\n source = dplId\n }\n\n // Metadata (icon mark replacement)\n const metadata = createMetadataTransform(getServerInsertedMetadata)\n source.pipe(metadata)\n source = metadata\n\n // Insert suffix content\n if (suffixUnclosed != null && suffixUnclosed.length > 0) {\n const deferredSuffix = createDeferredSuffixTransform(suffixUnclosed)\n source.pipe(deferredSuffix)\n source = deferredSuffix\n }\n\n // Flight data injection – interleaves RSC data chunks with the HTML stream\n if (inlinedDataStream) {\n const flightInjection = createFlightDataInjectionTransform(\n webToReadable(inlinedDataStream),\n true\n )\n source.pipe(flightInjection)\n source = flightInjection\n }\n\n if (validateRootLayout) {\n const rootLayoutValidator = createRootLayoutValidatorTransform()\n source.pipe(rootLayoutValidator)\n source = rootLayoutValidator\n }\n\n // Close tags should always be deferred to the end\n const moveSuffix = createMoveSuffixTransform()\n source.pipe(moveSuffix)\n source = moveSuffix\n\n // Head insertion – inserts server-generated HTML before </head>\n const headInsertion = createHeadInsertionTransform(getServerInsertedHTML)\n source.pipe(headInsertion)\n source = headInsertion\n\n return source\n}\n\nexport async function continueStaticPrerender(\n prerenderStream: AnyStream,\n opts: import('./stream-ops.web').ContinueStaticPrerenderOptions\n): Promise<AnyStream> {\n const webResult = await webContinueStaticPrerender(\n nodeReadableToWebReadableStream(prerenderStream),\n {\n ...opts,\n inlinedDataStream: nodeReadableToWebReadableStream(\n opts.inlinedDataStream\n ),\n }\n )\n return webToReadable(webResult)\n}\n\nexport async function continueDynamicPrerender(\n prerenderStream: AnyStream,\n opts: {\n getServerInsertedHTML: () => Promise<string>\n getServerInsertedMetadata: () => Promise<string>\n deploymentId: string | undefined\n }\n): Promise<AnyStream> {\n const webResult = await webContinueDynamicPrerender(\n nodeReadableToWebReadableStream(prerenderStream),\n opts\n )\n return webToReadable(webResult)\n}\n\nexport async function continueStaticFallbackPrerender(\n prerenderStream: AnyStream,\n opts: import('./stream-ops.web').ContinueStaticPrerenderOptions\n): Promise<AnyStream> {\n const webResult = await webContinueStaticFallbackPrerender(\n nodeReadableToWebReadableStream(prerenderStream),\n {\n ...opts,\n inlinedDataStream: nodeReadableToWebReadableStream(\n opts.inlinedDataStream\n ),\n }\n )\n return webToReadable(webResult)\n}\n\nexport async function continueDynamicHTMLResumeNode(\n renderStream: AnyStream,\n {\n delayDataUntilFirstHtmlChunk,\n inlinedDataStream,\n getServerInsertedHTML,\n getServerInsertedMetadata,\n deploymentId,\n }: import('./stream-ops.web').ContinueDynamicHTMLResumeOptions\n): Promise<AnyStream> {\n await waitAtLeastOneReactRenderTask()\n\n const buffered = createNodeBufferedTransformStream()\n webToReadable(renderStream).pipe(buffered)\n\n let source: Readable = buffered\n\n if (deploymentId) {\n const dplId = createHtmlDataDplIdTransform(deploymentId)\n source.pipe(dplId)\n source = dplId\n }\n\n const headInsertion = createHeadInsertionTransform(getServerInsertedHTML)\n source.pipe(headInsertion)\n source = headInsertion\n\n const metadata = createMetadataTransform(getServerInsertedMetadata)\n source.pipe(metadata)\n source = metadata\n\n const flightInjection = createFlightDataInjectionTransform(\n webToReadable(inlinedDataStream),\n delayDataUntilFirstHtmlChunk\n )\n source.pipe(flightInjection)\n source = flightInjection\n\n const moveSuffix = createMoveSuffixTransform()\n source.pipe(moveSuffix)\n source = moveSuffix\n\n return source\n}\n\nexport async function continueDynamicHTMLResumeWeb(\n renderStream: AnyStream,\n opts: import('./stream-ops.web').ContinueDynamicHTMLResumeOptions\n): Promise<AnyStream> {\n const webResult = await webContinueDynamicHTMLResume(\n nodeReadableToWebReadableStream(renderStream),\n {\n ...opts,\n inlinedDataStream: nodeReadableToWebReadableStream(\n opts.inlinedDataStream\n ),\n }\n )\n return webToReadable(webResult)\n}\n\n// ---------------------------------------------------------------------------\n// Utility functions (Node-native)\n// ---------------------------------------------------------------------------\n\nexport function chainStreams(...streams: AnyStream[]): AnyStream {\n if (streams.length === 0) {\n const pt = new PassThrough()\n pt.end()\n return pt\n }\n\n if (streams.length === 1) {\n return streams[0]\n }\n\n const out = new PassThrough()\n let i = 0\n\n function pipeNext() {\n if (i >= streams.length) {\n out.end()\n return\n }\n const current = webToReadable(streams[i++])\n current.pipe(out, { end: false })\n current.on('end', pipeNext)\n current.on('error', (err) => out.destroy(err))\n }\n\n pipeNext()\n return out\n}\n\nexport async function streamToBuffer(stream: AnyStream): Promise<Buffer> {\n return webStreamToBuffer(nodeReadableToWebReadableStream(stream))\n}\n\nexport async function streamToString(stream: AnyStream): Promise<string> {\n return webStreamToString(nodeReadableToWebReadableStream(stream))\n}\n\nexport function createWebInlinedDataStream(\n source: AnyStream,\n nonce: string | undefined,\n formState: unknown | null\n): AnyStream {\n const webSource = nodeReadableToWebReadableStream(source)\n const webResult = createInlinedDataReadableStream(webSource, nonce, formState)\n return webToReadable(webResult)\n}\n\nexport function createNodeInlinedDataStream(\n source: AnyStream,\n nonce: string | undefined,\n formState: unknown | null\n): AnyStream {\n const startScriptTag = nonce\n ? `<script nonce=\"${htmlEscapeAttributeString(nonce)}\">`\n : '<script>'\n\n const dataStream = webToReadable(source)\n const pt = new PassThrough()\n\n // Write initial bootstrap instructions\n let scriptContents = `(self.__next_f=self.__next_f||[]).push(${htmlEscapeJsonString(\n JSON.stringify([INLINE_FLIGHT_PAYLOAD_BOOTSTRAP])\n )})`\n if (formState != null) {\n scriptContents += `;self.__next_f.push(${htmlEscapeJsonString(\n JSON.stringify([INLINE_FLIGHT_PAYLOAD_FORM_STATE, formState])\n )})`\n }\n pt.push(Buffer.from(`${startScriptTag}${scriptContents}</script>`))\n\n // Pull from the flight data stream and wrap each chunk in a <script> tag\n pullFlightData(dataStream, pt, startScriptTag)\n\n return pt\n}\n\nconst INLINE_FLIGHT_PAYLOAD_BOOTSTRAP = 0\nconst INLINE_FLIGHT_PAYLOAD_DATA = 1\nconst INLINE_FLIGHT_PAYLOAD_FORM_STATE = 2\nconst INLINE_FLIGHT_PAYLOAD_BINARY = 3\n\nasync function pullFlightData(\n dataStream: Readable,\n output: PassThrough,\n startScriptTag: string\n): Promise<void> {\n function waitForReadableOrEnd(): Promise<void> {\n if (dataStream.readableLength > 0 || dataStream.readableEnded) {\n return Promise.resolve()\n }\n return new Promise<void>((resolve, reject) => {\n function cleanup() {\n dataStream.removeListener('readable', onDone)\n dataStream.removeListener('end', onDone)\n dataStream.removeListener('error', onError)\n }\n function onDone() {\n cleanup()\n resolve()\n }\n function onError(err: Error) {\n cleanup()\n reject(err)\n }\n dataStream.on('readable', onDone)\n dataStream.on('end', onDone)\n dataStream.on('error', onError)\n })\n }\n\n try {\n while (true) {\n const chunk: Buffer | null = dataStream.read()\n if (chunk !== null) {\n let htmlInlinedData: string\n if (isUtf8(chunk)) {\n const decodedString = chunk.toString('utf-8')\n htmlInlinedData = htmlEscapeJsonString(\n JSON.stringify([INLINE_FLIGHT_PAYLOAD_DATA, decodedString])\n )\n } else {\n const base64 = Buffer.from(\n chunk.buffer,\n chunk.byteOffset,\n chunk.byteLength\n ).toString('base64')\n htmlInlinedData = htmlEscapeJsonString(\n JSON.stringify([INLINE_FLIGHT_PAYLOAD_BINARY, base64])\n )\n }\n output.push(\n Buffer.from(\n `${startScriptTag}self.__next_f.push(${htmlInlinedData})</script>`\n )\n )\n continue\n }\n\n if (dataStream.readableEnded) {\n output.end()\n return\n }\n\n await waitForReadableOrEnd()\n }\n } catch (err) {\n output.destroy(err as Error)\n }\n}\n\nexport function createPendingStream(): AnyStream {\n return new PassThrough()\n}\n\nexport function createDocumentClosingStream(): AnyStream {\n const webStream = webCreateDocumentClosingStream()\n return webToReadable(webStream)\n}\n\nexport function createOnHeadersCallback(\n appendHeader: (key: string, value: string) => void\n): NonNullable<PrerenderOptions['onHeaders']> {\n return (headers: Headers) => {\n headers.forEach((value, key) => {\n appendHeader(key, value)\n })\n }\n}\n\nexport function pipeRuntimePrefetchTransform(\n stream: AnyStream,\n sentinel: number,\n isPartial: boolean,\n staleTime: number\n): AnyStream {\n const webStream = nodeReadableToWebReadableStream(stream)\n const transformed = webStream.pipeThrough(\n createRuntimePrefetchTransformStream(sentinel, isPartial, staleTime)\n )\n return webToReadable(transformed)\n}\n\n// ---------------------------------------------------------------------------\n// Re-exports (no stream involvement, identical to web)\n// ---------------------------------------------------------------------------\n\nexport async function processPrelude(unprocessedPrelude: AnyStream) {\n const [prelude, peek] =\n nodeReadableToWebReadableStream(unprocessedPrelude).tee()\n\n const reader = peek.getReader()\n const firstResult = await reader.read()\n reader.cancel()\n\n return {\n prelude: webToReadable(prelude) as AnyStream,\n preludeIsEmpty: firstResult.done === true,\n }\n}\n\nexport function getServerPrerender(ComponentMod: {\n prerender: (...args: any[]) => Promise<any>\n}): (...args: any[]) => any {\n return ComponentMod.prerender\n}\n\nexport const getClientPrerender: typeof import('react-dom/static').prerender =\n prerender\n\n// Node counterpart of the web `teeStream`. Like the web version it assumes the\n// stream type matching its build — here a Node `Readable` — and fans out\n// through `ReplayableNodeStream`. Need three or more consumers from one source?\n// Use `ReplayableNodeStream` directly (N `createReplayStream()` calls) to avoid\n// nesting tees.\nexport function teeStream(stream: AnyStream): [AnyStream, AnyStream] {\n const replayable = new ReplayableNodeStream(stream as Readable)\n return [replayable.createReplayStream(), replayable.createReplayStream()]\n}\n"],"names":["chainStreams","continueDynamicHTMLResumeNode","continueDynamicHTMLResumeWeb","continueDynamicPrerender","continueFizzStream","continueStaticFallbackPrerender","continueStaticPrerender","createDocumentClosingStream","createNodeInlinedDataStream","createOnHeadersCallback","createPendingStream","createWebInlinedDataStream","getClientPrerender","getServerPrerender","pipeRuntimePrefetchTransform","processPrelude","renderToNodeFizzStream","renderToNodeFlightStream","renderToWebFizzStream","renderToWebFlightStream","resumeAndAbort","resumeToFizzStream","streamToBuffer","streamToString","teeStream","nodeReadableToWebReadableStream","stream","ReadableStream","Readable","toWeb","webToReadable","fromWeb","createFlightDataInjectionTransform","dataStream","delayDataUntilFirstHtmlChunk","htmlStreamFinished","pull","donePulling","startOrContinuePulling","target","startPulling","atLeastOneTask","iterator","Symbol","asyncIterator","done","value","next","push","err","destroy","nodeTransform","Transform","transform","chunk","_encoding","callback","flush","then","createHeadInsertionTransform","insert","inserted","hasBytes","insertion","Buffer","from","index","indexOfUint8Array","ENCODED_TAGS","CLOSED","HEAD","encodedInsertion","merged","allocUnsafe","length","set","slice","createMetadataTransform","chunkIndex","isMarkRemoved","iconMarkIndex","closedHeadIndex","iconMarkLength","META","ICON_MARK","replaced","subarray","insertionLength","createDeferredSuffixTransform","suffix","flushed","encodedSuffix","queueMicrotask","createMoveSuffixTransform","foundSuffix","BODY_AND_HTML","before","after","createHtmlDataDplIdTransform","dplId","didTransform","htmlTagIndex","OPENING","HTML","insertionPoint","encodedAttribute","modified","createRootLayoutValidatorTransform","foundHtml","foundBody","BODY","missingTags","map","c","join","MISSING_ROOT_TAGS_ERROR","ComponentMod","payload","clientModules","opts","renderToPipeableStream","Error","pt","PassThrough","pipeable","pipe","element","streamOptions","options","shellReady","DetachedPromise","allReady","deferPipe","waitForAllReady","getTracer","trace","AppRenderSpan","renderToReadableStream","onHeaders","onShellReady","resolve","onShellError","error","reject","onAllReady","onError","waitShellReady","promise","waitAtLeastOneReactRenderTask","abort","reason","postponedState","runInContext","run","fn","resumeToPipeableStream","postponed","signal","renderStream","inlinedDataStream","isStaticGeneration","deploymentId","getServerInsertedHTML","getServerInsertedMetadata","validateRootLayout","suffixUnclosed","split","CLOSE_TAG","buffered","createNodeBufferedTransformStream","source","metadata","deferredSuffix","flightInjection","rootLayoutValidator","moveSuffix","headInsertion","prerenderStream","webResult","webContinueStaticPrerender","webContinueDynamicPrerender","webContinueStaticFallbackPrerender","webContinueDynamicHTMLResume","streams","end","out","i","pipeNext","current","on","webStreamToBuffer","webStreamToString","nonce","formState","webSource","createInlinedDataReadableStream","startScriptTag","htmlEscapeAttributeString","scriptContents","htmlEscapeJsonString","JSON","stringify","INLINE_FLIGHT_PAYLOAD_BOOTSTRAP","INLINE_FLIGHT_PAYLOAD_FORM_STATE","pullFlightData","INLINE_FLIGHT_PAYLOAD_DATA","INLINE_FLIGHT_PAYLOAD_BINARY","output","waitForReadableOrEnd","readableLength","readableEnded","Promise","cleanup","removeListener","onDone","read","htmlInlinedData","isUtf8","decodedString","toString","base64","buffer","byteOffset","byteLength","webStream","webCreateDocumentClosingStream","appendHeader","headers","forEach","key","sentinel","isPartial","staleTime","transformed","pipeThrough","createRuntimePrefetchTransformStream","unprocessedPrelude","prelude","peek","tee","reader","getReader","firstResult","cancel","preludeIsEmpty","prerender","replayable","ReplayableNodeStream","createReplayStream"],"mappings":"AAAA;;;;;;;;CAQC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAu1BeA,YAAY;eAAZA;;IAjEMC,6BAA6B;eAA7BA;;IA6CAC,4BAA4B;eAA5BA;;IA5EAC,wBAAwB;eAAxBA;;IAlGAC,kBAAkB;eAAlBA;;IAiHAC,+BAA+B;eAA/BA;;IA/BAC,uBAAuB;eAAvBA;;IA0QNC,2BAA2B;eAA3BA;;IA3GAC,2BAA2B;eAA3BA;;IAgHAC,uBAAuB;eAAvBA;;IATAC,mBAAmB;eAAnBA;;IAjHAC,0BAA0B;eAA1BA;;IAyKHC,kBAAkB;eAAlBA;;IANGC,kBAAkB;eAAlBA;;IA/BAC,4BAA4B;eAA5BA;;IAiBMC,cAAc;eAAdA;;IA3eAC,sBAAsB;eAAtBA;;IAtBNC,wBAAwB;eAAxBA;;IAoBPC,qBAAqB;eAArBA,mCAAqB;;IAtBrBC,uBAAuB;eAAvBA,qCAAuB;;IAkHVC,cAAc;eAAdA;;IAxCAC,kBAAkB;eAAlBA;;IA4RAC,cAAc;eAAdA;;IAIAC,cAAc;eAAdA;;IAqLNC,SAAS;eAATA;;;wBAviCT;wBACmB;4BACuB;4BAC1B;sCAYhB;mCAC2B;6BACL;6CACqB;2BACV;4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GACnBrN,gCAAgCmN,oBAAoBG,GAAG;IAEzD,MAAMC,SAASF,KAAKG,SAAS;IAC7B,MAAMC,cAAc,MAAMF,OAAOzB,IAAI;IACrCyB,OAAOG,MAAM;IAEb,OAAO;QACLN,SAAS/M,cAAc+M;QACvBO,gBAAgBF,YAAYrM,IAAI,KAAK;IACvC;AACF;AAEO,SAAShC,mBAAmBuG,YAElC;IACC,OAAOA,aAAaiI,SAAS;AAC/B;AAEO,MAAMzO,qBACXyO,iBAAS;AAOJ,SAAS7N,UAAUE,MAAiB;IACzC,MAAM4N,aAAa,IAAIC,6CAAoB,CAAC7N;IAC5C,OAAO;QAAC4N,WAAWE,kBAAkB;QAAIF,WAAWE,kBAAkB;KAAG;AAC3E","ignoreList":[0]} |
@@ -49,2 +49,3 @@ import type { NextConfig } from './config'; | ||
| optimisticRouting: z.ZodOptional<z.ZodBoolean>; | ||
| instrumentationClientRouterTransitionEvents: z.ZodOptional<z.ZodBoolean>; | ||
| appShells: z.ZodOptional<z.ZodBoolean>; | ||
@@ -51,0 +52,0 @@ varyParams: z.ZodOptional<z.ZodBoolean>; |
@@ -225,2 +225,3 @@ "use strict"; | ||
| optimisticRouting: _zod.z.boolean().optional(), | ||
| instrumentationClientRouterTransitionEvents: _zod.z.boolean().optional(), | ||
| appShells: _zod.z.boolean().optional(), | ||
@@ -227,0 +228,0 @@ varyParams: _zod.z.boolean().optional(), |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/server/config-schema.ts"],"sourcesContent":["import type { NextConfig } from './config'\nimport { VALID_LOADERS } from '../shared/lib/image-config'\n\nimport { z } from 'next/dist/compiled/zod'\nimport type zod from 'next/dist/compiled/zod'\n\nimport type { SizeLimit } from '../types'\nimport {\n LIGHTNINGCSS_FEATURE_NAMES,\n type ExportPathMap,\n type TurbopackLoaderItem,\n type TurbopackOptions,\n type TurbopackRuleConfigItem,\n type TurbopackRuleConfigCollection,\n type TurbopackRuleCondition,\n type TurbopackLoaderBuiltinCondition,\n} from './config-shared'\nimport type {\n Header,\n Rewrite,\n RouteHas,\n Redirect,\n} from '../lib/load-custom-routes'\nimport { SUPPORTED_TEST_RUNNERS_LIST } from '../cli/next-test'\n\n// A custom zod schema for the SizeLimit type\nconst zSizeLimit = z.custom<SizeLimit>((val) => {\n if (typeof val === 'number' || typeof val === 'string') {\n return true\n }\n return false\n})\n\nconst zExportMap: zod.ZodType<ExportPathMap> = z.record(\n z.string(),\n z.object({\n page: z.string(),\n query: z.any(), // NextParsedUrlQuery\n\n // private optional properties\n _fallbackRouteParams: z.array(z.any()).optional(),\n _isAppDir: z.boolean().optional(),\n _isDynamicError: z.boolean().optional(),\n _isRoutePPREnabled: z.boolean().optional(),\n _allowEmptyStaticShell: z.boolean().optional(),\n })\n)\n\nconst zRouteHas: zod.ZodType<RouteHas> = z.union([\n z.object({\n type: z.enum(['header', 'query', 'cookie']),\n key: z.string(),\n value: z.string().optional(),\n }),\n z.object({\n type: z.literal('host'),\n key: z.undefined().optional(),\n value: z.string(),\n }),\n])\n\nconst zRewrite: zod.ZodType<Rewrite> = z.object({\n source: z.string(),\n destination: z.string(),\n basePath: z.literal(false).optional(),\n locale: z.literal(false).optional(),\n has: z.array(zRouteHas).optional(),\n missing: z.array(zRouteHas).optional(),\n internal: z.boolean().optional(),\n})\n\nconst zRedirect: zod.ZodType<Redirect> = z\n .object({\n source: z.string(),\n destination: z.string(),\n basePath: z.literal(false).optional(),\n locale: z.literal(false).optional(),\n has: z.array(zRouteHas).optional(),\n missing: z.array(zRouteHas).optional(),\n internal: z.boolean().optional(),\n })\n .and(\n z.union([\n z.object({\n statusCode: z.never().optional(),\n permanent: z.boolean(),\n }),\n z.object({\n statusCode: z.number(),\n permanent: z.never().optional(),\n }),\n ])\n )\n\nconst zHeader: zod.ZodType<Header> = z.object({\n source: z.string(),\n basePath: z.literal(false).optional(),\n locale: z.literal(false).optional(),\n headers: z.array(z.object({ key: z.string(), value: z.string() })),\n has: z.array(zRouteHas).optional(),\n missing: z.array(zRouteHas).optional(),\n\n internal: z.boolean().optional(),\n})\n\nconst zTurbopackLoaderItem: zod.ZodType<TurbopackLoaderItem> = z.union([\n z.string(),\n z.strictObject({\n loader: z.string(),\n // Any JSON value can be used as turbo loader options, so use z.any() here\n options: z.record(z.string(), z.any()).optional(),\n }),\n])\n\nconst zTurbopackLoaderBuiltinCondition: zod.ZodType<TurbopackLoaderBuiltinCondition> =\n z.union([\n z.literal('browser'),\n z.literal('foreign'),\n z.literal('development'),\n z.literal('production'),\n z.literal('node'),\n z.literal('edge-light'),\n ])\n\nconst zTurbopackCondition: zod.ZodType<TurbopackRuleCondition> = z.union([\n z.strictObject({ all: z.lazy(() => z.array(zTurbopackCondition)) }),\n z.strictObject({ any: z.lazy(() => z.array(zTurbopackCondition)) }),\n z.strictObject({ not: z.lazy(() => zTurbopackCondition) }),\n zTurbopackLoaderBuiltinCondition,\n z.strictObject({\n path: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n content: z.instanceof(RegExp).optional(),\n query: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n contentType: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n }),\n])\n\nconst zTurbopackModuleType = z.enum([\n 'asset',\n 'ecmascript',\n 'typescript',\n 'css',\n 'css-module',\n 'wasm',\n 'raw',\n 'node',\n 'bytes',\n])\n\nconst zTurbopackRuleConfigItem: zod.ZodType<TurbopackRuleConfigItem> =\n z.strictObject({\n loaders: z.array(zTurbopackLoaderItem).optional(),\n as: z.string().optional(),\n condition: zTurbopackCondition.optional(),\n type: zTurbopackModuleType.optional(),\n })\n\nconst zTurbopackRuleConfigCollection: zod.ZodType<TurbopackRuleConfigCollection> =\n z.union([\n zTurbopackRuleConfigItem,\n z.array(z.union([zTurbopackLoaderItem, zTurbopackRuleConfigItem])),\n ])\n\nconst zTurbopackConfig: zod.ZodType<TurbopackOptions> = z.strictObject({\n rules: z.record(z.string(), zTurbopackRuleConfigCollection).optional(),\n resolveAlias: z\n .record(\n z.string(),\n z.union([\n z.string(),\n z.array(z.string()),\n z.record(z.string(), z.union([z.string(), z.array(z.string())])),\n ])\n )\n .optional(),\n resolveExtensions: z.array(z.string()).optional(),\n root: z.string().optional(),\n debugIds: z.boolean().optional(),\n chunkLoadingGlobal: z.string().optional(),\n ignoreIssue: z\n .array(\n z.object({\n path: z.union([z.string(), z.instanceof(RegExp)]),\n title: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n description: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n })\n )\n .optional(),\n})\n\nexport const experimentalSchema = {\n outputHashSalt: z.string().optional(),\n useSkewCookie: z.boolean().optional(),\n after: z.boolean().optional(),\n appNavFailHandling: z.boolean().optional(),\n appNewScrollHandler: z.boolean().optional(),\n preloadEntriesOnStart: z.boolean().optional(),\n allowedRevalidateHeaderKeys: z.array(z.string()).optional(),\n staleTimes: z\n .object({\n dynamic: z.number().optional(),\n static: z.number().gte(30).optional(),\n })\n .optional(),\n cacheLife: z\n .record(\n z.object({\n stale: z.number().optional(),\n revalidate: z.number().optional(),\n expire: z.number().optional(),\n })\n )\n .optional(),\n cacheHandlers: z.record(z.string(), z.string().optional()).optional(),\n clientRouterFilter: z.boolean().optional(),\n clientRouterFilterRedirects: z.boolean().optional(),\n clientRouterFilterAllowedRate: z.number().optional(),\n cpus: z.number().optional(),\n memoryBasedWorkersCount: z.boolean().optional(),\n craCompat: z.boolean().optional(),\n caseSensitiveRoutes: z.boolean().optional(),\n clientParamParsingOrigins: z.array(z.string()).optional(),\n cachedNavigations: z.boolean().optional(),\n dynamicOnHover: z.boolean().optional(),\n useOffline: z.boolean().optional(),\n optimisticRouting: z.boolean().optional(),\n appShells: z.boolean().optional(),\n varyParams: z.boolean().optional(),\n prefetchInlining: z\n .union([\n z.boolean(),\n z.object({\n maxSize: z.number().optional(),\n maxBundleSize: z.number().optional(),\n }),\n ])\n .optional(),\n disableOptimizedLoading: z.boolean().optional(),\n disablePostcssPresetEnv: z.boolean().optional(),\n cacheComponents: z.boolean().optional(),\n inlineCss: z.boolean().optional(),\n esmExternals: z.union([z.boolean(), z.literal('loose')]).optional(),\n serverActions: z\n .object({\n bodySizeLimit: zSizeLimit.optional(),\n allowedOrigins: z.array(z.string()).optional(),\n })\n .optional(),\n maxPostponedStateSize: zSizeLimit.optional(),\n // The original type was Record<string, any>\n extensionAlias: z.record(z.string(), z.any()).optional(),\n externalDir: z.boolean().optional(),\n externalMiddlewareRewritesResolve: z.boolean().optional(),\n externalProxyRewritesResolve: z.boolean().optional(),\n exposeTestingApiInProductionBuild: z.boolean().optional(),\n fallbackNodePolyfills: z.literal(false).optional(),\n fetchCacheKeyPrefix: z.string().optional(),\n forceSwcTransforms: z.boolean().optional(),\n fullySpecified: z.boolean().optional(),\n gzipSize: z.boolean().optional(),\n imgOptConcurrency: z.number().int().optional().nullable(),\n imgOptOperationCache: z.boolean().optional().nullable(),\n imgOptTimeoutInSeconds: z.number().int().optional(),\n imgOptMaxInputPixels: z.number().int().optional(),\n imgOptSequentialRead: z.boolean().optional().nullable(),\n imgOptSkipMetadata: z.boolean().optional().nullable(),\n isrFlushToDisk: z.boolean().optional(),\n largePageDataBytes: z.number().optional(),\n linkNoTouchStart: z.boolean().optional(),\n manualClientBasePath: z.boolean().optional(),\n middlewarePrefetch: z.enum(['strict', 'flexible']).optional(),\n proxyPrefetch: z.enum(['strict', 'flexible']).optional(),\n middlewareClientMaxBodySize: zSizeLimit.optional(),\n proxyClientMaxBodySize: zSizeLimit.optional(),\n multiZoneDraftMode: z.boolean().optional(),\n cssChunking: z\n .union([\n z.boolean(),\n z.literal('strict'),\n z.literal('loose'),\n z.literal('graph'),\n z.strictObject({ type: z.literal('strict') }),\n z.strictObject({ type: z.literal('loose') }),\n z.strictObject({\n type: z.literal('graph'),\n requestCost: z.number().nonnegative().finite().optional(),\n moduleFactorCost: z.number().nonnegative().finite().optional(),\n }),\n ])\n .optional(),\n nextScriptWorkers: z.boolean().optional(),\n // The critter option is unknown, use z.any() here\n optimizeCss: z.union([z.boolean(), z.any()]).optional(),\n optimisticClientCache: z.boolean().optional(),\n parallelServerCompiles: z.boolean().optional(),\n parallelServerBuildTraces: z.boolean().optional(),\n ppr: z\n .union([z.boolean(), z.literal('incremental')])\n .readonly()\n .optional(),\n taint: z.boolean().optional(),\n blockingSSR: z.boolean().optional(),\n prerenderEarlyExit: z.boolean().optional(),\n proxyTimeout: z.number().gte(0).optional(),\n rootParams: z.boolean().optional(),\n mcpServer: z.boolean().optional(),\n removeUncaughtErrorAndRejectionListeners: z.boolean().optional(),\n validateRSCRequestHeaders: z.boolean().optional(),\n scrollRestoration: z.boolean().optional(),\n sri: z\n .object({\n algorithm: z.enum(['sha256', 'sha384', 'sha512']).optional(),\n })\n .optional(),\n swcPlugins: z\n // The specific swc plugin's option is unknown, use z.any() here\n .array(z.tuple([z.string(), z.record(z.string(), z.any())]))\n .optional(),\n swcEnvOptions: z\n .object({\n mode: z.enum(['usage', 'entry']).optional(),\n coreJs: z.string().optional(),\n skip: z.array(z.string()).optional(),\n include: z.array(z.string()).optional(),\n exclude: z.array(z.string()).optional(),\n shippedProposals: z.boolean().optional(),\n forceAllTransforms: z.boolean().optional(),\n debug: z.boolean().optional(),\n loose: z.boolean().optional(),\n })\n .optional(),\n swcTraceProfiling: z.boolean().optional(),\n // NonNullable<webpack.Configuration['experiments']>['buildHttp']\n urlImports: z.any().optional(),\n viewTransition: z.boolean().optional(),\n workerThreads: z.boolean().optional(),\n webVitalsAttribution: z\n .array(\n z.union([\n z.literal('CLS'),\n z.literal('FCP'),\n z.literal('FID'),\n z.literal('INP'),\n z.literal('LCP'),\n z.literal('TTFB'),\n ])\n )\n .optional(),\n // This is partial set of mdx-rs transform options we support, aligned\n // with next_core::next_config::MdxRsOptions. Ensure both types are kept in sync.\n mdxRs: z\n .union([\n z.boolean(),\n z.object({\n development: z.boolean().optional(),\n jsxRuntime: z.string().optional(),\n jsxImportSource: z.string().optional(),\n providerImportSource: z.string().optional(),\n mdxType: z.enum(['gfm', 'commonmark']).optional(),\n }),\n ])\n .optional(),\n transitionIndicator: z.boolean().optional(),\n gestureTransition: z.boolean().optional(),\n typedRoutes: z.boolean().optional(),\n webpackBuildWorker: z.boolean().optional(),\n webpackMemoryOptimizations: z.boolean().optional(),\n turbopackMemoryEviction: z\n .union([z.literal(false), z.literal('full')])\n .optional(),\n turbopackPluginRuntimeStrategy: z\n .enum(['workerThreads', 'childProcesses', 'forceWorkerThreads'])\n .optional(),\n turbopackMinify: z.boolean().optional(),\n turbopackFileSystemCacheForDev: z.boolean().optional(),\n turbopackFileSystemCacheForBuild: z.boolean().optional(),\n turbopackSourceMaps: z.boolean().optional(),\n turbopackInputSourceMaps: z.boolean().optional(),\n turbopackTreeShaking: z.boolean().optional(),\n turbopackRemoveUnusedImports: z.boolean().optional(),\n turbopackRemoveUnusedExports: z.boolean().optional(),\n turbopackScopeHoisting: z.boolean().optional(),\n turbopackWorkerAssetPrefix: z.string().optional(),\n turbopackClientSideNestedAsyncChunking: z.boolean().optional(),\n turbopackServerSideNestedAsyncChunking: z.boolean().optional(),\n turbopackImportTypeBytes: z.boolean().optional(),\n turbopackImportTypeText: z.boolean().optional(),\n turbopackUseBuiltinBabel: z.boolean().optional(),\n turbopackUseBuiltinSass: z.boolean().optional(),\n turbopackLocalPostcssConfig: z.boolean().optional(),\n turbopackModuleIds: z.enum(['named', 'deterministic']).optional(),\n turbopackInferModuleSideEffects: z.boolean().optional(),\n turbopackServerFastRefresh: z.boolean().optional(),\n optimizePackageImports: z.array(z.string()).optional(),\n optimizeServerReact: z.boolean().optional(),\n strictRouteTypes: z.boolean().optional(),\n clientTraceMetadata: z.array(z.string()).optional(),\n serverMinification: z.boolean().optional(),\n serverSourceMaps: z.boolean().optional(),\n useWasmBinary: z.boolean().optional(),\n useLightningcss: z.boolean().optional(),\n lightningCssFeatures: z\n .object({\n include: z.array(z.enum(LIGHTNINGCSS_FEATURE_NAMES)).optional(),\n exclude: z.array(z.enum(LIGHTNINGCSS_FEATURE_NAMES)).optional(),\n })\n .optional(),\n testProxy: z.boolean().optional(),\n defaultTestRunner: z.enum(SUPPORTED_TEST_RUNNERS_LIST).optional(),\n allowDevelopmentBuild: z.literal(true).optional(),\n\n reactDebugChannel: z.boolean().optional(),\n instantInsights: z\n .object({\n validationLevel: z\n .enum([\n 'warning',\n 'manual-warning',\n 'experimental-error',\n 'experimental-manual-error',\n ])\n .optional(),\n })\n .optional(),\n staticGenerationRetryCount: z.number().int().optional(),\n staticGenerationMaxConcurrency: z.number().int().optional(),\n staticGenerationMinPagesPerWorker: z.number().int().optional(),\n typedEnv: z.boolean().optional(),\n serverComponentsHmrCache: z.boolean().optional(),\n authInterrupts: z.boolean().optional(),\n useCache: z.boolean().optional(),\n useCacheTimeout: z.number().positive().optional(),\n slowModuleDetection: z\n .object({\n buildTimeThresholdMs: z.number().int(),\n })\n .optional(),\n globalNotFound: z.boolean().optional(),\n turbopackRustReactCompiler: z.boolean().optional(),\n browserDebugInfoInTerminal: z\n .union([\n z.boolean(),\n z.enum(['error', 'warn', 'verbose']),\n z.object({\n level: z.enum(['error', 'warn', 'verbose']).optional(),\n depthLimit: z.number().int().positive().optional(),\n edgeLimit: z.number().int().positive().optional(),\n showSourceLocation: z.boolean().optional(),\n }),\n ])\n .optional(),\n lockDistDir: z.boolean().optional(),\n hideLogsAfterAbort: z.boolean().optional(),\n runtimeServerDeploymentId: z.boolean().optional(),\n supportsImmutableAssets: z.boolean().optional(),\n deferredEntries: z.array(z.string()).optional(),\n onBeforeDeferredEntries: z.function().returns(z.promise(z.void())).optional(),\n reportSystemEnvInlining: z.enum(['warn', 'error']).optional(),\n}\n\nexport const configSchema: zod.ZodType<NextConfig> = z.lazy(() =>\n z.strictObject({\n adapterPath: z.string().optional(),\n agentRules: z.boolean().optional(),\n allowedDevOrigins: z.array(z.string()).optional(),\n assetPrefix: z.string().optional(),\n basePath: z.string().optional(),\n bundlePagesRouterDependencies: z.boolean().optional(),\n cacheComponents: z.boolean().optional(),\n cacheHandler: z.string().min(1).optional(),\n cacheHandlers: z.record(z.string(), z.string().optional()).optional(),\n cacheLife: z\n .record(\n z.object({\n stale: z.number().optional(),\n revalidate: z.number().optional(),\n expire: z.number().optional(),\n })\n )\n .optional(),\n cacheMaxMemorySize: z.number().optional(),\n cleanDistDir: z.boolean().optional(),\n compiler: z\n .strictObject({\n emotion: z\n .union([\n z.boolean(),\n z.object({\n sourceMap: z.boolean().optional(),\n autoLabel: z\n .union([\n z.literal('always'),\n z.literal('dev-only'),\n z.literal('never'),\n ])\n .optional(),\n labelFormat: z.string().min(1).optional(),\n importMap: z\n .record(\n z.string(),\n z.record(\n z.string(),\n z.object({\n canonicalImport: z\n .tuple([z.string(), z.string()])\n .optional(),\n styledBaseImport: z\n .tuple([z.string(), z.string()])\n .optional(),\n })\n )\n )\n .optional(),\n }),\n ])\n .optional(),\n reactRemoveProperties: z\n .union([\n z.boolean().optional(),\n z.object({\n properties: z.array(z.string()).optional(),\n }),\n ])\n .optional(),\n relay: z\n .object({\n src: z.string(),\n artifactDirectory: z.string().optional(),\n language: z.enum(['javascript', 'typescript', 'flow']).optional(),\n eagerEsModules: z.boolean().optional(),\n })\n .optional(),\n removeConsole: z\n .union([\n z.boolean().optional(),\n z.object({\n exclude: z.array(z.string()).min(1).optional(),\n }),\n ])\n .optional(),\n styledComponents: z.union([\n z.boolean().optional(),\n z.object({\n displayName: z.boolean().optional(),\n topLevelImportPaths: z.array(z.string()).optional(),\n ssr: z.boolean().optional(),\n fileName: z.boolean().optional(),\n meaninglessFileNames: z.array(z.string()).optional(),\n minify: z.boolean().optional(),\n transpileTemplateLiterals: z.boolean().optional(),\n namespace: z.string().min(1).optional(),\n pure: z.boolean().optional(),\n cssProp: z.boolean().optional(),\n }),\n ]),\n styledJsx: z.union([\n z.boolean().optional(),\n z.object({\n useLightningcss: z.boolean().optional(),\n }),\n ]),\n define: z\n .record(z.string(), z.union([z.string(), z.number(), z.boolean()]))\n .optional(),\n defineServer: z\n .record(z.string(), z.union([z.string(), z.number(), z.boolean()]))\n .optional(),\n runAfterProductionCompile: z\n .function()\n .returns(z.promise(z.void()))\n .optional(),\n })\n .optional(),\n compress: z.boolean().optional(),\n configOrigin: z.string().optional(),\n crossOrigin: z\n .union([z.literal('anonymous'), z.literal('use-credentials')])\n .optional(),\n deploymentId: z.string().optional(),\n devIndicators: z\n .union([\n z.object({\n position: z\n .union([\n z.literal('bottom-left'),\n z.literal('bottom-right'),\n z.literal('top-left'),\n z.literal('top-right'),\n ])\n .optional(),\n }),\n z.literal(false),\n ])\n .optional(),\n distDir: z.string().min(1).optional(),\n env: z.record(z.string(), z.union([z.string(), z.undefined()])).optional(),\n enablePrerenderSourceMaps: z.boolean().optional(),\n excludeDefaultMomentLocales: z.boolean().optional(),\n experimental: z.strictObject(experimentalSchema).optional(),\n exportPathMap: z\n .function()\n .args(\n zExportMap,\n z.object({\n dev: z.boolean(),\n dir: z.string(),\n outDir: z.string().nullable(),\n distDir: z.string(),\n buildId: z.string(),\n })\n )\n .returns(z.union([zExportMap, z.promise(zExportMap)]))\n .optional(),\n generateBuildId: z\n .function()\n .args()\n .returns(\n z.union([\n z.string(),\n z.null(),\n z.promise(z.union([z.string(), z.null()])),\n ])\n )\n .optional(),\n generateEtags: z.boolean().optional(),\n headers: z\n .function()\n .args()\n .returns(z.promise(z.array(zHeader)))\n .optional(),\n htmlLimitedBots: z.instanceof(RegExp).optional(),\n httpAgentOptions: z\n .strictObject({ keepAlive: z.boolean().optional() })\n .optional(),\n i18n: z\n .strictObject({\n defaultLocale: z.string().min(1),\n domains: z\n .array(\n z.strictObject({\n defaultLocale: z.string().min(1),\n domain: z.string().min(1),\n http: z.literal(true).optional(),\n locales: z.array(z.string().min(1)).optional(),\n })\n )\n .optional(),\n localeDetection: z.literal(false).optional(),\n locales: z.array(z.string().min(1)),\n })\n .nullable()\n .optional(),\n images: z\n .strictObject({\n localPatterns: z\n .array(\n z.strictObject({\n pathname: z.string().optional(),\n search: z.string().optional(),\n })\n )\n .max(25)\n .optional(),\n remotePatterns: z\n .array(\n z.union([\n z.instanceof(URL),\n z.strictObject({\n hostname: z.string(),\n pathname: z.string().optional(),\n port: z.string().max(5).optional(),\n protocol: z.enum(['http', 'https']).optional(),\n search: z.string().optional(),\n }),\n ])\n )\n .max(50)\n .optional(),\n unoptimized: z.boolean().optional(),\n customCacheHandler: z.boolean().optional(),\n contentSecurityPolicy: z.string().optional(),\n contentDispositionType: z.enum(['inline', 'attachment']).optional(),\n dangerouslyAllowSVG: z.boolean().optional(),\n dangerouslyAllowLocalIP: z.boolean().optional(),\n deviceSizes: z\n .array(z.number().int().gte(1).lte(10000))\n .max(25)\n .optional(),\n disableStaticImages: z.boolean().optional(),\n domains: z.array(z.string()).max(50).optional(),\n formats: z\n .array(z.enum(['image/avif', 'image/webp']))\n .max(4)\n .optional(),\n imageSizes: z\n .array(z.number().int().gte(1).lte(10000))\n .min(0)\n .max(25)\n .optional(),\n loader: z.enum(VALID_LOADERS).optional(),\n loaderFile: z.string().optional(),\n maximumDiskCacheSize: z.number().int().min(0).optional(),\n maximumRedirects: z.number().int().min(0).max(20).optional(),\n maximumResponseBody: z\n .number()\n .int()\n .min(1)\n .max(Number.MAX_SAFE_INTEGER)\n .optional(),\n minimumCacheTTL: z.number().int().gte(0).optional(),\n path: z.string().optional(),\n qualities: z\n .array(z.number().int().gte(1).lte(100))\n .min(1)\n .max(20)\n .optional(),\n })\n .optional(),\n logging: z\n .union([\n z.object({\n fetches: z\n .object({\n fullUrl: z.boolean().optional(),\n hmrRefreshes: z.boolean().optional(),\n })\n .optional(),\n incomingRequests: z\n .union([\n z.boolean(),\n z.object({\n ignore: z.array(z.instanceof(RegExp)),\n }),\n ])\n .optional(),\n serverFunctions: z.boolean().optional(),\n browserToTerminal: z\n .union([z.boolean(), z.enum(['error', 'warn'])])\n .optional(),\n }),\n z.literal(false),\n ])\n .optional(),\n modularizeImports: z\n .record(\n z.string(),\n z.object({\n transform: z.union([z.string(), z.record(z.string(), z.string())]),\n preventFullImport: z.boolean().optional(),\n skipDefaultConversion: z.boolean().optional(),\n })\n )\n .optional(),\n onDemandEntries: z\n .strictObject({\n maxInactiveAge: z.number().optional(),\n pagesBufferLength: z.number().optional(),\n })\n .optional(),\n output: z.enum(['standalone', 'export']).optional(),\n outputFileTracingRoot: z.string().optional(),\n outputFileTracingExcludes: z\n .record(z.string(), z.array(z.string()))\n .optional(),\n outputFileTracingIncludes: z\n .record(z.string(), z.array(z.string()))\n .optional(),\n pageExtensions: z.array(z.string()).min(1).optional(),\n instrumentationClientInject: z.array(z.string()).optional(),\n partialPrefetching: z\n .union([z.boolean(), z.literal('unstable_eager')])\n .optional(),\n poweredByHeader: z.boolean().optional(),\n productionBrowserSourceMaps: z.boolean().optional(),\n reactCompiler: z.union([\n z.boolean(),\n z\n .object({\n compilationMode: z.enum(['infer', 'annotation', 'all']).optional(),\n panicThreshold: z\n .enum(['none', 'critical_errors', 'all_errors'])\n .optional(),\n })\n .optional(),\n ]),\n reactProductionProfiling: z.boolean().optional(),\n reactStrictMode: z.boolean().nullable().optional(),\n reactMaxHeadersLength: z.number().nonnegative().int().optional(),\n redirects: z\n .function()\n .args()\n .returns(z.promise(z.array(zRedirect)))\n .optional(),\n rewrites: z\n .function()\n .args()\n .returns(\n z.promise(\n z.union([\n z.array(zRewrite),\n z.object({\n beforeFiles: z.array(zRewrite),\n afterFiles: z.array(zRewrite),\n fallback: z.array(zRewrite),\n }),\n ])\n )\n )\n .optional(),\n // sassOptions properties are unknown besides implementation, use z.any() here\n sassOptions: z\n .object({\n implementation: z.string().optional(),\n })\n .catchall(z.any())\n .optional(),\n serverExternalPackages: z.array(z.string()).optional(),\n skipMiddlewareUrlNormalize: z.boolean().optional(),\n skipProxyUrlNormalize: z.boolean().optional(),\n skipTrailingSlashRedirect: z.boolean().optional(),\n staticPageGenerationTimeout: z.number().optional(),\n expireTime: z.number().optional(),\n target: z.string().optional(),\n trailingSlash: z.boolean().optional(),\n transpilePackages: z.array(z.string()).optional(),\n turbopack: zTurbopackConfig.optional(),\n typescript: z\n .strictObject({\n ignoreBuildErrors: z.boolean().optional(),\n tsconfigPath: z.string().min(1).optional(),\n })\n .optional(),\n typedRoutes: z.boolean().optional(),\n useFileSystemPublicRoutes: z.boolean().optional(),\n // The webpack config type is unknown, use z.any() here\n webpack: z.any().nullable().optional(),\n watchOptions: z\n .strictObject({\n pollIntervalMs: z.number().positive().finite().optional(),\n })\n .optional(),\n })\n)\n"],"names":["configSchema","experimentalSchema","zSizeLimit","z","custom","val","zExportMap","record","string","object","page","query","any","_fallbackRouteParams","array","optional","_isAppDir","boolean","_isDynamicError","_isRoutePPREnabled","_allowEmptyStaticShell","zRouteHas","union","type","enum","key","value","literal","undefined","zRewrite","source","destination","basePath","locale","has","missing","internal","zRedirect","and","statusCode","never","permanent","number","zHeader","headers","zTurbopackLoaderItem","strictObject","loader","options","zTurbopackLoaderBuiltinCondition","zTurbopackCondition","all","lazy","not","path","instanceof","RegExp","content","contentType","zTurbopackModuleType","zTurbopackRuleConfigItem","loaders","as","condition","zTurbopackRuleConfigCollection","zTurbopackConfig","rules","resolveAlias","resolveExtensions","root","debugIds","chunkLoadingGlobal","ignoreIssue","title","description","outputHashSalt","useSkewCookie","after","appNavFailHandling","appNewScrollHandler","preloadEntriesOnStart","allowedRevalidateHeaderKeys","staleTimes","dynamic","static","gte","cacheLife","stale","revalidate","expire","cacheHandlers","clientRouterFilter","clientRouterFilterRedirects","clientRouterFilterAllowedRate","cpus","memoryBasedWorkersCount","craCompat","caseSensitiveRoutes","clientParamParsingOrigins","cachedNavigations","dynamicOnHover","useOffline","optimisticRouting","appShells","varyParams","prefetchInlining","maxSize","maxBundleSize","disableOptimizedLoading","disablePostcssPresetEnv","cacheComponents","inlineCss","esmExternals","serverActions","bodySizeLimit","allowedOrigins","maxPostponedStateSize","extensionAlias","externalDir","externalMiddlewareRewritesResolve","externalProxyRewritesResolve","exposeTestingApiInProductionBuild","fallbackNodePolyfills","fetchCacheKeyPrefix","forceSwcTransforms","fullySpecified","gzipSize","imgOptConcurrency","int","nullable","imgOptOperationCache","imgOptTimeoutInSeconds","imgOptMaxInputPixels","imgOptSequentialRead","imgOptSkipMetadata","isrFlushToDisk","largePageDataBytes","linkNoTouchStart","manualClientBasePath","middlewarePrefetch","proxyPrefetch","middlewareClientMaxBodySize","proxyClientMaxBodySize","multiZoneDraftMode","cssChunking","requestCost","nonnegative","finite","moduleFactorCost","nextScriptWorkers","optimizeCss","optimisticClientCache","parallelServerCompiles","parallelServerBuildTraces","ppr","readonly","taint","blockingSSR","prerenderEarlyExit","proxyTimeout","rootParams","mcpServer","removeUncaughtErrorAndRejectionListeners","validateRSCRequestHeaders","scrollRestoration","sri","algorithm","swcPlugins","tuple","swcEnvOptions","mode","coreJs","skip","include","exclude","shippedProposals","forceAllTransforms","debug","loose","swcTraceProfiling","urlImports","viewTransition","workerThreads","webVitalsAttribution","mdxRs","development","jsxRuntime","jsxImportSource","providerImportSource","mdxType","transitionIndicator","gestureTransition","typedRoutes","webpackBuildWorker","webpackMemoryOptimizations","turbopackMemoryEviction","turbopackPluginRuntimeStrategy","turbopackMinify","turbopackFileSystemCacheForDev","turbopackFileSystemCacheForBuild","turbopackSourceMaps","turbopackInputSourceMaps","turbopackTreeShaking","turbopackRemoveUnusedImports","turbopackRemoveUnusedExports","turbopackScopeHoisting","turbopackWorkerAssetPrefix","turbopackClientSideNestedAsyncChunking","turbopackServerSideNestedAsyncChunking","turbopackImportTypeBytes","turbopackImportTypeText","turbopackUseBuiltinBabel","turbopackUseBuiltinSass","turbopackLocalPostcssConfig","turbopackModuleIds","turbopackInferModuleSideEffects","turbopackServerFastRefresh","optimizePackageImports","optimizeServerReact","strictRouteTypes","clientTraceMetadata","serverMinification","serverSourceMaps","useWasmBinary","useLightningcss","lightningCssFeatures","LIGHTNINGCSS_FEATURE_NAMES","testProxy","defaultTestRunner","SUPPORTED_TEST_RUNNERS_LIST","allowDevelopmentBuild","reactDebugChannel","instantInsights","validationLevel","staticGenerationRetryCount","staticGenerationMaxConcurrency","staticGenerationMinPagesPerWorker","typedEnv","serverComponentsHmrCache","authInterrupts","useCache","useCacheTimeout","positive","slowModuleDetection","buildTimeThresholdMs","globalNotFound","turbopackRustReactCompiler","browserDebugInfoInTerminal","level","depthLimit","edgeLimit","showSourceLocation","lockDistDir","hideLogsAfterAbort","runtimeServerDeploymentId","supportsImmutableAssets","deferredEntries","onBeforeDeferredEntries","function","returns","promise","void","reportSystemEnvInlining","adapterPath","agentRules","allowedDevOrigins","assetPrefix","bundlePagesRouterDependencies","cacheHandler","min","cacheMaxMemorySize","cleanDistDir","compiler","emotion","sourceMap","autoLabel","labelFormat","importMap","canonicalImport","styledBaseImport","reactRemoveProperties","properties","relay","src","artifactDirectory","language","eagerEsModules","removeConsole","styledComponents","displayName","topLevelImportPaths","ssr","fileName","meaninglessFileNames","minify","transpileTemplateLiterals","namespace","pure","cssProp","styledJsx","define","defineServer","runAfterProductionCompile","compress","configOrigin","crossOrigin","deploymentId","devIndicators","position","distDir","env","enablePrerenderSourceMaps","excludeDefaultMomentLocales","experimental","exportPathMap","args","dev","dir","outDir","buildId","generateBuildId","null","generateEtags","htmlLimitedBots","httpAgentOptions","keepAlive","i18n","defaultLocale","domains","domain","http","locales","localeDetection","images","localPatterns","pathname","search","max","remotePatterns","URL","hostname","port","protocol","unoptimized","customCacheHandler","contentSecurityPolicy","contentDispositionType","dangerouslyAllowSVG","dangerouslyAllowLocalIP","deviceSizes","lte","disableStaticImages","formats","imageSizes","VALID_LOADERS","loaderFile","maximumDiskCacheSize","maximumRedirects","maximumResponseBody","Number","MAX_SAFE_INTEGER","minimumCacheTTL","qualities","logging","fetches","fullUrl","hmrRefreshes","incomingRequests","ignore","serverFunctions","browserToTerminal","modularizeImports","transform","preventFullImport","skipDefaultConversion","onDemandEntries","maxInactiveAge","pagesBufferLength","output","outputFileTracingRoot","outputFileTracingExcludes","outputFileTracingIncludes","pageExtensions","instrumentationClientInject","partialPrefetching","poweredByHeader","productionBrowserSourceMaps","reactCompiler","compilationMode","panicThreshold","reactProductionProfiling","reactStrictMode","reactMaxHeadersLength","redirects","rewrites","beforeFiles","afterFiles","fallback","sassOptions","implementation","catchall","serverExternalPackages","skipMiddlewareUrlNormalize","skipProxyUrlNormalize","skipTrailingSlashRedirect","staticPageGenerationTimeout","expireTime","target","trailingSlash","transpilePackages","turbopack","typescript","ignoreBuildErrors","tsconfigPath","useFileSystemPublicRoutes","webpack","watchOptions","pollIntervalMs"],"mappings":";;;;;;;;;;;;;;;IA4caA,YAAY;eAAZA;;IA9QAC,kBAAkB;eAAlBA;;;6BA7LiB;qBAEZ;8BAaX;0BAOqC;AAE5C,6CAA6C;AAC7C,MAAMC,aAAaC,MAAC,CAACC,MAAM,CAAY,CAACC;IACtC,IAAI,OAAOA,QAAQ,YAAY,OAAOA,QAAQ,UAAU;QACtD,OAAO;IACT;IACA,OAAO;AACT;AAEA,MAAMC,aAAyCH,MAAC,CAACI,MAAM,CACrDJ,MAAC,CAACK,MAAM,IACRL,MAAC,CAACM,MAAM,CAAC;IACPC,MAAMP,MAAC,CAACK,MAAM;IACdG,OAAOR,MAAC,CAACS,GAAG;IAEZ,8BAA8B;IAC9BC,sBAAsBV,MAAC,CAACW,KAAK,CAACX,MAAC,CAACS,GAAG,IAAIG,QAAQ;IAC/CC,WAAWb,MAAC,CAACc,OAAO,GAAGF,QAAQ;IAC/BG,iBAAiBf,MAAC,CAACc,OAAO,GAAGF,QAAQ;IACrCI,oBAAoBhB,MAAC,CAACc,OAAO,GAAGF,QAAQ;IACxCK,wBAAwBjB,MAAC,CAACc,OAAO,GAAGF,QAAQ;AAC9C;AAGF,MAAMM,YAAmClB,MAAC,CAACmB,KAAK,CAAC;IAC/CnB,MAAC,CAACM,MAAM,CAAC;QACPc,MAAMpB,MAAC,CAACqB,IAAI,CAAC;YAAC;YAAU;YAAS;SAAS;QAC1CC,KAAKtB,MAAC,CAACK,MAAM;QACbkB,OAAOvB,MAAC,CAACK,MAAM,GAAGO,QAAQ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GAAGF,QAAQ;QACjC+Y,2BAA2B3Z,MAAC,CAACc,OAAO,GAAGF,QAAQ;QAC/C,uDAAuD;QACvDgZ,SAAS5Z,MAAC,CAACS,GAAG,GAAGqH,QAAQ,GAAGlH,QAAQ;QACpCiZ,cAAc7Z,MAAC,CACZ2C,YAAY,CAAC;YACZmX,gBAAgB9Z,MAAC,CAACuC,MAAM,GAAGwM,QAAQ,GAAG/F,MAAM,GAAGpI,QAAQ;QACzD,GACCA,QAAQ;IACb","ignoreList":[0]} | ||
| {"version":3,"sources":["../../src/server/config-schema.ts"],"sourcesContent":["import type { NextConfig } from './config'\nimport { VALID_LOADERS } from '../shared/lib/image-config'\n\nimport { z } from 'next/dist/compiled/zod'\nimport type zod from 'next/dist/compiled/zod'\n\nimport type { SizeLimit } from '../types'\nimport {\n LIGHTNINGCSS_FEATURE_NAMES,\n type ExportPathMap,\n type TurbopackLoaderItem,\n type TurbopackOptions,\n type TurbopackRuleConfigItem,\n type TurbopackRuleConfigCollection,\n type TurbopackRuleCondition,\n type TurbopackLoaderBuiltinCondition,\n} from './config-shared'\nimport type {\n Header,\n Rewrite,\n RouteHas,\n Redirect,\n} from '../lib/load-custom-routes'\nimport { SUPPORTED_TEST_RUNNERS_LIST } from '../cli/next-test'\n\n// A custom zod schema for the SizeLimit type\nconst zSizeLimit = z.custom<SizeLimit>((val) => {\n if (typeof val === 'number' || typeof val === 'string') {\n return true\n }\n return false\n})\n\nconst zExportMap: zod.ZodType<ExportPathMap> = z.record(\n z.string(),\n z.object({\n page: z.string(),\n query: z.any(), // NextParsedUrlQuery\n\n // private optional properties\n _fallbackRouteParams: z.array(z.any()).optional(),\n _isAppDir: z.boolean().optional(),\n _isDynamicError: z.boolean().optional(),\n _isRoutePPREnabled: z.boolean().optional(),\n _allowEmptyStaticShell: z.boolean().optional(),\n })\n)\n\nconst zRouteHas: zod.ZodType<RouteHas> = z.union([\n z.object({\n type: z.enum(['header', 'query', 'cookie']),\n key: z.string(),\n value: z.string().optional(),\n }),\n z.object({\n type: z.literal('host'),\n key: z.undefined().optional(),\n value: z.string(),\n }),\n])\n\nconst zRewrite: zod.ZodType<Rewrite> = z.object({\n source: z.string(),\n destination: z.string(),\n basePath: z.literal(false).optional(),\n locale: z.literal(false).optional(),\n has: z.array(zRouteHas).optional(),\n missing: z.array(zRouteHas).optional(),\n internal: z.boolean().optional(),\n})\n\nconst zRedirect: zod.ZodType<Redirect> = z\n .object({\n source: z.string(),\n destination: z.string(),\n basePath: z.literal(false).optional(),\n locale: z.literal(false).optional(),\n has: z.array(zRouteHas).optional(),\n missing: z.array(zRouteHas).optional(),\n internal: z.boolean().optional(),\n })\n .and(\n z.union([\n z.object({\n statusCode: z.never().optional(),\n permanent: z.boolean(),\n }),\n z.object({\n statusCode: z.number(),\n permanent: z.never().optional(),\n }),\n ])\n )\n\nconst zHeader: zod.ZodType<Header> = z.object({\n source: z.string(),\n basePath: z.literal(false).optional(),\n locale: z.literal(false).optional(),\n headers: z.array(z.object({ key: z.string(), value: z.string() })),\n has: z.array(zRouteHas).optional(),\n missing: z.array(zRouteHas).optional(),\n\n internal: z.boolean().optional(),\n})\n\nconst zTurbopackLoaderItem: zod.ZodType<TurbopackLoaderItem> = z.union([\n z.string(),\n z.strictObject({\n loader: z.string(),\n // Any JSON value can be used as turbo loader options, so use z.any() here\n options: z.record(z.string(), z.any()).optional(),\n }),\n])\n\nconst zTurbopackLoaderBuiltinCondition: zod.ZodType<TurbopackLoaderBuiltinCondition> =\n z.union([\n z.literal('browser'),\n z.literal('foreign'),\n z.literal('development'),\n z.literal('production'),\n z.literal('node'),\n z.literal('edge-light'),\n ])\n\nconst zTurbopackCondition: zod.ZodType<TurbopackRuleCondition> = z.union([\n z.strictObject({ all: z.lazy(() => z.array(zTurbopackCondition)) }),\n z.strictObject({ any: z.lazy(() => z.array(zTurbopackCondition)) }),\n z.strictObject({ not: z.lazy(() => zTurbopackCondition) }),\n zTurbopackLoaderBuiltinCondition,\n z.strictObject({\n path: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n content: z.instanceof(RegExp).optional(),\n query: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n contentType: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n }),\n])\n\nconst zTurbopackModuleType = z.enum([\n 'asset',\n 'ecmascript',\n 'typescript',\n 'css',\n 'css-module',\n 'wasm',\n 'raw',\n 'node',\n 'bytes',\n])\n\nconst zTurbopackRuleConfigItem: zod.ZodType<TurbopackRuleConfigItem> =\n z.strictObject({\n loaders: z.array(zTurbopackLoaderItem).optional(),\n as: z.string().optional(),\n condition: zTurbopackCondition.optional(),\n type: zTurbopackModuleType.optional(),\n })\n\nconst zTurbopackRuleConfigCollection: zod.ZodType<TurbopackRuleConfigCollection> =\n z.union([\n zTurbopackRuleConfigItem,\n z.array(z.union([zTurbopackLoaderItem, zTurbopackRuleConfigItem])),\n ])\n\nconst zTurbopackConfig: zod.ZodType<TurbopackOptions> = z.strictObject({\n rules: z.record(z.string(), zTurbopackRuleConfigCollection).optional(),\n resolveAlias: z\n .record(\n z.string(),\n z.union([\n z.string(),\n z.array(z.string()),\n z.record(z.string(), z.union([z.string(), z.array(z.string())])),\n ])\n )\n .optional(),\n resolveExtensions: z.array(z.string()).optional(),\n root: z.string().optional(),\n debugIds: z.boolean().optional(),\n chunkLoadingGlobal: z.string().optional(),\n ignoreIssue: z\n .array(\n z.object({\n path: z.union([z.string(), z.instanceof(RegExp)]),\n title: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n description: z.union([z.string(), z.instanceof(RegExp)]).optional(),\n })\n )\n .optional(),\n})\n\nexport const experimentalSchema = {\n outputHashSalt: z.string().optional(),\n useSkewCookie: z.boolean().optional(),\n after: z.boolean().optional(),\n appNavFailHandling: z.boolean().optional(),\n appNewScrollHandler: z.boolean().optional(),\n preloadEntriesOnStart: z.boolean().optional(),\n allowedRevalidateHeaderKeys: z.array(z.string()).optional(),\n staleTimes: z\n .object({\n dynamic: z.number().optional(),\n static: z.number().gte(30).optional(),\n })\n .optional(),\n cacheLife: z\n .record(\n z.object({\n stale: z.number().optional(),\n revalidate: z.number().optional(),\n expire: z.number().optional(),\n })\n )\n .optional(),\n cacheHandlers: z.record(z.string(), z.string().optional()).optional(),\n clientRouterFilter: z.boolean().optional(),\n clientRouterFilterRedirects: z.boolean().optional(),\n clientRouterFilterAllowedRate: z.number().optional(),\n cpus: z.number().optional(),\n memoryBasedWorkersCount: z.boolean().optional(),\n craCompat: z.boolean().optional(),\n caseSensitiveRoutes: z.boolean().optional(),\n clientParamParsingOrigins: z.array(z.string()).optional(),\n cachedNavigations: z.boolean().optional(),\n dynamicOnHover: z.boolean().optional(),\n useOffline: z.boolean().optional(),\n optimisticRouting: z.boolean().optional(),\n instrumentationClientRouterTransitionEvents: z.boolean().optional(),\n appShells: z.boolean().optional(),\n varyParams: z.boolean().optional(),\n prefetchInlining: z\n .union([\n z.boolean(),\n z.object({\n maxSize: z.number().optional(),\n maxBundleSize: z.number().optional(),\n }),\n ])\n .optional(),\n disableOptimizedLoading: z.boolean().optional(),\n disablePostcssPresetEnv: z.boolean().optional(),\n cacheComponents: z.boolean().optional(),\n inlineCss: z.boolean().optional(),\n esmExternals: z.union([z.boolean(), z.literal('loose')]).optional(),\n serverActions: z\n .object({\n bodySizeLimit: zSizeLimit.optional(),\n allowedOrigins: z.array(z.string()).optional(),\n })\n .optional(),\n maxPostponedStateSize: zSizeLimit.optional(),\n // The original type was Record<string, any>\n extensionAlias: z.record(z.string(), z.any()).optional(),\n externalDir: z.boolean().optional(),\n externalMiddlewareRewritesResolve: z.boolean().optional(),\n externalProxyRewritesResolve: z.boolean().optional(),\n exposeTestingApiInProductionBuild: z.boolean().optional(),\n fallbackNodePolyfills: z.literal(false).optional(),\n fetchCacheKeyPrefix: z.string().optional(),\n forceSwcTransforms: z.boolean().optional(),\n fullySpecified: z.boolean().optional(),\n gzipSize: z.boolean().optional(),\n imgOptConcurrency: z.number().int().optional().nullable(),\n imgOptOperationCache: z.boolean().optional().nullable(),\n imgOptTimeoutInSeconds: z.number().int().optional(),\n imgOptMaxInputPixels: z.number().int().optional(),\n imgOptSequentialRead: z.boolean().optional().nullable(),\n imgOptSkipMetadata: z.boolean().optional().nullable(),\n isrFlushToDisk: z.boolean().optional(),\n largePageDataBytes: z.number().optional(),\n linkNoTouchStart: z.boolean().optional(),\n manualClientBasePath: z.boolean().optional(),\n middlewarePrefetch: z.enum(['strict', 'flexible']).optional(),\n proxyPrefetch: z.enum(['strict', 'flexible']).optional(),\n middlewareClientMaxBodySize: zSizeLimit.optional(),\n proxyClientMaxBodySize: zSizeLimit.optional(),\n multiZoneDraftMode: z.boolean().optional(),\n cssChunking: z\n .union([\n z.boolean(),\n z.literal('strict'),\n z.literal('loose'),\n z.literal('graph'),\n z.strictObject({ type: z.literal('strict') }),\n z.strictObject({ type: z.literal('loose') }),\n z.strictObject({\n type: z.literal('graph'),\n requestCost: z.number().nonnegative().finite().optional(),\n moduleFactorCost: z.number().nonnegative().finite().optional(),\n }),\n ])\n .optional(),\n nextScriptWorkers: z.boolean().optional(),\n // The critter option is unknown, use z.any() here\n optimizeCss: z.union([z.boolean(), z.any()]).optional(),\n optimisticClientCache: z.boolean().optional(),\n parallelServerCompiles: z.boolean().optional(),\n parallelServerBuildTraces: z.boolean().optional(),\n ppr: z\n .union([z.boolean(), z.literal('incremental')])\n .readonly()\n .optional(),\n taint: z.boolean().optional(),\n blockingSSR: z.boolean().optional(),\n prerenderEarlyExit: z.boolean().optional(),\n proxyTimeout: z.number().gte(0).optional(),\n rootParams: z.boolean().optional(),\n mcpServer: z.boolean().optional(),\n removeUncaughtErrorAndRejectionListeners: z.boolean().optional(),\n validateRSCRequestHeaders: z.boolean().optional(),\n scrollRestoration: z.boolean().optional(),\n sri: z\n .object({\n algorithm: z.enum(['sha256', 'sha384', 'sha512']).optional(),\n })\n .optional(),\n swcPlugins: z\n // The specific swc plugin's option is unknown, use z.any() here\n .array(z.tuple([z.string(), z.record(z.string(), z.any())]))\n .optional(),\n swcEnvOptions: z\n .object({\n mode: z.enum(['usage', 'entry']).optional(),\n coreJs: z.string().optional(),\n skip: z.array(z.string()).optional(),\n include: z.array(z.string()).optional(),\n exclude: z.array(z.string()).optional(),\n shippedProposals: z.boolean().optional(),\n forceAllTransforms: z.boolean().optional(),\n debug: z.boolean().optional(),\n loose: z.boolean().optional(),\n })\n .optional(),\n swcTraceProfiling: z.boolean().optional(),\n // NonNullable<webpack.Configuration['experiments']>['buildHttp']\n urlImports: z.any().optional(),\n viewTransition: z.boolean().optional(),\n workerThreads: z.boolean().optional(),\n webVitalsAttribution: z\n .array(\n z.union([\n z.literal('CLS'),\n z.literal('FCP'),\n z.literal('FID'),\n z.literal('INP'),\n z.literal('LCP'),\n z.literal('TTFB'),\n ])\n )\n .optional(),\n // This is partial set of mdx-rs transform options we support, aligned\n // with next_core::next_config::MdxRsOptions. Ensure both types are kept in sync.\n mdxRs: z\n .union([\n z.boolean(),\n z.object({\n development: z.boolean().optional(),\n jsxRuntime: z.string().optional(),\n jsxImportSource: z.string().optional(),\n providerImportSource: z.string().optional(),\n mdxType: z.enum(['gfm', 'commonmark']).optional(),\n }),\n ])\n .optional(),\n transitionIndicator: z.boolean().optional(),\n gestureTransition: z.boolean().optional(),\n typedRoutes: z.boolean().optional(),\n webpackBuildWorker: z.boolean().optional(),\n webpackMemoryOptimizations: z.boolean().optional(),\n turbopackMemoryEviction: z\n .union([z.literal(false), z.literal('full')])\n .optional(),\n turbopackPluginRuntimeStrategy: z\n .enum(['workerThreads', 'childProcesses', 'forceWorkerThreads'])\n .optional(),\n turbopackMinify: z.boolean().optional(),\n turbopackFileSystemCacheForDev: z.boolean().optional(),\n turbopackFileSystemCacheForBuild: z.boolean().optional(),\n turbopackSourceMaps: z.boolean().optional(),\n turbopackInputSourceMaps: z.boolean().optional(),\n turbopackTreeShaking: z.boolean().optional(),\n turbopackRemoveUnusedImports: z.boolean().optional(),\n turbopackRemoveUnusedExports: z.boolean().optional(),\n turbopackScopeHoisting: z.boolean().optional(),\n turbopackWorkerAssetPrefix: z.string().optional(),\n turbopackClientSideNestedAsyncChunking: z.boolean().optional(),\n turbopackServerSideNestedAsyncChunking: z.boolean().optional(),\n turbopackImportTypeBytes: z.boolean().optional(),\n turbopackImportTypeText: z.boolean().optional(),\n turbopackUseBuiltinBabel: z.boolean().optional(),\n turbopackUseBuiltinSass: z.boolean().optional(),\n turbopackLocalPostcssConfig: z.boolean().optional(),\n turbopackModuleIds: z.enum(['named', 'deterministic']).optional(),\n turbopackInferModuleSideEffects: z.boolean().optional(),\n turbopackServerFastRefresh: z.boolean().optional(),\n optimizePackageImports: z.array(z.string()).optional(),\n optimizeServerReact: z.boolean().optional(),\n strictRouteTypes: z.boolean().optional(),\n clientTraceMetadata: z.array(z.string()).optional(),\n serverMinification: z.boolean().optional(),\n serverSourceMaps: z.boolean().optional(),\n useWasmBinary: z.boolean().optional(),\n useLightningcss: z.boolean().optional(),\n lightningCssFeatures: z\n .object({\n include: z.array(z.enum(LIGHTNINGCSS_FEATURE_NAMES)).optional(),\n exclude: z.array(z.enum(LIGHTNINGCSS_FEATURE_NAMES)).optional(),\n })\n .optional(),\n testProxy: z.boolean().optional(),\n defaultTestRunner: z.enum(SUPPORTED_TEST_RUNNERS_LIST).optional(),\n allowDevelopmentBuild: z.literal(true).optional(),\n\n reactDebugChannel: z.boolean().optional(),\n instantInsights: z\n .object({\n validationLevel: z\n .enum([\n 'warning',\n 'manual-warning',\n 'experimental-error',\n 'experimental-manual-error',\n ])\n .optional(),\n })\n .optional(),\n staticGenerationRetryCount: z.number().int().optional(),\n staticGenerationMaxConcurrency: z.number().int().optional(),\n staticGenerationMinPagesPerWorker: z.number().int().optional(),\n typedEnv: z.boolean().optional(),\n serverComponentsHmrCache: z.boolean().optional(),\n authInterrupts: z.boolean().optional(),\n useCache: z.boolean().optional(),\n useCacheTimeout: z.number().positive().optional(),\n slowModuleDetection: z\n .object({\n buildTimeThresholdMs: z.number().int(),\n })\n .optional(),\n globalNotFound: z.boolean().optional(),\n turbopackRustReactCompiler: z.boolean().optional(),\n browserDebugInfoInTerminal: z\n .union([\n z.boolean(),\n z.enum(['error', 'warn', 'verbose']),\n z.object({\n level: z.enum(['error', 'warn', 'verbose']).optional(),\n depthLimit: z.number().int().positive().optional(),\n edgeLimit: z.number().int().positive().optional(),\n showSourceLocation: z.boolean().optional(),\n }),\n ])\n .optional(),\n lockDistDir: z.boolean().optional(),\n hideLogsAfterAbort: z.boolean().optional(),\n runtimeServerDeploymentId: z.boolean().optional(),\n supportsImmutableAssets: z.boolean().optional(),\n deferredEntries: z.array(z.string()).optional(),\n onBeforeDeferredEntries: z.function().returns(z.promise(z.void())).optional(),\n reportSystemEnvInlining: z.enum(['warn', 'error']).optional(),\n}\n\nexport const configSchema: zod.ZodType<NextConfig> = z.lazy(() =>\n z.strictObject({\n adapterPath: z.string().optional(),\n agentRules: z.boolean().optional(),\n allowedDevOrigins: z.array(z.string()).optional(),\n assetPrefix: z.string().optional(),\n basePath: z.string().optional(),\n bundlePagesRouterDependencies: z.boolean().optional(),\n cacheComponents: z.boolean().optional(),\n cacheHandler: z.string().min(1).optional(),\n cacheHandlers: z.record(z.string(), z.string().optional()).optional(),\n cacheLife: z\n .record(\n z.object({\n stale: z.number().optional(),\n revalidate: z.number().optional(),\n expire: z.number().optional(),\n })\n )\n .optional(),\n cacheMaxMemorySize: z.number().optional(),\n cleanDistDir: z.boolean().optional(),\n compiler: z\n .strictObject({\n emotion: z\n .union([\n z.boolean(),\n z.object({\n sourceMap: z.boolean().optional(),\n autoLabel: z\n .union([\n z.literal('always'),\n z.literal('dev-only'),\n z.literal('never'),\n ])\n .optional(),\n labelFormat: z.string().min(1).optional(),\n importMap: z\n .record(\n z.string(),\n z.record(\n z.string(),\n z.object({\n canonicalImport: z\n .tuple([z.string(), z.string()])\n .optional(),\n styledBaseImport: z\n .tuple([z.string(), z.string()])\n .optional(),\n })\n )\n )\n .optional(),\n }),\n ])\n .optional(),\n reactRemoveProperties: z\n .union([\n z.boolean().optional(),\n z.object({\n properties: z.array(z.string()).optional(),\n }),\n ])\n .optional(),\n relay: z\n .object({\n src: z.string(),\n artifactDirectory: z.string().optional(),\n language: z.enum(['javascript', 'typescript', 'flow']).optional(),\n eagerEsModules: z.boolean().optional(),\n })\n .optional(),\n removeConsole: z\n .union([\n z.boolean().optional(),\n z.object({\n exclude: z.array(z.string()).min(1).optional(),\n }),\n ])\n .optional(),\n styledComponents: z.union([\n z.boolean().optional(),\n z.object({\n displayName: z.boolean().optional(),\n topLevelImportPaths: z.array(z.string()).optional(),\n ssr: z.boolean().optional(),\n fileName: z.boolean().optional(),\n meaninglessFileNames: z.array(z.string()).optional(),\n minify: z.boolean().optional(),\n transpileTemplateLiterals: z.boolean().optional(),\n namespace: z.string().min(1).optional(),\n pure: z.boolean().optional(),\n cssProp: z.boolean().optional(),\n }),\n ]),\n styledJsx: z.union([\n z.boolean().optional(),\n z.object({\n useLightningcss: z.boolean().optional(),\n }),\n ]),\n define: z\n .record(z.string(), z.union([z.string(), z.number(), z.boolean()]))\n .optional(),\n defineServer: z\n .record(z.string(), z.union([z.string(), z.number(), z.boolean()]))\n .optional(),\n runAfterProductionCompile: z\n .function()\n .returns(z.promise(z.void()))\n .optional(),\n })\n .optional(),\n compress: z.boolean().optional(),\n configOrigin: z.string().optional(),\n crossOrigin: z\n .union([z.literal('anonymous'), z.literal('use-credentials')])\n .optional(),\n deploymentId: z.string().optional(),\n devIndicators: z\n .union([\n z.object({\n position: z\n .union([\n z.literal('bottom-left'),\n z.literal('bottom-right'),\n z.literal('top-left'),\n z.literal('top-right'),\n ])\n .optional(),\n }),\n z.literal(false),\n ])\n .optional(),\n distDir: z.string().min(1).optional(),\n env: z.record(z.string(), z.union([z.string(), z.undefined()])).optional(),\n enablePrerenderSourceMaps: z.boolean().optional(),\n excludeDefaultMomentLocales: z.boolean().optional(),\n experimental: z.strictObject(experimentalSchema).optional(),\n exportPathMap: z\n .function()\n .args(\n zExportMap,\n z.object({\n dev: z.boolean(),\n dir: z.string(),\n outDir: z.string().nullable(),\n distDir: z.string(),\n buildId: z.string(),\n })\n )\n .returns(z.union([zExportMap, z.promise(zExportMap)]))\n .optional(),\n generateBuildId: z\n .function()\n .args()\n .returns(\n z.union([\n z.string(),\n z.null(),\n z.promise(z.union([z.string(), z.null()])),\n ])\n )\n .optional(),\n generateEtags: z.boolean().optional(),\n headers: z\n .function()\n .args()\n .returns(z.promise(z.array(zHeader)))\n .optional(),\n htmlLimitedBots: z.instanceof(RegExp).optional(),\n httpAgentOptions: z\n .strictObject({ keepAlive: z.boolean().optional() })\n .optional(),\n i18n: z\n .strictObject({\n defaultLocale: z.string().min(1),\n domains: z\n .array(\n z.strictObject({\n defaultLocale: z.string().min(1),\n domain: z.string().min(1),\n http: z.literal(true).optional(),\n locales: z.array(z.string().min(1)).optional(),\n })\n )\n .optional(),\n localeDetection: z.literal(false).optional(),\n locales: z.array(z.string().min(1)),\n })\n .nullable()\n .optional(),\n images: z\n .strictObject({\n localPatterns: z\n .array(\n z.strictObject({\n pathname: z.string().optional(),\n search: z.string().optional(),\n })\n )\n .max(25)\n .optional(),\n remotePatterns: z\n .array(\n z.union([\n z.instanceof(URL),\n z.strictObject({\n hostname: z.string(),\n pathname: z.string().optional(),\n port: z.string().max(5).optional(),\n protocol: z.enum(['http', 'https']).optional(),\n search: z.string().optional(),\n }),\n ])\n )\n .max(50)\n .optional(),\n unoptimized: z.boolean().optional(),\n customCacheHandler: z.boolean().optional(),\n contentSecurityPolicy: z.string().optional(),\n contentDispositionType: z.enum(['inline', 'attachment']).optional(),\n dangerouslyAllowSVG: z.boolean().optional(),\n dangerouslyAllowLocalIP: z.boolean().optional(),\n deviceSizes: z\n .array(z.number().int().gte(1).lte(10000))\n .max(25)\n .optional(),\n disableStaticImages: z.boolean().optional(),\n domains: z.array(z.string()).max(50).optional(),\n formats: z\n .array(z.enum(['image/avif', 'image/webp']))\n .max(4)\n .optional(),\n imageSizes: z\n .array(z.number().int().gte(1).lte(10000))\n .min(0)\n .max(25)\n .optional(),\n loader: z.enum(VALID_LOADERS).optional(),\n loaderFile: z.string().optional(),\n maximumDiskCacheSize: z.number().int().min(0).optional(),\n maximumRedirects: z.number().int().min(0).max(20).optional(),\n maximumResponseBody: z\n .number()\n .int()\n .min(1)\n .max(Number.MAX_SAFE_INTEGER)\n .optional(),\n minimumCacheTTL: z.number().int().gte(0).optional(),\n path: z.string().optional(),\n qualities: z\n .array(z.number().int().gte(1).lte(100))\n .min(1)\n .max(20)\n .optional(),\n })\n .optional(),\n logging: z\n .union([\n z.object({\n fetches: z\n .object({\n fullUrl: z.boolean().optional(),\n hmrRefreshes: z.boolean().optional(),\n })\n .optional(),\n incomingRequests: z\n .union([\n z.boolean(),\n z.object({\n ignore: z.array(z.instanceof(RegExp)),\n }),\n ])\n .optional(),\n serverFunctions: z.boolean().optional(),\n browserToTerminal: z\n .union([z.boolean(), z.enum(['error', 'warn'])])\n .optional(),\n }),\n z.literal(false),\n ])\n .optional(),\n modularizeImports: z\n .record(\n z.string(),\n z.object({\n transform: z.union([z.string(), z.record(z.string(), z.string())]),\n preventFullImport: z.boolean().optional(),\n skipDefaultConversion: z.boolean().optional(),\n })\n )\n .optional(),\n onDemandEntries: z\n .strictObject({\n maxInactiveAge: z.number().optional(),\n pagesBufferLength: z.number().optional(),\n })\n .optional(),\n output: z.enum(['standalone', 'export']).optional(),\n outputFileTracingRoot: z.string().optional(),\n outputFileTracingExcludes: z\n .record(z.string(), z.array(z.string()))\n .optional(),\n outputFileTracingIncludes: z\n .record(z.string(), z.array(z.string()))\n .optional(),\n pageExtensions: z.array(z.string()).min(1).optional(),\n instrumentationClientInject: z.array(z.string()).optional(),\n partialPrefetching: z\n .union([z.boolean(), z.literal('unstable_eager')])\n .optional(),\n poweredByHeader: z.boolean().optional(),\n productionBrowserSourceMaps: z.boolean().optional(),\n reactCompiler: z.union([\n z.boolean(),\n z\n .object({\n compilationMode: z.enum(['infer', 'annotation', 'all']).optional(),\n panicThreshold: z\n .enum(['none', 'critical_errors', 'all_errors'])\n .optional(),\n })\n .optional(),\n ]),\n reactProductionProfiling: z.boolean().optional(),\n reactStrictMode: z.boolean().nullable().optional(),\n reactMaxHeadersLength: z.number().nonnegative().int().optional(),\n redirects: z\n .function()\n .args()\n .returns(z.promise(z.array(zRedirect)))\n .optional(),\n rewrites: z\n .function()\n .args()\n .returns(\n z.promise(\n z.union([\n z.array(zRewrite),\n z.object({\n beforeFiles: z.array(zRewrite),\n afterFiles: z.array(zRewrite),\n fallback: z.array(zRewrite),\n }),\n ])\n )\n )\n .optional(),\n // sassOptions properties are unknown besides implementation, use z.any() here\n sassOptions: z\n .object({\n implementation: z.string().optional(),\n })\n .catchall(z.any())\n .optional(),\n serverExternalPackages: z.array(z.string()).optional(),\n skipMiddlewareUrlNormalize: z.boolean().optional(),\n skipProxyUrlNormalize: z.boolean().optional(),\n skipTrailingSlashRedirect: z.boolean().optional(),\n staticPageGenerationTimeout: z.number().optional(),\n expireTime: z.number().optional(),\n target: z.string().optional(),\n trailingSlash: z.boolean().optional(),\n transpilePackages: z.array(z.string()).optional(),\n turbopack: zTurbopackConfig.optional(),\n typescript: z\n .strictObject({\n ignoreBuildErrors: z.boolean().optional(),\n tsconfigPath: z.string().min(1).optional(),\n })\n .optional(),\n typedRoutes: z.boolean().optional(),\n useFileSystemPublicRoutes: z.boolean().optional(),\n // The webpack config type is unknown, use z.any() here\n webpack: z.any().nullable().optional(),\n watchOptions: z\n .strictObject({\n pollIntervalMs: z.number().positive().finite().optional(),\n })\n .optional(),\n })\n)\n"],"names":["configSchema","experimentalSchema","zSizeLimit","z","custom","val","zExportMap","record","string","object","page","query","any","_fallbackRouteParams","array","optional","_isAppDir","boolean","_isDynamicError","_isRoutePPREnabled","_allowEmptyStaticShell","zRouteHas","union","type","enum","key","value","literal","undefined","zRewrite","source","destination","basePath","locale","has","missing","internal","zRedirect","and","statusCode","never","permanent","number","zHeader","headers","zTurbopackLoaderItem","strictObject","loader","options","zTurbopackLoaderBuiltinCondition","zTurbopackCondition","all","lazy","not","path","instanceof","RegExp","content","contentType","zTurbopackModuleType","zTurbopackRuleConfigItem","loaders","as","condition","zTurbopackRuleConfigCollection","zTurbopackConfig","rules","resolveAlias","resolveExtensions","root","debugIds","chunkLoadingGlobal","ignoreIssue","title","description","outputHashSalt","useSkewCookie","after","appNavFailHandling","appNewScrollHandler","preloadEntriesOnStart","allowedRevalidateHeaderKeys","staleTimes","dynamic","static","gte","cacheLife","stale","revalidate","expire","cacheHandlers","clientRouterFilter","clientRouterFilterRedirects","clientRouterFilterAllowedRate","cpus","memoryBasedWorkersCount","craCompat","caseSensitiveRoutes","clientParamParsingOrigins","cachedNavigations","dynamicOnHover","useOffline","optimisticRouting","instrumentationClientRouterTransitionEvents","appShells","varyParams","prefetchInlining","maxSize","maxBundleSize","disableOptimizedLoading","disablePostcssPresetEnv","cacheComponents","inlineCss","esmExternals","serverActions","bodySizeLimit","allowedOrigins","maxPostponedStateSize","extensionAlias","externalDir","externalMiddlewareRewritesResolve","externalProxyRewritesResolve","exposeTestingApiInProductionBuild","fallbackNodePolyfills","fetchCacheKeyPrefix","forceSwcTransforms","fullySpecified","gzipSize","imgOptConcurrency","int","nullable","imgOptOperationCache","imgOptTimeoutInSeconds","imgOptMaxInputPixels","imgOptSequentialRead","imgOptSkipMetadata","isrFlushToDisk","largePageDataBytes","linkNoTouchStart","manualClientBasePath","middlewarePrefetch","proxyPrefetch","middlewareClientMaxBodySize","proxyClientMaxBodySize","multiZoneDraftMode","cssChunking","requestCost","nonnegative","finite","moduleFactorCost","nextScriptWorkers","optimizeCss","optimisticClientCache","parallelServerCompiles","parallelServerBuildTraces","ppr","readonly","taint","blockingSSR","prerenderEarlyExit","proxyTimeout","rootParams","mcpServer","removeUncaughtErrorAndRejectionListeners","validateRSCRequestHeaders","scrollRestoration","sri","algorithm","swcPlugins","tuple","swcEnvOptions","mode","coreJs","skip","include","exclude","shippedProposals","forceAllTransforms","debug","loose","swcTraceProfiling","urlImports","viewTransition","workerThreads","webVitalsAttribution","mdxRs","development","jsxRuntime","jsxImportSource","providerImportSource","mdxType","transitionIndicator","gestureTransition","typedRoutes","webpackBuildWorker","webpackMemoryOptimizations","turbopackMemoryEviction","turbopackPluginRuntimeStrategy","turbopackMinify","turbopackFileSystemCacheForDev","turbopackFileSystemCacheForBuild","turbopackSourceMaps","turbopackInputSourceMaps","turbopackTreeShaking","turbopackRemoveUnusedImports","turbopackRemoveUnusedExports","turbopackScopeHoisting","turbopackWorkerAssetPrefix","turbopackClientSideNestedAsyncChunking","turbopackServerSideNestedAsyncChunking","turbopackImportTypeBytes","turbopackImportTypeText","turbopackUseBuiltinBabel","turbopackUseBuiltinSass","turbopackLocalPostcssConfig","turbopackModuleIds","turbopackInferModuleSideEffects","turbopackServerFastRefresh","optimizePackageImports","optimizeServerReact","strictRouteTypes","clientTraceMetadata","serverMinification","serverSourceMaps","useWasmBinary","useLightningcss","lightningCssFeatures","LIGHTNINGCSS_FEATURE_NAMES","testProxy","defaultTestRunner","SUPPORTED_TEST_RUNNERS_LIST","allowDevelopmentBuild","reactDebugChannel","instantInsights","validationLevel","staticGenerationRetryCount","staticGenerationMaxConcurrency","staticGenerationMinPagesPerWorker","typedEnv","serverComponentsHmrCache","authInterrupts","useCache","useCacheTimeout","positive","slowModuleDetection","buildTimeThresholdMs","globalNotFound","turbopackRustReactCompiler","browserDebugInfoInTerminal","level","depthLimit","edgeLimit","showSourceLocation","lockDistDir","hideLogsAfterAbort","runtimeServerDeploymentId","supportsImmutableAssets","deferredEntries","onBeforeDeferredEntries","function","returns","promise","void","reportSystemEnvInlining","adapterPath","agentRules","allowedDevOrigins","assetPrefix","bundlePagesRouterDependencies","cacheHandler","min","cacheMaxMemorySize","cleanDistDir","compiler","emotion","sourceMap","autoLabel","labelFormat","importMap","canonicalImport","styledBaseImport","reactRemoveProperties","properties","relay","src","artifactDirectory","language","eagerEsModules","removeConsole","styledComponents","displayName","topLevelImportPaths","ssr","fileName","meaninglessFileNames","minify","transpileTemplateLiterals","namespace","pure","cssProp","styledJsx","define","defineServer","runAfterProductionCompile","compress","configOrigin","crossOrigin","deploymentId","devIndicators","position","distDir","env","enablePrerenderSourceMaps","excludeDefaultMomentLocales","experimental","exportPathMap","args","dev","dir","outDir","buildId","generateBuildId","null","generateEtags","htmlLimitedBots","httpAgentOptions","keepAlive","i18n","defaultLocale","domains","domain","http","locales","localeDetection","images","localPatterns","pathname","search","max","remotePatterns","URL","hostname","port","protocol","unoptimized","customCacheHandler","contentSecurityPolicy","contentDispositionType","dangerouslyAllowSVG","dangerouslyAllowLocalIP","deviceSizes","lte","disableStaticImages","formats","imageSizes","VALID_LOADERS","loaderFile","maximumDiskCacheSize","maximumRedirects","maximumResponseBody","Number","MAX_SAFE_INTEGER","minimumCacheTTL","qualities","logging","fetches","fullUrl","hmrRefreshes","incomingRequests","ignore","serverFunctions","browserToTerminal","modularizeImports","transform","preventFullImport","skipDefaultConversion","onDemandEntries","maxInactiveAge","pagesBufferLength","output","outputFileTracingRoot","outputFileTracingExcludes","outputFileTracingIncludes","pageExtensions","instrumentationClientInject","partialPrefetching","poweredByHeader","productionBrowserSourceMaps","reactCompiler","compilationMode","panicThreshold","reactProductionProfiling","reactStrictMode","reactMaxHeadersLength","redirects","rewrites","beforeFiles","afterFiles","fallback","sassOptions","implementation","catchall","serverExternalPackages","skipMiddlewareUrlNormalize","skipProxyUrlNormalize","skipTrailingSlashRedirect","staticPageGenerationTimeout","expireTime","target","trailingSlash","transpilePackages","turbopack","typescript","ignoreBuildErrors","tsconfigPath","useFileSystemPublicRoutes","webpack","watchOptions","pollIntervalMs"],"mappings":";;;;;;;;;;;;;;;IA6caA,YAAY;eAAZA;;IA/QAC,kBAAkB;eAAlBA;;;6BA7LiB;qBAEZ;8BAaX;0BAOqC;AAE5C,6CAA6C;AAC7C,MAAMC,aAAaC,MAAC,CAACC,MAAM,CAAY,CAACC;IACtC,IAAI,OAAOA,QAAQ,YAAY,OAAOA,QAAQ,U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art: true, |
@@ -94,3 +94,3 @@ "use strict"; | ||
| } | ||
| _log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"16.3.0-canary.58"}`))}${versionSuffix}`); | ||
| _log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"16.3.0-canary.59"}`))}${versionSuffix}`); | ||
| if (appUrl) { | ||
@@ -97,0 +97,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.0-canary.58"})`; | ||
| process.title = `next-server (v${"16.3.0-canary.59"})`; | ||
| let handlersReady = ()=>{}; | ||
@@ -183,0 +183,0 @@ let handlersError = ()=>{}; |
@@ -78,3 +78,5 @@ /** | ||
| getBodyResult = "AppRender.getBodyResult", | ||
| fetch = "AppRender.fetch" | ||
| fetch = "AppRender.fetch", | ||
| waitShellReady = "AppRender.waitShellReady", | ||
| renderToNodeFizzStream = "AppRender.renderToNodeFizzStream" | ||
| } | ||
@@ -81,0 +83,0 @@ declare enum RouterSpan { |
@@ -156,2 +156,4 @@ /** | ||
| AppRenderSpan["fetch"] = "AppRender.fetch"; | ||
| AppRenderSpan["waitShellReady"] = "AppRender.waitShellReady"; | ||
| AppRenderSpan["renderToNodeFizzStream"] = "AppRender.renderToNodeFizzStream"; | ||
| return AppRenderSpan; | ||
@@ -158,0 +160,0 @@ }(AppRenderSpan || {}); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/server/lib/trace/constants.ts"],"sourcesContent":["/**\n * Contains predefined constants for the trace span name in next/server.\n *\n * Currently, next/server/tracer is internal implementation only for tracking\n * next.js's implementation only with known span names defined here.\n **/\n\n// eslint typescript has a bug with TS enums\n\nenum BaseServerSpan {\n handleRequest = 'BaseServer.handleRequest',\n run = 'BaseServer.run',\n pipe = 'BaseServer.pipe',\n getStaticHTML = 'BaseServer.getStaticHTML',\n render = 'BaseServer.render',\n renderToResponseWithComponents = 'BaseServer.renderToResponseWithComponents',\n renderToResponse = 'BaseServer.renderToResponse',\n renderToHTML = 'BaseServer.renderToHTML',\n renderError = 'BaseServer.renderError',\n renderErrorToResponse = 'BaseServer.renderErrorToResponse',\n renderErrorToHTML = 'BaseServer.renderErrorToHTML',\n render404 = 'BaseServer.render404',\n}\n\nenum LoadComponentsSpan {\n loadDefaultErrorComponents = 'LoadComponents.loadDefaultErrorComponents',\n loadComponents = 'LoadComponents.loadComponents',\n}\n\nenum NextServerSpan {\n getRequestHandler = 'NextServer.getRequestHandler',\n getRequestHandlerWithMetadata = 'NextServer.getRequestHandlerWithMetadata',\n getServer = 'NextServer.getServer',\n getServerRequestHandler = 'NextServer.getServerRequestHandler',\n createServer = 'createServer.createServer',\n}\n\nenum NextNodeServerSpan {\n compression = 'NextNodeServer.compression',\n getBuildId = 'NextNodeServer.getBuildId',\n createComponentTree = 'NextNodeServer.createComponentTree',\n clientComponentLoading = 'NextNodeServer.clientComponentLoading',\n getLayoutOrPageModule = 'NextNodeServer.getLayoutOrPageModule',\n generateStaticRoutes = 'NextNodeServer.generateStaticRoutes',\n generateFsStaticRoutes = 'NextNodeServer.generateFsStaticRoutes',\n generatePublicRoutes = 'NextNodeServer.generatePublicRoutes',\n generateImageRoutes = 'NextNodeServer.generateImageRoutes.route',\n sendRenderResult = 'NextNodeServer.sendRenderResult',\n proxyRequest = 'NextNodeServer.proxyRequest',\n runApi = 'NextNodeServer.runApi',\n render = 'NextNodeServer.render',\n renderHTML = 'NextNodeServer.renderHTML',\n imageOptimizer = 'NextNodeServer.imageOptimizer',\n getPagePath = 'NextNodeServer.getPagePath',\n getRoutesManifest = 'NextNodeServer.getRoutesManifest',\n findPageComponents = 'NextNodeServer.findPageComponents',\n getFontManifest = 'NextNodeServer.getFontManifest',\n getServerComponentManifest = 'NextNodeServer.getServerComponentManifest',\n getRequestHandler = 'NextNodeServer.getRequestHandler',\n renderToHTML = 'NextNodeServer.renderToHTML',\n renderError = 'NextNodeServer.renderError',\n renderErrorToHTML = 'NextNodeServer.renderErrorToHTML',\n render404 = 'NextNodeServer.render404',\n startResponse = 'NextNodeServer.startResponse',\n\n // nested inner span, does not require parent scope name\n route = 'route',\n onProxyReq = 'onProxyReq',\n apiResolver = 'apiResolver',\n internalFetch = 'internalFetch',\n}\n\nenum StartServerSpan {\n startServer = 'startServer.startServer',\n}\n\nenum RenderSpan {\n getServerSideProps = 'Render.getServerSideProps',\n getStaticProps = 'Render.getStaticProps',\n renderToString = 'Render.renderToString',\n renderDocument = 'Render.renderDocument',\n createBodyResult = 'Render.createBodyResult',\n}\n\nenum AppRenderSpan {\n renderToString = 'AppRender.renderToString',\n renderToReadableStream = 'AppRender.renderToReadableStream',\n getBodyResult = 'AppRender.getBodyResult',\n fetch = 'AppRender.fetch',\n}\n\nenum RouterSpan {\n executeRoute = 'Router.executeRoute',\n}\n\nenum NodeSpan {\n runHandler = 'Node.runHandler',\n}\n\nenum AppRouteRouteHandlersSpan {\n runHandler = 'AppRouteRouteHandlers.runHandler',\n}\n\nenum ResolveMetadataSpan {\n generateMetadata = 'ResolveMetadata.generateMetadata',\n generateViewport = 'ResolveMetadata.generateViewport',\n}\n\nenum MiddlewareSpan {\n execute = 'Middleware.execute',\n}\n\ntype SpanTypes =\n | `${BaseServerSpan}`\n | `${LoadComponentsSpan}`\n | `${NextServerSpan}`\n | `${StartServerSpan}`\n | `${NextNodeServerSpan}`\n | `${RenderSpan}`\n | `${RouterSpan}`\n | `${AppRenderSpan}`\n | `${NodeSpan}`\n | `${AppRouteRouteHandlersSpan}`\n | `${ResolveMetadataSpan}`\n | `${MiddlewareSpan}`\n\n// This list is used to filter out spans that are not relevant to the user\nexport const NextVanillaSpanAllowlist = new Set([\n MiddlewareSpan.execute,\n BaseServerSpan.handleRequest,\n RenderSpan.getServerSideProps,\n RenderSpan.getStaticProps,\n AppRenderSpan.fetch,\n AppRenderSpan.getBodyResult,\n RenderSpan.renderDocument,\n NodeSpan.runHandler,\n AppRouteRouteHandlersSpan.runHandler,\n ResolveMetadataSpan.generateMetadata,\n ResolveMetadataSpan.generateViewport,\n NextNodeServerSpan.createComponentTree,\n NextNodeServerSpan.findPageComponents,\n NextNodeServerSpan.getLayoutOrPageModule,\n NextNodeServerSpan.startResponse,\n NextNodeServerSpan.clientComponentLoading,\n])\n\n// These Spans are allowed to be always logged\n// when the otel log prefix env is set\nexport const LogSpanAllowList = new Set([\n NextNodeServerSpan.findPageComponents,\n NextNodeServerSpan.createComponentTree,\n NextNodeServerSpan.clientComponentLoading,\n])\n\nexport {\n BaseServerSpan,\n LoadComponentsSpan,\n NextServerSpan,\n NextNodeServerSpan,\n StartServerSpan,\n RenderSpan,\n RouterSpan,\n AppRenderSpan,\n NodeSpan,\n AppRouteRouteHandlersSpan,\n ResolveMetadataSpan,\n MiddlewareSpan,\n}\n\nexport type { SpanTypes }\n"],"names":["AppRenderSpan","AppRouteRouteHandlersSpan","BaseServerSpan","LoadComponentsSpan","LogSpanAllowList","MiddlewareSpan","NextNodeServerSpan","NextServerSpan","NextVanillaSpanAllowlist","NodeSpan","RenderSpan","ResolveMetadataSpan","RouterSpan","StartServerSpan","Set"],"mappings":"AAAA;;;;;EAKE,GAEF,4CAA4C;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2J1CA,aAAa;eAAbA;;IAEAC,yBAAyB;eAAzBA;;IATAC,cAAc;eAAdA;;IACAC,kBAAkB;eAAlBA;;IARWC,gBAAgB;eAAhBA;;IAkBXC,cAAc;eAAdA;;IARAC,kBAAkB;eAAlBA;;IADAC,cAAc;eAAdA;;IA9BWC,wBAAwB;eAAxBA;;IAoCXC,QAAQ;eAARA;;IAHAC,UAAU;eAAVA;;IAKAC,mBAAmB;eAAnBA;;IAJAC,UAAU;eAAVA;;IAFAC,eAAe;eAAfA;;;AAtJF,IAAA,AAAKX,wCAAAA;;;;;;;;;;;;;WAAAA;EAAAA;AAeL,IAAA,AAAKC,4CAAAA;;;WAAAA;EAAAA;AAKL,IAAA,AAAKI,wCAAAA;;;;;;WAAAA;EAAAA;AAQL,IAAA,AAAKD,4CAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;IA4BH,wDAAwD;;;;;WA5BrDA;EAAAA;AAmCL,IAAA,AAAKO,yCAAAA;;WAAAA;EAAAA;AAIL,IAAA,AAAKH,oCAAAA;;;;;;WAAAA;EAAAA;AAQL,IAAA,AAAKV,uCAAAA;;;;;WAAAA;EAAAA;AAOL,IAAA,AAAKY,oCAAAA;;WAAAA;EAAAA;AAIL,IAAA,AAAKH,kCAAAA;;WAAAA;EAAAA;AAIL,IAAA,AAAKR,mDAAAA;;WAAAA;EAAAA;AAIL,IAAA,AAAKU,6CAAAA;;;WAAAA;EAAAA;AAKL,IAAA,AAAKN,wCAAAA;;WAAAA;EAAAA;AAmBE,MAAMG,2BAA2B,IAAIM,IAAI;;;;;;;;;;;;;;;;;CAiB/C;AAIM,MAAMV,mBAAmB,IAAIU,IAAI;;;;CAIvC","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/server/lib/trace/constants.ts"],"sourcesContent":["/**\n * Contains predefined constants for the trace span name in next/server.\n *\n * Currently, next/server/tracer is internal implementation only for tracking\n * next.js's implementation only with known span names defined here.\n **/\n\n// eslint typescript has a bug with TS enums\n\nenum BaseServerSpan {\n handleRequest = 'BaseServer.handleRequest',\n run = 'BaseServer.run',\n pipe = 'BaseServer.pipe',\n getStaticHTML = 'BaseServer.getStaticHTML',\n render = 'BaseServer.render',\n renderToResponseWithComponents = 'BaseServer.renderToResponseWithComponents',\n renderToResponse = 'BaseServer.renderToResponse',\n renderToHTML = 'BaseServer.renderToHTML',\n renderError = 'BaseServer.renderError',\n renderErrorToResponse = 'BaseServer.renderErrorToResponse',\n renderErrorToHTML = 'BaseServer.renderErrorToHTML',\n render404 = 'BaseServer.render404',\n}\n\nenum LoadComponentsSpan {\n loadDefaultErrorComponents = 'LoadComponents.loadDefaultErrorComponents',\n loadComponents = 'LoadComponents.loadComponents',\n}\n\nenum NextServerSpan {\n getRequestHandler = 'NextServer.getRequestHandler',\n getRequestHandlerWithMetadata = 'NextServer.getRequestHandlerWithMetadata',\n getServer = 'NextServer.getServer',\n getServerRequestHandler = 'NextServer.getServerRequestHandler',\n createServer = 'createServer.createServer',\n}\n\nenum NextNodeServerSpan {\n compression = 'NextNodeServer.compression',\n getBuildId = 'NextNodeServer.getBuildId',\n createComponentTree = 'NextNodeServer.createComponentTree',\n clientComponentLoading = 'NextNodeServer.clientComponentLoading',\n getLayoutOrPageModule = 'NextNodeServer.getLayoutOrPageModule',\n generateStaticRoutes = 'NextNodeServer.generateStaticRoutes',\n generateFsStaticRoutes = 'NextNodeServer.generateFsStaticRoutes',\n generatePublicRoutes = 'NextNodeServer.generatePublicRoutes',\n generateImageRoutes = 'NextNodeServer.generateImageRoutes.route',\n sendRenderResult = 'NextNodeServer.sendRenderResult',\n proxyRequest = 'NextNodeServer.proxyRequest',\n runApi = 'NextNodeServer.runApi',\n render = 'NextNodeServer.render',\n renderHTML = 'NextNodeServer.renderHTML',\n imageOptimizer = 'NextNodeServer.imageOptimizer',\n getPagePath = 'NextNodeServer.getPagePath',\n getRoutesManifest = 'NextNodeServer.getRoutesManifest',\n findPageComponents = 'NextNodeServer.findPageComponents',\n getFontManifest = 'NextNodeServer.getFontManifest',\n getServerComponentManifest = 'NextNodeServer.getServerComponentManifest',\n getRequestHandler = 'NextNodeServer.getRequestHandler',\n renderToHTML = 'NextNodeServer.renderToHTML',\n renderError = 'NextNodeServer.renderError',\n renderErrorToHTML = 'NextNodeServer.renderErrorToHTML',\n render404 = 'NextNodeServer.render404',\n startResponse = 'NextNodeServer.startResponse',\n\n // nested inner span, does not require parent scope name\n route = 'route',\n onProxyReq = 'onProxyReq',\n apiResolver = 'apiResolver',\n internalFetch = 'internalFetch',\n}\n\nenum StartServerSpan {\n startServer = 'startServer.startServer',\n}\n\nenum RenderSpan {\n getServerSideProps = 'Render.getServerSideProps',\n getStaticProps = 'Render.getStaticProps',\n renderToString = 'Render.renderToString',\n renderDocument = 'Render.renderDocument',\n createBodyResult = 'Render.createBodyResult',\n}\n\nenum AppRenderSpan {\n renderToString = 'AppRender.renderToString',\n renderToReadableStream = 'AppRender.renderToReadableStream',\n getBodyResult = 'AppRender.getBodyResult',\n fetch = 'AppRender.fetch',\n waitShellReady = 'AppRender.waitShellReady',\n renderToNodeFizzStream = 'AppRender.renderToNodeFizzStream',\n}\n\nenum RouterSpan {\n executeRoute = 'Router.executeRoute',\n}\n\nenum NodeSpan {\n runHandler = 'Node.runHandler',\n}\n\nenum AppRouteRouteHandlersSpan {\n runHandler = 'AppRouteRouteHandlers.runHandler',\n}\n\nenum ResolveMetadataSpan {\n generateMetadata = 'ResolveMetadata.generateMetadata',\n generateViewport = 'ResolveMetadata.generateViewport',\n}\n\nenum MiddlewareSpan {\n execute = 'Middleware.execute',\n}\n\ntype SpanTypes =\n | `${BaseServerSpan}`\n | `${LoadComponentsSpan}`\n | `${NextServerSpan}`\n | `${StartServerSpan}`\n | `${NextNodeServerSpan}`\n | `${RenderSpan}`\n | `${RouterSpan}`\n | `${AppRenderSpan}`\n | `${NodeSpan}`\n | `${AppRouteRouteHandlersSpan}`\n | `${ResolveMetadataSpan}`\n | `${MiddlewareSpan}`\n\n// This list is used to filter out spans that are not relevant to the user\nexport const NextVanillaSpanAllowlist = new Set([\n MiddlewareSpan.execute,\n BaseServerSpan.handleRequest,\n RenderSpan.getServerSideProps,\n RenderSpan.getStaticProps,\n AppRenderSpan.fetch,\n AppRenderSpan.getBodyResult,\n RenderSpan.renderDocument,\n NodeSpan.runHandler,\n AppRouteRouteHandlersSpan.runHandler,\n ResolveMetadataSpan.generateMetadata,\n ResolveMetadataSpan.generateViewport,\n NextNodeServerSpan.createComponentTree,\n NextNodeServerSpan.findPageComponents,\n NextNodeServerSpan.getLayoutOrPageModule,\n NextNodeServerSpan.startResponse,\n NextNodeServerSpan.clientComponentLoading,\n])\n\n// These Spans are allowed to be always logged\n// when the otel log prefix env is set\nexport const LogSpanAllowList = new Set([\n NextNodeServerSpan.findPageComponents,\n NextNodeServerSpan.createComponentTree,\n NextNodeServerSpan.clientComponentLoading,\n])\n\nexport {\n BaseServerSpan,\n LoadComponentsSpan,\n NextServerSpan,\n NextNodeServerSpan,\n StartServerSpan,\n RenderSpan,\n RouterSpan,\n AppRenderSpan,\n NodeSpan,\n AppRouteRouteHandlersSpan,\n ResolveMetadataSpan,\n MiddlewareSpan,\n}\n\nexport type { SpanTypes }\n"],"names":["AppRenderSpan","AppRouteRouteHandlersSpan","BaseServerSpan","LoadComponentsSpan","LogSpanAllowList","MiddlewareSpan","NextNodeServerSpan","NextServerSpan","NextVanillaSpanAllowlist","NodeSpan","RenderSpan","ResolveMetadataSpan","RouterSpan","StartServerSpan","Set"],"mappings":"AAAA;;;;;EAKE,GAEF,4CAA4C;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6J1CA,aAAa;eAAbA;;IAEAC,yBAAyB;eAAzBA;;IATAC,cAAc;eAAdA;;IACAC,kBAAkB;eAAlBA;;IARWC,gBAAgB;eAAhBA;;IAkBXC,cAAc;eAAdA;;IARAC,kBAAkB;eAAlBA;;IADAC,cAAc;eAAdA;;IA9BWC,wBAAwB;eAAxBA;;IAoCXC,QAAQ;eAARA;;IAHAC,UAAU;eAAVA;;IAKAC,mBAAmB;eAAnBA;;IAJAC,UAAU;eAAVA;;IAFAC,eAAe;eAAfA;;;AAxJF,IAAA,AAAKX,wCAAAA;;;;;;;;;;;;;WAAAA;EAAAA;AAeL,IAAA,AAAKC,4CAAAA;;;WAAAA;EAAAA;AAKL,IAAA,AAAKI,wCAAAA;;;;;;WAAAA;EAAAA;AAQL,IAAA,AAAKD,4CAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;IA4BH,wDAAwD;;;;;WA5BrDA;EAAAA;AAmCL,IAAA,AAAKO,yCAAAA;;WAAAA;EAAAA;AAIL,IAAA,AAAKH,oCAAAA;;;;;;WAAAA;EAAAA;AAQL,IAAA,AAAKV,uCAAAA;;;;;;;WAAAA;EAAAA;AASL,IAAA,AAAKY,oCAAAA;;WAAAA;EAAAA;AAIL,IAAA,AAAKH,kCAAAA;;WAAAA;EAAAA;AAIL,IAAA,AAAKR,mDAAAA;;WAAAA;EAAAA;AAIL,IAAA,AAAKU,6CAAAA;;;WAAAA;EAAAA;AAKL,IAAA,AAAKN,wCAAAA;;WAAAA;EAAAA;AAmBE,MAAMG,2BAA2B,IAAIM,IAAI;;;;;;;;;;;;;;;;;CAiB/C;AAIM,MAAMV,mBAAmB,IAAIU,IAAI;;;;CAIvC","ignoreList":[0]} |
@@ -24,5 +24,5 @@ "use strict"; | ||
| if (workStore) { | ||
| if (workUnitStore && workUnitStore.phase === 'after' && !(0, _utils.isRequestAPICallableInsideAfter)()) { | ||
| throw Object.defineProperty(new Error(`Route ${workStore.route} used \`connection()\` inside \`after()\`. The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but \`after()\` executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { | ||
| value: "E827", | ||
| if (workUnitStore && !(0, _utils.isRequestApiAllowedInCurrentPhase)(workUnitStore)) { | ||
| throw Object.defineProperty(new Error(`Route ${workStore.route} used \`connection()\` inside \`after()\` while rendering. The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but \`after()\` executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { | ||
| value: "E1369", | ||
| enumerable: false, | ||
@@ -29,0 +29,0 @@ configurable: true |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/server/request/connection.ts"],"sourcesContent":["import { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport {\n throwForMissingRequestStore,\n workUnitAsyncStorage,\n} from '../app-render/work-unit-async-storage.external'\nimport {\n postponeWithTracking,\n throwToInterruptStaticGeneration,\n trackDynamicDataInDynamicRender,\n} from '../app-render/dynamic-rendering'\nimport { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport {\n makeHangingPromise,\n makeDevtoolsIOAwarePromise,\n} from '../dynamic-rendering-utils'\nimport { isRequestAPICallableInsideAfter } from './utils'\nimport { applyOwnerStack } from '../dynamic-rendering-utils'\nimport { RenderStage } from '../app-render/staged-rendering'\nimport { InvariantError } from '../../shared/lib/invariant-error'\n\n/**\n * This function allows you to indicate that you require an actual user Request before continuing.\n *\n * During prerendering it will never resolve and during rendering it resolves immediately.\n */\nexport function connection(): Promise<void> {\n const callingExpression = 'connection'\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workStore) {\n if (\n workUnitStore &&\n workUnitStore.phase === 'after' &&\n !isRequestAPICallableInsideAfter()\n ) {\n throw new Error(\n `Route ${workStore.route} used \\`connection()\\` inside \\`after()\\`. The \\`connection()\\` function is used to indicate the subsequent code must only run when there is an actual Request, but \\`after()\\` executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`\n )\n }\n\n if (workStore.forceStatic) {\n // When using forceStatic, we override all other logic and always just\n // return a resolving promise without tracking.\n return Promise.resolve(undefined)\n }\n\n if (workStore.dynamicShouldError) {\n throw new StaticGenBailoutError(\n `Route ${workStore.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`connection()\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'cache': {\n const error = new Error(\n `Route ${workStore.route} used \\`connection()\\` inside \"use cache\". The \\`connection()\\` function is used to indicate the subsequent code must only run when there is an actual request, but caches must be able to be produced before a request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n Error.captureStackTrace(error, connection)\n applyOwnerStack(error)\n workStore.invalidDynamicUsageError ??= error\n throw error\n }\n case 'private-cache': {\n // It might not be intuitive to throw for private caches as well, but\n // we don't consider runtime prefetches as \"actual requests\" (in the\n // navigation sense), despite allowing them to read cookies.\n const error = new Error(\n `Route ${workStore.route} used \\`connection()\\` inside \"use cache: private\". The \\`connection()\\` function is used to indicate the subsequent code must only run when there is an actual navigation request, but caches must be able to be produced before a navigation request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n Error.captureStackTrace(error, connection)\n applyOwnerStack(error)\n workStore.invalidDynamicUsageError ??= error\n throw error\n }\n case 'unstable-cache':\n throw new Error(\n `Route ${workStore.route} used \\`connection()\\` inside a function cached with \\`unstable_cache()\\`. The \\`connection()\\` function is used to indicate the subsequent code must only run when there is an actual Request, but caches must be able to be produced before a Request so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`\n )\n case 'generate-static-params':\n throw new Error(\n `Route ${workStore.route} used \\`connection()\\` inside \\`generateStaticParams\\`. This is not supported because \\`generateStaticParams\\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`\n )\n case 'prerender':\n case 'prerender-client':\n case 'prerender-runtime':\n // We return a promise that never resolves to allow the prerender to\n // stall at this point.\n return makeHangingPromise(\n workUnitStore.renderSignal,\n workStore.route,\n '`connection()`'\n )\n case 'validation-client': {\n // TODO(NAR-789): make this consistent with the actual browser behavior when we change it.\n // Until then, erroring is fine.\n const exportName = '`connection`'\n throw new InvariantError(\n `${exportName} must not be used within a Client Component. Next.js should be preventing ${exportName} from being included in Client Components statically, but did not in this case.`\n )\n }\n case 'prerender-ppr':\n // We use React's postpone API to interrupt rendering here to create a\n // dynamic hole\n return postponeWithTracking(\n workStore.route,\n 'connection',\n workUnitStore.dynamicTracking\n )\n case 'prerender-legacy':\n // We throw an error here to interrupt prerendering to mark the route\n // as dynamic\n return throwToInterruptStaticGeneration(\n 'connection',\n workStore,\n workUnitStore\n )\n case 'request':\n trackDynamicDataInDynamicRender(workUnitStore)\n if (process.env.NODE_ENV === 'development') {\n // Semantically we only need the dev tracking when running in `next dev`\n // but since you would never use next dev with production NODE_ENV we use this\n // as a proxy so we can statically exclude this code from production builds.\n if (workUnitStore.asyncApiPromises) {\n return workUnitStore.asyncApiPromises.connection\n }\n return makeDevtoolsIOAwarePromise(\n undefined,\n workUnitStore,\n RenderStage.Dynamic\n )\n } else if (workUnitStore.asyncApiPromises) {\n return workUnitStore.asyncApiPromises.connection\n } else {\n return Promise.resolve(undefined)\n }\n default:\n workUnitStore satisfies never\n }\n }\n }\n\n // If we end up here, there was no work store or work unit store present.\n // TODO(NAR-789): connection() is not currently statically prevented from being imported in client components,\n // so we always error about a missing work unit store.\n throwForMissingRequestStore(callingExpression)\n}\n"],"names":["connection","callingExpression","workStore","workAsyncStorage","getStore","workUnitStore","workUnitAsyncStorage","phase","isRequestAPICallableInsideAfter","Error","route","forceStatic","Promise","resolve","undefined","dynamicShouldError","StaticGenBailoutError","type","error","captureStackTrace","applyOwnerStack","invalidDynamicUsageError","makeHangingPromise","renderSignal","exportName","InvariantError","postponeWithTracking","dynamicTracking","throwToInterruptStaticGeneration","trackDynamicDataInDynamicRender","process","env","NODE_ENV","asyncApiPromises","makeDevtoolsIOAwarePromise","RenderStage","Dynamic","throwForMissingRequestStore"],"mappings":";;;;+BAyBgBA;;;eAAAA;;;0CAzBiB;8CAI1B;kCAKA;yCAC+B;uCAI/B;uBACyC;iCAEpB;gCACG;AAOxB,SAASA;IACd,MAAMC,oBAAoB;IAC1B,MAAMC,YAAYC,0CAAgB,CAACC,QAAQ;IAC3C,MAAMC,gBAAgBC,kDAAoB,CAACF,QAAQ;IAEnD,IAAIF,WAAW;QACb,IACEG,iBACAA,cAAcE,KAAK,KAAK,WACxB,CAACC,IAAAA,sCAA+B,KAChC;YACA,MAAM,qBAEL,CAFK,IAAIC,MACR,CAAC,MAAM,EAAEP,UAAUQ,KAAK,CAAC,wUAAwU,CAAC,GAD9V,qB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/server/request/connection.ts"],"sourcesContent":["import { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport {\n throwForMissingRequestStore,\n workUnitAsyncStorage,\n} from '../app-render/work-unit-async-storage.external'\nimport {\n postponeWithTracking,\n throwToInterruptStaticGeneration,\n trackDynamicDataInDynamicRender,\n} from '../app-render/dynamic-rendering'\nimport { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport {\n makeHangingPromise,\n makeDevtoolsIOAwarePromise,\n} from '../dynamic-rendering-utils'\nimport { isRequestApiAllowedInCurrentPhase } from './utils'\nimport { applyOwnerStack } from '../dynamic-rendering-utils'\nimport { RenderStage } from '../app-render/staged-rendering'\nimport { InvariantError } from '../../shared/lib/invariant-error'\n\n/**\n * This function allows you to indicate that you require an actual user Request before continuing.\n *\n * During prerendering it will never resolve and during rendering it resolves immediately.\n */\nexport function connection(): Promise<void> {\n const callingExpression = 'connection'\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workStore) {\n if (workUnitStore && !isRequestApiAllowedInCurrentPhase(workUnitStore)) {\n throw new Error(\n `Route ${workStore.route} used \\`connection()\\` inside \\`after()\\` while rendering. The \\`connection()\\` function is used to indicate the subsequent code must only run when there is an actual Request, but \\`after()\\` executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`\n )\n }\n\n if (workStore.forceStatic) {\n // When using forceStatic, we override all other logic and always just\n // return a resolving promise without tracking.\n return Promise.resolve(undefined)\n }\n\n if (workStore.dynamicShouldError) {\n throw new StaticGenBailoutError(\n `Route ${workStore.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`connection()\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'cache': {\n const error = new Error(\n `Route ${workStore.route} used \\`connection()\\` inside \"use cache\". The \\`connection()\\` function is used to indicate the subsequent code must only run when there is an actual request, but caches must be able to be produced before a request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n Error.captureStackTrace(error, connection)\n applyOwnerStack(error)\n workStore.invalidDynamicUsageError ??= error\n throw error\n }\n case 'private-cache': {\n // It might not be intuitive to throw for private caches as well, but\n // we don't consider runtime prefetches as \"actual requests\" (in the\n // navigation sense), despite allowing them to read cookies.\n const error = new Error(\n `Route ${workStore.route} used \\`connection()\\` inside \"use cache: private\". The \\`connection()\\` function is used to indicate the subsequent code must only run when there is an actual navigation request, but caches must be able to be produced before a navigation request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n Error.captureStackTrace(error, connection)\n applyOwnerStack(error)\n workStore.invalidDynamicUsageError ??= error\n throw error\n }\n case 'unstable-cache':\n throw new Error(\n `Route ${workStore.route} used \\`connection()\\` inside a function cached with \\`unstable_cache()\\`. The \\`connection()\\` function is used to indicate the subsequent code must only run when there is an actual Request, but caches must be able to be produced before a Request so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`\n )\n case 'generate-static-params':\n throw new Error(\n `Route ${workStore.route} used \\`connection()\\` inside \\`generateStaticParams\\`. This is not supported because \\`generateStaticParams\\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`\n )\n case 'prerender':\n case 'prerender-client':\n case 'prerender-runtime':\n // We return a promise that never resolves to allow the prerender to\n // stall at this point.\n return makeHangingPromise(\n workUnitStore.renderSignal,\n workStore.route,\n '`connection()`'\n )\n case 'validation-client': {\n // TODO(NAR-789): make this consistent with the actual browser behavior when we change it.\n // Until then, erroring is fine.\n const exportName = '`connection`'\n throw new InvariantError(\n `${exportName} must not be used within a Client Component. Next.js should be preventing ${exportName} from being included in Client Components statically, but did not in this case.`\n )\n }\n case 'prerender-ppr':\n // We use React's postpone API to interrupt rendering here to create a\n // dynamic hole\n return postponeWithTracking(\n workStore.route,\n 'connection',\n workUnitStore.dynamicTracking\n )\n case 'prerender-legacy':\n // We throw an error here to interrupt prerendering to mark the route\n // as dynamic\n return throwToInterruptStaticGeneration(\n 'connection',\n workStore,\n workUnitStore\n )\n case 'request':\n trackDynamicDataInDynamicRender(workUnitStore)\n if (process.env.NODE_ENV === 'development') {\n // Semantically we only need the dev tracking when running in `next dev`\n // but since you would never use next dev with production NODE_ENV we use this\n // as a proxy so we can statically exclude this code from production builds.\n if (workUnitStore.asyncApiPromises) {\n return workUnitStore.asyncApiPromises.connection\n }\n return makeDevtoolsIOAwarePromise(\n undefined,\n workUnitStore,\n RenderStage.Dynamic\n )\n } else if (workUnitStore.asyncApiPromises) {\n return workUnitStore.asyncApiPromises.connection\n } else {\n return Promise.resolve(undefined)\n }\n default:\n workUnitStore satisfies never\n }\n }\n }\n\n // If we end up here, there was no work store or work unit store present.\n // TODO(NAR-789): connection() is not currently statically prevented from being imported in client components,\n // so we always error about a missing work unit store.\n throwForMissingRequestStore(callingExpression)\n}\n"],"names":["connection","callingExpression","workStore","workAsyncStorage","getStore","workUnitStore","workUnitAsyncStorage","isRequestApiAllowedInCurrentPhase","Error","route","forceStatic","Promise","resolve","undefined","dynamicShouldError","StaticGenBailoutError","type","error","captureStackTrace","applyOwnerStack","invalidDynamicUsageError","makeHangingPromise","renderSignal","exportName","InvariantError","postponeWithTracking","dynamicTracking","throwToInterruptStaticGeneration","trackDynamicDataInDynamicRender","process","env","NODE_ENV","asyncApiPromises","makeDevtoolsIOAwarePromise","RenderStage","Dynamic","throwForMissingRequestStore"],"mappings":";;;;+BAyBgBA;;;eAAAA;;;0CAzBiB;8CAI1B;kCAKA;yCAC+B;uCAI/B;uBAC2C;iCAEtB;gCACG;AAOxB,SAASA;IACd,MAAMC,oBAAoB;IAC1B,MAAMC,YAAYC,0CAAgB,CAACC,QAAQ;IAC3C,MAAMC,gBAAgBC,kDAAoB,CAACF,QAAQ;IAEnD,IAAIF,WAAW;QACb,IAAIG,iBAAiB,CAACE,IAA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AEA,yEAAyE;IACzE,8GAA8G;IAC9G,sDAAsD;IACtD+B,IAAAA,yDAA2B,EAACnC;AAC9B","ignoreList":[0]} |
@@ -27,6 +27,5 @@ "use strict"; | ||
| if (workStore) { | ||
| if (workUnitStore && workUnitStore.phase === 'after' && !(0, _utils.isRequestAPICallableInsideAfter)()) { | ||
| throw Object.defineProperty(new Error(// TODO(after): clarify that this only applies to pages? | ||
| `Route ${workStore.route} used \`cookies()\` inside \`after()\`. This is not supported. If you need this data inside an \`after()\` callback, use \`cookies()\` outside of the callback. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { | ||
| value: "E843", | ||
| if (workUnitStore && !(0, _utils.isRequestApiAllowedInCurrentPhase)(workUnitStore)) { | ||
| throw Object.defineProperty(new Error(`Route ${workStore.route} used \`cookies()\` inside \`after()\` while rendering. This is not supported. If you need this data inside an \`after()\` callback, use \`cookies()\` outside of the callback. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { | ||
| value: "E1373", | ||
| enumerable: false, | ||
@@ -33,0 +32,0 @@ configurable: true |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/server/request/cookies.ts"],"sourcesContent":["import {\n type ReadonlyRequestCookies,\n areCookiesMutableInCurrentPhase,\n RequestCookiesAdapter,\n} from '../web/spec-extension/adapters/request-cookies'\nimport { RequestCookies } from '../web/spec-extension/cookies'\nimport {\n workAsyncStorage,\n type WorkStore,\n} from '../app-render/work-async-storage.external'\nimport {\n throwForMissingRequestStore,\n workUnitAsyncStorage,\n type PrerenderStoreModern,\n type RequestStore,\n isInEarlyRenderStage,\n} from '../app-render/work-unit-async-storage.external'\nimport {\n postponeWithTracking,\n throwToInterruptStaticGeneration,\n trackDynamicDataInDynamicRender,\n} from '../app-render/dynamic-rendering'\nimport { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport {\n makeDevtoolsIOAwarePromise,\n makeHangingPromise,\n getSessionDataStage,\n} from '../dynamic-rendering-utils'\nimport { createDedupedByCallsiteServerErrorLoggerDev } from '../create-deduped-by-callsite-server-error-logger'\nimport { isRequestAPICallableInsideAfter } from './utils'\nimport { applyOwnerStack } from '../dynamic-rendering-utils'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { RenderStage } from '../app-render/staged-rendering'\n\nexport function cookies(): Promise<ReadonlyRequestCookies> {\n const callingExpression = 'cookies'\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workStore) {\n if (\n workUnitStore &&\n workUnitStore.phase === 'after' &&\n !isRequestAPICallableInsideAfter()\n ) {\n throw new Error(\n // TODO(after): clarify that this only applies to pages?\n `Route ${workStore.route} used \\`cookies()\\` inside \\`after()\\`. This is not supported. If you need this data inside an \\`after()\\` callback, use \\`cookies()\\` outside of the callback. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`\n )\n }\n\n if (workStore.forceStatic) {\n // When using forceStatic we override all other logic and always just return an empty\n // cookies object without tracking\n const underlyingCookies = createEmptyCookies()\n return makeUntrackedCookies(underlyingCookies)\n }\n\n if (workStore.dynamicShouldError) {\n throw new StaticGenBailoutError(\n `Route ${workStore.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`cookies()\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'cache':\n const error = new Error(\n `Route ${workStore.route} used \\`cookies()\\` inside \"use cache\". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \\`cookies()\\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n Error.captureStackTrace(error, cookies)\n applyOwnerStack(error)\n workStore.invalidDynamicUsageError ??= error\n throw error\n case 'unstable-cache':\n throw new Error(\n `Route ${workStore.route} used \\`cookies()\\` inside a function cached with \\`unstable_cache()\\`. Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \\`cookies()\\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`\n )\n case 'generate-static-params':\n throw new Error(\n `Route ${workStore.route} used \\`cookies()\\` inside \\`generateStaticParams\\`. This is not supported because \\`generateStaticParams\\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`\n )\n case 'prerender':\n return makeHangingCookies(workStore, workUnitStore)\n case 'prerender-client':\n case 'validation-client':\n const exportName = '`cookies`'\n throw new InvariantError(\n `${exportName} must not be used within a Client Component. Next.js should be preventing ${exportName} from being included in Client Components statically, but did not in this case.`\n )\n case 'prerender-ppr':\n // We need track dynamic access here eagerly to keep continuity with\n // how cookies has worked in PPR without cacheComponents.\n return postponeWithTracking(\n workStore.route,\n callingExpression,\n workUnitStore.dynamicTracking\n )\n case 'prerender-legacy':\n // We track dynamic access here so we don't need to wrap the cookies\n // in individual property access tracking.\n return throwToInterruptStaticGeneration(\n callingExpression,\n workStore,\n workUnitStore\n )\n case 'prerender-runtime': {\n const { stagedRendering } = workUnitStore\n if (stagedRendering) {\n return stagedRendering.delayUntilStage(\n getSessionDataStage(stagedRendering),\n 'cookies',\n workUnitStore.cookies\n )\n } else {\n return makeUntrackedCookies(workUnitStore.cookies)\n }\n }\n case 'private-cache':\n // Private caches are delayed until the runtime stage in use-cache-wrapper,\n // so we don't need an additional delay here.\n return makeUntrackedCookies(workUnitStore.cookies)\n case 'request':\n trackDynamicDataInDynamicRender(workUnitStore)\n\n let underlyingCookies: ReadonlyRequestCookies\n\n if (areCookiesMutableInCurrentPhase(workUnitStore)) {\n // We can't conditionally return different types here based on the context.\n // To avoid confusion, we always return the readonly type here.\n underlyingCookies =\n workUnitStore.userspaceMutableCookies as unknown as ReadonlyRequestCookies\n } else {\n underlyingCookies = workUnitStore.cookies\n }\n\n if (process.env.NODE_ENV === 'development') {\n // Semantically we only need the dev tracking when running in `next dev`\n // but since you would never use next dev with production NODE_ENV we use this\n // as a proxy so we can statically exclude this code from production builds.\n return makeUntrackedCookiesWithDevWarnings(\n workUnitStore,\n underlyingCookies,\n workStore?.route\n )\n } else if (workUnitStore.asyncApiPromises) {\n const early = isInEarlyRenderStage(workUnitStore)\n if (underlyingCookies === workUnitStore.mutableCookies) {\n return early\n ? workUnitStore.asyncApiPromises.earlyMutableCookies\n : workUnitStore.asyncApiPromises.mutableCookies\n } else {\n return early\n ? workUnitStore.asyncApiPromises.earlyCookies\n : workUnitStore.asyncApiPromises.cookies\n }\n } else {\n return makeUntrackedCookies(underlyingCookies)\n }\n default:\n workUnitStore satisfies never\n }\n }\n }\n\n // If we end up here, there was no work store or work unit store present.\n throwForMissingRequestStore(callingExpression)\n}\n\nfunction createEmptyCookies(): ReadonlyRequestCookies {\n return RequestCookiesAdapter.seal(new RequestCookies(new Headers({})))\n}\n\ninterface CacheLifetime {}\nconst CachedCookies = new WeakMap<\n CacheLifetime,\n Promise<ReadonlyRequestCookies>\n>()\n\nfunction makeHangingCookies(\n workStore: WorkStore,\n prerenderStore: PrerenderStoreModern\n): Promise<ReadonlyRequestCookies> {\n const cachedPromise = CachedCookies.get(prerenderStore)\n if (cachedPromise) {\n return cachedPromise\n }\n\n const promise = makeHangingPromise<ReadonlyRequestCookies>(\n prerenderStore.renderSignal,\n workStore.route,\n '`cookies()`'\n )\n CachedCookies.set(prerenderStore, promise)\n\n return promise\n}\n\nfunction makeUntrackedCookies(\n underlyingCookies: ReadonlyRequestCookies\n): Promise<ReadonlyRequestCookies> {\n const cachedCookies = CachedCookies.get(underlyingCookies)\n if (cachedCookies) {\n return cachedCookies\n }\n\n const promise = Promise.resolve(underlyingCookies)\n CachedCookies.set(underlyingCookies, promise)\n\n return promise\n}\n\nfunction makeUntrackedCookiesWithDevWarnings(\n requestStore: RequestStore,\n underlyingCookies: ReadonlyRequestCookies,\n route?: string\n): Promise<ReadonlyRequestCookies> {\n if (requestStore.asyncApiPromises) {\n const early = isInEarlyRenderStage(requestStore)\n let promise: Promise<ReadonlyRequestCookies>\n if (underlyingCookies === requestStore.mutableCookies) {\n promise = early\n ? requestStore.asyncApiPromises.earlyMutableCookies\n : requestStore.asyncApiPromises.mutableCookies\n } else if (underlyingCookies === requestStore.cookies) {\n promise = early\n ? requestStore.asyncApiPromises.earlyCookies\n : requestStore.asyncApiPromises.cookies\n } else {\n throw new InvariantError(\n 'Received an underlying cookies object that does not match either `cookies` or `mutableCookies`'\n )\n }\n return instrumentCookiesPromiseWithDevWarnings(promise, route)\n }\n\n const cachedCookies = CachedCookies.get(underlyingCookies)\n if (cachedCookies) {\n return cachedCookies\n }\n\n const promise = makeDevtoolsIOAwarePromise(\n underlyingCookies,\n requestStore,\n RenderStage.ShellRuntime\n )\n\n const proxiedPromise = instrumentCookiesPromiseWithDevWarnings(promise, route)\n\n CachedCookies.set(underlyingCookies, proxiedPromise)\n\n return proxiedPromise\n}\n\nconst warnForSyncAccess = createDedupedByCallsiteServerErrorLoggerDev(\n createCookiesAccessError\n)\n\nfunction instrumentCookiesPromiseWithDevWarnings(\n promise: Promise<ReadonlyRequestCookies>,\n route: string | undefined\n) {\n Object.defineProperties(promise, {\n [Symbol.iterator]: replaceableWarningDescriptorForSymbolIterator(\n promise,\n route\n ),\n size: replaceableWarningDescriptor(promise, 'size', route),\n get: replaceableWarningDescriptor(promise, 'get', route),\n getAll: replaceableWarningDescriptor(promise, 'getAll', route),\n has: replaceableWarningDescriptor(promise, 'has', route),\n set: replaceableWarningDescriptor(promise, 'set', route),\n delete: replaceableWarningDescriptor(promise, 'delete', route),\n clear: replaceableWarningDescriptor(promise, 'clear', route),\n toString: replaceableWarningDescriptor(promise, 'toString', route),\n })\n return promise\n}\n\nfunction replaceableWarningDescriptor(\n target: unknown,\n prop: string,\n route: string | undefined\n) {\n return {\n enumerable: false,\n get() {\n warnForSyncAccess(route, `\\`cookies().${prop}\\``)\n return undefined\n },\n set(value: unknown) {\n Object.defineProperty(target, prop, {\n value,\n writable: true,\n configurable: true,\n })\n },\n configurable: true,\n }\n}\n\nfunction replaceableWarningDescriptorForSymbolIterator(\n target: unknown,\n route: string | undefined\n) {\n return {\n enumerable: false,\n get() {\n warnForSyncAccess(route, '`...cookies()` or similar iteration')\n return undefined\n },\n set(value: unknown) {\n Object.defineProperty(target, Symbol.iterator, {\n value,\n writable: true,\n enumerable: true,\n configurable: true,\n })\n },\n configurable: true,\n }\n}\n\nfunction createCookiesAccessError(\n route: string | undefined,\n expression: string\n) {\n const prefix = route ? `Route \"${route}\" ` : 'This route '\n return new Error(\n `${prefix}used ${expression}. ` +\n `\\`cookies()\\` returns a Promise and must be unwrapped with \\`await\\` or \\`React.use()\\` before accessing its properties. ` +\n `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`\n )\n}\n"],"names":["cookies","callingExpression","workStore","workAsyncStorage","getStore","workUnitStore","workUnitAsyncStorage","phase","isRequestAPICallableInsideAfter","Error","route","forceStatic","underlyingCookies","createEmptyCookies","makeUntrackedCookies","dynamicShouldError","StaticGenBailoutError","type","error","captureStackTrace","applyOwnerStack","invalidDynamicUsageError","makeHangingCookies","exportName","InvariantError","postponeWithTracking","dynamicTracking","throwToInterruptStaticGeneration","stagedRendering","delayUntilStage","getSessionDataStage","trackDynamicDataInDynamicRender","areCookiesMutableInCurrentPhase","userspaceMutableCookies","process","env","NODE_ENV","makeUntrackedCookiesWithDevWarnings","asyncApiPromises","early","isInEarlyRenderStage","mutableCookies","earlyMutableCookies","earlyCookies","throwForMissingRequestStore","RequestCookiesAdapter","seal","RequestCookies","Headers","CachedCookies","WeakMap","prerenderStore","cachedPromise","get","promise","makeHangingPromise","renderSignal","set","cachedCookies","Promise","resolve","requestStore","instrumentCookiesPromiseWithDevWarnings","makeDevtoolsIOAwarePromise","RenderStage","ShellRuntime","proxiedPromise","warnForSyncAccess","createDedupedByCallsiteServerErrorLoggerDev","createCookiesAccessError","Object","defineProperties","Symbol","iterator","replaceableWarningDescriptorForSymbolIterator","size","replaceableWarningDescriptor","getAll","has","delete","clear","toString","target","prop","enumerable","undefined","value","defineProperty","writable","configurable","expression","prefix"],"mappings":";;;;+BAkCgBA;;;eAAAA;;;gCA9BT;yBACwB;0CAIxB;8CAOA;kCAKA;yCAC+B;uCAK/B;0DACqD;uBACZ;gCAEjB;iCACH;AAErB,SAASA;IACd,MAAMC,oBAAoB;IAC1B,MAAMC,YAAYC,0CAAgB,CAACC,QAAQ;IAC3C,MAAMC,gBAAgBC,kDAAoB,CAACF,QAAQ;IAEnD,IAAIF,WAAW;QACb,IACEG,iBACAA,cAAcE,KAAK,KAAK,WACxB,CAACC,IAAAA,sCAA+B,KAChC;YACA,MAAM,qBAGL,CAHK,IAAIC,MACR,wDAAwD;YACxD,CAAC,MAAM,EAAEP,UAAUQ,KAAK,CAAC,6OAA6O,CAAC,GAFnQ,qBAAA;uBAAA;4BAAA;8BAAA;YAGN;QACF;QAEA,IAAIR,UAAUS,WAAW,EAAE;YACzB,qFAAqF;YACrF,kCAAkC;YAClC,MAAMC,oBAAoBC;YAC1B,OAAOC,qBAAqBF;QAC9B;QAEA,IAAIV,UAAUa,kBAAkB,EAAE;YAChC,MAAM,qBAEL,CAFK,IAAIC,8CAAqB,CAC7B,CAAC,MAAM,EAAEd,UAAUQ,KAAK,CAAC,mNAAmN,CAAC,GADzO,qBAAA;uBAAA;4BAAA;8BAAA;YAEN;QACF;QAEA,IAAIL,eAAe;YACjB,OAAQA,cAAcY,IAAI;gBACxB,KAAK;oBACH,MAAMC,QAAQ,qBAEb,CAFa,IAAIT,MAChB,CAAC,MAAM,EAAEP,UAAUQ,KAAK,CAAC,kVAAkV,CAAC,GADhW,qBAAA;+BAAA;oCAAA;sCAAA;oBAEd;oBACAD,MAAMU,iBAAiB,CAACD,OAAOlB;oBAC/BoB,IAAAA,sCAAe,EAACF;oBAChBhB,UAAUmB,wBAAwB,KAAKH;oBACvC,MAAMA;gBACR,KAAK;oBACH,MAAM,qBAEL,CAFK,IAAIT,M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AAO5C;QAClDqE,QAAQH,6BAA6BtB,SAAS,UAAU5C;QACxDsE,OAAOJ,6BAA6BtB,SAAS,SAAS5C;QACtDuE,UAAUL,6BAA6BtB,SAAS,YAAY5C;IAC9D;IACA,OAAO4C;AACT;AAEA,SAASsB,6BACPM,MAAe,EACfC,IAAY,EACZzE,KAAyB;IAEzB,OAAO;QACL0E,YAAY;QACZ/B;YACEc,kBAAkBzD,OAAO,CAAC,YAAY,EAAEyE,KAAK,EAAE,CAAC;YAChD,OAAOE;QACT;QACA5B,KAAI6B,KAAc;YAChBhB,OAAOiB,cAAc,CAACL,QAAQC,MAAM;gBAClCG;gBACAE,UAAU;gBACVC,cAAc;YAChB;QACF;QACAA,cAAc;IAChB;AACF;AAEA,SAASf,8CACPQ,MAAe,EACfxE,KAAyB;IAEzB,OAAO;QACL0E,YAAY;QACZ/B;YACEc,kBAAkBzD,OAAO;YACzB,OAAO2E;QACT;QACA5B,KAAI6B,KAAc;YAChBhB,OAAOiB,cAAc,CAACL,QAAQV,OAAOC,QAAQ,EAAE;gBAC7Ca;gBACAE,UAAU;gBACVJ,YAAY;gBACZK,cAAc;YAChB;QACF;QACAA,cAAc;IAChB;AACF;AAEA,SAASpB,yBACP3D,KAAyB,EACzBgF,UAAkB;IAElB,MAAMC,SAASjF,QAAQ,CAAC,OAAO,EAAEA,MAAM,EAAE,CAAC,GAAG;IAC7C,OAAO,qBAIN,CAJM,IAAID,MACT,GAAGkF,OAAO,KAAK,EAAED,WAAW,EAAE,CAAC,GAC7B,CAAC,yHAAyH,CAAC,GAC3H,CAAC,8DAA8D,CAAC,GAH7D,qBAAA;eAAA;oBAAA;sBAAA;IAIP;AACF","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/server/request/cookies.ts"],"sourcesContent":["import {\n type ReadonlyRequestCookies,\n areCookiesMutableInCurrentPhase,\n RequestCookiesAdapter,\n} from '../web/spec-extension/adapters/request-cookies'\nimport { RequestCookies } from '../web/spec-extension/cookies'\nimport {\n workAsyncStorage,\n type WorkStore,\n} from '../app-render/work-async-storage.external'\nimport {\n throwForMissingRequestStore,\n workUnitAsyncStorage,\n type PrerenderStoreModern,\n type RequestStore,\n isInEarlyRenderStage,\n} from '../app-render/work-unit-async-storage.external'\nimport {\n postponeWithTracking,\n throwToInterruptStaticGeneration,\n trackDynamicDataInDynamicRender,\n} from '../app-render/dynamic-rendering'\nimport { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport {\n makeDevtoolsIOAwarePromise,\n makeHangingPromise,\n getSessionDataStage,\n} from '../dynamic-rendering-utils'\nimport { createDedupedByCallsiteServerErrorLoggerDev } from '../create-deduped-by-callsite-server-error-logger'\nimport { isRequestApiAllowedInCurrentPhase } from './utils'\nimport { applyOwnerStack } from '../dynamic-rendering-utils'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { RenderStage } from '../app-render/staged-rendering'\n\nexport function cookies(): Promise<ReadonlyRequestCookies> {\n const callingExpression = 'cookies'\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workStore) {\n if (workUnitStore && !isRequestApiAllowedInCurrentPhase(workUnitStore)) {\n throw new Error(\n `Route ${workStore.route} used \\`cookies()\\` inside \\`after()\\` while rendering. This is not supported. If you need this data inside an \\`after()\\` callback, use \\`cookies()\\` outside of the callback. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`\n )\n }\n\n if (workStore.forceStatic) {\n // When using forceStatic we override all other logic and always just return an empty\n // cookies object without tracking\n const underlyingCookies = createEmptyCookies()\n return makeUntrackedCookies(underlyingCookies)\n }\n\n if (workStore.dynamicShouldError) {\n throw new StaticGenBailoutError(\n `Route ${workStore.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`cookies()\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'cache':\n const error = new Error(\n `Route ${workStore.route} used \\`cookies()\\` inside \"use cache\". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \\`cookies()\\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n Error.captureStackTrace(error, cookies)\n applyOwnerStack(error)\n workStore.invalidDynamicUsageError ??= error\n throw error\n case 'unstable-cache':\n throw new Error(\n `Route ${workStore.route} used \\`cookies()\\` inside a function cached with \\`unstable_cache()\\`. Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \\`cookies()\\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`\n )\n case 'generate-static-params':\n throw new Error(\n `Route ${workStore.route} used \\`cookies()\\` inside \\`generateStaticParams\\`. This is not supported because \\`generateStaticParams\\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`\n )\n case 'prerender':\n return makeHangingCookies(workStore, workUnitStore)\n case 'prerender-client':\n case 'validation-client':\n const exportName = '`cookies`'\n throw new InvariantError(\n `${exportName} must not be used within a Client Component. Next.js should be preventing ${exportName} from being included in Client Components statically, but did not in this case.`\n )\n case 'prerender-ppr':\n // We need track dynamic access here eagerly to keep continuity with\n // how cookies has worked in PPR without cacheComponents.\n return postponeWithTracking(\n workStore.route,\n callingExpression,\n workUnitStore.dynamicTracking\n )\n case 'prerender-legacy':\n // We track dynamic access here so we don't need to wrap the cookies\n // in individual property access tracking.\n return throwToInterruptStaticGeneration(\n callingExpression,\n workStore,\n workUnitStore\n )\n case 'prerender-runtime': {\n const { stagedRendering } = workUnitStore\n if (stagedRendering) {\n return stagedRendering.delayUntilStage(\n getSessionDataStage(stagedRendering),\n 'cookies',\n workUnitStore.cookies\n )\n } else {\n return makeUntrackedCookies(workUnitStore.cookies)\n }\n }\n case 'private-cache':\n // Private caches are delayed until the runtime stage in use-cache-wrapper,\n // so we don't need an additional delay here.\n return makeUntrackedCookies(workUnitStore.cookies)\n case 'request':\n trackDynamicDataInDynamicRender(workUnitStore)\n\n let underlyingCookies: ReadonlyRequestCookies\n\n if (areCookiesMutableInCurrentPhase(workUnitStore)) {\n // We can't conditionally return different types here based on the context.\n // To avoid confusion, we always return the readonly type here.\n underlyingCookies =\n workUnitStore.userspaceMutableCookies as unknown as ReadonlyRequestCookies\n } else {\n underlyingCookies = workUnitStore.cookies\n }\n\n if (process.env.NODE_ENV === 'development') {\n // Semantically we only need the dev tracking when running in `next dev`\n // but since you would never use next dev with production NODE_ENV we use this\n // as a proxy so we can statically exclude this code from production builds.\n return makeUntrackedCookiesWithDevWarnings(\n workUnitStore,\n underlyingCookies,\n workStore?.route\n )\n } else if (workUnitStore.asyncApiPromises) {\n const early = isInEarlyRenderStage(workUnitStore)\n if (underlyingCookies === workUnitStore.mutableCookies) {\n return early\n ? workUnitStore.asyncApiPromises.earlyMutableCookies\n : workUnitStore.asyncApiPromises.mutableCookies\n } else {\n return early\n ? workUnitStore.asyncApiPromises.earlyCookies\n : workUnitStore.asyncApiPromises.cookies\n }\n } else {\n return makeUntrackedCookies(underlyingCookies)\n }\n default:\n workUnitStore satisfies never\n }\n }\n }\n\n // If we end up here, there was no work store or work unit store present.\n throwForMissingRequestStore(callingExpression)\n}\n\nfunction createEmptyCookies(): ReadonlyRequestCookies {\n return RequestCookiesAdapter.seal(new RequestCookies(new Headers({})))\n}\n\ninterface CacheLifetime {}\nconst CachedCookies = new WeakMap<\n CacheLifetime,\n Promise<ReadonlyRequestCookies>\n>()\n\nfunction makeHangingCookies(\n workStore: WorkStore,\n prerenderStore: PrerenderStoreModern\n): Promise<ReadonlyRequestCookies> {\n const cachedPromise = CachedCookies.get(prerenderStore)\n if (cachedPromise) {\n return cachedPromise\n }\n\n const promise = makeHangingPromise<ReadonlyRequestCookies>(\n prerenderStore.renderSignal,\n workStore.route,\n '`cookies()`'\n )\n CachedCookies.set(prerenderStore, promise)\n\n return promise\n}\n\nfunction makeUntrackedCookies(\n underlyingCookies: ReadonlyRequestCookies\n): Promise<ReadonlyRequestCookies> {\n const cachedCookies = CachedCookies.get(underlyingCookies)\n if (cachedCookies) {\n return cachedCookies\n }\n\n const promise = Promise.resolve(underlyingCookies)\n CachedCookies.set(underlyingCookies, promise)\n\n return promise\n}\n\nfunction makeUntrackedCookiesWithDevWarnings(\n requestStore: RequestStore,\n underlyingCookies: ReadonlyRequestCookies,\n route?: string\n): Promise<ReadonlyRequestCookies> {\n if (requestStore.asyncApiPromises) {\n const early = isInEarlyRenderStage(requestStore)\n let promise: Promise<ReadonlyRequestCookies>\n if (underlyingCookies === requestStore.mutableCookies) {\n promise = early\n ? requestStore.asyncApiPromises.earlyMutableCookies\n : requestStore.asyncApiPromises.mutableCookies\n } else if (underlyingCookies === requestStore.cookies) {\n promise = early\n ? requestStore.asyncApiPromises.earlyCookies\n : requestStore.asyncApiPromises.cookies\n } else {\n throw new InvariantError(\n 'Received an underlying cookies object that does not match either `cookies` or `mutableCookies`'\n )\n }\n return instrumentCookiesPromiseWithDevWarnings(promise, route)\n }\n\n const cachedCookies = CachedCookies.get(underlyingCookies)\n if (cachedCookies) {\n return cachedCookies\n }\n\n const promise = makeDevtoolsIOAwarePromise(\n underlyingCookies,\n requestStore,\n RenderStage.ShellRuntime\n )\n\n const proxiedPromise = instrumentCookiesPromiseWithDevWarnings(promise, route)\n\n CachedCookies.set(underlyingCookies, proxiedPromise)\n\n return proxiedPromise\n}\n\nconst warnForSyncAccess = createDedupedByCallsiteServerErrorLoggerDev(\n createCookiesAccessError\n)\n\nfunction instrumentCookiesPromiseWithDevWarnings(\n promise: Promise<ReadonlyRequestCookies>,\n route: string | undefined\n) {\n Object.defineProperties(promise, {\n [Symbol.iterator]: replaceableWarningDescriptorForSymbolIterator(\n promise,\n route\n ),\n size: replaceableWarningDescriptor(promise, 'size', route),\n get: replaceableWarningDescriptor(promise, 'get', route),\n getAll: replaceableWarningDescriptor(promise, 'getAll', route),\n has: replaceableWarningDescriptor(promise, 'has', route),\n set: replaceableWarningDescriptor(promise, 'set', route),\n delete: replaceableWarningDescriptor(promise, 'delete', route),\n clear: replaceableWarningDescriptor(promise, 'clear', route),\n toString: replaceableWarningDescriptor(promise, 'toString', route),\n })\n return promise\n}\n\nfunction replaceableWarningDescriptor(\n target: unknown,\n prop: string,\n route: string | undefined\n) {\n return {\n enumerable: false,\n get() {\n warnForSyncAccess(route, `\\`cookies().${prop}\\``)\n return undefined\n },\n set(value: unknown) {\n Object.defineProperty(target, prop, {\n value,\n writable: true,\n configurable: true,\n })\n },\n configurable: true,\n }\n}\n\nfunction replaceableWarningDescriptorForSymbolIterator(\n target: unknown,\n route: string | undefined\n) {\n return {\n enumerable: false,\n get() {\n warnForSyncAccess(route, '`...cookies()` or similar iteration')\n return undefined\n },\n set(value: unknown) {\n Object.defineProperty(target, Symbol.iterator, {\n value,\n writable: true,\n enumerable: true,\n configurable: true,\n })\n },\n configurable: true,\n }\n}\n\nfunction createCookiesAccessError(\n route: string | undefined,\n expression: string\n) {\n const prefix = route ? `Route \"${route}\" ` : 'This route '\n return new Error(\n `${prefix}used ${expression}. ` +\n `\\`cookies()\\` returns a Promise and must be unwrapped with \\`await\\` or \\`React.use()\\` before accessing its properties. ` +\n `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`\n )\n}\n"],"names":["cookies","callingExpression","workStore","workAsyncStorage","getStore","workUnitStore","workUnitAsyncStorage","isRequestApiAllowedInCurrentPhase","Error","route","forceStatic","underlyingCookies","createEmptyCookies","makeUntrackedCookies","dynamicShouldError","StaticGenBailoutError","type","error","captureStackTrace","applyOwnerStack","invalidDynamicUsageError","makeHangingCookies","exportName","InvariantError","postponeWithTracking","dynamicTracking","throwToInterruptStaticGeneration","stagedRendering","delayUntilStage","getSessionDataStage","trackDynamicDataInDynamicRender","areCookiesMutableInCurrentPhase","userspaceMutableCookies","process","env","NODE_ENV","makeUntrackedCookiesWithDevWarnings","asyncApiPromises","early","isInEarlyRenderStage","mutableCookies","earlyMutableCookies","earlyCookies","throwForMissingRequestStore","RequestCookiesAdapter","seal","RequestCookies","Headers","CachedCookies","WeakMap","prerenderStore","cachedPromise","get","promise","makeHangingPromise","renderSignal","set","cachedCookies","Promise","resolve","requestStore","instrumentCookiesPromiseWithDevWarnings","makeDevtoolsIOAwarePromise","RenderStage","ShellRuntime","proxiedPromise","warnForSyncAccess","createDedupedByCallsiteServerErrorLoggerDev","createCookiesAccessError","Object","defineProperties","Symbol","iterator","replaceableWarningDescriptorForSymbolIterator","size","replaceableWarningDescriptor","getAll","has","delete","clear","toString","target","prop","enumerable","undefined","value","defineProperty","writable","configurable","expression","prefix"],"mappings":";;;;+BAkCgBA;;;eAAAA;;;gCA9BT;yBACwB;0CAIxB;8CAOA;kCAKA;yCAC+B;uCAK/B;0DACqD;uBACV;gCAEnB;iCACH;AAErB,SAASA;IACd,MAAMC,oBAAoB;IAC1B,MAAMC,YAAYC,0CAAgB,CAACC,QAAQ;IAC3C,MAAMC,gBAAgBC,kDAAoB,CAACF,QAAQ;IAEnD,IAAIF,WAAW;QACb,IAAIG,iBAAiB,CAACE,IAAAA,wCAAiC,EAACF,gBAAgB;YACtE,MAAM,qBAEL,CAFK,IAAIG,MACR,CAAC,MAAM,EAAEN,UAAUO,KAAK,CAAC,6PAA6P,CAAC,GADnR,qBAAA;uBAAA;4BAAA;8BAAA;YAEN;QACF;QAEA,IAAIP,UAAUQ,WAAW,EAAE;YACzB,qFAAqF;YACrF,kCAAkC;YAClC,MAAMC,oBAAoBC;YAC1B,OAAOC,qBAAqBF;QAC9B;QAEA,IAAIT,UAAUY,kBAAkB,EAAE;YAChC,MAAM,qBAEL,CAFK,IAAIC,8CAAqB,CAC7B,CAAC,MAAM,EAAEb,UAAUO,KAAK,CAAC,mNAAmN,CAAC,GADzO,qBAAA;uBAAA;4BAAA;8BAAA;YAEN;QACF;QAEA,IAAIJ,eAAe;YACjB,OAAQA,cAAcW,IAAI;gBACxB,KAAK;oBACH,MAAMC,QAAQ,qBAEb,CAFa,IAAIT,MA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AC,8DAA8D,CAAC,GAH7D,qBAAA;eAAA;oBAAA;sBAAA;IAIP;AACF","ignoreList":[0]} |
@@ -26,5 +26,5 @@ "use strict"; | ||
| if (workStore) { | ||
| if (workUnitStore && workUnitStore.phase === 'after' && !(0, _utils.isRequestAPICallableInsideAfter)()) { | ||
| throw Object.defineProperty(new Error(`Route ${workStore.route} used \`headers()\` inside \`after()\`. This is not supported. If you need this data inside an \`after()\` callback, use \`headers()\` outside of the callback. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { | ||
| value: "E839", | ||
| if (workUnitStore && !(0, _utils.isRequestApiAllowedInCurrentPhase)(workUnitStore)) { | ||
| throw Object.defineProperty(new Error(`Route ${workStore.route} used \`headers()\` inside \`after()\` while rendering. This is not supported. If you need this data inside an \`after()\` callback, use \`headers()\` outside of the callback. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { | ||
| value: "E1370", | ||
| enumerable: false, | ||
@@ -31,0 +31,0 @@ configurable: true |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/server/request/headers.ts"],"sourcesContent":["import {\n HeadersAdapter,\n type ReadonlyHeaders,\n} from '../web/spec-extension/adapters/headers'\nimport {\n workAsyncStorage,\n type WorkStore,\n} from '../app-render/work-async-storage.external'\nimport {\n throwForMissingRequestStore,\n workUnitAsyncStorage,\n type PrerenderStoreModern,\n type RequestStore,\n isInEarlyRenderStage,\n} from '../app-render/work-unit-async-storage.external'\nimport {\n postponeWithTracking,\n throwToInterruptStaticGeneration,\n trackDynamicDataInDynamicRender,\n} from '../app-render/dynamic-rendering'\nimport { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport {\n makeDevtoolsIOAwarePromise,\n makeHangingPromise,\n getSessionDataStage,\n} from '../dynamic-rendering-utils'\nimport { createDedupedByCallsiteServerErrorLoggerDev } from '../create-deduped-by-callsite-server-error-logger'\nimport { isRequestAPICallableInsideAfter } from './utils'\nimport { applyOwnerStack } from '../dynamic-rendering-utils'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { RenderStage } from '../app-render/staged-rendering'\n\n/**\n * This function allows you to read the HTTP incoming request headers in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers) and\n * [Middleware](https://nextjs.org/docs/app/building-your-application/routing/middleware).\n *\n * Read more: [Next.js Docs: `headers`](https://nextjs.org/docs/app/api-reference/functions/headers)\n */\nexport function headers(): Promise<ReadonlyHeaders> {\n const callingExpression = 'headers'\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workStore) {\n if (\n workUnitStore &&\n workUnitStore.phase === 'after' &&\n !isRequestAPICallableInsideAfter()\n ) {\n throw new Error(\n `Route ${workStore.route} used \\`headers()\\` inside \\`after()\\`. This is not supported. If you need this data inside an \\`after()\\` callback, use \\`headers()\\` outside of the callback. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`\n )\n }\n\n if (workStore.forceStatic) {\n // When using forceStatic we override all other logic and always just return an empty\n // headers object without tracking\n const underlyingHeaders = HeadersAdapter.seal(new Headers({}))\n return makeUntrackedHeaders(underlyingHeaders)\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'cache': {\n const error = new Error(\n `Route ${workStore.route} used \\`headers()\\` inside \"use cache\". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \\`headers()\\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n Error.captureStackTrace(error, headers)\n applyOwnerStack(error)\n workStore.invalidDynamicUsageError ??= error\n throw error\n }\n case 'unstable-cache':\n throw new Error(\n `Route ${workStore.route} used \\`headers()\\` inside a function cached with \\`unstable_cache()\\`. Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \\`headers()\\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`\n )\n case 'generate-static-params':\n throw new Error(\n `Route ${workStore.route} used \\`headers()\\` inside \\`generateStaticParams\\`. This is not supported because \\`generateStaticParams\\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`\n )\n case 'prerender':\n case 'prerender-client':\n case 'validation-client':\n case 'private-cache':\n case 'prerender-runtime':\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'request':\n break\n default:\n workUnitStore satisfies never\n }\n }\n\n if (workStore.dynamicShouldError) {\n throw new StaticGenBailoutError(\n `Route ${workStore.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`headers()\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender':\n return makeHangingHeaders(workStore, workUnitStore)\n case 'prerender-client':\n case 'validation-client':\n const exportName = '`headers`'\n throw new InvariantError(\n `${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`\n )\n case 'prerender-ppr':\n // PPR Prerender (no cacheComponents)\n // We are prerendering with PPR. We need track dynamic access here eagerly\n // to keep continuity with how headers has worked in PPR without cacheComponents.\n // TODO consider switching the semantic to throw on property access instead\n return postponeWithTracking(\n workStore.route,\n callingExpression,\n workUnitStore.dynamicTracking\n )\n case 'prerender-legacy':\n // Legacy Prerender\n // We are in a legacy static generation mode while prerendering\n // We track dynamic access here so we don't need to wrap the headers in\n // individual property access tracking.\n return throwToInterruptStaticGeneration(\n callingExpression,\n workStore,\n workUnitStore\n )\n case 'prerender-runtime': {\n const { stagedRendering } = workUnitStore\n if (stagedRendering) {\n return stagedRendering.delayUntilStage(\n getSessionDataStage(stagedRendering),\n 'headers',\n workUnitStore.headers\n )\n } else {\n return makeUntrackedHeaders(workUnitStore.headers)\n }\n }\n case 'private-cache':\n // Private caches are delayed until the runtime stage in use-cache-wrapper,\n // so we don't need an additional delay here.\n return makeUntrackedHeaders(workUnitStore.headers)\n case 'request':\n trackDynamicDataInDynamicRender(workUnitStore)\n\n if (process.env.NODE_ENV === 'development') {\n // Semantically we only need the dev tracking when running in `next dev`\n // but since you would never use next dev with production NODE_ENV we use this\n // as a proxy so we can statically exclude this code from production builds.\n return makeUntrackedHeadersWithDevWarnings(\n workUnitStore.headers,\n workStore?.route,\n workUnitStore\n )\n } else if (workUnitStore.asyncApiPromises) {\n return isInEarlyRenderStage(workUnitStore)\n ? workUnitStore.asyncApiPromises.earlyHeaders\n : workUnitStore.asyncApiPromises.headers\n } else {\n return makeUntrackedHeaders(workUnitStore.headers)\n }\n break\n default:\n workUnitStore satisfies never\n }\n }\n }\n\n // If we end up here, there was no work store or work unit store present.\n throwForMissingRequestStore(callingExpression)\n}\n\ninterface CacheLifetime {}\nconst CachedHeaders = new WeakMap<CacheLifetime, Promise<ReadonlyHeaders>>()\n\nfunction makeHangingHeaders(\n workStore: WorkStore,\n prerenderStore: PrerenderStoreModern\n): Promise<ReadonlyHeaders> {\n const cachedHeaders = CachedHeaders.get(prerenderStore)\n if (cachedHeaders) {\n return cachedHeaders\n }\n\n const promise = makeHangingPromise<ReadonlyHeaders>(\n prerenderStore.renderSignal,\n workStore.route,\n '`headers()`'\n )\n CachedHeaders.set(prerenderStore, promise)\n\n return promise\n}\n\nfunction makeUntrackedHeaders(\n underlyingHeaders: ReadonlyHeaders\n): Promise<ReadonlyHeaders> {\n const cachedHeaders = CachedHeaders.get(underlyingHeaders)\n if (cachedHeaders) {\n return cachedHeaders\n }\n\n const promise = Promise.resolve(underlyingHeaders)\n CachedHeaders.set(underlyingHeaders, promise)\n\n return promise\n}\n\nfunction makeUntrackedHeadersWithDevWarnings(\n underlyingHeaders: ReadonlyHeaders,\n route: string | undefined,\n requestStore: RequestStore\n): Promise<ReadonlyHeaders> {\n if (requestStore.asyncApiPromises) {\n const promise = isInEarlyRenderStage(requestStore)\n ? requestStore.asyncApiPromises.earlyHeaders\n : requestStore.asyncApiPromises.headers\n return instrumentHeadersPromiseWithDevWarnings(promise, route)\n }\n\n const cachedHeaders = CachedHeaders.get(underlyingHeaders)\n if (cachedHeaders) {\n return cachedHeaders\n }\n\n const promise = makeDevtoolsIOAwarePromise(\n underlyingHeaders,\n requestStore,\n RenderStage.Runtime\n )\n\n const proxiedPromise = instrumentHeadersPromiseWithDevWarnings(promise, route)\n\n CachedHeaders.set(underlyingHeaders, proxiedPromise)\n\n return proxiedPromise\n}\n\nconst warnForSyncAccess = createDedupedByCallsiteServerErrorLoggerDev(\n createHeadersAccessError\n)\n\nfunction instrumentHeadersPromiseWithDevWarnings(\n promise: Promise<ReadonlyHeaders>,\n route: string | undefined\n) {\n Object.defineProperties(promise, {\n [Symbol.iterator]: replaceableWarningDescriptorForSymbolIterator(\n promise,\n route\n ),\n append: replaceableWarningDescriptor(promise, 'append', route),\n delete: replaceableWarningDescriptor(promise, 'delete', route),\n get: replaceableWarningDescriptor(promise, 'get', route),\n has: replaceableWarningDescriptor(promise, 'has', route),\n set: replaceableWarningDescriptor(promise, 'set', route),\n getSetCookie: replaceableWarningDescriptor(promise, 'getSetCookie', route),\n forEach: replaceableWarningDescriptor(promise, 'forEach', route),\n keys: replaceableWarningDescriptor(promise, 'keys', route),\n values: replaceableWarningDescriptor(promise, 'values', route),\n entries: replaceableWarningDescriptor(promise, 'entries', route),\n })\n return promise\n}\n\nfunction replaceableWarningDescriptor(\n target: unknown,\n prop: string,\n route: string | undefined\n) {\n return {\n enumerable: false,\n get() {\n warnForSyncAccess(route, `\\`headers().${prop}\\``)\n return undefined\n },\n set(value: unknown) {\n Object.defineProperty(target, prop, {\n value,\n writable: true,\n configurable: true,\n })\n },\n configurable: true,\n }\n}\n\nfunction replaceableWarningDescriptorForSymbolIterator(\n target: unknown,\n route: string | undefined\n) {\n return {\n enumerable: false,\n get() {\n warnForSyncAccess(route, '`...headers()` or similar iteration')\n return undefined\n },\n set(value: unknown) {\n Object.defineProperty(target, Symbol.iterator, {\n value,\n writable: true,\n enumerable: true,\n configurable: true,\n })\n },\n configurable: true,\n }\n}\n\nfunction createHeadersAccessError(\n route: string | undefined,\n expression: string\n) {\n const prefix = route ? `Route \"${route}\" ` : 'This route '\n return new Error(\n `${prefix}used ${expression}. ` +\n `\\`headers()\\` returns a Promise and must be unwrapped with \\`await\\` or \\`React.use()\\` before accessing its properties. ` +\n `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`\n )\n}\n"],"names":["headers","callingExpression","workStore","workAsyncStorage","getStore","workUnitStore","workUnitAsyncStorage","phase","isRequestAPICallableInsideAfter","Error","route","forceStatic","underlyingHeaders","HeadersAdapter","seal","Headers","makeUntrackedHeaders","type","error","captureStackTrace","applyOwnerStack","invalidDynamicUsageError","dynamicShouldError","StaticGenBailoutError","makeHangingHeaders","exportName","InvariantError","postponeWithTracking","dynamicTracking","throwToInterruptStaticGeneration","stagedRendering","delayUntilStage","getSessionDataStage","trackDynamicDataInDynamicRender","process","env","NODE_ENV","makeUntrackedHeadersWithDevWarnings","asyncApiPromises","isInEarlyRenderStage","earlyHeaders","throwForMissingRequestStore","CachedHeaders","WeakMap","prerenderStore","cachedHeaders","get","promise","makeHangingPromise","renderSignal","set","Promise","resolve","requestStore","instrumentHeadersPromiseWithDevWarnings","makeDevtoolsIOAwarePromise","RenderStage","Runtime","proxiedPromise","warnForSyncAccess","createDedupedByCallsiteServerErrorLoggerDev","createHeadersAccessError","Object","defineProperties","Symbol","iterator","replaceableWarningDescriptorForSymbolIterator","append","replaceableWarningDescriptor","delete","has","getSetCookie","forEach","keys","values","entries","target","prop","enumerable","undefined","value","defineProperty","writable","configurable","expression","prefix"],"mappings":";;;;+BAyCgBA;;;eAAAA;;;yBAtCT;0CAIA;8CAOA;kCAKA;yCAC+B;uCAK/B;0DACqD;uBACZ;gCAEjB;iCACH;AAWrB,SAASA;IACd,M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lB,OAAOmB,cAAc,CAACL,QAAQZ,OAAOC,QAAQ,EAAE;gBAC7Ce;gBACAE,UAAU;gBACVJ,YAAY;gBACZK,cAAc;YAChB;QACF;QACAA,cAAc;IAChB;AACF;AAEA,SAAStB,yBACPnD,KAAyB,EACzB0E,UAAkB;IAElB,MAAMC,SAAS3E,QAAQ,CAAC,OAAO,EAAEA,MAAM,EAAE,CAAC,GAAG;IAC7C,OAAO,qBAIN,CAJM,IAAID,MACT,GAAG4E,OAAO,KAAK,EAAED,WAAW,EAAE,CAAC,GAC7B,CAAC,yHAAyH,CAAC,GAC3H,CAAC,8DAA8D,CAAC,GAH7D,qBAAA;eAAA;oBAAA;sBAAA;IAIP;AACF","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/server/request/headers.ts"],"sourcesContent":["import {\n HeadersAdapter,\n type ReadonlyHeaders,\n} from '../web/spec-extension/adapters/headers'\nimport {\n workAsyncStorage,\n type WorkStore,\n} from '../app-render/work-async-storage.external'\nimport {\n throwForMissingRequestStore,\n workUnitAsyncStorage,\n type PrerenderStoreModern,\n type RequestStore,\n isInEarlyRenderStage,\n} from '../app-render/work-unit-async-storage.external'\nimport {\n postponeWithTracking,\n throwToInterruptStaticGeneration,\n trackDynamicDataInDynamicRender,\n} from '../app-render/dynamic-rendering'\nimport { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport {\n makeDevtoolsIOAwarePromise,\n makeHangingPromise,\n getSessionDataStage,\n} from '../dynamic-rendering-utils'\nimport { createDedupedByCallsiteServerErrorLoggerDev } from '../create-deduped-by-callsite-server-error-logger'\nimport { isRequestApiAllowedInCurrentPhase } from './utils'\nimport { applyOwnerStack } from '../dynamic-rendering-utils'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { RenderStage } from '../app-render/staged-rendering'\n\n/**\n * This function allows you to read the HTTP incoming request headers in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers) and\n * [Middleware](https://nextjs.org/docs/app/building-your-application/routing/middleware).\n *\n * Read more: [Next.js Docs: `headers`](https://nextjs.org/docs/app/api-reference/functions/headers)\n */\nexport function headers(): Promise<ReadonlyHeaders> {\n const callingExpression = 'headers'\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workStore) {\n if (workUnitStore && !isRequestApiAllowedInCurrentPhase(workUnitStore)) {\n throw new Error(\n `Route ${workStore.route} used \\`headers()\\` inside \\`after()\\` while rendering. This is not supported. If you need this data inside an \\`after()\\` callback, use \\`headers()\\` outside of the callback. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`\n )\n }\n\n if (workStore.forceStatic) {\n // When using forceStatic we override all other logic and always just return an empty\n // headers object without tracking\n const underlyingHeaders = HeadersAdapter.seal(new Headers({}))\n return makeUntrackedHeaders(underlyingHeaders)\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'cache': {\n const error = new Error(\n `Route ${workStore.route} used \\`headers()\\` inside \"use cache\". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \\`headers()\\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n Error.captureStackTrace(error, headers)\n applyOwnerStack(error)\n workStore.invalidDynamicUsageError ??= error\n throw error\n }\n case 'unstable-cache':\n throw new Error(\n `Route ${workStore.route} used \\`headers()\\` inside a function cached with \\`unstable_cache()\\`. Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \\`headers()\\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`\n )\n case 'generate-static-params':\n throw new Error(\n `Route ${workStore.route} used \\`headers()\\` inside \\`generateStaticParams\\`. This is not supported because \\`generateStaticParams\\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`\n )\n case 'prerender':\n case 'prerender-client':\n case 'validation-client':\n case 'private-cache':\n case 'prerender-runtime':\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'request':\n break\n default:\n workUnitStore satisfies never\n }\n }\n\n if (workStore.dynamicShouldError) {\n throw new StaticGenBailoutError(\n `Route ${workStore.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`headers()\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender':\n return makeHangingHeaders(workStore, workUnitStore)\n case 'prerender-client':\n case 'validation-client':\n const exportName = '`headers`'\n throw new InvariantError(\n `${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`\n )\n case 'prerender-ppr':\n // PPR Prerender (no cacheComponents)\n // We are prerendering with PPR. We need track dynamic access here eagerly\n // to keep continuity with how headers has worked in PPR without cacheComponents.\n // TODO consider switching the semantic to throw on property access instead\n return postponeWithTracking(\n workStore.route,\n callingExpression,\n workUnitStore.dynamicTracking\n )\n case 'prerender-legacy':\n // Legacy Prerender\n // We are in a legacy static generation mode while prerendering\n // We track dynamic access here so we don't need to wrap the headers in\n // individual property access tracking.\n return throwToInterruptStaticGeneration(\n callingExpression,\n workStore,\n workUnitStore\n )\n case 'prerender-runtime': {\n const { stagedRendering } = workUnitStore\n if (stagedRendering) {\n return stagedRendering.delayUntilStage(\n getSessionDataStage(stagedRendering),\n 'headers',\n workUnitStore.headers\n )\n } else {\n return makeUntrackedHeaders(workUnitStore.headers)\n }\n }\n case 'private-cache':\n // Private caches are delayed until the runtime stage in use-cache-wrapper,\n // so we don't need an additional delay here.\n return makeUntrackedHeaders(workUnitStore.headers)\n case 'request':\n trackDynamicDataInDynamicRender(workUnitStore)\n\n if (process.env.NODE_ENV === 'development') {\n // Semantically we only need the dev tracking when running in `next dev`\n // but since you would never use next dev with production NODE_ENV we use this\n // as a proxy so we can statically exclude this code from production builds.\n return makeUntrackedHeadersWithDevWarnings(\n workUnitStore.headers,\n workStore?.route,\n workUnitStore\n )\n } else if (workUnitStore.asyncApiPromises) {\n return isInEarlyRenderStage(workUnitStore)\n ? workUnitStore.asyncApiPromises.earlyHeaders\n : workUnitStore.asyncApiPromises.headers\n } else {\n return makeUntrackedHeaders(workUnitStore.headers)\n }\n break\n default:\n workUnitStore satisfies never\n }\n }\n }\n\n // If we end up here, there was no work store or work unit store present.\n throwForMissingRequestStore(callingExpression)\n}\n\ninterface CacheLifetime {}\nconst CachedHeaders = new WeakMap<CacheLifetime, Promise<ReadonlyHeaders>>()\n\nfunction makeHangingHeaders(\n workStore: WorkStore,\n prerenderStore: PrerenderStoreModern\n): Promise<ReadonlyHeaders> {\n const cachedHeaders = CachedHeaders.get(prerenderStore)\n if (cachedHeaders) {\n return cachedHeaders\n }\n\n const promise = makeHangingPromise<ReadonlyHeaders>(\n prerenderStore.renderSignal,\n workStore.route,\n '`headers()`'\n )\n CachedHeaders.set(prerenderStore, promise)\n\n return promise\n}\n\nfunction makeUntrackedHeaders(\n underlyingHeaders: ReadonlyHeaders\n): Promise<ReadonlyHeaders> {\n const cachedHeaders = CachedHeaders.get(underlyingHeaders)\n if (cachedHeaders) {\n return cachedHeaders\n }\n\n const promise = Promise.resolve(underlyingHeaders)\n CachedHeaders.set(underlyingHeaders, promise)\n\n return promise\n}\n\nfunction makeUntrackedHeadersWithDevWarnings(\n underlyingHeaders: ReadonlyHeaders,\n route: string | undefined,\n requestStore: RequestStore\n): Promise<ReadonlyHeaders> {\n if (requestStore.asyncApiPromises) {\n const promise = isInEarlyRenderStage(requestStore)\n ? requestStore.asyncApiPromises.earlyHeaders\n : requestStore.asyncApiPromises.headers\n return instrumentHeadersPromiseWithDevWarnings(promise, route)\n }\n\n const cachedHeaders = CachedHeaders.get(underlyingHeaders)\n if (cachedHeaders) {\n return cachedHeaders\n }\n\n const promise = makeDevtoolsIOAwarePromise(\n underlyingHeaders,\n requestStore,\n RenderStage.Runtime\n )\n\n const proxiedPromise = instrumentHeadersPromiseWithDevWarnings(promise, route)\n\n CachedHeaders.set(underlyingHeaders, proxiedPromise)\n\n return proxiedPromise\n}\n\nconst warnForSyncAccess = createDedupedByCallsiteServerErrorLoggerDev(\n createHeadersAccessError\n)\n\nfunction instrumentHeadersPromiseWithDevWarnings(\n promise: Promise<ReadonlyHeaders>,\n route: string | undefined\n) {\n Object.defineProperties(promise, {\n [Symbol.iterator]: replaceableWarningDescriptorForSymbolIterator(\n promise,\n route\n ),\n append: replaceableWarningDescriptor(promise, 'append', route),\n delete: replaceableWarningDescriptor(promise, 'delete', route),\n get: replaceableWarningDescriptor(promise, 'get', route),\n has: replaceableWarningDescriptor(promise, 'has', route),\n set: replaceableWarningDescriptor(promise, 'set', route),\n getSetCookie: replaceableWarningDescriptor(promise, 'getSetCookie', route),\n forEach: replaceableWarningDescriptor(promise, 'forEach', route),\n keys: replaceableWarningDescriptor(promise, 'keys', route),\n values: replaceableWarningDescriptor(promise, 'values', route),\n entries: replaceableWarningDescriptor(promise, 'entries', route),\n })\n return promise\n}\n\nfunction replaceableWarningDescriptor(\n target: unknown,\n prop: string,\n route: string | undefined\n) {\n return {\n enumerable: false,\n get() {\n warnForSyncAccess(route, `\\`headers().${prop}\\``)\n return undefined\n },\n set(value: unknown) {\n Object.defineProperty(target, prop, {\n value,\n writable: true,\n configurable: true,\n })\n },\n configurable: true,\n }\n}\n\nfunction replaceableWarningDescriptorForSymbolIterator(\n target: unknown,\n route: string | undefined\n) {\n return {\n enumerable: false,\n get() {\n warnForSyncAccess(route, '`...headers()` or similar iteration')\n return undefined\n },\n set(value: unknown) {\n Object.defineProperty(target, Symbol.iterator, {\n value,\n writable: true,\n enumerable: true,\n configurable: true,\n })\n },\n configurable: true,\n }\n}\n\nfunction createHeadersAccessError(\n route: string | undefined,\n expression: string\n) {\n const prefix = route ? `Route \"${route}\" ` : 'This route '\n return new Error(\n `${prefix}used ${expression}. ` +\n `\\`headers()\\` returns a Promise and must be unwrapped with \\`await\\` or \\`React.use()\\` before accessing its properties. ` +\n `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`\n )\n}\n"],"names":["headers","callingExpression","workStore","workAsyncStorage","getStore","workUnitStore","workUnitAsyncStorage","isRequestApiAllowedInCurrentPhase","Error","route","forceStatic","underlyingHeaders","HeadersAdapter","seal","Headers","makeUntrackedHeaders","type","error","captureStackTrace","applyOwnerStack","invalidDynamicUsageError","dynamicShouldError","StaticGenBailoutError","makeHangingHeaders","exportName","InvariantError","postponeWithTracking","dynamicTracking","throwToInterruptStaticGeneration","stagedRendering","delayUntilStage","getSessionDataStage","trackDynamicDataInDynamicRender","process","env","NODE_ENV","makeUntrackedHeadersWithDevWarnings","asyncApiPromises","isInEarlyRenderStage","earlyHeaders","throwForMissingRequestStore","CachedHeaders","WeakMap","prerenderStore","cachedHeaders","get","promise","makeHangingPromise","renderSignal","set","Promise","resolve","requestStore","instrumentHeadersPromiseWithDevWarnings","makeDevtoolsIOAwarePromise","RenderStage","Runtime","proxiedPromise","warnForSyncAccess","createDedupedByCallsiteServerErrorLoggerDev","createHeadersAccessError","Object","defineProperties","Symbol","iterator","replaceableWarningDescriptorForSymbolIterator","append","replaceableWarningDescriptor","delete","has","getSetCookie","forEach","keys","values","entries","target","prop","enumerable","undefined","value","defineProperty","writable","configurable","expression","prefix"],"mappings":";;;;+BAyCgBA;;;eAAAA;;;yBAtCT;0CAIA;8CAOA;kCAKA;yCAC+B;uCAK/B;0DACqD;uBACV;gCAEnB;iCACH;AAWrB,SAASA;IACd,MAAMC,oBAAoB;IAC1B,MAAMC,YAAYC,0CAAgB,CAACC,QAAQ;IAC3C,MAAMC,gBAAgBC,kDAAoB,CAACF,QAAQ;IAEnD,IAAIF,WAAW;QACb,IAAIG,iBAAiB,CAACE,IAAAA,wCAAiC,EAACF,gBAAgB;YACtE,MAAM,qBAEL,CAFK,IAAIG,MACR,CAAC,MAAM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GAAG;IAC7C,OAAO,qBAIN,CAJM,IAAID,MACT,GAAG4E,OAAO,KAAK,EAAED,WAAW,EAAE,CAAC,GAC7B,CAAC,yHAAyH,CAAC,GAC3H,CAAC,8DAA8D,CAAC,GAH7D,qBAAA;eAAA;oBAAA;sBAAA;IAIP;AACF","ignoreList":[0]} |
@@ -16,2 +16,3 @@ "use strict"; | ||
| const _pprremovederror = require("../../shared/lib/ppr-removed-error"); | ||
| const _utils = require("./utils"); | ||
| // A fulfilled thenable that React can unwrap synchronously via `use()` without | ||
@@ -26,2 +27,9 @@ // ever suspending. Reusing a single instance avoids allocating on every call. | ||
| if (workStore && workUnitStore) { | ||
| if (workUnitStore && !(0, _utils.isRequestApiAllowedInCurrentPhase)(workUnitStore)) { | ||
| throw Object.defineProperty(new Error(`Route ${workStore.route} used \`io()\` inside \`after()\` while rendering. The \`io()\` function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { | ||
| value: "E1372", | ||
| enumerable: false, | ||
| configurable: true | ||
| }); | ||
| } | ||
| switch(workUnitStore.type){ | ||
@@ -28,0 +36,0 @@ case 'request': |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/server/request/io.ts"],"sourcesContent":["import { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'\nimport {\n makeHangingPromise,\n makeDevtoolsIOAwarePromise,\n} from '../dynamic-rendering-utils'\nimport { RenderStage } from '../app-render/staged-rendering'\nimport { throwPrerenderPPRRemovedError } from '../../shared/lib/ppr-removed-error'\n\n// A fulfilled thenable that React can unwrap synchronously via `use()` without\n// ever suspending. Reusing a single instance avoids allocating on every call.\nconst resolvedIOPromise: Promise<void> = Promise.resolve(undefined)\n;(resolvedIOPromise as any).status = 'fulfilled'\n;(resolvedIOPromise as any).value = undefined\n\n/**\n * This function allows you to indicate that the code following it performs\n * I/O or accesses dynamic data sources such as `new Date()` or `Math.random()`.\n *\n * During prerendering it will prevent the prerender from continuing past this\n * point, creating a dynamic boundary. Inside `\"use cache\"` scopes or during\n * a real request it resolves immediately.\n *\n * Unlike `connection()`, `io()` does not require an actual HTTP request and\n * can be used freely inside cache scopes and client components.\n */\nexport function io(): Promise<void> {\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workStore && workUnitStore) {\n switch (workUnitStore.type) {\n case 'request':\n // For dev renders we instrument the promise so it will show up in\n // React Suspense Devtools and, if also doing `instant` validation,\n // ensure it resolves in the right stage for staged rendering\n // In production we just let it resolve immediately because we're doing\n // a dynamic SSR or resume render and have no need to delay anything\n // after this call\n if (process.env.NODE_ENV === 'development') {\n if (workUnitStore.asyncApiPromises) {\n return workUnitStore.asyncApiPromises.io\n }\n return makeDevtoolsIOAwarePromise(\n undefined,\n workUnitStore,\n RenderStage.Dynamic\n )\n } else if (workUnitStore.asyncApiPromises) {\n return workUnitStore.asyncApiPromises.io\n }\n return resolvedIOPromise\n case 'prerender':\n case 'prerender-client':\n case 'prerender-runtime':\n // When prerendering with Cache Components we consider `io()` to be\n // actual IO if not in a cache scope and we can avoid actually executing\n // anything after it by making it return a hanging promise.\n return makeHangingPromise(\n workUnitStore.renderSignal,\n workStore.route,\n '`io()`'\n )\n case 'prerender-ppr':\n // Dead code to be removed when we eliminate legacy ppr code\n throwPrerenderPPRRemovedError()\n break\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n // Inside cache scopes, io() resolves immediately.\n // Caches can contain IO-dependent code like new Date() — it will\n // simply return the value at cache-fill time.\n // ...\n // intentional fallthrough\n case 'generate-static-params':\n // generateStaticParams runs at build time. There is no prerender\n // to stall so we resolve immediately.\n // ...\n // intentional fallthrough\n case 'validation-client':\n // io() is usable in client components, resolve immediately.\n // The reason we take this position is most io shielding you would do\n // in a browser is for sync IO as there aren't many non-fetch based IO\n // operations you can do in the browser that have meaningful latency.\n // So while you might use\n // ...\n // intentional fallthrough\n case 'prerender-legacy':\n // Without cache components, IO is not inherently dynamic.\n // Resolve immediately rather than interrupting static generation.\n return resolvedIOPromise\n default:\n workUnitStore satisfies never\n }\n }\n\n // No work store — we're outside the Next.js rendering context (e.g. in\n // a client component on the browser or in a standalone script). Resolve\n // immediately.\n return resolvedIOPromise\n}\n"],"names":["io","resolvedIOPromise","Promise","resolve","undefined","status","value","workStore","workAsyncStorage","getStore","workUnitStore","workUnitAsyncStorage","type","process","env","NODE_ENV","asyncApiPromises","makeDevtoolsIOAwarePromise","RenderStage","Dynamic","makeHangingPromise","renderSignal","route","throwPrerenderPPRRemovedError"],"mappings":";;;;+BA0BgBA;;;eAAAA;;;0CA1BiB;8CACI;uCAI9B;iCACqB;iCACkB;AAE9C,+EAA+E;AAC/E,8EAA8E;AAC9E,MAAMC,oBAAmCC,QAAQC,OAAO,CAACC;AACvDH,kBAA0BI,MAAM,GAAG;AACnCJ,kBAA0BK,KAAK,GAAGF;AAa7B,SAASJ;IACd,MAAMO,YAAYC,0CAAgB,CAACC,QAAQ;IAC3C,MAAMC,gBAAgBC,kDAAoB,CAACF,QAAQ;IAEnD,IAAIF,aAAaG,eAAe;QAC9B,OAAQA,cAAcE,IAAI;YACxB,KAAK;gBACH,kEAAkE;gBAClE,mEAAmE;gBACnE,6DAA6D;gBAC7D,uEAAuE;gBACvE,oEAAoE;gBACpE,kBAAkB;gBAClB,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,eAAe;oBAC1C,IAAIL,cAAcM,gBAAgB,EAAE;wBAClC,OAAON,cAAcM,gBAAgB,CAAChB,EAAE;oBAC1C;oBACA,OAAOiB,IAAAA,iDAA0B,EAC/Bb,WACAM,eACAQ,4BAAW,CAACC,OAAO;gBAEvB,OAAO,IAAIT,cAAcM,gBAAgB,EAAE;oBACzC,OAAON,cAAcM,gBAAgB,CAAChB,EAAE;gBAC1C;gBACA,OAAOC;YACT,KAAK;YACL,KAAK;YACL,KAAK;gBACH,mEAAmE;gBACnE,wEAAwE;gBACxE,2DAA2D;gBAC3D,OAAOmB,IAAAA,yCAAkB,EACvBV,cAAcW,YAAY,EAC1Bd,UAAUe,KAAK,EACf;YAEJ,KAAK;gBACH,4DAA4D;gBAC5DC,IAAAA,8CAA6B;gBAC7B;YACF,KAAK;YACL,KAAK;YACL,KAAK;YACL,kDAAkD;YAClD,iEAAiE;YACjE,8CAA8C;YAC9C,MAAM;YACN,0BAA0B;YAC1B,KAAK;YACL,iEAAiE;YACjE,sCAAsC;YACtC,MAAM;YACN,0BAA0B;YAC1B,KAAK;YACL,4DAA4D;YAC5D,qEAAqE;YACrE,sEAAsE;YACtE,qEAAqE;YACrE,yBAAyB;YACzB,MAAM;YACN,0BAA0B;YAC1B,KAAK;gBACH,0DAA0D;gBAC1D,kEAAkE;gBAClE,OAAOtB;YACT;gBACES;QACJ;IACF;IAEA,uEAAuE;IACvE,wEAAwE;IACxE,eAAe;IACf,OAAOT;AACT","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/server/request/io.ts"],"sourcesContent":["import { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'\nimport {\n makeHangingPromise,\n makeDevtoolsIOAwarePromise,\n} from '../dynamic-rendering-utils'\nimport { RenderStage } from '../app-render/staged-rendering'\nimport { throwPrerenderPPRRemovedError } from '../../shared/lib/ppr-removed-error'\nimport { isRequestApiAllowedInCurrentPhase } from './utils'\n\n// A fulfilled thenable that React can unwrap synchronously via `use()` without\n// ever suspending. Reusing a single instance avoids allocating on every call.\nconst resolvedIOPromise: Promise<void> = Promise.resolve(undefined)\n;(resolvedIOPromise as any).status = 'fulfilled'\n;(resolvedIOPromise as any).value = undefined\n\n/**\n * This function allows you to indicate that the code following it performs\n * I/O or accesses dynamic data sources such as `new Date()` or `Math.random()`.\n *\n * During prerendering it will prevent the prerender from continuing past this\n * point, creating a dynamic boundary. Inside `\"use cache\"` scopes or during\n * a real request it resolves immediately.\n *\n * Unlike `connection()`, `io()` does not require an actual HTTP request and\n * can be used freely inside cache scopes and client components.\n */\nexport function io(): Promise<void> {\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workStore && workUnitStore) {\n if (workUnitStore && !isRequestApiAllowedInCurrentPhase(workUnitStore)) {\n throw new Error(\n `Route ${workStore.route} used \\`io()\\` inside \\`after()\\` while rendering. The \\`io()\\` function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`\n )\n }\n switch (workUnitStore.type) {\n case 'request':\n // For dev renders we instrument the promise so it will show up in\n // React Suspense Devtools and, if also doing `instant` validation,\n // ensure it resolves in the right stage for staged rendering\n // In production we just let it resolve immediately because we're doing\n // a dynamic SSR or resume render and have no need to delay anything\n // after this call\n if (process.env.NODE_ENV === 'development') {\n if (workUnitStore.asyncApiPromises) {\n return workUnitStore.asyncApiPromises.io\n }\n return makeDevtoolsIOAwarePromise(\n undefined,\n workUnitStore,\n RenderStage.Dynamic\n )\n } else if (workUnitStore.asyncApiPromises) {\n return workUnitStore.asyncApiPromises.io\n }\n return resolvedIOPromise\n case 'prerender':\n case 'prerender-client':\n case 'prerender-runtime':\n // When prerendering with Cache Components we consider `io()` to be\n // actual IO if not in a cache scope and we can avoid actually executing\n // anything after it by making it return a hanging promise.\n return makeHangingPromise(\n workUnitStore.renderSignal,\n workStore.route,\n '`io()`'\n )\n case 'prerender-ppr':\n // Dead code to be removed when we eliminate legacy ppr code\n throwPrerenderPPRRemovedError()\n break\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n // Inside cache scopes, io() resolves immediately.\n // Caches can contain IO-dependent code like new Date() — it will\n // simply return the value at cache-fill time.\n // ...\n // intentional fallthrough\n case 'generate-static-params':\n // generateStaticParams runs at build time. There is no prerender\n // to stall so we resolve immediately.\n // ...\n // intentional fallthrough\n case 'validation-client':\n // io() is usable in client components, resolve immediately.\n // The reason we take this position is most io shielding you would do\n // in a browser is for sync IO as there aren't many non-fetch based IO\n // operations you can do in the browser that have meaningful latency.\n // So while you might use\n // ...\n // intentional fallthrough\n case 'prerender-legacy':\n // Without cache components, IO is not inherently dynamic.\n // Resolve immediately rather than interrupting static generation.\n return resolvedIOPromise\n default:\n workUnitStore satisfies never\n }\n }\n\n // No work store — we're outside the Next.js rendering context (e.g. in\n // a client component on the browser or in a standalone script). Resolve\n // immediately.\n return resolvedIOPromise\n}\n"],"names":["io","resolvedIOPromise","Promise","resolve","undefined","status","value","workStore","workAsyncStorage","getStore","workUnitStore","workUnitAsyncStorage","isRequestApiAllowedInCurrentPhase","Error","route","type","process","env","NODE_ENV","asyncApiPromises","makeDevtoolsIOAwarePromise","RenderStage","Dynamic","makeHangingPromise","renderSignal","throwPrerenderPPRRemovedError"],"mappings":";;;;+BA2BgBA;;;eAAAA;;;0CA3BiB;8CACI;uCAI9B;iCACqB;iCACkB;uBACI;AAElD,+EAA+E;AAC/E,8EAA8E;AAC9E,MAAMC,oBAAmCC,QAAQC,OAAO,CAACC;AACvDH,kBAA0BI,MAAM,GAAG;AACnCJ,kBAA0BK,KAAK,GAAGF;AAa7B,SAASJ;IACd,MAAMO,YAAYC,0CAAgB,CAACC,QAAQ;IAC3C,MAAMC,gBAAgBC,kDAAoB,CAACF,QAAQ;IAEnD,IAAIF,aAAaG,eAAe;QAC9B,IAAIA,iBAAiB,CAACE,IAAAA,wCAAiC,EAACF,gBAAgB;YACtE,MAAM,qBAEL,CAFK,IAAIG,MACR,CAAC,MAAM,EAAEN,UAAUO,KAAK,CAAC,oLAAoL,CAAC,GAD1M,qBAAA;uBAAA;4BAAA;8BAAA;YAEN;QACF;QACA,OAAQJ,cAAcK,IAAI;YACxB,KAAK;gBACH,kEAAkE;gBAClE,mEAAmE;gBACnE,6DAA6D;gBAC7D,uEAAuE;gBACvE,oEAAoE;gBACpE,kBAAkB;gBAClB,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,eAAe;oBAC1C,IAAIR,cAAcS,gBAAgB,EAAE;wBAClC,OAAOT,cAAcS,gBAAgB,CAACnB,EAAE;oBAC1C;oBACA,OAAOoB,IAAAA,iDAA0B,EAC/BhB,WACAM,eACAW,4BAAW,CAACC,OAAO;gBAEvB,OAAO,IAAIZ,cAAcS,gBAAgB,EAAE;oBACzC,OAAOT,cAAcS,gBAAgB,CAACnB,EAAE;gBAC1C;gBACA,OAAOC;YACT,KAAK;YACL,KAAK;YACL,KAAK;gBACH,mEAAmE;gBACnE,wEAAwE;gBACxE,2DAA2D;gBAC3D,OAAOsB,IAAAA,yCAAkB,EACvBb,cAAcc,YAAY,EAC1BjB,UAAUO,KAAK,EACf;YAEJ,KAAK;gBACH,4DAA4D;gBAC5DW,IAAAA,8CAA6B;gBAC7B;YACF,KAAK;YACL,KAAK;YACL,KAAK;YACL,kDAAkD;YAClD,iEAAiE;YACjE,8CAA8C;YAC9C,MAAM;YACN,0BAA0B;YAC1B,KAAK;YACL,iEAAiE;YACjE,sCAAsC;YACtC,MAAM;YACN,0BAA0B;YAC1B,KAAK;YACL,4DAA4D;YAC5D,qEAAqE;YACrE,sEAAsE;YACtE,qEAAqE;YACrE,yBAAyB;YACzB,MAAM;YACN,0BAA0B;YAC1B,KAAK;gBACH,0DAA0D;gBAC1D,kEAAkE;gBAClE,OAAOxB;YACT;gBACES;QACJ;IACF;IAEA,uEAAuE;IACvE,wEAAwE;IACxE,eAAe;IACf,OAAOT;AACT","ignoreList":[0]} |
| import type { WorkStore } from '../app-render/work-async-storage.external'; | ||
| import type { WorkUnitStore } from '../app-render/work-unit-async-storage.external'; | ||
| export declare function throwWithStaticGenerationBailoutErrorWithDynamicError(route: string, expression: string): never; | ||
| export declare function throwForSearchParamsAccessInUseCache(workStore: WorkStore, constructorOpt: Function): never; | ||
| export declare function isRequestAPICallableInsideAfter(): boolean; | ||
| export declare function isRequestApiAllowedInCurrentPhase(workUnitStore: WorkUnitStore): boolean; |
@@ -6,3 +6,3 @@ "use strict"; | ||
| 0 && (module.exports = { | ||
| isRequestAPICallableInsideAfter: null, | ||
| isRequestApiAllowedInCurrentPhase: null, | ||
| throwForSearchParamsAccessInUseCache: null, | ||
@@ -18,4 +18,4 @@ throwWithStaticGenerationBailoutErrorWithDynamicError: null | ||
| _export(exports, { | ||
| isRequestAPICallableInsideAfter: function() { | ||
| return isRequestAPICallableInsideAfter; | ||
| isRequestApiAllowedInCurrentPhase: function() { | ||
| return isRequestApiAllowedInCurrentPhase; | ||
| }, | ||
@@ -30,2 +30,3 @@ throwForSearchParamsAccessInUseCache: function() { | ||
| const _staticgenerationbailout = require("../../client/components/static-generation-bailout"); | ||
| const _actionasyncstorageexternal = require("../app-render/action-async-storage.external"); | ||
| const _aftertaskasyncstorageexternal = require("../app-render/after-task-async-storage.external"); | ||
@@ -49,7 +50,39 @@ function throwWithStaticGenerationBailoutErrorWithDynamicError(route, expression) { | ||
| } | ||
| function isRequestAPICallableInsideAfter() { | ||
| const afterTaskStore = _aftertaskasyncstorageexternal.afterTaskAsyncStorage.getStore(); | ||
| return (afterTaskStore == null ? void 0 : afterTaskStore.rootTaskSpawnPhase) === 'action'; | ||
| function isRequestApiAllowedInCurrentPhase(workUnitStore) { | ||
| switch(workUnitStore.phase){ | ||
| case 'action': | ||
| case 'render': | ||
| { | ||
| // The request is still in progress. The API may be disallowed for other reasons, | ||
| // but not because of phase. | ||
| return true; | ||
| } | ||
| case 'after': | ||
| { | ||
| // The request has finished. | ||
| // If we're in a Route Handler or a Server Action, | ||
| // request APIs can be called everywhere, even in after(). | ||
| const actionStore = _actionasyncstorageexternal.actionAsyncStorage.getStore(); | ||
| if (actionStore && (actionStore.isAppRoute || actionStore.isAction)) { | ||
| return true; | ||
| } | ||
| const afterTaskStore = _aftertaskasyncstorageexternal.afterTaskAsyncStorage.getStore(); | ||
| if (afterTaskStore) { | ||
| // We're in an `after` callback. Request APIs are callable if | ||
| // the `after()` call happened in an action phase: | ||
| // - in a Route Handler | ||
| // - in a Server Action's body (but not the render after) | ||
| // | ||
| // TODO(after): Is it even possible to have `phase === 'action'` but no `actionStore`? | ||
| // We should revisit this setup and simplify this. | ||
| return afterTaskStore.rootTaskSpawnPhase === 'action'; | ||
| } | ||
| // Otherwise, we must be in a page, in the `after` phase. | ||
| // We don't allow calling request APIs here because we'd miss | ||
| // them during prerendering and wouldn't know that the page is dynamic. | ||
| return false; | ||
| } | ||
| } | ||
| } | ||
| //# sourceMappingURL=utils.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/server/request/utils.ts"],"sourcesContent":["import { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport { afterTaskAsyncStorage } from '../app-render/after-task-async-storage.external'\nimport type { WorkStore } from '../app-render/work-async-storage.external'\n\nexport function throwWithStaticGenerationBailoutErrorWithDynamicError(\n route: string,\n expression: string\n): never {\n throw new StaticGenBailoutError(\n `Route ${route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used ${expression}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n}\n\nexport function throwForSearchParamsAccessInUseCache(\n workStore: WorkStore,\n constructorOpt: Function\n): never {\n const error = new Error(\n `Route ${workStore.route} used \\`searchParams\\` inside \"use cache\". Accessing dynamic request data inside a cache scope is not supported. If you need some search params inside a cached function await \\`searchParams\\` outside of the cached function and pass only the required search params as arguments to the cached function. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n\n Error.captureStackTrace(error, constructorOpt)\n workStore.invalidDynamicUsageError ??= error\n\n throw error\n}\n\nexport function isRequestAPICallableInsideAfter() {\n const afterTaskStore = afterTaskAsyncStorage.getStore()\n return afterTaskStore?.rootTaskSpawnPhase === 'action'\n}\n"],"names":["isRequestAPICallableInsideAfter","throwForSearchParamsAccessInUseCache","throwWithStaticGenerationBailoutErrorWithDynamicError","route","expression","StaticGenBailoutError","workStore","constructorOpt","error","Error","captureStackTrace","invalidDynamicUsageError","afterTaskStore","afterTaskAsyncStorage","getStore","rootTaskSpawnPhase"],"mappings":";;;;;;;;;;;;;;;;IA2BgBA,+BAA+B;eAA/BA;;IAdAC,oCAAoC;eAApCA;;IATAC,qDAAqD;eAArDA;;;yCAJsB;+CACA;AAG/B,SAASA,sDACdC,KAAa,EACbC,UAAkB;IAElB,MAAM,qBAEL,CAFK,IAAIC,8CAAqB,CAC7B,CAAC,MAAM,EAAEF,MAAM,4EAA4E,EAAEC,WAAW,0HAA0H,CAAC,GAD/N,qBAAA;eAAA;oBAAA;sBAAA;IAEN;AACF;AAEO,SAASH,qCACdK,SAAoB,EACpBC,cAAwB;IAExB,MAAMC,QAAQ,qBAEb,CAFa,IAAIC,MAChB,CAAC,MAAM,EAAEH,UAAUH,KAAK,CAAC,2XAA2X,CAAC,GADzY,qBAAA;eAAA;oBAAA;sBAAA;IAEd;IAEAM,MAAMC,iBAAiB,CAACF,OAAOD;IAC/BD,UAAUK,wBAAwB,KAAKH;IAEvC,MAAMA;AACR;AAEO,SAASR;IACd,MAAMY,iBAAiBC,oDAAqB,CAACC,QAAQ;IACrD,OAAOF,CAAAA,kCAAAA,eAAgBG,kBAAkB,MAAK;AAChD","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/server/request/utils.ts"],"sourcesContent":["import { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport { actionAsyncStorage } from '../app-render/action-async-storage.external'\nimport { afterTaskAsyncStorage } from '../app-render/after-task-async-storage.external'\nimport type { WorkStore } from '../app-render/work-async-storage.external'\nimport type { WorkUnitStore } from '../app-render/work-unit-async-storage.external'\n\nexport function throwWithStaticGenerationBailoutErrorWithDynamicError(\n route: string,\n expression: string\n): never {\n throw new StaticGenBailoutError(\n `Route ${route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used ${expression}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n}\n\nexport function throwForSearchParamsAccessInUseCache(\n workStore: WorkStore,\n constructorOpt: Function\n): never {\n const error = new Error(\n `Route ${workStore.route} used \\`searchParams\\` inside \"use cache\". Accessing dynamic request data inside a cache scope is not supported. If you need some search params inside a cached function await \\`searchParams\\` outside of the cached function and pass only the required search params as arguments to the cached function. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n\n Error.captureStackTrace(error, constructorOpt)\n workStore.invalidDynamicUsageError ??= error\n\n throw error\n}\n\nexport function isRequestApiAllowedInCurrentPhase(\n workUnitStore: WorkUnitStore\n): boolean {\n switch (workUnitStore.phase) {\n case 'action':\n case 'render': {\n // The request is still in progress. The API may be disallowed for other reasons,\n // but not because of phase.\n return true\n }\n case 'after': {\n // The request has finished.\n\n // If we're in a Route Handler or a Server Action,\n // request APIs can be called everywhere, even in after().\n const actionStore = actionAsyncStorage.getStore()\n if (actionStore && (actionStore.isAppRoute || actionStore.isAction)) {\n return true\n }\n\n const afterTaskStore = afterTaskAsyncStorage.getStore()\n if (afterTaskStore) {\n // We're in an `after` callback. Request APIs are callable if\n // the `after()` call happened in an action phase:\n // - in a Route Handler\n // - in a Server Action's body (but not the render after)\n //\n // TODO(after): Is it even possible to have `phase === 'action'` but no `actionStore`?\n // We should revisit this setup and simplify this.\n return afterTaskStore.rootTaskSpawnPhase === 'action'\n }\n\n // Otherwise, we must be in a page, in the `after` phase.\n // We don't allow calling request APIs here because we'd miss\n // them during prerendering and wouldn't know that the page is dynamic.\n return false\n }\n }\n}\n"],"names":["isRequestApiAllowedInCurrentPhase","throwForSearchParamsAccessInUseCache","throwWithStaticGenerationBailoutErrorWithDynamicError","route","expression","StaticGenBailoutError","workStore","constructorOpt","error","Error","captureStackTrace","invalidDynamicUsageError","workUnitStore","phase","actionStore","actionAsyncStorage","getStore","isAppRoute","isAction","afterTaskStore","afterTaskAsyncStorage","rootTaskSpawnPhase"],"mappings":";;;;;;;;;;;;;;;;IA6BgBA,iCAAiC;eAAjCA;;IAdAC,oCAAoC;eAApCA;;IATAC,qDAAqD;eAArDA;;;yCANsB;4CACH;+CACG;AAI/B,SAASA,sDACdC,KAAa,EACbC,UAAkB;IAElB,MAAM,qBAEL,CAFK,IAAIC,8CAAqB,CAC7B,CAAC,MAAM,EAAEF,MAAM,4EAA4E,EAAEC,WAAW,0HAA0H,CAAC,GAD/N,qBAAA;eAAA;oBAAA;sBAAA;IAEN;AACF;AAEO,SAASH,qCACdK,SAAoB,EACpBC,cAAwB;IAExB,MAAMC,QAAQ,qBAEb,CAFa,IAAIC,MAChB,CAAC,MAAM,EAAEH,UAAUH,KAAK,CAAC,2XAA2X,CAAC,GADzY,qBAAA;eAAA;oBAAA;sBAAA;IAEd;IAEAM,MAAMC,iBAAiB,CAACF,OAAOD;IAC/BD,UAAUK,wBAAwB,KAAKH;IAEvC,MAAMA;AACR;AAEO,SAASR,kCACdY,aAA4B;IAE5B,OAAQA,cAAcC,KAAK;QACzB,KAAK;QACL,KAAK;YAAU;gBACb,iFAAiF;gBACjF,4BAA4B;gBAC5B,OAAO;YACT;QACA,KAAK;YAAS;gBACZ,4BAA4B;gBAE5B,kDAAkD;gBAClD,0DAA0D;gBAC1D,MAAMC,cAAcC,8CAAkB,CAACC,QAAQ;gBAC/C,IAAIF,eAAgBA,CAAAA,YAAYG,UAAU,IAAIH,YAAYI,QAAQ,AAAD,GAAI;oBACnE,OAAO;gBACT;gBAEA,MAAMC,iBAAiBC,oDAAqB,CAACJ,QAAQ;gBACrD,IAAIG,gBAAgB;oBAClB,6DAA6D;oBAC7D,kDAAkD;oBAClD,uBAAuB;oBACvB,yDAAyD;oBACzD,EAAE;oBACF,sFAAsF;oBACtF,kDAAkD;oBAClD,OAAOA,eAAeE,kBAAkB,KAAK;gBAC/C;gBAEA,yDAAyD;gBACzD,6DAA6D;gBAC7D,uEAAuE;gBACvE,OAAO;YACT;IACF;AACF","ignoreList":[0]} |
@@ -24,3 +24,3 @@ "use strict"; | ||
| function isStableBuild() { | ||
| return !"16.3.0-canary.58"?.includes('canary') && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV; | ||
| return !"16.3.0-canary.59"?.includes('canary') && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV; | ||
| } | ||
@@ -27,0 +27,0 @@ class CanaryOnlyConfigError extends Error { |
@@ -84,3 +84,3 @@ "use strict"; | ||
| ciName: _ciinfo.isCI && _ciinfo.name || null, | ||
| nextVersion: "16.3.0-canary.58" | ||
| nextVersion: "16.3.0-canary.59" | ||
| }; | ||
@@ -87,0 +87,0 @@ return traits; |
@@ -14,7 +14,7 @@ "use strict"; | ||
| // This should be an invariant, if it fails our build tooling is broken. | ||
| if (typeof "16.3.0-canary.58" !== 'string') { | ||
| if (typeof "16.3.0-canary.59" !== 'string') { | ||
| return []; | ||
| } | ||
| const payload = { | ||
| nextVersion: "16.3.0-canary.58", | ||
| nextVersion: "16.3.0-canary.59", | ||
| nodeVersion: process.version, | ||
@@ -21,0 +21,0 @@ cliCommand: event.cliCommand, |
@@ -41,3 +41,3 @@ "use strict"; | ||
| payload: { | ||
| nextVersion: "16.3.0-canary.58", | ||
| nextVersion: "16.3.0-canary.59", | ||
| glibcVersion, | ||
@@ -44,0 +44,0 @@ installedSwcPackages, |
@@ -15,3 +15,3 @@ "use strict"; | ||
| // This should be an invariant, if it fails our build tooling is broken. | ||
| if (typeof "16.3.0-canary.58" !== 'string') { | ||
| if (typeof "16.3.0-canary.59" !== 'string') { | ||
| return []; | ||
@@ -21,3 +21,3 @@ } | ||
| const payload = { | ||
| nextVersion: "16.3.0-canary.58", | ||
| nextVersion: "16.3.0-canary.59", | ||
| nodeVersion: process.version, | ||
@@ -24,0 +24,0 @@ cliCommand: event.cliCommand, |
+1
-0
@@ -20,2 +20,3 @@ /// <reference types="node" preserve="true" /> | ||
| export type { Instrumentation } from './server/instrumentation/types'; | ||
| export type { RouterTransitionType, RouterTransitionPrefetchIntent, RouterTransitionEvent, RouterTransitionStartEvent, } from './client/router-transition-types'; | ||
| /** | ||
@@ -22,0 +23,0 @@ * Stub route type for typedRoutes before `next dev` or `next build` is run |
+10
-10
| { | ||
| "name": "next", | ||
| "version": "16.3.0-canary.58", | ||
| "version": "16.3.0-canary.59", | ||
| "description": "The React Framework", | ||
@@ -84,3 +84,3 @@ "main": "./dist/server/next.js", | ||
| "dependencies": { | ||
| "@next/env": "16.3.0-canary.58", | ||
| "@next/env": "16.3.0-canary.59", | ||
| "@swc/helpers": "0.5.15", | ||
@@ -116,10 +116,10 @@ "baseline-browser-mapping": "^2.9.19", | ||
| "sharp": "^0.34.5", | ||
| "@next/swc-darwin-arm64": "16.3.0-canary.58", | ||
| "@next/swc-darwin-x64": "16.3.0-canary.58", | ||
| "@next/swc-linux-arm64-gnu": "16.3.0-canary.58", | ||
| "@next/swc-linux-arm64-musl": "16.3.0-canary.58", | ||
| "@next/swc-linux-x64-gnu": "16.3.0-canary.58", | ||
| "@next/swc-linux-x64-musl": "16.3.0-canary.58", | ||
| "@next/swc-win32-arm64-msvc": "16.3.0-canary.58", | ||
| "@next/swc-win32-x64-msvc": "16.3.0-canary.58" | ||
| "@next/swc-darwin-arm64": "16.3.0-canary.59", | ||
| "@next/swc-darwin-x64": "16.3.0-canary.59", | ||
| "@next/swc-linux-arm64-gnu": "16.3.0-canary.59", | ||
| "@next/swc-linux-arm64-musl": "16.3.0-canary.59", | ||
| "@next/swc-linux-x64-gnu": "16.3.0-canary.59", | ||
| "@next/swc-linux-x64-musl": "16.3.0-canary.59", | ||
| "@next/swc-win32-arm64-msvc": "16.3.0-canary.59", | ||
| "@next/swc-win32-x64-msvc": "16.3.0-canary.59" | ||
| }, | ||
@@ -126,0 +126,0 @@ "keywords": [ |
| self.__BUILD_MANIFEST = { | ||
| "__rewrites": { | ||
| "afterFiles": [], | ||
| "beforeFiles": [], | ||
| "fallback": [] | ||
| }, | ||
| "sortedPages": [ | ||
| "/_app", | ||
| "/_error" | ||
| ] | ||
| };self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB() |
| self.__MIDDLEWARE_MATCHERS = [];self.__MIDDLEWARE_MATCHERS_CB && self.__MIDDLEWARE_MATCHERS_CB() |
| self.__SSG_MANIFEST=new Set([]);self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB() |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Potential vulnerability
Supply chain riskInitial human review suggests the presence of a vulnerability in this package. It is pending further analysis and confirmation.
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 5 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 5 instances
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
168636207
0.1%8282
0.12%1274985
0.04%4327
0.14%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated