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/cli-args.d.ts
CHANGED
package/dist/cli.js
CHANGED
|
@@ -125,6 +125,7 @@ async function proxyVite(command) {
|
|
|
125
125
|
async function start() {
|
|
126
126
|
const parsed = parseArgs(rawArgs);
|
|
127
127
|
if (parsed.help) return printHelp("start");
|
|
128
|
+
if (!process.env.NODE_ENV) Reflect.set(process.env, "NODE_ENV", "production");
|
|
128
129
|
loadDotenv({
|
|
129
130
|
root: process.cwd(),
|
|
130
131
|
mode: "production"
|
|
@@ -194,6 +195,7 @@ async function check() {
|
|
|
194
195
|
async function typegen() {
|
|
195
196
|
const parsed = parseArgs(rawArgs);
|
|
196
197
|
if (parsed.help) return printHelp("typegen");
|
|
198
|
+
if (!process.env.NODE_ENV) Reflect.set(process.env, "NODE_ENV", "production");
|
|
197
199
|
const root = path.resolve(parsed.positionals?.[0] ?? process.cwd());
|
|
198
200
|
loadDotenv({
|
|
199
201
|
root,
|
|
@@ -11,7 +11,8 @@ function getMatcherRule(redirect) {
|
|
|
11
11
|
has: redirect.has,
|
|
12
12
|
missing: redirect.missing,
|
|
13
13
|
locale: redirect.locale,
|
|
14
|
-
basePath: redirect.basePath
|
|
14
|
+
basePath: redirect.basePath,
|
|
15
|
+
defaultLocaleVariant: redirect.defaultLocaleVariant
|
|
15
16
|
}];
|
|
16
17
|
matcherRules.set(redirect, rule);
|
|
17
18
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NextRedirect, ResolvedNextConfig } from "../config/next-config.js";
|
|
2
2
|
import { ClientHasCondition } from "./client-rewrites.js";
|
|
3
3
|
//#region src/client/client-redirects.d.ts
|
|
4
|
-
type ClientRedirectFields = Pick<NextRedirect, "basePath" | "locale" | "source"> & {
|
|
4
|
+
type ClientRedirectFields = Pick<NextRedirect, "basePath" | "defaultLocaleVariant" | "locale" | "source"> & {
|
|
5
5
|
has?: ClientHasCondition[];
|
|
6
6
|
missing?: ClientHasCondition[];
|
|
7
7
|
};
|
|
@@ -16,7 +16,7 @@ type ClientRedirectFields = Pick<NextRedirect, "basePath" | "locale" | "source">
|
|
|
16
16
|
*/
|
|
17
17
|
export type ClientRedirect = (ClientRedirectFields & {
|
|
18
18
|
destination: string;
|
|
19
|
-
permanent
|
|
19
|
+
permanent?: boolean;
|
|
20
20
|
requiresServerEvaluation?: never;
|
|
21
21
|
}) | (ClientRedirectFields & {
|
|
22
22
|
destination?: never;
|
|
@@ -24,4 +24,5 @@ export type ClientRedirect = (ClientRedirectFields & {
|
|
|
24
24
|
requiresServerEvaluation: true;
|
|
25
25
|
});
|
|
26
26
|
export declare function toClientRedirects(redirects: ResolvedNextConfig["redirects"]): ClientRedirect[];
|
|
27
|
-
//#endregion
|
|
27
|
+
//#endregion
|
|
28
|
+
export {};
|
|
@@ -9,7 +9,8 @@ function toClientRedirect(redirect) {
|
|
|
9
9
|
has: clientHas?.length ? clientHas : void 0,
|
|
10
10
|
missing: clientMissing?.length ? clientMissing : void 0,
|
|
11
11
|
locale: redirect.locale,
|
|
12
|
-
basePath: redirect.basePath
|
|
12
|
+
basePath: redirect.basePath,
|
|
13
|
+
defaultLocaleVariant: redirect.defaultLocaleVariant
|
|
13
14
|
};
|
|
14
15
|
if (hasServerOnlyCondition) return {
|
|
15
16
|
...common,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/client/client-rewrite-params.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Whether a rewrite to `destination` appends the source `params` to its
|
|
4
|
+
* query. Next.js does that when the destination's path, host and hash use
|
|
5
|
+
* none of them, for each param its query does not already name; the Pages
|
|
6
|
+
* router's sync rewrite path does not, so it defers these rewrites.
|
|
7
|
+
*/
|
|
8
|
+
export declare function clientRewriteAppendsParams(destination: string, params: Record<string, string>): boolean;
|
|
9
|
+
//#endregion
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/client/client-rewrite-params.ts
|
|
2
|
+
/**
|
|
3
|
+
* Whether a rewrite to `destination` appends the source `params` to its
|
|
4
|
+
* query. Next.js does that when the destination's path, host and hash use
|
|
5
|
+
* none of them, for each param its query does not already name; the Pages
|
|
6
|
+
* router's sync rewrite path does not, so it defers these rewrites.
|
|
7
|
+
*/
|
|
8
|
+
function clientRewriteAppendsParams(destination, params) {
|
|
9
|
+
const keys = Object.keys(params).filter((key) => key !== "nextInternalLocale");
|
|
10
|
+
if (keys.length === 0) return false;
|
|
11
|
+
const hashIndex = destination.indexOf("#");
|
|
12
|
+
const beforeHash = hashIndex === -1 ? destination : destination.slice(0, hashIndex);
|
|
13
|
+
const queryIndex = beforeHash.indexOf("?");
|
|
14
|
+
const withoutQuery = (queryIndex === -1 ? beforeHash : beforeHash.slice(0, queryIndex)) + (hashIndex === -1 ? "" : destination.slice(hashIndex));
|
|
15
|
+
if (keys.some((key) => new RegExp(`:${key}(?![A-Za-z0-9_])`).test(withoutQuery))) return false;
|
|
16
|
+
const queryKeys = new Set(queryIndex === -1 ? [] : new URLSearchParams(beforeHash.slice(queryIndex + 1)).keys());
|
|
17
|
+
return keys.some((key) => !queryKeys.has(key));
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { clientRewriteAppendsParams };
|
|
@@ -28,4 +28,5 @@ export type ClientRewrites = {
|
|
|
28
28
|
};
|
|
29
29
|
export declare function isClientHasCondition(condition: HasCondition): condition is ClientHasCondition;
|
|
30
30
|
export declare function toClientRewrites(rewrites: ResolvedNextConfig["rewrites"]): ClientRewrites;
|
|
31
|
-
//#endregion
|
|
31
|
+
//#endregion
|
|
32
|
+
export {};
|
|
@@ -26,11 +26,12 @@ function installDevErrorOverlay() {
|
|
|
26
26
|
installed = true;
|
|
27
27
|
window.addEventListener("error", (event) => {
|
|
28
28
|
const err = event.error;
|
|
29
|
+
if (!err) return;
|
|
29
30
|
if (isNavigationSignalError(err)) return;
|
|
30
31
|
if (err instanceof Error) {
|
|
31
32
|
if (alreadyReported(err)) return;
|
|
32
33
|
reportDevError(err, { source: "window-error" });
|
|
33
|
-
} else
|
|
34
|
+
} else reportDevError(event.message ? new Error(event.message) : err, { source: "window-error" });
|
|
34
35
|
});
|
|
35
36
|
window.addEventListener("unhandledrejection", (event) => {
|
|
36
37
|
const reason = event.reason;
|
package/dist/client/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { getVinextReact };
|
|
1
|
+
export { getVinextReact } from "./react-instance.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
//#region src/client/instrumentation-client-state.ts
|
|
2
|
-
|
|
2
|
+
const VINEXT_CLIENT_INSTRUMENTATION_HOOKS = Symbol.for("vinext.client.instrumentationHooks");
|
|
3
3
|
function normalizeClientInstrumentationHooks(hooks) {
|
|
4
4
|
return Object.values(hooks).some((value) => typeof value === "function") ? hooks : null;
|
|
5
5
|
}
|
|
6
6
|
function setClientInstrumentationHooks(hooks) {
|
|
7
|
-
|
|
8
|
-
return
|
|
7
|
+
Reflect.set(globalThis, VINEXT_CLIENT_INSTRUMENTATION_HOOKS, hooks);
|
|
8
|
+
return hooks;
|
|
9
9
|
}
|
|
10
10
|
function getClientInstrumentationHooks() {
|
|
11
|
-
return
|
|
11
|
+
return Reflect.get(globalThis, VINEXT_CLIENT_INSTRUMENTATION_HOOKS) ?? null;
|
|
12
12
|
}
|
|
13
13
|
function notifyAppRouterTransitionStart(href, navigationType) {
|
|
14
|
-
|
|
14
|
+
getClientInstrumentationHooks()?.onRouterTransitionStart?.(href, navigationType);
|
|
15
15
|
}
|
|
16
16
|
//#endregion
|
|
17
17
|
export { getClientInstrumentationHooks, normalizeClientInstrumentationHooks, notifyAppRouterTransitionStart, setClientInstrumentationHooks };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BrowserRouteManifest, BrowserRouteManifestWire } from "../routing/browser-route-manifest.js";
|
|
2
2
|
import { AppRouterScrollIntent } from "../shims/app-router-scroll-state.js";
|
|
3
3
|
//#region src/client/navigation-runtime.d.ts
|
|
4
4
|
type NavigationRuntimeSnapshot = {
|
|
@@ -7,6 +7,8 @@ type NavigationRuntimeSnapshot = {
|
|
|
7
7
|
};
|
|
8
8
|
export type NavigationRuntimeRscChunk = string | [3, string];
|
|
9
9
|
export type NavigationRuntimeRscBootstrap = {
|
|
10
|
+
/** The server's App Router RSC compatibility ID for this page. */
|
|
11
|
+
compatibilityId?: string;
|
|
10
12
|
done?: boolean;
|
|
11
13
|
dynamicStaleTimeSeconds?: number;
|
|
12
14
|
initialCacheKind?: "dynamic" | "static";
|
|
@@ -68,9 +70,15 @@ export type NavigationRuntimeFunctions = {
|
|
|
68
70
|
* committing writes its URL first, as Next.js does from an insertion effect.
|
|
69
71
|
*/
|
|
70
72
|
flushCommittingNavigationUrl?: () => void;
|
|
73
|
+
/**
|
|
74
|
+
* Starts loading the browser RouteManifest chunk, or joins the load in
|
|
75
|
+
* progress. Returns null once the manifest is registered. Created by
|
|
76
|
+
* createNavigationRuntimeRouteManifestLoader.
|
|
77
|
+
*/
|
|
78
|
+
loadRouteManifest?: () => Promise<boolean> | null;
|
|
71
79
|
};
|
|
72
80
|
export type NavigationRuntimeBootstrap = {
|
|
73
|
-
routeManifest:
|
|
81
|
+
routeManifest: BrowserRouteManifest | null;
|
|
74
82
|
rsc: NavigationRuntimeRscBootstrap | undefined;
|
|
75
83
|
};
|
|
76
84
|
export type NavigationRuntime = {
|
|
@@ -78,10 +86,26 @@ export type NavigationRuntime = {
|
|
|
78
86
|
functions: NavigationRuntimeFunctions;
|
|
79
87
|
};
|
|
80
88
|
export declare const NAVIGATION_RUNTIME_KEY: unique symbol;
|
|
89
|
+
export declare function isNavigationRuntimeFunctions(value: unknown): value is NavigationRuntimeFunctions;
|
|
81
90
|
export declare function getNavigationRuntime(): NavigationRuntime | null;
|
|
82
91
|
export declare function registerNavigationRuntimeBootstrap(bootstrap: Partial<NavigationRuntimeBootstrap>): NavigationRuntime;
|
|
83
92
|
export declare function registerNavigationRuntimeFunctions(functions: Partial<NavigationRuntimeFunctions>): NavigationRuntime;
|
|
84
93
|
export declare function ensureNavigationRuntimeRscBootstrap(): NavigationRuntimeRscBootstrap;
|
|
94
|
+
/**
|
|
95
|
+
* The browser entry does not inline the RouteManifest: the manifest grows with
|
|
96
|
+
* every route of the app, so it lives in its own chunk that loads alongside
|
|
97
|
+
* hydration. The navigation planner needs it to classify commits (root layout
|
|
98
|
+
* changes, intercepted payloads, preserved slots), so navigations, commits and
|
|
99
|
+
* prefetches that read it wait for this load first.
|
|
100
|
+
*/
|
|
101
|
+
export declare function createNavigationRuntimeRouteManifestLoader(importManifest: () => Promise<{
|
|
102
|
+
default: BrowserRouteManifestWire | null;
|
|
103
|
+
}>): () => Promise<boolean> | null;
|
|
104
|
+
/**
|
|
105
|
+
* Starts or joins the RouteManifest load. Resolves whether it loaded, and
|
|
106
|
+
* returns null once it has (or when no App Router runtime registered a loader).
|
|
107
|
+
*/
|
|
108
|
+
export declare function loadNavigationRuntimeRouteManifest(): Promise<boolean> | null;
|
|
85
109
|
export declare function hasAppNavigationRuntime(): boolean;
|
|
86
110
|
/**
|
|
87
111
|
* True when the App Router has installed its runtime bootstrap on `window`,
|
|
@@ -96,4 +120,5 @@ export declare function hasAppNavigationRuntime(): boolean;
|
|
|
96
120
|
* tag) should call this instead.
|
|
97
121
|
*/
|
|
98
122
|
export declare function hasAppNavigationRuntimeBootstrap(): boolean;
|
|
99
|
-
//#endregion
|
|
123
|
+
//#endregion
|
|
124
|
+
export {};
|
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
import { isUnknownRecord } from "../utils/record.js";
|
|
2
|
+
import { decodeBrowserRouteManifest } from "../routing/browser-route-manifest.js";
|
|
2
3
|
import { NAVIGATION_RUNTIME_SYMBOL_DESCRIPTION } from "./browser-globals.js";
|
|
3
4
|
//#region src/client/navigation-runtime.ts
|
|
4
5
|
const NAVIGATION_RUNTIME_KEY = Symbol.for(NAVIGATION_RUNTIME_SYMBOL_DESCRIPTION);
|
|
5
6
|
const ROUTE_MANIFEST_SEGMENT_GRAPH_MAP_KEYS = [
|
|
6
|
-
"boundaries",
|
|
7
|
-
"defaults",
|
|
8
7
|
"interceptions",
|
|
9
8
|
"interceptionsBySlotId",
|
|
10
9
|
"layouts",
|
|
11
|
-
"pages",
|
|
12
10
|
"rootBoundaries",
|
|
13
|
-
"routeHandlers",
|
|
14
11
|
"routes",
|
|
15
|
-
"slotBindings"
|
|
16
|
-
"slots",
|
|
17
|
-
"templates"
|
|
12
|
+
"slotBindings"
|
|
18
13
|
];
|
|
19
14
|
function createNavigationRuntime() {
|
|
20
15
|
return {
|
|
@@ -31,7 +26,7 @@ function readRuntimeWindow() {
|
|
|
31
26
|
}
|
|
32
27
|
function isNavigationRuntimeFunctions(value) {
|
|
33
28
|
if (!isUnknownRecord(value)) return false;
|
|
34
|
-
return isOptionalRuntimeFunction(Reflect.get(value, "clearNavigationCaches")) && isOptionalRuntimeFunction(Reflect.get(value, "commitHashNavigation")) && isOptionalRuntimeFunction(Reflect.get(value, "navigateExternal")) && isOptionalRuntimeFunction(Reflect.get(value, "navigate")) && isOptionalRuntimeFunction(Reflect.get(value, "getPrefetchRouterState")) && isOptionalRuntimeFunction(Reflect.get(value, "notifyLinkNavigationStart")) && isOptionalRuntimeFunction(Reflect.get(value, "pingVisibleLinks")) && isOptionalRuntimeFunction(Reflect.get(value, "preparePrefetchResponse")) && isOptionalRuntimeFunction(Reflect.get(value, "claimCurrentHistoryTreeSnapshot")) && isOptionalRuntimeFunction(Reflect.get(value, "commitAppOwnedHistoryStateWrite")) && isOptionalRuntimeFunction(Reflect.get(value, "discardPendingNavigation")) && isOptionalRuntimeFunction(Reflect.get(value, "flushCommittingNavigationUrl"));
|
|
29
|
+
return isOptionalRuntimeFunction(Reflect.get(value, "clearNavigationCaches")) && isOptionalRuntimeFunction(Reflect.get(value, "commitHashNavigation")) && isOptionalRuntimeFunction(Reflect.get(value, "navigateExternal")) && isOptionalRuntimeFunction(Reflect.get(value, "navigate")) && isOptionalRuntimeFunction(Reflect.get(value, "getPrefetchRouterState")) && isOptionalRuntimeFunction(Reflect.get(value, "notifyLinkNavigationStart")) && isOptionalRuntimeFunction(Reflect.get(value, "pingVisibleLinks")) && isOptionalRuntimeFunction(Reflect.get(value, "preparePrefetchResponse")) && isOptionalRuntimeFunction(Reflect.get(value, "claimCurrentHistoryTreeSnapshot")) && isOptionalRuntimeFunction(Reflect.get(value, "commitAppOwnedHistoryStateWrite")) && isOptionalRuntimeFunction(Reflect.get(value, "discardPendingNavigation")) && isOptionalRuntimeFunction(Reflect.get(value, "flushCommittingNavigationUrl")) && isOptionalRuntimeFunction(Reflect.get(value, "loadRouteManifest"));
|
|
35
30
|
}
|
|
36
31
|
function isNavigationRuntimeRscChunk(value) {
|
|
37
32
|
if (typeof value === "string") return true;
|
|
@@ -49,6 +44,7 @@ function isNavigationRuntimeParams(value) {
|
|
|
49
44
|
}
|
|
50
45
|
function isNavigationRuntimeRscBootstrap(value) {
|
|
51
46
|
if (!isUnknownRecord(value)) return false;
|
|
47
|
+
const compatibilityId = Reflect.get(value, "compatibilityId");
|
|
52
48
|
const done = Reflect.get(value, "done");
|
|
53
49
|
const dynamicStaleTimeSeconds = Reflect.get(value, "dynamicStaleTimeSeconds");
|
|
54
50
|
const initialCacheKind = Reflect.get(value, "initialCacheKind");
|
|
@@ -58,7 +54,7 @@ function isNavigationRuntimeRscBootstrap(value) {
|
|
|
58
54
|
const renderedSearch = Reflect.get(value, "renderedSearch");
|
|
59
55
|
const rsc = Reflect.get(value, "rsc");
|
|
60
56
|
const staleTimeSeconds = Reflect.get(value, "staleTimeSeconds");
|
|
61
|
-
return (done === void 0 || typeof done === "boolean") && isOptionalStaleTimeSeconds(dynamicStaleTimeSeconds) && (initialCacheKind === void 0 || initialCacheKind === "dynamic" || initialCacheKind === "static") && (searchParamsFromBrowser === void 0 || typeof searchParamsFromBrowser === "boolean") && (nav === void 0 || isNavigationRuntimeSnapshot(nav)) && (params === void 0 || isNavigationRuntimeParams(params)) && (renderedSearch === void 0 || typeof renderedSearch === "string") && Array.isArray(rsc) && rsc.every(isNavigationRuntimeRscChunk) && isOptionalStaleTimeSeconds(staleTimeSeconds);
|
|
57
|
+
return (compatibilityId === void 0 || typeof compatibilityId === "string") && (done === void 0 || typeof done === "boolean") && isOptionalStaleTimeSeconds(dynamicStaleTimeSeconds) && (initialCacheKind === void 0 || initialCacheKind === "dynamic" || initialCacheKind === "static") && (searchParamsFromBrowser === void 0 || typeof searchParamsFromBrowser === "boolean") && (nav === void 0 || isNavigationRuntimeSnapshot(nav)) && (params === void 0 || isNavigationRuntimeParams(params)) && (renderedSearch === void 0 || typeof renderedSearch === "string") && Array.isArray(rsc) && rsc.every(isNavigationRuntimeRscChunk) && isOptionalStaleTimeSeconds(staleTimeSeconds);
|
|
62
58
|
}
|
|
63
59
|
function isOptionalStaleTimeSeconds(value) {
|
|
64
60
|
return value === void 0 || typeof value === "number" && Number.isFinite(value) && value >= 0;
|
|
@@ -71,7 +67,7 @@ function isNullableString(value) {
|
|
|
71
67
|
}
|
|
72
68
|
function isNavigationRuntimeInterception(value) {
|
|
73
69
|
if (!isUnknownRecord(value)) return false;
|
|
74
|
-
return typeof value.id === "string" &&
|
|
70
|
+
return typeof value.id === "string" && isReadonlyStringArray(value.sourcePatternParts) && isReadonlyStringArray(value.targetPatternParts) && typeof value.slotId === "string" && isNullableString(value.ownerLayoutId) && isNullableString(value.targetRouteId);
|
|
75
71
|
}
|
|
76
72
|
function isNavigationRuntimeInterceptionArray(value) {
|
|
77
73
|
return Array.isArray(value) && value.every(isNavigationRuntimeInterception);
|
|
@@ -150,6 +146,41 @@ function ensureNavigationRuntimeRscBootstrapForRuntime(runtime) {
|
|
|
150
146
|
}
|
|
151
147
|
return rscBootstrap;
|
|
152
148
|
}
|
|
149
|
+
/**
|
|
150
|
+
* The browser entry does not inline the RouteManifest: the manifest grows with
|
|
151
|
+
* every route of the app, so it lives in its own chunk that loads alongside
|
|
152
|
+
* hydration. The navigation planner needs it to classify commits (root layout
|
|
153
|
+
* changes, intercepted payloads, preserved slots), so navigations, commits and
|
|
154
|
+
* prefetches that read it wait for this load first.
|
|
155
|
+
*/
|
|
156
|
+
function createNavigationRuntimeRouteManifestLoader(importManifest) {
|
|
157
|
+
let loaded = false;
|
|
158
|
+
let reportedFailure = false;
|
|
159
|
+
let pending = null;
|
|
160
|
+
return () => {
|
|
161
|
+
if (loaded) return null;
|
|
162
|
+
pending ??= importManifest().then(({ default: wire }) => {
|
|
163
|
+
registerNavigationRuntimeBootstrap({ routeManifest: wire === null ? null : decodeBrowserRouteManifest(wire) });
|
|
164
|
+
loaded = true;
|
|
165
|
+
return true;
|
|
166
|
+
}).catch((error) => {
|
|
167
|
+
pending = null;
|
|
168
|
+
if (!reportedFailure) {
|
|
169
|
+
reportedFailure = true;
|
|
170
|
+
console.error("[vinext] Failed to load the App Router route manifest:", error);
|
|
171
|
+
}
|
|
172
|
+
return false;
|
|
173
|
+
});
|
|
174
|
+
return pending;
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Starts or joins the RouteManifest load. Resolves whether it loaded, and
|
|
179
|
+
* returns null once it has (or when no App Router runtime registered a loader).
|
|
180
|
+
*/
|
|
181
|
+
function loadNavigationRuntimeRouteManifest() {
|
|
182
|
+
return getNavigationRuntime()?.functions.loadRouteManifest?.() ?? null;
|
|
183
|
+
}
|
|
153
184
|
function hasAppNavigationRuntime() {
|
|
154
185
|
return typeof getNavigationRuntime()?.functions.navigate === "function";
|
|
155
186
|
}
|
|
@@ -169,4 +200,4 @@ function hasAppNavigationRuntimeBootstrap() {
|
|
|
169
200
|
return getNavigationRuntime() !== null;
|
|
170
201
|
}
|
|
171
202
|
//#endregion
|
|
172
|
-
export { NAVIGATION_RUNTIME_KEY, ensureNavigationRuntimeRscBootstrap, getNavigationRuntime, hasAppNavigationRuntime, hasAppNavigationRuntimeBootstrap, registerNavigationRuntimeBootstrap, registerNavigationRuntimeFunctions };
|
|
203
|
+
export { NAVIGATION_RUNTIME_KEY, createNavigationRuntimeRouteManifestLoader, ensureNavigationRuntimeRscBootstrap, getNavigationRuntime, hasAppNavigationRuntime, hasAppNavigationRuntimeBootstrap, isNavigationRuntimeFunctions, loadNavigationRuntimeRouteManifest, registerNavigationRuntimeBootstrap, registerNavigationRuntimeFunctions };
|
|
@@ -5,10 +5,33 @@ export type VinextLinkPrefetchRoute = {
|
|
|
5
5
|
documentOnly?: boolean;
|
|
6
6
|
isDynamic: boolean;
|
|
7
7
|
patternParts: string[];
|
|
8
|
+
/**
|
|
9
|
+
* The route's segment config rules out static generation, so Next.js
|
|
10
|
+
* renders it on every request, and its automatic prefetch never renders the
|
|
11
|
+
* page. Read at build time. Never set with Cache Components: segment config
|
|
12
|
+
* doesn't decide what renders dynamically there, so an automatic prefetch of
|
|
13
|
+
* a dynamic route without a loading boundary still renders its page
|
|
14
|
+
* (Next.js prefetches its static shell instead).
|
|
15
|
+
*/
|
|
16
|
+
rendersDynamically?: true;
|
|
17
|
+
/**
|
|
18
|
+
* Intercepting pages that can render a URL of this route under a matching
|
|
19
|
+
* interception context. Next.js builds each as its own route, so its
|
|
20
|
+
* `rendersDynamically` replaces the route's own then. Set only alongside
|
|
21
|
+
* `rendersDynamically` classification.
|
|
22
|
+
*/
|
|
23
|
+
intercepts?: VinextLinkPrefetchIntercept[];
|
|
8
24
|
requiresDynamicNavigationRequest?: boolean;
|
|
9
25
|
/** The route has dynamic params above its root layout. */
|
|
10
26
|
hasRootParams?: true;
|
|
11
27
|
};
|
|
28
|
+
export type VinextLinkPrefetchIntercept = {
|
|
29
|
+
/** The URL pattern of the route the interception context must be on, or below. */
|
|
30
|
+
sourcePatternParts: string[];
|
|
31
|
+
/** The URL pattern the intercepting page intercepts. */
|
|
32
|
+
targetPatternParts: string[];
|
|
33
|
+
rendersDynamically?: true;
|
|
34
|
+
};
|
|
12
35
|
/**
|
|
13
36
|
* Pages Router route pattern exposed to the client so the App Router's
|
|
14
37
|
* navigation runtime can decide whether a soft-navigated URL should be
|
|
@@ -21,7 +44,6 @@ export type VinextLinkPrefetchRoute = {
|
|
|
21
44
|
*/
|
|
22
45
|
export type VinextPagesLinkPrefetchRoute = {
|
|
23
46
|
canPrefetchLoadingShell: false;
|
|
24
|
-
documentOnly?: boolean;
|
|
25
47
|
isDynamic: boolean;
|
|
26
48
|
patternParts: string[];
|
|
27
49
|
requiresDynamicNavigationRequest?: boolean;
|
|
@@ -50,4 +72,5 @@ type VinextLocaleGlobalTarget = {
|
|
|
50
72
|
export declare function extractVinextNextDataJson(html: string): string | null;
|
|
51
73
|
export declare function parseVinextNextDataJson(json: string): BrowserVinextNextData;
|
|
52
74
|
export declare function applyVinextLocaleGlobals(target: VinextLocaleGlobalTarget, nextData: VinextNextData): void;
|
|
53
|
-
//#endregion
|
|
75
|
+
//#endregion
|
|
76
|
+
export {};
|
|
@@ -2,34 +2,8 @@ import { HasCondition, NextHeader, NextI18nConfig, NextRedirect, NextRewrite } f
|
|
|
2
2
|
import { RequestContext, normalizeHost, parseCookies, requestContextFromRequest } from "./request-context.js";
|
|
3
3
|
import { RedirectDestinationQueryPart } from "./destination-params.js";
|
|
4
4
|
import { isExternalUrl } from "../utils/external-url.js";
|
|
5
|
+
import { configSourceError, matchConfigPattern } from "./config-source.js";
|
|
5
6
|
//#region src/config/config-matchers.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* Detect regex patterns vulnerable to catastrophic backtracking (ReDoS).
|
|
8
|
-
*
|
|
9
|
-
* Uses the same deterministic structural analysis as middleware matcher
|
|
10
|
-
* validation. Nested bounded repetition is accepted only when its repeated
|
|
11
|
-
* language has fixed width and unambiguous branches; a fixed outer count can
|
|
12
|
-
* otherwise still cause polynomially catastrophic backtracking on long near
|
|
13
|
-
* misses.
|
|
14
|
-
*
|
|
15
|
-
* Returns true if the pattern appears safe, false if it's potentially dangerous.
|
|
16
|
-
*/
|
|
17
|
-
export declare function isSafeRegex(pattern: string, flags?: string): boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Compile a regex pattern safely. Returns the compiled RegExp or null if the
|
|
20
|
-
* pattern is invalid or vulnerable to ReDoS.
|
|
21
|
-
*
|
|
22
|
-
* Logs a warning when a pattern is rejected so developers can fix their config.
|
|
23
|
-
*/
|
|
24
|
-
export declare function safeRegExp(pattern: string, flags?: string): RegExp | null;
|
|
25
|
-
/**
|
|
26
|
-
* Convert a Next.js header/rewrite/redirect source pattern into a regex string.
|
|
27
|
-
*
|
|
28
|
-
* Regex groups in the source (e.g. `(\d+)`) are extracted first, the remaining
|
|
29
|
-
* text is escaped/converted in a **single pass** (avoiding chained `.replace()`
|
|
30
|
-
* which CodeQL flags as incomplete sanitization), then groups are restored.
|
|
31
|
-
*/
|
|
32
|
-
export declare function escapeHeaderSource(source: string): string;
|
|
33
7
|
/**
|
|
34
8
|
* basePath gating state passed alongside the pathname to every matcher.
|
|
35
9
|
*
|
|
@@ -75,14 +49,13 @@ export declare function applyMiddlewareRequestHeaders(middlewareHeaders: Record<
|
|
|
75
49
|
postMwReqCtx: RequestContext;
|
|
76
50
|
};
|
|
77
51
|
export declare function checkHasConditions(has: HasCondition[] | undefined, missing: HasCondition[] | undefined, ctx: RequestContext): boolean;
|
|
78
|
-
export declare function matchConfigPattern(pathname: string, pattern: string): Record<string, string> | null;
|
|
79
52
|
/**
|
|
80
53
|
* A matched config redirect. `destinationQuery` holds the destination query's
|
|
81
54
|
* parts, split before params were substituted, for merging the request query.
|
|
82
55
|
*/
|
|
83
56
|
export type RedirectMatch = {
|
|
84
57
|
destination: string;
|
|
85
|
-
|
|
58
|
+
statusCode: number;
|
|
86
59
|
destinationQuery: RedirectDestinationQueryPart[];
|
|
87
60
|
};
|
|
88
61
|
/**
|
|
@@ -184,6 +157,17 @@ export declare function sanitizeDestination(dest: string): string;
|
|
|
184
157
|
* https://github.com/vercel/next.js/blob/canary/packages/next/src/server/server-route-utils.ts
|
|
185
158
|
*/
|
|
186
159
|
export declare function preserveRedirectDestinationQuery(destination: string, requestSearch: string, destinationQuery?: RedirectDestinationQueryPart[]): string;
|
|
160
|
+
/**
|
|
161
|
+
* Percent-encode what a config-redirect `Location` header cannot carry.
|
|
162
|
+
*
|
|
163
|
+
* The destination template was already parsed like a URL by matchRedirect, so
|
|
164
|
+
* its literal path, hash and host are encoded as Next.js sends them. Captures
|
|
165
|
+
* and the destination query are inserted verbatim, like Next.js, so they can
|
|
166
|
+
* still hold control or non-ASCII characters. Next.js writes those raw and its
|
|
167
|
+
* Node server answers 500 for a character above U+00FF (the Headers
|
|
168
|
+
* constructor throws the same way); vinext percent-encodes them instead.
|
|
169
|
+
*/
|
|
170
|
+
export declare function encodeRedirectLocation(location: string): string;
|
|
187
171
|
/**
|
|
188
172
|
* Proxy an incoming request to an external URL and return the upstream response.
|
|
189
173
|
*
|
|
@@ -220,17 +204,19 @@ export declare function matchHeaders(pathname: string, headers: NextHeader[], ct
|
|
|
220
204
|
* starts with `/:nextInternalLocale(en|sv|nl)` so that locale-prefixed
|
|
221
205
|
* URLs match. For redirects only, a second variant prefixed with
|
|
222
206
|
* `/${defaultLocale}` is also emitted, matching Next.js exactly.
|
|
223
|
-
* -
|
|
224
|
-
*
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
*
|
|
207
|
+
* - Headers get only that variant, exactly like Next.js. Every header
|
|
208
|
+
* matcher caller splices the (domain-aware) default locale into
|
|
209
|
+
* unprefixed request paths first (`normalizeDefaultLocalePathname`,
|
|
210
|
+
* mirroring `resolve-routes.ts`), so `/about` is matched as `/en/about`.
|
|
211
|
+
* `/_next/*` paths are left unprefixed and therefore only match
|
|
212
|
+
* `locale: false` rules, as in Next.js.
|
|
213
|
+
* - **Vinext divergence (redirects/rewrites only)**: we ALSO retain the
|
|
214
|
+
* original (unprefixed) source, appended LAST so the locale-aware
|
|
215
|
+
* variants win when both forms could match. Their callers normalise
|
|
216
|
+
* default-locale paths too, so this is a legacy fallback. Headers never
|
|
217
|
+
* get it: it would apply rules Next.js skips (`/((?!api).*)` would match
|
|
218
|
+
* `/fr/api/x` as `fr/api/x`), and default-locale requests would match
|
|
219
|
+
* both variants, appending additive headers such as `Set-Cookie` twice.
|
|
234
220
|
*
|
|
235
221
|
* Destinations that are local (start with `/`) are similarly rewritten with
|
|
236
222
|
* `/:nextInternalLocale` for the locale-capture variant so the locale
|
|
@@ -243,4 +229,4 @@ export declare function applyLocaleToRoutes<T extends NextRedirect | NextRewrite
|
|
|
243
229
|
trailingSlash?: boolean;
|
|
244
230
|
}): T[];
|
|
245
231
|
//#endregion
|
|
246
|
-
export { type RequestContext, isExternalUrl, normalizeHost, parseCookies, requestContextFromRequest };
|
|
232
|
+
export { type RequestContext, configSourceError, isExternalUrl, matchConfigPattern, normalizeHost, parseCookies, requestContextFromRequest };
|