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
|
@@ -3,7 +3,8 @@ import { detectDomainLocale, getLocalePathPrefix } from "../utils/domain-locale.
|
|
|
3
3
|
//#region src/shims/client-locale.ts
|
|
4
4
|
function getCurrentBrowserLocale({ basePath, domainLocales, hostname }) {
|
|
5
5
|
if (typeof window === "undefined") return void 0;
|
|
6
|
-
const
|
|
6
|
+
const locales = window.__VINEXT_LOCALES__;
|
|
7
|
+
const pathnameLocale = locales?.length ? getLocalePathPrefix(stripBasePath(window.location.pathname, basePath), locales) : void 0;
|
|
7
8
|
if (pathnameLocale) return pathnameLocale;
|
|
8
9
|
return detectDomainLocale(domainLocales, hostname ?? void 0)?.defaultLocale ?? window.__VINEXT_LOCALE__ ?? window.__VINEXT_DEFAULT_LOCALE__;
|
|
9
10
|
}
|
|
@@ -21,4 +21,5 @@ export type ClientPageRootProps = {
|
|
|
21
21
|
*/
|
|
22
22
|
export declare function createClientPageSearchParams(searchParams: URLSearchParams | null | undefined): Promise<ClientPageSearchParams>;
|
|
23
23
|
export declare function ClientPageRoot({ Component, pageProps, emptySearchParams }: ClientPageRootProps): import("react").ReactElement<Record<string, unknown>, string | import("react").JSXElementConstructor<any>>;
|
|
24
|
-
//#endregion
|
|
24
|
+
//#endregion
|
|
25
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { searchParamsToRecord } from "../utils/query.js";
|
|
3
3
|
import { getNavigationContext } from "./navigation-context-state.js";
|
|
4
|
+
import { getClientNavigationRenderContext, useSearchParams } from "./navigation.js";
|
|
4
5
|
import "./navigation-server.js";
|
|
5
|
-
import { isOwnPropertyCheck, isWellKnownProperty } from "./internal/thenable-well-known-properties.js";
|
|
6
6
|
import { RenderedSearchContext } from "./slot.js";
|
|
7
|
-
import {
|
|
7
|
+
import { isOwnPropertyCheck, isWellKnownProperty } from "./internal/thenable-well-known-properties.js";
|
|
8
8
|
import { createElement, use, useMemo } from "react";
|
|
9
9
|
//#region src/shims/client-page-root.tsx
|
|
10
10
|
/**
|
package/dist/shims/config.d.ts
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HTTPAccessErrorFallback } from "./http-access-error-fallback.js";
|
|
2
|
+
import React from "react";
|
|
3
|
+
//#region src/shims/default-forbidden.tsx
|
|
4
|
+
/**
|
|
5
|
+
* Ported from Next.js's built-in default forbidden component:
|
|
6
|
+
* https://github.com/vercel/next.js/blob/canary/packages/next/src/client/components/builtin/forbidden.tsx
|
|
7
|
+
*
|
|
8
|
+
* Rendered when `forbidden()` is called and no `app/forbidden.tsx` boundary
|
|
9
|
+
* catches it.
|
|
10
|
+
*/
|
|
11
|
+
function DefaultForbidden() {
|
|
12
|
+
return React.createElement(HTTPAccessErrorFallback, {
|
|
13
|
+
status: 403,
|
|
14
|
+
message: "This page could not be accessed."
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { DefaultForbidden as default };
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
//#region src/shims/default-not-found.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* Mirrors `<HTTPAccessErrorFallback status={404} message="This page could not be found." />`
|
|
5
|
-
* from Next.js. Kept in sync with the upstream component's structure so HTML
|
|
6
|
-
* snapshot diffs between Next.js and vinext stay minimal.
|
|
7
|
-
*/
|
|
8
3
|
export default function DefaultNotFound(): React.ReactElement;
|
|
9
4
|
//#endregion
|
|
@@ -1,59 +1,23 @@
|
|
|
1
|
+
import { HTTPAccessErrorFallback } from "./http-access-error-fallback.js";
|
|
1
2
|
import React from "react";
|
|
2
3
|
//#region src/shims/default-not-found.tsx
|
|
3
4
|
/**
|
|
4
5
|
* Ported from Next.js's built-in default not-found component:
|
|
5
6
|
* https://github.com/vercel/next.js/blob/canary/packages/next/src/client/components/builtin/not-found.tsx
|
|
6
|
-
* https://github.com/vercel/next.js/blob/canary/packages/next/src/client/components/http-access-fallback/error-fallback.tsx
|
|
7
7
|
*
|
|
8
8
|
* Rendered when an App Router request resolves to a 404 and the user has not
|
|
9
9
|
* supplied their own `app/not-found.tsx` (or `app/global-not-found.tsx`).
|
|
10
|
-
* Matches Next.js's `HTTPAccessErrorFallback` exactly: a centered 404 / message
|
|
11
|
-
* pair with minified theme CSS and dark-mode media query.
|
|
12
10
|
*
|
|
13
11
|
* The message string `"This page could not be found."` (note the trailing
|
|
14
12
|
* period) is the canonical body asserted by Next.js's deploy suite
|
|
15
13
|
* (`test/e2e/app-dir/prefetching-not-found/prefetching-not-found.test.ts`,
|
|
16
14
|
* `test/e2e/basepath/error-pages.test.ts`).
|
|
17
15
|
*/
|
|
18
|
-
const styles = {
|
|
19
|
-
error: {
|
|
20
|
-
fontFamily: "system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"",
|
|
21
|
-
height: "100vh",
|
|
22
|
-
textAlign: "center",
|
|
23
|
-
display: "flex",
|
|
24
|
-
flexDirection: "column",
|
|
25
|
-
alignItems: "center",
|
|
26
|
-
justifyContent: "center"
|
|
27
|
-
},
|
|
28
|
-
desc: { display: "inline-block" },
|
|
29
|
-
h1: {
|
|
30
|
-
display: "inline-block",
|
|
31
|
-
margin: "0 20px 0 0",
|
|
32
|
-
padding: "0 23px 0 0",
|
|
33
|
-
fontSize: 24,
|
|
34
|
-
fontWeight: 500,
|
|
35
|
-
verticalAlign: "top",
|
|
36
|
-
lineHeight: "49px"
|
|
37
|
-
},
|
|
38
|
-
h2: {
|
|
39
|
-
fontSize: 14,
|
|
40
|
-
fontWeight: 400,
|
|
41
|
-
lineHeight: "49px",
|
|
42
|
-
margin: 0
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
const STATUS = 404;
|
|
46
|
-
const MESSAGE = "This page could not be found.";
|
|
47
|
-
/**
|
|
48
|
-
* Mirrors `<HTTPAccessErrorFallback status={404} message="This page could not be found." />`
|
|
49
|
-
* from Next.js. Kept in sync with the upstream component's structure so HTML
|
|
50
|
-
* snapshot diffs between Next.js and vinext stay minimal.
|
|
51
|
-
*/
|
|
52
16
|
function DefaultNotFound() {
|
|
53
|
-
return React.createElement(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
17
|
+
return React.createElement(HTTPAccessErrorFallback, {
|
|
18
|
+
status: 404,
|
|
19
|
+
message: "This page could not be found."
|
|
20
|
+
});
|
|
57
21
|
}
|
|
58
22
|
//#endregion
|
|
59
23
|
export { DefaultNotFound as default };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HTTPAccessErrorFallback } from "./http-access-error-fallback.js";
|
|
2
|
+
import React from "react";
|
|
3
|
+
//#region src/shims/default-unauthorized.tsx
|
|
4
|
+
/**
|
|
5
|
+
* Ported from Next.js's built-in default unauthorized component:
|
|
6
|
+
* https://github.com/vercel/next.js/blob/canary/packages/next/src/client/components/builtin/unauthorized.tsx
|
|
7
|
+
*
|
|
8
|
+
* Rendered when `unauthorized()` is called and no `app/unauthorized.tsx`
|
|
9
|
+
* boundary catches it.
|
|
10
|
+
*/
|
|
11
|
+
function DefaultUnauthorized() {
|
|
12
|
+
return React.createElement(HTTPAccessErrorFallback, {
|
|
13
|
+
status: 401,
|
|
14
|
+
message: "You're not authorized to access this page."
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { DefaultUnauthorized as default };
|
package/dist/shims/dynamic.js
CHANGED
|
@@ -89,9 +89,11 @@ function createElementWithProps(Component, props) {
|
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
91
|
* Lightweight error boundary that renders the loading component with the error
|
|
92
|
-
* when a dynamic() loader rejects
|
|
93
|
-
*
|
|
94
|
-
*
|
|
92
|
+
* when a dynamic() loader rejects, as the Pages Router's react-loadable does by
|
|
93
|
+
* passing `error` to `loading`. App Router trees never get it: Next.js's App
|
|
94
|
+
* Router next/dynamic is React.lazy inside Suspense with no boundary of its own,
|
|
95
|
+
* so loader and render errors reach the nearest error.tsx.
|
|
96
|
+
* https://github.com/vercel/next.js/blob/canary/packages/next/src/shared/lib/lazy-dynamic/loadable.tsx
|
|
95
97
|
*
|
|
96
98
|
* Lazily created because React.Component is not available in the RSC environment
|
|
97
99
|
* (server components use a slimmed-down React that doesn't include class components).
|
|
@@ -202,6 +204,7 @@ function dynamic(dynamicInput, options) {
|
|
|
202
204
|
}
|
|
203
205
|
const InitialLazyComponent = createLazyComponent(loader);
|
|
204
206
|
const ClientSSRFalse = (props) => {
|
|
207
|
+
const isAppRouterTree = useIsAppRouterTree();
|
|
205
208
|
const [mounted, setMounted] = React.useState(false);
|
|
206
209
|
const { LazyComponent, retry, retryKey } = useRetryableLazyComponent(loader, InitialLazyComponent);
|
|
207
210
|
React.useEffect(() => setMounted(true), []);
|
|
@@ -209,7 +212,7 @@ function dynamic(dynamicInput, options) {
|
|
|
209
212
|
const fallback = LoadingComponent ? React.createElement(LoadingComponent, createDynamicLoadingProps({ retry })) : null;
|
|
210
213
|
const lazyElement = createElementWithProps(LazyComponent, props);
|
|
211
214
|
let content = lazyElement;
|
|
212
|
-
if (LoadingComponent) {
|
|
215
|
+
if (LoadingComponent && !isAppRouterTree) {
|
|
213
216
|
const ErrorBoundary = getDynamicErrorBoundary();
|
|
214
217
|
if (ErrorBoundary) content = React.createElement(ErrorBoundary, {
|
|
215
218
|
fallback: LoadingComponent,
|
|
@@ -237,7 +240,7 @@ function dynamic(dynamicInput, options) {
|
|
|
237
240
|
const fallback = LoadingComponent ? React.createElement(LoadingComponent, createDynamicLoadingProps()) : null;
|
|
238
241
|
const lazyElement = createElementWithProps(LazyServer, props);
|
|
239
242
|
let content = lazyElement;
|
|
240
|
-
if (LoadingComponent) {
|
|
243
|
+
if (LoadingComponent && !isAppRouterTree) {
|
|
241
244
|
const ErrorBoundary = getDynamicErrorBoundary();
|
|
242
245
|
if (ErrorBoundary) content = React.createElement(ErrorBoundary, {
|
|
243
246
|
fallback: LoadingComponent,
|
|
@@ -257,7 +260,7 @@ function dynamic(dynamicInput, options) {
|
|
|
257
260
|
const fallback = LoadingComponent ? React.createElement(LoadingComponent, createDynamicLoadingProps({ retry })) : null;
|
|
258
261
|
const lazyElement = createElementWithProps(LazyComponent, props);
|
|
259
262
|
let content = lazyElement;
|
|
260
|
-
if (LoadingComponent) {
|
|
263
|
+
if (LoadingComponent && !isAppRouterTree) {
|
|
261
264
|
const ErrorBoundary = getDynamicErrorBoundary();
|
|
262
265
|
if (ErrorBoundary) content = React.createElement(ErrorBoundary, {
|
|
263
266
|
fallback: LoadingComponent,
|
|
@@ -78,12 +78,47 @@ type NotFoundBoundaryProps = {
|
|
|
78
78
|
fallback: React.ReactNode;
|
|
79
79
|
children: React.ReactNode;
|
|
80
80
|
resetKey?: string | null;
|
|
81
|
+
/** A parallel slot boundary's id, which the document may render caught. */
|
|
82
|
+
caughtId?: string;
|
|
81
83
|
};
|
|
84
|
+
type NotFoundBoundaryInnerProps = {
|
|
85
|
+
pathname: string | null;
|
|
86
|
+
initiallyNotFound?: boolean;
|
|
87
|
+
} & NotFoundBoundaryProps;
|
|
88
|
+
type NotFoundBoundaryState = {
|
|
89
|
+
notFound: boolean;
|
|
90
|
+
previousPathname: string | null;
|
|
91
|
+
previousResetKey: string | null;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Inner class component that catches notFound() errors and renders the
|
|
95
|
+
* not-found.tsx fallback. Resets when the pathname or the caller's segment
|
|
96
|
+
* reset key changes.
|
|
97
|
+
*
|
|
98
|
+
* The ErrorBoundary above re-throws notFound errors so they propagate up to this
|
|
99
|
+
* boundary. This must be placed above the ErrorBoundary in the component tree.
|
|
100
|
+
*/
|
|
101
|
+
export declare class NotFoundBoundaryInner extends React.Component<NotFoundBoundaryInnerProps, NotFoundBoundaryState> {
|
|
102
|
+
constructor(props: NotFoundBoundaryInnerProps);
|
|
103
|
+
componentDidMount(): void;
|
|
104
|
+
static getDerivedStateFromProps(props: NotFoundBoundaryInnerProps, state: NotFoundBoundaryState): NotFoundBoundaryState | null;
|
|
105
|
+
static getDerivedStateFromError(error: unknown): Partial<NotFoundBoundaryState>;
|
|
106
|
+
render(): string | number | bigint | boolean | React.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | Iterable<React.ReactNode> | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | React.ReactPortal | null | undefined> | null | undefined;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Fallback for a page-level access boundary whose file belongs to an ancestor
|
|
110
|
+
* layout. Rethrowing from the fallback hands the signal to the next boundary
|
|
111
|
+
* up, so that layout's copy renders in place of the layouts below it while the
|
|
112
|
+
* page-level boundary keeps the element shape sibling routes share.
|
|
113
|
+
*/
|
|
114
|
+
export declare function HttpAccessFallbackPassthrough({ status }: {
|
|
115
|
+
status: 401 | 403 | 404;
|
|
116
|
+
}): never;
|
|
82
117
|
/**
|
|
83
118
|
* Wrapper that reads the current pathname and passes it to the inner class
|
|
84
|
-
* component.
|
|
119
|
+
* component.
|
|
85
120
|
*/
|
|
86
|
-
export declare function NotFoundBoundary({ fallback, children, resetKey }: NotFoundBoundaryProps): React.JSX.Element;
|
|
121
|
+
export declare function NotFoundBoundary({ fallback, children, resetKey, caughtId }: NotFoundBoundaryProps): React.JSX.Element;
|
|
87
122
|
type ForbiddenBoundaryProps = {
|
|
88
123
|
fallback: React.ReactNode;
|
|
89
124
|
children: React.ReactNode;
|
|
@@ -144,4 +179,5 @@ export declare class DevRecoveryBoundary extends React.Component<DevRecoveryBoun
|
|
|
144
179
|
componentDidCatch(): void;
|
|
145
180
|
render(): React.ReactNode;
|
|
146
181
|
}
|
|
147
|
-
//#endregion
|
|
182
|
+
//#endregion
|
|
183
|
+
export {};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { isNavigationSignalError } from "../utils/navigation-signal.js";
|
|
3
|
-
import {
|
|
3
|
+
import { handleAppNavigationFailure } from "../client/app-nav-failure-handler.js";
|
|
4
|
+
import { VINEXT_DEV_ERROR_RECOVERY_EVENT } from "../utils/dev-error-recovery-event.js";
|
|
5
|
+
import { decodeRedirectError, forbidden, isRedirectError, notFound, unauthorized } from "./navigation-errors.js";
|
|
4
6
|
import "./navigation-server.js";
|
|
5
7
|
import { isRedirectToCurrentUrl, useErrorBoundaryPathname, useErrorBoundaryRouter } from "./error-boundary-navigation.js";
|
|
6
8
|
import DefaultGlobalError from "./default-global-error.js";
|
|
7
|
-
import {
|
|
8
|
-
import { VINEXT_DEV_ERROR_RECOVERY_EVENT } from "../utils/dev-error-recovery-event.js";
|
|
9
|
+
import { consumeCaughtNotFoundBoundary, useCaughtNotFoundBoundary } from "./caught-not-found-boundaries.js";
|
|
9
10
|
import React from "react";
|
|
10
11
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
11
12
|
//#region src/shims/error-boundary.tsx
|
|
@@ -29,11 +30,8 @@ function readBoundaryResetState(props) {
|
|
|
29
30
|
previousResetKey: normalizeBoundaryResetKey(props.resetKey)
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
const previousResetKey = normalizeBoundaryResetKey(previousResetState.previousResetKey);
|
|
35
|
-
if (nextResetKey !== null || previousResetKey !== null) return nextResetKey !== previousResetKey;
|
|
36
|
-
return nextResetState.previousPathname !== previousResetState.previousPathname;
|
|
33
|
+
function shouldResetSegmentBoundary(nextResetState, previousResetState) {
|
|
34
|
+
return nextResetState.previousPathname !== previousResetState.previousPathname || normalizeBoundaryResetKey(nextResetState.previousResetKey) !== normalizeBoundaryResetKey(previousResetState.previousResetKey);
|
|
37
35
|
}
|
|
38
36
|
function addDevErrorRecoveryListener(listener) {
|
|
39
37
|
if (typeof window === "undefined") return;
|
|
@@ -136,7 +134,7 @@ var ErrorBoundaryInner = class extends React.Component {
|
|
|
136
134
|
error: null,
|
|
137
135
|
...nextResetState
|
|
138
136
|
};
|
|
139
|
-
if (state.error &&
|
|
137
|
+
if (state.error && shouldResetSegmentBoundary(nextResetState, state)) return {
|
|
140
138
|
error: null,
|
|
141
139
|
...nextResetState
|
|
142
140
|
};
|
|
@@ -196,8 +194,8 @@ function GlobalErrorBoundary({ fallback, children }) {
|
|
|
196
194
|
}
|
|
197
195
|
/**
|
|
198
196
|
* Inner class component that catches notFound() errors and renders the
|
|
199
|
-
* not-found.tsx fallback. Resets
|
|
200
|
-
*
|
|
197
|
+
* not-found.tsx fallback. Resets when the pathname or the caller's segment
|
|
198
|
+
* reset key changes.
|
|
201
199
|
*
|
|
202
200
|
* The ErrorBoundary above re-throws notFound errors so they propagate up to this
|
|
203
201
|
* boundary. This must be placed above the ErrorBoundary in the component tree.
|
|
@@ -206,13 +204,16 @@ var NotFoundBoundaryInner = class extends React.Component {
|
|
|
206
204
|
constructor(props) {
|
|
207
205
|
super(props);
|
|
208
206
|
this.state = {
|
|
209
|
-
notFound:
|
|
207
|
+
notFound: props.initiallyNotFound === true,
|
|
210
208
|
...readBoundaryResetState(props)
|
|
211
209
|
};
|
|
212
210
|
}
|
|
211
|
+
componentDidMount() {
|
|
212
|
+
if (this.props.initiallyNotFound === true) consumeCaughtNotFoundBoundary(this.props.caughtId);
|
|
213
|
+
}
|
|
213
214
|
static getDerivedStateFromProps(props, state) {
|
|
214
215
|
const nextResetState = readBoundaryResetState(props);
|
|
215
|
-
if (state.notFound &&
|
|
216
|
+
if (state.notFound && shouldResetSegmentBoundary(nextResetState, state)) return {
|
|
216
217
|
notFound: false,
|
|
217
218
|
...nextResetState
|
|
218
219
|
};
|
|
@@ -237,15 +238,29 @@ var NotFoundBoundaryInner = class extends React.Component {
|
|
|
237
238
|
}
|
|
238
239
|
};
|
|
239
240
|
/**
|
|
241
|
+
* Fallback for a page-level access boundary whose file belongs to an ancestor
|
|
242
|
+
* layout. Rethrowing from the fallback hands the signal to the next boundary
|
|
243
|
+
* up, so that layout's copy renders in place of the layouts below it while the
|
|
244
|
+
* page-level boundary keeps the element shape sibling routes share.
|
|
245
|
+
*/
|
|
246
|
+
function HttpAccessFallbackPassthrough({ status }) {
|
|
247
|
+
if (status === 403) forbidden();
|
|
248
|
+
if (status === 401) unauthorized();
|
|
249
|
+
notFound();
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
240
252
|
* Wrapper that reads the current pathname and passes it to the inner class
|
|
241
|
-
* component.
|
|
253
|
+
* component.
|
|
242
254
|
*/
|
|
243
|
-
function NotFoundBoundary({ fallback, children, resetKey }) {
|
|
255
|
+
function NotFoundBoundary({ fallback, children, resetKey, caughtId }) {
|
|
244
256
|
const pathname = useErrorBoundaryPathname();
|
|
257
|
+
const initiallyNotFound = useCaughtNotFoundBoundary(caughtId);
|
|
245
258
|
return /* @__PURE__ */ jsx(NotFoundBoundaryInner, {
|
|
246
259
|
pathname,
|
|
247
260
|
resetKey,
|
|
248
261
|
fallback,
|
|
262
|
+
caughtId,
|
|
263
|
+
initiallyNotFound,
|
|
249
264
|
children
|
|
250
265
|
});
|
|
251
266
|
}
|
|
@@ -259,7 +274,7 @@ var ForbiddenBoundaryInner = class extends React.Component {
|
|
|
259
274
|
}
|
|
260
275
|
static getDerivedStateFromProps(props, state) {
|
|
261
276
|
const nextResetState = readBoundaryResetState(props);
|
|
262
|
-
if (state.forbidden &&
|
|
277
|
+
if (state.forbidden && shouldResetSegmentBoundary(nextResetState, state)) return {
|
|
263
278
|
forbidden: false,
|
|
264
279
|
...nextResetState
|
|
265
280
|
};
|
|
@@ -301,7 +316,7 @@ var UnauthorizedBoundaryInner = class extends React.Component {
|
|
|
301
316
|
}
|
|
302
317
|
static getDerivedStateFromProps(props, state) {
|
|
303
318
|
const nextResetState = readBoundaryResetState(props);
|
|
304
|
-
if (state.unauthorized &&
|
|
319
|
+
if (state.unauthorized && shouldResetSegmentBoundary(nextResetState, state)) return {
|
|
305
320
|
unauthorized: false,
|
|
306
321
|
...nextResetState
|
|
307
322
|
};
|
|
@@ -374,4 +389,4 @@ var DevRecoveryBoundary = class extends React.Component {
|
|
|
374
389
|
}
|
|
375
390
|
};
|
|
376
391
|
//#endregion
|
|
377
|
-
export { DevRecoveryBoundary, ErrorBoundary, ErrorBoundaryInner, ForbiddenBoundary, ForbiddenBoundaryInner, GlobalErrorBoundary, NotFoundBoundary, RedirectBoundary, RedirectErrorBoundary, SerializedErrorBoundary, UnauthorizedBoundary, UnauthorizedBoundaryInner };
|
|
392
|
+
export { DevRecoveryBoundary, ErrorBoundary, ErrorBoundaryInner, ForbiddenBoundary, ForbiddenBoundaryInner, GlobalErrorBoundary, HttpAccessFallbackPassthrough, NotFoundBoundary, NotFoundBoundaryInner, RedirectBoundary, RedirectErrorBoundary, SerializedErrorBoundary, UnauthorizedBoundary, UnauthorizedBoundaryInner };
|
|
@@ -11,12 +11,16 @@ export type FetchDedupeEntry = {
|
|
|
11
11
|
response: Response | null;
|
|
12
12
|
};
|
|
13
13
|
export type FetchCacheState = {
|
|
14
|
-
cacheableFetchUrls: Set<string>;
|
|
15
14
|
currentRequestTags: string[];
|
|
16
15
|
currentFetchSoftTags: string[];
|
|
17
16
|
currentFetchCacheMode: FetchCacheMode | null;
|
|
18
17
|
currentFetchRevalidate: number | null;
|
|
19
18
|
currentForceDynamicFetchDefault: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Pages Router preview/draft render. App Router draft state is read from the
|
|
21
|
+
* headers context instead; Pages renders don't have one.
|
|
22
|
+
*/
|
|
23
|
+
isDraftMode: boolean;
|
|
20
24
|
dynamicFetchUrls: Set<string>;
|
|
21
25
|
refreshStaleFetchesInForeground: boolean;
|
|
22
26
|
isFetchDedupeActive: boolean;
|
|
@@ -11,12 +11,12 @@ const _FALLBACK_KEY = Symbol.for("vinext.fetchCache.fallback");
|
|
|
11
11
|
const fetchCacheAls = getOrCreateAls("vinext.fetchCache.als");
|
|
12
12
|
function createFetchCacheState() {
|
|
13
13
|
return {
|
|
14
|
-
cacheableFetchUrls: /* @__PURE__ */ new Set(),
|
|
15
14
|
currentRequestTags: [],
|
|
16
15
|
currentFetchSoftTags: [],
|
|
17
16
|
currentFetchCacheMode: null,
|
|
18
17
|
currentFetchRevalidate: null,
|
|
19
18
|
currentForceDynamicFetchDefault: false,
|
|
19
|
+
isDraftMode: false,
|
|
20
20
|
dynamicFetchUrls: /* @__PURE__ */ new Set(),
|
|
21
21
|
refreshStaleFetchesInForeground: false,
|
|
22
22
|
isFetchDedupeActive: false,
|
|
@@ -77,13 +77,11 @@ function getCurrentFetchSoftTags() {
|
|
|
77
77
|
*/
|
|
78
78
|
function runWithDetachedFetchObservations(fn) {
|
|
79
79
|
if (isInsideUnifiedScope()) return runWithUnifiedStateMutation((uCtx) => {
|
|
80
|
-
uCtx.cacheableFetchUrls = /* @__PURE__ */ new Set();
|
|
81
80
|
uCtx.currentRequestTags = [];
|
|
82
81
|
uCtx.dynamicFetchUrls = /* @__PURE__ */ new Set();
|
|
83
82
|
}, fn);
|
|
84
83
|
return fetchCacheAls.run({
|
|
85
84
|
...getFetchCacheState(),
|
|
86
|
-
cacheableFetchUrls: /* @__PURE__ */ new Set(),
|
|
87
85
|
currentRequestTags: [],
|
|
88
86
|
dynamicFetchUrls: /* @__PURE__ */ new Set()
|
|
89
87
|
}, fn);
|
|
@@ -11,7 +11,6 @@ declare global {
|
|
|
11
11
|
}
|
|
12
12
|
/** @internal Reset dedup state — exposed for test isolation only. */
|
|
13
13
|
export declare function _resetPendingRefetches(): void;
|
|
14
|
-
export declare function peekCacheableFetchObservations(): string[];
|
|
15
14
|
export declare function peekDynamicFetchObservations(): string[];
|
|
16
15
|
export declare function consumeDynamicFetchObservations(): string[];
|
|
17
16
|
/**
|
|
@@ -31,6 +30,8 @@ export declare function setCurrentFetchSoftTags(tags: string[]): void;
|
|
|
31
30
|
export declare function setCurrentFetchCacheMode(mode: FetchCacheMode | null): void;
|
|
32
31
|
export declare function setCurrentFetchRevalidate(revalidate: number | null): void;
|
|
33
32
|
export declare function setCurrentForceDynamicFetchDefault(enabled: boolean): void;
|
|
33
|
+
/** Mark the current Pages Router render as a preview/draft render. */
|
|
34
|
+
export declare function setCurrentFetchDraftMode(enabled: boolean): void;
|
|
34
35
|
export declare function setRefreshStaleFetchesInForeground(enabled: boolean): void;
|
|
35
36
|
/**
|
|
36
37
|
* Install the patched fetch and reset per-request tag state.
|
|
@@ -6,8 +6,8 @@ import { sha256Hex } from "../utils/hash.js";
|
|
|
6
6
|
import { traceAppFetch } from "../server/app-fetch-tracing.js";
|
|
7
7
|
import { addCollectedRequestTags, fallbackFetchCacheState, fetchCacheAls, getCurrentFetchSoftTags, getFetchCacheState, resetFallbackFetchCacheState, runWithDetachedFetchObservations } from "./fetch-cache-state.js";
|
|
8
8
|
import { isInsideAnyCacheScope, markDynamicUsage } from "./internal/headers-state.js";
|
|
9
|
-
import { getHeadersContext } from "./headers.js";
|
|
10
|
-
import { _hasPendingRevalidatedTag, _setRequestScopedCacheLife } from "./cache-request-state.js";
|
|
9
|
+
import { getHeadersContext, isDraftModeEnabled } from "./headers.js";
|
|
10
|
+
import { _hasPendingRevalidatedTag, _isOnDemandRevalidate, _setRequestScopedCacheLife } from "./cache-request-state.js";
|
|
11
11
|
import { Buffer } from "node:buffer";
|
|
12
12
|
//#region src/shims/fetch-cache.ts
|
|
13
13
|
/**
|
|
@@ -463,9 +463,6 @@ function markUncachedFetchForPageOutput(input) {
|
|
|
463
463
|
if (getHeadersContext()?.forceStatic !== true) getFetchCacheState().currentFetchRevalidate = 0;
|
|
464
464
|
markDynamicUsage();
|
|
465
465
|
}
|
|
466
|
-
function recordCacheableFetchObservation(input) {
|
|
467
|
-
getFetchCacheState().cacheableFetchUrls.add(getFetchObservationUrl(input));
|
|
468
|
-
}
|
|
469
466
|
function recordFiniteFetchRevalidate(revalidateSeconds) {
|
|
470
467
|
if (Number.isFinite(revalidateSeconds) && revalidateSeconds > 0) _setRequestScopedCacheLife({ revalidate: revalidateSeconds });
|
|
471
468
|
}
|
|
@@ -503,7 +500,8 @@ async function writeFetchCacheResponse(handler, cacheKey, response, tags, revali
|
|
|
503
500
|
await handler.set(cacheKey, cacheValue, {
|
|
504
501
|
fetchCache: true,
|
|
505
502
|
tags,
|
|
506
|
-
revalidate: revalidateSeconds
|
|
503
|
+
revalidate: revalidateSeconds,
|
|
504
|
+
...options?.staleEntry ? { staleEntry: options.staleEntry } : {}
|
|
507
505
|
});
|
|
508
506
|
}
|
|
509
507
|
async function lowerFetchCacheRevalidateIfNeeded(handler, cacheKey, cachedValue, tags, revalidateSeconds) {
|
|
@@ -520,9 +518,6 @@ async function lowerFetchCacheRevalidateIfNeeded(handler, cacheKey, cachedValue,
|
|
|
520
518
|
revalidate: revalidateSeconds
|
|
521
519
|
});
|
|
522
520
|
}
|
|
523
|
-
function peekCacheableFetchObservations() {
|
|
524
|
-
return [...getFetchCacheState().cacheableFetchUrls].sort();
|
|
525
|
-
}
|
|
526
521
|
function peekDynamicFetchObservations() {
|
|
527
522
|
return [...getFetchCacheState().dynamicFetchUrls].sort();
|
|
528
523
|
}
|
|
@@ -559,6 +554,10 @@ function setCurrentFetchRevalidate(revalidate) {
|
|
|
559
554
|
function setCurrentForceDynamicFetchDefault(enabled) {
|
|
560
555
|
getFetchCacheState().currentForceDynamicFetchDefault = enabled;
|
|
561
556
|
}
|
|
557
|
+
/** Mark the current Pages Router render as a preview/draft render. */
|
|
558
|
+
function setCurrentFetchDraftMode(enabled) {
|
|
559
|
+
getFetchCacheState().isDraftMode = enabled;
|
|
560
|
+
}
|
|
562
561
|
function setRefreshStaleFetchesInForeground(enabled) {
|
|
563
562
|
getFetchCacheState().refreshStaleFetchesInForeground = enabled;
|
|
564
563
|
}
|
|
@@ -705,8 +704,12 @@ function dedupeFetch(input, init) {
|
|
|
705
704
|
*/
|
|
706
705
|
function createPatchedFetch() {
|
|
707
706
|
const patchedFetch = async function patchedFetch(input, init, span) {
|
|
708
|
-
const nextOpts = init?.next;
|
|
709
707
|
const state = getFetchCacheState();
|
|
708
|
+
if (state.isDraftMode || isDraftModeEnabled()) {
|
|
709
|
+
recordDynamicFetchObservation(input);
|
|
710
|
+
return dedupeFetch(input, init);
|
|
711
|
+
}
|
|
712
|
+
const nextOpts = init?.next;
|
|
710
713
|
const fetchIdx = isInsideUnifiedScope() || fetchCacheAls.getStore() !== void 0 || fallbackFetchCacheState.isFetchDedupeActive ? (state.nextFetchId ?? 1) + 1 : void 0;
|
|
711
714
|
if (fetchIdx !== void 0) state.nextFetchId = fetchIdx;
|
|
712
715
|
const recordFetchOutcome = (response, cacheStatus, cacheReason) => {
|
|
@@ -753,7 +756,6 @@ function createPatchedFetch() {
|
|
|
753
756
|
return recordFetchOutcome(await dedupeFetch(input, cleanInit), "skip", "auto no cache");
|
|
754
757
|
}
|
|
755
758
|
const cacheReason = fetchCacheMode === "force-cache" || fetchCacheMode === "default-cache" ? `fetchCache = ${fetchCacheMode}` : `revalidate: ${nextOpts?.revalidate === false || cacheDirective === "force-cache" ? 4294967294 : revalidateSeconds}`;
|
|
756
|
-
recordCacheableFetchObservation(input);
|
|
757
759
|
if (typeof nextOpts?.revalidate === "number" && nextOpts.revalidate > 0) {
|
|
758
760
|
lowerCurrentFetchRevalidate(nextOpts.revalidate);
|
|
759
761
|
recordFiniteFetchRevalidate(nextOpts.revalidate);
|
|
@@ -785,8 +787,9 @@ function createPatchedFetch() {
|
|
|
785
787
|
}
|
|
786
788
|
const handler = getDataCacheHandler();
|
|
787
789
|
let mustBypassPendingRevalidation = _hasPendingRevalidatedTag([...tags, ...softTags]);
|
|
790
|
+
let staleEntry;
|
|
788
791
|
try {
|
|
789
|
-
let cached = mustBypassPendingRevalidation ? null : await handler.get(cacheKey, {
|
|
792
|
+
let cached = mustBypassPendingRevalidation || _isOnDemandRevalidate() ? null : await handler.get(cacheKey, {
|
|
790
793
|
kind: "FETCH",
|
|
791
794
|
tags,
|
|
792
795
|
softTags,
|
|
@@ -806,15 +809,19 @@ function createPatchedFetch() {
|
|
|
806
809
|
return recordFetchOutcome(buildCachedFetchResponse(cachedData, input), "hit", cacheReason);
|
|
807
810
|
}
|
|
808
811
|
if (cached?.value && cached.value.kind === "FETCH" && cached.cacheState === "stale") {
|
|
812
|
+
staleEntry = cached;
|
|
809
813
|
if (shouldRefreshStaleFetchInForeground()) {
|
|
810
814
|
const freshResponse = await dedupeFetch(input, fetchInit);
|
|
811
|
-
await writeFetchCacheResponse(handler, cacheKey, freshResponse, tags, revalidateSeconds);
|
|
815
|
+
await writeFetchCacheResponse(handler, cacheKey, freshResponse, tags, revalidateSeconds, { staleEntry: cached });
|
|
812
816
|
return recordFetchOutcome(freshResponse, "miss", cacheReason);
|
|
813
817
|
}
|
|
814
818
|
const staleData = cached.value.data;
|
|
815
819
|
if (!pendingRefetches.has(cacheKey)) {
|
|
816
820
|
const refetchPromise = originalFetch(input, fetchInit).then(async (freshResp) => {
|
|
817
|
-
await writeFetchCacheResponse(handler, cacheKey, freshResp, tags, revalidateSeconds, {
|
|
821
|
+
await writeFetchCacheResponse(handler, cacheKey, freshResp, tags, revalidateSeconds, {
|
|
822
|
+
cloneForReturn: false,
|
|
823
|
+
staleEntry: cached
|
|
824
|
+
});
|
|
818
825
|
}).catch((err) => {
|
|
819
826
|
const url = typeof input === "string" ? input : input instanceof URL ? input.toString() : input.url;
|
|
820
827
|
console.error(`[vinext] fetch cache background revalidation failed for ${url} (key=${cacheKey.slice(0, 12)}...):`, err);
|
|
@@ -835,13 +842,17 @@ function createPatchedFetch() {
|
|
|
835
842
|
}
|
|
836
843
|
const response = await (mustBypassPendingRevalidation ? originalFetch(input, fetchInit) : dedupeFetch(input, fetchInit));
|
|
837
844
|
const cacheValue = await buildFetchCacheValue(response, tags, revalidateSeconds);
|
|
838
|
-
if (cacheValue)
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
+
if (cacheValue) {
|
|
846
|
+
const write = handler.set(cacheKey, cacheValue, {
|
|
847
|
+
fetchCache: true,
|
|
848
|
+
tags,
|
|
849
|
+
revalidate: revalidateSeconds,
|
|
850
|
+
...staleEntry ? { staleEntry } : {}
|
|
851
|
+
}).catch((err) => {
|
|
852
|
+
console.error("[vinext] fetch cache write error:", err);
|
|
853
|
+
});
|
|
854
|
+
getRequestExecutionContext()?.waitUntil(write);
|
|
855
|
+
}
|
|
845
856
|
return recordFetchOutcome(response, "miss", cacheReason);
|
|
846
857
|
};
|
|
847
858
|
return ((input, init) => {
|
|
@@ -894,7 +905,6 @@ function withFetchCache() {
|
|
|
894
905
|
async function runWithFetchCache(fn) {
|
|
895
906
|
_ensurePatchInstalled();
|
|
896
907
|
if (isInsideUnifiedScope()) return await runWithUnifiedStateMutation((uCtx) => {
|
|
897
|
-
uCtx.cacheableFetchUrls = /* @__PURE__ */ new Set();
|
|
898
908
|
uCtx.currentRequestTags = [];
|
|
899
909
|
uCtx.currentFetchSoftTags = [];
|
|
900
910
|
uCtx.dynamicFetchUrls = /* @__PURE__ */ new Set();
|
|
@@ -904,12 +914,12 @@ async function runWithFetchCache(fn) {
|
|
|
904
914
|
uCtx.nextFetchId = 1;
|
|
905
915
|
}, fn);
|
|
906
916
|
return fetchCacheAls.run({
|
|
907
|
-
cacheableFetchUrls: /* @__PURE__ */ new Set(),
|
|
908
917
|
currentRequestTags: [],
|
|
909
918
|
currentFetchSoftTags: [],
|
|
910
919
|
currentFetchCacheMode: null,
|
|
911
920
|
currentFetchRevalidate: null,
|
|
912
921
|
currentForceDynamicFetchDefault: false,
|
|
922
|
+
isDraftMode: false,
|
|
913
923
|
dynamicFetchUrls: /* @__PURE__ */ new Set(),
|
|
914
924
|
refreshStaleFetchesInForeground: false,
|
|
915
925
|
isFetchDedupeActive: true,
|
|
@@ -950,4 +960,4 @@ function getOriginalFetch() {
|
|
|
950
960
|
return originalFetch;
|
|
951
961
|
}
|
|
952
962
|
//#endregion
|
|
953
|
-
export { _resetPendingRefetches, addCollectedRequestTags, consumeDynamicFetchObservations, ensureFetchPatch, getCollectedFetchTags, getCurrentFetchSoftTags, getOriginalFetch,
|
|
963
|
+
export { _resetPendingRefetches, addCollectedRequestTags, consumeDynamicFetchObservations, ensureFetchPatch, getCollectedFetchTags, getCurrentFetchSoftTags, getOriginalFetch, peekDynamicFetchObservations, runWithDetachedFetchObservations, runWithFetchCache, runWithFetchDedupe, setCurrentFetchCacheMode, setCurrentFetchDraftMode, setCurrentFetchRevalidate, setCurrentFetchSoftTags, setCurrentForceDynamicFetchDefault, setRefreshStaleFetchesInForeground, withFetchCache };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { buildGoogleFontsUrl, createFontLoader, googleFonts as default, getSSRFontLinks, getSSRFontPreloads, getSSRFontStyles };
|
|
1
|
+
export { buildGoogleFontsUrl, createFontLoader, default, getSSRFontLinks, getSSRFontPreloads, getSSRFontStyles } from "./font-google-base.js";
|
|
@@ -47,9 +47,10 @@ export declare function resolveGoogleFontStyle(style: string | string[] | undefi
|
|
|
47
47
|
export declare function resolveSingleFaceStyle(input: FontFaceStyleInput): FontStyle;
|
|
48
48
|
export declare function formatFontClassRule(className: string, style: FontStyle): string;
|
|
49
49
|
/**
|
|
50
|
-
* Determine the
|
|
50
|
+
* Determine the preload `type` for a font file based on its extension.
|
|
51
51
|
* Uses endsWith() only to avoid false positives from substring matches
|
|
52
|
-
* (e.g. ".woff" matching ".woff2").
|
|
52
|
+
* (e.g. ".woff" matching ".woff2"). Matches Next.js, which emits
|
|
53
|
+
* `font/${ext}` for every font preload (including `font/eot`).
|
|
53
54
|
*/
|
|
54
55
|
export declare function getFontMimeType(pathOrUrl: string): string;
|
|
55
56
|
//#endregion
|