vinext 1.0.0-beta.3 → 1.0.0-beta.5
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 +42 -8
- package/dist/build/prerender-paths.d.ts +2 -2
- package/dist/build/prerender-server-entry.d.ts +1 -1
- package/dist/build/prerender-server-pool.d.ts +4 -2
- package/dist/build/prerender.d.ts +36 -32
- package/dist/build/prerender.js +18 -3
- 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/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-args.d.ts +2 -1
- package/dist/cli-args.js +10 -0
- package/dist/cli-dev-config.d.ts +0 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +14 -8
- 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 +12 -1
- package/dist/client/navigation-runtime.js +6 -2
- 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 +11 -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 +4 -9
- package/dist/config/dotenv.js +30 -22
- package/dist/config/next-config.d.ts +113 -52
- package/dist/config/next-config.js +6 -0
- package/dist/config/prerender.d.ts +0 -1
- package/dist/entries/app-browser-entry.d.ts +0 -1
- package/dist/entries/app-browser-entry.js +7 -3
- package/dist/entries/app-rsc-entry.d.ts +30 -16
- package/dist/entries/app-rsc-entry.js +40 -12
- 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 +7 -2
- package/dist/entries/pages-server-entry.d.ts +1 -2
- package/dist/entries/pages-server-entry.js +25 -6
- package/dist/image/image-adapters-virtual.d.ts +4 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.js +257 -75
- 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/client-reference-dedup.js +7 -5
- 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/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 +67 -5
- 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/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 +4 -3
- package/dist/server/app-bfcache-identity.d.ts +9 -10
- package/dist/server/app-bfcache-identity.js +27 -102
- 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 +106 -66
- 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 +3 -6
- package/dist/server/app-browser-navigation-controller.js +29 -4
- package/dist/server/app-browser-popstate.d.ts +0 -1
- package/dist/server/app-browser-prefetch-response.d.ts +25 -0
- package/dist/server/app-browser-prefetch-response.js +54 -0
- 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 +11 -5
- package/dist/server/app-browser-state.js +10 -6
- 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-cache-finalizer.d.ts +2 -3
- package/dist/server/app-page-cache-finalizer.js +47 -17
- package/dist/server/app-page-cache-render.d.ts +2 -2
- package/dist/server/app-page-cache-render.js +2 -1
- package/dist/server/app-page-cache.d.ts +1 -3
- package/dist/server/app-page-cache.js +22 -11
- package/dist/server/app-page-dispatch.d.ts +12 -6
- package/dist/server/app-page-dispatch.js +14 -6
- package/dist/server/app-page-element-builder.d.ts +63 -20
- package/dist/server/app-page-element-builder.js +114 -43
- package/dist/server/app-page-execution.d.ts +12 -5
- package/dist/server/app-page-execution.js +1 -1
- 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 +7 -5
- package/dist/server/app-page-render.js +59 -24
- package/dist/server/app-page-request.d.ts +3 -2
- package/dist/server/app-page-request.js +6 -46
- package/dist/server/app-page-response.d.ts +15 -3
- package/dist/server/app-page-response.js +21 -3
- package/dist/server/app-page-route-wiring.d.ts +30 -7
- package/dist/server/app-page-route-wiring.js +163 -63
- 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 +19 -10
- package/dist/server/app-pages-bridge.d.ts +2 -2
- package/dist/server/app-pages-bridge.js +14 -2
- 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 +0 -1
- 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-route-handler-cache.d.ts +2 -2
- package/dist/server/app-route-handler-cache.js +5 -1
- package/dist/server/app-route-handler-dispatch.d.ts +0 -1
- package/dist/server/app-route-handler-execution.d.ts +2 -2
- package/dist/server/app-route-handler-execution.js +5 -1
- package/dist/server/app-route-handler-policy.d.ts +0 -1
- package/dist/server/app-route-handler-response.d.ts +0 -1
- package/dist/server/app-route-handler-runtime.d.ts +0 -1
- package/dist/server/app-route-handler-runtime.js +1 -2
- 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-router-entry.d.ts +0 -1
- package/dist/server/app-router-entry.js +2 -2
- package/dist/server/app-rsc-cache-busting.d.ts +7 -1
- package/dist/server/app-rsc-cache-busting.js +6 -0
- package/dist/server/app-rsc-handler.d.ts +9 -2
- package/dist/server/app-rsc-handler.js +173 -41
- package/dist/server/app-rsc-redirect-flight.d.ts +0 -1
- package/dist/server/app-rsc-render-mode.d.ts +3 -2
- package/dist/server/app-rsc-render-mode.js +4 -1
- package/dist/server/app-rsc-request-normalization.d.ts +19 -10
- package/dist/server/app-rsc-request-normalization.js +65 -4
- package/dist/server/app-rsc-response-finalizer.d.ts +5 -2
- package/dist/server/app-rsc-response-finalizer.js +31 -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-segment-config.d.ts +0 -1
- package/dist/server/app-server-action-execution.d.ts +42 -9
- package/dist/server/app-server-action-execution.js +189 -111
- package/dist/server/app-ssr-entry.d.ts +5 -3
- package/dist/server/app-ssr-entry.js +4 -5
- package/dist/server/app-ssr-router-instance.d.ts +0 -1
- package/dist/server/app-ssr-stream.d.ts +7 -1
- package/dist/server/app-ssr-stream.js +2 -1
- package/dist/server/app-static-generation.d.ts +0 -1
- package/dist/server/app-visited-response-cache.d.ts +7 -2
- package/dist/server/app-visited-response-cache.js +49 -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 +3 -3
- package/dist/server/cache-control.js +3 -2
- 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 +2 -2
- 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 +86 -131
- 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/edge-api-runtime.d.ts +10 -1
- package/dist/server/edge-api-runtime.js +29 -1
- package/dist/server/file-based-metadata.d.ts +0 -1
- package/dist/server/headers.d.ts +17 -2
- package/dist/server/headers.js +17 -1
- 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 +2 -1
- package/dist/server/http-error-responses.js +14 -2
- 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-response.d.ts +0 -1
- package/dist/server/metadata-route-response.js +7 -6
- package/dist/server/metadata-routes.d.ts +34 -16
- 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-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 +2 -1
- package/dist/server/pages-api-route.js +32 -7
- package/dist/server/pages-asset-tags.d.ts +3 -1
- package/dist/server/pages-asset-tags.js +6 -4
- 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 +3 -0
- package/dist/server/pages-dev-stylesheets.d.ts +10 -0
- package/dist/server/pages-dev-stylesheets.js +150 -0
- package/dist/server/pages-document-asset-props.d.ts +26 -0
- package/dist/server/pages-document-asset-props.js +69 -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 +52 -5
- 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 +70 -32
- package/dist/server/pages-page-handler.js +25 -6
- package/dist/server/pages-page-response.d.ts +9 -13
- package/dist/server/pages-page-response.js +25 -26
- 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 +14 -10
- package/dist/server/prerender-manifest.d.ts +7 -0
- package/dist/server/prod-server.d.ts +13 -7
- package/dist/server/prod-server.js +276 -83
- 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 +28 -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 +2 -1
- package/dist/server/seed-cache.js +8 -5
- 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-revalidation-context.js +1 -0
- package/dist/server/worker-utils.d.ts +3 -1
- package/dist/server/worker-utils.js +11 -2
- package/dist/shims/app-router-scroll-state.d.ts +2 -1
- package/dist/shims/app-router-scroll-state.js +7 -2
- 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-handler.d.ts +6 -1
- package/dist/shims/cache-handler.js +4 -2
- package/dist/shims/cache-request-state.d.ts +12 -1
- package/dist/shims/cache-request-state.js +22 -1
- package/dist/shims/cache-runtime.d.ts +9 -5
- package/dist/shims/cache-runtime.js +16 -6
- package/dist/shims/cache.d.ts +2 -3
- package/dist/shims/cache.js +2 -2
- package/dist/shims/cdn-cache.d.ts +0 -1
- 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 +17 -3
- 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 +112 -63
- package/dist/shims/font-google-base.d.ts +0 -1
- package/dist/shims/font-local.d.ts +0 -1
- package/dist/shims/form.d.ts +5 -3
- package/dist/shims/hash-scroll.d.ts +1 -1
- package/dist/shims/hash-scroll.js +2 -1
- package/dist/shims/head-state.d.ts +0 -1
- package/dist/shims/head.d.ts +1 -4
- 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 +31 -0
- package/dist/shims/internal/app-route-prefetch-policy.js +57 -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 +21 -10
- package/dist/shims/internal/pages-data-target.js +1 -1
- 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 -21
- package/dist/shims/link.js +52 -97
- package/dist/shims/metadata.d.ts +11 -25
- package/dist/shims/metadata.js +24 -32
- package/dist/shims/navigation-context-state.d.ts +0 -1
- package/dist/shims/navigation-state.d.ts +1 -0
- package/dist/shims/navigation.d.ts +54 -6
- package/dist/shims/navigation.js +325 -73
- 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 -3
- package/dist/shims/request-state-types.d.ts +1 -0
- package/dist/shims/router.d.ts +44 -23
- package/dist/shims/router.js +8 -7
- 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 +5 -6
- package/dist/shims/slot.d.ts +23 -11
- package/dist/shims/slot.js +103 -19
- package/dist/shims/streamed-icons.d.ts +7 -0
- package/dist/shims/streamed-icons.js +33 -0
- 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/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/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 +7 -3
|
@@ -217,7 +217,7 @@ import { clearAppRequestContext as __clearRequestContext, setAppNavigationContex
|
|
|
217
217
|
|
|
218
218
|
__configureMemoryCacheHandler({ cacheMaxMemorySize: ${JSON.stringify(cacheMaxMemorySize)} });
|
|
219
219
|
import { createAppPrerenderStaticParamsResolver as __createAppPrerenderStaticParamsResolver } from ${JSON.stringify(appPrerenderStaticParamsPath)};
|
|
220
|
-
import { ensureAppRouteModulesLoaded as __ensureRouteLoaded } from ${JSON.stringify(appRouteModuleLoaderPath)};
|
|
220
|
+
import { ensureAppRouteModulesLoaded as __ensureRouteLoaded, loadAppInterceptPage as __loadAppInterceptPage } from ${JSON.stringify(appRouteModuleLoaderPath)};
|
|
221
221
|
import {
|
|
222
222
|
getRenderedConcreteUrlPathsForRoute as __getRenderedConcreteUrlPathsForRoute,
|
|
223
223
|
initPregeneratedPathsFromGlobals as __initPregeneratedPathsFromGlobals,
|
|
@@ -414,7 +414,7 @@ function findIntercept(pathname, sourcePathname = null) {
|
|
|
414
414
|
return __routeMatcher.findIntercept(pathname, sourcePathname);
|
|
415
415
|
}
|
|
416
416
|
|
|
417
|
-
async function buildPageElements(route, params, routePath, pageRequest, layoutParamAccess, displayPathname = routePath) {
|
|
417
|
+
async function buildPageElements(route, params, routePath, pageRequest, layoutParamAccess, displayPathname = routePath, scriptNonce) {
|
|
418
418
|
// Hydrate lazy page/route-handler modules before any synchronous read.
|
|
419
419
|
await __ensureRouteLoaded(route);
|
|
420
420
|
return __buildPageElements({
|
|
@@ -433,6 +433,7 @@ async function buildPageElements(route, params, routePath, pageRequest, layoutPa
|
|
|
433
433
|
basePath: __basePath,
|
|
434
434
|
trailingSlash: __trailingSlash,
|
|
435
435
|
htmlLimitedBots: __htmlLimitedBots,
|
|
436
|
+
scriptNonce,
|
|
436
437
|
});
|
|
437
438
|
}
|
|
438
439
|
|
|
@@ -598,7 +599,7 @@ export default createAppRscHandler({
|
|
|
598
599
|
observePageSearchParamsAccess: buildOptions?.observePageSearchParamsAccess === true,
|
|
599
600
|
serveStreamingMetadata: buildOptions?.serveStreamingMetadata,
|
|
600
601
|
isProduction: process.env.NODE_ENV === "production",
|
|
601
|
-
}, layoutParamAccess, displayPathname);
|
|
602
|
+
}, layoutParamAccess, displayPathname, scriptNonce);
|
|
602
603
|
},
|
|
603
604
|
clientReuseManifest,
|
|
604
605
|
cleanPathname,
|
|
@@ -676,12 +677,11 @@ export default createAppRscHandler({
|
|
|
676
677
|
// The intercepting-route page module is lazy (page: null + __pageLoader).
|
|
677
678
|
// Resolve it before probing so buildAppPageProbes inspects the real page
|
|
678
679
|
// component for dynamic bailout — matching the render path, which also
|
|
679
|
-
//
|
|
680
|
-
//
|
|
681
|
-
//
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
}
|
|
680
|
+
// hydrates it (resolveAppPageInterceptState). Without this the intercept
|
|
681
|
+
// probe branch silently inspects an undefined component and never
|
|
682
|
+
// observes the page's searchParams/headers access. Shared loader, so
|
|
683
|
+
// the import is isolated from the request context here too.
|
|
684
|
+
if (__probeIntercept) await __loadAppInterceptPage(__probeIntercept);
|
|
685
685
|
return Promise.all(__buildAppPageProbes({
|
|
686
686
|
route,
|
|
687
687
|
pageComponent: PageComponent,
|
|
@@ -842,8 +842,11 @@ export default createAppRscHandler({
|
|
|
842
842
|
middlewareContext,
|
|
843
843
|
mountedSlotsHeader,
|
|
844
844
|
request,
|
|
845
|
+
scriptNonce,
|
|
845
846
|
routeMatch,
|
|
846
847
|
routePathname,
|
|
848
|
+
dispatchRedirectTargetRequest,
|
|
849
|
+
sourceConfigHeaders,
|
|
847
850
|
searchParams,
|
|
848
851
|
}) {
|
|
849
852
|
const {
|
|
@@ -874,6 +877,7 @@ export default createAppRscHandler({
|
|
|
874
877
|
renderMode: actionRenderMode,
|
|
875
878
|
observeMetadataSearchParamsAccess,
|
|
876
879
|
observePageSearchParamsAccess,
|
|
880
|
+
scriptNonce: targetScriptNonce,
|
|
877
881
|
}) {
|
|
878
882
|
return buildPageElements(actionRoute, actionParams, actionCleanPathname, {
|
|
879
883
|
opts: interceptOpts,
|
|
@@ -884,7 +888,7 @@ export default createAppRscHandler({
|
|
|
884
888
|
renderMode: actionRenderMode,
|
|
885
889
|
observeMetadataSearchParamsAccess: observeMetadataSearchParamsAccess === true,
|
|
886
890
|
observePageSearchParamsAccess: observePageSearchParamsAccess === true,
|
|
887
|
-
});
|
|
891
|
+
}, undefined, actionCleanPathname, targetScriptNonce ?? scriptNonce);
|
|
888
892
|
},
|
|
889
893
|
cleanPathname,
|
|
890
894
|
clearRequestContext() {
|
|
@@ -925,12 +929,15 @@ export default createAppRscHandler({
|
|
|
925
929
|
},
|
|
926
930
|
isRscRequest,
|
|
927
931
|
loadServerAction,
|
|
932
|
+
// Redirect targets are rendered as if the client had navigated to them,
|
|
933
|
+
// so they must route on the raw pathname a real request would use.
|
|
928
934
|
matchRoute(pathnameToMatch) {
|
|
929
|
-
return
|
|
935
|
+
return matchRequestRoute(pathnameToMatch);
|
|
930
936
|
},
|
|
931
937
|
maxActionBodySize: __MAX_ACTION_BODY_SIZE,
|
|
932
938
|
maxActionBodySizeLabel: __MAX_ACTION_BODY_SIZE_LABEL,
|
|
933
939
|
middlewareHeaders: middlewareContext.headers,
|
|
940
|
+
middlewareRequestHeaders: middlewareContext.requestHeaders,
|
|
934
941
|
middlewareStatus: middlewareContext.status,
|
|
935
942
|
mountedSlotsHeader,
|
|
936
943
|
readBodyWithLimit: __readBodyWithLimit,
|
|
@@ -945,6 +952,8 @@ export default createAppRscHandler({
|
|
|
945
952
|
},
|
|
946
953
|
resolveRouteRuntime: __resolveRouteRuntime,
|
|
947
954
|
request,
|
|
955
|
+
dispatchRedirectTargetRequest,
|
|
956
|
+
sourceConfigHeaders,
|
|
948
957
|
sanitizeErrorForClient(error) {
|
|
949
958
|
return __sanitizeErrorForClient(error);
|
|
950
959
|
},
|
|
@@ -953,6 +962,7 @@ export default createAppRscHandler({
|
|
|
953
962
|
setNavigationContext,
|
|
954
963
|
toInterceptOpts(intercept) {
|
|
955
964
|
return {
|
|
965
|
+
interceptGraphId: intercept.interceptionGraphId,
|
|
956
966
|
interceptionContext,
|
|
957
967
|
interceptLayouts: intercept.interceptLayouts,
|
|
958
968
|
interceptLayoutSegments: intercept.interceptLayoutSegments,
|
|
@@ -964,6 +974,8 @@ export default createAppRscHandler({
|
|
|
964
974
|
interceptSlotKey: intercept.slotKey,
|
|
965
975
|
interceptSourceMatchedUrl: interceptionContext,
|
|
966
976
|
interceptSourcePageSegments: intercept.sourcePageSegments,
|
|
977
|
+
interceptTargetPatternParts: intercept.targetPatternParts,
|
|
978
|
+
interceptTargetRouteGraphId: intercept.targetRouteGraphId,
|
|
967
979
|
interceptPage: intercept.page,
|
|
968
980
|
interceptParams: intercept.matchedParams,
|
|
969
981
|
};
|
|
@@ -984,19 +996,35 @@ export default createAppRscHandler({
|
|
|
984
996
|
},` : ""}
|
|
985
997
|
matchRoute,
|
|
986
998
|
matchRequestRoute,
|
|
987
|
-
|
|
999
|
+
matchInterceptRoute(pathname, sourcePathname) {
|
|
1000
|
+
const intercept = findIntercept(pathname, sourcePathname);
|
|
1001
|
+
if (!intercept) return null;
|
|
1002
|
+
const route = routes[intercept.sourceRouteIndex];
|
|
1003
|
+
if (!route) return null;
|
|
1004
|
+
const params = Object.create(null);
|
|
1005
|
+
for (const name of route.params) {
|
|
1006
|
+
if (Object.prototype.hasOwnProperty.call(intercept.sourceMatchedParams, name)) {
|
|
1007
|
+
params[name] = intercept.sourceMatchedParams[name];
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
return { route, params };
|
|
1011
|
+
},
|
|
1012
|
+
${middlewarePath ? `runMiddleware({ cleanPathname, context, externalRewriteRequest, hadBasePath, isDataRequest, middlewareRequest, request, validateExternalRewriteRequest }) {
|
|
988
1013
|
return __applyAppMiddleware({
|
|
989
1014
|
basePath: __basePath,
|
|
990
1015
|
cleanPathname,
|
|
991
1016
|
context,
|
|
1017
|
+
externalRewriteRequest,
|
|
992
1018
|
hadBasePath,
|
|
993
1019
|
filePath: ${JSON.stringify(middlewarePath ? toSlash(middlewarePath) : "")},
|
|
994
1020
|
i18nConfig: __i18nConfig,
|
|
995
1021
|
isDataRequest,
|
|
996
1022
|
isProxy: ${JSON.stringify(isProxyFile(middlewarePath))},
|
|
1023
|
+
middlewareRequest,
|
|
997
1024
|
module: middlewareModule,
|
|
998
1025
|
request,
|
|
999
1026
|
trailingSlash: __trailingSlash,
|
|
1027
|
+
validateExternalRewriteRequest,
|
|
1000
1028
|
});
|
|
1001
1029
|
},` : ""}
|
|
1002
1030
|
publicFiles: __publicFiles,
|
|
@@ -115,6 +115,7 @@ function buildRouteEntries(routes, imports) {
|
|
|
115
115
|
const forbiddenLoaders = lazyLoaderArray(forbiddenPaths, imports);
|
|
116
116
|
const unauthorizedLoaders = lazyLoaderArray(unauthorizedPaths, imports);
|
|
117
117
|
const siblingInterceptEntries = (route.siblingIntercepts ?? []).map((ir) => ` {
|
|
118
|
+
id: ${JSON.stringify(ir.id ?? null)},
|
|
118
119
|
convention: ${JSON.stringify(ir.convention)},
|
|
119
120
|
targetPattern: ${JSON.stringify(ir.targetPattern)},
|
|
120
121
|
sourceMatchPattern: ${JSON.stringify(ir.sourceMatchPattern)},
|
|
@@ -2,7 +2,6 @@ import { ResolvedNextConfig } from "../config/next-config.js";
|
|
|
2
2
|
import { createValidFileMatcher } from "../routing/file-matcher.js";
|
|
3
3
|
import { StaticMiddlewareMatcher } from "../build/report.js";
|
|
4
4
|
import { VinextLinkPrefetchRoute } from "../client/vinext-next-data.js";
|
|
5
|
-
|
|
6
5
|
//#region src/entries/pages-client-entry.d.ts
|
|
7
6
|
declare function generateClientEntry(pagesDir: string, nextConfig: ResolvedNextConfig, fileMatcher: ReturnType<typeof createValidFileMatcher>, options?: {
|
|
8
7
|
appPrefetchRoutes?: readonly VinextLinkPrefetchRoute[];
|
|
@@ -2,7 +2,9 @@ import { toSlash } from "../deps/.pnpm/pathslash@0.1.0/deps/pathslash/dist/index
|
|
|
2
2
|
import { findFileWithExts } from "../routing/file-matcher.js";
|
|
3
3
|
import { patternToNextFormat } from "../routing/route-validation.js";
|
|
4
4
|
import { apiRouter, pagesRouter } from "../routing/pages-router.js";
|
|
5
|
+
import { resolveClientRuntimeModule } from "./runtime-entry-module.js";
|
|
5
6
|
import { hasExportedName } from "../build/report.js";
|
|
7
|
+
import { toClientRewrites } from "../client/client-rewrites.js";
|
|
6
8
|
import { readFile } from "node:fs/promises";
|
|
7
9
|
//#region src/entries/pages-client-entry.ts
|
|
8
10
|
/**
|
|
@@ -51,6 +53,8 @@ async function generateClientEntry(pagesDir, nextConfig, fileMatcher, options =
|
|
|
51
53
|
const pagesSsgPatterns = (await Promise.all(pageRoutes.map(async (route) => await hasGetStaticPropsExport(route.filePath) ? patternToNextFormat(route.pattern) : null))).filter((pattern) => pattern !== null);
|
|
52
54
|
const pagesSspPatterns = (await Promise.all(pageRoutes.map(async (route) => await hasGetServerSidePropsExport(route.filePath) ? patternToNextFormat(route.pattern) : null))).filter((pattern) => pattern !== null);
|
|
53
55
|
const instrumentationClientPath = options.instrumentationClientPath ?? null;
|
|
56
|
+
const clientRewrites = toClientRewrites(nextConfig.rewrites);
|
|
57
|
+
const reactInstanceBootstrapPath = resolveClientRuntimeModule("react-instance-bootstrap");
|
|
54
58
|
const loaderEntries = pageRoutes.map((r) => {
|
|
55
59
|
const absPath = r.filePath;
|
|
56
60
|
const nextFormatPattern = patternToNextFormat(r.pattern);
|
|
@@ -61,7 +65,8 @@ async function generateClientEntry(pagesDir, nextConfig, fileMatcher, options =
|
|
|
61
65
|
const userInstrumentationImport = instrumentationClientPath ? `import ${JSON.stringify(toSlash(instrumentationClientPath))};\n` : "";
|
|
62
66
|
const reactPreambleImport = options.reactPreamble === false ? "" : "import \"@vitejs/plugin-react/preamble\";\n";
|
|
63
67
|
const reactStrictModeEnabled = nextConfig.reactStrictMode === true;
|
|
64
|
-
return
|
|
68
|
+
return `import ${JSON.stringify(reactInstanceBootstrapPath)};
|
|
69
|
+
${userInstrumentationImport}${reactPreambleImport}
|
|
65
70
|
import "vinext/instrumentation-client";
|
|
66
71
|
import React from "react";
|
|
67
72
|
import { hydrateRoot } from "react-dom/client";
|
|
@@ -121,7 +126,7 @@ window.__VINEXT_LINK_PREFETCH_ROUTES__ = ${JSON.stringify(appPrefetchRoutes)};
|
|
|
121
126
|
// so whichever entry runs first emits the Pages manifest.
|
|
122
127
|
window.__VINEXT_PAGES_LINK_PREFETCH_ROUTES__ = ${JSON.stringify(pagesPrefetchRoutes)};
|
|
123
128
|
window.__VINEXT_CLIENT_REDIRECTS__ = ${JSON.stringify(nextConfig.redirects)};
|
|
124
|
-
window.__VINEXT_CLIENT_REWRITES__ = ${JSON.stringify(
|
|
129
|
+
window.__VINEXT_CLIENT_REWRITES__ = ${JSON.stringify(clientRewrites)};
|
|
125
130
|
|
|
126
131
|
const nextDataElement = document.getElementById("__NEXT_DATA__");
|
|
127
132
|
if (nextDataElement?.textContent) {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { ResolvedNextConfig } from "../config/next-config.js";
|
|
2
2
|
import { createValidFileMatcher } from "../routing/file-matcher.js";
|
|
3
|
-
|
|
4
3
|
//#region src/entries/pages-server-entry.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Generate the virtual SSR server entry module.
|
|
7
6
|
* This is the entry point for `vite build --ssr`.
|
|
8
7
|
*/
|
|
9
|
-
declare function generateServerEntry(pagesDir: string, nextConfig: ResolvedNextConfig, fileMatcher: ReturnType<typeof createValidFileMatcher>, middlewarePath: string | null, instrumentationPath: string | null): Promise<string>;
|
|
8
|
+
declare function generateServerEntry(pagesDir: string, nextConfig: ResolvedNextConfig, fileMatcher: ReturnType<typeof createValidFileMatcher>, middlewarePath: string | null, instrumentationPath: string | null, publicFiles?: string[]): Promise<string>;
|
|
10
9
|
//#endregion
|
|
11
10
|
export { generateServerEntry };
|
|
@@ -35,7 +35,7 @@ async function getPagesDataKind(filePath) {
|
|
|
35
35
|
* Generate the virtual SSR server entry module.
|
|
36
36
|
* This is the entry point for `vite build --ssr`.
|
|
37
37
|
*/
|
|
38
|
-
async function generateServerEntry(pagesDir, nextConfig, fileMatcher, middlewarePath, instrumentationPath) {
|
|
38
|
+
async function generateServerEntry(pagesDir, nextConfig, fileMatcher, middlewarePath, instrumentationPath, publicFiles = []) {
|
|
39
39
|
const pageRoutes = await pagesRouter(pagesDir, nextConfig?.pageExtensions, fileMatcher);
|
|
40
40
|
const apiRoutes = await apiRouter(pagesDir, nextConfig?.pageExtensions, fileMatcher);
|
|
41
41
|
const pageImports = pageRoutes.map((r, i) => `import * as page_${i} from ${JSON.stringify(r.filePath)};`);
|
|
@@ -64,6 +64,7 @@ async function generateServerEntry(pagesDir, nextConfig, fileMatcher, middleware
|
|
|
64
64
|
basePath: nextConfig?.basePath ?? "",
|
|
65
65
|
assetPrefix: nextConfig?.assetPrefix ?? "",
|
|
66
66
|
trailingSlash: nextConfig?.trailingSlash ?? false,
|
|
67
|
+
skipProxyUrlNormalize: nextConfig?.skipProxyUrlNormalize ?? false,
|
|
67
68
|
redirects: nextConfig?.redirects ?? [],
|
|
68
69
|
rewrites: nextConfig?.rewrites ?? {
|
|
69
70
|
beforeFiles: [],
|
|
@@ -77,6 +78,7 @@ async function generateServerEntry(pagesDir, nextConfig, fileMatcher, middleware
|
|
|
77
78
|
htmlLimitedBots: nextConfig?.htmlLimitedBots,
|
|
78
79
|
i18n: nextConfig?.i18n ?? null,
|
|
79
80
|
disableOptimizedLoading: nextConfig?.disableOptimizedLoading === true,
|
|
81
|
+
crossOrigin: nextConfig?.crossOrigin,
|
|
80
82
|
clientTraceMetadata: nextConfig?.clientTraceMetadata,
|
|
81
83
|
images: {
|
|
82
84
|
deviceSizes: nextConfig?.images?.deviceSizes,
|
|
@@ -150,7 +152,7 @@ import { buildRouteTrie as _buildRouteTrie, trieMatch as _trieMatch } from ${JSO
|
|
|
150
152
|
import { reportRequestError as _reportRequestError } from "vinext/instrumentation";
|
|
151
153
|
import { resolvePagesI18nRequest } from ${JSON.stringify(_pagesI18nPath)};
|
|
152
154
|
import { handlePagesApiRoute as __handlePagesApiRoute } from ${JSON.stringify(_pagesApiRoutePath)};
|
|
153
|
-
import { normalizePagesDataRequest as __normalizePagesDataRequest, buildNextDataNotFoundResponse as __buildNextDataNotFoundResponse } from ${JSON.stringify(_pagesDataRoutePath)};
|
|
155
|
+
import { normalizePagesDataRequest as __normalizePagesDataRequest, shouldAddTrailingSlashToPagesDataPath as __shouldAddTrailingSlashToPagesDataPath, buildNextDataNotFoundResponse as __buildNextDataNotFoundResponse } from ${JSON.stringify(_pagesDataRoutePath)};
|
|
154
156
|
import { buildDefaultPagesNotFoundResponse as __buildDefaultPagesNotFoundResponse } from ${JSON.stringify(_pagesDefault404Path)};
|
|
155
157
|
import { createPagesPageHandler as __createPagesPageHandler } from ${JSON.stringify(_pagesPageHandlerPath)};
|
|
156
158
|
import { isOnDemandRevalidateRequest as __isOnDemandRevalidateRequest } from ${JSON.stringify(_isrCachePath)};
|
|
@@ -176,7 +178,11 @@ export function normalizeDataRequest(request) {
|
|
|
176
178
|
request,
|
|
177
179
|
buildId,
|
|
178
180
|
vinextConfig.basePath,
|
|
179
|
-
|
|
181
|
+
__shouldAddTrailingSlashToPagesDataPath(
|
|
182
|
+
hasMiddleware,
|
|
183
|
+
vinextConfig.trailingSlash,
|
|
184
|
+
vinextConfig.skipProxyUrlNormalize,
|
|
185
|
+
),
|
|
180
186
|
);
|
|
181
187
|
}
|
|
182
188
|
export const hasMiddleware = ${JSON.stringify(Boolean(middlewarePath))};
|
|
@@ -201,7 +207,7 @@ async function _renderToStringAsync(element) {
|
|
|
201
207
|
return new Response(stream).text();
|
|
202
208
|
}
|
|
203
209
|
|
|
204
|
-
async function _renderIsrPassToStringAsync(element) {
|
|
210
|
+
async function _renderIsrPassToStringAsync(element, onHeadReady) {
|
|
205
211
|
// The cache-fill render is a second render pass for the same request.
|
|
206
212
|
// Reset render-scoped state so it cannot leak from the streamed response
|
|
207
213
|
// render or affect async work that is still draining from that stream.
|
|
@@ -210,7 +216,17 @@ async function _renderIsrPassToStringAsync(element) {
|
|
|
210
216
|
return await runWithServerInsertedHTMLState(() =>
|
|
211
217
|
runWithHeadState(() =>
|
|
212
218
|
_runWithCacheState(() =>
|
|
213
|
-
runWithPrivateCache(() =>
|
|
219
|
+
runWithPrivateCache(() =>
|
|
220
|
+
runWithFetchCache(async () => {
|
|
221
|
+
const html = await _renderToStringAsync(element);
|
|
222
|
+
// next/head tags are collected as a side effect of the render
|
|
223
|
+
// above and live in this ALS scope only, so a caller that wants
|
|
224
|
+
// the regenerated head has to read it here — after the render,
|
|
225
|
+
// before the scope unwinds.
|
|
226
|
+
await onHeadReady?.();
|
|
227
|
+
return html;
|
|
228
|
+
}),
|
|
229
|
+
),
|
|
214
230
|
),
|
|
215
231
|
),
|
|
216
232
|
);
|
|
@@ -226,6 +242,7 @@ ${errorImportCode}
|
|
|
226
242
|
export const pageRoutes = [
|
|
227
243
|
${pageRouteEntries.join(",\n")}
|
|
228
244
|
];
|
|
245
|
+
export const publicFiles = new Set(${JSON.stringify(publicFiles)});
|
|
229
246
|
const _pageRouteTrie = _buildRouteTrie(pageRoutes);
|
|
230
247
|
const _errorPageRoute = {
|
|
231
248
|
pattern: "/_error",
|
|
@@ -298,6 +315,7 @@ const _renderPage = __createPagesPageHandler({
|
|
|
298
315
|
htmlLimitedBots: vinextConfig.htmlLimitedBots,
|
|
299
316
|
clientTraceMetadata: vinextConfig.clientTraceMetadata,
|
|
300
317
|
disableOptimizedLoading: vinextConfig.disableOptimizedLoading,
|
|
318
|
+
crossOrigin: vinextConfig.crossOrigin,
|
|
301
319
|
},
|
|
302
320
|
buildId,
|
|
303
321
|
hasMiddleware,
|
|
@@ -385,11 +403,12 @@ export async function renderPage(request, url, manifest, ctx, middlewareHeaders,
|
|
|
385
403
|
|
|
386
404
|
|
|
387
405
|
|
|
388
|
-
export async function handleApiRoute(request, url, ctx, trustedRevalidateOrigin) {
|
|
406
|
+
export async function handleApiRoute(request, url, ctx, trustedRevalidateOrigin, edgeRuntime = "worker") {
|
|
389
407
|
__registerConfiguredCacheAdapters();
|
|
390
408
|
const match = matchRoute(url, apiRoutes);
|
|
391
409
|
return __handlePagesApiRoute({
|
|
392
410
|
ctx,
|
|
411
|
+
edgeRuntime,
|
|
393
412
|
match,
|
|
394
413
|
nextConfig: vinextConfig,
|
|
395
414
|
request,
|
|
@@ -31,7 +31,8 @@ type ImageAdapterDescriptor<O extends Record<string, unknown> = Record<string, u
|
|
|
31
31
|
* Module specifier (or absolute path, e.g. from `require.resolve(...)`) whose
|
|
32
32
|
* default export is an image optimizer factory.
|
|
33
33
|
*/
|
|
34
|
-
adapter: string;
|
|
34
|
+
adapter: string;
|
|
35
|
+
/** JSON-serializable options forwarded to the factory at runtime. */
|
|
35
36
|
options?: O;
|
|
36
37
|
};
|
|
37
38
|
/**
|
|
@@ -46,7 +47,8 @@ type ImageAdapterDescriptor<O extends Record<string, unknown> = Record<string, u
|
|
|
46
47
|
* serializable next.config data.
|
|
47
48
|
*/
|
|
48
49
|
type VinextImageConfig = {
|
|
49
|
-
/** Server-side image optimizer adapter (the `/_next/image` transform backend). */
|
|
50
|
+
/** Server-side image optimizer adapter (the `/_next/image` transform backend). */
|
|
51
|
+
optimizer?: ImageAdapterDescriptor;
|
|
50
52
|
};
|
|
51
53
|
/** Public virtual module id imported by the server entries. */
|
|
52
54
|
declare const VIRTUAL_IMAGE_ADAPTERS = "virtual:vinext-image-adapters";
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ import { AppStaticExportOptions, StaticExportOptions, StaticExportResult, static
|
|
|
5
5
|
import { VinextImageConfig } from "./image/image-adapters-virtual.js";
|
|
6
6
|
import { PluginOption } from "vite";
|
|
7
7
|
import { Options } from "@vitejs/plugin-react";
|
|
8
|
-
|
|
9
8
|
//#region src/index.d.ts
|
|
10
9
|
type VinextOptions = {
|
|
11
10
|
/**
|