vinext 0.0.54 → 0.1.0
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 +52 -15
- package/dist/build/clean-output.d.ts +1 -2
- package/dist/build/clean-output.js +0 -2
- package/dist/build/client-build-config.d.ts +16 -3
- package/dist/build/client-build-config.js +29 -4
- package/dist/build/css-url-assets.d.ts +29 -0
- package/dist/build/css-url-assets.js +211 -0
- package/dist/build/google-fonts/build-url.d.ts +1 -2
- package/dist/build/google-fonts/build-url.js +0 -2
- package/dist/build/google-fonts/fallback-metrics-data.js +0 -2
- package/dist/build/google-fonts/fallback-metrics.d.ts +1 -2
- package/dist/build/google-fonts/fallback-metrics.js +0 -2
- package/dist/build/google-fonts/font-data.js +0 -2
- package/dist/build/google-fonts/font-metadata.d.ts +1 -2
- package/dist/build/google-fonts/font-metadata.js +0 -2
- package/dist/build/google-fonts/get-axes.d.ts +1 -2
- package/dist/build/google-fonts/get-axes.js +0 -2
- package/dist/build/google-fonts/sort-variants.d.ts +1 -2
- package/dist/build/google-fonts/sort-variants.js +0 -2
- package/dist/build/google-fonts/validate.d.ts +1 -2
- package/dist/build/google-fonts/validate.js +0 -2
- package/dist/build/inline-css.d.ts +1 -2
- package/dist/build/inline-css.js +0 -2
- package/dist/build/layout-classification-types.d.ts +1 -2
- package/dist/build/layout-classification.d.ts +2 -3
- package/dist/build/layout-classification.js +1 -3
- package/dist/build/next-client-runtime-manifests.d.ts +14 -0
- package/dist/build/next-client-runtime-manifests.js +39 -0
- package/dist/build/nitro-route-rules.d.ts +1 -2
- package/dist/build/nitro-route-rules.js +0 -2
- package/dist/build/precompress.d.ts +1 -2
- package/dist/build/precompress.js +0 -2
- package/dist/build/prerender.d.ts +2 -3
- package/dist/build/prerender.js +14 -2
- package/dist/build/report.d.ts +1 -2
- package/dist/build/report.js +0 -2
- package/dist/build/route-classification-injector.d.ts +1 -2
- package/dist/build/route-classification-injector.js +4 -6
- package/dist/build/route-classification-manifest.d.ts +5 -6
- package/dist/build/route-classification-manifest.js +5 -7
- package/dist/build/run-prerender.d.ts +1 -2
- package/dist/build/run-prerender.js +15 -7
- package/dist/build/server-manifest.d.ts +1 -2
- package/dist/build/server-manifest.js +0 -2
- package/dist/build/ssr-manifest.d.ts +1 -2
- package/dist/build/ssr-manifest.js +2 -4
- package/dist/build/standalone.d.ts +1 -2
- package/dist/build/standalone.js +0 -2
- package/dist/build/static-export.d.ts +2 -3
- package/dist/build/static-export.js +0 -2
- package/dist/cache/cache-adapters-virtual.d.ts +50 -0
- package/dist/cache/cache-adapters-virtual.js +45 -0
- package/dist/check.d.ts +33 -2
- package/dist/check.js +321 -27
- package/dist/cli-args.d.ts +1 -2
- package/dist/cli-args.js +0 -2
- package/dist/cli.js +7 -13
- package/dist/client/instrumentation-client-inject.d.ts +1 -2
- package/dist/client/instrumentation-client-inject.js +0 -2
- package/dist/client/instrumentation-client-state.d.ts +1 -2
- package/dist/client/instrumentation-client-state.js +0 -2
- package/dist/client/instrumentation-client.d.ts +1 -2
- package/dist/client/instrumentation-client.js +0 -2
- package/dist/client/navigation-runtime.d.ts +2 -2
- package/dist/client/navigation-runtime.js +1 -3
- package/dist/client/pages-router-link-navigation.d.ts +1 -2
- package/dist/client/pages-router-link-navigation.js +0 -2
- package/dist/client/validate-module-path.d.ts +1 -2
- package/dist/client/validate-module-path.js +0 -2
- package/dist/client/vinext-next-data.d.ts +1 -2
- package/dist/client/vinext-next-data.js +0 -2
- package/dist/client/window-next.d.ts +1 -2
- package/dist/client/window-next.js +0 -2
- package/dist/cloudflare/index.d.ts +1 -1
- package/dist/cloudflare/index.js +1 -1
- package/dist/cloudflare/src/cache/cdn-adapter.runtime.js +97 -0
- package/dist/cloudflare/{kv-cache-handler.d.ts → src/cache/kv-data-adapter.runtime.d.ts} +25 -6
- package/dist/cloudflare/{kv-cache-handler.js → src/cache/kv-data-adapter.runtime.js} +36 -28
- package/dist/cloudflare/src/utils/cache-control-metadata.js +20 -0
- package/dist/cloudflare/tpr.d.ts +2 -3
- package/dist/cloudflare/tpr.js +8 -8
- package/dist/config/config-matchers.d.ts +1 -2
- package/dist/config/config-matchers.js +0 -2
- package/dist/config/dotenv.d.ts +1 -2
- package/dist/config/dotenv.js +0 -2
- package/dist/config/next-config.d.ts +30 -3
- package/dist/config/next-config.js +47 -8
- package/dist/config/tsconfig-paths.d.ts +12 -4
- package/dist/config/tsconfig-paths.js +58 -31
- package/dist/deploy.d.ts +48 -3
- package/dist/deploy.js +141 -112
- package/dist/entries/app-browser-entry.d.ts +1 -2
- package/dist/entries/app-browser-entry.js +0 -2
- package/dist/entries/app-rsc-entry.d.ts +6 -5
- package/dist/entries/app-rsc-entry.js +62 -61
- package/dist/entries/app-rsc-manifest.d.ts +1 -2
- package/dist/entries/app-rsc-manifest.js +42 -12
- package/dist/entries/app-ssr-entry.d.ts +1 -2
- package/dist/entries/app-ssr-entry.js +0 -2
- package/dist/entries/pages-client-entry.d.ts +3 -3
- package/dist/entries/pages-client-entry.js +16 -5
- package/dist/entries/pages-entry-helpers.d.ts +2 -11
- package/dist/entries/pages-entry-helpers.js +1 -20
- package/dist/entries/pages-server-entry.d.ts +2 -3
- package/dist/entries/pages-server-entry.js +94 -670
- package/dist/entries/runtime-entry-module.d.ts +1 -2
- package/dist/entries/runtime-entry-module.js +0 -2
- package/dist/index.d.ts +22 -2
- package/dist/index.js +297 -140
- package/dist/init.d.ts +1 -2
- package/dist/init.js +1 -3
- package/dist/plugins/ast-utils.d.ts +20 -0
- package/dist/plugins/ast-utils.js +78 -0
- package/dist/plugins/async-hooks-stub.d.ts +1 -2
- package/dist/plugins/async-hooks-stub.js +0 -2
- package/dist/plugins/client-reference-dedup.d.ts +1 -2
- package/dist/plugins/client-reference-dedup.js +4 -8
- package/dist/plugins/css-data-url.d.ts +1 -2
- package/dist/plugins/css-data-url.js +0 -2
- package/dist/plugins/fonts.d.ts +13 -3
- package/dist/plugins/fonts.js +19 -13
- package/dist/plugins/import-meta-url.d.ts +16 -0
- package/dist/plugins/import-meta-url.js +347 -0
- package/dist/plugins/instrumentation-client.d.ts +1 -2
- package/dist/plugins/instrumentation-client.js +0 -2
- package/dist/plugins/middleware-server-only.d.ts +1 -2
- package/dist/plugins/middleware-server-only.js +0 -2
- package/dist/plugins/og-assets.d.ts +32 -8
- package/dist/plugins/og-assets.js +126 -34
- package/dist/plugins/optimize-imports.d.ts +1 -2
- package/dist/plugins/optimize-imports.js +9 -17
- package/dist/plugins/postcss.d.ts +1 -2
- package/dist/plugins/postcss.js +0 -2
- package/dist/plugins/remove-console.d.ts +1 -2
- package/dist/plugins/remove-console.js +0 -2
- package/dist/plugins/rsc-client-reference-loaders.d.ts +1 -2
- package/dist/plugins/rsc-client-reference-loaders.js +0 -2
- package/dist/plugins/rsc-client-shim-excludes.d.ts +1 -2
- package/dist/plugins/rsc-client-shim-excludes.js +0 -2
- package/dist/plugins/sass.d.ts +1 -2
- package/dist/plugins/sass.js +0 -2
- package/dist/plugins/server-externals-manifest.d.ts +1 -2
- package/dist/plugins/server-externals-manifest.js +0 -2
- package/dist/plugins/strip-server-exports.d.ts +1 -2
- package/dist/plugins/strip-server-exports.js +0 -2
- package/dist/routing/app-route-graph.d.ts +2 -9
- package/dist/routing/app-route-graph.js +9 -30
- package/dist/routing/app-router.d.ts +1 -2
- package/dist/routing/app-router.js +0 -2
- package/dist/routing/file-matcher.d.ts +6 -2
- package/dist/routing/file-matcher.js +15 -7
- package/dist/routing/pages-router.d.ts +1 -2
- package/dist/routing/pages-router.js +0 -2
- package/dist/routing/route-matching.d.ts +1 -2
- package/dist/routing/route-matching.js +0 -2
- package/dist/routing/route-pattern.d.ts +1 -2
- package/dist/routing/route-pattern.js +0 -2
- package/dist/routing/route-trie.d.ts +1 -2
- package/dist/routing/route-trie.js +0 -2
- package/dist/routing/route-validation.d.ts +1 -2
- package/dist/routing/route-validation.js +0 -2
- package/dist/routing/utils.d.ts +44 -2
- package/dist/routing/utils.js +62 -3
- package/dist/server/api-handler.d.ts +1 -2
- package/dist/server/api-handler.js +0 -2
- package/dist/server/app-bfcache-id.d.ts +5 -0
- package/dist/server/app-bfcache-id.js +5 -0
- package/dist/server/app-browser-action-result.d.ts +9 -17
- package/dist/server/app-browser-action-result.js +25 -16
- package/dist/server/app-browser-client-reuse-manifest.d.ts +12 -0
- package/dist/server/app-browser-client-reuse-manifest.js +101 -0
- package/dist/server/app-browser-entry.js +352 -115
- package/dist/server/app-browser-error.d.ts +1 -2
- package/dist/server/app-browser-error.js +0 -2
- package/dist/server/app-browser-hydration.d.ts +1 -2
- package/dist/server/app-browser-hydration.js +0 -2
- package/dist/server/app-browser-interception-context.d.ts +1 -2
- package/dist/server/app-browser-interception-context.js +0 -2
- package/dist/server/app-browser-mpa-navigation.d.ts +16 -0
- package/dist/server/app-browser-mpa-navigation.js +42 -0
- package/dist/server/app-browser-navigation-controller.d.ts +5 -4
- package/dist/server/app-browser-navigation-controller.js +3 -3
- package/dist/server/app-browser-popstate.d.ts +4 -3
- package/dist/server/app-browser-popstate.js +15 -3
- package/dist/server/app-browser-rsc-redirect.d.ts +1 -2
- package/dist/server/app-browser-rsc-redirect.js +0 -2
- package/dist/server/app-browser-state.d.ts +28 -4
- package/dist/server/app-browser-state.js +195 -11
- package/dist/server/app-browser-stream.d.ts +1 -2
- package/dist/server/app-browser-stream.js +0 -2
- package/dist/server/app-browser-visible-commit.d.ts +2 -3
- package/dist/server/app-browser-visible-commit.js +24 -17
- package/dist/server/app-client-reference-preloader.d.ts +1 -2
- package/dist/server/app-client-reference-preloader.js +0 -2
- package/dist/server/app-elements-wire.d.ts +14 -8
- package/dist/server/app-elements-wire.js +45 -24
- package/dist/server/app-elements.d.ts +2 -3
- package/dist/server/app-elements.js +2 -4
- package/dist/server/app-fallback-renderer.d.ts +5 -5
- package/dist/server/app-fallback-renderer.js +4 -3
- package/dist/server/app-history-state.d.ts +18 -2
- package/dist/server/app-history-state.js +68 -10
- package/dist/server/app-hook-warning-suppression.d.ts +1 -2
- package/dist/server/app-hook-warning-suppression.js +0 -2
- package/dist/server/app-inline-css-client.d.ts +1 -2
- package/dist/server/app-inline-css-client.js +0 -2
- package/dist/server/app-interception-context-header.d.ts +1 -2
- package/dist/server/app-interception-context-header.js +0 -2
- package/dist/server/app-layout-param-observation.d.ts +43 -0
- package/dist/server/app-layout-param-observation.js +168 -0
- package/dist/server/app-middleware.d.ts +1 -2
- package/dist/server/app-middleware.js +0 -2
- package/dist/server/app-mounted-slots-header.d.ts +1 -2
- package/dist/server/app-mounted-slots-header.js +0 -2
- package/dist/server/app-optimistic-routing.d.ts +1 -2
- package/dist/server/app-optimistic-routing.js +0 -2
- package/dist/server/app-page-boundary-render.d.ts +4 -3
- package/dist/server/app-page-boundary-render.js +20 -11
- package/dist/server/app-page-boundary.d.ts +11 -2
- package/dist/server/app-page-boundary.js +13 -4
- package/dist/server/app-page-cache.d.ts +3 -3
- package/dist/server/app-page-cache.js +36 -11
- package/dist/server/app-page-dispatch.d.ts +19 -5
- package/dist/server/app-page-dispatch.js +119 -24
- package/dist/server/app-page-element-builder.d.ts +3 -2
- package/dist/server/app-page-element-builder.js +9 -11
- package/dist/server/app-page-execution.d.ts +8 -3
- package/dist/server/app-page-execution.js +55 -24
- package/dist/server/app-page-head.d.ts +1 -2
- package/dist/server/app-page-head.js +6 -6
- package/dist/server/app-page-method.d.ts +1 -2
- package/dist/server/app-page-method.js +0 -2
- package/dist/server/app-page-params.d.ts +2 -2
- package/dist/server/app-page-params.js +14 -3
- package/dist/server/app-page-probe.d.ts +90 -2
- package/dist/server/app-page-probe.js +201 -6
- package/dist/server/app-page-render-identity.d.ts +1 -2
- package/dist/server/app-page-render-identity.js +0 -2
- package/dist/server/app-page-render-observation.d.ts +1 -2
- package/dist/server/app-page-render-observation.js +0 -2
- package/dist/server/app-page-render.d.ts +9 -3
- package/dist/server/app-page-render.js +167 -10
- package/dist/server/app-page-request.d.ts +4 -3
- package/dist/server/app-page-request.js +1 -3
- package/dist/server/app-page-response.d.ts +2 -2
- package/dist/server/app-page-response.js +5 -3
- package/dist/server/app-page-route-wiring.d.ts +14 -3
- package/dist/server/app-page-route-wiring.js +63 -11
- package/dist/server/app-page-search-params-observation.d.ts +10 -0
- package/dist/server/app-page-search-params-observation.js +20 -0
- package/dist/server/app-page-segment-state.d.ts +1 -2
- package/dist/server/app-page-segment-state.js +1 -8
- package/dist/server/app-page-stream.d.ts +19 -9
- package/dist/server/app-page-stream.js +28 -10
- package/dist/server/app-pages-bridge.d.ts +25 -0
- package/dist/server/app-pages-bridge.js +34 -0
- package/dist/server/app-post-middleware-context.d.ts +1 -2
- package/dist/server/app-post-middleware-context.js +0 -2
- package/dist/server/app-ppr-fallback-shell.d.ts +21 -0
- package/dist/server/app-ppr-fallback-shell.js +82 -0
- package/dist/server/app-prerender-endpoints.d.ts +1 -2
- package/dist/server/app-prerender-endpoints.js +0 -2
- package/dist/server/app-prerender-static-params.d.ts +15 -2
- package/dist/server/app-prerender-static-params.js +44 -13
- package/dist/server/app-render-dependency.d.ts +3 -2
- package/dist/server/app-render-dependency.js +9 -3
- package/dist/server/app-request-context.d.ts +1 -2
- package/dist/server/app-request-context.js +0 -2
- package/dist/server/app-route-handler-cache.d.ts +1 -2
- package/dist/server/app-route-handler-cache.js +0 -2
- package/dist/server/app-route-handler-dispatch.d.ts +1 -2
- package/dist/server/app-route-handler-dispatch.js +0 -2
- package/dist/server/app-route-handler-execution.d.ts +1 -2
- package/dist/server/app-route-handler-execution.js +2 -4
- package/dist/server/app-route-handler-policy.d.ts +1 -2
- package/dist/server/app-route-handler-policy.js +0 -2
- package/dist/server/app-route-handler-response.d.ts +2 -3
- package/dist/server/app-route-handler-response.js +8 -7
- package/dist/server/app-route-handler-runtime.d.ts +1 -2
- package/dist/server/app-route-handler-runtime.js +0 -2
- package/dist/server/app-route-module-loader.d.ts +43 -0
- package/dist/server/app-route-module-loader.js +32 -0
- package/dist/server/app-router-entry.d.ts +1 -2
- package/dist/server/app-router-entry.js +2 -2
- package/dist/server/app-rsc-cache-busting.d.ts +12 -3
- package/dist/server/app-rsc-cache-busting.js +21 -10
- package/dist/server/app-rsc-embedded-chunks.d.ts +1 -2
- package/dist/server/app-rsc-embedded-chunks.js +0 -2
- package/dist/server/app-rsc-error-handler.d.ts +1 -2
- package/dist/server/app-rsc-error-handler.js +0 -2
- package/dist/server/app-rsc-errors.d.ts +1 -2
- package/dist/server/app-rsc-errors.js +0 -2
- package/dist/server/app-rsc-handler.d.ts +16 -2
- package/dist/server/app-rsc-handler.js +32 -14
- package/dist/server/app-rsc-render-mode.d.ts +1 -2
- package/dist/server/app-rsc-render-mode.js +0 -2
- package/dist/server/app-rsc-request-normalization.d.ts +4 -5
- package/dist/server/app-rsc-request-normalization.js +2 -4
- package/dist/server/app-rsc-response-finalizer.d.ts +1 -2
- package/dist/server/app-rsc-response-finalizer.js +2 -2
- package/dist/server/app-rsc-route-matching.d.ts +1 -2
- package/dist/server/app-rsc-route-matching.js +0 -2
- package/dist/server/app-segment-config.d.ts +5 -3
- package/dist/server/app-segment-config.js +12 -3
- package/dist/server/app-server-action-execution.d.ts +12 -2
- package/dist/server/app-server-action-execution.js +200 -25
- package/dist/server/app-ssr-entry.d.ts +5 -4
- package/dist/server/app-ssr-entry.js +31 -15
- package/dist/server/app-ssr-error-meta.d.ts +1 -2
- package/dist/server/app-ssr-error-meta.js +0 -2
- package/dist/server/app-ssr-stream.d.ts +1 -2
- package/dist/server/app-ssr-stream.js +31 -3
- package/dist/server/app-static-generation.d.ts +1 -2
- package/dist/server/app-static-generation.js +0 -2
- package/dist/server/app-visited-response-cache.d.ts +23 -0
- package/dist/server/app-visited-response-cache.js +19 -0
- package/dist/server/artifact-compatibility.d.ts +2 -2
- package/dist/server/artifact-compatibility.js +12 -7
- package/dist/server/cache-control.d.ts +15 -2
- package/dist/server/cache-control.js +21 -3
- package/dist/server/cache-headers.d.ts +1 -2
- package/dist/server/cache-headers.js +0 -2
- package/dist/server/cache-proof.d.ts +1 -2
- package/dist/server/cache-proof.js +0 -2
- package/dist/server/client-reuse-manifest.d.ts +10 -5
- package/dist/server/client-reuse-manifest.js +7 -10
- package/dist/server/client-trace-metadata.d.ts +1 -2
- package/dist/server/client-trace-metadata.js +0 -2
- package/dist/server/cookie-utils.d.ts +1 -2
- package/dist/server/cookie-utils.js +0 -2
- package/dist/server/csp.d.ts +1 -2
- package/dist/server/csp.js +0 -2
- package/dist/server/default-global-error-module.d.ts +1 -2
- package/dist/server/default-global-error-module.js +0 -2
- package/dist/server/default-not-found-module.d.ts +1 -2
- package/dist/server/default-not-found-module.js +0 -2
- package/dist/server/dev-error-overlay-store.d.ts +20 -4
- package/dist/server/dev-error-overlay-store.js +23 -4
- package/dist/server/dev-error-overlay.d.ts +39 -3
- package/dist/server/dev-error-overlay.js +952 -164
- package/dist/server/dev-initial-server-error.d.ts +9 -0
- package/dist/server/dev-initial-server-error.js +26 -0
- package/dist/server/dev-lockfile.d.ts +1 -2
- package/dist/server/dev-lockfile.js +0 -2
- package/dist/server/dev-module-runner.d.ts +1 -2
- package/dist/server/dev-module-runner.js +0 -2
- package/dist/server/dev-origin-check.d.ts +1 -2
- package/dist/server/dev-origin-check.js +0 -2
- package/dist/server/dev-route-files.d.ts +1 -2
- package/dist/server/dev-route-files.js +0 -2
- package/dist/server/dev-server.d.ts +2 -3
- package/dist/server/dev-server.js +127 -28
- package/dist/server/dev-stack-sourcemap-endpoint.d.ts +4 -0
- package/dist/server/dev-stack-sourcemap-endpoint.js +4 -0
- package/dist/server/dev-stack-sourcemap.d.ts +43 -0
- package/dist/server/dev-stack-sourcemap.js +443 -0
- package/dist/server/document-initial-head.d.ts +6 -0
- package/dist/server/document-initial-head.js +33 -0
- package/dist/server/edge-api-runtime.d.ts +1 -2
- package/dist/server/edge-api-runtime.js +0 -2
- package/dist/server/file-based-metadata.d.ts +1 -2
- package/dist/server/file-based-metadata.js +0 -2
- package/dist/server/headers.d.ts +3 -2
- package/dist/server/headers.js +3 -3
- package/dist/server/html.d.ts +1 -2
- package/dist/server/html.js +0 -2
- package/dist/server/http-error-responses.d.ts +1 -2
- package/dist/server/http-error-responses.js +0 -2
- package/dist/server/image-optimization.d.ts +1 -2
- package/dist/server/image-optimization.js +0 -2
- package/dist/server/implicit-tags.d.ts +1 -2
- package/dist/server/implicit-tags.js +0 -2
- package/dist/server/instrumentation-runtime.d.ts +1 -2
- package/dist/server/instrumentation-runtime.js +0 -2
- package/dist/server/instrumentation.d.ts +1 -2
- package/dist/server/instrumentation.js +0 -2
- package/dist/server/isr-cache.d.ts +10 -3
- package/dist/server/isr-cache.js +13 -28
- package/dist/server/metadata-route-build-data.d.ts +1 -2
- package/dist/server/metadata-route-build-data.js +0 -2
- package/dist/server/metadata-route-response.d.ts +1 -2
- package/dist/server/metadata-route-response.js +0 -2
- package/dist/server/metadata-routes.d.ts +1 -2
- package/dist/server/metadata-routes.js +0 -2
- package/dist/server/middleware-matcher.d.ts +1 -2
- package/dist/server/middleware-matcher.js +0 -2
- package/dist/server/middleware-request-headers.d.ts +1 -2
- package/dist/server/middleware-request-headers.js +0 -2
- package/dist/server/middleware-response-headers.d.ts +1 -2
- package/dist/server/middleware-response-headers.js +0 -2
- package/dist/server/middleware-runtime.d.ts +1 -2
- package/dist/server/middleware-runtime.js +14 -5
- package/dist/server/middleware.d.ts +2 -3
- package/dist/server/middleware.js +0 -2
- package/dist/server/navigation-planner.d.ts +16 -2
- package/dist/server/navigation-planner.js +1 -3
- package/dist/server/navigation-trace.d.ts +1 -2
- package/dist/server/navigation-trace.js +0 -2
- package/dist/server/next-error-digest.d.ts +1 -2
- package/dist/server/next-error-digest.js +0 -2
- package/dist/server/normalize-path.d.ts +1 -2
- package/dist/server/normalize-path.js +0 -2
- package/dist/server/pages-api-route.d.ts +1 -2
- package/dist/server/pages-api-route.js +1 -3
- package/dist/server/pages-asset-tags.d.ts +66 -0
- package/dist/server/pages-asset-tags.js +116 -0
- package/dist/server/pages-body-parser-config.d.ts +1 -2
- package/dist/server/pages-body-parser-config.js +0 -2
- package/dist/server/pages-data-route.d.ts +39 -2
- package/dist/server/pages-data-route.js +46 -3
- package/dist/server/pages-default-404.d.ts +1 -2
- package/dist/server/pages-default-404.js +0 -2
- package/dist/server/pages-document-initial-props.d.ts +84 -3
- package/dist/server/pages-document-initial-props.js +127 -3
- package/dist/server/pages-get-initial-props.d.ts +17 -0
- package/dist/server/pages-get-initial-props.js +50 -0
- package/dist/server/pages-i18n.d.ts +1 -2
- package/dist/server/pages-i18n.js +0 -2
- package/dist/server/pages-media-type.d.ts +1 -2
- package/dist/server/pages-media-type.js +1 -2
- package/dist/server/pages-node-compat.d.ts +9 -2
- package/dist/server/pages-node-compat.js +35 -4
- package/dist/server/pages-page-data.d.ts +7 -3
- package/dist/server/pages-page-data.js +75 -33
- package/dist/server/pages-page-handler.d.ts +90 -0
- package/dist/server/pages-page-handler.js +335 -0
- package/dist/server/pages-page-method.d.ts +1 -2
- package/dist/server/pages-page-method.js +0 -2
- package/dist/server/pages-page-response.d.ts +15 -2
- package/dist/server/pages-page-response.js +39 -12
- package/dist/server/pages-serializable-props.d.ts +1 -2
- package/dist/server/pages-serializable-props.js +0 -2
- package/dist/server/pregenerated-concrete-paths.d.ts +32 -0
- package/dist/server/pregenerated-concrete-paths.js +78 -0
- package/dist/server/prerender-route-params.d.ts +13 -3
- package/dist/server/prerender-route-params.js +30 -11
- package/dist/server/prerender-work-unit-setup.d.ts +1 -2
- package/dist/server/prerender-work-unit-setup.js +0 -2
- package/dist/server/prod-server.d.ts +2 -4
- package/dist/server/prod-server.js +13 -8
- package/dist/server/proxy-trust.d.ts +1 -2
- package/dist/server/proxy-trust.js +0 -2
- package/dist/server/request-log.d.ts +1 -2
- package/dist/server/request-log.js +0 -2
- package/dist/server/request-pipeline.d.ts +14 -2
- package/dist/server/request-pipeline.js +42 -3
- package/dist/server/rsc-stream-hints.d.ts +1 -2
- package/dist/server/rsc-stream-hints.js +0 -2
- package/dist/server/seed-cache.d.ts +6 -2
- package/dist/server/seed-cache.js +10 -8
- package/dist/server/server-action-not-found.d.ts +1 -2
- package/dist/server/server-action-not-found.js +0 -2
- package/dist/server/server-globals.d.ts +1 -2
- package/dist/server/server-globals.js +0 -2
- package/dist/server/skip-cache-proof.d.ts +23 -3
- package/dist/server/skip-cache-proof.js +81 -14
- package/dist/server/socket-error-backstop.d.ts +1 -2
- package/dist/server/socket-error-backstop.js +0 -2
- package/dist/server/static-file-cache.d.ts +1 -2
- package/dist/server/static-file-cache.js +0 -2
- package/dist/server/static-layout-client-reuse-proof.d.ts +15 -0
- package/dist/server/static-layout-client-reuse-proof.js +33 -0
- package/dist/server/streaming-metadata.d.ts +1 -2
- package/dist/server/streaming-metadata.js +0 -2
- package/dist/server/worker-utils.d.ts +1 -2
- package/dist/server/worker-utils.js +3 -6
- package/dist/shims/amp.d.ts +1 -2
- package/dist/shims/amp.js +0 -2
- package/dist/shims/app-router-scroll-state.d.ts +1 -2
- package/dist/shims/app-router-scroll-state.js +0 -2
- package/dist/shims/app-router-scroll.d.ts +3 -5
- package/dist/shims/app-router-scroll.js +0 -2
- package/dist/shims/app.d.ts +1 -2
- package/dist/shims/app.js +0 -2
- package/dist/shims/before-interactive-context.d.ts +1 -2
- package/dist/shims/before-interactive-context.js +0 -2
- package/dist/shims/cache-for-request.d.ts +1 -2
- package/dist/shims/cache-for-request.js +0 -2
- package/dist/shims/cache-runtime.d.ts +20 -5
- package/dist/shims/cache-runtime.js +35 -30
- package/dist/shims/cache.d.ts +68 -7
- package/dist/shims/cache.js +179 -25
- package/dist/shims/cdn-cache.d.ts +125 -0
- package/dist/shims/cdn-cache.js +100 -0
- package/dist/shims/client-hook-error.d.ts +1 -2
- package/dist/shims/client-hook-error.js +0 -2
- package/dist/shims/client-locale.d.ts +1 -2
- package/dist/shims/client-locale.js +1 -3
- package/dist/shims/compat-router.d.ts +1 -2
- package/dist/shims/compat-router.js +0 -2
- package/dist/shims/config.d.ts +1 -2
- package/dist/shims/config.js +0 -2
- package/dist/shims/constants.d.ts +1 -2
- package/dist/shims/constants.js +0 -2
- package/dist/shims/default-global-error.d.ts +3 -4
- package/dist/shims/default-global-error.js +0 -2
- package/dist/shims/default-not-found.d.ts +1 -2
- package/dist/shims/default-not-found.js +0 -2
- package/dist/shims/document.d.ts +11 -7
- package/dist/shims/document.js +7 -10
- package/dist/shims/dynamic.d.ts +1 -2
- package/dist/shims/dynamic.js +0 -2
- package/dist/shims/error-boundary.d.ts +16 -12
- package/dist/shims/error-boundary.js +60 -28
- package/dist/shims/error.d.ts +1 -2
- package/dist/shims/error.js +0 -2
- package/dist/shims/fetch-cache.d.ts +3 -2
- package/dist/shims/fetch-cache.js +18 -9
- package/dist/shims/font-google-base.d.ts +1 -2
- package/dist/shims/font-google-base.js +1 -13
- package/dist/shims/font-local.d.ts +1 -2
- package/dist/shims/font-local.js +1 -15
- package/dist/shims/font-utils.d.ts +7 -2
- package/dist/shims/font-utils.js +13 -3
- package/dist/shims/form.d.ts +12 -5
- package/dist/shims/form.js +98 -21
- package/dist/shims/hash-scroll.d.ts +4 -2
- package/dist/shims/hash-scroll.js +13 -3
- package/dist/shims/head-state.d.ts +2 -2
- package/dist/shims/head-state.js +18 -5
- package/dist/shims/head.d.ts +35 -2
- package/dist/shims/head.js +113 -16
- package/dist/shims/headers.d.ts +9 -2
- package/dist/shims/headers.js +13 -3
- package/dist/shims/i18n-context.d.ts +1 -2
- package/dist/shims/i18n-context.js +0 -2
- package/dist/shims/i18n-state.d.ts +1 -2
- package/dist/shims/i18n-state.js +0 -2
- package/dist/shims/image-config.d.ts +1 -2
- package/dist/shims/image-config.js +0 -2
- package/dist/shims/image.d.ts +1 -2
- package/dist/shims/image.js +1 -3
- package/dist/shims/internal/als-registry.d.ts +1 -2
- package/dist/shims/internal/als-registry.js +0 -2
- package/dist/shims/internal/api-utils.d.ts +1 -2
- package/dist/shims/internal/app-route-detection.d.ts +1 -2
- package/dist/shims/internal/app-route-detection.js +0 -2
- package/dist/shims/internal/app-router-context.d.ts +1 -2
- package/dist/shims/internal/app-router-context.js +0 -2
- package/dist/shims/internal/cookie-serialize.d.ts +1 -2
- package/dist/shims/internal/cookie-serialize.js +0 -2
- package/dist/shims/internal/make-hanging-promise.d.ts +1 -2
- package/dist/shims/internal/make-hanging-promise.js +0 -2
- package/dist/shims/internal/pages-data-fetch-dedup.d.ts +55 -0
- package/dist/shims/internal/pages-data-fetch-dedup.js +68 -0
- package/dist/shims/internal/pages-data-target.d.ts +1 -2
- package/dist/shims/internal/pages-data-target.js +0 -2
- package/dist/shims/internal/pages-data-url.d.ts +1 -2
- package/dist/shims/internal/pages-data-url.js +0 -2
- package/dist/shims/internal/parse-cookie-header.d.ts +1 -2
- package/dist/shims/internal/parse-cookie-header.js +0 -2
- package/dist/shims/internal/router-context.d.ts +2 -4
- package/dist/shims/internal/router-context.js +0 -2
- package/dist/shims/internal/utils.d.ts +1 -2
- package/dist/shims/internal/utils.js +0 -2
- package/dist/shims/internal/work-unit-async-storage.d.ts +1 -2
- package/dist/shims/internal/work-unit-async-storage.js +0 -2
- package/dist/shims/layout-segment-context.d.ts +2 -4
- package/dist/shims/layout-segment-context.js +0 -2
- package/dist/shims/legacy-image.d.ts +1 -2
- package/dist/shims/legacy-image.js +0 -2
- package/dist/shims/link-prefetch.d.ts +1 -2
- package/dist/shims/link-prefetch.js +0 -2
- package/dist/shims/link.d.ts +2 -2
- package/dist/shims/link.js +47 -15
- package/dist/shims/metadata.d.ts +4 -5
- package/dist/shims/metadata.js +1 -3
- package/dist/shims/navigation-state.d.ts +1 -2
- package/dist/shims/navigation-state.js +0 -2
- package/dist/shims/navigation.d.ts +61 -7
- package/dist/shims/navigation.js +244 -47
- package/dist/shims/navigation.react-server.d.ts +1 -2
- package/dist/shims/navigation.react-server.js +0 -2
- package/dist/shims/offline.d.ts +1 -2
- package/dist/shims/offline.js +0 -2
- package/dist/shims/og.d.ts +1 -2
- package/dist/shims/og.js +2 -4
- package/dist/shims/pages-router-runtime.d.ts +7 -2
- package/dist/shims/pages-router-runtime.js +11 -3
- package/dist/shims/ppr-fallback-shell.d.ts +29 -0
- package/dist/shims/ppr-fallback-shell.js +149 -0
- package/dist/shims/readonly-url-search-params.d.ts +1 -2
- package/dist/shims/readonly-url-search-params.js +0 -2
- package/dist/shims/request-context.d.ts +9 -5
- package/dist/shims/request-context.js +0 -2
- package/dist/shims/request-state-types.d.ts +1 -1
- package/dist/shims/root-params.d.ts +1 -2
- package/dist/shims/root-params.js +0 -2
- package/dist/shims/router-state.d.ts +1 -2
- package/dist/shims/router-state.js +0 -2
- package/dist/shims/router.d.ts +1 -2
- package/dist/shims/router.js +172 -37
- package/dist/shims/script-nonce-context.d.ts +1 -2
- package/dist/shims/script-nonce-context.js +0 -2
- package/dist/shims/script.d.ts +1 -2
- package/dist/shims/script.js +0 -2
- package/dist/shims/server.d.ts +1 -2
- package/dist/shims/server.js +0 -2
- package/dist/shims/slot.d.ts +11 -4
- package/dist/shims/slot.js +121 -9
- package/dist/shims/thenable-params.d.ts +6 -3
- package/dist/shims/thenable-params.js +131 -12
- package/dist/shims/unified-request-context.d.ts +1 -2
- package/dist/shims/unified-request-context.js +3 -2
- package/dist/shims/unrecognized-action-error.d.ts +1 -2
- package/dist/shims/unrecognized-action-error.js +0 -2
- package/dist/shims/url-safety.d.ts +1 -2
- package/dist/shims/url-safety.js +0 -2
- package/dist/shims/url-utils.d.ts +1 -2
- package/dist/shims/url-utils.js +0 -2
- package/dist/shims/use-merged-ref.d.ts +1 -2
- package/dist/shims/use-merged-ref.js +0 -2
- package/dist/shims/web-vitals.d.ts +1 -2
- package/dist/shims/web-vitals.js +0 -2
- package/dist/typegen.d.ts +1 -2
- package/dist/typegen.js +2 -9
- package/dist/utils/asset-prefix.d.ts +1 -2
- package/dist/utils/asset-prefix.js +0 -2
- package/dist/utils/base-path.d.ts +1 -2
- package/dist/utils/base-path.js +0 -2
- package/dist/utils/cache-control-metadata.d.ts +1 -4
- package/dist/utils/cache-control-metadata.js +1 -3
- package/dist/utils/client-build-manifest.d.ts +14 -0
- package/dist/utils/client-build-manifest.js +52 -0
- package/dist/utils/compare.d.ts +4 -0
- package/dist/utils/compare.js +8 -0
- package/dist/utils/dev-error-recovery-event.d.ts +4 -0
- package/dist/utils/dev-error-recovery-event.js +4 -0
- package/dist/utils/domain-locale.d.ts +1 -2
- package/dist/utils/domain-locale.js +2 -4
- package/dist/utils/encode-cache-tag.d.ts +1 -2
- package/dist/utils/encode-cache-tag.js +0 -2
- package/dist/utils/error-cause.d.ts +1 -2
- package/dist/utils/error-cause.js +0 -2
- package/dist/utils/hash.d.ts +1 -2
- package/dist/utils/hash.js +1 -3
- package/dist/utils/html-limited-bots.d.ts +1 -2
- package/dist/utils/html-limited-bots.js +0 -2
- package/dist/utils/lazy-chunks.d.ts +1 -2
- package/dist/utils/lazy-chunks.js +0 -2
- package/dist/utils/manifest-paths.d.ts +8 -3
- package/dist/utils/manifest-paths.js +15 -3
- package/dist/utils/mdx-scan.d.ts +1 -2
- package/dist/utils/mdx-scan.js +0 -2
- package/dist/utils/navigation-signal.d.ts +1 -2
- package/dist/utils/navigation-signal.js +0 -2
- package/dist/utils/number.d.ts +4 -0
- package/dist/utils/number.js +6 -0
- package/dist/utils/path.d.ts +4 -2
- package/dist/utils/path.js +5 -3
- package/dist/utils/prerender-output-paths.d.ts +1 -2
- package/dist/utils/prerender-output-paths.js +0 -2
- package/dist/utils/project.d.ts +1 -2
- package/dist/utils/project.js +0 -2
- package/dist/utils/promise.d.ts +4 -0
- package/dist/utils/promise.js +6 -0
- package/dist/utils/public-routes.d.ts +1 -2
- package/dist/utils/public-routes.js +0 -2
- package/dist/utils/query.d.ts +1 -2
- package/dist/utils/query.js +0 -2
- package/dist/utils/record.d.ts +1 -2
- package/dist/utils/record.js +0 -2
- package/dist/utils/regex.d.ts +4 -0
- package/dist/utils/regex.js +6 -0
- package/dist/utils/safe-json-file.d.ts +1 -2
- package/dist/utils/safe-json-file.js +0 -2
- package/dist/utils/sorted-array.d.ts +1 -2
- package/dist/utils/sorted-array.js +0 -2
- package/dist/utils/text-stream.d.ts +1 -2
- package/dist/utils/text-stream.js +0 -2
- package/dist/utils/vinext-root.d.ts +1 -2
- package/dist/utils/vinext-root.js +0 -2
- package/dist/utils/vite-version.d.ts +10 -0
- package/dist/utils/vite-version.js +34 -0
- package/package.json +20 -7
- package/dist/build/clean-output.js.map +0 -1
- package/dist/build/client-build-config.js.map +0 -1
- package/dist/build/google-fonts/build-url.js.map +0 -1
- package/dist/build/google-fonts/fallback-metrics-data.js.map +0 -1
- package/dist/build/google-fonts/fallback-metrics.js.map +0 -1
- package/dist/build/google-fonts/font-data.js.map +0 -1
- package/dist/build/google-fonts/font-metadata.js.map +0 -1
- package/dist/build/google-fonts/get-axes.js.map +0 -1
- package/dist/build/google-fonts/sort-variants.js.map +0 -1
- package/dist/build/google-fonts/validate.js.map +0 -1
- package/dist/build/inline-css.js.map +0 -1
- package/dist/build/layout-classification.js.map +0 -1
- package/dist/build/nitro-route-rules.js.map +0 -1
- package/dist/build/precompress.js.map +0 -1
- package/dist/build/prerender.js.map +0 -1
- package/dist/build/report.js.map +0 -1
- package/dist/build/route-classification-injector.js.map +0 -1
- package/dist/build/route-classification-manifest.js.map +0 -1
- package/dist/build/run-prerender.js.map +0 -1
- package/dist/build/server-manifest.js.map +0 -1
- package/dist/build/ssr-manifest.js.map +0 -1
- package/dist/build/standalone.js.map +0 -1
- package/dist/build/static-export.js.map +0 -1
- package/dist/check.js.map +0 -1
- package/dist/cli-args.js.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/client/instrumentation-client-inject.js.map +0 -1
- package/dist/client/instrumentation-client-state.js.map +0 -1
- package/dist/client/instrumentation-client.js.map +0 -1
- package/dist/client/navigation-runtime.js.map +0 -1
- package/dist/client/pages-router-link-navigation.js.map +0 -1
- package/dist/client/validate-module-path.js.map +0 -1
- package/dist/client/vinext-next-data.js.map +0 -1
- package/dist/client/window-next.js.map +0 -1
- package/dist/cloudflare/kv-cache-handler.js.map +0 -1
- package/dist/cloudflare/tpr.js.map +0 -1
- package/dist/config/config-matchers.js.map +0 -1
- package/dist/config/dotenv.js.map +0 -1
- package/dist/config/next-config.js.map +0 -1
- package/dist/config/tsconfig-paths.js.map +0 -1
- package/dist/deploy.js.map +0 -1
- package/dist/entries/app-browser-entry.js.map +0 -1
- package/dist/entries/app-rsc-entry.js.map +0 -1
- package/dist/entries/app-rsc-manifest.js.map +0 -1
- package/dist/entries/app-ssr-entry.js.map +0 -1
- package/dist/entries/pages-client-entry.js.map +0 -1
- package/dist/entries/pages-entry-helpers.js.map +0 -1
- package/dist/entries/pages-server-entry.js.map +0 -1
- package/dist/entries/runtime-entry-module.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/init.js.map +0 -1
- package/dist/plugins/async-hooks-stub.js.map +0 -1
- package/dist/plugins/client-reference-dedup.js.map +0 -1
- package/dist/plugins/css-data-url.js.map +0 -1
- package/dist/plugins/fonts.js.map +0 -1
- package/dist/plugins/instrumentation-client.js.map +0 -1
- package/dist/plugins/middleware-server-only.js.map +0 -1
- package/dist/plugins/og-assets.js.map +0 -1
- package/dist/plugins/optimize-imports.js.map +0 -1
- package/dist/plugins/postcss.js.map +0 -1
- package/dist/plugins/remove-console.js.map +0 -1
- package/dist/plugins/rsc-client-reference-loaders.js.map +0 -1
- package/dist/plugins/rsc-client-shim-excludes.js.map +0 -1
- package/dist/plugins/sass.js.map +0 -1
- package/dist/plugins/server-externals-manifest.js.map +0 -1
- package/dist/plugins/strip-server-exports.js.map +0 -1
- package/dist/routing/app-route-graph.js.map +0 -1
- package/dist/routing/app-router.js.map +0 -1
- package/dist/routing/file-matcher.js.map +0 -1
- package/dist/routing/pages-router.js.map +0 -1
- package/dist/routing/route-matching.js.map +0 -1
- package/dist/routing/route-pattern.js.map +0 -1
- package/dist/routing/route-trie.js.map +0 -1
- package/dist/routing/route-validation.js.map +0 -1
- package/dist/routing/utils.js.map +0 -1
- package/dist/server/api-handler.js.map +0 -1
- package/dist/server/app-browser-action-result.js.map +0 -1
- package/dist/server/app-browser-entry.js.map +0 -1
- package/dist/server/app-browser-error.js.map +0 -1
- package/dist/server/app-browser-hydration.js.map +0 -1
- package/dist/server/app-browser-interception-context.js.map +0 -1
- package/dist/server/app-browser-navigation-controller.js.map +0 -1
- package/dist/server/app-browser-popstate.js.map +0 -1
- package/dist/server/app-browser-rsc-redirect.js.map +0 -1
- package/dist/server/app-browser-state.js.map +0 -1
- package/dist/server/app-browser-stream.js.map +0 -1
- package/dist/server/app-browser-visible-commit.js.map +0 -1
- package/dist/server/app-client-reference-preloader.js.map +0 -1
- package/dist/server/app-elements-wire.js.map +0 -1
- package/dist/server/app-elements.js.map +0 -1
- package/dist/server/app-fallback-renderer.js.map +0 -1
- package/dist/server/app-history-state.js.map +0 -1
- package/dist/server/app-hook-warning-suppression.js.map +0 -1
- package/dist/server/app-inline-css-client.js.map +0 -1
- package/dist/server/app-interception-context-header.js.map +0 -1
- package/dist/server/app-middleware.js.map +0 -1
- package/dist/server/app-mounted-slots-header.js.map +0 -1
- package/dist/server/app-optimistic-routing.js.map +0 -1
- package/dist/server/app-page-boundary-render.js.map +0 -1
- package/dist/server/app-page-boundary.js.map +0 -1
- package/dist/server/app-page-cache.js.map +0 -1
- package/dist/server/app-page-dispatch.js.map +0 -1
- package/dist/server/app-page-element-builder.js.map +0 -1
- package/dist/server/app-page-execution.js.map +0 -1
- package/dist/server/app-page-head.js.map +0 -1
- package/dist/server/app-page-method.js.map +0 -1
- package/dist/server/app-page-params.js.map +0 -1
- package/dist/server/app-page-probe.js.map +0 -1
- package/dist/server/app-page-render-identity.js.map +0 -1
- package/dist/server/app-page-render-observation.js.map +0 -1
- package/dist/server/app-page-render.js.map +0 -1
- package/dist/server/app-page-request.js.map +0 -1
- package/dist/server/app-page-response.js.map +0 -1
- package/dist/server/app-page-route-wiring.js.map +0 -1
- package/dist/server/app-page-segment-state.js.map +0 -1
- package/dist/server/app-page-stream.js.map +0 -1
- package/dist/server/app-post-middleware-context.js.map +0 -1
- package/dist/server/app-prerender-endpoints.js.map +0 -1
- package/dist/server/app-prerender-static-params.js.map +0 -1
- package/dist/server/app-render-dependency.js.map +0 -1
- package/dist/server/app-request-context.js.map +0 -1
- package/dist/server/app-route-handler-cache.js.map +0 -1
- package/dist/server/app-route-handler-dispatch.js.map +0 -1
- package/dist/server/app-route-handler-execution.js.map +0 -1
- package/dist/server/app-route-handler-policy.js.map +0 -1
- package/dist/server/app-route-handler-response.js.map +0 -1
- package/dist/server/app-route-handler-runtime.js.map +0 -1
- package/dist/server/app-router-entry.js.map +0 -1
- package/dist/server/app-rsc-cache-busting.js.map +0 -1
- package/dist/server/app-rsc-embedded-chunks.js.map +0 -1
- package/dist/server/app-rsc-error-handler.js.map +0 -1
- package/dist/server/app-rsc-errors.js.map +0 -1
- package/dist/server/app-rsc-handler.js.map +0 -1
- package/dist/server/app-rsc-render-mode.js.map +0 -1
- package/dist/server/app-rsc-request-normalization.js.map +0 -1
- package/dist/server/app-rsc-response-finalizer.js.map +0 -1
- package/dist/server/app-rsc-route-matching.js.map +0 -1
- package/dist/server/app-segment-config.js.map +0 -1
- package/dist/server/app-server-action-execution.js.map +0 -1
- package/dist/server/app-ssr-entry.js.map +0 -1
- package/dist/server/app-ssr-error-meta.js.map +0 -1
- package/dist/server/app-ssr-stream.js.map +0 -1
- package/dist/server/app-static-generation.js.map +0 -1
- package/dist/server/artifact-compatibility.js.map +0 -1
- package/dist/server/cache-control.js.map +0 -1
- package/dist/server/cache-headers.js.map +0 -1
- package/dist/server/cache-proof.js.map +0 -1
- package/dist/server/client-reuse-manifest.js.map +0 -1
- package/dist/server/client-trace-metadata.js.map +0 -1
- package/dist/server/cookie-utils.js.map +0 -1
- package/dist/server/csp.js.map +0 -1
- package/dist/server/default-global-error-module.js.map +0 -1
- package/dist/server/default-not-found-module.js.map +0 -1
- package/dist/server/dev-error-overlay-store.js.map +0 -1
- package/dist/server/dev-error-overlay.js.map +0 -1
- package/dist/server/dev-lockfile.js.map +0 -1
- package/dist/server/dev-module-runner.js.map +0 -1
- package/dist/server/dev-origin-check.js.map +0 -1
- package/dist/server/dev-route-files.js.map +0 -1
- package/dist/server/dev-server.js.map +0 -1
- package/dist/server/edge-api-runtime.js.map +0 -1
- package/dist/server/file-based-metadata.js.map +0 -1
- package/dist/server/headers.js.map +0 -1
- package/dist/server/html.js.map +0 -1
- package/dist/server/http-error-responses.js.map +0 -1
- package/dist/server/image-optimization.js.map +0 -1
- package/dist/server/implicit-tags.js.map +0 -1
- package/dist/server/instrumentation-runtime.js.map +0 -1
- package/dist/server/instrumentation.js.map +0 -1
- package/dist/server/isr-cache.js.map +0 -1
- package/dist/server/metadata-route-build-data.js.map +0 -1
- package/dist/server/metadata-route-response.js.map +0 -1
- package/dist/server/metadata-routes.js.map +0 -1
- package/dist/server/middleware-matcher.js.map +0 -1
- package/dist/server/middleware-request-headers.js.map +0 -1
- package/dist/server/middleware-response-headers.js.map +0 -1
- package/dist/server/middleware-runtime.js.map +0 -1
- package/dist/server/middleware.js.map +0 -1
- package/dist/server/navigation-planner.js.map +0 -1
- package/dist/server/navigation-trace.js.map +0 -1
- package/dist/server/next-error-digest.js.map +0 -1
- package/dist/server/normalize-path.js.map +0 -1
- package/dist/server/pages-api-route.js.map +0 -1
- package/dist/server/pages-body-parser-config.js.map +0 -1
- package/dist/server/pages-data-route.js.map +0 -1
- package/dist/server/pages-default-404.js.map +0 -1
- package/dist/server/pages-document-initial-props.js.map +0 -1
- package/dist/server/pages-i18n.js.map +0 -1
- package/dist/server/pages-media-type.js.map +0 -1
- package/dist/server/pages-node-compat.js.map +0 -1
- package/dist/server/pages-page-data.js.map +0 -1
- package/dist/server/pages-page-method.js.map +0 -1
- package/dist/server/pages-page-response.js.map +0 -1
- package/dist/server/pages-serializable-props.js.map +0 -1
- package/dist/server/prerender-route-params.js.map +0 -1
- package/dist/server/prerender-work-unit-setup.js.map +0 -1
- package/dist/server/prod-server.js.map +0 -1
- package/dist/server/proxy-trust.js.map +0 -1
- package/dist/server/request-log.js.map +0 -1
- package/dist/server/request-pipeline.js.map +0 -1
- package/dist/server/rsc-stream-hints.js.map +0 -1
- package/dist/server/seed-cache.js.map +0 -1
- package/dist/server/server-action-not-found.js.map +0 -1
- package/dist/server/server-globals.js.map +0 -1
- package/dist/server/skip-cache-proof.js.map +0 -1
- package/dist/server/socket-error-backstop.js.map +0 -1
- package/dist/server/static-file-cache.js.map +0 -1
- package/dist/server/streaming-metadata.js.map +0 -1
- package/dist/server/worker-utils.js.map +0 -1
- package/dist/shims/amp.js.map +0 -1
- package/dist/shims/app-router-scroll-state.js.map +0 -1
- package/dist/shims/app-router-scroll.js.map +0 -1
- package/dist/shims/app.js.map +0 -1
- package/dist/shims/before-interactive-context.js.map +0 -1
- package/dist/shims/cache-for-request.js.map +0 -1
- package/dist/shims/cache-runtime.js.map +0 -1
- package/dist/shims/cache.js.map +0 -1
- package/dist/shims/client-hook-error.js.map +0 -1
- package/dist/shims/client-locale.js.map +0 -1
- package/dist/shims/compat-router.js.map +0 -1
- package/dist/shims/config.js.map +0 -1
- package/dist/shims/constants.js.map +0 -1
- package/dist/shims/default-global-error.js.map +0 -1
- package/dist/shims/default-not-found.js.map +0 -1
- package/dist/shims/document.js.map +0 -1
- package/dist/shims/dynamic.js.map +0 -1
- package/dist/shims/error-boundary.js.map +0 -1
- package/dist/shims/error.js.map +0 -1
- package/dist/shims/fetch-cache.js.map +0 -1
- package/dist/shims/font-google-base.js.map +0 -1
- package/dist/shims/font-local.js.map +0 -1
- package/dist/shims/font-utils.js.map +0 -1
- package/dist/shims/form.js.map +0 -1
- package/dist/shims/hash-scroll.js.map +0 -1
- package/dist/shims/head-state.js.map +0 -1
- package/dist/shims/head.js.map +0 -1
- package/dist/shims/headers.js.map +0 -1
- package/dist/shims/i18n-context.js.map +0 -1
- package/dist/shims/i18n-state.js.map +0 -1
- package/dist/shims/image-config.js.map +0 -1
- package/dist/shims/image.js.map +0 -1
- package/dist/shims/internal/als-registry.js.map +0 -1
- package/dist/shims/internal/app-route-detection.js.map +0 -1
- package/dist/shims/internal/app-router-context.js.map +0 -1
- package/dist/shims/internal/cookie-serialize.js.map +0 -1
- package/dist/shims/internal/make-hanging-promise.js.map +0 -1
- package/dist/shims/internal/pages-data-target.js.map +0 -1
- package/dist/shims/internal/pages-data-url.js.map +0 -1
- package/dist/shims/internal/parse-cookie-header.js.map +0 -1
- package/dist/shims/internal/router-context.js.map +0 -1
- package/dist/shims/internal/utils.js.map +0 -1
- package/dist/shims/internal/work-unit-async-storage.js.map +0 -1
- package/dist/shims/layout-segment-context.js.map +0 -1
- package/dist/shims/legacy-image.js.map +0 -1
- package/dist/shims/link-prefetch.js.map +0 -1
- package/dist/shims/link.js.map +0 -1
- package/dist/shims/metadata.js.map +0 -1
- package/dist/shims/navigation-state.js.map +0 -1
- package/dist/shims/navigation.js.map +0 -1
- package/dist/shims/navigation.react-server.js.map +0 -1
- package/dist/shims/offline.js.map +0 -1
- package/dist/shims/og.js.map +0 -1
- package/dist/shims/pages-router-runtime.js.map +0 -1
- package/dist/shims/readonly-url-search-params.js.map +0 -1
- package/dist/shims/request-context.js.map +0 -1
- package/dist/shims/root-params.js.map +0 -1
- package/dist/shims/router-state.js.map +0 -1
- package/dist/shims/router.js.map +0 -1
- package/dist/shims/script-nonce-context.js.map +0 -1
- package/dist/shims/script.js.map +0 -1
- package/dist/shims/server.js.map +0 -1
- package/dist/shims/slot.js.map +0 -1
- package/dist/shims/thenable-params.js.map +0 -1
- package/dist/shims/unified-request-context.js.map +0 -1
- package/dist/shims/unrecognized-action-error.js.map +0 -1
- package/dist/shims/url-safety.js.map +0 -1
- package/dist/shims/url-utils.js.map +0 -1
- package/dist/shims/use-merged-ref.js.map +0 -1
- package/dist/shims/web-vitals.js.map +0 -1
- package/dist/typegen.js.map +0 -1
- package/dist/utils/asset-prefix.js.map +0 -1
- package/dist/utils/base-path.js.map +0 -1
- package/dist/utils/cache-control-metadata.js.map +0 -1
- package/dist/utils/domain-locale.js.map +0 -1
- package/dist/utils/encode-cache-tag.js.map +0 -1
- package/dist/utils/error-cause.js.map +0 -1
- package/dist/utils/hash.js.map +0 -1
- package/dist/utils/html-limited-bots.js.map +0 -1
- package/dist/utils/lazy-chunks.js.map +0 -1
- package/dist/utils/manifest-paths.js.map +0 -1
- package/dist/utils/mdx-scan.js.map +0 -1
- package/dist/utils/navigation-signal.js.map +0 -1
- package/dist/utils/path.js.map +0 -1
- package/dist/utils/prerender-output-paths.js.map +0 -1
- package/dist/utils/project.js.map +0 -1
- package/dist/utils/public-routes.js.map +0 -1
- package/dist/utils/query.js.map +0 -1
- package/dist/utils/record.js.map +0 -1
- package/dist/utils/safe-json-file.js.map +0 -1
- package/dist/utils/sorted-array.js.map +0 -1
- package/dist/utils/text-stream.js.map +0 -1
- package/dist/utils/vinext-root.js.map +0 -1
package/README.md
CHANGED
|
@@ -271,15 +271,6 @@ vinext deploy --experimental-tpr --tpr-window 48 # Use 48h of analytics
|
|
|
271
271
|
|
|
272
272
|
Requires a custom domain (zone analytics are unavailable on `*.workers.dev`) and `CLOUDFLARE_API_TOKEN` with Zone.Analytics read permission.
|
|
273
273
|
|
|
274
|
-
For production caching (ISR), use the built-in Cloudflare KV cache handler:
|
|
275
|
-
|
|
276
|
-
```ts
|
|
277
|
-
import { KVCacheHandler } from "vinext/cloudflare";
|
|
278
|
-
import { setCacheHandler } from "next/cache";
|
|
279
|
-
|
|
280
|
-
setCacheHandler(new KVCacheHandler(env.MY_KV_NAMESPACE));
|
|
281
|
-
```
|
|
282
|
-
|
|
283
274
|
#### Custom Vite configuration
|
|
284
275
|
|
|
285
276
|
If you need to customize the Vite config, create a `vite.config.ts`. vinext will merge its config with yours. This is required for Cloudflare Workers deployment with the App Router (RSC needs explicit plugin configuration):
|
|
@@ -533,14 +524,61 @@ Override behavior:
|
|
|
533
524
|
|
|
534
525
|
### Caching
|
|
535
526
|
|
|
536
|
-
The cache is pluggable. The default `MemoryCacheHandler` works out of the box. Swap in your own backend for production
|
|
527
|
+
The cache is pluggable. The default `MemoryCacheHandler` works out of the box. Swap in your own backend for production.
|
|
528
|
+
|
|
529
|
+
#### Configuring cache adapters from `vite.config`
|
|
530
|
+
|
|
531
|
+
Instead of wiring up cache handlers imperatively from a worker entry, you can declare them in the `vinext()` plugin config. The `@vinext/cloudflare` package ships two Cloudflare adapters for this:
|
|
532
|
+
|
|
533
|
+
- **`kvDataAdapter()`** (`@vinext/cloudflare/cache/kv-data-adapter`) — backs the `"use cache"` data cache with a Workers KV namespace.
|
|
534
|
+
- **`cdnAdapter()`** (`@vinext/cloudflare/cache/cdn-adapter`) — backs full-route CDN caching with the Workers Cache API.
|
|
537
535
|
|
|
538
536
|
```ts
|
|
539
|
-
import {
|
|
540
|
-
|
|
537
|
+
import { defineConfig } from "vite";
|
|
538
|
+
import vinext from "vinext";
|
|
539
|
+
import { cdnAdapter } from "@vinext/cloudflare/cache/cdn-adapter";
|
|
540
|
+
import { kvDataAdapter } from "@vinext/cloudflare/cache/kv-data-adapter";
|
|
541
|
+
|
|
542
|
+
export default defineConfig({
|
|
543
|
+
plugins: [
|
|
544
|
+
vinext({
|
|
545
|
+
cache: {
|
|
546
|
+
cdn: cdnAdapter(),
|
|
547
|
+
data: kvDataAdapter(),
|
|
548
|
+
},
|
|
549
|
+
}),
|
|
550
|
+
],
|
|
551
|
+
});
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
The KV data adapter reads `env[binding]` at runtime, so add the matching KV namespace to your `wrangler.jsonc`:
|
|
555
|
+
|
|
556
|
+
```jsonc
|
|
557
|
+
{
|
|
558
|
+
"kv_namespaces": [{ "binding": "VINEXT_KV_CACHE", "id": "<your-namespace-id>" }],
|
|
559
|
+
}
|
|
541
560
|
```
|
|
542
561
|
|
|
543
|
-
|
|
562
|
+
`binding` defaults to `VINEXT_KV_CACHE`, so `kvDataAdapter()` with no options works as long as that's your binding name. Other options: `appPrefix` (namespace cache keys to isolate multiple apps in one KV namespace), `ttlSeconds` (default KV `expirationTtl`, default 30 days), and `tagCacheTtlMs` (in-memory tag-invalidation cache TTL, default 5s). `cdnAdapter()` takes no options — it just needs the Workers Cache, which is always available on Workers.
|
|
563
|
+
|
|
564
|
+
Each builder returns a plain, serializable `{ adapter, options }` descriptor — **it never touches the Workers runtime**, so nothing throws at build or dev time when bindings aren't available. The actual adapter (and its `env` binding lookup) is instantiated lazily on the first request.
|
|
565
|
+
|
|
566
|
+
Registration is wired into **every router and runtime** — App Router and Pages Router, on Cloudflare Workers as well as the Node.js server (`vinext start`) and dev. It self-guards (instantiated once per isolate) and is resilient: if an adapter can't initialize on a given runtime (e.g. a KV binding doesn't exist on the Node server), vinext logs a warning and falls back to the default handler instead of failing requests.
|
|
567
|
+
|
|
568
|
+
To write your own adapter, point a slot at any module by path and default-export a factory that receives `{ env, options }` at runtime and returns a data-cache `CacheHandler` (or a CDN adapter):
|
|
569
|
+
|
|
570
|
+
```ts
|
|
571
|
+
vinext({
|
|
572
|
+
cache: {
|
|
573
|
+
data: {
|
|
574
|
+
adapter: require.resolve("./my-adapter.js"),
|
|
575
|
+
options: {
|
|
576
|
+
/* … */
|
|
577
|
+
},
|
|
578
|
+
},
|
|
579
|
+
},
|
|
580
|
+
});
|
|
581
|
+
```
|
|
544
582
|
|
|
545
583
|
## What's NOT supported (and won't be)
|
|
546
584
|
|
|
@@ -563,6 +601,7 @@ These are gaps we'd like to close — distinct from the [intentional exclusions]
|
|
|
563
601
|
- **Route segment config** — `runtime` and `preferredRegion` are ignored (everything runs in the same environment).
|
|
564
602
|
- **Node.js production server (`vinext start`)** works for testing but is less complete than Workers deployment. Cloudflare Workers is the primary target.
|
|
565
603
|
- **Native Node modules (sharp, resvg, satori, lightningcss, @napi-rs/canvas)** crash Vite's RSC dev environment. Dynamic OG image/icon routes using these work in production builds but not in dev mode. These are auto-stubbed during `vinext deploy`.
|
|
604
|
+
- **`next.config.ts` `baseUrl` bare imports require Vite 8.** A `next.config.ts` that imports a bare specifier resolved through `tsconfig.json`'s `compilerOptions.baseUrl` (e.g. `import { bar } from "bar"` resolving to a local `bar.ts`) relies on Vite 8's native `resolve.tsconfigPaths` (Rolldown/oxc-resolver). On Vite 7 there is no native equivalent, so these imports are not resolved. `compilerOptions.paths` aliases (e.g. `@/foo`) work on both Vite 7 and 8. Note that if a bare import matches both a `baseUrl`-local file and an installed package of the same name, the installed package wins (vinext keeps packages externalized so CJS config plugins like `@next/mdx` keep working).
|
|
566
605
|
|
|
567
606
|
## Benchmarks
|
|
568
607
|
|
|
@@ -649,8 +688,6 @@ packages/vinext/
|
|
|
649
688
|
middleware.ts # middleware.ts / proxy.ts runner
|
|
650
689
|
metadata-routes.ts # File-based metadata route scanner
|
|
651
690
|
instrumentation.ts # instrumentation.ts support
|
|
652
|
-
cloudflare/
|
|
653
|
-
kv-cache-handler.ts # Cloudflare KV-backed CacheHandler for ISR
|
|
654
691
|
shims/ # One file per next/* module (33 shims + 6 internal)
|
|
655
692
|
build/
|
|
656
693
|
static-export.ts # output: 'export' support
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import { UserConfig } from "vite";
|
|
2
2
|
|
|
3
3
|
//#region src/build/client-build-config.d.ts
|
|
4
|
+
type ClientAssetFileNameInfo = {
|
|
5
|
+
readonly name?: string;
|
|
6
|
+
readonly names?: readonly string[];
|
|
7
|
+
readonly originalFileName?: string;
|
|
8
|
+
readonly originalFileNames?: readonly string[];
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Routes client assets into Next-compatible subtrees: `.css` sources go to
|
|
12
|
+
* `<assetsDir>/css/`, everything else to `<assetsDir>/media/`. Returned as a
|
|
13
|
+
* function so it can inspect every source-name candidate Rolldown records for
|
|
14
|
+
* an asset (a single output asset can carry several `originalFileNames`).
|
|
15
|
+
*/
|
|
16
|
+
declare function createClientAssetFileNames(assetsDir: string): (assetInfo: ClientAssetFileNameInfo) => string;
|
|
4
17
|
/**
|
|
5
18
|
* Create a manualChunks function for client builds.
|
|
6
19
|
*
|
|
@@ -38,7 +51,8 @@ declare function createClientManualChunks(shimsDir: string): (id: string) => str
|
|
|
38
51
|
* compression efficiency — small files restart the compression dictionary,
|
|
39
52
|
* adding ~5-15% wire overhead vs fewer larger chunks.
|
|
40
53
|
*/
|
|
41
|
-
declare function createClientOutputConfig(clientManualChunks: (id: string) => string | undefined): {
|
|
54
|
+
declare function createClientOutputConfig(clientManualChunks: (id: string) => string | undefined, assetsDir: string): {
|
|
55
|
+
assetFileNames: (assetInfo: ClientAssetFileNameInfo) => string;
|
|
42
56
|
manualChunks: (id: string) => string | undefined;
|
|
43
57
|
experimentalMinChunkSize: number;
|
|
44
58
|
};
|
|
@@ -115,5 +129,4 @@ type VinextBuildConfigWithLegacy = VinextBuildConfig & {
|
|
|
115
129
|
declare function getBuildBundlerOptions(build: UserConfig["build"] | undefined): VinextBuildBundlerOptions | undefined;
|
|
116
130
|
declare function withBuildBundlerOptions(viteMajorVersion: number, bundlerOptions: VinextBuildBundlerOptions): Partial<VinextBuildConfigWithLegacy>;
|
|
117
131
|
//#endregion
|
|
118
|
-
export { clientTreeshakeConfig, createClientCodeSplittingConfig, createClientManualChunks, createClientOutputConfig, getBuildBundlerOptions, getClientTreeshakeConfigForVite, withBuildBundlerOptions };
|
|
119
|
-
//# sourceMappingURL=client-build-config.d.ts.map
|
|
132
|
+
export { clientTreeshakeConfig, createClientAssetFileNames, createClientCodeSplittingConfig, createClientManualChunks, createClientOutputConfig, getBuildBundlerOptions, getClientTreeshakeConfigForVite, withBuildBundlerOptions };
|
|
@@ -1,4 +1,30 @@
|
|
|
1
1
|
//#region src/build/client-build-config.ts
|
|
2
|
+
const NEXT_CLIENT_CSS_ASSET_FILE_NAMES = "css/[name].[hash:8][extname]";
|
|
3
|
+
const NEXT_CLIENT_STATIC_MEDIA_FILE_NAMES = "media/[name].[hash:8][extname]";
|
|
4
|
+
function joinAssetFileNamePattern(assetsDir, pattern) {
|
|
5
|
+
let end = assetsDir.length;
|
|
6
|
+
while (end > 0 && assetsDir[end - 1] === "/") end -= 1;
|
|
7
|
+
const normalized = assetsDir.slice(0, end);
|
|
8
|
+
return normalized ? `${normalized}/${pattern}` : pattern;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Routes client assets into Next-compatible subtrees: `.css` sources go to
|
|
12
|
+
* `<assetsDir>/css/`, everything else to `<assetsDir>/media/`. Returned as a
|
|
13
|
+
* function so it can inspect every source-name candidate Rolldown records for
|
|
14
|
+
* an asset (a single output asset can carry several `originalFileNames`).
|
|
15
|
+
*/
|
|
16
|
+
function createClientAssetFileNames(assetsDir) {
|
|
17
|
+
const cssAssetFileNames = joinAssetFileNamePattern(assetsDir, NEXT_CLIENT_CSS_ASSET_FILE_NAMES);
|
|
18
|
+
const mediaAssetFileNames = joinAssetFileNamePattern(assetsDir, NEXT_CLIENT_STATIC_MEDIA_FILE_NAMES);
|
|
19
|
+
return function getClientAssetFileNames(assetInfo) {
|
|
20
|
+
return [
|
|
21
|
+
...assetInfo.names ?? [],
|
|
22
|
+
assetInfo.name,
|
|
23
|
+
...assetInfo.originalFileNames ?? [],
|
|
24
|
+
assetInfo.originalFileName
|
|
25
|
+
].some((name) => name?.toLowerCase().endsWith(".css")) ? cssAssetFileNames : mediaAssetFileNames;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
2
28
|
/**
|
|
3
29
|
* Extract the npm package name from a module ID (file path).
|
|
4
30
|
* Returns null if not in node_modules.
|
|
@@ -63,8 +89,9 @@ function createClientManualChunks(shimsDir) {
|
|
|
63
89
|
* compression efficiency — small files restart the compression dictionary,
|
|
64
90
|
* adding ~5-15% wire overhead vs fewer larger chunks.
|
|
65
91
|
*/
|
|
66
|
-
function createClientOutputConfig(clientManualChunks) {
|
|
92
|
+
function createClientOutputConfig(clientManualChunks, assetsDir) {
|
|
67
93
|
return {
|
|
94
|
+
assetFileNames: createClientAssetFileNames(assetsDir),
|
|
68
95
|
manualChunks: clientManualChunks,
|
|
69
96
|
experimentalMinChunkSize: 1e4
|
|
70
97
|
};
|
|
@@ -144,6 +171,4 @@ function withBuildBundlerOptions(viteMajorVersion, bundlerOptions) {
|
|
|
144
171
|
return viteMajorVersion >= 8 ? { rolldownOptions: bundlerOptions } : { rollupOptions: bundlerOptions };
|
|
145
172
|
}
|
|
146
173
|
//#endregion
|
|
147
|
-
export { clientTreeshakeConfig, createClientCodeSplittingConfig, createClientManualChunks, createClientOutputConfig, getBuildBundlerOptions, getClientTreeshakeConfigForVite, withBuildBundlerOptions };
|
|
148
|
-
|
|
149
|
-
//# sourceMappingURL=client-build-config.js.map
|
|
174
|
+
export { clientTreeshakeConfig, createClientAssetFileNames, createClientCodeSplittingConfig, createClientManualChunks, createClientOutputConfig, getBuildBundlerOptions, getClientTreeshakeConfigForVite, withBuildBundlerOptions };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Rolldown } from "vite";
|
|
2
|
+
|
|
3
|
+
//#region src/build/css-url-assets.d.ts
|
|
4
|
+
type BundleAsset = Rolldown.OutputAsset;
|
|
5
|
+
type CssUrlAssetBundle = Rolldown.OutputBundle;
|
|
6
|
+
type EmitRestoredCssUrlAsset = (asset: {
|
|
7
|
+
fileName: string;
|
|
8
|
+
source: BundleAsset["source"];
|
|
9
|
+
}) => void;
|
|
10
|
+
/**
|
|
11
|
+
* Append the private provenance marker to each relative asset `url()` in a CSS
|
|
12
|
+
* source. Idempotent and side-effect free (only adds a query param), so it is
|
|
13
|
+
* safe to run on every client-environment stylesheet, vendored CSS included.
|
|
14
|
+
*/
|
|
15
|
+
declare function markCssUrlAssetReferences(code: string, id: string): string | null;
|
|
16
|
+
/**
|
|
17
|
+
* Mutates emitted CSS assets in place so byte-identical `url()` dependencies
|
|
18
|
+
* keep their distinct Next-compatible filenames. Sibling files are produced via
|
|
19
|
+
* `emitRestoredAsset` (which must call `this.emitFile({ type: "asset", fileName,
|
|
20
|
+
* source })` — the explicit `fileName` opts out of Rolldown's content dedupe).
|
|
21
|
+
*
|
|
22
|
+
* Expects CSS to have been marked by `markCssUrlAssetReferences()` first. The
|
|
23
|
+
* marker is stripped from all final output here. CSS that Vite inlined into a JS
|
|
24
|
+
* chunk (`cssCodeSplit: false` / `?inline`) already has final URLs, so chunk
|
|
25
|
+
* code only has the leaked marker stripped — no sibling files are emitted.
|
|
26
|
+
*/
|
|
27
|
+
declare function restoreDedupedCssAssetReferences(bundle: CssUrlAssetBundle, emitRestoredAsset: EmitRestoredCssUrlAsset): void;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { markCssUrlAssetReferences, restoreDedupedCssAssetReferences };
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
//#region src/build/css-url-assets.ts
|
|
2
|
+
/**
|
|
3
|
+
* Next-parity for CSS `url()` asset dependencies.
|
|
4
|
+
*
|
|
5
|
+
* Next.js (webpack `asset/resource`) emits one output file per *source* file a
|
|
6
|
+
* stylesheet references, keyed by module identity. Vite/Rolldown instead dedupe
|
|
7
|
+
* emitted assets by *content*: two byte-identical files (`dark.svg`, `dark2.svg`)
|
|
8
|
+
* collapse to a single output, and every `url()` that referenced either source
|
|
9
|
+
* is rewritten to that one filename — so the second filename disappears.
|
|
10
|
+
*
|
|
11
|
+
* There is no config switch to disable that dedupe (it is intentional; see
|
|
12
|
+
* vitejs/vite#8632). The one native escape hatch is `this.emitFile({ fileName })`:
|
|
13
|
+
* assets emitted with an explicit `fileName` are *never* deduped. So we:
|
|
14
|
+
*
|
|
15
|
+
* 1. mark — during the client CSS transform, tag each relative asset `url()`
|
|
16
|
+
* with a private `?vinext_css_url_asset=<source-basename>` query. This is
|
|
17
|
+
* the only durable carrier of per-reference provenance: once Rolldown
|
|
18
|
+
* dedupes, the emitted bundle cannot tell which `url()` came from which
|
|
19
|
+
* source, and the bundle metadata (`originalFileNames`) records the set of
|
|
20
|
+
* sources but not the mapping per reference.
|
|
21
|
+
*
|
|
22
|
+
* 2. restore — at `generateBundle`, read each marked reference's source
|
|
23
|
+
* basename back out. When it differs from the deduped output's basename,
|
|
24
|
+
* emit a sibling file under that source's name (via the `fileName` escape
|
|
25
|
+
* hatch) and rewrite the reference to it. The marker is then stripped.
|
|
26
|
+
*
|
|
27
|
+
* Each reference resolves from its own marker, so split CSS chunks stay correct
|
|
28
|
+
* with no shared cursor or bundle-iteration-order dependence.
|
|
29
|
+
*/
|
|
30
|
+
const CSS_URL_ASSET_MARKER = "vinext_css_url_asset";
|
|
31
|
+
const CSS_URL_RE = /url\(\s*(?:"([^"]*)"|'([^']*)'|([^'")]*?))\s*\)/g;
|
|
32
|
+
const CSS_ASSET_EXT_RE = /\.(?:avif|bmp|gif|ico|jpe?g|png|svg|webp|woff2?|eot|ttf|otf|mp4|webm|ogg|mp3|wav|flac|aac|wasm)$/i;
|
|
33
|
+
const CSS_REQUEST_RE = /\.(?:css|scss|sass|less|styl|stylus)(?:\?|$)/i;
|
|
34
|
+
function basename(value) {
|
|
35
|
+
const normalized = value.replaceAll("\\", "/");
|
|
36
|
+
const slash = normalized.lastIndexOf("/");
|
|
37
|
+
return slash === -1 ? normalized : normalized.slice(slash + 1);
|
|
38
|
+
}
|
|
39
|
+
function stem(fileName) {
|
|
40
|
+
const base = basename(fileName);
|
|
41
|
+
const dot = base.lastIndexOf(".");
|
|
42
|
+
return dot <= 0 ? base : base.slice(0, dot);
|
|
43
|
+
}
|
|
44
|
+
function splitUrl(url) {
|
|
45
|
+
const hashAt = url.indexOf("#");
|
|
46
|
+
const beforeHash = hashAt === -1 ? url : url.slice(0, hashAt);
|
|
47
|
+
const hash = hashAt === -1 ? "" : url.slice(hashAt);
|
|
48
|
+
const queryAt = beforeHash.indexOf("?");
|
|
49
|
+
if (queryAt === -1) return {
|
|
50
|
+
path: beforeHash,
|
|
51
|
+
query: "",
|
|
52
|
+
hash
|
|
53
|
+
};
|
|
54
|
+
return {
|
|
55
|
+
path: beforeHash.slice(0, queryAt),
|
|
56
|
+
query: beforeHash.slice(queryAt + 1),
|
|
57
|
+
hash
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function joinUrl({ path, query, hash }) {
|
|
61
|
+
return `${path}${query ? `?${query}` : ""}${hash}`;
|
|
62
|
+
}
|
|
63
|
+
function decodeURIComponentSafe(value) {
|
|
64
|
+
try {
|
|
65
|
+
return decodeURIComponent(value);
|
|
66
|
+
} catch {
|
|
67
|
+
return value;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function getMarker(query) {
|
|
71
|
+
for (const part of query.split("&")) {
|
|
72
|
+
const eq = part.indexOf("=");
|
|
73
|
+
if ((eq === -1 ? part : part.slice(0, eq)) === CSS_URL_ASSET_MARKER) return eq === -1 ? "" : decodeURIComponentSafe(part.slice(eq + 1));
|
|
74
|
+
}
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
function dropMarker(query) {
|
|
78
|
+
return query.split("&").filter((part) => (part.indexOf("=") === -1 ? part : part.slice(0, part.indexOf("="))) !== CSS_URL_ASSET_MARKER).join("&");
|
|
79
|
+
}
|
|
80
|
+
function isRelativeAssetUrl(rawPath) {
|
|
81
|
+
return !(rawPath === "" || rawPath.startsWith("/") || rawPath.startsWith("#") || rawPath.includes("(") || /^[a-zA-Z][\w+.-]*:/.test(rawPath));
|
|
82
|
+
}
|
|
83
|
+
function rewriteUrlToken(match, nextUrl) {
|
|
84
|
+
if (match[1] !== void 0) return `url("${nextUrl}")`;
|
|
85
|
+
if (match[2] !== void 0) return `url('${nextUrl}')`;
|
|
86
|
+
return `url(${nextUrl})`;
|
|
87
|
+
}
|
|
88
|
+
function isCssRequest(id) {
|
|
89
|
+
return CSS_REQUEST_RE.test(id);
|
|
90
|
+
}
|
|
91
|
+
/** Replace every `url(...)` in `code` whose raw URL `replace()` rewrites. */
|
|
92
|
+
function rewriteCssUrls(code, replace) {
|
|
93
|
+
let out = "";
|
|
94
|
+
let last = 0;
|
|
95
|
+
let changed = false;
|
|
96
|
+
CSS_URL_RE.lastIndex = 0;
|
|
97
|
+
let match;
|
|
98
|
+
while ((match = CSS_URL_RE.exec(code)) !== null) {
|
|
99
|
+
const rawUrl = match[1] ?? match[2] ?? match[3]?.trim();
|
|
100
|
+
if (!rawUrl) continue;
|
|
101
|
+
const next = replace(rawUrl);
|
|
102
|
+
if (next === null) continue;
|
|
103
|
+
out += code.slice(last, match.index) + rewriteUrlToken(match, next);
|
|
104
|
+
last = match.index + match[0].length;
|
|
105
|
+
changed = true;
|
|
106
|
+
}
|
|
107
|
+
return changed ? out + code.slice(last) : null;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Append the private provenance marker to each relative asset `url()` in a CSS
|
|
111
|
+
* source. Idempotent and side-effect free (only adds a query param), so it is
|
|
112
|
+
* safe to run on every client-environment stylesheet, vendored CSS included.
|
|
113
|
+
*/
|
|
114
|
+
function markCssUrlAssetReferences(code, id) {
|
|
115
|
+
if (!isCssRequest(id) || !code.includes("url(")) return null;
|
|
116
|
+
return rewriteCssUrls(code, (rawUrl) => {
|
|
117
|
+
const parts = splitUrl(rawUrl.trim());
|
|
118
|
+
if (!isRelativeAssetUrl(parts.path)) return null;
|
|
119
|
+
if (getMarker(parts.query) !== null) return null;
|
|
120
|
+
const lower = parts.path.toLowerCase();
|
|
121
|
+
if (!CSS_ASSET_EXT_RE.test(lower) || lower.endsWith(".css")) return null;
|
|
122
|
+
const param = `${CSS_URL_ASSET_MARKER}=${encodeURIComponent(basename(parts.path))}`;
|
|
123
|
+
return joinUrl({
|
|
124
|
+
...parts,
|
|
125
|
+
query: parts.query ? `${parts.query}&${param}` : param
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
function isCssFileName(fileName) {
|
|
130
|
+
return fileName.toLowerCase().endsWith(".css");
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Given a deduped output filename (`media/dark.1a2b3c4d.svg`) and the source
|
|
134
|
+
* basename a reference actually wants (`dark2.svg`), produce the sibling output
|
|
135
|
+
* filename (`media/dark2.1a2b3c4d.svg`) by swapping the leading name segment
|
|
136
|
+
* while preserving the hash + extension. `asset.originalFileNames` tells us
|
|
137
|
+
* which source stem the output was named after, so we strip exactly that.
|
|
138
|
+
*/
|
|
139
|
+
function deriveSiblingFileName(asset, desiredBasename) {
|
|
140
|
+
const fileName = asset.fileName;
|
|
141
|
+
const slash = fileName.lastIndexOf("/");
|
|
142
|
+
const dir = slash === -1 ? "" : fileName.slice(0, slash + 1);
|
|
143
|
+
const outBase = basename(fileName);
|
|
144
|
+
const desiredStem = stem(desiredBasename);
|
|
145
|
+
const sourceStems = [
|
|
146
|
+
...asset.names ?? [],
|
|
147
|
+
asset.name,
|
|
148
|
+
...asset.originalFileNames ?? [],
|
|
149
|
+
asset.originalFileName
|
|
150
|
+
].filter((n) => !!n).map((n) => stem(n)).sort((a, b) => b.length - a.length);
|
|
151
|
+
for (const wStem of sourceStems) if (wStem && (outBase === wStem || outBase.startsWith(`${wStem}.`) || outBase.startsWith(`${wStem}-`))) return `${dir}${desiredStem}${outBase.slice(wStem.length)}`;
|
|
152
|
+
const dot = outBase.indexOf(".");
|
|
153
|
+
return `${dir}${desiredStem}${dot === -1 ? "" : outBase.slice(dot)}`;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Mutates emitted CSS assets in place so byte-identical `url()` dependencies
|
|
157
|
+
* keep their distinct Next-compatible filenames. Sibling files are produced via
|
|
158
|
+
* `emitRestoredAsset` (which must call `this.emitFile({ type: "asset", fileName,
|
|
159
|
+
* source })` — the explicit `fileName` opts out of Rolldown's content dedupe).
|
|
160
|
+
*
|
|
161
|
+
* Expects CSS to have been marked by `markCssUrlAssetReferences()` first. The
|
|
162
|
+
* marker is stripped from all final output here. CSS that Vite inlined into a JS
|
|
163
|
+
* chunk (`cssCodeSplit: false` / `?inline`) already has final URLs, so chunk
|
|
164
|
+
* code only has the leaked marker stripped — no sibling files are emitted.
|
|
165
|
+
*/
|
|
166
|
+
function restoreDedupedCssAssetReferences(bundle, emitRestoredAsset) {
|
|
167
|
+
const assetsByBase = /* @__PURE__ */ new Map();
|
|
168
|
+
for (const entry of Object.values(bundle)) if (entry.type === "asset" && !isCssFileName(entry.fileName)) assetsByBase.set(basename(entry.fileName), entry);
|
|
169
|
+
const emitted = new Set(Object.keys(bundle));
|
|
170
|
+
for (const entry of Object.values(bundle)) {
|
|
171
|
+
if (entry.type === "chunk") {
|
|
172
|
+
if (typeof entry.code === "string" && entry.code.includes(CSS_URL_ASSET_MARKER)) entry.code = stripChunkMarkers(entry.code);
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
if (!isCssFileName(entry.fileName) || typeof entry.source !== "string") continue;
|
|
176
|
+
entry.source = rewriteCssUrls(entry.source, (rawUrl) => {
|
|
177
|
+
const parts = splitUrl(rawUrl);
|
|
178
|
+
const desiredBasename = getMarker(parts.query);
|
|
179
|
+
if (desiredBasename === null) return null;
|
|
180
|
+
const query = dropMarker(parts.query);
|
|
181
|
+
const asset = assetsByBase.get(basename(parts.path));
|
|
182
|
+
if (!asset) return joinUrl({
|
|
183
|
+
...parts,
|
|
184
|
+
query
|
|
185
|
+
});
|
|
186
|
+
const siblingFileName = deriveSiblingFileName(asset, desiredBasename);
|
|
187
|
+
if (siblingFileName === asset.fileName) return joinUrl({
|
|
188
|
+
...parts,
|
|
189
|
+
query
|
|
190
|
+
});
|
|
191
|
+
if (!emitted.has(siblingFileName)) {
|
|
192
|
+
emitted.add(siblingFileName);
|
|
193
|
+
emitRestoredAsset({
|
|
194
|
+
fileName: siblingFileName,
|
|
195
|
+
source: asset.source
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
return joinUrl({
|
|
199
|
+
path: parts.path.slice(0, parts.path.length - basename(parts.path).length) + basename(siblingFileName),
|
|
200
|
+
query,
|
|
201
|
+
hash: parts.hash
|
|
202
|
+
});
|
|
203
|
+
}) ?? entry.source;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
const CSS_URL_MARKER_PARAM_RE = new RegExp(`(\\?)${CSS_URL_ASSET_MARKER}=[^&#'")\\\\\\s]*&|[?&]${CSS_URL_ASSET_MARKER}=[^&#'")\\\\\\s]*`, "g");
|
|
207
|
+
function stripChunkMarkers(code) {
|
|
208
|
+
return code.replace(CSS_URL_MARKER_PARAM_RE, (_m, leadingQuestion) => leadingQuestion ? leadingQuestion : "");
|
|
209
|
+
}
|
|
210
|
+
//#endregion
|
|
211
|
+
export { markCssUrlAssetReferences, restoreDedupedCssAssetReferences };
|
|
@@ -14027,5 +14027,3 @@ var fallback_metrics_data_default = {
|
|
|
14027
14027
|
};
|
|
14028
14028
|
//#endregion
|
|
14029
14029
|
export { fallback_metrics_data_default as default };
|
|
14030
|
-
|
|
14031
|
-
//# sourceMappingURL=fallback-metrics-data.js.map
|
|
@@ -9,5 +9,4 @@ type AdjustFontFallback = {
|
|
|
9
9
|
declare function getFallbackFontOverrideMetrics(fontFamily: string): AdjustFontFallback | undefined;
|
|
10
10
|
declare function buildFallbackFontFace(family: string, metrics: AdjustFontFallback): string;
|
|
11
11
|
//#endregion
|
|
12
|
-
export { buildFallbackFontFace, getFallbackFontOverrideMetrics };
|
|
13
|
-
//# sourceMappingURL=fallback-metrics.d.ts.map
|
|
12
|
+
export { buildFallbackFontFace, getFallbackFontOverrideMetrics };
|
|
@@ -24981,5 +24981,3 @@ var font_data_default = {
|
|
|
24981
24981
|
};
|
|
24982
24982
|
//#endregion
|
|
24983
24983
|
export { font_data_default as default };
|
|
24984
|
-
|
|
24985
|
-
//# sourceMappingURL=font-data.js.map
|
|
@@ -3,5 +3,4 @@ import { FontAxes } from "./build-url.js";
|
|
|
3
3
|
//#region src/build/google-fonts/get-axes.d.ts
|
|
4
4
|
declare function getFontAxes(fontFamily: string, weights: string[], styles: string[], selectedVariableAxes?: string[]): FontAxes;
|
|
5
5
|
//#endregion
|
|
6
|
-
export { getFontAxes };
|
|
7
|
-
//# sourceMappingURL=get-axes.d.ts.map
|
|
6
|
+
export { getFontAxes };
|
|
@@ -24,5 +24,4 @@ type ValidatedGoogleFontOptions = {
|
|
|
24
24
|
};
|
|
25
25
|
declare function validateGoogleFontOptions(fontFamily: string, options: GoogleFontOptions): ValidatedGoogleFontOptions;
|
|
26
26
|
//#endregion
|
|
27
|
-
export { validateGoogleFontOptions };
|
|
28
|
-
//# sourceMappingURL=validate.d.ts.map
|
|
27
|
+
export { validateGoogleFontOptions };
|
|
@@ -3,5 +3,4 @@ type InlineCssManifest = Record<string, string>;
|
|
|
3
3
|
declare function collectInlineCssManifest(clientDir: string, assetPrefix: string): InlineCssManifest;
|
|
4
4
|
declare function injectInlineCssManifestGlobal(entryPath: string, manifest: InlineCssManifest): boolean;
|
|
5
5
|
//#endregion
|
|
6
|
-
export { collectInlineCssManifest, injectInlineCssManifestGlobal };
|
|
7
|
-
//# sourceMappingURL=inline-css.d.ts.map
|
|
6
|
+
export { collectInlineCssManifest, injectInlineCssManifestGlobal };
|
package/dist/build/inline-css.js
CHANGED
|
@@ -58,5 +58,4 @@ type LayoutBuildClassification = {
|
|
|
58
58
|
reason: ClassificationReason;
|
|
59
59
|
};
|
|
60
60
|
//#endregion
|
|
61
|
-
export { ClassificationReason, LayoutBuildClassification, ModuleGraphStaticReason };
|
|
62
|
-
//# sourceMappingURL=layout-classification-types.d.ts.map
|
|
61
|
+
export { ClassificationReason, LayoutBuildClassification, ModuleGraphStaticReason };
|
|
@@ -49,12 +49,11 @@ declare function isStaticModuleGraphResult(graphResult: ModuleGraphClassificatio
|
|
|
49
49
|
* Shared layouts (same file appearing in multiple routes) are classified once
|
|
50
50
|
* and deduplicated by layout ID.
|
|
51
51
|
*
|
|
52
|
-
* @internal Not called by production code. The `
|
|
52
|
+
* @internal Not called by production code. The `renderChunk` hook in
|
|
53
53
|
* `index.ts` calls `classifyLayoutByModuleGraph` directly and composes
|
|
54
54
|
* via the numeric-index manifest in `route-classification-manifest.ts`.
|
|
55
55
|
* Used only by `tests/layout-classification.test.ts`.
|
|
56
56
|
*/
|
|
57
57
|
declare function classifyAllRouteLayouts(routes: readonly RouteForClassification[], dynamicShimPaths: ReadonlySet<string>, moduleInfo: ModuleInfoProvider): Map<string, LayoutBuildClassification>;
|
|
58
58
|
//#endregion
|
|
59
|
-
export { ModuleInfoProvider, classifyAllRouteLayouts, classifyLayoutByModuleGraph, isStaticModuleGraphResult, moduleGraphReason };
|
|
60
|
-
//# sourceMappingURL=layout-classification.d.ts.map
|
|
59
|
+
export { ModuleInfoProvider, classifyAllRouteLayouts, classifyLayoutByModuleGraph, isStaticModuleGraphResult, moduleGraphReason };
|
|
@@ -68,7 +68,7 @@ function isStaticModuleGraphResult(graphResult) {
|
|
|
68
68
|
* Shared layouts (same file appearing in multiple routes) are classified once
|
|
69
69
|
* and deduplicated by layout ID.
|
|
70
70
|
*
|
|
71
|
-
* @internal Not called by production code. The `
|
|
71
|
+
* @internal Not called by production code. The `renderChunk` hook in
|
|
72
72
|
* `index.ts` calls `classifyLayoutByModuleGraph` directly and composes
|
|
73
73
|
* via the numeric-index manifest in `route-classification-manifest.ts`.
|
|
74
74
|
* Used only by `tests/layout-classification.test.ts`.
|
|
@@ -96,5 +96,3 @@ function classifyAllRouteLayouts(routes, dynamicShimPaths, moduleInfo) {
|
|
|
96
96
|
}
|
|
97
97
|
//#endregion
|
|
98
98
|
export { classifyAllRouteLayouts, classifyLayoutByModuleGraph, isStaticModuleGraphResult, moduleGraphReason };
|
|
99
|
-
|
|
100
|
-
//# sourceMappingURL=layout-classification.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ResolvedNextConfig } from "../config/next-config.js";
|
|
2
|
+
|
|
3
|
+
//#region src/build/next-client-runtime-manifests.d.ts
|
|
4
|
+
type EmitNextClientRuntimeManifestsOptions = {
|
|
5
|
+
clientDir: string;
|
|
6
|
+
assetsSubdir: string;
|
|
7
|
+
buildId: string;
|
|
8
|
+
rewrites: ResolvedNextConfig["rewrites"];
|
|
9
|
+
};
|
|
10
|
+
declare function buildNextClientBuildManifestContent(rewrites: ResolvedNextConfig["rewrites"]): string;
|
|
11
|
+
declare function buildNextClientSsgManifestContent(): string;
|
|
12
|
+
declare function emitNextClientRuntimeManifests(options: EmitNextClientRuntimeManifestsOptions): void;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { buildNextClientBuildManifestContent, buildNextClientSsgManifestContent, emitNextClientRuntimeManifests };
|