@timber-js/app 0.2.0-alpha.241 → 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 (264) hide show
  1. package/dist/_chunks/{actions-BCYVyoFl.js → actions-BkwgRwCl.js} +37 -9
  2. package/dist/_chunks/actions-BkwgRwCl.js.map +1 -0
  3. package/dist/_chunks/{als-registry-fabsRnPY.js → als-registry-C-iwbtvI.js} +1 -2
  4. package/dist/_chunks/{als-registry-fabsRnPY.js.map → als-registry-C-iwbtvI.js.map} +1 -1
  5. package/dist/_chunks/{cache-api-n5FL4wFs.js → cache-api-BGA7c5qJ.js} +5 -5
  6. package/dist/_chunks/{cache-api-n5FL4wFs.js.map → cache-api-BGA7c5qJ.js.map} +1 -1
  7. package/dist/_chunks/{chains-IswOWMnq.js → chains-Cuwwjv6T.js} +2 -2
  8. package/dist/_chunks/{chains-IswOWMnq.js.map → chains-Cuwwjv6T.js.map} +1 -1
  9. package/dist/_chunks/chains-LGjBHfSN.js +1 -0
  10. package/dist/_chunks/{classify-B08RCF6s.js → classify-Y8S9C0Na.js} +2 -2
  11. package/dist/_chunks/{classify-B08RCF6s.js.map → classify-Y8S9C0Na.js.map} +1 -1
  12. package/dist/_chunks/{cli-check-tpFb6pBU.js → cli-check-KeE1QaIx.js} +3 -3
  13. package/dist/_chunks/{cli-check-tpFb6pBU.js.map → cli-check-KeE1QaIx.js.map} +1 -1
  14. package/dist/_chunks/{cli-schema-sync-DRNJutey.js → cli-schema-sync-DZEF31wd.js} +2 -2
  15. package/dist/_chunks/{cli-schema-sync-DRNJutey.js.map → cli-schema-sync-DZEF31wd.js.map} +1 -1
  16. package/dist/_chunks/{cli-schema-sync-C0pXBtzG.js → cli-schema-sync-_y5O6MIg.js} +1 -1
  17. package/dist/_chunks/{client-dep-entries-Dw5Dvatr.js → client-dep-entries-DpiwvoDi.js} +2 -2
  18. package/dist/_chunks/{client-dep-entries-Dw5Dvatr.js.map → client-dep-entries-DpiwvoDi.js.map} +1 -1
  19. package/dist/_chunks/{convention-lint-BfC_dAhZ.js → convention-lint-0AEsPK2T.js} +19 -5
  20. package/dist/_chunks/convention-lint-0AEsPK2T.js.map +1 -0
  21. package/dist/_chunks/dev-server-CboXr8zX.js +1 -0
  22. package/dist/_chunks/{dev-server-3R6Bl9_R.js → dev-server-DYDr8KIc.js} +2 -3
  23. package/dist/_chunks/dev-server-DYDr8KIc.js.map +1 -0
  24. package/dist/_chunks/{error-boundary-Dfhxigko.js → error-boundary-wuNvAJ4n.js} +8 -15
  25. package/dist/_chunks/error-boundary-wuNvAJ4n.js.map +1 -0
  26. package/dist/_chunks/{flight-source-node-QOpWZATb.js → flight-source-node-KQsX_OhS.js} +4 -7
  27. package/dist/_chunks/flight-source-node-KQsX_OhS.js.map +1 -0
  28. package/dist/_chunks/{json-lossy-check-5KFcC1yt.js → json-lossy-check-BVDALqMf.js} +2 -2
  29. package/dist/_chunks/{json-lossy-check-5KFcC1yt.js.map → json-lossy-check-BVDALqMf.js.map} +1 -1
  30. package/dist/_chunks/key-headers-uIig1_mU.js +40 -0
  31. package/dist/_chunks/key-headers-uIig1_mU.js.map +1 -0
  32. package/dist/_chunks/{live-graph-D1dfVqoT.js → live-graph-VhzO7Ol9.js} +4 -4
  33. package/dist/_chunks/{live-graph-D1dfVqoT.js.map → live-graph-VhzO7Ol9.js.map} +1 -1
  34. package/dist/_chunks/{logger-BvGxPd1e.js → logger-C4m8rfMy.js} +2 -2
  35. package/dist/_chunks/{logger-BvGxPd1e.js.map → logger-C4m8rfMy.js.map} +1 -1
  36. package/dist/_chunks/metadata-routes-MXNjWOt5.js.map +1 -1
  37. package/dist/_chunks/{node-response-D5cfiyWP.js → node-response-8Vz29cGS.js} +2 -2
  38. package/dist/_chunks/{node-response-D5cfiyWP.js.map → node-response-8Vz29cGS.js.map} +1 -1
  39. package/dist/_chunks/{poison-scan-CX02ilxN.js → poison-scan-Dpl3ibG-.js} +2 -2
  40. package/dist/_chunks/{poison-scan-CX02ilxN.js.map → poison-scan-Dpl3ibG-.js.map} +1 -1
  41. package/dist/_chunks/{scanner-DneYxQoY.js → scanner-CCEHN9Jg.js} +2 -2
  42. package/dist/_chunks/{scanner-DneYxQoY.js.map → scanner-CCEHN9Jg.js.map} +1 -1
  43. package/dist/_chunks/{sizeof-BtQ3ErLf.js → sizeof-CIF7fwSJ.js} +2 -2
  44. package/dist/_chunks/{sizeof-BtQ3ErLf.js.map → sizeof-CIF7fwSJ.js.map} +1 -1
  45. package/dist/_chunks/{walkers-C9R2A4jN.js → walkers-BbotBhNG.js} +3 -3
  46. package/dist/_chunks/{walkers-C9R2A4jN.js.map → walkers-BbotBhNG.js.map} +1 -1
  47. package/dist/adapters/cloudflare-kv-cache.js +1 -1
  48. package/dist/analyze/crawl-entry.js +3 -3
  49. package/dist/analyze/graph-command.js +2 -2
  50. package/dist/cache/index.js +2 -2
  51. package/dist/cache/stores/memory.js +1 -1
  52. package/dist/cdn/workers-cache-purge.js +1 -1
  53. package/dist/cli.js +3 -3
  54. package/dist/client/browser-entry/router-init.d.ts +0 -1
  55. package/dist/client/browser-entry/router-init.d.ts.map +1 -1
  56. package/dist/client/error-boundary.js +1 -1
  57. package/dist/client/index.js +1 -1
  58. package/dist/client/index.js.map +1 -1
  59. package/dist/client/internal.js +3 -5
  60. package/dist/client/internal.js.map +1 -1
  61. package/dist/client/navigation-commit.d.ts +0 -7
  62. package/dist/client/navigation-commit.d.ts.map +1 -1
  63. package/dist/client/outlet-content-cache.d.ts +16 -42
  64. package/dist/client/outlet-content-cache.d.ts.map +1 -1
  65. package/dist/client/outlet-scope-context.d.ts +4 -4
  66. package/dist/client/outlet-scope-context.d.ts.map +1 -1
  67. package/dist/client/params-context.d.ts +1 -1
  68. package/dist/client/router-types.d.ts +3 -13
  69. package/dist/client/router-types.d.ts.map +1 -1
  70. package/dist/client/router.d.ts.map +1 -1
  71. package/dist/client/segment-cache.d.ts +2 -2
  72. package/dist/client/segment-outlet.d.ts +12 -15
  73. package/dist/client/segment-outlet.d.ts.map +1 -1
  74. package/dist/client/stale-segment.d.ts +2 -2
  75. package/dist/config-types.d.ts +0 -17
  76. package/dist/config-types.d.ts.map +1 -1
  77. package/dist/config-validation.d.ts.map +1 -1
  78. package/dist/index.js +7 -8
  79. package/dist/index.js.map +1 -1
  80. package/dist/native/rsc/manifest.json +2 -4
  81. package/dist/native/rsc/routing/segment-keys.js.map +1 -1
  82. package/dist/native/rsc/server/als-registry.js +1 -2
  83. package/dist/native/rsc/server/als-registry.js.map +1 -1
  84. package/dist/native/rsc/server/client-state-tree.js +1 -5
  85. package/dist/native/rsc/server/client-state-tree.js.map +1 -1
  86. package/dist/native/rsc/server/flight-source-node.js +2 -5
  87. package/dist/native/rsc/server/flight-source-node.js.map +1 -1
  88. package/dist/native/rsc/server/flight-source.js +6 -41
  89. package/dist/native/rsc/server/flight-source.js.map +1 -1
  90. package/dist/native/rsc/server/framework-stack-frames.js.map +1 -1
  91. package/dist/native/rsc/server/request-context.js +3 -3
  92. package/dist/native/rsc/server/request-context.js.map +1 -1
  93. package/dist/native/rsc/server/route-element-builder.js +5 -5
  94. package/dist/native/rsc/server/route-element-builder.js.map +1 -1
  95. package/dist/native/rsc/server/rsc-entry/render-route.js +4 -30
  96. package/dist/native/rsc/server/rsc-entry/render-route.js.map +1 -1
  97. package/dist/native/rsc/server/rsc-entry/revalidate-renderer.js +0 -2
  98. package/dist/native/rsc/server/rsc-entry/revalidate-renderer.js.map +1 -1
  99. package/dist/native/rsc/server/rsc-entry/rsc-stream.js +2 -5
  100. package/dist/native/rsc/server/rsc-entry/rsc-stream.js.map +1 -1
  101. package/dist/native/rsc/server/segment-lifetime/outlet-gate.js +44 -0
  102. package/dist/native/rsc/server/segment-lifetime/outlet-gate.js.map +1 -0
  103. package/dist/native/rsc/server/segment-lifetime/read-rule.js +25 -3
  104. package/dist/native/rsc/server/segment-lifetime/read-rule.js.map +1 -1
  105. package/dist/native/rsc/server/segment-lifetime/read-scope.js +3 -2
  106. package/dist/native/rsc/server/segment-lifetime/read-scope.js.map +1 -1
  107. package/dist/native/rsc/server/segment-lifetime/segment-key.js +17 -3
  108. package/dist/native/rsc/server/segment-lifetime/segment-key.js.map +1 -1
  109. package/dist/native/rsc/server/segment-lifetime/slot-outlets.js +4 -4
  110. package/dist/native/rsc/server/segment-lifetime/slot-outlets.js.map +1 -1
  111. package/dist/native/rsc/server/slot-resolver.js +3 -3
  112. package/dist/native/rsc/server/slot-resolver.js.map +1 -1
  113. package/dist/native/rsc/server/vite-handoff-rsc.js.map +1 -1
  114. package/dist/native/rsc/shared/key-headers.js +20 -0
  115. package/dist/native/rsc/shared/key-headers.js.map +1 -0
  116. package/dist/native/rsc/shared/outlet-decision.js.map +1 -1
  117. package/dist/native/ssr/client/outlet-content-cache.js +6 -26
  118. package/dist/native/ssr/client/outlet-content-cache.js.map +1 -1
  119. package/dist/native/ssr/client/outlet-scope-context.js.map +1 -1
  120. package/dist/native/ssr/client/segment-outlet.js +6 -19
  121. package/dist/native/ssr/client/segment-outlet.js.map +1 -1
  122. package/dist/native/ssr/manifest.json +1 -1
  123. package/dist/native/ssr/server/als-registry.js +0 -1
  124. package/dist/native/ssr/server/als-registry.js.map +1 -1
  125. package/dist/native/ssr/server/client-state-tree.js +1 -5
  126. package/dist/native/ssr/server/client-state-tree.js.map +1 -1
  127. package/dist/native/ssr/server/flight-source-node.js +2 -5
  128. package/dist/native/ssr/server/flight-source-node.js.map +1 -1
  129. package/dist/native/ssr/server/flight-source.js +0 -1
  130. package/dist/native/ssr/server/flight-source.js.map +1 -1
  131. package/dist/native/ssr/server/framework-stack-frames.js.map +1 -1
  132. package/dist/native/ssr/server/request-context.js +3 -3
  133. package/dist/native/ssr/server/request-context.js.map +1 -1
  134. package/dist/native/ssr/server/segment-lifetime/read-rule.js +25 -3
  135. package/dist/native/ssr/server/segment-lifetime/read-rule.js.map +1 -1
  136. package/dist/native/ssr/server/vite-handoff-rsc.js.map +1 -1
  137. package/dist/native/ssr/shared/key-headers.js +13 -0
  138. package/dist/native/ssr/shared/key-headers.js.map +1 -0
  139. package/dist/plugins/entries.d.ts.map +1 -1
  140. package/dist/routing/index.js +2 -2
  141. package/dist/routing/route-options.d.ts.map +1 -1
  142. package/dist/routing/segment-keys.d.ts +3 -4
  143. package/dist/routing/segment-keys.d.ts.map +1 -1
  144. package/dist/server/als-registry.d.ts +2 -16
  145. package/dist/server/als-registry.d.ts.map +1 -1
  146. package/dist/server/client-state-tree.d.ts +5 -11
  147. package/dist/server/client-state-tree.d.ts.map +1 -1
  148. package/dist/server/flight-source-node.d.ts +1 -6
  149. package/dist/server/flight-source-node.d.ts.map +1 -1
  150. package/dist/server/flight-source.d.ts +0 -27
  151. package/dist/server/flight-source.d.ts.map +1 -1
  152. package/dist/server/framework-stack-frames.d.ts +1 -4
  153. package/dist/server/framework-stack-frames.d.ts.map +1 -1
  154. package/dist/server/index.js +2 -2
  155. package/dist/server/internal.js +13 -23
  156. package/dist/server/internal.js.map +1 -1
  157. package/dist/server/request-context.d.ts.map +1 -1
  158. package/dist/server/route-element-builder.d.ts +2 -2
  159. package/dist/server/route-element-builder.d.ts.map +1 -1
  160. package/dist/server/rsc-entry/helpers.d.ts +1 -1
  161. package/dist/server/rsc-entry/index.d.ts.map +1 -1
  162. package/dist/server/rsc-entry/render-route.d.ts +0 -1
  163. package/dist/server/rsc-entry/render-route.d.ts.map +1 -1
  164. package/dist/server/rsc-entry/revalidate-renderer.d.ts.map +1 -1
  165. package/dist/server/rsc-entry/rsc-stream.d.ts +2 -11
  166. package/dist/server/rsc-entry/rsc-stream.d.ts.map +1 -1
  167. package/dist/server/segment-lifetime/outlet-gate.d.ts +58 -0
  168. package/dist/server/segment-lifetime/outlet-gate.d.ts.map +1 -0
  169. package/dist/server/segment-lifetime/read-rule.d.ts +13 -3
  170. package/dist/server/segment-lifetime/read-rule.d.ts.map +1 -1
  171. package/dist/server/segment-lifetime/read-scope.d.ts +2 -1
  172. package/dist/server/segment-lifetime/read-scope.d.ts.map +1 -1
  173. package/dist/server/segment-lifetime/segment-key.d.ts +3 -0
  174. package/dist/server/segment-lifetime/segment-key.d.ts.map +1 -1
  175. package/dist/server/segment-lifetime/slot-outlets.d.ts +2 -2
  176. package/dist/server/segment-lifetime/slot-outlets.d.ts.map +1 -1
  177. package/dist/server/slot-resolver.d.ts +5 -5
  178. package/dist/server/slot-resolver.d.ts.map +1 -1
  179. package/dist/server/types.d.ts +8 -2
  180. package/dist/server/types.d.ts.map +1 -1
  181. package/dist/server/vite-handoff-rsc.d.ts +1 -10
  182. package/dist/server/vite-handoff-rsc.d.ts.map +1 -1
  183. package/dist/shared/key-headers.d.ts +13 -0
  184. package/dist/shared/key-headers.d.ts.map +1 -0
  185. package/dist/shared/outlet-decision.d.ts +13 -44
  186. package/dist/shared/outlet-decision.d.ts.map +1 -1
  187. package/dist/shared/payload-root.d.ts +1 -1
  188. package/dist/shared/segment-info.d.ts +3 -7
  189. package/dist/shared/segment-info.d.ts.map +1 -1
  190. package/docs/api/30-api-server.mdx +1 -1
  191. package/package.json +1 -1
  192. package/src/client/browser-entry/index.ts +0 -2
  193. package/src/client/browser-entry/router-init.ts +2 -4
  194. package/src/client/error-boundary.tsx +1 -1
  195. package/src/client/navigation-commit.ts +4 -18
  196. package/src/client/outlet-content-cache.ts +24 -62
  197. package/src/client/outlet-scope-context.ts +5 -5
  198. package/src/client/params-context.ts +1 -1
  199. package/src/client/router-types.ts +3 -14
  200. package/src/client/router.ts +0 -2
  201. package/src/client/rsc-fetch.ts +1 -1
  202. package/src/client/segment-cache.ts +2 -2
  203. package/src/client/segment-outlet.tsx +19 -51
  204. package/src/client/stale-segment.ts +2 -2
  205. package/src/config-types.ts +0 -17
  206. package/src/config-validation.ts +0 -1
  207. package/src/plugins/entries.ts +0 -1
  208. package/src/routing/route-options.ts +20 -4
  209. package/src/routing/scanner.ts +1 -1
  210. package/src/routing/segment-keys.ts +3 -4
  211. package/src/rsc-runtime/vendor-types.d.ts +1 -1
  212. package/src/server/als-registry.ts +2 -23
  213. package/src/server/client-state-tree.ts +7 -18
  214. package/src/server/flight-source-node.ts +1 -5
  215. package/src/server/flight-source.ts +1 -81
  216. package/src/server/framework-stack-frames.ts +1 -4
  217. package/src/server/request-context.ts +6 -5
  218. package/src/server/route-element-builder.ts +13 -14
  219. package/src/server/rsc-entry/helpers.ts +1 -1
  220. package/src/server/rsc-entry/index.ts +0 -3
  221. package/src/server/rsc-entry/render-route.ts +7 -54
  222. package/src/server/rsc-entry/revalidate-renderer.ts +0 -2
  223. package/src/server/rsc-entry/rsc-stream.ts +3 -23
  224. package/src/server/segment-lifetime/outlet-gate.ts +102 -0
  225. package/src/server/segment-lifetime/read-rule.ts +63 -6
  226. package/src/server/segment-lifetime/read-scope.ts +4 -2
  227. package/src/server/segment-lifetime/segment-key.ts +31 -3
  228. package/src/server/segment-lifetime/slot-outlets.ts +5 -5
  229. package/src/server/slot-resolver.ts +8 -8
  230. package/src/server/types.ts +8 -2
  231. package/src/server/vite-handoff-rsc.ts +1 -12
  232. package/src/shared/key-headers.ts +42 -0
  233. package/src/shared/outlet-decision.ts +13 -48
  234. package/src/shared/payload-root.ts +1 -1
  235. package/src/shared/segment-info.ts +3 -7
  236. package/dist/_chunks/actions-BCYVyoFl.js.map +0 -1
  237. package/dist/_chunks/chains-DPZAMMav.js +0 -1
  238. package/dist/_chunks/convention-lint-BfC_dAhZ.js.map +0 -1
  239. package/dist/_chunks/dev-server-3DNTXQV-.js +0 -1
  240. package/dist/_chunks/dev-server-3R6Bl9_R.js.map +0 -1
  241. package/dist/_chunks/error-boundary-Dfhxigko.js.map +0 -1
  242. package/dist/_chunks/flight-source-node-QOpWZATb.js.map +0 -1
  243. package/dist/native/rsc/server/segment-hash/capture.js +0 -107
  244. package/dist/native/rsc/server/segment-hash/capture.js.map +0 -1
  245. package/dist/native/rsc/server/segment-hash/outlet.js +0 -101
  246. package/dist/native/rsc/server/segment-hash/outlet.js.map +0 -1
  247. package/dist/native/rsc/server/segment-hash/stream-tap.js +0 -139
  248. package/dist/native/rsc/server/segment-hash/stream-tap.js.map +0 -1
  249. package/dist/native/rsc/server/segment-hash/value-hash.js +0 -171
  250. package/dist/native/rsc/server/segment-hash/value-hash.js.map +0 -1
  251. package/dist/native/ssr/server/segment-hash/value-hash.js +0 -162
  252. package/dist/native/ssr/server/segment-hash/value-hash.js.map +0 -1
  253. package/dist/server/segment-hash/capture.d.ts +0 -77
  254. package/dist/server/segment-hash/capture.d.ts.map +0 -1
  255. package/dist/server/segment-hash/outlet.d.ts +0 -93
  256. package/dist/server/segment-hash/outlet.d.ts.map +0 -1
  257. package/dist/server/segment-hash/stream-tap.d.ts +0 -49
  258. package/dist/server/segment-hash/stream-tap.d.ts.map +0 -1
  259. package/dist/server/segment-hash/value-hash.d.ts +0 -70
  260. package/dist/server/segment-hash/value-hash.d.ts.map +0 -1
  261. package/src/server/segment-hash/capture.ts +0 -232
  262. package/src/server/segment-hash/outlet.ts +0 -229
  263. package/src/server/segment-hash/stream-tap.ts +0 -244
  264. package/src/server/segment-hash/value-hash.ts +0 -338
