@timber-js/app 0.2.0-alpha.19 → 0.2.0-alpha.191
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/LICENSE +8 -0
- package/agent-skill.md +344 -0
- package/dist/_chunks/actions-BjbbNRFN.js +318 -0
- package/dist/_chunks/actions-BjbbNRFN.js.map +1 -0
- package/dist/_chunks/als-registry-C6kcfprT.js +41 -0
- package/dist/_chunks/als-registry-C6kcfprT.js.map +1 -0
- package/dist/_chunks/als-slots-BEEIPKYm.js +26 -0
- package/dist/_chunks/als-slots-BEEIPKYm.js.map +1 -0
- package/dist/_chunks/base-path-DaQrzbez.js +80 -0
- package/dist/_chunks/base-path-DaQrzbez.js.map +1 -0
- package/dist/_chunks/build-manifest-DWppEdLB.js +86 -0
- package/dist/_chunks/build-manifest-DWppEdLB.js.map +1 -0
- package/dist/_chunks/build-output-helper-C3DrfzZR.js +369 -0
- package/dist/_chunks/build-output-helper-C3DrfzZR.js.map +1 -0
- package/dist/_chunks/cache-api-DllJ-Lyw.js +1196 -0
- package/dist/_chunks/cache-api-DllJ-Lyw.js.map +1 -0
- package/dist/_chunks/cli-check-DJZDc22E.js +256 -0
- package/dist/_chunks/cli-check-DJZDc22E.js.map +1 -0
- package/dist/_chunks/cli-schema-sync-D4_AZVUb.js +298 -0
- package/dist/_chunks/cli-schema-sync-D4_AZVUb.js.map +1 -0
- package/dist/_chunks/cloudflare-CGP6BZKO.js +1284 -0
- package/dist/_chunks/cloudflare-CGP6BZKO.js.map +1 -0
- package/dist/_chunks/codec-registry-oOUxugz3.js +21 -0
- package/dist/_chunks/codec-registry-oOUxugz3.js.map +1 -0
- package/dist/_chunks/convention-lint-CpteIpTm.js +784 -0
- package/dist/_chunks/convention-lint-CpteIpTm.js.map +1 -0
- package/dist/_chunks/dist-BA3u1z3W.js +423 -0
- package/dist/_chunks/dist-BA3u1z3W.js.map +1 -0
- package/dist/_chunks/error-boundary-D-ODYX41.js +353 -0
- package/dist/_chunks/error-boundary-D-ODYX41.js.map +1 -0
- package/dist/_chunks/fast-hash-C-tVYrLb.js +41 -0
- package/dist/_chunks/fast-hash-C-tVYrLb.js.map +1 -0
- package/dist/_chunks/file-cache-DmX7OqZP.js +454 -0
- package/dist/_chunks/file-cache-DmX7OqZP.js.map +1 -0
- package/dist/_chunks/format-CfwjgPz9.js +14 -0
- package/dist/_chunks/format-CfwjgPz9.js.map +1 -0
- package/dist/_chunks/fs-identity-D7vb6GdI.js +208 -0
- package/dist/_chunks/fs-identity-D7vb6GdI.js.map +1 -0
- package/dist/_chunks/href-validation-CMc5JRls.js +141 -0
- package/dist/_chunks/href-validation-CMc5JRls.js.map +1 -0
- package/dist/_chunks/json-lossy-check-ClNvBM_3.js +63 -0
- package/dist/_chunks/json-lossy-check-ClNvBM_3.js.map +1 -0
- package/dist/_chunks/logger-CH7IcMmg.js +1436 -0
- package/dist/_chunks/logger-CH7IcMmg.js.map +1 -0
- package/dist/_chunks/mdx-file-C005ay-P.js +25 -0
- package/dist/_chunks/mdx-file-C005ay-P.js.map +1 -0
- package/dist/_chunks/plugin-context-rCinWLiE.js +321 -0
- package/dist/_chunks/plugin-context-rCinWLiE.js.map +1 -0
- package/dist/_chunks/purge-store-Byr8XOjU.js +14 -0
- package/dist/_chunks/purge-store-Byr8XOjU.js.map +1 -0
- package/dist/_chunks/resolve-schema-CBR6Lm4i.js +50 -0
- package/dist/_chunks/resolve-schema-CBR6Lm4i.js.map +1 -0
- package/dist/_chunks/router-ref-DuYuV_0Q.js +28 -0
- package/dist/_chunks/router-ref-DuYuV_0Q.js.map +1 -0
- package/dist/_chunks/rsc-cache-key-DD0fl_-s.js +243 -0
- package/dist/_chunks/rsc-cache-key-DD0fl_-s.js.map +1 -0
- package/dist/_chunks/rsc-error-envelope-tT5PJs4q.js +40 -0
- package/dist/_chunks/rsc-error-envelope-tT5PJs4q.js.map +1 -0
- package/dist/_chunks/rsc-media-type-DRqE_lD_.js +46 -0
- package/dist/_chunks/rsc-media-type-DRqE_lD_.js.map +1 -0
- package/dist/_chunks/rsc-payload-path-B_LBodc2.js +48 -0
- package/dist/_chunks/rsc-payload-path-B_LBodc2.js.map +1 -0
- package/dist/_chunks/scanner-CAietmj4.js +1564 -0
- package/dist/_chunks/scanner-CAietmj4.js.map +1 -0
- package/dist/_chunks/schema-bridge-C83xa9lT.js +199 -0
- package/dist/_chunks/schema-bridge-C83xa9lT.js.map +1 -0
- package/dist/_chunks/segment-classify-C539Pa2O.js +197 -0
- package/dist/_chunks/segment-classify-C539Pa2O.js.map +1 -0
- package/dist/_chunks/segment-context-CjOlyB8Y.js +97 -0
- package/dist/_chunks/segment-context-CjOlyB8Y.js.map +1 -0
- package/dist/_chunks/segment-keys-BawYuNFO.js +307 -0
- package/dist/_chunks/segment-keys-BawYuNFO.js.map +1 -0
- package/dist/_chunks/sizeof-lXffQ1Vr.js +35 -0
- package/dist/_chunks/sizeof-lXffQ1Vr.js.map +1 -0
- package/dist/_chunks/slot-params-BCTmZkQB.js +76 -0
- package/dist/_chunks/slot-params-BCTmZkQB.js.map +1 -0
- package/dist/_chunks/{ssr-data-MjmprTmO.js → ssr-data-14MXm7Pj.js} +17 -2
- package/dist/_chunks/ssr-data-14MXm7Pj.js.map +1 -0
- package/dist/_chunks/use-query-states-I3JMng6J.js +226 -0
- package/dist/_chunks/use-query-states-I3JMng6J.js.map +1 -0
- package/dist/_chunks/use-segment-params-C4r4BD9T.js +398 -0
- package/dist/_chunks/use-segment-params-C4r4BD9T.js.map +1 -0
- package/dist/_chunks/walkers-BsVLmD1S.js +141 -0
- package/dist/_chunks/walkers-BsVLmD1S.js.map +1 -0
- package/dist/adapters/build-output-helper.d.ts +72 -0
- package/dist/adapters/build-output-helper.d.ts.map +1 -0
- package/dist/adapters/cloudflare-dev.d.ts +109 -0
- package/dist/adapters/cloudflare-dev.d.ts.map +1 -0
- package/dist/adapters/cloudflare-dev.js +73 -0
- package/dist/adapters/cloudflare-dev.js.map +1 -0
- package/dist/adapters/cloudflare-kv-cache.d.ts +65 -0
- package/dist/adapters/cloudflare-kv-cache.d.ts.map +1 -0
- package/dist/adapters/cloudflare-kv-cache.js +124 -0
- package/dist/adapters/cloudflare-kv-cache.js.map +1 -0
- package/dist/adapters/cloudflare.d.ts +199 -21
- package/dist/adapters/cloudflare.d.ts.map +1 -1
- package/dist/adapters/cloudflare.js +2 -188
- package/dist/adapters/compress-module.d.ts +17 -4
- package/dist/adapters/compress-module.d.ts.map +1 -1
- package/dist/adapters/fs-identity.d.ts +64 -0
- package/dist/adapters/fs-identity.d.ts.map +1 -0
- package/dist/adapters/nitro.d.ts +55 -3
- package/dist/adapters/nitro.d.ts.map +1 -1
- package/dist/adapters/nitro.js +287 -171
- package/dist/adapters/nitro.js.map +1 -1
- package/dist/adapters/shared.d.ts +62 -0
- package/dist/adapters/shared.d.ts.map +1 -0
- package/dist/adapters/types.d.ts +28 -6
- package/dist/adapters/types.d.ts.map +1 -1
- package/dist/cache/cache-api.d.ts +48 -0
- package/dist/cache/cache-api.d.ts.map +1 -0
- package/dist/cache/fast-hash.d.ts +5 -0
- package/dist/cache/fast-hash.d.ts.map +1 -1
- package/dist/cache/handler-store.d.ts +33 -0
- package/dist/cache/handler-store.d.ts.map +1 -0
- package/dist/cache/index.d.ts +31 -8
- package/dist/cache/index.d.ts.map +1 -1
- package/dist/cache/index.js +3 -326
- package/dist/cache/invalidation-epoch.d.ts +43 -0
- package/dist/cache/invalidation-epoch.d.ts.map +1 -0
- package/dist/cache/json-lossy-check.d.ts +11 -0
- package/dist/cache/json-lossy-check.d.ts.map +1 -0
- package/dist/cache/redis-handler.d.ts +140 -8
- package/dist/cache/redis-handler.d.ts.map +1 -1
- package/dist/cache/singleflight.d.ts +19 -2
- package/dist/cache/singleflight.d.ts.map +1 -1
- package/dist/cache/sizeof.d.ts +22 -0
- package/dist/cache/sizeof.d.ts.map +1 -0
- package/dist/cache/stable-stringify.d.ts +9 -0
- package/dist/cache/stable-stringify.d.ts.map +1 -1
- package/dist/cache/store.d.ts +53 -0
- package/dist/cache/store.d.ts.map +1 -0
- package/dist/cache/stores/cloudflare-kv.d.ts +38 -0
- package/dist/cache/stores/cloudflare-kv.d.ts.map +1 -0
- package/dist/cache/stores/cloudflare-kv.js +29 -0
- package/dist/cache/stores/cloudflare-kv.js.map +1 -0
- package/dist/cache/stores/memory.d.ts +42 -0
- package/dist/cache/stores/memory.d.ts.map +1 -0
- package/dist/cache/stores/memory.js +90 -0
- package/dist/cache/stores/memory.js.map +1 -0
- package/dist/cache/stores/redis.d.ts +69 -0
- package/dist/cache/stores/redis.d.ts.map +1 -0
- package/dist/cache/stores/redis.js +35 -0
- package/dist/cache/stores/redis.js.map +1 -0
- package/dist/cache/stores/vercel.d.ts +36 -0
- package/dist/cache/stores/vercel.d.ts.map +1 -0
- package/dist/cache/stores/vercel.js +33 -0
- package/dist/cache/stores/vercel.js.map +1 -0
- package/dist/cache/tag-aware-handler.d.ts +52 -0
- package/dist/cache/tag-aware-handler.d.ts.map +1 -0
- package/dist/cache/timber-cache.d.ts +20 -10
- package/dist/cache/timber-cache.d.ts.map +1 -1
- package/dist/cdn/cloudflare-purge.d.ts +23 -0
- package/dist/cdn/cloudflare-purge.d.ts.map +1 -0
- package/dist/cdn/cloudflare-purge.js +30 -0
- package/dist/cdn/cloudflare-purge.js.map +1 -0
- package/dist/cdn/fastly-purge.d.ts +25 -0
- package/dist/cdn/fastly-purge.d.ts.map +1 -0
- package/dist/cdn/fastly-purge.js +33 -0
- package/dist/cdn/fastly-purge.js.map +1 -0
- package/dist/cdn/headers.d.ts +97 -0
- package/dist/cdn/headers.d.ts.map +1 -0
- package/dist/cdn/index.d.ts +5 -0
- package/dist/cdn/index.d.ts.map +1 -0
- package/dist/cdn/index.js +94 -0
- package/dist/cdn/index.js.map +1 -0
- package/dist/cdn/purge-store.d.ts +23 -0
- package/dist/cdn/purge-store.d.ts.map +1 -0
- package/dist/cdn/workers-cache-purge.d.ts +16 -0
- package/dist/cdn/workers-cache-purge.d.ts.map +1 -0
- package/dist/cdn/workers-cache-purge.js +35 -0
- package/dist/cdn/workers-cache-purge.js.map +1 -0
- package/dist/cli-check.d.ts +153 -0
- package/dist/cli-check.d.ts.map +1 -0
- package/dist/cli-schema-sync.d.ts +59 -0
- package/dist/cli-schema-sync.d.ts.map +1 -0
- package/dist/cli.d.ts +66 -7
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +151 -47
- package/dist/cli.js.map +1 -1
- package/dist/client/browser-dev.d.ts +37 -1
- package/dist/client/browser-dev.d.ts.map +1 -1
- package/dist/client/browser-entry/action-dispatch.d.ts +17 -0
- package/dist/client/browser-entry/action-dispatch.d.ts.map +1 -0
- package/dist/client/browser-entry/hmr.d.ts +21 -0
- package/dist/client/browser-entry/hmr.d.ts.map +1 -0
- package/dist/client/browser-entry/hydrate.d.ts +57 -0
- package/dist/client/browser-entry/hydrate.d.ts.map +1 -0
- package/dist/client/browser-entry/index.d.ts +29 -0
- package/dist/client/browser-entry/index.d.ts.map +1 -0
- package/dist/client/browser-entry/post-hydration.d.ts +29 -0
- package/dist/client/browser-entry/post-hydration.d.ts.map +1 -0
- package/dist/client/browser-entry/router-init.d.ts +30 -0
- package/dist/client/browser-entry/router-init.d.ts.map +1 -0
- package/dist/client/browser-entry/rsc-stream.d.ts +32 -0
- package/dist/client/browser-entry/rsc-stream.d.ts.map +1 -0
- package/dist/client/browser-entry/scroll.d.ts +28 -0
- package/dist/client/browser-entry/scroll.d.ts.map +1 -0
- package/dist/client/error-boundary.d.ts +19 -5
- package/dist/client/error-boundary.d.ts.map +1 -1
- package/dist/client/error-boundary.js +1 -125
- package/dist/client/error-reconstituter.d.ts +61 -0
- package/dist/client/error-reconstituter.d.ts.map +1 -0
- package/dist/client/form.d.ts +16 -27
- package/dist/client/form.d.ts.map +1 -1
- package/dist/client/history.d.ts +29 -7
- package/dist/client/history.d.ts.map +1 -1
- package/dist/client/index.d.ts +11 -24
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +186 -1134
- package/dist/client/index.js.map +1 -1
- package/dist/client/internal.d.ts +20 -0
- package/dist/client/internal.d.ts.map +1 -0
- package/dist/client/internal.js +1624 -0
- package/dist/client/internal.js.map +1 -0
- package/dist/client/link.d.ts +63 -60
- package/dist/client/link.d.ts.map +1 -1
- package/dist/client/navigation-api.d.ts +121 -0
- package/dist/client/navigation-api.d.ts.map +1 -0
- package/dist/client/navigation-commit.d.ts +87 -0
- package/dist/client/navigation-commit.d.ts.map +1 -0
- package/dist/client/navigation-context.d.ts +38 -20
- package/dist/client/navigation-context.d.ts.map +1 -1
- package/dist/client/navigation-root.d.ts +159 -0
- package/dist/client/navigation-root.d.ts.map +1 -0
- package/dist/client/nuqs-adapter.d.ts +1 -1
- package/dist/client/nuqs-adapter.d.ts.map +1 -1
- package/dist/client/params-context.d.ts +82 -0
- package/dist/client/params-context.d.ts.map +1 -0
- package/dist/client/router-effects.d.ts +129 -0
- package/dist/client/router-effects.d.ts.map +1 -0
- package/dist/client/router-lifecycle.d.ts +55 -0
- package/dist/client/router-lifecycle.d.ts.map +1 -0
- package/dist/client/router-pipeline.d.ts +84 -0
- package/dist/client/router-pipeline.d.ts.map +1 -0
- package/dist/client/router-ref.d.ts +2 -2
- package/dist/client/router-ref.d.ts.map +1 -1
- package/dist/client/router-skew.d.ts +21 -0
- package/dist/client/router-skew.d.ts.map +1 -0
- package/dist/client/router-types.d.ts +207 -0
- package/dist/client/router-types.d.ts.map +1 -0
- package/dist/client/router.d.ts +1 -97
- package/dist/client/router.d.ts.map +1 -1
- package/dist/client/rsc-fetch.d.ts +113 -26
- package/dist/client/rsc-fetch.d.ts.map +1 -1
- package/dist/client/segment-cache.d.ts +107 -25
- package/dist/client/segment-cache.d.ts.map +1 -1
- package/dist/client/segment-outlet.d.ts +57 -0
- package/dist/client/segment-outlet.d.ts.map +1 -0
- package/dist/client/segment-update-context.d.ts +21 -0
- package/dist/client/segment-update-context.d.ts.map +1 -0
- package/dist/client/shallow-url.d.ts +10 -0
- package/dist/client/shallow-url.d.ts.map +1 -0
- package/dist/client/slot-context.d.ts +31 -0
- package/dist/client/slot-context.d.ts.map +1 -0
- package/dist/client/slot-outlet.d.ts +16 -0
- package/dist/client/slot-outlet.d.ts.map +1 -0
- package/dist/client/slot-provider.d.ts +25 -0
- package/dist/client/slot-provider.d.ts.map +1 -0
- package/dist/client/ssr-data.d.ts +21 -5
- package/dist/client/ssr-data.d.ts.map +1 -1
- package/dist/client/stale-client.d.ts +69 -0
- package/dist/client/stale-client.d.ts.map +1 -0
- package/dist/client/state.d.ts +14 -4
- package/dist/client/state.d.ts.map +1 -1
- package/dist/client/top-loader.d.ts +7 -6
- package/dist/client/top-loader.d.ts.map +1 -1
- package/dist/client/unload-guard.d.ts +5 -0
- package/dist/client/unload-guard.d.ts.map +1 -1
- package/dist/client/use-cookie.d.ts +12 -0
- package/dist/client/use-cookie.d.ts.map +1 -1
- package/dist/client/use-link-status.d.ts +5 -5
- package/dist/client/use-link-status.d.ts.map +1 -1
- package/dist/client/use-pathname.d.ts.map +1 -1
- package/dist/client/use-pending-navigation.d.ts +23 -0
- package/dist/client/use-pending-navigation.d.ts.map +1 -0
- package/dist/client/use-query-states.d.ts +10 -4
- package/dist/client/use-query-states.d.ts.map +1 -1
- package/dist/client/use-router.d.ts +2 -2
- package/dist/client/use-router.d.ts.map +1 -1
- package/dist/client/use-search-params.d.ts +12 -5
- package/dist/client/use-search-params.d.ts.map +1 -1
- package/dist/client/{use-params.d.ts → use-segment-params.d.ts} +29 -16
- package/dist/client/use-segment-params.d.ts.map +1 -0
- package/dist/codec.d.ts +69 -0
- package/dist/codec.d.ts.map +1 -0
- package/dist/codec.js +76 -0
- package/dist/codec.js.map +1 -0
- package/dist/config-types.d.ts +284 -0
- package/dist/config-types.d.ts.map +1 -0
- package/dist/config-validation.d.ts +51 -0
- package/dist/config-validation.d.ts.map +1 -0
- package/dist/content/index.d.ts +1 -10
- package/dist/content/index.d.ts.map +1 -1
- package/dist/content/index.js +0 -2
- package/dist/cookies/define-cookie.d.ts +58 -25
- package/dist/cookies/define-cookie.d.ts.map +1 -1
- package/dist/cookies/index.d.ts +2 -1
- package/dist/cookies/index.d.ts.map +1 -1
- package/dist/cookies/index.js +257 -36
- package/dist/cookies/index.js.map +1 -1
- package/dist/cookies/json-cookie.d.ts +64 -0
- package/dist/cookies/json-cookie.d.ts.map +1 -0
- package/dist/cookies/validation.d.ts +34 -0
- package/dist/cookies/validation.d.ts.map +1 -0
- package/dist/dev-tools/404-page.d.ts +50 -0
- package/dist/dev-tools/404-page.d.ts.map +1 -0
- package/dist/dev-tools/browser-logs.d.ts +40 -0
- package/dist/dev-tools/browser-logs.d.ts.map +1 -0
- package/dist/dev-tools/dev-page-shell.d.ts +78 -0
- package/dist/dev-tools/dev-page-shell.d.ts.map +1 -0
- package/dist/dev-tools/error-page.d.ts +32 -0
- package/dist/dev-tools/error-page.d.ts.map +1 -0
- package/dist/dev-tools/holding-server.d.ts +54 -0
- package/dist/dev-tools/holding-server.d.ts.map +1 -0
- package/dist/dev-tools/hydration-overlay.d.ts +11 -0
- package/dist/dev-tools/hydration-overlay.d.ts.map +1 -0
- package/dist/dev-tools/index.d.ts +31 -0
- package/dist/dev-tools/index.d.ts.map +1 -0
- package/dist/dev-tools/instrumentation.d.ts +59 -0
- package/dist/dev-tools/instrumentation.d.ts.map +1 -0
- package/dist/{server/dev-logger.d.ts → dev-tools/logger.d.ts} +1 -1
- package/dist/dev-tools/logger.d.ts.map +1 -0
- package/dist/{plugins/dev-logs.d.ts → dev-tools/logs.d.ts} +17 -3
- package/dist/dev-tools/logs.d.ts.map +1 -0
- package/dist/dev-tools/overlay.d.ts +91 -0
- package/dist/dev-tools/overlay.d.ts.map +1 -0
- package/dist/dev-tools/stack-classifier.d.ts +34 -0
- package/dist/dev-tools/stack-classifier.d.ts.map +1 -0
- package/dist/dev-tools/terminal.d.ts +28 -0
- package/dist/dev-tools/terminal.d.ts.map +1 -0
- package/dist/fonts/ast-walk.d.ts +68 -0
- package/dist/fonts/ast-walk.d.ts.map +1 -0
- package/dist/fonts/ast.d.ts +110 -6
- package/dist/fonts/ast.d.ts.map +1 -1
- package/dist/fonts/bundle.d.ts +50 -0
- package/dist/fonts/bundle.d.ts.map +1 -0
- package/dist/fonts/dev-middleware.d.ts +22 -0
- package/dist/fonts/dev-middleware.d.ts.map +1 -0
- package/dist/fonts/fallbacks.d.ts +0 -7
- package/dist/fonts/fallbacks.d.ts.map +1 -1
- package/dist/fonts/google.d.ts +4 -2
- package/dist/fonts/google.d.ts.map +1 -1
- package/dist/fonts/local.d.ts +4 -4
- package/dist/fonts/local.d.ts.map +1 -1
- package/dist/fonts/paths.d.ts +43 -0
- package/dist/fonts/paths.d.ts.map +1 -0
- package/dist/fonts/pipeline.d.ts +177 -0
- package/dist/fonts/pipeline.d.ts.map +1 -0
- package/dist/fonts/transform.d.ts +82 -0
- package/dist/fonts/transform.d.ts.map +1 -0
- package/dist/fonts/types.d.ts +47 -1
- package/dist/fonts/types.d.ts.map +1 -1
- package/dist/fonts/virtual-modules.d.ts +77 -0
- package/dist/fonts/virtual-modules.d.ts.map +1 -0
- package/dist/index.d.ts +50 -181
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9805 -14134
- package/dist/index.js.map +1 -1
- package/dist/params/codec-registry.d.ts +26 -0
- package/dist/params/codec-registry.d.ts.map +1 -0
- package/dist/params/define-schema.d.ts +81 -0
- package/dist/params/define-schema.d.ts.map +1 -0
- package/dist/params/index.d.ts +5 -0
- package/dist/params/index.d.ts.map +1 -0
- package/dist/params/index.js +34 -0
- package/dist/params/index.js.map +1 -0
- package/dist/params/resolve-schema.d.ts +34 -0
- package/dist/params/resolve-schema.d.ts.map +1 -0
- package/dist/plugin-context.d.ts +276 -0
- package/dist/plugin-context.d.ts.map +1 -0
- package/dist/plugins/adapter-build.d.ts +21 -1
- package/dist/plugins/adapter-build.d.ts.map +1 -1
- package/dist/plugins/build-manifest.d.ts +7 -3
- package/dist/plugins/build-manifest.d.ts.map +1 -1
- package/dist/plugins/build-report.d.ts +47 -10
- package/dist/plugins/build-report.d.ts.map +1 -1
- package/dist/plugins/cache.d.ts +64 -0
- package/dist/plugins/cache.d.ts.map +1 -0
- package/dist/plugins/callsite-ast.d.ts +117 -0
- package/dist/plugins/callsite-ast.d.ts.map +1 -0
- package/dist/plugins/callsite-jsx.d.ts +35 -0
- package/dist/plugins/callsite-jsx.d.ts.map +1 -0
- package/dist/plugins/chunks.d.ts +11 -4
- package/dist/plugins/chunks.d.ts.map +1 -1
- package/dist/plugins/client-chunks.d.ts +40 -0
- package/dist/plugins/client-chunks.d.ts.map +1 -0
- package/dist/plugins/cloudflare-wasm.d.ts +21 -0
- package/dist/plugins/cloudflare-wasm.d.ts.map +1 -0
- package/dist/plugins/content.d.ts +1 -1
- package/dist/plugins/content.d.ts.map +1 -1
- package/dist/plugins/dev-server.d.ts +17 -1
- package/dist/plugins/dev-server.d.ts.map +1 -1
- package/dist/plugins/entries.d.ts +28 -4
- package/dist/plugins/entries.d.ts.map +1 -1
- package/dist/plugins/fonts.d.ts +16 -73
- package/dist/plugins/fonts.d.ts.map +1 -1
- package/dist/plugins/mdx.d.ts +1 -1
- package/dist/plugins/mdx.d.ts.map +1 -1
- package/dist/plugins/prebuilt-capture.d.ts +60 -0
- package/dist/plugins/prebuilt-capture.d.ts.map +1 -0
- package/dist/plugins/prebuilt-options-analysis.d.ts +40 -0
- package/dist/plugins/prebuilt-options-analysis.d.ts.map +1 -0
- package/dist/plugins/prebuilt.d.ts +82 -0
- package/dist/plugins/prebuilt.d.ts.map +1 -0
- package/dist/plugins/prerender-sugar.d.ts +42 -0
- package/dist/plugins/prerender-sugar.d.ts.map +1 -0
- package/dist/plugins/request-dep/analysis.d.ts +106 -0
- package/dist/plugins/request-dep/analysis.d.ts.map +1 -0
- package/dist/plugins/request-dep/index.d.ts +75 -0
- package/dist/plugins/request-dep/index.d.ts.map +1 -0
- package/dist/plugins/request-dep/origin.d.ts +61 -0
- package/dist/plugins/request-dep/origin.d.ts.map +1 -0
- package/dist/plugins/routing.d.ts +1 -1
- package/dist/plugins/routing.d.ts.map +1 -1
- package/dist/plugins/server-bundle.d.ts.map +1 -1
- package/dist/plugins/shims.d.ts +29 -5
- package/dist/plugins/shims.d.ts.map +1 -1
- package/dist/plugins/static-build.d.ts +218 -21
- package/dist/plugins/static-build.d.ts.map +1 -1
- package/dist/routing/codegen-shared.d.ts +26 -0
- package/dist/routing/codegen-shared.d.ts.map +1 -0
- package/dist/routing/codegen-types.d.ts +61 -0
- package/dist/routing/codegen-types.d.ts.map +1 -0
- package/dist/routing/codegen-write.d.ts +51 -0
- package/dist/routing/codegen-write.d.ts.map +1 -0
- package/dist/routing/codegen.d.ts +7 -2
- package/dist/routing/codegen.d.ts.map +1 -1
- package/dist/routing/collision-probe.d.ts +104 -0
- package/dist/routing/collision-probe.d.ts.map +1 -0
- package/dist/routing/collision-spaces.d.ts +26 -0
- package/dist/routing/collision-spaces.d.ts.map +1 -0
- package/dist/routing/convention-lint.d.ts +55 -0
- package/dist/routing/convention-lint.d.ts.map +1 -0
- package/dist/routing/export-detect.d.ts +72 -0
- package/dist/routing/export-detect.d.ts.map +1 -0
- package/dist/routing/file-cache.d.ts +8 -0
- package/dist/routing/file-cache.d.ts.map +1 -0
- package/dist/routing/index.d.ts +7 -1
- package/dist/routing/index.d.ts.map +1 -1
- package/dist/routing/index.js +5 -2
- package/dist/routing/interception.d.ts +234 -10
- package/dist/routing/interception.d.ts.map +1 -1
- package/dist/routing/link-codegen.d.ts +105 -0
- package/dist/routing/link-codegen.d.ts.map +1 -0
- package/dist/routing/manifest-codegen.d.ts +26 -0
- package/dist/routing/manifest-codegen.d.ts.map +1 -0
- package/dist/routing/scanner.d.ts +1 -10
- package/dist/routing/scanner.d.ts.map +1 -1
- package/dist/routing/schema-validation.d.ts +35 -0
- package/dist/routing/schema-validation.d.ts.map +1 -0
- package/dist/routing/segment-classify.d.ts +114 -0
- package/dist/routing/segment-classify.d.ts.map +1 -0
- package/dist/routing/segment-codegen.d.ts +38 -0
- package/dist/routing/segment-codegen.d.ts.map +1 -0
- package/dist/routing/segment-keys.d.ts +118 -0
- package/dist/routing/segment-keys.d.ts.map +1 -0
- package/dist/routing/slot-placement.d.ts +48 -0
- package/dist/routing/slot-placement.d.ts.map +1 -0
- package/dist/routing/types.d.ts +74 -26
- package/dist/routing/types.d.ts.map +1 -1
- package/dist/routing/walkers.d.ts +57 -0
- package/dist/routing/walkers.d.ts.map +1 -0
- package/dist/rsc-runtime/rsc.d.ts +1 -1
- package/dist/rsc-runtime/rsc.d.ts.map +1 -1
- package/dist/rsc-runtime/ssr.d.ts +12 -0
- package/dist/rsc-runtime/ssr.d.ts.map +1 -1
- package/dist/schema-bridge.d.ts +145 -0
- package/dist/schema-bridge.d.ts.map +1 -0
- package/dist/search-params/define.d.ts +262 -0
- package/dist/search-params/define.d.ts.map +1 -0
- package/dist/search-params/index.d.ts +3 -7
- package/dist/search-params/index.d.ts.map +1 -1
- package/dist/search-params/index.js +179 -360
- package/dist/search-params/index.js.map +1 -1
- package/dist/search-params/parse-total.d.ts +81 -0
- package/dist/search-params/parse-total.d.ts.map +1 -0
- package/dist/search-params/serialize-equal.d.ts +9 -0
- package/dist/search-params/serialize-equal.d.ts.map +1 -0
- package/dist/search-params/wrappers.d.ts +76 -0
- package/dist/search-params/wrappers.d.ts.map +1 -0
- package/dist/server/access-gate.d.ts +26 -10
- package/dist/server/access-gate.d.ts.map +1 -1
- package/dist/server/action-client.d.ts +42 -7
- package/dist/server/action-client.d.ts.map +1 -1
- package/dist/server/action-encryption.d.ts +76 -0
- package/dist/server/action-encryption.d.ts.map +1 -0
- package/dist/server/action-handler.d.ts +35 -1
- package/dist/server/action-handler.d.ts.map +1 -1
- package/dist/server/actions.d.ts +12 -33
- package/dist/server/actions.d.ts.map +1 -1
- package/dist/server/als-registry.d.ts +115 -11
- package/dist/server/als-registry.d.ts.map +1 -1
- package/dist/server/asset-headers.d.ts +8 -18
- package/dist/server/asset-headers.d.ts.map +1 -1
- package/dist/server/body-limits.d.ts.map +1 -1
- package/dist/server/build-manifest.d.ts +25 -30
- package/dist/server/build-manifest.d.ts.map +1 -1
- package/dist/server/canonicalize.d.ts +10 -0
- package/dist/server/canonicalize.d.ts.map +1 -1
- package/dist/server/chain-url-parts.d.ts +82 -0
- package/dist/server/chain-url-parts.d.ts.map +1 -0
- package/dist/server/children-interception.d.ts +49 -0
- package/dist/server/children-interception.d.ts.map +1 -0
- package/dist/server/coalesce-tick.d.ts +40 -0
- package/dist/server/coalesce-tick.d.ts.map +1 -0
- package/dist/server/compress.d.ts.map +1 -1
- package/dist/server/cookie-context.d.ts +170 -0
- package/dist/server/cookie-context.d.ts.map +1 -0
- package/dist/server/cookie-parsing.d.ts +65 -0
- package/dist/server/cookie-parsing.d.ts.map +1 -0
- package/dist/server/csrf.d.ts +3 -2
- package/dist/server/csrf.d.ts.map +1 -1
- package/dist/server/default-logger.d.ts +22 -0
- package/dist/server/default-logger.d.ts.map +1 -0
- package/dist/server/default-status-page.d.ts +45 -0
- package/dist/server/default-status-page.d.ts.map +1 -0
- package/dist/server/deny-boundary.d.ts +247 -0
- package/dist/server/deny-boundary.d.ts.map +1 -0
- package/dist/server/deny-renderer.d.ts +16 -5
- package/dist/server/deny-renderer.d.ts.map +1 -1
- package/dist/server/dev-source-map.d.ts +22 -0
- package/dist/server/dev-source-map.d.ts.map +1 -0
- package/dist/server/early-hints-sender.d.ts.map +1 -1
- package/dist/server/early-hints.d.ts +13 -11
- package/dist/server/early-hints.d.ts.map +1 -1
- package/dist/server/error-boundary-wrapper.d.ts +86 -10
- package/dist/server/error-boundary-wrapper.d.ts.map +1 -1
- package/dist/server/fallback-error.d.ts +12 -7
- package/dist/server/fallback-error.d.ts.map +1 -1
- package/dist/server/flight-injection-state.d.ts +66 -0
- package/dist/server/flight-injection-state.d.ts.map +1 -0
- package/dist/server/flight-scripts.d.ts +42 -0
- package/dist/server/flight-scripts.d.ts.map +1 -0
- package/dist/server/form-data.d.ts +41 -0
- package/dist/server/form-data.d.ts.map +1 -1
- package/dist/server/head-response.d.ts +35 -0
- package/dist/server/head-response.d.ts.map +1 -0
- package/dist/server/html-injector-core.d.ts +242 -0
- package/dist/server/html-injector-core.d.ts.map +1 -0
- package/dist/server/html-injectors.d.ts +82 -41
- package/dist/server/html-injectors.d.ts.map +1 -1
- package/dist/server/index.d.ts +11 -47
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +183 -2906
- package/dist/server/index.js.map +1 -1
- package/dist/server/internal.d.ts +51 -0
- package/dist/server/internal.d.ts.map +1 -0
- package/dist/server/internal.js +4154 -0
- package/dist/server/internal.js.map +1 -0
- package/dist/server/logger.d.ts +39 -7
- package/dist/server/logger.d.ts.map +1 -1
- package/dist/server/metadata-collector.d.ts +74 -0
- package/dist/server/metadata-collector.d.ts.map +1 -0
- package/dist/server/metadata-routes.d.ts +60 -11
- package/dist/server/metadata-routes.d.ts.map +1 -1
- package/dist/server/metadata.d.ts +8 -0
- package/dist/server/metadata.d.ts.map +1 -1
- package/dist/server/middleware-runner.d.ts +19 -4
- package/dist/server/middleware-runner.d.ts.map +1 -1
- package/dist/server/node-stream-transforms.d.ts +119 -0
- package/dist/server/node-stream-transforms.d.ts.map +1 -0
- package/dist/server/param-coercion.d.ts +71 -0
- package/dist/server/param-coercion.d.ts.map +1 -0
- package/dist/server/pipeline-helpers.d.ts +77 -0
- package/dist/server/pipeline-helpers.d.ts.map +1 -0
- package/dist/server/pipeline-interception.d.ts +59 -9
- package/dist/server/pipeline-interception.d.ts.map +1 -1
- package/dist/server/pipeline-metadata.d.ts +6 -0
- package/dist/server/pipeline-metadata.d.ts.map +1 -1
- package/dist/server/pipeline-outcome.d.ts +49 -0
- package/dist/server/pipeline-outcome.d.ts.map +1 -0
- package/dist/server/pipeline-phases.d.ts +59 -0
- package/dist/server/pipeline-phases.d.ts.map +1 -0
- package/dist/server/pipeline.d.ts +152 -19
- package/dist/server/pipeline.d.ts.map +1 -1
- package/dist/server/port-resolution.d.ts +117 -0
- package/dist/server/port-resolution.d.ts.map +1 -0
- package/dist/server/prebuilt/cache-key.d.ts +63 -0
- package/dist/server/prebuilt/cache-key.d.ts.map +1 -0
- package/dist/server/prebuilt/capture-state.d.ts +57 -0
- package/dist/server/prebuilt/capture-state.d.ts.map +1 -0
- package/dist/server/prebuilt/key-discipline.d.ts +23 -0
- package/dist/server/prebuilt/key-discipline.d.ts.map +1 -0
- package/dist/server/prebuilt/manifest-tag-index.d.ts +27 -0
- package/dist/server/prebuilt/manifest-tag-index.d.ts.map +1 -0
- package/dist/server/prebuilt/overlay.d.ts +100 -0
- package/dist/server/prebuilt/overlay.d.ts.map +1 -0
- package/dist/server/prebuilt/payload-source.d.ts +79 -0
- package/dist/server/prebuilt/payload-source.d.ts.map +1 -0
- package/dist/server/prebuilt/slots.d.ts +99 -0
- package/dist/server/prebuilt/slots.d.ts.map +1 -0
- package/dist/server/prebuilt/synthetic-store.d.ts +67 -0
- package/dist/server/prebuilt/synthetic-store.d.ts.map +1 -0
- package/dist/server/prebuilt-builder.d.ts +121 -0
- package/dist/server/prebuilt-builder.d.ts.map +1 -0
- package/dist/server/prebuilt-runtime.d.ts +111 -0
- package/dist/server/prebuilt-runtime.d.ts.map +1 -0
- package/dist/server/primitives.d.ts +100 -44
- package/dist/server/primitives.d.ts.map +1 -1
- package/dist/server/publish-params.d.ts +33 -0
- package/dist/server/publish-params.d.ts.map +1 -0
- package/dist/server/render-timeout.d.ts +51 -0
- package/dist/server/render-timeout.d.ts.map +1 -0
- package/dist/server/render-utils.d.ts +25 -0
- package/dist/server/render-utils.d.ts.map +1 -0
- package/dist/server/request-context.d.ts +110 -106
- package/dist/server/request-context.d.ts.map +1 -1
- package/dist/server/request-dep.d.ts +15 -0
- package/dist/server/request-dep.d.ts.map +1 -0
- package/dist/server/route-element-builder.d.ts +74 -27
- package/dist/server/route-element-builder.d.ts.map +1 -1
- package/dist/server/route-handler.d.ts.map +1 -1
- package/dist/server/route-matcher.d.ts +38 -36
- package/dist/server/route-matcher.d.ts.map +1 -1
- package/dist/server/rsc-cache-key-guard.d.ts +78 -0
- package/dist/server/rsc-cache-key-guard.d.ts.map +1 -0
- package/dist/server/rsc-entry/action-middleware-runner.d.ts +66 -0
- package/dist/server/rsc-entry/action-middleware-runner.d.ts.map +1 -0
- package/dist/server/rsc-entry/api-handler.d.ts +12 -3
- package/dist/server/rsc-entry/api-handler.d.ts.map +1 -1
- package/dist/server/rsc-entry/deny-fallback.d.ts +29 -0
- package/dist/server/rsc-entry/deny-fallback.d.ts.map +1 -0
- package/dist/server/rsc-entry/error-renderer.d.ts +38 -13
- package/dist/server/rsc-entry/error-renderer.d.ts.map +1 -1
- package/dist/server/rsc-entry/helpers.d.ts +59 -42
- package/dist/server/rsc-entry/helpers.d.ts.map +1 -1
- package/dist/server/rsc-entry/index.d.ts +39 -6
- package/dist/server/rsc-entry/index.d.ts.map +1 -1
- package/dist/server/rsc-entry/render-route.d.ts +51 -0
- package/dist/server/rsc-entry/render-route.d.ts.map +1 -0
- package/dist/server/rsc-entry/revalidate-renderer.d.ts +108 -0
- package/dist/server/rsc-entry/revalidate-renderer.d.ts.map +1 -0
- package/dist/server/rsc-entry/rsc-payload.d.ts +5 -6
- package/dist/server/rsc-entry/rsc-payload.d.ts.map +1 -1
- package/dist/server/rsc-entry/rsc-stream.d.ts +40 -3
- package/dist/server/rsc-entry/rsc-stream.d.ts.map +1 -1
- package/dist/server/rsc-entry/ssr-bridge.d.ts +5 -1
- package/dist/server/rsc-entry/ssr-bridge.d.ts.map +1 -1
- package/dist/server/rsc-entry/ssr-renderer.d.ts +36 -4
- package/dist/server/rsc-entry/ssr-renderer.d.ts.map +1 -1
- package/dist/server/rsc-entry/wrap-action-dispatch.d.ts +89 -0
- package/dist/server/rsc-entry/wrap-action-dispatch.d.ts.map +1 -0
- package/dist/server/safe-load.d.ts +46 -0
- package/dist/server/safe-load.d.ts.map +1 -0
- package/dist/server/sensitive-fields.d.ts +74 -0
- package/dist/server/sensitive-fields.d.ts.map +1 -0
- package/dist/server/sitemap-generator.d.ts +130 -0
- package/dist/server/sitemap-generator.d.ts.map +1 -0
- package/dist/server/sitemap-handler.d.ts +22 -0
- package/dist/server/sitemap-handler.d.ts.map +1 -0
- package/dist/server/skippable-prefix.d.ts +26 -0
- package/dist/server/skippable-prefix.d.ts.map +1 -0
- package/dist/server/slot-interception.d.ts +80 -0
- package/dist/server/slot-interception.d.ts.map +1 -0
- package/dist/server/slot-resolver.d.ts +139 -5
- package/dist/server/slot-resolver.d.ts.map +1 -1
- package/dist/server/ssr-bridge-types.d.ts +140 -0
- package/dist/server/ssr-bridge-types.d.ts.map +1 -0
- package/dist/server/ssr-entry.d.ts +1 -43
- package/dist/server/ssr-entry.d.ts.map +1 -1
- package/dist/server/ssr-render.d.ts +64 -21
- package/dist/server/ssr-render.d.ts.map +1 -1
- package/dist/server/ssr-wrappers.d.ts +61 -0
- package/dist/server/ssr-wrappers.d.ts.map +1 -0
- package/dist/server/state-tree-diff.d.ts +44 -9
- package/dist/server/state-tree-diff.d.ts.map +1 -1
- package/dist/server/static-generator.d.ts +112 -0
- package/dist/server/static-generator.d.ts.map +1 -0
- package/dist/server/static-not-found.d.ts +52 -0
- package/dist/server/static-not-found.d.ts.map +1 -0
- package/dist/server/status-code-resolver.d.ts +26 -15
- package/dist/server/status-code-resolver.d.ts.map +1 -1
- package/dist/server/stream-utils.d.ts +47 -0
- package/dist/server/stream-utils.d.ts.map +1 -0
- package/dist/server/tracing.d.ts +44 -9
- package/dist/server/tracing.d.ts.map +1 -1
- package/dist/server/tree-builder.d.ts +66 -42
- package/dist/server/tree-builder.d.ts.map +1 -1
- package/dist/server/tree-match.d.ts +49 -0
- package/dist/server/tree-match.d.ts.map +1 -0
- package/dist/server/types.d.ts +77 -6
- package/dist/server/types.d.ts.map +1 -1
- package/dist/server/utils/element-type.d.ts +40 -0
- package/dist/server/utils/element-type.d.ts.map +1 -0
- package/dist/server/utils/escape-html.d.ts +14 -0
- package/dist/server/utils/escape-html.d.ts.map +1 -0
- package/dist/server/utils/mdx-file.d.ts +15 -0
- package/dist/server/utils/mdx-file.d.ts.map +1 -0
- package/dist/server/version-skew.d.ts +61 -0
- package/dist/server/version-skew.d.ts.map +1 -0
- package/dist/server/workers-cache-bridge.d.ts +26 -0
- package/dist/server/workers-cache-bridge.d.ts.map +1 -0
- package/dist/shared/als-slots.d.ts +42 -0
- package/dist/shared/als-slots.d.ts.map +1 -0
- package/dist/shared/base-path.d.ts +56 -0
- package/dist/shared/base-path.d.ts.map +1 -0
- package/dist/shared/href-validation.d.ts +49 -0
- package/dist/shared/href-validation.d.ts.map +1 -0
- package/dist/shared/merge-search-params.d.ts +22 -0
- package/dist/shared/merge-search-params.d.ts.map +1 -0
- package/dist/shared/param-value.d.ts +104 -0
- package/dist/shared/param-value.d.ts.map +1 -0
- package/dist/shared/payload-root.d.ts +109 -0
- package/dist/shared/payload-root.d.ts.map +1 -0
- package/dist/shared/redirect-type.d.ts +17 -0
- package/dist/shared/redirect-type.d.ts.map +1 -0
- package/dist/shared/rsc-cache-key.d.ts +163 -0
- package/dist/shared/rsc-cache-key.d.ts.map +1 -0
- package/dist/shared/rsc-error-envelope.d.ts +25 -0
- package/dist/shared/rsc-error-envelope.d.ts.map +1 -0
- package/dist/shared/rsc-manifest.d.ts +28 -0
- package/dist/shared/rsc-manifest.d.ts.map +1 -0
- package/dist/shared/rsc-media-type.d.ts +40 -0
- package/dist/shared/rsc-media-type.d.ts.map +1 -0
- package/dist/shared/rsc-payload-path.d.ts +42 -0
- package/dist/shared/rsc-payload-path.d.ts.map +1 -0
- package/dist/shared/segment-info.d.ts +66 -0
- package/dist/shared/segment-info.d.ts.map +1 -0
- package/dist/shared/slot-params.d.ts +52 -0
- package/dist/shared/slot-params.d.ts.map +1 -0
- package/dist/shared/static-platform-files.d.ts +71 -0
- package/dist/shared/static-platform-files.d.ts.map +1 -0
- package/dist/shims/font-google.d.ts +1 -1
- package/dist/shims/font-google.d.ts.map +1 -1
- package/dist/shims/font-google.js +42 -0
- package/dist/shims/font-google.js.map +1 -0
- package/dist/shims/font-local.d.ts +26 -0
- package/dist/shims/font-local.d.ts.map +1 -0
- package/dist/shims/font-local.js +20 -0
- package/dist/shims/font-local.js.map +1 -0
- package/dist/shims/headers.d.ts +53 -1
- package/dist/shims/headers.d.ts.map +1 -1
- package/dist/shims/image.d.ts +120 -120
- package/dist/shims/image.d.ts.map +1 -1
- package/dist/shims/navigation-client.d.ts +25 -12
- package/dist/shims/navigation-client.d.ts.map +1 -1
- package/dist/shims/navigation.d.ts +10 -5
- package/dist/shims/navigation.d.ts.map +1 -1
- package/dist/utils/state-machine.d.ts +80 -0
- package/dist/utils/state-machine.d.ts.map +1 -0
- package/docs/api/30-api-server.mdx +233 -0
- package/docs/api/31-api-client.mdx +163 -0
- package/docs/api/32-api-cache.mdx +311 -0
- package/docs/api/33-api-search-params.mdx +176 -0
- package/docs/api/34-api-config.mdx +325 -0
- package/docs/api/35-api-typescript.mdx +170 -0
- package/docs/api/36-cli.mdx +170 -0
- package/docs/learn/00-introduction.mdx +109 -0
- package/docs/learn/01-quick-start.mdx +94 -0
- package/docs/learn/02-pages-and-layouts.mdx +147 -0
- package/docs/learn/03-fetching-data.mdx +211 -0
- package/docs/learn/03b-access-control.mdx +130 -0
- package/docs/learn/04-loading-states.mdx +67 -0
- package/docs/learn/04b-the-flush-point.mdx +115 -0
- package/docs/learn/05-typed-params.mdx +275 -0
- package/docs/learn/06-forms-and-actions.mdx +146 -0
- package/docs/learn/07-typed-routes.mdx +132 -0
- package/docs/learn/08-streaming.mdx +146 -0
- package/docs/learn/09-caching.mdx +252 -0
- package/docs/learn/10-middleware.mdx +157 -0
- package/docs/learn/11-error-handling.mdx +173 -0
- package/docs/learn/12-client-navigation.mdx +176 -0
- package/docs/learn/13-configuration.mdx +166 -0
- package/docs/learn/14-deploying.mdx +287 -0
- package/docs/more/01-advanced-routing.mdx +343 -0
- package/docs/more/02-advanced-forms.mdx +137 -0
- package/docs/more/03-coming-from-nextjs.mdx +186 -0
- package/docs/more/04-metadata-and-fonts.mdx +193 -0
- package/docs/more/04b-mdx.mdx +209 -0
- package/docs/more/05-content-collections.mdx +90 -0
- package/docs/more/06-instrumentation.mdx +214 -0
- package/docs/more/07-security.mdx +129 -0
- package/docs/more/08-developer-experience.mdx +134 -0
- package/docs/more/40-why-timber.mdx +50 -0
- package/docs/more/41-timber-vs-nextjs.mdx +81 -0
- package/docs/more/42-timber-vs-others.mdx +68 -0
- package/docs/more/50-ai-agent-instructions.mdx +171 -0
- package/llms.txt +55 -0
- package/package.json +108 -26
- package/src/adapters/build-output-helper.ts +351 -0
- package/src/adapters/cloudflare-dev.ts +177 -0
- package/src/adapters/cloudflare-kv-cache.ts +204 -0
- package/src/adapters/cloudflare.ts +740 -129
- package/src/adapters/compress-module.ts +101 -88
- package/src/adapters/fs-identity.ts +156 -0
- package/src/adapters/nitro.ts +320 -120
- package/src/adapters/raw-imports.d.ts +5 -0
- package/src/adapters/shared.ts +274 -0
- package/src/adapters/types.ts +28 -7
- package/src/adapters/wrangler.d.ts +7 -0
- package/src/cache/cache-api.ts +107 -0
- package/src/cache/fast-hash.ts +5 -0
- package/src/cache/handler-store.ts +76 -0
- package/src/cache/index.ts +114 -21
- package/src/cache/invalidation-epoch.ts +93 -0
- package/src/cache/json-lossy-check.ts +75 -0
- package/src/cache/redis-handler.ts +197 -19
- package/src/cache/singleflight.ts +64 -6
- package/src/cache/sizeof.ts +33 -0
- package/src/cache/stable-stringify.ts +65 -2
- package/src/cache/store.ts +71 -0
- package/src/cache/stores/cloudflare-kv.ts +52 -0
- package/src/cache/stores/memory.ts +125 -0
- package/src/cache/stores/redis.ts +97 -0
- package/src/cache/stores/vercel.ts +59 -0
- package/src/cache/tag-aware-handler.ts +237 -0
- package/src/cache/timber-cache.ts +161 -36
- package/src/cdn/cloudflare-purge.ts +50 -0
- package/src/cdn/fastly-purge.ts +63 -0
- package/src/cdn/headers.ts +153 -0
- package/src/cdn/index.ts +17 -0
- package/src/cdn/purge-store.ts +34 -0
- package/src/cdn/workers-cache-purge.ts +30 -0
- package/src/cli-check.ts +458 -0
- package/src/cli-schema-sync.ts +401 -0
- package/src/cli.ts +221 -53
- package/src/client/browser-dev.ts +156 -1
- package/src/client/browser-entry/action-dispatch.ts +130 -0
- package/src/client/browser-entry/hmr.ts +70 -0
- package/src/client/browser-entry/hydrate.ts +198 -0
- package/src/client/browser-entry/index.ts +121 -0
- package/src/client/browser-entry/post-hydration.ts +122 -0
- package/src/client/browser-entry/router-init.ts +342 -0
- package/src/client/browser-entry/rsc-stream.ts +166 -0
- package/src/client/browser-entry/scroll.ts +50 -0
- package/src/client/error-boundary.tsx +210 -36
- package/src/client/error-reconstituter.tsx +79 -0
- package/src/client/form.tsx +31 -32
- package/src/client/history.ts +29 -7
- package/src/client/index.ts +78 -45
- package/src/client/internal.ts +59 -0
- package/src/client/link.tsx +397 -150
- package/src/client/navigation-api.ts +345 -0
- package/src/client/navigation-commit.ts +197 -0
- package/src/client/navigation-context.ts +43 -62
- package/src/client/navigation-root.tsx +580 -0
- package/src/client/nuqs-adapter.tsx +16 -3
- package/src/client/params-context.ts +192 -0
- package/src/client/router-effects.ts +231 -0
- package/src/client/router-lifecycle.ts +288 -0
- package/src/client/router-pipeline.ts +393 -0
- package/src/client/router-ref.ts +2 -2
- package/src/client/router-skew.ts +30 -0
- package/src/client/router-types.ts +230 -0
- package/src/client/router.ts +339 -410
- package/src/client/rsc-fetch.ts +530 -73
- package/src/client/segment-cache.ts +224 -38
- package/src/client/segment-outlet.tsx +141 -0
- package/src/client/segment-update-context.ts +42 -0
- package/src/client/shallow-url.ts +22 -0
- package/src/client/slot-context.ts +50 -0
- package/src/client/slot-outlet.tsx +22 -0
- package/src/client/slot-provider.tsx +32 -0
- package/src/client/ssr-data.ts +21 -6
- package/src/client/stale-client.ts +191 -0
- package/src/client/state.ts +19 -5
- package/src/client/top-loader.tsx +13 -10
- package/src/client/unload-guard.ts +34 -2
- package/src/client/use-cookie.ts +69 -17
- package/src/client/use-link-status.ts +7 -7
- package/src/client/use-pathname.ts +1 -0
- package/src/client/use-pending-navigation.ts +40 -0
- package/src/client/use-query-states.ts +206 -36
- package/src/client/use-router.ts +5 -2
- package/src/client/use-search-params.ts +31 -44
- package/src/client/{use-params.ts → use-segment-params.ts} +52 -25
- package/src/codec.ts +149 -0
- package/src/config-types.ts +282 -0
- package/src/config-validation.ts +330 -0
- package/src/content/index.ts +5 -13
- package/src/cookies/define-cookie.ts +222 -53
- package/src/cookies/index.ts +12 -1
- package/src/cookies/json-cookie.ts +105 -0
- package/src/cookies/validation.ts +192 -0
- package/src/dev-tools/404-page.ts +286 -0
- package/src/dev-tools/browser-logs.ts +55 -0
- package/src/dev-tools/dev-page-shell.ts +260 -0
- package/src/dev-tools/error-page.ts +331 -0
- package/src/dev-tools/holding-server.ts +187 -0
- package/src/dev-tools/hydration-overlay.ts +158 -0
- package/src/dev-tools/index.ts +83 -0
- package/src/dev-tools/instrumentation.ts +213 -0
- package/src/{server/dev-logger.ts → dev-tools/logger.ts} +33 -51
- package/src/{plugins/dev-logs.ts → dev-tools/logs.ts} +122 -26
- package/src/dev-tools/overlay.ts +469 -0
- package/src/dev-tools/stack-classifier.ts +75 -0
- package/src/dev-tools/terminal.ts +182 -0
- package/src/fonts/ast-walk.ts +235 -0
- package/src/fonts/ast.ts +477 -126
- package/src/fonts/bundle.ts +138 -0
- package/src/fonts/dev-middleware.ts +85 -0
- package/src/fonts/fallbacks.ts +0 -23
- package/src/fonts/google.ts +100 -18
- package/src/fonts/local.ts +9 -8
- package/src/fonts/paths.ts +58 -0
- package/src/fonts/pipeline.ts +348 -0
- package/src/fonts/transform.ts +311 -0
- package/src/fonts/types.ts +52 -1
- package/src/fonts/virtual-modules.ts +179 -0
- package/src/index.ts +468 -353
- package/src/params/codec-registry.ts +34 -0
- package/src/params/define-schema.ts +115 -0
- package/src/params/index.ts +17 -0
- package/src/params/resolve-schema.ts +84 -0
- package/src/plugin-context.ts +503 -0
- package/src/plugins/adapter-build.ts +229 -7
- package/src/plugins/build-manifest.ts +201 -26
- package/src/plugins/build-report.ts +259 -47
- package/src/plugins/cache.ts +243 -0
- package/src/plugins/callsite-ast.ts +472 -0
- package/src/plugins/callsite-jsx.ts +243 -0
- package/src/plugins/chunks.ts +74 -5
- package/src/plugins/client-chunks.ts +185 -0
- package/src/plugins/cloudflare-wasm.ts +141 -0
- package/src/plugins/content.ts +1 -1
- package/src/plugins/dev-server.ts +284 -94
- package/src/plugins/entries.ts +138 -16
- package/src/plugins/fonts.ts +228 -660
- package/src/plugins/mdx.ts +47 -10
- package/src/plugins/prebuilt-capture.ts +217 -0
- package/src/plugins/prebuilt-options-analysis.ts +175 -0
- package/src/plugins/prebuilt.ts +655 -0
- package/src/plugins/prerender-sugar.ts +328 -0
- package/src/plugins/request-dep/analysis.ts +447 -0
- package/src/plugins/request-dep/index.ts +376 -0
- package/src/plugins/request-dep/origin.ts +310 -0
- package/src/plugins/routing.ts +268 -277
- package/src/plugins/server-bundle.ts +89 -12
- package/src/plugins/shims.ts +240 -64
- package/src/plugins/static-build.ts +704 -66
- package/src/routing/codegen-shared.ts +39 -0
- package/src/routing/codegen-types.ts +62 -0
- package/src/routing/codegen-write.ts +139 -0
- package/src/routing/codegen.ts +339 -231
- package/src/routing/collision-probe.ts +438 -0
- package/src/routing/collision-spaces.ts +281 -0
- package/src/routing/convention-lint.ts +493 -0
- package/src/routing/export-detect.ts +448 -0
- package/src/routing/file-cache.ts +23 -0
- package/src/routing/index.ts +10 -1
- package/src/routing/interception.ts +894 -67
- package/src/routing/link-codegen.ts +280 -0
- package/src/routing/manifest-codegen.ts +226 -0
- package/src/routing/scanner.ts +368 -218
- package/src/routing/schema-validation.ts +155 -0
- package/src/routing/segment-classify.ts +280 -0
- package/src/routing/segment-codegen.ts +98 -0
- package/src/routing/segment-keys.ts +186 -0
- package/src/routing/slot-placement.ts +97 -0
- package/src/routing/types.ts +75 -26
- package/src/routing/walkers.ts +98 -0
- package/src/rsc-runtime/rsc.ts +9 -0
- package/src/rsc-runtime/ssr.ts +50 -0
- package/src/rsc-runtime/vendor-types.d.ts +7 -0
- package/src/schema-bridge.ts +380 -0
- package/src/search-params/define.ts +677 -0
- package/src/search-params/index.ts +14 -20
- package/src/search-params/parse-total.ts +91 -0
- package/src/search-params/serialize-equal.ts +14 -0
- package/src/search-params/wrappers.ts +150 -0
- package/src/server/access-gate.tsx +121 -51
- package/src/server/action-client.ts +120 -29
- package/src/server/action-encryption.ts +144 -0
- package/src/server/action-handler.ts +230 -43
- package/src/server/actions.ts +54 -57
- package/src/server/als-registry.ts +159 -20
- package/src/server/asset-headers.ts +15 -37
- package/src/server/body-limits.ts +10 -2
- package/src/server/build-manifest.ts +33 -57
- package/src/server/canonicalize.ts +6 -3
- package/src/server/chain-url-parts.ts +163 -0
- package/src/server/children-interception.ts +115 -0
- package/src/server/coalesce-tick.ts +75 -0
- package/src/server/compress.ts +43 -8
- package/src/server/cookie-context.ts +484 -0
- package/src/server/cookie-parsing.ts +163 -0
- package/src/server/csrf.ts +39 -6
- package/src/server/default-logger.ts +99 -0
- package/src/server/default-status-page.ts +127 -0
- package/src/server/deny-boundary.ts +516 -0
- package/src/server/deny-renderer.ts +181 -101
- package/src/server/dev-source-map.ts +31 -0
- package/src/server/early-hints-sender.ts +3 -2
- package/src/server/early-hints.ts +37 -27
- package/src/server/error-boundary-wrapper.ts +170 -44
- package/src/server/fallback-error.ts +79 -102
- package/src/server/flight-injection-state.ts +113 -0
- package/src/server/flight-scripts.ts +62 -0
- package/src/server/form-data.ts +124 -12
- package/src/server/head-response.ts +54 -0
- package/src/server/html-injector-core.ts +495 -0
- package/src/server/html-injectors.ts +271 -254
- package/src/server/index.ts +32 -184
- package/src/server/internal.ts +181 -0
- package/src/server/logger.ts +72 -36
- package/src/server/metadata-collector.ts +189 -0
- package/src/server/metadata-routes.ts +205 -24
- package/src/server/metadata.ts +21 -0
- package/src/server/middleware-runner.ts +31 -4
- package/src/server/node-stream-transforms.ts +336 -0
- package/src/server/param-coercion.ts +189 -0
- package/src/server/pipeline-helpers.ts +159 -0
- package/src/server/pipeline-interception.ts +109 -33
- package/src/server/pipeline-metadata.ts +14 -0
- package/src/server/pipeline-outcome.ts +196 -0
- package/src/server/pipeline-phases.ts +599 -0
- package/src/server/pipeline.ts +322 -382
- package/src/server/port-resolution.ts +215 -0
- package/src/server/prebuilt/cache-key.ts +299 -0
- package/src/server/prebuilt/capture-state.ts +89 -0
- package/src/server/prebuilt/key-discipline.ts +53 -0
- package/src/server/prebuilt/manifest-tag-index.ts +46 -0
- package/src/server/prebuilt/overlay.ts +256 -0
- package/src/server/prebuilt/payload-source.ts +202 -0
- package/src/server/prebuilt/slots.ts +190 -0
- package/src/server/prebuilt/synthetic-store.ts +122 -0
- package/src/server/prebuilt-builder.ts +804 -0
- package/src/server/prebuilt-runtime.ts +817 -0
- package/src/server/primitives.ts +174 -90
- package/src/server/publish-params.ts +42 -0
- package/src/server/render-timeout.ts +108 -0
- package/src/server/render-utils.ts +31 -0
- package/src/server/request-context.ts +243 -333
- package/src/server/request-dep.ts +37 -0
- package/src/server/route-element-builder.ts +666 -308
- package/src/server/route-handler.ts +39 -12
- package/src/server/route-matcher.ts +162 -269
- package/src/server/rsc-cache-key-guard.ts +164 -0
- package/src/server/rsc-entry/action-middleware-runner.ts +167 -0
- package/src/server/rsc-entry/api-handler.ts +67 -32
- package/src/server/rsc-entry/deny-fallback.ts +93 -0
- package/src/server/rsc-entry/error-renderer.ts +370 -94
- package/src/server/rsc-entry/helpers.ts +226 -95
- package/src/server/rsc-entry/index.ts +357 -330
- package/src/server/rsc-entry/render-route.ts +308 -0
- package/src/server/rsc-entry/revalidate-renderer.ts +350 -0
- package/src/server/rsc-entry/rsc-payload.ts +188 -55
- package/src/server/rsc-entry/rsc-stream.ts +122 -18
- package/src/server/rsc-entry/ssr-bridge.ts +18 -5
- package/src/server/rsc-entry/ssr-renderer.ts +299 -80
- package/src/server/rsc-entry/wrap-action-dispatch.ts +186 -0
- package/src/server/safe-load.ts +60 -0
- package/src/server/sensitive-fields.ts +230 -0
- package/src/server/server-only-guard-noop.js +3 -0
- package/src/server/sitemap-generator.ts +337 -0
- package/src/server/sitemap-handler.ts +157 -0
- package/src/server/skippable-prefix.ts +74 -0
- package/src/server/slot-interception.ts +168 -0
- package/src/server/slot-resolver.ts +678 -294
- package/src/server/ssr-bridge-types.ts +145 -0
- package/src/server/ssr-entry.ts +216 -78
- package/src/server/ssr-render.ts +345 -82
- package/src/server/ssr-wrappers.tsx +142 -0
- package/src/server/state-tree-diff.ts +85 -30
- package/src/server/static-generator.ts +715 -0
- package/src/server/static-not-found.ts +134 -0
- package/src/server/status-code-resolver.ts +107 -148
- package/src/server/stream-utils.ts +288 -0
- package/src/server/tracing.ts +126 -14
- package/src/server/tree-builder.ts +99 -168
- package/src/server/tree-match.ts +262 -0
- package/src/server/types.ts +84 -9
- package/src/server/utils/element-type.ts +72 -0
- package/src/server/utils/escape-html.ts +20 -0
- package/src/server/utils/mdx-file.ts +22 -0
- package/src/server/version-skew.ts +104 -0
- package/src/server/workers-cache-bridge.ts +33 -0
- package/src/shared/als-slots.ts +74 -0
- package/src/shared/base-path.ts +80 -0
- package/src/shared/href-validation.ts +159 -0
- package/src/shared/merge-search-params.ts +55 -0
- package/src/shared/param-value.ts +281 -0
- package/src/shared/payload-root.ts +152 -0
- package/src/shared/redirect-type.ts +17 -0
- package/src/shared/rsc-cache-key.ts +269 -0
- package/src/shared/rsc-error-envelope.ts +31 -0
- package/src/shared/rsc-manifest.ts +29 -0
- package/src/shared/rsc-media-type.ts +43 -0
- package/src/shared/rsc-payload-path.ts +45 -0
- package/src/shared/segment-info.ts +67 -0
- package/src/shared/slot-params.ts +110 -0
- package/src/shared/static-platform-files.ts +75 -0
- package/src/shims/font-google.ts +1 -1
- package/src/shims/font-local.ts +34 -0
- package/src/shims/headers.ts +122 -1
- package/src/shims/navigation-client.ts +36 -32
- package/src/shims/navigation.ts +10 -7
- package/src/utils/state-machine.ts +111 -0
- package/dist/_chunks/als-registry-B7DbZ2hS.js +0 -41
- package/dist/_chunks/als-registry-B7DbZ2hS.js.map +0 -1
- package/dist/_chunks/debug-B3Gypr3D.js +0 -108
- package/dist/_chunks/debug-B3Gypr3D.js.map +0 -1
- package/dist/_chunks/format-RyoGQL74.js +0 -164
- package/dist/_chunks/format-RyoGQL74.js.map +0 -1
- package/dist/_chunks/interception-BOoWmLUA.js +0 -676
- package/dist/_chunks/interception-BOoWmLUA.js.map +0 -1
- package/dist/_chunks/metadata-routes-Cjmvi3rQ.js +0 -153
- package/dist/_chunks/metadata-routes-Cjmvi3rQ.js.map +0 -1
- package/dist/_chunks/request-context-BQUC8PHn.js +0 -330
- package/dist/_chunks/request-context-BQUC8PHn.js.map +0 -1
- package/dist/_chunks/ssr-data-MjmprTmO.js.map +0 -1
- package/dist/_chunks/tracing-CemImE6h.js +0 -187
- package/dist/_chunks/tracing-CemImE6h.js.map +0 -1
- package/dist/_chunks/use-cookie-DX-l1_5E.js +0 -91
- package/dist/_chunks/use-cookie-DX-l1_5E.js.map +0 -1
- package/dist/_chunks/use-query-states-D5KaffOK.js +0 -109
- package/dist/_chunks/use-query-states-D5KaffOK.js.map +0 -1
- package/dist/adapters/cloudflare.js.map +0 -1
- package/dist/cache/index.js.map +0 -1
- package/dist/cache/register-cached-function.d.ts +0 -17
- package/dist/cache/register-cached-function.d.ts.map +0 -1
- package/dist/client/browser-entry.d.ts +0 -21
- package/dist/client/browser-entry.d.ts.map +0 -1
- package/dist/client/error-boundary.js.map +0 -1
- package/dist/client/head.d.ts +0 -16
- package/dist/client/head.d.ts.map +0 -1
- package/dist/client/link-status-provider.d.ts +0 -11
- package/dist/client/link-status-provider.d.ts.map +0 -1
- package/dist/client/segment-merger.d.ts +0 -119
- package/dist/client/segment-merger.d.ts.map +0 -1
- package/dist/client/stale-reload.d.ts +0 -44
- package/dist/client/stale-reload.d.ts.map +0 -1
- package/dist/client/transition-root.d.ts +0 -74
- package/dist/client/transition-root.d.ts.map +0 -1
- package/dist/client/use-navigation-pending.d.ts +0 -26
- package/dist/client/use-navigation-pending.d.ts.map +0 -1
- package/dist/client/use-params.d.ts.map +0 -1
- package/dist/plugins/cache-transform.d.ts +0 -36
- package/dist/plugins/cache-transform.d.ts.map +0 -1
- package/dist/plugins/dev-error-overlay.d.ts +0 -60
- package/dist/plugins/dev-error-overlay.d.ts.map +0 -1
- package/dist/plugins/dev-logs.d.ts.map +0 -1
- package/dist/plugins/dynamic-transform.d.ts +0 -72
- package/dist/plugins/dynamic-transform.d.ts.map +0 -1
- package/dist/plugins/server-action-exports.d.ts +0 -26
- package/dist/plugins/server-action-exports.d.ts.map +0 -1
- package/dist/routing/status-file-lint.d.ts +0 -33
- package/dist/routing/status-file-lint.d.ts.map +0 -1
- package/dist/search-params/analyze.d.ts +0 -54
- package/dist/search-params/analyze.d.ts.map +0 -1
- package/dist/search-params/builtin-codecs.d.ts +0 -105
- package/dist/search-params/builtin-codecs.d.ts.map +0 -1
- package/dist/search-params/codecs.d.ts +0 -53
- package/dist/search-params/codecs.d.ts.map +0 -1
- package/dist/search-params/create.d.ts +0 -106
- package/dist/search-params/create.d.ts.map +0 -1
- package/dist/search-params/registry.d.ts +0 -20
- package/dist/search-params/registry.d.ts.map +0 -1
- package/dist/server/client-module-map.d.ts +0 -47
- package/dist/server/client-module-map.d.ts.map +0 -1
- package/dist/server/dev-fetch-instrumentation.d.ts +0 -22
- package/dist/server/dev-fetch-instrumentation.d.ts.map +0 -1
- package/dist/server/dev-logger.d.ts.map +0 -1
- package/dist/server/dev-span-processor.d.ts +0 -29
- package/dist/server/dev-span-processor.d.ts.map +0 -1
- package/dist/server/dev-warnings.d.ts +0 -129
- package/dist/server/dev-warnings.d.ts.map +0 -1
- package/dist/server/flush.d.ts +0 -74
- package/dist/server/flush.d.ts.map +0 -1
- package/dist/server/manifest-status-resolver.d.ts +0 -58
- package/dist/server/manifest-status-resolver.d.ts.map +0 -1
- package/dist/server/prerender.d.ts +0 -77
- package/dist/server/prerender.d.ts.map +0 -1
- package/dist/utils/directive-parser.d.ts +0 -70
- package/dist/utils/directive-parser.d.ts.map +0 -1
- package/src/cache/register-cached-function.ts +0 -103
- package/src/client/browser-entry.ts +0 -678
- package/src/client/head.ts +0 -61
- package/src/client/link-status-provider.tsx +0 -30
- package/src/client/segment-merger.ts +0 -339
- package/src/client/stale-reload.ts +0 -87
- package/src/client/transition-root.tsx +0 -166
- package/src/client/use-navigation-pending.ts +0 -38
- package/src/plugins/cache-transform.ts +0 -199
- package/src/plugins/dev-error-overlay.ts +0 -230
- package/src/plugins/dynamic-transform.ts +0 -161
- package/src/plugins/server-action-exports.ts +0 -220
- package/src/routing/status-file-lint.ts +0 -112
- package/src/search-params/analyze.ts +0 -192
- package/src/search-params/builtin-codecs.ts +0 -228
- package/src/search-params/codecs.ts +0 -153
- package/src/search-params/create.ts +0 -321
- package/src/search-params/registry.ts +0 -31
- package/src/server/client-module-map.ts +0 -58
- package/src/server/dev-fetch-instrumentation.ts +0 -96
- package/src/server/dev-span-processor.ts +0 -78
- package/src/server/dev-warnings.ts +0 -283
- package/src/server/flush.ts +0 -182
- package/src/server/manifest-status-resolver.ts +0 -215
- package/src/server/prerender.ts +0 -139
- package/src/utils/directive-parser.ts +0 -529
|
@@ -0,0 +1,1624 @@
|
|
|
1
|
+
import { t as RSC_CONTENT_TYPE } from "../_chunks/rsc-media-type-DRqE_lD_.js";
|
|
2
|
+
import { a as randomRscCacheKey, n as RSC_KEY_PARAM, o as recordLookup, s as rscCacheKey } from "../_chunks/rsc-cache-key-DD0fl_-s.js";
|
|
3
|
+
import { i as withBasePath, r as stripBasePath } from "../_chunks/base-path-DaQrzbez.js";
|
|
4
|
+
import { t as rscPayloadPath } from "../_chunks/rsc-payload-path-B_LBodc2.js";
|
|
5
|
+
import { i as _setCachedSearch, l as cachedSearch, n as getSsrData, r as setSsrData, t as clearSsrData, u as cachedSearchParams } from "../_chunks/ssr-data-14MXm7Pj.js";
|
|
6
|
+
import { n as getRouterOrNull, r as setGlobalRouter, t as getRouter } from "../_chunks/router-ref-DuYuV_0Q.js";
|
|
7
|
+
import { i as markStaleFromError, n as isClientStale, r as markClientStale, t as TimberErrorBoundary } from "../_chunks/error-boundary-D-ODYX41.js";
|
|
8
|
+
import { n as useSegmentContext, t as SegmentProvider } from "../_chunks/segment-context-CjOlyB8Y.js";
|
|
9
|
+
import "../_chunks/rsc-error-envelope-tT5PJs4q.js";
|
|
10
|
+
import { a as supersedeNavigationTransitions, c as setNavigationState, i as setHardNavigating, l as useNavigationContext, n as setCurrentSlotParams, o as NavigationProvider, s as getNavigationState, t as setCurrentParams } from "../_chunks/use-segment-params-C4r4BD9T.js";
|
|
11
|
+
import { t as bindUseQueryStates } from "../_chunks/use-query-states-I3JMng6J.js";
|
|
12
|
+
//#region src/shared/payload-root.ts
|
|
13
|
+
/**
|
|
14
|
+
* What a reader gets when the value it was handed is not a payload root.
|
|
15
|
+
*
|
|
16
|
+
* In the browser this is unreachable for a real response: all four producers
|
|
17
|
+
* of a route payload go through `withPublishedParams`, and a client talking to
|
|
18
|
+
* a different build is answered with 204 at Stage 1c
|
|
19
|
+
* (`server/pipeline-phases.ts`) before any payload exists. It is reachable in
|
|
20
|
+
* the router's test/fallback path, where `decodeRsc` is absent and the
|
|
21
|
+
* "payload" is the raw response text.
|
|
22
|
+
*/
|
|
23
|
+
var NO_PUBLISHED_PARAMS = {
|
|
24
|
+
params: {},
|
|
25
|
+
slotParams: null
|
|
26
|
+
};
|
|
27
|
+
/** True when `value` carries published params — a root, or a read of one. */
|
|
28
|
+
function hasPublishedParams(value) {
|
|
29
|
+
return typeof value === "object" && value !== null && "params" in value && typeof value.params === "object" && value.params !== null;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Read the params published beside a tree.
|
|
33
|
+
*
|
|
34
|
+
* Accepts a payload root *or* a `PublishedParams` already split off one, so
|
|
35
|
+
* the client can pre-resolve on the navigation path and still hand the same
|
|
36
|
+
* value to the same provider. Never throws.
|
|
37
|
+
*/
|
|
38
|
+
function readPublishedParams(source) {
|
|
39
|
+
if (!hasPublishedParams(source)) return NO_PUBLISHED_PARAMS;
|
|
40
|
+
return {
|
|
41
|
+
params: source.params,
|
|
42
|
+
slotParams: source.slotParams ?? null
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Read the renderable tree out of a payload root.
|
|
47
|
+
*
|
|
48
|
+
* Returns the value unchanged when it is not a root — the router's fallback
|
|
49
|
+
* path stores raw response text under the same name, and a test asserting on
|
|
50
|
+
* that text should see the text.
|
|
51
|
+
*/
|
|
52
|
+
function readPayloadTree(root) {
|
|
53
|
+
if (typeof root === "object" && root !== null && "tree" in root && hasPublishedParams(root)) return root.tree;
|
|
54
|
+
return root;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Split a decoded payload root into its tree and its params.
|
|
58
|
+
*
|
|
59
|
+
* Accepts a settled root or a thenable of one, and preserves which it was: a
|
|
60
|
+
* settled root splits synchronously, so no code path gains a suspend point it
|
|
61
|
+
* did not already have.
|
|
62
|
+
*/
|
|
63
|
+
function splitPayloadRoot(root) {
|
|
64
|
+
if (typeof root !== "object" || root === null || typeof root.then !== "function") return {
|
|
65
|
+
tree: readPayloadTree(root),
|
|
66
|
+
params: readPublishedParams(root)
|
|
67
|
+
};
|
|
68
|
+
const settled = root;
|
|
69
|
+
const tree = Promise.resolve(settled).then(readPayloadTree);
|
|
70
|
+
tree.catch(() => {});
|
|
71
|
+
return {
|
|
72
|
+
tree,
|
|
73
|
+
params: Promise.resolve(settled).then(readPublishedParams, () => NO_PUBLISHED_PARAMS)
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/client/segment-cache.ts
|
|
78
|
+
/**
|
|
79
|
+
* Maintains the client-side segment tree representing currently mounted
|
|
80
|
+
* layouts and pages. Used for navigation reconciliation — the router diffs
|
|
81
|
+
* new routes against this tree to determine which segments to re-fetch.
|
|
82
|
+
*/
|
|
83
|
+
var SegmentCache = class {
|
|
84
|
+
root;
|
|
85
|
+
get(segment) {
|
|
86
|
+
if (segment === "/" || segment === this.root?.segment) return this.root;
|
|
87
|
+
}
|
|
88
|
+
set(segment, node) {
|
|
89
|
+
if (segment === "/" || !this.root) this.root = node;
|
|
90
|
+
}
|
|
91
|
+
clear() {
|
|
92
|
+
this.root = void 0;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Serialize the mounted segment tree for the X-Timber-State-Tree header.
|
|
96
|
+
* Only includes sync segments — async segments are excluded because the
|
|
97
|
+
* server must always re-render them (they may depend on request context).
|
|
98
|
+
*
|
|
99
|
+
* When mergeableFilter is provided, only segments whose paths are in the
|
|
100
|
+
* set are included. This ensures the server only skips segments that the
|
|
101
|
+
* client can actually merge (i.e., segments whose cached element tree
|
|
102
|
+
* contains an inner SegmentProvider the merger can splice into).
|
|
103
|
+
*
|
|
104
|
+
* `treePaths` is collected UNFILTERED, unlike `segments` and `slots`. Those
|
|
105
|
+
* two answer "what may the server skip re-rendering?", so every reason a
|
|
106
|
+
* segment cannot be reused is a reason to leave it out. `treePaths` answers
|
|
107
|
+
* "what is mounted right now?" for interception scoping — a request-dependent
|
|
108
|
+
* layout is still on screen, and dropping it would silently narrow the scope
|
|
109
|
+
* the server sees and cancel a modal that should open (TIM-1282).
|
|
110
|
+
*
|
|
111
|
+
* This is a performance optimization only, NOT a security boundary.
|
|
112
|
+
* The server always runs all access.ts files regardless of the state tree.
|
|
113
|
+
*/
|
|
114
|
+
serializeStateTree(mergeableFilter) {
|
|
115
|
+
const segments = [];
|
|
116
|
+
const slots = [];
|
|
117
|
+
const treePaths = [];
|
|
118
|
+
if (this.root) {
|
|
119
|
+
collectSyncSegments(this.root, segments, mergeableFilter);
|
|
120
|
+
collectSyncSlots(this.root, slots);
|
|
121
|
+
collectTreePaths(this.root, treePaths);
|
|
122
|
+
}
|
|
123
|
+
const tree = { segments };
|
|
124
|
+
if (slots.length > 0) tree.slots = slots;
|
|
125
|
+
if (treePaths.length > 0) tree.treePaths = treePaths;
|
|
126
|
+
return tree;
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
/** Recursively collect sync segment paths from the tree */
|
|
130
|
+
function collectSyncSegments(node, out, mergeableFilter) {
|
|
131
|
+
if (!node.isRequestDependent && (!mergeableFilter || mergeableFilter.has(node.segment))) out.push(node.segment);
|
|
132
|
+
for (const child of node.children.values()) collectSyncSegments(child, out, mergeableFilter);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Recursively collect the `app/` directory path of every mounted segment.
|
|
136
|
+
*
|
|
137
|
+
* Slots are not walked: a slot's own sub-tree can never own an intercepting
|
|
138
|
+
* slot's scope, because scopes are always ordinary segments (`interception.ts`
|
|
139
|
+
* derives one from the slot owner's ancestor chain).
|
|
140
|
+
*/
|
|
141
|
+
function collectTreePaths(node, out) {
|
|
142
|
+
if (node.treePath) out.push(node.treePath);
|
|
143
|
+
for (const child of node.children.values()) collectTreePaths(child, out);
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Recursively collect content keys from cacheable slots.
|
|
147
|
+
*
|
|
148
|
+
* The server advertises a content key per slot on every render (TIM-1370),
|
|
149
|
+
* encoding the owner's URL parts, the slot name, the matched entry file,
|
|
150
|
+
* and the slot's params. The client stores this key and sends it back on
|
|
151
|
+
* the next navigation so the server can decide skips by key membership —
|
|
152
|
+
* no departing URL reconstruction needed.
|
|
153
|
+
*/
|
|
154
|
+
function collectSyncSlots(node, out) {
|
|
155
|
+
if (node.slots) {
|
|
156
|
+
for (const slot of node.slots.values()) if (!slot.isRequestDependent && !slot.denied && slot.contentKey) out.push(slot.contentKey);
|
|
157
|
+
}
|
|
158
|
+
for (const child of node.children.values()) collectSyncSlots(child, out);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Build a SegmentNode tree from flat segment metadata.
|
|
162
|
+
*
|
|
163
|
+
* Takes an ordered list of segment descriptors (root → leaf) from the
|
|
164
|
+
* server's X-Timber-Segments header and constructs the hierarchical
|
|
165
|
+
* tree structure that SegmentCache expects.
|
|
166
|
+
*
|
|
167
|
+
* Each segment is nested as a child of the previous one, forming a
|
|
168
|
+
* linear chain from root to leaf. The leaf segment (page) is excluded
|
|
169
|
+
* from the tree — pages are never cached across navigations.
|
|
170
|
+
*/
|
|
171
|
+
function buildSegmentTree(segments) {
|
|
172
|
+
if (segments.length === 0) return void 0;
|
|
173
|
+
const segmentEntries = [];
|
|
174
|
+
const slotEntries = [];
|
|
175
|
+
for (const info of segments) if (info.slot) slotEntries.push(info);
|
|
176
|
+
else segmentEntries.push(info);
|
|
177
|
+
let root;
|
|
178
|
+
let parent;
|
|
179
|
+
const nodeById = /* @__PURE__ */ new Map();
|
|
180
|
+
for (const info of segmentEntries) {
|
|
181
|
+
const id = info.segmentId ?? info.path;
|
|
182
|
+
const node = {
|
|
183
|
+
segment: id,
|
|
184
|
+
treePath: info.treePath,
|
|
185
|
+
payload: null,
|
|
186
|
+
isRequestDependent: info.isRequestDependent,
|
|
187
|
+
children: /* @__PURE__ */ new Map()
|
|
188
|
+
};
|
|
189
|
+
nodeById.set(id, node);
|
|
190
|
+
if (!root) root = node;
|
|
191
|
+
if (parent) parent.children.set(id, node);
|
|
192
|
+
parent = node;
|
|
193
|
+
}
|
|
194
|
+
for (const slotInfo of slotEntries) {
|
|
195
|
+
const parentId = slotInfo.parentSegment;
|
|
196
|
+
const parentNode = parentId ? nodeById.get(parentId) : root;
|
|
197
|
+
if (!parentNode) continue;
|
|
198
|
+
const slotId = slotInfo.segmentId ?? slotInfo.path;
|
|
199
|
+
const slotNode = {
|
|
200
|
+
segment: slotId,
|
|
201
|
+
payload: null,
|
|
202
|
+
isRequestDependent: slotInfo.isRequestDependent,
|
|
203
|
+
children: /* @__PURE__ */ new Map(),
|
|
204
|
+
denied: slotInfo.denied,
|
|
205
|
+
contentKey: slotInfo.contentKey
|
|
206
|
+
};
|
|
207
|
+
if (!parentNode.slots) parentNode.slots = /* @__PURE__ */ new Map();
|
|
208
|
+
parentNode.slots.set(slotId, slotNode);
|
|
209
|
+
}
|
|
210
|
+
return root;
|
|
211
|
+
}
|
|
212
|
+
/** Sentinel value for negative cache entries (URL is not a route). */
|
|
213
|
+
var NEGATIVE_ENTRY = Object.freeze({ payload: null });
|
|
214
|
+
/**
|
|
215
|
+
* Compose the map key. Length-prefixed rather than delimiter-joined for the
|
|
216
|
+
* same reason `shared/rsc-cache-key.ts` is: any delimiter is forgeable by a
|
|
217
|
+
* value containing it, and a URL may contain any character a delimiter could.
|
|
218
|
+
*/
|
|
219
|
+
function prefetchMapKey(key) {
|
|
220
|
+
return `${key.from.length}:${key.from}:${key.scope.length}:${key.scope}:${key.url}`;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* The `scope` half of a `PrefetchKey`, derived from the state tree that will
|
|
224
|
+
* actually be sent. Taking it from the header value rather than re-walking the
|
|
225
|
+
* cache is the point: the key varies by exactly what the request varies by.
|
|
226
|
+
*/
|
|
227
|
+
function prefetchScopeOf(stateTree) {
|
|
228
|
+
return stateTree?.treePaths?.join("\0") ?? "";
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Short-lived cache for hover-triggered prefetches. Entries expire after
|
|
232
|
+
* 30 seconds. When a link is clicked, the prefetched payload is consumed
|
|
233
|
+
* (moved to the history stack) and removed from this cache.
|
|
234
|
+
*
|
|
235
|
+
* timber.js does NOT prefetch on viewport intersection — only explicit
|
|
236
|
+
* hover on <Link prefetch> triggers a prefetch.
|
|
237
|
+
*/
|
|
238
|
+
var PrefetchCache = class PrefetchCache {
|
|
239
|
+
static TTL_MS = 3e4;
|
|
240
|
+
entries = /* @__PURE__ */ new Map();
|
|
241
|
+
set(key, result) {
|
|
242
|
+
this.entries.set(prefetchMapKey(key), {
|
|
243
|
+
result,
|
|
244
|
+
expiresAt: Date.now() + PrefetchCache.TTL_MS
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
get(key) {
|
|
248
|
+
const mapKey = prefetchMapKey(key);
|
|
249
|
+
const entry = this.entries.get(mapKey);
|
|
250
|
+
if (!entry) return void 0;
|
|
251
|
+
if (Date.now() >= entry.expiresAt) {
|
|
252
|
+
this.entries.delete(mapKey);
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
return entry.result;
|
|
256
|
+
}
|
|
257
|
+
/** Get and remove the entry (used when navigation consumes a prefetch) */
|
|
258
|
+
consume(key) {
|
|
259
|
+
const result = this.get(key);
|
|
260
|
+
if (result !== void 0) this.entries.delete(prefetchMapKey(key));
|
|
261
|
+
return result;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Store a negative entry — the URL is not a route (non-RSC Content-Type).
|
|
265
|
+
*
|
|
266
|
+
* Keyed like every other entry even though "not a route" does not actually
|
|
267
|
+
* vary by departing URL: a source-independent negative would be a second
|
|
268
|
+
* keying rule to keep correct, and the only cost of the uniform one is a
|
|
269
|
+
* repeated fetch for a link hovered from a second page.
|
|
270
|
+
*/
|
|
271
|
+
setNegative(key) {
|
|
272
|
+
this.set(key, NEGATIVE_ENTRY);
|
|
273
|
+
}
|
|
274
|
+
/** Check if the entry is a negative cache entry (URL is not a route). */
|
|
275
|
+
isNegative(key) {
|
|
276
|
+
return this.get(key) === NEGATIVE_ENTRY;
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
//#endregion
|
|
280
|
+
//#region src/client/history.ts
|
|
281
|
+
/**
|
|
282
|
+
* Session-lived history stack keyed by URL. Enables instant back/forward
|
|
283
|
+
* navigation without a server roundtrip.
|
|
284
|
+
*
|
|
285
|
+
* On forward navigation, the new page's payload is pushed onto the stack.
|
|
286
|
+
* On popstate, the cached payload is replayed instantly.
|
|
287
|
+
*
|
|
288
|
+
* Entries are keyed by pathname + search. Used with the History API
|
|
289
|
+
* fallback and the Navigation API.
|
|
290
|
+
*
|
|
291
|
+
* Scroll positions are stored in history.state or Navigation API entry
|
|
292
|
+
* state, not in this stack — see design/19-client-navigation.md §Scroll Restoration.
|
|
293
|
+
*
|
|
294
|
+
* Entries persist for the session duration (no expiry) and are cleared
|
|
295
|
+
* when the tab is closed — matching browser back-button behavior.
|
|
296
|
+
*/
|
|
297
|
+
var HistoryStack = class {
|
|
298
|
+
entries = /* @__PURE__ */ new Map();
|
|
299
|
+
push(url, entry) {
|
|
300
|
+
this.entries.set(url, entry);
|
|
301
|
+
}
|
|
302
|
+
get(url) {
|
|
303
|
+
return this.entries.get(url);
|
|
304
|
+
}
|
|
305
|
+
has(url) {
|
|
306
|
+
return this.entries.has(url);
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
//#endregion
|
|
310
|
+
//#region src/client/navigation-commit.ts
|
|
311
|
+
/**
|
|
312
|
+
* What it means for a page to be "current" on the client.
|
|
313
|
+
*
|
|
314
|
+
* One module owns every write that makes a navigation's destination the
|
|
315
|
+
* current page, and the read that describes the current page back to the
|
|
316
|
+
* server. Keeping them together is the point: `X-Timber-State-Tree` is
|
|
317
|
+
* derived from the segment cache, so the thing that publishes and the thing
|
|
318
|
+
* that reports have to agree about when a page becomes current.
|
|
319
|
+
*
|
|
320
|
+
* See design/19-client-navigation.md §"State Update Invariants".
|
|
321
|
+
*/
|
|
322
|
+
/**
|
|
323
|
+
* Derive the navigation state (pathname + search) a URL renders with.
|
|
324
|
+
*
|
|
325
|
+
* Pure: publishing it — the module-level fallback for tests and SSR, and the
|
|
326
|
+
* globalThis bridge — is `prepareNavigation`'s commit, which runs only once
|
|
327
|
+
* the render is known to have won (TIM-1301). Callers pass the returned value
|
|
328
|
+
* explicitly to renderRoot/wrapPayload, so a render never depends on the
|
|
329
|
+
* publish having happened first.
|
|
330
|
+
*/
|
|
331
|
+
function deriveNavigationState(url) {
|
|
332
|
+
const parsed = new URL(url, "http://localhost");
|
|
333
|
+
return {
|
|
334
|
+
pathname: parsed.pathname || "/",
|
|
335
|
+
search: parsed.search
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
function createNavigationCommitter(deps) {
|
|
339
|
+
const { segmentCache, historyStack } = deps;
|
|
340
|
+
/**
|
|
341
|
+
* Update the segment cache from server-provided segment metadata.
|
|
342
|
+
*
|
|
343
|
+
* Runs whether or not `clientSegmentCache` is enabled: the tree is also
|
|
344
|
+
* where the mounted tree paths come from, and those cross on every
|
|
345
|
+
* navigation. What the flag gates is which parts get serialized — see
|
|
346
|
+
* `currentStateTree`.
|
|
347
|
+
*/
|
|
348
|
+
function updateSegmentCache(segmentInfo) {
|
|
349
|
+
if (!segmentInfo || segmentInfo.length === 0) return;
|
|
350
|
+
const tree = buildSegmentTree(segmentInfo);
|
|
351
|
+
if (tree) segmentCache.set("/", tree);
|
|
352
|
+
}
|
|
353
|
+
return {
|
|
354
|
+
updateSegmentCache,
|
|
355
|
+
/**
|
|
356
|
+
* The X-Timber-State-Tree to send with the next RSC request.
|
|
357
|
+
*
|
|
358
|
+
* Two different things travel on one header. `segments`/`slots` are the
|
|
359
|
+
* caching opt-in and are omitted unless `clientSegmentCache` is on.
|
|
360
|
+
* `treePaths` is how the server learns which route is actually mounted,
|
|
361
|
+
* which stops being derivable from the address bar as soon as a modal is
|
|
362
|
+
* open — so it crosses regardless (TIM-1282). Undefined when there is
|
|
363
|
+
* nothing to say, so a no-op header never enters the `_rsc` cache key.
|
|
364
|
+
*
|
|
365
|
+
* Reads what the last *committed* navigation published, so a superseded
|
|
366
|
+
* navigation's destination can never end up describing the mounted tree
|
|
367
|
+
* (TIM-1301).
|
|
368
|
+
*/
|
|
369
|
+
currentStateTree() {
|
|
370
|
+
const tree = segmentCache.serializeStateTree();
|
|
371
|
+
if (deps.clientSegmentCache()) return tree;
|
|
372
|
+
return tree.treePaths ? {
|
|
373
|
+
segments: [],
|
|
374
|
+
treePaths: tree.treePaths
|
|
375
|
+
} : void 0;
|
|
376
|
+
},
|
|
377
|
+
/**
|
|
378
|
+
* Prepare all navigation-owned state for a new page — without publishing
|
|
379
|
+
* any of it. Every code path that changes the "current page" must go
|
|
380
|
+
* through this function, which is what makes "forgot a field" impossible
|
|
381
|
+
* by construction.
|
|
382
|
+
*
|
|
383
|
+
* Returns the destination's `NavigationState`, which is a pure function of
|
|
384
|
+
* the URL and is what the incoming tree is *rendered* with, plus a
|
|
385
|
+
* `commit` thunk that performs the writes that make a page current:
|
|
386
|
+
* 1. Segment cache — update from server-provided segment metadata
|
|
387
|
+
* 2. Navigation state — pathname/search for usePathname/useSearchParams
|
|
388
|
+
* 3. History stack — store the payload for instant back/forward replay
|
|
389
|
+
*
|
|
390
|
+
* Nothing is written until `commit()` runs, and on a transitioned
|
|
391
|
+
* navigation it runs only once the transition is known to have won — see
|
|
392
|
+
* `renderViaTransition` and `NavigationRoot`. A navigation superseded
|
|
393
|
+
* while its payload was in flight never calls it, so the cache, the
|
|
394
|
+
* pathname the client reports and the history stack all keep describing
|
|
395
|
+
* the route still on screen (TIM-1301).
|
|
396
|
+
*
|
|
397
|
+
* Callers with state of their own to publish — the address bar, the
|
|
398
|
+
* client's record of the mounted tree — wrap this thunk rather than
|
|
399
|
+
* commit beside it, so there stays exactly one moment at which a page
|
|
400
|
+
* becomes current.
|
|
401
|
+
*/
|
|
402
|
+
prepareNavigation(url, opts) {
|
|
403
|
+
const navState = deriveNavigationState(url);
|
|
404
|
+
const segmentInfo = opts.status === void 0 || opts.status < 400 ? opts.segmentInfo : [];
|
|
405
|
+
return {
|
|
406
|
+
navState,
|
|
407
|
+
commit() {
|
|
408
|
+
if (segmentInfo && segmentInfo.length > 0) updateSegmentCache(segmentInfo);
|
|
409
|
+
else if (segmentInfo?.length === 0 || opts.clearSegmentCacheOnEmpty) segmentCache.clear();
|
|
410
|
+
setNavigationState(navState);
|
|
411
|
+
historyStack.push(url, {
|
|
412
|
+
payload: opts.payload,
|
|
413
|
+
params: opts.params,
|
|
414
|
+
segmentInfo
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
//#endregion
|
|
422
|
+
//#region src/client/rsc-fetch.ts
|
|
423
|
+
/**
|
|
424
|
+
* RSC Fetch — handles fetching and parsing RSC Flight payloads.
|
|
425
|
+
*
|
|
426
|
+
* Extracted from router.ts to keep both files under the 500-line limit.
|
|
427
|
+
* This module handles:
|
|
428
|
+
* - Cache-busting URL generation for RSC requests
|
|
429
|
+
* - Building RSC request headers (Accept, X-Timber-State-Tree)
|
|
430
|
+
* - Extracting metadata from RSC response headers
|
|
431
|
+
* - Fetching and decoding RSC payloads
|
|
432
|
+
*
|
|
433
|
+
* See design/19-client-navigation.md §"RSC Payload Handling"
|
|
434
|
+
*/
|
|
435
|
+
/**
|
|
436
|
+
* Append a `_rsc=<key>` query parameter to the URL (TIM-1268).
|
|
437
|
+
*
|
|
438
|
+
* The key is a deterministic hash of the RSC request headers, so identical
|
|
439
|
+
* requests share a URL and the payload becomes cacheable. It also keeps the
|
|
440
|
+
* document and the payload on different URLs, so a shared cache cannot
|
|
441
|
+
* return HTML for an RSC request (or vice versa) even where `Vary` is
|
|
442
|
+
* opt-in configuration rather than default behaviour — Cloudflare and
|
|
443
|
+
* CloudFront both. See GHSA-wfc6-r584-vfw7, design/13-security.md.
|
|
444
|
+
*
|
|
445
|
+
* The origin recomputes this key from the received headers and refuses to
|
|
446
|
+
* let a mismatched response be shared-cached, so a caller cannot claim
|
|
447
|
+
* another client's key while sending its own headers.
|
|
448
|
+
*
|
|
449
|
+
* Falls back to a random value when no key can be derived — `crypto.subtle`
|
|
450
|
+
* is absent in non-secure browsing contexts (plain `http://` on a LAN
|
|
451
|
+
* address). Dropping the parameter instead would put the payload back on
|
|
452
|
+
* the document URL, where a query-keyed cache that ignores `Vary` could
|
|
453
|
+
* store a Flight response under `/about` and serve it to an HTML
|
|
454
|
+
* navigation. The random parameter this feature replaced did separate those
|
|
455
|
+
* representations, and the fallback must not be worse than what it
|
|
456
|
+
* replaced. The origin cannot verify a random key, so it refuses to
|
|
457
|
+
* share-cache the response — which is exactly the old behaviour, where a
|
|
458
|
+
* unique URL was never a cache hit anyway.
|
|
459
|
+
*
|
|
460
|
+
* Strips any #fragment before appending — fragments are client-only and
|
|
461
|
+
* fetch() discards them, so _rsc would land inside the hash and be lost.
|
|
462
|
+
*/
|
|
463
|
+
async function appendRscParam(url, headers) {
|
|
464
|
+
const hashIndex = url.indexOf("#");
|
|
465
|
+
const urlWithoutHash = hashIndex === -1 ? url : url.slice(0, hashIndex);
|
|
466
|
+
const key = await rscCacheKey(recordLookup(headers)) ?? randomRscCacheKey();
|
|
467
|
+
return `${urlWithoutHash}${urlWithoutHash.includes("?") ? "&" : "?"}${RSC_KEY_PARAM}=${key}`;
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* The client's deployment ID, set at bootstrap from the runtime config.
|
|
471
|
+
* Sent with every RSC/action request for version skew detection.
|
|
472
|
+
* Null in dev mode. See TIM-446.
|
|
473
|
+
*/
|
|
474
|
+
var clientDeploymentId = null;
|
|
475
|
+
/**
|
|
476
|
+
* The deployment base path (Vite's resolved `base`), normalized.
|
|
477
|
+
* Set at bootstrap from `virtual:timber-config`; `'/'` unless the app is
|
|
478
|
+
* deployed under a sub-path. See design/11-platform.md, TIM-1261.
|
|
479
|
+
*
|
|
480
|
+
* **The base is applied in exactly one place: at fetch time**
|
|
481
|
+
* (`toStaticRscUrl`). The static build writes the RSC manifest with
|
|
482
|
+
* root-relative keys *and* root-relative URLs, so the generated site stays
|
|
483
|
+
* relocatable and there is no second copy of the base to drift from this one.
|
|
484
|
+
*/
|
|
485
|
+
var basePath = "/";
|
|
486
|
+
/**
|
|
487
|
+
* When true, RSC fetches use _rsc/*.rsc file URLs instead of
|
|
488
|
+
* the route URL with Accept headers. Static hosts ignore Accept
|
|
489
|
+
* headers, so the client must fetch the pre-generated .rsc files
|
|
490
|
+
* directly. Set at bootstrap from virtual:timber-config output mode.
|
|
491
|
+
*/
|
|
492
|
+
var staticMode = false;
|
|
493
|
+
/**
|
|
494
|
+
* RSC manifest mapping unhashed → content-hashed `.rsc` URLs. Populated from
|
|
495
|
+
* `window.__TIMBER_RSC_MANIFEST__` (injected into HTML during static
|
|
496
|
+
* generation). Shape shared with the static build that writes it — see
|
|
497
|
+
* `shared/rsc-manifest.ts`. See TIM-1254.
|
|
498
|
+
*/
|
|
499
|
+
var rscManifest = null;
|
|
500
|
+
function getRscManifest() {
|
|
501
|
+
if (rscManifest) return rscManifest;
|
|
502
|
+
if (typeof window !== "undefined" && window.__TIMBER_RSC_MANIFEST__) rscManifest = window.__TIMBER_RSC_MANIFEST__;
|
|
503
|
+
return rscManifest;
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Resolve a route URL to the `_rsc/*.rsc` file to fetch. The naming rule is
|
|
507
|
+
* `shared/rsc-payload-path.ts`, shared with the build that writes the files.
|
|
508
|
+
*
|
|
509
|
+
* When an RSC manifest is available (hashed filenames from TIM-1254),
|
|
510
|
+
* the manifest is consulted to resolve to the hashed path.
|
|
511
|
+
*
|
|
512
|
+
* / → /_rsc/index.rsc (or /_rsc/index-B7YxEKdN.rsc with manifest)
|
|
513
|
+
* /about → /_rsc/about/index.rsc (or /_rsc/about/index-C8ZzFLfO.rsc)
|
|
514
|
+
* /blog/hello → /_rsc/blog/hello/index.rsc
|
|
515
|
+
*
|
|
516
|
+
* The manifest is written and read in route space (no base prefix), so the
|
|
517
|
+
* base is applied here — once, on the way out. See client/base-path.ts.
|
|
518
|
+
*/
|
|
519
|
+
function toStaticRscUrl(url) {
|
|
520
|
+
const unhashed = toUnhashedRscUrl(url);
|
|
521
|
+
const hashedUrl = manifestLookup(unhashed);
|
|
522
|
+
return {
|
|
523
|
+
url: withBasePath(basePath, hashedUrl ?? unhashed),
|
|
524
|
+
hashed: hashedUrl !== null
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
* Compute the unhashed `_rsc/*.rsc` path for a route URL.
|
|
529
|
+
*
|
|
530
|
+
* Returns a **route-space** path: the deployment base is stripped from the
|
|
531
|
+
* incoming URL and is NOT re-applied, because this value doubles as the RSC
|
|
532
|
+
* manifest key, and the manifest is base-less. `toStaticRscUrl` applies the
|
|
533
|
+
* base to whatever is actually fetched.
|
|
534
|
+
*
|
|
535
|
+
* @internal Exported for testing.
|
|
536
|
+
*/
|
|
537
|
+
function toUnhashedRscUrl(url) {
|
|
538
|
+
const hashIndex = url.indexOf("#");
|
|
539
|
+
const queryIndex = url.indexOf("?");
|
|
540
|
+
const hashEnd = hashIndex === -1 ? url.length : hashIndex;
|
|
541
|
+
const queryEnd = queryIndex === -1 ? url.length : queryIndex;
|
|
542
|
+
const end = Math.min(hashEnd, queryEnd);
|
|
543
|
+
let pathname = stripBasePath(basePath, url.slice(0, end));
|
|
544
|
+
if (pathname.length > 1 && pathname.endsWith("/")) pathname = pathname.slice(0, -1);
|
|
545
|
+
return rscPayloadPath(pathname);
|
|
546
|
+
}
|
|
547
|
+
/**
|
|
548
|
+
* Look up a key in the RSC manifest, falling back to percent-decoded
|
|
549
|
+
* lookup for encoded browser URLs. Returns the entry or null.
|
|
550
|
+
*/
|
|
551
|
+
function manifestEntry(key) {
|
|
552
|
+
const manifest = getRscManifest();
|
|
553
|
+
if (!manifest) return null;
|
|
554
|
+
if (manifest[key]) return manifest[key];
|
|
555
|
+
try {
|
|
556
|
+
const decoded = decodeURIComponent(key);
|
|
557
|
+
if (decoded !== key && manifest[decoded]) return manifest[decoded];
|
|
558
|
+
} catch {}
|
|
559
|
+
return null;
|
|
560
|
+
}
|
|
561
|
+
/**
|
|
562
|
+
* Look up the hashed URL for an unhashed RSC path.
|
|
563
|
+
*/
|
|
564
|
+
function manifestLookup(key) {
|
|
565
|
+
return manifestEntry(key)?.url ?? null;
|
|
566
|
+
}
|
|
567
|
+
/** Header name used by the server to signal a version skew reload. */
|
|
568
|
+
var RELOAD_HEADER = "X-Timber-Reload";
|
|
569
|
+
/** Header name for the client's deployment ID. */
|
|
570
|
+
var DEPLOYMENT_ID_HEADER = "X-Timber-Deployment-Id";
|
|
571
|
+
/**
|
|
572
|
+
* Check if a response signals a version skew reload.
|
|
573
|
+
* Triggers a full page reload if the server indicates the client is stale.
|
|
574
|
+
*/
|
|
575
|
+
function checkReloadSignal(response) {
|
|
576
|
+
return response.headers.get(RELOAD_HEADER) === "1";
|
|
577
|
+
}
|
|
578
|
+
/**
|
|
579
|
+
* Build the headers for an RSC payload request.
|
|
580
|
+
*
|
|
581
|
+
* **Every header added here is hashed into the payload URL** as the `_rsc`
|
|
582
|
+
* cache key (see `rscCacheKey`), and URLs are logged by proxies, CDNs, and
|
|
583
|
+
* origin access logs. So: no credentials, no session identifiers, no
|
|
584
|
+
* user-supplied content. `fnv1aHash` is a cache-key hash, not a KDF — a
|
|
585
|
+
* low-entropy secret would be recoverable from the URL by brute force.
|
|
586
|
+
* Authentication already travels on cookies, which are not part of this
|
|
587
|
+
* object and never enter the key.
|
|
588
|
+
*/
|
|
589
|
+
function buildRscHeaders(stateTree, currentUrl) {
|
|
590
|
+
const headers = { Accept: RSC_CONTENT_TYPE };
|
|
591
|
+
if (stateTree) headers["X-Timber-State-Tree"] = JSON.stringify(stateTree);
|
|
592
|
+
if (currentUrl) headers["X-Timber-URL"] = currentUrl;
|
|
593
|
+
if (clientDeploymentId) headers[DEPLOYMENT_ID_HEADER] = clientDeploymentId;
|
|
594
|
+
return headers;
|
|
595
|
+
}
|
|
596
|
+
/** Dev-only warning for malformed framework headers. Tree-shaken in production. */
|
|
597
|
+
function warnMalformedHeader(headerName, raw) {
|
|
598
|
+
if (process.env.NODE_ENV !== "production") {
|
|
599
|
+
const preview = raw.length > 200 ? raw.slice(0, 200) + "…" : raw;
|
|
600
|
+
console.warn(`[timber] Malformed ${headerName} header \u2014 JSON.parse failed. This indicates a framework bug or header corruption. Raw (first 200 chars): ${preview}`);
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* Extract segment metadata from the X-Timber-Segments response header.
|
|
605
|
+
* Returns null if the header is missing or malformed.
|
|
606
|
+
*
|
|
607
|
+
* Format: JSON array of {path, isRequestDependent} objects describing the rendered
|
|
608
|
+
* segment chain from root to leaf. Used to populate the client-side
|
|
609
|
+
* segment cache for state tree diffing on subsequent navigations.
|
|
610
|
+
*/
|
|
611
|
+
function extractSegmentInfo(response) {
|
|
612
|
+
const header = response.headers.get("X-Timber-Segments");
|
|
613
|
+
if (!header) return null;
|
|
614
|
+
try {
|
|
615
|
+
return JSON.parse(header);
|
|
616
|
+
} catch {
|
|
617
|
+
warnMalformedHeader("X-Timber-Segments", header);
|
|
618
|
+
return null;
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
/**
|
|
622
|
+
* Extract skipped segment paths from the X-Timber-Skipped-Segments header.
|
|
623
|
+
* Returns null if the header is missing or malformed.
|
|
624
|
+
*
|
|
625
|
+
* When the server skips sync layouts the client already has cached,
|
|
626
|
+
* it sends this header listing the skipped segment paths (outermost first).
|
|
627
|
+
* The client uses this to merge the partial payload with cached segments.
|
|
628
|
+
*/
|
|
629
|
+
function extractSkippedSegments(response) {
|
|
630
|
+
const header = response.headers.get("X-Timber-Skipped-Segments");
|
|
631
|
+
if (!header) return null;
|
|
632
|
+
try {
|
|
633
|
+
const parsed = JSON.parse(header);
|
|
634
|
+
return Array.isArray(parsed) ? parsed : null;
|
|
635
|
+
} catch {
|
|
636
|
+
warnMalformedHeader("X-Timber-Skipped-Segments", header);
|
|
637
|
+
return null;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* Thrown when an RSC payload response contains X-Timber-Redirect header.
|
|
642
|
+
* Caught in navigate() to trigger a soft router navigation to the redirect target.
|
|
643
|
+
*/
|
|
644
|
+
var RedirectError = class extends Error {
|
|
645
|
+
redirectUrl;
|
|
646
|
+
constructor(url) {
|
|
647
|
+
super(`Server redirect to ${url}`);
|
|
648
|
+
this.redirectUrl = url;
|
|
649
|
+
}
|
|
650
|
+
};
|
|
651
|
+
/**
|
|
652
|
+
* Thrown when the server signals a version skew (X-Timber-Reload header).
|
|
653
|
+
* Caught in navigate() to trigger a full page reload.
|
|
654
|
+
* See TIM-446.
|
|
655
|
+
*/
|
|
656
|
+
var VersionSkewError = class extends Error {
|
|
657
|
+
constructor() {
|
|
658
|
+
super("Version skew detected — server has been redeployed");
|
|
659
|
+
}
|
|
660
|
+
};
|
|
661
|
+
/**
|
|
662
|
+
* Thrown when the server returns an error for an RSC payload request.
|
|
663
|
+
* The server sends X-Timber-Error header and a JSON body instead of a
|
|
664
|
+
* broken RSC stream for any RenderError (4xx or 5xx). Caught in
|
|
665
|
+
* navigate() to trigger a hard navigation so the server can render
|
|
666
|
+
* the error page as HTML.
|
|
667
|
+
*
|
|
668
|
+
* See design/10-error-handling.md §"Error Page Rendering for Client Navigation"
|
|
669
|
+
*/
|
|
670
|
+
var ServerErrorResponse = class extends Error {
|
|
671
|
+
status;
|
|
672
|
+
url;
|
|
673
|
+
constructor(status, url) {
|
|
674
|
+
super(`Server error ${status} during navigation to ${url}`);
|
|
675
|
+
this.status = status;
|
|
676
|
+
this.url = url;
|
|
677
|
+
}
|
|
678
|
+
};
|
|
679
|
+
/**
|
|
680
|
+
* Thrown when the RSC fetch response has a Content-Type that is not
|
|
681
|
+
* text/x-component — e.g., a static asset (image, CSS, JS) served
|
|
682
|
+
* for a same-origin URL that isn't a route. The response body is
|
|
683
|
+
* cancelled immediately (headers-only cost). Caught in navigate()
|
|
684
|
+
* to trigger a hard navigation; caught in prefetch() to store a
|
|
685
|
+
* negative cache entry so click hard-navigates without a second fetch.
|
|
686
|
+
*
|
|
687
|
+
* See TIM-1231.
|
|
688
|
+
*/
|
|
689
|
+
var NonRscResponse = class extends Error {
|
|
690
|
+
url;
|
|
691
|
+
constructor(url) {
|
|
692
|
+
super(`Non-RSC response for ${url}`);
|
|
693
|
+
this.url = url;
|
|
694
|
+
}
|
|
695
|
+
};
|
|
696
|
+
/**
|
|
697
|
+
* Wrap a response body stream to track when it's fully consumed.
|
|
698
|
+
* Returns a new body that passes all chunks through unchanged, plus
|
|
699
|
+
* a `done` promise that resolves when the last chunk is read (or
|
|
700
|
+
* rejects if the stream errors).
|
|
701
|
+
*
|
|
702
|
+
* createFromFetch's thenable resolves on shell arrival, but callers need to
|
|
703
|
+
* know when the stream is fully decoded: that is what `navigateTransition`'s
|
|
704
|
+
* returned promise means, and what the router's pending store, the Navigation
|
|
705
|
+
* API deferred and `<Link>`'s `isPending` are all timed against.
|
|
706
|
+
*/
|
|
707
|
+
function trackStreamCompletion(body) {
|
|
708
|
+
let resolveDone;
|
|
709
|
+
let rejectDone;
|
|
710
|
+
const done = new Promise((res, rej) => {
|
|
711
|
+
resolveDone = res;
|
|
712
|
+
rejectDone = rej;
|
|
713
|
+
});
|
|
714
|
+
const reader = body.getReader();
|
|
715
|
+
return {
|
|
716
|
+
body: new ReadableStream({
|
|
717
|
+
async pull(controller) {
|
|
718
|
+
try {
|
|
719
|
+
const result = await reader.read();
|
|
720
|
+
if (result.done) {
|
|
721
|
+
controller.close();
|
|
722
|
+
resolveDone();
|
|
723
|
+
} else controller.enqueue(result.value);
|
|
724
|
+
} catch (error) {
|
|
725
|
+
controller.error(error);
|
|
726
|
+
rejectDone(error);
|
|
727
|
+
}
|
|
728
|
+
},
|
|
729
|
+
cancel(reason) {
|
|
730
|
+
reader.cancel(reason);
|
|
731
|
+
resolveDone();
|
|
732
|
+
}
|
|
733
|
+
}),
|
|
734
|
+
done
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
/**
|
|
738
|
+
* Fetch an RSC payload from the server. If a decodeRsc function is provided,
|
|
739
|
+
* the response is decoded into a React element tree via createFromFetch.
|
|
740
|
+
* Otherwise, the raw response text is returned (test mode).
|
|
741
|
+
*/
|
|
742
|
+
async function fetchRscPayload(url, deps, stateTree, currentUrl, signal) {
|
|
743
|
+
const staticTarget = staticMode ? toStaticRscUrl(url) : null;
|
|
744
|
+
const fetchTarget = staticTarget ? staticTarget.url : url;
|
|
745
|
+
const headers = staticMode ? buildRscHeaders(void 0, void 0) : buildRscHeaders(stateTree, currentUrl);
|
|
746
|
+
const rscUrl = staticTarget?.hashed ? fetchTarget : await appendRscParam(fetchTarget, headers);
|
|
747
|
+
signal?.throwIfAborted();
|
|
748
|
+
if (deps.decodeRsc) {
|
|
749
|
+
const fetchPromise = deps.fetch(rscUrl, {
|
|
750
|
+
headers,
|
|
751
|
+
redirect: "manual",
|
|
752
|
+
signal
|
|
753
|
+
});
|
|
754
|
+
let segmentInfo = null;
|
|
755
|
+
let skippedSegments = null;
|
|
756
|
+
let status = 200;
|
|
757
|
+
let streamDone = Promise.resolve();
|
|
758
|
+
const wrappedPromise = fetchPromise.then((response) => {
|
|
759
|
+
if (checkReloadSignal(response)) throw new VersionSkewError();
|
|
760
|
+
const redirectLocation = response.headers.get("X-Timber-Redirect") || (response.status >= 300 && response.status < 400 ? response.headers.get("Location") : null);
|
|
761
|
+
if (redirectLocation) throw new RedirectError(redirectLocation);
|
|
762
|
+
if (response.headers.get("X-Timber-Error") === "1") throw new ServerErrorResponse(response.status, url);
|
|
763
|
+
if (staticMode) {
|
|
764
|
+
const contentType = response.headers.get("content-type");
|
|
765
|
+
if (!response.ok || contentType && contentType.split(";")[0].trim().toLowerCase() === "text/html") {
|
|
766
|
+
response.body?.cancel();
|
|
767
|
+
throw new NonRscResponse(url);
|
|
768
|
+
}
|
|
769
|
+
} else {
|
|
770
|
+
const contentType = response.headers.get("content-type");
|
|
771
|
+
if (!contentType || !contentType.split(";")[0].trim().includes("text/x-component")) {
|
|
772
|
+
response.body?.cancel();
|
|
773
|
+
throw new NonRscResponse(url);
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
segmentInfo = extractSegmentInfo(response);
|
|
777
|
+
skippedSegments = extractSkippedSegments(response);
|
|
778
|
+
status = response.status;
|
|
779
|
+
if (response.body) {
|
|
780
|
+
const tracked = trackStreamCompletion(response.body);
|
|
781
|
+
streamDone = tracked.done;
|
|
782
|
+
streamDone.catch(() => {});
|
|
783
|
+
return new Response(tracked.body, {
|
|
784
|
+
headers: response.headers,
|
|
785
|
+
status: response.status
|
|
786
|
+
});
|
|
787
|
+
}
|
|
788
|
+
return response;
|
|
789
|
+
});
|
|
790
|
+
await wrappedPromise;
|
|
791
|
+
const root = deps.decodeRsc(wrappedPromise);
|
|
792
|
+
const { tree: payload, params } = splitPayloadRoot(root);
|
|
793
|
+
const payloadError = new Promise((_, reject) => {
|
|
794
|
+
Promise.resolve(root).then(() => {}, reject);
|
|
795
|
+
});
|
|
796
|
+
payloadError.catch(() => {});
|
|
797
|
+
const decodePromise = Promise.race([streamDone, payloadError]);
|
|
798
|
+
decodePromise.catch(() => {});
|
|
799
|
+
return {
|
|
800
|
+
payload,
|
|
801
|
+
params,
|
|
802
|
+
decodePromise,
|
|
803
|
+
segmentInfo,
|
|
804
|
+
skippedSegments,
|
|
805
|
+
status
|
|
806
|
+
};
|
|
807
|
+
}
|
|
808
|
+
const response = await deps.fetch(rscUrl, {
|
|
809
|
+
headers,
|
|
810
|
+
redirect: "manual",
|
|
811
|
+
signal
|
|
812
|
+
});
|
|
813
|
+
if (response.status >= 300 && response.status < 400) {
|
|
814
|
+
const location = response.headers.get("Location");
|
|
815
|
+
if (location) throw new RedirectError(location);
|
|
816
|
+
}
|
|
817
|
+
if (response.headers.get("X-Timber-Error") === "1") throw new ServerErrorResponse(response.status, url);
|
|
818
|
+
if (staticMode) {
|
|
819
|
+
const fallbackContentType = response.headers.get("content-type");
|
|
820
|
+
if (!response.ok || fallbackContentType && fallbackContentType.split(";")[0].trim().toLowerCase() === "text/html") {
|
|
821
|
+
response.body?.cancel();
|
|
822
|
+
throw new NonRscResponse(url);
|
|
823
|
+
}
|
|
824
|
+
} else {
|
|
825
|
+
const fallbackContentType = response.headers.get("content-type");
|
|
826
|
+
if (!fallbackContentType || !fallbackContentType.split(";")[0].trim().includes("text/x-component")) {
|
|
827
|
+
response.body?.cancel();
|
|
828
|
+
throw new NonRscResponse(url);
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
return {
|
|
832
|
+
payload: await response.text(),
|
|
833
|
+
params: readPublishedParams(void 0),
|
|
834
|
+
decodePromise: null,
|
|
835
|
+
segmentInfo: extractSegmentInfo(response),
|
|
836
|
+
skippedSegments: extractSkippedSegments(response),
|
|
837
|
+
status: response.status
|
|
838
|
+
};
|
|
839
|
+
}
|
|
840
|
+
//#endregion
|
|
841
|
+
//#region src/client/router-skew.ts
|
|
842
|
+
/**
|
|
843
|
+
* Router Skew Recording — turning a rejection into "this bundle is superseded".
|
|
844
|
+
*
|
|
845
|
+
* Detection lives in `stale-client.ts`; this is the one place the router (and
|
|
846
|
+
* anything else holding an RSC rejection) turns an error into that verdict.
|
|
847
|
+
* Recovery is not here: every path that gives up on client-side navigation —
|
|
848
|
+
* skew or not — leaves through `createSpaExits()` in `router-effects.ts`.
|
|
849
|
+
*
|
|
850
|
+
* See design/33-version-skew.md §"Recovery on the next navigation"
|
|
851
|
+
*/
|
|
852
|
+
/**
|
|
853
|
+
* Record a version skew if `error` is one, and report whether it was.
|
|
854
|
+
*
|
|
855
|
+
* `VersionSkewError` is the origin saying so outright; the reactive shapes are
|
|
856
|
+
* inferred from the error text and are a no-op in dev.
|
|
857
|
+
*
|
|
858
|
+
* Closes over nothing — anywhere an RSC payload can fail needs it, including
|
|
859
|
+
* places that have no router instance to hand.
|
|
860
|
+
*/
|
|
861
|
+
function recordSkew(error) {
|
|
862
|
+
if (error instanceof VersionSkewError) {
|
|
863
|
+
markClientStale();
|
|
864
|
+
return true;
|
|
865
|
+
}
|
|
866
|
+
return markStaleFromError(error);
|
|
867
|
+
}
|
|
868
|
+
//#endregion
|
|
869
|
+
//#region src/client/router-effects.ts
|
|
870
|
+
/**
|
|
871
|
+
* Router Effects — full-page navigation and post-paint scroll.
|
|
872
|
+
*
|
|
873
|
+
* The two things the router does *to the document* rather than to its own
|
|
874
|
+
* state: leaving the SPA entirely, and moving the scroll position once React
|
|
875
|
+
* has committed. Extracted from `router.ts` to keep that file focused on
|
|
876
|
+
* navigation state (see design/18-build-system.md §"No file >500 lines").
|
|
877
|
+
*
|
|
878
|
+
* See design/19-client-navigation.md §"Scroll Restoration"
|
|
879
|
+
*/
|
|
880
|
+
function createScrollEffects(deps) {
|
|
881
|
+
/** Run a callback after the next paint (after React commit). */
|
|
882
|
+
function afterPaint(callback) {
|
|
883
|
+
if (deps.afterPaint) deps.afterPaint(callback);
|
|
884
|
+
else callback();
|
|
885
|
+
}
|
|
886
|
+
function restoreScrollAfterPaint(scrollY) {
|
|
887
|
+
afterPaint(() => {
|
|
888
|
+
deps.scrollTo(0, scrollY);
|
|
889
|
+
window.dispatchEvent(new Event("timber:scroll-restored"));
|
|
890
|
+
});
|
|
891
|
+
}
|
|
892
|
+
function scrollToHashAfterPaint(hash) {
|
|
893
|
+
afterPaint(() => {
|
|
894
|
+
if (deps.scrollToHash?.(hash) !== true) deps.scrollTo(0, 0);
|
|
895
|
+
window.dispatchEvent(new Event("timber:scroll-restored"));
|
|
896
|
+
});
|
|
897
|
+
}
|
|
898
|
+
return {
|
|
899
|
+
restoreScrollAfterPaint,
|
|
900
|
+
scrollToHashAfterPaint
|
|
901
|
+
};
|
|
902
|
+
}
|
|
903
|
+
/**
|
|
904
|
+
* Leave the SPA and never come back.
|
|
905
|
+
*
|
|
906
|
+
* Every router path that gives up on client-side navigation does the same
|
|
907
|
+
* three things: flag the hard navigation so the Navigation API and React stop
|
|
908
|
+
* acting on a dying document, perform the document load, then block forever so
|
|
909
|
+
* the caller cannot carry on rendering into it. The returned promise is
|
|
910
|
+
* deliberately unresolvable — `location` assignment does not stop this turn of
|
|
911
|
+
* the event loop.
|
|
912
|
+
*
|
|
913
|
+
* Callers: server error, non-RSC response, and every version skew path
|
|
914
|
+
* ([33-version-skew.md](../../../../design/33-version-skew.md)).
|
|
915
|
+
*/
|
|
916
|
+
function leaveSpa(url, fromUrl) {
|
|
917
|
+
setHardNavigating(true);
|
|
918
|
+
hardNavigate(url, fromUrl);
|
|
919
|
+
return new Promise(() => {});
|
|
920
|
+
}
|
|
921
|
+
/**
|
|
922
|
+
* The two ownership-aware ways out of the SPA.
|
|
923
|
+
*
|
|
924
|
+
* Both wrap {@link leaveSpa} with the question "is this navigation still the
|
|
925
|
+
* one the user is waiting for?" — asked before leaving on a failure, answered
|
|
926
|
+
* by force on a path that decided before any navigation began. They live
|
|
927
|
+
* together because every caller of `leaveSpa()` needs one or the other, and
|
|
928
|
+
* an unguarded call is the bug (TIM-1275, TIM-1276).
|
|
929
|
+
*/
|
|
930
|
+
function createSpaExits({ currentNavAbort, supersede }) {
|
|
931
|
+
async function leaveSpaIfOwned(navAbort, url, fromUrl) {
|
|
932
|
+
if (currentNavAbort() !== navAbort) return;
|
|
933
|
+
await leaveSpa(url, fromUrl);
|
|
934
|
+
}
|
|
935
|
+
function leaveSpaSuperseding(url, fromUrl) {
|
|
936
|
+
supersede();
|
|
937
|
+
return leaveSpa(url, fromUrl);
|
|
938
|
+
}
|
|
939
|
+
return {
|
|
940
|
+
leaveSpaIfOwned,
|
|
941
|
+
leaveSpaSuperseding
|
|
942
|
+
};
|
|
943
|
+
}
|
|
944
|
+
/**
|
|
945
|
+
* Answer the failures an RSC fetch can end on, or report that this one is not
|
|
946
|
+
* ours to answer.
|
|
947
|
+
*
|
|
948
|
+
* Returns `true` when the error was handled; the caller rethrows on `false`.
|
|
949
|
+
* Handling a failure by leaving the SPA never resolves at all — the document
|
|
950
|
+
* is going away and the caller must not carry on rendering into it.
|
|
951
|
+
*
|
|
952
|
+
* There is exactly one family of these and one response to it, so it lives in
|
|
953
|
+
* one function rather than once per fetch path. `navigate()`, `refresh()` and
|
|
954
|
+
* an uncached traversal all reach it: the latter two used to rethrow instead,
|
|
955
|
+
* and since nobody awaits a traversal that meant pressing Back on a 500 left
|
|
956
|
+
* the user on the old document with an unhandled rejection (TIM-1277).
|
|
957
|
+
*
|
|
958
|
+
* Order matters in exactly one way: `recordSkew()` ends in error-*text*
|
|
959
|
+
* matching, so it goes last and can never pre-empt a framework control-flow
|
|
960
|
+
* signal whose message happens to read like a stale bundle. The class checks
|
|
961
|
+
* above it are mutually exclusive, so their order is free.
|
|
962
|
+
*
|
|
963
|
+
* Must be called from inside the `runNavigation()` callback — see
|
|
964
|
+
* {@link SpaExits.leaveSpaIfOwned}.
|
|
965
|
+
*/
|
|
966
|
+
function createNavigationRecovery({ currentNavAbort, leaveSpaIfOwned, navigate }) {
|
|
967
|
+
return async function recoverFromNavigationError(error, navAbort, url, fromUrl) {
|
|
968
|
+
if (error instanceof RedirectError) {
|
|
969
|
+
if (currentNavAbort() !== navAbort) return true;
|
|
970
|
+
await navigate(error.redirectUrl);
|
|
971
|
+
return true;
|
|
972
|
+
}
|
|
973
|
+
if (error instanceof ServerErrorResponse || error instanceof NonRscResponse || recordSkew(error)) {
|
|
974
|
+
await leaveSpaIfOwned(navAbort, url, fromUrl);
|
|
975
|
+
return true;
|
|
976
|
+
}
|
|
977
|
+
return false;
|
|
978
|
+
};
|
|
979
|
+
}
|
|
980
|
+
/**
|
|
981
|
+
* Perform the full document load.
|
|
982
|
+
*
|
|
983
|
+
* `fromUrl` is the URL the navigation departed from, passed explicitly
|
|
984
|
+
* because the address bar may have already been updated.
|
|
985
|
+
*
|
|
986
|
+
* When the target differs from the departure point only by #fragment,
|
|
987
|
+
* assigning `href` is a hash change, not a load — so assign first (to update
|
|
988
|
+
* the address bar) and then reload (TIM-1235).
|
|
989
|
+
*/
|
|
990
|
+
function hardNavigate(url, fromUrl) {
|
|
991
|
+
const current = new URL(fromUrl, window.location.origin);
|
|
992
|
+
const target = new URL(url, window.location.origin);
|
|
993
|
+
if (target.pathname === current.pathname && target.search === current.search) {
|
|
994
|
+
window.location.href = url;
|
|
995
|
+
window.location.reload();
|
|
996
|
+
} else window.location.href = url;
|
|
997
|
+
}
|
|
998
|
+
//#endregion
|
|
999
|
+
//#region src/client/router-lifecycle.ts
|
|
1000
|
+
/**
|
|
1001
|
+
* Navigation Lifecycle — who owns the router, and when a fetch may be cut.
|
|
1002
|
+
*
|
|
1003
|
+
* One navigation at a time owns the router. This module holds that ownership
|
|
1004
|
+
* (`currentNavAbort`), the rule for taking it (`createNavAbort` supersedes),
|
|
1005
|
+
* the wrapper every navigation runs inside (`runNavigation`), the set of
|
|
1006
|
+
* navigations whose trees are on screen and therefore unabortable
|
|
1007
|
+
* (`handedOffNavAborts`), and the pending store that `TopLoader` and
|
|
1008
|
+
* `usePendingNavigation()` subscribe to.
|
|
1009
|
+
*
|
|
1010
|
+
* These belong together because every one of them is a read or a write of
|
|
1011
|
+
* "which navigation is the user waiting for?" — the question `router.ts` used
|
|
1012
|
+
* to answer in four places. Split out of `router.ts` for the same reason
|
|
1013
|
+
* `router-effects.ts` was (design/18-build-system.md §"No file >500 lines").
|
|
1014
|
+
*
|
|
1015
|
+
* See design/19-client-navigation.md §"How Pending State Works".
|
|
1016
|
+
*/
|
|
1017
|
+
/**
|
|
1018
|
+
* Check if an error is an abort error (connection closed / fetch aborted).
|
|
1019
|
+
* Browsers throw DOMException with name 'AbortError' when a fetch is aborted.
|
|
1020
|
+
*/
|
|
1021
|
+
function isAbortError(error) {
|
|
1022
|
+
if (error instanceof DOMException && error.name === "AbortError") return true;
|
|
1023
|
+
if (error instanceof Error && error.name === "AbortError") return true;
|
|
1024
|
+
return false;
|
|
1025
|
+
}
|
|
1026
|
+
function createNavigationLifecycle(deps) {
|
|
1027
|
+
let currentNavAbort = null;
|
|
1028
|
+
let routerPhase = { phase: "idle" };
|
|
1029
|
+
const pendingListeners = /* @__PURE__ */ new Set();
|
|
1030
|
+
/**
|
|
1031
|
+
* The controllers of navigations whose trees have been HANDED TO REACT.
|
|
1032
|
+
*
|
|
1033
|
+
* Its response may still be streaming: a destination reveals as soon as
|
|
1034
|
+
* React can render it, so the tree on screen routinely has Suspense
|
|
1035
|
+
* boundaries still waiting on later Flight rows. Aborting that response
|
|
1036
|
+
* rejects those rows, and the rejection surfaces through the tree into
|
|
1037
|
+
* whatever error boundary the app has — replacing the page the user is
|
|
1038
|
+
* looking at with an error state, while the successor navigation is still
|
|
1039
|
+
* in flight (codex on #1004).
|
|
1040
|
+
*
|
|
1041
|
+
* So such a navigation's stream is allowed to finish. It is finite and
|
|
1042
|
+
* already in flight; the alternative is a visible error on the page being
|
|
1043
|
+
* departed from. Cancelling is still correct for a navigation whose payload
|
|
1044
|
+
* never reached React at all, which is the case the abort was written for.
|
|
1045
|
+
*
|
|
1046
|
+
* **Handed over, not committed.** This is set when the tree is given to
|
|
1047
|
+
* React, not when React commits it. Marking on commit is a whole React
|
|
1048
|
+
* commit phase too late: the notification would be `NavigationRoot`'s
|
|
1049
|
+
* layout effect, and React runs *descendant* layout effects first — so a
|
|
1050
|
+
* destination that navigates from its own mount layout effect (a redirect
|
|
1051
|
+
* guard) runs before the mark and its just-committed stream gets torn out
|
|
1052
|
+
* from under it. `tests/navigation-supersede.test.ts` already pins that
|
|
1053
|
+
* ordering, and there is no earlier hook short of an extra sibling fiber,
|
|
1054
|
+
* which would shift every `useId` in the payload (see `server/ssr-wrappers`).
|
|
1055
|
+
*
|
|
1056
|
+
* Handing over is the right moment on its own terms, not merely a safe
|
|
1057
|
+
* over-approximation: from the instant React holds the tree it may commit
|
|
1058
|
+
* it without asking, so there is no later point at which "not on screen"
|
|
1059
|
+
* is still knowable from out here. The residue is that a navigation
|
|
1060
|
+
* superseded in the window between handover and commit keeps streaming a
|
|
1061
|
+
* payload nobody sees — bandwidth on a finite response, against a visible
|
|
1062
|
+
* error page the other way (codex on #1004, second round).
|
|
1063
|
+
*
|
|
1064
|
+
* A SET, not a single slot. Between a successor's handover and its commit
|
|
1065
|
+
* React is still showing the previous tree — that is what the transition
|
|
1066
|
+
* buys — so the previous navigation's stream is still feeding the screen and
|
|
1067
|
+
* must stay unabortable. Entries are dropped when a later tree actually
|
|
1068
|
+
* commits (`forgetOlderHandoffs`), which is the moment the trees they fed
|
|
1069
|
+
* are gone. A single slot made a legitimate handover steal protection from
|
|
1070
|
+
* a stream still on screen, and let a superseded navigation overwrite the
|
|
1071
|
+
* winner's entry outright.
|
|
1072
|
+
*/
|
|
1073
|
+
const handedOffNavAborts = /* @__PURE__ */ new Set();
|
|
1074
|
+
/**
|
|
1075
|
+
* Cancel a navigation's RSC fetch — unless its tree is the one on screen.
|
|
1076
|
+
*
|
|
1077
|
+
* THE only place a navigation controller is aborted. Every path that gives
|
|
1078
|
+
* up on a navigation calls this, so the "is this tree displayed?" question
|
|
1079
|
+
* is asked once rather than at each site (the same reason `createSpaExits`
|
|
1080
|
+
* exists for the SPA exits). A new abort path is a call to this, not a copy
|
|
1081
|
+
* of `controller.abort()`.
|
|
1082
|
+
*
|
|
1083
|
+
* See `handedOffNavAborts` for why such a navigation keeps its stream.
|
|
1084
|
+
*/
|
|
1085
|
+
function abortUnlessHandedOff(controller) {
|
|
1086
|
+
if (handedOffNavAborts.has(controller)) return;
|
|
1087
|
+
controller.abort();
|
|
1088
|
+
}
|
|
1089
|
+
/**
|
|
1090
|
+
* Create a new AbortController for a navigation, superseding any
|
|
1091
|
+
* previous in-flight navigation. Optionally links to an external
|
|
1092
|
+
* signal (e.g., from the Navigation API's NavigateEvent.signal).
|
|
1093
|
+
*
|
|
1094
|
+
* Superseding is one operation with three parts:
|
|
1095
|
+
* 1. Abort the previous navigation's fetch — UNLESS its tree is the one on
|
|
1096
|
+
* screen, in which case tearing the stream down would error the page the
|
|
1097
|
+
* user is currently looking at. See `handedOffNavAborts`.
|
|
1098
|
+
* 2. Invalidate its render transition so a response that already
|
|
1099
|
+
* arrived can't commit a stale tree (NavigationRoot's transId guard).
|
|
1100
|
+
* This happens either way, so skipping the abort cannot let a stale tree
|
|
1101
|
+
* displace the successor.
|
|
1102
|
+
* 3. Resolve its Navigation API deferred — the superseded navigation's
|
|
1103
|
+
* finally block is staleness-guarded (see TIM-1034) and no longer
|
|
1104
|
+
* cleans up after itself, so the browser's native loading state for
|
|
1105
|
+
* the dead navigation is cleared here.
|
|
1106
|
+
*/
|
|
1107
|
+
function createNavAbort(externalSignal) {
|
|
1108
|
+
if (currentNavAbort) {
|
|
1109
|
+
abortUnlessHandedOff(currentNavAbort);
|
|
1110
|
+
supersedeNavigationTransitions();
|
|
1111
|
+
deps.completeRouterNavigation?.();
|
|
1112
|
+
}
|
|
1113
|
+
const controller = new AbortController();
|
|
1114
|
+
currentNavAbort = controller;
|
|
1115
|
+
if (externalSignal) if (externalSignal.aborted) abortUnlessHandedOff(controller);
|
|
1116
|
+
else externalSignal.addEventListener("abort", () => abortUnlessHandedOff(controller), { once: true });
|
|
1117
|
+
return controller;
|
|
1118
|
+
}
|
|
1119
|
+
function setPending(value, url) {
|
|
1120
|
+
const next = value && url ? {
|
|
1121
|
+
phase: "navigating",
|
|
1122
|
+
targetUrl: url
|
|
1123
|
+
} : { phase: "idle" };
|
|
1124
|
+
if (routerPhase.phase === next.phase && (routerPhase.phase === "idle" || routerPhase.phase === "navigating" && next.phase === "navigating" && routerPhase.targetUrl === next.targetUrl)) return;
|
|
1125
|
+
routerPhase = next;
|
|
1126
|
+
for (const listener of pendingListeners) listener(value);
|
|
1127
|
+
}
|
|
1128
|
+
/**
|
|
1129
|
+
* Wrap a navigation in the standard abort/pending/cleanup lifecycle.
|
|
1130
|
+
* Consolidates the createNavAbort + setPending + staleness-guarded
|
|
1131
|
+
* finally that was duplicated across navigate, refresh, and both
|
|
1132
|
+
* handlePopState paths. AbortErrors are swallowed (not application
|
|
1133
|
+
* errors); all other errors propagate to the caller.
|
|
1134
|
+
*/
|
|
1135
|
+
async function runNavigation(url, fn, externalSignal) {
|
|
1136
|
+
const navAbort = createNavAbort(externalSignal);
|
|
1137
|
+
setPending(true, url);
|
|
1138
|
+
try {
|
|
1139
|
+
await fn(navAbort);
|
|
1140
|
+
} catch (error) {
|
|
1141
|
+
if (isAbortError(error)) return;
|
|
1142
|
+
throw error;
|
|
1143
|
+
} finally {
|
|
1144
|
+
if (currentNavAbort === navAbort) {
|
|
1145
|
+
currentNavAbort = null;
|
|
1146
|
+
setPending(false);
|
|
1147
|
+
deps.completeRouterNavigation?.();
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
return {
|
|
1152
|
+
currentNavAbort: () => currentNavAbort,
|
|
1153
|
+
createNavAbort,
|
|
1154
|
+
runNavigation,
|
|
1155
|
+
markHandedOff(owner) {
|
|
1156
|
+
if (currentNavAbort !== owner) return;
|
|
1157
|
+
handedOffNavAborts.add(owner);
|
|
1158
|
+
},
|
|
1159
|
+
forgetOlderHandoffs(owner) {
|
|
1160
|
+
for (const controller of handedOffNavAborts) if (controller !== owner) handedOffNavAborts.delete(controller);
|
|
1161
|
+
},
|
|
1162
|
+
isPending: () => routerPhase.phase === "navigating",
|
|
1163
|
+
getPendingUrl: () => routerPhase.phase === "navigating" ? routerPhase.targetUrl : null,
|
|
1164
|
+
onPendingChange(listener) {
|
|
1165
|
+
pendingListeners.add(listener);
|
|
1166
|
+
return () => pendingListeners.delete(listener);
|
|
1167
|
+
}
|
|
1168
|
+
};
|
|
1169
|
+
}
|
|
1170
|
+
//#endregion
|
|
1171
|
+
//#region src/client/router-pipeline.ts
|
|
1172
|
+
/**
|
|
1173
|
+
* Navigation Pipeline — URL in, tree in React's hands.
|
|
1174
|
+
*
|
|
1175
|
+
* Everything between "the user asked for this URL" and "React is holding the
|
|
1176
|
+
* destination's tree": consult the prefetch cache or fetch, prepare the commit
|
|
1177
|
+
* that makes the page current, and hand the result over inside a transition.
|
|
1178
|
+
*
|
|
1179
|
+
* `router.ts` keeps the *operations* — `navigate`, `refresh`, `handlePopState`,
|
|
1180
|
+
* `prefetch`, `applyRevalidation` — and each of them is a call into here. The
|
|
1181
|
+
* split is the same one `router-effects.ts` and `router-lifecycle.ts` made
|
|
1182
|
+
* (design/18-build-system.md §"No file >500 lines").
|
|
1183
|
+
*
|
|
1184
|
+
* See design/19-client-navigation.md §"Partial Rendering" and §"Prefetching".
|
|
1185
|
+
*/
|
|
1186
|
+
/**
|
|
1187
|
+
* Normalize a departing URL to the pathname the server is told about.
|
|
1188
|
+
*
|
|
1189
|
+
* This is the value sent as `X-Timber-URL` *and* the source half of the
|
|
1190
|
+
* prefetch cache key — one function so a prefetch and the click that consumes
|
|
1191
|
+
* it can never disagree about what "where we came from" means (TIM-1265). The
|
|
1192
|
+
* query is dropped deliberately: it would land in the `_rsc` digest, which is
|
|
1193
|
+
* logged (TIM-1268), and nothing downstream reads it — slot-skip resolution
|
|
1194
|
+
* and interception scope both compare pathnames.
|
|
1195
|
+
*
|
|
1196
|
+
* Absolute inputs parse against the base and ignore it, so one call handles
|
|
1197
|
+
* both `location.href` and a bare pathname.
|
|
1198
|
+
*/
|
|
1199
|
+
function departingPathname(raw) {
|
|
1200
|
+
return new URL(raw, "http://localhost").pathname;
|
|
1201
|
+
}
|
|
1202
|
+
/**
|
|
1203
|
+
* The prefetch cache key for a destination.
|
|
1204
|
+
*
|
|
1205
|
+
* Both halves of the cache are keyed through here — the hover that writes an
|
|
1206
|
+
* entry (`router.ts`'s `prefetch()`) and the click that consumes it
|
|
1207
|
+
* (`performNavigationFetch` below) — so the two cannot disagree about what
|
|
1208
|
+
* identifies a payload. That is the whole point of the key: `from` scopes it
|
|
1209
|
+
* to the page the link was on (TIM-1265) and `scope` to the tree that was
|
|
1210
|
+
* mounted (TIM-1282), and an entry written under one reading of either would
|
|
1211
|
+
* simply never be found under the other, silently costing every prefetch.
|
|
1212
|
+
*
|
|
1213
|
+
* `departingPathname` is applied here rather than by callers for the same
|
|
1214
|
+
* reason: it is also what goes out as `X-Timber-URL`, so the key and the
|
|
1215
|
+
* request describe the same departure point.
|
|
1216
|
+
*/
|
|
1217
|
+
function prefetchKeyFor(url, departingUrl, stateTree) {
|
|
1218
|
+
return {
|
|
1219
|
+
url,
|
|
1220
|
+
from: departingPathname(departingUrl),
|
|
1221
|
+
scope: prefetchScopeOf(stateTree)
|
|
1222
|
+
};
|
|
1223
|
+
}
|
|
1224
|
+
function isPartialNavigation(skippedSegments) {
|
|
1225
|
+
return skippedSegments != null && skippedSegments.length > 0;
|
|
1226
|
+
}
|
|
1227
|
+
/**
|
|
1228
|
+
* Build a segment updates map for partial navigation. Identifies the
|
|
1229
|
+
* first non-skipped segment and maps it to the payload content.
|
|
1230
|
+
*/
|
|
1231
|
+
function buildSegmentUpdates(result) {
|
|
1232
|
+
const skipped = new Set(result.skippedSegments);
|
|
1233
|
+
const segmentInfo = result.segmentInfo;
|
|
1234
|
+
const updates = /* @__PURE__ */ new Map();
|
|
1235
|
+
if (segmentInfo) {
|
|
1236
|
+
for (const info of segmentInfo) if (!skipped.has(info.segmentId ?? info.path)) {
|
|
1237
|
+
updates.set(info.segmentId ?? info.path, result.payload);
|
|
1238
|
+
break;
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
return updates;
|
|
1242
|
+
}
|
|
1243
|
+
/**
|
|
1244
|
+
* Inspect a decode rejection for version skew before handing the promise on,
|
|
1245
|
+
* without changing what the consumer sees.
|
|
1246
|
+
*
|
|
1247
|
+
* The decode rejects independently of the fetch, and not every consumer
|
|
1248
|
+
* awaits it — NavigationRoot drops it outright when the transition has been
|
|
1249
|
+
* superseded. A stale client reference arriving that way is still evidence
|
|
1250
|
+
* the bundle is superseded, so record it here where every consumer is fed
|
|
1251
|
+
* from, rather than at each place that might drop it (TIM-1275).
|
|
1252
|
+
*/
|
|
1253
|
+
function observeSkew(decodePromise) {
|
|
1254
|
+
decodePromise?.catch((error) => void recordSkew(error));
|
|
1255
|
+
return decodePromise;
|
|
1256
|
+
}
|
|
1257
|
+
function createNavigationPipeline({ deps, prefetchCache, currentStateTree, prepareNavigation, markHandedOff, forgetOlderHandoffs }) {
|
|
1258
|
+
/** Render a decoded RSC payload into the DOM if a renderer is available. */
|
|
1259
|
+
function renderPayload(payload, navState, params) {
|
|
1260
|
+
if (deps.renderRoot) deps.renderRoot(payload, navState, params);
|
|
1261
|
+
}
|
|
1262
|
+
/**
|
|
1263
|
+
* Resolve thenable payloads in the test/fallback path (no navigateTransition).
|
|
1264
|
+
* In production, React handles thenables from createFromFetch directly via
|
|
1265
|
+
* Suspense. In tests, renderRoot is a plain mock that expects resolved values.
|
|
1266
|
+
*/
|
|
1267
|
+
async function resolveForFallback(payload) {
|
|
1268
|
+
if (!deps.navigateTransition && payload != null && typeof payload === "object" && "then" in payload) return await payload;
|
|
1269
|
+
return payload;
|
|
1270
|
+
}
|
|
1271
|
+
/**
|
|
1272
|
+
* Render a payload via navigateTransition (production) or renderRoot (tests).
|
|
1273
|
+
* The perform callback should fetch data, prepare the commit, and return the
|
|
1274
|
+
* FetchResult plus the NavigationState and the commit thunk.
|
|
1275
|
+
*
|
|
1276
|
+
* The thunk is handed *through* to NavigationRoot rather than called here:
|
|
1277
|
+
* state management (segmentCache, navState, historyStack) has to happen on
|
|
1278
|
+
* the far side of the supersession check, which only NavigationRoot can
|
|
1279
|
+
* make (TIM-1301). The fallback path below has no transition to be
|
|
1280
|
+
* superseded by, so it commits directly.
|
|
1281
|
+
*/
|
|
1282
|
+
async function renderViaTransition(url, owner, perform) {
|
|
1283
|
+
const handOff = () => markHandedOff(owner);
|
|
1284
|
+
const commitAndForget = (commit) => () => {
|
|
1285
|
+
forgetOlderHandoffs(owner);
|
|
1286
|
+
commit();
|
|
1287
|
+
};
|
|
1288
|
+
if (deps.navigateTransition) {
|
|
1289
|
+
await deps.navigateTransition(url, async (wrapPayload) => {
|
|
1290
|
+
const result = await perform();
|
|
1291
|
+
const params = await result.params;
|
|
1292
|
+
if (isPartialNavigation(result.skippedSegments)) {
|
|
1293
|
+
const segmentUpdates = buildSegmentUpdates(result);
|
|
1294
|
+
const element = wrapPayload(deps._getCurrentPayload?.() ?? result.payload, result.navState, params, segmentUpdates);
|
|
1295
|
+
handOff();
|
|
1296
|
+
return {
|
|
1297
|
+
element,
|
|
1298
|
+
decodePromise: observeSkew(result.decodePromise),
|
|
1299
|
+
commit: commitAndForget(result.commit)
|
|
1300
|
+
};
|
|
1301
|
+
}
|
|
1302
|
+
const element = wrapPayload(result.payload, result.navState, params);
|
|
1303
|
+
handOff();
|
|
1304
|
+
return {
|
|
1305
|
+
element,
|
|
1306
|
+
decodePromise: observeSkew(result.decodePromise),
|
|
1307
|
+
commit: commitAndForget(result.commit)
|
|
1308
|
+
};
|
|
1309
|
+
});
|
|
1310
|
+
return;
|
|
1311
|
+
}
|
|
1312
|
+
const result = await perform();
|
|
1313
|
+
handOff();
|
|
1314
|
+
commitAndForget(result.commit)();
|
|
1315
|
+
if (!isPartialNavigation(result.skippedSegments)) renderPayload(result.payload, result.navState, await result.params);
|
|
1316
|
+
}
|
|
1317
|
+
/**
|
|
1318
|
+
* Core navigation logic shared between the transition and fallback paths.
|
|
1319
|
+
* Fetches the RSC payload, updates all state, and returns the result.
|
|
1320
|
+
*/
|
|
1321
|
+
async function performNavigationFetch(url, options) {
|
|
1322
|
+
const stateTree = currentStateTree();
|
|
1323
|
+
const cacheKey = prefetchKeyFor(url, options.departingUrl ?? deps.getCurrentUrl(), stateTree);
|
|
1324
|
+
const currentUrl = cacheKey.from;
|
|
1325
|
+
if (prefetchCache.isNegative(cacheKey)) {
|
|
1326
|
+
prefetchCache.consume(cacheKey);
|
|
1327
|
+
throw new NonRscResponse(url);
|
|
1328
|
+
}
|
|
1329
|
+
const prefetched = prefetchCache.consume(cacheKey);
|
|
1330
|
+
let result = prefetched ? {
|
|
1331
|
+
payload: prefetched.payload,
|
|
1332
|
+
params: prefetched.params ?? readPublishedParams(void 0),
|
|
1333
|
+
decodePromise: prefetched.decodePromise ?? null,
|
|
1334
|
+
segmentInfo: prefetched.segmentInfo ?? null,
|
|
1335
|
+
skippedSegments: prefetched.skippedSegments ?? null,
|
|
1336
|
+
status: prefetched.status ?? 200
|
|
1337
|
+
} : void 0;
|
|
1338
|
+
if (result === void 0) result = await fetchRscPayload(url, deps, stateTree, currentUrl, options.signal);
|
|
1339
|
+
const commitHistoryUrl = () => {
|
|
1340
|
+
if (options.skipHistory) return;
|
|
1341
|
+
const commitUrl = options.commitUrl ?? url;
|
|
1342
|
+
deps.setRouterNavigating?.(true);
|
|
1343
|
+
if (options.replace) deps.replaceState({
|
|
1344
|
+
timber: true,
|
|
1345
|
+
scrollY: 0
|
|
1346
|
+
}, "", commitUrl);
|
|
1347
|
+
else deps.pushState({
|
|
1348
|
+
timber: true,
|
|
1349
|
+
scrollY: 0
|
|
1350
|
+
}, "", commitUrl);
|
|
1351
|
+
deps.setRouterNavigating?.(false);
|
|
1352
|
+
};
|
|
1353
|
+
const payload = await resolveForFallback(result.payload);
|
|
1354
|
+
const params = await result.params;
|
|
1355
|
+
const isPartial = isPartialNavigation(result.skippedSegments);
|
|
1356
|
+
const hasSkippedSlots = result.segmentInfo?.some((s) => s.slot && s.skipped) ?? false;
|
|
1357
|
+
const { navState, commit } = prepareNavigation(url, {
|
|
1358
|
+
payload: isPartial || hasSkippedSlots ? null : payload,
|
|
1359
|
+
params,
|
|
1360
|
+
segmentInfo: result.segmentInfo,
|
|
1361
|
+
status: result.status
|
|
1362
|
+
});
|
|
1363
|
+
return {
|
|
1364
|
+
...result,
|
|
1365
|
+
payload,
|
|
1366
|
+
params,
|
|
1367
|
+
navState,
|
|
1368
|
+
commit: () => {
|
|
1369
|
+
commitHistoryUrl();
|
|
1370
|
+
commit();
|
|
1371
|
+
window.dispatchEvent(new Event("timber:navigation-end"));
|
|
1372
|
+
}
|
|
1373
|
+
};
|
|
1374
|
+
}
|
|
1375
|
+
return {
|
|
1376
|
+
performNavigationFetch,
|
|
1377
|
+
renderViaTransition,
|
|
1378
|
+
renderPayload,
|
|
1379
|
+
resolveForFallback
|
|
1380
|
+
};
|
|
1381
|
+
}
|
|
1382
|
+
//#endregion
|
|
1383
|
+
//#region src/client/router.ts
|
|
1384
|
+
/**
|
|
1385
|
+
* Create a router instance. In production, called once at app hydration
|
|
1386
|
+
* with real browser APIs. In tests, called with mock dependencies.
|
|
1387
|
+
*/
|
|
1388
|
+
function createRouter(deps) {
|
|
1389
|
+
const segmentCache = new SegmentCache();
|
|
1390
|
+
const prefetchCache = new PrefetchCache();
|
|
1391
|
+
const historyStack = new HistoryStack();
|
|
1392
|
+
const { prepareNavigation, currentStateTree, updateSegmentCache } = createNavigationCommitter({
|
|
1393
|
+
segmentCache,
|
|
1394
|
+
historyStack,
|
|
1395
|
+
clientSegmentCache: () => deps.clientSegmentCache
|
|
1396
|
+
});
|
|
1397
|
+
const { currentNavAbort, createNavAbort, runNavigation, markHandedOff, forgetOlderHandoffs, isPending, getPendingUrl, onPendingChange } = createNavigationLifecycle(deps);
|
|
1398
|
+
const { performNavigationFetch, renderViaTransition, renderPayload, resolveForFallback } = createNavigationPipeline({
|
|
1399
|
+
deps,
|
|
1400
|
+
prefetchCache,
|
|
1401
|
+
currentStateTree,
|
|
1402
|
+
prepareNavigation,
|
|
1403
|
+
markHandedOff,
|
|
1404
|
+
forgetOlderHandoffs
|
|
1405
|
+
});
|
|
1406
|
+
const { restoreScrollAfterPaint, scrollToHashAfterPaint } = createScrollEffects(deps);
|
|
1407
|
+
const { leaveSpaIfOwned, leaveSpaSuperseding } = createSpaExits({
|
|
1408
|
+
currentNavAbort,
|
|
1409
|
+
supersede: () => void createNavAbort()
|
|
1410
|
+
});
|
|
1411
|
+
const recoverFromNavigationError = createNavigationRecovery({
|
|
1412
|
+
currentNavAbort,
|
|
1413
|
+
leaveSpaIfOwned,
|
|
1414
|
+
navigate: (url) => navigate(url, { replace: true })
|
|
1415
|
+
});
|
|
1416
|
+
async function navigate(url, options = {}) {
|
|
1417
|
+
const scroll = options.scroll !== false;
|
|
1418
|
+
const replace = options.replace === true;
|
|
1419
|
+
const externalSignal = options._signal;
|
|
1420
|
+
const skipHistory = options._skipHistory === true;
|
|
1421
|
+
const hashIndex = url.indexOf("#");
|
|
1422
|
+
const hash = hashIndex === -1 ? "" : url.slice(hashIndex);
|
|
1423
|
+
const fetchUrl = hashIndex === -1 ? url : url.slice(0, hashIndex);
|
|
1424
|
+
const departingUrl = options._departingUrl ?? deps.getCurrentUrl();
|
|
1425
|
+
const currentScrollY = deps.getScrollY();
|
|
1426
|
+
if (deps.saveNavigationEntryScroll) deps.saveNavigationEntryScroll(currentScrollY);
|
|
1427
|
+
else deps.replaceState({
|
|
1428
|
+
timber: true,
|
|
1429
|
+
scrollY: currentScrollY
|
|
1430
|
+
}, "", deps.getCurrentUrl());
|
|
1431
|
+
if (isClientStale()) await leaveSpaSuperseding(url, departingUrl);
|
|
1432
|
+
let effectiveSkipHistory = skipHistory;
|
|
1433
|
+
await runNavigation(url, async (navAbort) => {
|
|
1434
|
+
if (!effectiveSkipHistory && deps.navigationNavigate) {
|
|
1435
|
+
deps.setRouterNavigating?.(true);
|
|
1436
|
+
deps.navigationNavigate(url, replace);
|
|
1437
|
+
deps.setRouterNavigating?.(false);
|
|
1438
|
+
effectiveSkipHistory = true;
|
|
1439
|
+
}
|
|
1440
|
+
try {
|
|
1441
|
+
await renderViaTransition(fetchUrl, navAbort, () => performNavigationFetch(fetchUrl, {
|
|
1442
|
+
replace,
|
|
1443
|
+
commitUrl: url,
|
|
1444
|
+
signal: navAbort.signal,
|
|
1445
|
+
skipHistory: effectiveSkipHistory,
|
|
1446
|
+
departingUrl
|
|
1447
|
+
}));
|
|
1448
|
+
if (scroll && hash) scrollToHashAfterPaint(hash);
|
|
1449
|
+
else restoreScrollAfterPaint(scroll ? 0 : currentScrollY);
|
|
1450
|
+
} catch (error) {
|
|
1451
|
+
if (await recoverFromNavigationError(error, navAbort, url, departingUrl)) return;
|
|
1452
|
+
throw error;
|
|
1453
|
+
}
|
|
1454
|
+
}, externalSignal);
|
|
1455
|
+
}
|
|
1456
|
+
/**
|
|
1457
|
+
* Fetch a URL's RSC payload, commit it, and render — the pipeline shared by
|
|
1458
|
+
* refresh() and an uncached back/forward traversal. Both can be the path
|
|
1459
|
+
* that discovers a version skew, and both recover the same way (TIM-1275).
|
|
1460
|
+
*
|
|
1461
|
+
* Not `performNavigationFetch`: neither caller consults the prefetch cache
|
|
1462
|
+
* (there is no link to have hovered) and neither moves the address bar (the
|
|
1463
|
+
* browser is already where it is going), so the fetch is a plain one.
|
|
1464
|
+
*/
|
|
1465
|
+
async function fetchCommitAndRender(url, opts = {}) {
|
|
1466
|
+
await runNavigation(url, async (navAbort) => {
|
|
1467
|
+
try {
|
|
1468
|
+
await renderViaTransition(url, navAbort, async () => {
|
|
1469
|
+
const result = await fetchRscPayload(url, deps, opts.stateTree, void 0, navAbort.signal);
|
|
1470
|
+
const payload = await resolveForFallback(result.payload);
|
|
1471
|
+
const params = await result.params;
|
|
1472
|
+
const { navState, commit } = prepareNavigation(url, {
|
|
1473
|
+
payload,
|
|
1474
|
+
params,
|
|
1475
|
+
segmentInfo: result.segmentInfo,
|
|
1476
|
+
status: result.status
|
|
1477
|
+
});
|
|
1478
|
+
return {
|
|
1479
|
+
...result,
|
|
1480
|
+
payload,
|
|
1481
|
+
params,
|
|
1482
|
+
navState,
|
|
1483
|
+
commit
|
|
1484
|
+
};
|
|
1485
|
+
});
|
|
1486
|
+
} catch (error) {
|
|
1487
|
+
if (await recoverFromNavigationError(error, navAbort, url, url)) return;
|
|
1488
|
+
throw error;
|
|
1489
|
+
}
|
|
1490
|
+
if (opts.scrollY !== void 0) restoreScrollAfterPaint(opts.scrollY);
|
|
1491
|
+
}, opts.externalSignal);
|
|
1492
|
+
}
|
|
1493
|
+
async function refresh() {
|
|
1494
|
+
const currentUrl = deps.getCurrentUrl();
|
|
1495
|
+
if (isClientStale()) await leaveSpaSuperseding(currentUrl, currentUrl);
|
|
1496
|
+
await fetchCommitAndRender(currentUrl);
|
|
1497
|
+
}
|
|
1498
|
+
async function handlePopState(url, scrollY = 0, externalSignal) {
|
|
1499
|
+
if (isClientStale()) await leaveSpaSuperseding(url, url);
|
|
1500
|
+
const entry = historyStack.get(url);
|
|
1501
|
+
if (entry && entry.payload !== null) await runNavigation(url, async () => {
|
|
1502
|
+
const { navState, commit } = prepareNavigation(url, {
|
|
1503
|
+
payload: entry.payload,
|
|
1504
|
+
params: entry.params,
|
|
1505
|
+
segmentInfo: entry.segmentInfo,
|
|
1506
|
+
clearSegmentCacheOnEmpty: true
|
|
1507
|
+
});
|
|
1508
|
+
commit();
|
|
1509
|
+
renderPayload(entry.payload, navState, entry.params);
|
|
1510
|
+
restoreScrollAfterPaint(scrollY);
|
|
1511
|
+
}, externalSignal);
|
|
1512
|
+
else await fetchCommitAndRender(url, {
|
|
1513
|
+
stateTree: currentStateTree(),
|
|
1514
|
+
scrollY,
|
|
1515
|
+
externalSignal
|
|
1516
|
+
});
|
|
1517
|
+
}
|
|
1518
|
+
/**
|
|
1519
|
+
* Prefetch an RSC payload for a URL and store it in the prefetch cache.
|
|
1520
|
+
* Called on hover of <Link prefetch> elements.
|
|
1521
|
+
*/
|
|
1522
|
+
function prefetch(url) {
|
|
1523
|
+
if (isClientStale()) return;
|
|
1524
|
+
const hashIndex = url.indexOf("#");
|
|
1525
|
+
const fetchUrl = hashIndex === -1 ? url : url.slice(0, hashIndex);
|
|
1526
|
+
const stateTree = currentStateTree();
|
|
1527
|
+
const cacheKey = prefetchKeyFor(fetchUrl, deps.getCurrentUrl(), stateTree);
|
|
1528
|
+
const from = cacheKey.from;
|
|
1529
|
+
if (prefetchCache.get(cacheKey) !== void 0) return;
|
|
1530
|
+
if (historyStack.has(fetchUrl)) return;
|
|
1531
|
+
fetchRscPayload(fetchUrl, deps, stateTree, from).then((result) => {
|
|
1532
|
+
result.decodePromise?.catch((error) => void recordSkew(error));
|
|
1533
|
+
prefetchCache.set(cacheKey, result);
|
|
1534
|
+
}, (error) => {
|
|
1535
|
+
if (error instanceof NonRscResponse) {
|
|
1536
|
+
prefetchCache.setNegative(cacheKey);
|
|
1537
|
+
return;
|
|
1538
|
+
}
|
|
1539
|
+
recordSkew(error);
|
|
1540
|
+
});
|
|
1541
|
+
}
|
|
1542
|
+
return {
|
|
1543
|
+
navigate,
|
|
1544
|
+
refresh,
|
|
1545
|
+
handlePopState,
|
|
1546
|
+
isPending,
|
|
1547
|
+
getPendingUrl,
|
|
1548
|
+
onPendingChange,
|
|
1549
|
+
prefetch,
|
|
1550
|
+
applyRevalidation(payloadRoot) {
|
|
1551
|
+
const currentUrl = deps.getCurrentUrl();
|
|
1552
|
+
const tree = readPayloadTree(payloadRoot);
|
|
1553
|
+
const params = readPublishedParams(payloadRoot);
|
|
1554
|
+
const existingEntry = historyStack.get(currentUrl);
|
|
1555
|
+
const { navState, commit } = prepareNavigation(currentUrl, {
|
|
1556
|
+
payload: tree,
|
|
1557
|
+
params,
|
|
1558
|
+
segmentInfo: existingEntry?.segmentInfo
|
|
1559
|
+
});
|
|
1560
|
+
commit();
|
|
1561
|
+
renderPayload(tree, navState, params);
|
|
1562
|
+
},
|
|
1563
|
+
initSegmentCache: (segments) => updateSegmentCache(segments),
|
|
1564
|
+
segmentCache,
|
|
1565
|
+
prefetchCache,
|
|
1566
|
+
historyStack
|
|
1567
|
+
};
|
|
1568
|
+
}
|
|
1569
|
+
//#endregion
|
|
1570
|
+
//#region src/client/use-search-params.ts
|
|
1571
|
+
/**
|
|
1572
|
+
* useSearchParams() — client-side hook for reading URL search params.
|
|
1573
|
+
*
|
|
1574
|
+
* Returns a read-only URLSearchParams instance reflecting the current
|
|
1575
|
+
* URL's query string. Updates when client-side navigation changes the URL.
|
|
1576
|
+
*
|
|
1577
|
+
* On the client, reads from NavigationContext which is updated atomically
|
|
1578
|
+
* with the RSC tree render during full navigations, AND by
|
|
1579
|
+
* syncShallowSearch() for shallow URL updates (nuqs shallow: true,
|
|
1580
|
+
* replaceUrl, or any external pushState/replaceState that changes the
|
|
1581
|
+
* query string). See router-init.ts.
|
|
1582
|
+
*
|
|
1583
|
+
* This replaces the previous useSyncExternalStore approach which read
|
|
1584
|
+
* window.location.search directly — causing React to detect external
|
|
1585
|
+
* store tearing during transitions and fall back to synchronous rendering
|
|
1586
|
+
* (renderRootSync instead of renderRootConcurrent), blocking the main
|
|
1587
|
+
* thread and freezing animations.
|
|
1588
|
+
*
|
|
1589
|
+
* Unlike Next.js's ReadonlyURLSearchParams, this returns a standard
|
|
1590
|
+
* URLSearchParams. Mutation methods (set, delete, append) work on the
|
|
1591
|
+
* local copy but do NOT affect the URL — use the router or nuqs for that.
|
|
1592
|
+
*
|
|
1593
|
+
* During SSR, reads the request search params from the SSR ALS context
|
|
1594
|
+
* (populated by ssr-entry.ts) instead of window.location.
|
|
1595
|
+
*
|
|
1596
|
+
* Compatible with Next.js's `useSearchParams()` from `next/navigation`.
|
|
1597
|
+
*/
|
|
1598
|
+
function getSearchParams(search) {
|
|
1599
|
+
if (search !== cachedSearch) {
|
|
1600
|
+
const params = new URLSearchParams(search);
|
|
1601
|
+
_setCachedSearch(search, params);
|
|
1602
|
+
return params;
|
|
1603
|
+
}
|
|
1604
|
+
return cachedSearchParams;
|
|
1605
|
+
}
|
|
1606
|
+
/**
|
|
1607
|
+
* Read the current URL search params.
|
|
1608
|
+
*
|
|
1609
|
+
* Compatible with Next.js's `useSearchParams()` from `next/navigation`.
|
|
1610
|
+
*/
|
|
1611
|
+
function useSearchParams() {
|
|
1612
|
+
try {
|
|
1613
|
+
const navContext = useNavigationContext();
|
|
1614
|
+
if (navContext !== null) return getSearchParams(navContext.search);
|
|
1615
|
+
} catch {}
|
|
1616
|
+
const ssrData = getSsrData();
|
|
1617
|
+
if (ssrData) return new URLSearchParams(ssrData.searchParams);
|
|
1618
|
+
if (typeof window !== "undefined") return getSearchParams(window.location.search);
|
|
1619
|
+
return new URLSearchParams();
|
|
1620
|
+
}
|
|
1621
|
+
//#endregion
|
|
1622
|
+
export { HistoryStack, NavigationProvider, PrefetchCache, SegmentCache, SegmentProvider, TimberErrorBoundary, bindUseQueryStates, clearSsrData, createRouter, getNavigationState, getRouter, getRouterOrNull, getSsrData, setCurrentParams, setCurrentSlotParams, setGlobalRouter, setNavigationState, setSsrData, useSearchParams, useSegmentContext };
|
|
1623
|
+
|
|
1624
|
+
//# sourceMappingURL=internal.js.map
|