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/font-utils.js
CHANGED
|
@@ -92,15 +92,17 @@ function formatFontClassRule(className, style) {
|
|
|
92
92
|
].join("; ")}; }\n`;
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
95
|
-
* Determine the
|
|
95
|
+
* Determine the preload `type` for a font file based on its extension.
|
|
96
96
|
* Uses endsWith() only to avoid false positives from substring matches
|
|
97
|
-
* (e.g. ".woff" matching ".woff2").
|
|
97
|
+
* (e.g. ".woff" matching ".woff2"). Matches Next.js, which emits
|
|
98
|
+
* `font/${ext}` for every font preload (including `font/eot`).
|
|
98
99
|
*/
|
|
99
100
|
function getFontMimeType(pathOrUrl) {
|
|
100
101
|
if (pathOrUrl.endsWith(".woff2")) return "font/woff2";
|
|
101
102
|
if (pathOrUrl.endsWith(".woff")) return "font/woff";
|
|
102
103
|
if (pathOrUrl.endsWith(".ttf")) return "font/ttf";
|
|
103
|
-
if (pathOrUrl.endsWith(".otf")) return "font/
|
|
104
|
+
if (pathOrUrl.endsWith(".otf")) return "font/otf";
|
|
105
|
+
if (pathOrUrl.endsWith(".eot")) return "font/eot";
|
|
104
106
|
return "font/woff2";
|
|
105
107
|
}
|
|
106
108
|
//#endregion
|
package/dist/shims/form.js
CHANGED
|
@@ -5,10 +5,10 @@ import "../server/headers.js";
|
|
|
5
5
|
import { assertSafeNavigationUrl } from "./url-safety.js";
|
|
6
6
|
import { APP_RSC_RENDER_MODE_PREFETCH_LOADING_SHELL } from "../server/app-rsc-render-mode.js";
|
|
7
7
|
import { withBasePath } from "./url-utils.js";
|
|
8
|
-
import { AppElementsWire } from "../server/app-elements-wire.js";
|
|
9
|
-
import "../server/app-elements.js";
|
|
10
8
|
import { createRscRequestHeaders, createRscRequestUrl } from "../server/app-rsc-cache-busting.js";
|
|
11
9
|
import { hasAppNavigationRuntime, loadNavigationRuntimeRouteManifest } from "../client/navigation-runtime.js";
|
|
10
|
+
import { AppElementsWire } from "../server/app-elements-wire.js";
|
|
11
|
+
import "../server/app-elements.js";
|
|
12
12
|
import { getMountedSlotsHeader, getPrefetchInterceptionContext, getPrefetchedUrls, hasPrefetchCacheEntryForNavigation, navigateClientSide, prefetchRscResponse } from "./navigation.js";
|
|
13
13
|
import { useMergedRef } from "./use-merged-ref.js";
|
|
14
14
|
import { forwardRef, useActionState, useCallback, useEffect, useRef } from "react";
|
|
@@ -161,7 +161,7 @@ const Form = forwardRef(function Form(props, ref) {
|
|
|
161
161
|
const cacheKey = AppElementsWire.encodeCacheKey(rscUrl, interceptionContext);
|
|
162
162
|
const prefetched = getPrefetchedUrls();
|
|
163
163
|
if (prefetched.has(cacheKey)) return;
|
|
164
|
-
if (hasPrefetchCacheEntryForNavigation(rscUrl, interceptionContext, mountedSlotsHeader)) return;
|
|
164
|
+
if (hasPrefetchCacheEntryForNavigation(rscUrl, interceptionContext, mountedSlotsHeader, { reusePending: false })) return;
|
|
165
165
|
prefetched.add(cacheKey);
|
|
166
166
|
const fetchPromise = fetch(rscUrl, {
|
|
167
167
|
headers,
|
package/dist/shims/headers.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { RenderRequestApiKind } from "../server/cache-proof.js";
|
|
2
|
-
import { CacheLifeConfig } from "./cache-request-state.js";
|
|
3
2
|
import { ConnectionProbeResult, HeadersAccessPhase, RenderDynamicLatch, VinextHeadersShimState, createRenderDynamicLatch, getHeadersAccessPhase, isInsideAnyCacheScope, isRenderDynamicLatched, markDynamicUsage, markRenderRequestApiUsage, onRenderDynamicLatched, throwIfInsideCacheScope, throwIfStaticGenerationAccessError } from "./internal/headers-state.js";
|
|
4
3
|
import { ReadonlyRequestCookies } from "@vinext/types/next/upstream/dist/server/web/spec-extension/adapters/request-cookies";
|
|
5
4
|
import { ResponseCookie } from "@vinext/types/next/upstream/dist/compiled/@edge-runtime/cookies/index";
|
|
@@ -19,27 +18,11 @@ type HeadersContextFromRequestOptions = {
|
|
|
19
18
|
draftModeSecret?: string;
|
|
20
19
|
};
|
|
21
20
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
export declare function runWithIsolatedDynamicUsage<T>(fn: () => T | Promise<T>): Promise<{
|
|
28
|
-
result: T;
|
|
29
|
-
dynamicDetected: boolean;
|
|
30
|
-
}>;
|
|
31
|
-
/**
|
|
32
|
-
* Run a pre-render probe without letting its dynamic API usage classify the
|
|
33
|
-
* request. Next.js has no probe: only the render decides whether a page is
|
|
34
|
-
* dynamic, and the render runs the probed layouts and page again. Returns the
|
|
35
|
-
* probe's own usage and cacheLife for a caller whose probe response replaces
|
|
36
|
-
* the render.
|
|
37
|
-
*/
|
|
38
|
-
export declare function runWithDetachedDynamicUsage<T>(fn: () => T | Promise<T>): Promise<{
|
|
39
|
-
result: T;
|
|
40
|
-
dynamicDetected: boolean;
|
|
41
|
-
cacheLife: CacheLifeConfig | null;
|
|
42
|
-
}>;
|
|
21
|
+
* Run a layout probe without letting its dynamic API usage, fetch tags or
|
|
22
|
+
* cacheLife reach the request. Next.js has no probe: only the render decides
|
|
23
|
+
* whether a page is dynamic and how long it is cached.
|
|
24
|
+
*/
|
|
25
|
+
export declare function runWithDetachedDynamicUsage<T>(fn: () => T | Promise<T>): Promise<T>;
|
|
43
26
|
export declare function runWithConnectionProbe<T>(fn: () => T | Promise<T>): Promise<ConnectionProbeResult<T>>;
|
|
44
27
|
export declare function suspendConnectionProbe(): Promise<never> | null;
|
|
45
28
|
export declare function peekRenderRequestApiUsage(): RenderRequestApiKind[];
|
|
@@ -214,7 +197,9 @@ declare class RequestCookies {
|
|
|
214
197
|
private _cookies;
|
|
215
198
|
private _responseCookies;
|
|
216
199
|
constructor(cookies: Map<string, string>, mutable?: boolean);
|
|
217
|
-
get(
|
|
200
|
+
get(nameOrOptions: string | {
|
|
201
|
+
name: string;
|
|
202
|
+
}): ResponseCookie | undefined;
|
|
218
203
|
getAll(nameOrOptions?: string | {
|
|
219
204
|
name: string;
|
|
220
205
|
}): ResponseCookie[];
|
package/dist/shims/headers.js
CHANGED
|
@@ -84,78 +84,27 @@ function mergeMiddlewareSetCookies(ctx, rawHeader) {
|
|
|
84
84
|
return merged;
|
|
85
85
|
}
|
|
86
86
|
/**
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* to the final cache policy.
|
|
91
|
-
*/
|
|
92
|
-
async function runWithIsolatedDynamicUsage(fn) {
|
|
93
|
-
const runInChildState = async (childState) => {
|
|
94
|
-
return {
|
|
95
|
-
result: await fn(),
|
|
96
|
-
dynamicDetected: childState.dynamicUsageDetected
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
if (isInsideUnifiedScope()) {
|
|
100
|
-
let childState = null;
|
|
101
|
-
return await runWithUnifiedStateMutation((context) => {
|
|
102
|
-
context.dynamicUsageDetected = false;
|
|
103
|
-
childState = context;
|
|
104
|
-
}, () => {
|
|
105
|
-
if (!childState) throw new Error("Dynamic usage scope was not initialized");
|
|
106
|
-
return runInChildState(childState);
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
const parentState = getHeadersShimState();
|
|
110
|
-
const childState = {
|
|
111
|
-
...parentState,
|
|
112
|
-
renderDynamicLatch: ensureRenderDynamicLatch(parentState),
|
|
113
|
-
dynamicUsageDetected: false
|
|
114
|
-
};
|
|
115
|
-
return await headersShimAls.run(childState, () => runInChildState(childState));
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Run a pre-render probe without letting its dynamic API usage classify the
|
|
119
|
-
* request. Next.js has no probe: only the render decides whether a page is
|
|
120
|
-
* dynamic, and the render runs the probed layouts and page again. Returns the
|
|
121
|
-
* probe's own usage and cacheLife for a caller whose probe response replaces
|
|
122
|
-
* the render.
|
|
87
|
+
* Run a layout probe without letting its dynamic API usage, fetch tags or
|
|
88
|
+
* cacheLife reach the request. Next.js has no probe: only the render decides
|
|
89
|
+
* whether a page is dynamic and how long it is cached.
|
|
123
90
|
*/
|
|
124
91
|
async function runWithDetachedDynamicUsage(fn) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
const cacheLifeSink = { cacheLife: null };
|
|
135
|
-
return await runWithUnifiedStateMutation((context) => {
|
|
136
|
-
context.cacheLifeSink = cacheLifeSink;
|
|
137
|
-
context.dynamicUsageDetected = false;
|
|
138
|
-
context.renderDynamicLatch = createRenderDynamicLatch();
|
|
139
|
-
context.renderRequestApiUsage = /* @__PURE__ */ new Set();
|
|
140
|
-
context.requestCache = /* @__PURE__ */ new WeakMap();
|
|
141
|
-
context.cacheableFetchUrls = /* @__PURE__ */ new Set();
|
|
142
|
-
context.currentRequestTags = [];
|
|
143
|
-
context.dynamicFetchUrls = /* @__PURE__ */ new Set();
|
|
144
|
-
context.requestScopedCacheLife = null;
|
|
145
|
-
context.unstableCacheObservations = /* @__PURE__ */ new Map();
|
|
146
|
-
childState = context;
|
|
147
|
-
}, () => {
|
|
148
|
-
if (!childState) throw new Error("Dynamic usage scope was not initialized");
|
|
149
|
-
return runInChildState(childState, cacheLifeSink);
|
|
150
|
-
});
|
|
151
|
-
}
|
|
92
|
+
if (isInsideUnifiedScope()) return await runWithUnifiedStateMutation((context) => {
|
|
93
|
+
context.dynamicUsageDetected = false;
|
|
94
|
+
context.renderDynamicLatch = createRenderDynamicLatch();
|
|
95
|
+
context.renderRequestApiUsage = /* @__PURE__ */ new Set();
|
|
96
|
+
context.requestCache = /* @__PURE__ */ new WeakMap();
|
|
97
|
+
context.currentRequestTags = [];
|
|
98
|
+
context.dynamicFetchUrls = /* @__PURE__ */ new Set();
|
|
99
|
+
context.requestScopedCacheLife = null;
|
|
100
|
+
}, fn);
|
|
152
101
|
const childState = {
|
|
153
102
|
...getHeadersShimState(),
|
|
154
103
|
dynamicUsageDetected: false,
|
|
155
104
|
renderDynamicLatch: createRenderDynamicLatch(),
|
|
156
105
|
renderRequestApiUsage: /* @__PURE__ */ new Set()
|
|
157
106
|
};
|
|
158
|
-
return await headersShimAls.run(childState,
|
|
107
|
+
return await headersShimAls.run(childState, fn);
|
|
159
108
|
}
|
|
160
109
|
async function runWithConnectionProbe(fn) {
|
|
161
110
|
const parentState = getHeadersShimState();
|
|
@@ -513,7 +462,7 @@ function _wrapMutableCookies(cookies) {
|
|
|
513
462
|
}
|
|
514
463
|
function _sealCookies(cookies) {
|
|
515
464
|
return new Proxy(cookies, { get(target, prop) {
|
|
516
|
-
if (prop === "set" || prop === "delete")
|
|
465
|
+
if (prop === "set" || prop === "delete" || prop === "clear") return ReadonlyRequestCookiesError.callable;
|
|
517
466
|
const value = Reflect.get(target, prop, target);
|
|
518
467
|
return typeof value === "function" ? value.bind(target) : value;
|
|
519
468
|
} });
|
|
@@ -761,7 +710,8 @@ var RequestCookies = class {
|
|
|
761
710
|
value
|
|
762
711
|
})])) : null;
|
|
763
712
|
}
|
|
764
|
-
get(
|
|
713
|
+
get(nameOrOptions) {
|
|
714
|
+
const name = typeof nameOrOptions === "string" ? nameOrOptions : nameOrOptions.name;
|
|
765
715
|
if (this._responseCookies) return this._responseCookies.get(name);
|
|
766
716
|
const value = this._cookies.get(name);
|
|
767
717
|
if (value === void 0) return void 0;
|
|
@@ -877,4 +827,4 @@ function serializeMutableCookie(cookie) {
|
|
|
877
827
|
});
|
|
878
828
|
}
|
|
879
829
|
//#endregion
|
|
880
|
-
export { applyEffectiveRequestCookieHeader, applyMiddlewareRequestHeaders, consumeDynamicUsage, consumeInvalidDynamicUsageError, consumeRenderRequestApiUsage, cookies, createRenderDynamicLatch, draftMode, getActiveDraftModeState, getAndClearPendingCookies, getDraftModeCookieHeader, getEffectiveRequestCookieHeader, getHeadersAccessPhase, getHeadersContext, hasDraftModeCookieHeader, hasEffectiveRequestCookieChanges, headers, headersContextFromRequest, isDraftModeEnabled, isDraftModeRequest, isInsideAnyCacheScope, isRenderDynamicLatched, markDynamicUsage, markRenderRequestApiUsage, onRenderDynamicLatched, peekDynamicUsage, peekRenderRequestApiUsage, replaceHeadersContext, restoreDraftModeTransition, runWithConnectionProbe, runWithDetachedDynamicUsage, runWithHeadersContext,
|
|
830
|
+
export { applyEffectiveRequestCookieHeader, applyMiddlewareRequestHeaders, consumeDynamicUsage, consumeInvalidDynamicUsageError, consumeRenderRequestApiUsage, cookies, createRenderDynamicLatch, draftMode, getActiveDraftModeState, getAndClearPendingCookies, getDraftModeCookieHeader, getEffectiveRequestCookieHeader, getHeadersAccessPhase, getHeadersContext, hasDraftModeCookieHeader, hasEffectiveRequestCookieChanges, headers, headersContextFromRequest, isDraftModeEnabled, isDraftModeRequest, isInsideAnyCacheScope, isRenderDynamicLatched, markDynamicUsage, markRenderRequestApiUsage, onRenderDynamicLatched, peekDynamicUsage, peekRenderRequestApiUsage, replaceHeadersContext, restoreDraftModeTransition, runWithConnectionProbe, runWithDetachedDynamicUsage, runWithHeadersContext, setHeadersAccessPhase, setHeadersContext, suspendConnectionProbe, throwIfInsideCacheScope, throwIfStaticGenerationAccessError };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
//#region src/shims/http-access-error-fallback.tsx
|
|
3
|
+
/**
|
|
4
|
+
* Ported from Next.js's built-in HTTP access fallback UI:
|
|
5
|
+
* https://github.com/vercel/next.js/blob/canary/packages/next/src/client/components/http-access-fallback/error-fallback.tsx
|
|
6
|
+
* https://github.com/vercel/next.js/blob/canary/packages/next/src/client/components/styles/access-error-styles.ts
|
|
7
|
+
*
|
|
8
|
+
* Shared by the built-in not-found, forbidden and unauthorized pages: a
|
|
9
|
+
* centered status / message pair with minified theme CSS and dark-mode media
|
|
10
|
+
* query. Kept in sync with the upstream component's structure so HTML
|
|
11
|
+
* snapshot diffs between Next.js and vinext stay minimal.
|
|
12
|
+
*/
|
|
13
|
+
const styles = {
|
|
14
|
+
error: {
|
|
15
|
+
fontFamily: "system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"",
|
|
16
|
+
height: "100vh",
|
|
17
|
+
textAlign: "center",
|
|
18
|
+
display: "flex",
|
|
19
|
+
flexDirection: "column",
|
|
20
|
+
alignItems: "center",
|
|
21
|
+
justifyContent: "center"
|
|
22
|
+
},
|
|
23
|
+
desc: { display: "inline-block" },
|
|
24
|
+
h1: {
|
|
25
|
+
display: "inline-block",
|
|
26
|
+
margin: "0 20px 0 0",
|
|
27
|
+
padding: "0 23px 0 0",
|
|
28
|
+
fontSize: 24,
|
|
29
|
+
fontWeight: 500,
|
|
30
|
+
verticalAlign: "top",
|
|
31
|
+
lineHeight: "49px"
|
|
32
|
+
},
|
|
33
|
+
h2: {
|
|
34
|
+
fontSize: 14,
|
|
35
|
+
fontWeight: 400,
|
|
36
|
+
lineHeight: "49px",
|
|
37
|
+
margin: 0
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
function HTTPAccessErrorFallback({ status, message }) {
|
|
41
|
+
return React.createElement(React.Fragment, null, React.createElement("title", null, `${status}: ${message}`), React.createElement("div", { style: styles.error }, React.createElement("div", null, React.createElement("style", { dangerouslySetInnerHTML: { __html: "body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}" } }), React.createElement("h1", {
|
|
42
|
+
className: "next-error-h1",
|
|
43
|
+
style: styles.h1
|
|
44
|
+
}, status), React.createElement("div", { style: styles.desc }, React.createElement("h2", { style: styles.h2 }, message)))));
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { HTTPAccessErrorFallback };
|
package/dist/shims/image.d.ts
CHANGED
|
@@ -4,27 +4,6 @@ import { ImageLoader, ImageProps as ImageProps$1, StaticImageData, StaticRequire
|
|
|
4
4
|
//#region src/shims/image.d.ts
|
|
5
5
|
export type ImageLoaderProps = Parameters<ImageLoader>[0];
|
|
6
6
|
export type ImageProps = ImageProps$1;
|
|
7
|
-
declare const Image: React.ForwardRefExoticComponent<
|
|
8
|
-
src: string | import("@vinext/types/next/upstream/dist/shared/lib/get-img-props").StaticImport;
|
|
9
|
-
alt: string;
|
|
10
|
-
width?: number | `${number}`;
|
|
11
|
-
height?: number | `${number}`;
|
|
12
|
-
fill?: boolean;
|
|
13
|
-
loader?: ImageLoader;
|
|
14
|
-
quality?: number | `${number}`;
|
|
15
|
-
preload?: boolean;
|
|
16
|
-
priority?: boolean;
|
|
17
|
-
loading?: "eager" | "lazy" | undefined;
|
|
18
|
-
placeholder?: import("@vinext/types/next/upstream/dist/shared/lib/get-img-props").PlaceholderValue;
|
|
19
|
-
blurDataURL?: string;
|
|
20
|
-
unoptimized?: boolean;
|
|
21
|
-
overrideSrc?: string;
|
|
22
|
-
onLoadingComplete?: import("@vinext/types/next/upstream/dist/shared/lib/get-img-props").OnLoadingComplete;
|
|
23
|
-
layout?: string;
|
|
24
|
-
objectFit?: string;
|
|
25
|
-
objectPosition?: string;
|
|
26
|
-
lazyBoundary?: string;
|
|
27
|
-
lazyRoot?: string;
|
|
28
|
-
} & React.RefAttributes<HTMLImageElement>>;
|
|
7
|
+
declare const Image: React.ForwardRefExoticComponent<ImageProps & React.RefAttributes<HTMLImageElement>>;
|
|
29
8
|
//#endregion
|
|
30
9
|
export { type ImageLoader, type StaticImageData, type StaticRequire, Image as default, getImageProps, imageOptimizationUrl };
|
|
@@ -4,8 +4,14 @@ export declare function releaseAppPrefetchFetchSlot(response: Response): void;
|
|
|
4
4
|
* Low-priority App Router prefetches share a small request queue. The consumer
|
|
5
5
|
* must either snapshot the returned Response with snapshotRscResponse() or call
|
|
6
6
|
* releaseAppPrefetchFetchSlot() when it drops the response without consuming it.
|
|
7
|
+
*
|
|
8
|
+
* `isWanted` is checked when a queued request reaches a free slot. Returning
|
|
9
|
+
* false drops it without fetching, like a cancelled Next.js prefetch task. A
|
|
10
|
+
* navigation that promotes the request skips the check.
|
|
7
11
|
*/
|
|
8
|
-
export declare function scheduleAppPrefetchFetch(fetcher: (signal: AbortSignal) => Promise<Response>, priority: "low" | "high"): Promise<Response>;
|
|
12
|
+
export declare function scheduleAppPrefetchFetch(fetcher: (signal: AbortSignal) => Promise<Response>, priority: "low" | "high", isWanted?: () => boolean): Promise<Response>;
|
|
13
|
+
/** Cancel a prefetch request that is still waiting for a slot; never aborts one in flight. */
|
|
14
|
+
export declare function cancelQueuedAppPrefetchFetch(promise: Promise<Response>): void;
|
|
9
15
|
/** Cancel a queued or in-flight prefetch request. No-op once it has settled. */
|
|
10
16
|
export declare function cancelAppPrefetchFetch(promise: Promise<Response> | undefined): void;
|
|
11
17
|
/**
|
|
@@ -19,6 +25,20 @@ export declare function cancelAppPrefetchFetch(promise: Promise<Response> | unde
|
|
|
19
25
|
* cap instead of waiting for a slot.
|
|
20
26
|
*
|
|
21
27
|
* No-op when the request has already started or was never queued.
|
|
28
|
+
*
|
|
29
|
+
* Also records a claim, live while `isCurrent` returns true, until the returned
|
|
30
|
+
* function releases it; see `isAppPrefetchFetchClaimed`.
|
|
31
|
+
*/
|
|
32
|
+
export declare function promoteAppPrefetchFetch(promise: Promise<Response> | undefined, isCurrent?: () => boolean): () => void;
|
|
33
|
+
/**
|
|
34
|
+
* Whether a current navigation is waiting on this prefetch. A staged prefetch
|
|
35
|
+
* (route tree, then payload) hands navigation a promise that wraps its queued
|
|
36
|
+
* requests, so promotion cannot reach them; they check this instead before
|
|
37
|
+
* dropping themselves.
|
|
38
|
+
*
|
|
39
|
+
* `claimedBy` limits this to claims made up to that `getAppPrefetchFetchClaimSequence()`.
|
|
22
40
|
*/
|
|
23
|
-
export declare function
|
|
41
|
+
export declare function isAppPrefetchFetchClaimed(promise: Promise<Response> | undefined, claimedBy?: number): boolean;
|
|
42
|
+
/** The sequence number of the latest claim on any prefetch. */
|
|
43
|
+
export declare function getAppPrefetchFetchClaimSequence(): number;
|
|
24
44
|
//#endregion
|
|
@@ -5,6 +5,12 @@ const MAX_DEFAULT_APP_PREFETCH_REQUESTS = 4;
|
|
|
5
5
|
const defaultAppPrefetchQueue = [];
|
|
6
6
|
/** Lets a consumer promote or cancel the request behind a promise it already holds. */
|
|
7
7
|
const appPrefetchFetchControls = /* @__PURE__ */ new WeakMap();
|
|
8
|
+
/**
|
|
9
|
+
* Navigations waiting on a promise, each live while it is current, with the
|
|
10
|
+
* sequence number it was claimed at.
|
|
11
|
+
*/
|
|
12
|
+
const appPrefetchFetchClaims = /* @__PURE__ */ new WeakMap();
|
|
13
|
+
let appPrefetchFetchClaimSequence = 0;
|
|
8
14
|
let activeDefaultAppPrefetchRequests = 0;
|
|
9
15
|
let defaultAppPrefetchDrainScheduled = false;
|
|
10
16
|
function drainDefaultAppPrefetchQueue() {
|
|
@@ -31,8 +37,12 @@ function releaseAppPrefetchFetchSlot(response) {
|
|
|
31
37
|
* Low-priority App Router prefetches share a small request queue. The consumer
|
|
32
38
|
* must either snapshot the returned Response with snapshotRscResponse() or call
|
|
33
39
|
* releaseAppPrefetchFetchSlot() when it drops the response without consuming it.
|
|
40
|
+
*
|
|
41
|
+
* `isWanted` is checked when a queued request reaches a free slot. Returning
|
|
42
|
+
* false drops it without fetching, like a cancelled Next.js prefetch task. A
|
|
43
|
+
* navigation that promotes the request skips the check.
|
|
34
44
|
*/
|
|
35
|
-
function scheduleAppPrefetchFetch(fetcher, priority) {
|
|
45
|
+
function scheduleAppPrefetchFetch(fetcher, priority, isWanted) {
|
|
36
46
|
const controller = new AbortController();
|
|
37
47
|
if (priority === "high") {
|
|
38
48
|
const promise = fetcher(controller.signal);
|
|
@@ -47,7 +57,13 @@ function scheduleAppPrefetchFetch(fetcher, priority) {
|
|
|
47
57
|
let started = false;
|
|
48
58
|
const promise = new Promise((resolve, reject) => {
|
|
49
59
|
rejectPromise = reject;
|
|
50
|
-
runner = () => {
|
|
60
|
+
runner = (promoted = false) => {
|
|
61
|
+
if (!promoted && isWanted?.() === false) {
|
|
62
|
+
appPrefetchFetchControls.delete(promise);
|
|
63
|
+
activeDefaultAppPrefetchRequests -= 1;
|
|
64
|
+
reject(new DOMException("Prefetch is no longer wanted", "AbortError"));
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
51
67
|
started = true;
|
|
52
68
|
let didRelease = false;
|
|
53
69
|
const release = () => {
|
|
@@ -73,25 +89,31 @@ function scheduleAppPrefetchFetch(fetcher, priority) {
|
|
|
73
89
|
}
|
|
74
90
|
};
|
|
75
91
|
});
|
|
92
|
+
const cancelQueued = () => {
|
|
93
|
+
if (started) return;
|
|
94
|
+
const index = defaultAppPrefetchQueue.indexOf(runner);
|
|
95
|
+
if (index === -1) return;
|
|
96
|
+
defaultAppPrefetchQueue.splice(index, 1);
|
|
97
|
+
appPrefetchFetchControls.delete(promise);
|
|
98
|
+
controller.abort();
|
|
99
|
+
rejectPromise(controller.signal.reason);
|
|
100
|
+
};
|
|
76
101
|
defaultAppPrefetchQueue.push(runner);
|
|
77
102
|
appPrefetchFetchControls.set(promise, {
|
|
78
103
|
runner,
|
|
104
|
+
cancelQueued,
|
|
79
105
|
cancel: () => {
|
|
80
|
-
if (started)
|
|
81
|
-
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
const index = defaultAppPrefetchQueue.indexOf(runner);
|
|
85
|
-
if (index === -1) return;
|
|
86
|
-
defaultAppPrefetchQueue.splice(index, 1);
|
|
87
|
-
appPrefetchFetchControls.delete(promise);
|
|
88
|
-
controller.abort();
|
|
89
|
-
rejectPromise(controller.signal.reason);
|
|
106
|
+
if (started) controller.abort();
|
|
107
|
+
else cancelQueued();
|
|
90
108
|
}
|
|
91
109
|
});
|
|
92
110
|
scheduleDefaultAppPrefetchDrain();
|
|
93
111
|
return promise;
|
|
94
112
|
}
|
|
113
|
+
/** Cancel a prefetch request that is still waiting for a slot; never aborts one in flight. */
|
|
114
|
+
function cancelQueuedAppPrefetchFetch(promise) {
|
|
115
|
+
appPrefetchFetchControls.get(promise)?.cancelQueued?.();
|
|
116
|
+
}
|
|
95
117
|
/** Cancel a queued or in-flight prefetch request. No-op once it has settled. */
|
|
96
118
|
function cancelAppPrefetchFetch(promise) {
|
|
97
119
|
if (promise === void 0) return;
|
|
@@ -108,16 +130,47 @@ function cancelAppPrefetchFetch(promise) {
|
|
|
108
130
|
* cap instead of waiting for a slot.
|
|
109
131
|
*
|
|
110
132
|
* No-op when the request has already started or was never queued.
|
|
133
|
+
*
|
|
134
|
+
* Also records a claim, live while `isCurrent` returns true, until the returned
|
|
135
|
+
* function releases it; see `isAppPrefetchFetchClaimed`.
|
|
111
136
|
*/
|
|
112
|
-
function promoteAppPrefetchFetch(promise) {
|
|
113
|
-
if (promise === void 0) return;
|
|
137
|
+
function promoteAppPrefetchFetch(promise, isCurrent = () => true) {
|
|
138
|
+
if (promise === void 0) return () => {};
|
|
139
|
+
let claims = appPrefetchFetchClaims.get(promise);
|
|
140
|
+
if (claims === void 0) {
|
|
141
|
+
claims = /* @__PURE__ */ new Map();
|
|
142
|
+
appPrefetchFetchClaims.set(promise, claims);
|
|
143
|
+
}
|
|
144
|
+
claims.set(isCurrent, ++appPrefetchFetchClaimSequence);
|
|
145
|
+
const release = () => {
|
|
146
|
+
claims.delete(isCurrent);
|
|
147
|
+
};
|
|
114
148
|
const runner = appPrefetchFetchControls.get(promise)?.runner;
|
|
115
|
-
if (runner === void 0) return;
|
|
149
|
+
if (runner === void 0) return release;
|
|
116
150
|
const index = defaultAppPrefetchQueue.indexOf(runner);
|
|
117
|
-
if (index === -1) return;
|
|
151
|
+
if (index === -1) return release;
|
|
118
152
|
defaultAppPrefetchQueue.splice(index, 1);
|
|
119
153
|
activeDefaultAppPrefetchRequests += 1;
|
|
120
|
-
runner();
|
|
154
|
+
runner(true);
|
|
155
|
+
return release;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Whether a current navigation is waiting on this prefetch. A staged prefetch
|
|
159
|
+
* (route tree, then payload) hands navigation a promise that wraps its queued
|
|
160
|
+
* requests, so promotion cannot reach them; they check this instead before
|
|
161
|
+
* dropping themselves.
|
|
162
|
+
*
|
|
163
|
+
* `claimedBy` limits this to claims made up to that `getAppPrefetchFetchClaimSequence()`.
|
|
164
|
+
*/
|
|
165
|
+
function isAppPrefetchFetchClaimed(promise, claimedBy = Infinity) {
|
|
166
|
+
const claims = promise && appPrefetchFetchClaims.get(promise);
|
|
167
|
+
if (!claims) return false;
|
|
168
|
+
for (const [isCurrent, sequence] of claims) if (sequence <= claimedBy && isCurrent()) return true;
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
171
|
+
/** The sequence number of the latest claim on any prefetch. */
|
|
172
|
+
function getAppPrefetchFetchClaimSequence() {
|
|
173
|
+
return appPrefetchFetchClaimSequence;
|
|
121
174
|
}
|
|
122
175
|
//#endregion
|
|
123
|
-
export { cancelAppPrefetchFetch, promoteAppPrefetchFetch, releaseAppPrefetchFetchSlot, scheduleAppPrefetchFetch };
|
|
176
|
+
export { cancelAppPrefetchFetch, cancelQueuedAppPrefetchFetch, getAppPrefetchFetchClaimSequence, isAppPrefetchFetchClaimed, promoteAppPrefetchFetch, releaseAppPrefetchFetchSlot, scheduleAppPrefetchFetch };
|
|
@@ -16,16 +16,27 @@ export type AppRoutePrefetchPolicy = {
|
|
|
16
16
|
* How the dynamic stale-time signal affects this prefetch. Navigation data
|
|
17
17
|
* takes it verbatim, explicit full prefetches fall back to the static window
|
|
18
18
|
* only when it is zero, and loading shells ignore it because their contents
|
|
19
|
-
* are static.
|
|
19
|
+
* are static. "learning-only" keeps a dynamic render out of navigation reuse
|
|
20
|
+
* and holds it for the static window instead.
|
|
20
21
|
*/
|
|
21
|
-
dynamicStaleTime: "verbatim" | "full-prefetch" | "ignore";
|
|
22
|
+
dynamicStaleTime: "verbatim" | "full-prefetch" | "ignore" | "learning-only";
|
|
22
23
|
fallbackTtl: "dynamic" | "static";
|
|
23
24
|
prefetchShellFirst: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* The route renders dynamically (`rendersDynamically`), so the prefetch
|
|
27
|
+
* never renders its page: an href with search params fetches the loading
|
|
28
|
+
* shell instead of the page with empty search params.
|
|
29
|
+
*/
|
|
30
|
+
rendersDynamically?: true;
|
|
24
31
|
/** Fetch the route tree before the concrete page segment. */
|
|
25
32
|
requiresRouteTreePrefetch?: true;
|
|
26
33
|
shouldPrefetch: boolean;
|
|
27
34
|
};
|
|
28
35
|
export declare function canAutoPrefetchFullAppRoute(href: string): boolean;
|
|
29
|
-
|
|
36
|
+
/**
|
|
37
|
+
* `interceptionContext` is the prefetch's interception context
|
|
38
|
+
* (`getPrefetchInterceptionContext`).
|
|
39
|
+
*/
|
|
40
|
+
export declare function resolveAutoAppRoutePrefetch(href: string, interceptionContext?: string | null): AppRoutePrefetchPolicy;
|
|
30
41
|
export declare function resolveFullAppRoutePrefetch(): AppRoutePrefetchPolicy;
|
|
31
42
|
//#endregion
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { stripBasePath } from "../../utils/base-path.js";
|
|
2
|
-
import {
|
|
2
|
+
import { splitPathSegments } from "../../routing/utils.js";
|
|
3
|
+
import { createRouteTrieCache, matchRouteWithTrie, matchRouteWithTrieRawPathname } from "../../routing/route-matching.js";
|
|
4
|
+
import { matchRoutePatternPrefix, matchRoutePatternRaw } from "../../routing/route-pattern.js";
|
|
3
5
|
//#region src/shims/internal/app-route-prefetch-policy.ts
|
|
4
6
|
/** basePath from next.config.js, injected by the plugin at build time */
|
|
5
7
|
const __basePath = process.env.__NEXT_ROUTER_BASEPATH ?? "";
|
|
@@ -27,7 +29,28 @@ const NO_APP_ROUTE_PREFETCH = {
|
|
|
27
29
|
function canAutoPrefetchFullAppRoute(href) {
|
|
28
30
|
return resolveAutoAppRoutePrefetch(href).cacheForNavigation;
|
|
29
31
|
}
|
|
30
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Whether the page the href renders is dynamic. Under an interception context
|
|
34
|
+
* that one of the route's intercepting pages matches, that page renders
|
|
35
|
+
* instead, and Next.js classifies it as its own route. When several match,
|
|
36
|
+
* any dynamic one counts. The intercepted response also renders the route the
|
|
37
|
+
* context resolves to, which can be a dynamic descendant of the intercept's
|
|
38
|
+
* source, so that route counts too.
|
|
39
|
+
*/
|
|
40
|
+
function resolveRendersDynamically(routes, route, interceptionContext, pathname) {
|
|
41
|
+
if (interceptionContext !== null && route.intercepts) {
|
|
42
|
+
const pathParts = splitPathSegments(pathname);
|
|
43
|
+
const contextParts = splitPathSegments(interceptionContext);
|
|
44
|
+
const matching = route.intercepts.filter((intercept) => matchRoutePatternRaw(pathParts, intercept.targetPatternParts) !== null && matchRoutePatternPrefix(contextParts, intercept.sourcePatternParts));
|
|
45
|
+
if (matching.length > 0) return matching.some((intercept) => intercept.rendersDynamically === true) || matchRouteWithTrieRawPathname(interceptionContext, routes, linkPrefetchRouteTrieCache)?.route.rendersDynamically === true;
|
|
46
|
+
}
|
|
47
|
+
return route.rendersDynamically === true;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* `interceptionContext` is the prefetch's interception context
|
|
51
|
+
* (`getPrefetchInterceptionContext`).
|
|
52
|
+
*/
|
|
53
|
+
function resolveAutoAppRoutePrefetch(href, interceptionContext = null) {
|
|
31
54
|
if (typeof window === "undefined") return NO_APP_ROUTE_PREFETCH;
|
|
32
55
|
const routes = window.__VINEXT_LINK_PREFETCH_ROUTES__;
|
|
33
56
|
if (!routes) return NO_APP_ROUTE_PREFETCH;
|
|
@@ -42,12 +65,14 @@ function resolveAutoAppRoutePrefetch(href) {
|
|
|
42
65
|
const hasSearchParams = routeUrl.search !== "";
|
|
43
66
|
const isFullyDynamicRootRoute = route.patternParts.length === 1 && route.patternParts[0]?.startsWith(":");
|
|
44
67
|
const hasCacheComponentsLearningOnlyDynamicPath = route.isDynamic && String(process.env.__NEXT_CACHE_COMPONENTS) === "true" && (ENCODED_PATH_DELIMITER_RE.test(routeUrl.pathname) || isFullyDynamicRootRoute && !requiresRouteTreePrefetch);
|
|
45
|
-
const
|
|
68
|
+
const rendersDynamically = resolveRendersDynamically(routes, route, interceptionContext, routeUrl.pathname);
|
|
69
|
+
const cacheForNavigation = !hasSearchParams && !hasCacheComponentsLearningOnlyDynamicPath && (requiresRouteTreePrefetch || !route.canPrefetchLoadingShell && route.requiresDynamicNavigationRequest !== true && !rendersDynamically);
|
|
46
70
|
return {
|
|
47
71
|
cacheForNavigation,
|
|
48
|
-
dynamicStaleTime: cacheForNavigation ? "verbatim" : "
|
|
72
|
+
dynamicStaleTime: !cacheForNavigation ? "ignore" : String(process.env.__NEXT_CACHE_COMPONENTS) === "true" ? "verbatim" : "learning-only",
|
|
49
73
|
fallbackTtl: "static",
|
|
50
74
|
prefetchShellFirst: requiresRouteTreePrefetch || hasSearchParams || !route.isDynamic,
|
|
75
|
+
...rendersDynamically ? { rendersDynamically: true } : {},
|
|
51
76
|
...requiresRouteTreePrefetch ? { requiresRouteTreePrefetch: true } : {},
|
|
52
77
|
shouldPrefetch: true
|
|
53
78
|
};
|
|
@@ -13,4 +13,5 @@ export declare function _registerCacheContextAccessor(fn: () => CacheContextLike
|
|
|
13
13
|
export declare function getRegisteredCacheContext(): CacheContextLike | null;
|
|
14
14
|
/** Record a root-param dependency on the active public `"use cache"` scope. */
|
|
15
15
|
export declare function _recordUseCacheRootParamRead(name: string): void;
|
|
16
|
-
//#endregion
|
|
16
|
+
//#endregion
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/shims/internal/client-reference-loader.d.ts
|
|
2
|
+
type ClientReferenceExports = Record<string, unknown>;
|
|
3
|
+
export declare function registerClientReference(key: string, exports: ClientReferenceExports): void;
|
|
4
|
+
/** What @vitejs/plugin-rsc/browser calls as `clientReferences.default[key]()`. */
|
|
5
|
+
export declare const clientReferences: Record<string, () => Promise<ClientReferenceExports>>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export {};
|