@@ -0,0 +1,102 @@
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
+
16
+ import { createElement, type ReactElement, type ReactNode } from 'react';
17
+ import type { OutletDecision } from '../../shared/outlet-decision.ts';
18
+ import { clientComponents } from '../vite-handoff-rsc.ts';
19
+ import type { DocumentKeys, DocumentOutlet } from './document-outlet.ts';
20
+ import type { SegmentLifetime } from '../types.ts';
21
+
22
+ /** One outlet in the element tree, and the outlets directly inside it. */
23
+ export interface OutletSpec {
24
+ segmentPath: string;
25
+ content: ReactNode;
26
+ nested: OutletSpec[];
27
+ /** Set on a `'document'` segment's outlet when the render can issue digests. */
28
+ document?: DocumentOutlet;
29
+ }
30
+
31
+ /** Per-request inputs to every gate in one render. */
32
+ export interface SegmentRender {
33
+ /**
34
+ * Key digests for `'document'` segments: the client's, and the signer that
35
+ * issues and checks them. Null when no client router can hold a segment.
36
+ */
37
+ documents: DocumentKeys | null;
38
+ /**
39
+ * The lifetime of a layout that declares none: the app's
40
+ * `defaultLayoutLifetime` (design/53 §"App-wide default"). Pages always
41
+ * default to `'request'`.
42
+ */
43
+ defaultLayoutLifetime: SegmentLifetime;
44
+ }
45
+
46
+ /** A render with no client router to hold segments: every outlet live. */
47
+ export const LIVE_ONLY_RENDER: SegmentRender = {
48
+ documents: null,
49
+ defaultLayoutLifetime: 'request',
50
+ };
51
+
52
+ /**
53
+ * The element for an outlet: a server component that decides when it renders
54
+ * — after every access gate above it.
55
+ *
56
+ * A closure with no props rather than a component taking `{ spec }`:
57
+ * dev Flight serializes a server component's props as debug info, and these
58
+ * would repeat the whole subtree in every dev payload.
59
+ */
60
+ export function outletGate(spec: OutletSpec): ReactElement {
61
+ function OutletGate(): ReactElement {
62
+ const { SegmentOutlet } = clientComponents();
63
+ return createElement(SegmentOutlet, { segmentPath: spec.segmentPath, decision: decide(spec) });
64
+ }
65
+ OUTLET_GATES.add(OutletGate);
66
+ return createElement(OutletGate);
67
+ }
68
+
69
+ /** Every gate component `outletGate` made, so a subtree walk can stop at one. */
70
+ const OUTLET_GATES = new WeakSet<object>();
71
+
72
+ /**
73
+ * Whether `node` is an outlet gate element — the boundary of the segment
74
+ * whose content contains it. A walk over one segment's output (a
75
+ * 'document' segment's read scope) stops here: what renders inside belongs
76
+ * to the nested segment and its own rules.
77
+ */
78
+ export function isOutletGateElement(node: unknown): boolean {
79
+ if (typeof node !== 'object' || node === null || !('type' in node)) return false;
80
+ const type = (node as { type: unknown }).type;
81
+ return typeof type === 'function' && OUTLET_GATES.has(type);
82
+ }
83
+
84
+ function decide(spec: OutletSpec): OutletDecision {
85
+ if (!spec.document) return { children: spec.content };
86
+ if ('issued' in spec.document) return { children: spec.content, digest: spec.document.issued };
87
+ return documentSkip(spec, spec.document.held);
88
+ }
89
+
90
+ /**
91
+ * A `'document'` skip: the segment is not rendered, so nothing says which
92
+ * nested outlets its content would hold — every one is decided. The client
93
+ * renders only those in its cached copy; a nested segment a layout body hid
94
+ * at load is still rendered and serialized here (its own `access.ts` still
95
+ * gates it), which is why a `'document'` layout body is not a data-hiding
96
+ * boundary (design/53 §"What stays frozen").
97
+ */
98
+ function documentSkip(spec: OutletSpec, digest: string): OutletDecision {
99
+ const outlets: Record<string, OutletDecision> = {};
100
+ for (const nested of spec.nested) outlets[nested.segmentPath] = decide(nested);
101
+ return { skip: true, digest, outlets };
102
+ }
@@ -8,6 +8,8 @@
8
8
  import { documentReadScopeAls, type DocumentReadScope } from '../als-registry.ts';
