vinext 1.2.1 → 1.3.1
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 +12 -9
- package/dist/_virtual/_rolldown/runtime.js +1 -1
- package/dist/build/action-owner-manifest.d.ts +3 -2
- package/dist/build/action-owner-manifest.js +18 -2
- package/dist/build/app-page-static-eligibility.d.ts +17 -1
- package/dist/build/app-page-static-eligibility.js +80 -13
- package/dist/build/clean-output.d.ts +2 -1
- package/dist/build/client-build-config.d.ts +77 -6
- package/dist/build/client-build-config.js +176 -12
- package/dist/build/client-reference-async.d.ts +48 -0
- package/dist/build/client-reference-async.js +123 -0
- package/dist/build/client-reference-chunks.d.ts +32 -0
- package/dist/build/client-reference-chunks.js +111 -0
- package/dist/build/client-reference-groups.d.ts +171 -0
- package/dist/build/client-reference-groups.js +572 -0
- package/dist/build/css-url-assets.d.ts +2 -1
- package/dist/build/google-fonts/fallback-metrics.d.ts +2 -1
- package/dist/build/google-fonts/find-font-files-in-css.d.ts +1 -0
- package/dist/build/google-fonts/find-font-files-in-css.js +17 -4
- package/dist/build/google-fonts/font-metadata.d.ts +2 -1
- package/dist/build/google-fonts/validate.d.ts +2 -1
- package/dist/build/inline-css.d.ts +2 -1
- package/dist/build/layout-classification.d.ts +2 -1
- package/dist/build/module-dependency-cache.d.ts +33 -1
- package/dist/build/module-dependency-cache.js +51 -1
- package/dist/build/next-client-runtime-manifests.d.ts +12 -2
- package/dist/build/next-client-runtime-manifests.js +19 -4
- package/dist/build/nitro-public-files.d.ts +24 -0
- package/dist/build/nitro-public-files.js +60 -0
- package/dist/build/pages-client-assets-module.js +1 -1
- package/dist/build/precompress.d.ts +2 -1
- package/dist/build/precompress.js +1 -1
- package/dist/build/prerender-paths.d.ts +2 -1
- package/dist/build/prerender-paths.js +5 -2
- package/dist/build/prerender-phase.d.ts +2 -1
- package/dist/build/prerender-server-pool.js +1 -1
- package/dist/build/prerender.d.ts +3 -2
- package/dist/build/prerender.js +5 -4
- package/dist/build/report.d.ts +2 -1
- package/dist/build/route-classification-injector.d.ts +2 -1
- package/dist/build/route-classification-manifest.d.ts +2 -1
- package/dist/build/run-prerender.d.ts +2 -1
- package/dist/build/server-actions-encryption-key.d.ts +24 -0
- package/dist/build/server-actions-encryption-key.js +101 -0
- package/dist/build/ssr-manifest.d.ts +3 -0
- package/dist/build/ssr-manifest.js +34 -2
- package/dist/build/standalone.d.ts +2 -1
- package/dist/cache/cache-adapters-virtual.d.ts +2 -1
- package/dist/cache.js +1 -2
- package/dist/check.d.ts +2 -1
- package/dist/check.js +4 -0
- package/dist/cli-args.d.ts +2 -1
- package/dist/cli.js +2 -0
- package/dist/client/client-redirect-matcher.js +2 -1
- package/dist/client/client-redirects.d.ts +4 -3
- package/dist/client/client-redirects.js +2 -1
- package/dist/client/client-rewrite-params.d.ts +9 -0
- package/dist/client/client-rewrite-params.js +20 -0
- package/dist/client/client-rewrites.d.ts +2 -1
- package/dist/client/dev-error-overlay-store.d.ts +2 -1
- package/dist/client/dev-error-overlay.js +2 -1
- package/dist/client/index.js +1 -2
- package/dist/client/instrumentation-client-state.js +5 -5
- package/dist/client/navigation-runtime.d.ts +28 -3
- package/dist/client/navigation-runtime.js +42 -11
- package/dist/client/pages-router-link-navigation.d.ts +2 -1
- package/dist/client/vinext-next-data.d.ts +25 -2
- package/dist/client/window-next.d.ts +2 -1
- package/dist/config/config-matchers.d.ts +27 -41
- package/dist/config/config-matchers.js +293 -270
- package/dist/config/config-source.d.ts +34 -0
- package/dist/config/config-source.js +141 -0
- package/dist/config/dotenv.d.ts +2 -1
- package/dist/config/header-params.d.ts +29 -0
- package/dist/config/header-params.js +106 -0
- package/dist/config/next-config.d.ts +20 -6
- package/dist/config/next-config.js +149 -11
- package/dist/config/tsconfig-paths.d.ts +2 -1
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/detector.js +23 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/index.js +2 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/lookup.js +25 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/bmp.js +11 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/cur.js +15 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/dds.js +11 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/gif.js +12 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/heif.js +55 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/icns.js +76 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/ico.js +39 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/index.js +46 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/j2c.js +11 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jp2.js +21 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jpg.js +71 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jxl-stream.js +42 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jxl.js +46 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/ktx.js +19 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/png.js +28 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/pnm.js +54 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/psd.js +11 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/svg.js +79 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/tga.js +15 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/tiff.js +96 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/utils.js +53 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/webp.js +45 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/utils/bit-reader.js +38 -0
- package/dist/deps/.pnpm/ua-parser-js@1.0.35/deps/ua-parser-js/src/ua-parser.js +2 -2
- package/dist/entries/app-browser-entry.d.ts +34 -6
- package/dist/entries/app-browser-entry.js +103 -40
- package/dist/entries/app-rsc-entry.d.ts +4 -1
- package/dist/entries/app-rsc-entry.js +131 -66
- package/dist/entries/app-rsc-manifest.d.ts +12 -1
- package/dist/entries/app-rsc-manifest.js +73 -1
- package/dist/entries/app-ssr-entry.d.ts +4 -1
- package/dist/entries/app-ssr-entry.js +9 -2
- package/dist/entries/pages-client-entry.d.ts +1 -0
- package/dist/entries/pages-client-entry.js +6 -6
- package/dist/entries/pages-entry-helpers.js +1 -2
- package/dist/entries/pages-server-entry.d.ts +2 -1
- package/dist/entries/pages-server-entry.js +18 -15
- package/dist/entries/runtime-entry-module.d.ts +1 -0
- package/dist/entries/runtime-entry-module.js +4 -1
- package/dist/image/image-adapters-virtual.d.ts +2 -1
- package/dist/index.d.ts +11 -0
- package/dist/index.js +340 -116
- package/dist/init.js +17 -0
- package/dist/plugins/client-compile-hints.d.ts +30 -0
- package/dist/plugins/client-compile-hints.js +88 -0
- package/dist/plugins/client-reference-dedup.d.ts +2 -1
- package/dist/plugins/cloudflare-dev-module-urls.d.ts +2 -1
- package/dist/plugins/dynamic-preload-metadata.d.ts +3 -1
- package/dist/plugins/dynamic-preload-metadata.js +1 -1
- package/dist/plugins/environment.d.ts +2 -1
- package/dist/plugins/fonts.js +9 -12
- package/dist/plugins/ignore-dynamic-requests.d.ts +2 -1
- package/dist/plugins/import-meta-url.d.ts +2 -1
- package/dist/plugins/og-assets.d.ts +2 -1
- package/dist/plugins/og-assets.js +2 -3
- package/dist/plugins/optimize-imports.d.ts +27 -3
- package/dist/plugins/optimize-imports.js +106 -20
- package/dist/plugins/pages-node-externals.d.ts +2 -1
- package/dist/plugins/remove-console.d.ts +2 -1
- package/dist/plugins/require-condition-resolution.d.ts +2 -1
- package/dist/plugins/rsc-client-reference-loaders.d.ts +53 -1
- package/dist/plugins/rsc-client-reference-loaders.js +447 -27
- package/dist/plugins/rsc-client-shim-excludes.js +2 -0
- package/dist/plugins/sass.d.ts +2 -1
- package/dist/plugins/strip-server-exports.d.ts +2 -1
- package/dist/plugins/styled-jsx.d.ts +2 -1
- package/dist/plugins/transform-result.d.ts +2 -1
- package/dist/plugins/typeof-window.d.ts +2 -1
- package/dist/plugins/use-cache-callable.d.ts +5 -0
- package/dist/plugins/use-cache-callable.js +30 -8
- package/dist/plugins/worker-image-imports.d.ts +1 -0
- package/dist/plugins/worker-image-imports.js +2 -2
- package/dist/plugins/worker-use-server.d.ts +2 -1
- package/dist/routing/app-route-graph.d.ts +41 -1
- package/dist/routing/app-route-graph.js +122 -50
- package/dist/routing/browser-route-manifest.d.ts +44 -0
- package/dist/routing/browser-route-manifest.js +195 -0
- package/dist/routing/hashed-route-patterns.d.ts +4 -0
- package/dist/routing/hashed-route-patterns.js +22 -0
- package/dist/routing/optimistic-route-trie.d.ts +28 -0
- package/dist/routing/optimistic-route-trie.js +102 -0
- package/dist/routing/route-matching.d.ts +2 -1
- package/dist/routing/route-pattern.d.ts +2 -1
- package/dist/routing/route-validation.d.ts +6 -1
- package/dist/routing/route-validation.js +26 -10
- package/dist/server/accept-encoding.d.ts +2 -1
- package/dist/server/app-action-forwarding.d.ts +10 -1
- package/dist/server/app-action-forwarding.js +15 -1
- package/dist/server/app-bfcache-identity.d.ts +2 -1
- package/dist/server/app-browser-action-result.d.ts +2 -1
- package/dist/server/app-browser-client-reuse-manifest.d.ts +2 -1
- package/dist/server/app-browser-entry.js +175 -64
- package/dist/server/app-browser-error.d.ts +5 -2
- package/dist/server/app-browser-error.js +7 -2
- package/dist/server/app-browser-history-controller.d.ts +2 -1
- package/dist/server/app-browser-hydration.d.ts +2 -1
- package/dist/server/app-browser-interception-context.d.ts +4 -3
- package/dist/server/app-browser-mpa-navigation.d.ts +1 -0
- package/dist/server/app-browser-mpa-navigation.js +6 -5
- package/dist/server/app-browser-navigation-controller.d.ts +17 -6
- package/dist/server/app-browser-navigation-controller.js +103 -36
- package/dist/server/app-browser-popstate.d.ts +2 -1
- package/dist/server/app-browser-rsc-redirect.d.ts +2 -1
- package/dist/server/app-browser-server-action-client.d.ts +2 -1
- package/dist/server/app-browser-state.d.ts +2 -2
- package/dist/server/app-browser-state.js +1 -1
- package/dist/server/app-browser-stream.d.ts +2 -1
- package/dist/server/app-browser-visible-commit.d.ts +6 -5
- package/dist/server/app-client-reference-manifest.d.ts +31 -0
- package/dist/server/app-client-reference-manifest.js +46 -0
- package/dist/server/app-client-reference-preloader.d.ts +45 -2
- package/dist/server/app-client-reference-preloader.js +48 -10
- package/dist/server/app-elements-wire.d.ts +2 -1
- package/dist/server/app-elements.d.ts +2 -0
- package/dist/server/app-elements.js +3 -1
- package/dist/server/app-fallback-renderer.d.ts +9 -2
- package/dist/server/app-fallback-renderer.js +6 -2
- package/dist/server/app-history-state.d.ts +2 -1
- package/dist/server/app-inline-css-client.d.ts +2 -1
- package/dist/server/app-layout-param-observation.d.ts +2 -1
- package/dist/server/app-metadata-tracing.d.ts +2 -1
- package/dist/server/app-middleware.d.ts +6 -0
- package/dist/server/app-middleware.js +8 -10
- package/dist/server/app-optimistic-routing.d.ts +26 -11
- package/dist/server/app-optimistic-routing.js +38 -96
- package/dist/server/app-page-boundary-render.d.ts +20 -2
- package/dist/server/app-page-boundary-render.js +229 -39
- package/dist/server/app-page-boundary.d.ts +34 -5
- package/dist/server/app-page-boundary.js +40 -7
- package/dist/server/app-page-cache-finalizer.d.ts +2 -1
- package/dist/server/app-page-cache-finalizer.js +1 -1
- package/dist/server/app-page-cache-render.d.ts +10 -2
- package/dist/server/app-page-cache-render.js +15 -2
- package/dist/server/app-page-cache.js +2 -2
- package/dist/server/app-page-dispatch.d.ts +34 -1
- package/dist/server/app-page-dispatch.js +165 -34
- package/dist/server/app-page-element-builder.d.ts +17 -1
- package/dist/server/app-page-element-builder.js +187 -66
- package/dist/server/app-page-execution.d.ts +28 -1
- package/dist/server/app-page-execution.js +114 -5
- package/dist/server/app-page-head.d.ts +95 -3
- package/dist/server/app-page-head.js +307 -152
- package/dist/server/app-page-http-access-fallback-metadata.d.ts +48 -2
- package/dist/server/app-page-http-access-fallback-metadata.js +76 -1
- package/dist/server/app-page-method.d.ts +2 -1
- package/dist/server/app-page-probe.d.ts +2 -1
- package/dist/server/app-page-render-identity.d.ts +2 -1
- package/dist/server/app-page-render.d.ts +7 -1
- package/dist/server/app-page-render.js +38 -11
- package/dist/server/app-page-request.d.ts +14 -1
- package/dist/server/app-page-request.js +1 -1
- package/dist/server/app-page-route-wiring.d.ts +52 -2
- package/dist/server/app-page-route-wiring.js +197 -47
- package/dist/server/app-page-rsc-render-status.d.ts +3 -1
- package/dist/server/app-page-rsc-render-status.js +1 -0
- package/dist/server/app-page-search-params-observation.d.ts +8 -6
- package/dist/server/app-page-search-params-observation.js +16 -11
- package/dist/server/app-page-segment-plan.d.ts +2 -1
- package/dist/server/app-page-stream.d.ts +38 -1
- package/dist/server/app-page-stream.js +24 -4
- package/dist/server/app-pages-bridge.d.ts +4 -2
- package/dist/server/app-pages-bridge.js +11 -7
- package/dist/server/app-ppr-fallback-shell-render.d.ts +2 -1
- package/dist/server/app-ppr-fallback-shell.d.ts +2 -1
- package/dist/server/app-prerender-endpoints.d.ts +2 -1
- package/dist/server/app-prerender-static-params.d.ts +2 -1
- package/dist/server/app-prerender-static-params.js +3 -2
- package/dist/server/app-render-dependency.d.ts +11 -1
- package/dist/server/app-render-dependency.js +65 -6
- package/dist/server/app-request-stage-independent-entry.d.ts +2 -1
- package/dist/server/app-request-stage-independent-entry.js +2 -2
- package/dist/server/app-response-stage-entry.d.ts +2 -1
- package/dist/server/app-response-stage-entry.js +3 -3
- package/dist/server/app-route-handler-cache.d.ts +2 -1
- package/dist/server/app-route-handler-dispatch.d.ts +2 -1
- package/dist/server/app-route-handler-dispatch.js +4 -2
- package/dist/server/app-route-handler-execution.d.ts +4 -1
- package/dist/server/app-route-handler-execution.js +9 -2
- package/dist/server/app-route-handler-middleware-context.d.ts +2 -1
- package/dist/server/app-route-handler-middleware-context.js +3 -3
- package/dist/server/app-route-handler-response.d.ts +4 -2
- package/dist/server/app-route-handler-response.js +2 -2
- package/dist/server/app-route-handler-runtime.d.ts +4 -1
- package/dist/server/app-route-handler-runtime.js +20 -3
- package/dist/server/app-route-module-loader.d.ts +18 -1
- package/dist/server/app-route-module-loader.js +15 -6
- package/dist/server/app-route-tree-prefetch.d.ts +2 -1
- package/dist/server/app-route-tree.d.ts +20 -0
- package/dist/server/app-route-tree.js +18 -0
- package/dist/server/app-router-entry.js +2 -2
- package/dist/server/app-rsc-combined-handler.js +8 -1
- package/dist/server/app-rsc-error-handler.d.ts +2 -1
- package/dist/server/app-rsc-errors.d.ts +9 -1
- package/dist/server/app-rsc-errors.js +9 -2
- package/dist/server/app-rsc-handler.d.ts +6 -2
- package/dist/server/app-rsc-handler.js +152 -140
- package/dist/server/app-rsc-response-finalizer.d.ts +7 -1
- package/dist/server/app-rsc-response-finalizer.js +4 -1
- package/dist/server/app-rsc-response-stage.js +3 -1
- package/dist/server/app-rsc-route-matching.d.ts +39 -1
- package/dist/server/app-rsc-route-matching.js +25 -1
- package/dist/server/app-segment-config.d.ts +2 -1
- package/dist/server/app-segment-config.js +1 -14
- package/dist/server/app-server-action-execution.d.ts +25 -7
- package/dist/server/app-server-action-execution.js +53 -59
- package/dist/server/app-ssr-entry.d.ts +12 -0
- package/dist/server/app-ssr-entry.js +104 -48
- package/dist/server/app-ssr-error-meta.d.ts +2 -1
- package/dist/server/app-ssr-search-params-gate.d.ts +2 -1
- package/dist/server/app-ssr-stream.d.ts +29 -10
- package/dist/server/app-ssr-stream.js +311 -67
- package/dist/server/app-static-generation.d.ts +2 -1
- package/dist/server/app-streamed-client-references.d.ts +39 -0
- package/dist/server/app-streamed-client-references.js +156 -0
- package/dist/server/app-visited-response-cache.d.ts +2 -1
- package/dist/server/app-worker-stages.d.ts +2 -1
- package/dist/server/artifact-compatibility.d.ts +2 -1
- package/dist/server/bfcache-identity.d.ts +2 -1
- package/dist/server/cache-headers.d.ts +2 -1
- package/dist/server/cacheability-request.d.ts +2 -1
- package/dist/server/client-reuse-manifest.d.ts +2 -1
- package/dist/server/config-headers.d.ts +2 -1
- package/dist/server/config-headers.js +12 -3
- package/dist/server/csp.d.ts +2 -1
- package/dist/server/default-global-not-found-module.d.ts +2 -1
- package/dist/server/default-http-access-fallback-modules.d.ts +33 -0
- package/dist/server/default-http-access-fallback-modules.js +31 -0
- package/dist/server/defer-until-stream-consumed.d.ts +34 -0
- package/dist/server/defer-until-stream-consumed.js +154 -21
- package/dist/server/dev-lockfile.d.ts +32 -2
- package/dist/server/dev-lockfile.js +46 -2
- package/dist/server/dev-module-runner.d.ts +2 -1
- package/dist/server/dev-server.js +10 -3
- package/dist/server/fetch-handler.js +1 -2
- package/dist/server/file-based-metadata.d.ts +2 -1
- package/dist/server/framework-tracer.d.ts +2 -1
- package/dist/server/html.d.ts +1 -0
- package/dist/server/html.js +19 -1
- package/dist/server/http-conditional.d.ts +2 -1
- package/dist/server/http-error-responses.d.ts +2 -1
- package/dist/server/implicit-tags.d.ts +2 -1
- package/dist/server/isolate-shared-promise.d.ts +10 -0
- package/dist/server/isolate-shared-promise.js +33 -0
- package/dist/server/isr-cache.js +3 -2
- package/dist/server/metadata-route-build-data.d.ts +2 -1
- package/dist/server/metadata-route-build-data.js +1 -1
- package/dist/server/metadata-route-response.d.ts +2 -1
- package/dist/server/metadata-route-response.js +1 -1
- package/dist/server/metadata-routes.d.ts +2 -1
- package/dist/server/middleware-matcher-pattern.d.ts +0 -1
- package/dist/server/middleware-matcher-pattern.js +11 -140
- package/dist/server/middleware-matcher.js +5 -6
- package/dist/server/middleware-response-headers.d.ts +31 -0
- package/dist/server/middleware-response-headers.js +57 -1
- package/dist/server/middleware-runtime.d.ts +2 -1
- package/dist/server/middleware-runtime.js +26 -13
- package/dist/server/navigation-planner.d.ts +2 -2
- package/dist/server/navigation-trace.d.ts +2 -1
- package/dist/server/next-error-digest.d.ts +2 -1
- package/dist/server/nitro-public-files-plugin.d.ts +39 -0
- package/dist/server/nitro-public-files-plugin.js +106 -0
- package/dist/server/nitro-public-files.d.ts +22 -0
- package/dist/server/nitro-public-files.js +39 -0
- package/dist/server/opentelemetry-api.d.ts +2 -1
- package/dist/server/operation-token.d.ts +2 -1
- package/dist/server/pages-api-route.d.ts +2 -1
- package/dist/server/pages-asset-tags.d.ts +7 -1
- package/dist/server/pages-asset-tags.js +9 -2
- package/dist/server/pages-body-parser-config.d.ts +2 -1
- package/dist/server/pages-client-assets.d.ts +8 -1
- package/dist/server/pages-data-route.d.ts +2 -1
- package/dist/server/pages-document-asset-props.d.ts +2 -1
- package/dist/server/pages-document-initial-props.d.ts +2 -1
- package/dist/server/pages-execution-tracing.d.ts +2 -1
- package/dist/server/pages-execution-tracing.js +1 -1
- package/dist/server/pages-get-initial-props.d.ts +2 -1
- package/dist/server/pages-i18n.d.ts +18 -0
- package/dist/server/pages-i18n.js +18 -2
- package/dist/server/pages-node-compat.d.ts +5 -3
- package/dist/server/pages-node-compat.js +35 -16
- package/dist/server/pages-page-data.d.ts +7 -1
- package/dist/server/pages-page-data.js +35 -12
- package/dist/server/pages-page-handler.d.ts +3 -2
- package/dist/server/pages-page-handler.js +16 -7
- package/dist/server/pages-page-method.d.ts +2 -1
- package/dist/server/pages-page-response.d.ts +2 -1
- package/dist/server/pages-preview.d.ts +2 -1
- package/dist/server/pages-readiness.d.ts +2 -1
- package/dist/server/pages-request-pipeline.d.ts +8 -2
- package/dist/server/pages-request-pipeline.js +35 -40
- package/dist/server/pages-request-stage-entry.d.ts +2 -1
- package/dist/server/pages-request-stage-entry.js +16 -6
- package/dist/server/pages-response-stage-entry.d.ts +2 -1
- package/dist/server/pages-response-stage-entry.js +1 -1
- package/dist/server/pages-revalidate.js +1 -0
- package/dist/server/pages-route-data-kind.d.ts +2 -1
- package/dist/server/pages-router-entry.js +1 -1
- package/dist/server/prerender-cache-life-header.d.ts +2 -1
- package/dist/server/prerender-route-params.d.ts +2 -1
- package/dist/server/prod-server.d.ts +2 -2
- package/dist/server/prod-server.js +80 -36
- package/dist/server/proxy-trust.d.ts +6 -0
- package/dist/server/proxy-trust.js +12 -6
- package/dist/server/request-log.d.ts +2 -1
- package/dist/server/request-pipeline.d.ts +5 -0
- package/dist/server/request-pipeline.js +12 -1
- package/dist/server/request-tracing.d.ts +2 -1
- package/dist/server/request-tracing.js +1 -1
- package/dist/server/response-start-tracing.js +7 -29
- package/dist/server/rsc-render-stream.d.ts +4 -0
- package/dist/server/rsc-render-stream.js +25 -0
- package/dist/server/seed-cache.d.ts +2 -1
- package/dist/server/seed-cache.js +1 -1
- package/dist/server/server-reference-loader.js +10 -1
- package/dist/server/static-file-cache.d.ts +2 -1
- package/dist/server/static-file-cache.js +16 -3
- package/dist/server/static-layout-client-reuse-proof.d.ts +2 -1
- package/dist/server/worker-revalidation-context.d.ts +2 -1
- package/dist/server/worker-stages.d.ts +2 -1
- package/dist/server/worker-utils.js +1 -1
- package/dist/shims/app.d.ts +2 -1
- package/dist/shims/cache-callable-runtime.d.ts +2 -1
- package/dist/shims/cache-handler.d.ts +8 -3
- package/dist/shims/cache-handler.js +32 -11
- package/dist/shims/cache-request-state.d.ts +40 -3
- package/dist/shims/cache-request-state.js +70 -5
- package/dist/shims/cache-runtime.js +47 -19
- package/dist/shims/cache.d.ts +2 -2
- package/dist/shims/cache.js +17 -8
- package/dist/shims/caught-not-found-boundaries.d.ts +15 -0
- package/dist/shims/caught-not-found-boundaries.js +48 -0
- package/dist/shims/cdn-purge-routes.d.ts +25 -0
- package/dist/shims/cdn-purge-routes.js +77 -0
- package/dist/shims/client-locale.js +2 -1
- package/dist/shims/client-page-root.d.ts +2 -1
- package/dist/shims/config.d.ts +2 -1
- package/dist/shims/default-forbidden.d.ts +4 -0
- package/dist/shims/default-forbidden.js +18 -0
- package/dist/shims/default-not-found.d.ts +0 -5
- package/dist/shims/default-not-found.js +5 -41
- package/dist/shims/default-unauthorized.d.ts +4 -0
- package/dist/shims/default-unauthorized.js +18 -0
- package/dist/shims/dynamic.js +17 -4
- package/dist/shims/error-boundary.d.ts +39 -3
- package/dist/shims/error-boundary.js +31 -16
- package/dist/shims/font-google.js +1 -2
- package/dist/shims/font-utils.d.ts +3 -2
- package/dist/shims/font-utils.js +5 -3
- package/dist/shims/form.js +9 -4
- package/dist/shims/http-access-error-fallback.d.ts +7 -0
- package/dist/shims/http-access-error-fallback.js +47 -0
- package/dist/shims/image-props.d.ts +93 -0
- package/dist/shims/image-props.js +323 -0
- package/dist/shims/image.d.ts +4 -39
- package/dist/shims/image.js +4 -319
- package/dist/shims/internal/app-prefetch-fetch-queue.d.ts +22 -2
- package/dist/shims/internal/app-prefetch-fetch-queue.js +71 -18
- package/dist/shims/internal/app-route-prefetch-policy.d.ts +14 -3
- package/dist/shims/internal/app-route-prefetch-policy.js +29 -4
- package/dist/shims/internal/cache-context-accessor.d.ts +2 -1
- package/dist/shims/internal/client-reference-loader.d.ts +7 -0
- package/dist/shims/internal/client-reference-loader.js +91 -0
- package/dist/shims/internal/cookie-serialize.d.ts +2 -1
- package/dist/shims/internal/cookies.js +1 -2
- package/dist/shims/internal/headers-state.d.ts +9 -0
- package/dist/shims/internal/headers-state.js +19 -2
- package/dist/shims/internal/hybrid-client-route-owner-direct.d.ts +6 -2
- package/dist/shims/internal/hybrid-client-route-owner-direct.js +31 -14
- package/dist/shims/internal/hybrid-client-route-owner.js +8 -8
- package/dist/shims/internal/interpolate-as.d.ts +2 -1
- package/dist/shims/internal/pages-data-target.d.ts +2 -1
- package/dist/shims/internal/pages-data-url.d.ts +2 -1
- package/dist/shims/internal/thenable-well-known-properties.d.ts +2 -1
- package/dist/shims/link.js +198 -53
- package/dist/shims/metadata.d.ts +32 -11
- package/dist/shims/metadata.js +88 -26
- package/dist/shims/navigation-errors.d.ts +2 -1
- package/dist/shims/navigation.d.ts +23 -3
- package/dist/shims/navigation.js +91 -25
- package/dist/shims/og.js +35 -10
- package/dist/shims/pages-router-runtime.d.ts +2 -1
- package/dist/shims/ppr-fallback-shell.d.ts +2 -1
- package/dist/shims/request-context.d.ts +13 -0
- package/dist/shims/router.js +33 -43
- package/dist/shims/server.d.ts +31 -4
- package/dist/shims/server.js +58 -10
- package/dist/shims/thenable-params.d.ts +6 -1
- package/dist/shims/thenable-params.js +11 -2
- package/dist/shims/unified-request-context.d.ts +5 -0
- package/dist/shims/unified-request-context.js +5 -3
- package/dist/typegen.d.ts +2 -1
- package/dist/utils/asset-prefix.d.ts +7 -0
- package/dist/utils/asset-prefix.js +10 -1
- package/dist/utils/client-build-manifest.d.ts +4 -1
- package/dist/utils/client-build-manifest.js +20 -6
- package/dist/utils/client-entry-manifest.d.ts +13 -0
- package/dist/utils/client-entry-manifest.js +20 -1
- package/dist/utils/client-reference-chunks.d.ts +45 -0
- package/dist/utils/client-reference-chunks.js +30 -0
- package/dist/utils/client-runtime-metadata.d.ts +10 -1
- package/dist/utils/client-runtime-metadata.js +53 -9
- package/dist/utils/compare.d.ts +9 -0
- package/dist/utils/compare.js +15 -1
- package/dist/utils/lazy-chunks.d.ts +18 -0
- package/dist/utils/lazy-chunks.js +27 -1
- package/dist/utils/manifest-paths.d.ts +14 -0
- package/dist/utils/manifest-paths.js +22 -1
- package/dist/utils/middleware-request-headers.d.ts +2 -1
- package/dist/utils/path-to-regexp.d.ts +21 -0
- package/dist/{server/middleware-path-to-regexp.js → utils/path-to-regexp.js} +14 -11
- package/dist/utils/plugin-react-version.d.ts +15 -0
- package/dist/utils/plugin-react-version.js +64 -0
- package/dist/utils/project.d.ts +2 -1
- package/dist/utils/project.js +9 -1
- package/dist/utils/public-routes.d.ts +2 -0
- package/dist/utils/public-routes.js +18 -7
- package/dist/utils/query.d.ts +2 -1
- package/dist/utils/sorted-array.d.ts +2 -1
- package/dist/utils/vite-cli-invocation.d.ts +2 -1
- package/package.json +5 -5
- package/dist/deps/.pnpm/image-size@2.0.2/deps/image-size/dist/index.js +0 -808
- package/dist/server/default-not-found-module.d.ts +0 -19
- package/dist/server/default-not-found-module.js +0 -18
- package/dist/server/middleware-path-to-regexp.d.ts +0 -13
- package/dist/server/rsc-stream-hints.d.ts +0 -21
- package/dist/server/rsc-stream-hints.js +0 -227
- package/dist/utils/regex-safety.d.ts +0 -17
- package/dist/utils/regex-safety.js +0 -789
|
@@ -6,8 +6,8 @@ import { extractExportConstString, getAppRouteRenderEntryPath } from "../build/r
|
|
|
6
6
|
import { routePatternParts } from "../routing/route-pattern.js";
|
|
7
7
|
import { safeJsonStringify } from "../server/html.js";
|
|
8
8
|
import { DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES } from "../server/image-optimization.js";
|
|
9
|
-
import { buildAppRscManifestCode } from "./app-rsc-manifest.js";
|
|
10
9
|
import { classifyAppPageRouteStaticEligibility } from "../build/app-page-static-eligibility.js";
|
|
10
|
+
import { buildAppRscManifestCode } from "./app-rsc-manifest.js";
|
|
11
11
|
import { generateDevOriginCheckCode } from "../server/dev-origin-check.js";
|
|
12
12
|
import { ACTION_OWNER_MANIFEST_ID } from "../plugins/action-owner-manifest.js";
|
|
13
13
|
import fs from "node:fs";
|
|
@@ -46,11 +46,13 @@ const appPageRequestPath = resolveEntryPath("../server/app-page-request.js", imp
|
|
|
46
46
|
const appSegmentConfigPath = resolveEntryPath("../server/app-segment-config.js", import.meta.url);
|
|
47
47
|
const appRscRouteMatchingPath = resolveEntryPath("../server/app-rsc-route-matching.js", import.meta.url);
|
|
48
48
|
const appRscResponseStagePath = resolveEntryPath("../server/app-rsc-response-stage.js", import.meta.url);
|
|
49
|
-
const
|
|
49
|
+
const rscRenderStreamPath = resolveEntryPath("../server/rsc-render-stream.js", import.meta.url);
|
|
50
|
+
const appClientReferenceManifestPath = resolveEntryPath("../server/app-client-reference-manifest.js", import.meta.url);
|
|
50
51
|
const isrCachePath = resolveEntryPath("../server/isr-cache.js", import.meta.url);
|
|
51
52
|
const thenableParamsShimPath = resolveEntryPath("../shims/thenable-params.js", import.meta.url);
|
|
52
53
|
const appPageElementBuilderPath = resolveEntryPath("../server/app-page-element-builder.js", import.meta.url);
|
|
53
54
|
const instrumentationRuntimePath = resolveEntryPath("../server/instrumentation-runtime.js", import.meta.url);
|
|
55
|
+
const isolateSharedPromisePath = resolveEntryPath("../server/isolate-shared-promise.js", import.meta.url);
|
|
54
56
|
const appRscErrorHandlerPath = resolveEntryPath("../server/app-rsc-error-handler.js", import.meta.url);
|
|
55
57
|
const appRequestContextPath = resolveEntryPath("../server/app-request-context.js", import.meta.url);
|
|
56
58
|
const appRequestStageContextPath = resolveEntryPath("../server/app-request-stage-context.js", import.meta.url);
|
|
@@ -116,19 +118,22 @@ function buildAppDecodedPathnamePatterns(routes, config) {
|
|
|
116
118
|
};
|
|
117
119
|
return routes.filter((route) => !route.isDynamic && !route.routePath && getAppRouteRenderEntryPath(route) !== null && isPrerenderedPage(route)).map((route) => route.pattern);
|
|
118
120
|
}
|
|
119
|
-
function
|
|
121
|
+
function createForcesDynamicReader() {
|
|
120
122
|
const readSource = createSegmentSourceReader();
|
|
121
|
-
|
|
123
|
+
return (filePath) => {
|
|
122
124
|
const source = readSource(filePath);
|
|
123
125
|
return source !== null && extractExportConstString(source, "dynamic") === "force-dynamic";
|
|
124
126
|
};
|
|
127
|
+
}
|
|
128
|
+
/** Whether a direct request to the route renders a `dynamic = "force-dynamic"` tree. */
|
|
129
|
+
function directRequestForcesDynamic(route, forcesDynamic) {
|
|
130
|
+
return route.routePath ? forcesDynamic(route.routePath) : appPageSegmentConfigPaths(route).some(forcesDynamic);
|
|
131
|
+
}
|
|
132
|
+
function buildAppRequestRouteMetadata(routes) {
|
|
133
|
+
const forcesDynamic = createForcesDynamicReader();
|
|
125
134
|
return routes.map((route) => ({
|
|
126
135
|
canUseCanonicalLoadingShell: appRouteHasMainTreeLoadingBoundary(route),
|
|
127
|
-
forceDynamic: route.
|
|
128
|
-
...appPageSegmentConfigPaths(route),
|
|
129
|
-
...route.parallelSlots.flatMap((slot) => slot.interceptingRoutes.flatMap((intercept) => [...intercept.layoutPaths, intercept.pagePath])),
|
|
130
|
-
...route.siblingIntercepts.flatMap((intercept) => [...intercept.layoutPaths, intercept.pagePath])
|
|
131
|
-
].some(forcesDynamic),
|
|
136
|
+
forceDynamic: directRequestForcesDynamic(route, forcesDynamic) || [...route.parallelSlots.flatMap((slot) => slot.interceptingRoutes.flatMap((intercept) => [...intercept.layoutPaths, intercept.pagePath])), ...route.siblingIntercepts.flatMap((intercept) => [...intercept.layoutPaths, intercept.pagePath])].some(forcesDynamic),
|
|
132
137
|
ids: route.ids ?? null,
|
|
133
138
|
pattern: route.pattern,
|
|
134
139
|
patternParts: route.patternParts,
|
|
@@ -153,10 +158,18 @@ function buildAppRequestRouteMetadata(routes) {
|
|
|
153
158
|
interceptBranchSegments: intercept.branchSegments ?? [],
|
|
154
159
|
interceptLoadings: [],
|
|
155
160
|
interceptLoadingTreePositions: intercept.loadingTreePositions ?? [],
|
|
161
|
+
interceptNotFounds: [],
|
|
162
|
+
interceptNotFoundTreePositions: intercept.notFoundTreePositions ?? [],
|
|
156
163
|
interceptNotFoundBranchSegments: intercept.notFoundBranchSegments ?? intercept.branchSegments ?? [],
|
|
157
164
|
page: null,
|
|
158
165
|
notFound: null,
|
|
159
166
|
notFoundTreePosition: intercept.notFoundTreePosition ?? null,
|
|
167
|
+
interceptForbiddens: [],
|
|
168
|
+
interceptForbiddenTreePositions: intercept.forbiddenTreePositions ?? [],
|
|
169
|
+
interceptUnauthorizeds: [],
|
|
170
|
+
interceptUnauthorizedTreePositions: intercept.unauthorizedTreePositions ?? [],
|
|
171
|
+
interceptErrors: [],
|
|
172
|
+
interceptErrorTreePositions: intercept.errorTreePositions ?? [],
|
|
160
173
|
params: intercept.params
|
|
161
174
|
}))
|
|
162
175
|
}])),
|
|
@@ -171,14 +184,45 @@ function buildAppRequestRouteMetadata(routes) {
|
|
|
171
184
|
interceptBranchSegments: intercept.branchSegments ?? [],
|
|
172
185
|
interceptLoadings: [],
|
|
173
186
|
interceptLoadingTreePositions: intercept.loadingTreePositions ?? [],
|
|
187
|
+
interceptNotFounds: [],
|
|
188
|
+
interceptNotFoundTreePositions: intercept.notFoundTreePositions ?? [],
|
|
174
189
|
interceptNotFoundBranchSegments: intercept.notFoundBranchSegments ?? intercept.branchSegments ?? [],
|
|
175
190
|
page: null,
|
|
176
191
|
notFound: null,
|
|
177
192
|
notFoundTreePosition: intercept.notFoundTreePosition ?? null,
|
|
193
|
+
interceptForbiddens: [],
|
|
194
|
+
interceptForbiddenTreePositions: intercept.forbiddenTreePositions ?? [],
|
|
195
|
+
interceptUnauthorizeds: [],
|
|
196
|
+
interceptUnauthorizedTreePositions: intercept.unauthorizedTreePositions ?? [],
|
|
197
|
+
interceptErrors: [],
|
|
198
|
+
interceptErrorTreePositions: intercept.errorTreePositions ?? [],
|
|
178
199
|
params: intercept.params
|
|
179
200
|
}))
|
|
180
201
|
}));
|
|
181
202
|
}
|
|
203
|
+
/**
|
|
204
|
+
* Register the build-time route facts `revalidatePath()` uses to skip CDN
|
|
205
|
+
* purges for force-dynamic routes. A Pages Router can serve the same paths
|
|
206
|
+
* without those facts, so mixed apps always purge.
|
|
207
|
+
*/
|
|
208
|
+
function generateCdnPurgeRoutesRegistration(routes, metadataRoutes, config) {
|
|
209
|
+
if (config?.hasPagesDir) return "";
|
|
210
|
+
const forcesDynamic = createForcesDynamicReader();
|
|
211
|
+
const purgeRoutes = {
|
|
212
|
+
metadataRoutes: (metadataRoutes ?? []).map((route) => ({
|
|
213
|
+
patternParts: route.patternParts ?? null,
|
|
214
|
+
routeSegments: route.routeSegments ?? [],
|
|
215
|
+
servedUrl: route.servedUrl
|
|
216
|
+
})),
|
|
217
|
+
routes: routes.map((route) => ({
|
|
218
|
+
forceDynamic: directRequestForcesDynamic(route, forcesDynamic),
|
|
219
|
+
patternParts: route.patternParts,
|
|
220
|
+
routeSegments: route.routeSegments
|
|
221
|
+
}))
|
|
222
|
+
};
|
|
223
|
+
return `import { registerCdnPurgeRoutes as __registerCdnPurgeRoutes } from "vinext/shims/cdn-purge-routes";
|
|
224
|
+
__registerCdnPurgeRoutes(${JSON.stringify(purgeRoutes)});`;
|
|
225
|
+
}
|
|
182
226
|
/** Generate the module-free App request stage used by multi-stage Worker outputs. */
|
|
183
227
|
function generateAppRequestRscEntry(appDir, routes, middlewarePath, metadataRoutes, _globalErrorPath, basePath, trailingSlash, config, instrumentationPath) {
|
|
184
228
|
const bp = basePath ?? "";
|
|
@@ -204,13 +248,14 @@ import __pagesClientAssets from "virtual:vinext-pages-client-assets";
|
|
|
204
248
|
${middlewarePath ? `import { applyAppMiddleware as __applyAppMiddleware } from ${JSON.stringify(appMiddlewarePath)};` : ""}
|
|
205
249
|
${instrumentationPath ? `import * as _instrumentation from ${JSON.stringify(toSlash(instrumentationPath))};
|
|
206
250
|
import { ensureInstrumentationRegistered as __ensureInstrumentationRegistered } from ${JSON.stringify(instrumentationRuntimePath)};
|
|
251
|
+
import { shareIsolatePromise as __shareIsolatePromise } from ${JSON.stringify(isolateSharedPromisePath)};
|
|
207
252
|
let __applicationInitialization;
|
|
208
253
|
async function __initializeApplication() {
|
|
209
254
|
await __ensureInstrumentationRegistered(_instrumentation, ${JSON.stringify(toSlash(instrumentationPath))});
|
|
210
255
|
${middlewarePath ? `middlewareModule = await import(${JSON.stringify(toSlash(middlewarePath))});` : ""}
|
|
211
256
|
}
|
|
212
|
-
export function __ensureInstrumentation() {
|
|
213
|
-
return __applicationInitialization ??= __initializeApplication();
|
|
257
|
+
export function __ensureInstrumentation(ctx) {
|
|
258
|
+
return __applicationInitialization ??= __shareIsolatePromise(__initializeApplication(), ctx);
|
|
214
259
|
}` : "export function __ensureInstrumentation() {}"}
|
|
215
260
|
${middlewarePath ? instrumentationPath ? "let middlewareModule;" : `import * as middlewareModule from ${JSON.stringify(toSlash(middlewarePath))};` : ""}
|
|
216
261
|
${hasPagesDir ? `import { getDraftModeCookieHeader } from "next/headers";
|
|
@@ -219,8 +264,8 @@ import { renderPagesFallback as __renderPagesFallback } from ${JSON.stringify(ap
|
|
|
219
264
|
import { buildRequestHeadersFromMiddlewareResponse as __buildRequestHeadersFromMiddlewareResponse } from ${JSON.stringify(middlewareRequestHeadersPath)};
|
|
220
265
|
import { applyRouteHandlerMiddlewareContext as __applyRouteHandlerMiddlewareContext } from ${JSON.stringify(appRouteHandlerMiddlewareContextPath)};` : ""}
|
|
221
266
|
|
|
222
|
-
${hasPagesDir ? `export function __ensureHybridPagesApplication() {
|
|
223
|
-
return __pagesRequestEntry.__ensureInstrumentation?.();
|
|
267
|
+
${hasPagesDir ? `export function __ensureHybridPagesApplication(ctx) {
|
|
268
|
+
return __pagesRequestEntry.__ensureInstrumentation?.(ctx);
|
|
224
269
|
}` : "export function __ensureHybridPagesApplication() {}"}
|
|
225
270
|
|
|
226
271
|
const __basePath = ${JSON.stringify(bp)};
|
|
@@ -242,6 +287,7 @@ export const __clientBuildFiles = __pagesClientAssets.clientBuildFiles ?? [];
|
|
|
242
287
|
const __routes = ${JSON.stringify(requestRoutes)};
|
|
243
288
|
const __routeMatcher = __createAppRscRouteMatcher(__routes, ${JSON.stringify(buildAppDecodedPathnamePatterns(routes, config))});
|
|
244
289
|
const __metadataRouteMatchers = ${JSON.stringify(metadataRouteMatchers)};
|
|
290
|
+
${generateCdnPurgeRoutesRegistration(routes, metadataRoutes, config)}
|
|
245
291
|
|
|
246
292
|
function matchRoute(pathname) { return __routeMatcher.matchRoute(pathname); }
|
|
247
293
|
function matchRequestRoute(pathname) { return __routeMatcher.matchRequestRoute(pathname); }
|
|
@@ -295,7 +341,7 @@ const __requestHandler = createAppRscRequestHandler({
|
|
|
295
341
|
devForwardedMiddlewareContextKey: ${JSON.stringify(config?.devForwardedMiddlewareContextKey ?? null)},
|
|
296
342
|
dispatchMatchedPage() { throw new Error("App request stage attempted to render a page inline"); },
|
|
297
343
|
dispatchMatchedRouteHandler() { throw new Error("App request stage attempted to render a route handler inline"); },
|
|
298
|
-
${instrumentationPath ? "ensureInstrumentation() { return __ensureInstrumentation(); }," : ""}
|
|
344
|
+
${instrumentationPath ? "ensureInstrumentation(ctx) { return __ensureInstrumentation(ctx); }," : ""}
|
|
299
345
|
i18nConfig: ${JSON.stringify(config?.i18n ?? null)},
|
|
300
346
|
imageConfig: ${JSON.stringify(config?.imageConfig)},
|
|
301
347
|
isMetadataRoute: __isMetadataPath,
|
|
@@ -368,6 +414,7 @@ const __requestHandler = createAppRscRequestHandler({
|
|
|
368
414
|
},` : ""}
|
|
369
415
|
rootParamNamesByPattern: {},
|
|
370
416
|
setNavigationContext,
|
|
417
|
+
skipProxyUrlNormalize: ${JSON.stringify(config?.skipProxyUrlNormalize ?? false)},
|
|
371
418
|
skipTrailingSlashRedirect: ${JSON.stringify(config?.skipTrailingSlashRedirect ?? false)},
|
|
372
419
|
staticParamsMap: {},
|
|
373
420
|
trailingSlash: __trailingSlash,
|
|
@@ -449,12 +496,12 @@ function generateRscEntry(appDir, routes, middlewarePath, metadataRoutes, global
|
|
|
449
496
|
});
|
|
450
497
|
const loadPrerenderPagesRoutesCode = hasPagesDir ? `
|
|
451
498
|
let __hybridPagesApplication;
|
|
452
|
-
export function __ensureHybridPagesApplication() {
|
|
453
|
-
return __hybridPagesApplication ??= (async () => {
|
|
499
|
+
export function __ensureHybridPagesApplication(ctx) {
|
|
500
|
+
return __hybridPagesApplication ??= __shareIsolatePromise((async () => {
|
|
454
501
|
const __pagesEntry = await import.meta.viteRsc.loadModule("ssr", "index");
|
|
455
|
-
await __pagesEntry.__ensureInstrumentation?.();
|
|
502
|
+
await __pagesEntry.__ensureInstrumentation?.(ctx);
|
|
456
503
|
return __pagesEntry;
|
|
457
|
-
})();
|
|
504
|
+
})(), ctx);
|
|
458
505
|
}
|
|
459
506
|
async function __loadPrerenderPagesRoutes() {
|
|
460
507
|
const __gspSsrEntry = await __ensureHybridPagesApplication();
|
|
@@ -475,8 +522,8 @@ ${metaRouteEntries.join(",\n")}
|
|
|
475
522
|
rootLayouts = [${rootLayoutVars.join(", ")}];
|
|
476
523
|
__fallbackRenderer = __createFallbackRenderer();
|
|
477
524
|
}
|
|
478
|
-
export function __ensureInstrumentation() {
|
|
479
|
-
return __applicationInitialization ??= __initializeApplication();
|
|
525
|
+
export function __ensureInstrumentation(ctx) {
|
|
526
|
+
return __applicationInitialization ??= __shareIsolatePromise(__initializeApplication(), ctx);
|
|
480
527
|
}` : "export function __ensureInstrumentation() {}";
|
|
481
528
|
return `
|
|
482
529
|
${hasAppRouteHandlers ? `// Capture the canonical Request surface before any user module can extend it.
|
|
@@ -485,26 +532,37 @@ import ${JSON.stringify(appRouteRequestBuiltInsPath)};` : ""}
|
|
|
485
532
|
import ${JSON.stringify(serverGlobalsPath)};
|
|
486
533
|
import __cacheabilityManifest from "virtual:vinext-cacheability-manifest";
|
|
487
534
|
export { __cacheabilityManifest };
|
|
488
|
-
import {
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
loadServerAction,
|
|
494
|
-
createTemporaryReferenceSet,` : ""}
|
|
495
|
-
} from ${JSON.stringify(hasServerActions ? "@vitejs/plugin-rsc/rsc" : "@vitejs/plugin-rsc/react/rsc")};
|
|
496
|
-
import { createClientManifest as _createClientManifest } from "@vitejs/plugin-rsc/core/rsc";
|
|
535
|
+
${hasServerActions ? `import { loadServerAction, createTemporaryReferenceSet } from "@vitejs/plugin-rsc/rsc";\n` : ""}import {
|
|
536
|
+
createClientManifest as _createClientManifest,${hasServerActions ? `
|
|
537
|
+
createServerManifest as _createServerManifest,` : ""}
|
|
538
|
+
} from "@vitejs/plugin-rsc/core/rsc";
|
|
539
|
+
import { renderToReadableStream as _renderToReadableStream } from "@vitejs/plugin-rsc/vendor/react-server-dom/server.edge";
|
|
497
540
|
import { prerender as _prerender } from "@vitejs/plugin-rsc/vendor/react-server-dom/static.edge";
|
|
498
|
-
import {
|
|
541
|
+
import { createClientReferenceChunksManifest } from ${JSON.stringify(appClientReferenceManifestPath)};
|
|
542
|
+
${hasServerActions ? `// plugin-rsc's decoders fix an unscoped server manifest; React's own take the
|
|
543
|
+
// manifest, so actions can scope the server references they decode per route.
|
|
544
|
+
import {
|
|
545
|
+
decodeAction as _decodeAction,
|
|
546
|
+
decodeFormState as _decodeFormState,
|
|
547
|
+
decodeReply as _decodeReply,
|
|
548
|
+
} from "@vitejs/plugin-rsc/vendor/react-server-dom/server.edge";
|
|
549
|
+
` : ""}import { createRscRenderer } from ${JSON.stringify(rscRenderStreamPath)};
|
|
499
550
|
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
551
|
+
// Each render takes a fresh client manifest: in development, its references
|
|
552
|
+
// carry a new cache tag.
|
|
553
|
+
const __withClientReferenceChunks = createClientReferenceChunksManifest(
|
|
554
|
+
__pagesClientAssets.appClientReferenceChunks,
|
|
555
|
+
);
|
|
556
|
+
const renderToReadableStream = createRscRenderer((model, options) =>
|
|
557
|
+
_renderToReadableStream(model, __withClientReferenceChunks(_createClientManifest()), options),
|
|
503
558
|
);
|
|
559
|
+
const prerenderToReadableStream = (model, options) =>
|
|
560
|
+
_prerender(model, __withClientReferenceChunks(_createClientManifest()), options);
|
|
504
561
|
import { createElement } from "react";
|
|
505
562
|
import { getNavigationContext as _getNavigationContext } from "next/navigation";
|
|
506
563
|
import { configureMemoryCacheHandler as __configureMemoryCacheHandler } from "vinext/shims/cache-handler";
|
|
507
564
|
import { getRequestExecutionContext as __getRequestExecutionContext } from "vinext/shims/request-context";
|
|
565
|
+
import { shareIsolatePromise as __shareIsolatePromise } from ${JSON.stringify(isolateSharedPromisePath)};
|
|
508
566
|
import { headersContextFromRequest, getDraftModeCookieHeader, getAndClearPendingCookies, consumeDynamicUsage, consumeInvalidDynamicUsageError, setHeadersAccessPhase } from "next/headers";
|
|
509
567
|
import { mergeMetadata, resolveModuleMetadata, mergeViewport, resolveModuleViewport } from "vinext/metadata";
|
|
510
568
|
${config?.nodeOpenTelemetryLoader ? `import { register as __registerOpenTelemetryLoader } from "node:module";
|
|
@@ -878,6 +936,8 @@ function __createFallbackRenderer() {
|
|
|
878
936
|
}
|
|
879
937
|
${instrumentationPath ? "let __fallbackRenderer;" : "const __fallbackRenderer = __createFallbackRenderer();"}
|
|
880
938
|
|
|
939
|
+
${generateCdnPurgeRoutesRegistration(routes, metadataRoutes, config)}
|
|
940
|
+
|
|
881
941
|
function matchRoute(url) {
|
|
882
942
|
return __routeMatcher.matchRoute(url);
|
|
883
943
|
}
|
|
@@ -1093,9 +1153,11 @@ ${responseStageOnly ? "const __responseStageOptions = {" : "const __appRscHandle
|
|
|
1093
1153
|
observeMetadataSearchParamsAccess: buildOptions?.observeMetadataSearchParamsAccess === true,
|
|
1094
1154
|
observePageSearchParamsAccess: buildOptions?.observePageSearchParamsAccess === true,
|
|
1095
1155
|
isForceStatic: buildOptions?.isForceStatic === true,
|
|
1156
|
+
isUncacheableRender: buildOptions?.isUncacheableRender === true,
|
|
1096
1157
|
serveStreamingMetadata: buildOptions?.serveStreamingMetadata,
|
|
1097
1158
|
placeStreamedMetadataInHead: buildOptions?.placeStreamedMetadataInHead === true,
|
|
1098
1159
|
isProduction: process.env.NODE_ENV === "production",
|
|
1160
|
+
onHeadPrepared: buildOptions?.onHeadPrepared,
|
|
1099
1161
|
}, layoutParamAccess, displayPathname, scriptNonce);
|
|
1100
1162
|
},
|
|
1101
1163
|
clientReuseManifest,
|
|
@@ -1286,8 +1348,8 @@ ${responseStageOnly ? "const __responseStageOptions = {" : "const __appRscHandle
|
|
|
1286
1348
|
searchParams,
|
|
1287
1349
|
});
|
|
1288
1350
|
},
|
|
1289
|
-
${instrumentationPath ? `ensureInstrumentation() {
|
|
1290
|
-
return __ensureInstrumentation();
|
|
1351
|
+
${instrumentationPath ? `ensureInstrumentation(ctx) {
|
|
1352
|
+
return __ensureInstrumentation(ctx);
|
|
1291
1353
|
},` : ""}
|
|
1292
1354
|
${hasServerActions ? `
|
|
1293
1355
|
async handleProgressiveActionRequest({
|
|
@@ -1305,13 +1367,15 @@ ${responseStageOnly ? "const __responseStageOptions = {" : "const __appRscHandle
|
|
|
1305
1367
|
} = await __loadAppServerActionExecution();
|
|
1306
1368
|
const {
|
|
1307
1369
|
areServerActionsOwnedByRoute: __areServerActionsOwnedByRoute,
|
|
1370
|
+
createForwardedActionContext: __createForwardedActionContext,
|
|
1308
1371
|
forwardServerActionIfNeeded: __forwardServerActionIfNeeded,
|
|
1309
1372
|
} = await __loadAppActionForwarding();
|
|
1310
1373
|
// A multipart form POST to a page is always a server-action attempt, so a
|
|
1311
1374
|
// body that decodes to no action must surface as 404 action-not-found
|
|
1312
|
-
// (#1340). Route handlers
|
|
1313
|
-
//
|
|
1314
|
-
//
|
|
1375
|
+
// (#1340). Route handlers and Pages routes never reach this dispatch
|
|
1376
|
+
// (#3886) and unmatched routes fall through, so only flag page routes.
|
|
1377
|
+
// The __loadPage marker is static and available before lazy module
|
|
1378
|
+
// hydration.
|
|
1315
1379
|
//
|
|
1316
1380
|
// Only the progressive (multipart, no actionId) POST path consults
|
|
1317
1381
|
// hasPageRoute, so skip the route match entirely for every other request
|
|
@@ -1321,11 +1385,7 @@ ${responseStageOnly ? "const __responseStageOptions = {" : "const __appRscHandle
|
|
|
1321
1385
|
contentType,
|
|
1322
1386
|
actionId,
|
|
1323
1387
|
);
|
|
1324
|
-
const __hasPageRoute = Boolean(
|
|
1325
|
-
__isProgressiveAction &&
|
|
1326
|
-
routeMatch?.route.__loadPage &&
|
|
1327
|
-
!routeMatch.route.__loadRouteHandler,
|
|
1328
|
-
);
|
|
1388
|
+
const __hasPageRoute = Boolean(__isProgressiveAction && routeMatch?.route.__loadPage);
|
|
1329
1389
|
return __handleProgressiveServerActionRequest({
|
|
1330
1390
|
actionId,
|
|
1331
1391
|
allowedOrigins: __allowedOrigins,
|
|
@@ -1335,8 +1395,9 @@ ${responseStageOnly ? "const __responseStageOptions = {" : "const __appRscHandle
|
|
|
1335
1395
|
__clearRequestContext();
|
|
1336
1396
|
},
|
|
1337
1397
|
contentType,
|
|
1338
|
-
|
|
1339
|
-
|
|
1398
|
+
createServerManifest: _createServerManifest,
|
|
1399
|
+
decodeAction: _decodeAction,
|
|
1400
|
+
decodeFormState: _decodeFormState,
|
|
1340
1401
|
getAndClearPendingCookies,
|
|
1341
1402
|
getDraftModeCookieHeader,
|
|
1342
1403
|
forwardAction(__progressiveActionId) {
|
|
@@ -1348,17 +1409,9 @@ ${responseStageOnly ? "const __responseStageOptions = {" : "const __appRscHandle
|
|
|
1348
1409
|
clearRequestContext: __clearRequestContext,
|
|
1349
1410
|
currentRoutePattern: routeMatch?.route.pattern ?? null,
|
|
1350
1411
|
dispatch(__forwardRequest) {
|
|
1351
|
-
const __executionContext = __getRequestExecutionContext();
|
|
1352
1412
|
return __appRscHandler(
|
|
1353
1413
|
__forwardRequest,
|
|
1354
|
-
|
|
1355
|
-
? {
|
|
1356
|
-
actionForwarded: true,
|
|
1357
|
-
cache: __executionContext.cache,
|
|
1358
|
-
passThroughOnException: __executionContext.passThroughOnException?.bind(__executionContext),
|
|
1359
|
-
waitUntil: __executionContext.waitUntil.bind(__executionContext),
|
|
1360
|
-
}
|
|
1361
|
-
: { actionForwarded: true },
|
|
1414
|
+
__createForwardedActionContext(__getRequestExecutionContext()),
|
|
1362
1415
|
);
|
|
1363
1416
|
},
|
|
1364
1417
|
middlewareContext,
|
|
@@ -1398,8 +1451,11 @@ ${responseStageOnly ? "const __responseStageOptions = {" : "const __appRscHandle
|
|
|
1398
1451
|
sourceConfigHeaders,
|
|
1399
1452
|
searchParams,
|
|
1400
1453
|
}) {
|
|
1401
|
-
const {
|
|
1402
|
-
|
|
1454
|
+
const {
|
|
1455
|
+
areServerActionsOwnedByRoute: __areServerActionsOwnedByRoute,
|
|
1456
|
+
createForwardedActionContext: __createForwardedActionContext,
|
|
1457
|
+
forwardServerActionIfNeeded: __forwardServerActionIfNeeded,
|
|
1458
|
+
} = await __loadAppActionForwarding();
|
|
1403
1459
|
const __currentActionMatch = routeMatch;
|
|
1404
1460
|
const __forwardResponse = await __forwardServerActionIfNeeded({
|
|
1405
1461
|
actionId,
|
|
@@ -1409,17 +1465,9 @@ ${responseStageOnly ? "const __responseStageOptions = {" : "const __appRscHandle
|
|
|
1409
1465
|
clearRequestContext: __clearRequestContext,
|
|
1410
1466
|
currentRoutePattern: __currentActionMatch?.route.pattern ?? null,
|
|
1411
1467
|
dispatch(__forwardRequest) {
|
|
1412
|
-
const __executionContext = __getRequestExecutionContext();
|
|
1413
1468
|
return __appRscHandler(
|
|
1414
1469
|
__forwardRequest,
|
|
1415
|
-
|
|
1416
|
-
? {
|
|
1417
|
-
actionForwarded: true,
|
|
1418
|
-
cache: __executionContext.cache,
|
|
1419
|
-
passThroughOnException: __executionContext.passThroughOnException?.bind(__executionContext),
|
|
1420
|
-
waitUntil: __executionContext.waitUntil.bind(__executionContext),
|
|
1421
|
-
}
|
|
1422
|
-
: { actionForwarded: true },
|
|
1470
|
+
__createForwardedActionContext(__getRequestExecutionContext()),
|
|
1423
1471
|
);
|
|
1424
1472
|
},
|
|
1425
1473
|
middlewareContext,
|
|
@@ -1492,8 +1540,9 @@ ${responseStageOnly ? "const __responseStageOptions = {" : "const __appRscHandle
|
|
|
1492
1540
|
createRscOnErrorHandler(actionRequest, actionPathname, routePattern, overrides) {
|
|
1493
1541
|
return createRscOnErrorHandler(actionRequest, actionPathname, routePattern, overrides);
|
|
1494
1542
|
},
|
|
1543
|
+
createServerManifest: _createServerManifest,
|
|
1495
1544
|
createTemporaryReferenceSet,
|
|
1496
|
-
decodeReply,
|
|
1545
|
+
decodeReply: _decodeReply,
|
|
1497
1546
|
dispatchRedirectRequest(redirectRequest) {
|
|
1498
1547
|
return __appRscHandler(redirectRequest, undefined);
|
|
1499
1548
|
},
|
|
@@ -1511,6 +1560,13 @@ ${responseStageOnly ? "const __responseStageOptions = {" : "const __appRscHandle
|
|
|
1511
1560
|
},
|
|
1512
1561
|
isRscRequest,
|
|
1513
1562
|
loadServerAction,
|
|
1563
|
+
validateActionReferences(__argumentActionIds) {
|
|
1564
|
+
return __areServerActionsOwnedByRoute(
|
|
1565
|
+
__VINEXT_ACTION_OWNERS(),
|
|
1566
|
+
__argumentActionIds,
|
|
1567
|
+
__actionMatch?.route.pattern ?? null,
|
|
1568
|
+
);
|
|
1569
|
+
},
|
|
1514
1570
|
// Redirect targets are rendered as if the client had navigated to them,
|
|
1515
1571
|
// so they must route on the raw pathname a real request would use.
|
|
1516
1572
|
matchRoute(pathnameToMatch) {
|
|
@@ -1556,6 +1612,14 @@ ${responseStageOnly ? "const __responseStageOptions = {" : "const __appRscHandle
|
|
|
1556
1612
|
interceptNotFoundBranchSegments: intercept.interceptNotFoundBranchSegments,
|
|
1557
1613
|
interceptNotFound: intercept.notFound,
|
|
1558
1614
|
interceptNotFoundTreePosition: intercept.notFoundTreePosition,
|
|
1615
|
+
interceptForbiddens: intercept.interceptForbiddens,
|
|
1616
|
+
interceptForbiddenTreePositions: intercept.interceptForbiddenTreePositions,
|
|
1617
|
+
interceptUnauthorizeds: intercept.interceptUnauthorizeds,
|
|
1618
|
+
interceptUnauthorizedTreePositions: intercept.interceptUnauthorizedTreePositions,
|
|
1619
|
+
interceptErrors: intercept.interceptErrors,
|
|
1620
|
+
interceptErrorTreePositions: intercept.interceptErrorTreePositions,
|
|
1621
|
+
interceptNotFounds: intercept.interceptNotFounds,
|
|
1622
|
+
interceptNotFoundTreePositions: intercept.interceptNotFoundTreePositions,
|
|
1559
1623
|
interceptSlotId: intercept.slotId,
|
|
1560
1624
|
interceptSlotKey: intercept.slotKey,
|
|
1561
1625
|
interceptSourceMatchedUrl: interceptionContext,
|
|
@@ -1676,6 +1740,7 @@ ${responseStageOnly ? "const __responseStageOptions = {" : "const __appRscHandle
|
|
|
1676
1740
|
},` : ""}
|
|
1677
1741
|
rootParamNamesByPattern: rootParamNamesMap,
|
|
1678
1742
|
setNavigationContext,
|
|
1743
|
+
skipProxyUrlNormalize: ${JSON.stringify(config?.skipProxyUrlNormalize ?? false)},
|
|
1679
1744
|
skipTrailingSlashRedirect: ${JSON.stringify(config?.skipTrailingSlashRedirect ?? false)},
|
|
1680
1745
|
staticParamsMap: generateStaticParamsMap,
|
|
1681
1746
|
trailingSlash: __trailingSlash,
|
|
@@ -49,5 +49,16 @@ type BuildAppRscManifestCodeOptions = {
|
|
|
49
49
|
*/
|
|
50
50
|
globalNotFoundPath?: string | null;
|
|
51
51
|
};
|
|
52
|
+
/**
|
|
53
|
+
* The root not-found, forbidden and unauthorized boundaries, which a route
|
|
54
|
+
* without its own boundary falls back to.
|
|
55
|
+
*/
|
|
56
|
+
export declare function rootBoundaryFiles(routes: readonly AppRoute[]): string[];
|
|
57
|
+
/**
|
|
58
|
+
* The files a render without a matched route shows (a route-miss 404, or a
|
|
59
|
+
* forbidden or unauthorized boundary): the root layouts and root boundaries.
|
|
60
|
+
*/
|
|
61
|
+
export declare function rootBoundaryRouteFiles(routes: readonly AppRoute[]): string[];
|
|
52
62
|
export declare function buildAppRscManifestCode(options: BuildAppRscManifestCodeOptions): AppRscManifestCode;
|
|
53
|
-
//#endregion
|
|
63
|
+
//#endregion
|
|
64
|
+
export {};
|
|
@@ -17,6 +17,25 @@ function rootRouteBoundaryPath(route, boundaryPaths, fallbackPath) {
|
|
|
17
17
|
if (route.pattern === "/") return fallbackPath ?? null;
|
|
18
18
|
return boundaryPaths?.[0] ?? fallbackPath ?? null;
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* The root not-found, forbidden and unauthorized boundaries, which a route
|
|
22
|
+
* without its own boundary falls back to.
|
|
23
|
+
*/
|
|
24
|
+
function rootBoundaryFiles(routes) {
|
|
25
|
+
const rootRoute = findRootBoundaryRoute(routes);
|
|
26
|
+
return [
|
|
27
|
+
rootRouteBoundaryPath(rootRoute, rootRoute?.notFoundPaths, rootRoute?.notFoundPath),
|
|
28
|
+
rootRouteBoundaryPath(rootRoute, rootRoute?.forbiddenPaths, rootRoute?.forbiddenPath),
|
|
29
|
+
rootRouteBoundaryPath(rootRoute, rootRoute?.unauthorizedPaths, rootRoute?.unauthorizedPath)
|
|
30
|
+
].filter((file) => file !== null);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The files a render without a matched route shows (a route-miss 404, or a
|
|
34
|
+
* forbidden or unauthorized boundary): the root layouts and root boundaries.
|
|
35
|
+
*/
|
|
36
|
+
function rootBoundaryRouteFiles(routes) {
|
|
37
|
+
return [...rootRouteLayoutPaths(findRootBoundaryRoute(routes)), ...rootBoundaryFiles(routes)];
|
|
38
|
+
}
|
|
20
39
|
function createImportAllocator(deferEagerImports) {
|
|
21
40
|
const imports = [];
|
|
22
41
|
const importInitializers = [];
|
|
@@ -76,6 +95,11 @@ function registerRouteModules(routes, imports) {
|
|
|
76
95
|
if (route.unauthorizedPaths) {
|
|
77
96
|
for (const up of route.unauthorizedPaths) if (up) imports.getLazyLoaderVar(up);
|
|
78
97
|
}
|
|
98
|
+
for (const boundaryPath of [
|
|
99
|
+
...route.segmentNotFoundPaths ?? [],
|
|
100
|
+
...route.segmentForbiddenPaths ?? [],
|
|
101
|
+
...route.segmentUnauthorizedPaths ?? []
|
|
102
|
+
]) imports.getLazyLoaderVar(boundaryPath);
|
|
79
103
|
for (const slot of route.parallelSlots) {
|
|
80
104
|
if (slot.pagePath) imports.getLazyLoaderVar(slot.pagePath);
|
|
81
105
|
if (slot.defaultPath) imports.getLazyLoaderVar(slot.defaultPath);
|
|
@@ -85,9 +109,14 @@ function registerRouteModules(routes, imports) {
|
|
|
85
109
|
for (const loadingPath of slot.loadingPaths ?? []) imports.getLazyLoaderVar(loadingPath);
|
|
86
110
|
if (slot.errorPath) imports.getLazyLoaderVar(slot.errorPath);
|
|
87
111
|
if (slot.notFoundPath) imports.getLazyLoaderVar(slot.notFoundPath);
|
|
112
|
+
for (const notFoundPath of slot.notFoundPaths ?? []) imports.getLazyLoaderVar(notFoundPath);
|
|
88
113
|
for (const ir of slot.interceptingRoutes) {
|
|
89
114
|
imports.getLazyLoaderVar(ir.pagePath);
|
|
90
115
|
if (ir.notFoundPath) imports.getLazyLoaderVar(ir.notFoundPath);
|
|
116
|
+
for (const forbiddenPath of ir.forbiddenPaths ?? []) imports.getLazyLoaderVar(forbiddenPath);
|
|
117
|
+
for (const unauthorizedPath of ir.unauthorizedPaths ?? []) imports.getLazyLoaderVar(unauthorizedPath);
|
|
118
|
+
for (const errorPath of ir.errorPaths ?? []) imports.getLazyLoaderVar(errorPath);
|
|
119
|
+
for (const notFoundPath of ir.notFoundPaths ?? []) imports.getLazyLoaderVar(notFoundPath);
|
|
91
120
|
for (const layoutPath of ir.layoutPaths) imports.getLazyLoaderVar(layoutPath);
|
|
92
121
|
for (const loadingPath of ir.loadingPaths ?? []) imports.getLazyLoaderVar(loadingPath);
|
|
93
122
|
}
|
|
@@ -95,6 +124,10 @@ function registerRouteModules(routes, imports) {
|
|
|
95
124
|
for (const ir of route.siblingIntercepts ?? []) {
|
|
96
125
|
imports.getLazyLoaderVar(ir.pagePath);
|
|
97
126
|
if (ir.notFoundPath) imports.getLazyLoaderVar(ir.notFoundPath);
|
|
127
|
+
for (const forbiddenPath of ir.forbiddenPaths ?? []) imports.getLazyLoaderVar(forbiddenPath);
|
|
128
|
+
for (const unauthorizedPath of ir.unauthorizedPaths ?? []) imports.getLazyLoaderVar(unauthorizedPath);
|
|
129
|
+
for (const errorPath of ir.errorPaths ?? []) imports.getLazyLoaderVar(errorPath);
|
|
130
|
+
for (const notFoundPath of ir.notFoundPaths ?? []) imports.getLazyLoaderVar(notFoundPath);
|
|
98
131
|
for (const layoutPath of ir.layoutPaths) imports.getLazyLoaderVar(layoutPath);
|
|
99
132
|
for (const loadingPath of ir.loadingPaths ?? []) imports.getLazyLoaderVar(loadingPath);
|
|
100
133
|
}
|
|
@@ -134,11 +167,23 @@ function buildRouteEntries(routes, imports) {
|
|
|
134
167
|
__loadInterceptLoadings: ${lazyLoaderArray(ir.loadingPaths ?? [], imports)},
|
|
135
168
|
interceptLoadingTreePositions: ${JSON.stringify(ir.loadingTreePositions ?? [])},
|
|
136
169
|
interceptNotFoundBranchSegments: ${JSON.stringify(ir.notFoundBranchSegments ?? ir.branchSegments ?? [])},
|
|
170
|
+
interceptNotFounds: ${moduleArray(ir.notFoundPaths?.length ?? 0)},
|
|
171
|
+
__loadInterceptNotFounds: ${lazyLoaderArray(ir.notFoundPaths ?? [], imports)},
|
|
172
|
+
interceptNotFoundTreePositions: ${JSON.stringify(ir.notFoundTreePositions ?? [])},
|
|
137
173
|
page: null,
|
|
138
174
|
__pageLoader: ${imports.getLazyLoaderVar(ir.pagePath)},
|
|
139
175
|
notFound: null,
|
|
140
176
|
__loadNotFound: ${ir.notFoundPath ? imports.getLazyLoaderVar(ir.notFoundPath) : "null"},
|
|
141
177
|
notFoundTreePosition: ${ir.notFoundTreePosition ?? "null"},
|
|
178
|
+
interceptForbiddens: ${moduleArray(ir.forbiddenPaths?.length ?? 0)},
|
|
179
|
+
__loadInterceptForbiddens: ${lazyLoaderArray(ir.forbiddenPaths ?? [], imports)},
|
|
180
|
+
interceptForbiddenTreePositions: ${JSON.stringify(ir.forbiddenTreePositions ?? [])},
|
|
181
|
+
interceptUnauthorizeds: ${moduleArray(ir.unauthorizedPaths?.length ?? 0)},
|
|
182
|
+
__loadInterceptUnauthorizeds: ${lazyLoaderArray(ir.unauthorizedPaths ?? [], imports)},
|
|
183
|
+
interceptUnauthorizedTreePositions: ${JSON.stringify(ir.unauthorizedTreePositions ?? [])},
|
|
184
|
+
interceptErrors: ${moduleArray(ir.errorPaths?.length ?? 0)},
|
|
185
|
+
__loadInterceptErrors: ${lazyLoaderArray(ir.errorPaths ?? [], imports)},
|
|
186
|
+
interceptErrorTreePositions: ${JSON.stringify(ir.errorTreePositions ?? [])},
|
|
142
187
|
params: ${JSON.stringify(ir.params)},
|
|
143
188
|
}`);
|
|
144
189
|
const slotEntries = route.parallelSlots.map((slot) => {
|
|
@@ -155,11 +200,23 @@ function buildRouteEntries(routes, imports) {
|
|
|
155
200
|
__loadInterceptLoadings: ${lazyLoaderArray(ir.loadingPaths ?? [], imports)},
|
|
156
201
|
interceptLoadingTreePositions: ${JSON.stringify(ir.loadingTreePositions ?? [])},
|
|
157
202
|
interceptNotFoundBranchSegments: ${JSON.stringify(ir.notFoundBranchSegments ?? ir.branchSegments ?? [])},
|
|
203
|
+
interceptNotFounds: ${moduleArray(ir.notFoundPaths?.length ?? 0)},
|
|
204
|
+
__loadInterceptNotFounds: ${lazyLoaderArray(ir.notFoundPaths ?? [], imports)},
|
|
205
|
+
interceptNotFoundTreePositions: ${JSON.stringify(ir.notFoundTreePositions ?? [])},
|
|
158
206
|
page: null,
|
|
159
207
|
__pageLoader: ${imports.getLazyLoaderVar(ir.pagePath)},
|
|
160
208
|
notFound: null,
|
|
161
209
|
__loadNotFound: ${ir.notFoundPath ? imports.getLazyLoaderVar(ir.notFoundPath) : "null"},
|
|
162
210
|
notFoundTreePosition: ${ir.notFoundTreePosition ?? "null"},
|
|
211
|
+
interceptForbiddens: ${moduleArray(ir.forbiddenPaths?.length ?? 0)},
|
|
212
|
+
__loadInterceptForbiddens: ${lazyLoaderArray(ir.forbiddenPaths ?? [], imports)},
|
|
213
|
+
interceptForbiddenTreePositions: ${JSON.stringify(ir.forbiddenTreePositions ?? [])},
|
|
214
|
+
interceptUnauthorizeds: ${moduleArray(ir.unauthorizedPaths?.length ?? 0)},
|
|
215
|
+
__loadInterceptUnauthorizeds: ${lazyLoaderArray(ir.unauthorizedPaths ?? [], imports)},
|
|
216
|
+
interceptUnauthorizedTreePositions: ${JSON.stringify(ir.unauthorizedTreePositions ?? [])},
|
|
217
|
+
interceptErrors: ${moduleArray(ir.errorPaths?.length ?? 0)},
|
|
218
|
+
__loadInterceptErrors: ${lazyLoaderArray(ir.errorPaths ?? [], imports)},
|
|
219
|
+
interceptErrorTreePositions: ${JSON.stringify(ir.errorTreePositions ?? [])},
|
|
163
220
|
params: ${JSON.stringify(ir.params)},
|
|
164
221
|
}`);
|
|
165
222
|
return ` ${JSON.stringify(slot.key)}: {
|
|
@@ -185,6 +242,9 @@ function buildRouteEntries(routes, imports) {
|
|
|
185
242
|
notFound: null,
|
|
186
243
|
__loadNotFound: ${slot.notFoundPath ? imports.getLazyLoaderVar(slot.notFoundPath) : "null"},
|
|
187
244
|
notFoundTreePosition: ${slot.notFoundTreePosition ?? "null"},
|
|
245
|
+
notFounds: ${moduleArray(slot.notFoundPaths?.length ?? 0)},
|
|
246
|
+
__loadNotFounds: ${lazyLoaderArray(slot.notFoundPaths ?? [], imports)},
|
|
247
|
+
notFoundTreePositions: ${JSON.stringify(slot.notFoundTreePositions ?? [])},
|
|
188
248
|
layoutIndex: ${slot.layoutIndex},
|
|
189
249
|
routeSegments: ${JSON.stringify(slot.routeSegments)},
|
|
190
250
|
slotPatternParts: ${slot.slotPatternParts ? JSON.stringify(slot.slotPatternParts) : "null"},
|
|
@@ -195,6 +255,9 @@ ${interceptEntries.join(",\n")}
|
|
|
195
255
|
}`;
|
|
196
256
|
});
|
|
197
257
|
const layoutErrorPaths = route.layoutErrorPaths ?? [];
|
|
258
|
+
const segmentNotFoundPaths = route.segmentNotFoundPaths ?? [];
|
|
259
|
+
const segmentForbiddenPaths = route.segmentForbiddenPaths ?? [];
|
|
260
|
+
const segmentUnauthorizedPaths = route.segmentUnauthorizedPaths ?? [];
|
|
198
261
|
const errorPaths = route.errorPaths ?? [];
|
|
199
262
|
const layoutErrorLoaders = lazyLoaderArray(layoutErrorPaths, imports);
|
|
200
263
|
const errorLoaders = lazyLoaderArray(errorPaths, imports);
|
|
@@ -257,6 +320,15 @@ ${siblingInterceptEntries.join(",\n")}
|
|
|
257
320
|
unauthorizedTreePosition: ${route.unauthorizedTreePosition ?? "null"},
|
|
258
321
|
unauthorizeds: ${moduleArray(unauthorizedPaths.length)},
|
|
259
322
|
__loadUnauthorizeds: ${unauthorizedLoaders},
|
|
323
|
+
segmentNotFounds: ${moduleArray(segmentNotFoundPaths.length)},
|
|
324
|
+
__loadSegmentNotFounds: ${lazyLoaderArray(segmentNotFoundPaths, imports)},
|
|
325
|
+
segmentNotFoundTreePositions: ${JSON.stringify(route.segmentNotFoundTreePositions ?? [])},
|
|
326
|
+
segmentForbiddens: ${moduleArray(segmentForbiddenPaths.length)},
|
|
327
|
+
__loadSegmentForbiddens: ${lazyLoaderArray(segmentForbiddenPaths, imports)},
|
|
328
|
+
segmentForbiddenTreePositions: ${JSON.stringify(route.segmentForbiddenTreePositions ?? [])},
|
|
329
|
+
segmentUnauthorizeds: ${moduleArray(segmentUnauthorizedPaths.length)},
|
|
330
|
+
__loadSegmentUnauthorizeds: ${lazyLoaderArray(segmentUnauthorizedPaths, imports)},
|
|
331
|
+
segmentUnauthorizedTreePositions: ${JSON.stringify(route.segmentUnauthorizedTreePositions ?? [])},
|
|
260
332
|
}`;
|
|
261
333
|
});
|
|
262
334
|
}
|
|
@@ -357,4 +429,4 @@ function buildAppRscManifestCode(options) {
|
|
|
357
429
|
};
|
|
358
430
|
}
|
|
359
431
|
//#endregion
|
|
360
|
-
export { buildAppRscManifestCode };
|
|
432
|
+
export { buildAppRscManifestCode, rootBoundaryFiles, rootBoundaryRouteFiles };
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
* entry also re-exports selected Pages server entry hooks from
|
|
10
10
|
* `virtual:vinext-server-entry` so the RSC bundle can access Pages Router
|
|
11
11
|
* route metadata and fallback dispatchers via `import("./ssr/index.js")`.
|
|
12
|
+
*
|
|
13
|
+
* `nitroPublicFilesEntry` wraps the default export for Nitro, so a public file
|
|
14
|
+
* the router resolves is served by Nitro's static handler.
|
|
12
15
|
*/
|
|
13
|
-
export declare function generateSsrEntry(hasPagesDir?: boolean): string;
|
|
16
|
+
export declare function generateSsrEntry(hasPagesDir?: boolean, nitroPublicFilesEntry?: string | null): string;
|
|
14
17
|
//#endregion
|
|
@@ -10,12 +10,19 @@ import { resolveRuntimeEntryModule } from "./runtime-entry-module.js";
|
|
|
10
10
|
* entry also re-exports selected Pages server entry hooks from
|
|
11
11
|
* `virtual:vinext-server-entry` so the RSC bundle can access Pages Router
|
|
12
12
|
* route metadata and fallback dispatchers via `import("./ssr/index.js")`.
|
|
13
|
+
*
|
|
14
|
+
* `nitroPublicFilesEntry` wraps the default export for Nitro, so a public file
|
|
15
|
+
* the router resolves is served by Nitro's static handler.
|
|
13
16
|
*/
|
|
14
|
-
function generateSsrEntry(hasPagesDir = false) {
|
|
17
|
+
function generateSsrEntry(hasPagesDir = false, nitroPublicFilesEntry = null) {
|
|
15
18
|
const entryPath = resolveRuntimeEntryModule("app-ssr-entry");
|
|
16
19
|
return `
|
|
17
20
|
export * from ${JSON.stringify(entryPath)};
|
|
18
|
-
|
|
21
|
+
${nitroPublicFilesEntry ? `
|
|
22
|
+
import ssrEntry from ${JSON.stringify(entryPath)};
|
|
23
|
+
import { withNitroPublicFiles } from ${JSON.stringify(nitroPublicFilesEntry)};
|
|
24
|
+
export default withNitroPublicFiles(ssrEntry);
|
|
25
|
+
` : `export { default } from ${JSON.stringify(entryPath)};`}
|
|
19
26
|
${hasPagesDir ? `
|
|
20
27
|
export {
|
|
21
28
|
__ensureInstrumentation,
|
|
@@ -6,6 +6,7 @@ import { VinextLinkPrefetchRoute } from "../client/vinext-next-data.js";
|
|
|
6
6
|
export declare function compileClientMiddlewareMatchers(matcher: StaticMiddlewareMatcher | undefined): unknown[] | undefined;
|
|
7
7
|
export declare function generateClientEntry(pagesDir: string, nextConfig: ResolvedNextConfig, fileMatcher: ReturnType<typeof createValidFileMatcher>, options?: {
|
|
8
8
|
appPrefetchRoutes?: readonly VinextLinkPrefetchRoute[];
|
|
9
|
+
appRouteHandlers?: readonly VinextLinkPrefetchRoute[];
|
|
9
10
|
instrumentationClientPath?: string | null;
|
|
10
11
|
middlewareMatcher?: StaticMiddlewareMatcher | undefined;
|
|
11
12
|
reactPreamble?: boolean;
|