@timber-js/app 0.2.0-alpha.21 → 0.2.0-alpha.211
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 +346 -0
- package/bin/timber.mjs +15 -1
- package/dist/_chunks/actions-Rjk4htmA.js +1199 -0
- package/dist/_chunks/actions-Rjk4htmA.js.map +1 -0
- package/dist/_chunks/als-registry-DaxkVjt5.js +45 -0
- package/dist/_chunks/als-registry-DaxkVjt5.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-RV_BRcF1.js +367 -0
- package/dist/_chunks/build-output-helper-RV_BRcF1.js.map +1 -0
- package/dist/_chunks/cache-api-DGdYfNJn.js +1182 -0
- package/dist/_chunks/cache-api-DGdYfNJn.js.map +1 -0
- package/dist/_chunks/canonicalize-CgHoscYO.js +66 -0
- package/dist/_chunks/canonicalize-CgHoscYO.js.map +1 -0
- package/dist/_chunks/chains-DGX9zmg9.js +272 -0
- package/dist/_chunks/chains-DGX9zmg9.js.map +1 -0
- package/dist/_chunks/classify-QwG5rxKI.js +147 -0
- package/dist/_chunks/classify-QwG5rxKI.js.map +1 -0
- package/dist/_chunks/cli-check-ajNY3B2e.js +252 -0
- package/dist/_chunks/cli-check-ajNY3B2e.js.map +1 -0
- package/dist/_chunks/cli-context-By7k2xVo.js +70 -0
- package/dist/_chunks/cli-context-By7k2xVo.js.map +1 -0
- package/dist/_chunks/cli-schema-sync-D2eI8jEg.js +299 -0
- package/dist/_chunks/cli-schema-sync-D2eI8jEg.js.map +1 -0
- package/dist/_chunks/client-dep-entries-2HCF09no.js +66 -0
- package/dist/_chunks/client-dep-entries-2HCF09no.js.map +1 -0
- package/dist/_chunks/cloudflare-Byxl8FWP.js +1333 -0
- package/dist/_chunks/cloudflare-Byxl8FWP.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/codegen-Bps1sLKJ.js +432 -0
- package/dist/_chunks/codegen-Bps1sLKJ.js.map +1 -0
- package/dist/_chunks/convention-lint-DLmhGsRS.js +590 -0
- package/dist/_chunks/convention-lint-DLmhGsRS.js.map +1 -0
- package/dist/_chunks/dev-server-TFpEwm3H.js +2039 -0
- package/dist/_chunks/dev-server-TFpEwm3H.js.map +1 -0
- package/dist/_chunks/dist-DtrJyBbw.js +386 -0
- package/dist/_chunks/dist-DtrJyBbw.js.map +1 -0
- package/dist/_chunks/error-boundary-DsNScGRM.js +1024 -0
- package/dist/_chunks/error-boundary-DsNScGRM.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/format-BKclgVbk.js +14 -0
- package/dist/_chunks/format-BKclgVbk.js.map +1 -0
- package/dist/_chunks/fs-identity-BRKuL215.js +207 -0
- package/dist/_chunks/fs-identity-BRKuL215.js.map +1 -0
- package/dist/_chunks/graph-cache-CYiUS2aS.js +303 -0
- package/dist/_chunks/graph-cache-CYiUS2aS.js.map +1 -0
- package/dist/_chunks/href-validation-BIrxavIy.js +213 -0
- package/dist/_chunks/href-validation-BIrxavIy.js.map +1 -0
- package/dist/_chunks/json-lossy-check-CVuRs2hG.js +66 -0
- package/dist/_chunks/json-lossy-check-CVuRs2hG.js.map +1 -0
- package/dist/_chunks/live-graph-cNuWMYQI.js +151 -0
- package/dist/_chunks/live-graph-cNuWMYQI.js.map +1 -0
- package/dist/_chunks/logger-BP0LN6vP.js +662 -0
- package/dist/_chunks/logger-BP0LN6vP.js.map +1 -0
- package/dist/_chunks/{metadata-routes-Cjmvi3rQ.js → metadata-routes-DSDjM_hJ.js} +71 -27
- package/dist/_chunks/metadata-routes-DSDjM_hJ.js.map +1 -0
- package/dist/_chunks/navigation-root-BQfo1-kG.js +126 -0
- package/dist/_chunks/navigation-root-BQfo1-kG.js.map +1 -0
- package/dist/_chunks/param-value-C8TNYchQ.js +66 -0
- package/dist/_chunks/param-value-C8TNYchQ.js.map +1 -0
- package/dist/_chunks/plugin-context-BPBPc3lL.js +345 -0
- package/dist/_chunks/plugin-context-BPBPc3lL.js.map +1 -0
- package/dist/_chunks/poison-rules-DoEhbqaY.js +110 -0
- package/dist/_chunks/poison-rules-DoEhbqaY.js.map +1 -0
- package/dist/_chunks/poison-scan-CfQ3unZR.js +99 -0
- package/dist/_chunks/poison-scan-CfQ3unZR.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/render-timeout-DOf_BBcO.js +46 -0
- package/dist/_chunks/render-timeout-DOf_BBcO.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/rolldown-runtime-D7D4PA-g.js +13 -0
- package/dist/_chunks/rsc-cache-key-ClUiXQnK.js +243 -0
- package/dist/_chunks/rsc-cache-key-ClUiXQnK.js.map +1 -0
- package/dist/_chunks/rsc-media-type-DDc7duTD.js +61 -0
- package/dist/_chunks/rsc-media-type-DDc7duTD.js.map +1 -0
- package/dist/_chunks/rsc-payload-path-dffcs4jp.js +54 -0
- package/dist/_chunks/rsc-payload-path-dffcs4jp.js.map +1 -0
- package/dist/_chunks/scan-BoP17W3w.js +140 -0
- package/dist/_chunks/scan-BoP17W3w.js.map +1 -0
- package/dist/_chunks/scanner-DmqdxzbW.js +2056 -0
- package/dist/_chunks/scanner-DmqdxzbW.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-xtPUGfdq.js +137 -0
- package/dist/_chunks/segment-context-xtPUGfdq.js.map +1 -0
- package/dist/_chunks/segment-keys-D5hu1hz4.js +62 -0
- package/dist/_chunks/segment-keys-D5hu1hz4.js.map +1 -0
- package/dist/_chunks/singleflight-BeVMMKi0.js +55 -0
- package/dist/_chunks/singleflight-BeVMMKi0.js.map +1 -0
- package/dist/_chunks/sizeof-BM1409x2.js +36 -0
- package/dist/_chunks/sizeof-BM1409x2.js.map +1 -0
- package/dist/_chunks/ssr-data-nA3I70_n.js +49 -0
- package/dist/_chunks/ssr-data-nA3I70_n.js.map +1 -0
- package/dist/_chunks/state-BhNGPsdi.js +50 -0
- package/dist/_chunks/state-BhNGPsdi.js.map +1 -0
- package/dist/_chunks/status-page-marker-BRX9Ib-d.js +564 -0
- package/dist/_chunks/status-page-marker-BRX9Ib-d.js.map +1 -0
- package/dist/_chunks/tree-match-6yihorhk.js +169 -0
- package/dist/_chunks/tree-match-6yihorhk.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/walkers-Czu2jXFq.js +144 -0
- package/dist/_chunks/walkers-Czu2jXFq.js.map +1 -0
- package/dist/_chunks/write-file-atomic-D1qWqHb4.js +32 -0
- package/dist/_chunks/write-file-atomic-D1qWqHb4.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/canonicalize-module.d.ts +8 -0
- package/dist/adapters/canonicalize-module.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 +74 -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 +123 -0
- package/dist/adapters/cloudflare-kv-cache.js.map +1 -0
- package/dist/adapters/cloudflare.d.ts +224 -24
- package/dist/adapters/cloudflare.d.ts.map +1 -1
- package/dist/adapters/cloudflare.js +2 -188
- package/dist/adapters/compress-module.d.ts +25 -4
- package/dist/adapters/compress-module.d.ts.map +1 -1
- package/dist/adapters/fs-identity.d.ts +63 -0
- package/dist/adapters/fs-identity.d.ts.map +1 -0
- package/dist/adapters/nitro-presets.d.ts +31 -0
- package/dist/adapters/nitro-presets.d.ts.map +1 -0
- package/dist/adapters/nitro-preview.d.ts +64 -0
- package/dist/adapters/nitro-preview.d.ts.map +1 -0
- package/dist/adapters/nitro.d.ts +54 -37
- package/dist/adapters/nitro.d.ts.map +1 -1
- package/dist/adapters/nitro.js +631 -359
- package/dist/adapters/nitro.js.map +1 -1
- package/dist/adapters/shared.d.ts +67 -0
- package/dist/adapters/shared.d.ts.map +1 -0
- package/dist/adapters/types.d.ts +122 -16
- package/dist/adapters/types.d.ts.map +1 -1
- package/dist/adapters/types.js +0 -0
- package/dist/analyze/chains.d.ts +124 -0
- package/dist/analyze/chains.d.ts.map +1 -0
- package/dist/analyze/classify.d.ts +153 -0
- package/dist/analyze/classify.d.ts.map +1 -0
- package/dist/analyze/crawl-entry.d.ts +17 -0
- package/dist/analyze/crawl-entry.d.ts.map +1 -0
- package/dist/analyze/crawl-entry.js +314 -0
- package/dist/analyze/crawl-entry.js.map +1 -0
- package/dist/analyze/crawl.d.ts +134 -0
- package/dist/analyze/crawl.d.ts.map +1 -0
- package/dist/analyze/graph-cache.d.ts +104 -0
- package/dist/analyze/graph-cache.d.ts.map +1 -0
- package/dist/analyze/graph-command.d.ts +43 -0
- package/dist/analyze/graph-command.d.ts.map +1 -0
- package/dist/analyze/graph-command.js +472 -0
- package/dist/analyze/graph-command.js.map +1 -0
- package/dist/analyze/live-graph.d.ts +81 -0
- package/dist/analyze/live-graph.d.ts.map +1 -0
- package/dist/analyze/poison-rules.d.ts +72 -0
- package/dist/analyze/poison-rules.d.ts.map +1 -0
- package/dist/analyze/poison-scan.d.ts +48 -0
- package/dist/analyze/poison-scan.d.ts.map +1 -0
- package/dist/analyze/scan.d.ts +73 -0
- package/dist/analyze/scan.d.ts.map +1 -0
- 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 +32 -9
- 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 +141 -9
- package/dist/cache/redis-handler.d.ts.map +1 -1
- package/dist/cache/singleflight.d.ts +21 -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 +21 -11
- 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 +20 -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 +133 -0
- package/dist/cli-check.d.ts.map +1 -0
- package/dist/cli-context.d.ts +54 -0
- package/dist/cli-context.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 +85 -13
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +224 -63
- package/dist/cli.js.map +1 -1
- package/dist/client/browser-dev.d.ts +42 -2
- package/dist/client/browser-dev.d.ts.map +1 -1
- package/dist/client/browser-entry/action-dispatch.d.ts +19 -0
- package/dist/client/browser-entry/action-dispatch.d.ts.map +1 -0
- package/dist/client/browser-entry/action-queue.d.ts +63 -0
- package/dist/client/browser-entry/action-queue.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 +53 -0
- package/dist/client/browser-entry/hydrate.d.ts.map +1 -0
- package/dist/client/browser-entry/index.d.ts +30 -0
- package/dist/client/browser-entry/index.d.ts.map +1 -0
- package/dist/client/browser-entry/post-hydration.d.ts +26 -0
- package/dist/client/browser-entry/post-hydration.d.ts.map +1 -0
- package/dist/client/browser-entry/router-init.d.ts +41 -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/deny-last-resort.d.ts +29 -0
- package/dist/client/deny-last-resort.d.ts.map +1 -0
- package/dist/client/error-boundary.d.ts +58 -9
- package/dist/client/error-boundary.d.ts.map +1 -1
- package/dist/client/error-boundary.js +2 -126
- package/dist/client/error-reconstituter.d.ts +55 -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/global-context.d.ts +15 -0
- package/dist/client/global-context.d.ts.map +1 -0
- package/dist/client/history.d.ts +50 -9
- package/dist/client/history.d.ts.map +1 -1
- package/dist/client/index.d.ts +20 -33
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +330 -1150
- 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 +792 -0
- package/dist/client/internal.js.map +1 -0
- package/dist/client/link.d.ts +85 -60
- package/dist/client/link.d.ts.map +1 -1
- package/dist/client/location-search.d.ts +12 -0
- package/dist/client/location-search.d.ts.map +1 -0
- package/dist/client/navigation-api.d.ts +133 -0
- package/dist/client/navigation-api.d.ts.map +1 -0
- package/dist/client/navigation-commit.d.ts +111 -0
- package/dist/client/navigation-commit.d.ts.map +1 -0
- package/dist/client/navigation-context.d.ts +54 -36
- package/dist/client/navigation-context.d.ts.map +1 -1
- package/dist/client/navigation-root.d.ts +106 -0
- package/dist/client/navigation-root.d.ts.map +1 -0
- package/dist/client/navigation-transition.d.ts +192 -0
- package/dist/client/navigation-transition.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 +81 -0
- package/dist/client/params-context.d.ts.map +1 -0
- package/dist/client/react-root.d.ts +45 -0
- package/dist/client/react-root.d.ts.map +1 -0
- package/dist/client/router-effects.d.ts +137 -0
- package/dist/client/router-effects.d.ts.map +1 -0
- package/dist/client/router-lifecycle.d.ts +98 -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 +334 -0
- package/dist/client/router-types.d.ts.map +1 -0
- package/dist/client/router-url.d.ts +24 -0
- package/dist/client/router-url.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 +110 -28
- package/dist/client/rsc-fetch.d.ts.map +1 -1
- package/dist/client/segment-cache.d.ts +186 -25
- package/dist/client/segment-cache.d.ts.map +1 -1
- package/dist/client/segment-context.d.ts.map +1 -1
- package/dist/client/segment-outlet.d.ts +68 -0
- package/dist/client/segment-outlet.d.ts.map +1 -0
- package/dist/client/segment-update-context.d.ts +15 -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-content-cache-context.d.ts +35 -0
- package/dist/client/slot-content-cache-context.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 +26 -50
- 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 +21 -13
- package/dist/client/state.d.ts.map +1 -1
- package/dist/client/status-page-marker.d.ts +25 -0
- package/dist/client/status-page-marker.d.ts.map +1 -0
- 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 +13 -11
- 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 +15 -8
- package/dist/client/use-router.d.ts.map +1 -1
- package/dist/client/use-search-params.d.ts +15 -8
- package/dist/client/use-search-params.d.ts.map +1 -1
- package/dist/client/use-segment-params.d.ts +55 -0
- 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 +323 -0
- package/dist/config-types.d.ts.map +1 -0
- package/dist/config-validation.d.ts +68 -0
- package/dist/config-validation.d.ts.map +1 -0
- 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 +3 -2
- package/dist/cookies/index.d.ts.map +1 -1
- package/dist/cookies/index.js +256 -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 +95 -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 +46 -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 +74 -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/{plugins/dev-error-overlay.d.ts → dev-tools/overlay.d.ts} +15 -25
- 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 +112 -8
- 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/css.d.ts +1 -1
- 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 +5 -3
- package/dist/fonts/google.d.ts.map +1 -1
- package/dist/fonts/local.d.ts +5 -5
- 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 +35 -181
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8871 -14233
- 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 +262 -0
- package/dist/plugin-context.d.ts.map +1 -0
- 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 +61 -11
- 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/client-dep-entries.d.ts +44 -0
- package/dist/plugins/client-dep-entries.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-discovery.d.ts +123 -0
- package/dist/plugins/dev-discovery.d.ts.map +1 -0
- package/dist/plugins/dev-server.d.ts +24 -1
- package/dist/plugins/dev-server.d.ts.map +1 -1
- package/dist/plugins/entries.d.ts +34 -4
- package/dist/plugins/entries.d.ts.map +1 -1
- package/dist/plugins/fonts.d.ts +35 -74
- package/dist/plugins/fonts.d.ts.map +1 -1
- package/dist/plugins/graph-endpoint.d.ts +112 -0
- package/dist/plugins/graph-endpoint.d.ts.map +1 -0
- package/dist/plugins/mdx.d.ts +18 -5
- package/dist/plugins/mdx.d.ts.map +1 -1
- package/dist/plugins/post-build.d.ts +110 -0
- package/dist/plugins/post-build.d.ts.map +1 -0
- package/dist/plugins/prebuilt-capture.d.ts +67 -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 +98 -0
- package/dist/plugins/prebuilt.d.ts.map +1 -0
- package/dist/plugins/prerender-sugar.d.ts +39 -0
- package/dist/plugins/prerender-sugar.d.ts.map +1 -0
- package/dist/plugins/react-resolve.d.ts +49 -0
- package/dist/plugins/react-resolve.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/rsc-assets-manifest.d.ts +33 -0
- package/dist/plugins/rsc-assets-manifest.d.ts.map +1 -0
- 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 +246 -26
- 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 +42 -0
- package/dist/routing/codegen-write.d.ts.map +1 -0
- package/dist/routing/codegen.d.ts +8 -3
- 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 +91 -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 +13 -7
- package/dist/routing/index.d.ts.map +1 -1
- package/dist/routing/index.js +5 -2
- package/dist/routing/interception-overlap.d.ts +35 -0
- package/dist/routing/interception-overlap.d.ts.map +1 -0
- 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 +14 -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 +81 -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 +14 -0
- package/dist/rsc-runtime/ssr.d.ts.map +1 -1
- package/dist/rsc-runtime/transforms.d.ts +13 -0
- package/dist/rsc-runtime/transforms.d.ts.map +1 -0
- 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 +98 -10
- package/dist/server/access-gate.d.ts.map +1 -1
- package/dist/server/action-client.d.ts +44 -9
- 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 +40 -5
- package/dist/server/action-handler.d.ts.map +1 -1
- package/dist/server/actions.d.ts +78 -40
- package/dist/server/actions.d.ts.map +1 -1
- package/dist/server/als-registry.d.ts +166 -16
- package/dist/server/als-registry.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 +149 -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/csp-nonce.d.ts +36 -0
- package/dist/server/csp-nonce.d.ts.map +1 -0
- package/dist/server/csrf.d.ts +58 -15
- package/dist/server/csrf.d.ts.map +1 -1
- package/dist/server/debug.d.ts +0 -1
- package/dist/server/debug.d.ts.map +1 -1
- package/dist/server/default-logger.d.ts +23 -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 +257 -0
- package/dist/server/deny-boundary.d.ts.map +1 -0
- package/dist/server/deny-renderer.d.ts +21 -15
- package/dist/server/deny-renderer.d.ts.map +1 -1
- package/dist/server/early-hints-sender.d.ts.map +1 -1
- package/dist/server/early-hints.d.ts +14 -12
- package/dist/server/early-hints.d.ts.map +1 -1
- package/dist/server/error-boundary-wrapper.d.ts +102 -10
- package/dist/server/error-boundary-wrapper.d.ts.map +1 -1
- package/dist/server/error-response-headers.d.ts +3 -0
- package/dist/server/error-response-headers.d.ts.map +1 -0
- package/dist/server/fallback-error.d.ts +19 -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 +45 -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/form-flash.d.ts +2 -2
- 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 +257 -0
- package/dist/server/html-injector-core.d.ts.map +1 -0
- package/dist/server/html-injectors.d.ts +84 -42
- package/dist/server/html-injectors.d.ts.map +1 -1
- package/dist/server/index.d.ts +17 -54
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +195 -2922
- package/dist/server/index.js.map +1 -1
- package/dist/server/instrumentation.d.ts +11 -4
- package/dist/server/instrumentation.d.ts.map +1 -1
- package/dist/server/internal.d.ts +47 -0
- package/dist/server/internal.d.ts.map +1 -0
- package/dist/server/internal.js +4645 -0
- package/dist/server/internal.js.map +1 -0
- package/dist/server/json-status-response.d.ts +34 -0
- package/dist/server/json-status-response.d.ts.map +1 -0
- package/dist/server/logger.d.ts +78 -7
- package/dist/server/logger.d.ts.map +1 -1
- package/dist/server/metadata-collector.d.ts +73 -0
- package/dist/server/metadata-collector.d.ts.map +1 -0
- package/dist/server/metadata-platform.d.ts +2 -2
- package/dist/server/metadata-render.d.ts +2 -2
- package/dist/server/metadata-render.d.ts.map +1 -1
- package/dist/server/metadata-routes.d.ts +71 -11
- package/dist/server/metadata-routes.d.ts.map +1 -1
- package/dist/server/metadata-social.d.ts +2 -2
- package/dist/server/metadata.d.ts +10 -2
- package/dist/server/metadata.d.ts.map +1 -1
- package/dist/server/middleware-runner.d.ts +20 -5
- package/dist/server/middleware-runner.d.ts.map +1 -1
- package/dist/server/node-stream-transforms.d.ts +105 -0
- package/dist/server/node-stream-transforms.d.ts.map +1 -0
- package/dist/server/nuqs-ssr-provider.d.ts +7 -3
- package/dist/server/nuqs-ssr-provider.d.ts.map +1 -1
- package/dist/server/param-coercion.d.ts +83 -0
- package/dist/server/param-coercion.d.ts.map +1 -0
- package/dist/server/pipeline-helpers.d.ts +193 -0
- package/dist/server/pipeline-helpers.d.ts.map +1 -0
- package/dist/server/pipeline-interception.d.ts +70 -9
- package/dist/server/pipeline-interception.d.ts.map +1 -1
- package/dist/server/pipeline-metadata.d.ts +7 -1
- package/dist/server/pipeline-metadata.d.ts.map +1 -1
- package/dist/server/pipeline-outcome.d.ts +59 -0
- package/dist/server/pipeline-outcome.d.ts.map +1 -0
- package/dist/server/pipeline-phases.d.ts +70 -0
- package/dist/server/pipeline-phases.d.ts.map +1 -0
- package/dist/server/pipeline.d.ts +147 -23
- package/dist/server/pipeline.d.ts.map +1 -1
- package/dist/server/port-resolution.d.ts +31 -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-render.d.ts +25 -0
- package/dist/server/prebuilt/capture-render.d.ts.map +1 -0
- package/dist/server/prebuilt/capture-routes.d.ts +37 -0
- package/dist/server/prebuilt/capture-routes.d.ts.map +1 -0
- package/dist/server/prebuilt/capture-state.d.ts +101 -0
- package/dist/server/prebuilt/capture-state.d.ts.map +1 -0
- package/dist/server/prebuilt/key-discipline.d.ts +52 -0
- package/dist/server/prebuilt/key-discipline.d.ts.map +1 -0
- package/dist/server/prebuilt/lifetime.d.ts +38 -0
- package/dist/server/prebuilt/lifetime.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 +106 -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 +101 -90
- 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/react-cache-bridge.d.ts +59 -0
- package/dist/server/react-cache-bridge.d.ts.map +1 -0
- package/dist/server/react-cache-scope.d.ts +49 -0
- package/dist/server/react-cache-scope.d.ts.map +1 -0
- package/dist/server/render-timeout.d.ts +66 -0
- package/dist/server/render-timeout.d.ts.map +1 -0
- package/dist/server/render-utils.d.ts +35 -0
- package/dist/server/render-utils.d.ts.map +1 -0
- package/dist/server/request-context.d.ts +128 -103
- 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/response-cache-policy.d.ts +3 -0
- package/dist/server/response-cache-policy.d.ts.map +1 -0
- package/dist/server/route-element-builder.d.ts +57 -30
- package/dist/server/route-element-builder.d.ts.map +1 -1
- package/dist/server/route-element-helpers.d.ts +12 -0
- package/dist/server/route-element-helpers.d.ts.map +1 -0
- package/dist/server/route-handler.d.ts +1 -1
- package/dist/server/route-handler.d.ts.map +1 -1
- package/dist/server/route-matcher.d.ts +55 -38
- package/dist/server/route-matcher.d.ts.map +1 -1
- package/dist/server/route-module-loader.d.ts +37 -0
- package/dist/server/route-module-loader.d.ts.map +1 -0
- 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-dispatcher.d.ts +67 -0
- package/dist/server/rsc-entry/action-dispatcher.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 +19 -3
- package/dist/server/rsc-entry/api-handler.d.ts.map +1 -1
- package/dist/server/rsc-entry/deny-fallback.d.ts +55 -0
- package/dist/server/rsc-entry/deny-fallback.d.ts.map +1 -0
- package/dist/server/rsc-entry/error-renderer.d.ts +35 -21
- package/dist/server/rsc-entry/error-renderer.d.ts.map +1 -1
- package/dist/server/rsc-entry/helpers.d.ts +14 -59
- package/dist/server/rsc-entry/helpers.d.ts.map +1 -1
- package/dist/server/rsc-entry/index.d.ts +30 -6
- package/dist/server/rsc-entry/index.d.ts.map +1 -1
- package/dist/server/rsc-entry/render-route.d.ts +50 -0
- package/dist/server/rsc-entry/render-route.d.ts.map +1 -0
- package/dist/server/rsc-entry/render-signals.d.ts +65 -0
- package/dist/server/rsc-entry/render-signals.d.ts.map +1 -0
- package/dist/server/rsc-entry/revalidate-renderer.d.ts +98 -0
- package/dist/server/rsc-entry/revalidate-renderer.d.ts.map +1 -0
- package/dist/server/rsc-entry/rsc-payload.d.ts +30 -6
- package/dist/server/rsc-entry/rsc-payload.d.ts.map +1 -1
- package/dist/server/rsc-entry/rsc-stream.d.ts +12 -30
- package/dist/server/rsc-entry/rsc-stream.d.ts.map +1 -1
- package/dist/server/rsc-entry/ssr-bridge.d.ts +6 -2
- package/dist/server/rsc-entry/ssr-bridge.d.ts.map +1 -1
- package/dist/server/rsc-entry/ssr-renderer.d.ts +44 -7
- package/dist/server/rsc-entry/ssr-renderer.d.ts.map +1 -1
- package/dist/server/rsc-error-envelope.d.ts +11 -0
- package/dist/server/rsc-error-envelope.d.ts.map +1 -0
- package/dist/server/safe-load.d.ts +39 -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/signal-identity.d.ts +43 -0
- package/dist/server/signal-identity.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 +29 -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 +138 -7
- package/dist/server/slot-resolver.d.ts.map +1 -1
- package/dist/server/slot-subtree-contain.d.ts +54 -0
- package/dist/server/slot-subtree-contain.d.ts.map +1 -0
- package/dist/server/ssr-bridge-types.d.ts +198 -0
- package/dist/server/ssr-bridge-types.d.ts.map +1 -0
- package/dist/server/ssr-entry.d.ts +8 -47
- package/dist/server/ssr-entry.d.ts.map +1 -1
- package/dist/server/ssr-render.d.ts +60 -27
- package/dist/server/ssr-render.d.ts.map +1 -1
- package/dist/server/ssr-wrappers.d.ts +93 -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 +59 -0
- package/dist/server/stream-utils.d.ts.map +1 -0
- package/dist/server/tracing.d.ts +57 -26
- package/dist/server/tracing.d.ts.map +1 -1
- package/dist/server/tree-match.d.ts +59 -0
- package/dist/server/tree-match.d.ts.map +1 -0
- package/dist/server/types.d.ts +89 -8
- package/dist/server/types.d.ts.map +1 -1
- package/dist/server/utils/element-type.d.ts +50 -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/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/csrf-reject.d.ts +16 -0
- package/dist/shared/csrf-reject.d.ts.map +1 -0
- package/dist/shared/error-digest.d.ts +28 -0
- package/dist/shared/error-digest.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 +110 -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 +16 -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 +52 -0
- package/dist/shared/rsc-media-type.d.ts.map +1 -0
- package/dist/shared/rsc-payload-path.d.ts +48 -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/shared/status-reason-phrase.d.ts +26 -0
- package/dist/shared/status-reason-phrase.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-rsc.d.ts +21 -0
- package/dist/shims/navigation-rsc.d.ts.map +1 -0
- 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/dist/utils/write-file-atomic.d.ts +17 -0
- package/dist/utils/write-file-atomic.d.ts.map +1 -0
- package/docs/api/30-api-server.mdx +239 -0
- package/docs/api/31-api-client.mdx +170 -0
- package/docs/api/32-api-cache.mdx +339 -0
- package/docs/api/33-api-search-params.mdx +176 -0
- package/docs/api/34-api-config.mdx +359 -0
- package/docs/api/35-api-typescript.mdx +91 -0
- package/docs/api/36-cli.mdx +202 -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 +227 -0
- package/docs/learn/04-access-control.mdx +115 -0
- package/docs/learn/05-the-flush-point.mdx +175 -0
- package/docs/learn/06-typed-params.mdx +275 -0
- package/docs/learn/07-typed-routes.mdx +108 -0
- package/docs/learn/08-forms-and-actions.mdx +146 -0
- package/docs/learn/09-streaming.mdx +140 -0
- package/docs/learn/10-caching.mdx +270 -0
- package/docs/learn/11-middleware.mdx +164 -0
- package/docs/learn/12-error-handling.mdx +192 -0
- package/docs/learn/13-deploying.mdx +287 -0
- package/llms.txt +55 -0
- package/package.json +120 -29
- package/src/adapters/build-output-helper.ts +353 -0
- package/src/adapters/canonicalize-module.ts +29 -0
- package/src/adapters/cloudflare-dev.ts +183 -0
- package/src/adapters/cloudflare-kv-cache.ts +207 -0
- package/src/adapters/cloudflare.ts +809 -150
- package/src/adapters/compress-module.ts +110 -86
- package/src/adapters/fs-identity.ts +155 -0
- package/src/adapters/nitro-presets.ts +124 -0
- package/src/adapters/nitro-preview.ts +476 -0
- package/src/adapters/nitro.ts +317 -457
- package/src/adapters/raw-imports.d.ts +5 -0
- package/src/adapters/shared.ts +283 -0
- package/src/adapters/types.ts +127 -17
- package/src/adapters/wrangler.d.ts +7 -0
- package/src/analyze/chains.ts +411 -0
- package/src/analyze/classify.ts +259 -0
- package/src/analyze/crawl-entry.ts +68 -0
- package/src/analyze/crawl.ts +500 -0
- package/src/analyze/graph-cache.ts +331 -0
- package/src/analyze/graph-command.ts +762 -0
- package/src/analyze/live-graph.ts +232 -0
- package/src/analyze/poison-rules.ts +165 -0
- package/src/analyze/poison-scan.ts +159 -0
- package/src/analyze/scan.ts +149 -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 +115 -22
- package/src/cache/invalidation-epoch.ts +93 -0
- package/src/cache/json-lossy-check.ts +69 -0
- package/src/cache/redis-handler.ts +198 -20
- package/src/cache/singleflight.ts +72 -6
- package/src/cache/sizeof.ts +35 -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 +254 -0
- package/src/cache/timber-cache.ts +165 -40
- 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 +23 -0
- package/src/cdn/purge-store.ts +34 -0
- package/src/cdn/workers-cache-purge.ts +34 -0
- package/src/cli-check.ts +417 -0
- package/src/cli-context.ts +119 -0
- package/src/cli-schema-sync.ts +401 -0
- package/src/cli.ts +330 -78
- package/src/client/browser-dev.ts +192 -5
- package/src/client/browser-entry/action-dispatch.ts +237 -0
- package/src/client/browser-entry/action-queue.ts +152 -0
- package/src/client/browser-entry/hmr.ts +70 -0
- package/src/client/browser-entry/hydrate.ts +143 -0
- package/src/client/browser-entry/index.ts +120 -0
- package/src/client/browser-entry/post-hydration.ts +99 -0
- package/src/client/browser-entry/router-init.ts +406 -0
- package/src/client/browser-entry/rsc-stream.ts +145 -0
- package/src/client/browser-entry/scroll.ts +50 -0
- package/src/client/deny-last-resort.tsx +54 -0
- package/src/client/error-boundary.tsx +279 -61
- package/src/client/error-reconstituter.tsx +84 -0
- package/src/client/form.tsx +36 -32
- package/src/client/global-context.ts +31 -0
- package/src/client/history.ts +74 -11
- package/src/client/index.ts +89 -53
- package/src/client/internal.ts +54 -0
- package/src/client/link.tsx +468 -151
- package/src/client/location-search.ts +15 -0
- package/src/client/navigation-api.ts +380 -0
- package/src/client/navigation-commit.ts +318 -0
- package/src/client/navigation-context.ts +67 -134
- package/src/client/navigation-root.tsx +236 -0
- package/src/client/navigation-transition.ts +337 -0
- package/src/client/nuqs-adapter.tsx +21 -9
- package/src/client/params-context.ts +187 -0
- package/src/client/react-root.ts +82 -0
- package/src/client/router-effects.ts +235 -0
- package/src/client/router-lifecycle.ts +354 -0
- package/src/client/router-pipeline.ts +458 -0
- package/src/client/router-ref.ts +3 -3
- package/src/client/router-skew.ts +30 -0
- package/src/client/router-types.ts +370 -0
- package/src/client/router-url.ts +32 -0
- package/src/client/router.ts +491 -424
- package/src/client/rsc-fetch.ts +510 -109
- package/src/client/segment-cache.ts +362 -41
- package/src/client/segment-context.ts +7 -4
- package/src/client/segment-outlet.tsx +96 -0
- package/src/client/segment-update-context.ts +23 -0
- package/src/client/shallow-url.ts +22 -0
- package/src/client/slot-content-cache-context.ts +43 -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 +27 -67
- package/src/client/stale-client.ts +191 -0
- package/src/client/state.ts +31 -24
- package/src/client/status-page-marker.tsx +32 -0
- package/src/client/top-loader.tsx +13 -10
- package/src/client/unload-guard.ts +35 -3
- package/src/client/use-cookie.ts +70 -18
- package/src/client/use-link-status.ts +7 -7
- package/src/client/use-pathname.ts +22 -31
- package/src/client/use-pending-navigation.ts +40 -0
- package/src/client/use-query-states.ts +206 -36
- package/src/client/use-router.ts +31 -9
- package/src/client/use-search-params.ts +38 -49
- package/src/client/use-segment-params.ts +69 -0
- package/src/client/use-selected-layout-segment.ts +2 -2
- package/src/codec.ts +149 -0
- package/src/config-types.ts +323 -0
- package/src/config-validation.ts +464 -0
- package/src/cookies/define-cookie.ts +222 -53
- package/src/cookies/index.ts +13 -2
- 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 +278 -0
- package/src/dev-tools/error-page.ts +331 -0
- package/src/dev-tools/holding-server.ts +185 -0
- package/src/dev-tools/hydration-overlay.ts +158 -0
- package/src/dev-tools/index.ts +79 -0
- package/src/dev-tools/instrumentation.ts +261 -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/{plugins/dev-error-overlay.ts → dev-tools/overlay.ts} +25 -80
- 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 +479 -128
- package/src/fonts/bundle.ts +138 -0
- package/src/fonts/css.ts +1 -1
- package/src/fonts/dev-middleware.ts +85 -0
- package/src/fonts/fallbacks.ts +0 -23
- package/src/fonts/google.ts +101 -19
- package/src/fonts/local.ts +12 -11
- 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 +513 -380
- 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 +502 -0
- package/src/plugins/build-manifest.ts +204 -36
- package/src/plugins/build-report.ts +299 -87
- 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/client-dep-entries.ts +78 -0
- package/src/plugins/cloudflare-wasm.ts +141 -0
- package/src/plugins/content.ts +31 -2
- package/src/plugins/dev-discovery.ts +218 -0
- package/src/plugins/dev-server.ts +360 -97
- package/src/plugins/entries.ts +149 -16
- package/src/plugins/fonts.ts +260 -657
- package/src/plugins/graph-endpoint.ts +532 -0
- package/src/plugins/mdx.ts +108 -35
- package/src/plugins/post-build.ts +327 -0
- package/src/plugins/prebuilt-capture.ts +213 -0
- package/src/plugins/prebuilt-options-analysis.ts +175 -0
- package/src/plugins/prebuilt.ts +670 -0
- package/src/plugins/prerender-sugar.ts +316 -0
- package/src/plugins/react-resolve.ts +149 -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 +273 -277
- package/src/plugins/rsc-assets-manifest.ts +251 -0
- package/src/plugins/server-bundle.ts +99 -14
- package/src/plugins/shims.ts +260 -97
- package/src/plugins/static-build.ts +681 -71
- package/src/react-canary.d.ts +2 -0
- package/src/routing/codegen-shared.ts +39 -0
- package/src/routing/codegen-types.ts +62 -0
- package/src/routing/codegen-write.ts +163 -0
- package/src/routing/codegen.ts +349 -232
- package/src/routing/collision-probe.ts +438 -0
- package/src/routing/collision-spaces.ts +281 -0
- package/src/routing/convention-lint.ts +651 -0
- package/src/routing/export-detect.ts +536 -0
- package/src/routing/file-cache.ts +23 -0
- package/src/routing/index.ts +16 -7
- package/src/routing/interception-overlap.ts +141 -0
- package/src/routing/interception.ts +1044 -67
- package/src/routing/link-codegen.ts +280 -0
- package/src/routing/manifest-codegen.ts +232 -0
- package/src/routing/scanner.ts +417 -223
- package/src/routing/schema-validation.ts +155 -0
- package/src/routing/segment-classify.ts +280 -0
- package/src/routing/segment-codegen.ts +99 -0
- package/src/routing/segment-keys.ts +186 -0
- package/src/routing/slot-placement.ts +97 -0
- package/src/routing/types.ts +82 -26
- package/src/routing/walkers.ts +98 -0
- package/src/rsc-runtime/rsc.ts +9 -0
- package/src/rsc-runtime/ssr.ts +51 -0
- package/src/rsc-runtime/transforms.ts +13 -0
- package/src/rsc-runtime/vendor-types.d.ts +27 -0
- package/src/schema-bridge.ts +382 -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 +195 -56
- package/src/server/action-client.ts +126 -33
- package/src/server/action-encryption.ts +144 -0
- package/src/server/action-handler.ts +457 -111
- package/src/server/actions.ts +172 -85
- package/src/server/als-registry.ts +224 -25
- 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 +116 -0
- package/src/server/coalesce-tick.ts +75 -0
- package/src/server/compress.ts +43 -8
- package/src/server/cookie-context.ts +454 -0
- package/src/server/cookie-parsing.ts +163 -0
- package/src/server/csp-nonce.ts +58 -0
- package/src/server/csrf.ts +228 -35
- package/src/server/debug.ts +0 -1
- package/src/server/default-logger.ts +100 -0
- package/src/server/default-status-page.ts +88 -0
- package/src/server/deny-boundary.ts +527 -0
- package/src/server/deny-renderer.ts +201 -179
- package/src/server/early-hints-sender.ts +4 -3
- package/src/server/early-hints.ts +39 -29
- package/src/server/error-boundary-wrapper.ts +160 -44
- package/src/server/error-response-headers.ts +18 -0
- package/src/server/fallback-error.ts +88 -104
- package/src/server/flight-injection-state.ts +113 -0
- package/src/server/flight-scripts.ts +67 -0
- package/src/server/form-data.ts +124 -12
- package/src/server/form-flash.ts +3 -3
- package/src/server/head-response.ts +54 -0
- package/src/server/html-injector-core.ts +512 -0
- package/src/server/html-injectors.ts +270 -255
- package/src/server/index.ts +36 -192
- package/src/server/instrumentation.ts +11 -4
- package/src/server/internal.ts +168 -0
- package/src/server/json-status-response.ts +105 -0
- package/src/server/logger.ts +126 -38
- package/src/server/metadata-collector.ts +177 -0
- package/src/server/metadata-platform.ts +2 -2
- package/src/server/metadata-render.ts +30 -8
- package/src/server/metadata-routes.ts +220 -24
- package/src/server/metadata-social.ts +2 -2
- package/src/server/metadata.ts +23 -2
- package/src/server/middleware-runner.ts +32 -5
- package/src/server/node-stream-transforms.ts +323 -0
- package/src/server/nuqs-ssr-provider.tsx +8 -7
- package/src/server/param-coercion.ts +201 -0
- package/src/server/pipeline-helpers.ts +485 -0
- package/src/server/pipeline-interception.ts +241 -32
- package/src/server/pipeline-metadata.ts +15 -1
- package/src/server/pipeline-outcome.ts +290 -0
- package/src/server/pipeline-phases.ts +496 -0
- package/src/server/pipeline.ts +385 -427
- package/src/server/port-resolution.ts +53 -0
- package/src/server/prebuilt/cache-key.ts +299 -0
- package/src/server/prebuilt/capture-render.ts +118 -0
- package/src/server/prebuilt/capture-routes.ts +104 -0
- package/src/server/prebuilt/capture-state.ts +196 -0
- package/src/server/prebuilt/key-discipline.ts +122 -0
- package/src/server/prebuilt/lifetime.ts +151 -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 +202 -0
- package/src/server/prebuilt/synthetic-store.ts +125 -0
- package/src/server/prebuilt-builder.ts +514 -0
- package/src/server/prebuilt-runtime.ts +813 -0
- package/src/server/primitives.ts +153 -171
- package/src/server/publish-params.ts +42 -0
- package/src/server/react-cache-bridge.ts +124 -0
- package/src/server/react-cache-scope.ts +104 -0
- package/src/server/render-timeout.ts +128 -0
- package/src/server/render-utils.ts +45 -0
- package/src/server/request-context.ts +269 -332
- package/src/server/request-dep.ts +37 -0
- package/src/server/response-cache-policy.ts +45 -0
- package/src/server/route-element-builder.ts +514 -355
- package/src/server/route-element-helpers.ts +37 -0
- package/src/server/route-handler.ts +67 -27
- package/src/server/route-matcher.ts +238 -267
- package/src/server/route-module-loader.ts +161 -0
- package/src/server/rsc-cache-key-guard.ts +122 -0
- package/src/server/rsc-entry/action-dispatcher.ts +142 -0
- package/src/server/rsc-entry/action-middleware-runner.ts +130 -0
- package/src/server/rsc-entry/api-handler.ts +49 -81
- package/src/server/rsc-entry/deny-fallback.ts +151 -0
- package/src/server/rsc-entry/error-renderer.ts +301 -113
- package/src/server/rsc-entry/helpers.ts +90 -115
- package/src/server/rsc-entry/index.ts +370 -350
- package/src/server/rsc-entry/render-route.ts +229 -0
- package/src/server/rsc-entry/render-signals.ts +108 -0
- package/src/server/rsc-entry/revalidate-renderer.ts +349 -0
- package/src/server/rsc-entry/rsc-payload.ts +192 -72
- package/src/server/rsc-entry/rsc-stream.ts +128 -131
- package/src/server/rsc-entry/ssr-bridge.ts +19 -6
- package/src/server/rsc-entry/ssr-renderer.ts +300 -137
- package/src/server/rsc-error-envelope.ts +18 -0
- package/src/server/rsc-prop-warnings.ts +1 -1
- package/src/server/safe-load.ts +53 -0
- package/src/server/sensitive-fields.ts +230 -0
- package/src/server/server-only-guard-noop.js +3 -0
- package/src/server/server-timing.ts +1 -1
- package/src/server/signal-identity.ts +112 -0
- package/src/server/sitemap-generator.ts +337 -0
- package/src/server/sitemap-handler.ts +157 -0
- package/src/server/skippable-prefix.ts +172 -0
- package/src/server/slot-interception.ts +168 -0
- package/src/server/slot-resolver.ts +707 -300
- package/src/server/slot-subtree-contain.ts +273 -0
- package/src/server/ssr-bridge-types.ts +201 -0
- package/src/server/ssr-entry.ts +225 -104
- package/src/server/ssr-render.ts +354 -91
- package/src/server/ssr-wrappers.tsx +162 -0
- package/src/server/state-tree-diff.ts +85 -30
- package/src/server/static-generator.ts +680 -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 +343 -0
- package/src/server/tracing.ts +163 -68
- package/src/server/tree-match.ts +494 -0
- package/src/server/types.ts +96 -11
- package/src/server/utils/element-type.ts +88 -0
- package/src/server/utils/escape-html.ts +20 -0
- package/src/server/version-skew.ts +104 -0
- package/src/server/waituntil-bridge.ts +1 -1
- 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/csrf-reject.ts +15 -0
- package/src/shared/error-digest.ts +46 -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 +153 -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 +16 -0
- package/src/shared/rsc-manifest.ts +29 -0
- package/src/shared/rsc-media-type.ts +59 -0
- package/src/shared/rsc-payload-path.ts +52 -0
- package/src/shared/segment-info.ts +67 -0
- package/src/shared/slot-params.ts +109 -0
- package/src/shared/static-platform-files.ts +75 -0
- package/src/shared/status-reason-phrase.ts +61 -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-rsc.ts +47 -0
- package/src/shims/navigation.ts +10 -7
- package/src/utils/state-machine.ts +111 -0
- package/src/utils/write-file-atomic.ts +32 -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.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 +0 -88
- 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/types.d.ts +0 -14
- package/dist/client/types.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 +0 -92
- package/dist/client/use-params.d.ts.map +0 -1
- package/dist/content/index.d.ts +0 -11
- package/dist/content/index.d.ts.map +0 -1
- package/dist/content/index.js +0 -2
- package/dist/plugins/adapter-build.d.ts +0 -18
- package/dist/plugins/adapter-build.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.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/asset-headers.d.ts +0 -42
- package/dist/server/asset-headers.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/server/tree-builder.d.ts +0 -126
- package/dist/server/tree-builder.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/types.ts +0 -21
- package/src/client/use-navigation-pending.ts +0 -38
- package/src/client/use-params.ts +0 -141
- package/src/content/index.ts +0 -13
- package/src/plugins/adapter-build.ts +0 -118
- package/src/plugins/cache-transform.ts +0 -199
- 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/asset-headers.ts +0 -81
- 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/server/tree-builder.ts +0 -382
- package/src/shims/server-only-noop.js +0 -6
- package/src/utils/directive-parser.ts +0 -529
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `_rsc` payload cache key — derived identically on both sides.
|
|
3
|
+
*
|
|
4
|
+
* The client puts this in the payload URL so the document and its Flight
|
|
5
|
+
* payload occupy different cache keys (TIM-1268). The server recomputes it
|
|
6
|
+
* from the received headers so a request cannot claim one client's key while
|
|
7
|
+
* sending another client's headers — see `server/rsc-cache-key-guard.ts`.
|
|
8
|
+
* Both sides must agree exactly, which is why the derivation lives here and
|
|
9
|
+
* not in either one.
|
|
10
|
+
*
|
|
11
|
+
* Isomorphic: no server or client imports. The browser bundle audit
|
|
12
|
+
* (`tests/client-bundle-audit.test.ts`) enforces the client half of that.
|
|
13
|
+
*
|
|
14
|
+
* See design/19-client-navigation.md §"The `_rsc` cache key".
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Digest length in hex characters. 128 bits: the origin guard compares a
|
|
19
|
+
* caller-supplied key against a recomputed one, so the relevant bound is a
|
|
20
|
+
* birthday attack (an attacker who can influence a victim's `X-Timber-URL`
|
|
21
|
+
* gets to search both sides), not second preimage. 64 bits would fall to
|
|
22
|
+
* ~2^32 work; 128 puts it at 2^64.
|
|
23
|
+
*/
|
|
24
|
+
const KEY_HEX_LENGTH = 32;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Marks a value as a framework-issued key, and versions the derivation.
|
|
28
|
+
*
|
|
29
|
+
* Without it, an application value that happened to be 32 lowercase hex — an
|
|
30
|
+
* MD5, a token — is indistinguishable from a forged claim: both are "the
|
|
31
|
+
* right shape, the wrong digest", and no information in the value separates
|
|
32
|
+
* them. So the exemption cannot key on shape alone.
|
|
33
|
+
*
|
|
34
|
+
* The prefix resolves that because it is anchored to the address the
|
|
35
|
+
* victim's own client uses. A payload lives at `?_rsc=1.<digest>`, so
|
|
36
|
+
* anything aimed at that cache entry must carry the prefix and therefore
|
|
37
|
+
* gets validated; anything without it cannot be addressing a payload URL at
|
|
38
|
+
* all, and is exempt as application data. An attacker cannot both hit the
|
|
39
|
+
* victim's cache key and dodge the check.
|
|
40
|
+
*
|
|
41
|
+
* The version component also gives the derivation a migration path: the
|
|
42
|
+
* client and the origin must agree byte for byte, so a future change to the
|
|
43
|
+
* canonical form can be rolled out by bumping this instead of a flag day.
|
|
44
|
+
*/
|
|
45
|
+
const KEY_PREFIX = '1.';
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The request headers that vary an RSC payload response, in canonical
|
|
49
|
+
* casing — this list is also emitted verbatim as the response's `Vary`
|
|
50
|
+
* tokens (`server/pipeline.ts`), since "what varies the response" is one
|
|
51
|
+
* question with one answer, not two lists that happen to agree.
|
|
52
|
+
*
|
|
53
|
+
* This list is the contract, and it is enforced rather than trusted:
|
|
54
|
+
* `tests/rsc-cache-key.test.ts` asserts that the header names
|
|
55
|
+
* `buildRscHeaders()` can emit are exactly this set. A header added to the
|
|
56
|
+
* request without being added here fails that test, because a varying input
|
|
57
|
+
* outside the key is precisely the cache-poisoning hazard the key exists to
|
|
58
|
+
* close.
|
|
59
|
+
*
|
|
60
|
+
* **No credentials, session identifiers, or user-supplied content may be
|
|
61
|
+
* added.** Every value here is hashed into a URL, and URLs are logged by
|
|
62
|
+
* proxies, CDNs, and origin access logs. `fnv1aHash` is a cache-key hash,
|
|
63
|
+
* not a KDF — a low-entropy secret would be recoverable by brute force.
|
|
64
|
+
* Authentication travels on cookies, which never enter the key.
|
|
65
|
+
*/
|
|
66
|
+
export const RSC_KEY_HEADERS = [
|
|
67
|
+
'Accept',
|
|
68
|
+
'X-Timber-State-Tree',
|
|
69
|
+
'X-Timber-URL',
|
|
70
|
+
'X-Timber-Deployment-Id',
|
|
71
|
+
] as const;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Whether a value could be a key this module produced.
|
|
75
|
+
*
|
|
76
|
+
* `_rsc` is not a reserved parameter name — an application may already use
|
|
77
|
+
* it for its own search state, including for a value that happens to look
|
|
78
|
+
* like a digest. Anything without the `KEY_PREFIX` is therefore application
|
|
79
|
+
* data, not a claim on a payload cache key, and the origin guard leaves it
|
|
80
|
+
* alone rather than penalizing the response.
|
|
81
|
+
*
|
|
82
|
+
* Derived from `KEY_PREFIX` and `KEY_HEX_LENGTH` rather than spelled again,
|
|
83
|
+
* so the shape cannot drift from the digest that has to satisfy it.
|
|
84
|
+
*
|
|
85
|
+
* Ignoring a malformed value costs no protection: clients only ever send
|
|
86
|
+
* well-formed keys, so a URL bearing a malformed one is an address no
|
|
87
|
+
* legitimate request will ever ask for, and nothing can be poisoned at an
|
|
88
|
+
* address nobody reads.
|
|
89
|
+
*/
|
|
90
|
+
export function isRscCacheKeyShape(value: string): boolean {
|
|
91
|
+
if (!value.startsWith(KEY_PREFIX)) return false;
|
|
92
|
+
const digest = value.slice(KEY_PREFIX.length);
|
|
93
|
+
return digest.length === KEY_HEX_LENGTH && /^[0-9a-f]+$/.test(digest);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* The query parameter carrying the payload cache key.
|
|
98
|
+
*
|
|
99
|
+
* Spelled here rather than at each of the four places that read or write it
|
|
100
|
+
* — the client that appends it, the origin guard that validates it, and the
|
|
101
|
+
* strip below — because it is a wire contract between two independent
|
|
102
|
+
* implementations, exactly like the digest itself.
|
|
103
|
+
*/
|
|
104
|
+
export const RSC_KEY_PARAM = '_rsc';
|
|
105
|
+
|
|
106
|
+
// ─── Keeping the key out of application state ────────────────────────────
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Decode one raw `name` or `value` the way `URLSearchParams` does:
|
|
110
|
+
* `application/x-www-form-urlencoded`, so `+` is a space.
|
|
111
|
+
*
|
|
112
|
+
* Malformed percent-escapes throw in `decodeURIComponent`. `URLSearchParams`
|
|
113
|
+
* leaves those bytes as-is rather than throwing, and so do we — a pair we
|
|
114
|
+
* cannot decode is by definition not the framework's, so it is kept.
|
|
115
|
+
*/
|
|
116
|
+
function formDecode(raw: string): string {
|
|
117
|
+
try {
|
|
118
|
+
return decodeURIComponent(raw.replace(/\+/g, ' '));
|
|
119
|
+
} catch {
|
|
120
|
+
return raw;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Remove framework-issued `_rsc` values from a raw query string.
|
|
126
|
+
*
|
|
127
|
+
* Only values matching `isRscCacheKeyShape` are removed. `_rsc` is not a
|
|
128
|
+
* reserved name (see that function), so `/search?_rsc=foo` is application
|
|
129
|
+
* state and survives — the same exemption the origin guard applies, derived
|
|
130
|
+
* from the same predicate so the two cannot disagree about what "ours"
|
|
131
|
+
* means.
|
|
132
|
+
*
|
|
133
|
+
* Operates on the raw string rather than round-tripping through
|
|
134
|
+
* `URLSearchParams`, so every surviving pair keeps its original bytes.
|
|
135
|
+
* Re-serializing would rewrite `?b` as `?b=` and `?a=%7E` as `?a=~` on RSC
|
|
136
|
+
* navigations only, which is the same class of inconsistency this function
|
|
137
|
+
* exists to remove.
|
|
138
|
+
*
|
|
139
|
+
* Matching decodes the name, because `?%5Frsc=<key>` is a `_rsc` parameter
|
|
140
|
+
* as far as `URLSearchParams` is concerned — the same reasoning as the
|
|
141
|
+
* guard's fast path.
|
|
142
|
+
*
|
|
143
|
+
* @param search - `url.search`, with or without the leading `?`.
|
|
144
|
+
* @returns The query string including a leading `?`, or `''` if empty.
|
|
145
|
+
*/
|
|
146
|
+
export function stripRscCacheKey(search: string): string {
|
|
147
|
+
const query = search.startsWith('?') ? search.slice(1) : search;
|
|
148
|
+
if (query === '') return '';
|
|
149
|
+
const kept = query.split('&').filter((pair) => {
|
|
150
|
+
const eq = pair.indexOf('=');
|
|
151
|
+
if (formDecode(eq === -1 ? pair : pair.slice(0, eq)) !== RSC_KEY_PARAM) return true;
|
|
152
|
+
return !isRscCacheKeyShape(eq === -1 ? '' : formDecode(pair.slice(eq + 1)));
|
|
153
|
+
});
|
|
154
|
+
const result = kept.join('&');
|
|
155
|
+
return result === '' ? '' : `?${result}`;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** A request's search state as application code should see it. */
|
|
159
|
+
export interface AppVisibleSearch {
|
|
160
|
+
/** Parsed params, with the framework's cache key removed. */
|
|
161
|
+
params: URLSearchParams;
|
|
162
|
+
/** The matching raw query string — `''` or `?…`. */
|
|
163
|
+
search: string;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* The search state application code sees, for any request URL.
|
|
168
|
+
*
|
|
169
|
+
* The `_rsc` key rides on the payload URL of every RSC navigation and on no
|
|
170
|
+
* other request, so reading search params straight off `req.url` makes the
|
|
171
|
+
* same page observe different search state depending on whether it was
|
|
172
|
+
* reached by a full load or a client navigation — and lets the cache key
|
|
173
|
+
* leak into whatever the page builds from it: a canonical URL, a pagination
|
|
174
|
+
* link, an analytics payload (TIM-1272).
|
|
175
|
+
*
|
|
176
|
+
* Every application-facing derivation of search state goes through here.
|
|
177
|
+
* `params` and `search` are returned together, from one strip, because they
|
|
178
|
+
* are two views of one answer and were previously two expressions that had
|
|
179
|
+
* to agree.
|
|
180
|
+
*
|
|
181
|
+
* The raw request URL is deliberately untouched: `server/rsc-cache-key-guard.ts`
|
|
182
|
+
* still reads the parameter from `req.url` to bind the key to the request.
|
|
183
|
+
*/
|
|
184
|
+
export function appVisibleSearch(url: URL): AppVisibleSearch {
|
|
185
|
+
const search = stripRscCacheKey(url.search);
|
|
186
|
+
return { params: new URLSearchParams(search), search };
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Reads a header value by name. Must be case-insensitive — `Headers.get()`
|
|
191
|
+
* already is, and `recordLookup` below makes a plain record so.
|
|
192
|
+
*/
|
|
193
|
+
export type HeaderLookup = (name: string) => string | null | undefined;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Compute the `_rsc` cache key for a request.
|
|
197
|
+
*
|
|
198
|
+
* Absent headers are omitted rather than sent as empty, so "header missing"
|
|
199
|
+
* and "header present but empty" produce different keys.
|
|
200
|
+
*
|
|
201
|
+
* Values are length-prefixed rather than delimiter-separated. Any delimiter
|
|
202
|
+
* can be forged by a value that contains it: with a `\0` separator, an
|
|
203
|
+
* `accept` of `a\nx-timber-url\0b` serializes identically to an `accept` of
|
|
204
|
+
* `a` alongside an `x-timber-url` of `b`, which would let one header claim
|
|
205
|
+
* another's key. HTTP forbids control characters in header values and both
|
|
206
|
+
* `fetch()` and the server runtime reject them, so this is defense in depth
|
|
207
|
+
* — but a length prefix is unambiguous for *any* content, which is a
|
|
208
|
+
* property worth having in a function whose whole job is to be agreed on by
|
|
209
|
+
* two independent implementations.
|
|
210
|
+
*
|
|
211
|
+
* SHA-256, truncated to 128 bits. A fast non-cryptographic hash is the
|
|
212
|
+
* obvious choice for a cache key and is the wrong one here: the origin
|
|
213
|
+
* *compares* this value against a recomputed one, which makes it a check.
|
|
214
|
+
* FNV-1a — used for timber's other cache keys — is a multiply-xor over a
|
|
215
|
+
* fixed field, so an attacker controlling a few bytes of any input (their
|
|
216
|
+
* own `X-Timber-URL`, say) can solve for a chosen digest rather than search
|
|
217
|
+
* for one, and forge a key belonging to somebody else.
|
|
218
|
+
*
|
|
219
|
+
* Returns `null` when no digest is available — `crypto.subtle` is absent in
|
|
220
|
+
* non-secure browsing contexts (plain `http://` on a LAN address). Callers
|
|
221
|
+
* must treat that as "no key", never as "key matches": the client omits the
|
|
222
|
+
* parameter and the server refuses to share-cache. That returns those
|
|
223
|
+
* clients to the pre-TIM-1268 posture, where `Vary` alone separates HTML
|
|
224
|
+
* from Flight — acceptable, because a non-secure origin has no shared-CDN
|
|
225
|
+
* caching story to protect in the first place.
|
|
226
|
+
*/
|
|
227
|
+
export async function rscCacheKey(lookup: HeaderLookup): Promise<string | null> {
|
|
228
|
+
const subtle = globalThis.crypto?.subtle;
|
|
229
|
+
if (!subtle) return null;
|
|
230
|
+
let canonical = '';
|
|
231
|
+
for (const name of RSC_KEY_HEADERS) {
|
|
232
|
+
const value = lookup(name);
|
|
233
|
+
if (value == null) continue;
|
|
234
|
+
// Lowercased in the canonical form so the two implementations cannot
|
|
235
|
+
// disagree over the casing of the constant they share.
|
|
236
|
+
canonical += `${name.toLowerCase()}:${value.length}:${value}`;
|
|
237
|
+
}
|
|
238
|
+
const digest = await subtle.digest('SHA-256', new TextEncoder().encode(canonical));
|
|
239
|
+
let hex = '';
|
|
240
|
+
for (const byte of new Uint8Array(digest, 0, KEY_HEX_LENGTH / 2)) {
|
|
241
|
+
hex += byte.toString(16).padStart(2, '0');
|
|
242
|
+
}
|
|
243
|
+
return KEY_PREFIX + hex;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* An unverifiable stand-in key, for the one case where the digest cannot be
|
|
248
|
+
* computed: `crypto.subtle` is absent in non-secure browsing contexts.
|
|
249
|
+
* `crypto.getRandomValues` is not gated that way, so it is available exactly
|
|
250
|
+
* where the digest is not.
|
|
251
|
+
*
|
|
252
|
+
* Carries `KEY_PREFIX` like any other key, so the origin reads it as a claim
|
|
253
|
+
* it cannot verify — and refuses to share-cache the response — rather than
|
|
254
|
+
* exempting it as application data. Lives here so the prefix has one home.
|
|
255
|
+
*/
|
|
256
|
+
export function randomRscCacheKey(): string {
|
|
257
|
+
const bytes = new Uint8Array(KEY_HEX_LENGTH / 2);
|
|
258
|
+
globalThis.crypto.getRandomValues(bytes);
|
|
259
|
+
return KEY_PREFIX + [...bytes].map((b) => b.toString(16).padStart(2, '0')).join('');
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/** Build a case-insensitive lookup over a plain header record. */
|
|
263
|
+
export function recordLookup(headers: Record<string, string>): HeaderLookup {
|
|
264
|
+
const lowered: Record<string, string> = {};
|
|
265
|
+
for (const name of Object.keys(headers)) {
|
|
266
|
+
lowered[name.toLowerCase()] = headers[name];
|
|
267
|
+
}
|
|
268
|
+
return (name) => lowered[name.toLowerCase()];
|
|
269
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The hard-navigate error envelope shared by the server and the client router.
|
|
3
|
+
*
|
|
4
|
+
* A client-navigation (RSC) request cannot carry an error *page* — the response
|
|
5
|
+
* body must be Flight data or the decoder crashes. Instead the server answers
|
|
6
|
+
* with this envelope: an `X-Timber-Error: 1` header and a minimal JSON body.
|
|
7
|
+
* The client treats it as "give up on SPA navigation and hard-navigate", and
|
|
8
|
+
* the resulting document request renders the real error page as HTML.
|
|
9
|
+
*
|
|
10
|
+
* The header name lives here so the four server producers and the single
|
|
11
|
+
* client consumer cannot drift apart. See design/10-error-handling.md
|
|
12
|
+
* §"Error Page Rendering for Client Navigation".
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/** Header the client checks to decide whether to hard-navigate. */
|
|
16
|
+
export const TIMBER_ERROR_HEADER = 'X-Timber-Error';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The RSC manifest — the shape the static build writes and the client reads.
|
|
3
|
+
*
|
|
4
|
+
* In `output: 'static'` there is no server at navigation time and a generated
|
|
5
|
+
* `.rsc` file carries no response headers, so anything a navigation would
|
|
6
|
+
* normally learn from headers has to be inlined here at build time.
|
|
7
|
+
*
|
|
8
|
+
* Route params used to be such a thing (TIM-1255, TIM-1285). They are not any
|
|
9
|
+
* more: they ride inside the payload, on its root row, so the
|
|
10
|
+
* `.rsc` file carries them the same way it carries the tree, and the static
|
|
11
|
+
* path stopped needing a special case (TIM-1294). What is left is the content
|
|
12
|
+
* hash, which genuinely cannot live inside the file it names.
|
|
13
|
+
*
|
|
14
|
+
* Declared once rather than in each half. The producer
|
|
15
|
+
* (`plugins/static-build.ts`) and the consumer (`client/rsc-fetch.ts`) each
|
|
16
|
+
* had their own copy, and the copies drifted the moment a field was added to
|
|
17
|
+
* one — a static SPA navigation then committed `null` for the field the
|
|
18
|
+
* producer was faithfully writing.
|
|
19
|
+
*
|
|
20
|
+
* Isomorphic: no server, client, or build-time imports.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
export interface RscManifestEntry {
|
|
24
|
+
/** The content-hashed URL the payload actually lives at, in route space. */
|
|
25
|
+
url: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Keyed by the unhashed `/_rsc/*.rsc` path. */
|
|
29
|
+
export type RscManifest = Record<string, RscManifestEntry>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The RSC Flight media type, and the request predicate over it.
|
|
3
|
+
*
|
|
4
|
+
* One module owns the string because two independently-written spellings of
|
|
5
|
+
* "is this an RSC request?" must agree, and the consequence of them
|
|
6
|
+
* disagreeing is cache poisoning rather than a visible bug. The Cloudflare
|
|
7
|
+
* adapter's `isRsc` decides what may enter the edge cache; the origin's
|
|
8
|
+
* pipeline decides which headers may vary the response. TIM-1269 made the
|
|
9
|
+
* adapter's `VARY_HONORED` allowlist exempt `Accept` *because* `isRsc`
|
|
10
|
+
* excludes Flight responses from the cache, and exempt the `X-Timber-*`
|
|
11
|
+
* headers *because* the origin reads them only behind its own RSC check. If
|
|
12
|
+
* one predicate is ever tightened (a real media-type parse, a
|
|
13
|
+
* parameter-aware match) and the other is not, the adapter can classify a
|
|
14
|
+
* request as a document while the origin treats it as RSC, and store a
|
|
15
|
+
* Flight payload under the document's key — the class
|
|
16
|
+
* `design/48-payload-addressing.md` exists to prevent.
|
|
17
|
+
*
|
|
18
|
+
* `tests/rsc-media-type-single-source.test.ts` fails if the literal reappears
|
|
19
|
+
* in executable source outside this file.
|
|
20
|
+
*
|
|
21
|
+
* Isomorphic: zero imports, so `adapters/cloudflare.ts` — which Node's native
|
|
22
|
+
* ESM loader evaluates before Vite's resolver exists — can load it and
|
|
23
|
+
* interpolate the value into the generated worker. Same precedent as
|
|
24
|
+
* `shared/rsc-cache-key.ts`.
|
|
25
|
+
*
|
|
26
|
+
* See design/19-client-navigation.md, design/25-production-deployments.md
|
|
27
|
+
* §"`Vary` and the Workers Cache API".
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/** Media type of a React Flight payload. */
|
|
31
|
+
export const RSC_CONTENT_TYPE = 'text/x-component';
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Is this request asking for an RSC payload rather than a full document?
|
|
35
|
+
*
|
|
36
|
+
* Substring containment, deliberately: `Accept` is a list, and a client may
|
|
37
|
+
* send `text/x-component;charset=utf-8` or list it alongside other types.
|
|
38
|
+
* Tightening this to a real media-type parse is a behaviour change that has
|
|
39
|
+
* to move the adapter's generated `isRsc` in the same commit — see above.
|
|
40
|
+
*/
|
|
41
|
+
export function isRscRequest(req: Request): boolean {
|
|
42
|
+
return (req.headers.get('Accept') ?? '').includes(RSC_CONTENT_TYPE);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Does this Content-Type header value designate an RSC Flight payload?
|
|
47
|
+
*
|
|
48
|
+
* Case-insensitive exact media-type match per RFC 9110 §8.3.1 — media types
|
|
49
|
+
* are case-insensitive. Parameters (`;charset=utf-8`) are stripped before
|
|
50
|
+
* comparison.
|
|
51
|
+
*
|
|
52
|
+
* Contrast with `isRscRequest`, which uses substring containment because
|
|
53
|
+
* `Accept` is a list of types. A `Content-Type` header names exactly one
|
|
54
|
+
* type, so substring would over-match (e.g. `text/x-component-v2`).
|
|
55
|
+
*/
|
|
56
|
+
export function isRscContentType(contentType: string | null): boolean {
|
|
57
|
+
if (!contentType) return false;
|
|
58
|
+
return contentType.split(';')[0].trim().toLowerCase() === RSC_CONTENT_TYPE;
|
|
59
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a route's Flight payload lives in `output: 'static'`.
|
|
3
|
+
*
|
|
4
|
+
* The static build writes these files and the client fetches them, so the two
|
|
5
|
+
* halves must agree byte for byte. They used to state the naming rule
|
|
6
|
+
* separately — `plugins/static-build.ts` for the write and
|
|
7
|
+
* `client/rsc-fetch.ts` for the read — which is a duplicate representation with
|
|
8
|
+
* nothing checking it. One function now, called by both.
|
|
9
|
+
*
|
|
10
|
+
* ## The shape
|
|
11
|
+
*
|
|
12
|
+
* The payload path mirrors the HTML path: every route gets a directory and the
|
|
13
|
+
* artifact is the `index` inside it.
|
|
14
|
+
*
|
|
15
|
+
* / → /_rsc/index.rsc (cf. index.html)
|
|
16
|
+
* /about → /_rsc/about/index.rsc (cf. about/index.html)
|
|
17
|
+
* /blog/hello → /_rsc/blog/hello/index.rsc
|
|
18
|
+
*
|
|
19
|
+
* That shape is **injective**, which the previous one (`/about` →
|
|
20
|
+
* `/_rsc/about.rsc`, root → `/_rsc/index.rsc`) was not: a site with both `/`
|
|
21
|
+
* and `/index` produced two payloads at `_rsc/index.rsc`, and the second write
|
|
22
|
+
* won silently — a client navigation to one route was served the other route's
|
|
23
|
+
* payload, same content type and same shape, undetectable downstream
|
|
24
|
+
* (TIM-1266).
|
|
25
|
+
*
|
|
26
|
+
* Injectivity holds because two distinct non-root routes give distinct
|
|
27
|
+
* directories, and the root's `/_rsc/index.rsc` has no directory component for
|
|
28
|
+
* a non-root route to occupy — reaching it would need an empty route path,
|
|
29
|
+
* which is not a route.
|
|
30
|
+
*
|
|
31
|
+
* Isomorphic: no server, client, or build-time imports.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The route-space path of a route's static Flight payload.
|
|
36
|
+
*
|
|
37
|
+
* @param routePath A route-space pathname: leading slash, no deployment base,
|
|
38
|
+
* no query or fragment, no trailing slash (except the root `/`). Callers
|
|
39
|
+
* normalize; this function does not, because the two callers normalize from
|
|
40
|
+
* different sources (a browser URL, a build-time route entry).
|
|
41
|
+
*/
|
|
42
|
+
/**
|
|
43
|
+
* The directory, relative to the site root, that holds every static RSC
|
|
44
|
+
* payload. The one spelling: the build writes, hashes, and reports it as
|
|
45
|
+
* content-hashed from here.
|
|
46
|
+
*/
|
|
47
|
+
export const RSC_PAYLOAD_DIR = '_rsc';
|
|
48
|
+
|
|
49
|
+
export function rscPayloadPath(routePath: string): string {
|
|
50
|
+
const prefix = routePath === '/' ? '' : routePath;
|
|
51
|
+
return `/${RSC_PAYLOAD_DIR}${prefix}/index.rsc`;
|
|
52
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The segment metadata wire contract between server and client.
|
|
3
|
+
*
|
|
4
|
+
* One declaration, imported by both ends. The producer
|
|
5
|
+
* (`server/rsc-entry/helpers.ts` → `X-Timber-Segments` and the
|
|
6
|
+
* `self.__timber_segments` bootstrap script) and the consumers
|
|
7
|
+
* (`client/segment-cache.ts`, the history stack, the prefetch cache) used to
|
|
8
|
+
* declare this shape separately, which is how a field gets added to one side
|
|
9
|
+
* only.
|
|
10
|
+
*
|
|
11
|
+
* See design/19-client-navigation.md §"X-Timber-State-Tree Header"
|
|
12
|
+
* See design/07-routing.md §"Intercepting Routes"
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Metadata for one rendered segment or slot, sent via `X-Timber-Segments`.
|
|
17
|
+
*/
|
|
18
|
+
export interface SegmentInfo {
|
|
19
|
+
/** The segment's URL path (e.g. `/`, `/feed`), or the slot key for slots. */
|
|
20
|
+
path: string;
|
|
21
|
+
/** Outlet key — includes route group name when applicable (e.g. `/(marketing)`). */
|
|
22
|
+
segmentId?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The segment's directory path in `app/`, groups included and slots elided
|
|
25
|
+
* (e.g. `app/(browse)/feed` → `/(browse)/feed`). Absent on slot entries.
|
|
26
|
+
*
|
|
27
|
+
* This is the identity interception scoping compares against, and it is the
|
|
28
|
+
* reason it travels: `path`/`segmentId` are URL-addressed and collapse
|
|
29
|
+
* `(browse)/feed` and `(landing)/feed` to the same key, while a scope has to
|
|
30
|
+
* tell those two directories apart. See `computeSegmentTreePaths`.
|
|
31
|
+
*/
|
|
32
|
+
treePath?: string;
|
|
33
|
+
isRequestDependent: boolean;
|
|
34
|
+
/** True for parallel route slot entries, keyed by slot path (e.g. `/@sidebar`). */
|
|
35
|
+
slot?: boolean;
|
|
36
|
+
/** Parent segment path for slot entries — attaches the slot to its SegmentNode. */
|
|
37
|
+
parentSegment?: string;
|
|
38
|
+
/** True when the slot's access.ts denied on this render. Denied slots are excluded from the state tree. */
|
|
39
|
+
denied?: boolean;
|
|
40
|
+
/** True when the slot was skipped (cached content reused). Payloads with skipped slots are not replayable. */
|
|
41
|
+
skipped?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Content key for slot entries — encodes owner parts, slot name, matched
|
|
44
|
+
* entry file, and slot params. The client stores and advertises this key;
|
|
45
|
+
* the server computes the destination key and checks membership.
|
|
46
|
+
* Replaces URL-based departing/destination diffing (TIM-1370).
|
|
47
|
+
*/
|
|
48
|
+
contentKey?: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The client's `X-Timber-State-Tree` request header.
|
|
53
|
+
*
|
|
54
|
+
* `segments` and `slots` are a caching optimization — they tell the server what
|
|
55
|
+
* the client can reuse. `treePaths` is not: it describes the *shape* of the
|
|
56
|
+
* tree currently on screen, so the server can answer "does the rendered route
|
|
57
|
+
* pass through the segment that owns this intercepting slot?" without
|
|
58
|
+
* re-deriving it from the address bar, which stops being the source route the
|
|
59
|
+
* moment a modal is open (TIM-1282).
|
|
60
|
+
*
|
|
61
|
+
* None of the three is a security input. Every `access.ts` runs regardless.
|
|
62
|
+
*/
|
|
63
|
+
export interface StateTree {
|
|
64
|
+
segments: string[];
|
|
65
|
+
slots?: string[];
|
|
66
|
+
treePaths?: string[];
|
|
67
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-slot segment params — the one definition both halves of the API read.
|
|
3
|
+
*
|
|
4
|
+
* A parallel slot matches the URL through its *own* sub-tree, so it can derive
|
|
5
|
+
* a param the main route never had, or derive the same name with a different
|
|
6
|
+
* type (`[...year]` → `string[]` where the main route's `[year]` gave
|
|
7
|
+
* `string`). The server answers `getSegmentParams(slotPath)` from a per-slot
|
|
8
|
+
* map; the client answers `useSegmentParams(slotPath)` from the same map,
|
|
9
|
+
* published on the RSC payload (TIM-1285).
|
|
10
|
+
*
|
|
11
|
+
* The merge lives here rather than in either half because the two must agree
|
|
12
|
+
* about what "the slot's params" are — a divergence is invisible until
|
|
13
|
+
* somebody reads a param of the wrong type, which is exactly the class of bug
|
|
14
|
+
* this module closes.
|
|
15
|
+
*
|
|
16
|
+
* Isomorphic: no server or client imports.
|
|
17
|
+
*
|
|
18
|
+
* See design/41-global-params.md §"Params in a parallel slot".
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import type { CoercedParams } from './param-value.ts';
|
|
22
|
+
|
|
23
|
+
/** Slot tree path → that slot's own coerced params. */
|
|
24
|
+
export type SlotParamsRecord = Record<string, CoercedParams>;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The params a slot sees: the main route's as a base, the slot's own on top.
|
|
28
|
+
*
|
|
29
|
+
* Params from segments *above* the slot are not re-derived by the slot's own
|
|
30
|
+
* chain, so they have to come from the main route; params the slot does
|
|
31
|
+
* re-derive may have a different type than the main route gave them, so the
|
|
32
|
+
* slot's win.
|
|
33
|
+
*
|
|
34
|
+
* Null-prototype, like every other param record the framework hands out
|
|
35
|
+
* (`coerceSegmentParams` installs one unconditionally). A spread literal would
|
|
36
|
+
* inherit `Object.prototype`, so a lookup for a param the route does not
|
|
37
|
+
* define would resolve to an inherited member — `params.constructor` returning
|
|
38
|
+
* a function instead of `undefined` — in the one param record that was built
|
|
39
|
+
* by merging. See design/13-security.md #36c.
|
|
40
|
+
*/
|
|
41
|
+
export function mergeSlotParams(
|
|
42
|
+
mainParams: CoercedParams,
|
|
43
|
+
slotParams: CoercedParams
|
|
44
|
+
): CoercedParams {
|
|
45
|
+
return Object.assign(Object.create(null), mainParams, slotParams);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Resolve the params for a segment path against a published slot map.
|
|
50
|
+
*
|
|
51
|
+
* Returns the merge when `segmentPath` names a slot that published params,
|
|
52
|
+
* and the main route's record otherwise — an ordinary (non-slot) segment
|
|
53
|
+
* path, an unknown path, or a request with no slots at all. Mirrors the
|
|
54
|
+
* server's `getSegmentParams(segmentPath)` branch exactly.
|
|
55
|
+
*
|
|
56
|
+
* `Object.hasOwn` rather than `in` or a truthiness test: the map arrives from
|
|
57
|
+
* JSON, so a segment path of `constructor` or `toString` would otherwise
|
|
58
|
+
* resolve to an inherited member of `Object.prototype`.
|
|
59
|
+
*/
|
|
60
|
+
export function resolveSegmentParams(
|
|
61
|
+
mainParams: CoercedParams,
|
|
62
|
+
slotParams: SlotParamsRecord | null | undefined,
|
|
63
|
+
segmentPath: string | undefined
|
|
64
|
+
): CoercedParams {
|
|
65
|
+
if (!segmentPath || !slotParams || !Object.hasOwn(slotParams, segmentPath)) return mainParams;
|
|
66
|
+
return cachedMerge(mainParams, slotParams, segmentPath);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The merged record for one (main record, slot map, path) triple, reused until
|
|
71
|
+
* one of the three changes.
|
|
72
|
+
*
|
|
73
|
+
* `useSegmentParams(slotPath)` calls this on every render. Returning a fresh
|
|
74
|
+
* object each time makes the hook's result change by reference on renders where
|
|
75
|
+
* nothing navigated, so a component using it as a `useEffect` dependency
|
|
76
|
+
* re-runs the effect — and re-renders in a loop if that effect sets state —
|
|
77
|
+
* while memoized children below it lose their memoization.
|
|
78
|
+
*
|
|
79
|
+
* Keyed on the *identities* of the two records, not their contents: both are
|
|
80
|
+
* replaced rather than mutated on every navigation (`ParamsProvider`'s memoized
|
|
81
|
+
* value and the server's per-request store), so identity is the correct
|
|
82
|
+
* equality here and a deep comparison would be slower and no more accurate.
|
|
83
|
+
*
|
|
84
|
+
* A `WeakMap` chain rather than a `Map`, so a superseded navigation's records
|
|
85
|
+
* and their merges become collectable as soon as nothing else holds them.
|
|
86
|
+
*/
|
|
87
|
+
const mergeCache = new WeakMap<object, WeakMap<object, Map<string, CoercedParams>>>();
|
|
88
|
+
|
|
89
|
+
function cachedMerge(
|
|
90
|
+
mainParams: CoercedParams,
|
|
91
|
+
slotParams: SlotParamsRecord,
|
|
92
|
+
segmentPath: string
|
|
93
|
+
): CoercedParams {
|
|
94
|
+
let bySlotMap = mergeCache.get(mainParams);
|
|
95
|
+
if (!bySlotMap) {
|
|
96
|
+
bySlotMap = new WeakMap();
|
|
97
|
+
mergeCache.set(mainParams, bySlotMap);
|
|
98
|
+
}
|
|
99
|
+
let byPath = bySlotMap.get(slotParams);
|
|
100
|
+
if (!byPath) {
|
|
101
|
+
byPath = new Map();
|
|
102
|
+
bySlotMap.set(slotParams, byPath);
|
|
103
|
+
}
|
|
104
|
+
const cached = byPath.get(segmentPath);
|
|
105
|
+
if (cached) return cached;
|
|
106
|
+
const merged = mergeSlotParams(mainParams, slotParams[segmentPath]);
|
|
107
|
+
byPath.set(segmentPath, merged);
|
|
108
|
+
return merged;
|
|
109
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform files the static build is allowed to overwrite in the output.
|
|
3
|
+
*
|
|
4
|
+
* The build merges two trees into the deployed directory — the client bundle
|
|
5
|
+
* (which carries everything the user put in `public/`) and the pre-rendered
|
|
6
|
+
* site. That merge otherwise refuses overlaps, because a silent overwrite
|
|
7
|
+
* leaves one of two artifacts deployed with nothing recording which
|
|
8
|
+
* (TIM-1266).
|
|
9
|
+
*
|
|
10
|
+
* These names are the exception, and only because the pre-rendered copy is
|
|
11
|
+
* *derived from* the one it replaces rather than competing with it:
|
|
12
|
+
* `plugins/static-build.ts` reads `public/_redirects` and writes the
|
|
13
|
+
* generated rules plus the user's, so the winner is a superset of the loser.
|
|
14
|
+
*
|
|
15
|
+
* That holds only for a file the current pass produced, which is why
|
|
16
|
+
* `cleanConditionalArtifacts` deletes a previous build's `_redirects` before
|
|
17
|
+
* generation: written only when a pass finds redirects, it would otherwise
|
|
18
|
+
* survive into a pass that produced nothing and claim an exemption it no
|
|
19
|
+
* longer earns.
|
|
20
|
+
*
|
|
21
|
+
* `_headers` is NOT here. It is not written into the pre-rendered tree at
|
|
22
|
+
* all — adapters generate it directly into the output, folding in the
|
|
23
|
+
* user's copy as they go (TIM-1326).
|
|
24
|
+
*
|
|
25
|
+
* Declared once so the code that performs the merge and the code that
|
|
26
|
+
* produces the merged file cannot disagree about which names are exempt.
|
|
27
|
+
*
|
|
28
|
+
* Isomorphic: no server, client, or build-time imports.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/** Platform redirect rules (Cloudflare Pages, Netlify). See TIM-1245/TIM-1249. */
|
|
32
|
+
export const REDIRECTS_FILE = '_redirects';
|
|
33
|
+
|
|
34
|
+
/** Platform header rules (Cloudflare Pages, Netlify). See TIM-1241/TIM-1326. */
|
|
35
|
+
export const HEADERS_FILE = '_headers';
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Where a user authors platform files. Stated once because two modules read
|
|
39
|
+
* from here — `plugins/static-build.ts` for `_redirects`, adapters for
|
|
40
|
+
* `_headers` — and they must look in the same place.
|
|
41
|
+
*
|
|
42
|
+
* Both read the **project source**, never the build output. The generated
|
|
43
|
+
* file lands under the same name in the output directory, so a reader aimed
|
|
44
|
+
* there would fold the previous build's generated rules back in and compound
|
|
45
|
+
* them on every rebuild.
|
|
46
|
+
*/
|
|
47
|
+
export const USER_PLATFORM_DIR = 'public';
|
|
48
|
+
|
|
49
|
+
/** Output-relative paths whose pre-rendered copy subsumes the `public/` one. */
|
|
50
|
+
export const USER_MERGED_PLATFORM_FILES: readonly string[] = [REDIRECTS_FILE];
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Output paths the framework writes itself, which no route may claim.
|
|
54
|
+
*
|
|
55
|
+
* These are written outside the per-entry writer — `_redirects` after
|
|
56
|
+
* generation, `_headers` by the adapter after the copy — so the collision
|
|
57
|
+
* tracker never sees them and a route rendering to one of these paths is
|
|
58
|
+
* overwritten with nothing recording it.
|
|
59
|
+
*
|
|
60
|
+
* Reserved rather than tracked, because there is no version of "serve a route
|
|
61
|
+
* at `/_headers`" that works: Cloudflare Pages and Netlify read these two
|
|
62
|
+
* files themselves and never serve them, so the route is unservable however
|
|
63
|
+
* the conflict is resolved.
|
|
64
|
+
*
|
|
65
|
+
* That justification is per-file, not per-mechanism. `.nojekyll` is written
|
|
66
|
+
* the same way and is deliberately NOT here: only the `github-pages` target
|
|
67
|
+
* writes it, and everywhere else `/.nojekyll` is an ordinary servable path,
|
|
68
|
+
* so reserving it globally would refuse a valid Cloudflare site. Its write
|
|
69
|
+
* site skips the write when a file is already there instead — GitHub Pages
|
|
70
|
+
* only cares that the file exists.
|
|
71
|
+
*
|
|
72
|
+
* Same reasoning as the synthetic 404 entry using an internal urlPath so a
|
|
73
|
+
* real `/404` route cannot collide with `404.html`.
|
|
74
|
+
*/
|
|
75
|
+
export const RESERVED_OUTPUT_PATHS: readonly string[] = [REDIRECTS_FILE, HEADERS_FILE];
|