@timber-js/app 0.2.0-alpha.240 → 0.2.0-alpha.242

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.
Files changed (408) hide show
  1. package/dist/_chunks/{actions-DIgnvDrG.js → actions-BkwgRwCl.js} +146 -12
  2. package/dist/_chunks/actions-BkwgRwCl.js.map +1 -0
  3. package/dist/_chunks/{als-registry-PPYstxK0.js → als-registry-C-iwbtvI.js} +4 -3
  4. package/dist/_chunks/{als-registry-PPYstxK0.js.map → als-registry-C-iwbtvI.js.map} +1 -1
  5. package/dist/_chunks/{als-slots-kbQrHTzm.js → als-slots-CVTF-AMz.js} +3 -3
  6. package/dist/_chunks/als-slots-CVTF-AMz.js.map +1 -0
  7. package/dist/_chunks/{cache-api-uWQwuxWb.js → cache-api-BGA7c5qJ.js} +5 -5
  8. package/dist/_chunks/{cache-api-uWQwuxWb.js.map → cache-api-BGA7c5qJ.js.map} +1 -1
  9. package/dist/_chunks/{chains-C7CExrUI.js → chains-Cuwwjv6T.js} +2 -2
  10. package/dist/_chunks/{chains-C7CExrUI.js.map → chains-Cuwwjv6T.js.map} +1 -1
  11. package/dist/_chunks/chains-LGjBHfSN.js +1 -0
  12. package/dist/_chunks/{classify-Cj9EeZoL.js → classify-Y8S9C0Na.js} +2 -2
  13. package/dist/_chunks/{classify-Cj9EeZoL.js.map → classify-Y8S9C0Na.js.map} +1 -1
  14. package/dist/_chunks/{cli-check-C3QOAru7.js → cli-check-KeE1QaIx.js} +7 -6
  15. package/dist/_chunks/cli-check-KeE1QaIx.js.map +1 -0
  16. package/dist/_chunks/{cli-schema-sync-DQUS_o3V.js → cli-schema-sync-DZEF31wd.js} +2 -2
  17. package/dist/_chunks/{cli-schema-sync-DQUS_o3V.js.map → cli-schema-sync-DZEF31wd.js.map} +1 -1
  18. package/dist/_chunks/{cli-schema-sync-BRxZz66D.js → cli-schema-sync-_y5O6MIg.js} +1 -1
  19. package/dist/_chunks/{client-dep-entries-ZETBdLgv.js → client-dep-entries-DpiwvoDi.js} +2 -2
  20. package/dist/_chunks/{client-dep-entries-ZETBdLgv.js.map → client-dep-entries-DpiwvoDi.js.map} +1 -1
  21. package/dist/_chunks/{cloudflare-Dk5Hqo-O.js → cloudflare-9dbhVOxS.js} +2 -2
  22. package/dist/_chunks/{cloudflare-Dk5Hqo-O.js.map → cloudflare-9dbhVOxS.js.map} +1 -1
  23. package/dist/_chunks/{convention-lint-BoVISNS6.js → convention-lint-0AEsPK2T.js} +378 -10
  24. package/dist/_chunks/convention-lint-0AEsPK2T.js.map +1 -0
  25. package/dist/_chunks/dev-server-CboXr8zX.js +1 -0
  26. package/dist/_chunks/{dev-server-C5R6jx8Q.js → dev-server-DYDr8KIc.js} +9 -3
  27. package/dist/_chunks/dev-server-DYDr8KIc.js.map +1 -0
  28. package/dist/_chunks/{dist-C1Rjlo6s.js → dist-GyaJm4GA.js} +18 -2
  29. package/dist/_chunks/dist-GyaJm4GA.js.map +1 -0
  30. package/dist/_chunks/{error-boundary-DB51f9ih.js → error-boundary-wuNvAJ4n.js} +11 -14
  31. package/dist/_chunks/error-boundary-wuNvAJ4n.js.map +1 -0
  32. package/dist/_chunks/{flight-source-node-D9cHBhjP.js → flight-source-node-KQsX_OhS.js} +4 -7
  33. package/dist/_chunks/flight-source-node-KQsX_OhS.js.map +1 -0
  34. package/dist/_chunks/{json-lossy-check-Y1GxqVX_.js → json-lossy-check-BVDALqMf.js} +2 -2
  35. package/dist/_chunks/{json-lossy-check-Y1GxqVX_.js.map → json-lossy-check-BVDALqMf.js.map} +1 -1
  36. package/dist/_chunks/key-headers-uIig1_mU.js +40 -0
  37. package/dist/_chunks/key-headers-uIig1_mU.js.map +1 -0
  38. package/dist/_chunks/{live-graph-BDQWvnMm.js → live-graph-VhzO7Ol9.js} +4 -4
  39. package/dist/_chunks/{live-graph-BDQWvnMm.js.map → live-graph-VhzO7Ol9.js.map} +1 -1
  40. package/dist/_chunks/{logger-DmRR9tmZ.js → logger-C4m8rfMy.js} +2 -2
  41. package/dist/_chunks/{logger-DmRR9tmZ.js.map → logger-C4m8rfMy.js.map} +1 -1
  42. package/dist/_chunks/metadata-routes-MXNjWOt5.js.map +1 -1
  43. package/dist/_chunks/{node-response-yp8zdyRp.js → node-response-8Vz29cGS.js} +2 -2
  44. package/dist/_chunks/{node-response-yp8zdyRp.js.map → node-response-8Vz29cGS.js.map} +1 -1
  45. package/dist/_chunks/{poison-scan-WQgUydF_.js → poison-scan-Dpl3ibG-.js} +2 -2
  46. package/dist/_chunks/{poison-scan-WQgUydF_.js.map → poison-scan-Dpl3ibG-.js.map} +1 -1
  47. package/dist/_chunks/{rsc-cache-key-D0cb0Gmc.js → rsc-cache-key-BGvUtMtN.js} +40 -4
  48. package/dist/_chunks/{rsc-cache-key-D0cb0Gmc.js.map → rsc-cache-key-BGvUtMtN.js.map} +1 -1
  49. package/dist/_chunks/{scanner-C9Lrf77z.js → scanner-CCEHN9Jg.js} +14 -81
  50. package/dist/_chunks/scanner-CCEHN9Jg.js.map +1 -0
  51. package/dist/_chunks/{sizeof-BISkSaU0.js → sizeof-CIF7fwSJ.js} +2 -2
  52. package/dist/_chunks/{sizeof-BISkSaU0.js.map → sizeof-CIF7fwSJ.js.map} +1 -1
  53. package/dist/_chunks/{walkers-Bxv4v7tX.js → walkers-BbotBhNG.js} +3 -3
  54. package/dist/_chunks/{walkers-Bxv4v7tX.js.map → walkers-BbotBhNG.js.map} +1 -1
  55. package/dist/adapters/cloudflare-dev.js +1 -1
  56. package/dist/adapters/cloudflare-kv-cache.js +2 -2
  57. package/dist/adapters/cloudflare.js +1 -1
  58. package/dist/analyze/crawl-entry.js +3 -3
  59. package/dist/analyze/graph-command.js +2 -2
  60. package/dist/cache/index.js +2 -2
  61. package/dist/cache/stores/memory.js +1 -1
  62. package/dist/cdn/workers-cache-purge.js +1 -1
  63. package/dist/cli-check.d.ts +3 -0
  64. package/dist/cli-check.d.ts.map +1 -1
  65. package/dist/cli.js +3 -3
  66. package/dist/client/browser-entry/router-init.d.ts +0 -1
  67. package/dist/client/browser-entry/router-init.d.ts.map +1 -1
  68. package/dist/client/error-boundary.js +1 -1
  69. package/dist/client/index.js +2 -2
  70. package/dist/client/index.js.map +1 -1
  71. package/dist/client/internal.js +4 -5
  72. package/dist/client/internal.js.map +1 -1
  73. package/dist/client/navigation-commit.d.ts +3 -5
  74. package/dist/client/navigation-commit.d.ts.map +1 -1
  75. package/dist/client/outlet-content-cache.d.ts +25 -30
  76. package/dist/client/outlet-content-cache.d.ts.map +1 -1
  77. package/dist/client/outlet-scope-context.d.ts +4 -4
  78. package/dist/client/outlet-scope-context.d.ts.map +1 -1
  79. package/dist/client/params-context.d.ts +1 -1
  80. package/dist/client/router-types.d.ts +3 -13
  81. package/dist/client/router-types.d.ts.map +1 -1
  82. package/dist/client/router.d.ts.map +1 -1
  83. package/dist/client/segment-cache.d.ts +2 -2
  84. package/dist/client/segment-outlet.d.ts +12 -13
  85. package/dist/client/segment-outlet.d.ts.map +1 -1
  86. package/dist/client/stale-segment.d.ts +2 -2
  87. package/dist/config-types.d.ts +22 -15
  88. package/dist/config-types.d.ts.map +1 -1
  89. package/dist/config-validation.d.ts.map +1 -1
  90. package/dist/cookies/define-cookie.d.ts.map +1 -1
  91. package/dist/cookies/index.js +5 -2
  92. package/dist/cookies/index.js.map +1 -1
  93. package/dist/index.d.ts +1 -0
  94. package/dist/index.d.ts.map +1 -1
  95. package/dist/index.js +109 -26
  96. package/dist/index.js.map +1 -1
  97. package/dist/native/rsc/cookies/define-cookie.js +6 -2
  98. package/dist/native/rsc/cookies/define-cookie.js.map +1 -1
  99. package/dist/native/rsc/manifest.json +12 -4
  100. package/dist/native/rsc/routing/segment-keys.js +11 -1
  101. package/dist/native/rsc/routing/segment-keys.js.map +1 -1
  102. package/dist/native/rsc/search-params/define.js +4 -1
  103. package/dist/native/rsc/search-params/define.js.map +1 -1
  104. package/dist/native/rsc/server/als-registry.js +2 -2
  105. package/dist/native/rsc/server/als-registry.js.map +1 -1
  106. package/dist/native/rsc/server/client-state-tree.js +13 -12
  107. package/dist/native/rsc/server/client-state-tree.js.map +1 -1
  108. package/dist/native/rsc/server/cookie-context.js +12 -0
  109. package/dist/native/rsc/server/cookie-context.js.map +1 -1
  110. package/dist/native/rsc/server/flight-source-node.js +2 -5
  111. package/dist/native/rsc/server/flight-source-node.js.map +1 -1
  112. package/dist/native/rsc/server/flight-source.js +8 -40
  113. package/dist/native/rsc/server/flight-source.js.map +1 -1
  114. package/dist/native/rsc/server/framework-stack-frames.js +18 -0
  115. package/dist/native/rsc/server/framework-stack-frames.js.map +1 -0
  116. package/dist/native/rsc/server/prebuilt-builder.js +15 -1
  117. package/dist/native/rsc/server/prebuilt-builder.js.map +1 -1
  118. package/dist/native/rsc/server/request-context.js +11 -5
  119. package/dist/native/rsc/server/request-context.js.map +1 -1
  120. package/dist/native/rsc/server/route-element-builder.js +29 -11
  121. package/dist/native/rsc/server/route-element-builder.js.map +1 -1
  122. package/dist/native/rsc/server/route-module-loader.js +14 -6
  123. package/dist/native/rsc/server/route-module-loader.js.map +1 -1
  124. package/dist/native/rsc/server/rsc-cache-key-guard.js +5 -1
  125. package/dist/native/rsc/server/rsc-cache-key-guard.js.map +1 -1
  126. package/dist/native/rsc/server/rsc-entry/render-route.js +10 -29
  127. package/dist/native/rsc/server/rsc-entry/render-route.js.map +1 -1
  128. package/dist/native/rsc/server/rsc-entry/revalidate-renderer.js +7 -2
  129. package/dist/native/rsc/server/rsc-entry/revalidate-renderer.js.map +1 -1
  130. package/dist/native/rsc/server/rsc-entry/rsc-stream.js +2 -5
  131. package/dist/native/rsc/server/rsc-entry/rsc-stream.js.map +1 -1
  132. package/dist/native/rsc/server/segment-lifetime/document-outlet.js +24 -0
  133. package/dist/native/rsc/server/segment-lifetime/document-outlet.js.map +1 -0
  134. package/dist/native/rsc/server/segment-lifetime/key-digest.js +74 -0
  135. package/dist/native/rsc/server/segment-lifetime/key-digest.js.map +1 -0
  136. package/dist/native/rsc/server/segment-lifetime/outlet-gate.js +44 -0
  137. package/dist/native/rsc/server/segment-lifetime/outlet-gate.js.map +1 -0
  138. package/dist/native/rsc/server/segment-lifetime/read-rule.js +78 -0
  139. package/dist/native/rsc/server/segment-lifetime/read-rule.js.map +1 -0
  140. package/dist/native/rsc/server/segment-lifetime/read-scope.js +41 -0
  141. package/dist/native/rsc/server/segment-lifetime/read-scope.js.map +1 -0
  142. package/dist/native/rsc/server/segment-lifetime/segment-key.js +64 -0
  143. package/dist/native/rsc/server/segment-lifetime/segment-key.js.map +1 -0
  144. package/dist/native/rsc/server/segment-lifetime/slot-outlets.js +72 -0
  145. package/dist/native/rsc/server/segment-lifetime/slot-outlets.js.map +1 -0
  146. package/dist/native/rsc/server/slot-resolver.js +51 -27
  147. package/dist/native/rsc/server/slot-resolver.js.map +1 -1
  148. package/dist/native/rsc/server/slot-subtree-contain.js +17 -89
  149. package/dist/native/rsc/server/slot-subtree-contain.js.map +1 -1
  150. package/dist/native/rsc/server/subtree-walk.js +140 -0
  151. package/dist/native/rsc/server/subtree-walk.js.map +1 -0
  152. package/dist/native/rsc/server/vite-handoff-rsc.js.map +1 -1
  153. package/dist/native/rsc/shared/als-slots.js +2 -2
  154. package/dist/native/rsc/shared/als-slots.js.map +1 -1
  155. package/dist/native/rsc/shared/cookie-read-through.js +5 -0
  156. package/dist/native/rsc/shared/cookie-read-through.js.map +1 -0
  157. package/dist/native/rsc/shared/key-headers.js +20 -0
  158. package/dist/native/rsc/shared/key-headers.js.map +1 -0
  159. package/dist/native/rsc/shared/outlet-decision.js.map +1 -1
  160. package/dist/native/rsc/shared/route-options-export.js +8 -0
  161. package/dist/native/rsc/shared/route-options-export.js.map +1 -0
  162. package/dist/native/rsc/shared/rsc-cache-key.js +19 -3
  163. package/dist/native/rsc/shared/rsc-cache-key.js.map +1 -1
  164. package/dist/native/rsc/shims/headers.js +3 -4
  165. package/dist/native/rsc/shims/headers.js.map +1 -1
  166. package/dist/native/ssr/client/outlet-content-cache.js +12 -18
  167. package/dist/native/ssr/client/outlet-content-cache.js.map +1 -1
  168. package/dist/native/ssr/client/outlet-scope-context.js.map +1 -1
  169. package/dist/native/ssr/client/segment-outlet.js +6 -19
  170. package/dist/native/ssr/client/segment-outlet.js.map +1 -1
  171. package/dist/native/ssr/cookies/define-cookie.js +6 -2
  172. package/dist/native/ssr/cookies/define-cookie.js.map +1 -1
  173. package/dist/native/ssr/manifest.json +5 -1
  174. package/dist/native/ssr/search-params/define.js +4 -1
  175. package/dist/native/ssr/search-params/define.js.map +1 -1
  176. package/dist/native/ssr/server/als-registry.js +2 -2
  177. package/dist/native/ssr/server/als-registry.js.map +1 -1
  178. package/dist/native/ssr/server/client-state-tree.js +13 -12
  179. package/dist/native/ssr/server/client-state-tree.js.map +1 -1
  180. package/dist/native/ssr/server/cookie-context.js +12 -0
  181. package/dist/native/ssr/server/cookie-context.js.map +1 -1
  182. package/dist/native/ssr/server/flight-source-node.js +2 -5
  183. package/dist/native/ssr/server/flight-source-node.js.map +1 -1
  184. package/dist/native/ssr/server/flight-source.js +1 -1
  185. package/dist/native/ssr/server/flight-source.js.map +1 -1
  186. package/dist/native/ssr/server/framework-stack-frames.js +18 -0
  187. package/dist/native/ssr/server/framework-stack-frames.js.map +1 -0
  188. package/dist/native/ssr/server/request-context.js +11 -5
  189. package/dist/native/ssr/server/request-context.js.map +1 -1
  190. package/dist/native/ssr/server/rsc-cache-key-guard.js +5 -1
  191. package/dist/native/ssr/server/rsc-cache-key-guard.js.map +1 -1
  192. package/dist/native/ssr/server/segment-lifetime/key-digest.js +6 -0
  193. package/dist/native/ssr/server/segment-lifetime/key-digest.js.map +1 -0
  194. package/dist/native/ssr/server/segment-lifetime/read-rule.js +78 -0
  195. package/dist/native/ssr/server/segment-lifetime/read-rule.js.map +1 -0
  196. package/dist/native/ssr/server/vite-handoff-rsc.js.map +1 -1
  197. package/dist/native/ssr/shared/als-slots.js +2 -2
  198. package/dist/native/ssr/shared/als-slots.js.map +1 -1
  199. package/dist/native/ssr/shared/cookie-read-through.js +5 -0
  200. package/dist/native/ssr/shared/cookie-read-through.js.map +1 -0
  201. package/dist/native/ssr/shared/key-headers.js +13 -0
  202. package/dist/native/ssr/shared/key-headers.js.map +1 -0
  203. package/dist/native/ssr/shared/rsc-cache-key.js +19 -3
  204. package/dist/native/ssr/shared/rsc-cache-key.js.map +1 -1
  205. package/dist/native/ssr/shims/headers.js +3 -4
  206. package/dist/native/ssr/shims/headers.js.map +1 -1
  207. package/dist/plugins/callsite-jsx.d.ts +8 -1
  208. package/dist/plugins/callsite-jsx.d.ts.map +1 -1
  209. package/dist/plugins/entries.d.ts.map +1 -1
  210. package/dist/plugins/prerender-sugar.d.ts +9 -8
  211. package/dist/plugins/prerender-sugar.d.ts.map +1 -1
  212. package/dist/plugins/routing.d.ts.map +1 -1
  213. package/dist/routing/convention-lint.d.ts +11 -3
  214. package/dist/routing/convention-lint.d.ts.map +1 -1
  215. package/dist/routing/export-detect.d.ts +50 -23
  216. package/dist/routing/export-detect.d.ts.map +1 -1
  217. package/dist/routing/index.js +2 -2
  218. package/dist/routing/route-options-lint.d.ts +36 -0
  219. package/dist/routing/route-options-lint.d.ts.map +1 -0
  220. package/dist/routing/route-options.d.ts +55 -0
  221. package/dist/routing/route-options.d.ts.map +1 -0
  222. package/dist/routing/segment-keys.d.ts +38 -4
  223. package/dist/routing/segment-keys.d.ts.map +1 -1
  224. package/dist/search-params/index.js +5 -2
  225. package/dist/search-params/index.js.map +1 -1
  226. package/dist/server/als-registry.d.ts +22 -13
  227. package/dist/server/als-registry.d.ts.map +1 -1
  228. package/dist/server/client-state-tree.d.ts +11 -10
  229. package/dist/server/client-state-tree.d.ts.map +1 -1
  230. package/dist/server/cookie-context.d.ts +3 -0
  231. package/dist/server/cookie-context.d.ts.map +1 -1
  232. package/dist/server/flight-source-node.d.ts +1 -6
  233. package/dist/server/flight-source-node.d.ts.map +1 -1
  234. package/dist/server/flight-source.d.ts +4 -28
  235. package/dist/server/flight-source.d.ts.map +1 -1
  236. package/dist/server/framework-stack-frames.d.ts +20 -0
  237. package/dist/server/framework-stack-frames.d.ts.map +1 -0
  238. package/dist/server/index.d.ts +1 -0
  239. package/dist/server/index.d.ts.map +1 -1
  240. package/dist/server/index.js +2 -2
  241. package/dist/server/internal.js +102 -28
  242. package/dist/server/internal.js.map +1 -1
  243. package/dist/server/prebuilt/capture-routes.d.ts +1 -1
  244. package/dist/server/prebuilt-builder.d.ts.map +1 -1
  245. package/dist/server/request-context.d.ts +6 -1
  246. package/dist/server/request-context.d.ts.map +1 -1
  247. package/dist/server/route-element-builder.d.ts +2 -2
  248. package/dist/server/route-element-builder.d.ts.map +1 -1
  249. package/dist/server/route-module-loader.d.ts +10 -2
  250. package/dist/server/route-module-loader.d.ts.map +1 -1
  251. package/dist/server/rsc-cache-key-guard.d.ts +3 -1
  252. package/dist/server/rsc-cache-key-guard.d.ts.map +1 -1
  253. package/dist/server/rsc-entry/helpers.d.ts +1 -1
  254. package/dist/server/rsc-entry/index.d.ts.map +1 -1
  255. package/dist/server/rsc-entry/render-route.d.ts +10 -1
  256. package/dist/server/rsc-entry/render-route.d.ts.map +1 -1
  257. package/dist/server/rsc-entry/revalidate-renderer.d.ts +12 -0
  258. package/dist/server/rsc-entry/revalidate-renderer.d.ts.map +1 -1
  259. package/dist/server/rsc-entry/rsc-stream.d.ts +2 -11
  260. package/dist/server/rsc-entry/rsc-stream.d.ts.map +1 -1
  261. package/dist/server/segment-lifetime/document-outlet.d.ts +66 -0
  262. package/dist/server/segment-lifetime/document-outlet.d.ts.map +1 -0
  263. package/dist/server/segment-lifetime/key-digest.d.ts +46 -0
  264. package/dist/server/segment-lifetime/key-digest.d.ts.map +1 -0
  265. package/dist/server/segment-lifetime/outlet-gate.d.ts +58 -0
  266. package/dist/server/segment-lifetime/outlet-gate.d.ts.map +1 -0
  267. package/dist/server/segment-lifetime/read-rule.d.ts +53 -0
  268. package/dist/server/segment-lifetime/read-rule.d.ts.map +1 -0
  269. package/dist/server/segment-lifetime/read-scope.d.ts +40 -0
  270. package/dist/server/segment-lifetime/read-scope.d.ts.map +1 -0
  271. package/dist/server/segment-lifetime/segment-key.d.ts +63 -0
  272. package/dist/server/segment-lifetime/segment-key.d.ts.map +1 -0
  273. package/dist/server/segment-lifetime/slot-outlets.d.ts +81 -0
  274. package/dist/server/segment-lifetime/slot-outlets.d.ts.map +1 -0
  275. package/dist/server/slot-resolver.d.ts +10 -5
  276. package/dist/server/slot-resolver.d.ts.map +1 -1
  277. package/dist/server/slot-subtree-contain.d.ts +2 -6
  278. package/dist/server/slot-subtree-contain.d.ts.map +1 -1
  279. package/dist/server/subtree-walk.d.ts +56 -0
  280. package/dist/server/subtree-walk.d.ts.map +1 -0
  281. package/dist/server/types.d.ts +75 -0
  282. package/dist/server/types.d.ts.map +1 -1
  283. package/dist/server/vite-handoff-rsc.d.ts +1 -10
  284. package/dist/server/vite-handoff-rsc.d.ts.map +1 -1
  285. package/dist/shared/als-slots.d.ts +12 -2
  286. package/dist/shared/als-slots.d.ts.map +1 -1
  287. package/dist/shared/cookie-read-through.d.ts +18 -0
  288. package/dist/shared/cookie-read-through.d.ts.map +1 -0
  289. package/dist/shared/key-headers.d.ts +13 -0
  290. package/dist/shared/key-headers.d.ts.map +1 -0
  291. package/dist/shared/outlet-decision.d.ts +16 -28
  292. package/dist/shared/outlet-decision.d.ts.map +1 -1
  293. package/dist/shared/payload-root.d.ts +1 -1
  294. package/dist/shared/route-options-export.d.ts +13 -0
  295. package/dist/shared/route-options-export.d.ts.map +1 -0
  296. package/dist/shared/rsc-cache-key.d.ts +22 -0
  297. package/dist/shared/rsc-cache-key.d.ts.map +1 -1
  298. package/dist/shared/segment-info.d.ts +7 -5
  299. package/dist/shared/segment-info.d.ts.map +1 -1
  300. package/dist/shims/headers.d.ts.map +1 -1
  301. package/docs/api/30-api-server.mdx +29 -0
  302. package/docs/api/32-api-cache.mdx +10 -4
  303. package/docs/api/34-api-config.mdx +5 -0
  304. package/docs/learn/09-streaming.mdx +6 -2
  305. package/docs/learn/10-caching.mdx +10 -4
  306. package/package.json +1 -1
  307. package/src/cli-check.ts +11 -3
  308. package/src/client/browser-entry/index.ts +0 -2
  309. package/src/client/browser-entry/router-init.ts +2 -4
  310. package/src/client/error-boundary.tsx +1 -1
  311. package/src/client/navigation-commit.ts +9 -14
  312. package/src/client/outlet-content-cache.ts +36 -42
  313. package/src/client/outlet-scope-context.ts +5 -5
  314. package/src/client/params-context.ts +1 -1
  315. package/src/client/router-types.ts +3 -14
  316. package/src/client/router.ts +1 -2
  317. package/src/client/rsc-fetch.ts +1 -1
  318. package/src/client/segment-cache.ts +2 -2
  319. package/src/client/segment-outlet.tsx +19 -45
  320. package/src/client/stale-segment.ts +2 -2
  321. package/src/config-types.ts +23 -15
  322. package/src/config-validation.ts +17 -1
  323. package/src/cookies/define-cookie.ts +5 -1
  324. package/src/index.ts +2 -1
  325. package/src/plugins/callsite-jsx.ts +104 -6
  326. package/src/plugins/entries.ts +3 -1
  327. package/src/plugins/prerender-sugar.ts +34 -18
  328. package/src/plugins/routing.ts +3 -1
  329. package/src/routing/convention-lint.ts +18 -7
  330. package/src/routing/export-detect.ts +14 -117
  331. package/src/routing/route-options-lint.ts +153 -0
  332. package/src/routing/route-options.ts +439 -0
  333. package/src/routing/scanner.ts +1 -1
  334. package/src/routing/segment-keys.ts +53 -4
  335. package/src/rsc-runtime/vendor-types.d.ts +5 -1
  336. package/src/search-params/define.ts +1 -1
  337. package/src/server/als-registry.ts +25 -17
  338. package/src/server/client-state-tree.ts +30 -27
  339. package/src/server/cookie-context.ts +17 -0
  340. package/src/server/flight-source-node.ts +1 -5
  341. package/src/server/flight-source.ts +8 -82
  342. package/src/server/framework-stack-frames.ts +41 -0
  343. package/src/server/index.ts +7 -0
  344. package/src/server/prebuilt/capture-routes.ts +1 -1
  345. package/src/server/prebuilt-builder.ts +30 -2
  346. package/src/server/request-context.ts +31 -6
  347. package/src/server/route-element-builder.ts +92 -18
  348. package/src/server/route-module-loader.ts +43 -10
  349. package/src/server/rsc-cache-key-guard.ts +17 -2
  350. package/src/server/rsc-entry/helpers.ts +1 -1
  351. package/src/server/rsc-entry/index.ts +16 -3
  352. package/src/server/rsc-entry/render-route.ts +22 -51
  353. package/src/server/rsc-entry/revalidate-renderer.ts +16 -2
  354. package/src/server/rsc-entry/rsc-stream.ts +3 -23
  355. package/src/server/segment-lifetime/document-outlet.ts +98 -0
  356. package/src/server/segment-lifetime/key-digest.ts +139 -0
  357. package/src/server/segment-lifetime/outlet-gate.ts +102 -0
  358. package/src/server/segment-lifetime/read-rule.ts +193 -0
  359. package/src/server/segment-lifetime/read-scope.ts +101 -0
  360. package/src/server/segment-lifetime/segment-key.ts +168 -0
  361. package/src/server/segment-lifetime/slot-outlets.ts +180 -0
  362. package/src/server/slot-resolver.ts +103 -60
  363. package/src/server/slot-subtree-contain.ts +35 -182
  364. package/src/server/subtree-walk.ts +316 -0
  365. package/src/server/types.ts +91 -0
  366. package/src/server/vite-handoff-rsc.ts +1 -12
  367. package/src/shared/als-slots.ts +19 -8
  368. package/src/shared/cookie-read-through.ts +18 -0
  369. package/src/shared/key-headers.ts +42 -0
  370. package/src/shared/outlet-decision.ts +16 -30
  371. package/src/shared/payload-root.ts +1 -1
  372. package/src/shared/route-options-export.ts +14 -0
  373. package/src/shared/rsc-cache-key.ts +41 -2
  374. package/src/shared/segment-info.ts +7 -5
  375. package/src/shims/headers.ts +5 -4
  376. package/dist/_chunks/actions-DIgnvDrG.js.map +0 -1
  377. package/dist/_chunks/als-slots-kbQrHTzm.js.map +0 -1
  378. package/dist/_chunks/chains-CSslTUdI.js +0 -1
  379. package/dist/_chunks/cli-check-C3QOAru7.js.map +0 -1
  380. package/dist/_chunks/convention-lint-BoVISNS6.js.map +0 -1
  381. package/dist/_chunks/dev-server-B8roKA3Q.js +0 -1
  382. package/dist/_chunks/dev-server-C5R6jx8Q.js.map +0 -1
  383. package/dist/_chunks/dist-C1Rjlo6s.js.map +0 -1
  384. package/dist/_chunks/error-boundary-DB51f9ih.js.map +0 -1
  385. package/dist/_chunks/flight-source-node-D9cHBhjP.js.map +0 -1
  386. package/dist/_chunks/scanner-C9Lrf77z.js.map +0 -1
  387. package/dist/native/rsc/server/segment-hash/capture.js +0 -107
  388. package/dist/native/rsc/server/segment-hash/capture.js.map +0 -1
  389. package/dist/native/rsc/server/segment-hash/outlet.js +0 -81
  390. package/dist/native/rsc/server/segment-hash/outlet.js.map +0 -1
  391. package/dist/native/rsc/server/segment-hash/stream-tap.js +0 -139
  392. package/dist/native/rsc/server/segment-hash/stream-tap.js.map +0 -1
  393. package/dist/native/rsc/server/segment-hash/value-hash.js +0 -171
  394. package/dist/native/rsc/server/segment-hash/value-hash.js.map +0 -1
  395. package/dist/native/ssr/server/segment-hash/value-hash.js +0 -162
  396. package/dist/native/ssr/server/segment-hash/value-hash.js.map +0 -1
  397. package/dist/server/segment-hash/capture.d.ts +0 -77
  398. package/dist/server/segment-hash/capture.d.ts.map +0 -1
  399. package/dist/server/segment-hash/outlet.d.ts +0 -65
  400. package/dist/server/segment-hash/outlet.d.ts.map +0 -1
  401. package/dist/server/segment-hash/stream-tap.d.ts +0 -49
  402. package/dist/server/segment-hash/stream-tap.d.ts.map +0 -1
  403. package/dist/server/segment-hash/value-hash.d.ts +0 -70
  404. package/dist/server/segment-hash/value-hash.d.ts.map +0 -1
  405. package/src/server/segment-hash/capture.ts +0 -232
  406. package/src/server/segment-hash/outlet.ts +0 -185
  407. package/src/server/segment-hash/stream-tap.ts +0 -244
  408. package/src/server/segment-hash/value-hash.ts +0 -338