9
9
  import type { CoercedParams } from '../../shared/param-value.ts';
10
10
  import type { SearchParamsReader } from '../../shared/als-slots.ts';
11
+ import type { ReadonlyHeaders } from '../request-context.ts';
12
+ import { isUnkeyableHeader } from '../../shared/key-headers.ts';
11
13
 
12
14
  /** The read scope the current render runs in, if it is a `'document'` segment's. */
13
15
  export function currentReadScope(): DocumentReadScope | undefined {
@@ -15,16 +17,24 @@ export function currentReadScope(): DocumentReadScope | undefined {
15
17
  }
16
18
 
17
19
  /** Which part of a key would allow a read, for the error's fix. */
18
- type KeyPart = 'segmentParams' | 'searchParams' | 'cookies';
20
+ type KeyPart = 'segmentParams' | 'searchParams' | 'cookies' | 'headers';
19
21
 
20
22
  /**
21
23
  * The error for a read outside the key. Names the segment, what was read, and
22
24
  * the fix: add it to the key, or make the segment `'request'`.
23
25
  */
24
- export function readOutsideKey(scope: DocumentReadScope, what: string, part?: KeyPart): Error {
25
- const fix = part
26
- ? `Add it to key.${part}, or declare lifetime: 'request'.`
27
- : "A 'document' segment cannot depend on it; declare lifetime: 'request'.";
26
+ export function readOutsideKey(
27
+ scope: DocumentReadScope,
28
+ what: string,
29
+ part?: KeyPart,
30
+ /** Overrides the fix when adding the read to the key is not possible. */
31
+ fixOverride?: string
32
+ ): Error {
33
+ const fix =
34
+ fixOverride ??
35
+ (part
36
+ ? `Add it to key.${part}, or declare lifetime: 'request'.`
37
+ : "A 'document' segment cannot depend on it; declare lifetime: 'request'.");
28
38
  return new Error(
29
39
  `[timber] ${scope.segmentPath} is lifetime: 'document' (declared, or from defaultLayoutLifetime) ` +
30
40
  `and read ${what}, which is not in its key. ` +
@@ -34,7 +44,54 @@ export function readOutsideKey(scope: DocumentReadScope, what: string, part?: Ke
34
44
  );
35
45
  }
36
46
 
37
- /** Throw if the current render may not read `what` at all (headers, raw search params). */
47
+ /**
48
+ * The request headers as a `'document'` segment may read them: `get` and
49
+ * `has` of a header in its key. Any other name throws, and so does reading
50
+ * them all (iteration, `entries`, `forEach`), which could see headers the
51
+ * key leaves out — the pathname among them.
52
+ */
53
+ export function keyedHeaders(headers: ReadonlyHeaders, scope: DocumentReadScope): ReadonlyHeaders {
54
+ const keyed = (name: string): string => {
55
+ if (scope.headers.has(name.toLowerCase())) return name;
56
+ const what = `the header "${name}"`;
57
+ if (name.toLowerCase() === 'cookie') {
58
+ throw readOutsideKey(
59
+ scope,
60
+ what,
61
+ 'cookies',
62
+ 'Read cookies through a cookie definition in key.cookies.'
63
+ );
64
+ }
65
+ if (isUnkeyableHeader(name)) {
66
+ throw readOutsideKey(
67
+ scope,
68
+ what,
69
+ undefined,
70
+ "A key may not name a credential; declare lifetime: 'request'."
71
+ );
72
+ }
73
+ throw readOutsideKey(scope, what, 'headers');
74
+ };
75
+ const all = (): never => {
76
+ throw readOutsideKey(
77
+ scope,
78
+ 'every request header',
79
+ undefined,
80
+ "Read each header you need with getHeaders().get(name) and add it to key.headers, or declare lifetime: 'request'."
81
+ );
82
+ };
83
+ return {
84
+ get: (name) => headers.get(keyed(name)),
85
+ has: (name) => headers.has(keyed(name)),
86
+ entries: all,
87
+ keys: all,
88
+ values: all,
89
+ forEach: all,
90
+ [Symbol.iterator]: all,
91
+ };
92
+ }
93
+
94
+ /** Throw if the current render may not read `what` at all (raw search params). */
38
95
  export function assertUnscopedRead(what: string): void {
39
96
  const scope = currentReadScope();
40
97
  if (scope) throw readOutsideKey(scope, what);
@@ -11,7 +11,8 @@
11
11
  * - a search-params definition's `.get()` throws unless every field it reads is
12
12
  * in the key's definition, and the raw search params throw;
13
13
  * - the cookie jar throws on a cookie outside the key, and on `getAll()`;
14
- * - the request headers throw — and with them the pathname, which no timber
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
15
16
  * API exposes to a component except through a header.
16
17
  *
17
18
  * **Reach.** The scope is an AsyncLocalStorage scope around the segment's
@@ -30,7 +31,7 @@
30
31
  import { createElement, type ReactNode } from 'react';
31
32
 
32
33
  import { documentReadScopeAls, type DocumentReadScope } from '../als-registry.ts';
33
- import { isOutletGateElement } from '../segment-hash/outlet.ts';
34
+ import { isOutletGateElement } from './outlet-gate.ts';
34
35
  import { callAndRewrite, type ServerComponent, type SubtreeRule } from '../subtree-walk.ts';
35
36
  import type { DocumentLifetime } from './segment-key.ts';
36
37
 
@@ -51,6 +52,7 @@ export function readScopeFor(
51
52
  ])
52
53
  ),
53
54
  cookies: new Map((key.cookies ?? []).map((cookie) => [cookie.name, cookie.codec])),
55
+ headers: new Set((key.headers ?? []).map((name) => name.toLowerCase())),
54
56
  };
55
57
  }
