@qzsy/vinext 0.1.7
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/LICENSE +21 -0
- package/README.md +773 -0
- package/dist/build/assets-ignore.d.ts +32 -0
- package/dist/build/assets-ignore.js +48 -0
- package/dist/build/clean-output.d.ts +13 -0
- package/dist/build/clean-output.js +34 -0
- package/dist/build/client-build-config.d.ts +171 -0
- package/dist/build/client-build-config.js +270 -0
- package/dist/build/css-url-assets.d.ts +29 -0
- package/dist/build/css-url-assets.js +213 -0
- package/dist/build/google-fonts/build-url.d.ts +9 -0
- package/dist/build/google-fonts/build-url.js +28 -0
- package/dist/build/google-fonts/fallback-metrics-data.js +14029 -0
- package/dist/build/google-fonts/fallback-metrics.d.ts +12 -0
- package/dist/build/google-fonts/fallback-metrics.js +44 -0
- package/dist/build/google-fonts/find-font-files-in-css.d.ts +16 -0
- package/dist/build/google-fonts/find-font-files-in-css.js +28 -0
- package/dist/build/google-fonts/font-data.js +24983 -0
- package/dist/build/google-fonts/font-metadata.d.ts +16 -0
- package/dist/build/google-fonts/font-metadata.js +5 -0
- package/dist/build/google-fonts/get-axes.d.ts +6 -0
- package/dist/build/google-fonts/get-axes.js +37 -0
- package/dist/build/google-fonts/sort-variants.d.ts +4 -0
- package/dist/build/google-fonts/sort-variants.js +12 -0
- package/dist/build/google-fonts/validate.d.ts +27 -0
- package/dist/build/google-fonts/validate.js +54 -0
- package/dist/build/inline-css.d.ts +6 -0
- package/dist/build/inline-css.js +48 -0
- package/dist/build/layout-classification-types.d.ts +61 -0
- package/dist/build/layout-classification-types.js +1 -0
- package/dist/build/layout-classification.d.ts +59 -0
- package/dist/build/layout-classification.js +98 -0
- package/dist/build/next-client-runtime-manifests.d.ts +14 -0
- package/dist/build/next-client-runtime-manifests.js +39 -0
- package/dist/build/nitro-route-rules.d.ts +49 -0
- package/dist/build/nitro-route-rules.js +79 -0
- package/dist/build/precompress.d.ts +27 -0
- package/dist/build/precompress.js +110 -0
- package/dist/build/prerender.d.ts +209 -0
- package/dist/build/prerender.js +932 -0
- package/dist/build/report.d.ts +132 -0
- package/dist/build/report.js +504 -0
- package/dist/build/route-classification-injector.d.ts +34 -0
- package/dist/build/route-classification-injector.js +59 -0
- package/dist/build/route-classification-manifest.d.ts +52 -0
- package/dist/build/route-classification-manifest.js +143 -0
- package/dist/build/run-prerender.d.ts +61 -0
- package/dist/build/run-prerender.js +224 -0
- package/dist/build/server-manifest.d.ts +18 -0
- package/dist/build/server-manifest.js +22 -0
- package/dist/build/ssr-manifest.d.ts +18 -0
- package/dist/build/ssr-manifest.js +69 -0
- package/dist/build/standalone.d.ts +31 -0
- package/dist/build/standalone.js +203 -0
- package/dist/build/static-export.d.ts +55 -0
- package/dist/build/static-export.js +60 -0
- package/dist/cache/cache-adapters-virtual.d.ts +50 -0
- package/dist/cache/cache-adapters-virtual.js +45 -0
- package/dist/cache.d.ts +2 -0
- package/dist/cache.js +2 -0
- package/dist/check.d.ts +87 -0
- package/dist/check.js +1037 -0
- package/dist/cli-args.d.ts +33 -0
- package/dist/cli-args.js +124 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +744 -0
- package/dist/client/app-nav-failure-handler.d.ts +8 -0
- package/dist/client/app-nav-failure-handler.js +44 -0
- package/dist/client/empty-module.d.ts +1 -0
- package/dist/client/empty-module.js +1 -0
- package/dist/client/instrumentation-client-inject.d.ts +33 -0
- package/dist/client/instrumentation-client-inject.js +55 -0
- package/dist/client/instrumentation-client-state.d.ts +9 -0
- package/dist/client/instrumentation-client-state.js +17 -0
- package/dist/client/instrumentation-client.d.ts +7 -0
- package/dist/client/instrumentation-client.js +6 -0
- package/dist/client/navigation-runtime.d.ts +70 -0
- package/dist/client/navigation-runtime.js +169 -0
- package/dist/client/pages-router-link-navigation.d.ts +61 -0
- package/dist/client/pages-router-link-navigation.js +42 -0
- package/dist/client/validate-module-path.d.ts +17 -0
- package/dist/client/validate-module-path.js +24 -0
- package/dist/client/vinext-next-data.d.ts +44 -0
- package/dist/client/vinext-next-data.js +50 -0
- package/dist/client/window-next.d.ts +168 -0
- package/dist/client/window-next.js +57 -0
- package/dist/cloudflare/index.d.ts +3 -0
- package/dist/cloudflare/index.js +3 -0
- package/dist/cloudflare/src/cache/cdn-adapter.runtime.js +102 -0
- package/dist/cloudflare/src/cache/kv-data-adapter.runtime.d.ts +126 -0
- package/dist/cloudflare/src/cache/kv-data-adapter.runtime.js +435 -0
- package/dist/cloudflare/src/utils/cache-control-metadata.js +20 -0
- package/dist/cloudflare/tpr.d.ts +82 -0
- package/dist/cloudflare/tpr.js +558 -0
- package/dist/config/config-matchers.d.ts +257 -0
- package/dist/config/config-matchers.js +1046 -0
- package/dist/config/dotenv.d.ts +56 -0
- package/dist/config/dotenv.js +88 -0
- package/dist/config/next-config.d.ts +540 -0
- package/dist/config/next-config.js +1050 -0
- package/dist/config/tsconfig-paths.d.ts +21 -0
- package/dist/config/tsconfig-paths.js +157 -0
- package/dist/deploy.d.ts +190 -0
- package/dist/deploy.js +1033 -0
- package/dist/entries/app-browser-entry.d.ts +29 -0
- package/dist/entries/app-browser-entry.js +83 -0
- package/dist/entries/app-rsc-entry.d.ts +81 -0
- package/dist/entries/app-rsc-entry.js +943 -0
- package/dist/entries/app-rsc-manifest.d.ts +53 -0
- package/dist/entries/app-rsc-manifest.js +294 -0
- package/dist/entries/app-ssr-entry.d.ts +15 -0
- package/dist/entries/app-ssr-entry.js +24 -0
- package/dist/entries/pages-client-entry.d.ts +11 -0
- package/dist/entries/pages-client-entry.js +204 -0
- package/dist/entries/pages-entry-helpers.d.ts +2 -0
- package/dist/entries/pages-entry-helpers.js +2 -0
- package/dist/entries/pages-server-entry.d.ts +11 -0
- package/dist/entries/pages-server-entry.js +398 -0
- package/dist/entries/runtime-entry-module.d.ts +25 -0
- package/dist/entries/runtime-entry-module.js +46 -0
- package/dist/index.d.ts +115 -0
- package/dist/index.js +2661 -0
- package/dist/init.d.ts +69 -0
- package/dist/init.js +253 -0
- package/dist/plugins/ast-utils.d.ts +20 -0
- package/dist/plugins/ast-utils.js +78 -0
- package/dist/plugins/async-hooks-stub.d.ts +18 -0
- package/dist/plugins/async-hooks-stub.js +40 -0
- package/dist/plugins/client-reference-dedup.d.ts +35 -0
- package/dist/plugins/client-reference-dedup.js +189 -0
- package/dist/plugins/css-data-url.d.ts +6 -0
- package/dist/plugins/css-data-url.js +83 -0
- package/dist/plugins/dynamic-preload-metadata.d.ts +13 -0
- package/dist/plugins/dynamic-preload-metadata.js +413 -0
- package/dist/plugins/extensionless-dynamic-import.d.ts +6 -0
- package/dist/plugins/extensionless-dynamic-import.js +155 -0
- package/dist/plugins/fonts.d.ts +95 -0
- package/dist/plugins/fonts.js +711 -0
- package/dist/plugins/import-meta-url.d.ts +16 -0
- package/dist/plugins/import-meta-url.js +353 -0
- package/dist/plugins/instrumentation-client.d.ts +6 -0
- package/dist/plugins/instrumentation-client.js +27 -0
- package/dist/plugins/middleware-export-validation.d.ts +5 -0
- package/dist/plugins/middleware-export-validation.js +36 -0
- package/dist/plugins/middleware-server-only.d.ts +53 -0
- package/dist/plugins/middleware-server-only.js +90 -0
- package/dist/plugins/og-asset-ownership.d.ts +27 -0
- package/dist/plugins/og-asset-ownership.js +285 -0
- package/dist/plugins/og-assets.d.ts +50 -0
- package/dist/plugins/og-assets.js +229 -0
- package/dist/plugins/optimize-imports.d.ts +42 -0
- package/dist/plugins/optimize-imports.js +587 -0
- package/dist/plugins/postcss.d.ts +26 -0
- package/dist/plugins/postcss.js +96 -0
- package/dist/plugins/remove-console.d.ts +21 -0
- package/dist/plugins/remove-console.js +177 -0
- package/dist/plugins/require-context.d.ts +6 -0
- package/dist/plugins/require-context.js +185 -0
- package/dist/plugins/rsc-client-reference-loaders.d.ts +6 -0
- package/dist/plugins/rsc-client-reference-loaders.js +46 -0
- package/dist/plugins/rsc-client-shim-excludes.d.ts +6 -0
- package/dist/plugins/rsc-client-shim-excludes.js +35 -0
- package/dist/plugins/sass.d.ts +62 -0
- package/dist/plugins/sass.js +268 -0
- package/dist/plugins/server-externals-manifest.d.ts +26 -0
- package/dist/plugins/server-externals-manifest.js +81 -0
- package/dist/plugins/strip-server-exports.d.ts +21 -0
- package/dist/plugins/strip-server-exports.js +519 -0
- package/dist/plugins/typeof-window.d.ts +14 -0
- package/dist/plugins/typeof-window.js +150 -0
- package/dist/plugins/wasm-module-import.d.ts +15 -0
- package/dist/plugins/wasm-module-import.js +50 -0
- package/dist/routing/app-route-graph.d.ts +336 -0
- package/dist/routing/app-route-graph.js +1518 -0
- package/dist/routing/app-router.d.ts +30 -0
- package/dist/routing/app-router.js +59 -0
- package/dist/routing/file-matcher.d.ts +60 -0
- package/dist/routing/file-matcher.js +147 -0
- package/dist/routing/pages-router.d.ts +48 -0
- package/dist/routing/pages-router.js +163 -0
- package/dist/routing/route-matching.d.ts +27 -0
- package/dist/routing/route-matching.js +42 -0
- package/dist/routing/route-pattern.d.ts +64 -0
- package/dist/routing/route-pattern.js +165 -0
- package/dist/routing/route-trie.d.ts +67 -0
- package/dist/routing/route-trie.js +143 -0
- package/dist/routing/route-validation.d.ts +10 -0
- package/dist/routing/route-validation.js +101 -0
- package/dist/routing/utils.d.ts +117 -0
- package/dist/routing/utils.js +242 -0
- package/dist/server/accept-encoding.d.ts +29 -0
- package/dist/server/accept-encoding.js +95 -0
- package/dist/server/api-handler.d.ts +17 -0
- package/dist/server/api-handler.js +276 -0
- package/dist/server/app-action-request.d.ts +4 -0
- package/dist/server/app-action-request.js +9 -0
- package/dist/server/app-bfcache-id.d.ts +5 -0
- package/dist/server/app-bfcache-id.js +5 -0
- package/dist/server/app-bfcache-identity.d.ts +36 -0
- package/dist/server/app-bfcache-identity.js +156 -0
- package/dist/server/app-browser-action-result.d.ts +64 -0
- package/dist/server/app-browser-action-result.js +111 -0
- package/dist/server/app-browser-client-reuse-manifest.d.ts +12 -0
- package/dist/server/app-browser-client-reuse-manifest.js +101 -0
- package/dist/server/app-browser-entry.d.ts +1 -0
- package/dist/server/app-browser-entry.js +1087 -0
- package/dist/server/app-browser-error.d.ts +13 -0
- package/dist/server/app-browser-error.js +52 -0
- package/dist/server/app-browser-history-controller.d.ts +104 -0
- package/dist/server/app-browser-history-controller.js +210 -0
- package/dist/server/app-browser-hydration.d.ts +32 -0
- package/dist/server/app-browser-hydration.js +29 -0
- package/dist/server/app-browser-interception-context.d.ts +24 -0
- package/dist/server/app-browser-interception-context.js +43 -0
- package/dist/server/app-browser-mpa-navigation.d.ts +16 -0
- package/dist/server/app-browser-mpa-navigation.js +42 -0
- package/dist/server/app-browser-navigation-controller.d.ts +109 -0
- package/dist/server/app-browser-navigation-controller.js +465 -0
- package/dist/server/app-browser-popstate.d.ts +26 -0
- package/dist/server/app-browser-popstate.js +44 -0
- package/dist/server/app-browser-rsc-redirect.d.ts +38 -0
- package/dist/server/app-browser-rsc-redirect.js +64 -0
- package/dist/server/app-browser-server-action-client.d.ts +32 -0
- package/dist/server/app-browser-server-action-client.js +128 -0
- package/dist/server/app-browser-server-action-navigation.d.ts +6 -0
- package/dist/server/app-browser-server-action-navigation.js +9 -0
- package/dist/server/app-browser-state.d.ts +140 -0
- package/dist/server/app-browser-state.js +315 -0
- package/dist/server/app-browser-stream.d.ts +28 -0
- package/dist/server/app-browser-stream.js +122 -0
- package/dist/server/app-browser-visible-commit.d.ts +78 -0
- package/dist/server/app-browser-visible-commit.js +241 -0
- package/dist/server/app-client-reference-preloader.d.ts +14 -0
- package/dist/server/app-client-reference-preloader.js +44 -0
- package/dist/server/app-elements-wire.d.ts +192 -0
- package/dist/server/app-elements-wire.js +443 -0
- package/dist/server/app-elements.d.ts +9 -0
- package/dist/server/app-elements.js +18 -0
- package/dist/server/app-fallback-renderer.d.ts +89 -0
- package/dist/server/app-fallback-renderer.js +136 -0
- package/dist/server/app-history-state.d.ts +85 -0
- package/dist/server/app-history-state.js +223 -0
- package/dist/server/app-hook-warning-suppression.d.ts +6 -0
- package/dist/server/app-hook-warning-suppression.js +10 -0
- package/dist/server/app-inline-css-client.d.ts +6 -0
- package/dist/server/app-inline-css-client.js +35 -0
- package/dist/server/app-interception-context-header.d.ts +32 -0
- package/dist/server/app-interception-context-header.js +42 -0
- package/dist/server/app-layout-param-observation.d.ts +43 -0
- package/dist/server/app-layout-param-observation.js +168 -0
- package/dist/server/app-middleware.d.ts +46 -0
- package/dist/server/app-middleware.js +168 -0
- package/dist/server/app-mounted-slots-header.d.ts +35 -0
- package/dist/server/app-mounted-slots-header.js +58 -0
- package/dist/server/app-optimistic-routing.d.ts +53 -0
- package/dist/server/app-optimistic-routing.js +227 -0
- package/dist/server/app-page-boundary-render.d.ts +85 -0
- package/dist/server/app-page-boundary-render.js +305 -0
- package/dist/server/app-page-boundary.d.ts +102 -0
- package/dist/server/app-page-boundary.js +120 -0
- package/dist/server/app-page-cache-finalizer.d.ts +62 -0
- package/dist/server/app-page-cache-finalizer.js +122 -0
- package/dist/server/app-page-cache-render.d.ts +53 -0
- package/dist/server/app-page-cache-render.js +91 -0
- package/dist/server/app-page-cache.d.ts +83 -0
- package/dist/server/app-page-cache.js +272 -0
- package/dist/server/app-page-dispatch.d.ts +223 -0
- package/dist/server/app-page-dispatch.js +610 -0
- package/dist/server/app-page-element-builder.d.ts +96 -0
- package/dist/server/app-page-element-builder.js +205 -0
- package/dist/server/app-page-execution.d.ts +138 -0
- package/dist/server/app-page-execution.js +328 -0
- package/dist/server/app-page-head.d.ts +65 -0
- package/dist/server/app-page-head.js +228 -0
- package/dist/server/app-page-method.d.ts +15 -0
- package/dist/server/app-page-method.js +25 -0
- package/dist/server/app-page-params.d.ts +8 -0
- package/dist/server/app-page-params.js +39 -0
- package/dist/server/app-page-ppr-runtime.d.ts +7 -0
- package/dist/server/app-page-ppr-runtime.js +70 -0
- package/dist/server/app-page-probe.d.ts +134 -0
- package/dist/server/app-page-probe.js +276 -0
- package/dist/server/app-page-render-identity.d.ts +21 -0
- package/dist/server/app-page-render-identity.js +40 -0
- package/dist/server/app-page-render-observation.d.ts +36 -0
- package/dist/server/app-page-render-observation.js +82 -0
- package/dist/server/app-page-render.d.ts +111 -0
- package/dist/server/app-page-render.js +602 -0
- package/dist/server/app-page-request.d.ts +137 -0
- package/dist/server/app-page-request.js +216 -0
- package/dist/server/app-page-response.d.ts +68 -0
- package/dist/server/app-page-response.js +120 -0
- package/dist/server/app-page-route-wiring.d.ts +151 -0
- package/dist/server/app-page-route-wiring.js +452 -0
- package/dist/server/app-page-search-params-observation.d.ts +10 -0
- package/dist/server/app-page-search-params-observation.js +20 -0
- package/dist/server/app-page-segment-state.d.ts +9 -0
- package/dist/server/app-page-segment-state.js +80 -0
- package/dist/server/app-page-stream.d.ts +151 -0
- package/dist/server/app-page-stream.js +143 -0
- package/dist/server/app-pages-bridge.d.ts +63 -0
- package/dist/server/app-pages-bridge.js +63 -0
- package/dist/server/app-post-middleware-context.d.ts +15 -0
- package/dist/server/app-post-middleware-context.js +26 -0
- package/dist/server/app-ppr-fallback-shell-render.d.ts +18 -0
- package/dist/server/app-ppr-fallback-shell-render.js +26 -0
- package/dist/server/app-ppr-fallback-shell.d.ts +33 -0
- package/dist/server/app-ppr-fallback-shell.js +89 -0
- package/dist/server/app-prerender-endpoints.d.ts +18 -0
- package/dist/server/app-prerender-endpoints.js +94 -0
- package/dist/server/app-prerender-static-params.d.ts +30 -0
- package/dist/server/app-prerender-static-params.js +81 -0
- package/dist/server/app-render-dependency.d.ts +14 -0
- package/dist/server/app-render-dependency.js +41 -0
- package/dist/server/app-request-context.d.ts +20 -0
- package/dist/server/app-request-context.js +29 -0
- package/dist/server/app-route-handler-cache.d.ts +46 -0
- package/dist/server/app-route-handler-cache.js +78 -0
- package/dist/server/app-route-handler-dispatch.d.ts +49 -0
- package/dist/server/app-route-handler-dispatch.js +163 -0
- package/dist/server/app-route-handler-execution.d.ts +86 -0
- package/dist/server/app-route-handler-execution.js +128 -0
- package/dist/server/app-route-handler-policy.d.ts +55 -0
- package/dist/server/app-route-handler-policy.js +58 -0
- package/dist/server/app-route-handler-response.d.ts +28 -0
- package/dist/server/app-route-handler-response.js +145 -0
- package/dist/server/app-route-handler-runtime.d.ts +39 -0
- package/dist/server/app-route-handler-runtime.js +250 -0
- package/dist/server/app-route-module-loader.d.ts +91 -0
- package/dist/server/app-route-module-loader.js +83 -0
- package/dist/server/app-router-entry.d.ts +13 -0
- package/dist/server/app-router-entry.js +49 -0
- package/dist/server/app-rsc-cache-busting.d.ts +64 -0
- package/dist/server/app-rsc-cache-busting.js +206 -0
- package/dist/server/app-rsc-embedded-chunks.d.ts +8 -0
- package/dist/server/app-rsc-embedded-chunks.js +32 -0
- package/dist/server/app-rsc-error-handler.d.ts +20 -0
- package/dist/server/app-rsc-error-handler.js +28 -0
- package/dist/server/app-rsc-errors.d.ts +40 -0
- package/dist/server/app-rsc-errors.js +60 -0
- package/dist/server/app-rsc-handler.d.ts +201 -0
- package/dist/server/app-rsc-handler.js +538 -0
- package/dist/server/app-rsc-render-mode.d.ts +11 -0
- package/dist/server/app-rsc-render-mode.js +25 -0
- package/dist/server/app-rsc-request-normalization.d.ts +48 -0
- package/dist/server/app-rsc-request-normalization.js +75 -0
- package/dist/server/app-rsc-response-finalizer.d.ts +37 -0
- package/dist/server/app-rsc-response-finalizer.js +54 -0
- package/dist/server/app-rsc-route-matching.d.ts +93 -0
- package/dist/server/app-rsc-route-matching.js +134 -0
- package/dist/server/app-segment-config.d.ts +46 -0
- package/dist/server/app-segment-config.js +113 -0
- package/dist/server/app-server-action-execution.d.ts +219 -0
- package/dist/server/app-server-action-execution.js +767 -0
- package/dist/server/app-ssr-entry.d.ts +52 -0
- package/dist/server/app-ssr-entry.js +295 -0
- package/dist/server/app-ssr-error-meta.d.ts +13 -0
- package/dist/server/app-ssr-error-meta.js +48 -0
- package/dist/server/app-ssr-router-instance.d.ts +6 -0
- package/dist/server/app-ssr-router-instance.js +24 -0
- package/dist/server/app-ssr-stream.d.ts +60 -0
- package/dist/server/app-ssr-stream.js +408 -0
- package/dist/server/app-static-generation.d.ts +15 -0
- package/dist/server/app-static-generation.js +19 -0
- package/dist/server/app-visited-response-cache.d.ts +23 -0
- package/dist/server/app-visited-response-cache.js +19 -0
- package/dist/server/artifact-compatibility.d.ts +54 -0
- package/dist/server/artifact-compatibility.js +91 -0
- package/dist/server/before-interactive-head.d.ts +17 -0
- package/dist/server/before-interactive-head.js +35 -0
- package/dist/server/cache-control.d.ts +37 -0
- package/dist/server/cache-control.js +56 -0
- package/dist/server/cache-headers.d.ts +6 -0
- package/dist/server/cache-headers.js +17 -0
- package/dist/server/cache-proof.d.ts +364 -0
- package/dist/server/cache-proof.js +794 -0
- package/dist/server/client-reuse-manifest.d.ts +104 -0
- package/dist/server/client-reuse-manifest.js +209 -0
- package/dist/server/client-trace-metadata.d.ts +30 -0
- package/dist/server/client-trace-metadata.js +81 -0
- package/dist/server/cookie-utils.d.ts +12 -0
- package/dist/server/cookie-utils.js +18 -0
- package/dist/server/csp.d.ts +10 -0
- package/dist/server/csp.js +41 -0
- package/dist/server/default-global-error-module.d.ts +19 -0
- package/dist/server/default-global-error-module.js +18 -0
- package/dist/server/default-not-found-module.d.ts +19 -0
- package/dist/server/default-not-found-module.js +18 -0
- package/dist/server/defer-until-stream-consumed.d.ts +7 -0
- package/dist/server/defer-until-stream-consumed.js +34 -0
- package/dist/server/dev-error-overlay-store.d.ts +39 -0
- package/dist/server/dev-error-overlay-store.js +86 -0
- package/dist/server/dev-error-overlay.d.ts +51 -0
- package/dist/server/dev-error-overlay.js +1341 -0
- package/dist/server/dev-initial-server-error.d.ts +9 -0
- package/dist/server/dev-initial-server-error.js +26 -0
- package/dist/server/dev-lockfile.d.ts +109 -0
- package/dist/server/dev-lockfile.js +179 -0
- package/dist/server/dev-module-runner.d.ts +30 -0
- package/dist/server/dev-module-runner.js +91 -0
- package/dist/server/dev-origin-check.d.ts +62 -0
- package/dist/server/dev-origin-check.js +156 -0
- package/dist/server/dev-route-files.d.ts +6 -0
- package/dist/server/dev-route-files.js +71 -0
- package/dist/server/dev-server.d.ts +58 -0
- package/dist/server/dev-server.js +1114 -0
- package/dist/server/dev-stack-sourcemap-endpoint.d.ts +4 -0
- package/dist/server/dev-stack-sourcemap-endpoint.js +4 -0
- package/dist/server/dev-stack-sourcemap.d.ts +43 -0
- package/dist/server/dev-stack-sourcemap.js +443 -0
- package/dist/server/document-initial-head.d.ts +6 -0
- package/dist/server/document-initial-head.js +33 -0
- package/dist/server/edge-api-runtime.d.ts +4 -0
- package/dist/server/edge-api-runtime.js +6 -0
- package/dist/server/file-based-metadata.d.ts +29 -0
- package/dist/server/file-based-metadata.js +401 -0
- package/dist/server/headers.d.ts +114 -0
- package/dist/server/headers.js +136 -0
- package/dist/server/html.d.ts +28 -0
- package/dist/server/html.js +41 -0
- package/dist/server/http-error-responses.d.ts +91 -0
- package/dist/server/http-error-responses.js +105 -0
- package/dist/server/hybrid-route-priority.d.ts +22 -0
- package/dist/server/hybrid-route-priority.js +33 -0
- package/dist/server/image-optimization.d.ts +130 -0
- package/dist/server/image-optimization.js +247 -0
- package/dist/server/implicit-tags.d.ts +6 -0
- package/dist/server/implicit-tags.js +44 -0
- package/dist/server/instrumentation-runtime.d.ts +49 -0
- package/dist/server/instrumentation-runtime.js +35 -0
- package/dist/server/instrumentation.d.ts +85 -0
- package/dist/server/instrumentation.js +130 -0
- package/dist/server/isr-cache.d.ts +127 -0
- package/dist/server/isr-cache.js +282 -0
- package/dist/server/isr-decision.d.ts +79 -0
- package/dist/server/isr-decision.js +70 -0
- package/dist/server/metadata-route-build-data.d.ts +24 -0
- package/dist/server/metadata-route-build-data.js +148 -0
- package/dist/server/metadata-route-response.d.ts +16 -0
- package/dist/server/metadata-route-response.js +205 -0
- package/dist/server/metadata-routes.d.ts +139 -0
- package/dist/server/metadata-routes.js +433 -0
- package/dist/server/middleware-matcher.d.ts +14 -0
- package/dist/server/middleware-matcher.js +111 -0
- package/dist/server/middleware-request-headers.d.ts +11 -0
- package/dist/server/middleware-request-headers.js +65 -0
- package/dist/server/middleware-response-headers.d.ts +12 -0
- package/dist/server/middleware-response-headers.js +42 -0
- package/dist/server/middleware-runtime.d.ts +67 -0
- package/dist/server/middleware-runtime.js +240 -0
- package/dist/server/middleware.d.ts +62 -0
- package/dist/server/middleware.js +114 -0
- package/dist/server/navigation-planner.d.ts +308 -0
- package/dist/server/navigation-planner.js +831 -0
- package/dist/server/navigation-trace.d.ts +68 -0
- package/dist/server/navigation-trace.js +71 -0
- package/dist/server/next-error-digest.d.ts +44 -0
- package/dist/server/next-error-digest.js +40 -0
- package/dist/server/normalize-path.d.ts +38 -0
- package/dist/server/normalize-path.js +70 -0
- package/dist/server/open-redirect.d.ts +12 -0
- package/dist/server/open-redirect.js +21 -0
- package/dist/server/operation-token.d.ts +40 -0
- package/dist/server/operation-token.js +85 -0
- package/dist/server/otel-tracer-extension.d.ts +45 -0
- package/dist/server/otel-tracer-extension.js +89 -0
- package/dist/server/pages-api-route.d.ts +83 -0
- package/dist/server/pages-api-route.js +75 -0
- package/dist/server/pages-asset-tags.d.ts +78 -0
- package/dist/server/pages-asset-tags.js +126 -0
- package/dist/server/pages-body-parser-config.d.ts +59 -0
- package/dist/server/pages-body-parser-config.js +77 -0
- package/dist/server/pages-data-route.d.ts +121 -0
- package/dist/server/pages-data-route.js +157 -0
- package/dist/server/pages-default-404.d.ts +30 -0
- package/dist/server/pages-default-404.js +38 -0
- package/dist/server/pages-dev-module-url.d.ts +4 -0
- package/dist/server/pages-dev-module-url.js +15 -0
- package/dist/server/pages-document-initial-props.d.ts +77 -0
- package/dist/server/pages-document-initial-props.js +109 -0
- package/dist/server/pages-get-initial-props.d.ts +67 -0
- package/dist/server/pages-get-initial-props.js +92 -0
- package/dist/server/pages-i18n.d.ts +106 -0
- package/dist/server/pages-i18n.js +183 -0
- package/dist/server/pages-media-type.d.ts +15 -0
- package/dist/server/pages-media-type.js +24 -0
- package/dist/server/pages-node-compat.d.ts +55 -0
- package/dist/server/pages-node-compat.js +235 -0
- package/dist/server/pages-page-data.d.ts +223 -0
- package/dist/server/pages-page-data.js +484 -0
- package/dist/server/pages-page-handler.d.ts +100 -0
- package/dist/server/pages-page-handler.js +403 -0
- package/dist/server/pages-page-method.d.ts +47 -0
- package/dist/server/pages-page-method.js +17 -0
- package/dist/server/pages-page-response.d.ts +138 -0
- package/dist/server/pages-page-response.js +285 -0
- package/dist/server/pages-readiness.d.ts +36 -0
- package/dist/server/pages-readiness.js +21 -0
- package/dist/server/pages-request-pipeline.d.ts +116 -0
- package/dist/server/pages-request-pipeline.js +311 -0
- package/dist/server/pages-revalidate.d.ts +15 -0
- package/dist/server/pages-revalidate.js +19 -0
- package/dist/server/pages-serializable-props.d.ts +24 -0
- package/dist/server/pages-serializable-props.js +67 -0
- package/dist/server/pregenerated-concrete-paths.d.ts +16 -0
- package/dist/server/pregenerated-concrete-paths.js +61 -0
- package/dist/server/prerender-manifest.d.ts +33 -0
- package/dist/server/prerender-manifest.js +54 -0
- package/dist/server/prerender-route-params.d.ts +23 -0
- package/dist/server/prerender-route-params.js +113 -0
- package/dist/server/prerender-work-unit-setup.d.ts +6 -0
- package/dist/server/prerender-work-unit-setup.js +28 -0
- package/dist/server/prod-server.d.ts +148 -0
- package/dist/server/prod-server.js +1136 -0
- package/dist/server/proxy-trust.d.ts +40 -0
- package/dist/server/proxy-trust.js +68 -0
- package/dist/server/request-log.d.ts +39 -0
- package/dist/server/request-log.js +56 -0
- package/dist/server/request-pipeline.d.ts +187 -0
- package/dist/server/request-pipeline.js +447 -0
- package/dist/server/rsc-stream-hints.d.ts +10 -0
- package/dist/server/rsc-stream-hints.js +41 -0
- package/dist/server/seed-cache.d.ts +29 -0
- package/dist/server/seed-cache.js +125 -0
- package/dist/server/server-action-not-found.d.ts +21 -0
- package/dist/server/server-action-not-found.js +62 -0
- package/dist/server/server-globals.d.ts +4 -0
- package/dist/server/server-globals.js +35 -0
- package/dist/server/skip-cache-proof.d.ts +61 -0
- package/dist/server/skip-cache-proof.js +168 -0
- package/dist/server/socket-error-backstop.d.ts +34 -0
- package/dist/server/socket-error-backstop.js +200 -0
- package/dist/server/static-file-cache.d.ts +56 -0
- package/dist/server/static-file-cache.js +231 -0
- package/dist/server/static-layout-client-reuse-proof.d.ts +15 -0
- package/dist/server/static-layout-client-reuse-proof.js +33 -0
- package/dist/server/streaming-metadata.d.ts +4 -0
- package/dist/server/streaming-metadata.js +8 -0
- package/dist/server/worker-utils.d.ts +7 -0
- package/dist/server/worker-utils.js +99 -0
- package/dist/shims/amp.d.ts +19 -0
- package/dist/shims/amp.js +23 -0
- package/dist/shims/app-router-scroll-state.d.ts +15 -0
- package/dist/shims/app-router-scroll-state.js +61 -0
- package/dist/shims/app-router-scroll.d.ts +29 -0
- package/dist/shims/app-router-scroll.js +141 -0
- package/dist/shims/app.d.ts +42 -0
- package/dist/shims/app.js +48 -0
- package/dist/shims/before-interactive-context.d.ts +40 -0
- package/dist/shims/before-interactive-context.js +8 -0
- package/dist/shims/cache-for-request.d.ts +57 -0
- package/dist/shims/cache-for-request.js +72 -0
- package/dist/shims/cache-handler.d.ts +106 -0
- package/dist/shims/cache-handler.js +176 -0
- package/dist/shims/cache-request-state.d.ts +47 -0
- package/dist/shims/cache-request-state.js +126 -0
- package/dist/shims/cache-runtime.d.ts +83 -0
- package/dist/shims/cache-runtime.js +452 -0
- package/dist/shims/cache.d.ts +145 -0
- package/dist/shims/cache.js +401 -0
- package/dist/shims/cdn-cache.d.ts +125 -0
- package/dist/shims/cdn-cache.js +100 -0
- package/dist/shims/client-hook-error.d.ts +13 -0
- package/dist/shims/client-hook-error.js +17 -0
- package/dist/shims/client-locale.d.ts +14 -0
- package/dist/shims/client-locale.js +11 -0
- package/dist/shims/client-only.d.ts +1 -0
- package/dist/shims/client-only.js +1 -0
- package/dist/shims/compat-router.d.ts +16 -0
- package/dist/shims/compat-router.js +25 -0
- package/dist/shims/config.d.ts +28 -0
- package/dist/shims/config.js +21 -0
- package/dist/shims/constants.d.ts +130 -0
- package/dist/shims/constants.js +167 -0
- package/dist/shims/default-global-error.d.ts +31 -0
- package/dist/shims/default-global-error.js +179 -0
- package/dist/shims/default-not-found.d.ts +11 -0
- package/dist/shims/default-not-found.js +59 -0
- package/dist/shims/document.d.ts +92 -0
- package/dist/shims/document.js +76 -0
- package/dist/shims/dynamic-preload-chunks.d.ts +8 -0
- package/dist/shims/dynamic-preload-chunks.js +79 -0
- package/dist/shims/dynamic.d.ts +35 -0
- package/dist/shims/dynamic.js +204 -0
- package/dist/shims/error-boundary-navigation.d.ts +7 -0
- package/dist/shims/error-boundary-navigation.js +44 -0
- package/dist/shims/error-boundary.d.ts +155 -0
- package/dist/shims/error-boundary.js +342 -0
- package/dist/shims/error.d.ts +31 -0
- package/dist/shims/error.js +123 -0
- package/dist/shims/error.react-server.d.ts +9 -0
- package/dist/shims/error.react-server.js +6 -0
- package/dist/shims/fetch-cache.d.ts +136 -0
- package/dist/shims/fetch-cache.js +766 -0
- package/dist/shims/font-google-base.d.ts +83 -0
- package/dist/shims/font-google-base.js +290 -0
- package/dist/shims/font-google.d.ts +2 -0
- package/dist/shims/font-google.js +2 -0
- package/dist/shims/font-local.d.ts +50 -0
- package/dist/shims/font-local.js +195 -0
- package/dist/shims/font-utils.d.ts +56 -0
- package/dist/shims/font-utils.js +107 -0
- package/dist/shims/form.d.ts +19 -0
- package/dist/shims/form.js +236 -0
- package/dist/shims/hash-scroll.d.ts +10 -0
- package/dist/shims/hash-scroll.js +47 -0
- package/dist/shims/head-state.d.ts +16 -0
- package/dist/shims/head-state.js +43 -0
- package/dist/shims/head.d.ts +73 -0
- package/dist/shims/head.js +340 -0
- package/dist/shims/headers.d.ts +253 -0
- package/dist/shims/headers.js +754 -0
- package/dist/shims/i18n-context.d.ts +22 -0
- package/dist/shims/i18n-context.js +42 -0
- package/dist/shims/i18n-state.d.ts +14 -0
- package/dist/shims/i18n-state.js +38 -0
- package/dist/shims/image-config.d.ts +45 -0
- package/dist/shims/image-config.js +85 -0
- package/dist/shims/image.d.ts +55 -0
- package/dist/shims/image.js +582 -0
- package/dist/shims/internal/als-registry.d.ts +14 -0
- package/dist/shims/internal/als-registry.js +80 -0
- package/dist/shims/internal/api-utils.d.ts +14 -0
- package/dist/shims/internal/api-utils.js +1 -0
- package/dist/shims/internal/app-page-props-cache-key.d.ts +5 -0
- package/dist/shims/internal/app-page-props-cache-key.js +16 -0
- package/dist/shims/internal/app-route-detection.d.ts +39 -0
- package/dist/shims/internal/app-route-detection.js +62 -0
- package/dist/shims/internal/app-router-context.d.ts +31 -0
- package/dist/shims/internal/app-router-context.js +28 -0
- package/dist/shims/internal/cookie-serialize.d.ts +45 -0
- package/dist/shims/internal/cookie-serialize.js +49 -0
- package/dist/shims/internal/cookies.d.ts +2 -0
- package/dist/shims/internal/cookies.js +2 -0
- package/dist/shims/internal/hybrid-client-route-owner.d.ts +31 -0
- package/dist/shims/internal/hybrid-client-route-owner.js +143 -0
- package/dist/shims/internal/interpolate-as.d.ts +25 -0
- package/dist/shims/internal/interpolate-as.js +196 -0
- package/dist/shims/internal/link-status-registry.d.ts +43 -0
- package/dist/shims/internal/link-status-registry.js +42 -0
- package/dist/shims/internal/make-hanging-promise.d.ts +15 -0
- package/dist/shims/internal/make-hanging-promise.js +44 -0
- package/dist/shims/internal/navigation-untracked.d.ts +35 -0
- package/dist/shims/internal/navigation-untracked.js +56 -0
- package/dist/shims/internal/pages-data-fetch-dedup.d.ts +54 -0
- package/dist/shims/internal/pages-data-fetch-dedup.js +121 -0
- package/dist/shims/internal/pages-data-target.d.ts +62 -0
- package/dist/shims/internal/pages-data-target.js +98 -0
- package/dist/shims/internal/pages-data-url.d.ts +41 -0
- package/dist/shims/internal/pages-data-url.js +71 -0
- package/dist/shims/internal/pages-router-accessor.d.ts +19 -0
- package/dist/shims/internal/pages-router-accessor.js +13 -0
- package/dist/shims/internal/route-pattern-for-warning.d.ts +27 -0
- package/dist/shims/internal/route-pattern-for-warning.js +40 -0
- package/dist/shims/internal/router-context.d.ts +7 -0
- package/dist/shims/internal/router-context.js +13 -0
- package/dist/shims/internal/utils.d.ts +52 -0
- package/dist/shims/internal/utils.js +27 -0
- package/dist/shims/internal/work-unit-async-storage.d.ts +30 -0
- package/dist/shims/internal/work-unit-async-storage.js +17 -0
- package/dist/shims/layout-segment-context.d.ts +24 -0
- package/dist/shims/layout-segment-context.js +39 -0
- package/dist/shims/legacy-image.d.ts +41 -0
- package/dist/shims/legacy-image.js +49 -0
- package/dist/shims/link-prefetch.d.ts +41 -0
- package/dist/shims/link-prefetch.js +43 -0
- package/dist/shims/link.d.ts +102 -0
- package/dist/shims/link.js +687 -0
- package/dist/shims/metadata.d.ts +285 -0
- package/dist/shims/metadata.js +820 -0
- package/dist/shims/navigation-context-state.d.ts +40 -0
- package/dist/shims/navigation-context-state.js +116 -0
- package/dist/shims/navigation-errors.d.ts +55 -0
- package/dist/shims/navigation-errors.js +110 -0
- package/dist/shims/navigation-server.d.ts +3 -0
- package/dist/shims/navigation-server.js +3 -0
- package/dist/shims/navigation-state.d.ts +25 -0
- package/dist/shims/navigation-state.js +66 -0
- package/dist/shims/navigation.d.ts +286 -0
- package/dist/shims/navigation.js +1206 -0
- package/dist/shims/navigation.react-server.d.ts +14 -0
- package/dist/shims/navigation.react-server.js +32 -0
- package/dist/shims/offline.d.ts +4 -0
- package/dist/shims/offline.js +15 -0
- package/dist/shims/og.d.ts +17 -0
- package/dist/shims/og.js +48 -0
- package/dist/shims/pages-router-runtime.d.ts +12 -0
- package/dist/shims/pages-router-runtime.js +24 -0
- package/dist/shims/ppr-fallback-shell.d.ts +33 -0
- package/dist/shims/ppr-fallback-shell.js +170 -0
- package/dist/shims/readonly-url-search-params.d.ts +13 -0
- package/dist/shims/readonly-url-search-params.js +26 -0
- package/dist/shims/request-context.d.ts +58 -0
- package/dist/shims/request-context.js +45 -0
- package/dist/shims/request-state-types.d.ts +12 -0
- package/dist/shims/request-state-types.js +1 -0
- package/dist/shims/root-params.d.ts +12 -0
- package/dist/shims/root-params.js +30 -0
- package/dist/shims/router-state.d.ts +32 -0
- package/dist/shims/router-state.js +39 -0
- package/dist/shims/router.d.ts +192 -0
- package/dist/shims/router.js +1786 -0
- package/dist/shims/script-nonce-context.d.ts +11 -0
- package/dist/shims/script-nonce-context.js +23 -0
- package/dist/shims/script.d.ts +43 -0
- package/dist/shims/script.js +370 -0
- package/dist/shims/server-only.d.ts +1 -0
- package/dist/shims/server-only.js +1 -0
- package/dist/shims/server.d.ts +323 -0
- package/dist/shims/server.js +729 -0
- package/dist/shims/slot.d.ts +45 -0
- package/dist/shims/slot.js +230 -0
- package/dist/shims/thenable-params.d.ts +11 -0
- package/dist/shims/thenable-params.js +176 -0
- package/dist/shims/unified-request-context.d.ts +68 -0
- package/dist/shims/unified-request-context.js +86 -0
- package/dist/shims/unrecognized-action-error.d.ts +34 -0
- package/dist/shims/unrecognized-action-error.js +39 -0
- package/dist/shims/url-safety.d.ts +34 -0
- package/dist/shims/url-safety.js +70 -0
- package/dist/shims/url-utils.d.ts +51 -0
- package/dist/shims/url-utils.js +156 -0
- package/dist/shims/use-merged-ref.d.ts +6 -0
- package/dist/shims/use-merged-ref.js +38 -0
- package/dist/shims/web-vitals.d.ts +8 -0
- package/dist/shims/web-vitals.js +22 -0
- package/dist/typegen.d.ts +9 -0
- package/dist/typegen.js +228 -0
- package/dist/utils/asset-prefix.d.ts +96 -0
- package/dist/utils/asset-prefix.js +122 -0
- package/dist/utils/base-path.d.ts +31 -0
- package/dist/utils/base-path.js +45 -0
- package/dist/utils/built-asset-url.d.ts +4 -0
- package/dist/utils/built-asset-url.js +11 -0
- package/dist/utils/cache-control-metadata.d.ts +4 -0
- package/dist/utils/cache-control-metadata.js +12 -0
- package/dist/utils/client-build-manifest.d.ts +21 -0
- package/dist/utils/client-build-manifest.js +87 -0
- package/dist/utils/client-entry-manifest.d.ts +11 -0
- package/dist/utils/client-entry-manifest.js +29 -0
- package/dist/utils/client-runtime-metadata.d.ts +45 -0
- package/dist/utils/client-runtime-metadata.js +63 -0
- package/dist/utils/commonjs-loader.d.ts +16 -0
- package/dist/utils/commonjs-loader.js +100 -0
- package/dist/utils/compare.d.ts +4 -0
- package/dist/utils/compare.js +8 -0
- package/dist/utils/deployment-id.d.ts +8 -0
- package/dist/utils/deployment-id.js +22 -0
- package/dist/utils/dev-error-recovery-event.d.ts +4 -0
- package/dist/utils/dev-error-recovery-event.js +4 -0
- package/dist/utils/domain-locale.d.ts +26 -0
- package/dist/utils/domain-locale.js +50 -0
- package/dist/utils/encode-cache-tag.d.ts +30 -0
- package/dist/utils/encode-cache-tag.js +36 -0
- package/dist/utils/error-cause.d.ts +4 -0
- package/dist/utils/error-cause.js +95 -0
- package/dist/utils/has-trailing-comma.d.ts +24 -0
- package/dist/utils/has-trailing-comma.js +62 -0
- package/dist/utils/hash.d.ts +24 -0
- package/dist/utils/hash.js +55 -0
- package/dist/utils/html-limited-bots.d.ts +21 -0
- package/dist/utils/html-limited-bots.js +35 -0
- package/dist/utils/lazy-chunks.d.ts +59 -0
- package/dist/utils/lazy-chunks.js +112 -0
- package/dist/utils/manifest-paths.d.ts +30 -0
- package/dist/utils/manifest-paths.js +66 -0
- package/dist/utils/mdx-scan.d.ts +9 -0
- package/dist/utils/mdx-scan.js +34 -0
- package/dist/utils/navigation-signal.d.ts +4 -0
- package/dist/utils/navigation-signal.js +12 -0
- package/dist/utils/number.d.ts +4 -0
- package/dist/utils/number.js +6 -0
- package/dist/utils/parse-cookie.d.ts +13 -0
- package/dist/utils/parse-cookie.js +52 -0
- package/dist/utils/path.d.ts +22 -0
- package/dist/utils/path.js +30 -0
- package/dist/utils/prerender-output-paths.d.ts +14 -0
- package/dist/utils/prerender-output-paths.js +22 -0
- package/dist/utils/project.d.ts +76 -0
- package/dist/utils/project.js +213 -0
- package/dist/utils/promise.d.ts +4 -0
- package/dist/utils/promise.js +6 -0
- package/dist/utils/public-routes.d.ts +4 -0
- package/dist/utils/public-routes.js +48 -0
- package/dist/utils/query.d.ts +49 -0
- package/dist/utils/query.js +122 -0
- package/dist/utils/record.d.ts +4 -0
- package/dist/utils/record.js +6 -0
- package/dist/utils/regex.d.ts +4 -0
- package/dist/utils/regex.js +6 -0
- package/dist/utils/safe-json-file.d.ts +17 -0
- package/dist/utils/safe-json-file.js +23 -0
- package/dist/utils/sorted-array.d.ts +8 -0
- package/dist/utils/sorted-array.js +20 -0
- package/dist/utils/text-stream.d.ts +28 -0
- package/dist/utils/text-stream.js +64 -0
- package/dist/utils/vinext-root.d.ts +23 -0
- package/dist/utils/vinext-root.js +29 -0
- package/dist/utils/virtual-module.d.ts +5 -0
- package/dist/utils/virtual-module.js +0 -0
- package/dist/utils/vite-version.d.ts +21 -0
- package/dist/utils/vite-version.js +42 -0
- package/package.json +145 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { AppElementValue, AppElements, UNMATCHED_SLOT } from "../server/app-elements-wire.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/shims/slot.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Holds resolved AppElements (not a Promise). React 19's use(Promise) during
|
|
7
|
+
* hydration triggers "async Client Component" for native Promises that lack
|
|
8
|
+
* React's internal .status property. Storing resolved values sidesteps this.
|
|
9
|
+
*/
|
|
10
|
+
declare const ElementsContext: React$1.Context<Readonly<Record<string, AppElementValue>>>;
|
|
11
|
+
declare const ChildrenContext: React$1.Context<React$1.ReactNode>;
|
|
12
|
+
declare const ParallelSlotsContext: React$1.Context<Readonly<Record<string, React$1.ReactNode>> | null>;
|
|
13
|
+
declare const BfcacheStateKeyMapContext: React$1.Context<Readonly<Record<string, string>>>;
|
|
14
|
+
type BfcacheSlotEntry = {
|
|
15
|
+
content: React$1.ReactNode;
|
|
16
|
+
elements?: AppElements;
|
|
17
|
+
segmentId?: string;
|
|
18
|
+
stateKey: string;
|
|
19
|
+
stateKeyMap?: Readonly<Record<string, string>>;
|
|
20
|
+
};
|
|
21
|
+
type MergeElementsOptions = {
|
|
22
|
+
clearAbsentSlots?: boolean;
|
|
23
|
+
preserveAbsentSlots?: boolean;
|
|
24
|
+
preserveElementIds?: readonly string[];
|
|
25
|
+
preservePreviousSlotIds?: readonly string[];
|
|
26
|
+
};
|
|
27
|
+
declare function updateBfcacheSlotEntryOrder(previousOrder: readonly string[], activeStateKey: string, maxEntries?: number): string[];
|
|
28
|
+
declare function mergeElements(prev: AppElements, next: AppElements, options?: MergeElementsOptions | boolean): AppElements;
|
|
29
|
+
declare function Slot({
|
|
30
|
+
id,
|
|
31
|
+
children,
|
|
32
|
+
parallelSlots
|
|
33
|
+
}: {
|
|
34
|
+
id: string;
|
|
35
|
+
children?: React$1.ReactNode;
|
|
36
|
+
parallelSlots?: Readonly<Record<string, React$1.ReactNode>>;
|
|
37
|
+
}): React$1.JSX.Element | null;
|
|
38
|
+
declare function Children(): React$1.ReactNode;
|
|
39
|
+
declare function ParallelSlot({
|
|
40
|
+
name
|
|
41
|
+
}: {
|
|
42
|
+
name: string;
|
|
43
|
+
}): string | number | bigint | boolean | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<React$1.ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<React$1.ReactNode> | null | undefined> | null;
|
|
44
|
+
//#endregion
|
|
45
|
+
export { BfcacheSlotEntry, BfcacheStateKeyMapContext, Children, ChildrenContext, ElementsContext, ParallelSlot, ParallelSlotsContext, Slot, UNMATCHED_SLOT, mergeElements, updateBfcacheSlotEntryOrder };
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { AppElementsWire, UNMATCHED_SLOT } from "../server/app-elements-wire.js";
|
|
3
|
+
import "../server/app-elements.js";
|
|
4
|
+
import { getBfcacheIdMapContext, getBfcacheSegmentIdContext } from "./navigation-context-state.js";
|
|
5
|
+
import { notFound } from "./navigation-errors.js";
|
|
6
|
+
import "./navigation-server.js";
|
|
7
|
+
import * as React$1 from "react";
|
|
8
|
+
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
9
|
+
//#region src/shims/slot.tsx
|
|
10
|
+
const EMPTY_ELEMENTS = Object.freeze({});
|
|
11
|
+
const warnedMissingEntryIds = /* @__PURE__ */ new Set();
|
|
12
|
+
const warnedTransportMetadataEntryIds = /* @__PURE__ */ new Set();
|
|
13
|
+
/**
|
|
14
|
+
* Holds resolved AppElements (not a Promise). React 19's use(Promise) during
|
|
15
|
+
* hydration triggers "async Client Component" for native Promises that lack
|
|
16
|
+
* React's internal .status property. Storing resolved values sidesteps this.
|
|
17
|
+
*/
|
|
18
|
+
const ElementsContext = React$1.createContext(EMPTY_ELEMENTS);
|
|
19
|
+
const ChildrenContext = React$1.createContext(null);
|
|
20
|
+
const ParallelSlotsContext = React$1.createContext(null);
|
|
21
|
+
const BfcacheIdMapContext = getBfcacheIdMapContext();
|
|
22
|
+
const BfcacheSegmentIdContext = getBfcacheSegmentIdContext();
|
|
23
|
+
const EMPTY_BFCACHE_STATE_KEYS = Object.freeze({});
|
|
24
|
+
const MAX_BFCACHE_SLOT_ENTRIES_WITH_CACHE_COMPONENTS = 3;
|
|
25
|
+
const MAX_BFCACHE_SLOT_ENTRIES_WITHOUT_CACHE_COMPONENTS = 1;
|
|
26
|
+
const BfcacheStateKeyMapContext = React$1.createContext(EMPTY_BFCACHE_STATE_KEYS);
|
|
27
|
+
function isCacheComponentsEnabled() {
|
|
28
|
+
return String(process.env.__NEXT_CACHE_COMPONENTS) === "true";
|
|
29
|
+
}
|
|
30
|
+
function getBfcacheSlotEntryLimit() {
|
|
31
|
+
return isCacheComponentsEnabled() ? MAX_BFCACHE_SLOT_ENTRIES_WITH_CACHE_COMPONENTS : MAX_BFCACHE_SLOT_ENTRIES_WITHOUT_CACHE_COMPONENTS;
|
|
32
|
+
}
|
|
33
|
+
function normalizeBfcacheSlotEntryLimit(maxEntries) {
|
|
34
|
+
if (!Number.isFinite(maxEntries)) return 1;
|
|
35
|
+
return Math.max(1, Math.trunc(maxEntries));
|
|
36
|
+
}
|
|
37
|
+
function updateBfcacheSlotEntryOrder(previousOrder, activeStateKey, maxEntries = getBfcacheSlotEntryLimit()) {
|
|
38
|
+
const entryLimit = normalizeBfcacheSlotEntryLimit(maxEntries);
|
|
39
|
+
const nextOrder = [activeStateKey];
|
|
40
|
+
for (const stateKey of previousOrder) {
|
|
41
|
+
if (nextOrder.length >= entryLimit) break;
|
|
42
|
+
if (stateKey === activeStateKey) continue;
|
|
43
|
+
nextOrder.push(stateKey);
|
|
44
|
+
}
|
|
45
|
+
return nextOrder;
|
|
46
|
+
}
|
|
47
|
+
function pruneBfcacheSlotEntrySnapshots(snapshotsByStateKey, retainedOrder) {
|
|
48
|
+
const retainedKeys = new Set(retainedOrder);
|
|
49
|
+
for (const stateKey of snapshotsByStateKey.keys()) if (!retainedKeys.has(stateKey)) snapshotsByStateKey.delete(stateKey);
|
|
50
|
+
}
|
|
51
|
+
function haveSameBfcacheSlotEntryOrder(left, right) {
|
|
52
|
+
if (left.length !== right.length) return false;
|
|
53
|
+
for (let index = 0; index < left.length; index++) if (left[index] !== right[index]) return false;
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
function isLayoutFlagsValue(value) {
|
|
57
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
|
|
58
|
+
const entries = Object.values(value);
|
|
59
|
+
return entries.length > 0 && entries.every((entry) => entry === "s" || entry === "d");
|
|
60
|
+
}
|
|
61
|
+
function isArtifactCompatibilityEnvelopeValue(value) {
|
|
62
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
|
|
63
|
+
return "schemaVersion" in value && "appElementsSchemaVersion" in value && "rscPayloadSchemaVersion" in value && "graphVersion" in value && "deploymentVersion" in value && "rootBoundaryId" in value && "renderEpoch" in value;
|
|
64
|
+
}
|
|
65
|
+
function isSlotBindingValue(value) {
|
|
66
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
|
|
67
|
+
return "ownerLayoutId" in value && "slotId" in value && "state" in value;
|
|
68
|
+
}
|
|
69
|
+
function isSlotBindingListValue(value) {
|
|
70
|
+
return Array.isArray(value) && value.length > 0 && value.every(isSlotBindingValue);
|
|
71
|
+
}
|
|
72
|
+
function isSkippedLayoutIdsMetadataValue(id, value) {
|
|
73
|
+
return id === "__skippedLayoutIds" && Array.isArray(value) && value.every((entry) => typeof entry === "string");
|
|
74
|
+
}
|
|
75
|
+
function isInterceptionMetadataValue(value) {
|
|
76
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
|
|
77
|
+
return "sourceMatchedUrl" in value && typeof value.sourceMatchedUrl === "string" && "sourceRouteId" in value && typeof value.sourceRouteId === "string" && "slotId" in value && typeof value.slotId === "string" && "targetMatchedUrl" in value && typeof value.targetMatchedUrl === "string" && "targetRouteId" in value && typeof value.targetRouteId === "string";
|
|
78
|
+
}
|
|
79
|
+
function isCacheEntryReuseProofValue(value) {
|
|
80
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
|
|
81
|
+
return "kind" in value && value.kind === "runtime-cache-entry" && "decision" in value;
|
|
82
|
+
}
|
|
83
|
+
function isTransportMetadataValue(id, value) {
|
|
84
|
+
return isLayoutFlagsValue(value) || isArtifactCompatibilityEnvelopeValue(value) || isCacheEntryReuseProofValue(value) || isInterceptionMetadataValue(value) || isSkippedLayoutIdsMetadataValue(id, value) || isSlotBindingListValue(value);
|
|
85
|
+
}
|
|
86
|
+
function warnTransportMetadataEntry(id) {
|
|
87
|
+
if (process.env.NODE_ENV === "production") return;
|
|
88
|
+
if (warnedTransportMetadataEntryIds.has(id)) return;
|
|
89
|
+
warnedTransportMetadataEntryIds.add(id);
|
|
90
|
+
console.warn("[vinext] Transport metadata value found under App Router render entry: " + id);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Provider stack for Activity-retained BFCache entries. Each retained entry
|
|
94
|
+
* re-provides the elements, state-key map, and segment id it was captured with,
|
|
95
|
+
* falling back to the live boundary values for entries that predate per-entry
|
|
96
|
+
* capture.
|
|
97
|
+
*/
|
|
98
|
+
function BfcacheEntryProviders({ entry, fallbackElements, fallbackSegmentId, fallbackStateKeyMap, SegmentContext }) {
|
|
99
|
+
return /* @__PURE__ */ jsx(BfcacheStateKeyMapContext.Provider, {
|
|
100
|
+
value: entry.stateKeyMap ?? fallbackStateKeyMap,
|
|
101
|
+
children: /* @__PURE__ */ jsx(ElementsContext.Provider, {
|
|
102
|
+
value: entry.elements ?? fallbackElements,
|
|
103
|
+
children: /* @__PURE__ */ jsx(SegmentContext.Provider, {
|
|
104
|
+
value: entry.segmentId ?? fallbackSegmentId,
|
|
105
|
+
children: entry.content
|
|
106
|
+
})
|
|
107
|
+
})
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
function useBfcacheSlotEntries(activeEntry) {
|
|
111
|
+
const snapshotsByStateKey = React$1.useRef(/* @__PURE__ */ new Map());
|
|
112
|
+
const [entryOrder, setEntryOrder] = React$1.useState(() => [activeEntry.stateKey]);
|
|
113
|
+
snapshotsByStateKey.current.set(activeEntry.stateKey, activeEntry);
|
|
114
|
+
const nextOrder = updateBfcacheSlotEntryOrder(entryOrder, activeEntry.stateKey);
|
|
115
|
+
const orderChanged = !haveSameBfcacheSlotEntryOrder(entryOrder, nextOrder);
|
|
116
|
+
const renderOrder = orderChanged ? nextOrder : entryOrder;
|
|
117
|
+
pruneBfcacheSlotEntrySnapshots(snapshotsByStateKey.current, renderOrder);
|
|
118
|
+
if (process.env.NODE_ENV !== "production" && !snapshotsByStateKey.current.has(activeEntry.stateKey)) throw new Error("BFCache Activity slot is missing the active entry snapshot");
|
|
119
|
+
if (orderChanged) setEntryOrder(nextOrder);
|
|
120
|
+
return renderOrder.map((stateKey) => snapshotsByStateKey.current.get(stateKey)).filter((entry) => entry !== void 0);
|
|
121
|
+
}
|
|
122
|
+
function BfcacheActivitySlotBoundary({ activeStateKey, content, elements, id, SegmentContext, stateKeyMap }) {
|
|
123
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: useBfcacheSlotEntries({
|
|
124
|
+
content,
|
|
125
|
+
elements,
|
|
126
|
+
segmentId: id,
|
|
127
|
+
stateKey: activeStateKey,
|
|
128
|
+
stateKeyMap
|
|
129
|
+
}).map((entry) => /* @__PURE__ */ jsx(React$1.Activity, {
|
|
130
|
+
mode: entry.stateKey === activeStateKey ? "visible" : "hidden",
|
|
131
|
+
children: /* @__PURE__ */ jsx(BfcacheEntryProviders, {
|
|
132
|
+
entry,
|
|
133
|
+
fallbackElements: elements,
|
|
134
|
+
fallbackSegmentId: id,
|
|
135
|
+
fallbackStateKeyMap: stateKeyMap,
|
|
136
|
+
SegmentContext
|
|
137
|
+
})
|
|
138
|
+
}, entry.stateKey)) });
|
|
139
|
+
}
|
|
140
|
+
function BfcacheSlotBoundary({ content, id }) {
|
|
141
|
+
const SegmentContext = BfcacheSegmentIdContext;
|
|
142
|
+
const elements = React$1.useContext(ElementsContext);
|
|
143
|
+
const stateKeyMap = React$1.useContext(BfcacheStateKeyMapContext);
|
|
144
|
+
const activeStateKey = stateKeyMap[id];
|
|
145
|
+
if (!SegmentContext) return /* @__PURE__ */ jsx(Fragment$1, { children: content });
|
|
146
|
+
if (activeStateKey === void 0) return /* @__PURE__ */ jsx(SegmentContext.Provider, {
|
|
147
|
+
value: id,
|
|
148
|
+
children: content
|
|
149
|
+
});
|
|
150
|
+
if (!isCacheComponentsEnabled()) return /* @__PURE__ */ jsx(SegmentContext.Provider, {
|
|
151
|
+
value: id,
|
|
152
|
+
children: content
|
|
153
|
+
});
|
|
154
|
+
return /* @__PURE__ */ jsx(BfcacheActivitySlotBoundary, {
|
|
155
|
+
activeStateKey,
|
|
156
|
+
content,
|
|
157
|
+
elements,
|
|
158
|
+
id,
|
|
159
|
+
SegmentContext,
|
|
160
|
+
stateKeyMap
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
function mergeElements(prev, next, options = {}) {
|
|
164
|
+
const clearAbsentSlots = typeof options === "boolean" ? options : options.clearAbsentSlots ?? false;
|
|
165
|
+
const preserveAbsentSlots = typeof options === "boolean" ? !options : options.preserveAbsentSlots ?? true;
|
|
166
|
+
const preserveElementIds = typeof options === "boolean" ? [] : options.preserveElementIds ?? [];
|
|
167
|
+
const preservePreviousSlotIds = typeof options === "boolean" ? [] : options.preservePreviousSlotIds ?? [];
|
|
168
|
+
const merged = { ...next };
|
|
169
|
+
for (const id of preserveElementIds) {
|
|
170
|
+
if (Object.hasOwn(merged, id)) continue;
|
|
171
|
+
if (Object.hasOwn(prev, id)) {
|
|
172
|
+
const value = prev[id];
|
|
173
|
+
if (value !== void 0) merged[id] = value;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
const slotKeys = new Set([...Object.keys(prev), ...Object.keys(next)].filter((key) => AppElementsWire.isSlotId(key)));
|
|
177
|
+
if (clearAbsentSlots) {
|
|
178
|
+
for (const key of slotKeys) if (!Object.hasOwn(next, key)) delete merged[key];
|
|
179
|
+
} else if (preserveAbsentSlots) {
|
|
180
|
+
for (const key of slotKeys) if (!Object.hasOwn(merged, key) && Object.hasOwn(prev, key)) {
|
|
181
|
+
const value = prev[key];
|
|
182
|
+
if (value !== void 0) merged[key] = value;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
for (const id of preservePreviousSlotIds) {
|
|
186
|
+
if (!AppElementsWire.isSlotId(id)) continue;
|
|
187
|
+
if (!Object.hasOwn(prev, id)) continue;
|
|
188
|
+
const value = prev[id];
|
|
189
|
+
if (value !== void 0 && value !== UNMATCHED_SLOT) merged[id] = value;
|
|
190
|
+
}
|
|
191
|
+
return merged;
|
|
192
|
+
}
|
|
193
|
+
function Slot({ id, children, parallelSlots }) {
|
|
194
|
+
const elements = React$1.useContext(ElementsContext);
|
|
195
|
+
if (!Object.hasOwn(elements, id)) {
|
|
196
|
+
if (process.env.NODE_ENV !== "production" && !AppElementsWire.isSlotId(id)) {
|
|
197
|
+
if (!warnedMissingEntryIds.has(id)) {
|
|
198
|
+
warnedMissingEntryIds.add(id);
|
|
199
|
+
console.warn("[vinext] Missing App Router element entry during render: " + id);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return null;
|
|
203
|
+
}
|
|
204
|
+
const element = elements[id];
|
|
205
|
+
if (isTransportMetadataValue(id, element)) {
|
|
206
|
+
warnTransportMetadataEntry(id);
|
|
207
|
+
return null;
|
|
208
|
+
}
|
|
209
|
+
if (element === UNMATCHED_SLOT) notFound();
|
|
210
|
+
if (element === null) return null;
|
|
211
|
+
const content = /* @__PURE__ */ jsx(ParallelSlotsContext.Provider, {
|
|
212
|
+
value: parallelSlots ?? null,
|
|
213
|
+
children: /* @__PURE__ */ jsx(ChildrenContext.Provider, {
|
|
214
|
+
value: children ?? null,
|
|
215
|
+
children: element
|
|
216
|
+
})
|
|
217
|
+
});
|
|
218
|
+
return BfcacheIdMapContext && BfcacheSegmentIdContext ? /* @__PURE__ */ jsx(BfcacheSlotBoundary, {
|
|
219
|
+
id,
|
|
220
|
+
content
|
|
221
|
+
}) : content;
|
|
222
|
+
}
|
|
223
|
+
function Children() {
|
|
224
|
+
return React$1.useContext(ChildrenContext);
|
|
225
|
+
}
|
|
226
|
+
function ParallelSlot({ name }) {
|
|
227
|
+
return React$1.useContext(ParallelSlotsContext)?.[name] ?? null;
|
|
228
|
+
}
|
|
229
|
+
//#endregion
|
|
230
|
+
export { BfcacheStateKeyMapContext, Children, ChildrenContext, ElementsContext, ParallelSlot, ParallelSlotsContext, Slot, UNMATCHED_SLOT, mergeElements, updateBfcacheSlotEntryOrder };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/shims/thenable-params.d.ts
|
|
2
|
+
declare const WELL_KNOWN_PROPERTIES: readonly ["hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toString", "valueOf", "toLocaleString", "then", "catch", "finally", "status", "value", "error", "displayName", "_debugInfo", "toJSON", "$$typeof", "__esModule", "@@iterator"];
|
|
3
|
+
type WellKnownProperty = (typeof WELL_KNOWN_PROPERTIES)[number];
|
|
4
|
+
type ThenableParams<T extends Record<string, unknown>> = Promise<T> & Omit<T, WellKnownProperty>;
|
|
5
|
+
type ThenableParamsObserver = Readonly<{
|
|
6
|
+
observeParamAccess: (keys: readonly string[]) => void;
|
|
7
|
+
observeReactPromiseStatus?: boolean;
|
|
8
|
+
}>;
|
|
9
|
+
declare function makeThenableParams<T extends Record<string, unknown>>(obj: T, observer?: ThenableParamsObserver): ThenableParams<T>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { ThenableParams, ThenableParamsObserver, makeThenableParams };
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { createPprFallbackShellSuspensePromiseForState, getPprFallbackShellState } from "./ppr-fallback-shell.js";
|
|
2
|
+
//#region src/shims/thenable-params.ts
|
|
3
|
+
function hasParamProperty(obj, prop) {
|
|
4
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
5
|
+
}
|
|
6
|
+
const wellKnownProperties = new Set([
|
|
7
|
+
"hasOwnProperty",
|
|
8
|
+
"isPrototypeOf",
|
|
9
|
+
"propertyIsEnumerable",
|
|
10
|
+
"toString",
|
|
11
|
+
"valueOf",
|
|
12
|
+
"toLocaleString",
|
|
13
|
+
"then",
|
|
14
|
+
"catch",
|
|
15
|
+
"finally",
|
|
16
|
+
"status",
|
|
17
|
+
"value",
|
|
18
|
+
"error",
|
|
19
|
+
"displayName",
|
|
20
|
+
"_debugInfo",
|
|
21
|
+
"toJSON",
|
|
22
|
+
"$$typeof",
|
|
23
|
+
"__esModule",
|
|
24
|
+
"@@iterator"
|
|
25
|
+
]);
|
|
26
|
+
function isWellKnownProperty(prop) {
|
|
27
|
+
return wellKnownProperties.has(prop);
|
|
28
|
+
}
|
|
29
|
+
function observeParamKeys(observer, keys) {
|
|
30
|
+
if (observer) observer.observeParamAccess(keys);
|
|
31
|
+
}
|
|
32
|
+
function observeAllParamKeys(observer, plain) {
|
|
33
|
+
observeParamKeys(observer, Object.keys(plain));
|
|
34
|
+
}
|
|
35
|
+
function observeReadableParamKeys(observer, plain) {
|
|
36
|
+
observeParamKeys(observer, Object.keys(plain).filter((key) => !isWellKnownProperty(key)));
|
|
37
|
+
}
|
|
38
|
+
function isPromiseContinuation(prop) {
|
|
39
|
+
return prop === "then" || prop === "catch" || prop === "finally";
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Build a proxy around `plain` that preserves fallback-key suspension.
|
|
43
|
+
* This is the value `await params` resolves to during fallback-shell
|
|
44
|
+
* prerendering. Known params are readable synchronously; fallback params
|
|
45
|
+
* suspend (throw a hanging promise) only when actually accessed.
|
|
46
|
+
*
|
|
47
|
+
* The handler is typed as `ProxyHandler<T>` and no cast is needed because
|
|
48
|
+
* the target is already `plain: T`.
|
|
49
|
+
*/
|
|
50
|
+
function createResolvedParamsProxy(plain, fallbackParamNames, observer, getFallbackShellPromise) {
|
|
51
|
+
if (!fallbackParamNames || fallbackParamNames.size === 0) return plain;
|
|
52
|
+
function isFallbackParam(prop) {
|
|
53
|
+
return typeof prop === "string" && fallbackParamNames !== null && fallbackParamNames.has(prop);
|
|
54
|
+
}
|
|
55
|
+
return new Proxy(plain, {
|
|
56
|
+
get(_target, prop, _receiver) {
|
|
57
|
+
if (typeof prop === "string" && !isWellKnownProperty(prop)) observeParamKeys(observer, [prop]);
|
|
58
|
+
if (!isWellKnownProperty(prop) && hasParamProperty(plain, prop)) {
|
|
59
|
+
if (isFallbackParam(prop)) {
|
|
60
|
+
const p = getFallbackShellPromise();
|
|
61
|
+
if (p) throw p;
|
|
62
|
+
}
|
|
63
|
+
return Reflect.get(plain, prop);
|
|
64
|
+
}
|
|
65
|
+
return Reflect.get(plain, prop);
|
|
66
|
+
},
|
|
67
|
+
getOwnPropertyDescriptor(_target, prop) {
|
|
68
|
+
if (typeof prop === "string" && !isWellKnownProperty(prop)) observeParamKeys(observer, [prop]);
|
|
69
|
+
if (!isWellKnownProperty(prop) && hasParamProperty(plain, prop)) {
|
|
70
|
+
if (isFallbackParam(prop)) return {
|
|
71
|
+
configurable: true,
|
|
72
|
+
enumerable: true,
|
|
73
|
+
get() {
|
|
74
|
+
const p = getFallbackShellPromise();
|
|
75
|
+
if (p) throw p;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
return {
|
|
79
|
+
configurable: true,
|
|
80
|
+
enumerable: true,
|
|
81
|
+
value: Reflect.get(plain, prop),
|
|
82
|
+
writable: true
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
return Reflect.getOwnPropertyDescriptor(plain, prop);
|
|
86
|
+
},
|
|
87
|
+
has(_target, prop) {
|
|
88
|
+
if (typeof prop === "string" && !isWellKnownProperty(prop)) observeParamKeys(observer, [prop]);
|
|
89
|
+
return Reflect.has(plain, prop) || !isWellKnownProperty(prop) && hasParamProperty(plain, prop);
|
|
90
|
+
},
|
|
91
|
+
ownKeys() {
|
|
92
|
+
observeReadableParamKeys(observer, plain);
|
|
93
|
+
return Reflect.ownKeys(plain).filter((prop) => !isWellKnownProperty(prop));
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Wrap a `Promise<T>` with a proxy that also exposes param properties for
|
|
99
|
+
* synchronous access. TypeScript cannot prove this hybrid shape statically,
|
|
100
|
+
* so the single `as ThenableParams<T>` cast is isolated here.
|
|
101
|
+
*/
|
|
102
|
+
function createThenableParamsProxy(promise, handler) {
|
|
103
|
+
return new Proxy(promise, handler);
|
|
104
|
+
}
|
|
105
|
+
function makeThenableParams(obj, observer) {
|
|
106
|
+
const plain = { ...obj };
|
|
107
|
+
const fallbackShellState = getPprFallbackShellState();
|
|
108
|
+
const fallbackParamNames = fallbackShellState && Object.keys(plain).some((key) => fallbackShellState.fallbackParamNames.has(key)) ? fallbackShellState.fallbackParamNames : null;
|
|
109
|
+
let fallbackShellPromise = null;
|
|
110
|
+
let fallbackShellPromiseController = null;
|
|
111
|
+
function getFallbackShellPromise() {
|
|
112
|
+
if (!fallbackParamNames || !fallbackShellState) return null;
|
|
113
|
+
if (fallbackShellPromise && fallbackShellPromiseController === fallbackShellState.abortController) return fallbackShellPromise;
|
|
114
|
+
fallbackShellPromiseController = fallbackShellState.abortController;
|
|
115
|
+
fallbackShellPromise = createPprFallbackShellSuspensePromiseForState(fallbackShellState, "`params`");
|
|
116
|
+
return fallbackShellPromise;
|
|
117
|
+
}
|
|
118
|
+
const resolvedParams = createResolvedParamsProxy(plain, fallbackParamNames, observer, getFallbackShellPromise);
|
|
119
|
+
const promise = Promise.resolve(resolvedParams);
|
|
120
|
+
function isFallbackParam(prop) {
|
|
121
|
+
return typeof prop === "string" && (fallbackParamNames?.has(prop) ?? false);
|
|
122
|
+
}
|
|
123
|
+
return createThenableParamsProxy(promise, {
|
|
124
|
+
get(target, prop, receiver) {
|
|
125
|
+
if (isPromiseContinuation(prop)) {
|
|
126
|
+
const value = Reflect.get(target, prop, receiver);
|
|
127
|
+
if (typeof value !== "function") return value;
|
|
128
|
+
return (...args) => {
|
|
129
|
+
if (!fallbackParamNames) observeAllParamKeys(observer, plain);
|
|
130
|
+
return Reflect.apply(value, target, args);
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
if (prop === "status" && observer?.observeReactPromiseStatus === true) observeAllParamKeys(observer, plain);
|
|
134
|
+
if (typeof prop === "string" && !isWellKnownProperty(prop)) observeParamKeys(observer, [prop]);
|
|
135
|
+
if (!isWellKnownProperty(prop) && hasParamProperty(plain, prop)) {
|
|
136
|
+
if (isFallbackParam(prop)) {
|
|
137
|
+
const p = getFallbackShellPromise();
|
|
138
|
+
if (p) throw p;
|
|
139
|
+
}
|
|
140
|
+
return Reflect.get(plain, prop);
|
|
141
|
+
}
|
|
142
|
+
const value = Reflect.get(target, prop, receiver);
|
|
143
|
+
return typeof value === "function" ? value.bind(target) : value;
|
|
144
|
+
},
|
|
145
|
+
getOwnPropertyDescriptor(target, prop) {
|
|
146
|
+
if (typeof prop === "string" && !isWellKnownProperty(prop)) observeParamKeys(observer, [prop]);
|
|
147
|
+
if (!isWellKnownProperty(prop) && hasParamProperty(plain, prop)) {
|
|
148
|
+
if (isFallbackParam(prop)) return {
|
|
149
|
+
configurable: true,
|
|
150
|
+
enumerable: true,
|
|
151
|
+
get() {
|
|
152
|
+
const p = getFallbackShellPromise();
|
|
153
|
+
if (p) throw p;
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
return {
|
|
157
|
+
configurable: true,
|
|
158
|
+
enumerable: true,
|
|
159
|
+
value: Reflect.get(plain, prop),
|
|
160
|
+
writable: true
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
return Reflect.getOwnPropertyDescriptor(target, prop);
|
|
164
|
+
},
|
|
165
|
+
has(target, prop) {
|
|
166
|
+
if (typeof prop === "string" && !isWellKnownProperty(prop)) observeParamKeys(observer, [prop]);
|
|
167
|
+
return Reflect.has(target, prop) || !isWellKnownProperty(prop) && hasParamProperty(plain, prop);
|
|
168
|
+
},
|
|
169
|
+
ownKeys() {
|
|
170
|
+
observeReadableParamKeys(observer, plain);
|
|
171
|
+
return Reflect.ownKeys(plain).filter((prop) => !isWellKnownProperty(prop));
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
//#endregion
|
|
176
|
+
export { makeThenableParams };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { CacheState } from "./cache-request-state.js";
|
|
2
|
+
import { ExecutionContextLike } from "./request-context.js";
|
|
3
|
+
import { RootParamsState } from "./root-params.js";
|
|
4
|
+
import { FetchCacheState } from "./fetch-cache.js";
|
|
5
|
+
import { VinextHeadersShimState } from "./headers.js";
|
|
6
|
+
import { RouterState } from "./router-state.js";
|
|
7
|
+
import { PrivateCacheState } from "./cache-runtime.js";
|
|
8
|
+
import { HeadState } from "./head-state.js";
|
|
9
|
+
import { I18nState } from "./i18n-state.js";
|
|
10
|
+
import { NavigationState } from "./navigation-state.js";
|
|
11
|
+
//#region src/shims/unified-request-context.d.ts
|
|
12
|
+
/**
|
|
13
|
+
* Flat union of all per-request state previously spread across
|
|
14
|
+
* VinextHeadersShimState, NavigationState, CacheState, PrivateCacheState,
|
|
15
|
+
* FetchCacheState, and ExecutionContextLike.
|
|
16
|
+
*
|
|
17
|
+
* Each field group is documented with its source shim module.
|
|
18
|
+
*/
|
|
19
|
+
type UnifiedRequestContext = {
|
|
20
|
+
/** Cloudflare Workers ExecutionContext, or null on Node.js dev. */executionContext: ExecutionContextLike | null; /** Per-request cache for cacheForRequest(). Keyed by factory function reference. */
|
|
21
|
+
requestCache: WeakMap<(...args: any[]) => any, unknown>;
|
|
22
|
+
} & VinextHeadersShimState & I18nState & NavigationState & CacheState & PrivateCacheState & FetchCacheState & RouterState & HeadState & RootParamsState;
|
|
23
|
+
/**
|
|
24
|
+
* Create a fresh `UnifiedRequestContext` with defaults for all fields.
|
|
25
|
+
* Pass partial overrides for the fields you need to pre-populate.
|
|
26
|
+
*/
|
|
27
|
+
declare function createRequestContext(opts?: Partial<UnifiedRequestContext>): UnifiedRequestContext;
|
|
28
|
+
/**
|
|
29
|
+
* Run `fn` within a unified request context scope.
|
|
30
|
+
* All shim modules will read/write their state from `ctx` for the
|
|
31
|
+
* duration of the call, including async continuations.
|
|
32
|
+
*/
|
|
33
|
+
declare function runWithRequestContext<T>(ctx: UnifiedRequestContext, fn: () => Promise<T>): Promise<T>;
|
|
34
|
+
declare function runWithRequestContext<T>(ctx: UnifiedRequestContext, fn: () => T | Promise<T>): T | Promise<T>;
|
|
35
|
+
/**
|
|
36
|
+
* Run `fn` in a nested unified scope derived from the current request context.
|
|
37
|
+
* Used by legacy runWith* wrappers to reset or override one sub-state while
|
|
38
|
+
* preserving proper async isolation for continuations created inside `fn`.
|
|
39
|
+
* The child scope is a shallow clone of the parent store, so untouched fields
|
|
40
|
+
* keep sharing their existing references while overridden slices can be reset.
|
|
41
|
+
*
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
44
|
+
declare function runWithUnifiedStateMutation<T>(mutate: (ctx: UnifiedRequestContext) => void, fn: () => Promise<T>): Promise<T>;
|
|
45
|
+
declare function runWithUnifiedStateMutation<T>(mutate: (ctx: UnifiedRequestContext) => void, fn: () => T | Promise<T>): T | Promise<T>;
|
|
46
|
+
/**
|
|
47
|
+
* Get the current unified request context.
|
|
48
|
+
* Returns the ALS store when inside a `runWithRequestContext()` scope,
|
|
49
|
+
* or a fresh detached context otherwise. Unlike the legacy per-shim fallback
|
|
50
|
+
* singletons, this detached value is ephemeral — mutations do not persist
|
|
51
|
+
* across calls. This is intentional to prevent state leakage outside request
|
|
52
|
+
* scopes.
|
|
53
|
+
*
|
|
54
|
+
* Only direct callers observe this detached fallback. Shim `_getState()`
|
|
55
|
+
* helpers should continue to gate on `isInsideUnifiedScope()` and fall back
|
|
56
|
+
* to their standalone ALS/fallback singletons outside the unified scope.
|
|
57
|
+
* If called inside a standalone `runWithExecutionContext()` scope, the
|
|
58
|
+
* detached context still reflects that inherited `executionContext`.
|
|
59
|
+
*/
|
|
60
|
+
declare function getRequestContext(): UnifiedRequestContext;
|
|
61
|
+
/**
|
|
62
|
+
* Check whether the current execution is inside a `runWithRequestContext()` scope.
|
|
63
|
+
* Shim modules use this to decide whether to read from the unified store
|
|
64
|
+
* or fall back to their own standalone ALS.
|
|
65
|
+
*/
|
|
66
|
+
declare function isInsideUnifiedScope(): boolean;
|
|
67
|
+
//#endregion
|
|
68
|
+
export { UnifiedRequestContext, createRequestContext, getRequestContext, isInsideUnifiedScope, runWithRequestContext, runWithUnifiedStateMutation };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { getOrCreateAls } from "./internal/als-registry.js";
|
|
2
|
+
//#region src/shims/unified-request-context.ts
|
|
3
|
+
const _REQUEST_CONTEXT_ALS_KEY = Symbol.for("vinext.requestContext.als");
|
|
4
|
+
const _g = globalThis;
|
|
5
|
+
const _als = getOrCreateAls("vinext.unifiedRequestContext.als");
|
|
6
|
+
function _getInheritedExecutionContext() {
|
|
7
|
+
const unifiedStore = _als.getStore();
|
|
8
|
+
if (unifiedStore) return unifiedStore.executionContext;
|
|
9
|
+
return _g[_REQUEST_CONTEXT_ALS_KEY]?.getStore() ?? null;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Create a fresh `UnifiedRequestContext` with defaults for all fields.
|
|
13
|
+
* Pass partial overrides for the fields you need to pre-populate.
|
|
14
|
+
*/
|
|
15
|
+
function createRequestContext(opts) {
|
|
16
|
+
return {
|
|
17
|
+
headersContext: null,
|
|
18
|
+
actionRevalidationKind: 0,
|
|
19
|
+
dynamicUsageDetected: false,
|
|
20
|
+
renderRequestApiUsage: /* @__PURE__ */ new Set(),
|
|
21
|
+
connectionProbe: null,
|
|
22
|
+
invalidDynamicUsageError: null,
|
|
23
|
+
pendingSetCookies: [],
|
|
24
|
+
draftModeCookieHeader: null,
|
|
25
|
+
phase: "render",
|
|
26
|
+
i18nContext: null,
|
|
27
|
+
serverContext: null,
|
|
28
|
+
serverInsertedHTMLCallbacks: [],
|
|
29
|
+
requestScopedCacheLife: null,
|
|
30
|
+
unstableCacheObservations: /* @__PURE__ */ new Map(),
|
|
31
|
+
unstableCacheRevalidation: "foreground",
|
|
32
|
+
_privateCache: null,
|
|
33
|
+
cacheableFetchUrls: /* @__PURE__ */ new Set(),
|
|
34
|
+
currentRequestTags: [],
|
|
35
|
+
currentFetchSoftTags: [],
|
|
36
|
+
currentFetchCacheMode: null,
|
|
37
|
+
currentForceDynamicFetchDefault: false,
|
|
38
|
+
dynamicFetchUrls: /* @__PURE__ */ new Set(),
|
|
39
|
+
isFetchDedupeActive: false,
|
|
40
|
+
currentFetchDedupeEntries: /* @__PURE__ */ new Map(),
|
|
41
|
+
executionContext: _getInheritedExecutionContext(),
|
|
42
|
+
requestCache: /* @__PURE__ */ new WeakMap(),
|
|
43
|
+
ssrContext: null,
|
|
44
|
+
ssrHeadChildren: [],
|
|
45
|
+
documentInitialHead: [],
|
|
46
|
+
rootParams: null,
|
|
47
|
+
...opts
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function runWithRequestContext(ctx, fn) {
|
|
51
|
+
return _als.run(ctx, fn);
|
|
52
|
+
}
|
|
53
|
+
function runWithUnifiedStateMutation(mutate, fn) {
|
|
54
|
+
const parentCtx = _als.getStore();
|
|
55
|
+
if (!parentCtx) return fn();
|
|
56
|
+
const childCtx = { ...parentCtx };
|
|
57
|
+
mutate(childCtx);
|
|
58
|
+
return _als.run(childCtx, fn);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Get the current unified request context.
|
|
62
|
+
* Returns the ALS store when inside a `runWithRequestContext()` scope,
|
|
63
|
+
* or a fresh detached context otherwise. Unlike the legacy per-shim fallback
|
|
64
|
+
* singletons, this detached value is ephemeral — mutations do not persist
|
|
65
|
+
* across calls. This is intentional to prevent state leakage outside request
|
|
66
|
+
* scopes.
|
|
67
|
+
*
|
|
68
|
+
* Only direct callers observe this detached fallback. Shim `_getState()`
|
|
69
|
+
* helpers should continue to gate on `isInsideUnifiedScope()` and fall back
|
|
70
|
+
* to their standalone ALS/fallback singletons outside the unified scope.
|
|
71
|
+
* If called inside a standalone `runWithExecutionContext()` scope, the
|
|
72
|
+
* detached context still reflects that inherited `executionContext`.
|
|
73
|
+
*/
|
|
74
|
+
function getRequestContext() {
|
|
75
|
+
return _als.getStore() ?? createRequestContext();
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Check whether the current execution is inside a `runWithRequestContext()` scope.
|
|
79
|
+
* Shim modules use this to decide whether to read from the unified store
|
|
80
|
+
* or fall back to their own standalone ALS.
|
|
81
|
+
*/
|
|
82
|
+
function isInsideUnifiedScope() {
|
|
83
|
+
return _als.getStore() != null;
|
|
84
|
+
}
|
|
85
|
+
//#endregion
|
|
86
|
+
export { createRequestContext, getRequestContext, isInsideUnifiedScope, runWithRequestContext, runWithUnifiedStateMutation };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//#region src/shims/unrecognized-action-error.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Unrecognized server-action errors.
|
|
4
|
+
*
|
|
5
|
+
* When a server action call fails because the server did not recognize the
|
|
6
|
+
* action id, the client bundle and the server are typically from different
|
|
7
|
+
* deployments and a hard reload is required.
|
|
8
|
+
*
|
|
9
|
+
* This module is intentionally dependency-free: both the `next/navigation`
|
|
10
|
+
* shim (which re-exports these for user code) and vinext's client
|
|
11
|
+
* server-action dispatcher import `UnrecognizedActionError` from here, so the
|
|
12
|
+
* `instanceof` check inside `unstable_isUnrecognizedActionError` resolves
|
|
13
|
+
* against a single shared class.
|
|
14
|
+
*
|
|
15
|
+
* Ported 1:1 from Next.js:
|
|
16
|
+
* https://github.com/vercel/next.js/blob/canary/packages/next/src/client/components/unrecognized-action-error.ts
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Error class for unrecognized server-action calls. Thrown by vinext's client
|
|
20
|
+
* server-action dispatcher when the server reports the requested action id as
|
|
21
|
+
* unknown (the `x-nextjs-action-not-found` response header).
|
|
22
|
+
*/
|
|
23
|
+
declare class UnrecognizedActionError extends Error {
|
|
24
|
+
constructor(...args: ConstructorParameters<typeof Error>);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Returns true if the error came from a server action whose id was not
|
|
28
|
+
* recognized by the server. Useful inside `catch` blocks that surround
|
|
29
|
+
* `await myAction(...)` calls; reloading the page generally fixes the
|
|
30
|
+
* underlying client/server deployment mismatch.
|
|
31
|
+
*/
|
|
32
|
+
declare function unstable_isUnrecognizedActionError(error: unknown): error is UnrecognizedActionError;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { UnrecognizedActionError, unstable_isUnrecognizedActionError };
|