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
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
import { APP_RSC_RENDER_MODE_PREFETCH_EMPTY, APP_RSC_RENDER_MODE_PREFETCH_LOADING_SHELL } from "./app-rsc-render-mode.js";
|
|
2
2
|
import { fnv1a64 } from "../utils/hash.js";
|
|
3
3
|
import { createInlineScriptTag, escapeHtmlAttr } from "./html.js";
|
|
4
|
-
import { createAppRenderDependency, registerAppElementRenderDependencies, renderAfterAppDependencies, renderAppComponentWithDependencyBarrier } from "./app-render-dependency.js";
|
|
4
|
+
import { createAppRenderDependency, invokeAppComponentMappingErrors, isReactOwnedAppComponent, registerAppElementRenderDependencies, renderAfterAppDependencies, renderAppComponentWithDependencyBarrier } from "./app-render-dependency.js";
|
|
5
5
|
import { APP_LAYOUT_IDS_KEY, APP_ROOT_LAYOUT_KEY, APP_STATIC_SIBLINGS_KEY, AppElementsWire, normalizeAppElementsSlotBindings } from "./app-elements-wire.js";
|
|
6
|
-
import { APP_PREFETCH_LOADING_SHELL_MARKER_KEY } from "./app-elements.js";
|
|
6
|
+
import { APP_PREFETCH_LOADING_SHELL_MARKER_KEY, APP_STREAMING_METADATA_BODY_ID_PREFIX } from "./app-elements.js";
|
|
7
7
|
import DefaultGlobalError from "../shims/default-global-error.js";
|
|
8
|
-
import { ErrorBoundary, ForbiddenBoundary, GlobalErrorBoundary, NotFoundBoundary, RedirectBoundary, UnauthorizedBoundary } from "../shims/error-boundary.js";
|
|
8
|
+
import { ErrorBoundary, ForbiddenBoundary, GlobalErrorBoundary, HttpAccessFallbackPassthrough, NotFoundBoundary, RedirectBoundary, UnauthorizedBoundary } from "../shims/error-boundary.js";
|
|
9
9
|
import { AppRouterScrollTarget } from "../shims/app-router-scroll.js";
|
|
10
|
+
import DefaultForbidden from "../shims/default-forbidden.js";
|
|
10
11
|
import DefaultNotFound from "../shims/default-not-found.js";
|
|
12
|
+
import DefaultUnauthorized from "../shims/default-unauthorized.js";
|
|
11
13
|
import { LayoutSegmentProvider } from "../shims/layout-segment-context.js";
|
|
12
14
|
import { withUseCacheLayoutMarker } from "../shims/internal/app-page-props-cache-key.js";
|
|
13
15
|
import { MetadataHead, ViewportHead, renderMetadataToHtml } from "../shims/metadata.js";
|
|
14
16
|
import { BfcacheSegmentBoundary, Children as Children$1, ParallelSlot, Slot } from "../shims/slot.js";
|
|
15
17
|
import { StreamedIconsInsertion } from "../shims/streamed-icons.js";
|
|
18
|
+
import { APP_PAGE_NOT_FOUND_BOUNDARY_ID, tagAppPageSlotError } from "./app-page-execution.js";
|
|
16
19
|
import { resolveAppPageBranchParams, resolveAppPageSegmentParamScopeKeys, resolveAppPageSegmentParams } from "./app-page-params.js";
|
|
17
20
|
import { probeReactServerSubtree } from "./app-page-probe.js";
|
|
18
|
-
import { APP_PAGE_SEGMENT_KEY, resolveAppPageChildSegments, resolveAppPageSegmentStateKey, resolveAppPageTemplateStateKey } from "./app-page-segment-state.js";
|
|
21
|
+
import { APP_PAGE_SEGMENT_KEY, isAppPageRouteGroupSegment, resolveAppPageChildSegments, resolveAppPageSegmentStateKey, resolveAppPageTemplateStateKey } from "./app-page-segment-state.js";
|
|
19
22
|
import { createAppPageSegmentPlan } from "./app-page-segment-plan.js";
|
|
20
23
|
import { resolveAppPageModuleTraceSegment, traceGetLayoutOrPageModule } from "./app-page-tracing.js";
|
|
21
24
|
import { Fragment, Suspense } from "react";
|
|
@@ -25,9 +28,22 @@ const APP_PAGE_SLOT_SEGMENT_KEY = "(__SLOT__)";
|
|
|
25
28
|
const APP_PAGE_LAYOUT_PROBE_CHILD = /* @__PURE__ */ jsx(Fragment, {});
|
|
26
29
|
const DEFAULT_GLOBAL_ERROR_COMPONENT = DefaultGlobalError;
|
|
27
30
|
const DEFAULT_NOT_FOUND_COMPONENT = DefaultNotFound;
|
|
31
|
+
const DEFAULT_FORBIDDEN_COMPONENT = DefaultForbidden;
|
|
32
|
+
const DEFAULT_UNAUTHORIZED_COMPONENT = DefaultUnauthorized;
|
|
28
33
|
function resolveSlotLayoutParams(routeSegments, treePosition, params) {
|
|
29
34
|
return resolveAppPageBranchParams(routeSegments, treePosition, params);
|
|
30
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* A parallel slot's layout, whose notFound(), forbidden() and unauthorized()
|
|
38
|
+
* are caught above the layout that renders the slot, as its page's are. Next.js
|
|
39
|
+
* attaches the slot's own boundaries inside that layout, so they never catch it.
|
|
40
|
+
* https://github.com/vercel/next.js/blob/canary/packages/next/src/server/app-render/create-component-tree.tsx
|
|
41
|
+
*/
|
|
42
|
+
function createSlotLayoutElement(LayoutComponent, props, slotLayoutIndex, notFoundBoundary) {
|
|
43
|
+
if (slotLayoutIndex === void 0 || isReactOwnedAppComponent(LayoutComponent)) return /* @__PURE__ */ jsx(LayoutComponent, { ...props });
|
|
44
|
+
const SlotLayoutInvoker = () => invokeAppComponentMappingErrors(LayoutComponent, props, (error) => tagAppPageSlotError(error, slotLayoutIndex, notFoundBoundary));
|
|
45
|
+
return /* @__PURE__ */ jsx(SlotLayoutInvoker, {});
|
|
46
|
+
}
|
|
31
47
|
function getDefaultExport(module) {
|
|
32
48
|
return module?.default ?? null;
|
|
33
49
|
}
|
|
@@ -266,7 +282,7 @@ async function AppPageHead(props) {
|
|
|
266
282
|
metadata,
|
|
267
283
|
pathname: props.pathname,
|
|
268
284
|
trailingSlash: props.trailingSlash
|
|
269
|
-
}) : null, /* @__PURE__ */ jsx(ViewportHead, { viewport })] });
|
|
285
|
+
}) : null, viewport ? /* @__PURE__ */ jsx(ViewportHead, { viewport }) : null] });
|
|
270
286
|
}
|
|
271
287
|
AppPageHead.displayName = "Vinext.Head";
|
|
272
288
|
function hasStreamedIcons(metadata) {
|
|
@@ -360,8 +376,56 @@ function buildAppPageElements(options) {
|
|
|
360
376
|
for (const templateEntry of templateEntries) templateEntriesByTreePosition.set(templateEntry.treePosition, templateEntry);
|
|
361
377
|
for (const loadingEntry of loadingEntries) loadingEntriesByTreePosition.set(loadingEntry.treePosition, loadingEntry);
|
|
362
378
|
for (const errorEntry of errorEntries) errorEntriesByTreePosition.set(errorEntry.treePosition, errorEntry);
|
|
379
|
+
const isOutermostEntryBelowLoading = (loadingTreePosition, treePosition, kind) => {
|
|
380
|
+
const enclosesEntry = (entryTreePosition, sameSegmentEncloses) => entryTreePosition > loadingTreePosition && (entryTreePosition < treePosition || sameSegmentEncloses && entryTreePosition === treePosition);
|
|
381
|
+
return !layoutEntries.some((entry) => getDefaultExport(entry.layoutModule) && enclosesEntry(entry.treePosition, kind !== "layout")) && !templateEntries.some((entry) => getDefaultExport(entry.templateModule) && enclosesEntry(entry.treePosition, kind === "page"));
|
|
382
|
+
};
|
|
363
383
|
const layoutIndicesByTreePosition = /* @__PURE__ */ new Map();
|
|
364
384
|
for (let index = 0; index < layoutEntries.length; index++) layoutIndicesByTreePosition.set(layoutEntries[index].treePosition, index);
|
|
385
|
+
const resolveAccessBoundaries = (segmentModules, segmentTreePositions, getLayoutModule, builtInComponent) => {
|
|
386
|
+
const files = /* @__PURE__ */ new Map();
|
|
387
|
+
if (segmentTreePositions) for (const [index, treePosition] of segmentTreePositions.entries()) {
|
|
388
|
+
const module = segmentModules?.[index];
|
|
389
|
+
if (module && getDefaultExport(module)) files.set(treePosition, module);
|
|
390
|
+
}
|
|
391
|
+
else for (const entry of layoutEntries) {
|
|
392
|
+
const module = getLayoutModule(entry);
|
|
393
|
+
if (module && getDefaultExport(module)) files.set(entry.treePosition, module);
|
|
394
|
+
}
|
|
395
|
+
const boundaries = /* @__PURE__ */ new Map();
|
|
396
|
+
for (const [treePosition, module] of files) {
|
|
397
|
+
const component = getDefaultExport(module);
|
|
398
|
+
if (component) boundaries.set(treePosition, {
|
|
399
|
+
component,
|
|
400
|
+
module
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
const rootTreePosition = layoutEntriesByTreePosition.has(0) ? 0 : layoutEntries[0]?.treePosition ?? null;
|
|
404
|
+
let rootModuleTreePosition = files.has(0) ? 0 : null;
|
|
405
|
+
for (const treePosition of files.keys()) if (rootTreePosition !== null && treePosition <= rootTreePosition && (rootModuleTreePosition === null || treePosition > rootModuleTreePosition)) rootModuleTreePosition = treePosition;
|
|
406
|
+
const rootModule = rootModuleTreePosition === null ? void 0 : files.get(rootModuleTreePosition);
|
|
407
|
+
const rootComponent = getDefaultExport(rootModule) ?? builtInComponent;
|
|
408
|
+
if (rootComponent) {
|
|
409
|
+
const rootBoundary = {
|
|
410
|
+
component: rootComponent,
|
|
411
|
+
module: rootModule ?? null
|
|
412
|
+
};
|
|
413
|
+
if (rootTreePosition !== null && !files.has(rootTreePosition)) boundaries.set(rootTreePosition, rootBoundary);
|
|
414
|
+
const firstSegment = routeSegments[0];
|
|
415
|
+
if (firstSegment !== void 0 && isAppPageRouteGroupSegment(firstSegment) && !files.has(1)) boundaries.set(1, rootBoundary);
|
|
416
|
+
}
|
|
417
|
+
for (const treePosition of boundaries.keys()) {
|
|
418
|
+
const hasLayout = layoutEntriesByTreePosition.has(treePosition);
|
|
419
|
+
if (rootTreePosition !== null && treePosition < rootTreePosition || !hasLayout && (treePosition === 0 || treePosition >= routeSegments.length)) boundaries.delete(treePosition);
|
|
420
|
+
}
|
|
421
|
+
return boundaries;
|
|
422
|
+
};
|
|
423
|
+
const rootNotFoundModule = options.route.segmentNotFoundTreePositions ? null : options.rootNotFoundModule;
|
|
424
|
+
const rootForbiddenModule = options.route.segmentForbiddenTreePositions ? null : options.rootForbiddenModule;
|
|
425
|
+
const rootUnauthorizedModule = options.route.segmentUnauthorizedTreePositions ? null : options.rootUnauthorizedModule;
|
|
426
|
+
const notFoundBoundaries = resolveAccessBoundaries(options.route.segmentNotFounds, options.route.segmentNotFoundTreePositions, (entry) => entry.notFoundModule, rootNotFoundModule ? null : DEFAULT_NOT_FOUND_COMPONENT);
|
|
427
|
+
const forbiddenBoundaries = resolveAccessBoundaries(options.route.segmentForbiddens, options.route.segmentForbiddenTreePositions, (entry) => entry.forbiddenModule, rootForbiddenModule ? null : DEFAULT_FORBIDDEN_COMPONENT);
|
|
428
|
+
const unauthorizedBoundaries = resolveAccessBoundaries(options.route.segmentUnauthorizeds, options.route.segmentUnauthorizedTreePositions, (entry) => entry.unauthorizedModule, rootUnauthorizedModule ? null : DEFAULT_UNAUTHORIZED_COMPONENT);
|
|
365
429
|
const layoutDependenciesByIndex = /* @__PURE__ */ new Map();
|
|
366
430
|
const renderDependenciesByElementId = /* @__PURE__ */ new Map();
|
|
367
431
|
const layoutDependenciesBefore = [];
|
|
@@ -379,7 +443,10 @@ function buildAppPageElements(options) {
|
|
|
379
443
|
...layoutEntries.map((entry) => entry.treePosition),
|
|
380
444
|
...templateEntries.map((entry) => entry.treePosition),
|
|
381
445
|
...loadingEntries.map((entry) => entry.treePosition),
|
|
382
|
-
...errorEntries.map((entry) => entry.treePosition)
|
|
446
|
+
...errorEntries.map((entry) => entry.treePosition),
|
|
447
|
+
...notFoundBoundaries.keys(),
|
|
448
|
+
...forbiddenBoundaries.keys(),
|
|
449
|
+
...unauthorizedBoundaries.keys()
|
|
383
450
|
])).sort((left, right) => left - right);
|
|
384
451
|
const resolveSlotOverride = (slotKey, slotName) => {
|
|
385
452
|
const overrideByKey = options.slotOverrides?.[slotKey];
|
|
@@ -398,7 +465,7 @@ function buildAppPageElements(options) {
|
|
|
398
465
|
}) : [];
|
|
399
466
|
const prefetchLoadingComponent = getDefaultExport(prefetchLoadingEntry?.loadingModule);
|
|
400
467
|
const shouldRenderPrefetchLoadingShell = isPrefetchLoadingShell && (prefetchLoadingComponent !== null || prefetchSlotLoadingEntries.length > 0);
|
|
401
|
-
const streamingMetadataBodyId = options.resolveHead && metadataPlacement === "body" && (!isPrefetchLoadingShell || shouldRenderPrefetchLoadingShell) ?
|
|
468
|
+
const streamingMetadataBodyId = options.resolveHead && metadataPlacement === "body" && (!isPrefetchLoadingShell || shouldRenderPrefetchLoadingShell) ? `${APP_STREAMING_METADATA_BODY_ID_PREFIX}${routeId}` : null;
|
|
402
469
|
const prefetchCutoffTreePosition = isPrefetchLoadingShell ? prefetchLoadingEntry?.treePosition ?? prefetchSlotLoadingEntries.reduce((deepest, entry) => Math.max(deepest, entry.ownerTreePosition), 0) : null;
|
|
403
470
|
const includesPrefetchTreePosition = (treePosition) => prefetchCutoffTreePosition === null || treePosition <= prefetchCutoffTreePosition;
|
|
404
471
|
const segmentPlan = createAppPageSegmentPlan({
|
|
@@ -440,6 +507,12 @@ function buildAppPageElements(options) {
|
|
|
440
507
|
[pageElementId]: null,
|
|
441
508
|
[routeId]: null
|
|
442
509
|
};
|
|
510
|
+
if (isPrefetchLoadingShell && !shouldRenderPrefetchLoadingShell && options.isUncacheableRender === true) return {
|
|
511
|
+
...metadataEntries,
|
|
512
|
+
...options.route.staticSiblings && options.route.staticSiblings.length > 0 ? { [APP_STATIC_SIBLINGS_KEY]: options.route.staticSiblings } : {},
|
|
513
|
+
[pageElementId]: null,
|
|
514
|
+
[routeId]: null
|
|
515
|
+
};
|
|
443
516
|
const elements = {};
|
|
444
517
|
for (const slotPlan of segmentPlan.slots) for (const segment of slotPlan.nestedBfcacheSegments) elements[segment.id] = null;
|
|
445
518
|
if (options.route.staticSiblings && options.route.staticSiblings.length > 0) elements[APP_STATIC_SIBLINGS_KEY] = options.route.staticSiblings;
|
|
@@ -476,11 +549,15 @@ function buildAppPageElements(options) {
|
|
|
476
549
|
const routeLoadingComponent = getDefaultExport(options.route.loading);
|
|
477
550
|
if (shouldRenderPrefetchLoadingShell) elements[APP_PREFETCH_LOADING_SHELL_MARKER_KEY] = "LoadingBoundary";
|
|
478
551
|
const pageLoadingModule = resolveAppPageLoadingModuleAtOrAbove(options.route, routeSegments.length);
|
|
479
|
-
const
|
|
552
|
+
const pageLoadingEntry = loadingEntries.find((entry) => entry.loadingModule === pageLoadingModule);
|
|
553
|
+
const PageLoadingComponent = pageRenderDependency && (!pageLoadingEntry || isOutermostEntryBelowLoading(pageLoadingEntry.treePosition, routeSegments.length, "page")) ? getDefaultExport(pageLoadingModule) : null;
|
|
554
|
+
const streamingMetadataOutlet = createAppPageStreamingMetadataOutlet(streamingMetadataOutletId, options.streamingMetadataOutletSuspended);
|
|
555
|
+
const renderElementWithMetadataOutlet = options.renderElementWithMetadataOutlet;
|
|
556
|
+
const pageContent = renderElementWithMetadataOutlet ? renderElementWithMetadataOutlet(streamingMetadataOutlet) : options.element;
|
|
480
557
|
const pageElement = PageLoadingComponent ? /* @__PURE__ */ jsx(Suspense, {
|
|
481
558
|
fallback: /* @__PURE__ */ jsx(PageLoadingComponent, {}),
|
|
482
|
-
children:
|
|
483
|
-
}, routeResetKey) :
|
|
559
|
+
children: pageContent
|
|
560
|
+
}, routeResetKey) : pageContent;
|
|
484
561
|
elements[pageElementId] = isPrefetchLoadingShell ? null : pageRenderDependency ? pageElement : renderAfterAppDependencies(pageElement, pageDependencies);
|
|
485
562
|
for (const templateEntry of templateEntries) {
|
|
486
563
|
if (isPrefetchLoadingShell && !includesPrefetchTreePosition(templateEntry.treePosition)) continue;
|
|
@@ -491,7 +568,7 @@ function buildAppPageElements(options) {
|
|
|
491
568
|
let templateElement = templateDependency ? renderAppComponentWithDependencyBarrier(TemplateComponent, { children: /* @__PURE__ */ jsx(Children$1, {}) }, templateDependency) : /* @__PURE__ */ jsx(TemplateComponent, { children: /* @__PURE__ */ jsx(Children$1, {}) });
|
|
492
569
|
const ancestorLoadingEntry = findNearestAncestorLoadingEntry(templateEntry.treePosition);
|
|
493
570
|
const ancestorLoadingComponent = getDefaultExport(ancestorLoadingEntry?.loadingModule);
|
|
494
|
-
if (ancestorLoadingComponent && ancestorLoadingEntry) {
|
|
571
|
+
if (ancestorLoadingComponent && ancestorLoadingEntry && isOutermostEntryBelowLoading(ancestorLoadingEntry.treePosition, templateEntry.treePosition, "template")) {
|
|
495
572
|
const AncestorLoadingComponent = ancestorLoadingComponent;
|
|
496
573
|
const loadingResetKey = resolveRouteSegmentResetKey(ancestorLoadingEntry.treePosition);
|
|
497
574
|
templateElement = /* @__PURE__ */ jsx(Suspense, {
|
|
@@ -532,7 +609,7 @@ function buildAppPageElements(options) {
|
|
|
532
609
|
});
|
|
533
610
|
const ancestorLoadingEntry = findNearestAncestorLoadingEntry(layoutEntry.treePosition);
|
|
534
611
|
const ancestorLoadingComponent = getDefaultExport(ancestorLoadingEntry?.loadingModule);
|
|
535
|
-
if (ancestorLoadingComponent && ancestorLoadingEntry) {
|
|
612
|
+
if (ancestorLoadingComponent && ancestorLoadingEntry && isOutermostEntryBelowLoading(ancestorLoadingEntry.treePosition, layoutEntry.treePosition, "layout")) {
|
|
536
613
|
const AncestorLoadingComponent = ancestorLoadingComponent;
|
|
537
614
|
const loadingResetKey = resolveRouteSegmentResetKey(ancestorLoadingEntry.treePosition);
|
|
538
615
|
layoutElement = /* @__PURE__ */ jsx(Suspense, {
|
|
@@ -561,6 +638,45 @@ function buildAppPageElements(options) {
|
|
|
561
638
|
elements[slotId] = AppElementsWire.unmatchedSlotValue;
|
|
562
639
|
continue;
|
|
563
640
|
}
|
|
641
|
+
const branchNotFounds = /* @__PURE__ */ new Map();
|
|
642
|
+
const slotNotFoundModules = !overrideOrPageComponent ? void 0 : hasSlotTreeOverride ? slotOverride?.notFoundModules : slot.notFounds;
|
|
643
|
+
const slotNotFoundTreePositions = hasSlotTreeOverride ? slotOverride?.notFoundTreePositions : slot.notFoundTreePositions;
|
|
644
|
+
for (const [index, notFoundModule] of (slotNotFoundModules ?? []).entries()) {
|
|
645
|
+
const component = getDefaultExport(notFoundModule);
|
|
646
|
+
const treePosition = slotNotFoundTreePositions?.[index];
|
|
647
|
+
if (component && treePosition !== void 0) branchNotFounds.set(treePosition, component);
|
|
648
|
+
}
|
|
649
|
+
const branchAccessBoundaries = /* @__PURE__ */ new Map();
|
|
650
|
+
if (overrideOrPageComponent && hasSlotTreeOverride) for (const [modules, treePositions, Boundary] of [[
|
|
651
|
+
slotOverride?.forbiddenModules,
|
|
652
|
+
slotOverride?.forbiddenTreePositions,
|
|
653
|
+
ForbiddenBoundary
|
|
654
|
+
], [
|
|
655
|
+
slotOverride?.unauthorizedModules,
|
|
656
|
+
slotOverride?.unauthorizedTreePositions,
|
|
657
|
+
UnauthorizedBoundary
|
|
658
|
+
]]) for (const [index, module] of (modules ?? []).entries()) {
|
|
659
|
+
const component = getDefaultExport(module);
|
|
660
|
+
const treePosition = treePositions?.[index];
|
|
661
|
+
if (!component || treePosition === void 0) continue;
|
|
662
|
+
const entries = branchAccessBoundaries.get(treePosition) ?? [];
|
|
663
|
+
entries.push({
|
|
664
|
+
component,
|
|
665
|
+
Boundary
|
|
666
|
+
});
|
|
667
|
+
branchAccessBoundaries.set(treePosition, entries);
|
|
668
|
+
}
|
|
669
|
+
const branchErrors = /* @__PURE__ */ new Map();
|
|
670
|
+
if (overrideOrPageComponent && hasSlotTreeOverride) for (const [index, errorModule] of (slotOverride?.errorModules ?? []).entries()) {
|
|
671
|
+
const component = getErrorBoundaryExport(errorModule);
|
|
672
|
+
const treePosition = slotOverride?.errorTreePositions?.[index];
|
|
673
|
+
if (component && treePosition !== void 0) branchErrors.set(treePosition, component);
|
|
674
|
+
}
|
|
675
|
+
const resolveSlotNotFoundBoundary = (treePosition) => {
|
|
676
|
+
let caughtAt;
|
|
677
|
+
for (const position of branchNotFounds.keys()) if (position < treePosition && (caughtAt === void 0 || position > caughtAt)) caughtAt = position;
|
|
678
|
+
return caughtAt === void 0 ? void 0 : `${slotId}:${caughtAt}`;
|
|
679
|
+
};
|
|
564
680
|
let slotElement;
|
|
565
681
|
if (prefetchSlotLoadingEntry) {
|
|
566
682
|
const PrefetchSlotLoadingComponent = getDefaultExport(prefetchSlotLoadingEntry.loadingModule);
|
|
@@ -569,10 +685,10 @@ function buildAppPageElements(options) {
|
|
|
569
685
|
const slotProps = { params: options.makeThenableParams(slotParams) };
|
|
570
686
|
if (options.searchParams !== void 0) slotProps.searchParams = options.searchParams;
|
|
571
687
|
if (slotOverride?.props) Object.assign(slotProps, slotOverride.props);
|
|
572
|
-
slotElement = options.createPageElement ? options.createPageElement(slotComponent, slotProps) : (() => {
|
|
688
|
+
slotElement = options.createPageElement ? options.createPageElement(slotComponent, slotProps, targetIndex >= 0 ? targetIndex : void 0, resolveSlotNotFoundBoundary(Number.POSITIVE_INFINITY)) : (() => {
|
|
573
689
|
return /* @__PURE__ */ jsx(slotComponent, { ...slotProps });
|
|
574
690
|
})();
|
|
575
|
-
if (overrideOrPageComponent) slotElement = /* @__PURE__ */
|
|
691
|
+
if (overrideOrPageComponent) slotElement = /* @__PURE__ */ jsxs(Fragment, { children: [slotElement, slotOverride?.metadataOutlet] }, slotResetKey);
|
|
576
692
|
slotElement = /* @__PURE__ */ jsx(RedirectBoundary, {
|
|
577
693
|
resetKey: slotResetKey,
|
|
578
694
|
children: slotElement
|
|
@@ -628,6 +744,9 @@ function buildAppPageElements(options) {
|
|
|
628
744
|
...branchLayouts.keys(),
|
|
629
745
|
...branchLoadings.keys(),
|
|
630
746
|
...slotErrorComponent ? [0] : [],
|
|
747
|
+
...branchNotFounds.keys(),
|
|
748
|
+
...branchAccessBoundaries.keys(),
|
|
749
|
+
...branchErrors.keys(),
|
|
631
750
|
...nestedBfcacheSegments.flatMap((segment) => segment.treePosition === null ? [] : [segment.treePosition])
|
|
632
751
|
])).filter((treePosition) => !prefetchSlotLoadingEntry || !isOwnedAtRoutePrefetchCutoff && treePosition <= prefetchSlotLoadingEntry.treePosition).sort((left, right) => left - right);
|
|
633
752
|
for (let index = branchTreePositions.length - 1; index >= 0; index--) {
|
|
@@ -647,19 +766,31 @@ function buildAppPageElements(options) {
|
|
|
647
766
|
children: slotElement
|
|
648
767
|
}, loadingResetKey || slotResetKey);
|
|
649
768
|
}
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
769
|
+
const SlotNotFoundComponent = branchNotFounds.get(treePosition);
|
|
770
|
+
if (SlotNotFoundComponent) slotElement = /* @__PURE__ */ jsx(NotFoundBoundary, {
|
|
771
|
+
resetKey: resolveAppPageTemplateStateKey(branchSegments, treePosition, slotParams),
|
|
772
|
+
fallback: /* @__PURE__ */ jsx(SlotNotFoundComponent, {}),
|
|
773
|
+
caughtId: `${slotId}:${treePosition}`,
|
|
774
|
+
children: slotElement
|
|
775
|
+
});
|
|
776
|
+
for (const { component: AccessComponent, Boundary } of branchAccessBoundaries.get(treePosition) ?? []) slotElement = /* @__PURE__ */ jsx(Boundary, {
|
|
777
|
+
resetKey: resolveAppPageTemplateStateKey(branchSegments, treePosition, slotParams),
|
|
778
|
+
fallback: /* @__PURE__ */ jsx(AccessComponent, {}),
|
|
779
|
+
children: slotElement
|
|
780
|
+
});
|
|
781
|
+
const SegmentErrorComponent = branchErrors.get(treePosition) ?? (treePosition === 0 ? slotErrorComponent : null);
|
|
782
|
+
if (SegmentErrorComponent) slotElement = /* @__PURE__ */ jsx(ErrorBoundary, {
|
|
783
|
+
resetKey: treePosition === 0 ? slotResetKey : resolveAppPageSegmentStateKey(branchSegments, treePosition, slotParams) || slotResetKey,
|
|
784
|
+
fallback: SegmentErrorComponent,
|
|
653
785
|
children: slotElement
|
|
654
786
|
});
|
|
655
787
|
const layoutEntriesAtPosition = branchLayouts.get(treePosition) ?? [];
|
|
656
788
|
for (let layoutIndex = layoutEntriesAtPosition.length - 1; layoutIndex >= 0; layoutIndex--) {
|
|
657
789
|
const layoutEntry = layoutEntriesAtPosition[layoutIndex];
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
...withUseCacheLayoutMarker(LayoutComponent, { params: options.makeThenableParams(layoutEntry.params) }),
|
|
790
|
+
slotElement = createSlotLayoutElement(layoutEntry.component, withUseCacheLayoutMarker(layoutEntry.component, {
|
|
791
|
+
params: options.makeThenableParams(layoutEntry.params),
|
|
661
792
|
children: slotElement
|
|
662
|
-
});
|
|
793
|
+
}), targetIndex >= 0 ? targetIndex : void 0, prefetchSlotLoadingEntry ? void 0 : resolveSlotNotFoundBoundary(treePosition));
|
|
663
794
|
}
|
|
664
795
|
}
|
|
665
796
|
const unalignedBfcacheSegment = nestedBfcacheSegments.find((segment) => segment.treePosition === null);
|
|
@@ -670,7 +801,8 @@ function buildAppPageElements(options) {
|
|
|
670
801
|
});
|
|
671
802
|
const ownerLoadingEntry = isPrefetchLoadingShell ? void 0 : findNearestLoadingEntryAtOrAbove(ownerTreePosition);
|
|
672
803
|
const ownerLoadingComponent = getDefaultExport(ownerLoadingEntry?.loadingModule);
|
|
673
|
-
|
|
804
|
+
const slotLayoutTreePosition = layoutEntries[targetIndex]?.treePosition;
|
|
805
|
+
if (ownerLoadingComponent && ownerLoadingEntry && (slotLayoutTreePosition === void 0 || isOutermostEntryBelowLoading(ownerLoadingEntry.treePosition, slotLayoutTreePosition, "slot"))) {
|
|
674
806
|
const OwnerLoadingComponent = ownerLoadingComponent;
|
|
675
807
|
const ownerResetKey = resolveRouteSegmentResetKey(ownerLoadingEntry.treePosition);
|
|
676
808
|
slotElement = /* @__PURE__ */ jsx(Suspense, {
|
|
@@ -684,7 +816,7 @@ function buildAppPageElements(options) {
|
|
|
684
816
|
providerId: pageElementId,
|
|
685
817
|
segmentMap: { children: [APP_PAGE_SEGMENT_KEY] },
|
|
686
818
|
children: /* @__PURE__ */ jsx(Slot, { id: pageElementId })
|
|
687
|
-
}),
|
|
819
|
+
}), renderElementWithMetadataOutlet ? null : streamingMetadataOutlet] });
|
|
688
820
|
if (isPrefetchLoadingShell) {
|
|
689
821
|
if (prefetchLoadingComponent === null) routeChildren = null;
|
|
690
822
|
else routeChildren = /* @__PURE__ */ jsx(prefetchLoadingComponent, {});
|
|
@@ -700,24 +832,41 @@ function buildAppPageElements(options) {
|
|
|
700
832
|
routeChildren = /* @__PURE__ */ jsx(AppRouterScrollTarget, { children: routeChildren });
|
|
701
833
|
}
|
|
702
834
|
const lastLayoutErrorModule = errorEntries.length > 0 ? errorEntries[errorEntries.length - 1].errorModule : null;
|
|
703
|
-
const
|
|
704
|
-
|
|
705
|
-
|
|
835
|
+
const resolveAccessBoundaryOwner = (boundaries, pageModule) => {
|
|
836
|
+
let deepest = null;
|
|
837
|
+
for (const treePosition of boundaries.keys()) if (treePosition < routeSegments.length && (deepest === null || treePosition > deepest)) deepest = treePosition;
|
|
838
|
+
return deepest !== null && boundaries.get(deepest)?.module === pageModule ? deepest : null;
|
|
839
|
+
};
|
|
840
|
+
const resolvePageAccessModule = (routeModule, rootModule) => (getDefaultExport(routeModule) ? routeModule : null) ?? (getDefaultExport(rootModule) ? rootModule : null) ?? null;
|
|
841
|
+
const notFoundPageModule = resolvePageAccessModule(options.route.notFound, rootNotFoundModule);
|
|
842
|
+
const forbiddenPageModule = resolvePageAccessModule(options.route.forbidden, rootForbiddenModule);
|
|
843
|
+
const unauthorizedPageModule = resolvePageAccessModule(options.route.unauthorized, rootUnauthorizedModule);
|
|
844
|
+
const notFoundOwnerTreePosition = resolveAccessBoundaryOwner(notFoundBoundaries, notFoundPageModule);
|
|
845
|
+
const forbiddenOwnerTreePosition = resolveAccessBoundaryOwner(forbiddenBoundaries, forbiddenPageModule);
|
|
846
|
+
const unauthorizedOwnerTreePosition = resolveAccessBoundaryOwner(unauthorizedBoundaries, unauthorizedPageModule);
|
|
847
|
+
const notFoundComponent = getDefaultExport(notFoundPageModule) ?? (layoutEntries.length === 0 ? DEFAULT_NOT_FOUND_COMPONENT : null);
|
|
848
|
+
const identifiesPageNotFoundCatcher = !renderElementWithMetadataOutlet;
|
|
849
|
+
const isPageNotFoundCaughtAtPage = identifiesPageNotFoundCatcher && notFoundComponent !== null && notFoundOwnerTreePosition === null;
|
|
850
|
+
let pageNotFoundCatcherTreePosition = null;
|
|
851
|
+
if (identifiesPageNotFoundCatcher && !isPageNotFoundCaughtAtPage) {
|
|
852
|
+
for (const treePosition of notFoundBoundaries.keys()) if (pageNotFoundCatcherTreePosition === null || treePosition > pageNotFoundCatcherTreePosition) pageNotFoundCatcherTreePosition = treePosition;
|
|
853
|
+
}
|
|
706
854
|
if (notFoundComponent) routeChildren = /* @__PURE__ */ jsx(NotFoundBoundary, {
|
|
707
855
|
resetKey: routeResetKey,
|
|
708
|
-
|
|
856
|
+
caughtId: isPageNotFoundCaughtAtPage ? APP_PAGE_NOT_FOUND_BOUNDARY_ID : void 0,
|
|
857
|
+
fallback: notFoundOwnerTreePosition === null ? /* @__PURE__ */ jsx(notFoundComponent, {}) : /* @__PURE__ */ jsx(HttpAccessFallbackPassthrough, { status: 404 }),
|
|
709
858
|
children: routeChildren
|
|
710
859
|
});
|
|
711
|
-
const forbiddenComponent = getDefaultExport(
|
|
860
|
+
const forbiddenComponent = getDefaultExport(forbiddenPageModule);
|
|
712
861
|
if (forbiddenComponent) routeChildren = /* @__PURE__ */ jsx(ForbiddenBoundary, {
|
|
713
862
|
resetKey: routeResetKey,
|
|
714
|
-
fallback: /* @__PURE__ */ jsx(forbiddenComponent, {}),
|
|
863
|
+
fallback: forbiddenOwnerTreePosition === null ? /* @__PURE__ */ jsx(forbiddenComponent, {}) : /* @__PURE__ */ jsx(HttpAccessFallbackPassthrough, { status: 403 }),
|
|
715
864
|
children: routeChildren
|
|
716
865
|
});
|
|
717
|
-
const unauthorizedComponent = getDefaultExport(
|
|
866
|
+
const unauthorizedComponent = getDefaultExport(unauthorizedPageModule);
|
|
718
867
|
if (unauthorizedComponent) routeChildren = /* @__PURE__ */ jsx(UnauthorizedBoundary, {
|
|
719
868
|
resetKey: routeResetKey,
|
|
720
|
-
fallback: /* @__PURE__ */ jsx(unauthorizedComponent, {}),
|
|
869
|
+
fallback: unauthorizedOwnerTreePosition === null ? /* @__PURE__ */ jsx(unauthorizedComponent, {}) : /* @__PURE__ */ jsx(HttpAccessFallbackPassthrough, { status: 401 }),
|
|
721
870
|
children: routeChildren
|
|
722
871
|
});
|
|
723
872
|
const pageErrorComponent = getErrorBoundaryExport(options.route.error);
|
|
@@ -742,23 +891,24 @@ function buildAppPageElements(options) {
|
|
|
742
891
|
children: segmentChildren
|
|
743
892
|
}, segmentResetKey || routeResetKey);
|
|
744
893
|
}
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
const
|
|
753
|
-
if (
|
|
754
|
-
|
|
755
|
-
|
|
894
|
+
const accessBoundaries = [
|
|
895
|
+
[notFoundBoundaries, NotFoundBoundary],
|
|
896
|
+
[forbiddenBoundaries, ForbiddenBoundary],
|
|
897
|
+
[unauthorizedBoundaries, UnauthorizedBoundary]
|
|
898
|
+
];
|
|
899
|
+
const accessResetKey = resolveAppPageTemplateStateKey(routeSegments, treePosition, options.matchedParams);
|
|
900
|
+
for (const [boundaries, AccessBoundary] of accessBoundaries) {
|
|
901
|
+
const boundary = boundaries.get(treePosition);
|
|
902
|
+
if (!boundary) continue;
|
|
903
|
+
const BoundaryComponent = boundary.component;
|
|
904
|
+
segmentChildren = AccessBoundary === NotFoundBoundary && treePosition === pageNotFoundCatcherTreePosition ? /* @__PURE__ */ jsx(NotFoundBoundary, {
|
|
905
|
+
resetKey: accessResetKey,
|
|
906
|
+
fallback: /* @__PURE__ */ jsx(BoundaryComponent, {}),
|
|
907
|
+
caughtId: APP_PAGE_NOT_FOUND_BOUNDARY_ID,
|
|
756
908
|
children: segmentChildren
|
|
757
|
-
})
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
resetKey: segmentResetKey,
|
|
761
|
-
fallback: /* @__PURE__ */ jsx(layoutUnauthorizedComponent, {}),
|
|
909
|
+
}) : /* @__PURE__ */ jsx(AccessBoundary, {
|
|
910
|
+
resetKey: accessResetKey,
|
|
911
|
+
fallback: /* @__PURE__ */ jsx(BoundaryComponent, {}),
|
|
762
912
|
children: segmentChildren
|
|
763
913
|
});
|
|
764
914
|
}
|
|
@@ -31,6 +31,7 @@ type CreateAppPageRscRenderStatusResolverOptions = {
|
|
|
31
31
|
loadSsrHandler: () => Promise<AppPageSsrHandler>;
|
|
32
32
|
navigationContext: NavigationContext | null;
|
|
33
33
|
rootParams?: RootParams;
|
|
34
|
+
routePattern: string;
|
|
34
35
|
};
|
|
35
36
|
/**
|
|
36
37
|
* Resolve an RSC-only render's status once its Flight payload is complete.
|
|
@@ -45,4 +46,5 @@ export declare function createAppPageRscRenderStatusResolver(options: CreateAppP
|
|
|
45
46
|
* payload carries a redirect, so a redirect is a 200 with its `location`.
|
|
46
47
|
*/
|
|
47
48
|
export declare function resolveAppPageRscResponseStatus(status: number): number;
|
|
48
|
-
//#endregion
|
|
49
|
+
//#endregion
|
|
50
|
+
export {};
|
|
@@ -28,6 +28,7 @@ async function resolveAppPageRscRenderStatus(options) {
|
|
|
28
28
|
isForceStatic: options.isForceStatic,
|
|
29
29
|
isStaticGeneration: true,
|
|
30
30
|
onSsrError: () => void 0,
|
|
31
|
+
preloadRoutePattern: options.routePattern,
|
|
31
32
|
rootParams: options.rootParams
|
|
32
33
|
});
|
|
33
34
|
} catch (error) {
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { ThenableParams, ThenableParamsObserver } from "../shims/thenable-params.js";
|
|
2
2
|
import { AppPageSearchParams } from "./app-page-head.js";
|
|
3
3
|
//#region src/server/app-page-search-params-observation.d.ts
|
|
4
|
-
type AppPageSearchParamsObservationOptions = {
|
|
5
|
-
observeReactPromiseStatus?: boolean;
|
|
6
|
-
};
|
|
7
4
|
type ClientPageSsrSearchParamsOptions = {
|
|
8
5
|
isForceStatic?: boolean;
|
|
9
6
|
isPprFallbackShell?: boolean;
|
|
10
7
|
};
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
/**
|
|
9
|
+
* The observer a route's head hands generateMetadata() and generateViewport()
|
|
10
|
+
* for `searchParams`, or none when a read doesn't count (`force-static`).
|
|
11
|
+
*/
|
|
12
|
+
export declare function createAppPageMetadataSearchParamsObserver(observe: boolean): ThenableParamsObserver | undefined;
|
|
13
|
+
export declare function makeObservedAppPageSearchParamsThenable(pageSearchParams: AppPageSearchParams): ThenableParams<AppPageSearchParams>;
|
|
13
14
|
/**
|
|
14
15
|
* The `searchParams` a client page receives during SSR (see
|
|
15
16
|
* `shims/client-page-root.tsx`). Its RSC payload carries no query, so this is
|
|
@@ -29,4 +30,5 @@ export declare function makeClientPageSsrSearchParamsThenable(searchParams: URLS
|
|
|
29
30
|
* The cache lives in this render's navigation context and is dropped with it.
|
|
30
31
|
*/
|
|
31
32
|
export declare function createClientPageSsrSearchParamsSource(searchParams: URLSearchParams, options: ClientPageSsrSearchParamsOptions): (pageProps: object) => ThenableParams<AppPageSearchParams>;
|
|
32
|
-
//#endregion
|
|
33
|
+
//#endregion
|
|
34
|
+
export {};
|
|
@@ -9,17 +9,22 @@ function markAppPageSearchParamsAccess() {
|
|
|
9
9
|
markRenderRequestApiUsage("searchParams");
|
|
10
10
|
}
|
|
11
11
|
function createAppPageSearchParamsObserver() {
|
|
12
|
-
return {
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
return {
|
|
13
|
+
observeParamAccess() {
|
|
14
|
+
markAppPageSearchParamsAccess();
|
|
15
|
+
},
|
|
16
|
+
observeThenRead: throwIfStaticGenerationAccessError
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The observer a route's head hands generateMetadata() and generateViewport()
|
|
21
|
+
* for `searchParams`, or none when a read doesn't count (`force-static`).
|
|
22
|
+
*/
|
|
23
|
+
function createAppPageMetadataSearchParamsObserver(observe) {
|
|
24
|
+
return observe ? createAppPageSearchParamsObserver() : void 0;
|
|
15
25
|
}
|
|
16
|
-
function makeObservedAppPageSearchParamsThenable(pageSearchParams
|
|
17
|
-
|
|
18
|
-
if (options.observeReactPromiseStatus === true) return makeThenableParams(pageSearchParams, {
|
|
19
|
-
...observer,
|
|
20
|
-
observeReactPromiseStatus: true
|
|
21
|
-
});
|
|
22
|
-
return makeThenableParams(pageSearchParams, observer);
|
|
26
|
+
function makeObservedAppPageSearchParamsThenable(pageSearchParams) {
|
|
27
|
+
return makeThenableParams(pageSearchParams, createAppPageSearchParamsObserver());
|
|
23
28
|
}
|
|
24
29
|
/**
|
|
25
30
|
* The `searchParams` a client page receives during SSR (see
|
|
@@ -57,4 +62,4 @@ function makeClientPageSsrSearchParamsThenableFromRecord(pageSearchParams, optio
|
|
|
57
62
|
return options.isForceStatic !== true && options.isPprFallbackShell !== true ? makeObservedAppPageSearchParamsThenable(pageSearchParams) : makeThenableParams(pageSearchParams);
|
|
58
63
|
}
|
|
59
64
|
//#endregion
|
|
60
|
-
export {
|
|
65
|
+
export { createAppPageMetadataSearchParamsObserver, createClientPageSsrSearchParamsSource, makeClientPageSsrSearchParamsThenable, makeObservedAppPageSearchParamsThenable };
|
|
@@ -52,4 +52,5 @@ export declare function createAppPageSegmentPlan<TModule extends AppPageModule,
|
|
|
52
52
|
slotBindings: readonly AppElementsSlotBinding[];
|
|
53
53
|
templateEntries: readonly AppPageTemplateEntry<TModule>[];
|
|
54
54
|
}): AppPageSegmentPlan<TModule>;
|
|
55
|
-
//#endregion
|
|
55
|
+
//#endregion
|
|
56
|
+
export {};
|
|
@@ -22,6 +22,12 @@ export type AppSsrRenderResult = {
|
|
|
22
22
|
renderComplete?: Promise<void>;
|
|
23
23
|
capturedRscData: Promise<ArrayBuffer> | null;
|
|
24
24
|
shellErrorRecovered?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* The special error that rejected the shell, when parallel slot not-found
|
|
27
|
+
* boundaries caught it in a second render of the same payload. The document
|
|
28
|
+
* is that error's, with its status.
|
|
29
|
+
*/
|
|
30
|
+
caughtShellError?: unknown;
|
|
25
31
|
/**
|
|
26
32
|
* Preload `Link` header value emitted by React during SSR (via `onHeaders`),
|
|
27
33
|
* already capped to `reactMaxHeadersLength`. Empty/undefined when React
|
|
@@ -71,6 +77,8 @@ export type AppPageSsrHandler = {
|
|
|
71
77
|
};
|
|
72
78
|
/** Abort signal for a build-time PPR fallback-shell static render. */
|
|
73
79
|
pprFallbackShellSignal?: AbortSignal;
|
|
80
|
+
/** Route whose client references load before the render; null for none. */
|
|
81
|
+
preloadRoutePattern?: string | null;
|
|
74
82
|
/** When true, wait for the full React tree before emitting bytes. */
|
|
75
83
|
waitForAllReady?: boolean;
|
|
76
84
|
/** Render is producing a static/prerendered HTML artifact. */
|
|
@@ -90,6 +98,8 @@ export type AppPageSsrHandler = {
|
|
|
90
98
|
* default `__next_error__` error-document shell (with the original
|
|
91
99
|
* flight payload and bootstrap) instead of rejecting. See handleSsr. */
|
|
92
100
|
fallbackToErrorDocumentOnShellError?: boolean;
|
|
101
|
+
/** The parallel slot not-found boundaries that catch a shell error. See handleSsr. */
|
|
102
|
+
resolveCaughtNotFoundBoundaries?: (error: unknown) => readonly string[] | null;
|
|
93
103
|
dynamicStaleTimeSeconds?: number;
|
|
94
104
|
getInitialNavigationCacheMetadata?: () => InitialNavigationCacheMetadata;
|
|
95
105
|
}) => Promise<ReadableStream<Uint8Array> | AppSsrRenderResult>;
|
|
@@ -128,6 +138,11 @@ type RenderAppPageHtmlStreamOptions = {
|
|
|
128
138
|
};
|
|
129
139
|
/** Abort signal for a build-time PPR fallback-shell static render. */
|
|
130
140
|
pprFallbackShellSignal?: AbortSignal;
|
|
141
|
+
/**
|
|
142
|
+
* Route whose client references load before the render, or null for a
|
|
143
|
+
* render without a route. Undefined loads every client reference.
|
|
144
|
+
*/
|
|
145
|
+
preloadRoutePattern?: string | null;
|
|
131
146
|
/** When true, wait for the full React tree before emitting bytes. */
|
|
132
147
|
waitForAllReady?: boolean;
|
|
133
148
|
/** Render is producing a static/prerendered HTML artifact. */
|
|
@@ -138,6 +153,8 @@ type RenderAppPageHtmlStreamOptions = {
|
|
|
138
153
|
isCacheCandidate?: boolean;
|
|
139
154
|
/** Override the default shell-error recovery decision passed to handleSsr. */
|
|
140
155
|
fallbackToErrorDocumentOnShellError?: boolean;
|
|
156
|
+
/** The parallel slot not-found boundaries that catch a shell error. See handleSsr. */
|
|
157
|
+
resolveCaughtNotFoundBoundaries?: (error: unknown) => readonly string[] | null;
|
|
141
158
|
/** Dev-only: original server error to surface in the browser overlay. */
|
|
142
159
|
initialDevServerError?: unknown;
|
|
143
160
|
/** Report an SSR/Fizz render failure through instrumentation. */
|
|
@@ -171,9 +188,20 @@ type RenderAppPageHtmlStreamWithRecoveryOptions<TSpecialError> = {
|
|
|
171
188
|
onShellRendered?: () => void;
|
|
172
189
|
renderErrorBoundaryResponse: (error: unknown) => Promise<Response | null>;
|
|
173
190
|
renderHtmlStream: () => Promise<ReadableStream<Uint8Array> | AppSsrRenderResult>;
|
|
174
|
-
|
|
191
|
+
/**
|
|
192
|
+
* The document of a special error that rejected the shell. With
|
|
193
|
+
* `caughtDocument`, parallel slot boundaries caught it in the page's own
|
|
194
|
+
* document, which that response sends.
|
|
195
|
+
*/
|
|
196
|
+
renderSpecialErrorResponse: (specialError: TSpecialError, caughtDocument?: AppPageCaughtShellErrorDocument) => Promise<Response>;
|
|
175
197
|
resolveSpecialError: (error: unknown) => TSpecialError | null;
|
|
176
198
|
};
|
|
199
|
+
/** The page's document, rendered with the slot boundaries that caught its shell error. */
|
|
200
|
+
type AppPageCaughtShellErrorDocument = {
|
|
201
|
+
htmlStream: ReadableStream<Uint8Array>;
|
|
202
|
+
/** React-emitted preload `Link` header (already capped). */
|
|
203
|
+
linkHeader?: string;
|
|
204
|
+
};
|
|
177
205
|
type AppPageRscErrorTracker = {
|
|
178
206
|
getCapturedError: () => unknown;
|
|
179
207
|
/**
|
|
@@ -195,6 +223,15 @@ export declare function createAppPageSsrErrorHandler(baseOnError: (error: unknow
|
|
|
195
223
|
export declare function createAppPageFontData(options: CreateAppPageFontDataOptions): AppPageFontData;
|
|
196
224
|
export declare function renderAppPageHtmlStream(options: RenderAppPageHtmlStreamOptions): Promise<AppSsrRenderResult>;
|
|
197
225
|
export declare function renderAppPageHtmlResponse(options: RenderAppPageHtmlResponseOptions): Promise<Response>;
|
|
226
|
+
export declare function buildAppPageHtmlDocumentResponse(htmlStream: ReadableStream<Uint8Array>, options: {
|
|
227
|
+
clearRequestContext: () => void;
|
|
228
|
+
fontLinkHeader?: string;
|
|
229
|
+
isEdgeRuntime?: boolean;
|
|
230
|
+
middlewareHeaders?: Headers | null;
|
|
231
|
+
reactLinkHeader?: string;
|
|
232
|
+
reactMaxHeadersLength?: number;
|
|
233
|
+
status: number;
|
|
234
|
+
}): Response;
|
|
198
235
|
export declare function renderAppPageHtmlStreamWithRecovery<TSpecialError>(options: RenderAppPageHtmlStreamWithRecoveryOptions<TSpecialError>): Promise<AppPageHtmlStreamRecoveryResult>;
|
|
199
236
|
export declare function createAppPageRscErrorTracker(baseOnError: (error: unknown, requestInfo: unknown, errorContext: unknown) => unknown): AppPageRscErrorTracker;
|
|
200
237
|
//#endregion
|