56
58
 
@@ -12,6 +12,9 @@
12
12
  * - **segment params** — the coerced params (each segment's codec applied);
13
13
  * - **search params** — `def.buildSearchParams(def.parse(…))`, which applies
14
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;
15
18
  * - **cookies** — `codec.serialize(codec.parse(raw))` per definition. The raw
16
19
  * value comes from the request's cookie jar, which reflects cookies the
17
20
  * current server action set (design/53 open question 4), so an action's
@@ -22,7 +25,8 @@
22
25
  import type { CoercedParams } from '../../shared/param-value.ts';
23
26
  import { ROUTE_OPTIONS_EXPORT, type RouteOptionsKind } from '../../shared/route-options-export.ts';
24
27
  import { getCookieJar } from '../cookie-context.ts';
25
- import { getSearchParams } from '../request-context.ts';
28
+ import { getHeaders, getSearchParams } from '../request-context.ts';
29
+ import { headerKeyProblem } from '../../shared/key-headers.ts';
26
30
  import type { SegmentKey, SegmentLifetime } from '../types.ts';
27
31
 
28
32
  /** A segment declared `lifetime: 'document'`, with the key it declared (if any). */
@@ -69,7 +73,25 @@ export function readDocumentLifetime(
69
73
  const key = 'key' in options ? options.key : undefined;
70
74
  // The module's own export, typed `satisfies LayoutOptions` / `PageOptions`
71
75
  // in source and shape-checked by the build; at runtime it is an `object`.
72
- return { key: typeof key === 'object' && key !== null ? (key as SegmentKey) : {} };
76
+ const segmentKey = typeof key === 'object' && key !== null ? (key as SegmentKey) : {};
77
+ assertKeyableHeaders(segmentKey.headers);
78
+ return { key: segmentKey };
79
+ }
80
+
81
+ /**
82
+ * Refuse a header the key may not name, at runtime too: the build does not
83
+ * read every file kind (an MDX page's options go unlinted), and a credential
84
+ * must not become keyable — and readable — by skipping the lint.
85
+ */
86
+ function assertKeyableHeaders(headers: unknown): void {
87
+ if (headers === undefined) return;
88
+ if (!Array.isArray(headers) || !headers.every((h) => typeof h === 'string')) {
89
+ throw new Error('[timber] key.headers must be an array of header names.');
90
+ }
91
+ for (const name of headers) {
92
+ const problem = headerKeyProblem(name);
93
+ if (problem) throw new Error(`[timber] ${problem}`);
94
+ }
73
95
  }
74
96
 
75
97
  /**
@@ -99,7 +121,13 @@ export function readKeyValues(
99
121
  cookie.codec.serialize(cookie.codec.parse(jar?.get(cookie.name))),
100
122
  ]);
101
123
 
102
- return JSON.stringify([segmentParams, searchParams, cookies]);
124
+ const requestHeaders = key.headers && key.headers.length > 0 ? getHeaders() : null;
125
+ const headers = (key.headers ?? []).map((name) => [
126
+ name.toLowerCase(),
127
+ requestHeaders?.get(name) ?? null,
128
+ ]);
129
+
130
+ return JSON.stringify([segmentParams, searchParams, cookies, headers]);
103
131
  }
104
132
 
105
133
  /**
@@ -29,7 +29,7 @@ import {
29
29
  } from '../../routing/segment-keys.ts';
30
30
  import type { CoercedParams } from '../../shared/param-value.ts';
31
31
  import type { ManifestSegmentNode } from '../route-matcher.ts';
32
- import { outletGate, type OutletSpec, type SegmentHashRender } from '../segment-hash/outlet.ts';
32
+ import { outletGate, type OutletSpec, type SegmentRender } from './outlet-gate.ts';
33
33
  import { documentOutletFor } from './document-outlet.ts';
34
34
  import {
35
35
  defaultLayoutLifetimeAt,
@@ -41,7 +41,7 @@ import type { ServerComponent } from '../subtree-walk.ts';
41
41
 
42
42
  /** Everything a slot's `'document'` outlets need from the slot being resolved. */
43
43
  export interface SlotDocumentContext {
44
- render: SegmentHashRender;
44
+ render: SegmentRender;
45
45
  /** The slot's matched chain, slot root first. */
46
46
  chain: readonly ManifestSegmentNode[];
47
47
  /** The tree path of the segment that owns the slot. */
@@ -102,7 +102,7 @@ export class SlotDocumentOutlets {
102
102
  document: await this.decision(node, segmentPath, lifetime),
103
103
  };
104
104
  this.unclaimed = [spec];
105
- return outletGate(spec, this.ctx.render);
105
+ return outletGate(spec);
106
106
  }
107
107
 
108
108
  /**
@@ -123,12 +123,12 @@ export class SlotDocumentOutlets {
123
123
  };
124
124
  const spec: OutletSpec = {
125
125
  segmentPath,
126
- content: buildLayout(outletGate(childrenOutlet, this.ctx.render)),
126
+ content: buildLayout(outletGate(childrenOutlet)),
127
127
  nested: [childrenOutlet],
128
128
  document: await this.decision(node, segmentPath, lifetime),
129
129
  };
130
130
  this.unclaimed = [spec];
131
- return outletGate(spec, this.ctx.render);
131
+ return outletGate(spec);
132
132
  }
133
133
 
134
134
  /**
@@ -34,11 +34,11 @@ import { extractUrlParts } from './chain-url-parts.ts';
34
34
  import { findInterceptingMatch } from './slot-interception.ts';
35
35
  import { computeSlotKey, slotChainTreePath } from '../routing/segment-keys.ts';
36
36
  import {
37
- NO_SEGMENT_HASHING,
37
+ LIVE_ONLY_RENDER,
38
38
  outletGate,
39
39
  type OutletSpec,
40
- type SegmentHashRender,
41
- } from './segment-hash/outlet.ts';
40
+ type SegmentRender,
41
+ } from './segment-lifetime/outlet-gate.ts';
42
42
  import { getSegmentParams } from './request-context.ts';
43
43
  import { pathParamNames } from './segment-lifetime/document-outlet.ts';
44
44
  import { SlotDocumentOutlets } from './segment-lifetime/slot-outlets.ts';
@@ -97,7 +97,7 @@ export async function resolveSlotElement(
97
97
  req: Request,
98
98
  interception?: InterceptionContext,
99
99
  parentTreePath?: string,
100
- render: SegmentHashRender = NO_SEGMENT_HASHING
100
+ render: SegmentRender = LIVE_ONLY_RENDER
101
101
  ): Promise<ResolvedSlotElement> {
102
102
  // When interception is active, try to match intercepting children in this
103
103
  // slot against the target pathname. If an intercepting child matches, render
@@ -584,7 +584,7 @@ interface ResolveSlotPropsArgs {
584
584
  parentTreePath: string;
585
585
  /** The request being rendered. */
586
586
  req: Request;
587
- render: SegmentHashRender;
587
+ render: SegmentRender;
588
588
  }
