vinext 1.0.0-beta.0 → 1.0.0-beta.10
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 +143 -19
- package/dist/build/action-owner-manifest.d.ts +41 -0
- package/dist/build/action-owner-manifest.js +110 -0
- package/dist/build/assets-ignore.d.ts +3 -4
- package/dist/build/assets-ignore.js +1 -1
- package/dist/build/clean-output.d.ts +2 -3
- package/dist/build/clean-output.js +2 -5
- package/dist/build/client-build-config.d.ts +39 -13
- package/dist/build/client-build-config.js +92 -16
- package/dist/build/css-url-assets.d.ts +4 -6
- package/dist/build/css-url-assets.js +8 -5
- package/dist/build/google-fonts/build-url.d.ts +8 -6
- package/dist/build/google-fonts/fallback-metrics.d.ts +3 -4
- package/dist/build/google-fonts/fallback-metrics.js +1 -1
- package/dist/build/google-fonts/find-font-files-in-css.d.ts +2 -3
- package/dist/build/google-fonts/font-metadata.d.ts +9 -6
- package/dist/build/google-fonts/font-metadata.js +1 -1
- package/dist/build/google-fonts/get-axes.d.ts +2 -4
- package/dist/build/google-fonts/sort-variants.d.ts +2 -3
- package/dist/build/google-fonts/validate.d.ts +2 -3
- package/dist/build/google-fonts/validate.js +8 -4
- package/dist/build/inject-pregenerated-paths.d.ts +2 -3
- package/dist/build/inject-pregenerated-paths.js +17 -15
- package/dist/build/inline-css.d.ts +3 -4
- package/dist/build/inline-css.js +2 -5
- package/dist/build/layout-classification-types.d.ts +4 -5
- package/dist/build/layout-classification.d.ts +14 -12
- package/dist/build/module-dependency-cache.d.ts +3 -0
- package/dist/build/module-dependency-cache.js +13 -0
- package/dist/build/next-client-runtime-manifests.d.ts +4 -6
- package/dist/build/next-client-runtime-manifests.js +3 -20
- package/dist/build/nitro-route-rules.d.ts +6 -8
- package/dist/build/pages-client-assets-module.d.ts +7 -9
- package/dist/build/pages-client-assets-module.js +1 -1
- package/dist/build/precompress.d.ts +9 -5
- package/dist/build/precompress.js +47 -13
- package/dist/build/prerender-paths.d.ts +69 -9
- package/dist/build/prerender-paths.js +708 -110
- package/dist/build/prerender-phase.d.ts +14 -0
- package/dist/build/prerender-phase.js +37 -0
- package/dist/build/prerender-server-entry.d.ts +1 -1
- package/dist/build/prerender-server-entry.js +8 -2
- package/dist/build/prerender-server-pool.d.ts +13 -8
- package/dist/build/prerender-server-pool.js +11 -6
- package/dist/build/prerender.d.ts +62 -42
- package/dist/build/prerender.js +171 -53
- package/dist/build/preview-credentials.d.ts +10 -0
- package/dist/build/preview-credentials.js +19 -0
- package/dist/build/public-dir-conflict.d.ts +13 -0
- package/dist/build/public-dir-conflict.js +26 -0
- package/dist/build/report.d.ts +42 -24
- package/dist/build/report.js +77 -8
- package/dist/build/route-classification-injector.d.ts +2 -4
- package/dist/build/route-classification-manifest.d.ts +11 -10
- package/dist/build/run-prerender.d.ts +14 -20
- package/dist/build/run-prerender.js +28 -26
- package/dist/build/server-entry.d.ts +4 -0
- package/dist/build/server-entry.js +28 -0
- package/dist/build/server-manifest.d.ts +8 -3
- package/dist/build/server-manifest.js +15 -3
- package/dist/build/ssr-manifest.d.ts +9 -6
- package/dist/build/ssr-manifest.js +10 -6
- package/dist/build/standalone.d.ts +2 -3
- package/dist/build/standalone.js +37 -37
- package/dist/build/static-export.d.ts +30 -20
- package/dist/cache/cache-adapters-virtual.d.ts +89 -27
- package/dist/cache/cache-adapters-virtual.js +54 -16
- package/dist/check.d.ts +9 -26
- package/dist/check.js +35 -40
- package/dist/cli-args.d.ts +4 -4
- package/dist/cli-args.js +10 -0
- package/dist/cli-dev-config.d.ts +5 -7
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +97 -65
- package/dist/client/app-nav-failure-handler.d.ts +6 -7
- package/dist/client/app-nav-failure-handler.js +1 -0
- package/dist/client/client-rewrite-matcher.d.ts +11 -0
- package/dist/client/client-rewrite-matcher.js +20 -0
- package/dist/client/client-rewrites.d.ts +30 -0
- package/dist/client/client-rewrites.js +41 -0
- package/dist/client/dev-error-overlay-store.d.ts +13 -14
- package/dist/client/dev-error-overlay.d.ts +15 -16
- package/dist/client/dev-error-overlay.js +7 -4
- package/dist/client/empty-module.d.ts +1 -1
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.js +2 -0
- package/dist/client/instrumentation-client-inject.d.ts +3 -4
- package/dist/client/instrumentation-client-inject.js +1 -1
- package/dist/client/instrumentation-client-state.d.ts +5 -7
- package/dist/client/instrumentation-client.d.ts +3 -4
- package/dist/client/navigation-runtime.d.ts +31 -19
- package/dist/client/navigation-runtime.js +8 -8
- package/dist/client/pages-router-link-navigation.d.ts +4 -23
- package/dist/client/pages-router-link-navigation.js +1 -1
- package/dist/client/react-instance-bootstrap.d.ts +1 -0
- package/dist/client/react-instance-bootstrap.js +7 -0
- package/dist/client/react-instance.d.ts +12 -0
- package/dist/client/react-instance.js +20 -0
- package/dist/client/validate-module-path.d.ts +2 -3
- package/dist/client/vinext-next-data.d.ts +20 -14
- package/dist/client/window-next.d.ts +9 -7
- package/dist/config/config-matchers.d.ts +27 -53
- package/dist/config/config-matchers.js +51 -134
- package/dist/config/dotenv.d.ts +5 -11
- package/dist/config/dotenv.js +33 -24
- package/dist/config/next-config.d.ts +145 -71
- package/dist/config/next-config.js +126 -28
- package/dist/config/prerender.d.ts +16 -17
- package/dist/config/prerender.js +9 -17
- package/dist/config/request-context.d.ts +13 -0
- package/dist/config/request-context.js +26 -0
- package/dist/config/server-external-packages.d.ts +2 -3
- package/dist/config/server-external-packages.js +1 -1
- package/dist/config/tsconfig-paths.d.ts +3 -4
- package/dist/config/tsconfig-paths.js +2 -2
- package/dist/{node_modules/.pnpm/am-i-vibing@0.5.0/node_modules → deps/.pnpm/am-i-vibing@0.5.0/deps}/am-i-vibing/dist/detector-1yx2Hoe0.js +2 -2
- package/dist/deps/.pnpm/image-size@2.0.2/deps/image-size/dist/index.js +808 -0
- package/dist/deps/.pnpm/pathslash@0.1.0/deps/pathslash/dist/index.js +50 -0
- package/dist/entries/app-browser-entry.d.ts +7 -15
- package/dist/entries/app-browser-entry.js +30 -8
- package/dist/entries/app-rsc-entry.d.ts +40 -20
- package/dist/entries/app-rsc-entry.js +534 -41
- package/dist/entries/app-rsc-manifest.d.ts +2 -4
- package/dist/entries/app-rsc-manifest.js +44 -5
- package/dist/entries/app-ssr-entry.d.ts +2 -3
- package/dist/entries/pages-client-entry.d.ts +3 -5
- package/dist/entries/pages-client-entry.js +21 -11
- package/dist/entries/pages-server-entry.d.ts +13 -5
- package/dist/entries/pages-server-entry.js +227 -54
- package/dist/entries/runtime-entry-module.d.ts +4 -5
- package/dist/entries/runtime-entry-module.js +2 -2
- package/dist/image/image-adapters-virtual.d.ts +8 -7
- package/dist/index.d.ts +7 -4
- package/dist/index.js +1141 -504
- package/dist/init-cloudflare.d.ts +19 -15
- package/dist/init-cloudflare.js +416 -59
- package/dist/init-platform.d.ts +24 -23
- package/dist/init-platform.js +71 -24
- package/dist/init.d.ts +52 -29
- package/dist/init.js +37 -30
- package/dist/plugins/action-owner-manifest.d.ts +13 -0
- package/dist/plugins/action-owner-manifest.js +91 -0
- package/dist/plugins/ast-scope.d.ts +10 -12
- package/dist/plugins/ast-scope.js +10 -22
- package/dist/plugins/ast-utils.d.ts +37 -21
- package/dist/plugins/ast-utils.js +70 -39
- package/dist/plugins/async-hooks-stub.d.ts +2 -4
- package/dist/plugins/client-reference-dedup.d.ts +4 -6
- package/dist/plugins/client-reference-dedup.js +7 -5
- package/dist/plugins/css-data-url.d.ts +2 -4
- package/dist/plugins/css-module-imports.d.ts +4 -6
- package/dist/plugins/css-module-imports.js +5 -13
- package/dist/plugins/dynamic-preload-metadata.d.ts +3 -5
- package/dist/plugins/dynamic-preload-metadata.js +65 -185
- package/dist/plugins/environment.d.ts +10 -0
- package/dist/plugins/environment.js +7 -0
- package/dist/plugins/extensionless-dynamic-import.d.ts +2 -4
- package/dist/plugins/extensionless-dynamic-import.js +379 -63
- package/dist/plugins/fonts.d.ts +10 -12
- package/dist/plugins/fonts.js +13 -16
- package/dist/plugins/ignore-dynamic-requests.d.ts +5 -9
- package/dist/plugins/ignore-dynamic-requests.js +116 -144
- package/dist/plugins/import-meta-url.d.ts +16 -12
- package/dist/plugins/import-meta-url.js +347 -124
- package/dist/plugins/instrumentation-client.d.ts +2 -4
- package/dist/plugins/instrumentation-client.js +4 -5
- package/dist/plugins/middleware-export-validation.d.ts +3 -4
- package/dist/plugins/middleware-export-validation.js +5 -17
- package/dist/plugins/middleware-server-only.d.ts +2 -4
- package/dist/plugins/middleware-server-only.js +3 -3
- package/dist/plugins/og-asset-ownership.d.ts +3 -5
- package/dist/plugins/og-asset-ownership.js +24 -31
- package/dist/plugins/og-assets.d.ts +4 -6
- package/dist/plugins/og-assets.js +7 -10
- package/dist/plugins/optimize-imports.d.ts +5 -7
- package/dist/plugins/optimize-imports.js +41 -58
- package/dist/plugins/pages-node-externals.d.ts +22 -0
- package/dist/plugins/pages-node-externals.js +174 -0
- package/dist/plugins/postcss.d.ts +3 -4
- package/dist/plugins/postcss.js +1 -1
- package/dist/plugins/remove-console.d.ts +2 -4
- package/dist/plugins/remove-console.js +3 -6
- package/dist/plugins/require-condition-resolution.d.ts +15 -0
- package/dist/plugins/require-condition-resolution.js +166 -0
- package/dist/plugins/require-context.d.ts +2 -4
- package/dist/plugins/require-context.js +163 -84
- package/dist/plugins/rsc-client-reference-loaders.d.ts +2 -4
- package/dist/plugins/rsc-client-shim-excludes.d.ts +4 -5
- package/dist/plugins/rsc-reference-validation-normalizer.d.ts +2 -4
- package/dist/plugins/sass.d.ts +34 -7
- package/dist/plugins/sass.js +75 -10
- package/dist/plugins/server-externals-manifest.d.ts +2 -4
- package/dist/plugins/server-externals-manifest.js +2 -24
- package/dist/plugins/strip-server-exports.d.ts +5 -7
- package/dist/plugins/strip-server-exports.js +14 -20
- package/dist/plugins/styled-jsx.d.ts +2 -4
- package/dist/plugins/styled-jsx.js +25 -26
- package/dist/plugins/transform-cache.d.ts +18 -0
- package/dist/plugins/transform-cache.js +36 -0
- package/dist/plugins/transform-result.d.ts +9 -0
- package/dist/plugins/transform-result.js +10 -0
- package/dist/plugins/transitive-externals.d.ts +23 -0
- package/dist/plugins/transitive-externals.js +107 -0
- package/dist/plugins/typeof-window.d.ts +11 -7
- package/dist/plugins/typeof-window.js +155 -38
- package/dist/plugins/use-cache-callable.d.ts +11 -0
- package/dist/plugins/use-cache-callable.js +202 -0
- package/dist/plugins/wasm-module-import.d.ts +2 -4
- package/dist/plugins/wasm-module-import.js +1 -1
- package/dist/plugins/worker-image-imports.d.ts +11 -0
- package/dist/plugins/worker-image-imports.js +134 -0
- package/dist/routing/app-route-graph.d.ts +138 -69
- package/dist/routing/app-route-graph.js +189 -99
- package/dist/routing/app-router.d.ts +7 -11
- package/dist/routing/app-router.js +17 -12
- package/dist/routing/file-matcher.d.ts +21 -37
- package/dist/routing/file-matcher.js +31 -44
- package/dist/routing/pages-router.d.ts +15 -11
- package/dist/routing/pages-router.js +26 -32
- package/dist/routing/route-matching.d.ts +16 -5
- package/dist/routing/route-matching.js +16 -2
- package/dist/routing/route-pattern.d.ts +19 -12
- package/dist/routing/route-pattern.js +33 -3
- package/dist/routing/route-trie.d.ts +8 -5
- package/dist/routing/route-trie.js +5 -2
- package/dist/routing/route-validation.d.ts +3 -4
- package/dist/routing/route-validation.js +19 -12
- package/dist/routing/utils.d.ts +13 -36
- package/dist/routing/utils.js +1 -30
- package/dist/server/accept-encoding.d.ts +9 -12
- package/dist/server/accept-encoding.js +1 -4
- package/dist/server/api-handler.d.ts +4 -4
- package/dist/server/api-handler.js +50 -40
- package/dist/server/app-action-forwarding.d.ts +17 -0
- package/dist/server/app-action-forwarding.js +140 -0
- package/dist/server/app-action-request.d.ts +2 -3
- package/dist/server/app-bfcache-id.d.ts +3 -4
- package/dist/server/app-bfcache-identity.d.ts +14 -16
- package/dist/server/app-bfcache-identity.js +27 -102
- package/dist/server/app-browser-action-result.d.ts +15 -17
- package/dist/server/app-browser-client-reuse-manifest.d.ts +2 -4
- package/dist/server/app-browser-entry.d.ts +1 -1
- package/dist/server/app-browser-entry.js +482 -147
- package/dist/server/app-browser-error.d.ts +5 -7
- package/dist/server/app-browser-error.js +1 -5
- package/dist/server/app-browser-history-controller.d.ts +29 -12
- package/dist/server/app-browser-history-controller.js +137 -20
- package/dist/server/app-browser-hydration.d.ts +5 -7
- package/dist/server/app-browser-interception-context.d.ts +3 -5
- package/dist/server/app-browser-mpa-navigation.d.ts +4 -6
- package/dist/server/app-browser-navigation-abort.d.ts +15 -0
- package/dist/server/app-browser-navigation-abort.js +29 -0
- package/dist/server/app-browser-navigation-controller.d.ts +36 -33
- package/dist/server/app-browser-navigation-controller.js +62 -16
- package/dist/server/app-browser-navigation-response.d.ts +10 -0
- package/dist/server/app-browser-navigation-response.js +8 -0
- package/dist/server/app-browser-popstate.d.ts +8 -5
- package/dist/server/app-browser-popstate.js +6 -2
- package/dist/server/app-browser-prefetch-response.d.ts +24 -0
- package/dist/server/app-browser-prefetch-response.js +54 -0
- package/dist/server/app-browser-rsc-redirect.d.ts +4 -5
- package/dist/server/app-browser-server-action-client.d.ts +5 -6
- package/dist/server/app-browser-server-action-client.js +7 -5
- package/dist/server/app-browser-server-action-navigation.d.ts +2 -4
- package/dist/server/app-browser-state.d.ts +26 -20
- package/dist/server/app-browser-state.js +15 -9
- package/dist/server/app-browser-stream.d.ts +4 -8
- package/dist/server/app-browser-stream.js +8 -6
- package/dist/server/app-browser-supplemental-refresh.d.ts +48 -0
- package/dist/server/app-browser-supplemental-refresh.js +190 -0
- package/dist/server/app-browser-visible-commit.d.ts +7 -8
- package/dist/server/app-browser-visible-commit.js +26 -11
- package/dist/server/app-client-reference-preloader.d.ts +2 -3
- package/dist/server/app-elements-wire-key.d.ts +25 -0
- package/dist/server/app-elements-wire-key.js +69 -0
- package/dist/server/app-elements-wire.d.ts +47 -60
- package/dist/server/app-elements-wire.js +43 -80
- package/dist/server/app-elements.d.ts +6 -7
- package/dist/server/app-elements.js +2 -2
- package/dist/server/app-fallback-renderer.d.ts +21 -7
- package/dist/server/app-fallback-renderer.js +18 -3
- package/dist/server/app-history-state.d.ts +37 -17
- package/dist/server/app-history-state.js +110 -18
- package/dist/server/app-hook-warning-suppression.d.ts +2 -4
- package/dist/server/app-hydration-cache-publication.d.ts +3 -4
- package/dist/server/app-inline-css-client.d.ts +3 -4
- package/dist/server/app-interception-context-header.d.ts +2 -3
- package/dist/server/app-layout-param-observation.d.ts +7 -9
- package/dist/server/app-layout-param-observation.js +1 -1
- package/dist/server/app-middleware.d.ts +20 -8
- package/dist/server/app-middleware.js +125 -34
- package/dist/server/app-mounted-slots-header.d.ts +2 -3
- package/dist/server/app-mounted-slots-header.js +2 -2
- package/dist/server/app-optimistic-routing.d.ts +35 -9
- package/dist/server/app-optimistic-routing.js +151 -13
- package/dist/server/app-page-boundary-render.d.ts +35 -8
- package/dist/server/app-page-boundary-render.js +195 -62
- package/dist/server/app-page-boundary.d.ts +9 -10
- package/dist/server/app-page-boundary.js +2 -1
- package/dist/server/app-page-cache-finalizer.d.ts +25 -9
- package/dist/server/app-page-cache-finalizer.js +124 -23
- package/dist/server/app-page-cache-render.d.ts +7 -7
- package/dist/server/app-page-cache-render.js +9 -4
- package/dist/server/app-page-cache.d.ts +12 -12
- package/dist/server/app-page-cache.js +55 -20
- package/dist/server/app-page-dispatch.d.ts +47 -19
- package/dist/server/app-page-dispatch.js +119 -79
- package/dist/server/app-page-element-builder.d.ts +77 -25
- package/dist/server/app-page-element-builder.js +260 -76
- package/dist/server/app-page-execution.d.ts +27 -18
- package/dist/server/app-page-execution.js +63 -54
- package/dist/server/app-page-head.d.ts +64 -13
- package/dist/server/app-page-head.js +216 -85
- package/dist/server/app-page-http-access-fallback-metadata.d.ts +28 -0
- package/dist/server/app-page-http-access-fallback-metadata.js +114 -0
- package/dist/server/app-page-method.d.ts +3 -4
- package/dist/server/app-page-params.d.ts +5 -7
- package/dist/server/app-page-ppr-runtime.d.ts +2 -3
- package/dist/server/app-page-ppr-runtime.js +3 -2
- package/dist/server/app-page-probe.d.ts +13 -9
- package/dist/server/app-page-probe.js +9 -4
- package/dist/server/app-page-render-identity.d.ts +5 -5
- package/dist/server/app-page-render-observation.d.ts +8 -10
- package/dist/server/app-page-render-observation.js +1 -1
- package/dist/server/app-page-render.d.ts +13 -10
- package/dist/server/app-page-render.js +96 -33
- package/dist/server/app-page-request.d.ts +27 -43
- package/dist/server/app-page-request.js +119 -65
- package/dist/server/app-page-response.d.ts +22 -10
- package/dist/server/app-page-response.js +25 -13
- package/dist/server/app-page-route-wiring.d.ts +58 -18
- package/dist/server/app-page-route-wiring.js +409 -98
- package/dist/server/app-page-search-params-observation.d.ts +3 -5
- package/dist/server/app-page-segment-plan.d.ts +55 -0
- package/dist/server/app-page-segment-plan.js +177 -0
- package/dist/server/app-page-segment-state.d.ts +23 -8
- package/dist/server/app-page-segment-state.js +35 -10
- package/dist/server/app-page-stream.d.ts +42 -21
- package/dist/server/app-page-stream.js +12 -4
- package/dist/server/app-pages-bridge.d.ts +7 -7
- package/dist/server/app-pages-bridge.js +33 -5
- package/dist/server/app-post-middleware-context.d.ts +3 -5
- package/dist/server/app-post-middleware-context.js +1 -1
- package/dist/server/app-ppr-fallback-shell-render.d.ts +3 -5
- package/dist/server/app-ppr-fallback-shell-render.js +3 -2
- package/dist/server/app-ppr-fallback-shell.d.ts +7 -8
- package/dist/server/app-ppr-fallback-shell.js +3 -6
- package/dist/server/app-prerender-endpoints.d.ts +5 -6
- package/dist/server/app-prerender-endpoints.js +36 -11
- package/dist/server/app-prerender-static-params.d.ts +3 -5
- package/dist/server/app-prerender-static-params.js +18 -8
- package/dist/server/app-render-dependency.d.ts +16 -10
- package/dist/server/app-render-dependency.js +59 -9
- package/dist/server/app-request-context.d.ts +4 -4
- package/dist/server/app-request-stage-context.d.ts +5 -0
- package/dist/server/app-request-stage-context.js +11 -0
- package/dist/server/app-request-stage-dispatch.d.ts +25 -0
- package/dist/server/app-request-stage-dispatch.js +54 -0
- package/dist/server/app-request-stage-independent-entry.d.ts +8 -0
- package/dist/server/app-request-stage-independent-entry.js +99 -0
- package/dist/server/app-response-header-provenance.d.ts +19 -0
- package/dist/server/app-response-header-provenance.js +58 -0
- package/dist/server/app-response-stage-entry.d.ts +9 -0
- package/dist/server/app-response-stage-entry.js +66 -0
- package/dist/server/app-route-handler-cache.d.ts +5 -5
- package/dist/server/app-route-handler-cache.js +11 -3
- package/dist/server/app-route-handler-dispatch.d.ts +2 -4
- package/dist/server/app-route-handler-dispatch.js +103 -70
- package/dist/server/app-route-handler-execution.d.ts +16 -11
- package/dist/server/app-route-handler-execution.js +175 -27
- package/dist/server/app-route-handler-middleware-context.d.ts +8 -0
- package/dist/server/app-route-handler-middleware-context.js +15 -0
- package/dist/server/app-route-handler-policy.d.ts +25 -11
- package/dist/server/app-route-handler-policy.js +21 -6
- package/dist/server/app-route-handler-response.d.ts +11 -11
- package/dist/server/app-route-handler-response.js +18 -6
- package/dist/server/app-route-handler-runtime.d.ts +10 -12
- package/dist/server/app-route-handler-runtime.js +222 -85
- package/dist/server/app-route-module-loader.d.ts +43 -10
- package/dist/server/app-route-module-loader.js +77 -3
- package/dist/server/app-route-request-built-ins.d.ts +15 -0
- package/dist/server/app-route-request-built-ins.js +41 -0
- package/dist/server/app-route-tree-prefetch.d.ts +6 -7
- package/dist/server/app-route-tree-prefetch.js +3 -2
- package/dist/server/app-router-entry.d.ts +0 -1
- package/dist/server/app-router-entry.js +61 -14
- package/dist/server/app-rsc-cache-busting.d.ts +50 -23
- package/dist/server/app-rsc-cache-busting.js +123 -32
- package/dist/server/app-rsc-combined-handler.d.ts +9 -0
- package/dist/server/app-rsc-combined-handler.js +11 -0
- package/dist/server/app-rsc-embedded-chunks.d.ts +6 -7
- package/dist/server/app-rsc-error-handler.d.ts +2 -3
- package/dist/server/app-rsc-errors.d.ts +6 -7
- package/dist/server/app-rsc-errors.js +22 -2
- package/dist/server/app-rsc-handler.d.ts +42 -13
- package/dist/server/app-rsc-handler.js +671 -116
- package/dist/server/app-rsc-redirect-flight.d.ts +64 -0
- package/dist/server/app-rsc-redirect-flight.js +71 -0
- package/dist/server/app-rsc-render-mode.d.ts +8 -8
- package/dist/server/app-rsc-render-mode.js +4 -1
- package/dist/server/app-rsc-request-normalization.d.ts +25 -13
- package/dist/server/app-rsc-request-normalization.js +78 -6
- package/dist/server/app-rsc-response-finalizer.d.ts +13 -5
- package/dist/server/app-rsc-response-finalizer.js +56 -29
- package/dist/server/app-rsc-response-stage.d.ts +6 -0
- package/dist/server/app-rsc-response-stage.js +242 -0
- package/dist/server/app-rsc-route-matching.d.ts +42 -7
- package/dist/server/app-rsc-route-matching.js +118 -17
- package/dist/server/app-rsc-state-fingerprint.d.ts +13 -0
- package/dist/server/app-rsc-state-fingerprint.js +13 -0
- package/dist/server/app-rsc-vary.d.ts +16 -0
- package/dist/server/app-rsc-vary.js +31 -0
- package/dist/server/app-segment-config.d.ts +7 -7
- package/dist/server/app-segment-config.js +38 -16
- package/dist/server/app-server-action-execution.d.ts +54 -17
- package/dist/server/app-server-action-execution.js +287 -128
- package/dist/server/app-ssr-entry.d.ts +15 -7
- package/dist/server/app-ssr-entry.js +39 -22
- package/dist/server/app-ssr-error-meta.d.ts +3 -4
- package/dist/server/app-ssr-error-meta.js +2 -1
- package/dist/server/app-ssr-router-instance.d.ts +2 -4
- package/dist/server/app-ssr-stream.d.ts +21 -16
- package/dist/server/app-ssr-stream.js +36 -16
- package/dist/server/app-static-generation.d.ts +4 -6
- package/dist/server/app-visited-response-cache.d.ts +17 -8
- package/dist/server/app-visited-response-cache.js +68 -4
- package/dist/server/app-worker-stages.d.ts +83 -0
- package/dist/server/app-worker-stages.js +52 -0
- package/dist/server/artifact-compatibility.d.ts +11 -12
- package/dist/server/artifact-compatibility.js +1 -1
- package/dist/server/before-interactive-head.d.ts +2 -4
- package/dist/server/before-interactive-head.js +2 -0
- package/dist/server/bfcache-identity.d.ts +44 -0
- package/dist/server/bfcache-identity.js +52 -0
- package/dist/server/cache-control.d.ts +46 -16
- package/dist/server/cache-control.js +117 -13
- package/dist/server/cache-headers.d.ts +3 -4
- package/dist/server/cache-proof.d.ts +69 -71
- package/dist/server/cache-proof.js +1 -1
- package/dist/server/cacheability-limits.d.ts +8 -0
- package/dist/server/cacheability-limits.js +9 -0
- package/dist/server/cacheability-manifest.d.ts +41 -0
- package/dist/server/cacheability-manifest.js +196 -0
- package/dist/server/cacheability-request.d.ts +49 -0
- package/dist/server/cacheability-request.js +538 -0
- package/dist/server/client-reuse-manifest.d.ts +17 -19
- package/dist/server/client-reuse-manifest.js +3 -3
- package/dist/server/client-trace-metadata.d.ts +5 -6
- package/dist/server/config-headers.d.ts +42 -0
- package/dist/server/config-headers.js +102 -0
- package/dist/server/cookie-utils.d.ts +2 -3
- package/dist/server/csp.d.ts +5 -7
- package/dist/server/default-global-error-module.d.ts +4 -4
- package/dist/server/default-global-not-found-module.d.ts +2 -4
- package/dist/server/default-not-found-module.d.ts +4 -4
- package/dist/server/defer-until-stream-consumed.d.ts +2 -3
- package/dist/server/dev-initial-server-error.d.ts +3 -4
- package/dist/server/dev-initial-server-error.js +2 -1
- package/dist/server/dev-lockfile.d.ts +29 -18
- package/dist/server/dev-lockfile.js +2 -3
- package/dist/server/dev-module-runner.d.ts +2 -4
- package/dist/server/dev-origin-check.d.ts +5 -6
- package/dist/server/dev-route-files.d.ts +2 -4
- package/dist/server/dev-route-files.js +3 -6
- package/dist/server/dev-server.d.ts +10 -21
- package/dist/server/dev-server.js +462 -546
- package/dist/server/dev-stack-sourcemap.d.ts +7 -9
- package/dist/server/dev-stack-sourcemap.js +6 -8
- package/dist/server/document-initial-head.d.ts +13 -4
- package/dist/server/document-initial-head.js +17 -2
- package/dist/server/edge-api-runtime.d.ts +11 -3
- package/dist/server/edge-api-runtime.js +29 -1
- package/dist/server/fetch-handler.d.ts +3 -2
- package/dist/server/fetch-handler.js +3 -18
- package/dist/server/file-based-metadata.d.ts +2 -4
- package/dist/server/headers.d.ts +73 -46
- package/dist/server/headers.js +52 -18
- package/dist/server/html.d.ts +6 -7
- package/dist/server/http-conditional.d.ts +21 -0
- package/dist/server/http-conditional.js +117 -0
- package/dist/server/http-date.d.ts +4 -0
- package/dist/server/http-date.js +73 -0
- package/dist/server/http-error-responses.d.ts +9 -9
- package/dist/server/http-error-responses.js +21 -4
- package/dist/server/http-range.d.ts +24 -0
- package/dist/server/http-range.js +67 -0
- package/dist/server/hybrid-route-priority.d.ts +4 -5
- package/dist/server/image-optimization.d.ts +34 -27
- package/dist/server/image-optimization.js +2 -3
- package/dist/server/implicit-tags.d.ts +3 -4
- package/dist/server/implicit-tags.js +2 -1
- package/dist/server/instrumentation-runtime.d.ts +2 -3
- package/dist/server/instrumentation.d.ts +17 -15
- package/dist/server/instrumentation.js +2 -2
- package/dist/server/isr-cache.d.ts +50 -67
- package/dist/server/isr-cache.js +45 -132
- package/dist/server/isr-decision.d.ts +11 -9
- package/dist/server/metadata-route-build-data.d.ts +4 -6
- package/dist/server/metadata-route-build-data.js +1 -1
- package/dist/server/metadata-route-cache-policy.d.ts +5 -0
- package/dist/server/metadata-route-cache-policy.js +6 -0
- package/dist/server/metadata-route-response.d.ts +28 -5
- package/dist/server/metadata-route-response.js +225 -11
- package/dist/server/metadata-routes.d.ts +52 -35
- package/dist/server/metadata-routes.js +5 -5
- package/dist/server/middleware-matcher-pattern.d.ts +20 -0
- package/dist/server/middleware-matcher-pattern.js +219 -0
- package/dist/server/middleware-matcher.d.ts +19 -12
- package/dist/server/middleware-matcher.js +56 -77
- package/dist/server/middleware-path-to-regexp.d.ts +13 -0
- package/dist/server/middleware-path-to-regexp.js +230 -0
- package/dist/server/middleware-response-headers.d.ts +3 -4
- package/dist/server/middleware-response-headers.js +5 -3
- package/dist/server/middleware-runtime.d.ts +19 -9
- package/dist/server/middleware-runtime.js +118 -36
- package/dist/server/middleware.d.ts +6 -19
- package/dist/server/middleware.js +5 -21
- package/dist/server/multi-stage.d.ts +118 -0
- package/dist/server/multi-stage.js +8 -0
- package/dist/server/navigation-planner.d.ts +30 -27
- package/dist/server/navigation-planner.js +65 -11
- package/dist/server/navigation-trace.d.ts +12 -12
- package/dist/server/navigation-trace.js +1 -0
- package/dist/server/next-error-digest.d.ts +12 -29
- package/dist/server/next-error-digest.js +23 -15
- package/dist/server/normalize-path.d.ts +5 -6
- package/dist/server/normalize-path.js +1 -1
- package/dist/server/open-redirect.d.ts +2 -3
- package/dist/server/operation-token.d.ts +11 -12
- package/dist/server/operation-token.js +1 -1
- package/dist/server/otel-tracer-extension.d.ts +2 -3
- package/dist/server/pages-api-route.d.ts +9 -5
- package/dist/server/pages-api-route.js +49 -8
- package/dist/server/pages-asset-tags.d.ts +8 -7
- package/dist/server/pages-asset-tags.js +6 -4
- package/dist/server/pages-body-parser-config.d.ts +4 -5
- package/dist/server/pages-body-parser-config.js +6 -5
- package/dist/server/pages-client-assets.d.ts +4 -5
- package/dist/server/pages-data-route.d.ts +29 -21
- package/dist/server/pages-data-route.js +31 -18
- package/dist/server/pages-default-404.d.ts +3 -4
- package/dist/server/pages-dev-hydration.d.ts +13 -0
- package/dist/server/pages-dev-hydration.js +92 -0
- package/dist/server/pages-dev-module-url.d.ts +3 -4
- package/dist/server/pages-dev-module-url.js +2 -2
- package/dist/server/pages-dev-stylesheets.d.ts +9 -0
- package/dist/server/pages-dev-stylesheets.js +150 -0
- package/dist/server/pages-document-asset-props.d.ts +25 -0
- package/dist/server/pages-document-asset-props.js +69 -0
- package/dist/server/pages-document-initial-props.d.ts +14 -11
- package/dist/server/pages-document-initial-props.js +4 -2
- package/dist/server/pages-get-initial-props.d.ts +21 -9
- package/dist/server/pages-get-initial-props.js +17 -10
- package/dist/server/pages-i18n.d.ts +8 -14
- package/dist/server/pages-i18n.js +67 -18
- package/dist/server/pages-media-type.d.ts +4 -5
- package/dist/server/pages-node-compat.d.ts +32 -16
- package/dist/server/pages-node-compat.js +112 -60
- package/dist/server/pages-page-data.d.ts +87 -22
- package/dist/server/pages-page-data.js +441 -92
- package/dist/server/pages-page-handler.d.ts +78 -33
- package/dist/server/pages-page-handler.js +244 -84
- package/dist/server/pages-page-method.d.ts +2 -3
- package/dist/server/pages-page-response.d.ts +19 -22
- package/dist/server/pages-page-response.js +57 -54
- package/dist/server/pages-preview.d.ts +25 -0
- package/dist/server/pages-preview.js +165 -0
- package/dist/server/pages-readiness.d.ts +7 -8
- package/dist/server/pages-readiness.js +7 -5
- package/dist/server/pages-request-pipeline.d.ts +43 -17
- package/dist/server/pages-request-pipeline.js +120 -47
- package/dist/server/pages-request-stage-entry.d.ts +23 -0
- package/dist/server/pages-request-stage-entry.js +297 -0
- package/dist/server/pages-response-stage-entry.d.ts +11 -0
- package/dist/server/pages-response-stage-entry.js +104 -0
- package/dist/server/pages-response-stage.d.ts +31 -0
- package/dist/server/pages-response-stage.js +49 -0
- package/dist/server/pages-revalidate.d.ts +3 -5
- package/dist/server/pages-revalidate.js +60 -9
- package/dist/server/pages-route-data-kind.d.ts +18 -0
- package/dist/server/pages-route-data-kind.js +11 -0
- package/dist/server/pages-router-entry.d.ts +1 -24
- package/dist/server/pages-router-entry.js +42 -99
- package/dist/server/pages-serializable-props.d.ts +3 -4
- package/dist/server/pregenerated-concrete-paths.d.ts +8 -7
- package/dist/server/pregenerated-concrete-paths.js +3 -1
- package/dist/server/prerender-cache-life-header.d.ts +10 -0
- package/dist/server/prerender-cache-life-header.js +18 -0
- package/dist/server/prerender-manifest.d.ts +20 -11
- package/dist/server/prerender-manifest.js +4 -1
- package/dist/server/prerender-route-params.d.ts +16 -10
- package/dist/server/prerender-route-params.js +20 -7
- package/dist/server/prerender-work-unit-setup.d.ts +4 -4
- package/dist/server/prerender-work-unit-setup.js +34 -11
- package/dist/server/prod-server.d.ts +27 -21
- package/dist/server/prod-server.js +378 -140
- package/dist/server/proxy-trust.d.ts +5 -7
- package/dist/server/request-log.d.ts +9 -14
- package/dist/server/request-pipeline.d.ts +40 -49
- package/dist/server/request-pipeline.js +61 -88
- package/dist/server/request-stage.d.ts +5 -0
- package/dist/server/request-stage.js +7 -0
- package/dist/server/response-stage-cacheability.d.ts +30 -0
- package/dist/server/response-stage-cacheability.js +36 -0
- package/dist/server/response-stage-policy.d.ts +23 -0
- package/dist/server/response-stage-policy.js +88 -0
- package/dist/server/response-stage.d.ts +5 -0
- package/dist/server/response-stage.js +7 -0
- package/dist/server/revalidation-host.d.ts +9 -0
- package/dist/server/revalidation-host.js +20 -0
- package/dist/server/revalidation-request.d.ts +8 -0
- package/dist/server/revalidation-request.js +37 -0
- package/dist/server/rsc-completion-metadata.d.ts +14 -0
- package/dist/server/rsc-completion-metadata.js +183 -0
- package/dist/server/rsc-stream-hints.d.ts +6 -7
- package/dist/server/rsc-stream-hints.js +122 -18
- package/dist/server/seed-cache.d.ts +8 -5
- package/dist/server/seed-cache.js +39 -11
- package/dist/server/server-action-not-found.d.ts +5 -6
- package/dist/server/server-globals.d.ts +2 -3
- package/dist/server/server-globals.js +13 -0
- package/dist/server/skip-cache-proof.d.ts +4 -5
- package/dist/server/socket-error-backstop.d.ts +5 -6
- package/dist/server/socket-error-backstop.js +1 -1
- package/dist/server/static-file-cache.d.ts +26 -13
- package/dist/server/static-file-cache.js +63 -38
- package/dist/server/static-file-signal.d.ts +16 -0
- package/dist/server/static-file-signal.js +82 -0
- package/dist/server/static-layout-client-reuse-proof.d.ts +4 -6
- package/dist/server/streaming-metadata.d.ts +2 -3
- package/dist/server/worker-prerender-discovery.d.ts +18 -0
- package/dist/server/worker-prerender-discovery.js +55 -0
- package/dist/server/worker-revalidation-context.d.ts +11 -0
- package/dist/server/worker-revalidation-context.js +30 -0
- package/dist/server/worker-stages.d.ts +43 -0
- package/dist/server/worker-stages.js +25 -0
- package/dist/server/worker-utils.d.ts +6 -5
- package/dist/server/worker-utils.js +17 -8
- package/dist/shims/amp.d.ts +3 -4
- package/dist/shims/app-router-scroll-state.d.ts +9 -9
- package/dist/shims/app-router-scroll-state.js +7 -2
- package/dist/shims/app-router-scroll.d.ts +4 -11
- package/dist/shims/app-router-scroll.js +2 -1
- package/dist/shims/app.d.ts +7 -12
- package/dist/shims/before-interactive-context.d.ts +10 -9
- package/dist/shims/cache-callable-runtime.d.ts +13 -0
- package/dist/shims/cache-callable-runtime.js +39 -0
- package/dist/shims/cache-for-request.d.ts +2 -3
- package/dist/shims/cache-handler.d.ts +33 -22
- package/dist/shims/cache-handler.js +74 -10
- package/dist/shims/cache-request-state.d.ts +62 -23
- package/dist/shims/cache-request-state.js +86 -1
- package/dist/shims/cache-runtime.d.ts +47 -17
- package/dist/shims/cache-runtime.js +272 -85
- package/dist/shims/cache.d.ts +17 -18
- package/dist/shims/cache.js +50 -21
- package/dist/shims/cacheability-classification.d.ts +94 -0
- package/dist/shims/cacheability-classification.js +143 -0
- package/dist/shims/cdn-cache-state.d.ts +13 -0
- package/dist/shims/cdn-cache-state.js +23 -0
- package/dist/shims/cdn-cache.d.ts +70 -17
- package/dist/shims/cdn-cache.js +34 -38
- package/dist/shims/client-hook-error.d.ts +3 -4
- package/dist/shims/client-locale.d.ts +2 -8
- package/dist/shims/client-only.d.ts +1 -1
- package/dist/shims/compat-router.d.ts +2 -4
- package/dist/shims/config.d.ts +3 -4
- package/dist/shims/constants.d.ts +73 -74
- package/dist/shims/constants.js +1 -1
- package/dist/shims/default-global-error.d.ts +1 -4
- package/dist/shims/default-not-found.d.ts +2 -4
- package/dist/shims/document.d.ts +42 -84
- package/dist/shims/document.js +76 -53
- package/dist/shims/dynamic-preload-chunks.d.ts +2 -4
- package/dist/shims/dynamic-preload-chunks.js +12 -12
- package/dist/shims/dynamic.d.ts +9 -30
- package/dist/shims/dynamic.js +33 -14
- package/dist/shims/error-boundary-navigation.d.ts +3 -5
- package/dist/shims/error-boundary.d.ts +21 -47
- package/dist/shims/error-boundary.js +16 -10
- package/dist/shims/error.d.ts +21 -10
- package/dist/shims/error.js +53 -15
- package/dist/shims/error.react-server.d.ts +3 -4
- package/dist/shims/fetch-cache.d.ts +22 -21
- package/dist/shims/fetch-cache.js +159 -76
- package/dist/shims/font-google-base.d.ts +18 -12
- package/dist/shims/font-google-base.js +19 -9
- package/dist/shims/font-local.d.ts +13 -7
- package/dist/shims/font-local.js +44 -13
- package/dist/shims/font-utils.d.ts +14 -15
- package/dist/shims/font-utils.js +1 -1
- package/dist/shims/form.d.ts +8 -6
- package/dist/shims/form.js +9 -6
- package/dist/shims/hash-scroll.d.ts +5 -6
- package/dist/shims/hash-scroll.js +2 -1
- package/dist/shims/head-state.d.ts +4 -6
- package/dist/shims/head.d.ts +39 -16
- package/dist/shims/head.js +79 -16
- package/dist/shims/headers.d.ts +83 -73
- package/dist/shims/headers.js +242 -84
- package/dist/shims/i18n-context.d.ts +5 -7
- package/dist/shims/i18n-state.d.ts +4 -6
- package/dist/shims/image-config.d.ts +5 -6
- package/dist/shims/image.d.ts +29 -40
- package/dist/shims/image.js +34 -24
- package/dist/shims/internal/als-registry.d.ts +32 -4
- package/dist/shims/internal/als-registry.js +50 -2
- package/dist/shims/internal/api-utils.d.ts +3 -4
- package/dist/shims/internal/app-page-props-cache-key.d.ts +3 -4
- package/dist/shims/internal/app-prefetch-fetch-queue.d.ts +18 -4
- package/dist/shims/internal/app-prefetch-fetch-queue.js +69 -7
- package/dist/shims/internal/app-prefetch-rsc-request.d.ts +13 -0
- package/dist/shims/internal/app-prefetch-rsc-request.js +12 -0
- package/dist/shims/internal/app-route-detection.d.ts +2 -3
- package/dist/shims/internal/app-route-prefetch-policy.d.ts +31 -0
- package/dist/shims/internal/app-route-prefetch-policy.js +65 -0
- package/dist/shims/internal/app-router-context.d.ts +9 -11
- package/dist/shims/internal/cookie-serialize.d.ts +15 -13
- package/dist/shims/internal/cookie-serialize.js +10 -7
- package/dist/shims/internal/hybrid-client-route-owner-direct.d.ts +6 -11
- package/dist/shims/internal/hybrid-client-route-owner-direct.js +29 -11
- package/dist/shims/internal/hybrid-client-route-owner.d.ts +3 -4
- package/dist/shims/internal/hybrid-client-route-owner.js +8 -7
- package/dist/shims/internal/interpolate-as.d.ts +19 -5
- package/dist/shims/internal/interpolate-as.js +31 -4
- package/dist/shims/internal/link-status-registry.d.ts +5 -6
- package/dist/shims/internal/make-hanging-promise.d.ts +8 -3
- package/dist/shims/internal/make-hanging-promise.js +13 -2
- package/dist/shims/internal/navigation-untracked.d.ts +2 -3
- package/dist/shims/internal/pages-data-fetch-dedup.d.ts +8 -9
- package/dist/shims/internal/pages-data-fetch-dedup.js +5 -3
- package/dist/shims/internal/pages-data-target.d.ts +26 -16
- package/dist/shims/internal/pages-data-target.js +23 -7
- package/dist/shims/internal/pages-data-url.d.ts +7 -6
- package/dist/shims/internal/pages-data-url.js +2 -1
- package/dist/shims/internal/pages-router-accessor.d.ts +3 -4
- package/dist/shims/internal/pages-router-components.d.ts +3 -4
- package/dist/shims/internal/route-pattern-for-warning.d.ts +3 -4
- package/dist/shims/internal/router-context.d.ts +2 -4
- package/dist/shims/internal/utils.d.ts +10 -11
- package/dist/shims/internal/work-unit-async-storage.d.ts +16 -14
- package/dist/shims/internal/work-unit-async-storage.js +2 -0
- package/dist/shims/layout-segment-context.d.ts +5 -10
- package/dist/shims/legacy-image.d.ts +3 -38
- package/dist/shims/legacy-image.js +6 -16
- package/dist/shims/link-prefetch.d.ts +9 -10
- package/dist/shims/link.d.ts +43 -40
- package/dist/shims/link.js +163 -177
- package/dist/shims/metadata.d.ts +25 -50
- package/dist/shims/metadata.js +129 -84
- package/dist/shims/navigation-context-accessors.d.ts +9 -0
- package/dist/shims/navigation-context-accessors.js +19 -0
- package/dist/shims/navigation-context-state.d.ts +21 -19
- package/dist/shims/navigation-errors.d.ts +20 -20
- package/dist/shims/navigation-errors.js +9 -13
- package/dist/shims/navigation-state.d.ts +7 -7
- package/dist/shims/navigation.d.ts +148 -60
- package/dist/shims/navigation.js +500 -99
- package/dist/shims/navigation.react-server.d.ts +10 -9
- package/dist/shims/navigation.react-server.js +1 -1
- package/dist/shims/next-shims-augmentations.d.ts +1 -0
- package/dist/shims/next-shims-public.d.ts +1 -0
- package/dist/shims/offline.d.ts +2 -3
- package/dist/shims/og.d.ts +2 -3
- package/dist/shims/pages-router-runtime.d.ts +4 -5
- package/dist/shims/ppr-fallback-shell.d.ts +13 -14
- package/dist/shims/public-shim-map.json.js +103 -0
- package/dist/shims/readonly-url-search-params.d.ts +5 -6
- package/dist/shims/readonly-url-search-params.js +3 -3
- package/dist/shims/request-context.d.ts +15 -6
- package/dist/shims/request-state-types.d.ts +3 -2
- package/dist/shims/root-params.d.ts +15 -14
- package/dist/shims/root-params.js +7 -1
- package/dist/shims/router-state.d.ts +6 -6
- package/dist/shims/router.d.ts +102 -46
- package/dist/shims/router.js +479 -152
- package/dist/shims/script-nonce-context.d.ts +5 -7
- package/dist/shims/script.d.ts +30 -22
- package/dist/shims/script.js +17 -12
- package/dist/shims/server-only.d.ts +1 -1
- package/dist/shims/server.d.ts +68 -47
- package/dist/shims/server.js +209 -67
- package/dist/shims/slot.d.ts +31 -19
- package/dist/shims/slot.js +107 -21
- package/dist/shims/streamed-icons.d.ts +6 -0
- package/dist/shims/streamed-icons.js +33 -0
- package/dist/shims/thenable-params.d.ts +4 -5
- package/dist/shims/thenable-params.js +1 -1
- package/dist/shims/unified-request-context.d.ts +71 -13
- package/dist/shims/unified-request-context.js +139 -1
- package/dist/shims/unrecognized-action-error.d.ts +3 -4
- package/dist/shims/url-safety.d.ts +5 -6
- package/dist/shims/url-safety.js +2 -2
- package/dist/shims/url-utils.d.ts +18 -12
- package/dist/shims/url-utils.js +10 -1
- package/dist/shims/use-merged-ref.d.ts +2 -4
- package/dist/shims/web-vitals.d.ts +2 -3
- package/dist/typegen.d.ts +7 -3
- package/dist/typegen.js +83 -24
- package/dist/utils/asset-prefix.d.ts +7 -8
- package/dist/utils/base-path.d.ts +5 -6
- package/dist/utils/built-asset-url.d.ts +2 -3
- package/dist/utils/built-asset-url.js +4 -2
- package/dist/utils/cache-control-metadata.d.ts +15 -3
- package/dist/utils/cache-control-metadata.js +21 -1
- package/dist/utils/client-build-manifest.d.ts +6 -8
- package/dist/utils/client-build-manifest.js +3 -2
- package/dist/utils/client-entry-manifest.d.ts +6 -7
- package/dist/utils/client-entry-manifest.js +1 -1
- package/dist/utils/client-runtime-metadata.d.ts +2 -3
- package/dist/utils/client-runtime-metadata.js +3 -2
- package/dist/utils/commonjs-loader.d.ts +4 -5
- package/dist/utils/commonjs-loader.js +3 -3
- package/dist/utils/compare.d.ts +2 -3
- package/dist/utils/deployment-id.d.ts +6 -7
- package/dist/utils/dev-error-recovery-event.d.ts +2 -3
- package/dist/utils/dev-stack-sourcemap-endpoint.d.ts +2 -3
- package/dist/utils/domain-locale.d.ts +9 -14
- package/dist/utils/encode-cache-tag.d.ts +4 -5
- package/dist/utils/encode-cache-tag.js +1 -1
- package/dist/utils/error-cause.d.ts +2 -3
- package/dist/utils/external-url.d.ts +4 -0
- package/dist/utils/external-url.js +7 -0
- package/dist/utils/has-trailing-comma.d.ts +3 -4
- package/dist/utils/hash.d.ts +3 -4
- package/dist/utils/html-limited-bots.d.ts +3 -4
- package/dist/utils/html-limited-bots.js +1 -1
- package/dist/utils/lazy-chunks.d.ts +8 -9
- package/dist/utils/lazy-chunks.js +3 -3
- package/dist/utils/manifest-paths.d.ts +5 -6
- package/dist/utils/mdx-scan.d.ts +3 -4
- package/dist/utils/mdx-scan.js +1 -1
- package/dist/utils/middleware-request-headers.d.ts +21 -8
- package/dist/utils/middleware-request-headers.js +37 -23
- package/dist/utils/navigation-signal.d.ts +2 -3
- package/dist/utils/number.d.ts +2 -3
- package/dist/utils/package-name.d.ts +10 -0
- package/dist/utils/package-name.js +18 -0
- package/dist/utils/parse-cookie.d.ts +4 -5
- package/dist/utils/path.d.ts +11 -17
- package/dist/utils/path.js +21 -15
- package/dist/utils/plugin-options.d.ts +3 -0
- package/dist/utils/plugin-options.js +8 -0
- package/dist/utils/precompressed-variant.d.ts +8 -0
- package/dist/utils/precompressed-variant.js +15 -0
- package/dist/utils/prerender-output-paths.d.ts +10 -9
- package/dist/utils/prerender-output-paths.js +22 -10
- package/dist/utils/project.d.ts +29 -31
- package/dist/utils/project.js +2 -8
- package/dist/utils/promise.d.ts +2 -3
- package/dist/utils/protocol-headers.d.ts +17 -12
- package/dist/utils/protocol-headers.js +7 -1
- package/dist/utils/public-file-path.d.ts +4 -0
- package/dist/utils/public-file-path.js +12 -0
- package/dist/utils/public-routes.d.ts +2 -3
- package/dist/utils/public-routes.js +8 -7
- package/dist/utils/query.d.ts +8 -9
- package/dist/utils/react-compiler-support.d.ts +19 -0
- package/dist/utils/react-compiler-support.js +29 -0
- package/dist/utils/react-version.d.ts +2 -3
- package/dist/utils/react-version.js +1 -1
- package/dist/utils/record.d.ts +2 -3
- package/dist/utils/redirect-digest.d.ts +8 -0
- package/dist/utils/redirect-digest.js +25 -0
- package/dist/utils/regex-safety.d.ts +7 -0
- package/dist/utils/regex-safety.js +737 -0
- package/dist/utils/regex.d.ts +2 -3
- package/dist/utils/safe-json-file.d.ts +2 -3
- package/dist/utils/sorted-array.d.ts +2 -3
- package/dist/utils/text-stream.d.ts +3 -4
- package/dist/utils/vinext-root.d.ts +2 -3
- package/dist/utils/vinext-root.js +1 -1
- package/dist/utils/virtual-module.d.ts +3 -4
- package/dist/utils/vite-version.d.ts +7 -5
- package/dist/utils/vite-version.js +43 -17
- package/package.json +53 -8
- /package/dist/build/google-fonts/{fallback-metrics-data.js → fallback-metrics-data.json.js} +0 -0
- /package/dist/build/google-fonts/{font-data.js → font-data.json.js} +0 -0
- /package/dist/{node_modules/.pnpm/process-ancestry@0.1.0/node_modules → deps/.pnpm/process-ancestry@0.1.0/deps}/process-ancestry/dist/index.js +0 -0
package/dist/shims/slot.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { AppElementsWire, UNMATCHED_SLOT } from "../server/app-elements-wire.js";
|
|
2
|
+
import { APP_BFCACHE_SEGMENT_IDENTITIES_KEY, AppElementsWire, UNMATCHED_SLOT } from "../server/app-elements-wire.js";
|
|
3
3
|
import "../server/app-elements.js";
|
|
4
4
|
import { getBfcacheIdMapContext, getBfcacheSegmentIdContext } from "./navigation-context-state.js";
|
|
5
5
|
import { notFound } from "./navigation-errors.js";
|
|
6
6
|
import "./navigation-server.js";
|
|
7
|
+
import { isNestedBfcacheSlotSegmentId, isNestedBfcacheSlotSegmentIdFor } from "../server/bfcache-identity.js";
|
|
7
8
|
import * as React$1 from "react";
|
|
8
9
|
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
9
10
|
//#region src/shims/slot.tsx
|
|
@@ -23,7 +24,7 @@ const BfcacheSegmentIdContext = getBfcacheSegmentIdContext();
|
|
|
23
24
|
const EMPTY_BFCACHE_STATE_KEYS = Object.freeze({});
|
|
24
25
|
const MAX_BFCACHE_SLOT_ENTRIES_WITH_CACHE_COMPONENTS = 3;
|
|
25
26
|
const MAX_BFCACHE_SLOT_ENTRIES_WITHOUT_CACHE_COMPONENTS = 1;
|
|
26
|
-
const
|
|
27
|
+
const BfcacheIdentityMapContext = React$1.createContext(EMPTY_BFCACHE_STATE_KEYS);
|
|
27
28
|
function isCacheComponentsEnabled() {
|
|
28
29
|
return String(process.env.__NEXT_CACHE_COMPONENTS) === "true";
|
|
29
30
|
}
|
|
@@ -53,6 +54,17 @@ function haveSameBfcacheSlotEntryOrder(left, right) {
|
|
|
53
54
|
for (let index = 0; index < left.length; index++) if (left[index] !== right[index]) return false;
|
|
54
55
|
return true;
|
|
55
56
|
}
|
|
57
|
+
function stageBfcacheSlotEntryForRender(committedSnapshots, committedOrder, activeEntry, maxEntries = getBfcacheSlotEntryLimit()) {
|
|
58
|
+
const snapshots = new Map(committedSnapshots);
|
|
59
|
+
snapshots.set(activeEntry.stateKey, activeEntry);
|
|
60
|
+
const order = updateBfcacheSlotEntryOrder(committedOrder, activeEntry.stateKey, maxEntries);
|
|
61
|
+
pruneBfcacheSlotEntrySnapshots(snapshots, order);
|
|
62
|
+
return {
|
|
63
|
+
entries: order.map((stateKey) => snapshots.get(stateKey)).filter((entry) => entry !== void 0),
|
|
64
|
+
order,
|
|
65
|
+
snapshots
|
|
66
|
+
};
|
|
67
|
+
}
|
|
56
68
|
function isLayoutFlagsValue(value) {
|
|
57
69
|
if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
|
|
58
70
|
const entries = Object.values(value);
|
|
@@ -72,6 +84,13 @@ function isSlotBindingListValue(value) {
|
|
|
72
84
|
function isSkippedLayoutIdsMetadataValue(id, value) {
|
|
73
85
|
return id === "__skippedLayoutIds" && Array.isArray(value) && value.every((entry) => typeof entry === "string");
|
|
74
86
|
}
|
|
87
|
+
function isBfcacheSegmentIdentitiesMetadataValue(id, value) {
|
|
88
|
+
if (id !== "__bfcacheSegmentIdentities" || typeof value !== "object" || value === null || Array.isArray(value)) return false;
|
|
89
|
+
return Object.entries(value).every(([elementId, identity]) => {
|
|
90
|
+
const parsed = AppElementsWire.parseElementKey(elementId);
|
|
91
|
+
return parsed !== null && parsed.kind !== "route" && typeof identity === "string";
|
|
92
|
+
});
|
|
93
|
+
}
|
|
75
94
|
function isInterceptionMetadataValue(value) {
|
|
76
95
|
if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
|
|
77
96
|
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";
|
|
@@ -81,7 +100,7 @@ function isCacheEntryReuseProofValue(value) {
|
|
|
81
100
|
return "kind" in value && value.kind === "runtime-cache-entry" && "decision" in value;
|
|
82
101
|
}
|
|
83
102
|
function isTransportMetadataValue(id, value) {
|
|
84
|
-
return isLayoutFlagsValue(value) || isArtifactCompatibilityEnvelopeValue(value) || isCacheEntryReuseProofValue(value) || isInterceptionMetadataValue(value) || isSkippedLayoutIdsMetadataValue(id, value) || isSlotBindingListValue(value);
|
|
103
|
+
return isLayoutFlagsValue(value) || isBfcacheSegmentIdentitiesMetadataValue(id, value) || isArtifactCompatibilityEnvelopeValue(value) || isCacheEntryReuseProofValue(value) || isInterceptionMetadataValue(value) || isSkippedLayoutIdsMetadataValue(id, value) || isSlotBindingListValue(value);
|
|
85
104
|
}
|
|
86
105
|
function warnTransportMetadataEntry(id) {
|
|
87
106
|
if (process.env.NODE_ENV === "production") return;
|
|
@@ -96,7 +115,7 @@ function warnTransportMetadataEntry(id) {
|
|
|
96
115
|
* capture.
|
|
97
116
|
*/
|
|
98
117
|
function BfcacheEntryProviders({ entry, fallbackElements, fallbackSegmentId, fallbackStateKeyMap, SegmentContext }) {
|
|
99
|
-
return /* @__PURE__ */ jsx(
|
|
118
|
+
return /* @__PURE__ */ jsx(BfcacheIdentityMapContext.Provider, {
|
|
100
119
|
value: entry.stateKeyMap ?? fallbackStateKeyMap,
|
|
101
120
|
children: /* @__PURE__ */ jsx(ElementsContext.Provider, {
|
|
102
121
|
value: entry.elements ?? fallbackElements,
|
|
@@ -110,23 +129,26 @@ function BfcacheEntryProviders({ entry, fallbackElements, fallbackSegmentId, fal
|
|
|
110
129
|
function useBfcacheSlotEntries(activeEntry) {
|
|
111
130
|
const snapshotsByStateKey = React$1.useRef(/* @__PURE__ */ new Map());
|
|
112
131
|
const [entryOrder, setEntryOrder] = React$1.useState(() => [activeEntry.stateKey]);
|
|
113
|
-
snapshotsByStateKey.current
|
|
114
|
-
const
|
|
132
|
+
const committedSnapshots = snapshotsByStateKey.current;
|
|
133
|
+
const staged = stageBfcacheSlotEntryForRender(committedSnapshots, entryOrder, activeEntry);
|
|
134
|
+
const nextOrder = staged.order;
|
|
115
135
|
const orderChanged = !haveSameBfcacheSlotEntryOrder(entryOrder, nextOrder);
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
136
|
+
React$1.useLayoutEffect(() => {
|
|
137
|
+
snapshotsByStateKey.current = staged.snapshots;
|
|
138
|
+
}, [staged.snapshots]);
|
|
139
|
+
if (process.env.NODE_ENV !== "production" && !staged.snapshots.has(activeEntry.stateKey)) throw new Error("BFCache Activity slot is missing the active entry snapshot");
|
|
119
140
|
if (orderChanged) setEntryOrder(nextOrder);
|
|
120
|
-
return
|
|
141
|
+
return staged.entries;
|
|
121
142
|
}
|
|
122
143
|
function BfcacheActivitySlotBoundary({ activeStateKey, content, elements, id, SegmentContext, stateKeyMap }) {
|
|
123
|
-
|
|
144
|
+
const renderEntries = useBfcacheSlotEntries({
|
|
124
145
|
content,
|
|
125
146
|
elements,
|
|
126
147
|
segmentId: id,
|
|
127
148
|
stateKey: activeStateKey,
|
|
128
149
|
stateKeyMap
|
|
129
|
-
})
|
|
150
|
+
});
|
|
151
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: renderEntries.map((entry) => /* @__PURE__ */ jsx(React$1.Activity, {
|
|
130
152
|
mode: entry.stateKey === activeStateKey ? "visible" : "hidden",
|
|
131
153
|
children: /* @__PURE__ */ jsx(BfcacheEntryProviders, {
|
|
132
154
|
entry,
|
|
@@ -137,11 +159,42 @@ function BfcacheActivitySlotBoundary({ activeStateKey, content, elements, id, Se
|
|
|
137
159
|
})
|
|
138
160
|
}, entry.stateKey)) });
|
|
139
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* Adds a nested segment-owned Activity cache inside a flattened AppElements
|
|
164
|
+
* entry. Named parallel routes are transported as one slot value, but Next.js
|
|
165
|
+
* retains each descendant segment independently. This boundary recreates that
|
|
166
|
+
* ownership without requiring a separate wire entry for every nested segment.
|
|
167
|
+
*/
|
|
168
|
+
function BfcacheSegmentBoundary({ children, id, stateKey }) {
|
|
169
|
+
const elements = React$1.useContext(ElementsContext);
|
|
170
|
+
const identityMap = React$1.useContext(BfcacheIdentityMapContext);
|
|
171
|
+
const activeStateKey = resolveBfcacheSegmentStateKey(id, identityMap, React$1.useContext(BfcacheIdMapContext));
|
|
172
|
+
if (!BfcacheSegmentIdContext || activeStateKey === void 0) return /* @__PURE__ */ jsx(React$1.Fragment, { children }, stateKey);
|
|
173
|
+
if (!isCacheComponentsEnabled()) return /* @__PURE__ */ jsx(BfcacheSegmentIdContext.Provider, {
|
|
174
|
+
value: id,
|
|
175
|
+
children
|
|
176
|
+
}, activeStateKey);
|
|
177
|
+
return /* @__PURE__ */ jsx(BfcacheActivitySlotBoundary, {
|
|
178
|
+
activeStateKey,
|
|
179
|
+
content: children,
|
|
180
|
+
elements,
|
|
181
|
+
id,
|
|
182
|
+
SegmentContext: BfcacheSegmentIdContext,
|
|
183
|
+
stateKeyMap: identityMap
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
function getNonCacheComponentsSegmentKey(id, activeStateKey) {
|
|
187
|
+
const parsed = AppElementsWire.parseElementKey(id);
|
|
188
|
+
return parsed !== null && parsed.kind !== "route" ? activeStateKey : void 0;
|
|
189
|
+
}
|
|
190
|
+
function resolveBfcacheSegmentStateKey(id, identityMap, bfcacheIdMap) {
|
|
191
|
+
return identityMap[id] ?? bfcacheIdMap?.[id];
|
|
192
|
+
}
|
|
140
193
|
function BfcacheSlotBoundary({ content, id }) {
|
|
141
194
|
const SegmentContext = BfcacheSegmentIdContext;
|
|
142
195
|
const elements = React$1.useContext(ElementsContext);
|
|
143
|
-
const
|
|
144
|
-
const activeStateKey =
|
|
196
|
+
const identityMap = React$1.useContext(BfcacheIdentityMapContext);
|
|
197
|
+
const activeStateKey = resolveBfcacheSegmentStateKey(id, identityMap, React$1.useContext(BfcacheIdMapContext));
|
|
145
198
|
if (!SegmentContext) return /* @__PURE__ */ jsx(Fragment$1, { children: content });
|
|
146
199
|
if (activeStateKey === void 0) return /* @__PURE__ */ jsx(SegmentContext.Provider, {
|
|
147
200
|
value: id,
|
|
@@ -150,14 +203,14 @@ function BfcacheSlotBoundary({ content, id }) {
|
|
|
150
203
|
if (!isCacheComponentsEnabled()) return /* @__PURE__ */ jsx(SegmentContext.Provider, {
|
|
151
204
|
value: id,
|
|
152
205
|
children: content
|
|
153
|
-
});
|
|
206
|
+
}, getNonCacheComponentsSegmentKey(id, activeStateKey));
|
|
154
207
|
return /* @__PURE__ */ jsx(BfcacheActivitySlotBoundary, {
|
|
155
208
|
activeStateKey,
|
|
156
209
|
content,
|
|
157
210
|
elements,
|
|
158
211
|
id,
|
|
159
212
|
SegmentContext,
|
|
160
|
-
stateKeyMap
|
|
213
|
+
stateKeyMap: identityMap
|
|
161
214
|
});
|
|
162
215
|
}
|
|
163
216
|
function mergeElements(prev, next, options = {}) {
|
|
@@ -166,24 +219,57 @@ function mergeElements(prev, next, options = {}) {
|
|
|
166
219
|
const preserveElementIds = typeof options === "boolean" ? [] : options.preserveElementIds ?? [];
|
|
167
220
|
const preservePreviousSlotIds = typeof options === "boolean" ? [] : options.preservePreviousSlotIds ?? [];
|
|
168
221
|
const merged = { ...next };
|
|
222
|
+
const preservedIdentityIds = /* @__PURE__ */ new Set();
|
|
169
223
|
for (const id of preserveElementIds) if (Object.hasOwn(prev, id)) {
|
|
170
224
|
const value = prev[id];
|
|
171
|
-
if (value !== void 0)
|
|
225
|
+
if (value !== void 0) {
|
|
226
|
+
merged[id] = value;
|
|
227
|
+
preservedIdentityIds.add(id);
|
|
228
|
+
}
|
|
172
229
|
}
|
|
173
|
-
const slotKeys = new Set([...Object.keys(prev), ...Object.keys(next)].filter((key) => AppElementsWire.isSlotId(key)));
|
|
230
|
+
const slotKeys = new Set([...Object.keys(prev), ...Object.keys(next)].filter((key) => AppElementsWire.isSlotId(key) && !isNestedBfcacheSlotSegmentId(key)));
|
|
174
231
|
if (clearAbsentSlots) {
|
|
175
232
|
for (const key of slotKeys) if (!Object.hasOwn(next, key)) delete merged[key];
|
|
176
233
|
} else if (preserveAbsentSlots) {
|
|
177
234
|
for (const key of slotKeys) if (!Object.hasOwn(merged, key) && Object.hasOwn(prev, key)) {
|
|
178
235
|
const value = prev[key];
|
|
179
|
-
if (value !== void 0)
|
|
236
|
+
if (value !== void 0) {
|
|
237
|
+
merged[key] = value;
|
|
238
|
+
preservedIdentityIds.add(key);
|
|
239
|
+
}
|
|
180
240
|
}
|
|
181
241
|
}
|
|
182
242
|
for (const id of preservePreviousSlotIds) {
|
|
183
243
|
if (!AppElementsWire.isSlotId(id)) continue;
|
|
184
244
|
if (!Object.hasOwn(prev, id)) continue;
|
|
185
245
|
const value = prev[id];
|
|
186
|
-
if (value !== void 0 && value !== UNMATCHED_SLOT)
|
|
246
|
+
if (value !== void 0 && value !== UNMATCHED_SLOT) {
|
|
247
|
+
merged[id] = value;
|
|
248
|
+
preservedIdentityIds.add(id);
|
|
249
|
+
for (const nestedId of Object.keys(prev)) {
|
|
250
|
+
if (!isNestedBfcacheSlotSegmentIdFor(nestedId, id)) continue;
|
|
251
|
+
const nestedValue = prev[nestedId];
|
|
252
|
+
if (nestedValue !== void 0) merged[nestedId] = nestedValue;
|
|
253
|
+
preservedIdentityIds.add(nestedId);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
if (preservedIdentityIds.size > 0) {
|
|
258
|
+
const previousIdentityValue = prev[APP_BFCACHE_SEGMENT_IDENTITIES_KEY];
|
|
259
|
+
const nextIdentityValue = next[APP_BFCACHE_SEGMENT_IDENTITIES_KEY];
|
|
260
|
+
const hasPreviousIdentities = isBfcacheSegmentIdentitiesMetadataValue(APP_BFCACHE_SEGMENT_IDENTITIES_KEY, previousIdentityValue);
|
|
261
|
+
const hasNextIdentities = isBfcacheSegmentIdentitiesMetadataValue(APP_BFCACHE_SEGMENT_IDENTITIES_KEY, nextIdentityValue);
|
|
262
|
+
const previousIdentities = hasPreviousIdentities ? { ...previousIdentityValue } : {};
|
|
263
|
+
const mergedIdentities = hasNextIdentities ? { ...nextIdentityValue } : {};
|
|
264
|
+
const identityIds = /* @__PURE__ */ new Set([...Object.keys(previousIdentities), ...Object.keys(mergedIdentities)]);
|
|
265
|
+
const preservedParentIds = new Set(preservedIdentityIds);
|
|
266
|
+
for (const parentId of preservedParentIds) for (const identityId of identityIds) if (isNestedBfcacheSlotSegmentIdFor(identityId, parentId)) preservedIdentityIds.add(identityId);
|
|
267
|
+
for (const id of preservedIdentityIds) {
|
|
268
|
+
const previousIdentity = previousIdentities[id];
|
|
269
|
+
if (previousIdentity === void 0) delete mergedIdentities[id];
|
|
270
|
+
else mergedIdentities[id] = previousIdentity;
|
|
271
|
+
}
|
|
272
|
+
if (hasPreviousIdentities || hasNextIdentities) merged[APP_BFCACHE_SEGMENT_IDENTITIES_KEY] = mergedIdentities;
|
|
187
273
|
}
|
|
188
274
|
return merged;
|
|
189
275
|
}
|
|
@@ -224,4 +310,4 @@ function ParallelSlot({ name }) {
|
|
|
224
310
|
return React$1.useContext(ParallelSlotsContext)?.[name] ?? null;
|
|
225
311
|
}
|
|
226
312
|
//#endregion
|
|
227
|
-
export {
|
|
313
|
+
export { BfcacheIdentityMapContext, BfcacheSegmentBoundary, Children, ChildrenContext, ElementsContext, ParallelSlot, ParallelSlotsContext, Slot, UNMATCHED_SLOT, getNonCacheComponentsSegmentKey, mergeElements, resolveBfcacheSegmentStateKey, stageBfcacheSlotEntryForRender, updateBfcacheSlotEntryOrder };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useLayoutEffect } from "react";
|
|
3
|
+
//#region src/shims/streamed-icons.tsx
|
|
4
|
+
const STREAMED_ICON_ATTRIBUTE = "data-vinext-streamed-icon";
|
|
5
|
+
function getStreamedIconOrder(icon, metadataKey) {
|
|
6
|
+
const marker = icon.getAttribute(STREAMED_ICON_ATTRIBUTE);
|
|
7
|
+
const prefix = `${metadataKey}:`;
|
|
8
|
+
if (!marker?.startsWith(prefix)) return null;
|
|
9
|
+
const order = Number(marker.slice(prefix.length));
|
|
10
|
+
return Number.isInteger(order) && order >= 0 ? order : null;
|
|
11
|
+
}
|
|
12
|
+
function reconcileStreamedIcons(metadataKey) {
|
|
13
|
+
document.querySelectorAll(`body link[${STREAMED_ICON_ATTRIBUTE}]`).forEach((icon) => document.head.appendChild(icon));
|
|
14
|
+
const ownedIcons = [...document.querySelectorAll(`head link[${STREAMED_ICON_ATTRIBUTE}]`)];
|
|
15
|
+
const retainedIcons = /* @__PURE__ */ new Map();
|
|
16
|
+
for (const icon of ownedIcons) {
|
|
17
|
+
const order = getStreamedIconOrder(icon, metadataKey);
|
|
18
|
+
if (order === null) {
|
|
19
|
+
icon.remove();
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
const previousIcon = retainedIcons.get(order);
|
|
23
|
+
if (previousIcon) previousIcon.remove();
|
|
24
|
+
retainedIcons.set(order, icon);
|
|
25
|
+
}
|
|
26
|
+
for (const [, icon] of [...retainedIcons].sort(([leftOrder], [rightOrder]) => leftOrder - rightOrder)) document.head.appendChild(icon);
|
|
27
|
+
}
|
|
28
|
+
function StreamedIconsInsertion({ metadataKey }) {
|
|
29
|
+
useLayoutEffect(() => reconcileStreamedIcons(metadataKey), [metadataKey]);
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { StreamedIconsInsertion, reconcileStreamedIcons };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
//#region src/shims/thenable-params.d.ts
|
|
2
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
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<{
|
|
4
|
+
export type ThenableParams<T extends Record<string, unknown>> = Promise<T> & Omit<T, WellKnownProperty>;
|
|
5
|
+
export type ThenableParamsObserver = Readonly<{
|
|
6
6
|
observeParamAccess: (keys: readonly string[]) => void;
|
|
7
7
|
observeReactPromiseStatus?: boolean;
|
|
8
8
|
}>;
|
|
9
|
-
declare function makeThenableParams<T extends Record<string, unknown>>(obj: T, observer?: ThenableParamsObserver): ThenableParams<T>;
|
|
10
|
-
//#endregion
|
|
11
|
-
export { ThenableParams, ThenableParamsObserver, makeThenableParams };
|
|
9
|
+
export declare function makeThenableParams<T extends Record<string, unknown>>(obj: T, observer?: ThenableParamsObserver): ThenableParams<T>;
|
|
10
|
+
//#endregion
|
|
@@ -3,7 +3,7 @@ import { createPprFallbackShellSuspensePromiseForState, getPprFallbackShellState
|
|
|
3
3
|
function hasParamProperty(obj, prop) {
|
|
4
4
|
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
5
5
|
}
|
|
6
|
-
const wellKnownProperties = new Set([
|
|
6
|
+
const wellKnownProperties = /* @__PURE__ */ new Set([
|
|
7
7
|
"hasOwnProperty",
|
|
8
8
|
"isPrototypeOf",
|
|
9
9
|
"propertyIsEnumerable",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { RootParamsState } from "./root-params.js";
|
|
2
|
-
import { CacheState } from "./cache-request-state.js";
|
|
3
1
|
import { ExecutionContextLike } from "./request-context.js";
|
|
2
|
+
import { CacheState } from "./cache-request-state.js";
|
|
3
|
+
import { RootParamsState } from "./root-params.js";
|
|
4
4
|
import { FetchCacheState } from "./fetch-cache.js";
|
|
5
5
|
import { VinextHeadersShimState } from "./headers.js";
|
|
6
6
|
import { RouterState } from "./router-state.js";
|
|
@@ -8,6 +8,7 @@ import { PrivateCacheState } from "./cache-runtime.js";
|
|
|
8
8
|
import { HeadState } from "./head-state.js";
|
|
9
9
|
import { I18nState } from "./i18n-state.js";
|
|
10
10
|
import { NavigationState } from "./navigation-state.js";
|
|
11
|
+
import "./request-state-types.js";
|
|
11
12
|
//#region src/shims/unified-request-context.d.ts
|
|
12
13
|
/**
|
|
13
14
|
* Flat union of all per-request state previously spread across
|
|
@@ -16,22 +17,80 @@ import { NavigationState } from "./navigation-state.js";
|
|
|
16
17
|
*
|
|
17
18
|
* Each field group is documented with its source shim module.
|
|
18
19
|
*/
|
|
19
|
-
type UnifiedRequestContext = {
|
|
20
|
-
/** Cloudflare Workers ExecutionContext, or null on Node.js dev. */
|
|
20
|
+
export type UnifiedRequestContext = {
|
|
21
|
+
/** Cloudflare Workers ExecutionContext, or null on Node.js dev. */
|
|
22
|
+
executionContext: ExecutionContextLike | null;
|
|
23
|
+
/** Per-request cache for cacheForRequest(). Keyed by factory function reference. */
|
|
21
24
|
requestCache: WeakMap<(...args: any[]) => any, unknown>;
|
|
25
|
+
/** Shared lifecycle state for work deferred until the response closes. */
|
|
26
|
+
afterContext: AfterRequestContext;
|
|
22
27
|
} & VinextHeadersShimState & I18nState & NavigationState & CacheState & PrivateCacheState & FetchCacheState & RouterState & HeadState & RootParamsState;
|
|
28
|
+
export type AfterRequestContext = {
|
|
29
|
+
callbacks: Array<() => unknown>;
|
|
30
|
+
responseClosed: boolean;
|
|
31
|
+
pendingCallbacks: number;
|
|
32
|
+
pendingPromises: number;
|
|
33
|
+
completion: Promise<void> | null;
|
|
34
|
+
resolveCompletion: (() => void) | null;
|
|
35
|
+
};
|
|
23
36
|
/**
|
|
24
37
|
* Create a fresh `UnifiedRequestContext` with defaults for all fields.
|
|
25
38
|
* Pass partial overrides for the fields you need to pre-populate.
|
|
26
39
|
*/
|
|
27
|
-
declare function createRequestContext(opts?: Partial<UnifiedRequestContext>): UnifiedRequestContext;
|
|
40
|
+
export declare function createRequestContext(opts?: Partial<UnifiedRequestContext>): UnifiedRequestContext;
|
|
41
|
+
/** Queue a callback until response close, or start it immediately once closed. */
|
|
42
|
+
export declare function queueAfterCallback(ctx: UnifiedRequestContext, callback: () => unknown): void;
|
|
43
|
+
/** Track promise-form after() work that can register a callback before settling. */
|
|
44
|
+
export declare function trackAfterPromise<T>(ctx: UnifiedRequestContext, promise: Promise<T>): Promise<T>;
|
|
45
|
+
/** Bind a callback to every AsyncLocalStorage context active at registration. */
|
|
46
|
+
export declare function bindRequestContextSnapshot<T>(ctx: UnifiedRequestContext, callback: () => T): () => T;
|
|
47
|
+
/**
|
|
48
|
+
* Release function-form `after()` work once the response body has closed.
|
|
49
|
+
* All queued callbacks start together, matching Next.js' unbounded PromiseQueue.
|
|
50
|
+
*/
|
|
51
|
+
export declare function closeAfterResponse(ctx: UnifiedRequestContext): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Whether this request has function-form `after()` work that still needs to
|
|
54
|
+
* observe the response body closing.
|
|
55
|
+
*
|
|
56
|
+
* Promise-form `after(promise)` is included because its continuation can
|
|
57
|
+
* register a function-form `after()` before the promise settles. Function-form
|
|
58
|
+
* work needs the body's close observed because its contract is "run once the
|
|
59
|
+
* response has been sent". `resolveCompletion` stays non-null for as long as
|
|
60
|
+
* any callback is queued or in flight, so checking it alongside the explicit
|
|
61
|
+
* counters keeps this correct on re-entry after callbacks have started.
|
|
62
|
+
*/
|
|
63
|
+
export declare function requiresResponseCloseTracking(ctx: UnifiedRequestContext): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Mark a response whose body vinext constructed from a fully in-memory string
|
|
66
|
+
* or byte array, as opposed to a body handed back by user code, which could
|
|
67
|
+
* still be producing. With no producer left, no `after()` call can originate
|
|
68
|
+
* from this body — the one signal that makes it safe for
|
|
69
|
+
* `closeAfterResponseWithBody()` to skip close tracking.
|
|
70
|
+
*
|
|
71
|
+
* Not set for a metadata route's `result instanceof Response` passthrough (a
|
|
72
|
+
* user `icon.tsx`/`opengraph-image.tsx` can return a streaming
|
|
73
|
+
* `ImageResponse`) or any handler-returned `new Response(stream)` — those
|
|
74
|
+
* bodies can still be producing and must keep close tracking.
|
|
75
|
+
*/
|
|
76
|
+
export declare function markFullyBufferedBody(response: Response): Response;
|
|
77
|
+
/** Preserve the internal buffered-body signal when response metadata is rebuilt. */
|
|
78
|
+
export declare function preserveFullyBufferedBodyMetadata(source: Response, target: Response): Response;
|
|
79
|
+
/**
|
|
80
|
+
* Wrap a response so deferred `after()` callbacks start on stream completion
|
|
81
|
+
* or cancellation. Skipped only when the body is marked fully buffered (see
|
|
82
|
+
* `markFullyBufferedBody`) and nothing is currently registered — that lets
|
|
83
|
+
* the runtime send it with an accurate `Content-Length` instead of chunked
|
|
84
|
+
* transfer encoding.
|
|
85
|
+
*/
|
|
86
|
+
export declare function closeAfterResponseWithBody(response: Response, ctx: UnifiedRequestContext): Response;
|
|
28
87
|
/**
|
|
29
88
|
* Run `fn` within a unified request context scope.
|
|
30
89
|
* All shim modules will read/write their state from `ctx` for the
|
|
31
90
|
* duration of the call, including async continuations.
|
|
32
91
|
*/
|
|
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>;
|
|
92
|
+
export declare function runWithRequestContext<T>(ctx: UnifiedRequestContext, fn: () => Promise<T>): Promise<T>;
|
|
93
|
+
export declare function runWithRequestContext<T>(ctx: UnifiedRequestContext, fn: () => T | Promise<T>): T | Promise<T>;
|
|
35
94
|
/**
|
|
36
95
|
* Run `fn` in a nested unified scope derived from the current request context.
|
|
37
96
|
* Used by legacy runWith* wrappers to reset or override one sub-state while
|
|
@@ -41,8 +100,8 @@ declare function runWithRequestContext<T>(ctx: UnifiedRequestContext, fn: () =>
|
|
|
41
100
|
*
|
|
42
101
|
* @internal
|
|
43
102
|
*/
|
|
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>;
|
|
103
|
+
export declare function runWithUnifiedStateMutation<T>(mutate: (ctx: UnifiedRequestContext) => void, fn: () => Promise<T>): Promise<T>;
|
|
104
|
+
export declare function runWithUnifiedStateMutation<T>(mutate: (ctx: UnifiedRequestContext) => void, fn: () => T | Promise<T>): T | Promise<T>;
|
|
46
105
|
/**
|
|
47
106
|
* Get the current unified request context.
|
|
48
107
|
* Returns the ALS store when inside a `runWithRequestContext()` scope,
|
|
@@ -57,12 +116,11 @@ declare function runWithUnifiedStateMutation<T>(mutate: (ctx: UnifiedRequestCont
|
|
|
57
116
|
* If called inside a standalone `runWithExecutionContext()` scope, the
|
|
58
117
|
* detached context still reflects that inherited `executionContext`.
|
|
59
118
|
*/
|
|
60
|
-
declare function getRequestContext(): UnifiedRequestContext;
|
|
119
|
+
export declare function getRequestContext(): UnifiedRequestContext;
|
|
61
120
|
/**
|
|
62
121
|
* Check whether the current execution is inside a `runWithRequestContext()` scope.
|
|
63
122
|
* Shim modules use this to decide whether to read from the unified store
|
|
64
123
|
* or fall back to their own standalone ALS.
|
|
65
124
|
*/
|
|
66
|
-
declare function isInsideUnifiedScope(): boolean;
|
|
67
|
-
//#endregion
|
|
68
|
-
export { UnifiedRequestContext, createRequestContext, getRequestContext, isInsideUnifiedScope, runWithRequestContext, runWithUnifiedStateMutation };
|
|
125
|
+
export declare function isInsideUnifiedScope(): boolean;
|
|
126
|
+
//#endregion
|
|
@@ -16,6 +16,8 @@ function createRequestContext(opts) {
|
|
|
16
16
|
return {
|
|
17
17
|
headersContext: null,
|
|
18
18
|
actionRevalidationKind: 0,
|
|
19
|
+
pendingRevalidatedTags: /* @__PURE__ */ new Set(),
|
|
20
|
+
pendingRevalidations: /* @__PURE__ */ new Set(),
|
|
19
21
|
dynamicUsageDetected: false,
|
|
20
22
|
renderRequestApiUsage: /* @__PURE__ */ new Set(),
|
|
21
23
|
connectionProbe: null,
|
|
@@ -34,6 +36,7 @@ function createRequestContext(opts) {
|
|
|
34
36
|
currentRequestTags: [],
|
|
35
37
|
currentFetchSoftTags: [],
|
|
36
38
|
currentFetchCacheMode: null,
|
|
39
|
+
currentFetchRevalidate: null,
|
|
37
40
|
currentForceDynamicFetchDefault: false,
|
|
38
41
|
dynamicFetchUrls: /* @__PURE__ */ new Set(),
|
|
39
42
|
refreshStaleFetchesInForeground: false,
|
|
@@ -41,6 +44,14 @@ function createRequestContext(opts) {
|
|
|
41
44
|
currentFetchDedupeEntries: /* @__PURE__ */ new Map(),
|
|
42
45
|
executionContext: _getInheritedExecutionContext(),
|
|
43
46
|
requestCache: /* @__PURE__ */ new WeakMap(),
|
|
47
|
+
afterContext: {
|
|
48
|
+
callbacks: [],
|
|
49
|
+
responseClosed: false,
|
|
50
|
+
pendingCallbacks: 0,
|
|
51
|
+
pendingPromises: 0,
|
|
52
|
+
completion: null,
|
|
53
|
+
resolveCompletion: null
|
|
54
|
+
},
|
|
44
55
|
ssrContext: null,
|
|
45
56
|
ssrHeadChildren: [],
|
|
46
57
|
documentInitialHead: [],
|
|
@@ -48,6 +59,133 @@ function createRequestContext(opts) {
|
|
|
48
59
|
...opts
|
|
49
60
|
};
|
|
50
61
|
}
|
|
62
|
+
function ensureAfterCompletion(ctx) {
|
|
63
|
+
const state = ctx.afterContext;
|
|
64
|
+
if (state.resolveCompletion && state.completion) return;
|
|
65
|
+
let resolveCompletion;
|
|
66
|
+
const completion = new Promise((resolve) => {
|
|
67
|
+
resolveCompletion = resolve;
|
|
68
|
+
});
|
|
69
|
+
state.completion = completion;
|
|
70
|
+
state.resolveCompletion = resolveCompletion;
|
|
71
|
+
ctx.executionContext?.waitUntil(completion);
|
|
72
|
+
}
|
|
73
|
+
function finishAfterCallbacksIfIdle(ctx) {
|
|
74
|
+
const state = ctx.afterContext;
|
|
75
|
+
if (!state.responseClosed || state.pendingCallbacks !== 0 || state.callbacks.length !== 0 || !state.resolveCompletion) return;
|
|
76
|
+
const resolveCompletion = state.resolveCompletion;
|
|
77
|
+
state.resolveCompletion = null;
|
|
78
|
+
resolveCompletion();
|
|
79
|
+
}
|
|
80
|
+
function startAfterCallback(ctx, callback) {
|
|
81
|
+
const state = ctx.afterContext;
|
|
82
|
+
ensureAfterCompletion(ctx);
|
|
83
|
+
state.pendingCallbacks += 1;
|
|
84
|
+
Promise.resolve().then(callback).catch((error) => {
|
|
85
|
+
console.error("[vinext] after() task failed:", error);
|
|
86
|
+
}).finally(() => {
|
|
87
|
+
state.pendingCallbacks -= 1;
|
|
88
|
+
finishAfterCallbacksIfIdle(ctx);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
/** Queue a callback until response close, or start it immediately once closed. */
|
|
92
|
+
function queueAfterCallback(ctx, callback) {
|
|
93
|
+
ensureAfterCompletion(ctx);
|
|
94
|
+
if (ctx.afterContext.responseClosed) startAfterCallback(ctx, callback);
|
|
95
|
+
else ctx.afterContext.callbacks.push(callback);
|
|
96
|
+
}
|
|
97
|
+
/** Track promise-form after() work that can register a callback before settling. */
|
|
98
|
+
function trackAfterPromise(ctx, promise) {
|
|
99
|
+
ctx.afterContext.pendingPromises += 1;
|
|
100
|
+
return promise.finally(() => {
|
|
101
|
+
ctx.afterContext.pendingPromises -= 1;
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
/** Bind a callback to every AsyncLocalStorage context active at registration. */
|
|
105
|
+
function bindRequestContextSnapshot(ctx, callback) {
|
|
106
|
+
const constructor = _als.constructor;
|
|
107
|
+
try {
|
|
108
|
+
const runInSnapshot = constructor.snapshot?.();
|
|
109
|
+
if (runInSnapshot) return () => runInSnapshot(callback);
|
|
110
|
+
} catch {}
|
|
111
|
+
return () => _als.run(ctx, callback);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Release function-form `after()` work once the response body has closed.
|
|
115
|
+
* All queued callbacks start together, matching Next.js' unbounded PromiseQueue.
|
|
116
|
+
*/
|
|
117
|
+
async function closeAfterResponse(ctx) {
|
|
118
|
+
const state = ctx.afterContext;
|
|
119
|
+
if (!state.responseClosed) {
|
|
120
|
+
state.responseClosed = true;
|
|
121
|
+
const callbacks = state.callbacks.splice(0);
|
|
122
|
+
for (const callback of callbacks) startAfterCallback(ctx, callback);
|
|
123
|
+
finishAfterCallbacksIfIdle(ctx);
|
|
124
|
+
}
|
|
125
|
+
return state.completion ?? Promise.resolve();
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Whether this request has function-form `after()` work that still needs to
|
|
129
|
+
* observe the response body closing.
|
|
130
|
+
*
|
|
131
|
+
* Promise-form `after(promise)` is included because its continuation can
|
|
132
|
+
* register a function-form `after()` before the promise settles. Function-form
|
|
133
|
+
* work needs the body's close observed because its contract is "run once the
|
|
134
|
+
* response has been sent". `resolveCompletion` stays non-null for as long as
|
|
135
|
+
* any callback is queued or in flight, so checking it alongside the explicit
|
|
136
|
+
* counters keeps this correct on re-entry after callbacks have started.
|
|
137
|
+
*/
|
|
138
|
+
function requiresResponseCloseTracking(ctx) {
|
|
139
|
+
const state = ctx.afterContext;
|
|
140
|
+
return state.callbacks.length > 0 || state.pendingCallbacks > 0 || state.pendingPromises > 0 || state.resolveCompletion !== null;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Mark a response whose body vinext constructed from a fully in-memory string
|
|
144
|
+
* or byte array, as opposed to a body handed back by user code, which could
|
|
145
|
+
* still be producing. With no producer left, no `after()` call can originate
|
|
146
|
+
* from this body — the one signal that makes it safe for
|
|
147
|
+
* `closeAfterResponseWithBody()` to skip close tracking.
|
|
148
|
+
*
|
|
149
|
+
* Not set for a metadata route's `result instanceof Response` passthrough (a
|
|
150
|
+
* user `icon.tsx`/`opengraph-image.tsx` can return a streaming
|
|
151
|
+
* `ImageResponse`) or any handler-returned `new Response(stream)` — those
|
|
152
|
+
* bodies can still be producing and must keep close tracking.
|
|
153
|
+
*/
|
|
154
|
+
function markFullyBufferedBody(response) {
|
|
155
|
+
response.__vinextFullyBufferedBody = true;
|
|
156
|
+
return response;
|
|
157
|
+
}
|
|
158
|
+
function isFullyBufferedBody(response) {
|
|
159
|
+
return response.__vinextFullyBufferedBody === true;
|
|
160
|
+
}
|
|
161
|
+
/** Preserve the internal buffered-body signal when response metadata is rebuilt. */
|
|
162
|
+
function preserveFullyBufferedBodyMetadata(source, target) {
|
|
163
|
+
return isFullyBufferedBody(source) ? markFullyBufferedBody(target) : target;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Wrap a response so deferred `after()` callbacks start on stream completion
|
|
167
|
+
* or cancellation. Skipped only when the body is marked fully buffered (see
|
|
168
|
+
* `markFullyBufferedBody`) and nothing is currently registered — that lets
|
|
169
|
+
* the runtime send it with an accurate `Content-Length` instead of chunked
|
|
170
|
+
* transfer encoding.
|
|
171
|
+
*/
|
|
172
|
+
function closeAfterResponseWithBody(response, ctx) {
|
|
173
|
+
if (!response.body) {
|
|
174
|
+
queueMicrotask(() => void closeAfterResponse(ctx));
|
|
175
|
+
return response;
|
|
176
|
+
}
|
|
177
|
+
if (isFullyBufferedBody(response) && !requiresResponseCloseTracking(ctx)) return response;
|
|
178
|
+
const passthrough = new TransformStream();
|
|
179
|
+
response.body.pipeTo(passthrough.writable).then(() => void closeAfterResponse(ctx), () => void closeAfterResponse(ctx));
|
|
180
|
+
const wrapped = new Response(passthrough.readable, {
|
|
181
|
+
status: response.status,
|
|
182
|
+
statusText: response.statusText,
|
|
183
|
+
headers: response.headers
|
|
184
|
+
});
|
|
185
|
+
wrapped.__vinextStreamedHtmlResponse = response.__vinextStreamedHtmlResponse;
|
|
186
|
+
wrapped.__vinextStreamedApiResponse = response.__vinextStreamedApiResponse;
|
|
187
|
+
return wrapped;
|
|
188
|
+
}
|
|
51
189
|
function runWithRequestContext(ctx, fn) {
|
|
52
190
|
return _als.run(ctx, fn);
|
|
53
191
|
}
|
|
@@ -84,4 +222,4 @@ function isInsideUnifiedScope() {
|
|
|
84
222
|
return _als.getStore() != null;
|
|
85
223
|
}
|
|
86
224
|
//#endregion
|
|
87
|
-
export { createRequestContext, getRequestContext, isInsideUnifiedScope, runWithRequestContext, runWithUnifiedStateMutation };
|
|
225
|
+
export { bindRequestContextSnapshot, closeAfterResponse, closeAfterResponseWithBody, createRequestContext, getRequestContext, isInsideUnifiedScope, markFullyBufferedBody, preserveFullyBufferedBodyMetadata, queueAfterCallback, requiresResponseCloseTracking, runWithRequestContext, runWithUnifiedStateMutation, trackAfterPromise };
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* server-action dispatcher when the server reports the requested action id as
|
|
21
21
|
* unknown (the `x-nextjs-action-not-found` response header).
|
|
22
22
|
*/
|
|
23
|
-
declare class UnrecognizedActionError extends Error {
|
|
23
|
+
export declare class UnrecognizedActionError extends Error {
|
|
24
24
|
constructor(...args: ConstructorParameters<typeof Error>);
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
@@ -29,6 +29,5 @@ declare class UnrecognizedActionError extends Error {
|
|
|
29
29
|
* `await myAction(...)` calls; reloading the page generally fixes the
|
|
30
30
|
* underlying client/server deployment mismatch.
|
|
31
31
|
*/
|
|
32
|
-
declare function unstable_isUnrecognizedActionError(error: unknown): error is UnrecognizedActionError;
|
|
33
|
-
//#endregion
|
|
34
|
-
export { UnrecognizedActionError, unstable_isUnrecognizedActionError };
|
|
32
|
+
export declare function unstable_isUnrecognizedActionError(error: unknown): error is UnrecognizedActionError;
|
|
33
|
+
//#endregion
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* Centralizes dangerous URI scheme detection so all components and
|
|
6
6
|
* navigation functions use the same validation logic.
|
|
7
7
|
*/
|
|
8
|
-
declare const DANGEROUS_URL_BLOCK_MESSAGE = "Next.js has blocked a javascript: URL as a security precaution.";
|
|
9
|
-
declare function isDangerousScheme(url: string): boolean;
|
|
8
|
+
export declare const DANGEROUS_URL_BLOCK_MESSAGE = "Next.js has blocked a javascript: URL as a security precaution.";
|
|
9
|
+
export declare function isDangerousScheme(url: string): boolean;
|
|
10
10
|
/**
|
|
11
11
|
* Emit a `console.error` matching Next.js's blocked-navigation message.
|
|
12
12
|
*
|
|
@@ -28,7 +28,6 @@ declare function isDangerousScheme(url: string): boolean;
|
|
|
28
28
|
* packages/next/src/client/components/app-router-instance.ts:345,402,442,460
|
|
29
29
|
* packages/next/src/shared/lib/router/router.ts:1025,1057
|
|
30
30
|
*/
|
|
31
|
-
declare function reportBlockedDangerousNavigation(): void;
|
|
32
|
-
declare function assertSafeNavigationUrl(url: string): void;
|
|
33
|
-
//#endregion
|
|
34
|
-
export { DANGEROUS_URL_BLOCK_MESSAGE, assertSafeNavigationUrl, isDangerousScheme, reportBlockedDangerousNavigation };
|
|
31
|
+
export declare function reportBlockedDangerousNavigation(): void;
|
|
32
|
+
export declare function assertSafeNavigationUrl(url: string, ErrorConstructor?: new (message: string) => Error): void;
|
|
33
|
+
//#endregion
|
package/dist/shims/url-safety.js
CHANGED
|
@@ -60,10 +60,10 @@ function isDangerousScheme(url) {
|
|
|
60
60
|
function reportBlockedDangerousNavigation() {
|
|
61
61
|
console.error(DANGEROUS_URL_BLOCK_MESSAGE);
|
|
62
62
|
}
|
|
63
|
-
function assertSafeNavigationUrl(url) {
|
|
63
|
+
function assertSafeNavigationUrl(url, ErrorConstructor = Error) {
|
|
64
64
|
if (isDangerousScheme(url)) {
|
|
65
65
|
reportBlockedDangerousNavigation();
|
|
66
|
-
throw new
|
|
66
|
+
throw new ErrorConstructor(DANGEROUS_URL_BLOCK_MESSAGE);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
//#endregion
|