vinext 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -2
- package/THIRD_PARTY_LICENSES.md +47 -0
- package/dist/_virtual/_rolldown/runtime.js +4 -3
- 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 +13 -3
- package/dist/build/client-build-config.js +46 -9
- 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 +9 -1
- package/dist/build/client-reference-groups.js +40 -2
- 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/module-dependency-cache.d.ts +2 -1
- package/dist/build/next-client-runtime-manifests.d.ts +2 -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-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 +6 -5
- package/dist/build/report.d.ts +2 -15
- package/dist/build/report.js +1 -51
- package/dist/build/run-prerender.d.ts +2 -1
- package/dist/build/server-actions-encryption-key.d.ts +2 -1
- package/dist/build/ssr-manifest.js +25 -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 +5 -1
- package/dist/cli-args.d.ts +2 -1
- package/dist/cli.js +5 -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-rewrites.d.ts +2 -1
- package/dist/client/dev-error-overlay-store.d.ts +2 -1
- package/dist/client/dev-error-overlay.js +1 -1
- package/dist/client/index.js +1 -2
- package/dist/client/instrumentation-client-state.js +5 -5
- package/dist/client/navigation-runtime.d.ts +16 -2
- package/dist/client/navigation-runtime.js +2 -2
- package/dist/client/pages-router-link-navigation.d.ts +2 -1
- package/dist/client/vinext-next-data.d.ts +25 -1
- package/dist/client/window-next.d.ts +2 -1
- package/dist/config/config-matchers.d.ts +12 -1
- package/dist/config/config-matchers.js +111 -16
- package/dist/config/dotenv.d.ts +2 -1
- package/dist/config/next-config.d.ts +32 -1
- package/dist/config/next-config.js +93 -5
- package/dist/config/tsconfig-paths.d.ts +2 -1
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/dbcs-codec.js +327 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/dbcs-data.js +123 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/index.js +29 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/internal.js +134 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/sbcs-codec.js +50 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/sbcs-data-generated.js +455 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/sbcs-data.js +147 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/big5-added.json.js +169 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/cp936.json.js +2584 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/cp949.json.js +2220 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/cp950.json.js +227 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/eucjp.json.js +425 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/gb18030-ranges.json.js +427 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/gbk-added.json.js +229 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/shiftjis.json.js +292 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/utf16.js +106 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/utf7.js +182 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/lib/bom-handling.js +42 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/lib/extend-node.js +147 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/lib/index.js +94 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/lib/streams.js +95 -0
- 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/safer-buffer@2.1.2/deps/safer-buffer/safer.js +45 -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 +20 -5
- package/dist/entries/app-browser-entry.js +79 -6
- package/dist/entries/app-rsc-entry.d.ts +2 -1
- package/dist/entries/app-rsc-entry.js +59 -60
- package/dist/entries/app-rsc-manifest.d.ts +2 -1
- package/dist/entries/app-rsc-manifest.js +56 -4
- package/dist/entries/app-ssr-entry.js +1 -0
- 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 +34 -9
- 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.js +184 -103
- package/dist/init-cloudflare.d.ts +1 -3
- package/dist/init-cloudflare.js +10 -48
- package/dist/init-platform.d.ts +2 -0
- package/dist/init-platform.js +4 -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/extensionless-dynamic-import.js +6 -2
- 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/next-intl-catalog.d.ts +12 -0
- package/dist/plugins/next-intl-catalog.js +85 -0
- package/dist/plugins/og-assets.d.ts +2 -1
- package/dist/plugins/og-assets.js +2 -3
- package/dist/plugins/optimize-imports.d.ts +2 -1
- package/dist/plugins/pages-node-externals.d.ts +3 -1
- package/dist/plugins/pages-node-externals.js +1 -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 +8 -0
- package/dist/plugins/rsc-client-reference-loaders.js +170 -68
- 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 +1 -1
- package/dist/plugins/use-cache-callable.js +136 -94
- package/dist/plugins/worker-image-imports.js +1 -1
- package/dist/plugins/worker-use-server.d.ts +2 -1
- package/dist/routing/app-route-graph.d.ts +46 -0
- package/dist/routing/app-route-graph.js +131 -51
- package/dist/routing/browser-route-manifest.d.ts +2 -1
- package/dist/routing/optimistic-route-trie.d.ts +2 -1
- package/dist/routing/route-matching.d.ts +2 -1
- package/dist/routing/route-pattern.d.ts +2 -1
- package/dist/server/accept-encoding.d.ts +2 -1
- package/dist/server/api-handler.js +19 -4
- package/dist/server/app-action-forwarding.d.ts +2 -1
- package/dist/server/app-bfcache-identity.d.ts +2 -1
- package/dist/server/app-bfcache-identity.js +1 -1
- package/dist/server/app-browser-action-result.d.ts +2 -1
- package/dist/server/app-browser-entry.js +106 -66
- package/dist/server/app-browser-error.d.ts +2 -1
- package/dist/server/app-browser-history-controller.d.ts +7 -5
- package/dist/server/app-browser-history-controller.js +93 -15
- package/dist/server/app-browser-hydration.d.ts +2 -1
- package/dist/server/app-browser-interception-context.d.ts +2 -1
- package/dist/server/app-browser-navigation-controller.d.ts +2 -2
- package/dist/server/app-browser-navigation-controller.js +16 -12
- 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-rsc-redirect.js +4 -4
- package/dist/server/app-browser-server-action-client.d.ts +4 -1
- package/dist/server/app-browser-server-action-client.js +4 -3
- package/dist/server/app-browser-state.d.ts +2 -4
- package/dist/server/app-browser-state.js +9 -4
- package/dist/server/app-browser-stream.d.ts +2 -1
- package/dist/server/app-browser-supplemental-refresh.js +16 -1
- package/dist/server/app-browser-visible-commit.d.ts +3 -2
- package/dist/server/app-browser-visible-commit.js +2 -12
- 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 +25 -5
- package/dist/server/app-client-reference-preloader.js +22 -7
- package/dist/server/app-elements-wire.d.ts +8 -39
- package/dist/server/app-elements-wire.js +4 -41
- package/dist/server/app-elements.d.ts +4 -2
- package/dist/server/app-elements.js +4 -2
- package/dist/server/app-fallback-renderer.d.ts +9 -2
- package/dist/server/app-fallback-renderer.js +4 -1
- package/dist/server/app-history-state.d.ts +4 -3
- package/dist/server/app-history-state.js +5 -2
- package/dist/server/app-inline-css-client.d.ts +2 -1
- package/dist/server/app-metadata-tracing.d.ts +2 -1
- package/dist/server/app-mounted-layouts.d.ts +21 -0
- package/dist/server/app-mounted-layouts.js +67 -0
- package/dist/server/app-optimistic-routing.d.ts +37 -2
- package/dist/server/app-optimistic-routing.js +75 -2
- package/dist/server/app-page-boundary-render.d.ts +20 -2
- package/dist/server/app-page-boundary-render.js +224 -40
- package/dist/server/app-page-boundary.d.ts +34 -5
- package/dist/server/app-page-boundary.js +41 -8
- package/dist/server/app-page-cache-finalizer.d.ts +14 -2
- package/dist/server/app-page-cache-finalizer.js +71 -30
- package/dist/server/app-page-cache-render.d.ts +10 -2
- package/dist/server/app-page-cache-render.js +14 -2
- package/dist/server/app-page-cache.d.ts +13 -1
- package/dist/server/app-page-cache.js +33 -11
- package/dist/server/app-page-dispatch.d.ts +39 -11
- package/dist/server/app-page-dispatch.js +236 -177
- package/dist/server/app-page-element-builder.d.ts +19 -3
- package/dist/server/app-page-element-builder.js +193 -71
- package/dist/server/app-page-execution.d.ts +43 -51
- package/dist/server/app-page-execution.js +205 -92
- package/dist/server/app-page-head.d.ts +108 -3
- package/dist/server/app-page-head.js +337 -154
- package/dist/server/app-page-http-access-fallback-metadata.d.ts +49 -2
- package/dist/server/app-page-http-access-fallback-metadata.js +77 -2
- package/dist/server/app-page-layout-gate.d.ts +35 -0
- package/dist/server/app-page-layout-gate.js +50 -0
- package/dist/server/app-page-method.d.ts +2 -1
- package/dist/server/app-page-params.d.ts +0 -1
- package/dist/server/app-page-params.js +1 -14
- package/dist/server/app-page-probe.d.ts +5 -22
- package/dist/server/app-page-probe.js +4 -37
- package/dist/server/app-page-render-identity.d.ts +2 -1
- package/dist/server/app-page-render.d.ts +9 -13
- package/dist/server/app-page-render.js +108 -214
- package/dist/server/app-page-request.d.ts +15 -4
- package/dist/server/app-page-request.js +2 -2
- package/dist/server/app-page-response.js +3 -3
- package/dist/server/app-page-route-wiring.d.ts +65 -8
- package/dist/server/app-page-route-wiring.js +259 -103
- package/dist/server/app-page-rsc-render-status.d.ts +29 -2
- package/dist/server/app-page-rsc-render-status.js +121 -13
- package/dist/server/app-page-search-params-observation.d.ts +7 -2
- package/dist/server/app-page-search-params-observation.js +8 -1
- package/dist/server/app-page-segment-plan.d.ts +2 -1
- package/dist/server/app-page-stream.d.ts +33 -1
- package/dist/server/app-page-stream.js +25 -6
- package/dist/server/app-pages-bridge.d.ts +6 -1
- package/dist/server/app-pages-bridge.js +7 -3
- 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-render-dependency.d.ts +21 -4
- package/dist/server/app-render-dependency.js +100 -33
- package/dist/server/app-request-stage-dispatch.js +1 -1
- package/dist/server/app-request-stage-independent-entry.d.ts +2 -1
- package/dist/server/app-response-stage-entry.d.ts +2 -1
- package/dist/server/app-route-handler-cache.d.ts +2 -1
- package/dist/server/app-route-handler-cache.js +2 -2
- package/dist/server/app-route-handler-dispatch.d.ts +2 -1
- package/dist/server/app-route-handler-dispatch.js +15 -10
- package/dist/server/app-route-handler-execution.d.ts +2 -1
- package/dist/server/app-route-handler-execution.js +8 -3
- package/dist/server/app-route-handler-policy.d.ts +1 -1
- package/dist/server/app-route-handler-policy.js +3 -3
- package/dist/server/app-route-handler-response.d.ts +2 -1
- package/dist/server/app-route-handler-response.js +1 -1
- package/dist/server/app-route-handler-runtime.d.ts +2 -1
- package/dist/server/app-route-handler-runtime.js +17 -4
- package/dist/server/app-route-module-loader.d.ts +18 -1
- package/dist/server/app-route-module-loader.js +8 -0
- package/dist/server/app-route-tree-prefetch.d.ts +2 -1
- package/dist/server/app-rsc-cache-busting.d.ts +2 -2
- package/dist/server/app-rsc-cache-busting.js +4 -4
- package/dist/server/app-rsc-error-handler.d.ts +4 -2
- package/dist/server/app-rsc-error-handler.js +9 -1
- package/dist/server/app-rsc-errors.d.ts +10 -1
- package/dist/server/app-rsc-errors.js +8 -1
- package/dist/server/app-rsc-handler.d.ts +7 -6
- package/dist/server/app-rsc-handler.js +36 -34
- package/dist/server/app-rsc-request-normalization.d.ts +0 -4
- package/dist/server/app-rsc-request-normalization.js +1 -4
- package/dist/server/app-rsc-response-finalizer.d.ts +2 -1
- package/dist/server/app-rsc-response-finalizer.js +2 -2
- package/dist/server/app-rsc-response-stage.js +5 -3
- package/dist/server/app-rsc-route-matching.d.ts +38 -1
- package/dist/server/app-rsc-route-matching.js +24 -0
- 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 +5 -2
- package/dist/server/app-server-action-execution.js +10 -7
- package/dist/server/app-ssr-entry.d.ts +8 -0
- package/dist/server/app-ssr-entry.js +98 -50
- 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 +22 -10
- package/dist/server/app-ssr-stream.js +300 -68
- 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 +38 -2
- package/dist/server/app-visited-response-cache.js +46 -5
- package/dist/server/app-worker-stages.d.ts +27 -4
- package/dist/server/app-worker-stages.js +45 -6
- package/dist/server/artifact-compatibility.d.ts +2 -2
- package/dist/server/artifact-compatibility.js +1 -10
- package/dist/server/bfcache-identity.d.ts +2 -1
- package/dist/server/cache-headers.d.ts +2 -1
- package/dist/server/cache-proof.d.ts +1 -115
- package/dist/server/cache-proof.js +1 -544
- package/dist/server/cacheability-request.d.ts +2 -1
- package/dist/server/cacheability-request.js +13 -8
- package/dist/server/config-headers.d.ts +2 -1
- 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 +14 -6
- 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/headers.d.ts +6 -3
- package/dist/server/headers.js +9 -5
- 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/isr-cache.d.ts +8 -2
- package/dist/server/isr-cache.js +26 -1
- 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 +32 -15
- package/dist/server/metadata-routes.d.ts +2 -1
- package/dist/server/middleware-runtime.d.ts +2 -1
- package/dist/server/multi-stage.d.ts +52 -11
- package/dist/server/multi-stage.js +13 -1
- package/dist/server/navigation-planner.js +1 -1
- 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 +2 -1
- package/dist/server/nitro-public-files.d.ts +2 -1
- 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-api-route.js +28 -19
- package/dist/server/pages-asset-tags.d.ts +2 -1
- package/dist/server/pages-body-parser-config.d.ts +2 -1
- package/dist/server/pages-client-assets.d.ts +4 -0
- 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-media-type.d.ts +21 -1
- package/dist/server/pages-media-type.js +69 -5
- package/dist/server/pages-node-compat.js +52 -27
- 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 +27 -27
- 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 +10 -1
- package/dist/server/pages-request-pipeline.js +6 -7
- package/dist/server/pages-request-stage-entry.d.ts +2 -1
- package/dist/server/pages-request-stage-entry.js +14 -12
- package/dist/server/pages-response-stage-entry.d.ts +2 -1
- package/dist/server/pages-response-stage-entry.js +9 -3
- package/dist/server/pages-route-data-kind.d.ts +2 -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.js +14 -4
- package/dist/server/request-log.d.ts +2 -1
- package/dist/server/request-pipeline.d.ts +6 -0
- package/dist/server/request-pipeline.js +21 -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/shared-cache-identity.d.ts +23 -0
- package/dist/server/shared-cache-identity.js +36 -0
- package/dist/server/static-file-cache.d.ts +2 -1
- package/dist/server/static-file-cache.js +1 -0
- package/dist/server/worker-revalidation-context.d.ts +2 -1
- package/dist/server/worker-stages.d.ts +18 -4
- package/dist/server/worker-stages.js +23 -4
- 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 +31 -11
- package/dist/shims/cache-request-state.d.ts +17 -20
- package/dist/shims/cache-request-state.js +16 -21
- package/dist/shims/cache-runtime.js +27 -11
- package/dist/shims/cache.d.ts +8 -7
- package/dist/shims/cache.js +17 -19
- package/dist/shims/cacheability-classification.d.ts +2 -0
- 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-cache.d.ts +22 -5
- package/dist/shims/cdn-purge-routes.d.ts +2 -1
- package/dist/shims/client-locale.js +2 -1
- package/dist/shims/client-page-root.d.ts +2 -1
- package/dist/shims/client-page-root.js +2 -2
- 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 +9 -6
- package/dist/shims/error-boundary.d.ts +39 -3
- package/dist/shims/error-boundary.js +33 -18
- package/dist/shims/fetch-cache-state.d.ts +5 -1
- package/dist/shims/fetch-cache-state.js +1 -3
- package/dist/shims/fetch-cache.d.ts +2 -1
- package/dist/shims/fetch-cache.js +34 -24
- 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 +3 -3
- package/dist/shims/headers.d.ts +8 -23
- package/dist/shims/headers.js +17 -67
- 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.d.ts +1 -22
- 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 +2 -0
- package/dist/shims/internal/headers-state.js +6 -1
- package/dist/shims/internal/hybrid-client-route-owner-direct.d.ts +2 -1
- package/dist/shims/internal/interpolate-as.d.ts +2 -1
- package/dist/shims/internal/navigation-untracked.js +1 -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 +197 -52
- package/dist/shims/metadata.d.ts +52 -29
- package/dist/shims/metadata.js +142 -42
- package/dist/shims/navigation-errors.d.ts +2 -1
- package/dist/shims/navigation-server.js +1 -1
- package/dist/shims/navigation.d.ts +95 -8
- package/dist/shims/navigation.js +255 -47
- package/dist/shims/navigation.react-server.js +2 -2
- package/dist/shims/pages-router-runtime.d.ts +2 -1
- package/dist/shims/ppr-fallback-shell.d.ts +2 -1
- package/dist/shims/request-state-types.d.ts +2 -2
- package/dist/shims/router.js +14 -3
- package/dist/shims/slot.d.ts +12 -0
- package/dist/shims/slot.js +37 -9
- package/dist/shims/unified-request-context.d.ts +1 -1
- package/dist/shims/unified-request-context.js +5 -6
- package/dist/typegen.d.ts +2 -1
- package/dist/utils/cache-control-metadata.d.ts +5 -0
- package/dist/utils/cache-control-metadata.js +9 -1
- package/dist/utils/client-build-manifest.d.ts +4 -1
- package/dist/utils/client-build-manifest.js +9 -2
- 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 +9 -1
- package/dist/utils/client-runtime-metadata.js +40 -9
- package/dist/utils/compare.d.ts +9 -0
- package/dist/utils/compare.js +15 -1
- package/dist/utils/lazy-chunks.d.ts +14 -0
- package/dist/utils/lazy-chunks.js +27 -1
- package/dist/utils/middleware-request-headers.d.ts +2 -1
- package/dist/utils/project.d.ts +4 -3
- package/dist/utils/project.js +12 -17
- package/dist/utils/query.d.ts +2 -1
- package/dist/utils/regex.d.ts +5 -0
- package/dist/utils/regex.js +11 -1
- package/dist/utils/text-stream.d.ts +10 -5
- package/dist/utils/text-stream.js +6 -6
- package/dist/utils/vite-cli-invocation.d.ts +2 -1
- package/package.json +6 -5
- package/dist/build/layout-classification-types.d.ts +0 -60
- package/dist/build/layout-classification-types.js +0 -1
- package/dist/build/layout-classification.d.ts +0 -61
- package/dist/build/layout-classification.js +0 -98
- package/dist/build/route-classification-injector.d.ts +0 -32
- package/dist/build/route-classification-injector.js +0 -59
- package/dist/build/route-classification-manifest.d.ts +0 -53
- package/dist/build/route-classification-manifest.js +0 -143
- package/dist/deps/.pnpm/image-size@2.0.2/deps/image-size/dist/index.js +0 -808
- package/dist/server/app-browser-client-reuse-manifest.d.ts +0 -10
- package/dist/server/app-browser-client-reuse-manifest.js +0 -101
- package/dist/server/app-layout-param-observation.d.ts +0 -41
- package/dist/server/app-layout-param-observation.js +0 -168
- package/dist/server/client-reuse-manifest.d.ts +0 -102
- package/dist/server/client-reuse-manifest.js +0 -209
- package/dist/server/default-not-found-module.d.ts +0 -19
- package/dist/server/default-not-found-module.js +0 -18
- package/dist/server/rsc-stream-hints.d.ts +0 -21
- package/dist/server/rsc-stream-hints.js +0 -227
- package/dist/server/skip-cache-proof.d.ts +0 -60
- package/dist/server/skip-cache-proof.js +0 -168
- package/dist/server/static-layout-client-reuse-proof.d.ts +0 -13
- package/dist/server/static-layout-client-reuse-proof.js +0 -33
- package/dist/utils/sorted-array.d.ts +0 -7
- package/dist/utils/sorted-array.js +0 -20
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
//#region src/server/rsc-stream-hints.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Rewrite stylesheet preload hints in a React Flight stream.
|
|
4
|
-
*
|
|
5
|
-
* The rewrite is byte-length preserving, so this transform keeps React's
|
|
6
|
-
* text chunk boundaries instead of re-emitting one chunk per Flight row. Every
|
|
7
|
-
* downstream consumer (the tee, the SSR Flight client, the inline RSC embed,
|
|
8
|
-
* RSC response wrappers) pays a per-chunk cost, and splitting per row
|
|
9
|
-
* multiplied the chunk count roughly 8x on content-heavy pages. Chunks with
|
|
10
|
-
* no stylesheet hint are forwarded as-is without copying; only rows whose
|
|
11
|
-
* tag is `HL` are decoded and inspected. Length-prefixed bodies remain separate
|
|
12
|
-
* so binary bytes do not force adjacent text through the embed's base64 path.
|
|
13
|
-
*/
|
|
14
|
-
export declare function normalizeReactFlightPreloadHints(stream: ReadableStream<Uint8Array>, onCancel?: (reason: unknown) => void): ReadableStream<Uint8Array>;
|
|
15
|
-
export type RscRawRenderer = (model: unknown, options?: unknown) => ReadableStream<Uint8Array>;
|
|
16
|
-
export type RscRawPrerenderer = (model: unknown, options?: unknown) => Promise<{
|
|
17
|
-
prelude: ReadableStream<Uint8Array>;
|
|
18
|
-
}>;
|
|
19
|
-
export declare function createRscRenderer(render: RscRawRenderer): RscRawRenderer;
|
|
20
|
-
export declare function createRscPrerenderer(prerender: RscRawPrerenderer): RscRawPrerenderer;
|
|
21
|
-
//#endregion
|
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
import { createRenderStreamCancellation } from "./app-render-abort-error.js";
|
|
2
|
-
//#region src/server/rsc-stream-hints.ts
|
|
3
|
-
const REACT_FLIGHT_STYLESHEET_PRELOAD_HINT = /^([0-9a-f]*:HL\[.*?),"stylesheet"(\]|,)/;
|
|
4
|
-
const STYLESHEET_TO_STYLE_JSON_PADDING = " ".repeat(5);
|
|
5
|
-
const LENGTH_PREFIXED_ROW_TAGS = /* @__PURE__ */ new Set([
|
|
6
|
-
"T",
|
|
7
|
-
"A",
|
|
8
|
-
"O",
|
|
9
|
-
"o",
|
|
10
|
-
"b",
|
|
11
|
-
"U",
|
|
12
|
-
"S",
|
|
13
|
-
"s",
|
|
14
|
-
"L",
|
|
15
|
-
"l",
|
|
16
|
-
"G",
|
|
17
|
-
"g",
|
|
18
|
-
"M",
|
|
19
|
-
"m",
|
|
20
|
-
"V"
|
|
21
|
-
]);
|
|
22
|
-
const NEWLINE_PREFIXED_ROW_TAGS = /* @__PURE__ */ new Set([
|
|
23
|
-
"I",
|
|
24
|
-
"H",
|
|
25
|
-
"E",
|
|
26
|
-
"N",
|
|
27
|
-
"D",
|
|
28
|
-
"J",
|
|
29
|
-
"W",
|
|
30
|
-
"R",
|
|
31
|
-
"r",
|
|
32
|
-
"X",
|
|
33
|
-
"x",
|
|
34
|
-
"C",
|
|
35
|
-
"P",
|
|
36
|
-
"#"
|
|
37
|
-
]);
|
|
38
|
-
const decoder = new TextDecoder();
|
|
39
|
-
const encoder = new TextEncoder();
|
|
40
|
-
/** Rewrite only a complete React Flight stylesheet hint row. */
|
|
41
|
-
function normalizeReactFlightHintLine(line) {
|
|
42
|
-
const text = decoder.decode(line);
|
|
43
|
-
const normalized = text.replace(REACT_FLIGHT_STYLESHEET_PRELOAD_HINT, `$1,"style"${STYLESHEET_TO_STYLE_JSON_PADDING}$2`);
|
|
44
|
-
if (normalized === text) return line;
|
|
45
|
-
const normalizedBytes = encoder.encode(normalized);
|
|
46
|
-
return normalizedBytes.byteLength === line.byteLength ? normalizedBytes : line;
|
|
47
|
-
}
|
|
48
|
-
function concatBytes(first, second) {
|
|
49
|
-
if (first.byteLength === 0) return second;
|
|
50
|
-
const combined = new Uint8Array(first.byteLength + second.byteLength);
|
|
51
|
-
combined.set(first);
|
|
52
|
-
combined.set(second, first.byteLength);
|
|
53
|
-
return combined;
|
|
54
|
-
}
|
|
55
|
-
function indexOfByte(bytes, byte, from) {
|
|
56
|
-
for (let index = from; index < bytes.byteLength; index++) if (bytes[index] === byte) return index;
|
|
57
|
-
return -1;
|
|
58
|
-
}
|
|
59
|
-
function utf8CompleteEnd(bytes, from) {
|
|
60
|
-
const length = bytes.byteLength;
|
|
61
|
-
for (let index = length - 1; index >= from && index >= length - 3; index--) {
|
|
62
|
-
const byte = bytes[index];
|
|
63
|
-
if ((byte & 192) === 128) continue;
|
|
64
|
-
return index + (byte >= 240 ? 4 : byte >= 224 ? 3 : byte >= 192 ? 2 : 1) > length ? index : length;
|
|
65
|
-
}
|
|
66
|
-
return length;
|
|
67
|
-
}
|
|
68
|
-
function parseHexBytes(bytes, start, end) {
|
|
69
|
-
if (start === end) return null;
|
|
70
|
-
let value = 0;
|
|
71
|
-
for (let index = start; index < end; index++) {
|
|
72
|
-
const byte = bytes[index];
|
|
73
|
-
const digit = byte >= 48 && byte <= 57 ? byte - 48 : byte >= 97 && byte <= 102 ? byte - 87 : -1;
|
|
74
|
-
if (digit === -1) return null;
|
|
75
|
-
value = value * 16 + digit;
|
|
76
|
-
if (!Number.isSafeInteger(value)) return null;
|
|
77
|
-
}
|
|
78
|
-
return value;
|
|
79
|
-
}
|
|
80
|
-
function isUntaggedJsonRowStart(byte) {
|
|
81
|
-
return byte === 34 || byte === 45 || byte >= 48 && byte <= 57 || byte === 91 || byte === 102 || byte === 110 || byte === 116 || byte === 123;
|
|
82
|
-
}
|
|
83
|
-
const COLON_BYTE = 58;
|
|
84
|
-
const COMMA_BYTE = 44;
|
|
85
|
-
const NEWLINE_BYTE = 10;
|
|
86
|
-
const HINT_TAG_BYTE = 72;
|
|
87
|
-
const LINK_HINT_CODE_BYTE = 76;
|
|
88
|
-
function createAsciiTagTable(tags) {
|
|
89
|
-
const table = /* @__PURE__ */ new Uint8Array(128);
|
|
90
|
-
for (const tag of tags) table[tag.charCodeAt(0)] = 1;
|
|
91
|
-
return table;
|
|
92
|
-
}
|
|
93
|
-
const LENGTH_PREFIXED_ROW_TAG_TABLE = createAsciiTagTable(LENGTH_PREFIXED_ROW_TAGS);
|
|
94
|
-
const NEWLINE_PREFIXED_ROW_TAG_TABLE = createAsciiTagTable(NEWLINE_PREFIXED_ROW_TAGS);
|
|
95
|
-
function isTagInTable(table, byte) {
|
|
96
|
-
return byte < 128 && table[byte] === 1;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Rewrite stylesheet preload hints in a React Flight stream.
|
|
100
|
-
*
|
|
101
|
-
* The rewrite is byte-length preserving, so this transform keeps React's
|
|
102
|
-
* text chunk boundaries instead of re-emitting one chunk per Flight row. Every
|
|
103
|
-
* downstream consumer (the tee, the SSR Flight client, the inline RSC embed,
|
|
104
|
-
* RSC response wrappers) pays a per-chunk cost, and splitting per row
|
|
105
|
-
* multiplied the chunk count roughly 8x on content-heavy pages. Chunks with
|
|
106
|
-
* no stylesheet hint are forwarded as-is without copying; only rows whose
|
|
107
|
-
* tag is `HL` are decoded and inspected. Length-prefixed bodies remain separate
|
|
108
|
-
* so binary bytes do not force adjacent text through the embed's base64 path.
|
|
109
|
-
*/
|
|
110
|
-
function normalizeReactFlightPreloadHints(stream, onCancel) {
|
|
111
|
-
let carry = null;
|
|
112
|
-
let rawBytesRemaining = 0;
|
|
113
|
-
let passThrough = false;
|
|
114
|
-
let inPlainRow = false;
|
|
115
|
-
return stream.pipeThrough(new TransformStream({
|
|
116
|
-
transform(chunk, controller) {
|
|
117
|
-
if (passThrough) {
|
|
118
|
-
controller.enqueue(chunk);
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
let start = 0;
|
|
122
|
-
if (inPlainRow) {
|
|
123
|
-
const end = indexOfByte(chunk, NEWLINE_BYTE, 0);
|
|
124
|
-
if (end === -1) {
|
|
125
|
-
const bytes = carry === null ? chunk : concatBytes(carry, chunk);
|
|
126
|
-
const complete = utf8CompleteEnd(bytes, 0);
|
|
127
|
-
carry = complete === bytes.byteLength ? null : bytes.slice(complete);
|
|
128
|
-
if (complete > 0) controller.enqueue(complete === bytes.byteLength ? bytes : bytes.subarray(0, complete));
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
inPlainRow = false;
|
|
132
|
-
start = (carry === null ? 0 : carry.byteLength) + end + 1;
|
|
133
|
-
}
|
|
134
|
-
const bytes = carry === null ? chunk : concatBytes(carry, chunk);
|
|
135
|
-
carry = null;
|
|
136
|
-
const byteLength = bytes.byteLength;
|
|
137
|
-
let offset = start;
|
|
138
|
-
let emittedThrough = 0;
|
|
139
|
-
let output = bytes;
|
|
140
|
-
let ownsOutput = bytes !== chunk;
|
|
141
|
-
while (offset < byteLength) {
|
|
142
|
-
if (rawBytesRemaining > 0) {
|
|
143
|
-
const length = Math.min(rawBytesRemaining, byteLength - offset);
|
|
144
|
-
if (offset > emittedThrough) controller.enqueue(output.subarray(emittedThrough, offset));
|
|
145
|
-
controller.enqueue(bytes.subarray(offset, offset + length));
|
|
146
|
-
rawBytesRemaining -= length;
|
|
147
|
-
offset += length;
|
|
148
|
-
emittedThrough = offset;
|
|
149
|
-
continue;
|
|
150
|
-
}
|
|
151
|
-
const colon = indexOfByte(bytes, COLON_BYTE, offset);
|
|
152
|
-
if (colon === -1 || colon + 1 === byteLength) break;
|
|
153
|
-
const tagByte = bytes[colon + 1];
|
|
154
|
-
if (isTagInTable(LENGTH_PREFIXED_ROW_TAG_TABLE, tagByte)) {
|
|
155
|
-
const comma = indexOfByte(bytes, COMMA_BYTE, colon + 2);
|
|
156
|
-
if (comma === -1) break;
|
|
157
|
-
const length = parseHexBytes(bytes, colon + 2, comma);
|
|
158
|
-
if (length != null) {
|
|
159
|
-
rawBytesRemaining = length;
|
|
160
|
-
offset = comma + 1;
|
|
161
|
-
continue;
|
|
162
|
-
}
|
|
163
|
-
passThrough = true;
|
|
164
|
-
offset = byteLength;
|
|
165
|
-
break;
|
|
166
|
-
}
|
|
167
|
-
if (!isTagInTable(NEWLINE_PREFIXED_ROW_TAG_TABLE, tagByte) && !isUntaggedJsonRowStart(tagByte)) {
|
|
168
|
-
passThrough = true;
|
|
169
|
-
offset = byteLength;
|
|
170
|
-
break;
|
|
171
|
-
}
|
|
172
|
-
const newline = indexOfByte(bytes, NEWLINE_BYTE, offset);
|
|
173
|
-
if (newline === -1) {
|
|
174
|
-
if (!(tagByte === HINT_TAG_BYTE && (colon + 2 === byteLength || bytes[colon + 2] === LINK_HINT_CODE_BYTE))) {
|
|
175
|
-
inPlainRow = true;
|
|
176
|
-
offset = utf8CompleteEnd(bytes, offset);
|
|
177
|
-
}
|
|
178
|
-
break;
|
|
179
|
-
}
|
|
180
|
-
if (tagByte === HINT_TAG_BYTE && bytes[colon + 2] === LINK_HINT_CODE_BYTE) {
|
|
181
|
-
const line = bytes.subarray(offset, newline + 1);
|
|
182
|
-
const normalized = normalizeReactFlightHintLine(line);
|
|
183
|
-
if (normalized !== line) {
|
|
184
|
-
if (!ownsOutput) {
|
|
185
|
-
output = bytes.slice();
|
|
186
|
-
ownsOutput = true;
|
|
187
|
-
}
|
|
188
|
-
output.set(normalized, offset);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
offset = newline + 1;
|
|
192
|
-
}
|
|
193
|
-
if (offset < byteLength) carry = bytes.slice(offset);
|
|
194
|
-
if (offset > emittedThrough) controller.enqueue(offset === byteLength && emittedThrough === 0 ? output : output.subarray(emittedThrough, offset));
|
|
195
|
-
},
|
|
196
|
-
flush(controller) {
|
|
197
|
-
if (carry !== null && carry.byteLength > 0) controller.enqueue(rawBytesRemaining > 0 ? carry : normalizeReactFlightHintLine(carry));
|
|
198
|
-
},
|
|
199
|
-
cancel: onCancel
|
|
200
|
-
}));
|
|
201
|
-
}
|
|
202
|
-
function createRscRenderer(render) {
|
|
203
|
-
return (model, options) => {
|
|
204
|
-
const cancellation = createRenderStreamCancellation();
|
|
205
|
-
return normalizeReactFlightPreloadHints(render(model, ignoreCancellationErrors(options, cancellation)), cancellation.record);
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
/** A consumer cancelling the payload is not a render failure. */
|
|
209
|
-
function ignoreCancellationErrors(options, cancellation) {
|
|
210
|
-
if (!options || typeof options !== "object") return options;
|
|
211
|
-
const onError = Reflect.get(options, "onError");
|
|
212
|
-
if (typeof onError !== "function") return options;
|
|
213
|
-
return {
|
|
214
|
-
...options,
|
|
215
|
-
onError(error, ...rest) {
|
|
216
|
-
if (cancellation.isReason(error)) return void 0;
|
|
217
|
-
return Reflect.apply(onError, options, [error, ...rest]);
|
|
218
|
-
}
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
function createRscPrerenderer(prerender) {
|
|
222
|
-
return async (model, options) => {
|
|
223
|
-
return { prelude: normalizeReactFlightPreloadHints((await prerender(model, options)).prelude) };
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
//#endregion
|
|
227
|
-
export { createRscPrerenderer, createRscRenderer, normalizeReactFlightPreloadHints };
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { ArtifactCompatibilityEnvelope, ArtifactCompatibilityEvaluationOptions } from "./artifact-compatibility.js";
|
|
2
|
-
import { StaticLayoutArtifactReuseDecision } from "./cache-proof.js";
|
|
3
|
-
import { ClientReuseManifestEntry, ClientReuseManifestEntryRejection, ClientReuseManifestParseResult, ClientReuseManifestRejection, ClientReuseManifestSkipDisposition, ClientReuseManifestTraceFields } from "./client-reuse-manifest.js";
|
|
4
|
-
import { createStaticLayoutClientReuseArtifactCompatibility, createStaticLayoutClientReusePayloadHash, createStaticLayoutClientReuseRouteId } from "./static-layout-client-reuse-proof.js";
|
|
5
|
-
//#region src/server/skip-cache-proof.d.ts
|
|
6
|
-
export type SkipCacheInvalidationProof = Readonly<{
|
|
7
|
-
kind: "invalidated";
|
|
8
|
-
invalidationEpoch: string | null;
|
|
9
|
-
}> | Readonly<{
|
|
10
|
-
kind: "unknown";
|
|
11
|
-
}> | Readonly<{
|
|
12
|
-
kind: "valid";
|
|
13
|
-
}>;
|
|
14
|
-
type SkipCacheArtifactProof = Readonly<{
|
|
15
|
-
compatibility: ArtifactCompatibilityEnvelope;
|
|
16
|
-
invalidation: SkipCacheInvalidationProof;
|
|
17
|
-
payloadHash: string | null;
|
|
18
|
-
}>;
|
|
19
|
-
type SkipCacheCrossCheckAcceptanceCode = "SKIP_CACHE_CROSS_CHECK_PASSED";
|
|
20
|
-
type SkipCacheCrossCheckVerified = Readonly<{
|
|
21
|
-
code: SkipCacheCrossCheckAcceptanceCode;
|
|
22
|
-
entryId: string;
|
|
23
|
-
fields: ClientReuseManifestTraceFields;
|
|
24
|
-
kind: "verified";
|
|
25
|
-
skipDisposition: ClientReuseManifestSkipDisposition;
|
|
26
|
-
}>;
|
|
27
|
-
type SkipCacheCrossCheckRejected = Readonly<{
|
|
28
|
-
kind: "rejected";
|
|
29
|
-
rejection: ClientReuseManifestEntryRejection;
|
|
30
|
-
skipDisposition: ClientReuseManifestSkipDisposition;
|
|
31
|
-
}>;
|
|
32
|
-
type SkipCacheCrossCheckResult = SkipCacheCrossCheckRejected | SkipCacheCrossCheckVerified;
|
|
33
|
-
type CrossCheckClientReuseManifestEntryWithCacheInput = Readonly<{
|
|
34
|
-
artifact: SkipCacheArtifactProof;
|
|
35
|
-
cacheDecision: StaticLayoutArtifactReuseDecision | null;
|
|
36
|
-
entry: ClientReuseManifestEntry;
|
|
37
|
-
}> & ArtifactCompatibilityEvaluationOptions;
|
|
38
|
-
type ClientReuseSkipTransportPlan = Readonly<{
|
|
39
|
-
entryRejections: readonly ClientReuseManifestEntryRejection[];
|
|
40
|
-
kind: "renderAndSend";
|
|
41
|
-
manifestRejection?: ClientReuseManifestRejection;
|
|
42
|
-
skipDisposition: ClientReuseManifestSkipDisposition;
|
|
43
|
-
skipIneligibleEntryIds: readonly string[];
|
|
44
|
-
skippedEntryIds: readonly string[];
|
|
45
|
-
}> | Readonly<{
|
|
46
|
-
entryRejections: readonly ClientReuseManifestEntryRejection[];
|
|
47
|
-
kind: "skip";
|
|
48
|
-
skipDisposition: ClientReuseManifestSkipDisposition;
|
|
49
|
-
skipIneligibleEntryIds: readonly string[];
|
|
50
|
-
skippedEntryIds: readonly string[];
|
|
51
|
-
}>;
|
|
52
|
-
type CreateClientReuseSkipTransportPlanInput = Readonly<{
|
|
53
|
-
manifest: ClientReuseManifestParseResult;
|
|
54
|
-
maxWireEntriesToVerify?: number;
|
|
55
|
-
verifyEntry: (entry: ClientReuseManifestEntry) => SkipCacheCrossCheckResult;
|
|
56
|
-
}>;
|
|
57
|
-
export declare function crossCheckClientReuseManifestEntryWithCache(input: CrossCheckClientReuseManifestEntryWithCacheInput): SkipCacheCrossCheckResult;
|
|
58
|
-
export declare function createClientReuseSkipTransportPlan(input: CreateClientReuseSkipTransportPlanInput): ClientReuseSkipTransportPlan;
|
|
59
|
-
//#endregion
|
|
60
|
-
export { createStaticLayoutClientReuseArtifactCompatibility, createStaticLayoutClientReusePayloadHash, createStaticLayoutClientReuseRouteId };
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { ARTIFACT_COMPATIBILITY_PROOF_FIELDS, evaluateArtifactCompatibility } from "./artifact-compatibility.js";
|
|
2
|
-
import { createClientReusePayloadHash } from "./client-reuse-manifest.js";
|
|
3
|
-
import { createStaticLayoutClientReuseArtifactCompatibility, createStaticLayoutClientReusePayloadHash, createStaticLayoutClientReuseRouteId } from "./static-layout-client-reuse-proof.js";
|
|
4
|
-
//#region src/server/skip-cache-proof.ts
|
|
5
|
-
function createDisabledSkipDisposition() {
|
|
6
|
-
return {
|
|
7
|
-
code: "SKIP_MODEL_DISABLED",
|
|
8
|
-
enabled: false,
|
|
9
|
-
mode: "renderAndSend"
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
function createStaticLayoutSkipDisposition(skippedEntryIds) {
|
|
13
|
-
return {
|
|
14
|
-
code: "SKIP_STATIC_LAYOUT_VERIFIED",
|
|
15
|
-
enabled: true,
|
|
16
|
-
mode: "skipStaticLayout",
|
|
17
|
-
skippedEntryIds: [...skippedEntryIds]
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
function rejectSkipCacheCrossCheck(entry, code, fields = {}) {
|
|
21
|
-
return {
|
|
22
|
-
kind: "rejected",
|
|
23
|
-
rejection: {
|
|
24
|
-
code,
|
|
25
|
-
entryId: entry.id,
|
|
26
|
-
fields
|
|
27
|
-
},
|
|
28
|
-
skipDisposition: createDisabledSkipDisposition()
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
function collectArtifactCompatibilityProofMismatches(artifactCompatibility, proofCompatibility) {
|
|
32
|
-
const mismatchedFields = [];
|
|
33
|
-
for (const field of ARTIFACT_COMPATIBILITY_PROOF_FIELDS) if (artifactCompatibility[field] !== proofCompatibility[field]) mismatchedFields.push(field);
|
|
34
|
-
return mismatchedFields;
|
|
35
|
-
}
|
|
36
|
-
function isExactArtifactCompatibility(artifactCompatibility, entryCompatibility) {
|
|
37
|
-
return collectArtifactCompatibilityProofMismatches(artifactCompatibility, entryCompatibility).length === 0;
|
|
38
|
-
}
|
|
39
|
-
function assertNever(value) {
|
|
40
|
-
throw new Error(`Unhandled skip/cache proof state: ${String(value)}`);
|
|
41
|
-
}
|
|
42
|
-
function createRenderAndSendPlan(options) {
|
|
43
|
-
return {
|
|
44
|
-
kind: "renderAndSend",
|
|
45
|
-
entryRejections: options.entryRejections ?? [],
|
|
46
|
-
...options.manifestRejection ? { manifestRejection: options.manifestRejection } : {},
|
|
47
|
-
skipDisposition: createDisabledSkipDisposition(),
|
|
48
|
-
skipIneligibleEntryIds: options.skipIneligibleEntryIds ?? [],
|
|
49
|
-
skippedEntryIds: []
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
function createVerificationBudgetExceededRejection(totalWireEntries, maxWireEntriesToVerify) {
|
|
53
|
-
return {
|
|
54
|
-
code: "SKIP_VERIFICATION_BUDGET_EXCEEDED",
|
|
55
|
-
fields: {
|
|
56
|
-
totalWireEntries,
|
|
57
|
-
maxWireEntriesToVerify
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
function crossCheckInvalidationProof(entry, invalidation) {
|
|
62
|
-
switch (invalidation.kind) {
|
|
63
|
-
case "valid": return null;
|
|
64
|
-
case "unknown": return rejectSkipCacheCrossCheck(entry, "SKIP_CACHE_INVALIDATION_UNKNOWN");
|
|
65
|
-
case "invalidated": return rejectSkipCacheCrossCheck(entry, "SKIP_CACHE_INVALIDATED", { invalidationEpoch: invalidation.invalidationEpoch });
|
|
66
|
-
default: return assertNever(invalidation);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
function crossCheckClientReuseManifestEntryWithCache(input) {
|
|
70
|
-
const { cacheDecision, entry } = input;
|
|
71
|
-
if (cacheDecision === null) return rejectSkipCacheCrossCheck(entry, "SKIP_CACHE_PROOF_MISSING");
|
|
72
|
-
if (cacheDecision.kind === "fallback") return rejectSkipCacheCrossCheck(entry, "SKIP_CACHE_PROOF_REJECTED", {
|
|
73
|
-
cacheProofCode: cacheDecision.fallback.code,
|
|
74
|
-
cacheProofMode: cacheDecision.fallback.mode,
|
|
75
|
-
cacheProofScope: cacheDecision.fallback.scope
|
|
76
|
-
});
|
|
77
|
-
const { proof } = cacheDecision;
|
|
78
|
-
if (entry.kind !== "layout" || proof.reuseClass !== "static-layout") return rejectSkipCacheCrossCheck(entry, "SKIP_CACHE_REUSE_CLASS_UNSUPPORTED", {
|
|
79
|
-
entryKind: entry.kind,
|
|
80
|
-
reuseClass: proof.reuseClass
|
|
81
|
-
});
|
|
82
|
-
if (entry.id !== proof.candidateOutput.layoutId) return rejectSkipCacheCrossCheck(entry, "SKIP_CACHE_ENTRY_ID_MISMATCH", {
|
|
83
|
-
cacheEntryId: proof.candidateOutput.layoutId,
|
|
84
|
-
manifestEntryId: entry.id
|
|
85
|
-
});
|
|
86
|
-
const artifactProofMismatches = collectArtifactCompatibilityProofMismatches(input.artifact.compatibility, proof.candidateArtifactCompatibility);
|
|
87
|
-
if (artifactProofMismatches.length > 0) return rejectSkipCacheCrossCheck(entry, "SKIP_CACHE_ARTIFACT_PROOF_MISMATCH", { mismatchedFields: artifactProofMismatches });
|
|
88
|
-
const artifactCompatibility = evaluateArtifactCompatibility(input.artifact.compatibility, entry.artifactCompatibility, { compatibilityMap: input.compatibilityMap });
|
|
89
|
-
if (artifactCompatibility.kind === "unknown") return rejectSkipCacheCrossCheck(entry, "SKIP_CACHE_ARTIFACT_COMPATIBILITY_UNKNOWN", {
|
|
90
|
-
compatibilityFallback: artifactCompatibility.fallback,
|
|
91
|
-
reason: artifactCompatibility.reason
|
|
92
|
-
});
|
|
93
|
-
if (artifactCompatibility.kind === "incompatible") return rejectSkipCacheCrossCheck(entry, "SKIP_CACHE_ARTIFACT_COMPATIBILITY_INCOMPATIBLE", {
|
|
94
|
-
compatibilityFallback: artifactCompatibility.fallback,
|
|
95
|
-
reason: artifactCompatibility.reason
|
|
96
|
-
});
|
|
97
|
-
if (entry.variantCacheKey !== proof.variant.cacheKey) return rejectSkipCacheCrossCheck(entry, "SKIP_CACHE_VARIANT_MISMATCH", {
|
|
98
|
-
cacheVariantCacheKeyHash: createClientReusePayloadHash(proof.variant.cacheKey),
|
|
99
|
-
entryVariantCacheKeyHash: createClientReusePayloadHash(entry.variantCacheKey)
|
|
100
|
-
});
|
|
101
|
-
if (input.artifact.payloadHash === null) return rejectSkipCacheCrossCheck(entry, "SKIP_CACHE_PAYLOAD_HASH_MISSING");
|
|
102
|
-
if (entry.payloadHash !== input.artifact.payloadHash) return rejectSkipCacheCrossCheck(entry, "SKIP_CACHE_PAYLOAD_HASH_MISMATCH", {
|
|
103
|
-
cachePayloadHash: input.artifact.payloadHash,
|
|
104
|
-
entryPayloadHash: entry.payloadHash
|
|
105
|
-
});
|
|
106
|
-
const invalidationRejection = crossCheckInvalidationProof(entry, input.artifact.invalidation);
|
|
107
|
-
if (invalidationRejection) return invalidationRejection;
|
|
108
|
-
const skipDisposition = isExactArtifactCompatibility(input.artifact.compatibility, entry.artifactCompatibility) ? createStaticLayoutSkipDisposition([entry.id]) : createDisabledSkipDisposition();
|
|
109
|
-
return {
|
|
110
|
-
kind: "verified",
|
|
111
|
-
code: "SKIP_CACHE_CROSS_CHECK_PASSED",
|
|
112
|
-
entryId: entry.id,
|
|
113
|
-
fields: {
|
|
114
|
-
entryKind: entry.kind,
|
|
115
|
-
reuseClass: proof.reuseClass,
|
|
116
|
-
variantCacheKeyHash: createClientReusePayloadHash(proof.variant.cacheKey)
|
|
117
|
-
},
|
|
118
|
-
skipDisposition
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
function createClientReuseSkipTransportPlan(input) {
|
|
122
|
-
const { manifest } = input;
|
|
123
|
-
if (manifest.kind === "absent") return createRenderAndSendPlan({});
|
|
124
|
-
if (manifest.kind === "rejected") return createRenderAndSendPlan({ manifestRejection: manifest.rejection });
|
|
125
|
-
const maxWireEntriesToVerify = input.maxWireEntriesToVerify ?? 8;
|
|
126
|
-
if (!Number.isSafeInteger(maxWireEntriesToVerify) || maxWireEntriesToVerify < 0) throw new RangeError("maxWireEntriesToVerify must be a non-negative safe integer");
|
|
127
|
-
const totalWireEntries = manifest.manifest.entries.length + manifest.entryRejections.length;
|
|
128
|
-
if (totalWireEntries > maxWireEntriesToVerify) return createRenderAndSendPlan({
|
|
129
|
-
entryRejections: manifest.entryRejections,
|
|
130
|
-
manifestRejection: createVerificationBudgetExceededRejection(totalWireEntries, maxWireEntriesToVerify)
|
|
131
|
-
});
|
|
132
|
-
const skippedEntryIds = [];
|
|
133
|
-
const skipIneligibleEntryIds = [];
|
|
134
|
-
const entryRejections = [...manifest.entryRejections];
|
|
135
|
-
for (const entry of manifest.manifest.entries) {
|
|
136
|
-
const verification = input.verifyEntry(entry);
|
|
137
|
-
if (verification.kind === "rejected") {
|
|
138
|
-
entryRejections.push(verification.rejection);
|
|
139
|
-
continue;
|
|
140
|
-
}
|
|
141
|
-
if (verification.entryId !== entry.id) {
|
|
142
|
-
entryRejections.push({
|
|
143
|
-
code: "SKIP_CACHE_ENTRY_ID_MISMATCH",
|
|
144
|
-
entryId: entry.id,
|
|
145
|
-
fields: {
|
|
146
|
-
verifierEntryId: verification.entryId,
|
|
147
|
-
manifestEntryId: entry.id
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
continue;
|
|
151
|
-
}
|
|
152
|
-
if (verification.skipDisposition.enabled) skippedEntryIds.push(entry.id);
|
|
153
|
-
else skipIneligibleEntryIds.push(entry.id);
|
|
154
|
-
}
|
|
155
|
-
if (skippedEntryIds.length === 0) return createRenderAndSendPlan({
|
|
156
|
-
entryRejections,
|
|
157
|
-
skipIneligibleEntryIds
|
|
158
|
-
});
|
|
159
|
-
return {
|
|
160
|
-
kind: "skip",
|
|
161
|
-
entryRejections,
|
|
162
|
-
skipDisposition: createStaticLayoutSkipDisposition(skippedEntryIds),
|
|
163
|
-
skipIneligibleEntryIds,
|
|
164
|
-
skippedEntryIds
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
//#endregion
|
|
168
|
-
export { createClientReuseSkipTransportPlan, createStaticLayoutClientReuseArtifactCompatibility, createStaticLayoutClientReusePayloadHash, createStaticLayoutClientReuseRouteId, crossCheckClientReuseManifestEntryWithCache };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ArtifactCompatibilityEnvelope } from "./artifact-compatibility.js";
|
|
2
|
-
//#region src/server/static-layout-client-reuse-proof.d.ts
|
|
3
|
-
type StaticLayoutClientReuseProofInput = Readonly<{
|
|
4
|
-
artifactCompatibility: ArtifactCompatibilityEnvelope;
|
|
5
|
-
layoutId: string;
|
|
6
|
-
rootBoundaryId: string | null;
|
|
7
|
-
routeId: string;
|
|
8
|
-
variantCacheKey: string;
|
|
9
|
-
}>;
|
|
10
|
-
export declare function createStaticLayoutClientReuseRouteId(layoutId: string): string;
|
|
11
|
-
export declare function createStaticLayoutClientReusePayloadHash(input: StaticLayoutClientReuseProofInput): string;
|
|
12
|
-
export declare function createStaticLayoutClientReuseArtifactCompatibility(input: StaticLayoutClientReuseProofInput): ArtifactCompatibilityEnvelope;
|
|
13
|
-
//#endregion
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { ARTIFACT_COMPATIBILITY_PROOF_FIELDS } from "./artifact-compatibility.js";
|
|
2
|
-
import { createClientReusePayloadHash } from "./client-reuse-manifest.js";
|
|
3
|
-
//#region src/server/static-layout-client-reuse-proof.ts
|
|
4
|
-
function createStaticLayoutClientReuseRouteId(layoutId) {
|
|
5
|
-
return `static-layout:${createClientReusePayloadHash(layoutId)}`;
|
|
6
|
-
}
|
|
7
|
-
function createCanonicalProofPairs(input) {
|
|
8
|
-
return ARTIFACT_COMPATIBILITY_PROOF_FIELDS.map((field) => [field, input.artifactCompatibility[field]]);
|
|
9
|
-
}
|
|
10
|
-
function createStaticLayoutClientReusePayloadHash(input) {
|
|
11
|
-
return createClientReusePayloadHash(JSON.stringify({
|
|
12
|
-
artifactCompatibilityPairs: createCanonicalProofPairs(input),
|
|
13
|
-
layoutId: input.layoutId,
|
|
14
|
-
rootBoundaryId: input.rootBoundaryId,
|
|
15
|
-
variantCacheKey: input.variantCacheKey
|
|
16
|
-
}));
|
|
17
|
-
}
|
|
18
|
-
function createStaticLayoutClientReuseArtifactCompatibility(input) {
|
|
19
|
-
return {
|
|
20
|
-
...input.artifactCompatibility,
|
|
21
|
-
graphVersion: `static-layout-graph:${createClientReusePayloadHash(JSON.stringify({
|
|
22
|
-
layoutId: input.layoutId,
|
|
23
|
-
rootBoundaryId: input.rootBoundaryId
|
|
24
|
-
}))}`,
|
|
25
|
-
renderEpoch: `static-layout:${createClientReusePayloadHash(JSON.stringify({
|
|
26
|
-
layoutId: input.layoutId,
|
|
27
|
-
rootBoundaryId: input.rootBoundaryId,
|
|
28
|
-
variantCacheKey: input.variantCacheKey
|
|
29
|
-
}))}`
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
//#endregion
|
|
33
|
-
export { createStaticLayoutClientReuseArtifactCompatibility, createStaticLayoutClientReusePayloadHash, createStaticLayoutClientReuseRouteId };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
//#region src/utils/sorted-array.ts
|
|
2
|
-
function findSortedStringPosition(values, candidate) {
|
|
3
|
-
let lower = 0;
|
|
4
|
-
let upper = values.length;
|
|
5
|
-
while (lower < upper) {
|
|
6
|
-
const middle = lower + Math.floor((upper - lower) / 2);
|
|
7
|
-
if (values[middle] === candidate) return {
|
|
8
|
-
found: true,
|
|
9
|
-
index: middle
|
|
10
|
-
};
|
|
11
|
-
if (values[middle] < candidate) lower = middle + 1;
|
|
12
|
-
else upper = middle;
|
|
13
|
-
}
|
|
14
|
-
return {
|
|
15
|
-
found: false,
|
|
16
|
-
index: lower
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
//#endregion
|
|
20
|
-
export { findSortedStringPosition };
|