589
589
 
590
590
  /** A layout's slot props, and the outlet of each slot. */
@@ -597,8 +597,8 @@ export interface ResolvedSlots {
597
597
  * Resolve all parallel route slots for a layout, each in its own outlet.
598
598
  *
599
599
  * Every slot is resolved and every slot's access chain runs, on every render.
600
- * Whether a slot's bytes are sent is decided by its outlet's hash, the same
601
- * as any other segment (design/52-segment-hash-dedupe.md).
600
+ * A slot is skipped only through the 'document' segments on its chain
601
+ * (design/53-segment-lifetime.md §"Slots").
602
602
  */
603
603
  export async function resolveSlotProps({
604
604
  segment,
@@ -629,7 +629,7 @@ export async function resolveSlotProps({
629
629
  nested,
630
630
  };
631
631
  outlets.push(spec);
632
- props[slotName] = outletGate(spec, render);
632
+ props[slotName] = outletGate(spec);
633
633
  }
634
634
 
635
635
  return { props, outlets };
@@ -107,8 +107,8 @@ export type SegmentLifetime = 'request' | 'document';
107
107
 
108
108
  /**
109
109
  * The request inputs a `'document'` segment depends on — and the only ones it
110
- * may read. Values are compared after parsing, through each definition's
111
- * codec. See design/53-segment-lifetime.md §"Segment keys".
110
+ * may read. Params, search params and cookies are compared after parsing,
111
+ * through each definition's codec; headers as `Headers.get` returns them. See design/53-segment-lifetime.md §"Segment keys".
112
112
  */
113
113
  export interface SegmentKey {
114
114
  /**
@@ -120,6 +120,12 @@ export interface SegmentKey {
120
120
  searchParams?: SearchParamsDefinition<Record<string, unknown>>;
121
121
  /** Cookie definitions (`defineCookie`). Default: none. */
122
122
  cookies?: readonly ServerOnlyCookieDefinition<unknown>[];
123
+ /**
124
+ * Request header names, matched case-insensitively; values compared as
125
+ * `Headers.get` returns them (trimmed, repeats joined). Default: none. `cookie` (use `cookies`) and credential headers
126
+ * (`authorization`, `proxy-authorization`, `x-api-key`) fail the build.
127
+ */
128
+ headers?: readonly string[];
123
129
  }
124
130
 
125
131
  /** Options for a `page.tsx`: `export const pageOptions = { … } satisfies PageOptions`. */
@@ -38,24 +38,13 @@ import type { DenyLastResort } from '../client/deny-last-resort.tsx';
38
38
  * decoder; the runtime only ever passes a stream and inspects the result, and
39
39
  * the narrower type is what a test double can satisfy.
40
40
  */
41
- /**
42
- * The decode half of Flight's temporary references: each `$T<id>` in the
43
- * stream is replaced by `get('$' + id)`. React's client reads only `get`.
44
- */
45
- export interface TemporaryReferenceLookup {
46
- get(key: string): unknown;
47
- }
48
-
49
41
  export interface RscFlightRuntime {
50
42
  renderFlight: typeof FlightAdapter.renderFlight;
51
43
  loadServerAction: typeof FlightAdapter.loadServerAction;
52
44
  decodeReply: typeof FlightAdapter.decodeReply;
53
45
  decodeAction: typeof FlightAdapter.decodeAction;
54
46
  decodeFormState: typeof FlightAdapter.decodeFormState;
55
- createFromReadableStream: (
56
- stream: ReadableStream<Uint8Array>,
57
- options?: { temporaryReferences?: TemporaryReferenceLookup }
58
- ) => Promise<unknown>;
47
+ createFromReadableStream: (stream: ReadableStream<Uint8Array>) => Promise<unknown>;
59
48
  }
60
49
 
61
50
  /**
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Which request headers a `'document'` segment's key may name
3
+ * (design/53-segment-lifetime.md §"Segment keys"). One rule for the build
4
+ * (`routing/route-options.ts`), which reports it from source, and for the
5
+ * runtime (`server/segment-lifetime/segment-key.ts`), which refuses it too —
6
+ * the build cannot read every file kind (MDX pages are not linted), and a
7
+ * credential must not become keyable by skipping the lint.
8
+ */
9
+
10
+ /** RFC 9110 §5.6.2 `token`: what a header field name may be. */
11
+ const HEADER_NAME = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
12
+
13
+ /**
14
+ * Headers a key may not name. `cookie` is read through cookie definitions
15
+ * (`key.cookies`). Credentials are secret, and a key answers guesses about
16
+ * its values to whoever holds a digest (design/53 §"The key digest").
17
+ */
18
+ const CREDENTIAL = 'It carries a credential, and a key must not hold secret values.';
19
+
20
+ /**
21
+ * A `Map`, not an object literal: a header may be named `constructor` or
22
+ * `__proto__`, and an index lookup would find `Object.prototype`'s.
23
+ */
24
+ const UNKEYABLE_HEADERS: ReadonlyMap<string, string> = new Map([
25
+ ['cookie', 'Key on cookie definitions with key.cookies instead.'],
26
+ ['authorization', CREDENTIAL],
27
+ ['proxy-authorization', CREDENTIAL],
28
+ ['x-api-key', CREDENTIAL],
29
+ ]);
30
+
31
+ /** Why a key may not name `name`, or undefined when it may. */
32
+ export function headerKeyProblem(name: string): string | undefined {
33
+ if (!HEADER_NAME.test(name))
34
+ return `key.headers names "${name}", which is not a valid header name.`;
35
+ const refused = UNKEYABLE_HEADERS.get(name.toLowerCase());
36
+ return refused ? `key.headers may not name "${name}". ${refused}` : undefined;
37
+ }
38
+
39
+ /** Whether a key may never name `name` (case-insensitive): a cookie or credential header. */
40
+ export function isUnkeyableHeader(name: string): boolean {
41
+ return UNKEYABLE_HEADERS.has(name.toLowerCase());
42
+ }
@@ -1,75 +1,40 @@
1
1
  /**
2
2
  * What the server decided for one `SegmentOutlet` — the wire contract
3
- * between the outlet gate (server/segment-hash/outlet.ts) and the client
4
- * outlet (client/segment-outlet.tsx).
3
+ * between the outlet gate (server/segment-lifetime/outlet-gate.ts) and the
4
+ * client outlet (client/segment-outlet.tsx).
5
5
  *
6
6
  * A segment is either sent or skipped:
7
7
  *
8
- * - **Live** — `children` is the segment's content. `hash` is the hash of the
9
- * rows that carried it, a promise the server resolves once those rows are
10
- * written (design/52 §"Two hashes, two jobs"); absent when the app has not
11
- * opted into `clientSegmentCache`, and null when the server could not hash
12
- * the segment.
13
- * A `'document'` segment (design/53-segment-lifetime.md) carries `digest`
14
- * instead: the key digest it rendered under, known before its content, and
15
- * no `hash`.
16
- * - **Skip** — the client already holds content with this `hash`, and the
17
- * server just produced identical output; or, for a `'document'` segment,
18
- * the client holds content rendered under this `digest` and the request's
19
- * key values still match it, so the server did not render the segment at
20
- * all. `outlets` carries the decisions for the segments nested directly
21
- * inside it, because the client renders its cached copy of this segment
22
- * and that copy still holds the old ones.
8
+ * - **Live** — `children` is the segment's content. A `'document'` segment
9
+ * (design/53-segment-lifetime.md) also carries `digest`: the key digest it
10
+ * rendered under.
11
+ * - **Skip** — only a `'document'` segment: the client holds content rendered
12
+ * under this `digest` and the request's key values still match it, so the
13
+ * server did not render the segment at all. `outlets` carries the decisions
14
+ * for the segments nested directly inside it, because the client renders
15
+ * its cached copy of this segment and that copy still holds the old ones.
23
16
  *
24
- * The outlet receives the decision as a promise when the server had to
25
- * render the segment once before deciding, and as a plain value otherwise.
26
- *
27
- * See design/52-segment-hash-dedupe.md §"Wire format".
17
+ * See design/53-segment-lifetime.md §"Skipping".
28
18
  */
29
19
 
30
20
  import type { ReactNode } from 'react';
31
21
 
32
- export type OutletDecision = LiveDecision | SkipDecision;
22
+ export type OutletDecision = LiveDecision | DocumentSkip;
33
23
 
34
24
  export interface LiveDecision {
35
25
  skip?: undefined;
36
- hash?: PromiseLike<string | null>;
37
26
  /** The key digest of a `'document'` segment's content. */
38
27
  digest?: string;
39
28
  children: ReactNode;
40
29
  }
41
30
 
42
- export type SkipDecision = HashSkip | DocumentSkip;
43
-
44
- /** A segment the server rendered and found identical to what the client holds. */
45
- export interface HashSkip {
46
- skip: true;
47
- hash: string;
48
- digest?: undefined;
49
- /** The decisions of the segments nested directly inside, by segment path. */
50
- outlets: Record<string, OutletDecisionValue>;
51
- }
52
-
53
31
  /** A `'document'` segment whose key is unchanged: never rendered. */
54
32
  export interface DocumentSkip {
55
33
  skip: true;
56
- hash?: undefined;
57
34
  digest: string;
58
35
  /** The decisions of the segments nested directly inside, by segment path. */
59
- outlets: Record<string, OutletDecisionValue>;
36
+ outlets: Record<string, OutletDecision>;
60
37
  }
61
38
 
62
- /**
63
- * What a nested outlet carries inside a segment-hash capture, in place of a
64
- * decision: an opaque marker Flight writes as a temporary reference and the
65
- * capture's decoder replaces with the real decision. Never reaches a client.
66
- */
67
- export interface CaptureHole {
68
- readonly captureHole: true;
69
- }
70
-
71
- /** A decision as an outlet receives it. */
72
- export type OutletDecisionValue = OutletDecision | PromiseLike<OutletDecision>;
73
-
74
39
  /** The `segmentPath` of the metadata outlet — one per payload. */
75
40
  export const METADATA_OUTLET_PATH = '#metadata';
@@ -11,7 +11,7 @@
11
11
  *
12
12
  * 1. **A provider inside the payload cannot reach a skipped segment.** A
13
13
  * segment the server skipped renders the content the client cached for it
14
- * (design/52-segment-hash-dedupe.md), and that copy carries whatever was
14
+ * (design/53-segment-lifetime.md), and that copy carries whatever was
15
15
  * inside it when it was committed — never the incoming route's provider.
16
16
  * Params belong to the *navigation*, so the provider has to be owned by the
17
17
  * client, above the payload root, and there must be exactly one.
@@ -35,10 +35,8 @@ export interface SegmentInfo {
35
35
  /**
36
36
  * The client's `X-Timber-State-Tree` request header.
37
37
  *
38
- * `hashes` is the caching half: the segment hashes the client holds content
39
- * for, by outlet path, sent only when the app opted into
40
- * `clientSegmentCache` (design/52-segment-hash-dedupe.md). `treePaths` is
41
- * not caching: it describes the *shape* of the tree currently on screen, so
38
+ * `documents` are the key digests of the `'document'` segments the client
39
+ * holds. `treePaths` is not caching: it describes the *shape* of the tree currently on screen, so
42
40
  * the server can answer "does the rendered route pass through the segment
43
41
  * that owns this intercepting slot?" without re-deriving it from the address
44
42
  * bar, which stops being the source route the moment a modal is open
@@ -47,11 +45,9 @@ export interface SegmentInfo {
47
45
  * Neither is a security input. Every `access.ts` runs regardless.
48
46
  */
49
47
  export interface StateTree {
50
- hashes?: Record<string, string>;
51
48
  /**
52
49
  * The key digests of the `'document'` segments the client holds, by outlet
53
- * path (design/53-segment-lifetime.md). Sent on every navigation, opt-in or
54
- * not; left out of the `_rsc` cache key.
50
+ * path (design/53-segment-lifetime.md). Left out of the `_rsc` cache key.
55
51
  */
56
52
  documents?: Record<string, string>;
57
53
  treePaths?: string[];