vinext 1.2.1 → 1.3.1
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 +12 -9
- package/dist/_virtual/_rolldown/runtime.js +1 -1
- 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 +77 -6
- package/dist/build/client-build-config.js +176 -12
- 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 +171 -0
- package/dist/build/client-reference-groups.js +572 -0
- 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/layout-classification.d.ts +2 -1
- package/dist/build/module-dependency-cache.d.ts +33 -1
- package/dist/build/module-dependency-cache.js +51 -1
- package/dist/build/next-client-runtime-manifests.d.ts +12 -2
- package/dist/build/next-client-runtime-manifests.js +19 -4
- package/dist/build/nitro-public-files.d.ts +24 -0
- package/dist/build/nitro-public-files.js +60 -0
- package/dist/build/pages-client-assets-module.js +1 -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-paths.js +5 -2
- 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 +5 -4
- package/dist/build/report.d.ts +2 -1
- package/dist/build/route-classification-injector.d.ts +2 -1
- package/dist/build/route-classification-manifest.d.ts +2 -1
- package/dist/build/run-prerender.d.ts +2 -1
- package/dist/build/server-actions-encryption-key.d.ts +24 -0
- package/dist/build/server-actions-encryption-key.js +101 -0
- package/dist/build/ssr-manifest.d.ts +3 -0
- package/dist/build/ssr-manifest.js +34 -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 +4 -0
- package/dist/cli-args.d.ts +2 -1
- package/dist/cli.js +2 -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-rewrite-params.d.ts +9 -0
- package/dist/client/client-rewrite-params.js +20 -0
- 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 +2 -1
- package/dist/client/index.js +1 -2
- package/dist/client/instrumentation-client-state.js +5 -5
- package/dist/client/navigation-runtime.d.ts +28 -3
- package/dist/client/navigation-runtime.js +42 -11
- package/dist/client/pages-router-link-navigation.d.ts +2 -1
- package/dist/client/vinext-next-data.d.ts +25 -2
- package/dist/client/window-next.d.ts +2 -1
- package/dist/config/config-matchers.d.ts +27 -41
- package/dist/config/config-matchers.js +293 -270
- package/dist/config/config-source.d.ts +34 -0
- package/dist/config/config-source.js +141 -0
- package/dist/config/dotenv.d.ts +2 -1
- package/dist/config/header-params.d.ts +29 -0
- package/dist/config/header-params.js +106 -0
- package/dist/config/next-config.d.ts +20 -6
- package/dist/config/next-config.js +149 -11
- package/dist/config/tsconfig-paths.d.ts +2 -1
- 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/ua-parser-js@1.0.35/deps/ua-parser-js/src/ua-parser.js +2 -2
- package/dist/entries/app-browser-entry.d.ts +34 -6
- package/dist/entries/app-browser-entry.js +103 -40
- package/dist/entries/app-rsc-entry.d.ts +4 -1
- package/dist/entries/app-rsc-entry.js +131 -66
- package/dist/entries/app-rsc-manifest.d.ts +12 -1
- package/dist/entries/app-rsc-manifest.js +73 -1
- package/dist/entries/app-ssr-entry.d.ts +4 -1
- package/dist/entries/app-ssr-entry.js +9 -2
- package/dist/entries/pages-client-entry.d.ts +1 -0
- package/dist/entries/pages-client-entry.js +6 -6
- 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 +18 -15
- 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.d.ts +11 -0
- package/dist/index.js +340 -116
- package/dist/init.js +17 -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/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/og-assets.d.ts +2 -1
- package/dist/plugins/og-assets.js +2 -3
- package/dist/plugins/optimize-imports.d.ts +27 -3
- package/dist/plugins/optimize-imports.js +106 -20
- package/dist/plugins/pages-node-externals.d.ts +2 -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 +53 -1
- package/dist/plugins/rsc-client-reference-loaders.js +447 -27
- 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 +5 -0
- package/dist/plugins/use-cache-callable.js +30 -8
- package/dist/plugins/worker-image-imports.d.ts +1 -0
- package/dist/plugins/worker-image-imports.js +2 -2
- package/dist/plugins/worker-use-server.d.ts +2 -1
- package/dist/routing/app-route-graph.d.ts +41 -1
- package/dist/routing/app-route-graph.js +122 -50
- package/dist/routing/browser-route-manifest.d.ts +44 -0
- package/dist/routing/browser-route-manifest.js +195 -0
- package/dist/routing/hashed-route-patterns.d.ts +4 -0
- package/dist/routing/hashed-route-patterns.js +22 -0
- package/dist/routing/optimistic-route-trie.d.ts +28 -0
- package/dist/routing/optimistic-route-trie.js +102 -0
- package/dist/routing/route-matching.d.ts +2 -1
- package/dist/routing/route-pattern.d.ts +2 -1
- package/dist/routing/route-validation.d.ts +6 -1
- package/dist/routing/route-validation.js +26 -10
- package/dist/server/accept-encoding.d.ts +2 -1
- package/dist/server/app-action-forwarding.d.ts +10 -1
- package/dist/server/app-action-forwarding.js +15 -1
- package/dist/server/app-bfcache-identity.d.ts +2 -1
- package/dist/server/app-browser-action-result.d.ts +2 -1
- package/dist/server/app-browser-client-reuse-manifest.d.ts +2 -1
- package/dist/server/app-browser-entry.js +175 -64
- package/dist/server/app-browser-error.d.ts +5 -2
- package/dist/server/app-browser-error.js +7 -2
- package/dist/server/app-browser-history-controller.d.ts +2 -1
- package/dist/server/app-browser-hydration.d.ts +2 -1
- package/dist/server/app-browser-interception-context.d.ts +4 -3
- package/dist/server/app-browser-mpa-navigation.d.ts +1 -0
- package/dist/server/app-browser-mpa-navigation.js +6 -5
- package/dist/server/app-browser-navigation-controller.d.ts +17 -6
- package/dist/server/app-browser-navigation-controller.js +103 -36
- 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-server-action-client.d.ts +2 -1
- package/dist/server/app-browser-state.d.ts +2 -2
- package/dist/server/app-browser-state.js +1 -1
- package/dist/server/app-browser-stream.d.ts +2 -1
- package/dist/server/app-browser-visible-commit.d.ts +6 -5
- 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 +45 -2
- package/dist/server/app-client-reference-preloader.js +48 -10
- package/dist/server/app-elements-wire.d.ts +2 -1
- package/dist/server/app-elements.d.ts +2 -0
- package/dist/server/app-elements.js +3 -1
- package/dist/server/app-fallback-renderer.d.ts +9 -2
- package/dist/server/app-fallback-renderer.js +6 -2
- package/dist/server/app-history-state.d.ts +2 -1
- package/dist/server/app-inline-css-client.d.ts +2 -1
- package/dist/server/app-layout-param-observation.d.ts +2 -1
- package/dist/server/app-metadata-tracing.d.ts +2 -1
- package/dist/server/app-middleware.d.ts +6 -0
- package/dist/server/app-middleware.js +8 -10
- package/dist/server/app-optimistic-routing.d.ts +26 -11
- package/dist/server/app-optimistic-routing.js +38 -96
- package/dist/server/app-page-boundary-render.d.ts +20 -2
- package/dist/server/app-page-boundary-render.js +229 -39
- package/dist/server/app-page-boundary.d.ts +34 -5
- package/dist/server/app-page-boundary.js +40 -7
- package/dist/server/app-page-cache-finalizer.d.ts +2 -1
- package/dist/server/app-page-cache-finalizer.js +1 -1
- package/dist/server/app-page-cache-render.d.ts +10 -2
- package/dist/server/app-page-cache-render.js +15 -2
- package/dist/server/app-page-cache.js +2 -2
- package/dist/server/app-page-dispatch.d.ts +34 -1
- package/dist/server/app-page-dispatch.js +165 -34
- package/dist/server/app-page-element-builder.d.ts +17 -1
- package/dist/server/app-page-element-builder.js +187 -66
- package/dist/server/app-page-execution.d.ts +28 -1
- package/dist/server/app-page-execution.js +114 -5
- package/dist/server/app-page-head.d.ts +95 -3
- package/dist/server/app-page-head.js +307 -152
- package/dist/server/app-page-http-access-fallback-metadata.d.ts +48 -2
- package/dist/server/app-page-http-access-fallback-metadata.js +76 -1
- package/dist/server/app-page-method.d.ts +2 -1
- package/dist/server/app-page-probe.d.ts +2 -1
- package/dist/server/app-page-render-identity.d.ts +2 -1
- package/dist/server/app-page-render.d.ts +7 -1
- package/dist/server/app-page-render.js +38 -11
- package/dist/server/app-page-request.d.ts +14 -1
- package/dist/server/app-page-request.js +1 -1
- package/dist/server/app-page-route-wiring.d.ts +52 -2
- package/dist/server/app-page-route-wiring.js +197 -47
- package/dist/server/app-page-rsc-render-status.d.ts +3 -1
- package/dist/server/app-page-rsc-render-status.js +1 -0
- package/dist/server/app-page-search-params-observation.d.ts +8 -6
- package/dist/server/app-page-search-params-observation.js +16 -11
- package/dist/server/app-page-segment-plan.d.ts +2 -1
- package/dist/server/app-page-stream.d.ts +38 -1
- package/dist/server/app-page-stream.js +24 -4
- package/dist/server/app-pages-bridge.d.ts +4 -2
- package/dist/server/app-pages-bridge.js +11 -7
- 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-prerender-static-params.js +3 -2
- package/dist/server/app-render-dependency.d.ts +11 -1
- package/dist/server/app-render-dependency.js +65 -6
- package/dist/server/app-request-stage-independent-entry.d.ts +2 -1
- package/dist/server/app-request-stage-independent-entry.js +2 -2
- package/dist/server/app-response-stage-entry.d.ts +2 -1
- package/dist/server/app-response-stage-entry.js +3 -3
- package/dist/server/app-route-handler-cache.d.ts +2 -1
- package/dist/server/app-route-handler-dispatch.d.ts +2 -1
- package/dist/server/app-route-handler-dispatch.js +4 -2
- package/dist/server/app-route-handler-execution.d.ts +4 -1
- package/dist/server/app-route-handler-execution.js +9 -2
- package/dist/server/app-route-handler-middleware-context.d.ts +2 -1
- package/dist/server/app-route-handler-middleware-context.js +3 -3
- package/dist/server/app-route-handler-response.d.ts +4 -2
- package/dist/server/app-route-handler-response.js +2 -2
- package/dist/server/app-route-handler-runtime.d.ts +4 -1
- package/dist/server/app-route-handler-runtime.js +20 -3
- package/dist/server/app-route-module-loader.d.ts +18 -1
- package/dist/server/app-route-module-loader.js +15 -6
- package/dist/server/app-route-tree-prefetch.d.ts +2 -1
- package/dist/server/app-route-tree.d.ts +20 -0
- package/dist/server/app-route-tree.js +18 -0
- package/dist/server/app-router-entry.js +2 -2
- package/dist/server/app-rsc-combined-handler.js +8 -1
- package/dist/server/app-rsc-error-handler.d.ts +2 -1
- package/dist/server/app-rsc-errors.d.ts +9 -1
- package/dist/server/app-rsc-errors.js +9 -2
- package/dist/server/app-rsc-handler.d.ts +6 -2
- package/dist/server/app-rsc-handler.js +152 -140
- package/dist/server/app-rsc-response-finalizer.d.ts +7 -1
- package/dist/server/app-rsc-response-finalizer.js +4 -1
- package/dist/server/app-rsc-response-stage.js +3 -1
- package/dist/server/app-rsc-route-matching.d.ts +39 -1
- package/dist/server/app-rsc-route-matching.js +25 -1
- 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 +25 -7
- package/dist/server/app-server-action-execution.js +53 -59
- package/dist/server/app-ssr-entry.d.ts +12 -0
- package/dist/server/app-ssr-entry.js +104 -48
- 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 +29 -10
- package/dist/server/app-ssr-stream.js +311 -67
- 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 +2 -1
- package/dist/server/app-worker-stages.d.ts +2 -1
- package/dist/server/artifact-compatibility.d.ts +2 -1
- package/dist/server/bfcache-identity.d.ts +2 -1
- package/dist/server/cache-headers.d.ts +2 -1
- package/dist/server/cacheability-request.d.ts +2 -1
- package/dist/server/client-reuse-manifest.d.ts +2 -1
- package/dist/server/config-headers.d.ts +2 -1
- package/dist/server/config-headers.js +12 -3
- 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 +10 -3
- 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/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/isolate-shared-promise.d.ts +10 -0
- package/dist/server/isolate-shared-promise.js +33 -0
- package/dist/server/isr-cache.js +3 -2
- 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 +1 -1
- package/dist/server/metadata-routes.d.ts +2 -1
- package/dist/server/middleware-matcher-pattern.d.ts +0 -1
- package/dist/server/middleware-matcher-pattern.js +11 -140
- package/dist/server/middleware-matcher.js +5 -6
- package/dist/server/middleware-response-headers.d.ts +31 -0
- package/dist/server/middleware-response-headers.js +57 -1
- package/dist/server/middleware-runtime.d.ts +2 -1
- package/dist/server/middleware-runtime.js +26 -13
- package/dist/server/navigation-planner.d.ts +2 -2
- 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 +39 -0
- package/dist/server/nitro-public-files-plugin.js +106 -0
- package/dist/server/nitro-public-files.d.ts +22 -0
- package/dist/server/nitro-public-files.js +39 -0
- 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-asset-tags.d.ts +7 -1
- package/dist/server/pages-asset-tags.js +9 -2
- package/dist/server/pages-body-parser-config.d.ts +2 -1
- package/dist/server/pages-client-assets.d.ts +8 -1
- 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-i18n.d.ts +18 -0
- package/dist/server/pages-i18n.js +18 -2
- package/dist/server/pages-node-compat.d.ts +5 -3
- package/dist/server/pages-node-compat.js +35 -16
- 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 +16 -7
- 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 +8 -2
- package/dist/server/pages-request-pipeline.js +35 -40
- package/dist/server/pages-request-stage-entry.d.ts +2 -1
- package/dist/server/pages-request-stage-entry.js +16 -6
- package/dist/server/pages-response-stage-entry.d.ts +2 -1
- package/dist/server/pages-response-stage-entry.js +1 -1
- package/dist/server/pages-revalidate.js +1 -0
- package/dist/server/pages-route-data-kind.d.ts +2 -1
- package/dist/server/pages-router-entry.js +1 -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.d.ts +2 -2
- package/dist/server/prod-server.js +80 -36
- package/dist/server/proxy-trust.d.ts +6 -0
- package/dist/server/proxy-trust.js +12 -6
- package/dist/server/request-log.d.ts +2 -1
- package/dist/server/request-pipeline.d.ts +5 -0
- package/dist/server/request-pipeline.js +12 -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/server-reference-loader.js +10 -1
- package/dist/server/static-file-cache.d.ts +2 -1
- package/dist/server/static-file-cache.js +16 -3
- package/dist/server/static-layout-client-reuse-proof.d.ts +2 -1
- package/dist/server/worker-revalidation-context.d.ts +2 -1
- package/dist/server/worker-stages.d.ts +2 -1
- package/dist/server/worker-utils.js +1 -1
- 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 +32 -11
- package/dist/shims/cache-request-state.d.ts +40 -3
- package/dist/shims/cache-request-state.js +70 -5
- package/dist/shims/cache-runtime.js +47 -19
- package/dist/shims/cache.d.ts +2 -2
- package/dist/shims/cache.js +17 -8
- 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-purge-routes.d.ts +25 -0
- package/dist/shims/cdn-purge-routes.js +77 -0
- package/dist/shims/client-locale.js +2 -1
- package/dist/shims/client-page-root.d.ts +2 -1
- 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 +17 -4
- package/dist/shims/error-boundary.d.ts +39 -3
- package/dist/shims/error-boundary.js +31 -16
- 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 +9 -4
- 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-props.d.ts +93 -0
- package/dist/shims/image-props.js +323 -0
- package/dist/shims/image.d.ts +4 -39
- package/dist/shims/image.js +4 -319
- 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 +9 -0
- package/dist/shims/internal/headers-state.js +19 -2
- package/dist/shims/internal/hybrid-client-route-owner-direct.d.ts +6 -2
- package/dist/shims/internal/hybrid-client-route-owner-direct.js +31 -14
- package/dist/shims/internal/hybrid-client-route-owner.js +8 -8
- package/dist/shims/internal/interpolate-as.d.ts +2 -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 +198 -53
- package/dist/shims/metadata.d.ts +32 -11
- package/dist/shims/metadata.js +88 -26
- package/dist/shims/navigation-errors.d.ts +2 -1
- package/dist/shims/navigation.d.ts +23 -3
- package/dist/shims/navigation.js +91 -25
- package/dist/shims/og.js +35 -10
- package/dist/shims/pages-router-runtime.d.ts +2 -1
- package/dist/shims/ppr-fallback-shell.d.ts +2 -1
- package/dist/shims/request-context.d.ts +13 -0
- package/dist/shims/router.js +33 -43
- package/dist/shims/server.d.ts +31 -4
- package/dist/shims/server.js +58 -10
- package/dist/shims/thenable-params.d.ts +6 -1
- package/dist/shims/thenable-params.js +11 -2
- package/dist/shims/unified-request-context.d.ts +5 -0
- package/dist/shims/unified-request-context.js +5 -3
- package/dist/typegen.d.ts +2 -1
- package/dist/utils/asset-prefix.d.ts +7 -0
- package/dist/utils/asset-prefix.js +10 -1
- package/dist/utils/client-build-manifest.d.ts +4 -1
- package/dist/utils/client-build-manifest.js +20 -6
- 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 +10 -1
- package/dist/utils/client-runtime-metadata.js +53 -9
- package/dist/utils/compare.d.ts +9 -0
- package/dist/utils/compare.js +15 -1
- package/dist/utils/lazy-chunks.d.ts +18 -0
- package/dist/utils/lazy-chunks.js +27 -1
- package/dist/utils/manifest-paths.d.ts +14 -0
- package/dist/utils/manifest-paths.js +22 -1
- package/dist/utils/middleware-request-headers.d.ts +2 -1
- package/dist/utils/path-to-regexp.d.ts +21 -0
- package/dist/{server/middleware-path-to-regexp.js → utils/path-to-regexp.js} +14 -11
- package/dist/utils/plugin-react-version.d.ts +15 -0
- package/dist/utils/plugin-react-version.js +64 -0
- package/dist/utils/project.d.ts +2 -1
- package/dist/utils/project.js +9 -1
- package/dist/utils/public-routes.d.ts +2 -0
- package/dist/utils/public-routes.js +18 -7
- package/dist/utils/query.d.ts +2 -1
- package/dist/utils/sorted-array.d.ts +2 -1
- package/dist/utils/vite-cli-invocation.d.ts +2 -1
- package/package.json +5 -5
- package/dist/deps/.pnpm/image-size@2.0.2/deps/image-size/dist/index.js +0 -808
- package/dist/server/default-not-found-module.d.ts +0 -19
- package/dist/server/default-not-found-module.js +0 -18
- package/dist/server/middleware-path-to-regexp.d.ts +0 -13
- package/dist/server/rsc-stream-hints.d.ts +0 -21
- package/dist/server/rsc-stream-hints.js +0 -227
- package/dist/utils/regex-safety.d.ts +0 -17
- package/dist/utils/regex-safety.js +0 -789
package/dist/shims/cache.js
CHANGED
|
@@ -3,7 +3,6 @@ import { getRequestContext, isInsideUnifiedScope } from "./unified-request-conte
|
|
|
3
3
|
import { getRequestExecutionContext, runWithExecutionContext } from "./request-context.js";
|
|
4
4
|
import { isInsideWorkStoreScope } from "./internal/work-store-scope.js";
|
|
5
5
|
import { workUnitAsyncStorage } from "./internal/work-unit-async-storage.js";
|
|
6
|
-
import { getCdnCacheAdapter } from "./cdn-cache.js";
|
|
7
6
|
import { isStagedCacheabilityProbeActive } from "./cacheability-classification.js";
|
|
8
7
|
import { MemoryCacheHandler, NoOpCacheHandler, configureMemoryCacheHandler, getCacheHandler, getDataCacheHandler, registerDataCacheHandler, registerLazyDataCacheHandler, setCacheHandler, setDataCacheHandler } from "./cache-handler.js";
|
|
9
8
|
import { encodeCacheTag, encodeCacheTags } from "../utils/encode-cache-tag.js";
|
|
@@ -13,7 +12,8 @@ import { makeHangingPromise } from "./internal/make-hanging-promise.js";
|
|
|
13
12
|
import { getHeadersAccessPhase, markDynamicUsage } from "./internal/headers-state.js";
|
|
14
13
|
import { isDraftModeEnabled } from "./headers.js";
|
|
15
14
|
import { _recordUseCacheRootParamRead, _registerCacheContextAccessor, getRegisteredCacheContext } from "./internal/cache-context-accessor.js";
|
|
16
|
-
import { ACTION_DID_REVALIDATE_DYNAMIC_ONLY, ACTION_DID_REVALIDATE_STATIC_AND_DYNAMIC, _captureRequestScopedCacheLifeAccessors, _consumeRequestScopedCacheLife, _drainPendingRevalidations, _hasPendingRevalidatedTag, _initRequestScopedCacheState, _markPendingRevalidatedTag, _peekRequestScopedCacheLife, _peekUnstableCacheObservations, _queuePendingRevalidation, _runWithCacheState, _setRequestScopedCacheLife, cacheLifeProfiles, getAndClearActionRevalidationKind, markActionRevalidation, recordUnstableCacheObservation, runWithDetachedCacheObservations, shouldServeStaleUnstableCacheEntry } from "./cache-request-state.js";
|
|
15
|
+
import { ACTION_DID_REVALIDATE_DYNAMIC_ONLY, ACTION_DID_REVALIDATE_STATIC_AND_DYNAMIC, _captureRequestScopedCacheLifeAccessors, _consumeRequestScopedCacheLife, _drainPendingRevalidations, _hasPendingRevalidatedTag, _initRequestScopedCacheState, _markPendingRevalidatedTag, _peekRequestScopedCacheLife, _peekUnstableCacheObservations, _queuePendingCdnTagInvalidation, _queuePendingRevalidation, _revalidateCdnTags, _runWithCacheState, _setRequestScopedCacheLife, cacheLifeProfiles, getAndClearActionRevalidationKind, markActionRevalidation, recordUnstableCacheObservation, runWithDetachedCacheObservations, shouldServeStaleUnstableCacheEntry } from "./cache-request-state.js";
|
|
16
|
+
import { isPathKnownNotEdgeCached } from "./cdn-purge-routes.js";
|
|
17
17
|
//#region src/shims/cache.ts
|
|
18
18
|
/**
|
|
19
19
|
* next/cache shim
|
|
@@ -69,7 +69,7 @@ function revalidateTag(tag, profile) {
|
|
|
69
69
|
if (!profile || !durations || durations.expire === 0) markActionRevalidation(1);
|
|
70
70
|
const encodedTag = encodeCacheTag(tag);
|
|
71
71
|
_markPendingRevalidatedTag(encodedTag);
|
|
72
|
-
return
|
|
72
|
+
return scheduleTagInvalidation(encodedTag, durations);
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
75
75
|
* Invalidate one already-encoded tag across both cache layers.
|
|
@@ -79,10 +79,18 @@ function revalidateTag(tag, profile) {
|
|
|
79
79
|
* default CDN adapter), THEN ask the CDN adapter to purge its edge (a no-op for
|
|
80
80
|
* the default adapter). Purging the edge before the store is invalidated would
|
|
81
81
|
* let the edge re-fetch and re-cache stale data.
|
|
82
|
+
*
|
|
83
|
+
* The data cache is invalidated right away, so reads later in the same action
|
|
84
|
+
* see it. Inside a Server Action or Route Handler the purge waits for the
|
|
85
|
+
* request boundary, which sends one batched adapter call per profile.
|
|
82
86
|
*/
|
|
83
|
-
|
|
87
|
+
function scheduleTagInvalidation(encoded, durations) {
|
|
88
|
+
const dataInvalidation = invalidateDataCacheTag(encoded, durations);
|
|
89
|
+
if (_queuePendingCdnTagInvalidation(encoded, durations, dataInvalidation)) return scheduleRevalidation(dataInvalidation);
|
|
90
|
+
return scheduleRevalidation(dataInvalidation.then(() => _revalidateCdnTags(encoded, durations)));
|
|
91
|
+
}
|
|
92
|
+
async function invalidateDataCacheTag(encoded, durations) {
|
|
84
93
|
await getDataCacheHandler().revalidateTag(encoded, durations);
|
|
85
|
-
await getCdnCacheAdapter().revalidateTag(encoded, durations);
|
|
86
94
|
}
|
|
87
95
|
/**
|
|
88
96
|
* Revalidate cached data associated with a specific path.
|
|
@@ -109,7 +117,8 @@ function revalidatePath(path, type) {
|
|
|
109
117
|
const tag = type ? `_N_T_${stem}/${type}` : `_N_T_${stem || "/"}`;
|
|
110
118
|
const encodedTag = encodeCacheTag(tag);
|
|
111
119
|
_markPendingRevalidatedTag(encodedTag);
|
|
112
|
-
return scheduleRevalidation(
|
|
120
|
+
if (isPathKnownNotEdgeCached(stem || "/")) return scheduleRevalidation(invalidateDataCacheTag(encodedTag));
|
|
121
|
+
return scheduleTagInvalidation(encodedTag);
|
|
113
122
|
}
|
|
114
123
|
/**
|
|
115
124
|
* No-op shim for API compatibility.
|
|
@@ -140,7 +149,7 @@ function updateTag(tag) {
|
|
|
140
149
|
markActionRevalidation(1);
|
|
141
150
|
const encodedTag = encodeCacheTag(tag);
|
|
142
151
|
_markPendingRevalidatedTag(encodedTag);
|
|
143
|
-
return
|
|
152
|
+
return scheduleTagInvalidation(encodedTag);
|
|
144
153
|
}
|
|
145
154
|
/**
|
|
146
155
|
* Opt out of static rendering and indicate a particular component should not be cached.
|
|
@@ -464,4 +473,4 @@ function unstable_cache(fn, keyParts, options) {
|
|
|
464
473
|
return cachedFn;
|
|
465
474
|
}
|
|
466
475
|
//#endregion
|
|
467
|
-
export { ACTION_DID_REVALIDATE_DYNAMIC_ONLY, ACTION_DID_REVALIDATE_STATIC_AND_DYNAMIC, MemoryCacheHandler, NoOpCacheHandler, _captureRequestScopedCacheLifeAccessors, _consumeRequestScopedCacheLife, _drainPendingRevalidations, _hasPendingRevalidatedTag, _initRequestScopedCacheState, _markPendingRevalidatedTag, _peekRequestScopedCacheLife, _peekUnstableCacheObservations, _queuePendingRevalidation, _recordUseCacheRootParamRead, _registerCacheContextAccessor, _runWithCacheState, _setRequestScopedCacheLife, cacheLife, cacheLifeProfiles, cacheTag, configureMemoryCacheHandler, getAndClearActionRevalidationKind, getCacheHandler, getDataCacheHandler, getRegisteredCacheContext, getRequestExecutionContext, io, isInsideUnstableCacheScope, markActionRevalidation, unstable_noStore as noStore, unstable_noStore, recordUnstableCacheObservation, refresh, registerDataCacheHandler, registerLazyDataCacheHandler, revalidatePath, revalidateTag, runWithDetachedCacheObservations, runWithExecutionContext, setCacheHandler, setDataCacheHandler, shouldServeStaleUnstableCacheEntry, unstable_cache, unstable_cacheLife, unstable_cacheTag, unstable_io, updateTag };
|
|
476
|
+
export { ACTION_DID_REVALIDATE_DYNAMIC_ONLY, ACTION_DID_REVALIDATE_STATIC_AND_DYNAMIC, MemoryCacheHandler, NoOpCacheHandler, _captureRequestScopedCacheLifeAccessors, _consumeRequestScopedCacheLife, _drainPendingRevalidations, _hasPendingRevalidatedTag, _initRequestScopedCacheState, _markPendingRevalidatedTag, _peekRequestScopedCacheLife, _peekUnstableCacheObservations, _queuePendingCdnTagInvalidation, _queuePendingRevalidation, _recordUseCacheRootParamRead, _registerCacheContextAccessor, _revalidateCdnTags, _runWithCacheState, _setRequestScopedCacheLife, cacheLife, cacheLifeProfiles, cacheTag, configureMemoryCacheHandler, getAndClearActionRevalidationKind, getCacheHandler, getDataCacheHandler, getRegisteredCacheContext, getRequestExecutionContext, io, isInsideUnstableCacheScope, markActionRevalidation, unstable_noStore as noStore, unstable_noStore, recordUnstableCacheObservation, refresh, registerDataCacheHandler, registerLazyDataCacheHandler, revalidatePath, revalidateTag, runWithDetachedCacheObservations, runWithExecutionContext, setCacheHandler, setDataCacheHandler, shouldServeStaleUnstableCacheEntry, unstable_cache, unstable_cacheLife, unstable_cacheTag, unstable_io, updateTag };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
//#region src/shims/caught-not-found-boundaries.d.ts
|
|
3
|
+
export declare const CAUGHT_NOT_FOUND_BOUNDARIES_GLOBAL = "__VINEXT_CAUGHT_NOT_FOUND__";
|
|
4
|
+
/** The boundaries that caught, and those of them the document rendered. */
|
|
5
|
+
export type CaughtNotFoundBoundaries = {
|
|
6
|
+
ids: ReadonlySet<string>;
|
|
7
|
+
rendered: Set<string>;
|
|
8
|
+
};
|
|
9
|
+
export declare const CaughtNotFoundBoundariesContext: React.Context<CaughtNotFoundBoundaries | null> | null;
|
|
10
|
+
export declare function withCaughtNotFoundBoundaries(boundaries: CaughtNotFoundBoundaries, children: React.ReactElement): React.ReactElement;
|
|
11
|
+
/** Whether the boundary with this id caught a notFound() in the document. */
|
|
12
|
+
export declare function useCaughtNotFoundBoundary(id: string | undefined): boolean;
|
|
13
|
+
/** A hydrated boundary consumes its id, so a later mount renders its children. */
|
|
14
|
+
export declare function consumeCaughtNotFoundBoundary(id: string | undefined): void;
|
|
15
|
+
//#endregion
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
//#region src/shims/caught-not-found-boundaries.ts
|
|
3
|
+
/**
|
|
4
|
+
* The parallel slot not-found boundaries that caught a slot's notFound() in
|
|
5
|
+
* the document. Fizz has no error boundaries, so a slot page's notFound()
|
|
6
|
+
* rejects the shell; the App Router SSR entry then renders the document again
|
|
7
|
+
* from the same Flight payload, with the boundaries that would have caught it
|
|
8
|
+
* on the client rendering their fallback (Next.js renders them in the browser
|
|
9
|
+
* after an empty error shell). The browser reads the same ids from
|
|
10
|
+
* `self.__VINEXT_CAUGHT_NOT_FOUND__`, so those boundaries hydrate caught. Only
|
|
11
|
+
* the boundaries the document rendered are sent, since one inside another
|
|
12
|
+
* caught boundary never mounts to consume its id.
|
|
13
|
+
*
|
|
14
|
+
* Stored on a global symbol so duplicate module instances share one context,
|
|
15
|
+
* and null in react-server, which has no createContext.
|
|
16
|
+
*/
|
|
17
|
+
const CAUGHT_NOT_FOUND_BOUNDARIES_CONTEXT_KEY = Symbol.for("vinext.caughtNotFoundBoundariesContext");
|
|
18
|
+
const CAUGHT_NOT_FOUND_BOUNDARIES_GLOBAL = "__VINEXT_CAUGHT_NOT_FOUND__";
|
|
19
|
+
function getCaughtNotFoundBoundariesContext() {
|
|
20
|
+
if (typeof React.createContext !== "function") return null;
|
|
21
|
+
const globalState = globalThis;
|
|
22
|
+
globalState[CAUGHT_NOT_FOUND_BOUNDARIES_CONTEXT_KEY] ??= React.createContext(null);
|
|
23
|
+
return globalState[CAUGHT_NOT_FOUND_BOUNDARIES_CONTEXT_KEY];
|
|
24
|
+
}
|
|
25
|
+
const CaughtNotFoundBoundariesContext = getCaughtNotFoundBoundariesContext();
|
|
26
|
+
function withCaughtNotFoundBoundaries(boundaries, children) {
|
|
27
|
+
return CaughtNotFoundBoundariesContext ? React.createElement(CaughtNotFoundBoundariesContext.Provider, { value: boundaries }, children) : children;
|
|
28
|
+
}
|
|
29
|
+
/** Whether the boundary with this id caught a notFound() in the document. */
|
|
30
|
+
function useCaughtNotFoundBoundary(id) {
|
|
31
|
+
const serverBoundaries = React.useContext(CaughtNotFoundBoundariesContext);
|
|
32
|
+
if (id === void 0) return false;
|
|
33
|
+
if (typeof window === "undefined") {
|
|
34
|
+
if (serverBoundaries?.ids.has(id) !== true) return false;
|
|
35
|
+
serverBoundaries.rendered.add(id);
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
return globalThis[CAUGHT_NOT_FOUND_BOUNDARIES_GLOBAL]?.includes(id) === true;
|
|
39
|
+
}
|
|
40
|
+
/** A hydrated boundary consumes its id, so a later mount renders its children. */
|
|
41
|
+
function consumeCaughtNotFoundBoundary(id) {
|
|
42
|
+
if (id === void 0 || typeof window === "undefined") return;
|
|
43
|
+
const ids = globalThis[CAUGHT_NOT_FOUND_BOUNDARIES_GLOBAL];
|
|
44
|
+
const index = ids?.indexOf(id) ?? -1;
|
|
45
|
+
if (index !== -1) ids.splice(index, 1);
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { CAUGHT_NOT_FOUND_BOUNDARIES_GLOBAL, CaughtNotFoundBoundariesContext, consumeCaughtNotFoundBoundary, useCaughtNotFoundBoundary, withCaughtNotFoundBoundaries };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/shims/cdn-purge-routes.d.ts
|
|
2
|
+
type CdnPurgeRoute = {
|
|
3
|
+
patternParts: readonly string[];
|
|
4
|
+
routeSegments: readonly string[];
|
|
5
|
+
};
|
|
6
|
+
type CdnPurgeRoutes = {
|
|
7
|
+
metadataRoutes: readonly (Omit<CdnPurgeRoute, "patternParts"> & {
|
|
8
|
+
patternParts: readonly string[] | null;
|
|
9
|
+
servedUrl: string;
|
|
10
|
+
})[];
|
|
11
|
+
routes: readonly (CdnPurgeRoute & {
|
|
12
|
+
forceDynamic?: boolean;
|
|
13
|
+
})[];
|
|
14
|
+
};
|
|
15
|
+
/** Register the App Router's routes. Apps with a Pages Router never register. */
|
|
16
|
+
export declare function registerCdnPurgeRoutes(routes: CdnPurgeRoutes): void;
|
|
17
|
+
/**
|
|
18
|
+
* Whether no edge-cacheable response can carry the implicit tags of
|
|
19
|
+
* `revalidatePath(path)`, for any `type`. Paths that need encoding, the
|
|
20
|
+
* `/index` alias, and paths ending in a derived tag suffix (`/docs/page` is
|
|
21
|
+
* also the `/docs` page tag) always purge.
|
|
22
|
+
*/
|
|
23
|
+
export declare function isPathKnownNotEdgeCached(path: string): boolean;
|
|
24
|
+
//#endregion
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { matchRoutePatternPrefix, routePatternParts } from "../routing/route-pattern.js";
|
|
2
|
+
//#region src/shims/cdn-purge-routes.ts
|
|
3
|
+
/**
|
|
4
|
+
* Build-time route facts that let `revalidatePath()` skip a CDN purge no
|
|
5
|
+
* edge-cached response could match.
|
|
6
|
+
*
|
|
7
|
+
* Edge purges are rate limited (Workers Cache allows 5 a minute per account),
|
|
8
|
+
* and a `dynamic = "force-dynamic"` App route never stores a response the
|
|
9
|
+
* edge can serve. The check is conservative: it only skips a path when at
|
|
10
|
+
* least one App route could serve it and every such route is force-dynamic.
|
|
11
|
+
* The data cache is always invalidated.
|
|
12
|
+
*/
|
|
13
|
+
const CDN_PURGE_ROUTES_KEY = Symbol.for("vinext.cdnPurgeRoutes");
|
|
14
|
+
const globals = globalThis;
|
|
15
|
+
const DERIVED_TAG_SUFFIXES = /* @__PURE__ */ new Set([
|
|
16
|
+
"layout",
|
|
17
|
+
"page",
|
|
18
|
+
"route"
|
|
19
|
+
]);
|
|
20
|
+
/** Register the App Router's routes. Apps with a Pages Router never register. */
|
|
21
|
+
function registerCdnPurgeRoutes(routes) {
|
|
22
|
+
globals[CDN_PURGE_ROUTES_KEY] = routes;
|
|
23
|
+
}
|
|
24
|
+
/** Whether some URL matched by `patternParts` starts with `pathParts`. */
|
|
25
|
+
function canServeUnder(pathParts, patternParts) {
|
|
26
|
+
const last = patternParts.at(-1) ?? "";
|
|
27
|
+
const endsInCatchAll = last.startsWith(":") && (last.endsWith("+") || last.endsWith("*"));
|
|
28
|
+
if (patternParts.length < pathParts.length && !endsInCatchAll) return false;
|
|
29
|
+
return matchRoutePatternPrefix(pathParts, patternParts.slice(0, pathParts.length));
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Whether a response from `route` could carry a `revalidatePath(path)` tag.
|
|
33
|
+
* Implicit tags use either the URL (`/blog/a`) or the route's segments
|
|
34
|
+
* (`/(site)/blog/[slug]`), so check both as prefixes.
|
|
35
|
+
*/
|
|
36
|
+
function couldCarryPathTag(pathParts, route) {
|
|
37
|
+
return canServeUnder(pathParts, route.patternParts) || canServeUnder(pathParts, routePatternParts(route.routeSegments.join("/")));
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Whether a metadata route, or a child it generates (`/icon/small` from
|
|
41
|
+
* `generateImageMetadata`, `/sitemap/0.xml` from `generateSitemaps`), could
|
|
42
|
+
* carry a `revalidatePath(path)` tag.
|
|
43
|
+
*/
|
|
44
|
+
function metadataCouldCarryPathTag(pathParts, route) {
|
|
45
|
+
const patternParts = route.patternParts ?? routePatternParts(route.servedUrl);
|
|
46
|
+
const childParts = [
|
|
47
|
+
...patternParts.slice(0, -1),
|
|
48
|
+
(patternParts.at(-1) ?? "").replace(/\.[^.]*$/, ""),
|
|
49
|
+
":children*"
|
|
50
|
+
];
|
|
51
|
+
return couldCarryPathTag(pathParts, {
|
|
52
|
+
patternParts,
|
|
53
|
+
routeSegments: route.routeSegments
|
|
54
|
+
}) || canServeUnder(pathParts, childParts);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Whether no edge-cacheable response can carry the implicit tags of
|
|
58
|
+
* `revalidatePath(path)`, for any `type`. Paths that need encoding, the
|
|
59
|
+
* `/index` alias, and paths ending in a derived tag suffix (`/docs/page` is
|
|
60
|
+
* also the `/docs` page tag) always purge.
|
|
61
|
+
*/
|
|
62
|
+
function isPathKnownNotEdgeCached(path) {
|
|
63
|
+
const registered = globals[CDN_PURGE_ROUTES_KEY];
|
|
64
|
+
if (!registered || path === "/index" || /[^\x21-\x7e]|%/.test(path)) return false;
|
|
65
|
+
const pathParts = path.split("/").filter(Boolean);
|
|
66
|
+
if (DERIVED_TAG_SUFFIXES.has(pathParts.at(-1) ?? "")) return false;
|
|
67
|
+
if (registered.metadataRoutes.some((route) => metadataCouldCarryPathTag(pathParts, route))) return false;
|
|
68
|
+
let matched = false;
|
|
69
|
+
for (const route of registered.routes) {
|
|
70
|
+
if (!couldCarryPathTag(pathParts, route)) continue;
|
|
71
|
+
if (route.forceDynamic !== true) return false;
|
|
72
|
+
matched = true;
|
|
73
|
+
}
|
|
74
|
+
return matched;
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
export { isPathKnownNotEdgeCached, registerCdnPurgeRoutes };
|
|
@@ -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 {};
|
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
|
@@ -52,13 +52,26 @@ function normalizeDynamicOptions(dynamicInput, options) {
|
|
|
52
52
|
...options
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
function createLazyComponent(loader) {
|
|
56
|
-
return React.lazy(async () => {
|
|
55
|
+
function createLazyComponent(loader, share = (load) => load) {
|
|
56
|
+
return React.lazy(() => share((async () => {
|
|
57
57
|
const mod = await loader();
|
|
58
58
|
if (hasDefaultExport(mod)) return mod;
|
|
59
59
|
return { default: mod };
|
|
60
|
-
});
|
|
60
|
+
})()));
|
|
61
61
|
}
|
|
62
|
+
const SHARE_ISOLATE_PROMISE_KEY = Symbol.for("vinext.shareIsolatePromise");
|
|
63
|
+
/**
|
|
64
|
+
* The server React.lazy is created once per dynamic() call, so every request
|
|
65
|
+
* in the isolate renders the same load. On Workers, the request that starts it
|
|
66
|
+
* owns its I/O; if that request is canceled first, the load never settles and
|
|
67
|
+
* every later render of the component hangs. The server installs
|
|
68
|
+
* `shareIsolatePromise` on a global symbol, which keeps the starting request
|
|
69
|
+
* alive until the load settles, without this shim importing request state.
|
|
70
|
+
*/
|
|
71
|
+
const shareServerLoad = (load) => {
|
|
72
|
+
const share = globalThis[SHARE_ISOLATE_PROMISE_KEY];
|
|
73
|
+
return share ? share(load) : load;
|
|
74
|
+
};
|
|
62
75
|
function useRetryableLazyComponent(loader, initialLazyComponent) {
|
|
63
76
|
const [LazyComponent, setLazyComponent] = React.useState(() => initialLazyComponent);
|
|
64
77
|
const [retryKey, setRetryKey] = React.useState(0);
|
|
@@ -218,7 +231,7 @@ function dynamic(dynamicInput, options) {
|
|
|
218
231
|
AsyncServerDynamic.displayName = "DynamicAsyncServer";
|
|
219
232
|
return AsyncServerDynamic;
|
|
220
233
|
}
|
|
221
|
-
const LazyServer = createLazyComponent(loader);
|
|
234
|
+
const LazyServer = createLazyComponent(loader, shareServerLoad);
|
|
222
235
|
const ServerDynamic = (props) => {
|
|
223
236
|
const isAppRouterTree = useIsAppRouterTree();
|
|
224
237
|
const fallback = LoadingComponent ? React.createElement(LoadingComponent, createDynamicLoadingProps()) : null;
|
|
@@ -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 { decodeRedirectError, isRedirectError } from "./navigation-errors.js";
|
|
3
|
+
import { decodeRedirectError, forbidden, isRedirectError, notFound, unauthorized } from "./navigation-errors.js";
|
|
4
4
|
import "./navigation-server.js";
|
|
5
5
|
import { isRedirectToCurrentUrl, useErrorBoundaryPathname, useErrorBoundaryRouter } from "./error-boundary-navigation.js";
|
|
6
6
|
import DefaultGlobalError from "./default-global-error.js";
|
|
7
7
|
import { handleAppNavigationFailure } from "../client/app-nav-failure-handler.js";
|
|
8
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 };
|
|
@@ -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
|