vinext 1.3.0 → 1.4.0
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 +5 -2
- package/THIRD_PARTY_LICENSES.md +47 -0
- package/dist/_virtual/_rolldown/runtime.js +4 -3
- package/dist/build/action-owner-manifest.d.ts +3 -2
- package/dist/build/action-owner-manifest.js +18 -2
- package/dist/build/app-page-static-eligibility.d.ts +17 -1
- package/dist/build/app-page-static-eligibility.js +80 -13
- package/dist/build/clean-output.d.ts +2 -1
- package/dist/build/client-build-config.d.ts +13 -3
- package/dist/build/client-build-config.js +46 -9
- package/dist/build/client-reference-async.d.ts +48 -0
- package/dist/build/client-reference-async.js +123 -0
- package/dist/build/client-reference-chunks.d.ts +32 -0
- package/dist/build/client-reference-chunks.js +111 -0
- package/dist/build/client-reference-groups.d.ts +9 -1
- package/dist/build/client-reference-groups.js +40 -2
- package/dist/build/css-url-assets.d.ts +2 -1
- package/dist/build/google-fonts/fallback-metrics.d.ts +2 -1
- package/dist/build/google-fonts/find-font-files-in-css.d.ts +1 -0
- package/dist/build/google-fonts/find-font-files-in-css.js +17 -4
- package/dist/build/google-fonts/font-metadata.d.ts +2 -1
- package/dist/build/google-fonts/validate.d.ts +2 -1
- package/dist/build/inline-css.d.ts +2 -1
- package/dist/build/module-dependency-cache.d.ts +2 -1
- package/dist/build/next-client-runtime-manifests.d.ts +2 -1
- package/dist/build/precompress.d.ts +2 -1
- package/dist/build/precompress.js +1 -1
- package/dist/build/prerender-paths.d.ts +2 -1
- package/dist/build/prerender-phase.d.ts +2 -1
- package/dist/build/prerender-server-pool.js +1 -1
- package/dist/build/prerender.d.ts +3 -2
- package/dist/build/prerender.js +6 -5
- package/dist/build/report.d.ts +2 -15
- package/dist/build/report.js +1 -51
- package/dist/build/run-prerender.d.ts +2 -1
- package/dist/build/server-actions-encryption-key.d.ts +2 -1
- package/dist/build/ssr-manifest.js +25 -2
- package/dist/build/standalone.d.ts +2 -1
- package/dist/cache/cache-adapters-virtual.d.ts +2 -1
- package/dist/cache.js +1 -2
- package/dist/check.d.ts +2 -1
- package/dist/check.js +5 -1
- package/dist/cli-args.d.ts +2 -1
- package/dist/cli.js +5 -0
- package/dist/client/client-redirect-matcher.js +2 -1
- package/dist/client/client-redirects.d.ts +4 -3
- package/dist/client/client-redirects.js +2 -1
- package/dist/client/client-rewrites.d.ts +2 -1
- package/dist/client/dev-error-overlay-store.d.ts +2 -1
- package/dist/client/dev-error-overlay.js +1 -1
- package/dist/client/index.js +1 -2
- package/dist/client/instrumentation-client-state.js +5 -5
- package/dist/client/navigation-runtime.d.ts +16 -2
- package/dist/client/navigation-runtime.js +2 -2
- package/dist/client/pages-router-link-navigation.d.ts +2 -1
- package/dist/client/vinext-next-data.d.ts +25 -1
- package/dist/client/window-next.d.ts +2 -1
- package/dist/config/config-matchers.d.ts +12 -1
- package/dist/config/config-matchers.js +111 -16
- package/dist/config/dotenv.d.ts +2 -1
- package/dist/config/next-config.d.ts +32 -1
- package/dist/config/next-config.js +93 -5
- package/dist/config/tsconfig-paths.d.ts +2 -1
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/dbcs-codec.js +327 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/dbcs-data.js +123 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/index.js +29 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/internal.js +134 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/sbcs-codec.js +50 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/sbcs-data-generated.js +455 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/sbcs-data.js +147 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/big5-added.json.js +169 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/cp936.json.js +2584 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/cp949.json.js +2220 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/cp950.json.js +227 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/eucjp.json.js +425 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/gb18030-ranges.json.js +427 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/gbk-added.json.js +229 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/shiftjis.json.js +292 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/utf16.js +106 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/utf7.js +182 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/lib/bom-handling.js +42 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/lib/extend-node.js +147 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/lib/index.js +94 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/lib/streams.js +95 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/detector.js +23 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/index.js +2 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/lookup.js +25 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/bmp.js +11 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/cur.js +15 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/dds.js +11 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/gif.js +12 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/heif.js +55 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/icns.js +76 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/ico.js +39 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/index.js +46 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/j2c.js +11 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jp2.js +21 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jpg.js +71 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jxl-stream.js +42 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jxl.js +46 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/ktx.js +19 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/png.js +28 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/pnm.js +54 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/psd.js +11 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/svg.js +79 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/tga.js +15 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/tiff.js +96 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/utils.js +53 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/webp.js +45 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/utils/bit-reader.js +38 -0
- package/dist/deps/.pnpm/safer-buffer@2.1.2/deps/safer-buffer/safer.js +45 -0
- package/dist/deps/.pnpm/ua-parser-js@1.0.35/deps/ua-parser-js/src/ua-parser.js +2 -2
- package/dist/entries/app-browser-entry.d.ts +20 -5
- package/dist/entries/app-browser-entry.js +79 -6
- package/dist/entries/app-rsc-entry.d.ts +2 -1
- package/dist/entries/app-rsc-entry.js +59 -60
- package/dist/entries/app-rsc-manifest.d.ts +2 -1
- package/dist/entries/app-rsc-manifest.js +56 -4
- package/dist/entries/app-ssr-entry.js +1 -0
- package/dist/entries/pages-entry-helpers.js +1 -2
- package/dist/entries/pages-server-entry.d.ts +2 -1
- package/dist/entries/pages-server-entry.js +34 -9
- package/dist/entries/runtime-entry-module.d.ts +1 -0
- package/dist/entries/runtime-entry-module.js +4 -1
- package/dist/image/image-adapters-virtual.d.ts +2 -1
- package/dist/index.js +184 -103
- package/dist/init-cloudflare.d.ts +1 -3
- package/dist/init-cloudflare.js +10 -48
- package/dist/init-platform.d.ts +2 -0
- package/dist/init-platform.js +4 -0
- package/dist/plugins/client-compile-hints.d.ts +30 -0
- package/dist/plugins/client-compile-hints.js +88 -0
- package/dist/plugins/client-reference-dedup.d.ts +2 -1
- package/dist/plugins/cloudflare-dev-module-urls.d.ts +2 -1
- package/dist/plugins/dynamic-preload-metadata.d.ts +3 -1
- package/dist/plugins/dynamic-preload-metadata.js +1 -1
- package/dist/plugins/environment.d.ts +2 -1
- package/dist/plugins/extensionless-dynamic-import.js +6 -2
- package/dist/plugins/fonts.js +9 -12
- package/dist/plugins/ignore-dynamic-requests.d.ts +2 -1
- package/dist/plugins/import-meta-url.d.ts +2 -1
- package/dist/plugins/next-intl-catalog.d.ts +12 -0
- package/dist/plugins/next-intl-catalog.js +85 -0
- package/dist/plugins/og-assets.d.ts +2 -1
- package/dist/plugins/og-assets.js +2 -3
- package/dist/plugins/optimize-imports.d.ts +2 -1
- package/dist/plugins/pages-node-externals.d.ts +3 -1
- package/dist/plugins/pages-node-externals.js +1 -1
- package/dist/plugins/remove-console.d.ts +2 -1
- package/dist/plugins/require-condition-resolution.d.ts +2 -1
- package/dist/plugins/rsc-client-reference-loaders.d.ts +8 -0
- package/dist/plugins/rsc-client-reference-loaders.js +170 -68
- package/dist/plugins/rsc-client-shim-excludes.js +2 -0
- package/dist/plugins/sass.d.ts +2 -1
- package/dist/plugins/strip-server-exports.d.ts +2 -1
- package/dist/plugins/styled-jsx.d.ts +2 -1
- package/dist/plugins/transform-result.d.ts +2 -1
- package/dist/plugins/typeof-window.d.ts +2 -1
- package/dist/plugins/use-cache-callable.d.ts +1 -1
- package/dist/plugins/use-cache-callable.js +136 -94
- package/dist/plugins/worker-image-imports.js +1 -1
- package/dist/plugins/worker-use-server.d.ts +2 -1
- package/dist/routing/app-route-graph.d.ts +46 -0
- package/dist/routing/app-route-graph.js +131 -51
- package/dist/routing/browser-route-manifest.d.ts +2 -1
- package/dist/routing/optimistic-route-trie.d.ts +2 -1
- package/dist/routing/route-matching.d.ts +2 -1
- package/dist/routing/route-pattern.d.ts +2 -1
- package/dist/server/accept-encoding.d.ts +2 -1
- package/dist/server/api-handler.js +19 -4
- package/dist/server/app-action-forwarding.d.ts +2 -1
- package/dist/server/app-bfcache-identity.d.ts +2 -1
- package/dist/server/app-bfcache-identity.js +1 -1
- package/dist/server/app-browser-action-result.d.ts +2 -1
- package/dist/server/app-browser-entry.js +106 -66
- package/dist/server/app-browser-error.d.ts +2 -1
- package/dist/server/app-browser-history-controller.d.ts +7 -5
- package/dist/server/app-browser-history-controller.js +93 -15
- package/dist/server/app-browser-hydration.d.ts +2 -1
- package/dist/server/app-browser-interception-context.d.ts +2 -1
- package/dist/server/app-browser-navigation-controller.d.ts +2 -2
- package/dist/server/app-browser-navigation-controller.js +16 -12
- package/dist/server/app-browser-popstate.d.ts +2 -1
- package/dist/server/app-browser-rsc-redirect.d.ts +2 -1
- package/dist/server/app-browser-rsc-redirect.js +4 -4
- package/dist/server/app-browser-server-action-client.d.ts +4 -1
- package/dist/server/app-browser-server-action-client.js +4 -3
- package/dist/server/app-browser-state.d.ts +2 -4
- package/dist/server/app-browser-state.js +9 -4
- package/dist/server/app-browser-stream.d.ts +2 -1
- package/dist/server/app-browser-supplemental-refresh.js +16 -1
- package/dist/server/app-browser-visible-commit.d.ts +3 -2
- package/dist/server/app-browser-visible-commit.js +2 -12
- package/dist/server/app-client-reference-manifest.d.ts +31 -0
- package/dist/server/app-client-reference-manifest.js +46 -0
- package/dist/server/app-client-reference-preloader.d.ts +25 -5
- package/dist/server/app-client-reference-preloader.js +22 -7
- package/dist/server/app-elements-wire.d.ts +8 -39
- package/dist/server/app-elements-wire.js +4 -41
- package/dist/server/app-elements.d.ts +4 -2
- package/dist/server/app-elements.js +4 -2
- package/dist/server/app-fallback-renderer.d.ts +9 -2
- package/dist/server/app-fallback-renderer.js +4 -1
- package/dist/server/app-history-state.d.ts +4 -3
- package/dist/server/app-history-state.js +5 -2
- package/dist/server/app-inline-css-client.d.ts +2 -1
- package/dist/server/app-metadata-tracing.d.ts +2 -1
- package/dist/server/app-mounted-layouts.d.ts +21 -0
- package/dist/server/app-mounted-layouts.js +67 -0
- package/dist/server/app-optimistic-routing.d.ts +37 -2
- package/dist/server/app-optimistic-routing.js +75 -2
- package/dist/server/app-page-boundary-render.d.ts +20 -2
- package/dist/server/app-page-boundary-render.js +224 -40
- package/dist/server/app-page-boundary.d.ts +34 -5
- package/dist/server/app-page-boundary.js +41 -8
- package/dist/server/app-page-cache-finalizer.d.ts +14 -2
- package/dist/server/app-page-cache-finalizer.js +71 -30
- package/dist/server/app-page-cache-render.d.ts +10 -2
- package/dist/server/app-page-cache-render.js +14 -2
- package/dist/server/app-page-cache.d.ts +13 -1
- package/dist/server/app-page-cache.js +33 -11
- package/dist/server/app-page-dispatch.d.ts +39 -11
- package/dist/server/app-page-dispatch.js +236 -177
- package/dist/server/app-page-element-builder.d.ts +19 -3
- package/dist/server/app-page-element-builder.js +193 -71
- package/dist/server/app-page-execution.d.ts +43 -51
- package/dist/server/app-page-execution.js +205 -92
- package/dist/server/app-page-head.d.ts +108 -3
- package/dist/server/app-page-head.js +337 -154
- package/dist/server/app-page-http-access-fallback-metadata.d.ts +49 -2
- package/dist/server/app-page-http-access-fallback-metadata.js +77 -2
- package/dist/server/app-page-layout-gate.d.ts +35 -0
- package/dist/server/app-page-layout-gate.js +50 -0
- package/dist/server/app-page-method.d.ts +2 -1
- package/dist/server/app-page-params.d.ts +0 -1
- package/dist/server/app-page-params.js +1 -14
- package/dist/server/app-page-probe.d.ts +5 -22
- package/dist/server/app-page-probe.js +4 -37
- package/dist/server/app-page-render-identity.d.ts +2 -1
- package/dist/server/app-page-render.d.ts +9 -13
- package/dist/server/app-page-render.js +108 -214
- package/dist/server/app-page-request.d.ts +15 -4
- package/dist/server/app-page-request.js +2 -2
- package/dist/server/app-page-response.js +3 -3
- package/dist/server/app-page-route-wiring.d.ts +65 -8
- package/dist/server/app-page-route-wiring.js +259 -103
- package/dist/server/app-page-rsc-render-status.d.ts +29 -2
- package/dist/server/app-page-rsc-render-status.js +121 -13
- package/dist/server/app-page-search-params-observation.d.ts +7 -2
- package/dist/server/app-page-search-params-observation.js +8 -1
- package/dist/server/app-page-segment-plan.d.ts +2 -1
- package/dist/server/app-page-stream.d.ts +33 -1
- package/dist/server/app-page-stream.js +25 -6
- package/dist/server/app-pages-bridge.d.ts +6 -1
- package/dist/server/app-pages-bridge.js +7 -3
- package/dist/server/app-ppr-fallback-shell-render.d.ts +2 -1
- package/dist/server/app-ppr-fallback-shell.d.ts +2 -1
- package/dist/server/app-prerender-endpoints.d.ts +2 -1
- package/dist/server/app-prerender-static-params.d.ts +2 -1
- package/dist/server/app-render-dependency.d.ts +21 -4
- package/dist/server/app-render-dependency.js +100 -33
- package/dist/server/app-request-stage-dispatch.js +1 -1
- package/dist/server/app-request-stage-independent-entry.d.ts +2 -1
- package/dist/server/app-response-stage-entry.d.ts +2 -1
- package/dist/server/app-route-handler-cache.d.ts +2 -1
- package/dist/server/app-route-handler-cache.js +2 -2
- package/dist/server/app-route-handler-dispatch.d.ts +2 -1
- package/dist/server/app-route-handler-dispatch.js +15 -10
- package/dist/server/app-route-handler-execution.d.ts +2 -1
- package/dist/server/app-route-handler-execution.js +8 -3
- package/dist/server/app-route-handler-policy.d.ts +1 -1
- package/dist/server/app-route-handler-policy.js +3 -3
- package/dist/server/app-route-handler-response.d.ts +2 -1
- package/dist/server/app-route-handler-response.js +1 -1
- package/dist/server/app-route-handler-runtime.d.ts +2 -1
- package/dist/server/app-route-handler-runtime.js +17 -4
- package/dist/server/app-route-module-loader.d.ts +18 -1
- package/dist/server/app-route-module-loader.js +8 -0
- package/dist/server/app-route-tree-prefetch.d.ts +2 -1
- package/dist/server/app-rsc-cache-busting.d.ts +2 -2
- package/dist/server/app-rsc-cache-busting.js +4 -4
- package/dist/server/app-rsc-error-handler.d.ts +4 -2
- package/dist/server/app-rsc-error-handler.js +9 -1
- package/dist/server/app-rsc-errors.d.ts +10 -1
- package/dist/server/app-rsc-errors.js +8 -1
- package/dist/server/app-rsc-handler.d.ts +7 -6
- package/dist/server/app-rsc-handler.js +36 -34
- package/dist/server/app-rsc-request-normalization.d.ts +0 -4
- package/dist/server/app-rsc-request-normalization.js +1 -4
- package/dist/server/app-rsc-response-finalizer.d.ts +2 -1
- package/dist/server/app-rsc-response-finalizer.js +2 -2
- package/dist/server/app-rsc-response-stage.js +5 -3
- package/dist/server/app-rsc-route-matching.d.ts +38 -1
- package/dist/server/app-rsc-route-matching.js +24 -0
- package/dist/server/app-segment-config.d.ts +2 -1
- package/dist/server/app-segment-config.js +1 -14
- package/dist/server/app-server-action-execution.d.ts +5 -2
- package/dist/server/app-server-action-execution.js +10 -7
- package/dist/server/app-ssr-entry.d.ts +8 -0
- package/dist/server/app-ssr-entry.js +98 -50
- package/dist/server/app-ssr-error-meta.d.ts +2 -1
- package/dist/server/app-ssr-search-params-gate.d.ts +2 -1
- package/dist/server/app-ssr-stream.d.ts +22 -10
- package/dist/server/app-ssr-stream.js +300 -68
- package/dist/server/app-static-generation.d.ts +2 -1
- package/dist/server/app-streamed-client-references.d.ts +39 -0
- package/dist/server/app-streamed-client-references.js +156 -0
- package/dist/server/app-visited-response-cache.d.ts +38 -2
- package/dist/server/app-visited-response-cache.js +46 -5
- package/dist/server/app-worker-stages.d.ts +27 -4
- package/dist/server/app-worker-stages.js +45 -6
- package/dist/server/artifact-compatibility.d.ts +2 -2
- package/dist/server/artifact-compatibility.js +1 -10
- package/dist/server/bfcache-identity.d.ts +2 -1
- package/dist/server/cache-headers.d.ts +2 -1
- package/dist/server/cache-proof.d.ts +1 -115
- package/dist/server/cache-proof.js +1 -544
- package/dist/server/cacheability-request.d.ts +2 -1
- package/dist/server/cacheability-request.js +13 -8
- package/dist/server/config-headers.d.ts +2 -1
- package/dist/server/csp.d.ts +2 -1
- package/dist/server/default-global-not-found-module.d.ts +2 -1
- package/dist/server/default-http-access-fallback-modules.d.ts +33 -0
- package/dist/server/default-http-access-fallback-modules.js +31 -0
- package/dist/server/defer-until-stream-consumed.d.ts +34 -0
- package/dist/server/defer-until-stream-consumed.js +154 -21
- package/dist/server/dev-lockfile.d.ts +32 -2
- package/dist/server/dev-lockfile.js +46 -2
- package/dist/server/dev-module-runner.d.ts +2 -1
- package/dist/server/dev-server.js +14 -6
- package/dist/server/fetch-handler.js +1 -2
- package/dist/server/file-based-metadata.d.ts +2 -1
- package/dist/server/framework-tracer.d.ts +2 -1
- package/dist/server/headers.d.ts +6 -3
- package/dist/server/headers.js +9 -5
- package/dist/server/html.d.ts +1 -0
- package/dist/server/html.js +19 -1
- package/dist/server/http-conditional.d.ts +2 -1
- package/dist/server/http-error-responses.d.ts +2 -1
- package/dist/server/implicit-tags.d.ts +2 -1
- package/dist/server/isr-cache.d.ts +8 -2
- package/dist/server/isr-cache.js +26 -1
- package/dist/server/metadata-route-build-data.d.ts +2 -1
- package/dist/server/metadata-route-build-data.js +1 -1
- package/dist/server/metadata-route-response.d.ts +2 -1
- package/dist/server/metadata-route-response.js +32 -15
- package/dist/server/metadata-routes.d.ts +2 -1
- package/dist/server/middleware-runtime.d.ts +2 -1
- package/dist/server/multi-stage.d.ts +52 -11
- package/dist/server/multi-stage.js +13 -1
- package/dist/server/navigation-planner.js +1 -1
- package/dist/server/navigation-trace.d.ts +2 -1
- package/dist/server/next-error-digest.d.ts +2 -1
- package/dist/server/nitro-public-files-plugin.d.ts +2 -1
- package/dist/server/nitro-public-files.d.ts +2 -1
- package/dist/server/opentelemetry-api.d.ts +2 -1
- package/dist/server/operation-token.d.ts +2 -1
- package/dist/server/pages-api-route.d.ts +2 -1
- package/dist/server/pages-api-route.js +28 -19
- package/dist/server/pages-asset-tags.d.ts +2 -1
- package/dist/server/pages-body-parser-config.d.ts +2 -1
- package/dist/server/pages-client-assets.d.ts +4 -0
- package/dist/server/pages-data-route.d.ts +2 -1
- package/dist/server/pages-document-asset-props.d.ts +2 -1
- package/dist/server/pages-document-initial-props.d.ts +2 -1
- package/dist/server/pages-execution-tracing.d.ts +2 -1
- package/dist/server/pages-execution-tracing.js +1 -1
- package/dist/server/pages-get-initial-props.d.ts +2 -1
- package/dist/server/pages-media-type.d.ts +21 -1
- package/dist/server/pages-media-type.js +69 -5
- package/dist/server/pages-node-compat.js +52 -27
- package/dist/server/pages-page-data.d.ts +7 -1
- package/dist/server/pages-page-data.js +35 -12
- package/dist/server/pages-page-handler.d.ts +3 -2
- package/dist/server/pages-page-handler.js +27 -27
- package/dist/server/pages-page-method.d.ts +2 -1
- package/dist/server/pages-page-response.d.ts +2 -1
- package/dist/server/pages-preview.d.ts +2 -1
- package/dist/server/pages-readiness.d.ts +2 -1
- package/dist/server/pages-request-pipeline.d.ts +10 -1
- package/dist/server/pages-request-pipeline.js +6 -7
- package/dist/server/pages-request-stage-entry.d.ts +2 -1
- package/dist/server/pages-request-stage-entry.js +14 -12
- package/dist/server/pages-response-stage-entry.d.ts +2 -1
- package/dist/server/pages-response-stage-entry.js +9 -3
- package/dist/server/pages-route-data-kind.d.ts +2 -1
- package/dist/server/prerender-cache-life-header.d.ts +2 -1
- package/dist/server/prerender-route-params.d.ts +2 -1
- package/dist/server/prod-server.js +14 -4
- package/dist/server/request-log.d.ts +2 -1
- package/dist/server/request-pipeline.d.ts +6 -0
- package/dist/server/request-pipeline.js +21 -1
- package/dist/server/request-tracing.d.ts +2 -1
- package/dist/server/request-tracing.js +1 -1
- package/dist/server/response-start-tracing.js +7 -29
- package/dist/server/rsc-render-stream.d.ts +4 -0
- package/dist/server/rsc-render-stream.js +25 -0
- package/dist/server/seed-cache.d.ts +2 -1
- package/dist/server/seed-cache.js +1 -1
- package/dist/server/shared-cache-identity.d.ts +23 -0
- package/dist/server/shared-cache-identity.js +36 -0
- package/dist/server/static-file-cache.d.ts +2 -1
- package/dist/server/static-file-cache.js +1 -0
- package/dist/server/worker-revalidation-context.d.ts +2 -1
- package/dist/server/worker-stages.d.ts +18 -4
- package/dist/server/worker-stages.js +23 -4
- package/dist/shims/app.d.ts +2 -1
- package/dist/shims/cache-callable-runtime.d.ts +2 -1
- package/dist/shims/cache-handler.d.ts +8 -3
- package/dist/shims/cache-handler.js +31 -11
- package/dist/shims/cache-request-state.d.ts +17 -20
- package/dist/shims/cache-request-state.js +16 -21
- package/dist/shims/cache-runtime.js +27 -11
- package/dist/shims/cache.d.ts +8 -7
- package/dist/shims/cache.js +17 -19
- package/dist/shims/cacheability-classification.d.ts +2 -0
- package/dist/shims/caught-not-found-boundaries.d.ts +15 -0
- package/dist/shims/caught-not-found-boundaries.js +48 -0
- package/dist/shims/cdn-cache.d.ts +22 -5
- package/dist/shims/cdn-purge-routes.d.ts +2 -1
- package/dist/shims/client-locale.js +2 -1
- package/dist/shims/client-page-root.d.ts +2 -1
- package/dist/shims/client-page-root.js +2 -2
- package/dist/shims/config.d.ts +2 -1
- package/dist/shims/default-forbidden.d.ts +4 -0
- package/dist/shims/default-forbidden.js +18 -0
- package/dist/shims/default-not-found.d.ts +0 -5
- package/dist/shims/default-not-found.js +5 -41
- package/dist/shims/default-unauthorized.d.ts +4 -0
- package/dist/shims/default-unauthorized.js +18 -0
- package/dist/shims/dynamic.js +9 -6
- package/dist/shims/error-boundary.d.ts +39 -3
- package/dist/shims/error-boundary.js +33 -18
- package/dist/shims/fetch-cache-state.d.ts +5 -1
- package/dist/shims/fetch-cache-state.js +1 -3
- package/dist/shims/fetch-cache.d.ts +2 -1
- package/dist/shims/fetch-cache.js +34 -24
- package/dist/shims/font-google.js +1 -2
- package/dist/shims/font-utils.d.ts +3 -2
- package/dist/shims/font-utils.js +5 -3
- package/dist/shims/form.js +3 -3
- package/dist/shims/headers.d.ts +8 -23
- package/dist/shims/headers.js +17 -67
- package/dist/shims/http-access-error-fallback.d.ts +7 -0
- package/dist/shims/http-access-error-fallback.js +47 -0
- package/dist/shims/image.d.ts +1 -22
- package/dist/shims/internal/app-prefetch-fetch-queue.d.ts +22 -2
- package/dist/shims/internal/app-prefetch-fetch-queue.js +71 -18
- package/dist/shims/internal/app-route-prefetch-policy.d.ts +14 -3
- package/dist/shims/internal/app-route-prefetch-policy.js +29 -4
- package/dist/shims/internal/cache-context-accessor.d.ts +2 -1
- package/dist/shims/internal/client-reference-loader.d.ts +7 -0
- package/dist/shims/internal/client-reference-loader.js +91 -0
- package/dist/shims/internal/cookie-serialize.d.ts +2 -1
- package/dist/shims/internal/cookies.js +1 -2
- package/dist/shims/internal/headers-state.d.ts +2 -0
- package/dist/shims/internal/headers-state.js +6 -1
- package/dist/shims/internal/hybrid-client-route-owner-direct.d.ts +2 -1
- package/dist/shims/internal/interpolate-as.d.ts +2 -1
- package/dist/shims/internal/navigation-untracked.js +1 -1
- package/dist/shims/internal/pages-data-target.d.ts +2 -1
- package/dist/shims/internal/pages-data-url.d.ts +2 -1
- package/dist/shims/internal/thenable-well-known-properties.d.ts +2 -1
- package/dist/shims/link.js +197 -52
- package/dist/shims/metadata.d.ts +52 -29
- package/dist/shims/metadata.js +142 -42
- package/dist/shims/navigation-errors.d.ts +2 -1
- package/dist/shims/navigation-server.js +1 -1
- package/dist/shims/navigation.d.ts +95 -8
- package/dist/shims/navigation.js +255 -47
- package/dist/shims/navigation.react-server.js +2 -2
- package/dist/shims/pages-router-runtime.d.ts +2 -1
- package/dist/shims/ppr-fallback-shell.d.ts +2 -1
- package/dist/shims/request-state-types.d.ts +2 -2
- package/dist/shims/router.js +14 -3
- package/dist/shims/slot.d.ts +12 -0
- package/dist/shims/slot.js +37 -9
- package/dist/shims/unified-request-context.d.ts +1 -1
- package/dist/shims/unified-request-context.js +5 -6
- package/dist/typegen.d.ts +2 -1
- package/dist/utils/cache-control-metadata.d.ts +5 -0
- package/dist/utils/cache-control-metadata.js +9 -1
- package/dist/utils/client-build-manifest.d.ts +4 -1
- package/dist/utils/client-build-manifest.js +9 -2
- package/dist/utils/client-entry-manifest.d.ts +13 -0
- package/dist/utils/client-entry-manifest.js +20 -1
- package/dist/utils/client-reference-chunks.d.ts +45 -0
- package/dist/utils/client-reference-chunks.js +30 -0
- package/dist/utils/client-runtime-metadata.d.ts +9 -1
- package/dist/utils/client-runtime-metadata.js +40 -9
- package/dist/utils/compare.d.ts +9 -0
- package/dist/utils/compare.js +15 -1
- package/dist/utils/lazy-chunks.d.ts +14 -0
- package/dist/utils/lazy-chunks.js +27 -1
- package/dist/utils/middleware-request-headers.d.ts +2 -1
- package/dist/utils/project.d.ts +4 -3
- package/dist/utils/project.js +12 -17
- package/dist/utils/query.d.ts +2 -1
- package/dist/utils/regex.d.ts +5 -0
- package/dist/utils/regex.js +11 -1
- package/dist/utils/text-stream.d.ts +10 -5
- package/dist/utils/text-stream.js +6 -6
- package/dist/utils/vite-cli-invocation.d.ts +2 -1
- package/package.json +6 -5
- package/dist/build/layout-classification-types.d.ts +0 -60
- package/dist/build/layout-classification-types.js +0 -1
- package/dist/build/layout-classification.d.ts +0 -61
- package/dist/build/layout-classification.js +0 -98
- package/dist/build/route-classification-injector.d.ts +0 -32
- package/dist/build/route-classification-injector.js +0 -59
- package/dist/build/route-classification-manifest.d.ts +0 -53
- package/dist/build/route-classification-manifest.js +0 -143
- package/dist/deps/.pnpm/image-size@2.0.2/deps/image-size/dist/index.js +0 -808
- package/dist/server/app-browser-client-reuse-manifest.d.ts +0 -10
- package/dist/server/app-browser-client-reuse-manifest.js +0 -101
- package/dist/server/app-layout-param-observation.d.ts +0 -41
- package/dist/server/app-layout-param-observation.js +0 -168
- package/dist/server/client-reuse-manifest.d.ts +0 -102
- package/dist/server/client-reuse-manifest.js +0 -209
- package/dist/server/default-not-found-module.d.ts +0 -19
- package/dist/server/default-not-found-module.js +0 -18
- package/dist/server/rsc-stream-hints.d.ts +0 -21
- package/dist/server/rsc-stream-hints.js +0 -227
- package/dist/server/skip-cache-proof.d.ts +0 -60
- package/dist/server/skip-cache-proof.js +0 -168
- package/dist/server/static-layout-client-reuse-proof.d.ts +0 -13
- package/dist/server/static-layout-client-reuse-proof.js +0 -33
- package/dist/utils/sorted-array.d.ts +0 -7
- package/dist/utils/sorted-array.js +0 -20
package/dist/shims/metadata.js
CHANGED
|
@@ -23,12 +23,23 @@ async function resolveModuleViewport(mod, params = {}, searchParams, parent = Pr
|
|
|
23
23
|
params: asyncParams,
|
|
24
24
|
searchParams: makeThenableParams(searchParams, searchParamsObserver)
|
|
25
25
|
});
|
|
26
|
-
return await mod.generateViewport
|
|
26
|
+
return await callSegmentResolver(mod.generateViewport, props, parent);
|
|
27
27
|
}
|
|
28
28
|
if (mod.viewport && typeof mod.viewport === "object") return mod.viewport;
|
|
29
29
|
return null;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
+
* Call a segment's generateMetadata() or generateViewport() with `parent`, as
|
|
33
|
+
* Next.js's getResult does for both.
|
|
34
|
+
* https://github.com/vercel/next.js/blob/canary/packages/next/src/lib/metadata/resolve-metadata.ts (getResult)
|
|
35
|
+
*/
|
|
36
|
+
function callSegmentResolver(resolver, props, parent) {
|
|
37
|
+
if (!(Reflect.get(resolver, USE_CACHE_FUNCTION_SYMBOL) === true)) return resolver(props, parent);
|
|
38
|
+
const acceptsSecondArgument = Reflect.get(resolver, USE_CACHE_ACCEPTS_SECOND_ARGUMENT_SYMBOL);
|
|
39
|
+
if (!(typeof acceptsSecondArgument === "boolean" ? acceptsSecondArgument : resolver.length >= 2)) return resolver(props);
|
|
40
|
+
return parent.then(() => resolver(props, parent));
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
32
43
|
* Merge viewport configs from multiple sources (layouts + page).
|
|
33
44
|
* Later entries override earlier ones.
|
|
34
45
|
*/
|
|
@@ -120,11 +131,8 @@ function resolveThemeColor(themeColor) {
|
|
|
120
131
|
/**
|
|
121
132
|
* Merge metadata from multiple sources (layouts + page).
|
|
122
133
|
*
|
|
123
|
-
* The list is ordered [rootLayout, nestedLayout, ..., page]
|
|
124
|
-
*
|
|
125
|
-
* the segment that defines the template itself. `title.absolute`
|
|
126
|
-
* skips all templates. `title.default` is the fallback when no
|
|
127
|
-
* child provides a title.
|
|
134
|
+
* The list is ordered [rootLayout, nestedLayout, ..., page], with titles
|
|
135
|
+
* resolved as {@link mergeMetadataEntries} does.
|
|
128
136
|
*
|
|
129
137
|
* Shallow merge: later entries override earlier ones (per Next.js docs).
|
|
130
138
|
*/
|
|
@@ -151,6 +159,10 @@ function resolveStringTitle(title) {
|
|
|
151
159
|
if (typeof title === "string") return title;
|
|
152
160
|
if (title && typeof title === "object") return title.absolute ?? title.default ?? void 0;
|
|
153
161
|
}
|
|
162
|
+
/** The text a social title renders, a raw `{ default }` title's default if it is not resolved. */
|
|
163
|
+
function renderedTitle(title) {
|
|
164
|
+
return title && typeof title === "object" ? title.absolute || title.default : title;
|
|
165
|
+
}
|
|
154
166
|
function applyTitleTemplate(template, title) {
|
|
155
167
|
return template ? template.replace(/%s/g, title) : title;
|
|
156
168
|
}
|
|
@@ -222,23 +234,47 @@ function postProcessMetadata(merged) {
|
|
|
222
234
|
/**
|
|
223
235
|
* Merge metadata from multiple sources (layouts + page).
|
|
224
236
|
*
|
|
225
|
-
* The list is ordered [rootLayout, nestedLayout, ..., page].
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
237
|
+
* The list is ordered [rootLayout, nestedLayout, ..., page]. Like Next.js's
|
|
238
|
+
* accumulateMetadata, each title resolves with the template of the title
|
|
239
|
+
* before it: a `title.template` wraps later titles, not its own entry's
|
|
240
|
+
* `title.default`, and a plain-string title, or one without a template,
|
|
241
|
+
* clears it. An `isPage` entry passes on the template it received.
|
|
242
|
+
* `title.absolute` skips all templates.
|
|
230
243
|
*
|
|
231
244
|
* For top-level keys, later entries override earlier ones. `other` custom meta
|
|
232
245
|
* tags are the exception: Next.js merges those across segments.
|
|
246
|
+
* https://github.com/vercel/next.js/blob/canary/packages/next/src/lib/metadata/resolve-metadata.ts (accumulateMetadata)
|
|
233
247
|
*/
|
|
234
248
|
function mergeMetadataEntries(entries) {
|
|
249
|
+
return mergeEntries(entries, false);
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Merge metadata into the `parent` a later segment's resolver receives. Like
|
|
253
|
+
* {@link mergeMetadataEntries}, except the title stays resolved as Next.js's
|
|
254
|
+
* `{ absolute, template }`, so `(await parent).title?.absolute` reads the
|
|
255
|
+
* title so far. `template` is the last title's own, the one the next title
|
|
256
|
+
* gets, so merging this parent with later entries resolves their titles as
|
|
257
|
+
* the full merge does.
|
|
258
|
+
* https://github.com/vercel/next.js/blob/canary/packages/next/src/lib/metadata/resolvers/resolve-title.ts
|
|
259
|
+
*/
|
|
260
|
+
function mergeParentMetadataEntries(entries) {
|
|
261
|
+
return mergeEntries(entries, true);
|
|
262
|
+
}
|
|
263
|
+
const SOCIAL_TITLE_KEYS = ["openGraph", "twitter"];
|
|
264
|
+
function titleTemplateOf(title) {
|
|
265
|
+
return typeof title === "object" && title ? title.template ?? null : null;
|
|
266
|
+
}
|
|
267
|
+
function mergeEntries(entries, resolvedTitle) {
|
|
235
268
|
if (entries.length === 0) return {};
|
|
236
269
|
const merged = {};
|
|
237
|
-
|
|
270
|
+
const titleTemplates = {
|
|
271
|
+
title: null,
|
|
272
|
+
openGraph: null,
|
|
273
|
+
twitter: null
|
|
274
|
+
};
|
|
275
|
+
let stashedTemplates = { ...titleTemplates };
|
|
238
276
|
for (const entry of entries) {
|
|
239
277
|
const meta = entry.metadata;
|
|
240
|
-
const isPage = Boolean(entry.isPage);
|
|
241
|
-
const contributesTitle = entry.contributesTitle !== false;
|
|
242
278
|
for (const key of Object.keys(meta)) {
|
|
243
279
|
if (key === "title") continue;
|
|
244
280
|
const incoming = meta[key];
|
|
@@ -249,8 +285,36 @@ function mergeMetadataEntries(entries) {
|
|
|
249
285
|
};
|
|
250
286
|
else merged[key] = incoming;
|
|
251
287
|
}
|
|
252
|
-
if (
|
|
253
|
-
|
|
288
|
+
if (meta.title !== void 0) {
|
|
289
|
+
merged.title = resolveTitle(meta.title, stashedTemplates.title ?? void 0);
|
|
290
|
+
titleTemplates.title = titleTemplateOf(meta.title);
|
|
291
|
+
}
|
|
292
|
+
for (const key of SOCIAL_TITLE_KEYS) {
|
|
293
|
+
if (!Object.hasOwn(meta, key)) continue;
|
|
294
|
+
const social = meta[key];
|
|
295
|
+
titleTemplates[key] = titleTemplateOf(social?.title);
|
|
296
|
+
merged[key] = social ? {
|
|
297
|
+
...social,
|
|
298
|
+
title: resolveTitle(social.title, stashedTemplates[key] ?? void 0)
|
|
299
|
+
} : null;
|
|
300
|
+
}
|
|
301
|
+
if (!entry.isPage) stashedTemplates = { ...titleTemplates };
|
|
302
|
+
}
|
|
303
|
+
if (resolvedTitle) {
|
|
304
|
+
if (Object.hasOwn(merged, "title")) merged.title = {
|
|
305
|
+
absolute: resolveStringTitle(merged.title) ?? "",
|
|
306
|
+
template: titleTemplates.title
|
|
307
|
+
};
|
|
308
|
+
for (const key of SOCIAL_TITLE_KEYS) {
|
|
309
|
+
const social = merged[key];
|
|
310
|
+
if (social) merged[key] = {
|
|
311
|
+
...social,
|
|
312
|
+
title: {
|
|
313
|
+
absolute: resolveStringTitle(social.title) ?? "",
|
|
314
|
+
template: titleTemplates[key]
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
}
|
|
254
318
|
}
|
|
255
319
|
return merged;
|
|
256
320
|
}
|
|
@@ -268,13 +332,10 @@ async function resolveModuleMetadata(mod, params = {}, searchParams, parent = Pr
|
|
|
268
332
|
if (typeof mod.generateMetadata === "function") {
|
|
269
333
|
const generateMetadata = mod.generateMetadata;
|
|
270
334
|
const asyncParams = makeThenableParams(params);
|
|
271
|
-
|
|
335
|
+
return await callSegmentResolver(generateMetadata, searchParams === void 0 ? withUseCacheLayoutMarker(generateMetadata, { params: asyncParams }) : withUseCachePageMarker(generateMetadata, {
|
|
272
336
|
params: asyncParams,
|
|
273
337
|
searchParams: makeThenableParams(searchParams, searchParamsObserver)
|
|
274
|
-
});
|
|
275
|
-
const isUseCacheFunction = Reflect.get(generateMetadata, USE_CACHE_FUNCTION_SYMBOL) === true;
|
|
276
|
-
const acceptsSecondArgument = Reflect.get(generateMetadata, USE_CACHE_ACCEPTS_SECOND_ARGUMENT_SYMBOL);
|
|
277
|
-
return await (!isUseCacheFunction || (typeof acceptsSecondArgument === "boolean" ? acceptsSecondArgument : generateMetadata.length >= 2) ? generateMetadata(props, parent) : generateMetadata(props));
|
|
338
|
+
}), parent);
|
|
278
339
|
}
|
|
279
340
|
if (mod.metadata && typeof mod.metadata === "object") return mod.metadata;
|
|
280
341
|
return null;
|
|
@@ -544,9 +605,10 @@ function MetadataHead({ metadata, pathname = "/", trailingSlash, streamedIconKey
|
|
|
544
605
|
}
|
|
545
606
|
if (metadata.openGraph) {
|
|
546
607
|
const og = metadata.openGraph;
|
|
547
|
-
|
|
608
|
+
const ogTitle = renderedTitle(og.title);
|
|
609
|
+
if (ogTitle) elements.push(/* @__PURE__ */ jsx("meta", {
|
|
548
610
|
property: "og:title",
|
|
549
|
-
content:
|
|
611
|
+
content: ogTitle
|
|
550
612
|
}, key++));
|
|
551
613
|
if (og.description) elements.push(/* @__PURE__ */ jsx("meta", {
|
|
552
614
|
property: "og:description",
|
|
@@ -607,24 +669,61 @@ function MetadataHead({ metadata, pathname = "/", trailingSlash, streamedIconKey
|
|
|
607
669
|
}
|
|
608
670
|
}
|
|
609
671
|
}
|
|
610
|
-
if (og.videos)
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
672
|
+
if (og.videos) {
|
|
673
|
+
const videos = normalizeUrlDescriptorEntries(og.videos, (url) => ({ url }));
|
|
674
|
+
for (const video of videos) {
|
|
675
|
+
if (video.url) elements.push(/* @__PURE__ */ jsx("meta", {
|
|
676
|
+
property: "og:video",
|
|
677
|
+
content: stringifyUrl(video.url)
|
|
678
|
+
}, key++));
|
|
679
|
+
if (video.secureUrl) elements.push(/* @__PURE__ */ jsx("meta", {
|
|
680
|
+
property: "og:video:secure_url",
|
|
681
|
+
content: stringifyUrl(video.secureUrl)
|
|
682
|
+
}, key++));
|
|
683
|
+
if (video.type) elements.push(/* @__PURE__ */ jsx("meta", {
|
|
684
|
+
property: "og:video:type",
|
|
685
|
+
content: video.type
|
|
686
|
+
}, key++));
|
|
687
|
+
if (video.width) elements.push(/* @__PURE__ */ jsx("meta", {
|
|
688
|
+
property: "og:video:width",
|
|
689
|
+
content: String(video.width)
|
|
690
|
+
}, key++));
|
|
691
|
+
if (video.height) elements.push(/* @__PURE__ */ jsx("meta", {
|
|
692
|
+
property: "og:video:height",
|
|
693
|
+
content: String(video.height)
|
|
694
|
+
}, key++));
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
if (og.audio) {
|
|
698
|
+
const audios = normalizeUrlDescriptorEntries(og.audio, (url) => ({ url }));
|
|
699
|
+
for (const audio of audios) {
|
|
700
|
+
if (audio.url) elements.push(/* @__PURE__ */ jsx("meta", {
|
|
701
|
+
property: "og:audio",
|
|
702
|
+
content: stringifyUrl(audio.url)
|
|
703
|
+
}, key++));
|
|
704
|
+
if (audio.secureUrl) elements.push(/* @__PURE__ */ jsx("meta", {
|
|
705
|
+
property: "og:audio:secure_url",
|
|
706
|
+
content: stringifyUrl(audio.secureUrl)
|
|
707
|
+
}, key++));
|
|
708
|
+
if (audio.type) elements.push(/* @__PURE__ */ jsx("meta", {
|
|
709
|
+
property: "og:audio:type",
|
|
710
|
+
content: audio.type
|
|
711
|
+
}, key++));
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
const ogListTags = [
|
|
715
|
+
["og:email", og.emails],
|
|
716
|
+
["og:phone_number", og.phoneNumbers],
|
|
717
|
+
["og:fax_number", og.faxNumbers],
|
|
718
|
+
["og:locale:alternate", og.alternateLocale]
|
|
719
|
+
];
|
|
720
|
+
for (const [property, value] of ogListTags) {
|
|
721
|
+
if (!value) continue;
|
|
722
|
+
for (const content of Array.isArray(value) ? value : [value]) elements.push(/* @__PURE__ */ jsx("meta", {
|
|
723
|
+
property,
|
|
724
|
+
content
|
|
622
725
|
}, key++));
|
|
623
726
|
}
|
|
624
|
-
if (og.audio) for (const audio of og.audio) elements.push(/* @__PURE__ */ jsx("meta", {
|
|
625
|
-
property: "og:audio",
|
|
626
|
-
content: resolveUrl(audio.url)
|
|
627
|
-
}, key++));
|
|
628
727
|
}
|
|
629
728
|
if (metadata.twitter) {
|
|
630
729
|
const tw = metadata.twitter;
|
|
@@ -640,9 +739,10 @@ function MetadataHead({ metadata, pathname = "/", trailingSlash, streamedIconKey
|
|
|
640
739
|
name: "twitter:site:id",
|
|
641
740
|
content: tw.siteId
|
|
642
741
|
}, key++));
|
|
643
|
-
|
|
742
|
+
const twTitle = renderedTitle(tw.title);
|
|
743
|
+
if (twTitle) elements.push(/* @__PURE__ */ jsx("meta", {
|
|
644
744
|
name: "twitter:title",
|
|
645
|
-
content:
|
|
745
|
+
content: twTitle
|
|
646
746
|
}, key++));
|
|
647
747
|
if (tw.description) elements.push(/* @__PURE__ */ jsx("meta", {
|
|
648
748
|
name: "twitter:description",
|
|
@@ -867,4 +967,4 @@ function MetadataHead({ metadata, pathname = "/", trailingSlash, streamedIconKey
|
|
|
867
967
|
return /* @__PURE__ */ jsx(Fragment$1, { children: elements });
|
|
868
968
|
}
|
|
869
969
|
//#endregion
|
|
870
|
-
export { DEFAULT_VIEWPORT, MetadataHead, ViewportHead, mergeMetadata, mergeMetadataEntries, mergeViewport, postProcessMetadata, renderMetadataToHtml, resolveModuleMetadata, resolveModuleViewport };
|
|
970
|
+
export { DEFAULT_VIEWPORT, MetadataHead, ViewportHead, mergeMetadata, mergeMetadataEntries, mergeParentMetadataEntries, mergeViewport, postProcessMetadata, renderMetadataToHtml, resolveModuleMetadata, resolveModuleViewport };
|
|
@@ -58,4 +58,5 @@ export declare function isDynamicServerError(error: unknown): error is DynamicSe
|
|
|
58
58
|
* them. This covers the categories vinext can currently produce.
|
|
59
59
|
*/
|
|
60
60
|
export declare function unstable_rethrow(error: unknown): void;
|
|
61
|
-
//#endregion
|
|
61
|
+
//#endregion
|
|
62
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { GLOBAL_ACCESSORS_KEY, ServerInsertedHTMLContext, _registerStateAccessors, clearClientHydrationContext, clearServerInsertedHTML, flushServerInsertedHTML, getBfcacheIdMapContext, getBfcacheSegmentIdContext, getLayoutSegmentContext, getNavigationContext, registerServerInsertedHTMLCallback, renderServerInsertedHTML, setNavigationContext } from "./navigation-context-state.js";
|
|
2
1
|
import { BailoutToCSRError, DynamicServerError, HTTP_ERROR_FALLBACK_ERROR_CODE, RedirectType, decodeRedirectError, forbidden, getAccessFallbackHTTPStatus, isBailoutToCSRError, isDynamicServerError, isHTTPAccessFallbackError, isNextRouterError, isRedirectError, notFound, permanentRedirect, redirect, unauthorized, unstable_rethrow } from "./navigation-errors.js";
|
|
2
|
+
import { GLOBAL_ACCESSORS_KEY, ServerInsertedHTMLContext, _registerStateAccessors, clearClientHydrationContext, clearServerInsertedHTML, flushServerInsertedHTML, getBfcacheIdMapContext, getBfcacheSegmentIdContext, getLayoutSegmentContext, getNavigationContext, registerServerInsertedHTMLCallback, renderServerInsertedHTML, setNavigationContext } from "./navigation-context-state.js";
|
|
3
3
|
export { BailoutToCSRError, DynamicServerError, GLOBAL_ACCESSORS_KEY, HTTP_ERROR_FALLBACK_ERROR_CODE, RedirectType, ServerInsertedHTMLContext, _registerStateAccessors, clearClientHydrationContext, clearServerInsertedHTML, decodeRedirectError, flushServerInsertedHTML, forbidden, getAccessFallbackHTTPStatus, getBfcacheIdMapContext, getBfcacheSegmentIdContext, getLayoutSegmentContext, getNavigationContext, isBailoutToCSRError, isDynamicServerError, isHTTPAccessFallbackError, isNextRouterError, isRedirectError, notFound, permanentRedirect, redirect, registerServerInsertedHTMLCallback, renderServerInsertedHTML, setNavigationContext, unauthorized, unstable_rethrow };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { AppRouterScrollIntent } from "./app-router-scroll-state.js";
|
|
2
|
-
import {
|
|
2
|
+
import { AppRouterInstance, NavigateOptions, PrefetchOptions as PrefetchOptions$1 } from "./internal/app-router-context.js";
|
|
3
|
+
import { AppRoutePrefetchPolicy } from "./internal/app-route-prefetch-policy.js";
|
|
3
4
|
import { AppElements } from "../server/app-elements-wire.js";
|
|
4
5
|
import "../server/app-elements.js";
|
|
5
|
-
import { AppRouterInstance, NavigateOptions, PrefetchOptions as PrefetchOptions$1 } from "./internal/app-router-context.js";
|
|
6
6
|
import { ReadonlyURLSearchParams } from "./readonly-url-search-params.js";
|
|
7
7
|
import { AppRscRenderMode } from "../server/app-rsc-render-mode.js";
|
|
8
8
|
import { GLOBAL_ACCESSORS_KEY, NavigationContext, NavigationStateAccessors, SegmentMap, ServerInsertedHTMLContext, _registerStateAccessors, clearServerInsertedHTML, flushServerInsertedHTML, getBfcacheIdMapContext, getBfcacheSegmentIdContext, getLayoutSegmentContext, getNavigationContext, renderServerInsertedHTML, setNavigationContext } from "./navigation-context-state.js";
|
|
9
9
|
import { BailoutToCSRError, DynamicServerError, HTTP_ERROR_FALLBACK_ERROR_CODE, RedirectType, decodeRedirectError, forbidden, getAccessFallbackHTTPStatus, isBailoutToCSRError, isDynamicServerError, isHTTPAccessFallbackError, isNextRouterError, isRedirectError, notFound, permanentRedirect, redirect, unauthorized, unstable_rethrow } from "./navigation-errors.js";
|
|
10
10
|
import { UnrecognizedActionError, unstable_isUnrecognizedActionError } from "./unrecognized-action-error.js";
|
|
11
|
+
import { NavigationRuntimeVisibleCommitMode } from "../client/navigation-runtime.js";
|
|
11
12
|
import * as React$1 from "react";
|
|
12
13
|
import { Params } from "@vinext/types/next/upstream/dist/server/request/params";
|
|
13
14
|
//#region src/shims/navigation.d.ts
|
|
@@ -49,6 +50,12 @@ export type CachedRscResponse = {
|
|
|
49
50
|
mountedSlotsHeader?: string | null;
|
|
50
51
|
paramsHeader: string | null;
|
|
51
52
|
preparedElements?: AppElements;
|
|
53
|
+
/**
|
|
54
|
+
* When the payload arrived from the server. A navigation that commits a
|
|
55
|
+
* prefetched payload keeps the prefetch's time, so a later full prefetch
|
|
56
|
+
* judges the data by its age, not by the navigation that reused it.
|
|
57
|
+
*/
|
|
58
|
+
receivedAt?: number;
|
|
52
59
|
/**
|
|
53
60
|
* Streamed `redirect()` side-channel headers. A replayed snapshot must keep
|
|
54
61
|
* them so the navigation follows the redirect instead of decoding the
|
|
@@ -67,7 +74,13 @@ export type PrefetchOptions = {
|
|
|
67
74
|
export type PrefetchCacheKind = "loading-shell" | "navigation" | "route-tree";
|
|
68
75
|
export type PrefetchCacheEntry = {
|
|
69
76
|
cacheForNavigation?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Set while a full prefetch would be kept as learning-only if its page
|
|
79
|
+
* renders dynamically. A hover upgrade turns it into a full prefetch.
|
|
80
|
+
*/
|
|
81
|
+
dynamicStaleTime?: "learning-only" | "full-prefetch";
|
|
70
82
|
expiresAt?: number;
|
|
83
|
+
fallbackTtlMs?: number;
|
|
71
84
|
invalidationTimer?: ReturnType<typeof setTimeout>;
|
|
72
85
|
mountedSlotsHeader?: string | null;
|
|
73
86
|
onInvalidateCallbacks?: Set<() => void>;
|
|
@@ -116,6 +129,10 @@ export declare function hasPrefetchCacheEntryForNavigation(rscUrl: string, inter
|
|
|
116
129
|
additionalRscUrls?: readonly string[];
|
|
117
130
|
notifyInvalidation?: boolean;
|
|
118
131
|
onInvalidate?: () => void;
|
|
132
|
+
/** Called with the matched entry, and the key it was found under, when it is reused. */
|
|
133
|
+
onReuse?: (entry: PrefetchCacheEntry, cacheKey: string) => void;
|
|
134
|
+
/** Whether an in-flight entry counts as reusable. Defaults to true. */
|
|
135
|
+
reusePending?: boolean;
|
|
119
136
|
}): boolean;
|
|
120
137
|
/**
|
|
121
138
|
* Return whether the exact learning-only Link prefetch is still usable.
|
|
@@ -124,8 +141,36 @@ export declare function hasPrefetchCacheEntryForNavigation(rscUrl: string, inter
|
|
|
124
141
|
*/
|
|
125
142
|
export declare function hasFreshLearningOnlyPrefetchCacheEntry(rscUrl: string, interceptionContext?: string | null): boolean;
|
|
126
143
|
export declare function hasSearchAgnosticPrefetchShellForRoute(rscUrl: string, interceptionContext?: string | null, mountedSlotsHeader?: string | null): boolean;
|
|
127
|
-
export declare function discardLearningOnlyPrefetchCacheEntry(rscUrl: string, interceptionContext?: string | null): boolean;
|
|
128
|
-
|
|
144
|
+
export declare function discardLearningOnlyPrefetchCacheEntry(rscUrl: string, interceptionContext?: string | null, mountedSlotsHeader?: string | null): boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Make a prefetch reusable by a navigation, as an `unstable_dynamicOnHover`
|
|
147
|
+
* hover does. A pending one that would be kept as learning-only becomes a full
|
|
148
|
+
* prefetch and takes the full-prefetch lifetime. One already kept as
|
|
149
|
+
* learning-only because its page rendered dynamically is left for the full
|
|
150
|
+
* prefetch to replace: Next.js refetches it with `FetchStrategy.Full`, so the
|
|
151
|
+
* page reflects the cookies and headers at hover time.
|
|
152
|
+
*/
|
|
153
|
+
export declare function promotePrefetchCacheEntryForNavigation(cacheKey: string, entry: PrefetchCacheEntry): void;
|
|
154
|
+
export type InvalidatePrefetchCacheOptions = {
|
|
155
|
+
/** Prefetch the visible links again right away. Defaults to true. */
|
|
156
|
+
pingVisibleLinks?: boolean;
|
|
157
|
+
};
|
|
158
|
+
export declare function invalidatePrefetchCache(options?: InvalidatePrefetchCacheOptions): void;
|
|
159
|
+
/**
|
|
160
|
+
* Evict the prefetch entries that may hold dynamic data, for a Server Action
|
|
161
|
+
* that called `refresh()`. Like Next.js's dynamic-only revalidation, which
|
|
162
|
+
* evicts its BFCache but keeps its prefetch cache, this keeps route trees,
|
|
163
|
+
* static prefetches and full prefetches. It drops navigation responses, and
|
|
164
|
+
* automatic prefetches whose page rendered dynamically or hasn't finished
|
|
165
|
+
* rendering, including those only kept to learn a route: Next.js's automatic
|
|
166
|
+
* prefetches never hold dynamic data.
|
|
167
|
+
*/
|
|
168
|
+
export declare function invalidateDynamicPrefetchCache(): void;
|
|
169
|
+
/**
|
|
170
|
+
* Notify the prefetches that stood in for a visited response (see
|
|
171
|
+
* `hasNavigationFreshVisitedResponse`), as the visited responses are cleared.
|
|
172
|
+
*/
|
|
173
|
+
export declare function invalidateVisitedResponsePrefetches(): void;
|
|
129
174
|
/**
|
|
130
175
|
* Prevent completed navigation responses from becoming authoritative again
|
|
131
176
|
* after restoring a history snapshot. Explicit Link/router prefetches remain
|
|
@@ -133,7 +178,21 @@ export declare function invalidatePrefetchCache(): void;
|
|
|
133
178
|
* responses retain the cache reuse licensed by Next's segment cache.
|
|
134
179
|
*/
|
|
135
180
|
export declare function disableNavigationResponsePrefetchCacheReuse(): void;
|
|
136
|
-
export declare function seedPrefetchResponseSnapshot(rscUrl: string, snapshot: CachedRscResponse, interceptionContext?: string | null, mountedSlotsHeader?: string | null, fallbackTtlMs?: number, reuseAfterHistoryRestore?: boolean): void;
|
|
181
|
+
export declare function seedPrefetchResponseSnapshot(rscUrl: string, snapshot: CachedRscResponse, interceptionContext?: string | null, mountedSlotsHeader?: string | null, fallbackTtlMs?: number, reuseAfterHistoryRestore?: boolean, expiresAt?: number): void;
|
|
182
|
+
/**
|
|
183
|
+
* Fulfill a full prefetch from the visited response of an earlier navigation,
|
|
184
|
+
* as Next.js does from its BFCache, instead of issuing a request. The data is
|
|
185
|
+
* fresh for the static stale time from the navigation, not the dynamic one
|
|
186
|
+
* (`attemptToFulfillDynamicSegmentFromBFCache`).
|
|
187
|
+
*/
|
|
188
|
+
export declare function seedFullPrefetchFromVisitedResponse(rscUrl: string, interceptionContext: string | null, mountedSlotsHeader: string | null, additionalRscUrls?: readonly string[], onInvalidate?: () => void): boolean;
|
|
189
|
+
/**
|
|
190
|
+
* Whether a navigation to the URL would reuse the response of an earlier one,
|
|
191
|
+
* so a prefetch has nothing to fetch. Like Next.js, whose navigation keeps the
|
|
192
|
+
* route and its segments for `staleTimes.dynamic`. `onInvalidate` fires when
|
|
193
|
+
* that reuse ends.
|
|
194
|
+
*/
|
|
195
|
+
export declare function hasNavigationFreshVisitedResponse(rscUrl: string, interceptionContext: string | null, mountedSlotsHeader: string | null, additionalRscUrls?: readonly string[], onInvalidate?: () => void): boolean;
|
|
137
196
|
export declare function deletePrefetchResponseSnapshot(rscUrl: string, snapshot: CachedRscResponse, interceptionContext?: string | null): void;
|
|
138
197
|
/**
|
|
139
198
|
* Store a prefetched RSC response in the cache by snapshotting it to an
|
|
@@ -206,7 +265,7 @@ export declare function fetchRouteTreeGatedPrefetch(options: {
|
|
|
206
265
|
*/
|
|
207
266
|
export declare function prefetchRscResponse(rscUrl: string, fetchPromise: Promise<Response>, interceptionContext?: string | null, mountedSlotsHeader?: string | null, options?: PrefetchOptions, behavior?: {
|
|
208
267
|
cacheForNavigation?: boolean;
|
|
209
|
-
dynamicStaleTime?: "
|
|
268
|
+
dynamicStaleTime?: AppRoutePrefetchPolicy["dynamicStaleTime"];
|
|
210
269
|
fallbackTtlMs?: number;
|
|
211
270
|
optimisticRouteShell?: boolean;
|
|
212
271
|
prefetchKind?: PrefetchCacheKind;
|
|
@@ -251,10 +310,33 @@ type ClientNavigationState = {
|
|
|
251
310
|
originalPushState: typeof window.history.pushState;
|
|
252
311
|
originalReplaceState: typeof window.history.replaceState;
|
|
253
312
|
patchInstalled: boolean;
|
|
313
|
+
routerHistoryWriteDepth: number;
|
|
314
|
+
routerHistoryWrite: RouterHistoryWrite | null;
|
|
254
315
|
hasPendingNavigationUpdate: boolean;
|
|
255
316
|
suppressUrlNotifyCount: number;
|
|
256
317
|
navigationSnapshotActiveCount: number;
|
|
257
318
|
};
|
|
319
|
+
type RouterHistoryWrite = {
|
|
320
|
+
method: "pushState" | "replaceState";
|
|
321
|
+
data: unknown;
|
|
322
|
+
url: string | URL;
|
|
323
|
+
href: string;
|
|
324
|
+
land: RouterHistoryWriteLanding | undefined;
|
|
325
|
+
threw: boolean;
|
|
326
|
+
landed: boolean;
|
|
327
|
+
};
|
|
328
|
+
/**
|
|
329
|
+
* Runs as a router history write lands, after any writes a history wrapper
|
|
330
|
+
* installed after boot made before forwarding it. Returns the data to write
|
|
331
|
+
* (re-stamped when those writes moved the traversal indices) and a commit to
|
|
332
|
+
* run once the write succeeds, before any write the wrapper makes after it. A
|
|
333
|
+
* wrapper installed before boot is the original method called after `land`, so
|
|
334
|
+
* writes it makes through the live methods are not accounted for.
|
|
335
|
+
*/
|
|
336
|
+
export type RouterHistoryWriteLanding = (data: unknown) => {
|
|
337
|
+
data: unknown;
|
|
338
|
+
commit: () => void;
|
|
339
|
+
};
|
|
258
340
|
type CommitClientNavigationStateOptions = {
|
|
259
341
|
releaseSnapshot?: boolean;
|
|
260
342
|
};
|
|
@@ -328,8 +410,8 @@ export declare function useParams<T extends Params = Params>(): T | null;
|
|
|
328
410
|
* must opt in explicitly if they also own an activated render snapshot.
|
|
329
411
|
*/
|
|
330
412
|
export declare function commitClientNavigationState(navId?: number, options?: CommitClientNavigationStateOptions): void;
|
|
331
|
-
export declare function pushHistoryStateWithoutNotify(data: unknown, unused: string, url?: string | URL | null): void;
|
|
332
|
-
export declare function replaceHistoryStateWithoutNotify(data: unknown, unused: string, url?: string | URL | null): void;
|
|
413
|
+
export declare function pushHistoryStateWithoutNotify(data: unknown, unused: string, url?: string | URL | null, land?: RouterHistoryWriteLanding): void;
|
|
414
|
+
export declare function replaceHistoryStateWithoutNotify(data: unknown, unused: string, url?: string | URL | null, land?: RouterHistoryWriteLanding): void;
|
|
333
415
|
/**
|
|
334
416
|
* Save the current scroll position into the current history state.
|
|
335
417
|
* Called before every navigation to enable scroll restoration on back/forward.
|
|
@@ -343,6 +425,11 @@ export declare function applyAppRouterScrollFallback(intent: AppRouterScrollInte
|
|
|
343
425
|
* Navigate to a URL, handling external URLs, hash-only changes, and RSC navigation.
|
|
344
426
|
*/
|
|
345
427
|
export declare function navigateClientSide(href: string, mode: "push" | "replace", scroll: boolean, programmaticTransition?: boolean, visibleCommitMode?: NavigationRuntimeVisibleCommitMode): Promise<void>;
|
|
428
|
+
/**
|
|
429
|
+
* Called by the App Router browser entry for each RSC navigation it runs.
|
|
430
|
+
* Returns a release callback for the navigation's settlement.
|
|
431
|
+
*/
|
|
432
|
+
export declare function trackAppRouterNavigationInFlight(): () => void;
|
|
346
433
|
/**
|
|
347
434
|
* Public App Router instance, exposed for the browser entry so it can wire
|
|
348
435
|
* `window.next.router` to the same singleton returned from `useRouter()`.
|