@@ -28,7 +28,7 @@ export declare function collectCandidateRoutes(root: ManifestSegmentNode, fileCo
28
28
  export type ParamCombo = CoercedParams;
29
29
  /**
30
30
  * Resolve the param combos to capture for a route. Static routes have
31
- * exactly one combo (the empty record) — `export const prerender`-style
31
+ * exactly one combo (the empty record) — `pageOptions.prerender`-style
32
32
  * components on static pages need no enumerator. Dynamic routes require
33
33
  * `generateStaticSegmentParams` (design/44 §generateStaticSegmentParams);
34
34
  * without it every request renders live and the wrapper is a no-op.
@@ -1 +1 @@
1
- {"version":3,"file":"prebuilt-builder.d.ts","sourceRoot":"","sources":["../../src/server/prebuilt-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAe9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAQvD,4EAA4E;AAC5E,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,yFAAyF;IACzF,QAAQ,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/D,MAAM,EAAE,aAAa,CAAC;IACtB,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,KAAK,EAAE,UAAU,CAAC;IAClB,gGAAgG;IAChG,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,oEAAoE;IACpE,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,6EAA6E;AAC7E,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC;IACjB,sEAAsE;IACtE,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,mEAAmE;IACnE,UAAU,EAAE,YAAY,EAAE,CAAC;IAC3B,qEAAqE;IACrE,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAC3C;;;;;OAK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15,7 @@
15
15
  */
16
16
  import type { CoercedParams } from '../shared/param-value.ts';
17
17
  import { requestContextAls, type ActionErrorForRender } from './als-registry.ts';
18
+ import { type SearchParamsReader } from '../shared/als-slots.ts';
18
19
  import { type SlotParamsRecord } from '../shared/slot-params.ts';
19
20
  import { type ReactCacheScope } from './react-cache-scope.ts';
20
21
  import type { ReactFormState } from 'react-dom/client';
@@ -39,8 +40,12 @@ export declare function getHeader(name: string): string | undefined;
39
40
  * Returns the current request's raw URLSearchParams.
40
41
  *
41
42
  * @internal — not part of the public API. Use `defineSearchParams().get()` instead.
43
+ *
44
+ * @param reader The definition the caller parses through (its fields, codecs
45
+ * and URL keys), checked against a 'document' segment's key. Omitted for a
46
+ * raw read.
42
47
  */
43
- export declare function getSearchParams(): URLSearchParams;
48
+ export declare function getSearchParams(reader?: SearchParamsReader): URLSearchParams;
44
49
  /**
45
50
  * Returns the current request's coerced segment params.
46
51
  *
@@ -1 +1 @@
1
- {"version":3,"file":"request-context.d.ts","sourceRoot":"","sources":["../../src/server/request-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EACL,iBAAiB,EACjB,KAAK,oBAAoB,EAE1B,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAA0B,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAI7B;;;;;GAKG;AACH,wBAAgB,UAAU,IAAI,eAAe,CAU5C;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAG1D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,eAAe,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,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,MAAM,CAAC,QAAQ,CACnF,CAAC;AAIF,6CAA6C;AAC7C,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B;;;OAGG;IACH,WAAW,CAAC,EAAE,oBAAoB,CAAC;CACpC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EACrC,GAAG,EAAE,OAAO,EACZ,EAAE,EAAE,MAAM,CAAC,EACX,EAAE,eAAe,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,GAAE,qBAA0B,GAC/E,CAAC,CA2BH;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAK9D;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAK1C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAmBhE;AAqCD;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,cAAc,GAAG,IAAI,CAE1D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,IAAI,oBAAoB,GAAG,IAAI,CAErE"}
@@ -19,7 +19,7 @@ import type { ManifestSegmentNode } from './route-matcher.ts';
19
19
  import type { DenyPageEntry } from './deny-boundary.ts';
20
20
  import type { RscPayloadRoot } from '../shared/payload-root.ts';
21
21
  import type { InterceptionContext } from './pipeline.ts';
22
- import { type SegmentHashRender } from './segment-hash/outlet.ts';
22
+ import { type SegmentRender } from './segment-lifetime/outlet-gate.ts';
23
23
  /**
24
24
  * The `segments` array handed to a layout's `SegmentProvider` — the value
25
25
  * `useSelectedLayoutSegment(s)` reads.
@@ -81,5 +81,5 @@ export interface RouteElementResult {
81
81
  * segments, the pre-computed verdict is replayed — no re-execution,
82
82
  * no metadata side effects, no head leak (TIM-1027).
83
83
  */
84
- export declare function buildRouteElement(req: Request, match: RouteMatch, interception: InterceptionContext | undefined, render: SegmentHashRender, metadataRouteHashes?: Record<string, string>): Promise<RouteElementResult>;
84
+ export declare function buildRouteElement(req: Request, match: RouteMatch, interception: InterceptionContext | undefined, render: SegmentRender, metadataRouteHashes?: Record<string, string>): Promise<RouteElementResult>;
85
85
  //# sourceMappingURL=route-element-builder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"route-element-builder.d.ts","sourceRoot":"","sources":["../../src/server/route-element-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAQ9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAIxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAMzD,OAAO,EAA+B,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAQ/F;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,mBAAmB,EAAE,EAC/B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,UAAU,GAChB,MAAM,EAAE,CAGV;AAED;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,OAAO,EAAE,MAAM,EAG1B;CACF;AAID,+CAA+C;AAC/C,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;IA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GAGG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,OAAO,EAAE,MAAM,EAG1B;CACF;AAID,+CAA+C;AAC/C,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;IAC3C,OAAO,EAAE,mBAAmB,CAAC;CAC9B;AAED,+CAA+C;AAC/C,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,OAAO,EAAE,cAAc,CAAC;IACxB,wDAAwD;IACxD,gBAAgB,EAAE,oBAAoB,EAAE,CAAC;IACzC,qCAAqC;IACrC,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC,4DAA4D;IAC5D,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,EAAE,CAAC;CACjC;AAqDD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,UAAU,EACjB,YAAY,EAAE,mBAAmB,GAAG,SAAS,EAC7C,MAAM,EAAE,aAAa,EACrB,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3C,OAAO,CAAC,kBAAkB,CAAC,CA6Y7B"}
@@ -8,8 +8,9 @@
8
8
  * See design/02-rendering-pipeline.md, design/07-routing.md.
9
9
  */
10
10
  import type { ManifestSegmentNode } from './route-matcher.ts';
11
- import type { Metadata } from './types.ts';
11
+ import type { Metadata, SegmentLifetime } from './types.ts';
12
12
  import { type LayoutComponentEntry } from './route-element-builder.ts';
13
+ import { type DocumentLifetime } from './segment-lifetime/segment-key.ts';
13
14
  /** Metadata export from a layout or page module, with its segment context. */
14
15
  export interface MetadataSource {
15
16
  metadataExport: Metadata | (() => Promise<Metadata>);
@@ -26,6 +27,11 @@ export interface LoadedRouteModules {
26
27
  PageComponent: (...args: unknown[]) => unknown;
27
28
  deferSuspenseFor: number;
28
29
  accessFns: Array<AccessFn>;
30
+ /** `'document'` lifetimes (design/53), by segment index for layouts. */
31
+ documentLifetimes: {
32
+ layouts: Array<DocumentLifetime | undefined>;
33
+ page?: DocumentLifetime;
34
+ };
29
35
  }
30
36
  /**
31
37
  * Load all route modules (layouts, page, access functions) in a single pass.
@@ -33,5 +39,7 @@ export interface LoadedRouteModules {
33
39
  * Access functions are loaded eagerly here so the wrapping loop does not need
34
40
  * to await `loadModule(segment.access)` at each iteration.
35
41
  */
36
- export declare function loadRouteModules(segments: ManifestSegmentNode[], requestUrl: string): Promise<LoadedRouteModules>;
42
+ export declare function loadRouteModules(segments: ManifestSegmentNode[], requestUrl: string,
43
+ /** The app's `defaultLayoutLifetime` (design/53 §"App-wide default"). */
44
+ defaultLayoutLifetime: SegmentLifetime): Promise<LoadedRouteModules>;
37
45
  //# sourceMappingURL=route-module-loader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"route-module-loader.d.ts","sourceRoot":"","sources":["../../src/server/route-module-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAwB,KAAK,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAE7F,8EAA8E;AAC9E,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE,QAAQ,GAAG,CAAC,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IACrD,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,yDAAyD;AACzD,MAAM,MAAM,QAAQ,GAAG,CAAC,MAAM,OAAO,CAAC,GAAG,SAAS,CAAC;AAEnD,0CAA0C;AAC1C,MAAM,WAAW,kBAAkB;IACjC,eAAe,EAAE,cAAc,EAAE,CAAC;I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SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC3B,wEAAwE;IACxE,iBAAiB,EAAE;QAAE,OAAO,EAAE,KAAK,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAAC;QAAC,IAAI,CAAC,EAAE,gBAAgB,CAAA;KAAE,CAAC;CAC9F;AAgED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,mBAAmB,EAAE,EAC/B,UAAU,EAAE,MAAM;AAClB,yEAAyE;AACzE,qBAAqB,EAAE,eAAe,GACrC,OAAO,CAAC,kBAAkB,CAAC,CA6E7B"}
@@ -66,7 +66,9 @@ export declare function hardenRscPayloadResponse(response: Response): void;
66
66
  * harmless lets a CDN apply heuristic caching to a response that has none.
67
67
  *
68
68
  * The cost is that a mismatched request loses developer-chosen *browser*
69
- * caching too. That is a request no timber client ever makes.
69
+ * caching too. A mismatch is a request no timber client ever makes. A request
70
+ * carrying 'document' key digests is one every client holding such a segment
71
+ * makes; it is private, no-store by default anyway.
70
72
  *
71
73
  * Purge tags (`Surrogate-Key`, `Cache-Tag`) are deliberately left alone:
72
74
  * they address stored entries, and this response is not stored.
@@ -1 +1 @@
1
- {"version":3,"file":"rsc-cache-key-guard.d.ts","sourceRoot":"","sources":["../../src/server/rsc-cache-key-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAMH;;;;;;;;;;;GAWG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAgCxE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAGjE;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAGxF"}
1
+ {"version":3,"file":"rsc-cache-key-guard.d.ts","sourceRoot":"","sources":["../../src/server/rsc-cache-key-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAWH;;;;;;;;;;;GAWG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAgCxE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAGjE;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAWxF"}
@@ -12,7 +12,7 @@ import type { SegmentInfo } from '../../shared/segment-info.ts';
12
12
  * interception scoping (design/07-routing.md §"Intercepting Routes").
13
13
  *
14
14
  * Nothing here is about caching — what the client may reuse is decided by
15
- * segment hashes in the payload itself (design/52-segment-hash-dedupe.md).
15
+ * the outlet decisions in the payload itself (design/53-segment-lifetime.md).
16
16
  */
17
17
  export declare function buildSegmentInfo(segments: ManifestSegmentNode[], layoutComponents: Array<{
18
18
  segment: ManifestSegmentNode;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/index.ts"],"names":[],"mappings":"AA0CA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AA6FlE;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAEjD;AAkWD,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAInE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAK1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAItE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,wBAAwB,EAAE,cAAc,GACvD,OAAO,CAAC,OAAO,wBAAwB,EAAE,cAAc,CAAC,CAE1D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,OAAO,wBAAwB,EAAE,uBAAuB,GAChE,OAAO,CAAC,OAAO,wBAAwB,EAAE,uBAAuB,CAAC,CAQnE;8BA4CoB,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/index.ts"],"names":[],"mappings":"AA6CA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AA+FlE;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAEjD;AA0WD,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAInE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAK1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAItE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,wBAAwB,EAAE,cAAc,GACvD,OAAO,CAAC,OAAO,wBAAwB,EAAE,cAAc,CAAC,CAE1D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,OAAO,wBAAwB,EAAE,uBAAuB,GAChE,OAAO,CAAC,OAAO,wBAAwB,EAAE,uBAAuB,CAAC,CAQnE;8BA4CoB,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC"}
@@ -19,6 +19,8 @@
19
19
  import type { BuildManifest } from '../build-manifest.ts';
20
20
  import type { ClientBootstrapConfig } from '../html-injectors.ts';
21
21
  import type { InterceptionContext, RouteMatch } from '../pipeline.ts';
22
+ import type { KeyDigestSigner } from '../segment-lifetime/key-digest.ts';
23
+ import type { SegmentLifetime } from '../types.ts';
22
24
  import type { DenyFallbackRenderer } from './deny-fallback.ts';
23
25
  /**
24
26
  * Static-per-handler dependencies for `renderRoute` — captured once at
@@ -28,7 +30,14 @@ import type { DenyFallbackRenderer } from './deny-fallback.ts';
28
30
  export interface RenderRouteDeps {
29
31
  clientBootstrap: ClientBootstrapConfig;
30
32
  clientJsDisabled: boolean;
31
- clientSegmentCache: boolean;
33
+ /**
34
+ * Issues and checks key digests for 'document' segments
35
+ * (design/53-segment-lifetime.md); null when client JavaScript is disabled,
36
+ * since no client router can hold a segment.
37
+ */
38
+ keyDigestSigner: KeyDigestSigner | null;
39
+ /** The app's `defaultLayoutLifetime` (design/53 §"App-wide default"). */
40
+ defaultLayoutLifetime: SegmentLifetime;
32
41
  renderDenyFallback: DenyFallbackRenderer;
33
42
  buildManifest: BuildManifest;
34
43
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"render-route.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/render-route.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAS1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAUtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAQ/D;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,eAAe,EAAE,qBAAqB,CAAC;IACvC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,kBAAkB,EAAE,oBAAoB,CAAC;IACzC,aAAa,EAAE,aAAa,CAAC;IAC7B;;;OAGG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB,WA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AA;KAAE,CAAC;CAClE;AAED;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAC/B,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,UAAU,EACjB,eAAe,EAAE,OAAO,EACxB,IAAI,EAAE,eAAe,EACrB,YAAY,CAAC,EAAE,mBAAmB,GACjC,OAAO,CAAC,QAAQ,CAAC,CA2JnB"}
@@ -29,6 +29,8 @@ import type { BuildManifest } from '../build-manifest.ts';
29
29
  import type { RouteMatch, RouteMatcher } from '../pipeline.ts';
30
30
  import { type RevalidateRenderer } from '../actions.ts';
31
31
  import type { CoercedParams } from '../../shared/param-value.ts';
32
+ import type { KeyDigestSigner } from '../segment-lifetime/key-digest.ts';
33
+ import type { SegmentLifetime } from '../types.ts';
32
34
  /** Result of validating a `revalidatePath()` argument. */
33
35
  type PathValidation = {
34
36
  ok: true;
@@ -63,6 +65,16 @@ export interface RevalidateRendererDeps {
63
65
  matchRoute: RouteMatcher;
64
66
  coerceSegmentParams: CoerceSegmentParamsFn;
65
67
  buildManifest: BuildManifest;
68
+ /**
69
+ * Issues key digests for 'document' segments; null when client JavaScript
70
+ * is disabled. A revalidated tree renders every segment live (it carries no
71
+ * client claims), and issues digests from the cookies as the action left
72
+ * them, so the next navigation compares against what the browser now sends
73
+ * (design/53-segment-lifetime.md open question 4).
74
+ */
75
+ keyDigestSigner: KeyDigestSigner | null;
76
+ /** The app's `defaultLayoutLifetime` (design/53 §"App-wide default"). */
77
+ defaultLayoutLifetime: SegmentLifetime;
66
78
  }
67
79
  /**
68
80
  * Build a per-request `RevalidateRenderer`.
@@ -1 +1 @@
1
- {"version":3,"file":"revalidate-renderer.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/revalidate-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAK1D,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EA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C;AAGjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGnD,0DAA0D;AAC1D,KAAK,cAAc,GACf;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC9C;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAElC;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,CAiCpE;AAwBD,kFAAkF;AAClF,MAAM,MAAM,qBAAqB,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;AAElF,wDAAwD;AACxD,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,YAAY,CAAC;IACzB,mBAAmB,EAAE,qBAAqB,CAAC;IAC3C,aAAa,EAAE,aAAa,CAAC;IAC7B;;;;;;OAMG;IACH,eAAe,EAAE,eAAe,GAAG,IAAI,CAAC;IACxC,yEAAyE;IACzE,qBAAqB,EAAE,eAAe,CAAC;CACxC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,+BAA+B,CAC7C,IAAI,EAAE,sBAAsB,GAC3B,CAAC,GAAG,EAAE,OAAO,KAAK,kBAAkB,CAoLtC"}
@@ -9,15 +9,13 @@
9
9
  * Design docs: 02-rendering-pipeline.md §"Single-Pass Rendering",
10
10
  * 13-security.md §"Errors don't leak"
11
11
  */
12
- import type { FlightSource, FlightTap } from '../flight-source.ts';
12
+ import type { FlightSource } from '../flight-source.ts';
13
13
  import type { RscPayloadRoot } from '../../shared/payload-root.ts';
14
14
  import { type DenyPageEntry } from '../deny-boundary.ts';
15
15
  import { type RenderSignals } from './render-signals.ts';
16
16
  export interface RscStreamResult {
17
17
  rscStream: FlightSource;
18
18
  signals: RenderSignals;
19
- /** The render's error handler — segment-hash captures report through it. */
20
- onError: (error: unknown) => string | void;
21
19
  }
22
20
  /**
23
21
  * Render a payload root (tree plus its params) to a Flight source.
@@ -34,12 +32,5 @@ export interface RscStreamResult {
34
32
  * `renderTimeoutMs` passes with it still running (design/02 §"Always Wire
35
33
  * abort() to Both Request Signal AND Timeout").
36
34
  */
37
- export declare function renderRscStream(payload: RscPayloadRoot, req: Request, renderTimeoutMs: number, leafDenyChain?: DenyPageEntry[], tap?: FlightTap,
38
- /**
39
- * Digests a segment-hash capture already produced through this handler. A
40
- * capture's error row decoded into the live content reaches this render
41
- * again as an error carrying that digest: pass it through, it has been
42
- * reported and signalled once already.
43
- */
44
- relayedDigests?: ReadonlySet<string>): RscStreamResult;
35
+ export declare function renderRscStream(payload: RscPayloadRoot, req: Request, renderTimeoutMs: number, leafDenyChain?: DenyPageEntry[]): RscStreamResult;
45
36
  //# sourceMappingURL=rsc-stream.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rsc-stream.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/rsc-stream.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAKnE,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAQ3E,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAG/E,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,YAAY,CAAC;IACxB,OAAO,EAAE,aAAa,CAAC;IACvB,4EAA4E;IAC5E,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,GAAG,IAAI,CAAC;CAC5C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,cAAc,EACvB,GAAG,EAAE,OAAO,EACZ,eAAe,EAAE,MAAM,EACvB,aAAa,CAAC,EAAE,aAAa,EAAE,EAC/B,GAAG,CAAC,EAAE,SAAS;AACf;;;;;GAKG;AACH,cAAc,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GACnC,eAAe,CAyHjB"}
1
+ {"version":3,"file":"rsc-stream.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/rsc-stream.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAKnE,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAQ3E,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAG/E,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,YAAY,CAAC;IACxB,OAAO,EAAE,aAAa,CAAC;CACxB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,cAAc,EACvB,GAAG,EAAE,OAAO,EACZ,eAAe,EAAE,MAAM,EACvB,aAAa,CAAC,EAAE,aAAa,EAAE,GAC9B,eAAe,CA+GjB"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * The per-request decision input for a `'document'` segment's outlet: either
3
+ * the client holds content rendered under the current key (skip, without
4
+ * rendering), or the server issues a new digest for content it sends.
5
+ *
6
+ * Decided before the element tree is rendered, while the builder is still
7
+ * async, so the outlet gate decides synchronously and a skipped segment's
8
+ * component is never called (design/53-segment-lifetime.md §"Skipping").
9
+ */
10
+ import type { CoercedParams } from '../../shared/param-value.ts';
11
+ import type { KeyDigestSigner } from './key-digest.ts';
12
+ import { type DocumentLifetime } from './segment-key.ts';
13
+ /** What one render knows about `'document'` keys. */
14
+ export interface DocumentKeys {
15
+ /**
16
+ * The digests the client advertised (`X-Timber-State-Tree` `documents`), by
17
+ * outlet path. Null when no request can skip: a document request, an
18
+ * action's revalidated render, `router.refresh()`.
19
+ */
20
+ client: ReadonlyMap<string, string> | null;
21
+ signer: KeyDigestSigner;
22
+ }
23
+ /** A `'document'` outlet's decision input. */
24
+ export type DocumentOutlet =
25
+ /** The client's digest verified against this request's key values. */
26
+ {
27
+ held: string;
28
+ }
29
+ /** The digest this render issues for the content it sends. */
30
+ | {
31
+ issued: string;
32
+ };
33
+ /**
34
+ * Decide a `'document'` outlet from the client's claim and this request's key
35
+ * values. Undefined when the render has no signer (client JavaScript is
36
+ * disabled, so no client can hold anything): the segment renders as a plain
37
+ * live outlet.
38
+ *
39
+ * A claim that does not verify — forged, from another segment, issued under
40
+ * other key values, or from another build — is treated as no claim. A claim
41
+ * that verifies but names content the client no longer holds is caught by
42
+ * the client (`stale-segment`), so a claim is never trusted for correctness.
43
+ */
44
+ export declare function prepareDocumentOutlet(keys: DocumentKeys | null, segmentPath: string, values: string): Promise<DocumentOutlet | undefined>;
45
+ /**
46
+ * The decision input for one segment's outlet: undefined unless the segment
47
+ * is `'document'` and the render can issue digests.
48
+ */
49
+ export declare function documentOutletFor(render: {
50
+ documents: DocumentKeys | null;
51
+ }, segmentPath: string, lifetime: DocumentLifetime | undefined, pathParams: readonly string[], params: CoercedParams,
52
+ /**
53
+ * The URL depth a layout publishes to `useSelectedLayoutSegment(s)`, which
54
+ * sits inside its outlet: when it changes, so does the layout's output,
55
+ * whatever the key says.
56
+ */
57
+ urlDepth?: number): Promise<DocumentOutlet | undefined>;
58
+ /**
59
+ * Every param named on the path down to `segments[index]`, outermost first —
60
+ * the default `segmentParams` of a key. A segment can read every param above
61
+ * it, so a new value for any of them must re-render it.
62
+ */
63
+ export declare function pathParamNames(segments: ReadonlyArray<{
64
+ paramName?: string;
65
+ }>, index: number): string[];
66
+ //# sourceMappingURL=document-outlet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-out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AAM,EAAE,CAOV"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * The key digest of a `'document'` segment — a keyed, per-render token over
3
+ * the parsed values of the request inputs in its key.
4
+ *
5
+ * Works like an ETag the server can check without storing anything: when a
6
+ * `'document'` segment renders, the server issues a token over its key values
7
+ * and the client stores it beside the content. On the next navigation the
8
+ * client sends it back (`X-Timber-State-Tree` `documents`), the server
9
+ * recomputes the MAC from that request's values, and skips the segment when
10
+ * they match (design/53-segment-lifetime.md §"The key digest").
11
+ *
12
+ * A token is `<nonce>.<mac>`, where
13
+ * `mac = HMAC-SHA256(key, nonce ‖ segmentPath ‖ values)` truncated to 128 bits:
14
+ *
15
+ * - **Keyed.** The key is derived from the build's secret (the server-action
16
+ * encryption key, `TIMBER_ACTIONS_ENCRYPTION_KEY` or plugin-rsc's per-build
17
+ * key) with HKDF under a label of its own, so the two uses never share key
18
+ * material. Without it a token cannot be reversed, and a guessed cookie value
19
+ * cannot be tested against it — a plain hash of a low-entropy value (a role,
20
+ * a short id) could be brute-forced.
21
+ * - **Fresh per render.** Every token carries its own random nonce, so the
22
+ * same session cookie yields a different token on every render and tokens
23
+ * cannot link visits. The nonce travels inside the token, so neither side
24
+ * keeps any nonce state.
25
+ * - **Bound to its segment.** The segment path is MACed with the values, so a
26
+ * token cannot be replayed at another segment with the same key values.
27
+ *
28
+ * Tokens never enter a URL: they are excluded from the `_rsc` cache key
29
+ * (`shared/rsc-cache-key.ts`).
30
+ */
31
+ /** The shape of a token; anything else the client sends is dropped. */
32
+ export declare const KEY_DIGEST_SHAPE: RegExp;
33
+ /** Issues and checks key digests. One per server, shared by every request. */
34
+ export interface KeyDigestSigner {
35
+ /** A new token for a segment rendered with these key values. */
36
+ issue(segmentPath: string, values: string): Promise<string>;
37
+ /** Whether `token` was issued for this segment with these key values. */
38
+ verify(token: string, segmentPath: string, values: string): Promise<boolean>;
39
+ }
40
+ /**
41
+ * A signer over a base64-encoded secret of at least 32 bytes. The source is
42
+ * read once, on first use, so an entry that reads it from a lazily loaded
43
+ * module pays nothing until a `'document'` segment renders.
44
+ */
45
+ export declare function createKeyDigestSigner(secretSource: () => string | Promise<string>): KeyDigestSigner;
46
+ //# sourceMappingURL=key-digest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"key-digest.d.ts","sourceRoot":"","sources":["../../../src/server/segment-lifetime/key-digest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAMH,uEAAuE;AACvE,eAAO,MAAM,gBAAgB,QAE5B,CAAC;AAKF,8EAA8E;AAC9E,MAAM,WAAW,eAAe;IAC9B,gEAAgE;IAChE,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5D,yEAAyE;IACzE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC9E;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAC3C,eAAe,CAsDjB"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * The outlet gate: renders one segment as a `SegmentOutlet` whose decision is
3
+ * either its live content or a skip.
4
+ *
5
+ * Only a `'document'` segment (design/53-segment-lifetime.md) is ever
6
+ * skipped. Its decision is made before the tree renders
7
+ * (`document-outlet.ts`): when the client holds content rendered under the
8
+ * current key digest, the segment is skipped **without rendering**, and its
9
+ * nested outlets are decided as if it had rendered — lifetime does not
10
+ * cascade. Otherwise it is sent live with the digest it rendered under. Every
11
+ * other segment is sent live. Access runs for every segment either way.
12
+ *
13
+ * See design/53-segment-lifetime.md §"Skipping".
14
+ */
15
+ import { type ReactElement, type ReactNode } from 'react';
16
+ import type { DocumentKeys, DocumentOutlet } from './document-outlet.ts';
17
+ import type { SegmentLifetime } from '../types.ts';
18
+ /** One outlet in the element tree, and the outlets directly inside it. */
19
+ export interface OutletSpec {
20
+ segmentPath: string;
21
+ content: ReactNode;
22
+ nested: OutletSpec[];
23
+ /** Set on a `'document'` segment's outlet when the render can issue digests. */
24
+ document?: DocumentOutlet;
25
+ }
26
+ /** Per-request inputs to every gate in one render. */
27
+ export interface SegmentRender {
28
+ /**
29
+ * Key digests for `'document'` segments: the client's, and the signer that
30
+ * issues and checks them. Null when no client router can hold a segment.
31
+ */
32
+ documents: DocumentKeys | null;
33
+ /**
34
+ * The lifetime of a layout that declares none: the app's
35
+ * `defaultLayoutLifetime` (design/53 §"App-wide default"). Pages always
36
+ * default to `'request'`.
37
+ */
38
+ defaultLayoutLifetime: SegmentLifetime;
39
+ }
40
+ /** A render with no client router to hold segments: every outlet live. */
41
+ export declare const LIVE_ONLY_RENDER: SegmentRender;
42
+ /**
43
+ * The element for an outlet: a server component that decides when it renders
44
+ * — after every access gate above it.
45
+ *
46
+ * A closure with no props rather than a component taking `{ spec }`:
47
+ * dev Flight serializes a server component's props as debug info, and these
48
+ * would repeat the whole subtree in every dev payload.
49
+ */
50
+ export declare function outletGate(spec: OutletSpec): ReactElement;
51
+ /**
52
+ * Whether `node` is an outlet gate element — the boundary of the segment
53
+ * whose content contains it. A walk over one segment's output (a
54
+ * 'document' segment's read scope) stops here: what renders inside belongs
55
+ * to the nested segment and its own rules.
56
+ */
57
+ export declare function isOutletGateElement(node: unknown): boolean;
58
+ //# sourceMappingURL=outlet-gate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outlet-gate.d.ts","sourceRoot":"","sources":["../../../src/server/segment-lifetime/outlet-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAiB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzE,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,0EAA0E;AAC1E,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,SAAS,CAAC;IACnB,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,gFAAgF;IAChF,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED,sDAAsD;AACtD,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,SAAS,EAAE,YAAY,GAAG,IAAI,CAAC;IAC/B;;;;OAIG;IACH,qBAAqB,EAAE,eAAe,CAAC;CACxC;AAED,0EAA0E;AAC1E,eAAO,MAAM,gBAAgB,EAAE,aAG9B,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,CAOzD;AAKD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAI1D"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * The checks every request-input accessor runs inside a `'document'`
3
+ * segment's read scope (`read-scope.ts`, design/53-segment-lifetime.md §"What
4
+ * a 'document' segment may read"). No React and no render machinery: the
5
+ * accessors in `request-context.ts` and `cookie-context.ts` import this.
6
+ */
7
+ import { type DocumentReadScope } from '../als-registry.ts';
8
+ import type { CoercedParams } from '../../shared/param-value.ts';
9
+ import type { SearchParamsReader } from '../../shared/als-slots.ts';
10
+ import type { ReadonlyHeaders } from '../request-context.ts';
11
+ /** The read scope the current render runs in, if it is a `'document'` segment's. */
12
+ export declare function currentReadScope(): DocumentReadScope | undefined;
13
+ /** Which part of a key would allow a read, for the error's fix. */
14
+ type KeyPart = 'segmentParams' | 'searchParams' | 'cookies' | 'headers';
15
+ /**
16
+ * The error for a read outside the key. Names the segment, what was read, and
17
+ * the fix: add it to the key, or make the segment `'request'`.
18
+ */
19
+ export declare function readOutsideKey(scope: DocumentReadScope, what: string, part?: KeyPart,
20
+ /** Overrides the fix when adding the read to the key is not possible. */
21
+ fixOverride?: string): Error;
22
+ /**
23
+ * The request headers as a `'document'` segment may read them: `get` and
24
+ * `has` of a header in its key. Any other name throws, and so does reading
25
+ * them all (iteration, `entries`, `forEach`), which could see headers the
26
+ * key leaves out — the pathname among them.
27
+ */
28
+ export declare function keyedHeaders(headers: ReadonlyHeaders, scope: DocumentReadScope): ReadonlyHeaders;
29
+ /** Throw if the current render may not read `what` at all (raw search params). */
30
+ export declare function assertUnscopedRead(what: string): void;
31
+ /**
32
+ * Throw if the current render reads search-param fields outside its key. A
33
+ * field is in the key only when the key's definition reads it through the
34
+ * same codec and URL key — a `.pick()` of the keyed definition, or the keyed
35
+ * definition itself. Another definition with a field of the same name may map
36
+ * it to another URL parameter or parse it differently.
37
+ */
38
+ export declare function assertSearchParamsRead(reader: SearchParamsReader): void;
39
+ /**
40
+ * Throw if the current render reads a cookie outside its key. A keyed cookie
41
+ * is in the key only as its definition parses it, so it may be read only
42
+ * through that definition (`codec` is the reader's); a raw read, or another
43
+ * definition of the same name, could see a difference the key does not.
44
+ */
45
+ export declare function assertCookieRead(name: string, codec?: unknown): void;
46
+ /**
47
+ * The params a scoped render sees: reading one outside the key throws. Its
48
+ * own keys are only the params in the key, so spreading it, or passing it to
49
+ * a client component, carries exactly what the segment may depend on.
50
+ */
51
+ export declare function scopedParams<T extends CoercedParams>(params: T): T;
52
+ export {};
53
+ //# sourceMappingURL=read-rule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-rule.d.ts","sourceRoot":"","sources":["../../../src/server/segment-lifetime/read-rule.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAwB,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG7D,oFAAoF;AACpF,wBAAgB,gBAAgB,IAAI,iBAAiB,GAAG,SAAS,CAEhE;AAED,mEAAmE;AACnE,KAAK,OAAO,GAAG,eAAe,GAAG,cAAc,GAAG,SAAS,GAAG,SAAS,CAAC;AAExE;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,iBAAiB,EACxB,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,OAAO;AACd,yEAAyE;AACzE,WAAW,CAAC,EAAE,MAAM,GACnB,KAAK,CAaP;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,iBAAiB,GAAG,eAAe,CAuChG;AAED,kFAAkF;AAClF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAGrD;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,CAcvE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAapE;AAiBD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,aAAa,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CA6BlE"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * The read rule of a `'document'` segment: it may read the request inputs in
3
+ * its key, and nothing else from the request (design/53-segment-lifetime.md
4
+ * §"What a 'document' segment may read").
5
+ *
6
+ * A `'document'` segment is skipped without rendering whenever its key is
7
+ * unchanged, so anything else it read would freeze silently at its load-time
8
+ * value. The rule makes that a thrown error instead, in every environment:
9
+ *
10
+ * - `getSegmentParams()` returns a view that throws on a param outside the key;
11
+ * - a search-params definition's `.get()` throws unless every field it reads is
12
+ * in the key's definition, and the raw search params throw;
13
+ * - the cookie jar throws on a cookie outside the key, and on `getAll()`;
14
+ * - `getHeaders()` reads only the headers in the key; any other header, and
15
+ * iterating them all, throws — and with that the pathname, which no timber
16
+ * API exposes to a component except through a header.
17
+ *
18
+ * **Reach.** The scope is an AsyncLocalStorage scope around the segment's
19
+ * component, so it covers the component and everything it calls or awaits.
20
+ * That alone would not reach the server components it *returns*: Flight
21
+ * renders those later, as tasks of its own, outside the scope. So the
22
+ * returned tree is rewritten (`subtree-walk.ts`) and each server component in
23
+ * it runs inside the scope too, down to the nested outlets — a layout's
24
+ * `children` and slots, which are other segments with their own rules.
25
+ *
26
+ * Not covered: values computed outside this render and handed to it — a
27
+ * `timber.cache` entry an earlier request filled, or a module-level value. The
28
+ * accessors' checks are `read-rule.ts`.
29
+ */
30
+ import { type DocumentReadScope } from '../als-registry.ts';
31
+ import { type ServerComponent } from '../subtree-walk.ts';
32
+ import type { DocumentLifetime } from './segment-key.ts';
33
+ /** The read scope of one `'document'` segment. */
34
+ export declare function readScopeFor(segmentPath: string, lifetime: DocumentLifetime, pathParams: readonly string[]): DocumentReadScope;
35
+ /**
36
+ * The segment's component, run inside its read scope with every server
37
+ * component it returns rewritten to run there too.
38
+ */
39
+ export declare function inReadScope(component: ServerComponent, scope: DocumentReadScope): ServerComponent;
40
+ //# sourceMappingURL=read-scope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-scope.d.ts","sourceRoot":"","sources":["../../../src/server/segment-lifetime/read-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH,OAAO,EAAwB,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAElF,OAAO,EAAkB,KAAK,eAAe,EAAoB,MAAM,oBAAoB,CAAC;AAC5F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,kDAAkD;AAClD,wBAAgB,YAAY,CAC1B,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,SAAS,MAAM,EAAE,GAC5B,iBAAiB,CAcnB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,iBAAiB,GAAG,eAAe,CAGjG"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * A segment's lifetime, read from its loaded module, and the parsed values of
3
+ * the request inputs in its key.
4
+ *
5
+ * Design doc: design/53-segment-lifetime.md §"Segment keys".
6
+ *
7
+ * The values are one canonical string per segment, the input the key digest
8
+ * MACs (`key-digest.ts`). Each part is compared after parsing, through the
9
+ * definition that owns it, so two requests that differ only in a way the
10
+ * segment cannot observe produce the same string:
11
+ *
12
+ * - **segment params** — the coerced params (each segment's codec applied);
13
+ * - **search params** — `def.buildSearchParams(def.parse(…))`, which applies
14
+ * defaults, aliases (`withUrlKey`) and drops values that parse to the default;
15
+ * - **headers** — each named header's value as `Headers.get` returns it
16
+ * (trimmed, repeats joined with ", "), or null when absent, by lowercased
17
+ * name; headers have no codec, so equivalent spellings differ;
18
+ * - **cookies** — `codec.serialize(codec.parse(raw))` per definition. The raw
19
+ * value comes from the request's cookie jar, which reflects cookies the
20
+ * current server action set (design/53 open question 4), so an action's
21
+ * revalidated render issues digests from the values the browser will send
22
+ * next.
23
+ */
24
+ import type { CoercedParams } from '../../shared/param-value.ts';
25
+ import { type RouteOptionsKind } from '../../shared/route-options-export.ts';
26
+ import type { SegmentKey, SegmentLifetime } from '../types.ts';
27
+ /** A segment declared `lifetime: 'document'`, with the key it declared (if any). */
28
+ export interface DocumentLifetime {
29
+ key: SegmentKey;
30
+ }
31
+ /**
32
+ * The lifetime of a layout that declares none, at the end of `chain` (the
33
+ * segments from the root down to it, slot chains included): the app's
34
+ * `defaultLayoutLifetime`, except at or below an intercepting segment.
35
+ * Options there are a build error (`routing/route-options-lint.ts`), so a
36
+ * defaulted layout under an intercepting directory could never opt back to
37
+ * `'request'` — it keeps `'request'` instead (design/53 §"App-wide default").
38
+ * A page always defaults to `'request'`.
39
+ */
40
+ export declare function defaultLayoutLifetimeAt(chain: readonly {
41
+ segmentType?: string;
42
+ }[], appDefault: SegmentLifetime): SegmentLifetime;
43
+ /**
44
+ * The module's lifetime: a `DocumentLifetime` when its options object
45
+ * declares `lifetime: 'document'`, or declares no lifetime and
46
+ * `defaultLifetime` is `'document'`; undefined otherwise. The build validated
47
+ * the object from source (`routing/route-options.ts`); this runtime read is
48
+ * what takes effect.
49
+ *
50
+ * @param defaultLifetime The lifetime of a module that declares none: the
51
+ * app's `defaultLayoutLifetime` for a layout, `'request'` for a page
52
+ * (design/53 §"App-wide default").
53
+ */
54
+ export declare function readDocumentLifetime(mod: Record<string, unknown>, kind: RouteOptionsKind, defaultLifetime: SegmentLifetime): DocumentLifetime | undefined;
55
+ /**
56
+ * The canonical key values of one segment in the current request.
57
+ *
58
+ * @param pathParams Every param name on the segment's path, outermost first —
59
+ * the default `segmentParams`.
60
+ * @param params The coerced values of those params.
61
+ */
62
+ export declare function readKeyValues(lifetime: DocumentLifetime, pathParams: readonly string[], params: CoercedParams): string;
63
+ //# sourceMappingURL=segment-key.d.ts.map