vinext 1.0.0-beta.1 → 1.0.0-beta.11
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 +135 -27
- package/THIRD_PARTY_LICENSES.md +25 -0
- package/dist/_virtual/_rolldown/runtime.js +25 -0
- package/dist/build/action-owner-manifest.d.ts +41 -0
- package/dist/build/action-owner-manifest.js +110 -0
- package/dist/build/assets-ignore.d.ts +3 -4
- package/dist/build/clean-output.d.ts +2 -3
- package/dist/build/clean-output.js +1 -4
- package/dist/build/client-build-config.d.ts +39 -13
- package/dist/build/client-build-config.js +86 -12
- package/dist/build/css-url-assets.d.ts +4 -6
- package/dist/build/css-url-assets.js +5 -2
- package/dist/build/google-fonts/build-url.d.ts +8 -6
- package/dist/build/google-fonts/fallback-metrics.d.ts +3 -4
- package/dist/build/google-fonts/find-font-files-in-css.d.ts +2 -3
- package/dist/build/google-fonts/font-metadata.d.ts +9 -6
- package/dist/build/google-fonts/get-axes.d.ts +2 -4
- package/dist/build/google-fonts/sort-variants.d.ts +2 -3
- package/dist/build/google-fonts/validate.d.ts +2 -3
- package/dist/build/google-fonts/validate.js +8 -4
- package/dist/build/inject-pregenerated-paths.d.ts +2 -3
- package/dist/build/inject-pregenerated-paths.js +16 -14
- package/dist/build/inline-css.d.ts +3 -4
- package/dist/build/layout-classification-types.d.ts +4 -5
- package/dist/build/layout-classification.d.ts +14 -12
- package/dist/build/module-dependency-cache.d.ts +2 -3
- package/dist/build/next-client-runtime-manifests.d.ts +4 -6
- package/dist/build/next-client-runtime-manifests.js +2 -19
- package/dist/build/nitro-route-rules.d.ts +6 -8
- package/dist/build/pages-client-assets-module.d.ts +7 -9
- package/dist/build/precompress.d.ts +9 -5
- package/dist/build/precompress.js +42 -8
- package/dist/build/prerender-paths.d.ts +73 -9
- package/dist/build/prerender-paths.js +730 -95
- package/dist/build/prerender-phase.d.ts +14 -0
- package/dist/build/prerender-phase.js +37 -0
- package/dist/build/prerender-server-entry.d.ts +1 -1
- package/dist/build/prerender-server-entry.js +8 -2
- package/dist/build/prerender-server-pool.d.ts +13 -8
- package/dist/build/prerender-server-pool.js +9 -4
- package/dist/build/prerender.d.ts +63 -43
- package/dist/build/prerender.js +171 -53
- package/dist/build/preview-credentials.d.ts +5 -6
- package/dist/build/public-dir-conflict.d.ts +13 -0
- package/dist/build/public-dir-conflict.js +26 -0
- package/dist/build/report.d.ts +42 -21
- package/dist/build/report.js +75 -4
- package/dist/build/route-classification-injector.d.ts +2 -4
- package/dist/build/route-classification-manifest.d.ts +11 -10
- package/dist/build/run-prerender.d.ts +13 -10
- package/dist/build/run-prerender.js +27 -17
- package/dist/build/server-entry.d.ts +4 -0
- package/dist/build/server-entry.js +28 -0
- package/dist/build/server-manifest.d.ts +8 -3
- package/dist/build/server-manifest.js +14 -2
- package/dist/build/ssr-manifest.d.ts +5 -6
- package/dist/build/standalone.d.ts +2 -3
- package/dist/build/static-export.d.ts +30 -20
- package/dist/cache/cache-adapters-virtual.d.ts +89 -11
- package/dist/cache/cache-adapters-virtual.js +42 -6
- package/dist/check.d.ts +9 -10
- package/dist/check.js +91 -18
- package/dist/cli-args.d.ts +4 -4
- package/dist/cli-args.js +10 -0
- package/dist/cli-dev-config.d.ts +5 -7
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +45 -18
- package/dist/client/app-nav-failure-handler.d.ts +6 -7
- package/dist/client/app-nav-failure-handler.js +1 -0
- package/dist/client/client-rewrite-matcher.d.ts +11 -0
- package/dist/client/client-rewrite-matcher.js +20 -0
- package/dist/client/client-rewrites.d.ts +30 -0
- package/dist/client/client-rewrites.js +41 -0
- package/dist/client/dev-error-overlay-store.d.ts +13 -14
- package/dist/client/dev-error-overlay.d.ts +15 -16
- package/dist/client/dev-error-overlay.js +8 -5
- package/dist/client/empty-module.d.ts +1 -1
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.js +2 -0
- package/dist/client/instrumentation-client-inject.d.ts +3 -4
- package/dist/client/instrumentation-client-state.d.ts +5 -7
- package/dist/client/instrumentation-client.d.ts +3 -4
- package/dist/client/navigation-runtime.d.ts +31 -19
- package/dist/client/navigation-runtime.js +8 -8
- package/dist/client/pages-router-link-navigation.d.ts +4 -23
- package/dist/client/react-instance-bootstrap.d.ts +1 -0
- package/dist/client/react-instance-bootstrap.js +7 -0
- package/dist/client/react-instance.d.ts +12 -0
- package/dist/client/react-instance.js +20 -0
- package/dist/client/validate-module-path.d.ts +2 -3
- package/dist/client/vinext-next-data.d.ts +20 -14
- package/dist/client/window-next.d.ts +9 -7
- package/dist/config/config-matchers.d.ts +27 -53
- package/dist/config/config-matchers.js +49 -132
- package/dist/config/dotenv.d.ts +5 -11
- package/dist/config/dotenv.js +32 -23
- package/dist/config/next-config.d.ts +148 -73
- package/dist/config/next-config.js +195 -19
- package/dist/config/prerender.d.ts +16 -17
- package/dist/config/prerender.js +2 -2
- package/dist/config/request-context.d.ts +13 -0
- package/dist/config/request-context.js +26 -0
- package/dist/config/server-external-packages.d.ts +14 -3
- package/dist/config/server-external-packages.js +37 -3
- package/dist/config/tsconfig-paths.d.ts +3 -4
- package/dist/deps/.pnpm/ignore@5.3.2/deps/ignore/index.js +189 -0
- package/dist/deps/.pnpm/image-size@2.0.2/deps/image-size/dist/index.js +808 -0
- package/dist/deps/.pnpm/ua-parser-js@1.0.35/deps/ua-parser-js/src/ua-parser.js +1057 -0
- package/dist/entries/app-browser-entry.d.ts +7 -15
- package/dist/entries/app-browser-entry.js +30 -8
- package/dist/entries/app-rsc-entry.d.ts +42 -20
- package/dist/entries/app-rsc-entry.js +621 -56
- package/dist/entries/app-rsc-manifest.d.ts +4 -4
- package/dist/entries/app-rsc-manifest.js +49 -4
- package/dist/entries/app-ssr-entry.d.ts +2 -3
- package/dist/entries/app-ssr-entry.js +8 -1
- package/dist/entries/pages-client-entry.d.ts +3 -5
- package/dist/entries/pages-client-entry.js +15 -6
- package/dist/entries/pages-server-entry.d.ts +14 -5
- package/dist/entries/pages-server-entry.js +272 -41
- package/dist/entries/runtime-entry-module.d.ts +4 -5
- package/dist/image/image-adapters-virtual.d.ts +8 -7
- package/dist/index.d.ts +7 -4
- package/dist/index.js +1039 -363
- package/dist/init-cloudflare.d.ts +19 -15
- package/dist/init-cloudflare.js +415 -58
- package/dist/init-platform.d.ts +24 -23
- package/dist/init-platform.js +70 -23
- package/dist/init.d.ts +52 -29
- package/dist/init.js +32 -25
- package/dist/plugins/action-owner-manifest.d.ts +13 -0
- package/dist/plugins/action-owner-manifest.js +91 -0
- package/dist/plugins/ast-scope.d.ts +10 -12
- package/dist/plugins/ast-scope.js +10 -22
- package/dist/plugins/ast-utils.d.ts +37 -21
- package/dist/plugins/ast-utils.js +69 -38
- package/dist/plugins/async-hooks-stub.d.ts +2 -4
- package/dist/plugins/client-reference-dedup.d.ts +4 -6
- package/dist/plugins/client-reference-dedup.js +7 -5
- package/dist/plugins/css-data-url.d.ts +2 -4
- package/dist/plugins/css-module-imports.d.ts +4 -6
- package/dist/plugins/css-module-imports.js +5 -13
- package/dist/plugins/dynamic-preload-metadata.d.ts +3 -5
- package/dist/plugins/dynamic-preload-metadata.js +59 -179
- package/dist/plugins/environment.d.ts +10 -0
- package/dist/plugins/environment.js +7 -0
- package/dist/plugins/extensionless-dynamic-import.d.ts +2 -4
- package/dist/plugins/extensionless-dynamic-import.js +379 -63
- package/dist/plugins/fonts.d.ts +10 -12
- package/dist/plugins/fonts.js +11 -14
- package/dist/plugins/ignore-dynamic-requests.d.ts +5 -9
- package/dist/plugins/ignore-dynamic-requests.js +107 -140
- package/dist/plugins/import-meta-url.d.ts +16 -12
- package/dist/plugins/import-meta-url.js +337 -113
- package/dist/plugins/instrumentation-client.d.ts +3 -4
- package/dist/plugins/instrumentation-client.js +49 -14
- package/dist/plugins/middleware-export-validation.d.ts +3 -4
- package/dist/plugins/middleware-export-validation.js +5 -17
- package/dist/plugins/middleware-server-only.d.ts +2 -4
- package/dist/plugins/middleware-server-only.js +2 -2
- package/dist/plugins/og-asset-ownership.d.ts +3 -5
- package/dist/plugins/og-asset-ownership.js +18 -26
- package/dist/plugins/og-assets.d.ts +4 -6
- package/dist/plugins/og-assets.js +3 -5
- package/dist/plugins/optimize-imports.d.ts +7 -8
- package/dist/plugins/optimize-imports.js +33 -47
- package/dist/plugins/pages-node-externals.d.ts +22 -0
- package/dist/plugins/pages-node-externals.js +174 -0
- package/dist/plugins/postcss.d.ts +3 -4
- package/dist/plugins/remove-console.d.ts +2 -4
- package/dist/plugins/remove-console.js +2 -5
- package/dist/plugins/require-condition-resolution.d.ts +15 -0
- package/dist/plugins/require-condition-resolution.js +166 -0
- package/dist/plugins/require-context.d.ts +2 -4
- package/dist/plugins/require-context.js +163 -84
- package/dist/plugins/rsc-client-reference-loaders.d.ts +2 -4
- package/dist/plugins/rsc-client-shim-excludes.d.ts +4 -5
- package/dist/plugins/rsc-reference-validation-normalizer.d.ts +2 -4
- package/dist/plugins/sass.d.ts +34 -7
- package/dist/plugins/sass.js +73 -8
- package/dist/plugins/server-externals-manifest.d.ts +2 -4
- package/dist/plugins/server-externals-manifest.js +1 -23
- package/dist/plugins/strip-server-exports.d.ts +5 -7
- package/dist/plugins/strip-server-exports.js +13 -19
- package/dist/plugins/styled-jsx.d.ts +2 -4
- package/dist/plugins/styled-jsx.js +22 -24
- package/dist/plugins/transform-cache.d.ts +18 -0
- package/dist/plugins/transform-cache.js +36 -0
- package/dist/plugins/transform-result.d.ts +9 -0
- package/dist/plugins/transform-result.js +10 -0
- package/dist/plugins/transitive-externals.d.ts +23 -0
- package/dist/plugins/transitive-externals.js +107 -0
- package/dist/plugins/typeof-window.d.ts +11 -7
- package/dist/plugins/typeof-window.js +154 -37
- package/dist/plugins/use-cache-callable.d.ts +11 -0
- package/dist/plugins/use-cache-callable.js +202 -0
- package/dist/plugins/wasm-module-import.d.ts +2 -4
- package/dist/plugins/wasm-module-import.js +1 -1
- package/dist/plugins/worker-image-imports.d.ts +11 -0
- package/dist/plugins/worker-image-imports.js +134 -0
- package/dist/routing/app-route-graph.d.ts +135 -59
- package/dist/routing/app-route-graph.js +162 -24
- package/dist/routing/app-router.d.ts +7 -6
- package/dist/routing/app-router.js +17 -7
- package/dist/routing/file-matcher.d.ts +19 -31
- package/dist/routing/file-matcher.js +21 -33
- package/dist/routing/pages-router.d.ts +15 -11
- package/dist/routing/pages-router.js +23 -29
- package/dist/routing/route-matching.d.ts +16 -5
- package/dist/routing/route-matching.js +16 -2
- package/dist/routing/route-pattern.d.ts +19 -12
- package/dist/routing/route-pattern.js +33 -3
- package/dist/routing/route-trie.d.ts +8 -5
- package/dist/routing/route-trie.js +5 -2
- package/dist/routing/route-validation.d.ts +3 -4
- package/dist/routing/route-validation.js +19 -12
- package/dist/routing/utils.d.ts +13 -36
- package/dist/routing/utils.js +1 -30
- package/dist/server/accept-encoding.d.ts +9 -12
- package/dist/server/accept-encoding.js +1 -4
- package/dist/server/api-handler.d.ts +4 -4
- package/dist/server/api-handler.js +16 -12
- package/dist/server/app-action-forwarding.d.ts +17 -0
- package/dist/server/app-action-forwarding.js +140 -0
- package/dist/server/app-action-request.d.ts +2 -3
- package/dist/server/app-bfcache-id.d.ts +3 -4
- package/dist/server/app-bfcache-identity.d.ts +14 -16
- package/dist/server/app-bfcache-identity.js +27 -102
- package/dist/server/app-browser-action-result.d.ts +15 -17
- package/dist/server/app-browser-client-reuse-manifest.d.ts +2 -4
- package/dist/server/app-browser-entry.d.ts +1 -1
- package/dist/server/app-browser-entry.js +468 -139
- package/dist/server/app-browser-error.d.ts +5 -7
- package/dist/server/app-browser-error.js +2 -6
- package/dist/server/app-browser-history-controller.d.ts +29 -12
- package/dist/server/app-browser-history-controller.js +137 -20
- package/dist/server/app-browser-hydration.d.ts +5 -7
- package/dist/server/app-browser-interception-context.d.ts +3 -5
- package/dist/server/app-browser-mpa-navigation.d.ts +4 -6
- package/dist/server/app-browser-navigation-abort.d.ts +15 -0
- package/dist/server/app-browser-navigation-abort.js +29 -0
- package/dist/server/app-browser-navigation-controller.d.ts +36 -33
- package/dist/server/app-browser-navigation-controller.js +58 -14
- package/dist/server/app-browser-navigation-response.d.ts +10 -0
- package/dist/server/app-browser-navigation-response.js +8 -0
- package/dist/server/app-browser-popstate.d.ts +8 -5
- package/dist/server/app-browser-popstate.js +6 -2
- package/dist/server/app-browser-prefetch-response.d.ts +24 -0
- package/dist/server/app-browser-prefetch-response.js +54 -0
- package/dist/server/app-browser-rsc-redirect.d.ts +4 -5
- package/dist/server/app-browser-server-action-client.d.ts +5 -6
- package/dist/server/app-browser-server-action-client.js +6 -4
- package/dist/server/app-browser-server-action-navigation.d.ts +2 -4
- package/dist/server/app-browser-state.d.ts +26 -20
- package/dist/server/app-browser-state.js +15 -9
- package/dist/server/app-browser-stream.d.ts +4 -8
- package/dist/server/app-browser-stream.js +8 -6
- package/dist/server/app-browser-supplemental-refresh.d.ts +48 -0
- package/dist/server/app-browser-supplemental-refresh.js +190 -0
- package/dist/server/app-browser-visible-commit.d.ts +7 -8
- package/dist/server/app-browser-visible-commit.js +26 -11
- package/dist/server/app-client-reference-preloader.d.ts +2 -3
- package/dist/server/app-elements-wire-key.d.ts +25 -0
- package/dist/server/app-elements-wire-key.js +69 -0
- package/dist/server/app-elements-wire.d.ts +46 -60
- package/dist/server/app-elements-wire.js +43 -80
- package/dist/server/app-elements.d.ts +6 -7
- package/dist/server/app-elements.js +2 -2
- package/dist/server/app-fallback-renderer.d.ts +15 -8
- package/dist/server/app-fallback-renderer.js +12 -9
- package/dist/server/app-fetch-tracing.d.ts +15 -0
- package/dist/server/app-fetch-tracing.js +38 -0
- package/dist/server/app-history-state.d.ts +37 -17
- package/dist/server/app-history-state.js +110 -18
- package/dist/server/app-hook-warning-suppression.d.ts +2 -4
- package/dist/server/app-hydration-cache-publication.d.ts +3 -4
- package/dist/server/app-inline-css-client.d.ts +3 -4
- package/dist/server/app-interception-context-header.d.ts +2 -3
- package/dist/server/app-layout-param-observation.d.ts +7 -9
- package/dist/server/app-layout-param-observation.js +1 -1
- package/dist/server/app-metadata-tracing.d.ts +12 -0
- package/dist/server/app-metadata-tracing.js +17 -0
- package/dist/server/app-middleware.d.ts +20 -8
- package/dist/server/app-middleware.js +125 -34
- package/dist/server/app-mounted-slots-header.d.ts +2 -3
- package/dist/server/app-mounted-slots-header.js +2 -2
- package/dist/server/app-optimistic-routing.d.ts +35 -9
- package/dist/server/app-optimistic-routing.js +151 -13
- package/dist/server/app-page-boundary-render.d.ts +24 -9
- package/dist/server/app-page-boundary-render.js +98 -13
- package/dist/server/app-page-boundary.d.ts +9 -10
- package/dist/server/app-page-boundary.js +2 -1
- package/dist/server/app-page-cache-finalizer.d.ts +27 -9
- package/dist/server/app-page-cache-finalizer.js +129 -24
- package/dist/server/app-page-cache-render.d.ts +9 -7
- package/dist/server/app-page-cache-render.js +24 -5
- package/dist/server/app-page-cache.d.ts +12 -12
- package/dist/server/app-page-cache.js +55 -20
- package/dist/server/app-page-dispatch.d.ts +49 -20
- package/dist/server/app-page-dispatch.js +140 -60
- package/dist/server/app-page-element-builder.d.ts +77 -26
- package/dist/server/app-page-element-builder.js +326 -110
- package/dist/server/app-page-execution.d.ts +26 -19
- package/dist/server/app-page-execution.js +32 -15
- package/dist/server/app-page-head.d.ts +68 -13
- package/dist/server/app-page-head.js +235 -91
- package/dist/server/app-page-http-access-fallback-metadata.d.ts +30 -0
- package/dist/server/app-page-http-access-fallback-metadata.js +121 -0
- package/dist/server/app-page-method.d.ts +3 -4
- package/dist/server/app-page-params.d.ts +5 -7
- package/dist/server/app-page-ppr-runtime.d.ts +2 -3
- package/dist/server/app-page-ppr-runtime.js +3 -2
- package/dist/server/app-page-probe.d.ts +13 -9
- package/dist/server/app-page-probe.js +9 -4
- package/dist/server/app-page-render-identity.d.ts +5 -5
- package/dist/server/app-page-render-observation.d.ts +8 -10
- package/dist/server/app-page-render-observation.js +1 -1
- package/dist/server/app-page-render.d.ts +33 -13
- package/dist/server/app-page-render.js +171 -34
- package/dist/server/app-page-request.d.ts +27 -43
- package/dist/server/app-page-request.js +118 -64
- package/dist/server/app-page-response.d.ts +22 -10
- package/dist/server/app-page-response.js +25 -13
- package/dist/server/app-page-route-wiring.d.ts +58 -18
- package/dist/server/app-page-route-wiring.js +420 -103
- package/dist/server/app-page-search-params-observation.d.ts +3 -5
- package/dist/server/app-page-segment-plan.d.ts +55 -0
- package/dist/server/app-page-segment-plan.js +177 -0
- package/dist/server/app-page-segment-state.d.ts +23 -8
- package/dist/server/app-page-segment-state.js +35 -10
- package/dist/server/app-page-stream.d.ts +54 -21
- package/dist/server/app-page-stream.js +44 -9
- package/dist/server/app-page-tracing.d.ts +33 -0
- package/dist/server/app-page-tracing.js +49 -0
- package/dist/server/app-pages-bridge.d.ts +7 -7
- package/dist/server/app-pages-bridge.js +33 -5
- package/dist/server/app-post-middleware-context.d.ts +3 -5
- package/dist/server/app-post-middleware-context.js +1 -1
- package/dist/server/app-ppr-fallback-shell-render.d.ts +3 -5
- package/dist/server/app-ppr-fallback-shell-render.js +3 -2
- package/dist/server/app-ppr-fallback-shell.d.ts +7 -8
- package/dist/server/app-ppr-fallback-shell.js +3 -6
- package/dist/server/app-prerender-endpoints.d.ts +5 -6
- package/dist/server/app-prerender-endpoints.js +36 -11
- package/dist/server/app-prerender-static-params.d.ts +3 -5
- package/dist/server/app-prerender-static-params.js +18 -8
- package/dist/server/app-render-dependency.d.ts +16 -10
- package/dist/server/app-render-dependency.js +59 -9
- package/dist/server/app-request-context.d.ts +4 -4
- package/dist/server/app-request-stage-context.d.ts +5 -0
- package/dist/server/app-request-stage-context.js +11 -0
- package/dist/server/app-request-stage-dispatch.d.ts +25 -0
- package/dist/server/app-request-stage-dispatch.js +54 -0
- package/dist/server/app-request-stage-independent-entry.d.ts +8 -0
- package/dist/server/app-request-stage-independent-entry.js +115 -0
- package/dist/server/app-response-header-provenance.d.ts +19 -0
- package/dist/server/app-response-header-provenance.js +59 -0
- package/dist/server/app-response-stage-entry.d.ts +9 -0
- package/dist/server/app-response-stage-entry.js +86 -0
- package/dist/server/app-route-handler-cache.d.ts +5 -5
- package/dist/server/app-route-handler-cache.js +53 -33
- package/dist/server/app-route-handler-dispatch.d.ts +2 -4
- package/dist/server/app-route-handler-dispatch.js +116 -74
- package/dist/server/app-route-handler-execution.d.ts +22 -13
- package/dist/server/app-route-handler-execution.js +228 -30
- package/dist/server/app-route-handler-middleware-context.d.ts +8 -0
- package/dist/server/app-route-handler-middleware-context.js +15 -0
- package/dist/server/app-route-handler-policy.d.ts +25 -11
- package/dist/server/app-route-handler-policy.js +21 -6
- package/dist/server/app-route-handler-response.d.ts +11 -11
- package/dist/server/app-route-handler-response.js +18 -6
- package/dist/server/app-route-handler-runtime.d.ts +10 -12
- package/dist/server/app-route-handler-runtime.js +222 -85
- package/dist/server/app-route-module-loader.d.ts +43 -10
- package/dist/server/app-route-module-loader.js +77 -3
- package/dist/server/app-route-request-built-ins.d.ts +15 -0
- package/dist/server/app-route-request-built-ins.js +41 -0
- package/dist/server/app-route-tree-prefetch.d.ts +6 -7
- package/dist/server/app-route-tree-prefetch.js +2 -1
- package/dist/server/app-router-entry.d.ts +2 -1
- package/dist/server/app-router-entry.js +83 -16
- package/dist/server/app-rsc-cache-busting.d.ts +50 -23
- package/dist/server/app-rsc-cache-busting.js +122 -31
- package/dist/server/app-rsc-combined-handler.d.ts +9 -0
- package/dist/server/app-rsc-combined-handler.js +11 -0
- package/dist/server/app-rsc-embedded-chunks.d.ts +6 -7
- package/dist/server/app-rsc-error-handler.d.ts +12 -6
- package/dist/server/app-rsc-error-handler.js +15 -6
- package/dist/server/app-rsc-errors.d.ts +12 -9
- package/dist/server/app-rsc-errors.js +24 -4
- package/dist/server/app-rsc-handler.d.ts +43 -13
- package/dist/server/app-rsc-handler.js +701 -122
- package/dist/server/app-rsc-redirect-flight.d.ts +4 -6
- package/dist/server/app-rsc-render-mode.d.ts +8 -8
- package/dist/server/app-rsc-render-mode.js +4 -1
- package/dist/server/app-rsc-request-normalization.d.ts +25 -13
- package/dist/server/app-rsc-request-normalization.js +78 -6
- package/dist/server/app-rsc-response-finalizer.d.ts +13 -5
- package/dist/server/app-rsc-response-finalizer.js +56 -29
- package/dist/server/app-rsc-response-stage.d.ts +6 -0
- package/dist/server/app-rsc-response-stage.js +248 -0
- package/dist/server/app-rsc-route-matching.d.ts +42 -7
- package/dist/server/app-rsc-route-matching.js +118 -17
- package/dist/server/app-rsc-state-fingerprint.d.ts +13 -0
- package/dist/server/app-rsc-state-fingerprint.js +13 -0
- package/dist/server/app-rsc-vary.d.ts +16 -0
- package/dist/server/app-rsc-vary.js +31 -0
- package/dist/server/app-segment-config.d.ts +7 -7
- package/dist/server/app-segment-config.js +36 -14
- package/dist/server/app-server-action-execution.d.ts +60 -19
- package/dist/server/app-server-action-execution.js +321 -147
- package/dist/server/app-ssr-entry.d.ts +19 -7
- package/dist/server/app-ssr-entry.js +47 -24
- package/dist/server/app-ssr-error-meta.d.ts +3 -4
- package/dist/server/app-ssr-error-meta.js +2 -1
- package/dist/server/app-ssr-router-instance.d.ts +2 -4
- package/dist/server/app-ssr-stream.d.ts +21 -17
- package/dist/server/app-ssr-stream.js +33 -16
- package/dist/server/app-static-generation.d.ts +4 -6
- package/dist/server/app-visited-response-cache.d.ts +17 -8
- package/dist/server/app-visited-response-cache.js +68 -4
- package/dist/server/app-worker-stages.d.ts +84 -0
- package/dist/server/app-worker-stages.js +52 -0
- package/dist/server/artifact-compatibility.d.ts +11 -12
- package/dist/server/artifact-compatibility.js +1 -1
- package/dist/server/before-interactive-head.d.ts +2 -4
- package/dist/server/before-interactive-head.js +2 -0
- package/dist/server/bfcache-identity.d.ts +44 -0
- package/dist/server/bfcache-identity.js +52 -0
- package/dist/server/cache-control.d.ts +46 -16
- package/dist/server/cache-control.js +117 -13
- package/dist/server/cache-headers.d.ts +3 -4
- package/dist/server/cache-proof.d.ts +69 -71
- package/dist/server/cacheability-limits.d.ts +8 -0
- package/dist/server/cacheability-limits.js +9 -0
- package/dist/server/cacheability-manifest.d.ts +41 -0
- package/dist/server/cacheability-manifest.js +196 -0
- package/dist/server/cacheability-request.d.ts +49 -0
- package/dist/server/cacheability-request.js +545 -0
- package/dist/server/client-reuse-manifest.d.ts +17 -19
- package/dist/server/client-reuse-manifest.js +3 -3
- package/dist/server/client-trace-metadata.d.ts +9 -6
- package/dist/server/client-trace-metadata.js +27 -15
- package/dist/server/cloudflare-workers-tracing.d.ts +1 -0
- package/dist/server/cloudflare-workers-tracing.js +8 -0
- package/dist/server/config-headers.d.ts +42 -0
- package/dist/server/config-headers.js +102 -0
- package/dist/server/cookie-utils.d.ts +2 -3
- package/dist/server/csp.d.ts +5 -7
- package/dist/server/default-global-error-module.d.ts +2 -4
- package/dist/server/default-global-not-found-module.d.ts +2 -4
- package/dist/server/default-not-found-module.d.ts +2 -4
- package/dist/server/defer-until-stream-consumed.d.ts +2 -3
- package/dist/server/defer-until-stream-consumed.js +2 -1
- package/dist/server/dev-initial-server-error.d.ts +3 -4
- package/dist/server/dev-initial-server-error.js +2 -1
- package/dist/server/dev-lockfile.d.ts +29 -18
- package/dist/server/dev-module-runner.d.ts +2 -4
- package/dist/server/dev-origin-check.d.ts +5 -6
- package/dist/server/dev-route-files.d.ts +2 -4
- package/dist/server/dev-route-files.js +2 -5
- package/dist/server/dev-server.d.ts +10 -21
- package/dist/server/dev-server.js +381 -513
- package/dist/server/dev-stack-sourcemap.d.ts +7 -9
- package/dist/server/dev-stack-sourcemap.js +2 -5
- package/dist/server/document-initial-head.d.ts +13 -4
- package/dist/server/document-initial-head.js +17 -2
- package/dist/server/edge-api-runtime.d.ts +11 -3
- package/dist/server/edge-api-runtime.js +29 -1
- package/dist/server/fetch-handler.d.ts +3 -2
- package/dist/server/fetch-handler.js +3 -18
- package/dist/server/file-based-metadata.d.ts +2 -4
- package/dist/server/framework-tracer.d.ts +46 -0
- package/dist/server/framework-tracer.js +125 -0
- package/dist/server/fully-buffered-response.d.ts +11 -0
- package/dist/server/fully-buffered-response.js +19 -0
- package/dist/server/headers.d.ts +78 -47
- package/dist/server/headers.js +59 -18
- package/dist/server/html.d.ts +6 -7
- package/dist/server/http-conditional.d.ts +21 -0
- package/dist/server/http-conditional.js +117 -0
- package/dist/server/http-date.d.ts +4 -0
- package/dist/server/http-date.js +73 -0
- package/dist/server/http-error-responses.d.ts +9 -9
- package/dist/server/http-error-responses.js +21 -4
- package/dist/server/http-range.d.ts +24 -0
- package/dist/server/http-range.js +67 -0
- package/dist/server/hybrid-route-priority.d.ts +4 -5
- package/dist/server/image-optimization.d.ts +34 -27
- package/dist/server/image-optimization.js +0 -1
- package/dist/server/implicit-tags.d.ts +3 -4
- package/dist/server/instrumentation-runtime.d.ts +17 -21
- package/dist/server/instrumentation-runtime.js +26 -8
- package/dist/server/instrumentation.d.ts +24 -20
- package/dist/server/instrumentation.js +8 -8
- package/dist/server/isr-cache.d.ts +53 -68
- package/dist/server/isr-cache.js +49 -135
- package/dist/server/isr-decision.d.ts +11 -9
- package/dist/server/metadata-route-build-data.d.ts +4 -6
- package/dist/server/metadata-route-build-data.js +1 -1
- package/dist/server/metadata-route-cache-policy.d.ts +5 -0
- package/dist/server/metadata-route-cache-policy.js +6 -0
- package/dist/server/metadata-route-response.d.ts +28 -5
- package/dist/server/metadata-route-response.js +226 -11
- package/dist/server/metadata-routes.d.ts +52 -35
- package/dist/server/metadata-routes.js +1 -1
- package/dist/server/middleware-matcher-pattern.d.ts +20 -0
- package/dist/server/middleware-matcher-pattern.js +219 -0
- package/dist/server/middleware-matcher.d.ts +19 -12
- package/dist/server/middleware-matcher.js +56 -77
- package/dist/server/middleware-path-to-regexp.d.ts +13 -0
- package/dist/server/middleware-path-to-regexp.js +230 -0
- package/dist/server/middleware-response-headers.d.ts +3 -4
- package/dist/server/middleware-response-headers.js +4 -2
- package/dist/server/middleware-runtime.d.ts +19 -9
- package/dist/server/middleware-runtime.js +144 -36
- package/dist/server/middleware.d.ts +6 -20
- package/dist/server/middleware.js +4 -20
- package/dist/server/multi-stage.d.ts +118 -0
- package/dist/server/multi-stage.js +8 -0
- package/dist/server/navigation-planner.d.ts +28 -27
- package/dist/server/navigation-planner.js +57 -9
- package/dist/server/navigation-trace.d.ts +12 -12
- package/dist/server/navigation-trace.js +1 -0
- package/dist/server/next-error-digest.d.ts +4 -6
- package/dist/server/normalize-path.d.ts +5 -6
- package/dist/server/normalize-path.js +1 -1
- package/dist/server/open-redirect.d.ts +2 -3
- package/dist/server/opentelemetry-api.d.ts +59 -0
- package/dist/server/opentelemetry-api.js +53 -0
- package/dist/server/opentelemetry-tracing.d.ts +5 -0
- package/dist/server/opentelemetry-tracing.js +83 -0
- package/dist/server/operation-token.d.ts +11 -12
- package/dist/server/otel-tracer-extension.d.ts +7 -9
- package/dist/server/otel-tracer-extension.js +37 -36
- package/dist/server/pages-api-route.d.ts +9 -5
- package/dist/server/pages-api-route.js +51 -10
- package/dist/server/pages-asset-tags.d.ts +8 -7
- package/dist/server/pages-asset-tags.js +6 -4
- package/dist/server/pages-body-parser-config.d.ts +4 -5
- package/dist/server/pages-body-parser-config.js +4 -4
- package/dist/server/pages-client-assets.d.ts +4 -5
- package/dist/server/pages-data-route.d.ts +29 -21
- package/dist/server/pages-data-route.js +31 -18
- package/dist/server/pages-default-404.d.ts +3 -4
- package/dist/server/pages-dev-hydration.d.ts +3 -4
- package/dist/server/pages-dev-hydration.js +14 -5
- package/dist/server/pages-dev-module-url.d.ts +3 -4
- package/dist/server/pages-dev-stylesheets.d.ts +9 -0
- package/dist/server/pages-dev-stylesheets.js +150 -0
- package/dist/server/pages-document-asset-props.d.ts +25 -0
- package/dist/server/pages-document-asset-props.js +69 -0
- package/dist/server/pages-document-initial-props.d.ts +14 -11
- package/dist/server/pages-document-initial-props.js +4 -2
- package/dist/server/pages-execution-tracing.d.ts +40 -0
- package/dist/server/pages-execution-tracing.js +80 -0
- package/dist/server/pages-get-initial-props.d.ts +21 -9
- package/dist/server/pages-get-initial-props.js +17 -10
- package/dist/server/pages-i18n.d.ts +8 -14
- package/dist/server/pages-i18n.js +67 -18
- package/dist/server/pages-media-type.d.ts +4 -5
- package/dist/server/pages-node-compat.d.ts +21 -12
- package/dist/server/pages-node-compat.js +71 -18
- package/dist/server/pages-page-data.d.ts +86 -21
- package/dist/server/pages-page-data.js +447 -98
- package/dist/server/pages-page-handler.d.ts +80 -33
- package/dist/server/pages-page-handler.js +220 -69
- package/dist/server/pages-page-method.d.ts +2 -3
- package/dist/server/pages-page-response.d.ts +22 -21
- package/dist/server/pages-page-response.js +99 -81
- package/dist/server/pages-preview.d.ts +10 -11
- package/dist/server/pages-readiness.d.ts +5 -7
- package/dist/server/pages-readiness.js +4 -4
- package/dist/server/pages-request-pipeline.d.ts +43 -17
- package/dist/server/pages-request-pipeline.js +126 -47
- package/dist/server/pages-request-stage-entry.d.ts +23 -0
- package/dist/server/pages-request-stage-entry.js +314 -0
- package/dist/server/pages-response-stage-entry.d.ts +11 -0
- package/dist/server/pages-response-stage-entry.js +106 -0
- package/dist/server/pages-response-stage.d.ts +31 -0
- package/dist/server/pages-response-stage.js +49 -0
- package/dist/server/pages-revalidate.d.ts +3 -5
- package/dist/server/pages-revalidate.js +60 -9
- package/dist/server/pages-route-data-kind.d.ts +18 -0
- package/dist/server/pages-route-data-kind.js +11 -0
- package/dist/server/pages-router-entry.d.ts +1 -24
- package/dist/server/pages-router-entry.js +49 -99
- package/dist/server/pages-serializable-props.d.ts +3 -4
- package/dist/server/pregenerated-concrete-paths.d.ts +9 -7
- package/dist/server/pregenerated-concrete-paths.js +12 -6
- package/dist/server/prerender-cache-life-header.d.ts +10 -0
- package/dist/server/prerender-cache-life-header.js +18 -0
- package/dist/server/prerender-manifest.d.ts +21 -11
- package/dist/server/prerender-manifest.js +10 -4
- package/dist/server/prerender-route-params.d.ts +16 -10
- package/dist/server/prerender-route-params.js +20 -7
- package/dist/server/prerender-work-unit-setup.d.ts +4 -4
- package/dist/server/prerender-work-unit-setup.js +37 -14
- package/dist/server/prod-server.d.ts +28 -21
- package/dist/server/prod-server.js +450 -137
- package/dist/server/proxy-trust.d.ts +5 -7
- package/dist/server/request-log.d.ts +9 -14
- package/dist/server/request-pipeline.d.ts +40 -49
- package/dist/server/request-pipeline.js +60 -87
- package/dist/server/request-stage.d.ts +5 -0
- package/dist/server/request-stage.js +7 -0
- package/dist/server/request-tracing.d.ts +22 -0
- package/dist/server/request-tracing.js +180 -0
- package/dist/server/response-stage-cacheability.d.ts +31 -0
- package/dist/server/response-stage-cacheability.js +37 -0
- package/dist/server/response-stage-policy.d.ts +23 -0
- package/dist/server/response-stage-policy.js +89 -0
- package/dist/server/response-stage.d.ts +5 -0
- package/dist/server/response-stage.js +7 -0
- package/dist/server/response-start-tracing.d.ts +14 -0
- package/dist/server/response-start-tracing.js +80 -0
- package/dist/server/revalidation-host.d.ts +9 -0
- package/dist/server/revalidation-host.js +20 -0
- package/dist/server/revalidation-request.d.ts +8 -0
- package/dist/server/revalidation-request.js +37 -0
- package/dist/server/rsc-completion-metadata.d.ts +14 -0
- package/dist/server/rsc-completion-metadata.js +183 -0
- package/dist/server/rsc-stream-hints.d.ts +6 -7
- package/dist/server/rsc-stream-hints.js +122 -18
- package/dist/server/seed-cache.d.ts +8 -5
- package/dist/server/seed-cache.js +41 -12
- package/dist/server/server-action-not-found.d.ts +5 -6
- package/dist/server/server-globals.d.ts +2 -3
- package/dist/server/server-globals.js +13 -0
- package/dist/server/skip-cache-proof.d.ts +4 -5
- package/dist/server/socket-error-backstop.d.ts +5 -6
- package/dist/server/static-file-cache.d.ts +26 -13
- package/dist/server/static-file-cache.js +56 -30
- package/dist/server/static-file-signal.d.ts +16 -0
- package/dist/server/static-file-signal.js +82 -0
- package/dist/server/static-layout-client-reuse-proof.d.ts +4 -6
- package/dist/server/streaming-metadata.d.ts +2 -3
- package/dist/server/tracer.d.ts +5 -0
- package/dist/server/tracer.js +13 -0
- package/dist/server/worker-prerender-discovery.d.ts +18 -0
- package/dist/server/worker-prerender-discovery.js +55 -0
- package/dist/server/worker-revalidation-context.d.ts +11 -0
- package/dist/server/worker-revalidation-context.js +30 -0
- package/dist/server/worker-stages.d.ts +43 -0
- package/dist/server/worker-stages.js +25 -0
- package/dist/server/worker-utils.d.ts +6 -5
- package/dist/server/worker-utils.js +16 -7
- package/dist/server/workers-tracing.d.ts +17 -0
- package/dist/server/workers-tracing.js +27 -0
- package/dist/shims/amp.d.ts +3 -4
- package/dist/shims/app-router-scroll-state.d.ts +9 -9
- package/dist/shims/app-router-scroll-state.js +7 -2
- package/dist/shims/app-router-scroll.d.ts +4 -11
- package/dist/shims/app-router-scroll.js +2 -1
- package/dist/shims/app.d.ts +7 -12
- package/dist/shims/before-interactive-context.d.ts +10 -9
- package/dist/shims/cache-callable-runtime.d.ts +13 -0
- package/dist/shims/cache-callable-runtime.js +39 -0
- package/dist/shims/cache-for-request.d.ts +2 -3
- package/dist/shims/cache-handler.d.ts +33 -22
- package/dist/shims/cache-handler.js +74 -10
- package/dist/shims/cache-request-state.d.ts +62 -23
- package/dist/shims/cache-request-state.js +86 -1
- package/dist/shims/cache-runtime.d.ts +47 -17
- package/dist/shims/cache-runtime.js +273 -85
- package/dist/shims/cache.d.ts +17 -18
- package/dist/shims/cache.js +50 -22
- package/dist/shims/cacheability-classification.d.ts +98 -0
- package/dist/shims/cacheability-classification.js +149 -0
- package/dist/shims/cdn-cache-state.d.ts +13 -0
- package/dist/shims/cdn-cache-state.js +23 -0
- package/dist/shims/cdn-cache.d.ts +73 -17
- package/dist/shims/cdn-cache.js +41 -38
- package/dist/shims/client-hook-error.d.ts +3 -4
- package/dist/shims/client-locale.d.ts +2 -8
- package/dist/shims/client-only.d.ts +1 -1
- package/dist/shims/compat-router.d.ts +2 -4
- package/dist/shims/config.d.ts +3 -4
- package/dist/shims/constants.d.ts +73 -74
- package/dist/shims/default-global-error.d.ts +1 -4
- package/dist/shims/default-not-found.d.ts +2 -4
- package/dist/shims/document.d.ts +42 -84
- package/dist/shims/document.js +76 -53
- package/dist/shims/dynamic-preload-chunks.d.ts +2 -4
- package/dist/shims/dynamic-preload-chunks.js +12 -12
- package/dist/shims/dynamic.d.ts +9 -30
- package/dist/shims/dynamic.js +33 -14
- package/dist/shims/error-boundary-navigation.d.ts +3 -5
- package/dist/shims/error-boundary.d.ts +17 -43
- package/dist/shims/error-boundary.js +17 -11
- package/dist/shims/error.d.ts +6 -11
- package/dist/shims/error.js +2 -2
- package/dist/shims/error.react-server.d.ts +3 -4
- package/dist/shims/fetch-cache.d.ts +23 -21
- package/dist/shims/fetch-cache.js +194 -88
- package/dist/shims/font-google-base.d.ts +18 -12
- package/dist/shims/font-google-base.js +19 -9
- package/dist/shims/font-local.d.ts +13 -7
- package/dist/shims/font-local.js +44 -13
- package/dist/shims/font-utils.d.ts +14 -15
- package/dist/shims/form.d.ts +7 -5
- package/dist/shims/form.js +9 -6
- package/dist/shims/hash-scroll.d.ts +5 -6
- package/dist/shims/hash-scroll.js +2 -1
- package/dist/shims/head-state.d.ts +4 -6
- package/dist/shims/head.d.ts +39 -16
- package/dist/shims/head.js +76 -13
- package/dist/shims/headers.d.ts +83 -73
- package/dist/shims/headers.js +236 -80
- package/dist/shims/i18n-context.d.ts +5 -7
- package/dist/shims/i18n-state.d.ts +4 -6
- package/dist/shims/image-config.d.ts +5 -6
- package/dist/shims/image.d.ts +29 -40
- package/dist/shims/image.js +34 -24
- package/dist/shims/internal/als-registry.d.ts +32 -4
- package/dist/shims/internal/als-registry.js +50 -2
- package/dist/shims/internal/api-utils.d.ts +3 -4
- package/dist/shims/internal/app-page-props-cache-key.d.ts +3 -4
- package/dist/shims/internal/app-prefetch-fetch-queue.d.ts +18 -4
- package/dist/shims/internal/app-prefetch-fetch-queue.js +69 -7
- package/dist/shims/internal/app-prefetch-rsc-request.d.ts +13 -0
- package/dist/shims/internal/app-prefetch-rsc-request.js +12 -0
- package/dist/shims/internal/app-route-detection.d.ts +2 -3
- package/dist/shims/internal/app-route-prefetch-policy.d.ts +31 -0
- package/dist/shims/internal/app-route-prefetch-policy.js +65 -0
- package/dist/shims/internal/app-router-context.d.ts +9 -11
- package/dist/shims/internal/cookie-serialize.d.ts +15 -13
- package/dist/shims/internal/cookie-serialize.js +10 -7
- package/dist/shims/internal/hybrid-client-route-owner-direct.d.ts +6 -11
- package/dist/shims/internal/hybrid-client-route-owner-direct.js +29 -11
- package/dist/shims/internal/hybrid-client-route-owner.d.ts +3 -4
- package/dist/shims/internal/hybrid-client-route-owner.js +8 -7
- package/dist/shims/internal/interpolate-as.d.ts +19 -5
- package/dist/shims/internal/interpolate-as.js +31 -4
- package/dist/shims/internal/link-status-registry.d.ts +5 -6
- package/dist/shims/internal/make-hanging-promise.d.ts +8 -3
- package/dist/shims/internal/make-hanging-promise.js +13 -2
- package/dist/shims/internal/navigation-untracked.d.ts +2 -3
- package/dist/shims/internal/pages-data-fetch-dedup.d.ts +8 -9
- package/dist/shims/internal/pages-data-target.d.ts +26 -16
- package/dist/shims/internal/pages-data-target.js +23 -7
- package/dist/shims/internal/pages-data-url.d.ts +7 -6
- package/dist/shims/internal/pages-data-url.js +2 -1
- package/dist/shims/internal/pages-router-accessor.d.ts +3 -4
- package/dist/shims/internal/pages-router-components.d.ts +3 -4
- package/dist/shims/internal/route-pattern-for-warning.d.ts +3 -4
- package/dist/shims/internal/router-context.d.ts +2 -4
- package/dist/shims/internal/utils.d.ts +10 -11
- package/dist/shims/internal/work-unit-async-storage.d.ts +16 -14
- package/dist/shims/internal/work-unit-async-storage.js +2 -0
- package/dist/shims/layout-segment-context.d.ts +4 -9
- package/dist/shims/legacy-image.d.ts +3 -38
- package/dist/shims/legacy-image.js +6 -16
- package/dist/shims/link-prefetch.d.ts +9 -10
- package/dist/shims/link.d.ts +42 -41
- package/dist/shims/link.js +161 -178
- package/dist/shims/metadata.d.ts +25 -50
- package/dist/shims/metadata.js +129 -84
- package/dist/shims/navigation-context-accessors.d.ts +9 -0
- package/dist/shims/navigation-context-accessors.js +19 -0
- package/dist/shims/navigation-context-state.d.ts +21 -19
- package/dist/shims/navigation-errors.d.ts +18 -19
- package/dist/shims/navigation-state.d.ts +7 -7
- package/dist/shims/navigation.d.ts +147 -59
- package/dist/shims/navigation.js +496 -95
- package/dist/shims/navigation.react-server.d.ts +10 -9
- package/dist/shims/navigation.react-server.js +1 -1
- package/dist/shims/next-shims-augmentations.d.ts +1 -0
- package/dist/shims/next-shims-public.d.ts +1 -0
- package/dist/shims/offline.d.ts +2 -3
- package/dist/shims/og.d.ts +2 -3
- package/dist/shims/pages-router-runtime.d.ts +4 -5
- package/dist/shims/ppr-fallback-shell.d.ts +13 -14
- package/dist/shims/public-shim-map.json.js +103 -0
- package/dist/shims/readonly-url-search-params.d.ts +5 -6
- package/dist/shims/readonly-url-search-params.js +3 -3
- package/dist/shims/request-context.d.ts +15 -6
- package/dist/shims/request-state-types.d.ts +3 -2
- package/dist/shims/root-params.d.ts +15 -14
- package/dist/shims/root-params.js +7 -1
- package/dist/shims/router-state.d.ts +5 -6
- package/dist/shims/router.d.ts +100 -45
- package/dist/shims/router.js +464 -144
- package/dist/shims/script-nonce-context.d.ts +5 -7
- package/dist/shims/script.d.ts +30 -22
- package/dist/shims/script.js +16 -11
- package/dist/shims/server-only.d.ts +1 -1
- package/dist/shims/server.d.ts +66 -76
- package/dist/shims/server.js +208 -84
- package/dist/shims/slot.d.ts +30 -18
- package/dist/shims/slot.js +107 -21
- package/dist/shims/streamed-icons.d.ts +6 -0
- package/dist/shims/streamed-icons.js +33 -0
- package/dist/shims/thenable-params.d.ts +4 -5
- package/dist/shims/unified-request-context.d.ts +57 -12
- package/dist/shims/unified-request-context.js +118 -1
- package/dist/shims/unrecognized-action-error.d.ts +3 -4
- package/dist/shims/url-safety.d.ts +5 -6
- package/dist/shims/url-safety.js +2 -2
- package/dist/shims/url-utils.d.ts +18 -12
- package/dist/shims/url-utils.js +10 -1
- package/dist/shims/use-merged-ref.d.ts +2 -4
- package/dist/shims/user-agent.d.ts +31 -0
- package/dist/shims/user-agent.js +16 -0
- package/dist/shims/web-vitals.d.ts +2 -3
- package/dist/typegen.d.ts +7 -3
- package/dist/typegen.js +75 -14
- package/dist/utils/asset-prefix.d.ts +7 -8
- package/dist/utils/base-path.d.ts +5 -6
- package/dist/utils/built-asset-url.d.ts +2 -3
- package/dist/utils/built-asset-url.js +4 -2
- package/dist/utils/cache-control-metadata.d.ts +15 -3
- package/dist/utils/cache-control-metadata.js +21 -1
- package/dist/utils/client-build-manifest.d.ts +6 -8
- package/dist/utils/client-build-manifest.js +2 -1
- package/dist/utils/client-entry-manifest.d.ts +6 -7
- package/dist/utils/client-runtime-metadata.d.ts +2 -3
- package/dist/utils/client-runtime-metadata.js +2 -1
- package/dist/utils/commonjs-loader.d.ts +4 -5
- package/dist/utils/compare.d.ts +2 -3
- package/dist/utils/deployment-id.d.ts +6 -7
- package/dist/utils/dev-error-recovery-event.d.ts +2 -3
- package/dist/utils/dev-stack-sourcemap-endpoint.d.ts +2 -3
- package/dist/utils/domain-locale.d.ts +9 -14
- package/dist/utils/encode-cache-tag.d.ts +4 -5
- package/dist/utils/encode-cache-tag.js +1 -1
- package/dist/utils/error-cause.d.ts +2 -3
- package/dist/utils/external-url.d.ts +4 -0
- package/dist/utils/external-url.js +7 -0
- package/dist/utils/has-trailing-comma.d.ts +3 -4
- package/dist/utils/hash.d.ts +3 -4
- package/dist/utils/html-limited-bots.d.ts +3 -4
- package/dist/utils/html-limited-bots.js +1 -1
- package/dist/utils/lazy-chunks.d.ts +8 -9
- package/dist/utils/lazy-chunks.js +3 -3
- package/dist/utils/manifest-paths.d.ts +5 -6
- package/dist/utils/mdx-scan.d.ts +3 -4
- package/dist/utils/middleware-request-headers.d.ts +21 -8
- package/dist/utils/middleware-request-headers.js +37 -23
- package/dist/utils/navigation-signal.d.ts +3 -3
- package/dist/utils/navigation-signal.js +16 -1
- package/dist/utils/number.d.ts +2 -3
- package/dist/utils/package-name.d.ts +10 -0
- package/dist/utils/package-name.js +18 -0
- package/dist/utils/parse-cookie.d.ts +4 -5
- package/dist/utils/path.d.ts +11 -5
- package/dist/utils/path.js +21 -1
- package/dist/utils/plugin-options.d.ts +2 -3
- package/dist/utils/precompressed-variant.d.ts +8 -0
- package/dist/utils/precompressed-variant.js +15 -0
- package/dist/utils/prerender-output-paths.d.ts +10 -9
- package/dist/utils/prerender-output-paths.js +22 -10
- package/dist/utils/project.d.ts +29 -25
- package/dist/utils/promise.d.ts +2 -3
- package/dist/utils/protocol-headers.d.ts +17 -12
- package/dist/utils/protocol-headers.js +7 -1
- package/dist/utils/public-file-path.d.ts +4 -0
- package/dist/utils/public-file-path.js +12 -0
- package/dist/utils/public-routes.d.ts +2 -3
- package/dist/utils/public-routes.js +6 -5
- package/dist/utils/query.d.ts +8 -9
- package/dist/utils/react-compiler-support.d.ts +19 -0
- package/dist/utils/react-compiler-support.js +29 -0
- package/dist/utils/react-version.d.ts +2 -3
- package/dist/utils/record.d.ts +2 -3
- package/dist/utils/redirect-digest.d.ts +3 -4
- package/dist/utils/regex-safety.d.ts +7 -0
- package/dist/utils/regex-safety.js +737 -0
- package/dist/utils/regex.d.ts +2 -3
- package/dist/utils/safe-json-file.d.ts +2 -3
- package/dist/utils/sorted-array.d.ts +2 -3
- package/dist/utils/text-stream.d.ts +3 -4
- package/dist/utils/vinext-root.d.ts +2 -3
- package/dist/utils/virtual-module.d.ts +3 -4
- package/dist/utils/vite-version.d.ts +5 -6
- package/next-package.json +4 -0
- package/package.json +66 -9
package/README.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Run Next.js applications on Vite, with Cloudflare Workers as the primary deployment target.
|
|
4
4
|
|
|
5
|
+
**Website:** [vinext.dev](https://vinext.dev)
|
|
6
|
+
|
|
7
|
+
**Documentation:** [vinext.dev/docs](https://vinext.dev/docs)
|
|
8
|
+
|
|
5
9
|
> **Read the announcement:** [How we rebuilt Next.js with AI in one week](https://blog.cloudflare.com/vinext/)
|
|
6
10
|
|
|
7
11
|
> **Under active development.** vinext supports substantial Next.js applications today, but it is not yet a drop-in replacement for every application or production workload. Expect compatibility gaps, especially in newer App Router features, and evaluate it against your own application before adopting it.
|
|
@@ -116,7 +120,7 @@ Your existing `pages/`, `app/`, `next.config.js`, and `public/` directories work
|
|
|
116
120
|
|
|
117
121
|
Options: `-p / --port <port>`, `-H / --hostname <host>`, `--turbopack` (accepted, no-op).
|
|
118
122
|
|
|
119
|
-
`@vinext/cloudflare deploy` options: `--preview`, `--env <name>`, `--name <name>`, `--skip-build`, `--dry-run`, `--experimental-
|
|
123
|
+
`@vinext/cloudflare deploy` options: `--preview`, `--env <name>`, `--name <name>`, `--skip-build`, `--dry-run`, `--experimental-traffic-aware-warm-cache`.
|
|
120
124
|
|
|
121
125
|
`vinext init` prompts for a deployment target, defaulting to Cloudflare. Agents must ask the
|
|
122
126
|
user which target they want, then pass `--platform=cloudflare` or `--platform=node`.
|
|
@@ -206,7 +210,10 @@ vinext works everywhere. It natively supports Cloudflare Workers (with `npx @vin
|
|
|
206
210
|
vinext is a Vite plugin that reimplements the public Next.js API — routing, server rendering, `next/*` module imports, the CLI — so you can run Next.js applications on Vite instead of the Next.js compiler toolchain. It can be deployed anywhere: Cloudflare Workers is the first natively supported target, with other platforms available via Nitro. Native adapters for more platforms are [planned](https://github.com/cloudflare/vinext/issues/80).
|
|
207
211
|
|
|
208
212
|
**Is this a fork of Next.js?**
|
|
209
|
-
No. vinext is an alternative implementation of the Next.js API surface built on Vite.
|
|
213
|
+
No. vinext is an alternative implementation of the Next.js API surface built on Vite. The core is written from scratch. The goal is not to create a competing framework or add features beyond what Next.js offers; it is to provide the same well-defined API surface on Vite's toolchain.
|
|
214
|
+
|
|
215
|
+
**Does vinext require Next.js to be installed?**
|
|
216
|
+
No. vinext ships fallback declarations for the supported `next` and `next/*` APIs, so applications can run and type-check without the `next` package. If both packages are installed, vinext keeps using Next.js's authoritative types and adds only its own extensions. Compatibility features that consume Next.js internals, such as `styled-jsx`, may still require a matching Next.js installation when used.
|
|
210
217
|
|
|
211
218
|
**How is this different from OpenNext?**
|
|
212
219
|
[OpenNext](https://opennext.js.org/) adapts the _output_ of a standard `next build` to run on various platforms. Because it builds on Next.js's own output, it inherits broad API coverage and has been well-tested for much longer. vinext takes a different approach: it reimplements the Next.js APIs on Vite from scratch, which means faster builds and smaller bundles, but less coverage of the long tail of Next.js features. If you need a mature, well-tested way to run Next.js outside Vercel, OpenNext is the safer choice. If you want a lighter Vite-based toolchain and do not need every Next.js API, vinext may be a good fit.
|
|
@@ -326,40 +333,34 @@ For TypeScript types, generate them with `wrangler types` and the `env` import w
|
|
|
326
333
|
|
|
327
334
|
> **Note:** You do not need `getPlatformProxy()`, a custom worker entry with `fetch(request, env)`, or any other workaround. `cloudflare:workers` is the recommended way to access bindings in vinext.
|
|
328
335
|
|
|
329
|
-
#### Traffic-aware
|
|
336
|
+
#### Traffic-aware pre-warming (experimental)
|
|
330
337
|
|
|
331
|
-
|
|
338
|
+
Traffic-aware warming queries Cloudflare zone analytics at deploy time to select the routes that actually get traffic. Those routes then go through vinext's standard staged CDN pre-warming flow, including route resolution, cacheability checks, and promotion.
|
|
332
339
|
|
|
333
340
|
```bash
|
|
334
|
-
npx @vinext/cloudflare deploy --experimental-
|
|
335
|
-
vp exec vinext-cloudflare deploy --experimental-
|
|
336
|
-
npx @vinext/cloudflare deploy --experimental-
|
|
337
|
-
npx @vinext/cloudflare deploy --experimental-
|
|
338
|
-
npx @vinext/cloudflare deploy --experimental-
|
|
341
|
+
npx @vinext/cloudflare deploy --experimental-traffic-aware-warm-cache # Pre-warm routes covering 90% of traffic
|
|
342
|
+
vp exec vinext-cloudflare deploy --experimental-traffic-aware-warm-cache # Same, with Vite+
|
|
343
|
+
npx @vinext/cloudflare deploy --experimental-traffic-aware-warm-cache --traffic-aware-coverage 95 # More aggressive coverage
|
|
344
|
+
npx @vinext/cloudflare deploy --experimental-traffic-aware-warm-cache --traffic-aware-limit 500 # Cap at 500 routes
|
|
345
|
+
npx @vinext/cloudflare deploy --experimental-traffic-aware-warm-cache --traffic-aware-window 48 # Use 48h of analytics
|
|
339
346
|
```
|
|
340
347
|
|
|
341
348
|
Requires a custom domain (zone analytics are unavailable on `*.workers.dev`) and `CLOUDFLARE_API_TOKEN` with Zone.Analytics read permission.
|
|
342
349
|
|
|
350
|
+
The previous `--experimental-tpr` and `--tpr-*` names remain supported as aliases.
|
|
351
|
+
|
|
343
352
|
#### Custom Vite configuration
|
|
344
353
|
|
|
345
|
-
If you need to customize the Vite config, create a `vite.config.ts`. vinext will merge its config with yours.
|
|
354
|
+
If you need to customize the Vite config, create a `vite.config.ts`. vinext will merge its config with yours. For Cloudflare Workers deployment with the App Router, configure `@cloudflare/vite-plugin` so the RSC environment runs in workerd:
|
|
346
355
|
|
|
347
356
|
```ts
|
|
348
357
|
import { defineConfig } from "vite";
|
|
349
358
|
import vinext from "vinext";
|
|
350
|
-
import rsc from "@vitejs/plugin-rsc";
|
|
351
359
|
import { cloudflare } from "@cloudflare/vite-plugin";
|
|
352
360
|
|
|
353
361
|
export default defineConfig({
|
|
354
362
|
plugins: [
|
|
355
363
|
vinext(),
|
|
356
|
-
rsc({
|
|
357
|
-
entries: {
|
|
358
|
-
rsc: "virtual:vinext-rsc-entry",
|
|
359
|
-
ssr: "virtual:vinext-app-ssr-entry",
|
|
360
|
-
client: "virtual:vinext-app-browser-entry",
|
|
361
|
-
},
|
|
362
|
-
}),
|
|
363
364
|
cloudflare({
|
|
364
365
|
viteEnvironment: { name: "rsc", childEnvironments: ["ssr"] },
|
|
365
366
|
}),
|
|
@@ -367,6 +368,54 @@ export default defineConfig({
|
|
|
367
368
|
});
|
|
368
369
|
```
|
|
369
370
|
|
|
371
|
+
> **Do not register `@vitejs/plugin-rsc` yourself.** It is an optional peer dependency, so it must be
|
|
372
|
+
> _installed_ in your project, but vinext auto-registers it whenever an `app/` directory is detected.
|
|
373
|
+
> Adding an explicit `rsc()` call fails the build with `[vinext] Duplicate @vitejs/plugin-rsc detected`.
|
|
374
|
+
> Pass `rsc: false` to `vinext()` only if you want to own that registration.
|
|
375
|
+
|
|
376
|
+
#### Module Federation (client-side)
|
|
377
|
+
|
|
378
|
+
For client-side Module Federation, configure React and React DOM as singleton shared modules in both the host and remotes:
|
|
379
|
+
|
|
380
|
+
```ts
|
|
381
|
+
import { federation } from "@module-federation/vite";
|
|
382
|
+
import { defineConfig } from "vite";
|
|
383
|
+
import vinext from "vinext";
|
|
384
|
+
|
|
385
|
+
export default defineConfig({
|
|
386
|
+
plugins: [
|
|
387
|
+
federation({
|
|
388
|
+
name: "host",
|
|
389
|
+
shared: {
|
|
390
|
+
react: { singleton: true },
|
|
391
|
+
"react/": { singleton: true },
|
|
392
|
+
"react-dom": { singleton: true },
|
|
393
|
+
"react-dom/": { singleton: true },
|
|
394
|
+
},
|
|
395
|
+
}),
|
|
396
|
+
vinext(),
|
|
397
|
+
],
|
|
398
|
+
});
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
In a remote client component, use `getVinextReact()` before reading React hooks. vinext registers the host's browser React instance before application modules execute, and the first registration remains stable across remote evaluation and HMR:
|
|
402
|
+
|
|
403
|
+
```tsx
|
|
404
|
+
"use client";
|
|
405
|
+
|
|
406
|
+
import * as React from "react";
|
|
407
|
+
import { getVinextReact } from "vinext/client";
|
|
408
|
+
|
|
409
|
+
const { useState } = getVinextReact(React);
|
|
410
|
+
|
|
411
|
+
export function RemoteCounter() {
|
|
412
|
+
const [count, setCount] = useState(0);
|
|
413
|
+
return <button onClick={() => setCount((value) => value + 1)}>{count}</button>;
|
|
414
|
+
}
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
This bridge is browser-only. It does not provide App Router Module Federation SSR or transparently replace React imports inside third-party packages; compatible React versions remain the responsibility of the Module Federation `shared` configuration.
|
|
418
|
+
|
|
370
419
|
See the [examples](#live-examples) for complete working configurations.
|
|
371
420
|
|
|
372
421
|
### Other platforms (via Nitro)
|
|
@@ -472,13 +521,14 @@ These are deployed to Cloudflare Workers and updated on every push to `main`:
|
|
|
472
521
|
| Nextra Docs | Nextra docs site (MDX, App Router) | [nextra-docs-template.vinext.workers.dev](https://nextra-docs-template.vinext.workers.dev) |
|
|
473
522
|
| App Router (minimal) | Minimal App Router on Workers | [app-router-cloudflare.vinext.workers.dev](https://app-router-cloudflare.vinext.workers.dev) |
|
|
474
523
|
| Pages Router (minimal) | Minimal Pages Router on Workers | [pages-router-cloudflare.vinext.workers.dev](https://pages-router-cloudflare.vinext.workers.dev) |
|
|
524
|
+
| Static export | [Hybrid App/Pages Router site](examples/static-export) served as assets only | [static-export.vinext.workers.dev](https://static-export.vinext.workers.dev) |
|
|
475
525
|
| RealWorld API | REST API routes example | [realworld-api-rest.vinext.workers.dev](https://realworld-api-rest.vinext.workers.dev) |
|
|
476
|
-
| Benchmarks Dashboard | Build performance tracking over time (D1-backed) | [vinext
|
|
526
|
+
| Benchmarks Dashboard | Build performance tracking over time (D1-backed) | [vinext.dev/benchmarks](https://vinext.dev/benchmarks) |
|
|
477
527
|
| App Router + Nitro | App Router deployed via Nitro (multi-platform) | [examples/app-router-nitro](examples/app-router-nitro) |
|
|
478
528
|
|
|
479
529
|
## API coverage
|
|
480
530
|
|
|
481
|
-
~94% of the Next.js 16 API surface has full or partial support. The remaining gaps are intentional stubs for deprecated features
|
|
531
|
+
~94% of the Next.js 16 API surface has full or partial support. The remaining gaps are intentional stubs for deprecated features, plus Partial Prerendering and Cache Components. Next.js 16 reworked PPR into `"use cache"`; vinext implements that directive for file-level and function-level caching, but full `cacheComponents` behavior is still incomplete — see [Known gaps we're working on](#known-gaps-were-working-on).
|
|
482
532
|
|
|
483
533
|
> ✅ = full implementation | 🟡 = partial (runtime behavior correct, some build-time optimizations missing) | ⬜ = intentional stub/no-op
|
|
484
534
|
|
|
@@ -548,7 +598,7 @@ Every `next/*` import is shimmed to a Vite-compatible implementation.
|
|
|
548
598
|
| Standalone output (`output: 'standalone'`) | ✅ | Generates `dist/standalone` with `server.js`, build artifacts, and runtime deps |
|
|
549
599
|
| `connection()` | ✅ | Forces dynamic rendering |
|
|
550
600
|
| `"use cache"` directive | ✅ | File-level and function-level. `cacheLife()` profiles, `cacheTag()`, stale-while-revalidate |
|
|
551
|
-
| `instrumentation.ts` | ✅ | `register()` and
|
|
601
|
+
| `instrumentation.ts` | ✅ | `register()`, `onRequestError()`, and [framework tracing](docs/tracing.mdx) |
|
|
552
602
|
| Route segment config | 🟡 | `revalidate`, `dynamic`, `dynamicParams`. `runtime` and `preferredRegion` are ignored |
|
|
553
603
|
|
|
554
604
|
### Configuration
|
|
@@ -561,6 +611,33 @@ Every `next/*` import is shimmed to a Vite-compatible implementation.
|
|
|
561
611
|
| `images` config | 🟡 | Parsed but not used for optimization |
|
|
562
612
|
| `experimental.optimizePackageImports` | ✅ | Rewrites barrel imports to direct sub-module imports in RSC/SSR environments. A default set (lucide-react, date-fns, radix-ui, antd, MUI, and others) are always optimized. Add package names here to extend the list. |
|
|
563
613
|
| `vinext({ nextConfig })` | ✅ | Inline Next-style config from `vite.config.*`. Supports object-form and function-form config. When provided, this overrides root `next.config.*`. |
|
|
614
|
+
| `vinext({ react: { compiler: true } })` | ✅ | React Compiler auto memoization. Needs `@vitejs/plugin-react` 6.1+ and the optional `oxc-transform-react` package. |
|
|
615
|
+
|
|
616
|
+
### React Compiler
|
|
617
|
+
|
|
618
|
+
vinext auto-registers `@vitejs/plugin-react`, so the React Compiler is enabled through the same `react` option:
|
|
619
|
+
|
|
620
|
+
```ts
|
|
621
|
+
import { defineConfig } from "vite";
|
|
622
|
+
import vinext from "vinext";
|
|
623
|
+
|
|
624
|
+
export default defineConfig({
|
|
625
|
+
plugins: [vinext({ react: { compiler: true } })],
|
|
626
|
+
});
|
|
627
|
+
```
|
|
628
|
+
|
|
629
|
+
The transform itself ships separately, so install it alongside:
|
|
630
|
+
|
|
631
|
+
```bash
|
|
632
|
+
npm install -D oxc-transform-react
|
|
633
|
+
```
|
|
634
|
+
|
|
635
|
+
This requires `@vitejs/plugin-react` 6.1.0 or newer. Older versions accept the option and drop it, so vinext fails with an actionable error instead of leaving the compiler silently disabled. The compiler runs on the client environment only.
|
|
636
|
+
|
|
637
|
+
One caveat: modules whose JSX is lowered earlier in the pipeline are not memoized. Those build and behave correctly, they just miss auto memoization:
|
|
638
|
+
|
|
639
|
+
- JSX in plain `.js` files, which `vinext:jsx-in-js` compiles first so the compiler can parse them at all. Rename to `.jsx` or `.tsx` to get memoization.
|
|
640
|
+
- Components using `<style jsx>`, which `vinext:styled-jsx` compiles through the Next.js SWC transform before the compiler runs.
|
|
564
641
|
|
|
565
642
|
### Environment variable loading (`.env*`)
|
|
566
643
|
|
|
@@ -600,16 +677,21 @@ The cache is pluggable. The default `MemoryCacheHandler` works out of the box. S
|
|
|
600
677
|
Instead of wiring up cache handlers imperatively from a worker entry, you can declare them in the `vinext()` plugin config. The `@vinext/cloudflare` package ships Cloudflare adapters for this:
|
|
601
678
|
|
|
602
679
|
- **`kvDataAdapter()`** (`@vinext/cloudflare/cache/kv-data-adapter`) — backs the `"use cache"` data cache with a Workers KV namespace.
|
|
680
|
+
- **`cdnAdapter()`** (`@vinext/cloudflare/cache/cdn-adapter`) — serves page-level ISR from the Cloudflare Workers Cache (`ctx.cache`) instead of from the origin.
|
|
681
|
+
|
|
682
|
+
The two fill different slots and can be used together:
|
|
603
683
|
|
|
604
684
|
```ts
|
|
605
685
|
import { defineConfig } from "vite";
|
|
606
686
|
import vinext from "vinext";
|
|
687
|
+
import { cdnAdapter } from "@vinext/cloudflare/cache/cdn-adapter";
|
|
607
688
|
import { kvDataAdapter } from "@vinext/cloudflare/cache/kv-data-adapter";
|
|
608
689
|
|
|
609
690
|
export default defineConfig({
|
|
610
691
|
plugins: [
|
|
611
692
|
vinext({
|
|
612
693
|
cache: {
|
|
694
|
+
cdn: cdnAdapter(),
|
|
613
695
|
data: kvDataAdapter(),
|
|
614
696
|
},
|
|
615
697
|
}),
|
|
@@ -625,9 +707,37 @@ The KV data adapter reads `env[binding]` at runtime, so add the matching KV name
|
|
|
625
707
|
}
|
|
626
708
|
```
|
|
627
709
|
|
|
628
|
-
`binding` defaults to `VINEXT_KV_CACHE`, so `kvDataAdapter()` with no options works as long as that's your binding name. Other options: `appPrefix` (namespace cache keys to isolate multiple apps in one KV namespace), `ttlSeconds` (default KV `expirationTtl`, default 30 days),
|
|
710
|
+
`binding` defaults to `VINEXT_KV_CACHE`, so `kvDataAdapter()` with no options works as long as that's your binding name. Other options: `appPrefix` (namespace cache keys to isolate multiple apps in one KV namespace), `ttlSeconds` (default KV `expirationTtl`, default 30 days), `tagCacheTtlMs` (in-memory tag-invalidation cache TTL, default 5s), and `entryCacheTtlSeconds` (optional KV edge-cache TTL for entry reads; tag markers keep KV's default).
|
|
629
711
|
|
|
630
|
-
|
|
712
|
+
When `cdnAdapter()` is used in a Cloudflare build, vinext emits two Worker
|
|
713
|
+
entrypoints and configures Workers Cache only on the response entrypoint. The
|
|
714
|
+
default entrypoint keeps caching disabled so middleware and request-time routing
|
|
715
|
+
run on every request. Do not enable Workers Cache on the default entrypoint in
|
|
716
|
+
your source `wrangler.jsonc`; the generated `dist/server/wrangler.json` contains
|
|
717
|
+
the per-entrypoint cache settings and version metadata binding used for staged
|
|
718
|
+
discovery and warming.
|
|
719
|
+
|
|
720
|
+
The generated version metadata binding lets staged discovery and warming verify
|
|
721
|
+
the uploaded Worker version. Pass `versionMetadataBinding` to `cdnAdapter()`
|
|
722
|
+
only when the deployment needs a custom binding name.
|
|
723
|
+
|
|
724
|
+
`vinext-cloudflare deploy --experimental-warm-cdn-cache` performs the two-stage
|
|
725
|
+
upload and makes one final cache-fill request per admitted identity by default.
|
|
726
|
+
Add `--warm-cdn-certify` only to opt into a second, header-only request that
|
|
727
|
+
must prove every planned entry reusable before promotion.
|
|
728
|
+
|
|
729
|
+
While the data adapter can store entries and serve HIT/STALE itself, the CDN adapter delegates serving to Cloudflare's edge: the origin renders fresh responses and tags them with `Cache-Tag`, and `revalidateTag()` / `revalidatePath()` purge the edge through `ctx.cache.purge({ tags })`. See [examples/response-store-demo](examples/response-store-demo) for the Workers Response Store adapter.
|
|
730
|
+
|
|
731
|
+
The response entrypoint adds a transport-only digest of the complete stage
|
|
732
|
+
identity to its Workers Cache URL. That internal key is independent of zone
|
|
733
|
+
Cache Rules and prevents distinct query, representation, rewrite, or
|
|
734
|
+
interception identities from colliding.
|
|
735
|
+
|
|
736
|
+
Adapter declarations do not access the Workers runtime, so nothing throws at
|
|
737
|
+
config-evaluation or dev time when bindings are unavailable. Builders may also
|
|
738
|
+
provide platform-specific output hooks; `cdnAdapter()` uses one to configure
|
|
739
|
+
the Cloudflare entrypoints after the application build. Runtime adapters (and
|
|
740
|
+
their `env` binding lookups) are instantiated lazily on the first request.
|
|
631
741
|
|
|
632
742
|
Registration is wired into **every router and runtime** — App Router and Pages Router, on Cloudflare Workers as well as the Node.js server (`vinext start`) and dev. It self-guards (instantiated once per isolate) and is resilient: if an adapter can't initialize on a given runtime (e.g. a KV binding doesn't exist on the Node server), vinext logs a warning and falls back to the default handler instead of failing requests.
|
|
633
743
|
|
|
@@ -638,9 +748,7 @@ vinext({
|
|
|
638
748
|
cache: {
|
|
639
749
|
data: {
|
|
640
750
|
adapter: require.resolve("./my-adapter.js"),
|
|
641
|
-
options: {
|
|
642
|
-
/* … */
|
|
643
|
-
},
|
|
751
|
+
options: {/* … */},
|
|
644
752
|
},
|
|
645
753
|
},
|
|
646
754
|
});
|
|
@@ -672,7 +780,7 @@ We measure three things:
|
|
|
672
780
|
- **Client bundle size** — gzipped output of each build.
|
|
673
781
|
- **Dev server cold start** — 10 runs, randomized execution order. Vite's dependency optimizer cache is cleared before each run.
|
|
674
782
|
|
|
675
|
-
Benchmarks run on GitHub CI runners (2-core Ubuntu) on every merge to `main`. See the launch numbers in the [announcement blog post](https://blog.cloudflare.com/vinext/) and the latest results at **[vinext
|
|
783
|
+
Benchmarks run on GitHub CI runners (2-core Ubuntu) on every merge to `main`. See the launch numbers in the [announcement blog post](https://blog.cloudflare.com/vinext/) and the latest results at **[vinext.dev/benchmarks](https://vinext.dev/benchmarks)**.
|
|
676
784
|
|
|
677
785
|
<details>
|
|
678
786
|
<summary>Why the bundle size difference?</summary>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Third-party licenses
|
|
2
|
+
|
|
3
|
+
## ua-parser-js
|
|
4
|
+
|
|
5
|
+
MIT License
|
|
6
|
+
|
|
7
|
+
Copyright (c) 2012-2021 Faisal Salman <f@faisalman.com>
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
SOFTWARE.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
|
+
key = keys[i];
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
21
|
+
value: mod,
|
|
22
|
+
enumerable: true
|
|
23
|
+
}) : target, mod));
|
|
24
|
+
//#endregion
|
|
25
|
+
export { __commonJSMin, __toESM };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { AppRoute } from "../routing/app-route-graph.js";
|
|
2
|
+
import { Rollup } from "vite";
|
|
3
|
+
import { RscPluginManager } from "@vitejs/plugin-rsc";
|
|
4
|
+
//#region src/build/action-owner-manifest.d.ts
|
|
5
|
+
type ActionOwnerRoute = Pick<AppRoute, "errorPath" | "errorPaths" | "forbiddenPath" | "forbiddenPaths" | "layoutErrorPaths" | "layouts" | "loadingPath" | "loadingPaths" | "notFoundPath" | "notFoundPaths" | "pagePath" | "parallelSlots" | "pattern" | "siblingIntercepts" | "templates" | "unauthorizedPath" | "unauthorizedPaths">;
|
|
6
|
+
export type ActionOwnerRouteReachability = Map<string, {
|
|
7
|
+
clientReferenceImportIds: Set<string>;
|
|
8
|
+
serverReferenceIds: Set<string>;
|
|
9
|
+
}>;
|
|
10
|
+
type ActionOwnerModuleInfo = Pick<Rollup.ModuleInfo, "dynamicallyImportedIds" | "importedIds">;
|
|
11
|
+
type ActionOwnerReferenceMaps = {
|
|
12
|
+
clientReferenceMetaMap: RscPluginManager["clientReferenceMetaMap"];
|
|
13
|
+
serverReferenceMetaMap: RscPluginManager["serverReferences"]["metaMap"];
|
|
14
|
+
};
|
|
15
|
+
export declare function actionOwnerRouteEntryIds(route: ActionOwnerRoute): string[];
|
|
16
|
+
export declare function collectReachableActionReferences(options: {
|
|
17
|
+
canonicalizeModuleId?: (id: string) => string;
|
|
18
|
+
getModuleInfo: (id: string) => ActionOwnerModuleInfo | null;
|
|
19
|
+
roots: readonly string[];
|
|
20
|
+
} & ActionOwnerReferenceMaps): {
|
|
21
|
+
clientReferenceImportIds: Set<string>;
|
|
22
|
+
serverReferenceIds: Set<string>;
|
|
23
|
+
};
|
|
24
|
+
export declare function collectRscActionReachability(options: {
|
|
25
|
+
canonicalizeModuleId?: (id: string) => string;
|
|
26
|
+
getModuleInfo: (id: string) => ActionOwnerModuleInfo | null;
|
|
27
|
+
routes: readonly ActionOwnerRoute[];
|
|
28
|
+
sharedRoots?: readonly string[];
|
|
29
|
+
} & ActionOwnerReferenceMaps): ActionOwnerRouteReachability;
|
|
30
|
+
export declare function resolveClientReferenceImportIds(options: {
|
|
31
|
+
canonicalizeModuleId?: (id: string) => string;
|
|
32
|
+
resolveId: (id: string) => Promise<string | null>;
|
|
33
|
+
routeReachability: ActionOwnerRouteReachability;
|
|
34
|
+
}): Promise<void>;
|
|
35
|
+
export declare function addClientActionReachability(options: {
|
|
36
|
+
canonicalizeModuleId?: (id: string) => string;
|
|
37
|
+
getModuleInfo: (id: string) => ActionOwnerModuleInfo | null;
|
|
38
|
+
routeReachability: ActionOwnerRouteReachability;
|
|
39
|
+
} & ActionOwnerReferenceMaps): void;
|
|
40
|
+
export declare function buildActionOwnerManifest(routeReachability: ActionOwnerRouteReachability): Record<string, string[]>;
|
|
41
|
+
//#endregion
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
//#region src/build/action-owner-manifest.ts
|
|
2
|
+
function actionOwnerRouteEntryIds(route) {
|
|
3
|
+
return [
|
|
4
|
+
route.pagePath,
|
|
5
|
+
...route.layouts,
|
|
6
|
+
...route.templates,
|
|
7
|
+
route.loadingPath,
|
|
8
|
+
...route.loadingPaths ?? [],
|
|
9
|
+
route.errorPath,
|
|
10
|
+
...route.layoutErrorPaths ?? [],
|
|
11
|
+
...route.errorPaths ?? [],
|
|
12
|
+
route.notFoundPath,
|
|
13
|
+
...route.notFoundPaths ?? [],
|
|
14
|
+
route.forbiddenPath,
|
|
15
|
+
...route.forbiddenPaths ?? [],
|
|
16
|
+
route.unauthorizedPath,
|
|
17
|
+
...route.unauthorizedPaths ?? [],
|
|
18
|
+
...route.parallelSlots.flatMap((slot) => [
|
|
19
|
+
slot.pagePath,
|
|
20
|
+
slot.defaultPath,
|
|
21
|
+
slot.layoutPath,
|
|
22
|
+
...slot.configLayoutPaths ?? [],
|
|
23
|
+
slot.loadingPath,
|
|
24
|
+
...slot.loadingPaths ?? [],
|
|
25
|
+
slot.errorPath,
|
|
26
|
+
slot.notFoundPath,
|
|
27
|
+
...slot.interceptingRoutes.flatMap((intercept) => [
|
|
28
|
+
intercept.pagePath,
|
|
29
|
+
...intercept.layoutPaths,
|
|
30
|
+
...intercept.loadingPaths ?? [],
|
|
31
|
+
intercept.notFoundPath
|
|
32
|
+
])
|
|
33
|
+
]),
|
|
34
|
+
...route.siblingIntercepts.flatMap((intercept) => [
|
|
35
|
+
intercept.pagePath,
|
|
36
|
+
...intercept.layoutPaths,
|
|
37
|
+
...intercept.loadingPaths ?? [],
|
|
38
|
+
intercept.notFoundPath
|
|
39
|
+
])
|
|
40
|
+
].filter((value) => typeof value === "string");
|
|
41
|
+
}
|
|
42
|
+
function collectReachableActionReferences(options) {
|
|
43
|
+
const canonicalizeModuleId = options.canonicalizeModuleId ?? ((id) => id);
|
|
44
|
+
const clientReferenceImportIds = /* @__PURE__ */ new Set();
|
|
45
|
+
const serverReferenceIds = /* @__PURE__ */ new Set();
|
|
46
|
+
const visited = /* @__PURE__ */ new Set();
|
|
47
|
+
const queue = options.roots.map(canonicalizeModuleId);
|
|
48
|
+
for (let index = 0; index < queue.length; index++) {
|
|
49
|
+
const id = queue[index];
|
|
50
|
+
if (visited.has(id)) continue;
|
|
51
|
+
visited.add(id);
|
|
52
|
+
const clientReference = options.clientReferenceMetaMap[id];
|
|
53
|
+
if (clientReference) clientReferenceImportIds.add(clientReference.importId);
|
|
54
|
+
const serverReference = options.serverReferenceMetaMap.get(id);
|
|
55
|
+
if (serverReference) for (const exportName of serverReference.exportNames) serverReferenceIds.add(`${serverReference.referenceKey}#${exportName}`);
|
|
56
|
+
const info = options.getModuleInfo(id);
|
|
57
|
+
for (const importedId of [...info?.importedIds ?? [], ...info?.dynamicallyImportedIds ?? []]) if (!visited.has(importedId)) queue.push(importedId);
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
clientReferenceImportIds,
|
|
61
|
+
serverReferenceIds
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function collectRscActionReachability(options) {
|
|
65
|
+
const routeReachability = new Map(options.routes.map((route) => [route.pattern, collectReachableActionReferences({
|
|
66
|
+
canonicalizeModuleId: options.canonicalizeModuleId,
|
|
67
|
+
clientReferenceMetaMap: options.clientReferenceMetaMap,
|
|
68
|
+
getModuleInfo: options.getModuleInfo,
|
|
69
|
+
roots: actionOwnerRouteEntryIds(route),
|
|
70
|
+
serverReferenceMetaMap: options.serverReferenceMetaMap
|
|
71
|
+
})]));
|
|
72
|
+
if (options.sharedRoots?.length) routeReachability.set("*", collectReachableActionReferences({
|
|
73
|
+
canonicalizeModuleId: options.canonicalizeModuleId,
|
|
74
|
+
clientReferenceMetaMap: options.clientReferenceMetaMap,
|
|
75
|
+
getModuleInfo: options.getModuleInfo,
|
|
76
|
+
roots: options.sharedRoots,
|
|
77
|
+
serverReferenceMetaMap: options.serverReferenceMetaMap
|
|
78
|
+
}));
|
|
79
|
+
return routeReachability;
|
|
80
|
+
}
|
|
81
|
+
async function resolveClientReferenceImportIds(options) {
|
|
82
|
+
const canonicalizeModuleId = options.canonicalizeModuleId ?? ((id) => id);
|
|
83
|
+
for (const reachability of options.routeReachability.values()) {
|
|
84
|
+
const resolvedImportIds = /* @__PURE__ */ new Set();
|
|
85
|
+
for (const importId of reachability.clientReferenceImportIds) {
|
|
86
|
+
const resolvedId = await options.resolveId(importId) ?? importId;
|
|
87
|
+
resolvedImportIds.add(canonicalizeModuleId(resolvedId));
|
|
88
|
+
}
|
|
89
|
+
reachability.clientReferenceImportIds = resolvedImportIds;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function addClientActionReachability(options) {
|
|
93
|
+
for (const reachability of options.routeReachability.values()) {
|
|
94
|
+
const clientReachability = collectReachableActionReferences({
|
|
95
|
+
canonicalizeModuleId: options.canonicalizeModuleId,
|
|
96
|
+
clientReferenceMetaMap: options.clientReferenceMetaMap,
|
|
97
|
+
getModuleInfo: options.getModuleInfo,
|
|
98
|
+
roots: [...reachability.clientReferenceImportIds],
|
|
99
|
+
serverReferenceMetaMap: options.serverReferenceMetaMap
|
|
100
|
+
});
|
|
101
|
+
for (const actionId of clientReachability.serverReferenceIds) reachability.serverReferenceIds.add(actionId);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function buildActionOwnerManifest(routeReachability) {
|
|
105
|
+
const manifest = {};
|
|
106
|
+
for (const [pattern, reachability] of routeReachability) for (const actionId of reachability.serverReferenceIds) (manifest[actionId] ??= []).push(pattern);
|
|
107
|
+
return manifest;
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
110
|
+
export { actionOwnerRouteEntryIds, addClientActionReachability, buildActionOwnerManifest, collectReachableActionReferences, collectRscActionReachability, resolveClientReferenceImportIds };
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* patterns with `.gitignore` semantics (via the `ignore` package), so the bare
|
|
17
17
|
* `.vite` entry excludes the directory and everything beneath it.
|
|
18
18
|
*/
|
|
19
|
-
declare const DEFAULT_VINEXT_ASSET_IGNORE_PATTERNS: readonly string[];
|
|
19
|
+
export declare const DEFAULT_VINEXT_ASSET_IGNORE_PATTERNS: readonly string[];
|
|
20
20
|
/**
|
|
21
21
|
* Ensure a `.assetsignore` in `clientDir` contains every pattern in `patterns`.
|
|
22
22
|
*
|
|
@@ -27,6 +27,5 @@ declare const DEFAULT_VINEXT_ASSET_IGNORE_PATTERNS: readonly string[];
|
|
|
27
27
|
* @returns `true` when the file was created or modified, `false` when it already
|
|
28
28
|
* covered every requested pattern.
|
|
29
29
|
*/
|
|
30
|
-
declare function ensureAssetsIgnore(clientDir: string, patterns?: readonly string[]): boolean;
|
|
31
|
-
//#endregion
|
|
32
|
-
export { DEFAULT_VINEXT_ASSET_IGNORE_PATTERNS, ensureAssetsIgnore };
|
|
30
|
+
export declare function ensureAssetsIgnore(clientDir: string, patterns?: readonly string[]): boolean;
|
|
31
|
+
//#endregion
|
|
@@ -8,6 +8,5 @@ type CleanBuildOutputResult = {
|
|
|
8
8
|
cleaned: boolean;
|
|
9
9
|
outDir: string;
|
|
10
10
|
};
|
|
11
|
-
declare function cleanBuildOutput(options: CleanBuildOutputOptions): CleanBuildOutputResult;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { cleanBuildOutput };
|
|
11
|
+
export declare function cleanBuildOutput(options: CleanBuildOutputOptions): CleanBuildOutputResult;
|
|
12
|
+
//#endregion
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import path from "../deps/.pnpm/pathslash@0.1.0/deps/pathslash/dist/index.js";
|
|
2
|
+
import { isPathInsideOrEqual } from "../utils/path.js";
|
|
2
3
|
import fs from "node:fs";
|
|
3
4
|
//#region src/build/clean-output.ts
|
|
4
5
|
function resolveOutDir(root, outDir) {
|
|
@@ -6,10 +7,6 @@ function resolveOutDir(root, outDir) {
|
|
|
6
7
|
if (!outDir) return path.join(resolvedRoot, "dist");
|
|
7
8
|
return path.isAbsolute(outDir) ? outDir : path.resolve(resolvedRoot, outDir);
|
|
8
9
|
}
|
|
9
|
-
function isPathInsideOrEqual(parent, child) {
|
|
10
|
-
const relative = path.relative(parent, child);
|
|
11
|
-
return relative === "" || !relative.startsWith("..") && !path.isAbsolute(relative);
|
|
12
|
-
}
|
|
13
10
|
function shouldCleanBuildOutput(options) {
|
|
14
11
|
if (options.emptyOutDir === false) return false;
|
|
15
12
|
if (options.emptyOutDir === true) return true;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { UserConfig } from "vite";
|
|
2
|
-
|
|
3
2
|
//#region src/build/client-build-config.d.ts
|
|
4
3
|
type ClientAssetFileNameInfo = {
|
|
5
4
|
readonly name?: string;
|
|
@@ -13,7 +12,7 @@ type ClientAssetFileNameInfo = {
|
|
|
13
12
|
* function so it can inspect every source-name candidate Rolldown records for
|
|
14
13
|
* an asset (a single output asset can carry several `originalFileNames`).
|
|
15
14
|
*/
|
|
16
|
-
declare function createClientAssetFileNames(assetsDir: string): (assetInfo: ClientAssetFileNameInfo) => string;
|
|
15
|
+
export declare function createClientAssetFileNames(assetsDir: string): (assetInfo: ClientAssetFileNameInfo) => string;
|
|
17
16
|
/**
|
|
18
17
|
* Create a manualChunks function for client builds.
|
|
19
18
|
*
|
|
@@ -39,12 +38,12 @@ declare function createClientAssetFileNames(assetsDir: string): (assetInfo: Clie
|
|
|
39
38
|
* well: shared dependencies between routes get their own chunks,
|
|
40
39
|
* and route-specific code stays in route chunks.
|
|
41
40
|
*/
|
|
42
|
-
declare function createClientManualChunks(shimsDir: string, preserveRouteBoundaries?: boolean): (id: string) => string | undefined;
|
|
43
|
-
declare function createClientFileNameConfig(assetsDir: string): {
|
|
41
|
+
export declare function createClientManualChunks(shimsDir: string, preserveRouteBoundaries?: boolean): (id: string) => string | undefined;
|
|
42
|
+
export declare function createClientFileNameConfig(assetsDir: string): {
|
|
44
43
|
entryFileNames: string;
|
|
45
44
|
chunkFileNames: string;
|
|
46
45
|
};
|
|
47
|
-
declare function createClientCodeSplittingConfig(clientManualChunks: (id: string) => string | undefined): {
|
|
46
|
+
export declare function createClientCodeSplittingConfig(clientManualChunks: (id: string) => string | undefined): {
|
|
48
47
|
minSize: number;
|
|
49
48
|
groups: {
|
|
50
49
|
name(moduleId: string): string | null;
|
|
@@ -55,8 +54,16 @@ declare function createClientCodeSplittingConfig(clientManualChunks: (id: string
|
|
|
55
54
|
* Derived from the package list so the regex and {@link isRscFrameworkModule}
|
|
56
55
|
* predicate can't drift.
|
|
57
56
|
*/
|
|
58
|
-
declare const RSC_FRAMEWORK_CHUNK_TEST: RegExp;
|
|
59
|
-
declare function isRscFrameworkModule(id: string): boolean;
|
|
57
|
+
export declare const RSC_FRAMEWORK_CHUNK_TEST: RegExp;
|
|
58
|
+
export declare function isRscFrameworkModule(id: string): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Keep virtual entry ids out of emitted RSC chunk filenames.
|
|
61
|
+
*
|
|
62
|
+
* Rolldown's entries-aware chunk names can contain the `\\0` virtual-id marker,
|
|
63
|
+
* which is not a portable module-specifier or filesystem name. Preserve every
|
|
64
|
+
* other character and remove both the printable and actual-NUL forms.
|
|
65
|
+
*/
|
|
66
|
+
export declare function sanitizeRscChunkFileName(name: string): string;
|
|
60
67
|
/**
|
|
61
68
|
* Output config that isolates React (and the RSC flight runtime) into a
|
|
62
69
|
* dedicated "framework" chunk in the RSC server build. See
|
|
@@ -64,7 +71,8 @@ declare function isRscFrameworkModule(id: string): boolean;
|
|
|
64
71
|
* modules that are only reachable through dynamic imports must stay out of the
|
|
65
72
|
* eager framework chunk (issue #2073).
|
|
66
73
|
*/
|
|
67
|
-
declare function createRscFrameworkChunkOutputConfig(): {
|
|
74
|
+
export declare function createRscFrameworkChunkOutputConfig(): {
|
|
75
|
+
sanitizeFileName: typeof sanitizeRscChunkFileName;
|
|
68
76
|
codeSplitting: {
|
|
69
77
|
groups: {
|
|
70
78
|
name: string;
|
|
@@ -81,12 +89,30 @@ declare function createRscFrameworkChunkOutputConfig(): {
|
|
|
81
89
|
* treats node_modules as side-effect-free while preserving side effects in
|
|
82
90
|
* local code.
|
|
83
91
|
*/
|
|
84
|
-
declare function getClientTreeshakeConfig(): {
|
|
92
|
+
export declare function getClientTreeshakeConfig(): {
|
|
85
93
|
moduleSideEffects: "no-external";
|
|
86
94
|
};
|
|
87
95
|
type VinextBuildConfig = NonNullable<UserConfig["build"]>;
|
|
88
96
|
type VinextBuildBundlerOptions = NonNullable<VinextBuildConfig["rolldownOptions"]>;
|
|
89
|
-
declare function getBuildBundlerOptions(build: UserConfig["build"] | undefined): VinextBuildBundlerOptions | undefined;
|
|
90
|
-
declare function withBuildBundlerOptions(bundlerOptions: VinextBuildBundlerOptions): Partial<VinextBuildConfig>;
|
|
91
|
-
|
|
92
|
-
|
|
97
|
+
export declare function getBuildBundlerOptions(build: UserConfig["build"] | undefined): VinextBuildBundlerOptions | undefined;
|
|
98
|
+
export declare function withBuildBundlerOptions(bundlerOptions: VinextBuildBundlerOptions): Partial<VinextBuildConfig>;
|
|
99
|
+
type VinextBuildOutput = Exclude<NonNullable<VinextBuildBundlerOptions["output"]>, readonly unknown[]>;
|
|
100
|
+
type VinextCodeSplittingConfig = Exclude<NonNullable<VinextBuildOutput["codeSplitting"]>, boolean>;
|
|
101
|
+
type ChunkFileNames = NonNullable<VinextBuildOutput["chunkFileNames"]>;
|
|
102
|
+
type ChunkFileNameFunction = Exclude<ChunkFileNames, string>;
|
|
103
|
+
/**
|
|
104
|
+
* Keep vinext modules partitioned by the stage entries that actually use them.
|
|
105
|
+
* Without an entry-aware catch-all, Rolldown may merge a small helper shared by
|
|
106
|
+
* request/response entries into a response-heavy chunk; importing that helper
|
|
107
|
+
* then evaluates React and renderer code on a request-stage cache hit.
|
|
108
|
+
*/
|
|
109
|
+
export declare function createMultiStageCodeSplittingConfig(existing: VinextBuildOutput["codeSplitting"]): VinextCodeSplittingConfig & {
|
|
110
|
+
groups: NonNullable<VinextCodeSplittingConfig["groups"]>;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Keep router stage chunks beside the server entry so their generated
|
|
114
|
+
* `./vinext-client-assets.js` external continues to resolve. Other chunks keep
|
|
115
|
+
* the host's existing output pattern (or vinext's server-assets default).
|
|
116
|
+
*/
|
|
117
|
+
export declare function createMultiStageChunkFileNames(assetsDir: string, existing: VinextBuildOutput["chunkFileNames"]): ChunkFileNameFunction;
|
|
118
|
+
//#endregion
|