vinext 0.0.53 → 0.0.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/dist/build/inline-css.d.ts +7 -0
  2. package/dist/build/inline-css.js +50 -0
  3. package/dist/build/inline-css.js.map +1 -0
  4. package/dist/build/prerender.js +2 -1
  5. package/dist/build/prerender.js.map +1 -1
  6. package/dist/check.js +4 -0
  7. package/dist/check.js.map +1 -1
  8. package/dist/client/navigation-runtime.d.ts +2 -1
  9. package/dist/client/navigation-runtime.js.map +1 -1
  10. package/dist/client/window-next.d.ts +7 -0
  11. package/dist/client/window-next.js.map +1 -1
  12. package/dist/config/next-config.d.ts +83 -1
  13. package/dist/config/next-config.js +131 -2
  14. package/dist/config/next-config.js.map +1 -1
  15. package/dist/deploy.js +13 -0
  16. package/dist/deploy.js.map +1 -1
  17. package/dist/entries/app-browser-entry.d.ts +11 -1
  18. package/dist/entries/app-browser-entry.js +16 -6
  19. package/dist/entries/app-browser-entry.js.map +1 -1
  20. package/dist/entries/app-rsc-entry.d.ts +8 -1
  21. package/dist/entries/app-rsc-entry.js +18 -5
  22. package/dist/entries/app-rsc-entry.js.map +1 -1
  23. package/dist/entries/app-rsc-manifest.d.ts +21 -1
  24. package/dist/entries/app-rsc-manifest.js +6 -4
  25. package/dist/entries/app-rsc-manifest.js.map +1 -1
  26. package/dist/entries/pages-client-entry.d.ts +4 -1
  27. package/dist/entries/pages-client-entry.js +18 -2
  28. package/dist/entries/pages-client-entry.js.map +1 -1
  29. package/dist/entries/pages-server-entry.js +82 -4
  30. package/dist/entries/pages-server-entry.js.map +1 -1
  31. package/dist/entries/runtime-entry-module.d.ts +1 -10
  32. package/dist/entries/runtime-entry-module.js +2 -12
  33. package/dist/entries/runtime-entry-module.js.map +1 -1
  34. package/dist/index.js +63 -5
  35. package/dist/index.js.map +1 -1
  36. package/dist/plugins/remove-console.d.ts +16 -0
  37. package/dist/plugins/remove-console.js +176 -0
  38. package/dist/plugins/remove-console.js.map +1 -0
  39. package/dist/routing/app-route-graph.d.ts +24 -1
  40. package/dist/routing/app-route-graph.js +52 -4
  41. package/dist/routing/app-route-graph.js.map +1 -1
  42. package/dist/routing/app-router.d.ts +2 -2
  43. package/dist/routing/app-router.js +2 -2
  44. package/dist/routing/app-router.js.map +1 -1
  45. package/dist/routing/file-matcher.d.ts +21 -1
  46. package/dist/routing/file-matcher.js +39 -1
  47. package/dist/routing/file-matcher.js.map +1 -1
  48. package/dist/routing/pages-router.d.ts +1 -1
  49. package/dist/routing/pages-router.js +10 -3
  50. package/dist/routing/pages-router.js.map +1 -1
  51. package/dist/server/api-handler.js +1 -1
  52. package/dist/server/app-browser-entry.js +25 -16
  53. package/dist/server/app-browser-entry.js.map +1 -1
  54. package/dist/server/app-browser-navigation-controller.d.ts +2 -0
  55. package/dist/server/app-browser-navigation-controller.js +4 -0
  56. package/dist/server/app-browser-navigation-controller.js.map +1 -1
  57. package/dist/server/app-elements-wire.d.ts +13 -4
  58. package/dist/server/app-elements-wire.js +10 -1
  59. package/dist/server/app-elements-wire.js.map +1 -1
  60. package/dist/server/app-elements.d.ts +2 -2
  61. package/dist/server/app-elements.js +2 -2
  62. package/dist/server/app-elements.js.map +1 -1
  63. package/dist/server/app-fallback-renderer.d.ts +15 -5
  64. package/dist/server/app-fallback-renderer.js +10 -4
  65. package/dist/server/app-fallback-renderer.js.map +1 -1
  66. package/dist/server/app-inline-css-client.d.ts +7 -0
  67. package/dist/server/app-inline-css-client.js +37 -0
  68. package/dist/server/app-inline-css-client.js.map +1 -0
  69. package/dist/server/app-page-boundary.d.ts +21 -1
  70. package/dist/server/app-page-boundary.js +28 -3
  71. package/dist/server/app-page-boundary.js.map +1 -1
  72. package/dist/server/app-page-cache.d.ts +7 -3
  73. package/dist/server/app-page-cache.js +7 -7
  74. package/dist/server/app-page-cache.js.map +1 -1
  75. package/dist/server/app-page-dispatch.d.ts +10 -1
  76. package/dist/server/app-page-dispatch.js +126 -79
  77. package/dist/server/app-page-dispatch.js.map +1 -1
  78. package/dist/server/app-page-element-builder.js +12 -28
  79. package/dist/server/app-page-element-builder.js.map +1 -1
  80. package/dist/server/app-page-render-identity.d.ts +22 -0
  81. package/dist/server/app-page-render-identity.js +42 -0
  82. package/dist/server/app-page-render-identity.js.map +1 -0
  83. package/dist/server/app-page-render.d.ts +8 -1
  84. package/dist/server/app-page-render.js +4 -1
  85. package/dist/server/app-page-render.js.map +1 -1
  86. package/dist/server/app-page-request.d.ts +6 -3
  87. package/dist/server/app-page-request.js +5 -2
  88. package/dist/server/app-page-request.js.map +1 -1
  89. package/dist/server/app-page-response.js +2 -2
  90. package/dist/server/app-page-response.js.map +1 -1
  91. package/dist/server/app-page-route-wiring.d.ts +15 -0
  92. package/dist/server/app-page-route-wiring.js +7 -5
  93. package/dist/server/app-page-route-wiring.js.map +1 -1
  94. package/dist/server/app-page-stream.d.ts +11 -0
  95. package/dist/server/app-page-stream.js +1 -0
  96. package/dist/server/app-page-stream.js.map +1 -1
  97. package/dist/server/app-route-handler-response.js +37 -5
  98. package/dist/server/app-route-handler-response.js.map +1 -1
  99. package/dist/server/app-rsc-handler.d.ts +14 -3
  100. package/dist/server/app-rsc-handler.js +45 -5
  101. package/dist/server/app-rsc-handler.js.map +1 -1
  102. package/dist/server/app-rsc-request-normalization.d.ts +2 -1
  103. package/dist/server/app-rsc-request-normalization.js +3 -2
  104. package/dist/server/app-rsc-request-normalization.js.map +1 -1
  105. package/dist/server/app-server-action-execution.d.ts +21 -3
  106. package/dist/server/app-server-action-execution.js +42 -7
  107. package/dist/server/app-server-action-execution.js.map +1 -1
  108. package/dist/server/app-ssr-entry.d.ts +6 -0
  109. package/dist/server/app-ssr-entry.js +22 -7
  110. package/dist/server/app-ssr-entry.js.map +1 -1
  111. package/dist/server/app-ssr-error-meta.js +3 -3
  112. package/dist/server/app-ssr-error-meta.js.map +1 -1
  113. package/dist/server/app-ssr-stream.d.ts +2 -1
  114. package/dist/server/app-ssr-stream.js +176 -31
  115. package/dist/server/app-ssr-stream.js.map +1 -1
  116. package/dist/server/client-trace-metadata.d.ts +31 -0
  117. package/dist/server/client-trace-metadata.js +83 -0
  118. package/dist/server/client-trace-metadata.js.map +1 -0
  119. package/dist/server/cookie-utils.d.ts +13 -0
  120. package/dist/server/cookie-utils.js +20 -0
  121. package/dist/server/cookie-utils.js.map +1 -0
  122. package/dist/server/dev-server.d.ts +8 -1
  123. package/dist/server/dev-server.js +34 -5
  124. package/dist/server/dev-server.js.map +1 -1
  125. package/dist/server/html.d.ts +2 -1
  126. package/dist/server/html.js +6 -1
  127. package/dist/server/html.js.map +1 -1
  128. package/dist/server/isr-cache.d.ts +7 -5
  129. package/dist/server/isr-cache.js +17 -6
  130. package/dist/server/isr-cache.js.map +1 -1
  131. package/dist/server/middleware-runtime.js +1 -2
  132. package/dist/server/middleware-runtime.js.map +1 -1
  133. package/dist/server/pages-document-initial-props.d.ts +7 -0
  134. package/dist/server/pages-document-initial-props.js +14 -0
  135. package/dist/server/pages-document-initial-props.js.map +1 -0
  136. package/dist/server/pages-page-data.js +3 -0
  137. package/dist/server/pages-page-data.js.map +1 -1
  138. package/dist/server/pages-page-method.d.ts +48 -0
  139. package/dist/server/pages-page-method.js +19 -0
  140. package/dist/server/pages-page-method.js.map +1 -0
  141. package/dist/server/pages-page-response.d.ts +6 -0
  142. package/dist/server/pages-page-response.js +10 -3
  143. package/dist/server/pages-page-response.js.map +1 -1
  144. package/dist/server/pages-serializable-props.d.ts +25 -0
  145. package/dist/server/pages-serializable-props.js +69 -0
  146. package/dist/server/pages-serializable-props.js.map +1 -0
  147. package/dist/server/prod-server.js +3 -0
  148. package/dist/server/prod-server.js.map +1 -1
  149. package/dist/server/server-action-not-found.js +3 -2
  150. package/dist/server/server-action-not-found.js.map +1 -1
  151. package/dist/server/static-file-cache.js +2 -1
  152. package/dist/server/static-file-cache.js.map +1 -1
  153. package/dist/shims/app-router-scroll-state.d.ts +4 -2
  154. package/dist/shims/app-router-scroll-state.js +16 -3
  155. package/dist/shims/app-router-scroll-state.js.map +1 -1
  156. package/dist/shims/app-router-scroll.d.ts +16 -2
  157. package/dist/shims/app-router-scroll.js +18 -3
  158. package/dist/shims/app-router-scroll.js.map +1 -1
  159. package/dist/shims/cache.d.ts +6 -0
  160. package/dist/shims/cache.js +7 -0
  161. package/dist/shims/cache.js.map +1 -1
  162. package/dist/shims/error.js +3 -0
  163. package/dist/shims/error.js.map +1 -1
  164. package/dist/shims/headers.d.ts +7 -0
  165. package/dist/shims/headers.js +9 -1
  166. package/dist/shims/headers.js.map +1 -1
  167. package/dist/shims/internal/app-route-detection.d.ts +37 -0
  168. package/dist/shims/internal/app-route-detection.js +69 -0
  169. package/dist/shims/internal/app-route-detection.js.map +1 -0
  170. package/dist/shims/link.d.ts +18 -2
  171. package/dist/shims/link.js +70 -6
  172. package/dist/shims/link.js.map +1 -1
  173. package/dist/shims/metadata.d.ts +7 -6
  174. package/dist/shims/metadata.js +9 -5
  175. package/dist/shims/metadata.js.map +1 -1
  176. package/dist/shims/navigation.d.ts +1 -2
  177. package/dist/shims/navigation.js +63 -12
  178. package/dist/shims/navigation.js.map +1 -1
  179. package/dist/shims/router.d.ts +5 -0
  180. package/dist/shims/router.js +14 -4
  181. package/dist/shims/router.js.map +1 -1
  182. package/dist/shims/script.d.ts +11 -1
  183. package/dist/shims/script.js +75 -6
  184. package/dist/shims/script.js.map +1 -1
  185. package/dist/utils/path.d.ts +13 -0
  186. package/dist/utils/path.js +16 -0
  187. package/dist/utils/path.js.map +1 -0
  188. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"app-rsc-entry.js","names":[],"sources":["../../src/entries/app-rsc-entry.ts"],"sourcesContent":["/**\n * App Router RSC entry generator.\n *\n * Generates the virtual RSC entry module for the App Router.\n * The RSC entry does route matching and renders the component tree,\n * then delegates to the SSR entry for HTML generation.\n *\n * Previously housed in server/app-dev-server.ts.\n */\nimport { randomUUID } from \"node:crypto\";\nimport { buildAppRscManifestCode } from \"./app-rsc-manifest.js\";\nimport { resolveEntryPath, normalizePathSeparators } from \"./runtime-entry-module.js\";\nimport type {\n NextHeader,\n NextI18nConfig,\n NextRedirect,\n NextRewrite,\n} from \"../config/next-config.js\";\nimport type { AppRoute } from \"../routing/app-router.js\";\nimport { generateDevOriginCheckCode } from \"../server/dev-origin-check.js\";\nimport type { MetadataFileRoute } from \"../server/metadata-routes.js\";\nimport { isProxyFile } from \"../server/middleware.js\";\n\nconst DEFAULT_EXPIRE_TIME = 31_536_000;\n\n// Pre-computed absolute paths for generated-code imports. The virtual RSC\n// entry can't use relative imports (it has no real file location), so we\n// resolve these at code-generation time and embed them as absolute paths.\nconst middlewareRequestHeadersPath = resolveEntryPath(\n \"../server/middleware-request-headers.js\",\n import.meta.url,\n);\nconst normalizePathModulePath = resolveEntryPath(\"../server/normalize-path.js\", import.meta.url);\nconst appRscHandlerPath = resolveEntryPath(\"../server/app-rsc-handler.js\", import.meta.url);\nconst appRouteHandlerDispatchPath = resolveEntryPath(\n \"../server/app-route-handler-dispatch.js\",\n import.meta.url,\n);\nconst appRouteHandlerResponsePath = resolveEntryPath(\n \"../server/app-route-handler-response.js\",\n import.meta.url,\n);\nconst appServerActionExecutionPath = resolveEntryPath(\n \"../server/app-server-action-execution.js\",\n import.meta.url,\n);\nconst appRscErrorsPath = resolveEntryPath(\"../server/app-rsc-errors.js\", import.meta.url);\nconst appPageExecutionPath = resolveEntryPath(\"../server/app-page-execution.js\", import.meta.url);\nconst appFallbackRendererPath = resolveEntryPath(\n \"../server/app-fallback-renderer.js\",\n import.meta.url,\n);\nconst appElementsPath = resolveEntryPath(\"../server/app-elements.js\", import.meta.url);\nconst appPageRouteWiringPath = resolveEntryPath(\n \"../server/app-page-route-wiring.js\",\n import.meta.url,\n);\nconst appPageProbePath = resolveEntryPath(\"../server/app-page-probe.js\", import.meta.url);\nconst appPageParamsPath = resolveEntryPath(\"../server/app-page-params.js\", import.meta.url);\nconst appPageDispatchPath = resolveEntryPath(\"../server/app-page-dispatch.js\", import.meta.url);\nconst appPageRequestPath = resolveEntryPath(\"../server/app-page-request.js\", import.meta.url);\nconst appSegmentConfigPath = resolveEntryPath(\"../server/app-segment-config.js\", import.meta.url);\nconst appRscRouteMatchingPath = resolveEntryPath(\n \"../server/app-rsc-route-matching.js\",\n import.meta.url,\n);\nconst rscStreamHintsPath = resolveEntryPath(\"../server/rsc-stream-hints.js\", import.meta.url);\nconst isrCachePath = resolveEntryPath(\"../server/isr-cache.js\", import.meta.url);\nconst thenableParamsShimPath = resolveEntryPath(\"../shims/thenable-params.js\", import.meta.url);\nconst appPageElementBuilderPath = resolveEntryPath(\n \"../server/app-page-element-builder.js\",\n import.meta.url,\n);\nconst instrumentationRuntimePath = resolveEntryPath(\n \"../server/instrumentation-runtime.js\",\n import.meta.url,\n);\nconst appRscErrorHandlerPath = resolveEntryPath(\n \"../server/app-rsc-error-handler.js\",\n import.meta.url,\n);\nconst appRequestContextPath = resolveEntryPath(\"../server/app-request-context.js\", import.meta.url);\nconst appPrerenderStaticParamsPath = resolveEntryPath(\n \"../server/app-prerender-static-params.js\",\n import.meta.url,\n);\nconst seedCachePath = resolveEntryPath(\"../server/seed-cache.js\", import.meta.url);\nconst appHookWarningSuppressionPath = resolveEntryPath(\n \"../server/app-hook-warning-suppression.js\",\n import.meta.url,\n);\nconst serverGlobalsPath = resolveEntryPath(\"../server/server-globals.js\", import.meta.url);\n\n/**\n * Resolved config options relevant to App Router request handling.\n * Passed from the Vite plugin where the full next.config.js is loaded.\n */\ntype AppRouterConfig = {\n redirects?: NextRedirect[];\n rewrites?: {\n beforeFiles: NextRewrite[];\n afterFiles: NextRewrite[];\n fallback: NextRewrite[];\n };\n headers?: NextHeader[];\n /** Extra origins allowed for server action CSRF checks (from experimental.serverActions.allowedOrigins). */\n allowedOrigins?: string[];\n /** Extra origins allowed for dev server access (from allowedDevOrigins). */\n allowedDevOrigins?: string[];\n /** Body size limit for server actions in bytes (from experimental.serverActions.bodySizeLimit). */\n bodySizeLimit?: number;\n /** Serialized next.config htmlLimitedBots regexp source. */\n htmlLimitedBots?: string;\n /**\n * Resolved `assetPrefix` from next.config. Empty string when unset.\n * Embedded in the generated entry so the App Router prod-server reads\n * it from the imported module instead of a sidecar JSON file —\n * matches how the Pages Router entry exposes `vinextConfig.assetPrefix`.\n *\n * @see https://nextjs.org/docs/app/api-reference/config/next-config-js/assetPrefix\n */\n assetPrefix?: string;\n /** Route-level expire fallback in seconds for ISR entries with numeric revalidate. */\n expireTime?: number;\n /** Internationalization routing config for middleware matcher locale handling. */\n i18n?: NextI18nConfig | null;\n /**\n * Absolute path to `app/global-not-found.{tsx,ts,js,jsx}` when present.\n * When provided, route-miss 404s render this module standalone (it owns its\n * own `<html>` and `<body>`) instead of wrapping the regular `not-found.tsx`\n * boundary inside the root layout. Mirrors Next.js 16's\n * `experimental.globalNotFound` behavior.\n * @see https://github.com/vercel/next.js/blob/canary/test/e2e/app-dir/global-not-found\n */\n globalNotFoundPath?: string | null;\n /**\n * When true, the project has a `pages/` directory alongside the App Router.\n * The generated RSC entry exposes `/__vinext/prerender/pages-static-paths`\n * so `prerenderPages` can call `getStaticPaths` via `wrangler unstable_startWorker`\n * in CF Workers builds. `pageRoutes` is loaded from the SSR environment via\n * `import(\"./ssr/index.js\")`, which re-exports it from\n * `virtual:vinext-server-entry` when this flag is set.\n */\n hasPagesDir?: boolean;\n /** Exact public/ file routes, using normalized leading-slash pathnames. */\n publicFiles?: string[];\n /** Server-only token used to validate the draft-mode bypass cookie. */\n draftModeSecret?: string;\n};\n\n/**\n * Generate the virtual RSC entry module.\n *\n * This runs in the `rsc` Vite environment (react-server condition).\n * It matches the incoming request URL to an app route, builds the\n * nested layout + page tree, and renders it to an RSC stream.\n */\nexport function generateRscEntry(\n appDir: string,\n routes: AppRoute[],\n middlewarePath?: string | null,\n metadataRoutes?: MetadataFileRoute[],\n globalErrorPath?: string | null,\n basePath?: string,\n trailingSlash?: boolean,\n config?: AppRouterConfig,\n instrumentationPath?: string | null,\n): string {\n const bp = basePath ?? \"\";\n const ts = trailingSlash ?? false;\n const redirects = config?.redirects ?? [];\n const rewrites = config?.rewrites ?? { beforeFiles: [], afterFiles: [], fallback: [] };\n const headers = config?.headers ?? [];\n const allowedOrigins = config?.allowedOrigins ?? [];\n const bodySizeLimit = config?.bodySizeLimit ?? 1 * 1024 * 1024;\n const htmlLimitedBots = config?.htmlLimitedBots;\n const assetPrefix = config?.assetPrefix ?? \"\";\n const expireTime = config?.expireTime ?? DEFAULT_EXPIRE_TIME;\n const i18nConfig = config?.i18n ?? null;\n const hasPagesDir = config?.hasPagesDir ?? false;\n const publicFiles = config?.publicFiles ?? [];\n const draftModeSecret = config?.draftModeSecret ?? randomUUID();\n const manifestCode = buildAppRscManifestCode({\n routes,\n metadataRoutes,\n globalErrorPath,\n globalNotFoundPath: config?.globalNotFoundPath ?? null,\n });\n const {\n imports,\n routeEntries,\n metaRouteEntries,\n generateStaticParamsEntries,\n rootParamNameEntries,\n rootNotFoundVar,\n rootForbiddenVar,\n rootUnauthorizedVar,\n rootLayoutVars,\n globalErrorVar,\n globalNotFoundVar,\n } = manifestCode;\n const loadPrerenderPagesRoutesCode = hasPagesDir\n ? `\nasync function __loadPrerenderPagesRoutes() {\n const __gspSsrEntry = await import.meta.viteRsc.loadModule(\"ssr\", \"index\");\n return __gspSsrEntry.pageRoutes;\n}\n`\n : \"\";\n\n return `\nimport ${JSON.stringify(serverGlobalsPath)};\nimport {\n renderToReadableStream as _renderToReadableStream,\n decodeAction,\n decodeFormState,\n decodeReply,\n loadServerAction,\n createTemporaryReferenceSet,\n} from \"@vitejs/plugin-rsc/rsc\";\nimport { createRscRenderer } from ${JSON.stringify(rscStreamHintsPath)};\n\nconst renderToReadableStream = createRscRenderer(_renderToReadableStream);\nimport { createElement } from \"react\";\nimport { getNavigationContext as _getNavigationContext } from \"next/navigation\";\nimport { headersContextFromRequest, getDraftModeCookieHeader, getAndClearPendingCookies, consumeDynamicUsage, consumeInvalidDynamicUsageError, setHeadersAccessPhase } from \"next/headers\";\nimport { mergeMetadata, resolveModuleMetadata, mergeViewport, resolveModuleViewport } from \"vinext/metadata\";\n${middlewarePath ? `import * as middlewareModule from ${JSON.stringify(normalizePathSeparators(middlewarePath))};` : \"\"}\n${\n instrumentationPath\n ? `import * as _instrumentation from ${JSON.stringify(normalizePathSeparators(instrumentationPath))};\nimport { ensureInstrumentationRegistered as __ensureInstrumentationRegistered } from ${JSON.stringify(instrumentationRuntimePath)};`\n : \"\"\n}\nimport { createAppRscHandler as __createAppRscHandler } from ${JSON.stringify(appRscHandlerPath)};\nimport { decodePathParams as __decodePathParams } from ${JSON.stringify(normalizePathModulePath)};\nimport { buildRequestHeadersFromMiddlewareResponse as __buildRequestHeadersFromMiddlewareResponse } from ${JSON.stringify(middlewareRequestHeadersPath)};\nimport {\n dispatchAppRouteHandler as __dispatchAppRouteHandler,\n} from ${JSON.stringify(appRouteHandlerDispatchPath)};\nimport {\n applyRouteHandlerMiddlewareContext as __applyRouteHandlerMiddlewareContext,\n} from ${JSON.stringify(appRouteHandlerResponsePath)};\nimport {\n handleProgressiveServerActionRequest as __handleProgressiveServerActionRequest,\n handleServerActionRscRequest as __handleServerActionRscRequest,\n readActionBodyWithLimit as __readBodyWithLimit,\n readActionFormDataWithLimit as __readFormDataWithLimit,\n} from ${JSON.stringify(appServerActionExecutionPath)};\nimport {\n sanitizeErrorForClient as __sanitizeErrorForClient,\n} from ${JSON.stringify(appRscErrorsPath)};\nimport { createAppRscOnErrorHandler } from ${JSON.stringify(appRscErrorHandlerPath)};\nimport {\n buildAppPageFontLinkHeader as __buildAppPageFontLinkHeader,\n resolveAppPageSpecialError as __resolveAppPageSpecialError,\n} from ${JSON.stringify(appPageExecutionPath)};\nimport {\n createAppFallbackRenderer as __createAppFallbackRenderer,\n} from ${JSON.stringify(appFallbackRendererPath)};\nimport {\n AppElementsWire as __AppElementsWire,\n} from ${JSON.stringify(appElementsPath)};\nimport {\n resolveAppPageChildSegments as __resolveAppPageChildSegments,\n} from ${JSON.stringify(appPageRouteWiringPath)};\nimport { buildPageElements as __buildPageElements } from ${JSON.stringify(appPageElementBuilderPath)};\nimport {\n resolveAppPageSegmentParams as __resolveAppPageSegmentParams,\n} from ${JSON.stringify(appPageParamsPath)};\nimport { probeAppPage as __probeAppPage } from ${JSON.stringify(appPageProbePath)};\nimport {\n dispatchAppPage as __dispatchAppPage,\n} from ${JSON.stringify(appPageDispatchPath)};\nimport {\n resolveAppPageGenerateStaticParamsSources as __resolveAppPageGenerateStaticParamsSources,\n} from ${JSON.stringify(appPageRequestPath)};\nimport {\n isEdgeRuntime as __isEdgeRuntime,\n resolveAppPageFetchCacheMode as __resolveAppPageFetchCacheMode,\n resolveAppPageSegmentConfig as __resolveAppPageSegmentConfig,\n} from ${JSON.stringify(appSegmentConfigPath)};\nimport { makeThenableParams } from ${JSON.stringify(thenableParamsShimPath)};\nimport {\n createAppRscRouteMatcher as __createAppRscRouteMatcher,\n} from ${JSON.stringify(appRscRouteMatchingPath)};\nimport {\n appIsrHtmlKey as __isrHtmlKey,\n appIsrRscKey as __isrRscKey,\n appIsrRouteKey as __isrRouteKey,\n isrGet as __isrGet,\n isrSet as __isrSet,\n isrSetPrerenderedAppPage as __isrSetPrerenderedAppPage,\n triggerBackgroundRegeneration as __triggerBackgroundRegeneration,\n} from ${JSON.stringify(isrCachePath)};\n// Import server-only state module to register ALS-backed accessors.\nimport \"vinext/navigation-state\";\nimport { reportRequestError as _reportRequestError } from \"vinext/instrumentation\";\nimport { getSSRFontLinks as _getSSRFontLinks, getSSRFontStyles as _getSSRFontStylesGoogle, getSSRFontPreloads as _getSSRFontPreloadsGoogle } from \"next/font/google\";\nimport { getSSRFontStyles as _getSSRFontStylesLocal, getSSRFontPreloads as _getSSRFontPreloadsLocal } from \"next/font/local\";\nfunction _getSSRFontStyles() { return [..._getSSRFontStylesGoogle(), ..._getSSRFontStylesLocal()]; }\nfunction _getSSRFontPreloads() { return [..._getSSRFontPreloadsGoogle(), ..._getSSRFontPreloadsLocal()]; }\n${hasPagesDir ? `// Pages Router routes are loaded lazily from the SSR environment for internal prerender requests.` : \"\"}\n\n// Suppress expected \"Invalid hook call\" dev warning when layout/page\n// components are probed outside React's render cycle. The import patches\n// console.error once at module load (side-effect) and exposes the ALS\n// so per-route dispatch can opt into suppression via .run(true, ...).\nimport { suppressHookWarningAls } from ${JSON.stringify(appHookWarningSuppressionPath)};\nimport { clearAppRequestContext as __clearRequestContext, setAppNavigationContext as setNavigationContext } from ${JSON.stringify(appRequestContextPath)};\nimport { createAppPrerenderStaticParamsResolver as __createAppPrerenderStaticParamsResolver } from ${JSON.stringify(appPrerenderStaticParamsPath)};\nimport { seedMemoryCacheFromPrerender as __seedMemoryCacheFromPrerender } from ${JSON.stringify(seedCachePath)};\n\nconst __draftModeSecret = ${JSON.stringify(draftModeSecret)};\n\n// Note: cache entries are written with \\`headers: undefined\\`. Next.js stores\n// response headers (e.g. set-cookie from cookies().set() during render) in the\n// cache entry so they can be replayed on HIT. We don't do this because:\n// 1. Pages that call cookies().set() during render trigger dynamicUsedDuringRender,\n// which opts them out of ISR caching before we reach the write path.\n// 2. Custom response headers set via next/headers are not yet captured separately\n// from the live Response object in vinext's server pipeline.\n// In practice this means ISR-cached responses won't replay render-time set-cookie\n// headers — but that case is already prevented by the dynamic-usage opt-out.\n// TODO: capture render-time response headers for full Next.js parity.\n// Verbose cache logging — opt in with NEXT_PRIVATE_DEBUG_CACHE=1.\n// Matches the env var Next.js uses for its own cache debug output so operators\n// have a single knob for all cache tracing.\nconst __isrDebug = process.env.NEXT_PRIVATE_DEBUG_CACHE\n ? console.debug.bind(console, \"[vinext] ISR:\")\n : undefined;\n\n// Classification debug — opt in with VINEXT_DEBUG_CLASSIFICATION=1. Gated on\n// the env var so the hot path pays no overhead unless an operator is actively\n// tracing why a layout was flagged static or dynamic. The reason payload is\n// carried by __VINEXT_CLASS_REASONS and consumed inside probeAppPageLayouts.\nconst __classDebug = process.env.VINEXT_DEBUG_CLASSIFICATION\n ? function(layoutId, reason) {\n console.debug(\"[vinext] CLS:\", layoutId, reason);\n }\n : undefined;\n\nfunction __resolveRouteFetchCacheMode(route) {\n return __resolveAppPageFetchCacheMode({\n layouts: route.layouts,\n page: route.page,\n });\n}\n\n${imports.join(\"\\n\")}\n\n${\n instrumentationPath\n ? `// Lazy instrumentation initialisation is handled by ensureInstrumentationRegistered\n// (imported from vinext/instrumentation-runtime). The generated entry only passes\n// the user module in; all bookkeeping (initialized flag, shared promise, prerender\n// skip) lives in the typed helper so it can be unit-tested independently.`\n : \"\"\n}\n\n// Build-time layout classification dispatch. Replaced in generateBundle\n// with a switch statement that returns a pre-computed per-layout\n// Map<layoutIndex, \"static\" | \"dynamic\"> for each route. Until the\n// plugin patches this stub, every route falls back to the Layer 3\n// runtime probe, which is the current (slow) behaviour.\nfunction __VINEXT_CLASS(routeIdx) {\n return null;\n}\n\n// Build-time layout classification reasons dispatch. Sibling of\n// __VINEXT_CLASS, returning a per-route Map<layoutIndex, ClassificationReason>\n// that feeds the debug channel when VINEXT_DEBUG_CLASSIFICATION is active.\n// Replaced in generateBundle with a real dispatch table; the stub returns\n// null so the hot path never allocates reason maps when debug is off.\nfunction __VINEXT_CLASS_REASONS(routeIdx) {\n return null;\n}\n\nconst routes = [\n${routeEntries.join(\",\\n\")}\n];\nconst __routeMatcher = __createAppRscRouteMatcher(routes);\n\nconst metadataRoutes = [\n${metaRouteEntries.join(\",\\n\")}\n];\n\n// Hoisted ahead of __fallbackRenderer / buildPageElements so both can thread\n// the configured basePath through file-based metadata href emission.\n// Re-exported so the Cloudflare worker entry can strip basePath before\n// recognising /_next/static/* paths (parity with __assetPrefix below).\nexport const __basePath = ${JSON.stringify(bp)};\n\nconst rootNotFoundModule = ${rootNotFoundVar ? rootNotFoundVar : \"null\"};\nconst rootForbiddenModule = ${rootForbiddenVar ? rootForbiddenVar : \"null\"};\nconst rootUnauthorizedModule = ${rootUnauthorizedVar ? rootUnauthorizedVar : \"null\"};\nconst rootLayouts = [${rootLayoutVars.join(\", \")}];\n// Root-level app/global-not-found module. When present, route-miss 404s render\n// this module standalone (it provides its own html/body) instead of wrapping\n// the not-found.tsx boundary inside the root layout. Page-triggered notFound()\n// calls still use the regular not-found.tsx boundary inside the layouts.\n// See https://github.com/vercel/next.js/blob/canary/packages/next/src/server/app-render/app-render.tsx#L495-L520\nconst globalNotFoundModule = ${globalNotFoundVar ? globalNotFoundVar : \"null\"};\n\nconst createRscOnErrorHandler = (request, pathname, routePath) =>\n createAppRscOnErrorHandler(_reportRequestError, request, pathname, routePath);\n\nconst __fallbackRenderer = __createAppFallbackRenderer({\n basePath: __basePath,\n rootBoundaries: {\n rootForbiddenModule,\n rootLayouts,\n rootNotFoundModule,\n rootUnauthorizedModule,\n },\n globalErrorModule: ${globalErrorVar ? globalErrorVar : \"null\"},\n globalNotFoundModule,\n metadataRoutes,\n ssrLoader() {\n return import.meta.viteRsc.loadModule(\"ssr\", \"index\");\n },\n fontProviders: {\n buildFontLinkHeader: __buildAppPageFontLinkHeader,\n getFontLinks: _getSSRFontLinks,\n getFontPreloads: _getSSRFontPreloads,\n getFontStyles: _getSSRFontStyles,\n },\n makeThenableParams,\n sanitizer: __sanitizeErrorForClient,\n rscRenderer: renderToReadableStream,\n getNavigationContext: _getNavigationContext,\n resolveChildSegments: __resolveAppPageChildSegments,\n clearRequestContext() {\n __clearRequestContext();\n },\n createRscOnErrorHandler(request, pathname, routePath) {\n return createRscOnErrorHandler(request, pathname, routePath);\n },\n});\n\nfunction matchRoute(url) {\n return __routeMatcher.matchRoute(url);\n}\n\n/**\n * Check if a pathname matches any intercepting route.\n * Returns the match info or null.\n */\nfunction findIntercept(pathname, sourcePathname = null) {\n return __routeMatcher.findIntercept(pathname, sourcePathname);\n}\n\nasync function buildPageElements(route, params, routePath, pageRequest) {\n return __buildPageElements({\n route,\n params,\n routePath,\n pageRequest,\n globalErrorModule: ${globalErrorVar ? globalErrorVar : \"null\"},\n rootNotFoundModule: ${rootNotFoundVar ? rootNotFoundVar : \"null\"},\n rootForbiddenModule: ${rootForbiddenVar ? rootForbiddenVar : \"null\"},\n rootUnauthorizedModule: ${rootUnauthorizedVar ? rootUnauthorizedVar : \"null\"},\n metadataRoutes,\n basePath: __basePath,\n htmlLimitedBots: __htmlLimitedBots,\n });\n}\n\nconst __trailingSlash = ${JSON.stringify(ts)};\nconst __i18nConfig = ${JSON.stringify(i18nConfig)};\nconst __configRedirects = ${JSON.stringify(redirects)};\nconst __configRewrites = ${JSON.stringify(rewrites)};\nconst __configHeaders = ${JSON.stringify(headers)};\nconst __publicFiles = new Set(${JSON.stringify(publicFiles)});\nconst __allowedOrigins = ${JSON.stringify(allowedOrigins)};\nconst __expireTime = ${JSON.stringify(expireTime)};\nconst __htmlLimitedBots = ${JSON.stringify(htmlLimitedBots)};\n// Re-exported for the App Router prod-server to consume at startup —\n// mirrors the embedded \\`__basePath\\` pattern (and Pages Router's\n// \\`vinextConfig\\` export). Empty string when unset.\nexport const __assetPrefix = ${JSON.stringify(assetPrefix)};\n\nexport function seedMemoryCacheFromPrerender(serverDir) {\n return __seedMemoryCacheFromPrerender(serverDir, {\n buildAppPageHtmlKey(pathname) {\n return __isrHtmlKey(pathname);\n },\n buildAppPageRscKey(pathname) {\n return __isrRscKey(pathname);\n },\n writeAppPageEntry(key, data, metadata) {\n return __isrSetPrerenderedAppPage(key, data, metadata);\n },\n });\n}\n\n${generateDevOriginCheckCode(config?.allowedDevOrigins)}\n\n/**\n * Maximum server-action request body size.\n * Configurable via experimental.serverActions.bodySizeLimit in next.config.\n * Defaults to 1MB, matching the Next.js default.\n * @see https://nextjs.org/docs/app/api-reference/config/next-config-js/serverActions#bodysizelimit\n * Prevents unbounded request body buffering.\n */\nvar __MAX_ACTION_BODY_SIZE = ${JSON.stringify(bodySizeLimit)};\n\n// Map from route pattern to generateStaticParams function.\n// Used by the prerender phase to enumerate dynamic route URLs without\n// loading route modules via the dev server.\nexport const generateStaticParamsMap = {\n${generateStaticParamsEntries.join(\"\\n\")}\n};${loadPrerenderPagesRoutesCode}\nconst rootParamNamesMap = {\n${rootParamNameEntries.join(\"\\n\")}\n};\n\nexport default __createAppRscHandler({\n basePath: __basePath,\n clearRequestContext() {\n __clearRequestContext();\n },\n configHeaders: __configHeaders,\n configRedirects: __configRedirects,\n configRewrites: __configRewrites,\n draftModeSecret: __draftModeSecret,\n dispatchMatchedPage({\n cleanPathname,\n formState,\n actionError,\n actionFailed,\n handlerStart,\n interceptionContext,\n isProgressiveActionRender,\n isRscRequest,\n middlewareContext,\n mountedSlotsHeader,\n params,\n staticParamsValidationParams,\n rootParams,\n request,\n route,\n scriptNonce,\n searchParams,\n renderMode,\n }) {\n const PageComponent = route.page?.default;\n const __segmentConfig = __resolveAppPageSegmentConfig({\n layouts: route.layouts,\n page: route.page,\n });\n const __generateStaticParams = __resolveAppPageGenerateStaticParamsSources({\n layouts: route.layouts,\n layoutTreePositions: route.layoutTreePositions,\n page: route.page,\n routeSegments: route.routeSegments,\n });\n const _asyncRouteParams = makeThenableParams(params);\n return __dispatchAppPage({\n basePath: __basePath,\n buildPageElement(targetRoute, targetParams, targetOpts, targetSearchParams) {\n return buildPageElements(targetRoute, targetParams, cleanPathname, {\n opts: targetOpts,\n searchParams: targetSearchParams,\n isRscRequest,\n request,\n mountedSlotsHeader,\n renderMode,\n });\n },\n cleanPathname,\n clearRequestContext() {\n __clearRequestContext();\n },\n createRscOnErrorHandler(pathname, routePath) {\n return createRscOnErrorHandler(request, pathname, routePath);\n },\n debugClassification: __classDebug,\n draftModeSecret: __draftModeSecret,\n dynamicConfig: __segmentConfig.dynamicConfig,\n dynamicParamsConfig: __segmentConfig.dynamicParamsConfig,\n fetchCache: __segmentConfig.fetchCache ?? null,\n isEdgeRuntime: __isEdgeRuntime(__segmentConfig.runtime),\n findIntercept(pathname) {\n return findIntercept(pathname, interceptionContext);\n },\n generateStaticParams: __generateStaticParams,\n getFontLinks: _getSSRFontLinks,\n getFontPreloads: _getSSRFontPreloads,\n getFontStyles: _getSSRFontStyles,\n getNavigationContext: _getNavigationContext,\n getSourceRoute(sourceRouteIndex) {\n return routes[sourceRouteIndex];\n },\n hasGenerateStaticParams: __generateStaticParams.length > 0,\n hasPageDefaultExport: !!PageComponent,\n hasPageModule: !!route.page,\n handlerStart,\n interceptionContext,\n expireSeconds: __expireTime,\n formState,\n actionError,\n actionFailed,\n isProgressiveActionRender,\n isProduction: process.env.NODE_ENV === \"production\",\n isRscRequest,\n isrDebug: __isrDebug,\n isrGet: __isrGet,\n isrHtmlKey: __isrHtmlKey,\n isrRscKey: __isrRscKey,\n isrSet: __isrSet,\n loadSsrHandler() {\n return import.meta.viteRsc.loadModule(\"ssr\", \"index\");\n },\n middlewareContext,\n mountedSlotsHeader,\n params,\n staticParamsValidationParams,\n rootParams,\n probeLayoutAt(li) {\n const LayoutComp = route.layouts[li]?.default;\n if (!LayoutComp) return null;\n return LayoutComp({\n params: makeThenableParams(__resolveAppPageSegmentParams(\n route.routeSegments,\n route.layoutTreePositions?.[li] ?? 0,\n params,\n )),\n children: null,\n });\n },\n probePage() {\n return __probeAppPage({\n pageComponent: PageComponent,\n asyncRouteParams: _asyncRouteParams,\n searchParams,\n });\n },\n renderErrorBoundaryPage(renderErr) {\n return __fallbackRenderer.renderErrorBoundary(route, renderErr, isRscRequest, request, params, scriptNonce, middlewareContext, { isEdgeRuntime: __isEdgeRuntime(__segmentConfig.runtime) });\n },\n renderHttpAccessFallbackPage(statusCode, opts, currentMiddlewareContext) {\n return __fallbackRenderer.renderHttpAccessFallback(route, statusCode, isRscRequest, request, opts, scriptNonce, currentMiddlewareContext, { isEdgeRuntime: __isEdgeRuntime(__segmentConfig.runtime) });\n },\n renderToReadableStream,\n request,\n revalidateSeconds: __segmentConfig.revalidateSeconds,\n resolveRouteFetchCacheMode(targetRoute) {\n return __resolveRouteFetchCacheMode(targetRoute);\n },\n rootForbiddenModule,\n rootNotFoundModule,\n rootUnauthorizedModule,\n route,\n runWithSuppressedHookWarning(probe) {\n return suppressHookWarningAls.run(true, probe);\n },\n scheduleBackgroundRegeneration(key, renderFn, errorContext) {\n __triggerBackgroundRegeneration(key, renderFn, errorContext);\n },\n scriptNonce,\n searchParams,\n setNavigationContext,\n renderMode,\n });\n },\n dispatchMatchedRouteHandler({\n cleanPathname,\n middlewareContext,\n params,\n request,\n route,\n searchParams,\n }) {\n return __dispatchAppRouteHandler({\n basePath: __basePath,\n cleanPathname,\n clearRequestContext() {\n __clearRequestContext();\n },\n draftModeSecret: __draftModeSecret,\n i18n: __i18nConfig,\n isrDebug: __isrDebug,\n isrGet: __isrGet,\n isrRouteKey: __isrRouteKey,\n isrSet: __isrSet,\n middlewareContext,\n middlewareRequestHeaders: middlewareContext.requestHeaders,\n params,\n request,\n route: {\n pattern: route.pattern,\n routeHandler: route.routeHandler,\n routeSegments: route.routeSegments,\n },\n scheduleBackgroundRegeneration: __triggerBackgroundRegeneration,\n searchParams,\n });\n },\n ${\n instrumentationPath\n ? `ensureInstrumentation() {\n return __ensureInstrumentationRegistered(_instrumentation);\n },`\n : \"\"\n }\n handleProgressiveActionRequest({\n actionId,\n cleanPathname,\n contentType,\n middlewareContext,\n request,\n }) {\n return __handleProgressiveServerActionRequest({\n actionId,\n allowedOrigins: __allowedOrigins,\n basePath: __basePath,\n cleanPathname,\n clearRequestContext() {\n __clearRequestContext();\n },\n contentType,\n decodeAction,\n decodeFormState,\n getAndClearPendingCookies,\n getDraftModeCookieHeader,\n maxActionBodySize: __MAX_ACTION_BODY_SIZE,\n middlewareHeaders: middlewareContext.headers,\n readFormDataWithLimit: __readFormDataWithLimit,\n reportRequestError: _reportRequestError,\n request,\n setHeadersAccessPhase,\n });\n },\n handleServerActionRequest({\n actionId,\n cleanPathname,\n contentType,\n interceptionContext,\n isRscRequest,\n middlewareContext,\n mountedSlotsHeader,\n request,\n searchParams,\n }) {\n const __actionMatch = matchRoute(cleanPathname);\n const __actionIsEdgeRuntime = __actionMatch\n ? __isEdgeRuntime(__resolveAppPageSegmentConfig({ layouts: __actionMatch.route.layouts, page: __actionMatch.route.page }).runtime)\n : false;\n return __handleServerActionRscRequest({\n actionId,\n allowedOrigins: __allowedOrigins,\n basePath: __basePath,\n isEdgeRuntime: __actionIsEdgeRuntime,\n buildPageElement({\n route: actionRoute,\n params: actionParams,\n cleanPathname: actionCleanPathname,\n interceptOpts,\n searchParams: actionSearchParams,\n isRscRequest: actionIsRscRequest,\n request: actionRequest,\n mountedSlotsHeader: actionMountedSlotsHeader,\n renderMode: actionRenderMode,\n }) {\n return buildPageElements(actionRoute, actionParams, actionCleanPathname, {\n opts: interceptOpts,\n searchParams: actionSearchParams,\n isRscRequest: actionIsRscRequest,\n request: actionRequest,\n mountedSlotsHeader: actionMountedSlotsHeader,\n renderMode: actionRenderMode,\n });\n },\n cleanPathname,\n clearRequestContext() {\n __clearRequestContext();\n },\n contentType,\n createNotFoundElement(actionRouteId) {\n return {\n ...__AppElementsWire.createMetadataEntries({\n interceptionContext: null,\n rootLayoutTreePath: null,\n routeId: actionRouteId,\n }),\n [actionRouteId]: createElement(\"div\", null, \"Page not found\"),\n };\n },\n createPayloadRouteId(pathnameToRender, currentInterceptionContext) {\n return __AppElementsWire.encodeRouteId(pathnameToRender, currentInterceptionContext);\n },\n createRscOnErrorHandler(actionRequest, actionPathname, routePattern) {\n return createRscOnErrorHandler(actionRequest, actionPathname, routePattern);\n },\n createTemporaryReferenceSet,\n decodeReply,\n findIntercept(pathnameToMatch) {\n return findIntercept(pathnameToMatch, interceptionContext);\n },\n getAndClearPendingCookies,\n getDraftModeCookieHeader,\n getRouteParamNames(sourceRoute) {\n return sourceRoute.params;\n },\n getSourceRoute(sourceRouteIndex) {\n return routes[sourceRouteIndex];\n },\n isRscRequest,\n loadServerAction,\n matchRoute(pathnameToMatch) {\n return matchRoute(pathnameToMatch);\n },\n maxActionBodySize: __MAX_ACTION_BODY_SIZE,\n middlewareHeaders: middlewareContext.headers,\n middlewareStatus: middlewareContext.status,\n mountedSlotsHeader,\n readBodyWithLimit: __readBodyWithLimit,\n readFormDataWithLimit: __readFormDataWithLimit,\n renderToReadableStream,\n reportRequestError: _reportRequestError,\n request,\n sanitizeErrorForClient(error) {\n return __sanitizeErrorForClient(error);\n },\n searchParams,\n setHeadersAccessPhase,\n setNavigationContext,\n toInterceptOpts(intercept) {\n return {\n interceptionContext,\n interceptLayouts: intercept.interceptLayouts,\n interceptSlotId: intercept.slotId,\n interceptSlotKey: intercept.slotKey,\n interceptSourceMatchedUrl: interceptionContext,\n interceptPage: intercept.page,\n interceptParams: intercept.matchedParams,\n };\n },\n });\n },\n i18nConfig: __i18nConfig,\n isMiddlewareProxy: ${JSON.stringify(middlewarePath ? isProxyFile(middlewarePath) : false)},\n ${hasPagesDir ? `loadPrerenderPagesRoutes: __loadPrerenderPagesRoutes,` : \"\"}\n makeThenableParams,\n matchRoute,\n metadataRoutes,\n middlewareModule: ${middlewarePath ? \"middlewareModule\" : \"null\"},\n publicFiles: __publicFiles,\n renderNotFound({ isRscRequest, matchedParams, middlewareContext, request, route, scriptNonce }) {\n const __isEdge = route ? __isEdgeRuntime(__resolveAppPageSegmentConfig({ layouts: route.layouts, page: route.page }).runtime) : false;\n return __fallbackRenderer.renderNotFound(route, isRscRequest, request, matchedParams, scriptNonce, middlewareContext, { isEdgeRuntime: __isEdge });\n },\n ${\n hasPagesDir\n ? `async renderPagesFallback({ isRscRequest, middlewareContext, request, url }) {\n if (isRscRequest) return null;\n\n const __pagesEntry = await import.meta.viteRsc.loadModule(\"ssr\", \"index\");\n\n const __pagesRequestHeaders = middlewareContext.requestHeaders\n ? __buildRequestHeadersFromMiddlewareResponse(request.headers, middlewareContext.requestHeaders)\n : null;\n let __pagesRequest = request;\n if (__pagesRequestHeaders) {\n const __pagesRequestInit = {\n method: request.method,\n headers: __pagesRequestHeaders,\n };\n if (request.method !== \"GET\" && request.method !== \"HEAD\") {\n __pagesRequestInit.body = request.body;\n __pagesRequestInit.duplex = \"half\";\n }\n __pagesRequest = new Request(request.url, __pagesRequestInit);\n }\n\n const __pagesUrl = __decodePathParams(url.pathname) + (url.search || \"\");\n const __pagesPathname = url.pathname;\n if (__pagesPathname.startsWith(\"/api/\") || __pagesPathname === \"/api\") {\n if (typeof __pagesEntry.handleApiRoute !== \"function\") return null;\n const __pagesApiResponse = await __pagesEntry.handleApiRoute(__pagesRequest, __pagesUrl);\n return __applyRouteHandlerMiddlewareContext(__pagesApiResponse, middlewareContext);\n }\n\n if (typeof __pagesEntry.renderPage !== \"function\") return null;\n const __pagesRes = await __pagesEntry.renderPage(\n __pagesRequest,\n __pagesUrl,\n {},\n undefined,\n middlewareContext.requestHeaders,\n );\n return __pagesRes.status !== 404 ? __pagesRes : null;\n },`\n : \"\"\n }\n rootParamNamesByPattern: rootParamNamesMap,\n setNavigationContext,\n staticParamsMap: generateStaticParamsMap,\n trailingSlash: __trailingSlash,\n validateDevRequestOrigin: __validateDevRequestOrigin,\n});\n\nif (import.meta.hot) {\n import.meta.hot.accept();\n}\n`;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAuBA,MAAM,sBAAsB;AAK5B,MAAM,+BAA+B,iBACnC,2CACA,OAAO,KAAK,IACb;AACD,MAAM,0BAA0B,iBAAiB,+BAA+B,OAAO,KAAK,IAAI;AAChG,MAAM,oBAAoB,iBAAiB,gCAAgC,OAAO,KAAK,IAAI;AAC3F,MAAM,8BAA8B,iBAClC,2CACA,OAAO,KAAK,IACb;AACD,MAAM,8BAA8B,iBAClC,2CACA,OAAO,KAAK,IACb;AACD,MAAM,+BAA+B,iBACnC,4CACA,OAAO,KAAK,IACb;AACD,MAAM,mBAAmB,iBAAiB,+BAA+B,OAAO,KAAK,IAAI;AACzF,MAAM,uBAAuB,iBAAiB,mCAAmC,OAAO,KAAK,IAAI;AACjG,MAAM,0BAA0B,iBAC9B,sCACA,OAAO,KAAK,IACb;AACD,MAAM,kBAAkB,iBAAiB,6BAA6B,OAAO,KAAK,IAAI;AACtF,MAAM,yBAAyB,iBAC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,UAAU,CAAC;2BAC3B,KAAK,UAAU,SAAS,CAAC;0BAC1B,KAAK,UAAU,QAAQ,CAAC;gCAClB,KAAK,UAAU,YAAY,CAAC;2BACjC,KAAK,UAAU,eAAe,CAAC;uBACnC,KAAK,UAAU,WAAW,CAAC;4BACtB,KAAK,UAAU,gBAAgB,CAAC;;;;+BAI7B,KAAK,UAAU,YAAY,CAAC;;;;;;;;;;;;;;;;EAgBzD,2BAA2B,QAAQ,kBAAkB,CAAC;;;;;;;;;+BASzB,KAAK,UAAU,cAAc,CAAC;;;;;;EAM3D,4BAA4B,KAAK,KAAK,CAAC;IACrC,6BAA6B;;EAE/B,qBAAqB,KAAK,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0L9B,sBACI;;QAGA,GACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAyIoB,KAAK,UAAU,iBAAiB,YAAY,eAAe,GAAG,MAAM,CAAC;IACxF,cAAc,0DAA0D,GAAG;;;;sBAIzD,iBAAiB,qBAAqB,OAAO;;;;;;IAO/D,cACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAuCA,GACL"}
