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/dist/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { detectPackageManager } from "./utils/project.js";
|
|
2
2
|
import { normalizePathnameForRouteMatchStrict } from "./routing/utils.js";
|
|
3
|
-
import { buildViteResolveExtensions, createValidFileMatcher } from "./routing/file-matcher.js";
|
|
3
|
+
import { buildViteResolveExtensions, createValidFileMatcher, findFileWithExts } from "./routing/file-matcher.js";
|
|
4
4
|
import { hasBasePath } from "./utils/base-path.js";
|
|
5
5
|
import { apiRouter, invalidateRouteCache, matchRoute, pagesRouter } from "./routing/pages-router.js";
|
|
6
|
+
import { normalizePathSeparators } from "./utils/path.js";
|
|
6
7
|
import { INTERNAL_HEADERS, VINEXT_INTERNAL_HEADERS, VINEXT_MW_CTX_HEADER, VINEXT_TIMING_HEADER } from "./server/headers.js";
|
|
7
8
|
import { buildRequestHeadersFromMiddlewareResponse } from "./server/middleware-request-headers.js";
|
|
8
9
|
import { normalizePath as normalizePath$1 } from "./server/normalize-path.js";
|
|
@@ -13,6 +14,7 @@ import { generateServerEntry } from "./entries/pages-server-entry.js";
|
|
|
13
14
|
import { generateClientEntry } from "./entries/pages-client-entry.js";
|
|
14
15
|
import { appRouteGraph, appRouter, invalidateAppRouteCache } from "./routing/app-router.js";
|
|
15
16
|
import { findInstrumentationClientFile, findInstrumentationFile, runInstrumentation } from "./server/instrumentation.js";
|
|
17
|
+
import { isUnknownRecord } from "./utils/record.js";
|
|
16
18
|
import { mergeRewriteQuery } from "./utils/query.js";
|
|
17
19
|
import { logRequest, now } from "./server/request-log.js";
|
|
18
20
|
import { normalizeDefaultLocalePathname, stripI18nLocaleForApiRoute } from "./server/pages-i18n.js";
|
|
@@ -26,17 +28,21 @@ import { createDirectRunner } from "./server/dev-module-runner.js";
|
|
|
26
28
|
import { validateDevRequest } from "./server/dev-origin-check.js";
|
|
27
29
|
import { generateRscEntry } from "./entries/app-rsc-entry.js";
|
|
28
30
|
import { generateSsrEntry } from "./entries/app-ssr-entry.js";
|
|
31
|
+
import { VIRTUAL_CACHE_ADAPTERS, generateCacheAdaptersModule } from "./cache/cache-adapters-virtual.js";
|
|
29
32
|
import { generateBrowserEntry, isLinkPrefetchRoute, toLinkPrefetchRoute } from "./entries/app-browser-entry.js";
|
|
30
33
|
import { collectRouteClassificationManifest } from "./build/route-classification-manifest.js";
|
|
31
34
|
import { planRouteClassificationInjection } from "./build/route-classification-injector.js";
|
|
32
35
|
import { PHASE_DEVELOPMENT_SERVER, PHASE_PRODUCTION_BUILD } from "./shims/constants.js";
|
|
33
36
|
import { ASSET_PREFIX_URL_DIR, resolveAssetUrlPrefix, resolveAssetsDir } from "./utils/asset-prefix.js";
|
|
34
37
|
import { RESOLVED_VIRTUAL_GOOGLE_FONTS, VIRTUAL_GOOGLE_FONTS, createGoogleFontsPlugin, createLocalFontsPlugin, generateGoogleFontsVirtualModule, parseStaticObjectLiteral } from "./plugins/fonts.js";
|
|
35
|
-
import {
|
|
38
|
+
import { getViteMajorVersion } from "./utils/vite-version.js";
|
|
39
|
+
import { createRscCompatibilityId, findNextConfigPath, loadNextConfig, resolveNextConfig, resolveNextConfigInput } from "./config/next-config.js";
|
|
36
40
|
import { isNextDataPathname, parseNextDataPathname } from "./server/pages-data-route.js";
|
|
37
41
|
import { precompressAssets } from "./build/precompress.js";
|
|
42
|
+
import { emitNextClientRuntimeManifests } from "./build/next-client-runtime-manifests.js";
|
|
38
43
|
import { collectInlineCssManifest, injectInlineCssManifestGlobal } from "./build/inline-css.js";
|
|
39
|
-
import {
|
|
44
|
+
import { installDevStackSourcemapMiddleware } from "./server/dev-stack-sourcemap.js";
|
|
45
|
+
import { manifestFilesWithBase } from "./utils/manifest-paths.js";
|
|
40
46
|
import { asyncHooksStubPlugin } from "./plugins/async-hooks-stub.js";
|
|
41
47
|
import { clientReferenceDedupPlugin } from "./plugins/client-reference-dedup.js";
|
|
42
48
|
import { dataUrlCssPlugin } from "./plugins/css-data-url.js";
|
|
@@ -45,18 +51,21 @@ import { createInstrumentationClientTransformPlugin } from "./plugins/instrument
|
|
|
45
51
|
import { INSTRUMENTATION_CLIENT_EMPTY_MODULE, generateInstrumentationClientInjectModule } from "./client/instrumentation-client-inject.js";
|
|
46
52
|
import { createMiddlewareServerOnlyPlugin } from "./plugins/middleware-server-only.js";
|
|
47
53
|
import { createOptimizeImportsPlugin } from "./plugins/optimize-imports.js";
|
|
48
|
-
import {
|
|
54
|
+
import { createOgAssetsPlugin, createOgInlineFetchAssetsPlugin } from "./plugins/og-assets.js";
|
|
49
55
|
import { generateRouteTypes } from "./typegen.js";
|
|
50
56
|
import { SSR_EXTERNAL_REACT_ENTRIES, VINEXT_OPTIMIZE_DEPS_EXCLUDE, mergeOptimizeDepsExclude } from "./plugins/rsc-client-shim-excludes.js";
|
|
51
57
|
import { createServerExternalsManifestPlugin } from "./plugins/server-externals-manifest.js";
|
|
52
58
|
import { computeLazyChunks } from "./utils/lazy-chunks.js";
|
|
59
|
+
import { findClientEntryFile, readClientBuildManifest } from "./utils/client-build-manifest.js";
|
|
53
60
|
import { formatMissingCloudflarePluginError, hasWranglerConfig } from "./deploy.js";
|
|
54
61
|
import { resolvePostcssStringPlugins } from "./plugins/postcss.js";
|
|
55
62
|
import { buildSassPreprocessorOptions } from "./plugins/sass.js";
|
|
56
|
-
import { createClientCodeSplittingConfig, createClientManualChunks, createClientOutputConfig, getBuildBundlerOptions, getClientTreeshakeConfigForVite, withBuildBundlerOptions } from "./build/client-build-config.js";
|
|
63
|
+
import { createClientAssetFileNames, createClientCodeSplittingConfig, createClientManualChunks, createClientOutputConfig, getBuildBundlerOptions, getClientTreeshakeConfigForVite, withBuildBundlerOptions } from "./build/client-build-config.js";
|
|
64
|
+
import { markCssUrlAssetReferences, restoreDedupedCssAssetReferences } from "./build/css-url-assets.js";
|
|
57
65
|
import { augmentSsrManifestFromBundle, relativeWithinRoot, tryRealpathSync } from "./build/ssr-manifest.js";
|
|
58
66
|
import { stripServerExports } from "./plugins/strip-server-exports.js";
|
|
59
67
|
import { removeConsoleCalls } from "./plugins/remove-console.js";
|
|
68
|
+
import { createImportMetaUrlPlugin } from "./plugins/import-meta-url.js";
|
|
60
69
|
import { hasMdxFiles } from "./utils/mdx-scan.js";
|
|
61
70
|
import { scanPublicFileRoutes } from "./utils/public-routes.js";
|
|
62
71
|
import { staticExportApp, staticExportPages } from "./build/static-export.js";
|
|
@@ -71,9 +80,57 @@ import MagicString from "magic-string";
|
|
|
71
80
|
import tsconfigPaths from "vite-tsconfig-paths";
|
|
72
81
|
//#region src/index.ts
|
|
73
82
|
installSocketErrorBackstop();
|
|
74
|
-
function
|
|
75
|
-
|
|
76
|
-
return
|
|
83
|
+
function stripViteModuleQuery(id) {
|
|
84
|
+
const queryIndex = id.search(/[?#]/);
|
|
85
|
+
return queryIndex === -1 ? id : id.slice(0, queryIndex);
|
|
86
|
+
}
|
|
87
|
+
function isInsideDirectory(dir, filePath) {
|
|
88
|
+
const relativePath = path.relative(dir, filePath);
|
|
89
|
+
return relativePath !== "" && !relativePath.startsWith("..") && !path.isAbsolute(relativePath);
|
|
90
|
+
}
|
|
91
|
+
function hasModuleLevelUseServerDirective(body) {
|
|
92
|
+
for (const node of body) {
|
|
93
|
+
if (node.type !== "ExpressionStatement") break;
|
|
94
|
+
const directive = node.directive;
|
|
95
|
+
const expression = node.expression;
|
|
96
|
+
const value = typeof directive === "string" ? directive : expression?.type === "Literal" ? expression.value : void 0;
|
|
97
|
+
if (value === "use server") return true;
|
|
98
|
+
if (typeof value !== "string") break;
|
|
99
|
+
}
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
function hasServerOnlyMarkerImport(code) {
|
|
103
|
+
if (!code.includes("server-only")) return false;
|
|
104
|
+
let ast;
|
|
105
|
+
try {
|
|
106
|
+
ast = parseAst(code);
|
|
107
|
+
} catch {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
if (hasModuleLevelUseServerDirective(ast.body)) return false;
|
|
111
|
+
function walk(node) {
|
|
112
|
+
if (!node) return false;
|
|
113
|
+
if (Array.isArray(node)) return node.some((child) => walk(child));
|
|
114
|
+
if (typeof node !== "object") return false;
|
|
115
|
+
if (node.type === "ImportDeclaration") {
|
|
116
|
+
if (node.source?.value === "server-only") return true;
|
|
117
|
+
}
|
|
118
|
+
if (node.type === "CallExpression") {
|
|
119
|
+
const call = node;
|
|
120
|
+
if (call.callee?.type === "Identifier" && call.callee.name === "require" && call.arguments?.[0]?.type === "Literal" && call.arguments[0].value === "server-only") return true;
|
|
121
|
+
}
|
|
122
|
+
for (const key of Object.keys(node)) {
|
|
123
|
+
if (key === "type" || key === "start" || key === "end" || key === "loc" || key === "parent") continue;
|
|
124
|
+
const value = node[key];
|
|
125
|
+
if (Array.isArray(value)) {
|
|
126
|
+
if (value.some((child) => child && typeof child === "object" && walk(child))) return true;
|
|
127
|
+
} else if (value && typeof value === "object" && "type" in value) {
|
|
128
|
+
if (walk(value)) return true;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
return walk(ast.body);
|
|
77
134
|
}
|
|
78
135
|
const __dirname = import.meta.dirname;
|
|
79
136
|
function resolveOptionalDependency(projectRoot, specifier) {
|
|
@@ -107,9 +164,6 @@ function isVinextOgShimImporter(importer) {
|
|
|
107
164
|
function toRelativeFileEntry(root, absPath) {
|
|
108
165
|
return path.relative(root, absPath).split(path.sep).join("/");
|
|
109
166
|
}
|
|
110
|
-
function isRecord(value) {
|
|
111
|
-
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
112
|
-
}
|
|
113
167
|
const TSCONFIG_FILES = ["tsconfig.json", "jsconfig.json"];
|
|
114
168
|
function resolveTsconfigPathCandidate(candidate) {
|
|
115
169
|
const candidates = candidate.endsWith(".json") ? [candidate] : [
|
|
@@ -183,8 +237,8 @@ function loadTsconfigPathAliases(configPath, projectRoot, seen = /* @__PURE__ */
|
|
|
183
237
|
const extendedPath = resolveTsconfigExtends(normalizedPath, parsed.extends);
|
|
184
238
|
if (extendedPath) aliases = loadTsconfigPathAliases(extendedPath, projectRoot, seen);
|
|
185
239
|
}
|
|
186
|
-
const compilerOptions =
|
|
187
|
-
const pathsConfig = compilerOptions &&
|
|
240
|
+
const compilerOptions = isUnknownRecord(parsed.compilerOptions) ? parsed.compilerOptions : null;
|
|
241
|
+
const pathsConfig = compilerOptions && isUnknownRecord(compilerOptions.paths) ? compilerOptions.paths : null;
|
|
188
242
|
if (!pathsConfig) return aliases;
|
|
189
243
|
const baseUrl = compilerOptions && typeof compilerOptions.baseUrl === "string" ? compilerOptions.baseUrl : ".";
|
|
190
244
|
const resolvedBaseUrl = path.resolve(path.dirname(normalizedPath), baseUrl);
|
|
@@ -194,27 +248,6 @@ function loadTsconfigPathAliases(configPath, projectRoot, seen = /* @__PURE__ */
|
|
|
194
248
|
};
|
|
195
249
|
}
|
|
196
250
|
/**
|
|
197
|
-
* Detect Vite major version at runtime by resolving from cwd.
|
|
198
|
-
* The plugin may be installed in a workspace root with Vite 7 but used
|
|
199
|
-
* by a project that has Vite 8 — so we resolve from cwd, not from
|
|
200
|
-
* the plugin's own location.
|
|
201
|
-
*/
|
|
202
|
-
function getViteMajorVersion() {
|
|
203
|
-
try {
|
|
204
|
-
const vitePkg = createRequire(path.join(process.cwd(), "package.json"))("vite/package.json");
|
|
205
|
-
const viteMajor = parseInt(vitePkg?.version, 10);
|
|
206
|
-
if (vitePkg?.name === "vite" && Number.isFinite(viteMajor)) return viteMajor;
|
|
207
|
-
const bundledViteMajor = parseInt(vitePkg?.bundledVersions?.vite, 10);
|
|
208
|
-
if (Number.isFinite(bundledViteMajor)) return bundledViteMajor;
|
|
209
|
-
console.warn(`[vinext] Could not determine Vite major version from ${vitePkg?.name ?? "vite/package.json"}; assuming Vite 7`);
|
|
210
|
-
return 7;
|
|
211
|
-
} catch (error) {
|
|
212
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
213
|
-
console.warn(`[vinext] Failed to resolve vite/package.json (${message}); assuming Vite 7`);
|
|
214
|
-
return 7;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
251
|
* Read the vinext package version once at plugin load. Surfaced via
|
|
219
252
|
* `process.env.__NEXT_VERSION` define so `window.next.version` lands a
|
|
220
253
|
* real string instead of the `"vinext"` fallback. Resolved relative to
|
|
@@ -249,16 +282,18 @@ function resolveTsconfigAliases(projectRoot) {
|
|
|
249
282
|
return aliases;
|
|
250
283
|
}
|
|
251
284
|
const VIRTUAL_SERVER_ENTRY = "virtual:vinext-server-entry";
|
|
252
|
-
const RESOLVED_SERVER_ENTRY = "\
|
|
285
|
+
const RESOLVED_SERVER_ENTRY = "\0virtual:vinext-server-entry";
|
|
253
286
|
const VIRTUAL_CLIENT_ENTRY = "virtual:vinext-client-entry";
|
|
254
|
-
const RESOLVED_CLIENT_ENTRY = "\
|
|
287
|
+
const RESOLVED_CLIENT_ENTRY = "\0virtual:vinext-client-entry";
|
|
255
288
|
const VIRTUAL_RSC_ENTRY = "virtual:vinext-rsc-entry";
|
|
256
|
-
const RESOLVED_RSC_ENTRY = "\
|
|
289
|
+
const RESOLVED_RSC_ENTRY = "\0virtual:vinext-rsc-entry";
|
|
257
290
|
const VIRTUAL_APP_SSR_ENTRY = "virtual:vinext-app-ssr-entry";
|
|
258
|
-
const RESOLVED_APP_SSR_ENTRY = "\
|
|
291
|
+
const RESOLVED_APP_SSR_ENTRY = "\0virtual:vinext-app-ssr-entry";
|
|
259
292
|
const VIRTUAL_APP_BROWSER_ENTRY = "virtual:vinext-app-browser-entry";
|
|
260
|
-
const RESOLVED_APP_BROWSER_ENTRY = "\
|
|
293
|
+
const RESOLVED_APP_BROWSER_ENTRY = "\0virtual:vinext-app-browser-entry";
|
|
261
294
|
const RESOLVED_ROOT_PARAMS = "\0virtual:vinext-root-params";
|
|
295
|
+
/** Virtual module that registers config-driven cache adapters (see VinextOptions.cache). */
|
|
296
|
+
const RESOLVED_CACHE_ADAPTERS = "\0" + VIRTUAL_CACHE_ADAPTERS;
|
|
262
297
|
/** Virtual module for composed instrumentation-client bootstrap. */
|
|
263
298
|
const VIRTUAL_INSTRUMENTATION_CLIENT = "private-next-instrumentation-client";
|
|
264
299
|
const RESOLVED_INSTRUMENTATION_CLIENT = `\0${VIRTUAL_INSTRUMENTATION_CLIENT}.mjs`;
|
|
@@ -343,10 +378,12 @@ const _reactServerShims = new Map([
|
|
|
343
378
|
["next/dist/client/components/navigation", "navigation"]
|
|
344
379
|
]);
|
|
345
380
|
const clientManualChunks = createClientManualChunks(_shimsDir);
|
|
346
|
-
const clientOutputConfig = createClientOutputConfig(clientManualChunks);
|
|
347
381
|
const clientCodeSplittingConfig = createClientCodeSplittingConfig(clientManualChunks);
|
|
348
|
-
function getClientOutputConfigForVite(viteMajorVersion) {
|
|
349
|
-
return viteMajorVersion >= 8 ? {
|
|
382
|
+
function getClientOutputConfigForVite(viteMajorVersion, assetsDir) {
|
|
383
|
+
return viteMajorVersion >= 8 ? {
|
|
384
|
+
assetFileNames: createClientAssetFileNames(assetsDir),
|
|
385
|
+
codeSplitting: clientCodeSplittingConfig
|
|
386
|
+
} : createClientOutputConfig(clientManualChunks, assetsDir);
|
|
350
387
|
}
|
|
351
388
|
function vinext(options = {}) {
|
|
352
389
|
const viteMajorVersion = getViteMajorVersion();
|
|
@@ -361,6 +398,7 @@ function vinext(options = {}) {
|
|
|
361
398
|
let instrumentationPath = null;
|
|
362
399
|
let instrumentationClientPath = null;
|
|
363
400
|
let clientInjectModule = null;
|
|
401
|
+
let clientAssetsInlineLimit = 0;
|
|
364
402
|
let hasCloudflarePlugin = false;
|
|
365
403
|
let warnedInlineNextConfigOverride = false;
|
|
366
404
|
let hasNitroPlugin = false;
|
|
@@ -392,7 +430,10 @@ function vinext(options = {}) {
|
|
|
392
430
|
*/
|
|
393
431
|
async function generateClientEntry$1() {
|
|
394
432
|
const appPrefetchRoutes = hasAppDir ? (await appRouter(appDir, nextConfig?.pageExtensions, fileMatcher)).filter(isLinkPrefetchRoute).map(toLinkPrefetchRoute) : [];
|
|
395
|
-
return generateClientEntry(pagesDir, nextConfig, fileMatcher, {
|
|
433
|
+
return generateClientEntry(pagesDir, nextConfig, fileMatcher, {
|
|
434
|
+
appPrefetchRoutes,
|
|
435
|
+
instrumentationClientPath
|
|
436
|
+
});
|
|
396
437
|
}
|
|
397
438
|
async function writeRouteTypes() {
|
|
398
439
|
if (!hasAppDir) return;
|
|
@@ -540,8 +581,16 @@ function vinext(options = {}) {
|
|
|
540
581
|
rawConfig = await resolveNextConfigInput(options.nextConfig, phase);
|
|
541
582
|
} else rawConfig = await loadNextConfig(root, phase);
|
|
542
583
|
nextConfig = await resolveNextConfig(rawConfig, root);
|
|
584
|
+
const sharedBuildId = process.env.__VINEXT_SHARED_BUILD_ID;
|
|
585
|
+
if (sharedBuildId && sharedBuildId.length > 0) nextConfig = {
|
|
586
|
+
...nextConfig,
|
|
587
|
+
buildId: sharedBuildId
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
if (rscCompatibilityId === void 0) {
|
|
591
|
+
const sharedRscCompatibilityId = process.env.__VINEXT_SHARED_RSC_COMPATIBILITY_ID;
|
|
592
|
+
rscCompatibilityId = sharedRscCompatibilityId && sharedRscCompatibilityId.length > 0 ? sharedRscCompatibilityId : createRscCompatibilityId(nextConfig);
|
|
543
593
|
}
|
|
544
|
-
rscCompatibilityId ??= createRscCompatibilityId(nextConfig);
|
|
545
594
|
fileMatcher = createValidFileMatcher(nextConfig.pageExtensions);
|
|
546
595
|
instrumentationPath = findInstrumentationFile(root, fileMatcher);
|
|
547
596
|
instrumentationClientPath = findInstrumentationClientFile(root, fileMatcher);
|
|
@@ -557,6 +606,7 @@ function vinext(options = {}) {
|
|
|
557
606
|
}
|
|
558
607
|
defines["process.env.__NEXT_ROUTER_BASEPATH"] = JSON.stringify(nextConfig.basePath);
|
|
559
608
|
defines["process.env.__NEXT_CLIENT_ROUTER_STATIC_STALETIME"] = JSON.stringify(String(nextConfig.staleTimes.static));
|
|
609
|
+
defines["process.env.__VINEXT_PREFETCH_INLINING"] = JSON.stringify(nextConfig.prefetchInlining ? "true" : "false");
|
|
560
610
|
defines["process.env.__VINEXT_TRAILING_SLASH"] = JSON.stringify(nextConfig.trailingSlash ? "true" : "false");
|
|
561
611
|
defines["process.env.__VINEXT_IMAGE_REMOTE_PATTERNS"] = JSON.stringify(JSON.stringify(nextConfig.images?.remotePatterns ?? []));
|
|
562
612
|
defines["process.env.__VINEXT_IMAGE_DOMAINS"] = JSON.stringify(JSON.stringify(nextConfig.images?.domains ?? []));
|
|
@@ -591,7 +641,8 @@ function vinext(options = {}) {
|
|
|
591
641
|
defines["process.env.__VINEXT_DEPLOYMENT_ID"] = JSON.stringify(nextConfig.deploymentId ?? "");
|
|
592
642
|
defines["process.env.NEXT_DEPLOYMENT_ID"] = nextConfig.deploymentId ? JSON.stringify(nextConfig.deploymentId) : "false";
|
|
593
643
|
defines["process.env.__NEXT_VERSION"] = JSON.stringify(getVinextVersion());
|
|
594
|
-
defines["process.env.__NEXT_APP_SHELLS"] = JSON.stringify(
|
|
644
|
+
defines["process.env.__NEXT_APP_SHELLS"] = JSON.stringify(nextConfig.appShells);
|
|
645
|
+
defines["process.env.__NEXT_CACHE_COMPONENTS"] = JSON.stringify(String(nextConfig.cacheComponents ?? false));
|
|
595
646
|
for (const [key, value] of Object.entries(nextConfig.compilerDefine)) {
|
|
596
647
|
if (key in defines) throw new Error(`The \`compiler.define\` option is configured to replace the \`${key}\` variable. This variable is either part of a built-in or is already configured.`);
|
|
597
648
|
defines[key] = value;
|
|
@@ -651,6 +702,7 @@ function vinext(options = {}) {
|
|
|
651
702
|
"vinext/cache": path.resolve(__dirname, "cache"),
|
|
652
703
|
"vinext/instrumentation": path.resolve(__dirname, "server", "instrumentation"),
|
|
653
704
|
"vinext/instrumentation-client": path.resolve(__dirname, "client", "instrumentation-client"),
|
|
705
|
+
"vinext/dev-error-overlay": path.resolve(__dirname, "server", "dev-error-overlay"),
|
|
654
706
|
"vinext/html": path.resolve(__dirname, "server", "html"),
|
|
655
707
|
...clientInjectModule === null ? { "private-next-instrumentation-client": instrumentationClientPath ?? INSTRUMENTATION_CLIENT_EMPTY_MODULE } : {}
|
|
656
708
|
}).flatMap(([k, v]) => k.startsWith("next/") ? [[k, v], [`${k}.js`, v]] : [[k, v]]));
|
|
@@ -669,6 +721,15 @@ function vinext(options = {}) {
|
|
|
669
721
|
if (!hasUserMdxPlugin && hasMdxFiles(root, hasAppDir ? appDir : null, hasPagesDir ? pagesDir : null)) await ensureMdxDelegate("detected");
|
|
670
722
|
const isSSR = !!config.build?.ssr;
|
|
671
723
|
const isMultiEnv = hasAppDir || hasCloudflarePlugin || hasNitroPlugin;
|
|
724
|
+
const hasBuildInput = getBuildBundlerOptions(config.build)?.input !== void 0;
|
|
725
|
+
const shouldInjectPlainPagesEnvironments = !hasAppDir && !hasCloudflarePlugin && !isSSR && !hasBuildInput;
|
|
726
|
+
const hasClientBuildEnvironment = hasAppDir || hasCloudflarePlugin || hasNitroPlugin || shouldInjectPlainPagesEnvironments;
|
|
727
|
+
const clientAssetsDir = resolveAssetsDir(nextConfig.assetPrefix ?? "");
|
|
728
|
+
clientAssetsInlineLimit = config.build?.assetsInlineLimit ?? 0;
|
|
729
|
+
const devHmrConfig = config.server?.hmr === false ? false : {
|
|
730
|
+
...typeof config.server?.hmr === "object" ? config.server.hmr : {},
|
|
731
|
+
overlay: false
|
|
732
|
+
};
|
|
672
733
|
const viteConfig = {
|
|
673
734
|
appType: "custom",
|
|
674
735
|
build: {
|
|
@@ -679,7 +740,8 @@ function vinext(options = {}) {
|
|
|
679
740
|
"firefox114",
|
|
680
741
|
"safari15"
|
|
681
742
|
],
|
|
682
|
-
assetsDir:
|
|
743
|
+
assetsDir: clientAssetsDir,
|
|
744
|
+
...!isSSR && !hasClientBuildEnvironment ? { assetsInlineLimit: clientAssetsInlineLimit } : {},
|
|
683
745
|
...withBuildBundlerOptions(viteMajorVersion, {
|
|
684
746
|
onwarn: (() => {
|
|
685
747
|
const userOnwarn = getBuildBundlerOptions(config.build)?.onwarn;
|
|
@@ -692,13 +754,16 @@ function vinext(options = {}) {
|
|
|
692
754
|
};
|
|
693
755
|
})(),
|
|
694
756
|
...!isSSR && !isMultiEnv ? { treeshake: getClientTreeshakeConfigForVite(viteMajorVersion) } : {},
|
|
695
|
-
...!isSSR && !isMultiEnv ? { output: getClientOutputConfigForVite(viteMajorVersion) } : {}
|
|
757
|
+
...!isSSR && !isMultiEnv ? { output: getClientOutputConfigForVite(viteMajorVersion, clientAssetsDir) } : {}
|
|
696
758
|
})
|
|
697
759
|
},
|
|
698
|
-
server: {
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
760
|
+
server: {
|
|
761
|
+
cors: {
|
|
762
|
+
preflightContinue: true,
|
|
763
|
+
origin: /^https?:\/\/(?:(?:[^:]+\.)?localhost|127\.0\.0\.1|\[::1\])(?::\d+)?$/
|
|
764
|
+
},
|
|
765
|
+
hmr: devHmrConfig
|
|
766
|
+
},
|
|
702
767
|
...hasCloudflarePlugin || hasNitroPlugin ? {} : config.ssr?.external === true ? { ssr: { external: true } } : { ssr: {
|
|
703
768
|
external: [
|
|
704
769
|
"react",
|
|
@@ -810,9 +875,10 @@ function vinext(options = {}) {
|
|
|
810
875
|
},
|
|
811
876
|
build: {
|
|
812
877
|
...hasCloudflarePlugin ? { manifest: true } : {},
|
|
878
|
+
assetsInlineLimit: clientAssetsInlineLimit,
|
|
813
879
|
...withBuildBundlerOptions(viteMajorVersion, {
|
|
814
880
|
input: { index: VIRTUAL_APP_BROWSER_ENTRY },
|
|
815
|
-
output: getClientOutputConfigForVite(viteMajorVersion),
|
|
881
|
+
output: getClientOutputConfigForVite(viteMajorVersion, clientAssetsDir),
|
|
816
882
|
treeshake: getClientTreeshakeConfigForVite(viteMajorVersion)
|
|
817
883
|
})
|
|
818
884
|
}
|
|
@@ -824,14 +890,15 @@ function vinext(options = {}) {
|
|
|
824
890
|
build: {
|
|
825
891
|
manifest: true,
|
|
826
892
|
ssrManifest: true,
|
|
893
|
+
assetsInlineLimit: clientAssetsInlineLimit,
|
|
827
894
|
...withBuildBundlerOptions(viteMajorVersion, {
|
|
828
895
|
input: { index: VIRTUAL_CLIENT_ENTRY },
|
|
829
|
-
output: getClientOutputConfigForVite(viteMajorVersion),
|
|
896
|
+
output: getClientOutputConfigForVite(viteMajorVersion, clientAssetsDir),
|
|
830
897
|
treeshake: getClientTreeshakeConfigForVite(viteMajorVersion)
|
|
831
898
|
})
|
|
832
899
|
}
|
|
833
900
|
} };
|
|
834
|
-
else if (
|
|
901
|
+
else if (shouldInjectPlainPagesEnvironments) viteConfig.environments = {
|
|
835
902
|
client: {
|
|
836
903
|
consumer: "client",
|
|
837
904
|
optimizeDeps: pagesOptimizeEntries.length > 0 ? { entries: pagesOptimizeEntries } : void 0,
|
|
@@ -839,9 +906,10 @@ function vinext(options = {}) {
|
|
|
839
906
|
outDir: "dist/client",
|
|
840
907
|
manifest: true,
|
|
841
908
|
ssrManifest: true,
|
|
909
|
+
assetsInlineLimit: clientAssetsInlineLimit,
|
|
842
910
|
...withBuildBundlerOptions(viteMajorVersion, {
|
|
843
911
|
input: { index: VIRTUAL_CLIENT_ENTRY },
|
|
844
|
-
output: getClientOutputConfigForVite(viteMajorVersion),
|
|
912
|
+
output: getClientOutputConfigForVite(viteMajorVersion, clientAssetsDir),
|
|
845
913
|
treeshake: getClientTreeshakeConfigForVite(viteMajorVersion)
|
|
846
914
|
})
|
|
847
915
|
}
|
|
@@ -900,16 +968,17 @@ function vinext(options = {}) {
|
|
|
900
968
|
if (isVercelOgImport(cleanId) && !isVinextOgShimImporter(importer)) return resolveShimModulePath(_shimsDir, "og");
|
|
901
969
|
if (cleanId === VIRTUAL_SERVER_ENTRY) return RESOLVED_SERVER_ENTRY;
|
|
902
970
|
if (cleanId === VIRTUAL_CLIENT_ENTRY) return RESOLVED_CLIENT_ENTRY;
|
|
903
|
-
if (cleanId.endsWith("/"
|
|
904
|
-
if (cleanId.endsWith("/"
|
|
971
|
+
if (cleanId.endsWith("/virtual:vinext-server-entry") || cleanId.endsWith("\\virtual:vinext-server-entry")) return RESOLVED_SERVER_ENTRY;
|
|
972
|
+
if (cleanId.endsWith("/virtual:vinext-client-entry") || cleanId.endsWith("\\virtual:vinext-client-entry")) return RESOLVED_CLIENT_ENTRY;
|
|
905
973
|
if (cleanId === VIRTUAL_RSC_ENTRY) return RESOLVED_RSC_ENTRY;
|
|
906
974
|
if (cleanId === VIRTUAL_APP_SSR_ENTRY) return RESOLVED_APP_SSR_ENTRY;
|
|
907
975
|
if (cleanId === VIRTUAL_APP_BROWSER_ENTRY) return RESOLVED_APP_BROWSER_ENTRY;
|
|
908
976
|
if (cleanId === "next/root-params" || cleanId === "next/root-params.js") return RESOLVED_ROOT_PARAMS;
|
|
977
|
+
if (cleanId === "virtual:vinext-cache-adapters" || cleanId.endsWith("/virtual:vinext-cache-adapters") || cleanId.endsWith("\\virtual:vinext-cache-adapters")) return RESOLVED_CACHE_ADAPTERS;
|
|
909
978
|
if (cleanId.startsWith("virtual:vinext-google-fonts?")) return RESOLVED_VIRTUAL_GOOGLE_FONTS + cleanId.slice(VIRTUAL_GOOGLE_FONTS.length);
|
|
910
|
-
if (cleanId.endsWith("/"
|
|
911
|
-
if (cleanId.endsWith("/"
|
|
912
|
-
if (cleanId.endsWith("/"
|
|
979
|
+
if (cleanId.endsWith("/virtual:vinext-rsc-entry") || cleanId.endsWith("\\virtual:vinext-rsc-entry")) return RESOLVED_RSC_ENTRY;
|
|
980
|
+
if (cleanId.endsWith("/virtual:vinext-app-ssr-entry") || cleanId.endsWith("\\virtual:vinext-app-ssr-entry")) return RESOLVED_APP_SSR_ENTRY;
|
|
981
|
+
if (cleanId.endsWith("/virtual:vinext-app-browser-entry") || cleanId.endsWith("\\virtual:vinext-app-browser-entry")) return RESOLVED_APP_BROWSER_ENTRY;
|
|
913
982
|
if (cleanId.includes("/virtual:vinext-google-fonts?") || cleanId.includes("\\virtual:vinext-google-fonts?")) {
|
|
914
983
|
const queryIndex = cleanId.indexOf(VIRTUAL_GOOGLE_FONTS + "?");
|
|
915
984
|
return RESOLVED_VIRTUAL_GOOGLE_FONTS + cleanId.slice(queryIndex + VIRTUAL_GOOGLE_FONTS.length);
|
|
@@ -938,6 +1007,7 @@ function vinext(options = {}) {
|
|
|
938
1007
|
clientTraceMetadata: nextConfig?.clientTraceMetadata,
|
|
939
1008
|
assetPrefix: nextConfig?.assetPrefix,
|
|
940
1009
|
expireTime: nextConfig?.expireTime,
|
|
1010
|
+
cacheMaxMemorySize: nextConfig?.cacheMaxMemorySize,
|
|
941
1011
|
inlineCss: nextConfig?.inlineCss,
|
|
942
1012
|
i18n: nextConfig?.i18n,
|
|
943
1013
|
hasPagesDir,
|
|
@@ -947,6 +1017,7 @@ function vinext(options = {}) {
|
|
|
947
1017
|
}, instrumentationPath);
|
|
948
1018
|
}
|
|
949
1019
|
if (id === RESOLVED_ROOT_PARAMS) return generateRootParamsModule((hasAppDir ? await appRouter(appDir, nextConfig?.pageExtensions, fileMatcher) : []).flatMap((route) => route.rootParamNames ?? []));
|
|
1020
|
+
if (id === RESOLVED_CACHE_ADAPTERS) return generateCacheAdaptersModule(options.cache);
|
|
950
1021
|
if (id === RESOLVED_APP_SSR_ENTRY && hasAppDir) return generateSsrEntry(hasPagesDir);
|
|
951
1022
|
if (id === RESOLVED_APP_BROWSER_ENTRY && hasAppDir) {
|
|
952
1023
|
const graph = await appRouteGraph(appDir, nextConfig?.pageExtensions, fileMatcher);
|
|
@@ -955,41 +1026,84 @@ function vinext(options = {}) {
|
|
|
955
1026
|
if (id.startsWith("\0virtual:vinext-google-fonts?")) return generateGoogleFontsVirtualModule(id, _fontGoogleShimPath);
|
|
956
1027
|
},
|
|
957
1028
|
// @vitejs/plugin-rsc runs the RSC environment build in two phases:
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
1029
|
+
renderChunk: {
|
|
1030
|
+
order: "pre",
|
|
1031
|
+
handler(code, chunk) {
|
|
1032
|
+
if (this.environment?.name !== "rsc") return null;
|
|
1033
|
+
if (!rscClassificationManifest) return null;
|
|
1034
|
+
if (!code.includes("__VINEXT_CLASS")) return null;
|
|
1035
|
+
const enableClassificationDebug = Boolean(process.env.VINEXT_DEBUG_CLASSIFICATION);
|
|
1036
|
+
const patchPlan = planRouteClassificationInjection({
|
|
1037
|
+
canonicalizeLayoutPath: canonicalize,
|
|
1038
|
+
chunks: [{
|
|
1039
|
+
code,
|
|
1040
|
+
fileName: chunk.fileName
|
|
1041
|
+
}],
|
|
1042
|
+
dynamicShimPaths,
|
|
1043
|
+
enableDebugReasons: enableClassificationDebug,
|
|
1044
|
+
manifest: rscClassificationManifest,
|
|
1045
|
+
moduleInfo: { getModuleInfo: (moduleId) => {
|
|
1046
|
+
const info = this.getModuleInfo(moduleId);
|
|
1047
|
+
if (!info) return null;
|
|
1048
|
+
return {
|
|
1049
|
+
importedIds: info.importedIds ?? [],
|
|
1050
|
+
dynamicImportedIds: info.dynamicallyImportedIds ?? []
|
|
1051
|
+
};
|
|
1052
|
+
} }
|
|
969
1053
|
});
|
|
970
|
-
|
|
1054
|
+
if (patchPlan.kind === "skip") return null;
|
|
1055
|
+
rscClassificationManifest = null;
|
|
1056
|
+
return {
|
|
1057
|
+
code: patchPlan.code,
|
|
1058
|
+
map: patchPlan.map
|
|
1059
|
+
};
|
|
971
1060
|
}
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
1061
|
+
}
|
|
1062
|
+
},
|
|
1063
|
+
{
|
|
1064
|
+
name: "vinext:css-url-assets-mark",
|
|
1065
|
+
enforce: "pre",
|
|
1066
|
+
apply: "build",
|
|
1067
|
+
transform(code, id) {
|
|
1068
|
+
if (this.environment?.name !== "client") return null;
|
|
1069
|
+
const marked = markCssUrlAssetReferences(code, id);
|
|
1070
|
+
if (marked === null) return null;
|
|
1071
|
+
return {
|
|
1072
|
+
code: marked,
|
|
1073
|
+
map: null
|
|
1074
|
+
};
|
|
1075
|
+
}
|
|
1076
|
+
},
|
|
1077
|
+
{
|
|
1078
|
+
name: "vinext:client-css-url-assets-defaults",
|
|
1079
|
+
apply: "build",
|
|
1080
|
+
configEnvironment(name) {
|
|
1081
|
+
if (name !== "client") return null;
|
|
1082
|
+
return { build: { assetsInlineLimit: clientAssetsInlineLimit } };
|
|
1083
|
+
}
|
|
1084
|
+
},
|
|
1085
|
+
{
|
|
1086
|
+
name: "vinext:server-minify-defaults",
|
|
1087
|
+
apply: "build",
|
|
1088
|
+
configEnvironment(name, config) {
|
|
1089
|
+
if (name === "client") return null;
|
|
1090
|
+
if (config.build?.minify !== void 0) return null;
|
|
1091
|
+
return { build: { minify: true } };
|
|
1092
|
+
}
|
|
1093
|
+
},
|
|
1094
|
+
{
|
|
1095
|
+
name: "vinext:css-url-assets-restore",
|
|
1096
|
+
enforce: "post",
|
|
1097
|
+
apply: "build",
|
|
1098
|
+
generateBundle(_options, bundle) {
|
|
1099
|
+
if (this.environment?.name !== "client") return;
|
|
1100
|
+
restoreDedupedCssAssetReferences(bundle, (asset) => {
|
|
1101
|
+
this.emitFile({
|
|
1102
|
+
type: "asset",
|
|
1103
|
+
fileName: asset.fileName,
|
|
1104
|
+
source: asset.source
|
|
1105
|
+
});
|
|
986
1106
|
});
|
|
987
|
-
if (patchPlan.kind === "skip") return;
|
|
988
|
-
const target = chunksByFileName.get(patchPlan.fileName);
|
|
989
|
-
if (!target) throw new Error(`vinext: build-time classification — patch target ${patchPlan.fileName} disappeared from the RSC bundle`);
|
|
990
|
-
target.code = patchPlan.code;
|
|
991
|
-
target.map = patchPlan.map;
|
|
992
|
-
rscClassificationManifest = null;
|
|
993
1107
|
}
|
|
994
1108
|
},
|
|
995
1109
|
asyncHooksStubPlugin,
|
|
@@ -1157,6 +1271,7 @@ function vinext(options = {}) {
|
|
|
1157
1271
|
}
|
|
1158
1272
|
next();
|
|
1159
1273
|
});
|
|
1274
|
+
installDevStackSourcemapMiddleware(server);
|
|
1160
1275
|
return () => {
|
|
1161
1276
|
if (instrumentationPath && !hasAppDir) runInstrumentation(getPagesRunner(), instrumentationPath).catch((err) => {
|
|
1162
1277
|
console.error("[vinext] Instrumentation error:", err);
|
|
@@ -1464,6 +1579,21 @@ function vinext(options = {}) {
|
|
|
1464
1579
|
};
|
|
1465
1580
|
}
|
|
1466
1581
|
},
|
|
1582
|
+
{
|
|
1583
|
+
name: "vinext:validate-server-only-client-imports",
|
|
1584
|
+
transform: {
|
|
1585
|
+
filter: {
|
|
1586
|
+
id: /\.(tsx?|jsx?|mjs)$/,
|
|
1587
|
+
code: "server-only"
|
|
1588
|
+
},
|
|
1589
|
+
handler(code, id) {
|
|
1590
|
+
if (this.environment?.name !== "client") return null;
|
|
1591
|
+
if (id.startsWith("\0")) return null;
|
|
1592
|
+
if (!hasServerOnlyMarkerImport(code)) return null;
|
|
1593
|
+
throw new Error(`You're importing a module that depends on "server-only". This API is only available in Server Components in the App Router, but this module is reachable from a client bundle.`);
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
},
|
|
1467
1597
|
{
|
|
1468
1598
|
name: "vinext:strip-server-exports",
|
|
1469
1599
|
transform: {
|
|
@@ -1554,23 +1684,35 @@ function vinext(options = {}) {
|
|
|
1554
1684
|
if (id.includes("node_modules")) return null;
|
|
1555
1685
|
if (id.startsWith("\0")) return null;
|
|
1556
1686
|
if (!id.match(/\.(tsx?|jsx?|mjs)$/)) return null;
|
|
1557
|
-
const
|
|
1558
|
-
|
|
1559
|
-
|
|
1687
|
+
const imageExtRe = new RegExp(`\\.(${IMAGE_EXTS})$`);
|
|
1688
|
+
const lang = id.endsWith(".ts") ? "ts" : "tsx";
|
|
1689
|
+
let ast;
|
|
1690
|
+
try {
|
|
1691
|
+
ast = parseAst(code, { lang });
|
|
1692
|
+
} catch {
|
|
1693
|
+
return null;
|
|
1694
|
+
}
|
|
1560
1695
|
const s = new MagicString(code);
|
|
1561
1696
|
let hasChanges = false;
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
const
|
|
1565
|
-
const
|
|
1566
|
-
|
|
1697
|
+
for (const node of ast.body) {
|
|
1698
|
+
if (node.type !== "ImportDeclaration") continue;
|
|
1699
|
+
const importNode = node;
|
|
1700
|
+
const importPath = importNode.source?.value;
|
|
1701
|
+
if (typeof importPath !== "string") continue;
|
|
1702
|
+
if (!imageExtRe.test(importPath)) continue;
|
|
1703
|
+
const specifiers = importNode.specifiers ?? [];
|
|
1704
|
+
if (specifiers.length !== 1) continue;
|
|
1705
|
+
const specifier = specifiers[0];
|
|
1706
|
+
if (specifier.type !== "ImportDefaultSpecifier") continue;
|
|
1707
|
+
const varName = specifier.local?.name;
|
|
1708
|
+
if (!varName) continue;
|
|
1567
1709
|
const dir = path.dirname(id);
|
|
1568
|
-
const absImagePath = path.resolve(dir, importPath);
|
|
1710
|
+
const absImagePath = normalizePathSeparators(path.resolve(dir, importPath));
|
|
1569
1711
|
if (!fs.existsSync(absImagePath)) continue;
|
|
1570
1712
|
const urlVar = `__vinext_img_url_${varName}`;
|
|
1571
1713
|
const metaVar = `__vinext_img_meta_${varName}`;
|
|
1572
1714
|
const replacement = `import ${urlVar} from ${JSON.stringify(importPath)};\nimport ${metaVar} from ${JSON.stringify(absImagePath + "?vinext-meta")};\nconst ${varName} = { src: ${urlVar}, width: ${metaVar}.width, height: ${metaVar}.height };`;
|
|
1573
|
-
s.overwrite(
|
|
1715
|
+
s.overwrite(importNode.start, importNode.end, replacement);
|
|
1574
1716
|
hasChanges = true;
|
|
1575
1717
|
}
|
|
1576
1718
|
if (!hasChanges) return null;
|
|
@@ -1582,7 +1724,7 @@ function vinext(options = {}) {
|
|
|
1582
1724
|
}
|
|
1583
1725
|
},
|
|
1584
1726
|
createGoogleFontsPlugin(_fontGoogleShimPath, _shimsDir),
|
|
1585
|
-
createLocalFontsPlugin(),
|
|
1727
|
+
createLocalFontsPlugin(_shimsDir),
|
|
1586
1728
|
createOptimizeImportsPlugin(() => nextConfig, () => root),
|
|
1587
1729
|
{
|
|
1588
1730
|
name: "vinext:use-cache",
|
|
@@ -1634,9 +1776,15 @@ function vinext(options = {}) {
|
|
|
1634
1776
|
const directiveValue = cacheDirective.expression.value;
|
|
1635
1777
|
const variant = directiveValue === "use cache" ? "" : directiveValue.replace("use cache:", "").replace("use cache: ", "").trim();
|
|
1636
1778
|
const isLayoutOrTemplate = /\/(layout|template)\.(tsx?|jsx?|mjs)$/.test(id);
|
|
1779
|
+
const modulePath = stripViteModuleQuery(id);
|
|
1780
|
+
const moduleFileName = path.basename(modulePath);
|
|
1781
|
+
const isAppPageModule = hasAppDir && isInsideDirectory(appDir, modulePath) && path.parse(moduleFileName).name === "page" && fileMatcher.extensionRegex.test(moduleFileName);
|
|
1637
1782
|
const runtimeModuleUrl = pathToFileURL(resolveShimModulePath(shimsDir, "cache-runtime")).href;
|
|
1638
1783
|
const result = transformWrapExport(code, ast, {
|
|
1639
|
-
runtime: (value, name) =>
|
|
1784
|
+
runtime: (value, name) => {
|
|
1785
|
+
const pageOptions = name === "default" && isAppPageModule ? `, { appPageDefaultExport: true }` : "";
|
|
1786
|
+
return `(await import(${JSON.stringify(runtimeModuleUrl)})).registerCachedFunction(${value}, ${JSON.stringify(id + ":" + name)}, ${JSON.stringify(variant)}${pageOptions})`;
|
|
1787
|
+
},
|
|
1640
1788
|
rejectNonAsyncFunction: false,
|
|
1641
1789
|
filter: (name, meta) => {
|
|
1642
1790
|
if (meta.isFunction === false) return false;
|
|
@@ -1681,8 +1829,9 @@ function vinext(options = {}) {
|
|
|
1681
1829
|
}
|
|
1682
1830
|
}
|
|
1683
1831
|
},
|
|
1832
|
+
createImportMetaUrlPlugin({ getRoot: () => root }),
|
|
1684
1833
|
createOgInlineFetchAssetsPlugin(),
|
|
1685
|
-
|
|
1834
|
+
createOgAssetsPlugin(),
|
|
1686
1835
|
createServerExternalsManifestPlugin(),
|
|
1687
1836
|
{
|
|
1688
1837
|
name: "vinext:image-config",
|
|
@@ -1710,7 +1859,7 @@ function vinext(options = {}) {
|
|
|
1710
1859
|
name: "vinext:build-id",
|
|
1711
1860
|
apply: "build",
|
|
1712
1861
|
enforce: "post",
|
|
1713
|
-
|
|
1862
|
+
writeBundle: {
|
|
1714
1863
|
sequential: true,
|
|
1715
1864
|
order: "post",
|
|
1716
1865
|
handler() {
|
|
@@ -1792,6 +1941,26 @@ function vinext(options = {}) {
|
|
|
1792
1941
|
}
|
|
1793
1942
|
}
|
|
1794
1943
|
},
|
|
1944
|
+
{
|
|
1945
|
+
name: "vinext:next-client-runtime-manifests",
|
|
1946
|
+
apply: "build",
|
|
1947
|
+
enforce: "post",
|
|
1948
|
+
writeBundle: {
|
|
1949
|
+
sequential: true,
|
|
1950
|
+
order: "post",
|
|
1951
|
+
handler(outputOptions) {
|
|
1952
|
+
const clientDir = outputOptions.dir;
|
|
1953
|
+
if (!clientDir) return;
|
|
1954
|
+
if (!(this.environment?.name === "client")) return;
|
|
1955
|
+
emitNextClientRuntimeManifests({
|
|
1956
|
+
clientDir,
|
|
1957
|
+
assetsSubdir: resolveAssetsDir(nextConfig.assetPrefix),
|
|
1958
|
+
buildId: nextConfig.buildId,
|
|
1959
|
+
rewrites: nextConfig.rewrites
|
|
1960
|
+
});
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
},
|
|
1795
1964
|
(() => {
|
|
1796
1965
|
let pendingPrecompress = null;
|
|
1797
1966
|
let pendingPrecompressError = null;
|
|
@@ -1820,8 +1989,7 @@ function vinext(options = {}) {
|
|
|
1820
1989
|
if (!isTTY) return;
|
|
1821
1990
|
const pct = total > 0 ? Math.floor(completed / total * 100) : 0;
|
|
1822
1991
|
const bar = `[${"█".repeat(Math.floor(pct / 5))}${" ".repeat(20 - Math.floor(pct / 5))}]`;
|
|
1823
|
-
const
|
|
1824
|
-
const fileLabel = file.length > maxFile ? "…" + file.slice(-(maxFile - 1)) : file;
|
|
1992
|
+
const fileLabel = file.length > 30 ? "…" + file.slice(-29) : file;
|
|
1825
1993
|
const line = `Compressing assets... ${bar} ${String(completed).padStart(String(total).length)}/${total} ${fileLabel}`;
|
|
1826
1994
|
const padded = line.padEnd(lastLineLen);
|
|
1827
1995
|
lastLineLen = line.length;
|
|
@@ -1896,16 +2064,17 @@ function vinext(options = {}) {
|
|
|
1896
2064
|
const clientBase = envConfig.base ?? "/";
|
|
1897
2065
|
let lazyChunksData = null;
|
|
1898
2066
|
let clientEntryFile = null;
|
|
1899
|
-
const
|
|
1900
|
-
if (
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
2067
|
+
const buildManifest = readClientBuildManifest(path.join(clientDir, ".vite", "manifest.json"));
|
|
2068
|
+
if (buildManifest) {
|
|
2069
|
+
clientEntryFile = findClientEntryFile({
|
|
2070
|
+
buildManifest,
|
|
2071
|
+
clientDir,
|
|
2072
|
+
assetsSubdir: resolveAssetsDir(nextConfig?.assetPrefix),
|
|
2073
|
+
assetBase: clientBase
|
|
2074
|
+
}) ?? null;
|
|
1906
2075
|
const lazy = manifestFilesWithBase(computeLazyChunks(buildManifest), clientBase);
|
|
1907
2076
|
if (lazy.length > 0) lazyChunksData = lazy;
|
|
1908
|
-
}
|
|
2077
|
+
}
|
|
1909
2078
|
let ssrManifestData = null;
|
|
1910
2079
|
const ssrManifestPath = path.join(clientDir, ".vite", "ssr-manifest.json");
|
|
1911
2080
|
if (fs.existsSync(ssrManifestPath)) try {
|
|
@@ -1934,14 +2103,11 @@ function vinext(options = {}) {
|
|
|
1934
2103
|
if (!workerOutDir) return;
|
|
1935
2104
|
const workerEntry = path.join(workerOutDir, "index.js");
|
|
1936
2105
|
if (!fs.existsSync(workerEntry)) return;
|
|
1937
|
-
if (!clientEntryFile) {
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
if (entry) clientEntryFile = manifestFileWithBase(`${assetsSubdir}/${entry}`, clientBase);
|
|
1943
|
-
}
|
|
1944
|
-
}
|
|
2106
|
+
if (!clientEntryFile) clientEntryFile = findClientEntryFile({
|
|
2107
|
+
clientDir,
|
|
2108
|
+
assetsSubdir: resolveAssetsDir(nextConfig?.assetPrefix),
|
|
2109
|
+
assetBase: clientBase
|
|
2110
|
+
}) ?? null;
|
|
1945
2111
|
if (clientEntryFile || ssrManifestData || lazyChunksData) {
|
|
1946
2112
|
let code = fs.readFileSync(workerEntry, "utf-8");
|
|
1947
2113
|
const globals = [];
|
|
@@ -1986,15 +2152,19 @@ function vinext(options = {}) {
|
|
|
1986
2152
|
` if (mod) {`,
|
|
1987
2153
|
` WebAssembly.instantiate(mod, imports).then(function(inst) { callback(inst); });`,
|
|
1988
2154
|
` } else {`,
|
|
1989
|
-
`
|
|
1990
|
-
`
|
|
2155
|
+
` Promise.all([import("node:fs"), import("node:url")]).then(function(mods) {`,
|
|
2156
|
+
` var p = mods[1].fileURLToPath(new URL("./yoga.wasm", import.meta.url));`,
|
|
2157
|
+
` return mods[0].promises.readFile(p).then(function(bytes) {`,
|
|
2158
|
+
` return WebAssembly.instantiate(bytes, imports).then(function(r) { callback(r.instance); });`,
|
|
2159
|
+
` });`,
|
|
2160
|
+
` });`,
|
|
1991
2161
|
` }`,
|
|
1992
2162
|
` });`,
|
|
1993
2163
|
` return {};`,
|
|
1994
2164
|
`} })`
|
|
1995
2165
|
].join("\n");
|
|
1996
2166
|
result = result.replace(YOGA_CALL, YOGA_CALL_PATCHED);
|
|
1997
|
-
result = [`var
|
|
2167
|
+
result = [`var __vi_yoga_mod = import("./yoga.wasm?module").then(function(m) { return m.default; }).catch(function() { return null; });`].join("\n") + "\n" + result;
|
|
1998
2168
|
}
|
|
1999
2169
|
const resvgMatch = /import\s+resvg_wasm\s+from\s+["']\.\/resvg\.wasm\?module["']\s*;?/.exec(result);
|
|
2000
2170
|
if (resvgMatch) {
|
|
@@ -2118,18 +2288,5 @@ function applyHeaders(pathname, res, headers, ctx, basePath = "") {
|
|
|
2118
2288
|
} else if (!res.getHeader(lk)) res.setHeader(header.key, header.value);
|
|
2119
2289
|
}
|
|
2120
2290
|
}
|
|
2121
|
-
/**
|
|
2122
|
-
* Find a file by name (without extension) in a directory.
|
|
2123
|
-
* Checks the configured page extensions.
|
|
2124
|
-
*/
|
|
2125
|
-
function findFileWithExts(dir, name, matcher) {
|
|
2126
|
-
for (const ext of matcher.dottedExtensions) {
|
|
2127
|
-
const filePath = path.join(dir, name + ext);
|
|
2128
|
-
if (fs.existsSync(filePath)) return filePath;
|
|
2129
|
-
}
|
|
2130
|
-
return null;
|
|
2131
|
-
}
|
|
2132
2291
|
//#endregion
|
|
2133
2292
|
export { vinext as default, staticExportApp, staticExportPages };
|
|
2134
|
-
|
|
2135
|
-
//# sourceMappingURL=index.js.map
|