vinext 0.0.52 → 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.
- package/README.md +1 -1
- package/dist/build/clean-output.d.ts +14 -0
- package/dist/build/clean-output.js +36 -0
- package/dist/build/clean-output.js.map +1 -0
- package/dist/build/inline-css.d.ts +7 -0
- package/dist/build/inline-css.js +50 -0
- package/dist/build/inline-css.js.map +1 -0
- package/dist/build/prerender.d.ts +6 -2
- package/dist/build/prerender.js +51 -12
- package/dist/build/prerender.js.map +1 -1
- package/dist/build/run-prerender.js +10 -1
- package/dist/build/run-prerender.js.map +1 -1
- package/dist/build/static-export.d.ts +5 -0
- package/dist/build/static-export.js +8 -3
- package/dist/build/static-export.js.map +1 -1
- package/dist/check.js +4 -0
- package/dist/check.js.map +1 -1
- package/dist/cli.js +19 -4
- package/dist/cli.js.map +1 -1
- package/dist/client/instrumentation-client-inject.d.ts +34 -0
- package/dist/client/instrumentation-client-inject.js +57 -0
- package/dist/client/instrumentation-client-inject.js.map +1 -0
- package/dist/client/navigation-runtime.d.ts +16 -2
- package/dist/client/navigation-runtime.js +16 -1
- package/dist/client/navigation-runtime.js.map +1 -1
- package/dist/client/vinext-next-data.d.ts +2 -1
- package/dist/client/vinext-next-data.js.map +1 -1
- package/dist/client/window-next.d.ts +17 -2
- package/dist/client/window-next.js.map +1 -1
- package/dist/cloudflare/tpr.js +1 -1
- package/dist/cloudflare/tpr.js.map +1 -1
- package/dist/config/config-matchers.js +2 -1
- package/dist/config/config-matchers.js.map +1 -1
- package/dist/config/next-config.d.ts +95 -4
- package/dist/config/next-config.js +173 -14
- package/dist/config/next-config.js.map +1 -1
- package/dist/deploy.js +42 -7
- package/dist/deploy.js.map +1 -1
- package/dist/entries/app-browser-entry.d.ts +11 -1
- package/dist/entries/app-browser-entry.js +16 -6
- package/dist/entries/app-browser-entry.js.map +1 -1
- package/dist/entries/app-rsc-entry.d.ts +12 -3
- package/dist/entries/app-rsc-entry.js +41 -8
- package/dist/entries/app-rsc-entry.js.map +1 -1
- package/dist/entries/app-rsc-manifest.d.ts +21 -1
- package/dist/entries/app-rsc-manifest.js +6 -4
- package/dist/entries/app-rsc-manifest.js.map +1 -1
- package/dist/entries/pages-client-entry.d.ts +4 -1
- package/dist/entries/pages-client-entry.js +40 -3
- package/dist/entries/pages-client-entry.js.map +1 -1
- package/dist/entries/pages-server-entry.js +292 -34
- package/dist/entries/pages-server-entry.js.map +1 -1
- package/dist/entries/runtime-entry-module.d.ts +1 -10
- package/dist/entries/runtime-entry-module.js +2 -12
- package/dist/entries/runtime-entry-module.js.map +1 -1
- package/dist/index.js +91 -10
- package/dist/index.js.map +1 -1
- package/dist/plugins/fonts.js +25 -2
- package/dist/plugins/fonts.js.map +1 -1
- package/dist/plugins/remove-console.d.ts +16 -0
- package/dist/plugins/remove-console.js +176 -0
- package/dist/plugins/remove-console.js.map +1 -0
- package/dist/routing/app-route-graph.d.ts +24 -1
- package/dist/routing/app-route-graph.js +52 -4
- package/dist/routing/app-route-graph.js.map +1 -1
- package/dist/routing/app-router.d.ts +2 -2
- package/dist/routing/app-router.js +2 -2
- package/dist/routing/app-router.js.map +1 -1
- package/dist/routing/file-matcher.d.ts +21 -1
- package/dist/routing/file-matcher.js +39 -1
- package/dist/routing/file-matcher.js.map +1 -1
- package/dist/routing/pages-router.d.ts +1 -1
- package/dist/routing/pages-router.js +10 -3
- package/dist/routing/pages-router.js.map +1 -1
- package/dist/routing/route-trie.js +13 -18
- package/dist/routing/route-trie.js.map +1 -1
- package/dist/routing/utils.d.ts +11 -1
- package/dist/routing/utils.js +15 -1
- package/dist/routing/utils.js.map +1 -1
- package/dist/server/api-handler.js +19 -10
- package/dist/server/api-handler.js.map +1 -1
- package/dist/server/app-browser-action-result.d.ts +16 -1
- package/dist/server/app-browser-action-result.js +15 -1
- package/dist/server/app-browser-action-result.js.map +1 -1
- package/dist/server/app-browser-entry.js +47 -28
- package/dist/server/app-browser-entry.js.map +1 -1
- package/dist/server/app-browser-navigation-controller.d.ts +2 -0
- package/dist/server/app-browser-navigation-controller.js +4 -0
- package/dist/server/app-browser-navigation-controller.js.map +1 -1
- package/dist/server/app-elements-wire.d.ts +13 -4
- package/dist/server/app-elements-wire.js +10 -1
- package/dist/server/app-elements-wire.js.map +1 -1
- package/dist/server/app-elements.d.ts +2 -2
- package/dist/server/app-elements.js +2 -2
- package/dist/server/app-elements.js.map +1 -1
- package/dist/server/app-fallback-renderer.d.ts +27 -8
- package/dist/server/app-fallback-renderer.js +19 -8
- package/dist/server/app-fallback-renderer.js.map +1 -1
- package/dist/server/app-history-state.js +6 -2
- package/dist/server/app-history-state.js.map +1 -1
- package/dist/server/app-inline-css-client.d.ts +7 -0
- package/dist/server/app-inline-css-client.js +37 -0
- package/dist/server/app-inline-css-client.js.map +1 -0
- package/dist/server/app-interception-context-header.d.ts +33 -0
- package/dist/server/app-interception-context-header.js +44 -0
- package/dist/server/app-interception-context-header.js.map +1 -0
- package/dist/server/app-mounted-slots-header.d.ts +19 -0
- package/dist/server/app-mounted-slots-header.js +40 -1
- package/dist/server/app-mounted-slots-header.js.map +1 -1
- package/dist/server/app-optimistic-routing.js +26 -18
- package/dist/server/app-optimistic-routing.js.map +1 -1
- package/dist/server/app-page-boundary-render.d.ts +1 -0
- package/dist/server/app-page-boundary-render.js +2 -0
- package/dist/server/app-page-boundary-render.js.map +1 -1
- package/dist/server/app-page-boundary.d.ts +22 -1
- package/dist/server/app-page-boundary.js +30 -3
- package/dist/server/app-page-boundary.js.map +1 -1
- package/dist/server/app-page-cache.d.ts +9 -3
- package/dist/server/app-page-cache.js +14 -8
- package/dist/server/app-page-cache.js.map +1 -1
- package/dist/server/app-page-dispatch.d.ts +13 -1
- package/dist/server/app-page-dispatch.js +136 -82
- package/dist/server/app-page-dispatch.js.map +1 -1
- package/dist/server/app-page-element-builder.d.ts +2 -1
- package/dist/server/app-page-element-builder.js +17 -30
- package/dist/server/app-page-element-builder.js.map +1 -1
- package/dist/server/app-page-execution.d.ts +1 -0
- package/dist/server/app-page-execution.js +2 -0
- package/dist/server/app-page-execution.js.map +1 -1
- package/dist/server/app-page-head.d.ts +1 -0
- package/dist/server/app-page-head.js +8 -0
- package/dist/server/app-page-head.js.map +1 -1
- package/dist/server/app-page-render-identity.d.ts +22 -0
- package/dist/server/app-page-render-identity.js +42 -0
- package/dist/server/app-page-render-identity.js.map +1 -0
- package/dist/server/app-page-render-observation.js +1 -1
- package/dist/server/app-page-render.d.ts +9 -1
- package/dist/server/app-page-render.js +8 -2
- package/dist/server/app-page-render.js.map +1 -1
- package/dist/server/app-page-request.d.ts +6 -3
- package/dist/server/app-page-request.js +5 -2
- package/dist/server/app-page-request.js.map +1 -1
- package/dist/server/app-page-response.d.ts +11 -1
- package/dist/server/app-page-response.js +16 -4
- package/dist/server/app-page-response.js.map +1 -1
- package/dist/server/app-page-route-wiring.d.ts +16 -0
- package/dist/server/app-page-route-wiring.js +25 -10
- package/dist/server/app-page-route-wiring.js.map +1 -1
- package/dist/server/app-page-stream.d.ts +12 -0
- package/dist/server/app-page-stream.js +3 -0
- package/dist/server/app-page-stream.js.map +1 -1
- package/dist/server/app-route-handler-dispatch.d.ts +1 -0
- package/dist/server/app-route-handler-dispatch.js +3 -0
- package/dist/server/app-route-handler-dispatch.js.map +1 -1
- package/dist/server/app-route-handler-execution.d.ts +1 -0
- package/dist/server/app-route-handler-execution.js +1 -0
- package/dist/server/app-route-handler-execution.js.map +1 -1
- package/dist/server/app-route-handler-response.js +38 -6
- package/dist/server/app-route-handler-response.js.map +1 -1
- package/dist/server/app-rsc-handler.d.ts +16 -3
- package/dist/server/app-rsc-handler.js +60 -11
- package/dist/server/app-rsc-handler.js.map +1 -1
- package/dist/server/app-rsc-request-normalization.d.ts +2 -1
- package/dist/server/app-rsc-request-normalization.js +6 -4
- package/dist/server/app-rsc-request-normalization.js.map +1 -1
- package/dist/server/app-segment-config.d.ts +4 -1
- package/dist/server/app-segment-config.js +6 -1
- package/dist/server/app-segment-config.js.map +1 -1
- package/dist/server/app-server-action-execution.d.ts +22 -3
- package/dist/server/app-server-action-execution.js +46 -7
- package/dist/server/app-server-action-execution.js.map +1 -1
- package/dist/server/app-ssr-entry.d.ts +6 -0
- package/dist/server/app-ssr-entry.js +57 -6
- package/dist/server/app-ssr-entry.js.map +1 -1
- package/dist/server/app-ssr-error-meta.js +3 -3
- package/dist/server/app-ssr-error-meta.js.map +1 -1
- package/dist/server/app-ssr-stream.d.ts +25 -1
- package/dist/server/app-ssr-stream.js +237 -19
- package/dist/server/app-ssr-stream.js.map +1 -1
- package/dist/server/app-static-generation.d.ts +1 -0
- package/dist/server/app-static-generation.js +2 -1
- package/dist/server/app-static-generation.js.map +1 -1
- package/dist/server/client-trace-metadata.d.ts +31 -0
- package/dist/server/client-trace-metadata.js +83 -0
- package/dist/server/client-trace-metadata.js.map +1 -0
- package/dist/server/cookie-utils.d.ts +13 -0
- package/dist/server/cookie-utils.js +20 -0
- package/dist/server/cookie-utils.js.map +1 -0
- package/dist/server/default-not-found-module.d.ts +20 -0
- package/dist/server/default-not-found-module.js +20 -0
- package/dist/server/default-not-found-module.js.map +1 -0
- package/dist/server/dev-server.d.ts +8 -1
- package/dist/server/dev-server.js +56 -11
- package/dist/server/dev-server.js.map +1 -1
- package/dist/server/headers.d.ts +5 -1
- package/dist/server/headers.js +5 -1
- package/dist/server/headers.js.map +1 -1
- package/dist/server/html.d.ts +2 -1
- package/dist/server/html.js +6 -1
- package/dist/server/html.js.map +1 -1
- package/dist/server/image-optimization.d.ts +13 -4
- package/dist/server/image-optimization.js +15 -4
- package/dist/server/image-optimization.js.map +1 -1
- package/dist/server/isr-cache.d.ts +7 -5
- package/dist/server/isr-cache.js +17 -6
- package/dist/server/isr-cache.js.map +1 -1
- package/dist/server/middleware-runtime.js +1 -2
- package/dist/server/middleware-runtime.js.map +1 -1
- package/dist/server/middleware.js +1 -1
- package/dist/server/middleware.js.map +1 -1
- package/dist/server/pages-api-route.d.ts +18 -0
- package/dist/server/pages-api-route.js +3 -1
- package/dist/server/pages-api-route.js.map +1 -1
- package/dist/server/pages-body-parser-config.d.ts +60 -0
- package/dist/server/pages-body-parser-config.js +79 -0
- package/dist/server/pages-body-parser-config.js.map +1 -0
- package/dist/server/pages-data-route.js +1 -0
- package/dist/server/pages-data-route.js.map +1 -1
- package/dist/server/pages-default-404.d.ts +31 -0
- package/dist/server/pages-default-404.js +40 -0
- package/dist/server/pages-default-404.js.map +1 -0
- package/dist/server/pages-document-initial-props.d.ts +7 -0
- package/dist/server/pages-document-initial-props.js +14 -0
- package/dist/server/pages-document-initial-props.js.map +1 -0
- package/dist/server/pages-node-compat.d.ts +10 -0
- package/dist/server/pages-node-compat.js +12 -1
- package/dist/server/pages-node-compat.js.map +1 -1
- package/dist/server/pages-page-data.d.ts +40 -0
- package/dist/server/pages-page-data.js +19 -14
- package/dist/server/pages-page-data.js.map +1 -1
- package/dist/server/pages-page-method.d.ts +48 -0
- package/dist/server/pages-page-method.js +19 -0
- package/dist/server/pages-page-method.js.map +1 -0
- package/dist/server/pages-page-response.d.ts +8 -0
- package/dist/server/pages-page-response.js +21 -11
- package/dist/server/pages-page-response.js.map +1 -1
- package/dist/server/pages-serializable-props.d.ts +25 -0
- package/dist/server/pages-serializable-props.js +69 -0
- package/dist/server/pages-serializable-props.js.map +1 -0
- package/dist/server/prerender-route-params.d.ts +14 -0
- package/dist/server/prerender-route-params.js +94 -0
- package/dist/server/prerender-route-params.js.map +1 -0
- package/dist/server/prod-server.d.ts +3 -23
- package/dist/server/prod-server.js +43 -57
- package/dist/server/prod-server.js.map +1 -1
- package/dist/server/proxy-trust.d.ts +41 -0
- package/dist/server/proxy-trust.js +70 -0
- package/dist/server/proxy-trust.js.map +1 -0
- package/dist/server/request-pipeline.d.ts +3 -3
- package/dist/server/request-pipeline.js +5 -4
- package/dist/server/request-pipeline.js.map +1 -1
- package/dist/server/seed-cache.js +12 -6
- package/dist/server/seed-cache.js.map +1 -1
- package/dist/server/server-action-not-found.js +3 -2
- package/dist/server/server-action-not-found.js.map +1 -1
- package/dist/server/static-file-cache.js +2 -1
- package/dist/server/static-file-cache.js.map +1 -1
- package/dist/server/streaming-metadata.d.ts +5 -0
- package/dist/server/streaming-metadata.js +10 -0
- package/dist/server/streaming-metadata.js.map +1 -0
- package/dist/shims/app-router-scroll-state.d.ts +14 -0
- package/dist/shims/app-router-scroll-state.js +51 -0
- package/dist/shims/app-router-scroll-state.js.map +1 -0
- package/dist/shims/app-router-scroll.d.ts +28 -0
- package/dist/shims/app-router-scroll.js +115 -0
- package/dist/shims/app-router-scroll.js.map +1 -0
- package/dist/shims/before-interactive-context.d.ts +30 -0
- package/dist/shims/before-interactive-context.js +10 -0
- package/dist/shims/before-interactive-context.js.map +1 -0
- package/dist/shims/cache-runtime.d.ts +1 -1
- package/dist/shims/cache-runtime.js +14 -1
- package/dist/shims/cache-runtime.js.map +1 -1
- package/dist/shims/cache.d.ts +6 -0
- package/dist/shims/cache.js +7 -0
- package/dist/shims/cache.js.map +1 -1
- package/dist/shims/default-not-found.d.ts +12 -0
- package/dist/shims/default-not-found.js +61 -0
- package/dist/shims/default-not-found.js.map +1 -0
- package/dist/shims/error.js +3 -0
- package/dist/shims/error.js.map +1 -1
- package/dist/shims/font-local.d.ts +5 -0
- package/dist/shims/font-local.js +6 -2
- package/dist/shims/font-local.js.map +1 -1
- package/dist/shims/head.js +4 -4
- package/dist/shims/head.js.map +1 -1
- package/dist/shims/headers.d.ts +13 -2
- package/dist/shims/headers.js +73 -22
- package/dist/shims/headers.js.map +1 -1
- package/dist/shims/image.d.ts +1 -1
- package/dist/shims/image.js +4 -4
- package/dist/shims/image.js.map +1 -1
- package/dist/shims/internal/app-route-detection.d.ts +37 -0
- package/dist/shims/internal/app-route-detection.js +69 -0
- package/dist/shims/internal/app-route-detection.js.map +1 -0
- package/dist/shims/internal/pages-data-target.d.ts +58 -0
- package/dist/shims/internal/pages-data-target.js +91 -0
- package/dist/shims/internal/pages-data-target.js.map +1 -0
- package/dist/shims/internal/pages-data-url.d.ts +42 -0
- package/dist/shims/internal/pages-data-url.js +73 -0
- package/dist/shims/internal/pages-data-url.js.map +1 -0
- package/dist/shims/link.d.ts +18 -2
- package/dist/shims/link.js +129 -15
- package/dist/shims/link.js.map +1 -1
- package/dist/shims/metadata.d.ts +9 -7
- package/dist/shims/metadata.js +70 -7
- package/dist/shims/metadata.js.map +1 -1
- package/dist/shims/navigation.d.ts +1 -2
- package/dist/shims/navigation.js +94 -20
- package/dist/shims/navigation.js.map +1 -1
- package/dist/shims/router.d.ts +5 -0
- package/dist/shims/router.js +389 -80
- package/dist/shims/router.js.map +1 -1
- package/dist/shims/script.d.ts +11 -1
- package/dist/shims/script.js +158 -15
- package/dist/shims/script.js.map +1 -1
- package/dist/shims/server.js +1 -0
- package/dist/shims/server.js.map +1 -1
- package/dist/shims/url-utils.d.ts +2 -1
- package/dist/shims/url-utils.js +15 -4
- package/dist/shims/url-utils.js.map +1 -1
- package/dist/utils/html-limited-bots.d.ts +5 -0
- package/dist/utils/html-limited-bots.js +15 -0
- package/dist/utils/html-limited-bots.js.map +1 -0
- package/dist/utils/path.d.ts +13 -0
- package/dist/utils/path.js +16 -0
- package/dist/utils/path.js.map +1 -0
- package/dist/utils/query.d.ts +6 -0
- package/dist/utils/query.js +10 -1
- package/dist/utils/query.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { normalizePathSeparators
|
|
1
|
+
import { normalizePathSeparators } from "../utils/path.js";
|
|
2
|
+
import { resolveEntryPath } from "./runtime-entry-module.js";
|
|
2
3
|
import { isProxyFile } from "../server/middleware.js";
|
|
3
4
|
import { buildAppRscManifestCode } from "./app-rsc-manifest.js";
|
|
4
5
|
import { generateDevOriginCheckCode } from "../server/dev-origin-check.js";
|
|
6
|
+
import { randomUUID } from "node:crypto";
|
|
5
7
|
//#region src/entries/app-rsc-entry.ts
|
|
6
8
|
/**
|
|
7
9
|
* App Router RSC entry generator.
|
|
@@ -60,12 +62,16 @@ function generateRscEntry(appDir, routes, middlewarePath, metadataRoutes, global
|
|
|
60
62
|
const headers = config?.headers ?? [];
|
|
61
63
|
const allowedOrigins = config?.allowedOrigins ?? [];
|
|
62
64
|
const bodySizeLimit = config?.bodySizeLimit ?? 1 * 1024 * 1024;
|
|
65
|
+
const htmlLimitedBots = config?.htmlLimitedBots;
|
|
66
|
+
const clientTraceMetadata = config?.clientTraceMetadata;
|
|
63
67
|
const assetPrefix = config?.assetPrefix ?? "";
|
|
64
68
|
const expireTime = config?.expireTime ?? DEFAULT_EXPIRE_TIME;
|
|
69
|
+
const inlineCss = config?.inlineCss === true;
|
|
65
70
|
const i18nConfig = config?.i18n ?? null;
|
|
66
71
|
const hasPagesDir = config?.hasPagesDir ?? false;
|
|
67
72
|
const publicFiles = config?.publicFiles ?? [];
|
|
68
|
-
const
|
|
73
|
+
const draftModeSecret = config?.draftModeSecret ?? randomUUID();
|
|
74
|
+
const { imports, routeEntries, metaRouteEntries, generateStaticParamsEntries, rootParamNameEntries, rootNotFoundVar, rootForbiddenVar, rootUnauthorizedVar, rootLayoutVars, globalErrorVar, globalNotFoundImportSpecifier } = buildAppRscManifestCode({
|
|
69
75
|
routes,
|
|
70
76
|
metadataRoutes,
|
|
71
77
|
globalErrorPath,
|
|
@@ -141,6 +147,7 @@ import {
|
|
|
141
147
|
resolveAppPageGenerateStaticParamsSources as __resolveAppPageGenerateStaticParamsSources,
|
|
142
148
|
} from ${JSON.stringify(appPageRequestPath)};
|
|
143
149
|
import {
|
|
150
|
+
isEdgeRuntime as __isEdgeRuntime,
|
|
144
151
|
resolveAppPageFetchCacheMode as __resolveAppPageFetchCacheMode,
|
|
145
152
|
resolveAppPageSegmentConfig as __resolveAppPageSegmentConfig,
|
|
146
153
|
} from ${JSON.stringify(appSegmentConfigPath)};
|
|
@@ -175,6 +182,8 @@ import { clearAppRequestContext as __clearRequestContext, setAppNavigationContex
|
|
|
175
182
|
import { createAppPrerenderStaticParamsResolver as __createAppPrerenderStaticParamsResolver } from ${JSON.stringify(appPrerenderStaticParamsPath)};
|
|
176
183
|
import { seedMemoryCacheFromPrerender as __seedMemoryCacheFromPrerender } from ${JSON.stringify(seedCachePath)};
|
|
177
184
|
|
|
185
|
+
const __draftModeSecret = ${JSON.stringify(draftModeSecret)};
|
|
186
|
+
|
|
178
187
|
// Note: cache entries are written with \`headers: undefined\`. Next.js stores
|
|
179
188
|
// response headers (e.g. set-cookie from cookies().set() during render) in the
|
|
180
189
|
// cache entry so they can be replayed on HIT. We don't do this because:
|
|
@@ -253,12 +262,19 @@ const rootNotFoundModule = ${rootNotFoundVar ? rootNotFoundVar : "null"};
|
|
|
253
262
|
const rootForbiddenModule = ${rootForbiddenVar ? rootForbiddenVar : "null"};
|
|
254
263
|
const rootUnauthorizedModule = ${rootUnauthorizedVar ? rootUnauthorizedVar : "null"};
|
|
255
264
|
const rootLayouts = [${rootLayoutVars.join(", ")}];
|
|
256
|
-
// Root-level app/global-not-found
|
|
265
|
+
// Root-level app/global-not-found loader. When present, route-miss 404s render
|
|
257
266
|
// this module standalone (it provides its own html/body) instead of wrapping
|
|
258
267
|
// the not-found.tsx boundary inside the root layout. Page-triggered notFound()
|
|
259
268
|
// calls still use the regular not-found.tsx boundary inside the layouts.
|
|
269
|
+
//
|
|
270
|
+
// The module is loaded via dynamic \`import()\` (not a static \`import * as\`)
|
|
271
|
+
// so the bundler emits it in its own JS+CSS chunk. Without that isolation,
|
|
272
|
+
// global-not-found's CSS gets concatenated with the root layout's CSS into a
|
|
273
|
+
// single file, where the CSS minifier (lightningcss) drops overlapping
|
|
274
|
+
// declarations as dead code — breaking the cascade for route-miss 404s.
|
|
260
275
|
// See https://github.com/vercel/next.js/blob/canary/packages/next/src/server/app-render/app-render.tsx#L495-L520
|
|
261
|
-
|
|
276
|
+
// See Next.js test: test/e2e/app-dir/initial-css-order/initial-css-order.test.ts
|
|
277
|
+
const __loadGlobalNotFoundModule = ${globalNotFoundImportSpecifier ? `() => import(${globalNotFoundImportSpecifier})` : "null"};
|
|
262
278
|
|
|
263
279
|
const createRscOnErrorHandler = (request, pathname, routePath) =>
|
|
264
280
|
createAppRscOnErrorHandler(_reportRequestError, request, pathname, routePath);
|
|
@@ -272,7 +288,7 @@ const __fallbackRenderer = __createAppFallbackRenderer({
|
|
|
272
288
|
rootUnauthorizedModule,
|
|
273
289
|
},
|
|
274
290
|
globalErrorModule: ${globalErrorVar ? globalErrorVar : "null"},
|
|
275
|
-
|
|
291
|
+
loadGlobalNotFoundModule: __loadGlobalNotFoundModule,
|
|
276
292
|
metadataRoutes,
|
|
277
293
|
ssrLoader() {
|
|
278
294
|
return import.meta.viteRsc.loadModule("ssr", "index");
|
|
@@ -320,6 +336,7 @@ async function buildPageElements(route, params, routePath, pageRequest) {
|
|
|
320
336
|
rootUnauthorizedModule: ${rootUnauthorizedVar ? rootUnauthorizedVar : "null"},
|
|
321
337
|
metadataRoutes,
|
|
322
338
|
basePath: __basePath,
|
|
339
|
+
htmlLimitedBots: __htmlLimitedBots,
|
|
323
340
|
});
|
|
324
341
|
}
|
|
325
342
|
|
|
@@ -331,10 +348,13 @@ const __configHeaders = ${JSON.stringify(headers)};
|
|
|
331
348
|
const __publicFiles = new Set(${JSON.stringify(publicFiles)});
|
|
332
349
|
const __allowedOrigins = ${JSON.stringify(allowedOrigins)};
|
|
333
350
|
const __expireTime = ${JSON.stringify(expireTime)};
|
|
351
|
+
const __htmlLimitedBots = ${JSON.stringify(htmlLimitedBots)};
|
|
352
|
+
const __clientTraceMetadata = ${JSON.stringify(clientTraceMetadata)};
|
|
334
353
|
// Re-exported for the App Router prod-server to consume at startup —
|
|
335
354
|
// mirrors the embedded \`__basePath\` pattern (and Pages Router's
|
|
336
355
|
// \`vinextConfig\` export). Empty string when unset.
|
|
337
356
|
export const __assetPrefix = ${JSON.stringify(assetPrefix)};
|
|
357
|
+
export const __inlineCss = ${JSON.stringify(inlineCss)};
|
|
338
358
|
|
|
339
359
|
export function seedMemoryCacheFromPrerender(serverDir) {
|
|
340
360
|
return __seedMemoryCacheFromPrerender(serverDir, {
|
|
@@ -379,6 +399,7 @@ export default __createAppRscHandler({
|
|
|
379
399
|
configHeaders: __configHeaders,
|
|
380
400
|
configRedirects: __configRedirects,
|
|
381
401
|
configRewrites: __configRewrites,
|
|
402
|
+
draftModeSecret: __draftModeSecret,
|
|
382
403
|
dispatchMatchedPage({
|
|
383
404
|
cleanPathname,
|
|
384
405
|
formState,
|
|
@@ -391,6 +412,7 @@ export default __createAppRscHandler({
|
|
|
391
412
|
middlewareContext,
|
|
392
413
|
mountedSlotsHeader,
|
|
393
414
|
params,
|
|
415
|
+
staticParamsValidationParams,
|
|
394
416
|
rootParams,
|
|
395
417
|
request,
|
|
396
418
|
route,
|
|
@@ -412,6 +434,7 @@ export default __createAppRscHandler({
|
|
|
412
434
|
const _asyncRouteParams = makeThenableParams(params);
|
|
413
435
|
return __dispatchAppPage({
|
|
414
436
|
basePath: __basePath,
|
|
437
|
+
clientTraceMetadata: __clientTraceMetadata,
|
|
415
438
|
buildPageElement(targetRoute, targetParams, targetOpts, targetSearchParams) {
|
|
416
439
|
return buildPageElements(targetRoute, targetParams, cleanPathname, {
|
|
417
440
|
opts: targetOpts,
|
|
@@ -430,9 +453,11 @@ export default __createAppRscHandler({
|
|
|
430
453
|
return createRscOnErrorHandler(request, pathname, routePath);
|
|
431
454
|
},
|
|
432
455
|
debugClassification: __classDebug,
|
|
456
|
+
draftModeSecret: __draftModeSecret,
|
|
433
457
|
dynamicConfig: __segmentConfig.dynamicConfig,
|
|
434
458
|
dynamicParamsConfig: __segmentConfig.dynamicParamsConfig,
|
|
435
459
|
fetchCache: __segmentConfig.fetchCache ?? null,
|
|
460
|
+
isEdgeRuntime: __isEdgeRuntime(__segmentConfig.runtime),
|
|
436
461
|
findIntercept(pathname) {
|
|
437
462
|
return findIntercept(pathname, interceptionContext);
|
|
438
463
|
},
|
|
@@ -467,6 +492,7 @@ export default __createAppRscHandler({
|
|
|
467
492
|
middlewareContext,
|
|
468
493
|
mountedSlotsHeader,
|
|
469
494
|
params,
|
|
495
|
+
staticParamsValidationParams,
|
|
470
496
|
rootParams,
|
|
471
497
|
probeLayoutAt(li) {
|
|
472
498
|
const LayoutComp = route.layouts[li]?.default;
|
|
@@ -488,10 +514,10 @@ export default __createAppRscHandler({
|
|
|
488
514
|
});
|
|
489
515
|
},
|
|
490
516
|
renderErrorBoundaryPage(renderErr) {
|
|
491
|
-
return __fallbackRenderer.renderErrorBoundary(route, renderErr, isRscRequest, request, params, scriptNonce, middlewareContext);
|
|
517
|
+
return __fallbackRenderer.renderErrorBoundary(route, renderErr, isRscRequest, request, params, scriptNonce, middlewareContext, { isEdgeRuntime: __isEdgeRuntime(__segmentConfig.runtime) });
|
|
492
518
|
},
|
|
493
519
|
renderHttpAccessFallbackPage(statusCode, opts, currentMiddlewareContext) {
|
|
494
|
-
return __fallbackRenderer.renderHttpAccessFallback(route, statusCode, isRscRequest, request, opts, scriptNonce, currentMiddlewareContext);
|
|
520
|
+
return __fallbackRenderer.renderHttpAccessFallback(route, statusCode, isRscRequest, request, opts, scriptNonce, currentMiddlewareContext, { isEdgeRuntime: __isEdgeRuntime(__segmentConfig.runtime) });
|
|
495
521
|
},
|
|
496
522
|
renderToReadableStream,
|
|
497
523
|
request,
|
|
@@ -529,6 +555,7 @@ export default __createAppRscHandler({
|
|
|
529
555
|
clearRequestContext() {
|
|
530
556
|
__clearRequestContext();
|
|
531
557
|
},
|
|
558
|
+
draftModeSecret: __draftModeSecret,
|
|
532
559
|
i18n: __i18nConfig,
|
|
533
560
|
isrDebug: __isrDebug,
|
|
534
561
|
isrGet: __isrGet,
|
|
@@ -589,10 +616,15 @@ export default __createAppRscHandler({
|
|
|
589
616
|
request,
|
|
590
617
|
searchParams,
|
|
591
618
|
}) {
|
|
619
|
+
const __actionMatch = matchRoute(cleanPathname);
|
|
620
|
+
const __actionIsEdgeRuntime = __actionMatch
|
|
621
|
+
? __isEdgeRuntime(__resolveAppPageSegmentConfig({ layouts: __actionMatch.route.layouts, page: __actionMatch.route.page }).runtime)
|
|
622
|
+
: false;
|
|
592
623
|
return __handleServerActionRscRequest({
|
|
593
624
|
actionId,
|
|
594
625
|
allowedOrigins: __allowedOrigins,
|
|
595
626
|
basePath: __basePath,
|
|
627
|
+
isEdgeRuntime: __actionIsEdgeRuntime,
|
|
596
628
|
buildPageElement({
|
|
597
629
|
route: actionRoute,
|
|
598
630
|
params: actionParams,
|
|
@@ -689,7 +721,8 @@ export default __createAppRscHandler({
|
|
|
689
721
|
middlewareModule: ${middlewarePath ? "middlewareModule" : "null"},
|
|
690
722
|
publicFiles: __publicFiles,
|
|
691
723
|
renderNotFound({ isRscRequest, matchedParams, middlewareContext, request, route, scriptNonce }) {
|
|
692
|
-
|
|
724
|
+
const __isEdge = route ? __isEdgeRuntime(__resolveAppPageSegmentConfig({ layouts: route.layouts, page: route.page }).runtime) : false;
|
|
725
|
+
return __fallbackRenderer.renderNotFound(route, isRscRequest, request, matchedParams, scriptNonce, middlewareContext, { isEdgeRuntime: __isEdge });
|
|
693
726
|
},
|
|
694
727
|
${hasPagesDir ? `async renderPagesFallback({ isRscRequest, middlewareContext, request, url }) {
|
|
695
728
|
if (isRscRequest) return null;
|
|
@@ -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 { 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 /**\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};\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 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 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 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\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 });\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)};\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 dispatchMatchedPage({\n cleanPathname,\n formState,\n actionError,\n actionFailed,\n handlerStart,\n interceptionContext,\n isProgressiveActionRender,\n isRscRequest,\n middlewareContext,\n mountedSlotsHeader,\n params,\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 dynamicConfig: __segmentConfig.dynamicConfig,\n dynamicParamsConfig: __segmentConfig.dynamicParamsConfig,\n fetchCache: __segmentConfig.fetchCache ?? null,\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 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);\n },\n renderHttpAccessFallbackPage(statusCode, opts, currentMiddlewareContext) {\n return __fallbackRenderer.renderHttpAccessFallback(route, statusCode, isRscRequest, request, opts, scriptNonce, currentMiddlewareContext);\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 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 return __handleServerActionRscRequest({\n actionId,\n allowedOrigins: __allowedOrigins,\n basePath: __basePath,\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 return __fallbackRenderer.renderNotFound(route, isRscRequest, request, matchedParams, scriptNonce, middlewareContext);\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":";;;;;;;;;;;;;;AAsBA,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,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sBAAsB,OAAO;;;;;;0BAMvD,KAAK,UAAU,GAAG,CAAC;uBACtB,KAAK,UAAU,WAAW,CAAC;4BACtB,KAAK,UAAU,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;;;;+BAInB,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoL9B,sBACI;;QAGA,GACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAoIoB,KAAK,UAAU,iBAAiB,YAAY,eAAe,GAAG,MAAM,CAAC;IACxF,cAAc,0DAA0D,GAAG;;;;sBAIzD,iBAAiB,qBAAqB,OAAO;;;;;IAM/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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B,KAAK,UAAU,cAAc,CAAC;;;;;;EAM3D,4BAA4B,KAAK,KAAK,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
|
-
|
|
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 "
|
|
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
|
|
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
|
-
|
|
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,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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,UA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C,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
|
|
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
|