1
+ {"version":3,"file":"app-rsc-entry.js","names":[],"sources":["../../src/entries/app-rsc-entry.ts"],"sourcesContent":["/**\n * App Router RSC entry generator.\n *\n * Generates the virtual RSC entry module for the App Router.\n * The RSC entry does route matching and renders the component tree,\n * then delegates to the SSR entry for HTML generation.\n *\n * Previously housed in server/app-dev-server.ts.\n */\nimport { randomUUID } from \"node:crypto\";\nimport { buildAppRscManifestCode } from \"./app-rsc-manifest.js\";\nimport { resolveEntryPath } from \"./runtime-entry-module.js\";\nimport { normalizePathSeparators } from \"../utils/path.js\";\nimport type {\n NextHeader,\n NextI18nConfig,\n NextRedirect,\n NextRewrite,\n} from \"../config/next-config.js\";\nimport type { AppRoute } from \"../routing/app-router.js\";\nimport { generateDevOriginCheckCode } from \"../server/dev-origin-check.js\";\nimport type { MetadataFileRoute } from \"../server/metadata-routes.js\";\nimport { isProxyFile } from \"../server/middleware.js\";\n\nconst DEFAULT_EXPIRE_TIME = 31_536_000;\n\n// Pre-computed absolute paths for generated-code imports. The virtual RSC\n// entry can't use relative imports (it has no real file location), so we\n// resolve these at code-generation time and embed them as absolute paths.\nconst middlewareRequestHeadersPath = resolveEntryPath(\n \"../server/middleware-request-headers.js\",\n import.meta.url,\n);\nconst normalizePathModulePath = resolveEntryPath(\"../server/normalize-path.js\", import.meta.url);\nconst appRscHandlerPath = resolveEntryPath(\"../server/app-rsc-handler.js\", import.meta.url);\nconst appRouteHandlerDispatchPath = resolveEntryPath(\n \"../server/app-route-handler-dispatch.js\",\n import.meta.url,\n);\nconst appRouteHandlerResponsePath = resolveEntryPath(\n \"../server/app-route-handler-response.js\",\n import.meta.url,\n);\nconst appServerActionExecutionPath = resolveEntryPath(\n \"../server/app-server-action-execution.js\",\n import.meta.url,\n);\nconst appRscErrorsPath = resolveEntryPath(\"../server/app-rsc-errors.js\", import.meta.url);\nconst appPageExecutionPath = resolveEntryPath(\"../server/app-page-execution.js\", import.meta.url);\nconst appFallbackRendererPath = resolveEntryPath(\n \"../server/app-fallback-renderer.js\",\n import.meta.url,\n);\nconst appElementsPath = resolveEntryPath(\"../server/app-elements.js\", import.meta.url);\nconst appPageRouteWiringPath = resolveEntryPath(\n \"../server/app-page-route-wiring.js\",\n import.meta.url,\n);\nconst appPageProbePath = resolveEntryPath(\"../server/app-page-probe.js\", import.meta.url);\nconst appPageParamsPath = resolveEntryPath(\"../server/app-page-params.js\", import.meta.url);\nconst appPageDispatchPath = resolveEntryPath(\"../server/app-page-dispatch.js\", import.meta.url);\nconst appPageRequestPath = resolveEntryPath(\"../server/app-page-request.js\", import.meta.url);\nconst appSegmentConfigPath = resolveEntryPath(\"../server/app-segment-config.js\", import.meta.url);\nconst appRscRouteMatchingPath = resolveEntryPath(\n \"../server/app-rsc-route-matching.js\",\n import.meta.url,\n);\nconst rscStreamHintsPath = resolveEntryPath(\"../server/rsc-stream-hints.js\", import.meta.url);\nconst isrCachePath = resolveEntryPath(\"../server/isr-cache.js\", import.meta.url);\nconst thenableParamsShimPath = resolveEntryPath(\"../shims/thenable-params.js\", import.meta.url);\nconst appPageElementBuilderPath = resolveEntryPath(\n \"../server/app-page-element-builder.js\",\n import.meta.url,\n);\nconst instrumentationRuntimePath = resolveEntryPath(\n \"../server/instrumentation-runtime.js\",\n import.meta.url,\n);\nconst appRscErrorHandlerPath = resolveEntryPath(\n \"../server/app-rsc-error-handler.js\",\n import.meta.url,\n);\nconst appRequestContextPath = resolveEntryPath(\"../server/app-request-context.js\", import.meta.url);\nconst appPrerenderStaticParamsPath = resolveEntryPath(\n \"../server/app-prerender-static-params.js\",\n import.meta.url,\n);\nconst seedCachePath = resolveEntryPath(\"../server/seed-cache.js\", import.meta.url);\nconst appHookWarningSuppressionPath = resolveEntryPath(\n \"../server/app-hook-warning-suppression.js\",\n import.meta.url,\n);\nconst serverGlobalsPath = resolveEntryPath(\"../server/server-globals.js\", import.meta.url);\n\n/**\n * Resolved config options relevant to App Router request handling.\n * Passed from the Vite plugin where the full next.config.js is loaded.\n */\ntype AppRouterConfig = {\n redirects?: NextRedirect[];\n rewrites?: {\n beforeFiles: NextRewrite[];\n afterFiles: NextRewrite[];\n fallback: NextRewrite[];\n };\n headers?: NextHeader[];\n /** Extra origins allowed for server action CSRF checks (from experimental.serverActions.allowedOrigins). */\n allowedOrigins?: string[];\n /** Extra origins allowed for dev server access (from allowedDevOrigins). */\n allowedDevOrigins?: string[];\n /** Body size limit for server actions in bytes (from experimental.serverActions.bodySizeLimit). */\n bodySizeLimit?: number;\n /** Serialized next.config htmlLimitedBots regexp source. */\n htmlLimitedBots?: string;\n /**\n * Allow-list of keys (from `experimental.clientTraceMetadata`) to surface\n * from the active OpenTelemetry context as `<meta>` tags in the SSR head.\n * Undefined or empty disables emission entirely.\n */\n clientTraceMetadata?: string[] | undefined;\n /**\n * Resolved `assetPrefix` from next.config. Empty string when unset.\n * Embedded in the generated entry so the App Router prod-server reads\n * it from the imported module instead of a sidecar JSON file —\n * matches how the Pages Router entry exposes `vinextConfig.assetPrefix`.\n *\n * @see https://nextjs.org/docs/app/api-reference/config/next-config-js/assetPrefix\n */\n assetPrefix?: string;\n /** Route-level expire fallback in seconds for ISR entries with numeric revalidate. */\n expireTime?: number;\n /** Inline app CSS into production HTML (from experimental.inlineCss). */\n inlineCss?: boolean;\n /** Internationalization routing config for middleware matcher locale handling. */\n i18n?: NextI18nConfig | null;\n /**\n * Absolute path to `app/global-not-found.{tsx,ts,js,jsx}` when present.\n * When provided, route-miss 404s render this module standalone (it owns its\n * own `<html>` and `<body>`) instead of wrapping the regular `not-found.tsx`\n * boundary inside the root layout. Mirrors Next.js 16's\n * `experimental.globalNotFound` behavior.\n * @see https://github.com/vercel/next.js/blob/canary/test/e2e/app-dir/global-not-found\n */\n globalNotFoundPath?: string | null;\n /**\n * When true, the project has a `pages/` directory alongside the App Router.\n * The generated RSC entry exposes `/__vinext/prerender/pages-static-paths`\n * so `prerenderPages` can call `getStaticPaths` via `wrangler unstable_startWorker`\n * in CF Workers builds. `pageRoutes` is loaded from the SSR environment via\n * `import(\"./ssr/index.js\")`, which re-exports it from\n * `virtual:vinext-server-entry` when this flag is set.\n */\n hasPagesDir?: boolean;\n /** Exact public/ file routes, using normalized leading-slash pathnames. */\n publicFiles?: string[];\n /** Server-only token used to validate the draft-mode bypass cookie. */\n draftModeSecret?: string;\n};\n\n/**\n * Generate the virtual RSC entry module.\n *\n * This runs in the `rsc` Vite environment (react-server condition).\n * It matches the incoming request URL to an app route, builds the\n * nested layout + page tree, and renders it to an RSC stream.\n */\nexport function generateRscEntry(\n appDir: string,\n routes: AppRoute[],\n middlewarePath?: string | null,\n metadataRoutes?: MetadataFileRoute[],\n globalErrorPath?: string | null,\n basePath?: string,\n trailingSlash?: boolean,\n config?: AppRouterConfig,\n instrumentationPath?: string | null,\n): string {\n const bp = basePath ?? \"\";\n const ts = trailingSlash ?? false;\n const redirects = config?.redirects ?? [];\n const rewrites = config?.rewrites ?? { beforeFiles: [], afterFiles: [], fallback: [] };\n const headers = config?.headers ?? [];\n const allowedOrigins = config?.allowedOrigins ?? [];\n const bodySizeLimit = config?.bodySizeLimit ?? 1 * 1024 * 1024;\n const htmlLimitedBots = config?.htmlLimitedBots;\n const clientTraceMetadata = config?.clientTraceMetadata;\n const assetPrefix = config?.assetPrefix ?? \"\";\n const expireTime = config?.expireTime ?? DEFAULT_EXPIRE_TIME;\n const inlineCss = config?.inlineCss === true;\n const i18nConfig = config?.i18n ?? null;\n const hasPagesDir = config?.hasPagesDir ?? false;\n const publicFiles = config?.publicFiles ?? [];\n const draftModeSecret = config?.draftModeSecret ?? randomUUID();\n const manifestCode = buildAppRscManifestCode({\n routes,\n metadataRoutes,\n globalErrorPath,\n globalNotFoundPath: config?.globalNotFoundPath ?? null,\n });\n const {\n imports,\n routeEntries,\n metaRouteEntries,\n generateStaticParamsEntries,\n rootParamNameEntries,\n rootNotFoundVar,\n rootForbiddenVar,\n rootUnauthorizedVar,\n rootLayoutVars,\n globalErrorVar,\n globalNotFoundImportSpecifier,\n } = manifestCode;\n const loadPrerenderPagesRoutesCode = hasPagesDir\n ? `\nasync function __loadPrerenderPagesRoutes() {\n const __gspSsrEntry = await import.meta.viteRsc.loadModule(\"ssr\", \"index\");\n return __gspSsrEntry.pageRoutes;\n}\n`\n : \"\";\n\n return `\nimport ${JSON.stringify(serverGlobalsPath)};\nimport {\n renderToReadableStream as _renderToReadableStream,\n decodeAction,\n decodeFormState,\n decodeReply,\n loadServerAction,\n createTemporaryReferenceSet,\n} from \"@vitejs/plugin-rsc/rsc\";\nimport { createRscRenderer } from ${JSON.stringify(rscStreamHintsPath)};\n\nconst renderToReadableStream = createRscRenderer(_renderToReadableStream);\nimport { createElement } from \"react\";\nimport { getNavigationContext as _getNavigationContext } from \"next/navigation\";\nimport { headersContextFromRequest, getDraftModeCookieHeader, getAndClearPendingCookies, consumeDynamicUsage, consumeInvalidDynamicUsageError, setHeadersAccessPhase } from \"next/headers\";\nimport { mergeMetadata, resolveModuleMetadata, mergeViewport, resolveModuleViewport } from \"vinext/metadata\";\n${middlewarePath ? `import * as middlewareModule from ${JSON.stringify(normalizePathSeparators(middlewarePath))};` : \"\"}\n${\n instrumentationPath\n ? `import * as _instrumentation from ${JSON.stringify(normalizePathSeparators(instrumentationPath))};\nimport { ensureInstrumentationRegistered as __ensureInstrumentationRegistered } from ${JSON.stringify(instrumentationRuntimePath)};`\n : \"\"\n}\nimport { createAppRscHandler as __createAppRscHandler } from ${JSON.stringify(appRscHandlerPath)};\nimport { decodePathParams as __decodePathParams } from ${JSON.stringify(normalizePathModulePath)};\nimport { buildRequestHeadersFromMiddlewareResponse as __buildRequestHeadersFromMiddlewareResponse } from ${JSON.stringify(middlewareRequestHeadersPath)};\nimport {\n dispatchAppRouteHandler as __dispatchAppRouteHandler,\n} from ${JSON.stringify(appRouteHandlerDispatchPath)};\nimport {\n applyRouteHandlerMiddlewareContext as __applyRouteHandlerMiddlewareContext,\n} from ${JSON.stringify(appRouteHandlerResponsePath)};\nimport {\n handleProgressiveServerActionRequest as __handleProgressiveServerActionRequest,\n handleServerActionRscRequest as __handleServerActionRscRequest,\n readActionBodyWithLimit as __readBodyWithLimit,\n readActionFormDataWithLimit as __readFormDataWithLimit,\n} from ${JSON.stringify(appServerActionExecutionPath)};\nimport {\n sanitizeErrorForClient as __sanitizeErrorForClient,\n} from ${JSON.stringify(appRscErrorsPath)};\nimport { createAppRscOnErrorHandler } from ${JSON.stringify(appRscErrorHandlerPath)};\nimport {\n buildAppPageFontLinkHeader as __buildAppPageFontLinkHeader,\n resolveAppPageSpecialError as __resolveAppPageSpecialError,\n} from ${JSON.stringify(appPageExecutionPath)};\nimport {\n createAppFallbackRenderer as __createAppFallbackRenderer,\n} from ${JSON.stringify(appFallbackRendererPath)};\nimport {\n AppElementsWire as __AppElementsWire,\n} from ${JSON.stringify(appElementsPath)};\nimport {\n resolveAppPageChildSegments as __resolveAppPageChildSegments,\n} from ${JSON.stringify(appPageRouteWiringPath)};\nimport { buildPageElements as __buildPageElements } from ${JSON.stringify(appPageElementBuilderPath)};\nimport {\n resolveAppPageSegmentParams as __resolveAppPageSegmentParams,\n} from ${JSON.stringify(appPageParamsPath)};\nimport { probeAppPage as __probeAppPage } from ${JSON.stringify(appPageProbePath)};\nimport {\n dispatchAppPage as __dispatchAppPage,\n} from ${JSON.stringify(appPageDispatchPath)};\nimport {\n resolveAppPageGenerateStaticParamsSources as __resolveAppPageGenerateStaticParamsSources,\n} from ${JSON.stringify(appPageRequestPath)};\nimport {\n isEdgeRuntime as __isEdgeRuntime,\n resolveAppPageFetchCacheMode as __resolveAppPageFetchCacheMode,\n resolveAppPageSegmentConfig as __resolveAppPageSegmentConfig,\n} from ${JSON.stringify(appSegmentConfigPath)};\nimport { makeThenableParams } from ${JSON.stringify(thenableParamsShimPath)};\nimport {\n createAppRscRouteMatcher as __createAppRscRouteMatcher,\n} from ${JSON.stringify(appRscRouteMatchingPath)};\nimport {\n appIsrHtmlKey as __isrHtmlKey,\n appIsrRscKey as __isrRscKey,\n appIsrRouteKey as __isrRouteKey,\n isrGet as __isrGet,\n isrSet as __isrSet,\n isrSetPrerenderedAppPage as __isrSetPrerenderedAppPage,\n triggerBackgroundRegeneration as __triggerBackgroundRegeneration,\n} from ${JSON.stringify(isrCachePath)};\n// Import server-only state module to register ALS-backed accessors.\nimport \"vinext/navigation-state\";\nimport { reportRequestError as _reportRequestError } from \"vinext/instrumentation\";\nimport { getSSRFontLinks as _getSSRFontLinks, getSSRFontStyles as _getSSRFontStylesGoogle, getSSRFontPreloads as _getSSRFontPreloadsGoogle } from \"next/font/google\";\nimport { getSSRFontStyles as _getSSRFontStylesLocal, getSSRFontPreloads as _getSSRFontPreloadsLocal } from \"next/font/local\";\nfunction _getSSRFontStyles() { return [..._getSSRFontStylesGoogle(), ..._getSSRFontStylesLocal()]; }\nfunction _getSSRFontPreloads() { return [..._getSSRFontPreloadsGoogle(), ..._getSSRFontPreloadsLocal()]; }\n${hasPagesDir ? `// Pages Router routes are loaded lazily from the SSR environment for internal prerender requests.` : \"\"}\n\n// Suppress expected \"Invalid hook call\" dev warning when layout/page\n// components are probed outside React's render cycle. The import patches\n// console.error once at module load (side-effect) and exposes the ALS\n// so per-route dispatch can opt into suppression via .run(true, ...).\nimport { suppressHookWarningAls } from ${JSON.stringify(appHookWarningSuppressionPath)};\nimport { clearAppRequestContext as __clearRequestContext, setAppNavigationContext as setNavigationContext } from ${JSON.stringify(appRequestContextPath)};\nimport { createAppPrerenderStaticParamsResolver as __createAppPrerenderStaticParamsResolver } from ${JSON.stringify(appPrerenderStaticParamsPath)};\nimport { seedMemoryCacheFromPrerender as __seedMemoryCacheFromPrerender } from ${JSON.stringify(seedCachePath)};\n\nconst __draftModeSecret = ${JSON.stringify(draftModeSecret)};\n\n// Note: cache entries are written with \\`headers: undefined\\`. Next.js stores\n// response headers (e.g. set-cookie from cookies().set() during render) in the\n// cache entry so they can be replayed on HIT. We don't do this because:\n// 1. Pages that call cookies().set() during render trigger dynamicUsedDuringRender,\n// which opts them out of ISR caching before we reach the write path.\n// 2. Custom response headers set via next/headers are not yet captured separately\n// from the live Response object in vinext's server pipeline.\n// In practice this means ISR-cached responses won't replay render-time set-cookie\n// headers — but that case is already prevented by the dynamic-usage opt-out.\n// TODO: capture render-time response headers for full Next.js parity.\n// Verbose cache logging — opt in with NEXT_PRIVATE_DEBUG_CACHE=1.\n// Matches the env var Next.js uses for its own cache debug output so operators\n// have a single knob for all cache tracing.\nconst __isrDebug = process.env.NEXT_PRIVATE_DEBUG_CACHE\n ? console.debug.bind(console, \"[vinext] ISR:\")\n : undefined;\n\n// Classification debug — opt in with VINEXT_DEBUG_CLASSIFICATION=1. Gated on\n// the env var so the hot path pays no overhead unless an operator is actively\n// tracing why a layout was flagged static or dynamic. The reason payload is\n// carried by __VINEXT_CLASS_REASONS and consumed inside probeAppPageLayouts.\nconst __classDebug = process.env.VINEXT_DEBUG_CLASSIFICATION\n ? function(layoutId, reason) {\n console.debug(\"[vinext] CLS:\", layoutId, reason);\n }\n : undefined;\n\nfunction __resolveRouteFetchCacheMode(route) {\n return __resolveAppPageFetchCacheMode({\n layouts: route.layouts,\n page: route.page,\n });\n}\n\n${imports.join(\"\\n\")}\n\n${\n instrumentationPath\n ? `// Lazy instrumentation initialisation is handled by ensureInstrumentationRegistered\n// (imported from vinext/instrumentation-runtime). The generated entry only passes\n// the user module in; all bookkeeping (initialized flag, shared promise, prerender\n// skip) lives in the typed helper so it can be unit-tested independently.`\n : \"\"\n}\n\n// Build-time layout classification dispatch. Replaced in generateBundle\n// with a switch statement that returns a pre-computed per-layout\n// Map<layoutIndex, \"static\" | \"dynamic\"> for each route. Until the\n// plugin patches this stub, every route falls back to the Layer 3\n// runtime probe, which is the current (slow) behaviour.\nfunction __VINEXT_CLASS(routeIdx) {\n return null;\n}\n\n// Build-time layout classification reasons dispatch. Sibling of\n// __VINEXT_CLASS, returning a per-route Map<layoutIndex, ClassificationReason>\n// that feeds the debug channel when VINEXT_DEBUG_CLASSIFICATION is active.\n// Replaced in generateBundle with a real dispatch table; the stub returns\n// null so the hot path never allocates reason maps when debug is off.\nfunction __VINEXT_CLASS_REASONS(routeIdx) {\n return null;\n}\n\nconst routes = [\n${routeEntries.join(\",\\n\")}\n];\nconst __routeMatcher = __createAppRscRouteMatcher(routes);\n\nconst metadataRoutes = [\n${metaRouteEntries.join(\",\\n\")}\n];\n\n// Hoisted ahead of __fallbackRenderer / buildPageElements so both can thread\n// the configured basePath through file-based metadata href emission.\n// Re-exported so the Cloudflare worker entry can strip basePath before\n// recognising /_next/static/* paths (parity with __assetPrefix below).\nexport const __basePath = ${JSON.stringify(bp)};\n\nconst rootNotFoundModule = ${rootNotFoundVar ? rootNotFoundVar : \"null\"};\nconst rootForbiddenModule = ${rootForbiddenVar ? rootForbiddenVar : \"null\"};\nconst rootUnauthorizedModule = ${rootUnauthorizedVar ? rootUnauthorizedVar : \"null\"};\nconst rootLayouts = [${rootLayoutVars.join(\", \")}];\n// Root-level app/global-not-found loader. When present, route-miss 404s render\n// this module standalone (it provides its own html/body) instead of wrapping\n// the not-found.tsx boundary inside the root layout. Page-triggered notFound()\n// calls still use the regular not-found.tsx boundary inside the layouts.\n//\n// The module is loaded via dynamic \\`import()\\` (not a static \\`import * as\\`)\n// so the bundler emits it in its own JS+CSS chunk. Without that isolation,\n// global-not-found's CSS gets concatenated with the root layout's CSS into a\n// single file, where the CSS minifier (lightningcss) drops overlapping\n// declarations as dead code — breaking the cascade for route-miss 404s.\n// See https://github.com/vercel/next.js/blob/canary/packages/next/src/server/app-render/app-render.tsx#L495-L520\n// See Next.js test: test/e2e/app-dir/initial-css-order/initial-css-order.test.ts\nconst __loadGlobalNotFoundModule = ${\n globalNotFoundImportSpecifier ? `() => import(${globalNotFoundImportSpecifier})` : \"null\"\n };\n\nconst createRscOnErrorHandler = (request, pathname, routePath) =>\n createAppRscOnErrorHandler(_reportRequestError, request, pathname, routePath);\n\nconst __fallbackRenderer = __createAppFallbackRenderer({\n basePath: __basePath,\n rootBoundaries: {\n rootForbiddenModule,\n rootLayouts,\n rootNotFoundModule,\n rootUnauthorizedModule,\n },\n globalErrorModule: ${globalErrorVar ? globalErrorVar : \"null\"},\n loadGlobalNotFoundModule: __loadGlobalNotFoundModule,\n metadataRoutes,\n ssrLoader() {\n return import.meta.viteRsc.loadModule(\"ssr\", \"index\");\n },\n fontProviders: {\n buildFontLinkHeader: __buildAppPageFontLinkHeader,\n getFontLinks: _getSSRFontLinks,\n getFontPreloads: _getSSRFontPreloads,\n getFontStyles: _getSSRFontStyles,\n },\n makeThenableParams,\n sanitizer: __sanitizeErrorForClient,\n rscRenderer: renderToReadableStream,\n getNavigationContext: _getNavigationContext,\n resolveChildSegments: __resolveAppPageChildSegments,\n clearRequestContext() {\n __clearRequestContext();\n },\n createRscOnErrorHandler(request, pathname, routePath) {\n return createRscOnErrorHandler(request, pathname, routePath);\n },\n});\n\nfunction matchRoute(url) {\n return __routeMatcher.matchRoute(url);\n}\n\n/**\n * Check if a pathname matches any intercepting route.\n * Returns the match info or null.\n */\nfunction findIntercept(pathname, sourcePathname = null) {\n return __routeMatcher.findIntercept(pathname, sourcePathname);\n}\n\nasync function buildPageElements(route, params, routePath, pageRequest) {\n return __buildPageElements({\n route,\n params,\n routePath,\n pageRequest,\n globalErrorModule: ${globalErrorVar ? globalErrorVar : \"null\"},\n rootNotFoundModule: ${rootNotFoundVar ? rootNotFoundVar : \"null\"},\n rootForbiddenModule: ${rootForbiddenVar ? rootForbiddenVar : \"null\"},\n rootUnauthorizedModule: ${rootUnauthorizedVar ? rootUnauthorizedVar : \"null\"},\n metadataRoutes,\n basePath: __basePath,\n htmlLimitedBots: __htmlLimitedBots,\n });\n}\n\nconst __trailingSlash = ${JSON.stringify(ts)};\nconst __i18nConfig = ${JSON.stringify(i18nConfig)};\nconst __configRedirects = ${JSON.stringify(redirects)};\nconst __configRewrites = ${JSON.stringify(rewrites)};\nconst __configHeaders = ${JSON.stringify(headers)};\nconst __publicFiles = new Set(${JSON.stringify(publicFiles)});\nconst __allowedOrigins = ${JSON.stringify(allowedOrigins)};\nconst __expireTime = ${JSON.stringify(expireTime)};\nconst __htmlLimitedBots = ${JSON.stringify(htmlLimitedBots)};\nconst __clientTraceMetadata = ${JSON.stringify(clientTraceMetadata)};\n// Re-exported for the App Router prod-server to consume at startup —\n// mirrors the embedded \\`__basePath\\` pattern (and Pages Router's\n// \\`vinextConfig\\` export). Empty string when unset.\nexport const __assetPrefix = ${JSON.stringify(assetPrefix)};\nexport const __inlineCss = ${JSON.stringify(inlineCss)};\n\nexport function seedMemoryCacheFromPrerender(serverDir) {\n return __seedMemoryCacheFromPrerender(serverDir, {\n buildAppPageHtmlKey(pathname) {\n return __isrHtmlKey(pathname);\n },\n buildAppPageRscKey(pathname) {\n return __isrRscKey(pathname);\n },\n writeAppPageEntry(key, data, metadata) {\n return __isrSetPrerenderedAppPage(key, data, metadata);\n },\n });\n}\n\n${generateDevOriginCheckCode(config?.allowedDevOrigins)}\n\n/**\n * Maximum server-action request body size.\n * Configurable via experimental.serverActions.bodySizeLimit in next.config.\n * Defaults to 1MB, matching the Next.js default.\n * @see https://nextjs.org/docs/app/api-reference/config/next-config-js/serverActions#bodysizelimit\n * Prevents unbounded request body buffering.\n */\nvar __MAX_ACTION_BODY_SIZE = ${JSON.stringify(bodySizeLimit)};\n\n// Map from route pattern to generateStaticParams function.\n// Used by the prerender phase to enumerate dynamic route URLs without\n// loading route modules via the dev server.\nexport const generateStaticParamsMap = {\n${generateStaticParamsEntries.join(\"\\n\")}\n};${loadPrerenderPagesRoutesCode}\nconst rootParamNamesMap = {\n${rootParamNameEntries.join(\"\\n\")}\n};\n\nexport default __createAppRscHandler({\n basePath: __basePath,\n clearRequestContext() {\n __clearRequestContext();\n },\n configHeaders: __configHeaders,\n configRedirects: __configRedirects,\n configRewrites: __configRewrites,\n draftModeSecret: __draftModeSecret,\n dispatchMatchedPage({\n cleanPathname,\n formState,\n actionError,\n actionFailed,\n handlerStart,\n interceptionContext,\n isProgressiveActionRender,\n isRscRequest,\n middlewareContext,\n mountedSlotsHeader,\n params,\n staticParamsValidationParams,\n rootParams,\n request,\n route,\n scriptNonce,\n searchParams,\n renderMode,\n }) {\n const PageComponent = route.page?.default;\n const __segmentConfig = __resolveAppPageSegmentConfig({\n layouts: route.layouts,\n page: route.page,\n });\n const __generateStaticParams = __resolveAppPageGenerateStaticParamsSources({\n layouts: route.layouts,\n layoutTreePositions: route.layoutTreePositions,\n page: route.page,\n routeSegments: route.routeSegments,\n });\n const _asyncRouteParams = makeThenableParams(params);\n return __dispatchAppPage({\n basePath: __basePath,\n clientTraceMetadata: __clientTraceMetadata,\n buildPageElement(targetRoute, targetParams, targetOpts, targetSearchParams) {\n return buildPageElements(targetRoute, targetParams, cleanPathname, {\n opts: targetOpts,\n searchParams: targetSearchParams,\n isRscRequest,\n request,\n mountedSlotsHeader,\n renderMode,\n });\n },\n cleanPathname,\n clearRequestContext() {\n __clearRequestContext();\n },\n createRscOnErrorHandler(pathname, routePath) {\n return createRscOnErrorHandler(request, pathname, routePath);\n },\n debugClassification: __classDebug,\n draftModeSecret: __draftModeSecret,\n dynamicConfig: __segmentConfig.dynamicConfig,\n dynamicParamsConfig: __segmentConfig.dynamicParamsConfig,\n fetchCache: __segmentConfig.fetchCache ?? null,\n isEdgeRuntime: __isEdgeRuntime(__segmentConfig.runtime),\n findIntercept(pathname) {\n return findIntercept(pathname, interceptionContext);\n },\n generateStaticParams: __generateStaticParams,\n getFontLinks: _getSSRFontLinks,\n getFontPreloads: _getSSRFontPreloads,\n getFontStyles: _getSSRFontStyles,\n getNavigationContext: _getNavigationContext,\n getSourceRoute(sourceRouteIndex) {\n return routes[sourceRouteIndex];\n },\n hasGenerateStaticParams: __generateStaticParams.length > 0,\n hasPageDefaultExport: !!PageComponent,\n hasPageModule: !!route.page,\n handlerStart,\n interceptionContext,\n expireSeconds: __expireTime,\n formState,\n actionError,\n actionFailed,\n isProgressiveActionRender,\n isProduction: process.env.NODE_ENV === \"production\",\n isRscRequest,\n isrDebug: __isrDebug,\n isrGet: __isrGet,\n isrHtmlKey: __isrHtmlKey,\n isrRscKey: __isrRscKey,\n isrSet: __isrSet,\n loadSsrHandler() {\n return import.meta.viteRsc.loadModule(\"ssr\", \"index\");\n },\n middlewareContext,\n mountedSlotsHeader,\n params,\n staticParamsValidationParams,\n rootParams,\n probeLayoutAt(li) {\n const LayoutComp = route.layouts[li]?.default;\n if (!LayoutComp) return null;\n return LayoutComp({\n params: makeThenableParams(__resolveAppPageSegmentParams(\n route.routeSegments,\n route.layoutTreePositions?.[li] ?? 0,\n params,\n )),\n children: null,\n });\n },\n probePage() {\n return __probeAppPage({\n pageComponent: PageComponent,\n asyncRouteParams: _asyncRouteParams,\n searchParams,\n });\n },\n renderErrorBoundaryPage(renderErr) {\n return __fallbackRenderer.renderErrorBoundary(route, renderErr, isRscRequest, request, params, scriptNonce, middlewareContext, { isEdgeRuntime: __isEdgeRuntime(__segmentConfig.runtime) });\n },\n renderHttpAccessFallbackPage(statusCode, opts, currentMiddlewareContext) {\n return __fallbackRenderer.renderHttpAccessFallback(route, statusCode, isRscRequest, request, opts, scriptNonce, currentMiddlewareContext, { isEdgeRuntime: __isEdgeRuntime(__segmentConfig.runtime) });\n },\n renderToReadableStream,\n request,\n revalidateSeconds: __segmentConfig.revalidateSeconds,\n resolveRouteFetchCacheMode(targetRoute) {\n return __resolveRouteFetchCacheMode(targetRoute);\n },\n rootForbiddenModule,\n rootNotFoundModule,\n rootUnauthorizedModule,\n route,\n runWithSuppressedHookWarning(probe) {\n return suppressHookWarningAls.run(true, probe);\n },\n scheduleBackgroundRegeneration(key, renderFn, errorContext) {\n __triggerBackgroundRegeneration(key, renderFn, errorContext);\n },\n scriptNonce,\n searchParams,\n setNavigationContext,\n renderMode,\n });\n },\n dispatchMatchedRouteHandler({\n cleanPathname,\n middlewareContext,\n params,\n request,\n route,\n searchParams,\n }) {\n return __dispatchAppRouteHandler({\n basePath: __basePath,\n cleanPathname,\n clearRequestContext() {\n __clearRequestContext();\n },\n draftModeSecret: __draftModeSecret,\n i18n: __i18nConfig,\n isrDebug: __isrDebug,\n isrGet: __isrGet,\n isrRouteKey: __isrRouteKey,\n isrSet: __isrSet,\n middlewareContext,\n middlewareRequestHeaders: middlewareContext.requestHeaders,\n params,\n request,\n route: {\n pattern: route.pattern,\n routeHandler: route.routeHandler,\n routeSegments: route.routeSegments,\n },\n scheduleBackgroundRegeneration: __triggerBackgroundRegeneration,\n searchParams,\n });\n },\n ${\n instrumentationPath\n ? `ensureInstrumentation() {\n return __ensureInstrumentationRegistered(_instrumentation);\n },`\n : \"\"\n }\n handleProgressiveActionRequest({\n actionId,\n cleanPathname,\n contentType,\n middlewareContext,\n request,\n }) {\n return __handleProgressiveServerActionRequest({\n actionId,\n allowedOrigins: __allowedOrigins,\n basePath: __basePath,\n cleanPathname,\n clearRequestContext() {\n __clearRequestContext();\n },\n contentType,\n decodeAction,\n decodeFormState,\n getAndClearPendingCookies,\n getDraftModeCookieHeader,\n maxActionBodySize: __MAX_ACTION_BODY_SIZE,\n middlewareHeaders: middlewareContext.headers,\n readFormDataWithLimit: __readFormDataWithLimit,\n reportRequestError: _reportRequestError,\n request,\n setHeadersAccessPhase,\n });\n },\n handleServerActionRequest({\n actionId,\n cleanPathname,\n contentType,\n interceptionContext,\n isRscRequest,\n middlewareContext,\n mountedSlotsHeader,\n request,\n searchParams,\n }) {\n const __actionMatch = matchRoute(cleanPathname);\n const __actionIsEdgeRuntime = __actionMatch\n ? __isEdgeRuntime(__resolveAppPageSegmentConfig({ layouts: __actionMatch.route.layouts, page: __actionMatch.route.page }).runtime)\n : false;\n return __handleServerActionRscRequest({\n actionId,\n allowedOrigins: __allowedOrigins,\n basePath: __basePath,\n isEdgeRuntime: __actionIsEdgeRuntime,\n buildPageElement({\n route: actionRoute,\n params: actionParams,\n cleanPathname: actionCleanPathname,\n interceptOpts,\n searchParams: actionSearchParams,\n isRscRequest: actionIsRscRequest,\n request: actionRequest,\n mountedSlotsHeader: actionMountedSlotsHeader,\n renderMode: actionRenderMode,\n }) {\n return buildPageElements(actionRoute, actionParams, actionCleanPathname, {\n opts: interceptOpts,\n searchParams: actionSearchParams,\n isRscRequest: actionIsRscRequest,\n request: actionRequest,\n mountedSlotsHeader: actionMountedSlotsHeader,\n renderMode: actionRenderMode,\n });\n },\n cleanPathname,\n clearRequestContext() {\n __clearRequestContext();\n },\n contentType,\n createNotFoundElement(actionRouteId) {\n return {\n ...__AppElementsWire.createMetadataEntries({\n interceptionContext: null,\n rootLayoutTreePath: null,\n routeId: actionRouteId,\n }),\n [actionRouteId]: createElement(\"div\", null, \"Page not found\"),\n };\n },\n createPayloadRouteId(pathnameToRender, currentInterceptionContext) {\n return __AppElementsWire.encodeRouteId(pathnameToRender, currentInterceptionContext);\n },\n createRscOnErrorHandler(actionRequest, actionPathname, routePattern) {\n return createRscOnErrorHandler(actionRequest, actionPathname, routePattern);\n },\n createTemporaryReferenceSet,\n decodeReply,\n findIntercept(pathnameToMatch) {\n return findIntercept(pathnameToMatch, interceptionContext);\n },\n getAndClearPendingCookies,\n getDraftModeCookieHeader,\n getRouteParamNames(sourceRoute) {\n return sourceRoute.params;\n },\n getSourceRoute(sourceRouteIndex) {\n return routes[sourceRouteIndex];\n },\n isRscRequest,\n loadServerAction,\n matchRoute(pathnameToMatch) {\n return matchRoute(pathnameToMatch);\n },\n maxActionBodySize: __MAX_ACTION_BODY_SIZE,\n middlewareHeaders: middlewareContext.headers,\n middlewareStatus: middlewareContext.status,\n mountedSlotsHeader,\n readBodyWithLimit: __readBodyWithLimit,\n readFormDataWithLimit: __readFormDataWithLimit,\n renderToReadableStream,\n reportRequestError: _reportRequestError,\n request,\n sanitizeErrorForClient(error) {\n return __sanitizeErrorForClient(error);\n },\n searchParams,\n setHeadersAccessPhase,\n setNavigationContext,\n toInterceptOpts(intercept) {\n return {\n interceptionContext,\n interceptLayouts: intercept.interceptLayouts,\n interceptSlotId: intercept.slotId,\n interceptSlotKey: intercept.slotKey,\n interceptSourceMatchedUrl: interceptionContext,\n interceptPage: intercept.page,\n interceptParams: intercept.matchedParams,\n };\n },\n });\n },\n i18nConfig: __i18nConfig,\n isMiddlewareProxy: ${JSON.stringify(middlewarePath ? isProxyFile(middlewarePath) : false)},\n ${hasPagesDir ? `loadPrerenderPagesRoutes: __loadPrerenderPagesRoutes,` : \"\"}\n makeThenableParams,\n matchRoute,\n metadataRoutes,\n middlewareModule: ${middlewarePath ? \"middlewareModule\" : \"null\"},\n publicFiles: __publicFiles,\n renderNotFound({ isRscRequest, matchedParams, middlewareContext, request, route, scriptNonce }) {\n const __isEdge = route ? __isEdgeRuntime(__resolveAppPageSegmentConfig({ layouts: route.layouts, page: route.page }).runtime) : false;\n return __fallbackRenderer.renderNotFound(route, isRscRequest, request, matchedParams, scriptNonce, middlewareContext, { isEdgeRuntime: __isEdge });\n },\n ${\n hasPagesDir\n ? `async renderPagesFallback({ isRscRequest, middlewareContext, request, url }) {\n if (isRscRequest) return null;\n\n const __pagesEntry = await import.meta.viteRsc.loadModule(\"ssr\", \"index\");\n\n const __pagesRequestHeaders = middlewareContext.requestHeaders\n ? __buildRequestHeadersFromMiddlewareResponse(request.headers, middlewareContext.requestHeaders)\n : null;\n let __pagesRequest = request;\n if (__pagesRequestHeaders) {\n const __pagesRequestInit = {\n method: request.method,\n headers: __pagesRequestHeaders,\n };\n if (request.method !== \"GET\" && request.method !== \"HEAD\") {\n __pagesRequestInit.body = request.body;\n __pagesRequestInit.duplex = \"half\";\n }\n __pagesRequest = new Request(request.url, __pagesRequestInit);\n }\n\n const __pagesUrl = __decodePathParams(url.pathname) + (url.search || \"\");\n const __pagesPathname = url.pathname;\n if (__pagesPathname.startsWith(\"/api/\") || __pagesPathname === \"/api\") {\n if (typeof __pagesEntry.handleApiRoute !== \"function\") return null;\n const __pagesApiResponse = await __pagesEntry.handleApiRoute(__pagesRequest, __pagesUrl);\n return __applyRouteHandlerMiddlewareContext(__pagesApiResponse, middlewareContext);\n }\n\n if (typeof __pagesEntry.renderPage !== \"function\") return null;\n const __pagesRes = await __pagesEntry.renderPage(\n __pagesRequest,\n __pagesUrl,\n {},\n undefined,\n middlewareContext.requestHeaders,\n );\n return __pagesRes.status !== 404 ? __pagesRes : null;\n },`\n : \"\"\n }\n rootParamNamesByPattern: rootParamNamesMap,\n setNavigationContext,\n staticParamsMap: generateStaticParamsMap,\n trailingSlash: __trailingSlash,\n validateDevRequestOrigin: __validateDevRequestOrigin,\n});\n\nif (import.meta.hot) {\n import.meta.hot.accept();\n}\n`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAwBA,MAAM,sBAAsB;AAK5B,MAAM,+BAA+B,iBACnC,2CACA,OAAO,KAAK,IACb;AACD,MAAM,0BAA0B,iBAAiB,+BAA+B,OAAO,KAAK,IAAI;AAChG,MAAM,oBAAoB,iBAAiB,gCAAgC,OAAO,KAAK,IAAI;AAC3F,MAAM,8BAA8B,iBAClC,2CACA,OAAO,KAAK,IACb;AACD,MAAM,8BAA8B,iBAClC,2CACA,OAAO,KAAK,IACb;AACD,MAAM,+BAA+B,iBACnC,4CACA,OAAO,KAAK,IACb;AACD,MAAM,mBAAmB,iBAAiB,+BAA+B,OAAO,KAAK,IAAI;AACzF,MAAM,uBAAuB,iBAAiB,mCAAmC,OAAO,KAAK,IAAI;AACjG,MAAM,0BAA0B,iBAC9B,sCACA,OAAO,KAAK,IACb;AACD,MAAM,kBAAkB,iBAAiB,6BAA6B,OAAO,KAAK,IAAI;AACtF,MAAM,yBAAyB,iBAC7B,sCACA,OAAO,KAAK,IACb;AACD,MAAM,mBAAmB,iBAAiB,+BAA+B,OAAO,KAAK,IAAI;AACzF,MAAM,oBAAoB,iBAAiB,gCAAgC,OAAO,KAAK,IAAI;AAC3F,MAAM,sBAAsB,iBAAiB,kCAAkC,OAAO,KAAK,IAAI;AAC/F,MAAM,qBAAqB,iBAAiB,iCAAiC,OAAO,KAAK,IAAI;AAC7F,MAAM,uBAAuB,iBAAiB,mCAAmC,OAAO,KAAK,IAAI;AACjG,MAAM,0BAA0B,iBAC9B,uCACA,OAAO,KAAK,IACb;AACD,MAAM,qBAAqB,iBAAiB,iCAAiC,OAAO,KAAK,IAAI;AAC7F,MAAM,eAAe,iBAAiB,0BAA0B,OAAO,KAAK,IAAI;AAChF,MAAM,yBAAyB,iBAAiB,+BAA+B,OAAO,KAAK,IAAI;AAC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CAAC;IACrC,6BAA6B;;EAE/B,qBAAqB,KAAK,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2L9B,sBACI;;QAGA,GACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAyIoB,KAAK,UAAU,iBAAiB,YAAY,eAAe,GAAG,MAAM,CAAC;IACxF,cAAc,0DAA0D,GAAG;;;;sBAIzD,iBAAiB,qBAAqB,OAAO;;;;;;IAO/D,cACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAuCA,GACL"}
@@ -13,7 +13,27 @@ type AppRscManifestCode = {
13
13
  rootUnauthorizedVar: string | null;
14
14
  rootLayoutVars: string[];
15
15
  globalErrorVar: string | null;
16
- globalNotFoundVar: string | null;
16
+ /**
17
+ * Path expression for the `app/global-not-found.{tsx,ts,js,jsx}` module
18
+ * suitable for embedding in a generated `import()` call (already JSON-encoded
19
+ * with platform path separators normalized). `null` when the user did not
20
+ * define `global-not-found.tsx`.
21
+ *
22
+ * We intentionally do NOT register this module as a static `import * as`
23
+ * in the manifest. Statically importing it puts global-not-found.tsx in
24
+ * the same JS chunk as the root layout, which causes the CSS bundler to
25
+ * concatenate their stylesheets into a single CSS file. The CSS minifier
26
+ * (lightningcss) then drops overlapping declarations as dead code, so any
27
+ * rule in global-not-found's CSS that the layout's CSS also defines gets
28
+ * silently removed — breaking the cascade on route-miss 404s where only
29
+ * global-not-found is supposed to render.
30
+ *
31
+ * By emitting a dynamic `import()` instead, the bundler gives
32
+ * global-not-found.tsx its own chunk with its own CSS asset.
33
+ *
34
+ * @see Next.js test: test/e2e/app-dir/initial-css-order/initial-css-order.test.ts
35
+ */
36
+ globalNotFoundImportSpecifier: string | null;
17
37
  };
18
38
  type BuildAppRscManifestCodeOptions = {
19
39
  routes: AppRoute[];
@@ -1,5 +1,5 @@
1
- import { normalizePathSeparators } from "./runtime-entry-module.js";
2
- import { convertSegmentsToRouteParts } from "../routing/app-route-graph.js";
1
+ import { normalizePathSeparators } from "../utils/path.js";
2
+ import { computeAppRouteStaticSiblings, convertSegmentsToRouteParts } from "../routing/app-route-graph.js";
3
3
  import "../routing/app-router.js";
4
4
  import { createMetadataRouteEntriesSource } from "../server/metadata-route-build-data.js";
5
5
  //#region src/entries/app-rsc-manifest.ts
@@ -60,6 +60,7 @@ function registerRouteModules(routes, imports) {
60
60
  }
61
61
  function buildRouteEntries(routes, imports) {
62
62
  return routes.map((route, routeIdx) => {
63
+ const staticSiblings = route.isDynamic ? computeAppRouteStaticSiblings(routes, route) : [];
63
64
  const layoutVars = route.layouts.map((l) => imports.getImportVar(l));
64
65
  const templateVars = route.templates.map((t) => imports.getImportVar(t));
65
66
  const notFoundVars = (route.notFoundPaths ?? []).map((nf) => nf ? imports.getImportVar(nf) : "null");
@@ -101,6 +102,7 @@ ${interceptEntries.join(",\n")}
101
102
  patternParts: ${JSON.stringify(route.patternParts)},
102
103
  isDynamic: ${route.isDynamic},
103
104
  params: ${JSON.stringify(route.params)},
105
+ staticSiblings: ${JSON.stringify(staticSiblings)},
104
106
  rootParamNames: ${JSON.stringify(route.rootParamNames ?? [])},
105
107
  page: ${route.pagePath ? imports.getImportVar(route.pagePath) : "null"},
106
108
  routeHandler: ${route.routePath ? imports.getImportVar(route.routePath) : "null"},
@@ -188,7 +190,7 @@ function buildAppRscManifestCode(options) {
188
190
  const rootUnauthorizedVar = rootRoute?.unauthorizedPath ? imports.getImportVar(rootRoute.unauthorizedPath) : null;
189
191
  const rootLayoutVars = rootRoute ? rootRoute.layouts.map((l) => imports.getImportVar(l)) : [];
190
192
  const globalErrorVar = options.globalErrorPath ? imports.getImportVar(options.globalErrorPath) : null;
191
- const globalNotFoundVar = options.globalNotFoundPath ? imports.getImportVar(options.globalNotFoundPath) : null;
193
+ const globalNotFoundImportSpecifier = options.globalNotFoundPath ? JSON.stringify(normalizePathSeparators(options.globalNotFoundPath)) : null;
192
194
  const dynamicMetadataRoutes = metadataRoutes.filter((r) => r.isDynamic);
193
195
  for (const route of dynamicMetadataRoutes) imports.getImportVar(route.filePath);
194
196
  const namesByPattern = buildRootParamNamesByPattern(options.routes);
@@ -203,7 +205,7 @@ function buildAppRscManifestCode(options) {
203
205
  rootUnauthorizedVar,
204
206
  rootLayoutVars,
205
207
  globalErrorVar,
206
- globalNotFoundVar
208
+ globalNotFoundImportSpecifier
207
209
  };
208
210
  }
209
211
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"app-rsc-manifest.js","names":[],"sources":["../../src/entries/app-rsc-manifest.ts"],"sourcesContent":["import { convertSegmentsToRouteParts, type AppRoute } from \"../routing/app-router.js\";\nimport { createMetadataRouteEntriesSource } from \"../server/metadata-route-build-data.js\";\nimport type { MetadataFileRoute } from \"../server/metadata-routes.js\";\nimport { normalizePathSeparators } from \"./runtime-entry-module.js\";\n\ntype AppRscManifestCode = {\n imports: string[];\n routeEntries: string[];\n metaRouteEntries: string[];\n generateStaticParamsEntries: string[];\n rootParamNameEntries: string[];\n rootNotFoundVar: string | null;\n rootForbiddenVar: string | null;\n rootUnauthorizedVar: string | null;\n rootLayoutVars: string[];\n globalErrorVar: string | null;\n globalNotFoundVar: string | null;\n};\n\ntype BuildAppRscManifestCodeOptions = {\n routes: AppRoute[];\n metadataRoutes?: MetadataFileRoute[];\n globalErrorPath?: string | null;\n /**\n * Optional `app/global-not-found.tsx` path. When present, route-miss 404s\n * render this module standalone (it provides its own <html>/<body>) instead\n * of wrapping the regular not-found boundary inside the root layout.\n * Mirrors Next.js 16's `experimental.globalNotFound` behavior.\n * @see https://github.com/vercel/next.js/blob/canary/packages/next/src/server/app-render/app-render.tsx\n */\n globalNotFoundPath?: string | null;\n};\n\ntype ImportAllocator = {\n getImportVar(filePath: string): string;\n importMap: ReadonlyMap<string, string>;\n imports: string[];\n};\n\nfunction createImportAllocator(): ImportAllocator {\n const imports: string[] = [];\n const importMap = new Map<string, string>();\n let importIdx = 0;\n\n return {\n importMap,\n imports,\n getImportVar(filePath) {\n const existing = importMap.get(filePath);\n if (existing) return existing;\n\n const varName = `mod_${importIdx++}`;\n const absPath = normalizePathSeparators(filePath);\n imports.push(`import * as ${varName} from ${JSON.stringify(absPath)};`);\n importMap.set(filePath, varName);\n return varName;\n },\n };\n}\n\nfunction registerRouteModules(routes: AppRoute[], imports: ImportAllocator): void {\n for (const route of routes) {\n if (route.pagePath) imports.getImportVar(route.pagePath);\n if (route.routePath) imports.getImportVar(route.routePath);\n for (const layout of route.layouts) imports.getImportVar(layout);\n for (const tmpl of route.templates) imports.getImportVar(tmpl);\n if (route.loadingPath) imports.getImportVar(route.loadingPath);\n if (route.errorPath) imports.getImportVar(route.errorPath);\n if (route.layoutErrorPaths) {\n for (const ep of route.layoutErrorPaths) {\n if (ep) imports.getImportVar(ep);\n }\n }\n if (route.errorPaths) {\n for (const ep of route.errorPaths) {\n imports.getImportVar(ep);\n }\n }\n if (route.notFoundPath) imports.getImportVar(route.notFoundPath);\n if (route.notFoundPaths) {\n for (const nfp of route.notFoundPaths) {\n if (nfp) imports.getImportVar(nfp);\n }\n }\n if (route.forbiddenPath) imports.getImportVar(route.forbiddenPath);\n if (route.forbiddenPaths) {\n for (const fp of route.forbiddenPaths) {\n if (fp) imports.getImportVar(fp);\n }\n }\n if (route.unauthorizedPath) imports.getImportVar(route.unauthorizedPath);\n if (route.unauthorizedPaths) {\n for (const up of route.unauthorizedPaths) {\n if (up) imports.getImportVar(up);\n }\n }\n for (const slot of route.parallelSlots) {\n if (slot.pagePath) imports.getImportVar(slot.pagePath);\n if (slot.defaultPath) imports.getImportVar(slot.defaultPath);\n if (slot.layoutPath) imports.getImportVar(slot.layoutPath);\n if (slot.loadingPath) imports.getImportVar(slot.loadingPath);\n if (slot.errorPath) imports.getImportVar(slot.errorPath);\n for (const ir of slot.interceptingRoutes) {\n imports.getImportVar(ir.pagePath);\n for (const layoutPath of ir.layoutPaths) {\n imports.getImportVar(layoutPath);\n }\n }\n }\n }\n}\n\nfunction buildRouteEntries(routes: AppRoute[], imports: ImportAllocator): string[] {\n return routes.map((route, routeIdx) => {\n const layoutVars = route.layouts.map((l) => imports.getImportVar(l));\n const templateVars = route.templates.map((t) => imports.getImportVar(t));\n const notFoundVars = (route.notFoundPaths ?? []).map((nf) =>\n nf ? imports.getImportVar(nf) : \"null\",\n );\n const forbiddenVars = (route.forbiddenPaths ?? []).map((fp) =>\n fp ? imports.getImportVar(fp) : \"null\",\n );\n const unauthorizedVars = (route.unauthorizedPaths ?? []).map((up) =>\n up ? imports.getImportVar(up) : \"null\",\n );\n const slotEntries = route.parallelSlots.map((slot) => {\n const interceptEntries = slot.interceptingRoutes.map(\n (ir) => ` {\n convention: ${JSON.stringify(ir.convention)},\n targetPattern: ${JSON.stringify(ir.targetPattern)},\n sourceMatchPattern: ${JSON.stringify(ir.sourceMatchPattern)},\n interceptLayouts: [${ir.layoutPaths.map((layoutPath) => imports.getImportVar(layoutPath)).join(\", \")}],\n page: ${imports.getImportVar(ir.pagePath)},\n params: ${JSON.stringify(ir.params)},\n }`,\n );\n return ` ${JSON.stringify(slot.key)}: {\n id: ${JSON.stringify(slot.id ?? null)},\n name: ${JSON.stringify(slot.name)},\n page: ${slot.pagePath ? imports.getImportVar(slot.pagePath) : \"null\"},\n default: ${slot.defaultPath ? imports.getImportVar(slot.defaultPath) : \"null\"},\n layout: ${slot.layoutPath ? imports.getImportVar(slot.layoutPath) : \"null\"},\n loading: ${slot.loadingPath ? imports.getImportVar(slot.loadingPath) : \"null\"},\n error: ${slot.errorPath ? imports.getImportVar(slot.errorPath) : \"null\"},\n layoutIndex: ${slot.layoutIndex},\n routeSegments: ${JSON.stringify(slot.routeSegments)},\n slotPatternParts: ${slot.slotPatternParts ? JSON.stringify(slot.slotPatternParts) : \"null\"},\n slotParamNames: ${slot.slotParamNames ? JSON.stringify(slot.slotParamNames) : \"null\"},\n intercepts: [\n${interceptEntries.join(\",\\n\")}\n ],\n }`;\n });\n const layoutErrorVars = (route.layoutErrorPaths || []).map((ep) =>\n ep ? imports.getImportVar(ep) : \"null\",\n );\n const errorVars = (route.errorPaths ?? []).map((ep) => imports.getImportVar(ep));\n return ` {\n __buildTimeClassifications: __VINEXT_CLASS(${routeIdx}), // evaluated once at module load\n __buildTimeReasons: __classDebug ? __VINEXT_CLASS_REASONS(${routeIdx}) : null,\n ids: ${JSON.stringify(route.ids ?? null)},\n pattern: ${JSON.stringify(route.pattern)},\n patternParts: ${JSON.stringify(route.patternParts)},\n isDynamic: ${route.isDynamic},\n params: ${JSON.stringify(route.params)},\n rootParamNames: ${JSON.stringify(route.rootParamNames ?? [])},\n page: ${route.pagePath ? imports.getImportVar(route.pagePath) : \"null\"},\n routeHandler: ${route.routePath ? imports.getImportVar(route.routePath) : \"null\"},\n layouts: [${layoutVars.join(\", \")}],\n routeSegments: ${JSON.stringify(route.routeSegments)},\n templateTreePositions: ${JSON.stringify(route.templateTreePositions)},\n layoutTreePositions: ${JSON.stringify(route.layoutTreePositions)},\n templates: [${templateVars.join(\", \")}],\n errors: [${layoutErrorVars.join(\", \")}],\n errorPaths: [${errorVars.join(\", \")}],\n errorTreePositions: ${JSON.stringify(route.errorTreePositions ?? null)},\n slots: {\n${slotEntries.join(\",\\n\")}\n },\n loading: ${route.loadingPath ? imports.getImportVar(route.loadingPath) : \"null\"},\n error: ${route.errorPath ? imports.getImportVar(route.errorPath) : \"null\"},\n notFound: ${route.notFoundPath ? imports.getImportVar(route.notFoundPath) : \"null\"},\n notFounds: [${notFoundVars.join(\", \")}],\n forbidden: ${route.forbiddenPath ? imports.getImportVar(route.forbiddenPath) : \"null\"},\n forbiddens: [${forbiddenVars.join(\", \")}],\n unauthorized: ${route.unauthorizedPath ? imports.getImportVar(route.unauthorizedPath) : \"null\"},\n unauthorizeds: [${unauthorizedVars.join(\", \")}],\n }`;\n });\n}\n\ntype RoutePatternPrefix = {\n pattern: string;\n paramNames: string[];\n};\n\nfunction createRoutePatternPrefix(\n routeSegments: readonly string[],\n treePosition: number,\n): RoutePatternPrefix | null {\n // treePosition is always non-negative (represents tree depth).\n const limit = Math.min(treePosition, routeSegments.length);\n const converted = convertSegmentsToRouteParts(routeSegments.slice(0, limit));\n if (!converted) return null;\n\n return {\n pattern: converted.urlSegments.length === 0 ? \"/\" : `/${converted.urlSegments.join(\"/\")}`,\n paramNames: converted.params,\n };\n}\n\nfunction appendStaticParamSource(\n sourcesByPattern: Map<string, string[]>,\n pattern: string | null,\n sourceVar: string,\n): void {\n if (!pattern || pattern === \"/\" || !pattern.includes(\":\")) return;\n const sources = sourcesByPattern.get(pattern) ?? [];\n // ImportAllocator is path-stable, so the generated member expression is a\n // deterministic key for deduping the same module across inherited routes.\n if (!sources.includes(sourceVar)) sources.push(sourceVar);\n sourcesByPattern.set(pattern, sources);\n}\n\nfunction buildRootParamNamesByPattern(routes: AppRoute[]): Map<string, string[]> {\n const namesByPattern = new Map<string, string[]>();\n\n function append(\n pattern: string | null,\n rootParamNames: readonly string[] | undefined,\n paramNames: readonly string[],\n ): void {\n if (!pattern || pattern === \"/\" || !pattern.includes(\":\")) return;\n const patternParams = new Set(paramNames);\n const names = (rootParamNames ?? []).filter((name) => patternParams.has(name));\n if (names.length === 0) return;\n\n const existing = namesByPattern.get(pattern) ?? [];\n for (const name of names) {\n if (!existing.includes(name)) existing.push(name);\n }\n namesByPattern.set(pattern, existing);\n }\n\n for (const route of routes) {\n if (!route.isDynamic) continue;\n append(route.pattern, route.rootParamNames, route.params);\n for (const treePosition of route.layoutTreePositions) {\n const prefix = createRoutePatternPrefix(route.routeSegments, treePosition);\n append(prefix?.pattern ?? null, route.rootParamNames, prefix?.paramNames ?? []);\n }\n }\n\n return namesByPattern;\n}\n\nfunction buildGenerateStaticParamsEntries(\n routes: AppRoute[],\n imports: ImportAllocator,\n namesByPattern: Map<string, string[]>,\n): string[] {\n const sourcesByPattern = new Map<string, string[]>();\n\n for (const route of routes) {\n if (!route.isDynamic) continue;\n\n for (const [index, layoutPath] of route.layouts.entries()) {\n appendStaticParamSource(\n sourcesByPattern,\n createRoutePatternPrefix(route.routeSegments, route.layoutTreePositions[index] ?? 0)\n ?.pattern ?? null,\n `${imports.getImportVar(layoutPath)}?.generateStaticParams`,\n );\n }\n\n if (route.pagePath) {\n appendStaticParamSource(\n sourcesByPattern,\n route.pattern,\n `${imports.getImportVar(route.pagePath)}?.generateStaticParams`,\n );\n }\n }\n\n return Array.from(sourcesByPattern.entries()).map(([pattern, sources]) => {\n const rootParamNames = namesByPattern.get(pattern) ?? [];\n return ` ${JSON.stringify(pattern)}: __createAppPrerenderStaticParamsResolver([${sources.join(\n \", \",\n )}], ${JSON.stringify(rootParamNames)}),`;\n });\n}\n\nfunction buildRootParamNameEntries(namesByPattern: Map<string, string[]>): string[] {\n return Array.from(namesByPattern.entries()).map(\n ([pattern, names]) => ` ${JSON.stringify(pattern)}: ${JSON.stringify(names)},`,\n );\n}\n\nexport function buildAppRscManifestCode(\n options: BuildAppRscManifestCodeOptions,\n): AppRscManifestCode {\n const imports = createImportAllocator();\n const metadataRoutes = options.metadataRoutes ?? [];\n\n registerRouteModules(options.routes, imports);\n const routeEntries = buildRouteEntries(options.routes, imports);\n\n const rootRoute = options.routes.find((r) => r.pattern === \"/\");\n const rootNotFoundVar = rootRoute?.notFoundPath\n ? imports.getImportVar(rootRoute.notFoundPath)\n : null;\n const rootForbiddenVar = rootRoute?.forbiddenPath\n ? imports.getImportVar(rootRoute.forbiddenPath)\n : null;\n const rootUnauthorizedVar = rootRoute?.unauthorizedPath\n ? imports.getImportVar(rootRoute.unauthorizedPath)\n : null;\n const rootLayoutVars = rootRoute ? rootRoute.layouts.map((l) => imports.getImportVar(l)) : [];\n const globalErrorVar = options.globalErrorPath\n ? imports.getImportVar(options.globalErrorPath)\n : null;\n const globalNotFoundVar = options.globalNotFoundPath\n ? imports.getImportVar(options.globalNotFoundPath)\n : null;\n\n const dynamicMetadataRoutes = metadataRoutes.filter((r) => r.isDynamic);\n for (const route of dynamicMetadataRoutes) {\n imports.getImportVar(route.filePath);\n }\n\n const namesByPattern = buildRootParamNamesByPattern(options.routes);\n\n return {\n imports: imports.imports,\n routeEntries,\n metaRouteEntries: createMetadataRouteEntriesSource(metadataRoutes, imports.importMap),\n generateStaticParamsEntries: buildGenerateStaticParamsEntries(\n options.routes,\n imports,\n namesByPattern,\n ),\n rootParamNameEntries: buildRootParamNameEntries(namesByPattern),\n rootNotFoundVar,\n rootForbiddenVar,\n rootUnauthorizedVar,\n rootLayoutVars,\n globalErrorVar,\n globalNotFoundVar,\n };\n}\n"],"mappings":";;;;;AAuCA,SAAS,wBAAyC;CAChD,MAAM,UAAoB,EAAE;CAC5B,MAAM,4BAAY,IAAI,KAAqB;CAC3C,IAAI,YAAY;CAEhB,OAAO;EACL;EACA;EACA,aAAa,UAAU;GACrB,MAAM,WAAW,UAAU,IAAI,SAAS;GACxC,IAAI,UAAU,OAAO;GAErB,MAAM,UAAU,OAAO;GACvB,MAAM,UAAU,wBAAwB,SAAS;GACjD,QAAQ,KAAK,eAAe,QAAQ,QAAQ,KAAK,UAAU,QAAQ,CAAC,GAAG;GACvE,UAAU,IAAI,UAAU,QAAQ;GAChC,OAAO;;EAEV;;AAGH,SAAS,qBAAqB,QAAoB,SAAgC;CAChF,KAAK,MAAM,SAAS,QAAQ;EAC1B,IAAI,MAAM,UAAU,QAAQ,aAAa,MAAM,SAAS;EACxD,IAAI,MAAM,WAAW,QAAQ,aAAa,MAAM,UAAU;EAC1D,KAAK,MAAM,UAAU,MAAM,SAAS,QAAQ,aAAa,OAAO;EAChE,KAAK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AQ,QAAQ;CAE/D,MAAM,YAAY,QAAQ,OAAO,MAAM,MAAM,EAAE,YAAY,IAAI;CAC/D,MAAM,kBAAkB,WAAW,eAC/B,QAAQ,aAAa,UAAU,aAAa,GAC5C;CACJ,MAAM,mBAAmB,WAAW,gBAChC,QAAQ,aAAa,UAAU,cAAc,GAC7C;CACJ,MAAM,sBAAsB,WAAW,mBACnC,QAAQ,aAAa,UAAU,iBAAiB,GAChD;CACJ,MAAM,iBAAiB,YAAY,UAAU,QAAQ,KAAK,MAAM,QAAQ,aAAa,EAAE,CAAC,GAAG,EAAE;CAC7F,MAAM,iBAAiB,QAAQ,kBAC3B,QAAQ,aAAa,QAAQ,gBAAgB,GAC7C;CACJ,MAAM,oBAAoB,QAAQ,qBAC9B,QAAQ,aAAa,QAAQ,mBAAmB,GAChD;CAEJ,MAAM,wBAAwB,eAAe,QAAQ,MAAM,EAAE,UAAU;CACvE,KAAK,MAAM,SAAS,uBAClB,QAAQ,aAAa,MAAM,SAAS;CAGtC,MAAM,iBAAiB,6BAA6B,QAAQ,OAAO;CAEnE,OAAO;EACL,SAAS,QAAQ;EACjB;EACA,kBAAkB,iCAAiC,gBAAgB,QAAQ,UAAU;EACrF,6BAA6B,iCAC3B,QAAQ,QACR,SACA,eACD;EACD,sBAAsB,0BAA0B,eAAe;EAC/D;EACA;EACA;EACA;EACA;EACA;EACD"}
1
+ {"version":3,"file":"app-rsc-manifest.js","names":[],"sources":["../../src/entries/app-rsc-manifest.ts"],"sourcesContent":["import {\n computeAppRouteStaticSiblings,\n convertSegmentsToRouteParts,\n type AppRoute,\n} from \"../routing/app-router.js\";\nimport { createMetadataRouteEntriesSource } from \"../server/metadata-route-build-data.js\";\nimport type { MetadataFileRoute } from \"../server/metadata-routes.js\";\nimport { normalizePathSeparators } from \"../utils/path.js\";\n\ntype AppRscManifestCode = {\n imports: string[];\n routeEntries: string[];\n metaRouteEntries: string[];\n generateStaticParamsEntries: string[];\n rootParamNameEntries: string[];\n rootNotFoundVar: string | null;\n rootForbiddenVar: string | null;\n rootUnauthorizedVar: string | null;\n rootLayoutVars: string[];\n globalErrorVar: string | null;\n /**\n * Path expression for the `app/global-not-found.{tsx,ts,js,jsx}` module\n * suitable for embedding in a generated `import()` call (already JSON-encoded\n * with platform path separators normalized). `null` when the user did not\n * define `global-not-found.tsx`.\n *\n * We intentionally do NOT register this module as a static `import * as`\n * in the manifest. Statically importing it puts global-not-found.tsx in\n * the same JS chunk as the root layout, which causes the CSS bundler to\n * concatenate their stylesheets into a single CSS file. The CSS minifier\n * (lightningcss) then drops overlapping declarations as dead code, so any\n * rule in global-not-found's CSS that the layout's CSS also defines gets\n * silently removed — breaking the cascade on route-miss 404s where only\n * global-not-found is supposed to render.\n *\n * By emitting a dynamic `import()` instead, the bundler gives\n * global-not-found.tsx its own chunk with its own CSS asset.\n *\n * @see Next.js test: test/e2e/app-dir/initial-css-order/initial-css-order.test.ts\n */\n globalNotFoundImportSpecifier: string | null;\n};\n\ntype BuildAppRscManifestCodeOptions = {\n routes: AppRoute[];\n metadataRoutes?: MetadataFileRoute[];\n globalErrorPath?: string | null;\n /**\n * Optional `app/global-not-found.tsx` path. When present, route-miss 404s\n * render this module standalone (it provides its own <html>/<body>) instead\n * of wrapping the regular not-found boundary inside the root layout.\n * Mirrors Next.js 16's `experimental.globalNotFound` behavior.\n * @see https://github.com/vercel/next.js/blob/canary/packages/next/src/server/app-render/app-render.tsx\n */\n globalNotFoundPath?: string | null;\n};\n\ntype ImportAllocator = {\n getImportVar(filePath: string): string;\n importMap: ReadonlyMap<string, string>;\n imports: string[];\n};\n\nfunction createImportAllocator(): ImportAllocator {\n const imports: string[] = [];\n const importMap = new Map<string, string>();\n let importIdx = 0;\n\n return {\n importMap,\n imports,\n getImportVar(filePath) {\n const existing = importMap.get(filePath);\n if (existing) return existing;\n\n const varName = `mod_${importIdx++}`;\n const absPath = normalizePathSeparators(filePath);\n imports.push(`import * as ${varName} from ${JSON.stringify(absPath)};`);\n importMap.set(filePath, varName);\n return varName;\n },\n };\n}\n\nfunction registerRouteModules(routes: AppRoute[], imports: ImportAllocator): void {\n for (const route of routes) {\n if (route.pagePath) imports.getImportVar(route.pagePath);\n if (route.routePath) imports.getImportVar(route.routePath);\n for (const layout of route.layouts) imports.getImportVar(layout);\n for (const tmpl of route.templates) imports.getImportVar(tmpl);\n if (route.loadingPath) imports.getImportVar(route.loadingPath);\n if (route.errorPath) imports.getImportVar(route.errorPath);\n if (route.layoutErrorPaths) {\n for (const ep of route.layoutErrorPaths) {\n if (ep) imports.getImportVar(ep);\n }\n }\n if (route.errorPaths) {\n for (const ep of route.errorPaths) {\n imports.getImportVar(ep);\n }\n }\n if (route.notFoundPath) imports.getImportVar(route.notFoundPath);\n if (route.notFoundPaths) {\n for (const nfp of route.notFoundPaths) {\n if (nfp) imports.getImportVar(nfp);\n }\n }\n if (route.forbiddenPath) imports.getImportVar(route.forbiddenPath);\n if (route.forbiddenPaths) {\n for (const fp of route.forbiddenPaths) {\n if (fp) imports.getImportVar(fp);\n }\n }\n if (route.unauthorizedPath) imports.getImportVar(route.unauthorizedPath);\n if (route.unauthorizedPaths) {\n for (const up of route.unauthorizedPaths) {\n if (up) imports.getImportVar(up);\n }\n }\n for (const slot of route.parallelSlots) {\n if (slot.pagePath) imports.getImportVar(slot.pagePath);\n if (slot.defaultPath) imports.getImportVar(slot.defaultPath);\n if (slot.layoutPath) imports.getImportVar(slot.layoutPath);\n if (slot.loadingPath) imports.getImportVar(slot.loadingPath);\n if (slot.errorPath) imports.getImportVar(slot.errorPath);\n for (const ir of slot.interceptingRoutes) {\n imports.getImportVar(ir.pagePath);\n for (const layoutPath of ir.layoutPaths) {\n imports.getImportVar(layoutPath);\n }\n }\n }\n }\n}\n\nfunction buildRouteEntries(routes: AppRoute[], imports: ImportAllocator): string[] {\n return routes.map((route, routeIdx) => {\n // Pre-compute static-sibling segment names for the matched route's\n // dynamic URL levels. The client router uses this to decide if a cached\n // dynamic-route prefetch can be reused when navigating to a static\n // sibling URL (issue cloudflare/vinext#1525). Emitted only when there are\n // siblings so static routes get an empty literal and stay lean.\n const staticSiblings = route.isDynamic ? computeAppRouteStaticSiblings(routes, route) : [];\n const layoutVars = route.layouts.map((l) => imports.getImportVar(l));\n const templateVars = route.templates.map((t) => imports.getImportVar(t));\n const notFoundVars = (route.notFoundPaths ?? []).map((nf) =>\n nf ? imports.getImportVar(nf) : \"null\",\n );\n const forbiddenVars = (route.forbiddenPaths ?? []).map((fp) =>\n fp ? imports.getImportVar(fp) : \"null\",\n );\n const unauthorizedVars = (route.unauthorizedPaths ?? []).map((up) =>\n up ? imports.getImportVar(up) : \"null\",\n );\n const slotEntries = route.parallelSlots.map((slot) => {\n const interceptEntries = slot.interceptingRoutes.map(\n (ir) => ` {\n convention: ${JSON.stringify(ir.convention)},\n targetPattern: ${JSON.stringify(ir.targetPattern)},\n sourceMatchPattern: ${JSON.stringify(ir.sourceMatchPattern)},\n interceptLayouts: [${ir.layoutPaths.map((layoutPath) => imports.getImportVar(layoutPath)).join(\", \")}],\n page: ${imports.getImportVar(ir.pagePath)},\n params: ${JSON.stringify(ir.params)},\n }`,\n );\n return ` ${JSON.stringify(slot.key)}: {\n id: ${JSON.stringify(slot.id ?? null)},\n name: ${JSON.stringify(slot.name)},\n page: ${slot.pagePath ? imports.getImportVar(slot.pagePath) : \"null\"},\n default: ${slot.defaultPath ? imports.getImportVar(slot.defaultPath) : \"null\"},\n layout: ${slot.layoutPath ? imports.getImportVar(slot.layoutPath) : \"null\"},\n loading: ${slot.loadingPath ? imports.getImportVar(slot.loadingPath) : \"null\"},\n error: ${slot.errorPath ? imports.getImportVar(slot.errorPath) : \"null\"},\n layoutIndex: ${slot.layoutIndex},\n routeSegments: ${JSON.stringify(slot.routeSegments)},\n slotPatternParts: ${slot.slotPatternParts ? JSON.stringify(slot.slotPatternParts) : \"null\"},\n slotParamNames: ${slot.slotParamNames ? JSON.stringify(slot.slotParamNames) : \"null\"},\n intercepts: [\n${interceptEntries.join(\",\\n\")}\n ],\n }`;\n });\n const layoutErrorVars = (route.layoutErrorPaths || []).map((ep) =>\n ep ? imports.getImportVar(ep) : \"null\",\n );\n const errorVars = (route.errorPaths ?? []).map((ep) => imports.getImportVar(ep));\n return ` {\n __buildTimeClassifications: __VINEXT_CLASS(${routeIdx}), // evaluated once at module load\n __buildTimeReasons: __classDebug ? __VINEXT_CLASS_REASONS(${routeIdx}) : null,\n ids: ${JSON.stringify(route.ids ?? null)},\n pattern: ${JSON.stringify(route.pattern)},\n patternParts: ${JSON.stringify(route.patternParts)},\n isDynamic: ${route.isDynamic},\n params: ${JSON.stringify(route.params)},\n staticSiblings: ${JSON.stringify(staticSiblings)},\n rootParamNames: ${JSON.stringify(route.rootParamNames ?? [])},\n page: ${route.pagePath ? imports.getImportVar(route.pagePath) : \"null\"},\n routeHandler: ${route.routePath ? imports.getImportVar(route.routePath) : \"null\"},\n layouts: [${layoutVars.join(\", \")}],\n routeSegments: ${JSON.stringify(route.routeSegments)},\n templateTreePositions: ${JSON.stringify(route.templateTreePositions)},\n layoutTreePositions: ${JSON.stringify(route.layoutTreePositions)},\n templates: [${templateVars.join(\", \")}],\n errors: [${layoutErrorVars.join(\", \")}],\n errorPaths: [${errorVars.join(\", \")}],\n errorTreePositions: ${JSON.stringify(route.errorTreePositions ?? null)},\n slots: {\n${slotEntries.join(\",\\n\")}\n },\n loading: ${route.loadingPath ? imports.getImportVar(route.loadingPath) : \"null\"},\n error: ${route.errorPath ? imports.getImportVar(route.errorPath) : \"null\"},\n notFound: ${route.notFoundPath ? imports.getImportVar(route.notFoundPath) : \"null\"},\n notFounds: [${notFoundVars.join(\", \")}],\n forbidden: ${route.forbiddenPath ? imports.getImportVar(route.forbiddenPath) : \"null\"},\n forbiddens: [${forbiddenVars.join(\", \")}],\n unauthorized: ${route.unauthorizedPath ? imports.getImportVar(route.unauthorizedPath) : \"null\"},\n unauthorizeds: [${unauthorizedVars.join(\", \")}],\n }`;\n });\n}\n\ntype RoutePatternPrefix = {\n pattern: string;\n paramNames: string[];\n};\n\nfunction createRoutePatternPrefix(\n routeSegments: readonly string[],\n treePosition: number,\n): RoutePatternPrefix | null {\n // treePosition is always non-negative (represents tree depth).\n const limit = Math.min(treePosition, routeSegments.length);\n const converted = convertSegmentsToRouteParts(routeSegments.slice(0, limit));\n if (!converted) return null;\n\n return {\n pattern: converted.urlSegments.length === 0 ? \"/\" : `/${converted.urlSegments.join(\"/\")}`,\n paramNames: converted.params,\n };\n}\n\nfunction appendStaticParamSource(\n sourcesByPattern: Map<string, string[]>,\n pattern: string | null,\n sourceVar: string,\n): void {\n if (!pattern || pattern === \"/\" || !pattern.includes(\":\")) return;\n const sources = sourcesByPattern.get(pattern) ?? [];\n // ImportAllocator is path-stable, so the generated member expression is a\n // deterministic key for deduping the same module across inherited routes.\n if (!sources.includes(sourceVar)) sources.push(sourceVar);\n sourcesByPattern.set(pattern, sources);\n}\n\nfunction buildRootParamNamesByPattern(routes: AppRoute[]): Map<string, string[]> {\n const namesByPattern = new Map<string, string[]>();\n\n function append(\n pattern: string | null,\n rootParamNames: readonly string[] | undefined,\n paramNames: readonly string[],\n ): void {\n if (!pattern || pattern === \"/\" || !pattern.includes(\":\")) return;\n const patternParams = new Set(paramNames);\n const names = (rootParamNames ?? []).filter((name) => patternParams.has(name));\n if (names.length === 0) return;\n\n const existing = namesByPattern.get(pattern) ?? [];\n for (const name of names) {\n if (!existing.includes(name)) existing.push(name);\n }\n namesByPattern.set(pattern, existing);\n }\n\n for (const route of routes) {\n if (!route.isDynamic) continue;\n append(route.pattern, route.rootParamNames, route.params);\n for (const treePosition of route.layoutTreePositions) {\n const prefix = createRoutePatternPrefix(route.routeSegments, treePosition);\n append(prefix?.pattern ?? null, route.rootParamNames, prefix?.paramNames ?? []);\n }\n }\n\n return namesByPattern;\n}\n\nfunction buildGenerateStaticParamsEntries(\n routes: AppRoute[],\n imports: ImportAllocator,\n namesByPattern: Map<string, string[]>,\n): string[] {\n const sourcesByPattern = new Map<string, string[]>();\n\n for (const route of routes) {\n if (!route.isDynamic) continue;\n\n for (const [index, layoutPath] of route.layouts.entries()) {\n appendStaticParamSource(\n sourcesByPattern,\n createRoutePatternPrefix(route.routeSegments, route.layoutTreePositions[index] ?? 0)\n ?.pattern ?? null,\n `${imports.getImportVar(layoutPath)}?.generateStaticParams`,\n );\n }\n\n if (route.pagePath) {\n appendStaticParamSource(\n sourcesByPattern,\n route.pattern,\n `${imports.getImportVar(route.pagePath)}?.generateStaticParams`,\n );\n }\n }\n\n return Array.from(sourcesByPattern.entries()).map(([pattern, sources]) => {\n const rootParamNames = namesByPattern.get(pattern) ?? [];\n return ` ${JSON.stringify(pattern)}: __createAppPrerenderStaticParamsResolver([${sources.join(\n \", \",\n )}], ${JSON.stringify(rootParamNames)}),`;\n });\n}\n\nfunction buildRootParamNameEntries(namesByPattern: Map<string, string[]>): string[] {\n return Array.from(namesByPattern.entries()).map(\n ([pattern, names]) => ` ${JSON.stringify(pattern)}: ${JSON.stringify(names)},`,\n );\n}\n\nexport function buildAppRscManifestCode(\n options: BuildAppRscManifestCodeOptions,\n): AppRscManifestCode {\n const imports = createImportAllocator();\n const metadataRoutes = options.metadataRoutes ?? [];\n\n registerRouteModules(options.routes, imports);\n const routeEntries = buildRouteEntries(options.routes, imports);\n\n const rootRoute = options.routes.find((r) => r.pattern === \"/\");\n const rootNotFoundVar = rootRoute?.notFoundPath\n ? imports.getImportVar(rootRoute.notFoundPath)\n : null;\n const rootForbiddenVar = rootRoute?.forbiddenPath\n ? imports.getImportVar(rootRoute.forbiddenPath)\n : null;\n const rootUnauthorizedVar = rootRoute?.unauthorizedPath\n ? imports.getImportVar(rootRoute.unauthorizedPath)\n : null;\n const rootLayoutVars = rootRoute ? rootRoute.layouts.map((l) => imports.getImportVar(l)) : [];\n const globalErrorVar = options.globalErrorPath\n ? imports.getImportVar(options.globalErrorPath)\n : null;\n // Intentionally NOT registered as a static `import * as` — see the docstring\n // on `AppRscManifestCode.globalNotFoundImportSpecifier` for the chunk/CSS\n // isolation rationale. We emit a dynamic `import()` from the entry instead.\n const globalNotFoundImportSpecifier = options.globalNotFoundPath\n ? JSON.stringify(normalizePathSeparators(options.globalNotFoundPath))\n : null;\n\n const dynamicMetadataRoutes = metadataRoutes.filter((r) => r.isDynamic);\n for (const route of dynamicMetadataRoutes) {\n imports.getImportVar(route.filePath);\n }\n\n const namesByPattern = buildRootParamNamesByPattern(options.routes);\n\n return {\n imports: imports.imports,\n routeEntries,\n metaRouteEntries: createMetadataRouteEntriesSource(metadataRoutes, imports.importMap),\n generateStaticParamsEntries: buildGenerateStaticParamsEntries(\n options.routes,\n imports,\n namesByPattern,\n ),\n rootParamNameEntries: buildRootParamNameEntries(namesByPattern),\n rootNotFoundVar,\n rootForbiddenVar,\n rootUnauthorizedVar,\n rootLayoutVars,\n globalErrorVar,\n globalNotFoundImportSpecifier,\n };\n}\n"],"mappings":";;;;;AA+DA,SAAS,wBAAyC;CAChD,MAAM,UAAoB,EAAE;CAC5B,MAAM,4BAAY,IAAI,KAAqB;CAC3C,IAAI,YAAY;CAEhB,OAAO;EACL;EACA;EACA,aAAa,UAAU;GACrB,MAAM,WAAW,UAAU,IAAI,SAAS;GACxC,IAAI,UAAU,OAAO;GAErB,MAAM,UAAU,OAAO;GACvB,MAAM,UAAU,wBAAwB,SAAS;GACjD,QAAQ,KAAK,eAAe,QAAQ,QAAQ,KAAK,UAAU,QAAQ,CAAC,GAAG;GACvE,UAAU,IAAI,UAAU,QAAQ;GAChC,OAAO;;EAEV;;AAGH,SAAS,qBAAqB,QAAoB,SAAgC;CAChF,KAAK,MAAM,SAAS,QAAQ;EAC1B,IAAI,MAAM,UAAU,QAAQ,aAAa,MAAM,SAAS;EACxD,IAAI,MAAM,WAAW,QAAQ,aAAa,MAAM,UAAU;EAC1D,KAAK,MAAM,UAAU,MAAM,SAAS,QAAQ,aAAa,OAAO;EAChE,KAAK,MAAM,QAAQ,MAAM,WAAW,QAAQ,aAAa,KAAK;EAC9D,IAAI,MAAM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CAC7C,MAAM,eAAe,kBAAkB,QAAQ,QAAQ,QAAQ;CAE/D,MAAM,YAAY,QAAQ,OAAO,MAAM,MAAM,EAAE,YAAY,IAAI;CAC/D,MAAM,kBAAkB,WAAW,eAC/B,QAAQ,aAAa,UAAU,aAAa,GAC5C;CACJ,MAAM,mBAAmB,WAAW,gBAChC,QAAQ,aAAa,UAAU,cAAc,GAC7C;CACJ,MAAM,sBAAsB,WAAW,mBACnC,QAAQ,aAAa,UAAU,iBAAiB,GAChD;CACJ,MAAM,iBAAiB,YAAY,UAAU,QAAQ,KAAK,MAAM,QAAQ,aAAa,EAAE,CAAC,GAAG,EAAE;CAC7F,MAAM,iBAAiB,QAAQ,kBAC3B,QAAQ,aAAa,QAAQ,gBAAgB,GAC7C;CAIJ,MAAM,gCAAgC,QAAQ,qBAC1C,KAAK,UAAU,wBAAwB,QAAQ,mBAAmB,CAAC,GACnE;CAEJ,MAAM,wBAAwB,eAAe,QAAQ,MAAM,EAAE,UAAU;CACvE,KAAK,MAAM,SAAS,uBAClB,QAAQ,aAAa,MAAM,SAAS;CAGtC,MAAM,iBAAiB,6BAA6B,QAAQ,OAAO;CAEnE,OAAO;EACL,SAAS,QAAQ;EACjB;EACA,kBAAkB,iCAAiC,gBAAgB,QAAQ,UAAU;EACrF,6BAA6B,iCAC3B,QAAQ,QACR,SACA,eACD;EACD,sBAAsB,0BAA0B,eAAe;EAC/D;EACA;EACA;EACA;EACA;EACA;EACD"}
@@ -1,8 +1,11 @@
1
1
  import { createValidFileMatcher } from "../routing/file-matcher.js";
2
2
  import { ResolvedNextConfig } from "../config/next-config.js";
3
+ import { VinextLinkPrefetchRoute } from "../client/vinext-next-data.js";
3
4
 
4
5
  //#region src/entries/pages-client-entry.d.ts
5
- declare function generateClientEntry(pagesDir: string, nextConfig: ResolvedNextConfig, fileMatcher: ReturnType<typeof createValidFileMatcher>): Promise<string>;
6
+ declare function generateClientEntry(pagesDir: string, nextConfig: ResolvedNextConfig, fileMatcher: ReturnType<typeof createValidFileMatcher>, options?: {
7
+ appPrefetchRoutes?: readonly VinextLinkPrefetchRoute[];
8
+ }): Promise<string>;
6
9
  //#endregion
7
10
  export { generateClientEntry };
8
11
  //# sourceMappingURL=pages-client-entry.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { patternToNextFormat } from "../routing/route-validation.js";
2
2
  import { pagesRouter } from "../routing/pages-router.js";
3
- import { normalizePathSeparators } from "./runtime-entry-module.js";
3
+ import { normalizePathSeparators } from "../utils/path.js";
4
4
  import { findFileWithExts } from "./pages-entry-helpers.js";
5
5
  //#region src/entries/pages-client-entry.ts
6
6
  /**
@@ -14,10 +14,11 @@ import { findFileWithExts } from "./pages-entry-helpers.js";
14
14
  *
15
15
  * Extracted from index.ts.
16
16
  */
17
- async function generateClientEntry(pagesDir, nextConfig, fileMatcher) {
17
+ async function generateClientEntry(pagesDir, nextConfig, fileMatcher, options = {}) {
18
18
  const pageRoutes = await pagesRouter(pagesDir, nextConfig?.pageExtensions, fileMatcher);
19
19
  const appFilePath = findFileWithExts(pagesDir, "_app", fileMatcher);
20
20
  const hasApp = appFilePath !== null;
21
+ const appPrefetchRoutes = options.appPrefetchRoutes ?? [];
21
22
  const loaderEntries = pageRoutes.map((r) => {
22
23
  const absPath = normalizePathSeparators(r.filePath);
23
24
  const nextFormatPattern = patternToNextFormat(r.pattern);
@@ -67,6 +68,21 @@ const appLoader = undefined;
67
68
  window.__VINEXT_PAGE_LOADERS__ = pageLoaders;
68
69
  window.__VINEXT_PAGE_PATTERNS__ = Object.keys(pageLoaders);
69
70
  window.__VINEXT_APP_LOADER__ = appLoader;
71
+ // Expose the App Router prefetch manifest so Pages Router \`<Link>\`s and
72
+ // \`Router.prefetch\` can detect when a prefetch target is actually an App
73
+ // Router route, and mark it on \`Router.components[urlPathname]\` with
74
+ // \`{ __appRouter: true }\`. Mirrors Next.js's \`_bfl\`-driven marker write at
75
+ // .nextjs-ref/packages/next/src/shared/lib/router/router.ts:2525, which the
76
+ // Next.js deploy test
77
+ // test/e2e/app-dir/app/index.test.ts → "should successfully detect app
78
+ // route during prefetch"
79
+ // asserts via \`window.next.router.components[<path>]\`. Issue #1526.
80
+ //
81
+ // In a hybrid Pages + App Router build, this entry runs when the user lands
82
+ // on a Pages Router page. The App Router browser entry sets the same global
83
+ // when the user lands on an App Router page (see app-browser-entry.ts) — the
84
+ // two writes do not race because only one entry executes per page load.
85
+ window.__VINEXT_LINK_PREFETCH_ROUTES__ = ${JSON.stringify(appPrefetchRoutes)};
70
86
 
71
87
  async function hydrate() {
72
88
  const nextData = window.__NEXT_DATA__;
@@ -1 +1 @@
1
- {"version":3,"file":"pages-client-entry.js","names":["pagesPatternToNextFormat"],"sources":["../../src/entries/pages-client-entry.ts"],"sourcesContent":["/**\n * Pages Router client hydration entry generator.\n *\n * Generates the virtual client entry module (`virtual:vinext-client-entry`).\n * This is the entry point for `vite build` (client bundle). It maps route\n * patterns to dynamic imports of page modules so Vite code-splits each page\n * into its own chunk. At runtime it reads __NEXT_DATA__ to determine which\n * page to hydrate.\n *\n * Extracted from index.ts.\n */\nimport {\n pagesRouter,\n patternToNextFormat as pagesPatternToNextFormat,\n type Route,\n} from \"../routing/pages-router.js\";\nimport { createValidFileMatcher } from \"../routing/file-matcher.js\";\nimport { type ResolvedNextConfig } from \"../config/next-config.js\";\nimport { findFileWithExts } from \"./pages-entry-helpers.js\";\nimport { normalizePathSeparators } from \"./runtime-entry-module.js\";\n\nexport async function generateClientEntry(\n pagesDir: string,\n nextConfig: ResolvedNextConfig,\n fileMatcher: ReturnType<typeof createValidFileMatcher>,\n): Promise<string> {\n const pageRoutes = await pagesRouter(pagesDir, nextConfig?.pageExtensions, fileMatcher);\n\n const appFilePath = findFileWithExts(pagesDir, \"_app\", fileMatcher);\n const hasApp = appFilePath !== null;\n\n // Build a map of route pattern -> dynamic import.\n // Keys must use Next.js bracket format (e.g. \"/user/[id]\") to match\n // __NEXT_DATA__.page which is set via patternToNextFormat() during SSR.\n const loaderEntries = pageRoutes.map((r: Route) => {\n const absPath = normalizePathSeparators(r.filePath);\n const nextFormatPattern = pagesPatternToNextFormat(r.pattern);\n // JSON.stringify safely escapes quotes, backslashes, and special chars in\n // both the route pattern and the absolute file path.\n // lgtm[js/bad-code-sanitization]\n return ` ${JSON.stringify(nextFormatPattern)}: () => import(${JSON.stringify(absPath)})`;\n });\n\n const appFileBase = appFilePath ? normalizePathSeparators(appFilePath) : undefined;\n\n return `\nimport \"vinext/instrumentation-client\";\nimport React from \"react\";\nimport { hydrateRoot } from \"react-dom/client\";\nimport { installPagesRouterRuntime } from \"vinext/pages-router-runtime\";\n// Statically import next/router as the very first vinext shim so that\n// (a) installWindowNext runs at top-level — \\`window.next.router\\` is\n// available to test harnesses and third-party scripts BEFORE\n// hydrate() resolves (see .nextjs-ref/packages/next/src/client/next.ts\n// line 13, which also sets window.next as a top-level side effect),\n// and (b) the popstate handler is registered before\n// installPagesRouterRuntime() runs, removing the race window where a\n// popstate event could fire between hydration and runtime install.\n//\n// Mirrors Next.js's bootstrap order: client/next.ts statically imports\n// from './' before calling initialize/hydrate, so window.next is set up\n// before any async work.\nimport { wrapWithRouterContext } from \"next/router\";\n\nconst pageLoaders = {\n${loaderEntries.join(\",\\n\")}\n};\n${\n hasApp\n ? `\nconst appLoader = () => import(${JSON.stringify(appFileBase!)});\n`\n : `\nconst appLoader = undefined;\n`\n}\n// Expose the code-split loader manifest on window so client-side\n// _next/data navigations in shims/router.ts can resolve the correct page\n// chunk for any route. Without this, navigateClient() would have to extract\n// the chunk URL from an HTML response — the whole point of switching to the\n// JSON data endpoint is to avoid that round trip.\n//\n// Keys are route patterns in Next.js bracket format (matching __NEXT_DATA__.page\n// and the keys of pageLoaders above). The patterns list is the same as\n// Object.keys(pageLoaders), exposed separately so navigateClient() can iterate\n// it without re-keying the map. Ordering is the insertion order of pageRoutes,\n// which pagesRouter() has already sorted by specificity (static → dynamic →\n// catch-all → optional catch-all) via compareRoutes — so matchPagesPattern()\n// can iterate in order and trust the first match.\nwindow.__VINEXT_PAGE_LOADERS__ = pageLoaders;\nwindow.__VINEXT_PAGE_PATTERNS__ = Object.keys(pageLoaders);\nwindow.__VINEXT_APP_LOADER__ = appLoader;\n\nasync function hydrate() {\n const nextData = window.__NEXT_DATA__;\n if (!nextData) {\n console.error(\"[vinext] No __NEXT_DATA__ found\");\n return;\n }\n\n const { pageProps } = nextData.props;\n const loader = pageLoaders[nextData.page];\n if (!loader) {\n console.error(\"[vinext] No page loader for route:\", nextData.page);\n return;\n }\n\n const pageModule = await loader();\n const PageComponent = pageModule.default;\n if (!PageComponent) {\n console.error(\"[vinext] Page module has no default export\");\n return;\n }\n\n let element;\n ${\n hasApp\n ? `\n try {\n const appModule = await appLoader();\n const AppComponent = appModule.default;\n window.__VINEXT_APP__ = AppComponent;\n element = React.createElement(AppComponent, { Component: PageComponent, pageProps });\n } catch {\n element = React.createElement(PageComponent, pageProps);\n }\n `\n : `\n element = React.createElement(PageComponent, pageProps);\n `\n }\n\n // Wrap with RouterContext.Provider so next/router and next/compat/router work during hydration.\n element = wrapWithRouterContext(element);\n\n const container = document.getElementById(\"__next\");\n if (!container) {\n console.error(\"[vinext] No #__next element found\");\n return;\n }\n\n const root = hydrateRoot(container, element);\n window.__VINEXT_ROOT__ = root;\n installPagesRouterRuntime();\n const hydratedAt = performance.now();\n window.__VINEXT_HYDRATED_AT = hydratedAt;\n window.__NEXT_HYDRATED = true;\n window.__NEXT_HYDRATED_AT = hydratedAt;\n window.__NEXT_HYDRATED_CB?.();\n}\n\nhydrate();\n`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAqBA,eAAsB,oBACpB,UACA,YACA,aACiB;CACjB,MAAM,aAAa,MAAM,YAAY,UAAU,YAAY,gBAAgB,YAAY;CAEvF,MAAM,cAAc,iBAAiB,UAAU,QAAQ,YAAY;CACnE,MAAM,SAAS,gBAAgB;CAK/B,MAAM,gBAAgB,WAAW,KAAK,MAAa;EACjD,MAAM,UAAU,wBAAwB,EAAE,SAAS;EACnD,MAAM,oBAAoBA,oBAAyB,EAAE,QAAQ;EAI7D,OAAO,KAAK,KAAK,UAAU,kBAAkB,CAAC,iBAAiB,KAAK,UAAU,QAAQ,CAAC;GACvF;CAEF,MAAM,cAAc,cAAc,wBAAwB,YAAY,GAAG,KAAA;CAEzE,OAAO;;;;;;;;;;;;;;;;;;;;EAoBP,cAAc,KAAK,MAAM,CAAC;;EAG1B,SACI;iCAC2B,KAAK,UAAU,YAAa,CAAC;IAExD;;EAGL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAyCG,SACI;;;;;;;;;MAUA;;IAGL"}
1
+ {"version":3,"file":"pages-client-entry.js","names":["pagesPatternToNextFormat"],"sources":["../../src/entries/pages-client-entry.ts"],"sourcesContent":["/**\n * Pages Router client hydration entry generator.\n *\n * Generates the virtual client entry module (`virtual:vinext-client-entry`).\n * This is the entry point for `vite build` (client bundle). It maps route\n * patterns to dynamic imports of page modules so Vite code-splits each page\n * into its own chunk. At runtime it reads __NEXT_DATA__ to determine which\n * page to hydrate.\n *\n * Extracted from index.ts.\n */\nimport {\n pagesRouter,\n patternToNextFormat as pagesPatternToNextFormat,\n type Route,\n} from \"../routing/pages-router.js\";\nimport { createValidFileMatcher } from \"../routing/file-matcher.js\";\nimport { type ResolvedNextConfig } from \"../config/next-config.js\";\nimport type { VinextLinkPrefetchRoute } from \"../client/vinext-next-data.js\";\nimport { findFileWithExts } from \"./pages-entry-helpers.js\";\nimport { normalizePathSeparators } from \"../utils/path.js\";\n\nexport async function generateClientEntry(\n pagesDir: string,\n nextConfig: ResolvedNextConfig,\n fileMatcher: ReturnType<typeof createValidFileMatcher>,\n options: { appPrefetchRoutes?: readonly VinextLinkPrefetchRoute[] } = {},\n): Promise<string> {\n const pageRoutes = await pagesRouter(pagesDir, nextConfig?.pageExtensions, fileMatcher);\n\n const appFilePath = findFileWithExts(pagesDir, \"_app\", fileMatcher);\n const hasApp = appFilePath !== null;\n const appPrefetchRoutes = options.appPrefetchRoutes ?? [];\n\n // Build a map of route pattern -> dynamic import.\n // Keys must use Next.js bracket format (e.g. \"/user/[id]\") to match\n // __NEXT_DATA__.page which is set via patternToNextFormat() during SSR.\n const loaderEntries = pageRoutes.map((r: Route) => {\n const absPath = normalizePathSeparators(r.filePath);\n const nextFormatPattern = pagesPatternToNextFormat(r.pattern);\n // JSON.stringify safely escapes quotes, backslashes, and special chars in\n // both the route pattern and the absolute file path.\n // lgtm[js/bad-code-sanitization]\n return ` ${JSON.stringify(nextFormatPattern)}: () => import(${JSON.stringify(absPath)})`;\n });\n\n const appFileBase = appFilePath ? normalizePathSeparators(appFilePath) : undefined;\n\n return `\nimport \"vinext/instrumentation-client\";\nimport React from \"react\";\nimport { hydrateRoot } from \"react-dom/client\";\nimport { installPagesRouterRuntime } from \"vinext/pages-router-runtime\";\n// Statically import next/router as the very first vinext shim so that\n// (a) installWindowNext runs at top-level — \\`window.next.router\\` is\n// available to test harnesses and third-party scripts BEFORE\n// hydrate() resolves (see .nextjs-ref/packages/next/src/client/next.ts\n// line 13, which also sets window.next as a top-level side effect),\n// and (b) the popstate handler is registered before\n// installPagesRouterRuntime() runs, removing the race window where a\n// popstate event could fire between hydration and runtime install.\n//\n// Mirrors Next.js's bootstrap order: client/next.ts statically imports\n// from './' before calling initialize/hydrate, so window.next is set up\n// before any async work.\nimport { wrapWithRouterContext } from \"next/router\";\n\nconst pageLoaders = {\n${loaderEntries.join(\",\\n\")}\n};\n${\n hasApp\n ? `\nconst appLoader = () => import(${JSON.stringify(appFileBase!)});\n`\n : `\nconst appLoader = undefined;\n`\n}\n// Expose the code-split loader manifest on window so client-side\n// _next/data navigations in shims/router.ts can resolve the correct page\n// chunk for any route. Without this, navigateClient() would have to extract\n// the chunk URL from an HTML response — the whole point of switching to the\n// JSON data endpoint is to avoid that round trip.\n//\n// Keys are route patterns in Next.js bracket format (matching __NEXT_DATA__.page\n// and the keys of pageLoaders above). The patterns list is the same as\n// Object.keys(pageLoaders), exposed separately so navigateClient() can iterate\n// it without re-keying the map. Ordering is the insertion order of pageRoutes,\n// which pagesRouter() has already sorted by specificity (static → dynamic →\n// catch-all → optional catch-all) via compareRoutes — so matchPagesPattern()\n// can iterate in order and trust the first match.\nwindow.__VINEXT_PAGE_LOADERS__ = pageLoaders;\nwindow.__VINEXT_PAGE_PATTERNS__ = Object.keys(pageLoaders);\nwindow.__VINEXT_APP_LOADER__ = appLoader;\n// Expose the App Router prefetch manifest so Pages Router \\`<Link>\\`s and\n// \\`Router.prefetch\\` can detect when a prefetch target is actually an App\n// Router route, and mark it on \\`Router.components[urlPathname]\\` with\n// \\`{ __appRouter: true }\\`. Mirrors Next.js's \\`_bfl\\`-driven marker write at\n// .nextjs-ref/packages/next/src/shared/lib/router/router.ts:2525, which the\n// Next.js deploy test\n// test/e2e/app-dir/app/index.test.ts → \"should successfully detect app\n// route during prefetch\"\n// asserts via \\`window.next.router.components[<path>]\\`. Issue #1526.\n//\n// In a hybrid Pages + App Router build, this entry runs when the user lands\n// on a Pages Router page. The App Router browser entry sets the same global\n// when the user lands on an App Router page (see app-browser-entry.ts) — the\n// two writes do not race because only one entry executes per page load.\nwindow.__VINEXT_LINK_PREFETCH_ROUTES__ = ${JSON.stringify(appPrefetchRoutes)};\n\nasync function hydrate() {\n const nextData = window.__NEXT_DATA__;\n if (!nextData) {\n console.error(\"[vinext] No __NEXT_DATA__ found\");\n return;\n }\n\n const { pageProps } = nextData.props;\n const loader = pageLoaders[nextData.page];\n if (!loader) {\n console.error(\"[vinext] No page loader for route:\", nextData.page);\n return;\n }\n\n const pageModule = await loader();\n const PageComponent = pageModule.default;\n if (!PageComponent) {\n console.error(\"[vinext] Page module has no default export\");\n return;\n }\n\n let element;\n ${\n hasApp\n ? `\n try {\n const appModule = await appLoader();\n const AppComponent = appModule.default;\n window.__VINEXT_APP__ = AppComponent;\n element = React.createElement(AppComponent, { Component: PageComponent, pageProps });\n } catch {\n element = React.createElement(PageComponent, pageProps);\n }\n `\n : `\n element = React.createElement(PageComponent, pageProps);\n `\n }\n\n // Wrap with RouterContext.Provider so next/router and next/compat/router work during hydration.\n element = wrapWithRouterContext(element);\n\n const container = document.getElementById(\"__next\");\n if (!container) {\n console.error(\"[vinext] No #__next element found\");\n return;\n }\n\n const root = hydrateRoot(container, element);\n window.__VINEXT_ROOT__ = root;\n installPagesRouterRuntime();\n const hydratedAt = performance.now();\n window.__VINEXT_HYDRATED_AT = hydratedAt;\n window.__NEXT_HYDRATED = true;\n window.__NEXT_HYDRATED_AT = hydratedAt;\n window.__NEXT_HYDRATED_CB?.();\n}\n\nhydrate();\n`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAsBA,eAAsB,oBACpB,UACA,YACA,aACA,UAAsE,EAAE,EACvD;CACjB,MAAM,aAAa,MAAM,YAAY,UAAU,YAAY,gBAAgB,YAAY;CAEvF,MAAM,cAAc,iBAAiB,UAAU,QAAQ,YAAY;CACnE,MAAM,SAAS,gBAAgB;CAC/B,MAAM,oBAAoB,QAAQ,qBAAqB,EAAE;CAKzD,MAAM,gBAAgB,WAAW,KAAK,MAAa;EACjD,MAAM,UAAU,wBAAwB,EAAE,SAAS;EACnD,MAAM,oBAAoBA,oBAAyB,EAAE,QAAQ;EAI7D,OAAO,KAAK,KAAK,UAAU,kBAAkB,CAAC,iBAAiB,KAAK,UAAU,QAAQ,CAAC;GACvF;CAEF,MAAM,cAAc,cAAc,wBAAwB,YAAY,GAAG,KAAA;CAEzE,OAAO;;;;;;;;;;;;;;;;;;;;EAoBP,cAAc,KAAK,MAAM,CAAC;;EAG1B,SACI;iCAC2B,KAAK,UAAU,YAAa,CAAC;IAExD;;EAGL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CA+B0C,KAAK,UAAU,kBAAkB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;IAyBzE,SACI;;;;;;;;;MAUA;;IAGL"}