vinext 0.0.49 → 0.0.51
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/dist/build/client-build-config.js.map +1 -1
- package/dist/build/google-fonts/build-url.js.map +1 -1
- package/dist/build/google-fonts/fallback-metrics-data.js +14031 -0
- package/dist/build/google-fonts/fallback-metrics-data.js.map +1 -0
- package/dist/build/google-fonts/fallback-metrics.d.ts +13 -0
- package/dist/build/google-fonts/fallback-metrics.js +46 -0
- package/dist/build/google-fonts/fallback-metrics.js.map +1 -0
- package/dist/build/google-fonts/get-axes.js.map +1 -1
- package/dist/build/google-fonts/sort-variants.js.map +1 -1
- package/dist/build/google-fonts/validate.js.map +1 -1
- package/dist/build/layout-classification.js.map +1 -1
- package/dist/build/nitro-route-rules.js.map +1 -1
- package/dist/build/precompress.d.ts +13 -2
- package/dist/build/precompress.js +12 -3
- package/dist/build/precompress.js.map +1 -1
- package/dist/build/prerender.d.ts +17 -1
- package/dist/build/prerender.js +114 -23
- package/dist/build/prerender.js.map +1 -1
- package/dist/build/report.d.ts +5 -4
- package/dist/build/report.js +196 -348
- package/dist/build/report.js.map +1 -1
- package/dist/build/route-classification-injector.js.map +1 -1
- package/dist/build/route-classification-manifest.js.map +1 -1
- package/dist/build/run-prerender.js.map +1 -1
- package/dist/build/server-manifest.js.map +1 -1
- package/dist/build/ssr-manifest.js.map +1 -1
- package/dist/build/standalone.js.map +1 -1
- package/dist/build/static-export.js.map +1 -1
- package/dist/check.js +2 -1
- package/dist/check.js.map +1 -1
- package/dist/cli-args.js.map +1 -1
- package/dist/cli.js +68 -7
- package/dist/cli.js.map +1 -1
- package/dist/client/instrumentation-client-state.js.map +1 -1
- package/dist/client/validate-module-path.js.map +1 -1
- package/dist/client/vinext-next-data.d.ts +5 -1
- package/dist/client/window-next.d.ts +151 -0
- package/dist/client/window-next.js +48 -0
- package/dist/client/window-next.js.map +1 -0
- package/dist/cloudflare/kv-cache-handler.js.map +1 -1
- package/dist/cloudflare/tpr.js +2 -1
- package/dist/cloudflare/tpr.js.map +1 -1
- package/dist/config/config-matchers.d.ts +3 -1
- package/dist/config/config-matchers.js +5 -4
- package/dist/config/config-matchers.js.map +1 -1
- package/dist/config/dotenv.d.ts +11 -1
- package/dist/config/dotenv.js.map +1 -1
- package/dist/config/next-config.d.ts +93 -6
- package/dist/config/next-config.js +233 -6
- package/dist/config/next-config.js.map +1 -1
- package/dist/config/tsconfig-paths.d.ts +13 -0
- package/dist/config/tsconfig-paths.js +117 -0
- package/dist/config/tsconfig-paths.js.map +1 -0
- package/dist/deploy.js +16 -7
- package/dist/deploy.js.map +1 -1
- package/dist/entries/app-browser-entry.d.ts +3 -1
- package/dist/entries/app-browser-entry.js +36 -2
- package/dist/entries/app-browser-entry.js.map +1 -1
- package/dist/entries/app-rsc-entry.d.ts +19 -1
- package/dist/entries/app-rsc-entry.js +49 -12
- package/dist/entries/app-rsc-entry.js.map +1 -1
- package/dist/entries/app-rsc-manifest.d.ts +9 -0
- package/dist/entries/app-rsc-manifest.js +8 -1
- package/dist/entries/app-rsc-manifest.js.map +1 -1
- package/dist/entries/app-ssr-entry.js.map +1 -1
- package/dist/entries/pages-client-entry.js +3 -5
- package/dist/entries/pages-client-entry.js.map +1 -1
- package/dist/entries/pages-entry-helpers.js.map +1 -1
- package/dist/entries/pages-server-entry.js +34 -1
- package/dist/entries/pages-server-entry.js.map +1 -1
- package/dist/entries/runtime-entry-module.js.map +1 -1
- package/dist/index.js +204 -53
- package/dist/index.js.map +1 -1
- package/dist/init.js.map +1 -1
- package/dist/plugins/async-hooks-stub.js.map +1 -1
- package/dist/plugins/client-reference-dedup.d.ts +15 -2
- package/dist/plugins/client-reference-dedup.js +138 -16
- package/dist/plugins/client-reference-dedup.js.map +1 -1
- package/dist/plugins/fonts.d.ts +2 -2
- package/dist/plugins/fonts.js +15 -6
- package/dist/plugins/fonts.js.map +1 -1
- package/dist/plugins/instrumentation-client.js.map +1 -1
- package/dist/plugins/og-assets.js.map +1 -1
- package/dist/plugins/optimize-imports.js.map +1 -1
- package/dist/plugins/postcss.js.map +1 -1
- package/dist/plugins/rsc-client-reference-loaders.d.ts +7 -0
- package/dist/plugins/rsc-client-reference-loaders.js +48 -0
- package/dist/plugins/rsc-client-reference-loaders.js.map +1 -0
- package/dist/plugins/rsc-client-shim-excludes.js.map +1 -1
- package/dist/plugins/sass.d.ts +34 -0
- package/dist/plugins/sass.js +22 -0
- package/dist/plugins/sass.js.map +1 -0
- package/dist/plugins/server-externals-manifest.js.map +1 -1
- package/dist/plugins/strip-server-exports.js.map +1 -1
- package/dist/routing/app-route-graph.d.ts +78 -6
- package/dist/routing/app-route-graph.js +241 -25
- package/dist/routing/app-route-graph.js.map +1 -1
- package/dist/routing/app-router.js.map +1 -1
- package/dist/routing/file-matcher.js.map +1 -1
- package/dist/routing/pages-router.js.map +1 -1
- package/dist/routing/route-matching.js.map +1 -1
- package/dist/routing/route-pattern.d.ts +56 -1
- package/dist/routing/route-pattern.js +60 -1
- package/dist/routing/route-pattern.js.map +1 -1
- package/dist/routing/route-trie.js.map +1 -1
- package/dist/routing/route-validation.js.map +1 -1
- package/dist/routing/utils.js.map +1 -1
- package/dist/server/api-handler.js.map +1 -1
- package/dist/server/app-browser-action-result.d.ts +44 -0
- package/dist/server/app-browser-action-result.js +79 -0
- package/dist/server/app-browser-action-result.js.map +1 -0
- package/dist/server/app-browser-entry.js +330 -133
- package/dist/server/app-browser-entry.js.map +1 -1
- package/dist/server/app-browser-error.js.map +1 -1
- package/dist/server/app-browser-hydration.d.ts +31 -0
- package/dist/server/app-browser-hydration.js +30 -0
- package/dist/server/app-browser-hydration.js.map +1 -0
- package/dist/server/app-browser-navigation-controller.d.ts +20 -4
- package/dist/server/app-browser-navigation-controller.js +90 -23
- package/dist/server/app-browser-navigation-controller.js.map +1 -1
- package/dist/server/app-browser-popstate.d.ts +16 -0
- package/dist/server/app-browser-popstate.js +17 -0
- package/dist/server/app-browser-popstate.js.map +1 -0
- package/dist/server/app-browser-rsc-redirect.d.ts +28 -0
- package/dist/server/app-browser-rsc-redirect.js +37 -0
- package/dist/server/app-browser-rsc-redirect.js.map +1 -0
- package/dist/server/app-browser-state.d.ts +27 -23
- package/dist/server/app-browser-state.js +158 -54
- package/dist/server/app-browser-state.js.map +1 -1
- package/dist/server/app-browser-stream.d.ts +9 -4
- package/dist/server/app-browser-stream.js +29 -8
- package/dist/server/app-browser-stream.js.map +1 -1
- package/dist/server/app-browser-visible-commit.d.ts +11 -1
- package/dist/server/app-browser-visible-commit.js +69 -21
- package/dist/server/app-browser-visible-commit.js.map +1 -1
- package/dist/server/app-client-reference-preloader.js.map +1 -1
- package/dist/server/app-elements-wire.d.ts +43 -6
- package/dist/server/app-elements-wire.js +121 -5
- package/dist/server/app-elements-wire.js.map +1 -1
- package/dist/server/app-elements.d.ts +2 -2
- package/dist/server/app-elements.js +2 -2
- package/dist/server/app-elements.js.map +1 -1
- package/dist/server/app-fallback-renderer.d.ts +10 -1
- package/dist/server/app-fallback-renderer.js +37 -1
- package/dist/server/app-fallback-renderer.js.map +1 -1
- package/dist/server/app-history-state.d.ts +26 -0
- package/dist/server/app-history-state.js +53 -0
- package/dist/server/app-history-state.js.map +1 -0
- package/dist/server/app-hook-warning-suppression.js.map +1 -1
- package/dist/server/app-middleware.d.ts +1 -1
- package/dist/server/app-middleware.js +4 -9
- package/dist/server/app-middleware.js.map +1 -1
- package/dist/server/app-mounted-slots-header.js.map +1 -1
- package/dist/server/app-page-boundary-render.d.ts +11 -1
- package/dist/server/app-page-boundary-render.js +27 -19
- package/dist/server/app-page-boundary-render.js.map +1 -1
- package/dist/server/app-page-boundary.d.ts +1 -0
- package/dist/server/app-page-boundary.js +10 -7
- package/dist/server/app-page-boundary.js.map +1 -1
- package/dist/server/app-page-cache.d.ts +23 -3
- package/dist/server/app-page-cache.js +63 -27
- package/dist/server/app-page-cache.js.map +1 -1
- package/dist/server/app-page-dispatch.d.ts +11 -1
- package/dist/server/app-page-dispatch.js +85 -14
- package/dist/server/app-page-dispatch.js.map +1 -1
- package/dist/server/app-page-element-builder.d.ts +10 -1
- package/dist/server/app-page-element-builder.js +38 -6
- package/dist/server/app-page-element-builder.js.map +1 -1
- package/dist/server/app-page-execution.js +2 -3
- package/dist/server/app-page-execution.js.map +1 -1
- package/dist/server/app-page-head.d.ts +7 -0
- package/dist/server/app-page-head.js +6 -1
- package/dist/server/app-page-head.js.map +1 -1
- package/dist/server/app-page-method.js.map +1 -1
- package/dist/server/app-page-params.js.map +1 -1
- package/dist/server/app-page-probe.d.ts +23 -1
- package/dist/server/app-page-probe.js +29 -1
- package/dist/server/app-page-probe.js.map +1 -1
- package/dist/server/app-page-render-observation.d.ts +35 -0
- package/dist/server/app-page-render-observation.js +68 -0
- package/dist/server/app-page-render-observation.js.map +1 -0
- package/dist/server/app-page-render.d.ts +12 -2
- package/dist/server/app-page-render.js +90 -7
- package/dist/server/app-page-render.js.map +1 -1
- package/dist/server/app-page-request.d.ts +1 -0
- package/dist/server/app-page-request.js +2 -1
- package/dist/server/app-page-request.js.map +1 -1
- package/dist/server/app-page-response.d.ts +2 -0
- package/dist/server/app-page-response.js +18 -7
- package/dist/server/app-page-response.js.map +1 -1
- package/dist/server/app-page-route-wiring.d.ts +9 -3
- package/dist/server/app-page-route-wiring.js +91 -62
- package/dist/server/app-page-route-wiring.js.map +1 -1
- package/dist/server/app-page-segment-state.d.ts +10 -0
- package/dist/server/app-page-segment-state.js +87 -0
- package/dist/server/app-page-segment-state.js.map +1 -0
- package/dist/server/app-page-stream.d.ts +9 -2
- package/dist/server/app-page-stream.js +4 -1
- package/dist/server/app-page-stream.js.map +1 -1
- package/dist/server/app-post-middleware-context.js.map +1 -1
- package/dist/server/app-prerender-endpoints.js.map +1 -1
- package/dist/server/app-prerender-static-params.js.map +1 -1
- package/dist/server/app-render-dependency.js.map +1 -1
- package/dist/server/app-request-context.js.map +1 -1
- package/dist/server/app-route-handler-cache.js.map +1 -1
- package/dist/server/app-route-handler-dispatch.js +3 -1
- package/dist/server/app-route-handler-dispatch.js.map +1 -1
- package/dist/server/app-route-handler-execution.js.map +1 -1
- package/dist/server/app-route-handler-policy.js +1 -0
- package/dist/server/app-route-handler-policy.js.map +1 -1
- package/dist/server/app-route-handler-response.js +4 -3
- package/dist/server/app-route-handler-response.js.map +1 -1
- package/dist/server/app-route-handler-runtime.js.map +1 -1
- package/dist/server/app-router-entry.js +7 -15
- package/dist/server/app-router-entry.js.map +1 -1
- package/dist/server/app-rsc-cache-busting.d.ts +23 -2
- package/dist/server/app-rsc-cache-busting.js +75 -19
- package/dist/server/app-rsc-cache-busting.js.map +1 -1
- package/dist/server/app-rsc-embedded-chunks.d.ts +9 -0
- package/dist/server/app-rsc-embedded-chunks.js +34 -0
- package/dist/server/app-rsc-embedded-chunks.js.map +1 -0
- package/dist/server/app-rsc-error-handler.js.map +1 -1
- package/dist/server/app-rsc-errors.d.ts +4 -1
- package/dist/server/app-rsc-errors.js +1 -1
- package/dist/server/app-rsc-errors.js.map +1 -1
- package/dist/server/app-rsc-handler.d.ts +18 -1
- package/dist/server/app-rsc-handler.js +55 -16
- package/dist/server/app-rsc-handler.js.map +1 -1
- package/dist/server/app-rsc-render-mode.d.ts +11 -0
- package/dist/server/app-rsc-render-mode.js +21 -0
- package/dist/server/app-rsc-render-mode.js.map +1 -0
- package/dist/server/app-rsc-request-normalization.d.ts +4 -1
- package/dist/server/app-rsc-request-normalization.js +7 -2
- package/dist/server/app-rsc-request-normalization.js.map +1 -1
- package/dist/server/app-rsc-response-finalizer.d.ts +2 -1
- package/dist/server/app-rsc-response-finalizer.js +6 -1
- package/dist/server/app-rsc-response-finalizer.js.map +1 -1
- package/dist/server/app-rsc-route-matching.d.ts +23 -0
- package/dist/server/app-rsc-route-matching.js +45 -23
- package/dist/server/app-rsc-route-matching.js.map +1 -1
- package/dist/server/app-segment-config.js.map +1 -1
- package/dist/server/app-server-action-execution.d.ts +51 -5
- package/dist/server/app-server-action-execution.js +161 -51
- package/dist/server/app-server-action-execution.js.map +1 -1
- package/dist/server/app-ssr-entry.d.ts +7 -0
- package/dist/server/app-ssr-entry.js +44 -14
- package/dist/server/app-ssr-entry.js.map +1 -1
- package/dist/server/app-ssr-error-meta.d.ts +14 -0
- package/dist/server/app-ssr-error-meta.js +50 -0
- package/dist/server/app-ssr-error-meta.js.map +1 -0
- package/dist/server/app-ssr-stream.d.ts +1 -1
- package/dist/server/app-ssr-stream.js +9 -12
- package/dist/server/app-ssr-stream.js.map +1 -1
- package/dist/server/app-static-generation.js.map +1 -1
- package/dist/server/artifact-compatibility.d.ts +12 -2
- package/dist/server/artifact-compatibility.js +12 -8
- package/dist/server/artifact-compatibility.js.map +1 -1
- package/dist/server/cache-control.js +1 -0
- package/dist/server/cache-control.js.map +1 -1
- package/dist/server/cache-proof.d.ts +124 -5
- package/dist/server/cache-proof.js +416 -18
- package/dist/server/cache-proof.js.map +1 -1
- package/dist/server/csp.js.map +1 -1
- package/dist/server/dev-error-overlay-store.js.map +1 -1
- package/dist/server/dev-error-overlay.js +5 -0
- package/dist/server/dev-error-overlay.js.map +1 -1
- package/dist/server/dev-lockfile.d.ts +110 -0
- package/dist/server/dev-lockfile.js +180 -0
- package/dist/server/dev-lockfile.js.map +1 -0
- package/dist/server/dev-module-runner.js.map +1 -1
- package/dist/server/dev-origin-check.js.map +1 -1
- package/dist/server/dev-route-files.js.map +1 -1
- package/dist/server/dev-server.js +23 -10
- package/dist/server/dev-server.js.map +1 -1
- package/dist/server/file-based-metadata.d.ts +13 -0
- package/dist/server/file-based-metadata.js +49 -2
- package/dist/server/file-based-metadata.js.map +1 -1
- package/dist/server/headers.d.ts +81 -0
- package/dist/server/headers.js +104 -0
- package/dist/server/headers.js.map +1 -0
- package/dist/server/html.js +1 -1
- package/dist/server/html.js.map +1 -1
- package/dist/server/http-error-responses.d.ts +10 -0
- package/dist/server/http-error-responses.js +11 -1
- package/dist/server/http-error-responses.js.map +1 -1
- package/dist/server/image-optimization.d.ts +11 -1
- package/dist/server/image-optimization.js.map +1 -1
- package/dist/server/implicit-tags.js +2 -1
- package/dist/server/implicit-tags.js.map +1 -1
- package/dist/server/instrumentation-runtime.js.map +1 -1
- package/dist/server/instrumentation.js.map +1 -1
- package/dist/server/isr-cache.d.ts +12 -2
- package/dist/server/isr-cache.js +16 -5
- package/dist/server/isr-cache.js.map +1 -1
- package/dist/server/metadata-route-build-data.js.map +1 -1
- package/dist/server/metadata-route-response.js +22 -5
- package/dist/server/metadata-route-response.js.map +1 -1
- package/dist/server/metadata-routes.js +27 -8
- package/dist/server/metadata-routes.js.map +1 -1
- package/dist/server/middleware-matcher.js.map +1 -1
- package/dist/server/middleware-request-headers.d.ts +4 -1
- package/dist/server/middleware-request-headers.js +15 -8
- package/dist/server/middleware-request-headers.js.map +1 -1
- package/dist/server/middleware-response-headers.d.ts +2 -1
- package/dist/server/middleware-response-headers.js +1 -1
- package/dist/server/middleware-response-headers.js.map +1 -1
- package/dist/server/middleware-runtime.d.ts +1 -0
- package/dist/server/middleware-runtime.js +7 -3
- package/dist/server/middleware-runtime.js.map +1 -1
- package/dist/server/middleware.d.ts +12 -0
- package/dist/server/middleware.js +12 -0
- package/dist/server/middleware.js.map +1 -1
- package/dist/server/navigation-planner.d.ts +133 -0
- package/dist/server/navigation-planner.js +432 -0
- package/dist/server/navigation-planner.js.map +1 -0
- package/dist/server/navigation-trace.d.ts +19 -2
- package/dist/server/navigation-trace.js +20 -1
- package/dist/server/navigation-trace.js.map +1 -1
- package/dist/server/next-error-digest.d.ts +3 -2
- package/dist/server/next-error-digest.js +4 -2
- package/dist/server/next-error-digest.js.map +1 -1
- package/dist/server/normalize-path.d.ts +2 -1
- package/dist/server/normalize-path.js +4 -1
- package/dist/server/normalize-path.js.map +1 -1
- package/dist/server/pages-api-route.js +1 -0
- package/dist/server/pages-api-route.js.map +1 -1
- package/dist/server/pages-i18n.js.map +1 -1
- package/dist/server/pages-media-type.js.map +1 -1
- package/dist/server/pages-node-compat.js.map +1 -1
- package/dist/server/pages-page-data.d.ts +3 -2
- package/dist/server/pages-page-data.js +27 -5
- package/dist/server/pages-page-data.js.map +1 -1
- package/dist/server/pages-page-response.js +2 -1
- package/dist/server/pages-page-response.js.map +1 -1
- package/dist/server/prerender-work-unit-setup.js +1 -1
- package/dist/server/prerender-work-unit-setup.js.map +1 -1
- package/dist/server/prod-server.d.ts +28 -1
- package/dist/server/prod-server.js +97 -22
- package/dist/server/prod-server.js.map +1 -1
- package/dist/server/request-log.js.map +1 -1
- package/dist/server/request-pipeline.d.ts +1 -13
- package/dist/server/request-pipeline.js +3 -25
- package/dist/server/request-pipeline.js.map +1 -1
- package/dist/server/rsc-stream-hints.js.map +1 -1
- package/dist/server/seed-cache.js.map +1 -1
- package/dist/server/server-action-not-found.d.ts +16 -3
- package/dist/server/server-action-not-found.js +22 -4
- package/dist/server/server-action-not-found.js.map +1 -1
- package/dist/server/server-globals.d.ts +5 -0
- package/dist/server/server-globals.js +37 -0
- package/dist/server/server-globals.js.map +1 -0
- package/dist/server/socket-error-backstop.js.map +1 -1
- package/dist/server/static-file-cache.js +1 -1
- package/dist/server/static-file-cache.js.map +1 -1
- package/dist/server/worker-utils.d.ts +0 -7
- package/dist/server/worker-utils.js +3 -2
- package/dist/server/worker-utils.js.map +1 -1
- package/dist/shims/amp.js.map +1 -1
- package/dist/shims/app.d.ts +37 -4
- package/dist/shims/app.js +50 -1
- package/dist/shims/app.js.map +1 -0
- package/dist/shims/cache-for-request.js.map +1 -1
- package/dist/shims/cache-runtime.d.ts +19 -2
- package/dist/shims/cache-runtime.js +87 -19
- package/dist/shims/cache-runtime.js.map +1 -1
- package/dist/shims/cache.d.ts +20 -21
- package/dist/shims/cache.js +101 -15
- package/dist/shims/cache.js.map +1 -1
- package/dist/shims/client-hook-error.js.map +1 -1
- package/dist/shims/compat-router.js.map +1 -1
- package/dist/shims/config.js.map +1 -1
- package/dist/shims/constants.js.map +1 -1
- package/dist/shims/document.js.map +1 -1
- package/dist/shims/dynamic.d.ts +18 -10
- package/dist/shims/dynamic.js +107 -51
- package/dist/shims/dynamic.js.map +1 -1
- package/dist/shims/error-boundary.d.ts +35 -6
- package/dist/shims/error-boundary.js +116 -33
- package/dist/shims/error-boundary.js.map +1 -1
- package/dist/shims/error.d.ts +18 -1
- package/dist/shims/error.js +56 -1
- package/dist/shims/error.js.map +1 -1
- package/dist/shims/fetch-cache.d.ts +25 -1
- package/dist/shims/fetch-cache.js +159 -13
- package/dist/shims/fetch-cache.js.map +1 -1
- package/dist/shims/font-google-base.d.ts +22 -8
- package/dist/shims/font-google-base.js +41 -71
- package/dist/shims/font-google-base.js.map +1 -1
- package/dist/shims/font-local.d.ts +3 -20
- package/dist/shims/font-local.js +23 -75
- package/dist/shims/font-local.js.map +1 -1
- package/dist/shims/font-utils.d.ts +51 -0
- package/dist/shims/font-utils.js +97 -0
- package/dist/shims/font-utils.js.map +1 -0
- package/dist/shims/form.js +3 -1
- package/dist/shims/form.js.map +1 -1
- package/dist/shims/hash-scroll.d.ts +7 -0
- package/dist/shims/hash-scroll.js +30 -0
- package/dist/shims/hash-scroll.js.map +1 -0
- package/dist/shims/head-state.js.map +1 -1
- package/dist/shims/head.d.ts +3 -1
- package/dist/shims/head.js +28 -16
- package/dist/shims/head.js.map +1 -1
- package/dist/shims/headers.d.ts +11 -12
- package/dist/shims/headers.js +45 -8
- package/dist/shims/headers.js.map +1 -1
- package/dist/shims/i18n-context.js.map +1 -1
- package/dist/shims/i18n-state.js.map +1 -1
- package/dist/shims/image-config.d.ts +14 -1
- package/dist/shims/image-config.js +24 -1
- package/dist/shims/image-config.js.map +1 -1
- package/dist/shims/image.d.ts +1 -0
- package/dist/shims/image.js +159 -80
- package/dist/shims/image.js.map +1 -1
- package/dist/shims/internal/als-registry.js.map +1 -1
- package/dist/shims/internal/app-router-context.d.ts +7 -6
- package/dist/shims/internal/app-router-context.js +17 -6
- package/dist/shims/internal/app-router-context.js.map +1 -1
- package/dist/shims/internal/cookie-serialize.js.map +1 -1
- package/dist/shims/internal/make-hanging-promise.d.ts +1 -1
- package/dist/shims/internal/make-hanging-promise.js +1 -1
- package/dist/shims/internal/make-hanging-promise.js.map +1 -1
- package/dist/shims/internal/parse-cookie-header.js.map +1 -1
- package/dist/shims/internal/utils.js.map +1 -1
- package/dist/shims/internal/work-unit-async-storage.js +2 -2
- package/dist/shims/internal/work-unit-async-storage.js.map +1 -1
- package/dist/shims/layout-segment-context.js.map +1 -1
- package/dist/shims/legacy-image.js.map +1 -1
- package/dist/shims/link-prefetch.d.ts +42 -0
- package/dist/shims/link-prefetch.js +45 -0
- package/dist/shims/link-prefetch.js.map +1 -0
- package/dist/shims/link.d.ts +37 -4
- package/dist/shims/link.js +156 -46
- package/dist/shims/link.js.map +1 -1
- package/dist/shims/metadata.d.ts +16 -30
- package/dist/shims/metadata.js +87 -28
- package/dist/shims/metadata.js.map +1 -1
- package/dist/shims/navigation-state.js.map +1 -1
- package/dist/shims/navigation.d.ts +172 -10
- package/dist/shims/navigation.js +335 -70
- package/dist/shims/navigation.js.map +1 -1
- package/dist/shims/navigation.react-server.d.ts +3 -2
- package/dist/shims/navigation.react-server.js +5 -2
- package/dist/shims/navigation.react-server.js.map +1 -1
- package/dist/shims/offline.js.map +1 -1
- package/dist/shims/pages-router-runtime.d.ts +7 -0
- package/dist/shims/pages-router-runtime.js +16 -0
- package/dist/shims/pages-router-runtime.js.map +1 -0
- package/dist/shims/readonly-url-search-params.js.map +1 -1
- package/dist/shims/request-context.js.map +1 -1
- package/dist/shims/root-params.js.map +1 -1
- package/dist/shims/router-state.js.map +1 -1
- package/dist/shims/router.d.ts +69 -7
- package/dist/shims/router.js +232 -249
- package/dist/shims/router.js.map +1 -1
- package/dist/shims/script-nonce-context.js.map +1 -1
- package/dist/shims/script.js +110 -32
- package/dist/shims/script.js.map +1 -1
- package/dist/shims/server.js +12 -15
- package/dist/shims/server.js.map +1 -1
- package/dist/shims/slot.d.ts +7 -1
- package/dist/shims/slot.js +60 -7
- package/dist/shims/slot.js.map +1 -1
- package/dist/shims/thenable-params.js.map +1 -1
- package/dist/shims/unified-request-context.js +5 -0
- package/dist/shims/unified-request-context.js.map +1 -1
- package/dist/shims/unrecognized-action-error.d.ts +35 -0
- package/dist/shims/unrecognized-action-error.js +41 -0
- package/dist/shims/unrecognized-action-error.js.map +1 -0
- package/dist/shims/url-safety.js.map +1 -1
- package/dist/shims/url-utils.d.ts +22 -1
- package/dist/shims/url-utils.js +76 -3
- package/dist/shims/url-utils.js.map +1 -1
- package/dist/shims/use-merged-ref.js.map +1 -1
- package/dist/shims/web-vitals.d.ts +4 -21
- package/dist/shims/web-vitals.js +19 -6
- package/dist/shims/web-vitals.js.map +1 -1
- package/dist/utils/asset-prefix.d.ts +69 -0
- package/dist/utils/asset-prefix.js +91 -0
- package/dist/utils/asset-prefix.js.map +1 -0
- package/dist/utils/base-path.d.ts +7 -1
- package/dist/utils/base-path.js +10 -1
- package/dist/utils/base-path.js.map +1 -1
- package/dist/utils/cache-control-metadata.js.map +1 -1
- package/dist/utils/domain-locale.js.map +1 -1
- package/dist/utils/encode-cache-tag.d.ts +31 -0
- package/dist/utils/encode-cache-tag.js +38 -0
- package/dist/utils/encode-cache-tag.js.map +1 -0
- package/dist/utils/error-cause.js.map +1 -1
- package/dist/utils/hash.js.map +1 -1
- package/dist/utils/lazy-chunks.js.map +1 -1
- package/dist/utils/manifest-paths.js.map +1 -1
- package/dist/utils/mdx-scan.js.map +1 -1
- package/dist/utils/navigation-signal.d.ts +5 -0
- package/dist/utils/navigation-signal.js +14 -0
- package/dist/utils/navigation-signal.js.map +1 -0
- package/dist/utils/project.js.map +1 -1
- package/dist/utils/public-routes.js.map +1 -1
- package/dist/utils/query.js.map +1 -1
- package/dist/utils/safe-json-file.js.map +1 -1
- package/dist/utils/sorted-array.d.ts +9 -0
- package/dist/utils/sorted-array.js +22 -0
- package/dist/utils/sorted-array.js.map +1 -0
- package/dist/utils/text-stream.js.map +1 -1
- package/dist/utils/vinext-root.js.map +1 -1
- package/package.json +8 -6
|
@@ -3,7 +3,23 @@ import { ValidFileMatcher } from "./file-matcher.js";
|
|
|
3
3
|
//#region src/routing/app-route-graph.d.ts
|
|
4
4
|
type InterceptingRoute = {
|
|
5
5
|
/** The interception convention: "." | ".." | "../.." | "..." */convention: string; /** The URL pattern this intercepts (e.g. "/photos/:id") */
|
|
6
|
-
targetPattern: string;
|
|
6
|
+
targetPattern: string;
|
|
7
|
+
/**
|
|
8
|
+
* URL pattern of the *intercepting route* — the path that owns the slot
|
|
9
|
+
* containing this interception marker, with route groups and `@slot`
|
|
10
|
+
* segments stripped. Mirrors Next.js' `interceptingRoute` from
|
|
11
|
+
* `extractInterceptionRouteInformation`.
|
|
12
|
+
*
|
|
13
|
+
* Used at request time to gate `findIntercept` against the Next-URL /
|
|
14
|
+
* interception-context header: an intercept only fires when the source
|
|
15
|
+
* pathname matches `^<sourceMatchPattern>(?:/.*)?$`. Without this gate
|
|
16
|
+
* a direct RSC fetch to the intercept target would render the modal
|
|
17
|
+
* instead of the underlying page.
|
|
18
|
+
*
|
|
19
|
+
* @see https://github.com/vercel/next.js/blob/canary/packages/next/src/lib/generate-interception-routes-rewrites.ts
|
|
20
|
+
* @see https://github.com/vercel/next.js/blob/canary/packages/next/src/shared/lib/router/utils/interception-routes.ts
|
|
21
|
+
*/
|
|
22
|
+
sourceMatchPattern: string; /** Absolute path to the intercepting page component */
|
|
7
23
|
pagePath: string; /** Absolute layout paths inside the intercepting route tree, outermost to innermost */
|
|
8
24
|
layoutPaths: string[]; /** Parameter names for dynamic segments */
|
|
9
25
|
params: string[];
|
|
@@ -12,7 +28,9 @@ type ParallelSlot = {
|
|
|
12
28
|
/** Graph-owned semantic slot identity. Required on AppRouteGraphParallelSlot. */id?: string; /** Stable slot identity (name + owning directory), used for route serialization keys. */
|
|
13
29
|
key: string; /** Slot name (e.g. "team" from @team) */
|
|
14
30
|
name: string; /** Absolute path to the @slot directory that owns this slot. Internal routing metadata. */
|
|
15
|
-
ownerDir: string; /**
|
|
31
|
+
ownerDir: string; /** Stable tree path for the directory whose layout owns this slot. */
|
|
32
|
+
ownerTreePath: string; /** Whether the slot owner directory declares its own page component. */
|
|
33
|
+
hasPage: boolean; /** Absolute path to the slot's page component */
|
|
16
34
|
pagePath: string | null; /** Absolute path to the slot's default.tsx fallback */
|
|
17
35
|
defaultPath: string | null; /** Absolute path to the slot's layout component (wraps slot content) */
|
|
18
36
|
layoutPath: string | null; /** Absolute path to the slot's loading component */
|
|
@@ -61,10 +79,10 @@ type AppRoute = {
|
|
|
61
79
|
* Per-layout error boundary paths, aligned with the layouts array.
|
|
62
80
|
* Each entry is the error.tsx at the same directory level as the
|
|
63
81
|
* corresponding layout (or null if that level has no error.tsx).
|
|
64
|
-
* Used to interleave ErrorBoundary components with layouts so that
|
|
65
|
-
* ancestor error boundaries catch errors from descendant segments.
|
|
66
82
|
*/
|
|
67
|
-
layoutErrorPaths: (string | null)[]; /**
|
|
83
|
+
layoutErrorPaths: (string | null)[]; /** Per-segment error boundary paths, aligned with errorTreePositions. */
|
|
84
|
+
errorPaths?: string[]; /** Tree position (directory depth from app/ root) for each error boundary. */
|
|
85
|
+
errorTreePositions?: number[]; /** Not-found component path (nearest, walking up from page dir) */
|
|
68
86
|
notFoundPath: string | null;
|
|
69
87
|
/**
|
|
70
88
|
* Not-found component paths per layout level (aligned with layouts array).
|
|
@@ -161,11 +179,60 @@ type RouteManifestTemplate = {
|
|
|
161
179
|
id: string;
|
|
162
180
|
treePath: string;
|
|
163
181
|
rootBoundaryId: RootBoundaryId | null;
|
|
182
|
+
ownerLayoutId: string | null;
|
|
183
|
+
reset: {
|
|
184
|
+
kind: "remountSubtree";
|
|
185
|
+
treePath: string;
|
|
186
|
+
};
|
|
164
187
|
};
|
|
165
188
|
type RouteManifestSlot = {
|
|
166
189
|
id: string;
|
|
167
190
|
key: string;
|
|
168
191
|
name: string;
|
|
192
|
+
ownerTreePath: string;
|
|
193
|
+
ownerLayoutId: string | null;
|
|
194
|
+
rootBoundaryId: RootBoundaryId | null;
|
|
195
|
+
defaultId: string | null;
|
|
196
|
+
hasDefault: boolean;
|
|
197
|
+
hasPage: boolean;
|
|
198
|
+
};
|
|
199
|
+
type RouteManifestDefault = {
|
|
200
|
+
id: string;
|
|
201
|
+
slotId: string;
|
|
202
|
+
ownerTreePath: string;
|
|
203
|
+
ownerLayoutId: string | null;
|
|
204
|
+
rootBoundaryId: RootBoundaryId | null;
|
|
205
|
+
};
|
|
206
|
+
type RouteManifestSlotBindingState = "active" | "default" | "unmatched";
|
|
207
|
+
type RouteManifestSlotBinding = {
|
|
208
|
+
id: string;
|
|
209
|
+
routeId: string;
|
|
210
|
+
slotId: string;
|
|
211
|
+
ownerLayoutId: string | null;
|
|
212
|
+
state: RouteManifestSlotBindingState;
|
|
213
|
+
defaultId: string | null;
|
|
214
|
+
routeSegments: readonly string[] | null;
|
|
215
|
+
slotPatternParts?: readonly string[];
|
|
216
|
+
slotParamNames?: readonly string[];
|
|
217
|
+
};
|
|
218
|
+
type RouteManifestInterception = {
|
|
219
|
+
id: string;
|
|
220
|
+
sourcePattern: string;
|
|
221
|
+
sourcePatternParts: readonly string[];
|
|
222
|
+
targetPattern: string;
|
|
223
|
+
targetPatternParts: readonly string[];
|
|
224
|
+
slotId: string;
|
|
225
|
+
ownerLayoutId: string | null;
|
|
226
|
+
interceptingRouteId: string | null;
|
|
227
|
+
targetRouteId: string | null;
|
|
228
|
+
};
|
|
229
|
+
type RouteManifestBoundaryOutcome = "error" | "forbidden" | "notFound" | "unauthorized";
|
|
230
|
+
type RouteManifestBoundary = {
|
|
231
|
+
id: string;
|
|
232
|
+
outcome: RouteManifestBoundaryOutcome;
|
|
233
|
+
treePath: string;
|
|
234
|
+
ownerLayoutId: string | null;
|
|
235
|
+
rootBoundaryId: RootBoundaryId | null;
|
|
169
236
|
};
|
|
170
237
|
type RouteManifestRootBoundary = {
|
|
171
238
|
id: RootBoundaryId;
|
|
@@ -179,6 +246,11 @@ type StaticSegmentGraph = {
|
|
|
179
246
|
layouts: ReadonlyMap<string, RouteManifestLayout>;
|
|
180
247
|
templates: ReadonlyMap<string, RouteManifestTemplate>;
|
|
181
248
|
slots: ReadonlyMap<string, RouteManifestSlot>;
|
|
249
|
+
defaults: ReadonlyMap<string, RouteManifestDefault>;
|
|
250
|
+
slotBindings: ReadonlyMap<string, RouteManifestSlotBinding>;
|
|
251
|
+
interceptions: ReadonlyMap<string, RouteManifestInterception>;
|
|
252
|
+
interceptionsBySlotId: ReadonlyMap<string, readonly RouteManifestInterception[]>;
|
|
253
|
+
boundaries: ReadonlyMap<string, RouteManifestBoundary>;
|
|
182
254
|
rootBoundaries: ReadonlyMap<RootBoundaryId, RouteManifestRootBoundary>;
|
|
183
255
|
};
|
|
184
256
|
type RouteManifest = {
|
|
@@ -191,5 +263,5 @@ declare function buildAppRouteGraph(appDir: string, matcher: ValidFileMatcher):
|
|
|
191
263
|
}>;
|
|
192
264
|
declare function computeRootParamNames(routeSegments: readonly string[], layoutTreePositions: readonly number[]): string[];
|
|
193
265
|
//#endregion
|
|
194
|
-
export { AppRoute, AppRouteGraphParallelSlot, AppRouteGraphRoute, AppRouteSemanticIds, GraphVersion, InterceptingRoute, ParallelSlot, RootBoundaryId, RouteManifest, RouteManifestLayout, RouteManifestPage, RouteManifestRootBoundary, RouteManifestRoute, RouteManifestRouteHandler, RouteManifestSlot, RouteManifestTemplate, StaticSegmentGraph, buildAppRouteGraph, computeRootParamNames };
|
|
266
|
+
export { AppRoute, AppRouteGraphParallelSlot, AppRouteGraphRoute, AppRouteSemanticIds, GraphVersion, InterceptingRoute, ParallelSlot, RootBoundaryId, RouteManifest, RouteManifestBoundary, RouteManifestBoundaryOutcome, RouteManifestDefault, RouteManifestInterception, RouteManifestLayout, RouteManifestPage, RouteManifestRootBoundary, RouteManifestRoute, RouteManifestRouteHandler, RouteManifestSlot, RouteManifestSlotBinding, RouteManifestSlotBindingState, RouteManifestTemplate, StaticSegmentGraph, buildAppRouteGraph, computeRootParamNames };
|
|
195
267
|
//# sourceMappingURL=app-route-graph.d.ts.map
|
|
@@ -29,6 +29,12 @@ function createAppRouteGraphTemplateId(treePath) {
|
|
|
29
29
|
function createAppRouteGraphSlotId(slotName, ownerTreePath) {
|
|
30
30
|
return `slot:${slotName}:${ownerTreePath}`;
|
|
31
31
|
}
|
|
32
|
+
function createAppRouteGraphDefaultId(slotId) {
|
|
33
|
+
return `default:${slotId}`;
|
|
34
|
+
}
|
|
35
|
+
function createAppRouteGraphInterceptionId(slotId, sourcePattern, targetPattern) {
|
|
36
|
+
return `interception:${slotId}:${sourcePattern}->${targetPattern}`;
|
|
37
|
+
}
|
|
32
38
|
function createAppRouteGraphRootBoundaryId(treePath) {
|
|
33
39
|
return `root-boundary:${treePath}`;
|
|
34
40
|
}
|
|
@@ -54,7 +60,12 @@ function createStaticSegmentGraph(routes) {
|
|
|
54
60
|
const layouts = /* @__PURE__ */ new Map();
|
|
55
61
|
const templates = /* @__PURE__ */ new Map();
|
|
56
62
|
const slots = /* @__PURE__ */ new Map();
|
|
63
|
+
const defaults = /* @__PURE__ */ new Map();
|
|
64
|
+
const slotBindings = /* @__PURE__ */ new Map();
|
|
65
|
+
const interceptions = /* @__PURE__ */ new Map();
|
|
66
|
+
const boundaries = /* @__PURE__ */ new Map();
|
|
57
67
|
const rootBoundaries = /* @__PURE__ */ new Map();
|
|
68
|
+
const routeIdByPattern = createRouteManifestRouteIdByPattern(routes);
|
|
58
69
|
for (const route of routes) {
|
|
59
70
|
routeEntries.set(route.ids.route, {
|
|
60
71
|
id: route.ids.route,
|
|
@@ -86,10 +97,18 @@ function createStaticSegmentGraph(routes) {
|
|
|
86
97
|
const treePath = createAppRouteGraphTreePath(route.routeSegments, treePosition);
|
|
87
98
|
const existingLayout = layouts.get(layoutId);
|
|
88
99
|
if (existingLayout) assertRouteManifestRootBoundary("layout", route, layoutId, existingLayout.rootBoundaryId);
|
|
89
|
-
|
|
100
|
+
const layout = {
|
|
90
101
|
id: layoutId,
|
|
91
102
|
treePath,
|
|
92
103
|
rootBoundaryId: route.ids.rootBoundary
|
|
104
|
+
};
|
|
105
|
+
layouts.set(layoutId, layout);
|
|
106
|
+
addRouteManifestBoundaryFacts({
|
|
107
|
+
boundaries,
|
|
108
|
+
route,
|
|
109
|
+
layoutId,
|
|
110
|
+
treePath,
|
|
111
|
+
layoutIndex: index
|
|
93
112
|
});
|
|
94
113
|
if (index === 0 && route.ids.rootBoundary) rootBoundaries.set(route.ids.rootBoundary, {
|
|
95
114
|
id: route.ids.rootBoundary,
|
|
@@ -97,22 +116,58 @@ function createStaticSegmentGraph(routes) {
|
|
|
97
116
|
treePath
|
|
98
117
|
});
|
|
99
118
|
}
|
|
119
|
+
addRouteManifestSegmentErrorBoundaryFacts({
|
|
120
|
+
boundaries,
|
|
121
|
+
route
|
|
122
|
+
});
|
|
100
123
|
for (const [index, templateId] of route.ids.templates.entries()) {
|
|
101
124
|
const treePosition = route.templateTreePositions?.[index];
|
|
102
125
|
assertRouteManifestTreePosition("template", route, templateId, treePosition);
|
|
126
|
+
const treePath = createAppRouteGraphTreePath(route.routeSegments, treePosition);
|
|
103
127
|
const existingTemplate = templates.get(templateId);
|
|
104
128
|
if (existingTemplate) assertRouteManifestRootBoundary("template", route, templateId, existingTemplate.rootBoundaryId);
|
|
105
129
|
templates.set(templateId, {
|
|
106
130
|
id: templateId,
|
|
107
|
-
treePath
|
|
108
|
-
rootBoundaryId: route.ids.rootBoundary
|
|
131
|
+
treePath,
|
|
132
|
+
rootBoundaryId: route.ids.rootBoundary,
|
|
133
|
+
ownerLayoutId: findRouteManifestOwnerLayoutId(route, treePosition),
|
|
134
|
+
reset: {
|
|
135
|
+
kind: "remountSubtree",
|
|
136
|
+
treePath
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
for (const slot of route.parallelSlots) {
|
|
141
|
+
const ownerLayoutId = findSlotOwnerLayoutId(route, slot);
|
|
142
|
+
const defaultId = slot.defaultPath ? createAppRouteGraphDefaultId(slot.id) : null;
|
|
143
|
+
slots.set(slot.id, {
|
|
144
|
+
id: slot.id,
|
|
145
|
+
key: slot.key,
|
|
146
|
+
name: slot.name,
|
|
147
|
+
ownerTreePath: slot.ownerTreePath,
|
|
148
|
+
ownerLayoutId,
|
|
149
|
+
rootBoundaryId: ownerLayoutId ? route.ids.rootBoundary : null,
|
|
150
|
+
defaultId,
|
|
151
|
+
hasDefault: slot.defaultPath !== null,
|
|
152
|
+
hasPage: slot.hasPage
|
|
153
|
+
});
|
|
154
|
+
if (defaultId) defaults.set(defaultId, {
|
|
155
|
+
id: defaultId,
|
|
156
|
+
slotId: slot.id,
|
|
157
|
+
ownerTreePath: slot.ownerTreePath,
|
|
158
|
+
ownerLayoutId,
|
|
159
|
+
rootBoundaryId: ownerLayoutId ? route.ids.rootBoundary : null
|
|
160
|
+
});
|
|
161
|
+
const binding = createRouteManifestSlotBinding(route, slot, ownerLayoutId, defaultId);
|
|
162
|
+
slotBindings.set(binding.id, binding);
|
|
163
|
+
addRouteManifestInterceptionFacts({
|
|
164
|
+
interceptions,
|
|
165
|
+
ownerLayoutId,
|
|
166
|
+
route,
|
|
167
|
+
routeIdByPattern,
|
|
168
|
+
slot
|
|
109
169
|
});
|
|
110
170
|
}
|
|
111
|
-
for (const slot of route.parallelSlots) slots.set(slot.id, {
|
|
112
|
-
id: slot.id,
|
|
113
|
-
key: slot.key,
|
|
114
|
-
name: slot.name
|
|
115
|
-
});
|
|
116
171
|
}
|
|
117
172
|
return {
|
|
118
173
|
routes: routeEntries,
|
|
@@ -121,13 +176,114 @@ function createStaticSegmentGraph(routes) {
|
|
|
121
176
|
layouts,
|
|
122
177
|
templates,
|
|
123
178
|
slots,
|
|
179
|
+
defaults,
|
|
180
|
+
slotBindings,
|
|
181
|
+
interceptions,
|
|
182
|
+
interceptionsBySlotId: createRouteManifestInterceptionsBySlotId(interceptions),
|
|
183
|
+
boundaries,
|
|
124
184
|
rootBoundaries
|
|
125
185
|
};
|
|
126
186
|
}
|
|
187
|
+
function createRouteManifestRouteIdByPattern(routes) {
|
|
188
|
+
return new Map(routes.map((route) => [route.pattern, route.ids.route]));
|
|
189
|
+
}
|
|
190
|
+
function findRouteManifestOwnerLayoutId(route, treePosition) {
|
|
191
|
+
const layoutIndex = route.layoutTreePositions.indexOf(treePosition);
|
|
192
|
+
return route.ids.layouts[layoutIndex] ?? null;
|
|
193
|
+
}
|
|
194
|
+
function findSlotOwnerLayoutId(route, slot) {
|
|
195
|
+
if (slot.layoutIndex < 0) return null;
|
|
196
|
+
return route.ids.layouts[slot.layoutIndex] ?? null;
|
|
197
|
+
}
|
|
198
|
+
function createRouteManifestSlotBinding(route, slot, ownerLayoutId, defaultId) {
|
|
199
|
+
const state = getRouteManifestSlotBindingState(slot);
|
|
200
|
+
const binding = {
|
|
201
|
+
id: `${route.ids.route}::${slot.id}`,
|
|
202
|
+
routeId: route.ids.route,
|
|
203
|
+
slotId: slot.id,
|
|
204
|
+
ownerLayoutId,
|
|
205
|
+
state,
|
|
206
|
+
defaultId: state === "default" ? defaultId : null,
|
|
207
|
+
routeSegments: slot.routeSegments ? [...slot.routeSegments] : null
|
|
208
|
+
};
|
|
209
|
+
if (slot.slotPatternParts) binding.slotPatternParts = [...slot.slotPatternParts];
|
|
210
|
+
if (slot.slotParamNames) binding.slotParamNames = [...slot.slotParamNames];
|
|
211
|
+
return binding;
|
|
212
|
+
}
|
|
213
|
+
function addRouteManifestInterceptionFacts(input) {
|
|
214
|
+
for (const interception of input.slot.interceptingRoutes) {
|
|
215
|
+
const id = createAppRouteGraphInterceptionId(input.slot.id, interception.sourceMatchPattern, interception.targetPattern);
|
|
216
|
+
input.interceptions.set(id, {
|
|
217
|
+
id,
|
|
218
|
+
sourcePattern: interception.sourceMatchPattern,
|
|
219
|
+
sourcePatternParts: splitRouteManifestPatternParts(interception.sourceMatchPattern),
|
|
220
|
+
targetPattern: interception.targetPattern,
|
|
221
|
+
targetPatternParts: splitRouteManifestPatternParts(interception.targetPattern),
|
|
222
|
+
slotId: input.slot.id,
|
|
223
|
+
ownerLayoutId: input.ownerLayoutId,
|
|
224
|
+
interceptingRouteId: input.routeIdByPattern.get(interception.sourceMatchPattern) ?? null,
|
|
225
|
+
targetRouteId: input.routeIdByPattern.get(interception.targetPattern) ?? null
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
function createRouteManifestInterceptionsBySlotId(interceptions) {
|
|
230
|
+
const interceptionsBySlotId = /* @__PURE__ */ new Map();
|
|
231
|
+
for (const interception of interceptions.values()) {
|
|
232
|
+
const existing = interceptionsBySlotId.get(interception.slotId);
|
|
233
|
+
if (existing) existing.push(interception);
|
|
234
|
+
else interceptionsBySlotId.set(interception.slotId, [interception]);
|
|
235
|
+
}
|
|
236
|
+
for (const slotInterceptions of interceptionsBySlotId.values()) slotInterceptions.sort((left, right) => compareStableStrings(left.id, right.id));
|
|
237
|
+
return new Map(Array.from(interceptionsBySlotId.entries()).sort(([left], [right]) => compareStableStrings(left, right)));
|
|
238
|
+
}
|
|
239
|
+
function splitRouteManifestPatternParts(pattern) {
|
|
240
|
+
return pattern.split("/").filter((part) => part.length > 0);
|
|
241
|
+
}
|
|
242
|
+
function getRouteManifestSlotBindingState(slot) {
|
|
243
|
+
if (slot.pagePath) return "active";
|
|
244
|
+
if (slot.defaultPath) return "default";
|
|
245
|
+
return "unmatched";
|
|
246
|
+
}
|
|
247
|
+
function addRouteManifestBoundaryFacts(input) {
|
|
248
|
+
addRouteManifestBoundaryFact(input, "error", input.route.layoutErrorPaths[input.layoutIndex]);
|
|
249
|
+
addRouteManifestBoundaryFact(input, "notFound", input.route.notFoundPaths[input.layoutIndex]);
|
|
250
|
+
addRouteManifestBoundaryFact(input, "forbidden", input.route.forbiddenPaths[input.layoutIndex]);
|
|
251
|
+
addRouteManifestBoundaryFact(input, "unauthorized", input.route.unauthorizedPaths[input.layoutIndex]);
|
|
252
|
+
}
|
|
253
|
+
function addRouteManifestSegmentErrorBoundaryFacts(input) {
|
|
254
|
+
for (const [index, boundaryPath] of (input.route.errorPaths ?? []).entries()) {
|
|
255
|
+
const treePosition = input.route.errorTreePositions?.[index];
|
|
256
|
+
assertRouteManifestBoundaryTreePosition(input.route, boundaryPath, treePosition);
|
|
257
|
+
const ownerLayoutId = findRouteManifestOwnerLayoutId(input.route, treePosition);
|
|
258
|
+
if (ownerLayoutId !== null) continue;
|
|
259
|
+
const treePath = createAppRouteGraphTreePath(input.route.routeSegments, treePosition);
|
|
260
|
+
addRouteManifestBoundaryFact({
|
|
261
|
+
boundaries: input.boundaries,
|
|
262
|
+
route: input.route,
|
|
263
|
+
layoutId: ownerLayoutId,
|
|
264
|
+
treePath
|
|
265
|
+
}, "error", boundaryPath);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
function addRouteManifestBoundaryFact(input, outcome, boundaryPath) {
|
|
269
|
+
if (!boundaryPath) return;
|
|
270
|
+
const id = `boundary:${outcome}:${input.treePath}`;
|
|
271
|
+
input.boundaries.set(id, {
|
|
272
|
+
id,
|
|
273
|
+
outcome,
|
|
274
|
+
treePath: input.treePath,
|
|
275
|
+
ownerLayoutId: input.layoutId,
|
|
276
|
+
rootBoundaryId: input.route.ids.rootBoundary
|
|
277
|
+
});
|
|
278
|
+
}
|
|
127
279
|
function assertRouteManifestTreePosition(kind, route, id, treePosition) {
|
|
128
280
|
if (treePosition !== void 0) return;
|
|
129
281
|
throw new Error(`[vinext] App route graph invariant violated: missing ${kind} tree position for ${id} on ${route.pattern}`);
|
|
130
282
|
}
|
|
283
|
+
function assertRouteManifestBoundaryTreePosition(route, boundaryPath, treePosition) {
|
|
284
|
+
if (treePosition !== void 0) return;
|
|
285
|
+
throw new Error(`[vinext] App route graph invariant violated: missing boundary tree position for ${boundaryPath} on ${route.pattern}`);
|
|
286
|
+
}
|
|
131
287
|
function assertRouteManifestRootBoundary(kind, route, id, existingRootBoundaryId) {
|
|
132
288
|
if (existingRootBoundaryId === route.ids.rootBoundary) return;
|
|
133
289
|
throw new Error(`[vinext] App route graph invariant violated: ${kind} ${id} is shared across root boundaries (${existingRootBoundaryId ?? "none"} and ${route.ids.rootBoundary ?? "none"}) on ${route.pattern}`);
|
|
@@ -140,6 +296,11 @@ function createRouteManifestGraphVersion(segmentGraph) {
|
|
|
140
296
|
layouts: sortedMapValues(segmentGraph.layouts),
|
|
141
297
|
templates: sortedMapValues(segmentGraph.templates),
|
|
142
298
|
slots: sortedMapValues(segmentGraph.slots),
|
|
299
|
+
defaults: sortedMapValues(segmentGraph.defaults),
|
|
300
|
+
slotBindings: sortedMapValues(segmentGraph.slotBindings),
|
|
301
|
+
interceptions: sortedMapValues(segmentGraph.interceptions),
|
|
302
|
+
interceptionsBySlotId: sortedMapValues(segmentGraph.interceptionsBySlotId),
|
|
303
|
+
boundaries: sortedMapValues(segmentGraph.boundaries),
|
|
143
304
|
rootBoundaries: sortedMapValues(segmentGraph.rootBoundaries)
|
|
144
305
|
};
|
|
145
306
|
return `graph:${createHash("sha256").update(JSON.stringify(stableShape)).digest("hex")}`;
|
|
@@ -383,6 +544,9 @@ function directoryToAppRoute(dir, appDir, matcher, pagePath, routePath) {
|
|
|
383
544
|
const templateTreePositions = computeLayoutTreePositions(appDir, templates);
|
|
384
545
|
const layoutTreePositions = computeLayoutTreePositions(appDir, layouts);
|
|
385
546
|
const layoutErrorPaths = discoverLayoutAlignedErrors(segments, appDir, matcher);
|
|
547
|
+
const errorEntries = discoverSegmentErrors(segments, appDir, matcher);
|
|
548
|
+
const errorPaths = errorEntries.map((entry) => entry.path);
|
|
549
|
+
const errorTreePositions = errorEntries.map((entry) => entry.treePosition);
|
|
386
550
|
const routeDir = dir === "." ? appDir : path.join(appDir, dir);
|
|
387
551
|
const loadingPath = findFile(routeDir, "loading", matcher);
|
|
388
552
|
const errorPath = findFile(routeDir, "error", matcher);
|
|
@@ -412,6 +576,8 @@ function directoryToAppRoute(dir, appDir, matcher, pagePath, routePath) {
|
|
|
412
576
|
loadingPath,
|
|
413
577
|
errorPath,
|
|
414
578
|
layoutErrorPaths,
|
|
579
|
+
errorPaths,
|
|
580
|
+
errorTreePositions,
|
|
415
581
|
notFoundPath,
|
|
416
582
|
notFoundPaths,
|
|
417
583
|
forbiddenPaths,
|
|
@@ -512,15 +678,39 @@ function discoverTemplates(segments, appDir, matcher) {
|
|
|
512
678
|
return templates;
|
|
513
679
|
}
|
|
514
680
|
/**
|
|
681
|
+
* Discover error.tsx files by segment tree position.
|
|
682
|
+
*
|
|
683
|
+
* Next.js stores conventions on every loader-tree segment; a route-group
|
|
684
|
+
* directory with error.tsx but no sibling layout.tsx must still wrap its
|
|
685
|
+
* descendants. Keeping positions explicit avoids conflating segment boundaries
|
|
686
|
+
* with layout component ownership.
|
|
687
|
+
*/
|
|
688
|
+
function discoverSegmentErrors(segments, appDir, matcher) {
|
|
689
|
+
const errors = [];
|
|
690
|
+
const rootError = findFile(appDir, "error", matcher);
|
|
691
|
+
if (rootError) errors.push({
|
|
692
|
+
path: rootError,
|
|
693
|
+
treePosition: 0
|
|
694
|
+
});
|
|
695
|
+
let currentDir = appDir;
|
|
696
|
+
for (let index = 0; index < segments.length; index++) {
|
|
697
|
+
const segment = segments[index];
|
|
698
|
+
currentDir = path.join(currentDir, segment);
|
|
699
|
+
const error = findFile(currentDir, "error", matcher);
|
|
700
|
+
if (error) errors.push({
|
|
701
|
+
path: error,
|
|
702
|
+
treePosition: index + 1
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
return errors;
|
|
706
|
+
}
|
|
707
|
+
/**
|
|
515
708
|
* Discover error.tsx files aligned with the layouts array.
|
|
516
|
-
* Walks the same directory levels as discoverLayouts and, for each level
|
|
517
|
-
* that contributes a layout entry, checks whether error.tsx also exists.
|
|
518
|
-
* Returns an array of the same length as discoverLayouts() would return,
|
|
519
|
-
* with the error path (or null) at each corresponding layout level.
|
|
520
709
|
*
|
|
521
|
-
*
|
|
522
|
-
*
|
|
523
|
-
*
|
|
710
|
+
* Route manifests still model layout-owned boundary facts by layout index.
|
|
711
|
+
* Keep this layout-aligned compatibility shape separate from segment-owned
|
|
712
|
+
* error boundaries so route-group errors without layouts do not get attributed
|
|
713
|
+
* to unrelated layouts.
|
|
524
714
|
*/
|
|
525
715
|
function discoverLayoutAlignedErrors(segments, appDir, matcher) {
|
|
526
716
|
const errors = [];
|
|
@@ -764,6 +954,8 @@ function discoverParallelSlots(dir, appDir, matcher) {
|
|
|
764
954
|
key: `${slotName}@${path.relative(appDir, slotDir).replace(/\\/g, "/")}`,
|
|
765
955
|
name: slotName,
|
|
766
956
|
ownerDir: slotDir,
|
|
957
|
+
ownerTreePath,
|
|
958
|
+
hasPage: pagePath !== null,
|
|
767
959
|
pagePath,
|
|
768
960
|
defaultPath,
|
|
769
961
|
layoutPath: findFile(slotDir, "layout", matcher),
|
|
@@ -828,7 +1020,7 @@ function scanForInterceptingPages(currentDir, routeDir, appDir, results, matcher
|
|
|
828
1020
|
if (interceptMatch) {
|
|
829
1021
|
const restOfName = entry.name.slice(interceptMatch.prefix.length);
|
|
830
1022
|
const interceptDir = path.join(currentDir, entry.name);
|
|
831
|
-
collectInterceptingPages(interceptDir, interceptDir, interceptMatch.convention, restOfName, routeDir, appDir, results, matcher);
|
|
1023
|
+
collectInterceptingPages(interceptDir, interceptDir, interceptMatch.convention, restOfName, routeDir, appDir, currentDir, results, matcher);
|
|
832
1024
|
} else scanForInterceptingPages(path.join(currentDir, entry.name), routeDir, appDir, results, matcher);
|
|
833
1025
|
}
|
|
834
1026
|
}
|
|
@@ -843,29 +1035,53 @@ function matchInterceptConvention(name) {
|
|
|
843
1035
|
* Collect page.tsx files inside an intercepting route directory tree
|
|
844
1036
|
* and compute their target URL patterns.
|
|
845
1037
|
*/
|
|
846
|
-
function collectInterceptingPages(currentDir, interceptRoot, convention, interceptSegment, routeDir, appDir, results, matcher, parentLayoutPaths = []) {
|
|
1038
|
+
function collectInterceptingPages(currentDir, interceptRoot, convention, interceptSegment, routeDir, appDir, interceptParentDir, results, matcher, parentLayoutPaths = []) {
|
|
847
1039
|
const currentLayoutPath = findFile(currentDir, "layout", matcher);
|
|
848
1040
|
const layoutPaths = currentLayoutPath ? [...parentLayoutPaths, currentLayoutPath] : parentLayoutPaths;
|
|
849
1041
|
const page = findFile(currentDir, "page", matcher);
|
|
850
1042
|
if (page) {
|
|
851
1043
|
const targetPattern = computeInterceptTarget(convention, interceptSegment, currentDir, interceptRoot, routeDir, appDir);
|
|
852
|
-
if (targetPattern)
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
1044
|
+
if (targetPattern) {
|
|
1045
|
+
const sourceMatchPattern = computeInterceptSourceMatchPattern(interceptParentDir, appDir);
|
|
1046
|
+
results.push({
|
|
1047
|
+
convention,
|
|
1048
|
+
layoutPaths: [...layoutPaths],
|
|
1049
|
+
targetPattern: targetPattern.pattern,
|
|
1050
|
+
sourceMatchPattern,
|
|
1051
|
+
pagePath: page,
|
|
1052
|
+
params: targetPattern.params
|
|
1053
|
+
});
|
|
1054
|
+
}
|
|
859
1055
|
}
|
|
860
1056
|
if (!fs.existsSync(currentDir)) return;
|
|
861
1057
|
const entries = fs.readdirSync(currentDir, { withFileTypes: true });
|
|
862
1058
|
for (const entry of entries) {
|
|
863
1059
|
if (!entry.isDirectory()) continue;
|
|
864
1060
|
if (entry.name.startsWith("_")) continue;
|
|
865
|
-
collectInterceptingPages(path.join(currentDir, entry.name), interceptRoot, convention, interceptSegment, routeDir, appDir, results, matcher, layoutPaths);
|
|
1061
|
+
collectInterceptingPages(path.join(currentDir, entry.name), interceptRoot, convention, interceptSegment, routeDir, appDir, interceptParentDir, results, matcher, layoutPaths);
|
|
866
1062
|
}
|
|
867
1063
|
}
|
|
868
1064
|
/**
|
|
1065
|
+
* Compute the URL pattern for the *intercepting route* — the path that
|
|
1066
|
+
* owns the slot containing the interception marker. Route groups (`(name)`)
|
|
1067
|
+
* and parallel slots (`@slot`) are stripped because Next.js'
|
|
1068
|
+
* `normalizeAppPath` treats them as invisible in the URL.
|
|
1069
|
+
*
|
|
1070
|
+
* Mirrors Next.js' computation in `extractInterceptionRouteInformation`:
|
|
1071
|
+
* `interceptingRoute = normalizeAppPath(path.split(marker, 2)[0])`.
|
|
1072
|
+
*
|
|
1073
|
+
* Returns `/` for the app root.
|
|
1074
|
+
*
|
|
1075
|
+
* @see https://github.com/vercel/next.js/blob/canary/packages/next/src/shared/lib/router/utils/interception-routes.ts
|
|
1076
|
+
*/
|
|
1077
|
+
function computeInterceptSourceMatchPattern(interceptParentDir, appDir) {
|
|
1078
|
+
const segments = path.relative(appDir, interceptParentDir).split(path.sep).filter(Boolean);
|
|
1079
|
+
const converted = convertSegmentsToRouteParts(segments);
|
|
1080
|
+
const urlSegments = converted ? converted.urlSegments : segments.filter((segment) => !isInvisibleSegment(segment));
|
|
1081
|
+
if (urlSegments.length === 0) return "/";
|
|
1082
|
+
return "/" + urlSegments.join("/");
|
|
1083
|
+
}
|
|
1084
|
+
/**
|
|
869
1085
|
* Check whether a path segment is invisible in the URL (route groups, parallel slots, ".").
|
|
870
1086
|
*
|
|
871
1087
|
* Used by computeInterceptTarget, convertSegmentsToRouteParts, and
|