vinext 1.0.0-beta.0 → 1.0.0-beta.10
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 +143 -19
- 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/assets-ignore.js +1 -1
- package/dist/build/clean-output.d.ts +2 -3
- package/dist/build/clean-output.js +2 -5
- package/dist/build/client-build-config.d.ts +39 -13
- package/dist/build/client-build-config.js +92 -16
- package/dist/build/css-url-assets.d.ts +4 -6
- package/dist/build/css-url-assets.js +8 -5
- 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/fallback-metrics.js +1 -1
- 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/font-metadata.js +1 -1
- 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 +17 -15
- package/dist/build/inline-css.d.ts +3 -4
- package/dist/build/inline-css.js +2 -5
- 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 +3 -0
- package/dist/build/module-dependency-cache.js +13 -0
- package/dist/build/next-client-runtime-manifests.d.ts +4 -6
- package/dist/build/next-client-runtime-manifests.js +3 -20
- package/dist/build/nitro-route-rules.d.ts +6 -8
- package/dist/build/pages-client-assets-module.d.ts +7 -9
- package/dist/build/pages-client-assets-module.js +1 -1
- package/dist/build/precompress.d.ts +9 -5
- package/dist/build/precompress.js +47 -13
- package/dist/build/prerender-paths.d.ts +69 -9
- package/dist/build/prerender-paths.js +708 -110
- 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 +11 -6
- package/dist/build/prerender.d.ts +62 -42
- package/dist/build/prerender.js +171 -53
- package/dist/build/preview-credentials.d.ts +10 -0
- package/dist/build/preview-credentials.js +19 -0
- 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 -24
- package/dist/build/report.js +77 -8
- 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 +14 -20
- package/dist/build/run-prerender.js +28 -26
- 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 +15 -3
- package/dist/build/ssr-manifest.d.ts +9 -6
- package/dist/build/ssr-manifest.js +10 -6
- package/dist/build/standalone.d.ts +2 -3
- package/dist/build/standalone.js +37 -37
- package/dist/build/static-export.d.ts +30 -20
- package/dist/cache/cache-adapters-virtual.d.ts +89 -27
- package/dist/cache/cache-adapters-virtual.js +54 -16
- package/dist/check.d.ts +9 -26
- package/dist/check.js +35 -40
- 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 +97 -65
- 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 +7 -4
- 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-inject.js +1 -1
- 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/pages-router-link-navigation.js +1 -1
- 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 +51 -134
- package/dist/config/dotenv.d.ts +5 -11
- package/dist/config/dotenv.js +33 -24
- package/dist/config/next-config.d.ts +145 -71
- package/dist/config/next-config.js +126 -28
- package/dist/config/prerender.d.ts +16 -17
- package/dist/config/prerender.js +9 -17
- 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 +2 -3
- package/dist/config/server-external-packages.js +1 -1
- package/dist/config/tsconfig-paths.d.ts +3 -4
- package/dist/config/tsconfig-paths.js +2 -2
- package/dist/{node_modules/.pnpm/am-i-vibing@0.5.0/node_modules → deps/.pnpm/am-i-vibing@0.5.0/deps}/am-i-vibing/dist/detector-1yx2Hoe0.js +2 -2
- package/dist/deps/.pnpm/image-size@2.0.2/deps/image-size/dist/index.js +808 -0
- package/dist/deps/.pnpm/pathslash@0.1.0/deps/pathslash/dist/index.js +50 -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 +40 -20
- package/dist/entries/app-rsc-entry.js +534 -41
- package/dist/entries/app-rsc-manifest.d.ts +2 -4
- package/dist/entries/app-rsc-manifest.js +44 -5
- package/dist/entries/app-ssr-entry.d.ts +2 -3
- package/dist/entries/pages-client-entry.d.ts +3 -5
- package/dist/entries/pages-client-entry.js +21 -11
- package/dist/entries/pages-server-entry.d.ts +13 -5
- package/dist/entries/pages-server-entry.js +227 -54
- package/dist/entries/runtime-entry-module.d.ts +4 -5
- package/dist/entries/runtime-entry-module.js +2 -2
- package/dist/image/image-adapters-virtual.d.ts +8 -7
- package/dist/index.d.ts +7 -4
- package/dist/index.js +1141 -504
- package/dist/init-cloudflare.d.ts +19 -15
- package/dist/init-cloudflare.js +416 -59
- package/dist/init-platform.d.ts +24 -23
- package/dist/init-platform.js +71 -24
- package/dist/init.d.ts +52 -29
- package/dist/init.js +37 -30
- 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 +70 -39
- 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 +65 -185
- 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 +13 -16
- package/dist/plugins/ignore-dynamic-requests.d.ts +5 -9
- package/dist/plugins/ignore-dynamic-requests.js +116 -144
- package/dist/plugins/import-meta-url.d.ts +16 -12
- package/dist/plugins/import-meta-url.js +347 -124
- package/dist/plugins/instrumentation-client.d.ts +2 -4
- package/dist/plugins/instrumentation-client.js +4 -5
- 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 +3 -3
- package/dist/plugins/og-asset-ownership.d.ts +3 -5
- package/dist/plugins/og-asset-ownership.js +24 -31
- package/dist/plugins/og-assets.d.ts +4 -6
- package/dist/plugins/og-assets.js +7 -10
- package/dist/plugins/optimize-imports.d.ts +5 -7
- package/dist/plugins/optimize-imports.js +41 -58
- 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/postcss.js +1 -1
- package/dist/plugins/remove-console.d.ts +2 -4
- package/dist/plugins/remove-console.js +3 -6
- 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 +75 -10
- package/dist/plugins/server-externals-manifest.d.ts +2 -4
- package/dist/plugins/server-externals-manifest.js +2 -24
- package/dist/plugins/strip-server-exports.d.ts +5 -7
- package/dist/plugins/strip-server-exports.js +14 -20
- package/dist/plugins/styled-jsx.d.ts +2 -4
- package/dist/plugins/styled-jsx.js +25 -26
- 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 +155 -38
- 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 +138 -69
- package/dist/routing/app-route-graph.js +189 -99
- package/dist/routing/app-router.d.ts +7 -11
- package/dist/routing/app-router.js +17 -12
- package/dist/routing/file-matcher.d.ts +21 -37
- package/dist/routing/file-matcher.js +31 -44
- package/dist/routing/pages-router.d.ts +15 -11
- package/dist/routing/pages-router.js +26 -32
- 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 +50 -40
- 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 +482 -147
- package/dist/server/app-browser-error.d.ts +5 -7
- package/dist/server/app-browser-error.js +1 -5
- 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 +62 -16
- 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 +7 -5
- 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 +47 -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 +21 -7
- package/dist/server/app-fallback-renderer.js +18 -3
- 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-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 +35 -8
- package/dist/server/app-page-boundary-render.js +195 -62
- 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 +25 -9
- package/dist/server/app-page-cache-finalizer.js +124 -23
- package/dist/server/app-page-cache-render.d.ts +7 -7
- package/dist/server/app-page-cache-render.js +9 -4
- 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 +47 -19
- package/dist/server/app-page-dispatch.js +119 -79
- package/dist/server/app-page-element-builder.d.ts +77 -25
- package/dist/server/app-page-element-builder.js +260 -76
- package/dist/server/app-page-execution.d.ts +27 -18
- package/dist/server/app-page-execution.js +63 -54
- package/dist/server/app-page-head.d.ts +64 -13
- package/dist/server/app-page-head.js +216 -85
- package/dist/server/app-page-http-access-fallback-metadata.d.ts +28 -0
- package/dist/server/app-page-http-access-fallback-metadata.js +114 -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 +13 -10
- package/dist/server/app-page-render.js +96 -33
- package/dist/server/app-page-request.d.ts +27 -43
- package/dist/server/app-page-request.js +119 -65
- 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 +409 -98
- 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 +42 -21
- package/dist/server/app-page-stream.js +12 -4
- 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 +99 -0
- package/dist/server/app-response-header-provenance.d.ts +19 -0
- package/dist/server/app-response-header-provenance.js +58 -0
- package/dist/server/app-response-stage-entry.d.ts +9 -0
- package/dist/server/app-response-stage-entry.js +66 -0
- package/dist/server/app-route-handler-cache.d.ts +5 -5
- package/dist/server/app-route-handler-cache.js +11 -3
- package/dist/server/app-route-handler-dispatch.d.ts +2 -4
- package/dist/server/app-route-handler-dispatch.js +103 -70
- package/dist/server/app-route-handler-execution.d.ts +16 -11
- package/dist/server/app-route-handler-execution.js +175 -27
- 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 +3 -2
- package/dist/server/app-router-entry.d.ts +0 -1
- package/dist/server/app-router-entry.js +61 -14
- package/dist/server/app-rsc-cache-busting.d.ts +50 -23
- package/dist/server/app-rsc-cache-busting.js +123 -32
- 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 +2 -3
- package/dist/server/app-rsc-errors.d.ts +6 -7
- package/dist/server/app-rsc-errors.js +22 -2
- package/dist/server/app-rsc-handler.d.ts +42 -13
- package/dist/server/app-rsc-handler.js +671 -116
- package/dist/server/app-rsc-redirect-flight.d.ts +64 -0
- package/dist/server/app-rsc-redirect-flight.js +71 -0
- 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 +242 -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 +38 -16
- package/dist/server/app-server-action-execution.d.ts +54 -17
- package/dist/server/app-server-action-execution.js +287 -128
- package/dist/server/app-ssr-entry.d.ts +15 -7
- package/dist/server/app-ssr-entry.js +39 -22
- 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 -16
- package/dist/server/app-ssr-stream.js +36 -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 +83 -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/cache-proof.js +1 -1
- 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 +538 -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 +5 -6
- 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 +4 -4
- package/dist/server/default-global-not-found-module.d.ts +2 -4
- package/dist/server/default-not-found-module.d.ts +4 -4
- package/dist/server/defer-until-stream-consumed.d.ts +2 -3
- 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-lockfile.js +2 -3
- 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 +3 -6
- package/dist/server/dev-server.d.ts +10 -21
- package/dist/server/dev-server.js +462 -546
- package/dist/server/dev-stack-sourcemap.d.ts +7 -9
- package/dist/server/dev-stack-sourcemap.js +6 -8
- 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/headers.d.ts +73 -46
- package/dist/server/headers.js +52 -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 +2 -3
- package/dist/server/implicit-tags.d.ts +3 -4
- package/dist/server/implicit-tags.js +2 -1
- package/dist/server/instrumentation-runtime.d.ts +2 -3
- package/dist/server/instrumentation.d.ts +17 -15
- package/dist/server/instrumentation.js +2 -2
- package/dist/server/isr-cache.d.ts +50 -67
- package/dist/server/isr-cache.js +45 -132
- 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 +225 -11
- package/dist/server/metadata-routes.d.ts +52 -35
- package/dist/server/metadata-routes.js +5 -5
- 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 +5 -3
- package/dist/server/middleware-runtime.d.ts +19 -9
- package/dist/server/middleware-runtime.js +118 -36
- package/dist/server/middleware.d.ts +6 -19
- package/dist/server/middleware.js +5 -21
- package/dist/server/multi-stage.d.ts +118 -0
- package/dist/server/multi-stage.js +8 -0
- package/dist/server/navigation-planner.d.ts +30 -27
- package/dist/server/navigation-planner.js +65 -11
- 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 +12 -29
- package/dist/server/next-error-digest.js +23 -15
- 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/operation-token.d.ts +11 -12
- package/dist/server/operation-token.js +1 -1
- package/dist/server/otel-tracer-extension.d.ts +2 -3
- package/dist/server/pages-api-route.d.ts +9 -5
- package/dist/server/pages-api-route.js +49 -8
- 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 +6 -5
- 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 +13 -0
- package/dist/server/pages-dev-hydration.js +92 -0
- package/dist/server/pages-dev-module-url.d.ts +3 -4
- package/dist/server/pages-dev-module-url.js +2 -2
- 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-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 +32 -16
- package/dist/server/pages-node-compat.js +112 -60
- package/dist/server/pages-page-data.d.ts +87 -22
- package/dist/server/pages-page-data.js +441 -92
- package/dist/server/pages-page-handler.d.ts +78 -33
- package/dist/server/pages-page-handler.js +244 -84
- package/dist/server/pages-page-method.d.ts +2 -3
- package/dist/server/pages-page-response.d.ts +19 -22
- package/dist/server/pages-page-response.js +57 -54
- package/dist/server/pages-preview.d.ts +25 -0
- package/dist/server/pages-preview.js +165 -0
- package/dist/server/pages-readiness.d.ts +7 -8
- package/dist/server/pages-readiness.js +7 -5
- package/dist/server/pages-request-pipeline.d.ts +43 -17
- package/dist/server/pages-request-pipeline.js +120 -47
- package/dist/server/pages-request-stage-entry.d.ts +23 -0
- package/dist/server/pages-request-stage-entry.js +297 -0
- package/dist/server/pages-response-stage-entry.d.ts +11 -0
- package/dist/server/pages-response-stage-entry.js +104 -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 +42 -99
- package/dist/server/pages-serializable-props.d.ts +3 -4
- package/dist/server/pregenerated-concrete-paths.d.ts +8 -7
- package/dist/server/pregenerated-concrete-paths.js +3 -1
- 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 +20 -11
- package/dist/server/prerender-manifest.js +4 -1
- 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 +34 -11
- package/dist/server/prod-server.d.ts +27 -21
- package/dist/server/prod-server.js +378 -140
- 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 +61 -88
- package/dist/server/request-stage.d.ts +5 -0
- package/dist/server/request-stage.js +7 -0
- package/dist/server/response-stage-cacheability.d.ts +30 -0
- package/dist/server/response-stage-cacheability.js +36 -0
- package/dist/server/response-stage-policy.d.ts +23 -0
- package/dist/server/response-stage-policy.js +88 -0
- package/dist/server/response-stage.d.ts +5 -0
- package/dist/server/response-stage.js +7 -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 +39 -11
- 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/socket-error-backstop.js +1 -1
- package/dist/server/static-file-cache.d.ts +26 -13
- package/dist/server/static-file-cache.js +63 -38
- 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/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 +17 -8
- 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 +272 -85
- package/dist/shims/cache.d.ts +17 -18
- package/dist/shims/cache.js +50 -21
- package/dist/shims/cacheability-classification.d.ts +94 -0
- package/dist/shims/cacheability-classification.js +143 -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 +70 -17
- package/dist/shims/cdn-cache.js +34 -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/constants.js +1 -1
- 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 +21 -47
- package/dist/shims/error-boundary.js +16 -10
- package/dist/shims/error.d.ts +21 -10
- package/dist/shims/error.js +53 -15
- package/dist/shims/error.react-server.d.ts +3 -4
- package/dist/shims/fetch-cache.d.ts +22 -21
- package/dist/shims/fetch-cache.js +159 -76
- 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/font-utils.js +1 -1
- package/dist/shims/form.d.ts +8 -6
- 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 +79 -16
- package/dist/shims/headers.d.ts +83 -73
- package/dist/shims/headers.js +242 -84
- 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-fetch-dedup.js +5 -3
- 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 +5 -10
- 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 +43 -40
- package/dist/shims/link.js +163 -177
- 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 +20 -20
- package/dist/shims/navigation-errors.js +9 -13
- package/dist/shims/navigation-state.d.ts +7 -7
- package/dist/shims/navigation.d.ts +148 -60
- package/dist/shims/navigation.js +500 -99
- 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 +6 -6
- package/dist/shims/router.d.ts +102 -46
- package/dist/shims/router.js +479 -152
- package/dist/shims/script-nonce-context.d.ts +5 -7
- package/dist/shims/script.d.ts +30 -22
- package/dist/shims/script.js +17 -12
- package/dist/shims/server-only.d.ts +1 -1
- package/dist/shims/server.d.ts +68 -47
- package/dist/shims/server.js +209 -67
- package/dist/shims/slot.d.ts +31 -19
- 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/thenable-params.js +1 -1
- package/dist/shims/unified-request-context.d.ts +71 -13
- package/dist/shims/unified-request-context.js +139 -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/web-vitals.d.ts +2 -3
- package/dist/typegen.d.ts +7 -3
- package/dist/typegen.js +83 -24
- 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 +3 -2
- package/dist/utils/client-entry-manifest.d.ts +6 -7
- package/dist/utils/client-entry-manifest.js +1 -1
- package/dist/utils/client-runtime-metadata.d.ts +2 -3
- package/dist/utils/client-runtime-metadata.js +3 -2
- package/dist/utils/commonjs-loader.d.ts +4 -5
- package/dist/utils/commonjs-loader.js +3 -3
- 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/mdx-scan.js +1 -1
- 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 +2 -3
- 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 -17
- package/dist/utils/path.js +21 -15
- package/dist/utils/plugin-options.d.ts +3 -0
- package/dist/utils/plugin-options.js +8 -0
- 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 -31
- package/dist/utils/project.js +2 -8
- 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 +8 -7
- 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/react-version.js +1 -1
- package/dist/utils/record.d.ts +2 -3
- package/dist/utils/redirect-digest.d.ts +8 -0
- package/dist/utils/redirect-digest.js +25 -0
- 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/vinext-root.js +1 -1
- package/dist/utils/virtual-module.d.ts +3 -4
- package/dist/utils/vite-version.d.ts +7 -5
- package/dist/utils/vite-version.js +43 -17
- package/package.json +53 -8
- /package/dist/build/google-fonts/{fallback-metrics-data.js → fallback-metrics-data.json.js} +0 -0
- /package/dist/build/google-fonts/{font-data.js → font-data.json.js} +0 -0
- /package/dist/{node_modules/.pnpm/process-ancestry@0.1.0/node_modules → deps/.pnpm/process-ancestry@0.1.0/deps}/process-ancestry/dist/index.js +0 -0
package/README.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
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:**
|
|
8
|
+
|
|
9
|
+
- [Caching](docs/caching.md)
|
|
10
|
+
|
|
5
11
|
> **Read the announcement:** [How we rebuilt Next.js with AI in one week](https://blog.cloudflare.com/vinext/)
|
|
6
12
|
|
|
7
13
|
> **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.
|
|
@@ -32,7 +38,23 @@ Run `vinext check` against an existing application before migrating. If a gap is
|
|
|
32
38
|
|
|
33
39
|
## Quick start
|
|
34
40
|
|
|
35
|
-
|
|
41
|
+
**Use the official setup commands below.** They are the recommended way to create or migrate a vinext project because they configure dependencies, scripts, Vite, and your deployment target for you.
|
|
42
|
+
|
|
43
|
+
Start a new project with `create-vinext-app`:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
pnpm create vinext-app@latest my-app
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Migrate an existing Next.js project with `vinext init`:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npx vinext init
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Optional: migrate with an AI agent
|
|
56
|
+
|
|
57
|
+
Prefer `vinext init` for a direct, repeatable migration. If you want an AI agent to investigate compatibility issues and guide the migration, vinext also includes an optional [Agent Skill](https://agentskills.io/home). It works with Claude Code, OpenCode, Cursor, Codex, and dozens of other AI coding tools:
|
|
36
58
|
|
|
37
59
|
```sh
|
|
38
60
|
npx skills add cloudflare/vinext
|
|
@@ -190,7 +212,10 @@ vinext works everywhere. It natively supports Cloudflare Workers (with `npx @vin
|
|
|
190
212
|
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).
|
|
191
213
|
|
|
192
214
|
**Is this a fork of Next.js?**
|
|
193
|
-
No. vinext is an alternative implementation of the Next.js API surface built on Vite.
|
|
215
|
+
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.
|
|
216
|
+
|
|
217
|
+
**Does vinext require Next.js to be installed?**
|
|
218
|
+
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.
|
|
194
219
|
|
|
195
220
|
**How is this different from OpenNext?**
|
|
196
221
|
[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,24 +351,16 @@ Requires a custom domain (zone analytics are unavailable on `*.workers.dev`) and
|
|
|
326
351
|
|
|
327
352
|
#### Custom Vite configuration
|
|
328
353
|
|
|
329
|
-
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:
|
|
330
355
|
|
|
331
356
|
```ts
|
|
332
357
|
import { defineConfig } from "vite";
|
|
333
358
|
import vinext from "vinext";
|
|
334
|
-
import rsc from "@vitejs/plugin-rsc";
|
|
335
359
|
import { cloudflare } from "@cloudflare/vite-plugin";
|
|
336
360
|
|
|
337
361
|
export default defineConfig({
|
|
338
362
|
plugins: [
|
|
339
363
|
vinext(),
|
|
340
|
-
rsc({
|
|
341
|
-
entries: {
|
|
342
|
-
rsc: "virtual:vinext-rsc-entry",
|
|
343
|
-
ssr: "virtual:vinext-app-ssr-entry",
|
|
344
|
-
client: "virtual:vinext-app-browser-entry",
|
|
345
|
-
},
|
|
346
|
-
}),
|
|
347
364
|
cloudflare({
|
|
348
365
|
viteEnvironment: { name: "rsc", childEnvironments: ["ssr"] },
|
|
349
366
|
}),
|
|
@@ -351,6 +368,54 @@ export default defineConfig({
|
|
|
351
368
|
});
|
|
352
369
|
```
|
|
353
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
|
+
|
|
354
419
|
See the [examples](#live-examples) for complete working configurations.
|
|
355
420
|
|
|
356
421
|
### Other platforms (via Nitro)
|
|
@@ -456,13 +521,14 @@ These are deployed to Cloudflare Workers and updated on every push to `main`:
|
|
|
456
521
|
| Nextra Docs | Nextra docs site (MDX, App Router) | [nextra-docs-template.vinext.workers.dev](https://nextra-docs-template.vinext.workers.dev) |
|
|
457
522
|
| App Router (minimal) | Minimal App Router on Workers | [app-router-cloudflare.vinext.workers.dev](https://app-router-cloudflare.vinext.workers.dev) |
|
|
458
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) |
|
|
459
525
|
| RealWorld API | REST API routes example | [realworld-api-rest.vinext.workers.dev](https://realworld-api-rest.vinext.workers.dev) |
|
|
460
|
-
| 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) |
|
|
461
527
|
| App Router + Nitro | App Router deployed via Nitro (multi-platform) | [examples/app-router-nitro](examples/app-router-nitro) |
|
|
462
528
|
|
|
463
529
|
## API coverage
|
|
464
530
|
|
|
465
|
-
~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).
|
|
466
532
|
|
|
467
533
|
> ✅ = full implementation | 🟡 = partial (runtime behavior correct, some build-time optimizations missing) | ⬜ = intentional stub/no-op
|
|
468
534
|
|
|
@@ -545,6 +611,33 @@ Every `next/*` import is shimmed to a Vite-compatible implementation.
|
|
|
545
611
|
| `images` config | 🟡 | Parsed but not used for optimization |
|
|
546
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. |
|
|
547
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.
|
|
548
641
|
|
|
549
642
|
### Environment variable loading (`.env*`)
|
|
550
643
|
|
|
@@ -584,16 +677,21 @@ The cache is pluggable. The default `MemoryCacheHandler` works out of the box. S
|
|
|
584
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:
|
|
585
678
|
|
|
586
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:
|
|
587
683
|
|
|
588
684
|
```ts
|
|
589
685
|
import { defineConfig } from "vite";
|
|
590
686
|
import vinext from "vinext";
|
|
687
|
+
import { cdnAdapter } from "@vinext/cloudflare/cache/cdn-adapter";
|
|
591
688
|
import { kvDataAdapter } from "@vinext/cloudflare/cache/kv-data-adapter";
|
|
592
689
|
|
|
593
690
|
export default defineConfig({
|
|
594
691
|
plugins: [
|
|
595
692
|
vinext({
|
|
596
693
|
cache: {
|
|
694
|
+
cdn: cdnAdapter(),
|
|
597
695
|
data: kvDataAdapter(),
|
|
598
696
|
},
|
|
599
697
|
}),
|
|
@@ -609,9 +707,37 @@ The KV data adapter reads `env[binding]` at runtime, so add the matching KV name
|
|
|
609
707
|
}
|
|
610
708
|
```
|
|
611
709
|
|
|
612
|
-
`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).
|
|
711
|
+
|
|
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.
|
|
613
723
|
|
|
614
|
-
|
|
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.
|
|
615
741
|
|
|
616
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.
|
|
617
743
|
|
|
@@ -622,9 +748,7 @@ vinext({
|
|
|
622
748
|
cache: {
|
|
623
749
|
data: {
|
|
624
750
|
adapter: require.resolve("./my-adapter.js"),
|
|
625
|
-
options: {
|
|
626
|
-
/* … */
|
|
627
|
-
},
|
|
751
|
+
options: {/* … */},
|
|
628
752
|
},
|
|
629
753
|
},
|
|
630
754
|
});
|
|
@@ -656,7 +780,7 @@ We measure three things:
|
|
|
656
780
|
- **Client bundle size** — gzipped output of each build.
|
|
657
781
|
- **Dev server cold start** — 10 runs, randomized execution order. Vite's dependency optimizer cache is cleared before each run.
|
|
658
782
|
|
|
659
|
-
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)**.
|
|
660
784
|
|
|
661
785
|
<details>
|
|
662
786
|
<summary>Why the bundle size difference?</summary>
|
|
@@ -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,15 +1,12 @@
|
|
|
1
|
+
import path from "../deps/.pnpm/pathslash@0.1.0/deps/pathslash/dist/index.js";
|
|
2
|
+
import { isPathInsideOrEqual } from "../utils/path.js";
|
|
1
3
|
import fs from "node:fs";
|
|
2
|
-
import path from "node:path";
|
|
3
4
|
//#region src/build/clean-output.ts
|
|
4
5
|
function resolveOutDir(root, outDir) {
|
|
5
6
|
const resolvedRoot = path.resolve(root);
|
|
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
|