vinext 1.2.1 → 1.3.1
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 +12 -9
- package/dist/_virtual/_rolldown/runtime.js +1 -1
- package/dist/build/action-owner-manifest.d.ts +3 -2
- package/dist/build/action-owner-manifest.js +18 -2
- package/dist/build/app-page-static-eligibility.d.ts +17 -1
- package/dist/build/app-page-static-eligibility.js +80 -13
- package/dist/build/clean-output.d.ts +2 -1
- package/dist/build/client-build-config.d.ts +77 -6
- package/dist/build/client-build-config.js +176 -12
- package/dist/build/client-reference-async.d.ts +48 -0
- package/dist/build/client-reference-async.js +123 -0
- package/dist/build/client-reference-chunks.d.ts +32 -0
- package/dist/build/client-reference-chunks.js +111 -0
- package/dist/build/client-reference-groups.d.ts +171 -0
- package/dist/build/client-reference-groups.js +572 -0
- package/dist/build/css-url-assets.d.ts +2 -1
- package/dist/build/google-fonts/fallback-metrics.d.ts +2 -1
- package/dist/build/google-fonts/find-font-files-in-css.d.ts +1 -0
- package/dist/build/google-fonts/find-font-files-in-css.js +17 -4
- package/dist/build/google-fonts/font-metadata.d.ts +2 -1
- package/dist/build/google-fonts/validate.d.ts +2 -1
- package/dist/build/inline-css.d.ts +2 -1
- package/dist/build/layout-classification.d.ts +2 -1
- package/dist/build/module-dependency-cache.d.ts +33 -1
- package/dist/build/module-dependency-cache.js +51 -1
- package/dist/build/next-client-runtime-manifests.d.ts +12 -2
- package/dist/build/next-client-runtime-manifests.js +19 -4
- package/dist/build/nitro-public-files.d.ts +24 -0
- package/dist/build/nitro-public-files.js +60 -0
- package/dist/build/pages-client-assets-module.js +1 -1
- package/dist/build/precompress.d.ts +2 -1
- package/dist/build/precompress.js +1 -1
- package/dist/build/prerender-paths.d.ts +2 -1
- package/dist/build/prerender-paths.js +5 -2
- package/dist/build/prerender-phase.d.ts +2 -1
- package/dist/build/prerender-server-pool.js +1 -1
- package/dist/build/prerender.d.ts +3 -2
- package/dist/build/prerender.js +5 -4
- package/dist/build/report.d.ts +2 -1
- package/dist/build/route-classification-injector.d.ts +2 -1
- package/dist/build/route-classification-manifest.d.ts +2 -1
- package/dist/build/run-prerender.d.ts +2 -1
- package/dist/build/server-actions-encryption-key.d.ts +24 -0
- package/dist/build/server-actions-encryption-key.js +101 -0
- package/dist/build/ssr-manifest.d.ts +3 -0
- package/dist/build/ssr-manifest.js +34 -2
- package/dist/build/standalone.d.ts +2 -1
- package/dist/cache/cache-adapters-virtual.d.ts +2 -1
- package/dist/cache.js +1 -2
- package/dist/check.d.ts +2 -1
- package/dist/check.js +4 -0
- package/dist/cli-args.d.ts +2 -1
- package/dist/cli.js +2 -0
- package/dist/client/client-redirect-matcher.js +2 -1
- package/dist/client/client-redirects.d.ts +4 -3
- package/dist/client/client-redirects.js +2 -1
- package/dist/client/client-rewrite-params.d.ts +9 -0
- package/dist/client/client-rewrite-params.js +20 -0
- package/dist/client/client-rewrites.d.ts +2 -1
- package/dist/client/dev-error-overlay-store.d.ts +2 -1
- package/dist/client/dev-error-overlay.js +2 -1
- package/dist/client/index.js +1 -2
- package/dist/client/instrumentation-client-state.js +5 -5
- package/dist/client/navigation-runtime.d.ts +28 -3
- package/dist/client/navigation-runtime.js +42 -11
- package/dist/client/pages-router-link-navigation.d.ts +2 -1
- package/dist/client/vinext-next-data.d.ts +25 -2
- package/dist/client/window-next.d.ts +2 -1
- package/dist/config/config-matchers.d.ts +27 -41
- package/dist/config/config-matchers.js +293 -270
- package/dist/config/config-source.d.ts +34 -0
- package/dist/config/config-source.js +141 -0
- package/dist/config/dotenv.d.ts +2 -1
- package/dist/config/header-params.d.ts +29 -0
- package/dist/config/header-params.js +106 -0
- package/dist/config/next-config.d.ts +20 -6
- package/dist/config/next-config.js +149 -11
- package/dist/config/tsconfig-paths.d.ts +2 -1
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/detector.js +23 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/index.js +2 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/lookup.js +25 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/bmp.js +11 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/cur.js +15 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/dds.js +11 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/gif.js +12 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/heif.js +55 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/icns.js +76 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/ico.js +39 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/index.js +46 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/j2c.js +11 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jp2.js +21 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jpg.js +71 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jxl-stream.js +42 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jxl.js +46 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/ktx.js +19 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/png.js +28 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/pnm.js +54 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/psd.js +11 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/svg.js +79 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/tga.js +15 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/tiff.js +96 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/utils.js +53 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/webp.js +45 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/utils/bit-reader.js +38 -0
- package/dist/deps/.pnpm/ua-parser-js@1.0.35/deps/ua-parser-js/src/ua-parser.js +2 -2
- package/dist/entries/app-browser-entry.d.ts +34 -6
- package/dist/entries/app-browser-entry.js +103 -40
- package/dist/entries/app-rsc-entry.d.ts +4 -1
- package/dist/entries/app-rsc-entry.js +131 -66
- package/dist/entries/app-rsc-manifest.d.ts +12 -1
- package/dist/entries/app-rsc-manifest.js +73 -1
- package/dist/entries/app-ssr-entry.d.ts +4 -1
- package/dist/entries/app-ssr-entry.js +9 -2
- package/dist/entries/pages-client-entry.d.ts +1 -0
- package/dist/entries/pages-client-entry.js +6 -6
- package/dist/entries/pages-entry-helpers.js +1 -2
- package/dist/entries/pages-server-entry.d.ts +2 -1
- package/dist/entries/pages-server-entry.js +18 -15
- package/dist/entries/runtime-entry-module.d.ts +1 -0
- package/dist/entries/runtime-entry-module.js +4 -1
- package/dist/image/image-adapters-virtual.d.ts +2 -1
- package/dist/index.d.ts +11 -0
- package/dist/index.js +340 -116
- package/dist/init.js +17 -0
- package/dist/plugins/client-compile-hints.d.ts +30 -0
- package/dist/plugins/client-compile-hints.js +88 -0
- package/dist/plugins/client-reference-dedup.d.ts +2 -1
- package/dist/plugins/cloudflare-dev-module-urls.d.ts +2 -1
- package/dist/plugins/dynamic-preload-metadata.d.ts +3 -1
- package/dist/plugins/dynamic-preload-metadata.js +1 -1
- package/dist/plugins/environment.d.ts +2 -1
- package/dist/plugins/fonts.js +9 -12
- package/dist/plugins/ignore-dynamic-requests.d.ts +2 -1
- package/dist/plugins/import-meta-url.d.ts +2 -1
- package/dist/plugins/og-assets.d.ts +2 -1
- package/dist/plugins/og-assets.js +2 -3
- package/dist/plugins/optimize-imports.d.ts +27 -3
- package/dist/plugins/optimize-imports.js +106 -20
- package/dist/plugins/pages-node-externals.d.ts +2 -1
- package/dist/plugins/remove-console.d.ts +2 -1
- package/dist/plugins/require-condition-resolution.d.ts +2 -1
- package/dist/plugins/rsc-client-reference-loaders.d.ts +53 -1
- package/dist/plugins/rsc-client-reference-loaders.js +447 -27
- package/dist/plugins/rsc-client-shim-excludes.js +2 -0
- package/dist/plugins/sass.d.ts +2 -1
- package/dist/plugins/strip-server-exports.d.ts +2 -1
- package/dist/plugins/styled-jsx.d.ts +2 -1
- package/dist/plugins/transform-result.d.ts +2 -1
- package/dist/plugins/typeof-window.d.ts +2 -1
- package/dist/plugins/use-cache-callable.d.ts +5 -0
- package/dist/plugins/use-cache-callable.js +30 -8
- package/dist/plugins/worker-image-imports.d.ts +1 -0
- package/dist/plugins/worker-image-imports.js +2 -2
- package/dist/plugins/worker-use-server.d.ts +2 -1
- package/dist/routing/app-route-graph.d.ts +41 -1
- package/dist/routing/app-route-graph.js +122 -50
- package/dist/routing/browser-route-manifest.d.ts +44 -0
- package/dist/routing/browser-route-manifest.js +195 -0
- package/dist/routing/hashed-route-patterns.d.ts +4 -0
- package/dist/routing/hashed-route-patterns.js +22 -0
- package/dist/routing/optimistic-route-trie.d.ts +28 -0
- package/dist/routing/optimistic-route-trie.js +102 -0
- package/dist/routing/route-matching.d.ts +2 -1
- package/dist/routing/route-pattern.d.ts +2 -1
- package/dist/routing/route-validation.d.ts +6 -1
- package/dist/routing/route-validation.js +26 -10
- package/dist/server/accept-encoding.d.ts +2 -1
- package/dist/server/app-action-forwarding.d.ts +10 -1
- package/dist/server/app-action-forwarding.js +15 -1
- package/dist/server/app-bfcache-identity.d.ts +2 -1
- package/dist/server/app-browser-action-result.d.ts +2 -1
- package/dist/server/app-browser-client-reuse-manifest.d.ts +2 -1
- package/dist/server/app-browser-entry.js +175 -64
- package/dist/server/app-browser-error.d.ts +5 -2
- package/dist/server/app-browser-error.js +7 -2
- package/dist/server/app-browser-history-controller.d.ts +2 -1
- package/dist/server/app-browser-hydration.d.ts +2 -1
- package/dist/server/app-browser-interception-context.d.ts +4 -3
- package/dist/server/app-browser-mpa-navigation.d.ts +1 -0
- package/dist/server/app-browser-mpa-navigation.js +6 -5
- package/dist/server/app-browser-navigation-controller.d.ts +17 -6
- package/dist/server/app-browser-navigation-controller.js +103 -36
- package/dist/server/app-browser-popstate.d.ts +2 -1
- package/dist/server/app-browser-rsc-redirect.d.ts +2 -1
- package/dist/server/app-browser-server-action-client.d.ts +2 -1
- package/dist/server/app-browser-state.d.ts +2 -2
- package/dist/server/app-browser-state.js +1 -1
- package/dist/server/app-browser-stream.d.ts +2 -1
- package/dist/server/app-browser-visible-commit.d.ts +6 -5
- package/dist/server/app-client-reference-manifest.d.ts +31 -0
- package/dist/server/app-client-reference-manifest.js +46 -0
- package/dist/server/app-client-reference-preloader.d.ts +45 -2
- package/dist/server/app-client-reference-preloader.js +48 -10
- package/dist/server/app-elements-wire.d.ts +2 -1
- package/dist/server/app-elements.d.ts +2 -0
- package/dist/server/app-elements.js +3 -1
- package/dist/server/app-fallback-renderer.d.ts +9 -2
- package/dist/server/app-fallback-renderer.js +6 -2
- package/dist/server/app-history-state.d.ts +2 -1
- package/dist/server/app-inline-css-client.d.ts +2 -1
- package/dist/server/app-layout-param-observation.d.ts +2 -1
- package/dist/server/app-metadata-tracing.d.ts +2 -1
- package/dist/server/app-middleware.d.ts +6 -0
- package/dist/server/app-middleware.js +8 -10
- package/dist/server/app-optimistic-routing.d.ts +26 -11
- package/dist/server/app-optimistic-routing.js +38 -96
- package/dist/server/app-page-boundary-render.d.ts +20 -2
- package/dist/server/app-page-boundary-render.js +229 -39
- package/dist/server/app-page-boundary.d.ts +34 -5
- package/dist/server/app-page-boundary.js +40 -7
- package/dist/server/app-page-cache-finalizer.d.ts +2 -1
- package/dist/server/app-page-cache-finalizer.js +1 -1
- package/dist/server/app-page-cache-render.d.ts +10 -2
- package/dist/server/app-page-cache-render.js +15 -2
- package/dist/server/app-page-cache.js +2 -2
- package/dist/server/app-page-dispatch.d.ts +34 -1
- package/dist/server/app-page-dispatch.js +165 -34
- package/dist/server/app-page-element-builder.d.ts +17 -1
- package/dist/server/app-page-element-builder.js +187 -66
- package/dist/server/app-page-execution.d.ts +28 -1
- package/dist/server/app-page-execution.js +114 -5
- package/dist/server/app-page-head.d.ts +95 -3
- package/dist/server/app-page-head.js +307 -152
- package/dist/server/app-page-http-access-fallback-metadata.d.ts +48 -2
- package/dist/server/app-page-http-access-fallback-metadata.js +76 -1
- package/dist/server/app-page-method.d.ts +2 -1
- package/dist/server/app-page-probe.d.ts +2 -1
- package/dist/server/app-page-render-identity.d.ts +2 -1
- package/dist/server/app-page-render.d.ts +7 -1
- package/dist/server/app-page-render.js +38 -11
- package/dist/server/app-page-request.d.ts +14 -1
- package/dist/server/app-page-request.js +1 -1
- package/dist/server/app-page-route-wiring.d.ts +52 -2
- package/dist/server/app-page-route-wiring.js +197 -47
- package/dist/server/app-page-rsc-render-status.d.ts +3 -1
- package/dist/server/app-page-rsc-render-status.js +1 -0
- package/dist/server/app-page-search-params-observation.d.ts +8 -6
- package/dist/server/app-page-search-params-observation.js +16 -11
- package/dist/server/app-page-segment-plan.d.ts +2 -1
- package/dist/server/app-page-stream.d.ts +38 -1
- package/dist/server/app-page-stream.js +24 -4
- package/dist/server/app-pages-bridge.d.ts +4 -2
- package/dist/server/app-pages-bridge.js +11 -7
- package/dist/server/app-ppr-fallback-shell-render.d.ts +2 -1
- package/dist/server/app-ppr-fallback-shell.d.ts +2 -1
- package/dist/server/app-prerender-endpoints.d.ts +2 -1
- package/dist/server/app-prerender-static-params.d.ts +2 -1
- package/dist/server/app-prerender-static-params.js +3 -2
- package/dist/server/app-render-dependency.d.ts +11 -1
- package/dist/server/app-render-dependency.js +65 -6
- package/dist/server/app-request-stage-independent-entry.d.ts +2 -1
- package/dist/server/app-request-stage-independent-entry.js +2 -2
- package/dist/server/app-response-stage-entry.d.ts +2 -1
- package/dist/server/app-response-stage-entry.js +3 -3
- package/dist/server/app-route-handler-cache.d.ts +2 -1
- package/dist/server/app-route-handler-dispatch.d.ts +2 -1
- package/dist/server/app-route-handler-dispatch.js +4 -2
- package/dist/server/app-route-handler-execution.d.ts +4 -1
- package/dist/server/app-route-handler-execution.js +9 -2
- package/dist/server/app-route-handler-middleware-context.d.ts +2 -1
- package/dist/server/app-route-handler-middleware-context.js +3 -3
- package/dist/server/app-route-handler-response.d.ts +4 -2
- package/dist/server/app-route-handler-response.js +2 -2
- package/dist/server/app-route-handler-runtime.d.ts +4 -1
- package/dist/server/app-route-handler-runtime.js +20 -3
- package/dist/server/app-route-module-loader.d.ts +18 -1
- package/dist/server/app-route-module-loader.js +15 -6
- package/dist/server/app-route-tree-prefetch.d.ts +2 -1
- package/dist/server/app-route-tree.d.ts +20 -0
- package/dist/server/app-route-tree.js +18 -0
- package/dist/server/app-router-entry.js +2 -2
- package/dist/server/app-rsc-combined-handler.js +8 -1
- package/dist/server/app-rsc-error-handler.d.ts +2 -1
- package/dist/server/app-rsc-errors.d.ts +9 -1
- package/dist/server/app-rsc-errors.js +9 -2
- package/dist/server/app-rsc-handler.d.ts +6 -2
- package/dist/server/app-rsc-handler.js +152 -140
- package/dist/server/app-rsc-response-finalizer.d.ts +7 -1
- package/dist/server/app-rsc-response-finalizer.js +4 -1
- package/dist/server/app-rsc-response-stage.js +3 -1
- package/dist/server/app-rsc-route-matching.d.ts +39 -1
- package/dist/server/app-rsc-route-matching.js +25 -1
- package/dist/server/app-segment-config.d.ts +2 -1
- package/dist/server/app-segment-config.js +1 -14
- package/dist/server/app-server-action-execution.d.ts +25 -7
- package/dist/server/app-server-action-execution.js +53 -59
- package/dist/server/app-ssr-entry.d.ts +12 -0
- package/dist/server/app-ssr-entry.js +104 -48
- package/dist/server/app-ssr-error-meta.d.ts +2 -1
- package/dist/server/app-ssr-search-params-gate.d.ts +2 -1
- package/dist/server/app-ssr-stream.d.ts +29 -10
- package/dist/server/app-ssr-stream.js +311 -67
- package/dist/server/app-static-generation.d.ts +2 -1
- package/dist/server/app-streamed-client-references.d.ts +39 -0
- package/dist/server/app-streamed-client-references.js +156 -0
- package/dist/server/app-visited-response-cache.d.ts +2 -1
- package/dist/server/app-worker-stages.d.ts +2 -1
- package/dist/server/artifact-compatibility.d.ts +2 -1
- package/dist/server/bfcache-identity.d.ts +2 -1
- package/dist/server/cache-headers.d.ts +2 -1
- package/dist/server/cacheability-request.d.ts +2 -1
- package/dist/server/client-reuse-manifest.d.ts +2 -1
- package/dist/server/config-headers.d.ts +2 -1
- package/dist/server/config-headers.js +12 -3
- package/dist/server/csp.d.ts +2 -1
- package/dist/server/default-global-not-found-module.d.ts +2 -1
- package/dist/server/default-http-access-fallback-modules.d.ts +33 -0
- package/dist/server/default-http-access-fallback-modules.js +31 -0
- package/dist/server/defer-until-stream-consumed.d.ts +34 -0
- package/dist/server/defer-until-stream-consumed.js +154 -21
- package/dist/server/dev-lockfile.d.ts +32 -2
- package/dist/server/dev-lockfile.js +46 -2
- package/dist/server/dev-module-runner.d.ts +2 -1
- package/dist/server/dev-server.js +10 -3
- package/dist/server/fetch-handler.js +1 -2
- package/dist/server/file-based-metadata.d.ts +2 -1
- package/dist/server/framework-tracer.d.ts +2 -1
- package/dist/server/html.d.ts +1 -0
- package/dist/server/html.js +19 -1
- package/dist/server/http-conditional.d.ts +2 -1
- package/dist/server/http-error-responses.d.ts +2 -1
- package/dist/server/implicit-tags.d.ts +2 -1
- package/dist/server/isolate-shared-promise.d.ts +10 -0
- package/dist/server/isolate-shared-promise.js +33 -0
- package/dist/server/isr-cache.js +3 -2
- package/dist/server/metadata-route-build-data.d.ts +2 -1
- package/dist/server/metadata-route-build-data.js +1 -1
- package/dist/server/metadata-route-response.d.ts +2 -1
- package/dist/server/metadata-route-response.js +1 -1
- package/dist/server/metadata-routes.d.ts +2 -1
- package/dist/server/middleware-matcher-pattern.d.ts +0 -1
- package/dist/server/middleware-matcher-pattern.js +11 -140
- package/dist/server/middleware-matcher.js +5 -6
- package/dist/server/middleware-response-headers.d.ts +31 -0
- package/dist/server/middleware-response-headers.js +57 -1
- package/dist/server/middleware-runtime.d.ts +2 -1
- package/dist/server/middleware-runtime.js +26 -13
- package/dist/server/navigation-planner.d.ts +2 -2
- package/dist/server/navigation-trace.d.ts +2 -1
- package/dist/server/next-error-digest.d.ts +2 -1
- package/dist/server/nitro-public-files-plugin.d.ts +39 -0
- package/dist/server/nitro-public-files-plugin.js +106 -0
- package/dist/server/nitro-public-files.d.ts +22 -0
- package/dist/server/nitro-public-files.js +39 -0
- package/dist/server/opentelemetry-api.d.ts +2 -1
- package/dist/server/operation-token.d.ts +2 -1
- package/dist/server/pages-api-route.d.ts +2 -1
- package/dist/server/pages-asset-tags.d.ts +7 -1
- package/dist/server/pages-asset-tags.js +9 -2
- package/dist/server/pages-body-parser-config.d.ts +2 -1
- package/dist/server/pages-client-assets.d.ts +8 -1
- package/dist/server/pages-data-route.d.ts +2 -1
- package/dist/server/pages-document-asset-props.d.ts +2 -1
- package/dist/server/pages-document-initial-props.d.ts +2 -1
- package/dist/server/pages-execution-tracing.d.ts +2 -1
- package/dist/server/pages-execution-tracing.js +1 -1
- package/dist/server/pages-get-initial-props.d.ts +2 -1
- package/dist/server/pages-i18n.d.ts +18 -0
- package/dist/server/pages-i18n.js +18 -2
- package/dist/server/pages-node-compat.d.ts +5 -3
- package/dist/server/pages-node-compat.js +35 -16
- package/dist/server/pages-page-data.d.ts +7 -1
- package/dist/server/pages-page-data.js +35 -12
- package/dist/server/pages-page-handler.d.ts +3 -2
- package/dist/server/pages-page-handler.js +16 -7
- package/dist/server/pages-page-method.d.ts +2 -1
- package/dist/server/pages-page-response.d.ts +2 -1
- package/dist/server/pages-preview.d.ts +2 -1
- package/dist/server/pages-readiness.d.ts +2 -1
- package/dist/server/pages-request-pipeline.d.ts +8 -2
- package/dist/server/pages-request-pipeline.js +35 -40
- package/dist/server/pages-request-stage-entry.d.ts +2 -1
- package/dist/server/pages-request-stage-entry.js +16 -6
- package/dist/server/pages-response-stage-entry.d.ts +2 -1
- package/dist/server/pages-response-stage-entry.js +1 -1
- package/dist/server/pages-revalidate.js +1 -0
- package/dist/server/pages-route-data-kind.d.ts +2 -1
- package/dist/server/pages-router-entry.js +1 -1
- package/dist/server/prerender-cache-life-header.d.ts +2 -1
- package/dist/server/prerender-route-params.d.ts +2 -1
- package/dist/server/prod-server.d.ts +2 -2
- package/dist/server/prod-server.js +80 -36
- package/dist/server/proxy-trust.d.ts +6 -0
- package/dist/server/proxy-trust.js +12 -6
- package/dist/server/request-log.d.ts +2 -1
- package/dist/server/request-pipeline.d.ts +5 -0
- package/dist/server/request-pipeline.js +12 -1
- package/dist/server/request-tracing.d.ts +2 -1
- package/dist/server/request-tracing.js +1 -1
- package/dist/server/response-start-tracing.js +7 -29
- package/dist/server/rsc-render-stream.d.ts +4 -0
- package/dist/server/rsc-render-stream.js +25 -0
- package/dist/server/seed-cache.d.ts +2 -1
- package/dist/server/seed-cache.js +1 -1
- package/dist/server/server-reference-loader.js +10 -1
- package/dist/server/static-file-cache.d.ts +2 -1
- package/dist/server/static-file-cache.js +16 -3
- package/dist/server/static-layout-client-reuse-proof.d.ts +2 -1
- package/dist/server/worker-revalidation-context.d.ts +2 -1
- package/dist/server/worker-stages.d.ts +2 -1
- package/dist/server/worker-utils.js +1 -1
- package/dist/shims/app.d.ts +2 -1
- package/dist/shims/cache-callable-runtime.d.ts +2 -1
- package/dist/shims/cache-handler.d.ts +8 -3
- package/dist/shims/cache-handler.js +32 -11
- package/dist/shims/cache-request-state.d.ts +40 -3
- package/dist/shims/cache-request-state.js +70 -5
- package/dist/shims/cache-runtime.js +47 -19
- package/dist/shims/cache.d.ts +2 -2
- package/dist/shims/cache.js +17 -8
- package/dist/shims/caught-not-found-boundaries.d.ts +15 -0
- package/dist/shims/caught-not-found-boundaries.js +48 -0
- package/dist/shims/cdn-purge-routes.d.ts +25 -0
- package/dist/shims/cdn-purge-routes.js +77 -0
- package/dist/shims/client-locale.js +2 -1
- package/dist/shims/client-page-root.d.ts +2 -1
- package/dist/shims/config.d.ts +2 -1
- package/dist/shims/default-forbidden.d.ts +4 -0
- package/dist/shims/default-forbidden.js +18 -0
- package/dist/shims/default-not-found.d.ts +0 -5
- package/dist/shims/default-not-found.js +5 -41
- package/dist/shims/default-unauthorized.d.ts +4 -0
- package/dist/shims/default-unauthorized.js +18 -0
- package/dist/shims/dynamic.js +17 -4
- package/dist/shims/error-boundary.d.ts +39 -3
- package/dist/shims/error-boundary.js +31 -16
- package/dist/shims/font-google.js +1 -2
- package/dist/shims/font-utils.d.ts +3 -2
- package/dist/shims/font-utils.js +5 -3
- package/dist/shims/form.js +9 -4
- package/dist/shims/http-access-error-fallback.d.ts +7 -0
- package/dist/shims/http-access-error-fallback.js +47 -0
- package/dist/shims/image-props.d.ts +93 -0
- package/dist/shims/image-props.js +323 -0
- package/dist/shims/image.d.ts +4 -39
- package/dist/shims/image.js +4 -319
- package/dist/shims/internal/app-prefetch-fetch-queue.d.ts +22 -2
- package/dist/shims/internal/app-prefetch-fetch-queue.js +71 -18
- package/dist/shims/internal/app-route-prefetch-policy.d.ts +14 -3
- package/dist/shims/internal/app-route-prefetch-policy.js +29 -4
- package/dist/shims/internal/cache-context-accessor.d.ts +2 -1
- package/dist/shims/internal/client-reference-loader.d.ts +7 -0
- package/dist/shims/internal/client-reference-loader.js +91 -0
- package/dist/shims/internal/cookie-serialize.d.ts +2 -1
- package/dist/shims/internal/cookies.js +1 -2
- package/dist/shims/internal/headers-state.d.ts +9 -0
- package/dist/shims/internal/headers-state.js +19 -2
- package/dist/shims/internal/hybrid-client-route-owner-direct.d.ts +6 -2
- package/dist/shims/internal/hybrid-client-route-owner-direct.js +31 -14
- package/dist/shims/internal/hybrid-client-route-owner.js +8 -8
- package/dist/shims/internal/interpolate-as.d.ts +2 -1
- package/dist/shims/internal/pages-data-target.d.ts +2 -1
- package/dist/shims/internal/pages-data-url.d.ts +2 -1
- package/dist/shims/internal/thenable-well-known-properties.d.ts +2 -1
- package/dist/shims/link.js +198 -53
- package/dist/shims/metadata.d.ts +32 -11
- package/dist/shims/metadata.js +88 -26
- package/dist/shims/navigation-errors.d.ts +2 -1
- package/dist/shims/navigation.d.ts +23 -3
- package/dist/shims/navigation.js +91 -25
- package/dist/shims/og.js +35 -10
- package/dist/shims/pages-router-runtime.d.ts +2 -1
- package/dist/shims/ppr-fallback-shell.d.ts +2 -1
- package/dist/shims/request-context.d.ts +13 -0
- package/dist/shims/router.js +33 -43
- package/dist/shims/server.d.ts +31 -4
- package/dist/shims/server.js +58 -10
- package/dist/shims/thenable-params.d.ts +6 -1
- package/dist/shims/thenable-params.js +11 -2
- package/dist/shims/unified-request-context.d.ts +5 -0
- package/dist/shims/unified-request-context.js +5 -3
- package/dist/typegen.d.ts +2 -1
- package/dist/utils/asset-prefix.d.ts +7 -0
- package/dist/utils/asset-prefix.js +10 -1
- package/dist/utils/client-build-manifest.d.ts +4 -1
- package/dist/utils/client-build-manifest.js +20 -6
- package/dist/utils/client-entry-manifest.d.ts +13 -0
- package/dist/utils/client-entry-manifest.js +20 -1
- package/dist/utils/client-reference-chunks.d.ts +45 -0
- package/dist/utils/client-reference-chunks.js +30 -0
- package/dist/utils/client-runtime-metadata.d.ts +10 -1
- package/dist/utils/client-runtime-metadata.js +53 -9
- package/dist/utils/compare.d.ts +9 -0
- package/dist/utils/compare.js +15 -1
- package/dist/utils/lazy-chunks.d.ts +18 -0
- package/dist/utils/lazy-chunks.js +27 -1
- package/dist/utils/manifest-paths.d.ts +14 -0
- package/dist/utils/manifest-paths.js +22 -1
- package/dist/utils/middleware-request-headers.d.ts +2 -1
- package/dist/utils/path-to-regexp.d.ts +21 -0
- package/dist/{server/middleware-path-to-regexp.js → utils/path-to-regexp.js} +14 -11
- package/dist/utils/plugin-react-version.d.ts +15 -0
- package/dist/utils/plugin-react-version.js +64 -0
- package/dist/utils/project.d.ts +2 -1
- package/dist/utils/project.js +9 -1
- package/dist/utils/public-routes.d.ts +2 -0
- package/dist/utils/public-routes.js +18 -7
- package/dist/utils/query.d.ts +2 -1
- package/dist/utils/sorted-array.d.ts +2 -1
- package/dist/utils/vite-cli-invocation.d.ts +2 -1
- package/package.json +5 -5
- package/dist/deps/.pnpm/image-size@2.0.2/deps/image-size/dist/index.js +0 -808
- package/dist/server/default-not-found-module.d.ts +0 -19
- package/dist/server/default-not-found-module.js +0 -18
- package/dist/server/middleware-path-to-regexp.d.ts +0 -13
- package/dist/server/rsc-stream-hints.d.ts +0 -21
- package/dist/server/rsc-stream-hints.js +0 -227
- package/dist/utils/regex-safety.d.ts +0 -17
- package/dist/utils/regex-safety.js +0 -789
package/dist/init.js
CHANGED
|
@@ -2,6 +2,7 @@ import path, { toSlash } from "./deps/.pnpm/pathslash@0.1.0/deps/pathslash/dist/
|
|
|
2
2
|
import { detectPackageManager, detectPackageManagerName, detectProject, ensureESModule, findViteConfigPath, hasViteConfig, renameCJSConfigs } from "./utils/project.js";
|
|
3
3
|
import { compactResourceName, cssModulesConfigSource, findConfigKeepingWorkerName, setupCloudflarePlatform, updateViteConfigForCssModules, usesCommonJsViteConfig, validateCloudflarePlatformSetup } from "./init-cloudflare.js";
|
|
4
4
|
import { getReactUpgradeDeps } from "./utils/react-version.js";
|
|
5
|
+
import { getPluginReactUpgradeDeps } from "./utils/plugin-react-version.js";
|
|
5
6
|
import fs from "node:fs";
|
|
6
7
|
import { spawn, spawnSync } from "node:child_process";
|
|
7
8
|
//#region src/init.ts
|
|
@@ -598,6 +599,22 @@ async function init(options) {
|
|
|
598
599
|
}
|
|
599
600
|
}
|
|
600
601
|
}
|
|
602
|
+
const pluginReactUpgrade = getPluginReactUpgradeDeps(root);
|
|
603
|
+
if (pluginReactUpgrade.length > 0) {
|
|
604
|
+
console.log(` ${terminalStyle.cyan(terminalStyle.bold("Upgrading devDependencies:"))}`);
|
|
605
|
+
console.log(formatList(pluginReactUpgrade.map((dep) => dep.replace(/@latest$/, "")), " "));
|
|
606
|
+
try {
|
|
607
|
+
if (shouldInstall) {
|
|
608
|
+
if (isApproveBuildsError(await installDeps(root, pluginReactUpgrade, exec))) dependencyInstallNeedsApproval = true;
|
|
609
|
+
} else {
|
|
610
|
+
const added = addDependencyEntries(root, pluginReactUpgrade, { dev: true });
|
|
611
|
+
devDependencyEntriesAdded.push(...added);
|
|
612
|
+
}
|
|
613
|
+
} catch (error) {
|
|
614
|
+
if (pmName !== "pnpm" || !isApproveBuildsError(error)) throw error;
|
|
615
|
+
dependencyInstallNeedsApproval = true;
|
|
616
|
+
}
|
|
617
|
+
}
|
|
601
618
|
if (missingDependencies.length > 0) {
|
|
602
619
|
console.log(` ${terminalStyle.cyan(terminalStyle.bold("Installing dependencies:"))}`);
|
|
603
620
|
console.log(formatList(missingDependencies, " "));
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Plugin } from "vite";
|
|
2
|
+
//#region src/plugins/client-compile-hints.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* V8's file-level explicit compile hint (Chrome 136+). V8 compiles every
|
|
5
|
+
* function in a file that starts with this comment eagerly, on the background
|
|
6
|
+
* thread that streams the script, instead of lazily on the main thread the
|
|
7
|
+
* first time each function runs. Other engines ignore it.
|
|
8
|
+
* https://v8.dev/blog/explicit-compile-hints
|
|
9
|
+
*/
|
|
10
|
+
export declare const CLIENT_COMPILE_HINT = "//# allFunctionsCalledOnLoad";
|
|
11
|
+
/**
|
|
12
|
+
* Marks the client chunks every page load runs with V8's compile hint.
|
|
13
|
+
*
|
|
14
|
+
* Those are the browser entry chunks and the chunks they import statically:
|
|
15
|
+
* React, React DOM, the Flight client and the vinext runtime. Hydration calls
|
|
16
|
+
* most of their functions on load, so lazy compilation only moves that work
|
|
17
|
+
* onto the main thread. Chunks reached through dynamic imports (route code,
|
|
18
|
+
* lazy client references, navigation-only modules) keep lazy compilation,
|
|
19
|
+
* since eagerly compiling code a page may never call costs time and memory.
|
|
20
|
+
*
|
|
21
|
+
* The hint has to be the first line of the file, so it is added in the last
|
|
22
|
+
* generateBundle pass, after minification and after Vite's import analysis
|
|
23
|
+
* prepends its `__vite__mapDeps` preload helper. That pass runs after Rolldown
|
|
24
|
+
* hashes file names, so `augmentChunkHash` salts the hash of every chunk that
|
|
25
|
+
* gets the hint: a hinted file never reuses the URL of an unhinted one, which
|
|
26
|
+
* browsers may hold as immutable. Its sourcemap keeps following the chunk's
|
|
27
|
+
* name, so builds that name sourcemaps themselves are left alone.
|
|
28
|
+
*/
|
|
29
|
+
export declare function createClientCompileHintsPlugin(isBrowserEntry: (id: string) => boolean): Plugin;
|
|
30
|
+
//#endregion
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
//#region src/plugins/client-compile-hints.ts
|
|
2
|
+
/**
|
|
3
|
+
* V8's file-level explicit compile hint (Chrome 136+). V8 compiles every
|
|
4
|
+
* function in a file that starts with this comment eagerly, on the background
|
|
5
|
+
* thread that streams the script, instead of lazily on the main thread the
|
|
6
|
+
* first time each function runs. Other engines ignore it.
|
|
7
|
+
* https://v8.dev/blog/explicit-compile-hints
|
|
8
|
+
*/
|
|
9
|
+
const CLIENT_COMPILE_HINT = "//# allFunctionsCalledOnLoad";
|
|
10
|
+
/** Shifts a sourcemap down one generated line, for a line added at the top. */
|
|
11
|
+
function shiftSourceMapSource(source) {
|
|
12
|
+
const text = typeof source === "string" ? source : new TextDecoder().decode(source);
|
|
13
|
+
const map = JSON.parse(text);
|
|
14
|
+
map.mappings = ";" + map.mappings;
|
|
15
|
+
return JSON.stringify(map);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Marks the client chunks every page load runs with V8's compile hint.
|
|
19
|
+
*
|
|
20
|
+
* Those are the browser entry chunks and the chunks they import statically:
|
|
21
|
+
* React, React DOM, the Flight client and the vinext runtime. Hydration calls
|
|
22
|
+
* most of their functions on load, so lazy compilation only moves that work
|
|
23
|
+
* onto the main thread. Chunks reached through dynamic imports (route code,
|
|
24
|
+
* lazy client references, navigation-only modules) keep lazy compilation,
|
|
25
|
+
* since eagerly compiling code a page may never call costs time and memory.
|
|
26
|
+
*
|
|
27
|
+
* The hint has to be the first line of the file, so it is added in the last
|
|
28
|
+
* generateBundle pass, after minification and after Vite's import analysis
|
|
29
|
+
* prepends its `__vite__mapDeps` preload helper. That pass runs after Rolldown
|
|
30
|
+
* hashes file names, so `augmentChunkHash` salts the hash of every chunk that
|
|
31
|
+
* gets the hint: a hinted file never reuses the URL of an unhinted one, which
|
|
32
|
+
* browsers may hold as immutable. Its sourcemap keeps following the chunk's
|
|
33
|
+
* name, so builds that name sourcemaps themselves are left alone.
|
|
34
|
+
*/
|
|
35
|
+
function createClientCompileHintsPlugin(isBrowserEntry) {
|
|
36
|
+
const startupByEnvironment = /* @__PURE__ */ new WeakMap();
|
|
37
|
+
const startupChunks = (environment) => (environment && startupByEnvironment.get(environment)?.chunks) ?? void 0;
|
|
38
|
+
return {
|
|
39
|
+
name: "vinext:client-compile-hints",
|
|
40
|
+
apply: "build",
|
|
41
|
+
enforce: "post",
|
|
42
|
+
renderStart(outputOptions) {
|
|
43
|
+
const environment = this.environment;
|
|
44
|
+
if (environment?.name !== "client") return;
|
|
45
|
+
const { codeSplitting, sourcemap, sourcemapFileNames } = outputOptions;
|
|
46
|
+
if (!codeSplitting || sourcemap === "inline" || sourcemap && sourcemapFileNames !== void 0) {
|
|
47
|
+
startupByEnvironment.delete(environment);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
startupByEnvironment.set(environment, { chunks: null });
|
|
51
|
+
},
|
|
52
|
+
renderChunk(_code, _chunk, _options, meta) {
|
|
53
|
+
const state = this.environment && startupByEnvironment.get(this.environment);
|
|
54
|
+
if (!state || state.chunks) return null;
|
|
55
|
+
const startup = /* @__PURE__ */ new Set();
|
|
56
|
+
const pending = [];
|
|
57
|
+
for (const chunk of Object.values(meta.chunks)) if (chunk.isEntry && chunk.facadeModuleId !== null && isBrowserEntry(chunk.facadeModuleId)) pending.push(chunk.fileName);
|
|
58
|
+
for (let fileName = pending.pop(); fileName !== void 0; fileName = pending.pop()) {
|
|
59
|
+
const chunk = meta.chunks[fileName];
|
|
60
|
+
if (startup.has(fileName) || !chunk) continue;
|
|
61
|
+
startup.add(fileName);
|
|
62
|
+
pending.push(...chunk.imports);
|
|
63
|
+
}
|
|
64
|
+
state.chunks = startup;
|
|
65
|
+
return null;
|
|
66
|
+
},
|
|
67
|
+
augmentChunkHash(chunk) {
|
|
68
|
+
if (startupChunks(this.environment)?.has(chunk.fileName)) return CLIENT_COMPILE_HINT;
|
|
69
|
+
},
|
|
70
|
+
generateBundle: {
|
|
71
|
+
order: "post",
|
|
72
|
+
handler(options, bundle) {
|
|
73
|
+
const startup = startupChunks(this.environment);
|
|
74
|
+
if (!startup) return;
|
|
75
|
+
for (const chunk of Object.values(bundle)) {
|
|
76
|
+
if (chunk.type !== "chunk" || !startup.has(chunk.preliminaryFileName)) continue;
|
|
77
|
+
chunk.code = `${CLIENT_COMPILE_HINT}\n${chunk.code}`;
|
|
78
|
+
if (!options.sourcemap) continue;
|
|
79
|
+
if (chunk.map) chunk.map.mappings = ";" + chunk.map.mappings;
|
|
80
|
+
const mapAsset = chunk.sourcemapFileName ? bundle[chunk.sourcemapFileName] : void 0;
|
|
81
|
+
if (mapAsset?.type === "asset") mapAsset.source = shiftSourceMapSource(mapAsset.source);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
//#endregion
|
|
88
|
+
export { CLIENT_COMPILE_HINT, createClientCompileHintsPlugin };
|
|
@@ -30,4 +30,5 @@ export declare function extractPackageImportSpecifier(absolutePath: string, read
|
|
|
30
30
|
* Dev-only — production builds use the SSR manifest which handles this correctly.
|
|
31
31
|
*/
|
|
32
32
|
export declare function clientReferenceDedupPlugin(options?: ClientReferenceDedupOptions): Plugin;
|
|
33
|
-
//#endregion
|
|
33
|
+
//#endregion
|
|
34
|
+
export {};
|
|
@@ -6,6 +6,8 @@ type TransformResult = {
|
|
|
6
6
|
map: ReturnType<MagicString["generateMap"]>;
|
|
7
7
|
};
|
|
8
8
|
type ResolveDynamicImport = (specifier: string, importer: string) => Promise<string | null>;
|
|
9
|
+
export declare function toManifestModuleId(root: string, resolvedId: string): string | null;
|
|
9
10
|
export declare function transformNextDynamicPreloadMetadata(code: string, id: string, root: string, resolveDynamicImport: ResolveDynamicImport): Promise<TransformResult | null>;
|
|
10
11
|
export declare function createDynamicPreloadMetadataPlugin(getTranspiledPackages: () => readonly string[]): Plugin;
|
|
11
|
-
//#endregion
|
|
12
|
+
//#endregion
|
|
13
|
+
export {};
|
|
@@ -290,4 +290,4 @@ function createDynamicPreloadMetadataPlugin(getTranspiledPackages) {
|
|
|
290
290
|
};
|
|
291
291
|
}
|
|
292
292
|
//#endregion
|
|
293
|
-
export { createDynamicPreloadMetadataPlugin, transformNextDynamicPreloadMetadata };
|
|
293
|
+
export { createDynamicPreloadMetadataPlugin, toManifestModuleId, transformNextDynamicPreloadMetadata };
|
package/dist/plugins/fonts.js
CHANGED
|
@@ -74,10 +74,12 @@ const CACHED_FONT_DIR_TOKEN = "__VINEXT_FONT_CACHE_DIR__";
|
|
|
74
74
|
* Cached stylesheet whose `url()` references use `CACHED_FONT_DIR_TOKEN`.
|
|
75
75
|
* The suffix ties the cache to that format: a `style.css` written by an
|
|
76
76
|
* earlier vinext holds the writing checkout's absolute paths, which would
|
|
77
|
-
* 404 once embedded,
|
|
78
|
-
*
|
|
77
|
+
* 404 once embedded, and a `style-q7f3kd.css` names extensionless Google
|
|
78
|
+
* font URLs `.ttf` whatever their format, so neither is read and the font
|
|
79
|
+
* is fetched again. Change the suffix whenever the cached CSS format
|
|
80
|
+
* changes.
|
|
79
81
|
*/
|
|
80
|
-
const CACHED_FONT_CSS_FILE = "style-
|
|
82
|
+
const CACHED_FONT_CSS_FILE = "style-h8r2vn.css";
|
|
81
83
|
function formatGoogleFontsErrorBody(body) {
|
|
82
84
|
const trimmed = body.trim();
|
|
83
85
|
if (!trimmed) return "(empty response body)";
|
|
@@ -330,16 +332,11 @@ async function downloadGoogleFont(cssUrl, family, fontDir, fontDirName) {
|
|
|
330
332
|
}
|
|
331
333
|
let css = await cssResponse.text();
|
|
332
334
|
if (!css.trim()) throw new Error(`Google Fonts returned an empty stylesheet: ${cssUrl}`);
|
|
333
|
-
const urlRe = /url\((https:\/\/fonts\.gstatic\.com\/[^)]+)\)/g;
|
|
334
335
|
const urls = /* @__PURE__ */ new Map();
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
const
|
|
338
|
-
|
|
339
|
-
const ext = fontUrl.includes(".woff2") ? ".woff2" : fontUrl.includes(".woff") ? ".woff" : ".ttf";
|
|
340
|
-
const fileHash = createHash("md5").update(fontUrl).digest("hex").slice(0, 8);
|
|
341
|
-
urls.set(fontUrl, `${family.toLowerCase().replace(/\s+/g, "-")}-${fileHash}${ext}`);
|
|
342
|
-
}
|
|
336
|
+
for (const { googleFontFileUrl: fontUrl, ext } of findFontFilesInCss(css)) {
|
|
337
|
+
if (!fontUrl.startsWith("https://fonts.gstatic.com/")) continue;
|
|
338
|
+
const fileHash = createHash("md5").update(fontUrl).digest("hex").slice(0, 8);
|
|
339
|
+
urls.set(fontUrl, `${family.toLowerCase().replace(/\s+/g, "-")}-${fileHash}.${ext}`);
|
|
343
340
|
}
|
|
344
341
|
fs.mkdirSync(fontDir, { recursive: true });
|
|
345
342
|
for (const [fontUrl, filename] of urls) {
|
|
@@ -15,4 +15,5 @@ declare function transformVeryDynamicRequests(code: string, id: string): MagicSt
|
|
|
15
15
|
export declare function createIgnoreDynamicRequestsPlugin(getTranspiledPackages?: () => readonly string[]): Plugin;
|
|
16
16
|
export declare const _transformVeryDynamicRequests: typeof transformVeryDynamicRequests;
|
|
17
17
|
export declare const _mayContainVeryDynamicRequest: typeof mayContainVeryDynamicRequest;
|
|
18
|
-
//#endregion
|
|
18
|
+
//#endregion
|
|
19
|
+
export {};
|
|
@@ -17,4 +17,5 @@ export declare function createImportMetaUrlPlugin(options: {
|
|
|
17
17
|
}): ImportMetaUrlCapability;
|
|
18
18
|
export declare function rewriteImportMetaUrl(code: string, id: string, root: string, environment: ImportMetaUrlEnvironment): MagicStringTransformResult | null;
|
|
19
19
|
export declare function rewriteServerCjsGlobals(code: string, id: string, root: string): MagicStringTransformResult | null;
|
|
20
|
-
//#endregion
|
|
20
|
+
//#endregion
|
|
21
|
+
export {};
|
|
@@ -37,9 +37,8 @@ function createOgInlineFetchAssetsPlugin() {
|
|
|
37
37
|
...options,
|
|
38
38
|
skipSelf: true
|
|
39
39
|
});
|
|
40
|
-
if (resolved
|
|
41
|
-
|
|
42
|
-
return null;
|
|
40
|
+
if (resolved !== null && !resolved.external) await ownership.recordResolvedImport(source, resolved.id);
|
|
41
|
+
return options.kind === "require-call" ? null : resolved;
|
|
43
42
|
},
|
|
44
43
|
transform: {
|
|
45
44
|
filter: { code: "import.meta.url" },
|
|
@@ -5,16 +5,39 @@ type BarrelExportEntry = {
|
|
|
5
5
|
source: string;
|
|
6
6
|
isNamespace: boolean;
|
|
7
7
|
originalName?: string;
|
|
8
|
+
/**
|
|
9
|
+
* The outermost module on the way to `source` that RSC replaces with
|
|
10
|
+
* references or wrappers because of its directive. RSC must import the name
|
|
11
|
+
* from it instead.
|
|
12
|
+
*/
|
|
13
|
+
rscBoundary?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The same for SSR, where only "use server" and "use cache" modules are
|
|
16
|
+
* replaced with references.
|
|
17
|
+
*/
|
|
18
|
+
ssrBoundary?: string;
|
|
8
19
|
};
|
|
9
20
|
type BarrelExportMap = Map<string, BarrelExportEntry>;
|
|
10
21
|
/**
|
|
11
22
|
* Packages whose barrel imports are automatically optimized.
|
|
12
23
|
* Matches Next.js's built-in optimizePackageImports defaults plus vinext-specific
|
|
13
|
-
* compatibility entries for radix-ui
|
|
24
|
+
* compatibility entries for radix-ui, @chakra-ui/react, and @heroui/react.
|
|
14
25
|
* @see https://github.com/vercel/next.js/blob/9c31bbdaa/packages/next/src/server/config.ts#L1301
|
|
15
26
|
*/
|
|
16
27
|
export declare const DEFAULT_OPTIMIZE_PACKAGES: string[];
|
|
17
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Packages whose subpath imports (`pkg/Sub`) are also optimized, in the RSC
|
|
30
|
+
* environment only. Their subpath entries are themselves barrels: heroui's
|
|
31
|
+
* Toast imports `UNSTABLE_ToastQueue` from "react-aria-components/Toast", whose
|
|
32
|
+
* other exports call createContext() at module scope and import "client-only"
|
|
33
|
+
* (https://github.com/cloudflare/vinext/issues/4007). Like Next.js's default
|
|
34
|
+
* Turbopack build, this drops the side-effect-free entry's "client-only"
|
|
35
|
+
* import: server-safe exports work, and client components still fail when
|
|
36
|
+
* their own modules are evaluated. SSR and the client keep the package's own
|
|
37
|
+
* module graph, so context modules are never instantiated twice there.
|
|
38
|
+
*/
|
|
39
|
+
export declare const SUBPATH_OPTIMIZE_PACKAGES: string[];
|
|
40
|
+
export declare function createOptimizedImportSourceMatcher(packages: Iterable<string>, subpathPackages?: Iterable<string>): (code: string) => boolean;
|
|
18
41
|
/**
|
|
19
42
|
* Build a map of exported names → source sub-module for a barrel package.
|
|
20
43
|
*
|
|
@@ -38,4 +61,5 @@ export declare function buildBarrelExportMap(entryPath: string | null, readFile:
|
|
|
38
61
|
* @param getRoot - Returns the current project root (set by the vinext:config hook).
|
|
39
62
|
*/
|
|
40
63
|
export declare function createOptimizeImportsPlugin(getNextConfig: () => ResolvedNextConfig | undefined, getRoot: () => string): Plugin;
|
|
41
|
-
//#endregion
|
|
64
|
+
//#endregion
|
|
65
|
+
export {};
|
|
@@ -21,7 +21,7 @@ async function readFileSafe(filepath) {
|
|
|
21
21
|
/**
|
|
22
22
|
* Packages whose barrel imports are automatically optimized.
|
|
23
23
|
* Matches Next.js's built-in optimizePackageImports defaults plus vinext-specific
|
|
24
|
-
* compatibility entries for radix-ui
|
|
24
|
+
* compatibility entries for radix-ui, @chakra-ui/react, and @heroui/react.
|
|
25
25
|
* @see https://github.com/vercel/next.js/blob/9c31bbdaa/packages/next/src/server/config.ts#L1301
|
|
26
26
|
*/
|
|
27
27
|
const DEFAULT_OPTIMIZE_PACKAGES = [
|
|
@@ -101,10 +101,40 @@ const DEFAULT_OPTIMIZE_PACKAGES = [
|
|
|
101
101
|
"react-icons/ti",
|
|
102
102
|
"react-icons/vsc",
|
|
103
103
|
"react-icons/wi",
|
|
104
|
-
"radix-ui"
|
|
104
|
+
"radix-ui",
|
|
105
|
+
"@heroui/react"
|
|
105
106
|
];
|
|
106
|
-
|
|
107
|
-
|
|
107
|
+
/**
|
|
108
|
+
* Packages whose subpath imports (`pkg/Sub`) are also optimized, in the RSC
|
|
109
|
+
* environment only. Their subpath entries are themselves barrels: heroui's
|
|
110
|
+
* Toast imports `UNSTABLE_ToastQueue` from "react-aria-components/Toast", whose
|
|
111
|
+
* other exports call createContext() at module scope and import "client-only"
|
|
112
|
+
* (https://github.com/cloudflare/vinext/issues/4007). Like Next.js's default
|
|
113
|
+
* Turbopack build, this drops the side-effect-free entry's "client-only"
|
|
114
|
+
* import: server-safe exports work, and client components still fail when
|
|
115
|
+
* their own modules are evaluated. SSR and the client keep the package's own
|
|
116
|
+
* module graph, so context modules are never instantiated twice there.
|
|
117
|
+
*/
|
|
118
|
+
const SUBPATH_OPTIMIZE_PACKAGES = ["react-aria-components"];
|
|
119
|
+
function isOptimizedSubpath(source, subpathPackages) {
|
|
120
|
+
for (const pkg of subpathPackages) if (source.length > pkg.length + 1 && source.startsWith(`${pkg}/`)) return true;
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Return the directive that marks a module as an RSC boundary, if any.
|
|
125
|
+
* Re-exports must not be followed through such a module: importing its leaves
|
|
126
|
+
* directly would bypass the client reference, server reference, or cache wrapper.
|
|
127
|
+
*/
|
|
128
|
+
function findBoundaryDirective(ast) {
|
|
129
|
+
for (const statement of ast.body) {
|
|
130
|
+
if (statement.type !== "ExpressionStatement" || typeof statement.directive !== "string") return null;
|
|
131
|
+
const directive = statement.directive;
|
|
132
|
+
if (directive === "use client" || directive === "use server" || directive.startsWith("use cache")) return directive;
|
|
133
|
+
}
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
function createOptimizedImportSourceMatcher(packages, subpathPackages = []) {
|
|
137
|
+
const pattern = [...[...packages].map(escapeRegExp), ...[...subpathPackages].map((pkg) => String.raw`${escapeRegExp(pkg)}/[^"'\s]+`)].join("|");
|
|
108
138
|
if (!pattern) return () => false;
|
|
109
139
|
const importFromPattern = new RegExp(String.raw`(?:^|[;}\n\r])\s*import(?!\s*\()(?:(?!\bfrom\b)[\s\S])*?\bfrom\s*["'](?:${pattern})["']`, "m");
|
|
110
140
|
const quotedSourcePattern = new RegExp(String.raw`["'](?:${pattern})["']`);
|
|
@@ -238,6 +268,7 @@ async function buildExportMapFromFile(filePath, readFile, cache, visited, initia
|
|
|
238
268
|
return /* @__PURE__ */ new Map();
|
|
239
269
|
}
|
|
240
270
|
const exportMap = /* @__PURE__ */ new Map();
|
|
271
|
+
const boundaryDirective = findBoundaryDirective(ast);
|
|
241
272
|
const importBindings = /* @__PURE__ */ new Map();
|
|
242
273
|
const localDeclarations = /* @__PURE__ */ new Set();
|
|
243
274
|
const fileDir = path.dirname(filePath);
|
|
@@ -379,6 +410,14 @@ async function buildExportMapFromFile(filePath, readFile, cache, visited, initia
|
|
|
379
410
|
break;
|
|
380
411
|
}
|
|
381
412
|
}
|
|
413
|
+
if (boundaryDirective) {
|
|
414
|
+
const isSsrBoundary = boundaryDirective !== "use client";
|
|
415
|
+
for (const [name, entry] of exportMap) exportMap.set(name, {
|
|
416
|
+
...entry,
|
|
417
|
+
rscBoundary: filePath,
|
|
418
|
+
ssrBoundary: isSsrBoundary ? filePath : entry.ssrBoundary
|
|
419
|
+
});
|
|
420
|
+
}
|
|
382
421
|
cache.set(filePath, exportMap);
|
|
383
422
|
return exportMap;
|
|
384
423
|
}
|
|
@@ -407,6 +446,15 @@ async function buildBarrelExportMap(entryPath, readFile, cache) {
|
|
|
407
446
|
return await buildExportMapFromFile(entryPath, readFile, exportMapCache, /* @__PURE__ */ new Set(), content);
|
|
408
447
|
}
|
|
409
448
|
/**
|
|
449
|
+
* Resolve a specifier with Vite's resolver, returning the id only when it is a
|
|
450
|
+
* file in the module graph (not external or virtual).
|
|
451
|
+
*/
|
|
452
|
+
async function resolveFileId(ctx, source, importer) {
|
|
453
|
+
const resolved = await ctx.resolve(source, importer, { skipSelf: true });
|
|
454
|
+
if (!resolved || resolved.external || !path.isAbsolute(resolved.id)) return null;
|
|
455
|
+
return resolved.id;
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
410
458
|
* Creates the vinext:optimize-imports Vite plugin.
|
|
411
459
|
*
|
|
412
460
|
* @param nextConfig - Resolved Next.js config (may be undefined before config hook runs).
|
|
@@ -420,6 +468,7 @@ function createOptimizeImportsPlugin(getNextConfig, getRoot) {
|
|
|
420
468
|
const entryPathCache = /* @__PURE__ */ new Map();
|
|
421
469
|
let optimizedPackages = /* @__PURE__ */ new Set();
|
|
422
470
|
let hasOptimizedImportSource = () => false;
|
|
471
|
+
let hasOptimizedRscImportSource = () => false;
|
|
423
472
|
const registeredBarrels = /* @__PURE__ */ new Set();
|
|
424
473
|
return {
|
|
425
474
|
name: "vinext:optimize-imports",
|
|
@@ -427,6 +476,7 @@ function createOptimizeImportsPlugin(getNextConfig, getRoot) {
|
|
|
427
476
|
const nextConfig = getNextConfig();
|
|
428
477
|
optimizedPackages = /* @__PURE__ */ new Set([...DEFAULT_OPTIMIZE_PACKAGES, ...nextConfig?.optimizePackageImports ?? []]);
|
|
429
478
|
hasOptimizedImportSource = createOptimizedImportSourceMatcher(optimizedPackages);
|
|
479
|
+
hasOptimizedRscImportSource = createOptimizedImportSourceMatcher(optimizedPackages, SUBPATH_OPTIMIZE_PACKAGES);
|
|
430
480
|
entryPathCache.clear();
|
|
431
481
|
barrelCaches.exportMapCache.clear();
|
|
432
482
|
barrelCaches.subpkgOrigin.clear();
|
|
@@ -434,56 +484,77 @@ function createOptimizeImportsPlugin(getNextConfig, getRoot) {
|
|
|
434
484
|
},
|
|
435
485
|
async resolveId(source) {
|
|
436
486
|
if (this.environment?.name === "client") return;
|
|
437
|
-
const
|
|
438
|
-
const barrelEntry = barrelCaches.subpkgOrigin.get(
|
|
487
|
+
const envKey = this.environment?.name === "rsc" ? "rsc" : "ssr";
|
|
488
|
+
const barrelEntry = barrelCaches.subpkgOrigin.get(envKey)?.get(source);
|
|
439
489
|
if (!barrelEntry) return;
|
|
440
490
|
return await this.resolve(source, barrelEntry, { skipSelf: true }) ?? void 0;
|
|
441
491
|
},
|
|
442
492
|
transform: {
|
|
443
493
|
filter: {
|
|
444
494
|
id: {
|
|
445
|
-
include: /\.(tsx?|jsx?|mjs)
|
|
495
|
+
include: /\.(tsx?|jsx?|mjs)(?:\?v=\w+)?$/,
|
|
446
496
|
exclude: VIRTUAL_MODULE_ID_RE
|
|
447
497
|
},
|
|
448
498
|
code: /\bimport\b[\s\S]*\bfrom\b/
|
|
449
499
|
},
|
|
450
|
-
async handler(code) {
|
|
500
|
+
async handler(code, id) {
|
|
451
501
|
const env = this.environment;
|
|
452
502
|
if (env?.name === "client") return null;
|
|
453
503
|
const preferReactServer = env?.name === "rsc";
|
|
454
504
|
const packages = optimizedPackages;
|
|
455
|
-
if (!hasOptimizedImportSource(code)) return null;
|
|
505
|
+
if (!(preferReactServer ? hasOptimizedRscImportSource : hasOptimizedImportSource)(code)) return null;
|
|
456
506
|
let ast;
|
|
457
507
|
try {
|
|
458
508
|
ast = parseProgram(code);
|
|
459
509
|
} catch {
|
|
460
510
|
return null;
|
|
461
511
|
}
|
|
512
|
+
if (preferReactServer && findBoundaryDirective(ast) === "use client") return null;
|
|
462
513
|
const s = new MagicString(code);
|
|
463
514
|
let hasChanges = false;
|
|
464
515
|
const root = getRoot();
|
|
465
516
|
for (const node of ast.body) {
|
|
466
517
|
if (node.type !== "ImportDeclaration") continue;
|
|
467
518
|
const importSource = typeof node.source?.value === "string" ? node.source.value : null;
|
|
468
|
-
if (!importSource
|
|
469
|
-
const
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
519
|
+
if (!importSource) continue;
|
|
520
|
+
const isSubpath = !packages.has(importSource) && preferReactServer && isOptimizedSubpath(importSource, SUBPATH_OPTIMIZE_PACKAGES);
|
|
521
|
+
if (!isSubpath && !packages.has(importSource)) continue;
|
|
522
|
+
let barrelEntry;
|
|
523
|
+
if (isSubpath) {
|
|
524
|
+
barrelEntry = await resolveFileId(this, importSource, id);
|
|
525
|
+
if (barrelEntry) barrelEntry = barrelEntry.replace(/\?.*$/, "");
|
|
526
|
+
} else {
|
|
527
|
+
const cacheKey = `${preferReactServer ? "rsc" : "ssr"}:${importSource}`;
|
|
528
|
+
barrelEntry = entryPathCache.get(cacheKey);
|
|
529
|
+
if (barrelEntry === void 0) {
|
|
530
|
+
barrelEntry = await resolvePackageEntry(importSource, root, preferReactServer);
|
|
531
|
+
entryPathCache.set(cacheKey, barrelEntry ?? null);
|
|
532
|
+
}
|
|
474
533
|
}
|
|
475
534
|
const exportMap = await buildBarrelExportMap(barrelEntry, readFileSafe, barrelCaches.exportMapCache);
|
|
476
535
|
if (!exportMap || !barrelEntry) continue;
|
|
536
|
+
const getEntry = (name) => {
|
|
537
|
+
const entry = exportMap.get(name);
|
|
538
|
+
const boundary = preferReactServer ? entry?.rscBoundary : entry?.ssrBoundary;
|
|
539
|
+
return boundary ? {
|
|
540
|
+
source: boundary,
|
|
541
|
+
isNamespace: false,
|
|
542
|
+
originalName: name
|
|
543
|
+
} : entry;
|
|
544
|
+
};
|
|
477
545
|
const envKey = preferReactServer ? "rsc" : "ssr";
|
|
478
546
|
const registeredKey = `${envKey}:${barrelEntry}`;
|
|
479
|
-
if (!registeredBarrels.has(registeredKey)) {
|
|
547
|
+
if (!isSubpath && !registeredBarrels.has(registeredKey)) {
|
|
480
548
|
registeredBarrels.add(registeredKey);
|
|
481
549
|
let envOriginMap = barrelCaches.subpkgOrigin.get(envKey);
|
|
482
550
|
if (!envOriginMap) {
|
|
483
551
|
envOriginMap = /* @__PURE__ */ new Map();
|
|
484
552
|
barrelCaches.subpkgOrigin.set(envKey, envOriginMap);
|
|
485
553
|
}
|
|
486
|
-
for (const
|
|
554
|
+
for (const name of exportMap.keys()) {
|
|
555
|
+
const source = getEntry(name).source;
|
|
556
|
+
if (!source.startsWith("/") && !source.startsWith(".") && !envOriginMap.has(source)) envOriginMap.set(source, barrelEntry);
|
|
557
|
+
}
|
|
487
558
|
}
|
|
488
559
|
const specifiers = [];
|
|
489
560
|
let allResolved = true;
|
|
@@ -528,11 +599,26 @@ function createOptimizeImportsPlugin(getNextConfig, getRoot) {
|
|
|
528
599
|
}
|
|
529
600
|
continue;
|
|
530
601
|
}
|
|
602
|
+
if (isSubpath && specifiers.every(({ imported }) => getEntry(imported)?.source === barrelEntry)) continue;
|
|
603
|
+
const resolvedPackageSources = /* @__PURE__ */ new Map();
|
|
604
|
+
if (isSubpath) {
|
|
605
|
+
for (const { imported } of specifiers) {
|
|
606
|
+
const source = getEntry(imported)?.source;
|
|
607
|
+
if (!source || path.isAbsolute(source) || resolvedPackageSources.has(source)) continue;
|
|
608
|
+
const resolvedId = await resolveFileId(this, source, barrelEntry);
|
|
609
|
+
if (!resolvedId) {
|
|
610
|
+
allResolved = false;
|
|
611
|
+
break;
|
|
612
|
+
}
|
|
613
|
+
resolvedPackageSources.set(source, resolvedId);
|
|
614
|
+
}
|
|
615
|
+
if (!allResolved) continue;
|
|
616
|
+
}
|
|
531
617
|
const bySource = /* @__PURE__ */ new Map();
|
|
532
618
|
for (const { local, imported } of specifiers) {
|
|
533
|
-
const entry =
|
|
619
|
+
const entry = getEntry(imported);
|
|
534
620
|
if (!entry) continue;
|
|
535
|
-
const resolvedSource = entry.source;
|
|
621
|
+
const resolvedSource = resolvedPackageSources.get(entry.source) ?? entry.source;
|
|
536
622
|
const key = `${resolvedSource}::${entry.isNamespace}`;
|
|
537
623
|
let group = bySource.get(key);
|
|
538
624
|
if (!group) {
|
|
@@ -569,4 +655,4 @@ function createOptimizeImportsPlugin(getNextConfig, getRoot) {
|
|
|
569
655
|
};
|
|
570
656
|
}
|
|
571
657
|
//#endregion
|
|
572
|
-
export { DEFAULT_OPTIMIZE_PACKAGES, buildBarrelExportMap, createOptimizeImportsPlugin, createOptimizedImportSourceMatcher };
|
|
658
|
+
export { DEFAULT_OPTIMIZE_PACKAGES, SUBPATH_OPTIMIZE_PACKAGES, buildBarrelExportMap, createOptimizeImportsPlugin, createOptimizedImportSourceMatcher };
|
|
@@ -12,4 +12,5 @@ export declare function isConditionalRequireScriptModuleId(id: string): boolean;
|
|
|
12
12
|
type IdResolverFactory = typeof createIdResolver;
|
|
13
13
|
type CommonJsTransformFilter = (id: string) => boolean | undefined;
|
|
14
14
|
export declare function createRequireConditionResolutionPlugin(createResolver?: IdResolverFactory, commonjsTransformFilter?: CommonJsTransformFilter): Plugin;
|
|
15
|
-
//#endregion
|
|
15
|
+
//#endregion
|
|
16
|
+
export {};
|
|
@@ -1,4 +1,56 @@
|
|
|
1
|
+
import { AppRoute } from "../routing/app-route-graph.js";
|
|
1
2
|
import { Plugin } from "vite";
|
|
2
3
|
//#region src/plugins/rsc-client-reference-loaders.d.ts
|
|
3
|
-
|
|
4
|
+
/** Prefixes the module that registers one client reference outside every group. */
|
|
5
|
+
export declare const RESOLVED_CLIENT_REFERENCE_MODULE_PREFIX = "\0virtual:vinext-client-reference-module/";
|
|
6
|
+
export declare const RESOLVED_CLIENT_REFERENCE_CHUNKS_ID = "\0virtual:vinext-client-reference-chunks";
|
|
7
|
+
export type RscClientReferenceRouteOptions = {
|
|
8
|
+
/** Maps route file paths to the module ids used by the RSC module graph. */
|
|
9
|
+
canonicalizeModuleId: (id: string) => string;
|
|
10
|
+
/** App Router routes of the current build, or null outside App Router builds. */
|
|
11
|
+
getRoutes: () => readonly AppRoute[] | null;
|
|
12
|
+
/**
|
|
13
|
+
* Files any route's render can show: global-error, and the root boundaries
|
|
14
|
+
* that routes without their own not-found, forbidden or unauthorized use.
|
|
15
|
+
*/
|
|
16
|
+
getAlwaysRenderedFiles: () => readonly string[];
|
|
17
|
+
/**
|
|
18
|
+
* The files a render without a route (a route-miss 404) shows: the root
|
|
19
|
+
* layouts and boundaries, and global-not-found.
|
|
20
|
+
*/
|
|
21
|
+
getRoutelessFiles: () => readonly string[];
|
|
22
|
+
/** Route-independent roots such as global-error and global-not-found. */
|
|
23
|
+
getSharedRoots: () => readonly string[];
|
|
24
|
+
};
|
|
25
|
+
export type RscClientReferenceGroupingOptions = {
|
|
26
|
+
/** Modules that live in chunks every page loads anyway (React, vinext runtime). */
|
|
27
|
+
isAlwaysLoadedClientModule: (id: string) => boolean;
|
|
28
|
+
/** vinext's own client chunk groups. Any other chunk group disables grouping. */
|
|
29
|
+
ownClientChunkGroups: ReadonlySet<unknown>;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Replaces @vitejs/plugin-rsc's client-reference facades with per-reference
|
|
33
|
+
* loaders. With `routes`, the SSR build also exports the client references
|
|
34
|
+
* each App Router route preloads. With `grouping`, production client builds
|
|
35
|
+
* additionally load references that the same App Router routes reach through
|
|
36
|
+
* one shared route group module (see build/client-reference-groups.ts), so a
|
|
37
|
+
* page fetches one chunk per route group instead of one per `"use client"`
|
|
38
|
+
* module.
|
|
39
|
+
*/
|
|
40
|
+
export declare function createRscClientReferenceLoadersPlugin(options?: {
|
|
41
|
+
routes?: RscClientReferenceRouteOptions;
|
|
42
|
+
grouping?: RscClientReferenceGroupingOptions;
|
|
43
|
+
/**
|
|
44
|
+
* Receives the client build's client reference modules: each resolved
|
|
45
|
+
* module id with the keys of the references it registers.
|
|
46
|
+
*/
|
|
47
|
+
onClientReferenceModules?: (modules: ReadonlyMap<string, readonly string[]>) => void;
|
|
48
|
+
}): Plugin;
|
|
49
|
+
/**
|
|
50
|
+
* Exports a null preload plan from the client-references virtual module when
|
|
51
|
+
* the app registers @vitejs/plugin-rsc itself (`rsc: false`), where vinext
|
|
52
|
+
* doesn't add the loaders plugin above. The App Router SSR entry imports the
|
|
53
|
+
* plan, and null makes it preload every client reference.
|
|
54
|
+
*/
|
|
55
|
+
export declare function createRouteClientReferencesFallbackPlugin(): Plugin;
|
|
4
56
|
//#endregion
|