vinext 1.0.0-beta.4 → 1.0.0-beta.6
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 +44 -3
- package/dist/build/client-build-config.d.ts +0 -1
- package/dist/build/css-url-assets.d.ts +0 -1
- package/dist/build/google-fonts/build-url.d.ts +5 -2
- package/dist/build/google-fonts/font-metadata.d.ts +7 -3
- package/dist/build/google-fonts/get-axes.d.ts +0 -1
- package/dist/build/layout-classification.d.ts +7 -4
- package/dist/build/next-client-runtime-manifests.d.ts +0 -1
- package/dist/build/next-client-runtime-manifests.js +2 -19
- package/dist/build/nitro-route-rules.d.ts +0 -1
- package/dist/build/pages-client-assets-module.d.ts +0 -1
- package/dist/build/precompress.d.ts +7 -2
- package/dist/build/precompress.js +41 -7
- package/dist/build/prerender-paths.d.ts +2 -2
- package/dist/build/prerender-paths.js +3 -4
- package/dist/build/prerender-phase.d.ts +15 -0
- package/dist/build/prerender-phase.js +37 -0
- package/dist/build/prerender-server-entry.d.ts +1 -1
- package/dist/build/prerender-server-entry.js +3 -3
- package/dist/build/prerender-server-pool.d.ts +4 -2
- package/dist/build/prerender-server-pool.js +2 -0
- package/dist/build/prerender.d.ts +40 -33
- package/dist/build/prerender.js +99 -18
- package/dist/build/public-dir-conflict.d.ts +14 -0
- package/dist/build/public-dir-conflict.js +25 -0
- package/dist/build/report.d.ts +2 -2
- package/dist/build/route-classification-injector.d.ts +0 -1
- package/dist/build/route-classification-manifest.d.ts +5 -3
- package/dist/build/run-prerender.d.ts +3 -2
- package/dist/build/run-prerender.js +9 -6
- package/dist/build/static-export.d.ts +23 -12
- package/dist/cache/cache-adapters-virtual.d.ts +5 -2
- package/dist/check.js +4 -4
- package/dist/cli-dev-config.d.ts +0 -1
- package/dist/cli.d.ts +1 -1
- package/dist/client/client-rewrite-matcher.d.ts +12 -0
- package/dist/client/client-rewrite-matcher.js +20 -0
- package/dist/client/client-rewrites.d.ts +31 -0
- package/dist/client/client-rewrites.js +41 -0
- package/dist/client/dev-error-overlay.d.ts +0 -1
- package/dist/client/empty-module.d.ts +1 -1
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.js +2 -0
- package/dist/client/instrumentation-client-state.d.ts +0 -1
- package/dist/client/navigation-runtime.d.ts +6 -1
- package/dist/client/navigation-runtime.js +5 -1
- package/dist/client/pages-router-link-navigation.d.ts +3 -21
- package/dist/client/react-instance-bootstrap.d.ts +1 -0
- package/dist/client/react-instance-bootstrap.js +7 -0
- package/dist/client/react-instance.d.ts +13 -0
- package/dist/client/react-instance.js +20 -0
- package/dist/client/vinext-next-data.d.ts +13 -6
- package/dist/client/window-next.d.ts +5 -2
- package/dist/config/config-matchers.d.ts +3 -5
- package/dist/config/config-matchers.js +7 -6
- package/dist/config/dotenv.d.ts +1 -5
- package/dist/config/next-config.d.ts +113 -54
- package/dist/config/next-config.js +27 -7
- package/dist/config/prerender.d.ts +0 -1
- package/dist/deps/.pnpm/image-size@2.0.2/deps/image-size/dist/index.js +808 -0
- package/dist/entries/app-browser-entry.d.ts +0 -1
- package/dist/entries/app-browser-entry.js +8 -3
- package/dist/entries/app-rsc-entry.d.ts +30 -16
- package/dist/entries/app-rsc-entry.js +48 -10
- package/dist/entries/app-rsc-manifest.d.ts +0 -1
- package/dist/entries/app-rsc-manifest.js +1 -0
- package/dist/entries/pages-client-entry.d.ts +0 -1
- package/dist/entries/pages-client-entry.js +15 -5
- package/dist/entries/pages-server-entry.d.ts +1 -2
- package/dist/entries/pages-server-entry.js +21 -5
- package/dist/image/image-adapters-virtual.d.ts +4 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.js +328 -227
- package/dist/init-cloudflare.d.ts +0 -1
- package/dist/init-platform.d.ts +0 -1
- package/dist/init.d.ts +40 -20
- package/dist/plugins/ast-scope.d.ts +0 -1
- package/dist/plugins/async-hooks-stub.d.ts +0 -1
- package/dist/plugins/client-reference-dedup.d.ts +0 -1
- package/dist/plugins/css-data-url.d.ts +0 -1
- package/dist/plugins/css-module-imports.d.ts +0 -1
- package/dist/plugins/dynamic-preload-metadata.d.ts +0 -1
- package/dist/plugins/extensionless-dynamic-import.d.ts +0 -1
- package/dist/plugins/extensionless-dynamic-import.js +352 -13
- package/dist/plugins/fonts.d.ts +0 -1
- package/dist/plugins/ignore-dynamic-requests.d.ts +0 -1
- package/dist/plugins/ignore-dynamic-requests.js +28 -4
- package/dist/plugins/import-meta-url.d.ts +0 -1
- package/dist/plugins/instrumentation-client.d.ts +0 -1
- package/dist/plugins/middleware-server-only.d.ts +0 -1
- package/dist/plugins/og-asset-ownership.d.ts +0 -1
- package/dist/plugins/og-assets.d.ts +0 -1
- package/dist/plugins/optimize-imports.d.ts +0 -1
- package/dist/plugins/pages-node-externals.d.ts +23 -0
- package/dist/plugins/pages-node-externals.js +206 -0
- package/dist/plugins/remove-console.d.ts +0 -1
- package/dist/plugins/require-context.d.ts +0 -1
- package/dist/plugins/require-context.js +143 -26
- package/dist/plugins/rsc-client-reference-loaders.d.ts +0 -1
- package/dist/plugins/rsc-reference-validation-normalizer.d.ts +0 -1
- package/dist/plugins/sass.d.ts +30 -2
- package/dist/plugins/sass.js +64 -1
- package/dist/plugins/server-externals-manifest.d.ts +0 -1
- package/dist/plugins/strip-server-exports.d.ts +0 -1
- package/dist/plugins/styled-jsx.d.ts +0 -1
- package/dist/plugins/transitive-externals.d.ts +24 -0
- package/dist/plugins/transitive-externals.js +121 -0
- package/dist/plugins/typeof-window.d.ts +11 -1
- package/dist/plugins/typeof-window.js +141 -13
- package/dist/plugins/use-cache-callable.d.ts +12 -0
- package/dist/plugins/use-cache-callable.js +209 -0
- package/dist/plugins/wasm-module-import.d.ts +0 -1
- package/dist/routing/app-route-graph.d.ts +115 -56
- package/dist/routing/app-route-graph.js +2 -1
- package/dist/routing/app-router.d.ts +0 -1
- package/dist/routing/pages-router.d.ts +9 -5
- package/dist/routing/route-matching.d.ts +0 -1
- package/dist/routing/utils.d.ts +1 -23
- package/dist/routing/utils.js +1 -30
- package/dist/server/accept-encoding.d.ts +0 -1
- package/dist/server/api-handler.d.ts +0 -1
- package/dist/server/api-handler.js +1 -1
- package/dist/server/app-bfcache-identity.d.ts +9 -10
- package/dist/server/app-bfcache-identity.js +27 -128
- package/dist/server/app-browser-action-result.d.ts +0 -1
- package/dist/server/app-browser-client-reuse-manifest.d.ts +0 -1
- package/dist/server/app-browser-entry.d.ts +1 -1
- package/dist/server/app-browser-entry.js +46 -30
- package/dist/server/app-browser-history-controller.d.ts +8 -5
- package/dist/server/app-browser-hydration.d.ts +0 -1
- package/dist/server/app-browser-interception-context.d.ts +0 -1
- package/dist/server/app-browser-mpa-navigation.d.ts +0 -1
- package/dist/server/app-browser-navigation-controller.d.ts +2 -5
- package/dist/server/app-browser-popstate.d.ts +0 -1
- package/dist/server/app-browser-prefetch-response.d.ts +17 -1
- package/dist/server/app-browser-prefetch-response.js +23 -1
- package/dist/server/app-browser-server-action-client.d.ts +1 -1
- package/dist/server/app-browser-server-action-client.js +3 -2
- package/dist/server/app-browser-server-action-navigation.d.ts +0 -1
- package/dist/server/app-browser-state.d.ts +4 -3
- package/dist/server/app-browser-state.js +2 -4
- package/dist/server/app-browser-stream.d.ts +0 -1
- package/dist/server/app-browser-visible-commit.d.ts +1 -1
- package/dist/server/app-browser-visible-commit.js +6 -2
- package/dist/server/app-elements-wire.d.ts +16 -13
- package/dist/server/app-elements-wire.js +37 -10
- package/dist/server/app-elements.d.ts +2 -3
- package/dist/server/app-elements.js +2 -2
- package/dist/server/app-fallback-renderer.d.ts +8 -4
- package/dist/server/app-fallback-renderer.js +2 -1
- package/dist/server/app-history-state.d.ts +2 -2
- package/dist/server/app-history-state.js +1 -1
- package/dist/server/app-hook-warning-suppression.d.ts +0 -1
- package/dist/server/app-layout-param-observation.d.ts +0 -1
- package/dist/server/app-layout-param-observation.js +1 -1
- package/dist/server/app-middleware.d.ts +5 -1
- package/dist/server/app-middleware.js +96 -31
- package/dist/server/app-optimistic-routing.d.ts +1 -0
- package/dist/server/app-page-boundary-render.d.ts +8 -4
- package/dist/server/app-page-boundary-render.js +4 -7
- package/dist/server/app-page-cache-finalizer.d.ts +3 -3
- package/dist/server/app-page-cache-finalizer.js +45 -19
- package/dist/server/app-page-cache-render.d.ts +3 -2
- package/dist/server/app-page-cache-render.js +5 -2
- package/dist/server/app-page-cache.d.ts +3 -4
- package/dist/server/app-page-cache.js +33 -15
- package/dist/server/app-page-dispatch.d.ts +11 -5
- package/dist/server/app-page-dispatch.js +11 -6
- package/dist/server/app-page-element-builder.d.ts +61 -19
- package/dist/server/app-page-element-builder.js +113 -43
- package/dist/server/app-page-execution.d.ts +12 -5
- package/dist/server/app-page-execution.js +20 -7
- package/dist/server/app-page-head.d.ts +2 -2
- package/dist/server/app-page-http-access-fallback-metadata.d.ts +2 -2
- package/dist/server/app-page-params.d.ts +0 -1
- package/dist/server/app-page-ppr-runtime.d.ts +0 -1
- package/dist/server/app-page-probe.d.ts +4 -3
- package/dist/server/app-page-probe.js +1 -1
- package/dist/server/app-page-render-identity.d.ts +1 -0
- package/dist/server/app-page-render-observation.d.ts +0 -1
- package/dist/server/app-page-render.d.ts +6 -4
- package/dist/server/app-page-render.js +53 -25
- package/dist/server/app-page-request.d.ts +3 -1
- package/dist/server/app-page-request.js +3 -34
- package/dist/server/app-page-response.d.ts +13 -3
- package/dist/server/app-page-response.js +17 -11
- package/dist/server/app-page-route-wiring.d.ts +27 -5
- package/dist/server/app-page-route-wiring.js +110 -58
- package/dist/server/app-page-search-params-observation.d.ts +0 -1
- package/dist/server/app-page-segment-plan.d.ts +56 -0
- package/dist/server/app-page-segment-plan.js +177 -0
- package/dist/server/app-page-segment-state.d.ts +18 -2
- package/dist/server/app-page-segment-state.js +23 -4
- package/dist/server/app-page-stream.d.ts +31 -10
- package/dist/server/app-page-stream.js +10 -3
- package/dist/server/app-pages-bridge.d.ts +0 -1
- package/dist/server/app-pages-bridge.js +12 -1
- package/dist/server/app-post-middleware-context.d.ts +0 -1
- package/dist/server/app-ppr-fallback-shell-render.d.ts +0 -1
- package/dist/server/app-prerender-endpoints.d.ts +1 -1
- package/dist/server/app-prerender-endpoints.js +12 -0
- package/dist/server/app-prerender-static-params.d.ts +0 -1
- package/dist/server/app-render-dependency.d.ts +11 -4
- package/dist/server/app-render-dependency.js +59 -9
- package/dist/server/app-request-context.d.ts +1 -0
- package/dist/server/app-response-header-provenance.d.ts +13 -0
- package/dist/server/app-response-header-provenance.js +26 -0
- package/dist/server/app-route-handler-cache.d.ts +3 -2
- package/dist/server/app-route-handler-cache.js +7 -3
- package/dist/server/app-route-handler-dispatch.d.ts +0 -1
- package/dist/server/app-route-handler-dispatch.js +4 -2
- package/dist/server/app-route-handler-execution.d.ts +2 -2
- package/dist/server/app-route-handler-execution.js +15 -7
- package/dist/server/app-route-handler-policy.d.ts +1 -1
- package/dist/server/app-route-handler-response.d.ts +3 -2
- package/dist/server/app-route-handler-response.js +15 -5
- package/dist/server/app-route-handler-runtime.d.ts +1 -2
- package/dist/server/app-route-handler-runtime.js +218 -85
- package/dist/server/app-route-module-loader.d.ts +32 -6
- package/dist/server/app-route-module-loader.js +73 -3
- package/dist/server/app-route-request-built-ins.d.ts +16 -0
- package/dist/server/app-route-request-built-ins.js +41 -0
- package/dist/server/app-router-entry.d.ts +0 -1
- package/dist/server/app-router-entry.js +4 -4
- package/dist/server/app-rsc-cache-busting.d.ts +2 -1
- package/dist/server/app-rsc-cache-busting.js +24 -16
- package/dist/server/app-rsc-handler.d.ts +9 -2
- package/dist/server/app-rsc-handler.js +176 -47
- package/dist/server/app-rsc-redirect-flight.d.ts +0 -1
- package/dist/server/app-rsc-request-normalization.d.ts +19 -10
- package/dist/server/app-rsc-response-finalizer.d.ts +7 -2
- package/dist/server/app-rsc-response-finalizer.js +34 -18
- package/dist/server/app-rsc-route-matching.d.ts +6 -1
- package/dist/server/app-rsc-route-matching.js +47 -2
- package/dist/server/app-rsc-state-fingerprint.d.ts +14 -0
- package/dist/server/app-rsc-state-fingerprint.js +13 -0
- package/dist/server/app-segment-config.d.ts +0 -1
- package/dist/server/app-server-action-execution.d.ts +41 -8
- package/dist/server/app-server-action-execution.js +191 -113
- package/dist/server/app-ssr-entry.d.ts +11 -3
- package/dist/server/app-ssr-entry.js +19 -8
- package/dist/server/app-ssr-router-instance.d.ts +0 -1
- package/dist/server/app-ssr-stream.d.ts +13 -2
- package/dist/server/app-ssr-stream.js +30 -5
- package/dist/server/app-static-generation.d.ts +0 -1
- package/dist/server/app-visited-response-cache.d.ts +1 -1
- package/dist/server/before-interactive-head.d.ts +0 -1
- package/dist/server/before-interactive-head.js +2 -0
- package/dist/server/bfcache-identity.d.ts +45 -0
- package/dist/server/bfcache-identity.js +52 -0
- package/dist/server/cache-control.d.ts +11 -7
- package/dist/server/cache-control.js +23 -11
- package/dist/server/cache-proof.d.ts +0 -1
- package/dist/server/client-reuse-manifest.d.ts +0 -1
- package/dist/server/config-headers.d.ts +6 -2
- package/dist/server/config-headers.js +19 -3
- package/dist/server/csp.d.ts +0 -1
- package/dist/server/default-global-error-module.d.ts +0 -1
- package/dist/server/default-global-not-found-module.d.ts +0 -1
- package/dist/server/default-not-found-module.d.ts +0 -1
- package/dist/server/dev-lockfile.d.ts +21 -9
- package/dist/server/dev-module-runner.d.ts +0 -1
- package/dist/server/dev-route-files.d.ts +0 -1
- package/dist/server/dev-server.d.ts +4 -8
- package/dist/server/dev-server.js +54 -105
- package/dist/server/dev-stack-sourcemap.d.ts +0 -1
- package/dist/server/document-initial-head.d.ts +12 -2
- package/dist/server/document-initial-head.js +17 -2
- package/dist/server/file-based-metadata.d.ts +0 -1
- package/dist/server/headers.d.ts +21 -2
- package/dist/server/headers.js +23 -2
- package/dist/server/http-conditional.d.ts +22 -0
- package/dist/server/http-conditional.js +117 -0
- package/dist/server/http-date.d.ts +5 -0
- package/dist/server/http-date.js +73 -0
- package/dist/server/http-error-responses.d.ts +3 -2
- package/dist/server/http-error-responses.js +21 -4
- package/dist/server/http-range.d.ts +25 -0
- package/dist/server/http-range.js +67 -0
- package/dist/server/image-optimization.d.ts +14 -6
- package/dist/server/image-optimization.js +0 -1
- package/dist/server/instrumentation.d.ts +7 -4
- package/dist/server/isr-cache.d.ts +28 -6
- package/dist/server/isr-cache.js +19 -13
- package/dist/server/isr-decision.d.ts +6 -4
- package/dist/server/metadata-route-build-data.d.ts +0 -1
- package/dist/server/metadata-route-build-data.js +1 -1
- package/dist/server/metadata-route-cache-policy.d.ts +6 -0
- package/dist/server/metadata-route-cache-policy.js +6 -0
- package/dist/server/metadata-route-response.d.ts +26 -2
- package/dist/server/metadata-route-response.js +225 -11
- package/dist/server/metadata-routes.d.ts +34 -16
- package/dist/server/metadata-routes.js +1 -1
- package/dist/server/middleware-matcher-pattern.d.ts +0 -1
- package/dist/server/middleware-matcher.d.ts +8 -3
- package/dist/server/middleware-matcher.js +23 -18
- package/dist/server/middleware-response-headers.js +4 -2
- package/dist/server/middleware-runtime.d.ts +6 -1
- package/dist/server/middleware-runtime.js +91 -28
- package/dist/server/middleware.d.ts +0 -1
- package/dist/server/navigation-planner.d.ts +1 -1
- package/dist/server/next-error-digest.d.ts +0 -1
- package/dist/server/pages-api-route.d.ts +0 -1
- package/dist/server/pages-api-route.js +30 -5
- package/dist/server/pages-asset-tags.d.ts +2 -1
- package/dist/server/pages-data-route.d.ts +14 -6
- package/dist/server/pages-data-route.js +19 -10
- package/dist/server/pages-dev-hydration.js +14 -4
- package/dist/server/pages-dev-stylesheets.d.ts +10 -0
- package/dist/server/pages-dev-stylesheets.js +150 -0
- package/dist/server/pages-document-initial-props.d.ts +10 -6
- package/dist/server/pages-get-initial-props.d.ts +2 -2
- package/dist/server/pages-i18n.d.ts +1 -7
- package/dist/server/pages-node-compat.d.ts +11 -2
- package/dist/server/pages-node-compat.js +49 -2
- package/dist/server/pages-page-data.d.ts +21 -9
- package/dist/server/pages-page-data.js +109 -30
- package/dist/server/pages-page-handler.d.ts +72 -33
- package/dist/server/pages-page-handler.js +25 -20
- package/dist/server/pages-page-response.d.ts +7 -13
- package/dist/server/pages-page-response.js +16 -23
- package/dist/server/pages-readiness.d.ts +0 -1
- package/dist/server/pages-request-pipeline.d.ts +20 -6
- package/dist/server/pages-request-pipeline.js +40 -20
- package/dist/server/pages-revalidate.d.ts +0 -1
- package/dist/server/pages-revalidate.js +1 -1
- package/dist/server/pages-router-entry.js +13 -9
- package/dist/server/prerender-cache-life-header.d.ts +11 -0
- package/dist/server/prerender-cache-life-header.js +18 -0
- package/dist/server/prerender-manifest.d.ts +11 -2
- package/dist/server/prerender-manifest.js +4 -1
- package/dist/server/prod-server.d.ts +13 -7
- package/dist/server/prod-server.js +280 -92
- package/dist/server/proxy-trust.d.ts +0 -1
- package/dist/server/request-log.d.ts +7 -11
- package/dist/server/request-pipeline.d.ts +13 -4
- package/dist/server/request-pipeline.js +30 -20
- package/dist/server/revalidation-host.d.ts +0 -1
- package/dist/server/revalidation-host.js +1 -1
- package/dist/server/rsc-completion-metadata.d.ts +15 -0
- package/dist/server/rsc-completion-metadata.js +183 -0
- package/dist/server/seed-cache.d.ts +6 -2
- package/dist/server/seed-cache.js +35 -8
- package/dist/server/skip-cache-proof.d.ts +0 -1
- package/dist/server/static-file-cache.d.ts +23 -9
- package/dist/server/static-file-cache.js +47 -23
- package/dist/server/static-layout-client-reuse-proof.d.ts +0 -1
- package/dist/server/worker-revalidation-context.d.ts +0 -1
- package/dist/server/worker-utils.d.ts +3 -1
- package/dist/server/worker-utils.js +12 -3
- package/dist/shims/app-router-scroll.d.ts +2 -8
- package/dist/shims/app.d.ts +1 -5
- package/dist/shims/before-interactive-context.d.ts +5 -3
- package/dist/shims/cache-callable-runtime.d.ts +11 -0
- package/dist/shims/cache-callable-runtime.js +30 -0
- package/dist/shims/cache-handler.d.ts +6 -1
- package/dist/shims/cache-handler.js +4 -2
- package/dist/shims/cache-request-state.d.ts +15 -1
- package/dist/shims/cache-request-state.js +27 -1
- package/dist/shims/cache-runtime.d.ts +15 -6
- package/dist/shims/cache-runtime.js +129 -29
- package/dist/shims/cache.d.ts +2 -3
- package/dist/shims/cache.js +2 -2
- package/dist/shims/cdn-cache.d.ts +18 -7
- package/dist/shims/cdn-cache.js +4 -2
- package/dist/shims/client-locale.d.ts +1 -6
- package/dist/shims/client-only.d.ts +1 -1
- package/dist/shims/compat-router.d.ts +0 -1
- package/dist/shims/constants.d.ts +1 -1
- package/dist/shims/default-global-error.d.ts +1 -4
- package/dist/shims/default-not-found.d.ts +0 -1
- package/dist/shims/document.d.ts +0 -1
- package/dist/shims/document.js +2 -1
- package/dist/shims/dynamic-preload-chunks.d.ts +0 -1
- package/dist/shims/dynamic.d.ts +0 -1
- package/dist/shims/error-boundary-navigation.d.ts +0 -1
- package/dist/shims/error-boundary.d.ts +7 -32
- package/dist/shims/error.d.ts +1 -6
- package/dist/shims/fetch-cache.js +115 -65
- package/dist/shims/font-google-base.d.ts +0 -1
- package/dist/shims/font-local.d.ts +0 -1
- package/dist/shims/font-local.js +3 -3
- package/dist/shims/form.d.ts +5 -3
- package/dist/shims/head-state.d.ts +0 -1
- package/dist/shims/head.d.ts +17 -5
- package/dist/shims/head.js +70 -8
- package/dist/shims/headers.d.ts +2 -2
- package/dist/shims/headers.js +1 -1
- package/dist/shims/i18n-context.d.ts +0 -1
- package/dist/shims/i18n-state.d.ts +0 -1
- package/dist/shims/image.d.ts +0 -1
- package/dist/shims/image.js +1 -2
- package/dist/shims/internal/als-registry.d.ts +31 -2
- package/dist/shims/internal/als-registry.js +50 -2
- package/dist/shims/internal/app-prefetch-fetch-queue.d.ts +17 -2
- package/dist/shims/internal/app-prefetch-fetch-queue.js +69 -7
- package/dist/shims/internal/app-route-detection.d.ts +0 -1
- package/dist/shims/internal/app-route-prefetch-policy.d.ts +33 -0
- package/dist/shims/internal/app-route-prefetch-policy.js +63 -0
- package/dist/shims/internal/app-router-context.d.ts +0 -1
- package/dist/shims/internal/hybrid-client-route-owner-direct.d.ts +1 -5
- package/dist/shims/internal/hybrid-client-route-owner.d.ts +0 -1
- package/dist/shims/internal/hybrid-client-route-owner.js +6 -8
- package/dist/shims/internal/interpolate-as.d.ts +3 -2
- package/dist/shims/internal/pages-data-target.d.ts +22 -11
- package/dist/shims/internal/pages-data-target.js +19 -6
- package/dist/shims/internal/pages-data-url.d.ts +3 -1
- package/dist/shims/internal/router-context.d.ts +0 -1
- package/dist/shims/internal/work-unit-async-storage.d.ts +4 -3
- package/dist/shims/internal/work-unit-async-storage.js +2 -0
- package/dist/shims/layout-segment-context.d.ts +2 -6
- package/dist/shims/legacy-image.d.ts +0 -1
- package/dist/shims/link.d.ts +29 -23
- package/dist/shims/link.js +59 -150
- package/dist/shims/metadata.d.ts +2 -10
- package/dist/shims/navigation-context-state.d.ts +4 -1
- package/dist/shims/navigation-state.d.ts +1 -0
- package/dist/shims/navigation.d.ts +65 -6
- package/dist/shims/navigation.js +360 -71
- package/dist/shims/navigation.react-server.d.ts +1 -0
- package/dist/shims/og.d.ts +0 -1
- package/dist/shims/request-context.d.ts +8 -4
- package/dist/shims/request-state-types.d.ts +1 -0
- package/dist/shims/root-params.d.ts +3 -1
- package/dist/shims/root-params.js +7 -1
- package/dist/shims/router.d.ts +44 -23
- package/dist/shims/router.js +184 -82
- package/dist/shims/script-nonce-context.d.ts +0 -1
- package/dist/shims/script.d.ts +25 -13
- package/dist/shims/server-only.d.ts +1 -1
- package/dist/shims/server.d.ts +1 -3
- package/dist/shims/server.js +7 -7
- package/dist/shims/slot.d.ts +22 -11
- package/dist/shims/slot.js +99 -19
- package/dist/shims/streamed-icons.d.ts +1 -3
- package/dist/shims/unified-request-context.d.ts +44 -4
- package/dist/shims/unified-request-context.js +56 -2
- package/dist/shims/use-merged-ref.d.ts +0 -1
- package/dist/shims/web-vitals.d.ts +0 -1
- package/dist/typegen.d.ts +1 -2
- package/dist/typegen.js +1 -1
- package/dist/utils/cache-control-metadata.d.ts +13 -1
- package/dist/utils/cache-control-metadata.js +17 -1
- package/dist/utils/client-build-manifest.d.ts +0 -1
- package/dist/utils/domain-locale.d.ts +1 -5
- package/dist/utils/encode-cache-tag.d.ts +1 -1
- package/dist/utils/encode-cache-tag.js +1 -1
- package/dist/utils/html-limited-bots.js +1 -1
- package/dist/utils/middleware-request-headers.d.ts +17 -5
- package/dist/utils/middleware-request-headers.js +32 -23
- package/dist/utils/precompressed-variant.d.ts +9 -0
- package/dist/utils/precompressed-variant.js +15 -0
- package/dist/utils/prerender-output-paths.d.ts +3 -1
- package/dist/utils/prerender-output-paths.js +6 -1
- package/dist/utils/project.d.ts +12 -7
- package/dist/utils/public-file-path.d.ts +5 -0
- package/dist/utils/public-file-path.js +12 -0
- package/dist/utils/public-routes.d.ts +1 -1
- package/dist/utils/public-routes.js +6 -5
- package/package.json +10 -6
|
@@ -26,32 +26,14 @@ type PagesRouterLinkNavigation = {
|
|
|
26
26
|
locale?: string | false;
|
|
27
27
|
interpolateDynamicRoute?: boolean;
|
|
28
28
|
};
|
|
29
|
-
declare function resolvePagesRouterQueryOnlyHref(href: string, {
|
|
30
|
-
asPath,
|
|
31
|
-
basePath,
|
|
32
|
-
fallbackHref,
|
|
33
|
-
locales
|
|
34
|
-
}: {
|
|
29
|
+
declare function resolvePagesRouterQueryOnlyHref(href: string, { asPath, basePath, fallbackHref, locales }: {
|
|
35
30
|
asPath?: string;
|
|
36
31
|
basePath: string;
|
|
37
32
|
fallbackHref: string;
|
|
38
33
|
locales?: readonly string[];
|
|
39
34
|
}): string;
|
|
40
|
-
declare function navigatePagesRouterLink(router: PagesRouterLinkRuntime, {
|
|
41
|
-
|
|
42
|
-
as,
|
|
43
|
-
replace,
|
|
44
|
-
scroll,
|
|
45
|
-
shallow,
|
|
46
|
-
locale,
|
|
47
|
-
interpolateDynamicRoute
|
|
48
|
-
}: PagesRouterLinkNavigation): Promise<void>;
|
|
49
|
-
declare function navigatePagesRouterLinkWithFallback({
|
|
50
|
-
router,
|
|
51
|
-
loadRouter,
|
|
52
|
-
navigation,
|
|
53
|
-
fallback
|
|
54
|
-
}: {
|
|
35
|
+
declare function navigatePagesRouterLink(router: PagesRouterLinkRuntime, { href, as, replace, scroll, shallow, locale, interpolateDynamicRoute }: PagesRouterLinkNavigation): Promise<void>;
|
|
36
|
+
declare function navigatePagesRouterLinkWithFallback({ router, loadRouter, navigation, fallback }: {
|
|
55
37
|
router?: PagesRouterLinkRuntime;
|
|
56
38
|
loadRouter: () => Promise<PagesRouterLinkRuntime | undefined>;
|
|
57
39
|
navigation: PagesRouterLinkNavigation;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/client/react-instance.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Return the React instance registered by the vinext browser entry.
|
|
4
|
+
*
|
|
5
|
+
* Module Federation remotes can call this with their local React namespace to
|
|
6
|
+
* reuse the host instance. The first browser registration wins so evaluating
|
|
7
|
+
* another copy of this module (for example after HMR) cannot replace it.
|
|
8
|
+
* Server and RSC environments always keep their condition-specific React
|
|
9
|
+
* instance local.
|
|
10
|
+
*/
|
|
11
|
+
declare function getVinextReact(reactInstance: typeof import("react")): typeof import("react");
|
|
12
|
+
//#endregion
|
|
13
|
+
export { getVinextReact };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/client/react-instance.ts
|
|
2
|
+
const VINEXT_CLIENT_REACT = Symbol.for("vinext.client.react");
|
|
3
|
+
/**
|
|
4
|
+
* Return the React instance registered by the vinext browser entry.
|
|
5
|
+
*
|
|
6
|
+
* Module Federation remotes can call this with their local React namespace to
|
|
7
|
+
* reuse the host instance. The first browser registration wins so evaluating
|
|
8
|
+
* another copy of this module (for example after HMR) cannot replace it.
|
|
9
|
+
* Server and RSC environments always keep their condition-specific React
|
|
10
|
+
* instance local.
|
|
11
|
+
*/
|
|
12
|
+
function getVinextReact(reactInstance) {
|
|
13
|
+
if (typeof window === "undefined") return reactInstance;
|
|
14
|
+
const registeredReact = Reflect.get(globalThis, VINEXT_CLIENT_REACT);
|
|
15
|
+
if (registeredReact !== void 0) return registeredReact;
|
|
16
|
+
Reflect.set(globalThis, VINEXT_CLIENT_REACT, reactInstance);
|
|
17
|
+
return reactInstance;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { getVinextReact };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { NEXT_DATA } from "../shims/internal/utils.js";
|
|
2
|
-
|
|
3
2
|
//#region src/client/vinext-next-data.d.ts
|
|
4
3
|
type VinextLinkPrefetchRoute = {
|
|
5
4
|
canPrefetchLoadingShell: boolean;
|
|
@@ -7,6 +6,8 @@ type VinextLinkPrefetchRoute = {
|
|
|
7
6
|
isDynamic: boolean;
|
|
8
7
|
patternParts: string[];
|
|
9
8
|
requiresDynamicNavigationRequest?: boolean;
|
|
9
|
+
/** The route has dynamic params above its root layout. */
|
|
10
|
+
hasRootParams?: true;
|
|
10
11
|
};
|
|
11
12
|
/**
|
|
12
13
|
* Pages Router route pattern exposed to the client so the App Router's
|
|
@@ -26,11 +27,17 @@ type VinextPagesLinkPrefetchRoute = {
|
|
|
26
27
|
requiresDynamicNavigationRequest?: boolean;
|
|
27
28
|
};
|
|
28
29
|
type VinextNextData = {
|
|
29
|
-
/** vinext-specific additions (not part of Next.js upstream). */
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
/** vinext-specific additions (not part of Next.js upstream). */
|
|
31
|
+
__vinext?: {
|
|
32
|
+
/** Absolute URL of the page module for dynamic import. */
|
|
33
|
+
pageModuleUrl?: string;
|
|
34
|
+
/** Absolute URL of the `_app` module for dynamic import. */
|
|
35
|
+
appModuleUrl?: string;
|
|
36
|
+
/** True when the Pages Router server has middleware/proxy configured. */
|
|
37
|
+
hasMiddleware?: boolean;
|
|
38
|
+
/** True when build-time rewrites can affect the initial Pages Router ready state. */
|
|
39
|
+
hasRewrites?: boolean;
|
|
40
|
+
/** Server-resolved Pages route URL used to hydrate fallback shells behind rewrites. */
|
|
34
41
|
routeUrl?: string;
|
|
35
42
|
};
|
|
36
43
|
} & NEXT_DATA;
|
|
@@ -55,11 +55,13 @@ type AppRouterPublicInstance = {
|
|
|
55
55
|
forward: () => void;
|
|
56
56
|
refresh: () => void;
|
|
57
57
|
prefetch: (href: string, options?: {
|
|
58
|
+
kind?: "auto" | "full";
|
|
58
59
|
onInvalidate?: () => void;
|
|
59
60
|
}) => void;
|
|
60
61
|
experimental_gesturePush?: (href: string, options?: {
|
|
61
62
|
scroll?: boolean;
|
|
62
|
-
}) => void;
|
|
63
|
+
}) => void;
|
|
64
|
+
/** Default placeholder, matches Next.js. */
|
|
63
65
|
bfcacheId?: string;
|
|
64
66
|
};
|
|
65
67
|
/**
|
|
@@ -97,7 +99,8 @@ type PagesRouterPublicInstance = {
|
|
|
97
99
|
* prefetch — App Router targets land here as `{ __appRouter: true }`.
|
|
98
100
|
* See: `packages/next/src/shared/lib/router/router.ts:2525`.
|
|
99
101
|
*/
|
|
100
|
-
components: Record<string, unknown>;
|
|
102
|
+
components: Record<string, unknown>;
|
|
103
|
+
/** Persistent Pages Router static-data cache, matching Next.js `Router.sdc`. */
|
|
101
104
|
sdc: Record<string, Promise<Response>>;
|
|
102
105
|
};
|
|
103
106
|
declare global {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { HasCondition, NextHeader, NextI18nConfig, NextRedirect, NextRewrite } from "./next-config.js";
|
|
2
2
|
import { RequestContext, normalizeHost, parseCookies, requestContextFromRequest } from "./request-context.js";
|
|
3
3
|
import { isExternalUrl } from "../utils/external-url.js";
|
|
4
|
-
|
|
5
4
|
//#region src/config/config-matchers.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* Detect regex patterns vulnerable to catastrophic backtracking (ReDoS).
|
|
@@ -44,7 +43,8 @@ declare function escapeHeaderSource(source: string): string;
|
|
|
44
43
|
* @see .nextjs-ref/packages/next/src/lib/load-custom-routes.ts:198-220
|
|
45
44
|
*/
|
|
46
45
|
type BasePathMatchState = {
|
|
47
|
-
/** Configured `basePath` (without trailing slash) or "" when unset. */
|
|
46
|
+
/** Configured `basePath` (without trailing slash) or "" when unset. */
|
|
47
|
+
basePath: string;
|
|
48
48
|
/**
|
|
49
49
|
* True when the inbound request was originally under `basePath` (i.e.
|
|
50
50
|
* the prod-server/handler stripped the prefix before the matcher runs).
|
|
@@ -69,9 +69,7 @@ type BasePathMatchState = {
|
|
|
69
69
|
* individual header values), so the wider `string | string[]` type of
|
|
70
70
|
* `middlewareHeaders` is safe to cast here.
|
|
71
71
|
*/
|
|
72
|
-
declare function applyMiddlewareRequestHeaders(middlewareHeaders: Record<string, string | string[]>, request: Request
|
|
73
|
-
preserveCredentialHeaders?: boolean;
|
|
74
|
-
}): {
|
|
72
|
+
declare function applyMiddlewareRequestHeaders(middlewareHeaders: Record<string, string | string[]>, request: Request): {
|
|
75
73
|
request: Request;
|
|
76
74
|
postMwReqCtx: RequestContext;
|
|
77
75
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { normalizeHost, parseCookies, requestContextFromRequest } from "./request-context.js";
|
|
1
2
|
import { PRERENDER_REVALIDATE_HEADER, PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER, VINEXT_MW_CTX_HEADER, VINEXT_PRERENDER_ROUTE_PARAMS_HEADER, VINEXT_PRERENDER_SECRET_HEADER, VINEXT_REVALIDATE_HOST_HEADER } from "../utils/protocol-headers.js";
|
|
2
|
-
import { buildRequestHeadersFromMiddlewareResponse } from "../utils/middleware-request-headers.js";
|
|
3
|
+
import { buildRequestHeadersFromMiddlewareResponse, getUnconsumedMiddlewareRequestHeaders } from "../utils/middleware-request-headers.js";
|
|
3
4
|
import { analyzeRegexSafety } from "../utils/regex-safety.js";
|
|
4
|
-
import { normalizeHost, parseCookies, requestContextFromRequest } from "./request-context.js";
|
|
5
5
|
import { isExternalUrl } from "../utils/external-url.js";
|
|
6
6
|
//#region src/config/config-matchers.ts
|
|
7
7
|
/**
|
|
@@ -301,9 +301,10 @@ function shouldEvaluateRule(ruleBasePath, state) {
|
|
|
301
301
|
* individual header values), so the wider `string | string[]` type of
|
|
302
302
|
* `middlewareHeaders` is safe to cast here.
|
|
303
303
|
*/
|
|
304
|
-
function applyMiddlewareRequestHeaders(middlewareHeaders, request
|
|
305
|
-
const nextHeaders = buildRequestHeadersFromMiddlewareResponse(request.headers, middlewareHeaders
|
|
306
|
-
|
|
304
|
+
function applyMiddlewareRequestHeaders(middlewareHeaders, request) {
|
|
305
|
+
const nextHeaders = buildRequestHeadersFromMiddlewareResponse(request.headers, middlewareHeaders);
|
|
306
|
+
const unconsumedRequestHeaders = getUnconsumedMiddlewareRequestHeaders(middlewareHeaders);
|
|
307
|
+
for (const key of Object.keys(middlewareHeaders)) if (key.startsWith("x-middleware-") && key !== "x-middleware-cache" && !unconsumedRequestHeaders.has(key)) delete middlewareHeaders[key];
|
|
307
308
|
if (nextHeaders) request = new Request(request.url, {
|
|
308
309
|
method: request.method,
|
|
309
310
|
headers: nextHeaders,
|
|
@@ -831,7 +832,7 @@ async function proxyExternalRequest(request, externalUrl) {
|
|
|
831
832
|
headers.set("host", targetUrl.host);
|
|
832
833
|
stripHopByHopRequestHeaders(headers);
|
|
833
834
|
const keysToDelete = [];
|
|
834
|
-
for (const key of headers.keys()) if (key.startsWith("x-middleware-")) keysToDelete.push(key);
|
|
835
|
+
for (const key of headers.keys()) if (key.startsWith("x-middleware-") && !key.startsWith("x-middleware-request-")) keysToDelete.push(key);
|
|
835
836
|
for (const key of keysToDelete) headers.delete(key);
|
|
836
837
|
headers.delete(VINEXT_PRERENDER_SECRET_HEADER);
|
|
837
838
|
headers.delete(VINEXT_PRERENDER_ROUTE_PARAMS_HEADER);
|
package/dist/config/dotenv.d.ts
CHANGED
|
@@ -46,10 +46,6 @@ declare function getDotenvFiles(mode: string): string[];
|
|
|
46
46
|
* pass is effectively a no-op for overlapping keys. For `start` and `deploy`
|
|
47
47
|
* commands (which don't go through Vite at all), this is the only loading.
|
|
48
48
|
*/
|
|
49
|
-
declare function loadDotenv({
|
|
50
|
-
root,
|
|
51
|
-
mode,
|
|
52
|
-
processEnv
|
|
53
|
-
}: LoadDotenvOptions): LoadDotenvResult;
|
|
49
|
+
declare function loadDotenv({ root, mode, processEnv }: LoadDotenvOptions): LoadDotenvResult;
|
|
54
50
|
//#endregion
|
|
55
51
|
export { getDotenvFiles, loadDotenv };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PHASE_PRODUCTION_BUILD } from "../shims/constants.js";
|
|
2
2
|
import { PluginOption } from "vite";
|
|
3
|
-
|
|
4
3
|
//#region src/config/next-config.d.ts
|
|
5
4
|
declare const VINEXT_NEXT_CONFIG_PLUGIN_PROPERTY = "__vinextNextConfig";
|
|
6
5
|
/**
|
|
@@ -42,8 +41,10 @@ type NextRewrite = {
|
|
|
42
41
|
source: string;
|
|
43
42
|
destination: string;
|
|
44
43
|
has?: HasCondition[];
|
|
45
|
-
missing?: HasCondition[];
|
|
46
|
-
|
|
44
|
+
missing?: HasCondition[];
|
|
45
|
+
/** See {@link NextRedirect.locale}. */
|
|
46
|
+
locale?: false;
|
|
47
|
+
/** See {@link NextRedirect.basePath}. */
|
|
47
48
|
basePath?: false;
|
|
48
49
|
};
|
|
49
50
|
type NextHeader = {
|
|
@@ -53,12 +54,16 @@ type NextHeader = {
|
|
|
53
54
|
headers: Array<{
|
|
54
55
|
key: string;
|
|
55
56
|
value: string;
|
|
56
|
-
}>;
|
|
57
|
-
|
|
57
|
+
}>;
|
|
58
|
+
/** See {@link NextRedirect.basePath}. */
|
|
59
|
+
basePath?: false;
|
|
60
|
+
/** See {@link NextRedirect.locale}. */
|
|
58
61
|
locale?: false;
|
|
59
62
|
};
|
|
60
63
|
type NextI18nConfig = {
|
|
61
|
-
/** List of supported locales */
|
|
64
|
+
/** List of supported locales */
|
|
65
|
+
locales: string[];
|
|
66
|
+
/** The default locale (used when no locale prefix is in the URL) */
|
|
62
67
|
defaultLocale: string;
|
|
63
68
|
/**
|
|
64
69
|
* Whether to auto-detect locale from Accept-Language header.
|
|
@@ -90,7 +95,9 @@ type PrefetchInliningConfig = false | {
|
|
|
90
95
|
maxSize: number;
|
|
91
96
|
};
|
|
92
97
|
type NextConfig = {
|
|
93
|
-
/** Additional env variables */
|
|
98
|
+
/** Additional env variables */
|
|
99
|
+
env?: Record<string, string>;
|
|
100
|
+
/** Base URL path prefix */
|
|
94
101
|
basePath?: string;
|
|
95
102
|
/**
|
|
96
103
|
* Prefix applied to every emitted JS/CSS/image/static asset URL.
|
|
@@ -99,15 +106,26 @@ type NextConfig = {
|
|
|
99
106
|
* `basePath` affects route URLs; `assetPrefix` only affects asset URLs.
|
|
100
107
|
* @see https://nextjs.org/docs/app/api-reference/config/next-config-js/assetPrefix
|
|
101
108
|
*/
|
|
102
|
-
assetPrefix?: string;
|
|
103
|
-
|
|
104
|
-
|
|
109
|
+
assetPrefix?: string;
|
|
110
|
+
/** Cross-origin mode applied to framework scripts and preload links. */
|
|
111
|
+
crossOrigin?: "anonymous" | "use-credentials";
|
|
112
|
+
/** Whether to add trailing slashes */
|
|
113
|
+
trailingSlash?: boolean;
|
|
114
|
+
/** Keep the original request URL visible to middleware/proxy. */
|
|
115
|
+
skipProxyUrlNormalize?: boolean;
|
|
116
|
+
/** @deprecated Use `skipProxyUrlNormalize` instead. */
|
|
117
|
+
skipMiddlewareUrlNormalize?: boolean;
|
|
118
|
+
/** TypeScript build settings. */
|
|
105
119
|
typescript?: {
|
|
106
|
-
/** Project-relative path to the TypeScript configuration file. */
|
|
120
|
+
/** Project-relative path to the TypeScript configuration file. */
|
|
121
|
+
tsconfigPath?: string;
|
|
107
122
|
[key: string]: unknown;
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
|
|
123
|
+
};
|
|
124
|
+
/** Internationalization routing config */
|
|
125
|
+
i18n?: NextI18nConfig;
|
|
126
|
+
/** URL redirect rules */
|
|
127
|
+
redirects?: () => Promise<NextRedirect[]> | NextRedirect[];
|
|
128
|
+
/** URL rewrite rules */
|
|
111
129
|
rewrites?: () => Promise<NextRewrite[] | {
|
|
112
130
|
beforeFiles: NextRewrite[];
|
|
113
131
|
afterFiles: NextRewrite[];
|
|
@@ -116,8 +134,10 @@ type NextConfig = {
|
|
|
116
134
|
beforeFiles: NextRewrite[];
|
|
117
135
|
afterFiles: NextRewrite[];
|
|
118
136
|
fallback: NextRewrite[];
|
|
119
|
-
};
|
|
120
|
-
|
|
137
|
+
};
|
|
138
|
+
/** Custom response headers */
|
|
139
|
+
headers?: () => Promise<NextHeader[]> | NextHeader[];
|
|
140
|
+
/** Image optimization config */
|
|
121
141
|
images?: {
|
|
122
142
|
remotePatterns?: Array<URL | {
|
|
123
143
|
protocol?: string;
|
|
@@ -127,13 +147,20 @@ type NextConfig = {
|
|
|
127
147
|
search?: string;
|
|
128
148
|
}>;
|
|
129
149
|
domains?: string[];
|
|
130
|
-
unoptimized?: boolean;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
150
|
+
unoptimized?: boolean;
|
|
151
|
+
/** Allowed device widths for image optimization. Defaults to Next.js defaults: [640, 750, 828, 1080, 1200, 1920, 2048, 3840] */
|
|
152
|
+
deviceSizes?: number[];
|
|
153
|
+
/** Allowed image sizes for fixed-width images. Defaults to Next.js defaults: [32, 48, 64, 96, 128, 256, 384] */
|
|
154
|
+
imageSizes?: number[];
|
|
155
|
+
/** Allowed image qualities. When unset, any quality from 1-100 is permitted (matches Next.js). */
|
|
156
|
+
qualities?: number[];
|
|
157
|
+
/** Allow SVG images through the image optimization endpoint. SVG can contain scripts, so only enable if you trust all image sources. */
|
|
158
|
+
dangerouslyAllowSVG?: boolean;
|
|
159
|
+
/** Allow image optimization for hostnames that resolve to private IP addresses. This is a security risk (SSRF) — only enable for private networks when you understand the risk. */
|
|
160
|
+
dangerouslyAllowLocalIP?: boolean;
|
|
161
|
+
/** Content-Disposition header for image responses. Defaults to "inline". */
|
|
162
|
+
contentDispositionType?: "inline" | "attachment";
|
|
163
|
+
/** Content-Security-Policy header for image responses. Defaults to "script-src 'none'; frame-src 'none'; sandbox;" */
|
|
137
164
|
contentSecurityPolicy?: string;
|
|
138
165
|
};
|
|
139
166
|
/**
|
|
@@ -143,9 +170,12 @@ type NextConfig = {
|
|
|
143
170
|
* router: OFF for the Pages Router, ON for the App Router — matching Next.js.
|
|
144
171
|
* @see https://nextjs.org/docs/app/api-reference/config/next-config-js/reactStrictMode
|
|
145
172
|
*/
|
|
146
|
-
reactStrictMode?: boolean | null;
|
|
147
|
-
|
|
148
|
-
|
|
173
|
+
reactStrictMode?: boolean | null;
|
|
174
|
+
/** Build output mode: 'export' for full static export, 'standalone' for single server */
|
|
175
|
+
output?: "export" | "standalone";
|
|
176
|
+
/** File extensions treated as routable pages/routes (Next.js pageExtensions) */
|
|
177
|
+
pageExtensions?: string[];
|
|
178
|
+
/** Turbopack-compatible module resolution options. */
|
|
149
179
|
turbopack?: {
|
|
150
180
|
resolveAlias?: Record<string, unknown>;
|
|
151
181
|
resolveExtensions?: string[];
|
|
@@ -156,8 +186,10 @@ type NextConfig = {
|
|
|
156
186
|
* hydration, in array order, ahead of the user's `instrumentation-client.{ts,js}`.
|
|
157
187
|
* Each entry may be a bare npm package name or a path relative to the project root.
|
|
158
188
|
*/
|
|
159
|
-
instrumentationClientInject?: string[];
|
|
160
|
-
|
|
189
|
+
instrumentationClientInject?: string[];
|
|
190
|
+
/** Extra origins allowed to access the dev server. */
|
|
191
|
+
allowedDevOrigins?: string[];
|
|
192
|
+
/** Maximum age in seconds for stale ISR entries before blocking regeneration. */
|
|
161
193
|
expireTime?: number;
|
|
162
194
|
/**
|
|
163
195
|
* Maximum total length (in characters) of the preload `Link` header emitted
|
|
@@ -165,7 +197,8 @@ type NextConfig = {
|
|
|
165
197
|
* exceeded; `0` disables emission entirely. Defaults to 6000.
|
|
166
198
|
* @see https://nextjs.org/docs/app/api-reference/config/next-config-js/reactMaxHeadersLength
|
|
167
199
|
*/
|
|
168
|
-
reactMaxHeadersLength?: number;
|
|
200
|
+
reactMaxHeadersLength?: number;
|
|
201
|
+
/** User agents that require blocking metadata in the initial head. */
|
|
169
202
|
htmlLimitedBots?: RegExp | string;
|
|
170
203
|
/**
|
|
171
204
|
* Enable Cache Components (Next.js 16).
|
|
@@ -178,21 +211,24 @@ type NextConfig = {
|
|
|
178
211
|
* Helps with errors during the prerender phase in `vinext build`.
|
|
179
212
|
* Defaults to `true`. Set to `false` to disable.
|
|
180
213
|
*/
|
|
181
|
-
enablePrerenderSourceMaps?: boolean;
|
|
214
|
+
enablePrerenderSourceMaps?: boolean;
|
|
215
|
+
/** Transpile packages (Vite handles this natively) */
|
|
182
216
|
transpilePackages?: string[];
|
|
183
217
|
/**
|
|
184
218
|
* Packages that should be treated as server-external (not bundled by Vite).
|
|
185
219
|
* Corresponds to Next.js `serverExternalPackages` (or the legacy
|
|
186
220
|
* `experimental.serverComponentsExternalPackages`).
|
|
187
221
|
*/
|
|
188
|
-
serverExternalPackages?: string[];
|
|
222
|
+
serverExternalPackages?: string[];
|
|
223
|
+
/** Webpack config (ignored — we use Vite) */
|
|
189
224
|
webpack?: unknown;
|
|
190
225
|
/**
|
|
191
226
|
* Compiler options for build-time code transforms.
|
|
192
227
|
* vinext supports the subset that maps to Vite-compatible transforms.
|
|
193
228
|
*/
|
|
194
229
|
compiler?: {
|
|
195
|
-
/** Remove `console.*` calls from the client bundle. */
|
|
230
|
+
/** Remove `console.*` calls from the client bundle. */
|
|
231
|
+
removeConsole?: boolean | {
|
|
196
232
|
exclude?: string[];
|
|
197
233
|
};
|
|
198
234
|
/**
|
|
@@ -208,7 +244,8 @@ type NextConfig = {
|
|
|
208
244
|
defineServer?: Record<string, string | number | boolean>;
|
|
209
245
|
};
|
|
210
246
|
experimental?: {
|
|
211
|
-
/** Enables hard-navigation recovery when App Router navigation rendering fails. */
|
|
247
|
+
/** Enables hard-navigation recovery when App Router navigation rendering fails. */
|
|
248
|
+
appNavFailHandling?: boolean;
|
|
212
249
|
/**
|
|
213
250
|
* Enables the experimental App Router gesture transition API:
|
|
214
251
|
* `useRouter().experimental_gesturePush()`.
|
|
@@ -222,7 +259,8 @@ type NextConfig = {
|
|
|
222
259
|
prefetchInlining?: boolean | {
|
|
223
260
|
maxBundleSize?: number;
|
|
224
261
|
maxSize?: number;
|
|
225
|
-
};
|
|
262
|
+
};
|
|
263
|
+
/** Header names forwarded by Pages Router `res.revalidate()` internal requests. */
|
|
226
264
|
allowedRevalidateHeaderKeys?: string[];
|
|
227
265
|
[key: string]: unknown;
|
|
228
266
|
};
|
|
@@ -242,8 +280,10 @@ type NextConfig = {
|
|
|
242
280
|
* Custom build ID generator. If provided, called once at build/dev start.
|
|
243
281
|
* Must return a non-empty string, or null to use the default random ID.
|
|
244
282
|
*/
|
|
245
|
-
generateBuildId?: () => string | null | Promise<string | null>;
|
|
246
|
-
|
|
283
|
+
generateBuildId?: () => string | null | Promise<string | null>;
|
|
284
|
+
/** Identifier for deployment-aware cache keys and version skew protection. */
|
|
285
|
+
deploymentId?: string;
|
|
286
|
+
/** Any other options */
|
|
247
287
|
[key: string]: unknown;
|
|
248
288
|
};
|
|
249
289
|
type NextConfigFactory = (phase: string, opts: {
|
|
@@ -272,6 +312,7 @@ type ResolvedNextConfig = {
|
|
|
272
312
|
*/
|
|
273
313
|
assetPrefix: string;
|
|
274
314
|
trailingSlash: boolean;
|
|
315
|
+
skipProxyUrlNormalize: boolean;
|
|
275
316
|
typescript: {
|
|
276
317
|
tsconfigPath?: string;
|
|
277
318
|
};
|
|
@@ -300,32 +341,47 @@ type ResolvedNextConfig = {
|
|
|
300
341
|
};
|
|
301
342
|
headers: NextHeader[];
|
|
302
343
|
images: NextConfig["images"];
|
|
303
|
-
i18n: NextI18nConfig | null;
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
344
|
+
i18n: NextI18nConfig | null;
|
|
345
|
+
/** MDX remark/rehype/recma plugins extracted from @next/mdx config */
|
|
346
|
+
mdx: MdxOptions | null;
|
|
347
|
+
/** Explicit module aliases preserved from wrapped next.config plugins. */
|
|
348
|
+
aliases: Record<string, string>;
|
|
349
|
+
/** Extra allowed origins for dev server access (from allowedDevOrigins). */
|
|
350
|
+
allowedDevOrigins: string[];
|
|
351
|
+
/** Extra allowed origins for server action CSRF validation (from experimental.serverActions.allowedOrigins). */
|
|
352
|
+
serverActionsAllowedOrigins: string[];
|
|
353
|
+
/** Header names forwarded by Pages Router `res.revalidate()` internal requests. */
|
|
354
|
+
allowedRevalidateHeaderKeys: string[];
|
|
355
|
+
/** Packages whose barrel imports should be optimized (from experimental.optimizePackageImports). */
|
|
356
|
+
optimizePackageImports: string[];
|
|
357
|
+
/** Packages explicitly requested for server/client transpilation. */
|
|
358
|
+
transpilePackages: string[];
|
|
359
|
+
/** Packages treated as application code by Turbopack's foreign-code condition. */
|
|
360
|
+
turbopackTranspilePackages: string[];
|
|
361
|
+
/** Inline app CSS into production HTML (from experimental.inlineCss). */
|
|
362
|
+
inlineCss: boolean;
|
|
363
|
+
/** Enable standalone route-miss 404 handling (from experimental.globalNotFound). */
|
|
364
|
+
globalNotFound: boolean;
|
|
365
|
+
/** Parsed body size limit for server actions in bytes (from experimental.serverActions.bodySizeLimit). Defaults to 1MB. */
|
|
366
|
+
serverActionsBodySizeLimit: number;
|
|
367
|
+
/** Verbatim body size limit config value (e.g. "2mb") for the "Body exceeded {limit} limit" error. Defaults to "1 MB". */
|
|
368
|
+
serverActionsBodySizeLimitLabel: string;
|
|
369
|
+
/** Route-level expire fallback in seconds for ISR entries with numeric revalidate. */
|
|
316
370
|
expireTime: number;
|
|
317
371
|
/**
|
|
318
372
|
* Maximum total length (in characters) of the preload `Link` header emitted
|
|
319
373
|
* during App Router SSR. `0` disables emission. Defaults to 6000.
|
|
320
374
|
*/
|
|
321
|
-
reactMaxHeadersLength: number;
|
|
375
|
+
reactMaxHeadersLength: number;
|
|
376
|
+
/** Serialized htmlLimitedBots regexp source from next.config. */
|
|
322
377
|
htmlLimitedBots: string | undefined;
|
|
323
378
|
/**
|
|
324
379
|
* Packages that should be treated as server-external (not bundled by Vite).
|
|
325
380
|
* Sourced from `serverExternalPackages` or the legacy
|
|
326
381
|
* `experimental.serverComponentsExternalPackages` in next.config.
|
|
327
382
|
*/
|
|
328
|
-
serverExternalPackages: string[];
|
|
383
|
+
serverExternalPackages: string[];
|
|
384
|
+
/** Enable sourcemaps for prerender error stack traces. Defaults to true. */
|
|
329
385
|
enablePrerenderSourceMaps: boolean;
|
|
330
386
|
/**
|
|
331
387
|
* Enable App Shell prefetching (from experimental.appShells).
|
|
@@ -333,8 +389,10 @@ type ResolvedNextConfig = {
|
|
|
333
389
|
* bundle via `process.env.__NEXT_APP_SHELLS`, but actual App Shell behavior
|
|
334
390
|
* requires the segment-cache architecture which is not yet implemented.
|
|
335
391
|
*/
|
|
336
|
-
appShells: boolean;
|
|
337
|
-
|
|
392
|
+
appShells: boolean;
|
|
393
|
+
/** Resolved build ID (from generateBuildId, or a random UUID if not provided). */
|
|
394
|
+
buildId: string;
|
|
395
|
+
/** Resolved deployment ID from next.config.js or NEXT_DEPLOYMENT_ID. */
|
|
338
396
|
deploymentId: string | undefined;
|
|
339
397
|
/**
|
|
340
398
|
* Path to a custom cache handler module. file:// URLs are resolved to
|
|
@@ -383,7 +441,8 @@ type ResolvedNextConfig = {
|
|
|
383
441
|
* `defer={!disableOptimizedLoading}`) and the upstream
|
|
384
442
|
* `test/e2e/optimized-loading` test fixture.
|
|
385
443
|
*/
|
|
386
|
-
disableOptimizedLoading: boolean;
|
|
444
|
+
disableOptimizedLoading: boolean;
|
|
445
|
+
/** Cross-origin mode applied to framework scripts and preload links. */
|
|
387
446
|
crossOrigin: "anonymous" | "use-credentials" | undefined;
|
|
388
447
|
/**
|
|
389
448
|
* Resolved `reactStrictMode` from next.config, preserved as `boolean | null`
|
|
@@ -332,7 +332,11 @@ async function loadNextConfig(root, phase = DEFAULT_PHASE) {
|
|
|
332
332
|
const normalizedConfigPath = safeRealpath(path.resolve(configPath));
|
|
333
333
|
try {
|
|
334
334
|
const { runnerImport } = await import("vite");
|
|
335
|
-
const
|
|
335
|
+
const virtualConfigId = "virtual:vinext-resolved-next-config";
|
|
336
|
+
const resolvedVirtualConfigId = `\0${virtualConfigId}`;
|
|
337
|
+
const configPathLiteral = JSON.stringify(configPath);
|
|
338
|
+
const phaseLiteral = JSON.stringify(phase);
|
|
339
|
+
const { module: mod } = await runnerImport(virtualConfigId, {
|
|
336
340
|
root,
|
|
337
341
|
logLevel: "error",
|
|
338
342
|
clearScreen: false,
|
|
@@ -351,13 +355,26 @@ async function loadNextConfig(root, phase = DEFAULT_PHASE) {
|
|
|
351
355
|
".json"
|
|
352
356
|
]
|
|
353
357
|
},
|
|
354
|
-
plugins: [
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
358
|
+
plugins: [
|
|
359
|
+
{
|
|
360
|
+
name: "vinext:resolve-next-config-value",
|
|
361
|
+
resolveId(id) {
|
|
362
|
+
if (id === virtualConfigId) return resolvedVirtualConfigId;
|
|
363
|
+
},
|
|
364
|
+
load(id) {
|
|
365
|
+
if (id !== resolvedVirtualConfigId) return;
|
|
366
|
+
return `import * as configModule from ${configPathLiteral};\nconst cjsModule = configModule[${JSON.stringify(VINEXT_CJS_EXPORTS_KEY)}];\nconst cjsInitial = configModule[${JSON.stringify(VINEXT_CJS_INITIAL_KEY)}];\nconst cjsExports = cjsModule && cjsModule.exports;\nconst cjsValue = cjsExports != null && (cjsExports !== cjsInitial || (typeof cjsExports === "object" && Object.keys(cjsExports).length > 0)) ? cjsExports : undefined;\nconst value = cjsValue ?? configModule.default ?? configModule;\nexport default typeof value === "function" ? await value(${phaseLiteral}, { defaultConfig: {} }) : value;\n`;
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
...isTypeScriptConfig ? [cjsGlobalsInjectorPlugin(configPath)] : [],
|
|
370
|
+
commonjs({ filter: (id) => {
|
|
371
|
+
const idPath = id.startsWith("file://") ? fileURLToPath(id) : id.split("?")[0];
|
|
372
|
+
if (safeRealpath(path.resolve(idPath)) === normalizedConfigPath) return false;
|
|
373
|
+
return id.includes("node_modules") ? true : void 0;
|
|
374
|
+
} })
|
|
375
|
+
]
|
|
359
376
|
});
|
|
360
|
-
return
|
|
377
|
+
return mod.default;
|
|
361
378
|
} catch (e) {
|
|
362
379
|
if (isCjsError(e) && (filename.endsWith(".js") || filename.endsWith(".cjs"))) try {
|
|
363
380
|
return await loadConfigViaRequire(configPath, root, phase);
|
|
@@ -658,6 +675,7 @@ async function resolveNextConfig(config, root = toSlash(process.cwd()), options
|
|
|
658
675
|
basePath: "",
|
|
659
676
|
assetPrefix: "",
|
|
660
677
|
trailingSlash: false,
|
|
678
|
+
skipProxyUrlNormalize: false,
|
|
661
679
|
typescript: {},
|
|
662
680
|
output: "",
|
|
663
681
|
pageExtensions: normalizePageExtensions(),
|
|
@@ -720,6 +738,7 @@ async function resolveNextConfig(config, root = toSlash(process.cwd()), options
|
|
|
720
738
|
return resolved;
|
|
721
739
|
}
|
|
722
740
|
if (config.crossOrigin !== void 0 && config.crossOrigin !== "anonymous" && config.crossOrigin !== "use-credentials") console.warn("Invalid next.config options detected:\n Invalid option at \"crossOrigin\": expected \"anonymous\" or \"use-credentials\"\nSee more info here: https://nextjs.org/docs/messages/invalid-next-config");
|
|
741
|
+
if (config.skipProxyUrlNormalize !== void 0 && config.skipMiddlewareUrlNormalize !== void 0) throw new Error("Config options `skipProxyUrlNormalize` and `skipMiddlewareUrlNormalize` cannot be set at the same time. Please use `skipProxyUrlNormalize` instead.");
|
|
723
742
|
warnDeprecatedConfigOptions(config, root);
|
|
724
743
|
const i18n = normalizeI18nConfig(config.i18n);
|
|
725
744
|
let redirects = [];
|
|
@@ -837,6 +856,7 @@ async function resolveNextConfig(config, root = toSlash(process.cwd()), options
|
|
|
837
856
|
basePath: config.basePath ?? "",
|
|
838
857
|
assetPrefix: normalizeAssetPrefix(config.assetPrefix),
|
|
839
858
|
trailingSlash: config.trailingSlash ?? false,
|
|
859
|
+
skipProxyUrlNormalize: config.skipProxyUrlNormalize ?? config.skipMiddlewareUrlNormalize ?? false,
|
|
840
860
|
typescript: typeof config.typescript?.tsconfigPath === "string" ? { tsconfigPath: config.typescript.tsconfigPath } : {},
|
|
841
861
|
output: output === "export" || output === "standalone" ? output : "",
|
|
842
862
|
pageExtensions,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { VINEXT_CACHE_CONFIG_PLUGIN_PROPERTY, VinextCacheConfig, findVinextCacheConfigInPlugins, loadVinextCacheConfigFromViteConfig } from "../cache/cache-adapters-virtual.js";
|
|
2
2
|
import { PluginOption } from "vite";
|
|
3
|
-
|
|
4
3
|
//#region src/config/prerender.d.ts
|
|
5
4
|
type VinextPrerenderConfig = true | {
|
|
6
5
|
/**
|