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

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 (332) hide show
  1. package/dist/_chunks/{actions-Top9GftB.js → actions-DIgnvDrG.js} +4 -4
  2. package/dist/_chunks/{actions-Top9GftB.js.map → actions-DIgnvDrG.js.map} +1 -1
  3. package/dist/_chunks/{als-registry-DpygwCp0.js → als-registry-PPYstxK0.js} +2 -1
  4. package/dist/_chunks/{als-registry-DpygwCp0.js.map → als-registry-PPYstxK0.js.map} +1 -1
  5. package/dist/_chunks/{cache-api-Bo8c7XVF.js → cache-api-uWQwuxWb.js} +5 -5
  6. package/dist/_chunks/{cache-api-Bo8c7XVF.js.map → cache-api-uWQwuxWb.js.map} +1 -1
  7. package/dist/_chunks/{chains-DMoHX4yH.js → chains-C7CExrUI.js} +2 -2
  8. package/dist/_chunks/{chains-DMoHX4yH.js.map → chains-C7CExrUI.js.map} +1 -1
  9. package/dist/_chunks/chains-CSslTUdI.js +1 -0
  10. package/dist/_chunks/{classify-BwyAd-dZ.js → classify-Cj9EeZoL.js} +2 -2
  11. package/dist/_chunks/{classify-BwyAd-dZ.js.map → classify-Cj9EeZoL.js.map} +1 -1
  12. package/dist/_chunks/{cli-check-DQAD9MLo.js → cli-check-C3QOAru7.js} +3 -3
  13. package/dist/_chunks/{cli-check-DQAD9MLo.js.map → cli-check-C3QOAru7.js.map} +1 -1
  14. package/dist/_chunks/{cli-schema-sync-C_xNLqBj.js → cli-schema-sync-BRxZz66D.js} +1 -1
  15. package/dist/_chunks/{cli-schema-sync-CmGls3dc.js → cli-schema-sync-DQUS_o3V.js} +2 -2
  16. package/dist/_chunks/{cli-schema-sync-CmGls3dc.js.map → cli-schema-sync-DQUS_o3V.js.map} +1 -1
  17. package/dist/_chunks/{client-dep-entries-C5BTQtFS.js → client-dep-entries-ZETBdLgv.js} +2 -2
  18. package/dist/_chunks/{client-dep-entries-C5BTQtFS.js.map → client-dep-entries-ZETBdLgv.js.map} +1 -1
  19. package/dist/_chunks/{convention-lint-GQA6WTRo.js → convention-lint-BoVISNS6.js} +3 -3
  20. package/dist/_chunks/{convention-lint-GQA6WTRo.js.map → convention-lint-BoVISNS6.js.map} +1 -1
  21. package/dist/_chunks/dev-server-B8roKA3Q.js +1 -0
  22. package/dist/_chunks/{dev-server-Cr3_Fu5A.js → dev-server-C5R6jx8Q.js} +2 -2
  23. package/dist/_chunks/{dev-server-Cr3_Fu5A.js.map → dev-server-C5R6jx8Q.js.map} +1 -1
  24. package/dist/_chunks/{dev-span-RsVeYYc_.js → dev-span-0aG7Q_Ph.js} +3 -7
  25. package/dist/_chunks/dev-span-0aG7Q_Ph.js.map +1 -0
  26. package/dist/_chunks/{error-boundary-Bh-egWUI.js → error-boundary-DB51f9ih.js} +98 -419
  27. package/dist/_chunks/error-boundary-DB51f9ih.js.map +1 -0
  28. package/dist/_chunks/{flight-source-node-BsrlUjMO.js → flight-source-node-D9cHBhjP.js} +7 -4
  29. package/dist/_chunks/flight-source-node-D9cHBhjP.js.map +1 -0
  30. package/dist/_chunks/{json-lossy-check-D47R9Fp5.js → json-lossy-check-Y1GxqVX_.js} +2 -2
  31. package/dist/_chunks/{json-lossy-check-D47R9Fp5.js.map → json-lossy-check-Y1GxqVX_.js.map} +1 -1
  32. package/dist/_chunks/{live-graph-HcLScfiV.js → live-graph-BDQWvnMm.js} +4 -4
  33. package/dist/_chunks/{live-graph-HcLScfiV.js.map → live-graph-BDQWvnMm.js.map} +1 -1
  34. package/dist/_chunks/{logger-DDLtp5e-.js → logger-DmRR9tmZ.js} +2 -2
  35. package/dist/_chunks/{logger-DDLtp5e-.js.map → logger-DmRR9tmZ.js.map} +1 -1
  36. package/dist/_chunks/metadata-routes-MXNjWOt5.js.map +1 -1
  37. package/dist/_chunks/{node-response-omewa8e6.js → node-response-yp8zdyRp.js} +2 -2
  38. package/dist/_chunks/{node-response-omewa8e6.js.map → node-response-yp8zdyRp.js.map} +1 -1
  39. package/dist/_chunks/plugin-context-BtaQcMuh.js.map +1 -1
  40. package/dist/_chunks/{poison-scan-DONdiCGX.js → poison-scan-WQgUydF_.js} +2 -2
  41. package/dist/_chunks/{poison-scan-DONdiCGX.js.map → poison-scan-WQgUydF_.js.map} +1 -1
  42. package/dist/_chunks/{scanner-DSAJjH0x.js → scanner-C9Lrf77z.js} +3 -2
  43. package/dist/_chunks/{scanner-DSAJjH0x.js.map → scanner-C9Lrf77z.js.map} +1 -1
  44. package/dist/_chunks/{sizeof-DVhEVN_y.js → sizeof-BISkSaU0.js} +2 -2
  45. package/dist/_chunks/{sizeof-DVhEVN_y.js.map → sizeof-BISkSaU0.js.map} +1 -1
  46. package/dist/_chunks/{walkers-96YopJds.js → walkers-Bxv4v7tX.js} +3 -3
  47. package/dist/_chunks/{walkers-96YopJds.js.map → walkers-Bxv4v7tX.js.map} +1 -1
  48. package/dist/adapters/cloudflare-kv-cache.js +1 -1
  49. package/dist/analyze/crawl-entry.js +3 -3
  50. package/dist/analyze/graph-command.js +2 -2
  51. package/dist/cache/index.js +2 -2
  52. package/dist/cache/stores/memory.js +1 -1
  53. package/dist/cdn/workers-cache-purge.js +1 -1
  54. package/dist/cli.js +3 -3
  55. package/dist/client/browser-entry/action-dispatch.d.ts.map +1 -1
  56. package/dist/client/browser-entry/hydrate.d.ts +1 -1
  57. package/dist/client/browser-entry/router-init.d.ts.map +1 -1
  58. package/dist/client/error-boundary.d.ts +1 -0
  59. package/dist/client/error-boundary.d.ts.map +1 -1
  60. package/dist/client/error-boundary.js +1 -1
  61. package/dist/client/history.d.ts +4 -5
  62. package/dist/client/history.d.ts.map +1 -1
  63. package/dist/client/index.js +6 -7
  64. package/dist/client/index.js.map +1 -1
  65. package/dist/client/internal.d.ts +1 -1
  66. package/dist/client/internal.d.ts.map +1 -1
  67. package/dist/client/internal.js +194 -55
  68. package/dist/client/internal.js.map +1 -1
  69. package/dist/client/navigation-commit.d.ts +6 -25
  70. package/dist/client/navigation-commit.d.ts.map +1 -1
  71. package/dist/client/outlet-content-cache.d.ts +59 -0
  72. package/dist/client/outlet-content-cache.d.ts.map +1 -0
  73. package/dist/client/outlet-scope-context.d.ts +30 -0
  74. package/dist/client/outlet-scope-context.d.ts.map +1 -0
  75. package/dist/client/params-context.d.ts +10 -11
  76. package/dist/client/params-context.d.ts.map +1 -1
  77. package/dist/client/router-pipeline.d.ts +5 -5
  78. package/dist/client/router-pipeline.d.ts.map +1 -1
  79. package/dist/client/router-types.d.ts +10 -24
  80. package/dist/client/router-types.d.ts.map +1 -1
  81. package/dist/client/router.d.ts.map +1 -1
  82. package/dist/client/rsc-fetch.d.ts +4 -17
  83. package/dist/client/rsc-fetch.d.ts.map +1 -1
  84. package/dist/client/segment-cache.d.ts +15 -103
  85. package/dist/client/segment-cache.d.ts.map +1 -1
  86. package/dist/client/segment-outlet.d.ts +28 -52
  87. package/dist/client/segment-outlet.d.ts.map +1 -1
  88. package/dist/client/stale-segment.d.ts +39 -0
  89. package/dist/client/stale-segment.d.ts.map +1 -0
  90. package/dist/client/use-segment-params.d.ts +1 -1
  91. package/dist/config-types.d.ts +7 -6
  92. package/dist/config-types.d.ts.map +1 -1
  93. package/dist/index.d.ts.map +1 -1
  94. package/dist/index.js +9 -732
  95. package/dist/index.js.map +1 -1
  96. package/dist/native/rsc/manifest.json +6 -4
  97. package/dist/native/rsc/routing/segment-keys.js +3 -11
  98. package/dist/native/rsc/routing/segment-keys.js.map +1 -1
  99. package/dist/native/rsc/server/access-gate.js +3 -7
  100. package/dist/native/rsc/server/access-gate.js.map +1 -1
  101. package/dist/native/rsc/server/als-registry.js +2 -1
  102. package/dist/native/rsc/server/als-registry.js.map +1 -1
  103. package/dist/native/rsc/server/build-manifest.js.map +1 -1
  104. package/dist/native/rsc/server/chain-url-parts.js +1 -6
  105. package/dist/native/rsc/server/chain-url-parts.js.map +1 -1
  106. package/dist/native/rsc/server/client-state-tree.js +33 -0
  107. package/dist/native/rsc/server/client-state-tree.js.map +1 -0
  108. package/dist/native/rsc/server/flight-source-node.js +5 -2
  109. package/dist/native/rsc/server/flight-source-node.js.map +1 -1
  110. package/dist/native/rsc/server/flight-source.js +46 -7
  111. package/dist/native/rsc/server/flight-source.js.map +1 -1
  112. package/dist/native/rsc/server/pipeline-interception.js +1 -1
  113. package/dist/native/rsc/server/publish-params.js.map +1 -1
  114. package/dist/native/rsc/server/route-element-builder.js +43 -61
  115. package/dist/native/rsc/server/route-element-builder.js.map +1 -1
  116. package/dist/native/rsc/server/rsc-entry/helpers.js +5 -28
  117. package/dist/native/rsc/server/rsc-entry/helpers.js.map +1 -1
  118. package/dist/native/rsc/server/rsc-entry/render-route.js +33 -7
  119. package/dist/native/rsc/server/rsc-entry/render-route.js.map +1 -1
  120. package/dist/native/rsc/server/rsc-entry/revalidate-renderer.js +2 -1
  121. package/dist/native/rsc/server/rsc-entry/revalidate-renderer.js.map +1 -1
  122. package/dist/native/rsc/server/rsc-entry/rsc-payload.js +2 -5
  123. package/dist/native/rsc/server/rsc-entry/rsc-payload.js.map +1 -1
  124. package/dist/native/rsc/server/rsc-entry/rsc-stream.js +44 -40
  125. package/dist/native/rsc/server/rsc-entry/rsc-stream.js.map +1 -1
  126. package/dist/native/rsc/server/rsc-entry/ssr-renderer.js +1 -1
  127. package/dist/native/rsc/server/rsc-entry/ssr-renderer.js.map +1 -1
  128. package/dist/native/rsc/server/segment-hash/capture.js +107 -0
  129. package/dist/native/rsc/server/segment-hash/capture.js.map +1 -0
  130. package/dist/native/rsc/server/segment-hash/outlet.js +81 -0
  131. package/dist/native/rsc/server/segment-hash/outlet.js.map +1 -0
  132. package/dist/native/rsc/server/segment-hash/stream-tap.js +139 -0
  133. package/dist/native/rsc/server/segment-hash/stream-tap.js.map +1 -0
  134. package/dist/native/rsc/server/segment-hash/value-hash.js +171 -0
  135. package/dist/native/rsc/server/segment-hash/value-hash.js.map +1 -0
  136. package/dist/native/rsc/server/slot-resolver.js +20 -124
  137. package/dist/native/rsc/server/slot-resolver.js.map +1 -1
  138. package/dist/native/rsc/server/vite-handoff-rsc.js.map +1 -1
  139. package/dist/native/rsc/shared/outlet-decision.js +5 -0
  140. package/dist/native/rsc/shared/outlet-decision.js.map +1 -0
  141. package/dist/native/ssr/client/error-boundary.js +16 -3
  142. package/dist/native/ssr/client/error-boundary.js.map +1 -1
  143. package/dist/native/ssr/client/navigation-commit.js +1 -5
  144. package/dist/native/ssr/client/navigation-commit.js.map +1 -1
  145. package/dist/native/ssr/client/outlet-content-cache.js +53 -0
  146. package/dist/native/ssr/client/outlet-content-cache.js.map +1 -0
  147. package/dist/native/ssr/client/outlet-scope-context.js +12 -0
  148. package/dist/native/ssr/client/outlet-scope-context.js.map +1 -0
  149. package/dist/native/ssr/client/params-context.js.map +1 -1
  150. package/dist/native/ssr/client/rsc-fetch.js +1 -12
  151. package/dist/native/ssr/client/rsc-fetch.js.map +1 -1
  152. package/dist/native/ssr/client/segment-outlet.js +34 -13
  153. package/dist/native/ssr/client/segment-outlet.js.map +1 -1
  154. package/dist/native/ssr/client/stale-segment.js +29 -0
  155. package/dist/native/ssr/client/stale-segment.js.map +1 -0
  156. package/dist/native/ssr/manifest.json +5 -4
  157. package/dist/native/ssr/routing/segment-keys.js +5 -1
  158. package/dist/native/ssr/routing/segment-keys.js.map +1 -1
  159. package/dist/native/ssr/server/access-gate.js +3 -7
  160. package/dist/native/ssr/server/access-gate.js.map +1 -1
  161. package/dist/native/ssr/server/als-registry.js +1 -0
  162. package/dist/native/ssr/server/als-registry.js.map +1 -1
  163. package/dist/native/ssr/server/build-manifest.js.map +1 -1
  164. package/dist/native/ssr/server/client-state-tree.js +33 -0
  165. package/dist/native/ssr/server/client-state-tree.js.map +1 -0
  166. package/dist/native/ssr/server/flight-source-node.js +5 -2
  167. package/dist/native/ssr/server/flight-source-node.js.map +1 -1
  168. package/dist/native/ssr/server/flight-source.js +1 -0
  169. package/dist/native/ssr/server/flight-source.js.map +1 -1
  170. package/dist/native/ssr/server/pipeline-interception.js +1 -1
  171. package/dist/native/ssr/server/segment-hash/value-hash.js +162 -0
  172. package/dist/native/ssr/server/segment-hash/value-hash.js.map +1 -0
  173. package/dist/native/ssr/server/ssr-wrappers.js.map +1 -1
  174. package/dist/native/ssr/server/vite-handoff-rsc.js.map +1 -1
  175. package/dist/native/ssr/shared/payload-root.js.map +1 -1
  176. package/dist/plugin-context.d.ts +0 -16
  177. package/dist/plugin-context.d.ts.map +1 -1
  178. package/dist/plugins/build-manifest.d.ts.map +1 -1
  179. package/dist/routing/index.js +2 -2
  180. package/dist/routing/segment-keys.d.ts +8 -21
  181. package/dist/routing/segment-keys.d.ts.map +1 -1
  182. package/dist/server/access-gate.d.ts +0 -14
  183. package/dist/server/access-gate.d.ts.map +1 -1
  184. package/dist/server/als-registry.d.ts +16 -0
  185. package/dist/server/als-registry.d.ts.map +1 -1
  186. package/dist/server/build-manifest.d.ts +1 -10
  187. package/dist/server/build-manifest.d.ts.map +1 -1
  188. package/dist/server/chain-url-parts.d.ts +3 -13
  189. package/dist/server/chain-url-parts.d.ts.map +1 -1
  190. package/dist/server/client-state-tree.d.ts +31 -0
  191. package/dist/server/client-state-tree.d.ts.map +1 -0
  192. package/dist/server/flight-source-node.d.ts +6 -1
  193. package/dist/server/flight-source-node.d.ts.map +1 -1
  194. package/dist/server/flight-source.d.ts +27 -0
  195. package/dist/server/flight-source.d.ts.map +1 -1
  196. package/dist/server/index.js +2 -2
  197. package/dist/server/internal.js +48 -47
  198. package/dist/server/internal.js.map +1 -1
  199. package/dist/server/publish-params.d.ts +5 -4
  200. package/dist/server/publish-params.d.ts.map +1 -1
  201. package/dist/server/route-element-builder.d.ts +4 -19
  202. package/dist/server/route-element-builder.d.ts.map +1 -1
  203. package/dist/server/rsc-entry/helpers.d.ts +7 -13
  204. package/dist/server/rsc-entry/helpers.d.ts.map +1 -1
  205. package/dist/server/rsc-entry/render-route.d.ts.map +1 -1
  206. package/dist/server/rsc-entry/revalidate-renderer.d.ts.map +1 -1
  207. package/dist/server/rsc-entry/rsc-payload.d.ts +1 -2
  208. package/dist/server/rsc-entry/rsc-payload.d.ts.map +1 -1
  209. package/dist/server/rsc-entry/rsc-stream.d.ts +11 -2
  210. package/dist/server/rsc-entry/rsc-stream.d.ts.map +1 -1
  211. package/dist/server/rsc-entry/ssr-renderer.d.ts +0 -2
  212. package/dist/server/rsc-entry/ssr-renderer.d.ts.map +1 -1
  213. package/dist/server/segment-hash/capture.d.ts +77 -0
  214. package/dist/server/segment-hash/capture.d.ts.map +1 -0
  215. package/dist/server/segment-hash/outlet.d.ts +65 -0
  216. package/dist/server/segment-hash/outlet.d.ts.map +1 -0
  217. package/dist/server/segment-hash/stream-tap.d.ts +49 -0
  218. package/dist/server/segment-hash/stream-tap.d.ts.map +1 -0
  219. package/dist/server/segment-hash/value-hash.d.ts +70 -0
  220. package/dist/server/segment-hash/value-hash.d.ts.map +1 -0
  221. package/dist/server/slot-resolver.d.ts +13 -78
  222. package/dist/server/slot-resolver.d.ts.map +1 -1
  223. package/dist/server/ssr-wrappers.d.ts +7 -9
  224. package/dist/server/ssr-wrappers.d.ts.map +1 -1
  225. package/dist/server/vite-handoff-rsc.d.ts +10 -1
  226. package/dist/server/vite-handoff-rsc.d.ts.map +1 -1
  227. package/dist/shared/outlet-decision.d.ts +48 -0
  228. package/dist/shared/outlet-decision.d.ts.map +1 -0
  229. package/dist/shared/payload-root.d.ts +5 -8
  230. package/dist/shared/payload-root.d.ts.map +1 -1
  231. package/dist/shared/segment-info.d.ts +13 -28
  232. package/dist/shared/segment-info.d.ts.map +1 -1
  233. package/package.json +1 -1
  234. package/src/client/browser-entry/action-dispatch.ts +1 -15
  235. package/src/client/browser-entry/hydrate.ts +3 -3
  236. package/src/client/browser-entry/router-init.ts +28 -47
  237. package/src/client/error-boundary.tsx +49 -9
  238. package/src/client/history.ts +4 -5
  239. package/src/client/internal.ts +1 -1
  240. package/src/client/navigation-commit.ts +25 -83
  241. package/src/client/outlet-content-cache.ts +119 -0
  242. package/src/client/outlet-scope-context.ts +42 -0
  243. package/src/client/params-context.ts +11 -12
  244. package/src/client/router-pipeline.ts +10 -74
  245. package/src/client/router-types.ts +11 -26
  246. package/src/client/router.ts +7 -22
  247. package/src/client/rsc-fetch.ts +5 -30
  248. package/src/client/segment-cache.ts +19 -264
  249. package/src/client/segment-outlet.tsx +80 -72
  250. package/src/client/stale-segment.ts +60 -0
  251. package/src/client/use-segment-params.ts +1 -1
  252. package/src/config-types.ts +7 -6
  253. package/src/index.ts +0 -2
  254. package/src/plugin-context.ts +0 -16
  255. package/src/plugins/build-manifest.ts +1 -22
  256. package/src/routing/scanner.ts +12 -0
  257. package/src/routing/segment-keys.ts +9 -35
  258. package/src/rsc-runtime/vendor-types.d.ts +8 -0
  259. package/src/server/access-gate.tsx +3 -32
  260. package/src/server/als-registry.ts +23 -0
  261. package/src/server/build-manifest.ts +1 -11
  262. package/src/server/chain-url-parts.ts +3 -21
  263. package/src/server/client-state-tree.ts +75 -0
  264. package/src/server/flight-source-node.ts +7 -2
  265. package/src/server/flight-source.ts +102 -9
  266. package/src/server/pipeline-interception.ts +1 -1
  267. package/src/server/publish-params.ts +5 -4
  268. package/src/server/route-element-builder.ts +77 -206
  269. package/src/server/rsc-entry/helpers.ts +11 -65
  270. package/src/server/rsc-entry/render-route.ts +54 -28
  271. package/src/server/rsc-entry/revalidate-renderer.ts +2 -1
  272. package/src/server/rsc-entry/rsc-payload.ts +11 -39
  273. package/src/server/rsc-entry/rsc-stream.ts +123 -101
  274. package/src/server/rsc-entry/ssr-renderer.ts +1 -3
  275. package/src/server/segment-hash/capture.ts +232 -0
  276. package/src/server/segment-hash/outlet.ts +185 -0
  277. package/src/server/segment-hash/stream-tap.ts +244 -0
  278. package/src/server/segment-hash/value-hash.ts +338 -0
  279. package/src/server/slot-resolver.ts +37 -323
  280. package/src/server/ssr-wrappers.tsx +7 -9
  281. package/src/server/vite-handoff-rsc.ts +12 -1
  282. package/src/shared/outlet-decision.ts +54 -0
  283. package/src/shared/payload-root.ts +5 -8
  284. package/src/shared/segment-info.ts +13 -28
  285. package/dist/_chunks/chains-CmzbpG-6.js +0 -1
  286. package/dist/_chunks/dev-server--4_Ogy_6.js +0 -1
  287. package/dist/_chunks/dev-span-RsVeYYc_.js.map +0 -1
  288. package/dist/_chunks/error-boundary-Bh-egWUI.js.map +0 -1
  289. package/dist/_chunks/flight-source-node-BsrlUjMO.js.map +0 -1
  290. package/dist/client/segment-update-context.d.ts +0 -15
  291. package/dist/client/segment-update-context.d.ts.map +0 -1
  292. package/dist/client/slot-content-cache-context.d.ts +0 -35
  293. package/dist/client/slot-content-cache-context.d.ts.map +0 -1
  294. package/dist/native/rsc/server/request-dep.js +0 -12
  295. package/dist/native/rsc/server/request-dep.js.map +0 -1
  296. package/dist/native/rsc/server/route-element-helpers.js +0 -20
  297. package/dist/native/rsc/server/route-element-helpers.js.map +0 -1
  298. package/dist/native/rsc/server/skippable-prefix.js +0 -72
  299. package/dist/native/rsc/server/skippable-prefix.js.map +0 -1
  300. package/dist/native/rsc/server/state-tree-diff.js +0 -35
  301. package/dist/native/rsc/server/state-tree-diff.js.map +0 -1
  302. package/dist/native/ssr/client/segment-cache.js +0 -119
  303. package/dist/native/ssr/client/segment-cache.js.map +0 -1
  304. package/dist/native/ssr/client/segment-update-context.js +0 -9
  305. package/dist/native/ssr/client/segment-update-context.js.map +0 -1
  306. package/dist/native/ssr/client/slot-content-cache-context.js +0 -8
  307. package/dist/native/ssr/client/slot-content-cache-context.js.map +0 -1
  308. package/dist/native/ssr/server/state-tree-diff.js +0 -23
  309. package/dist/native/ssr/server/state-tree-diff.js.map +0 -1
  310. package/dist/plugins/request-dep/analysis.d.ts +0 -106
  311. package/dist/plugins/request-dep/analysis.d.ts.map +0 -1
  312. package/dist/plugins/request-dep/index.d.ts +0 -75
  313. package/dist/plugins/request-dep/index.d.ts.map +0 -1
  314. package/dist/plugins/request-dep/origin.d.ts +0 -61
  315. package/dist/plugins/request-dep/origin.d.ts.map +0 -1
  316. package/dist/server/request-dep.d.ts +0 -15
  317. package/dist/server/request-dep.d.ts.map +0 -1
  318. package/dist/server/route-element-helpers.d.ts +0 -12
  319. package/dist/server/route-element-helpers.d.ts.map +0 -1
  320. package/dist/server/skippable-prefix.d.ts +0 -29
  321. package/dist/server/skippable-prefix.d.ts.map +0 -1
  322. package/dist/server/state-tree-diff.d.ts +0 -78
  323. package/dist/server/state-tree-diff.d.ts.map +0 -1
  324. package/src/client/segment-update-context.ts +0 -23
  325. package/src/client/slot-content-cache-context.ts +0 -43
  326. package/src/plugins/request-dep/analysis.ts +0 -447
  327. package/src/plugins/request-dep/index.ts +0 -376
  328. package/src/plugins/request-dep/origin.ts +0 -310
  329. package/src/server/request-dep.ts +0 -37
  330. package/src/server/route-element-helpers.ts +0 -37
  331. package/src/server/skippable-prefix.ts +0 -172
  332. package/src/server/state-tree-diff.ts +0 -132
@@ -17,6 +17,7 @@ import { createNavigationCommitter } from './navigation-commit.ts';
17
17
 
18
18
  import { fetchRscPayload, NonRscResponse } from './rsc-fetch.ts';
19
19
  import { readPayloadTree, readPublishedParams } from '../shared/payload-root.ts';
20
+ import type { StateTree } from '../shared/segment-info.ts';
20
21
  import { isClientStale } from './stale-client.ts';
21
22
  import {
22
23
  createScrollEffects,
@@ -51,16 +52,11 @@ export function createRouter(deps: RouterDeps): RouterInstance {
51
52
 
52
53
  // Every write that makes a page "current", and the read that reports the
53
54
  // current page back to the server. See navigation-commit.ts.
54
- const {
55
- prepareNavigation,
56
- currentStateTree,
57
- committedSegmentInfo,
58
- isSegmentReuseSuppressed,
59
- restoreSegmentReuse,
60
- } = createNavigationCommitter({
55
+ const { prepareNavigation, currentStateTree, committedSegmentInfo } = createNavigationCommitter({
61
56
  segmentCache,
62
57
  historyStack,
63
58
  clientSegmentCache: () => deps.clientSegmentCache,
59
+ outletHashes: () => deps.outletContentCache?.hashes() ?? {},
64
60
  });
65
61
 
66
62
  // Ownership of the router: who is navigating, whose fetch may be cut, and
@@ -83,8 +79,6 @@ export function createRouter(deps: RouterDeps): RouterInstance {
83
79
  prefetchCache,
84
80
  currentStateTree,
85
81
  prepareNavigation,
86
- isSegmentReuseSuppressed,
87
- restoreSegmentReuse,
88
82
  markHandedOff,
89
83
  forgetOlderHandoffs,
90
84
  });
@@ -233,7 +227,7 @@ export function createRouter(deps: RouterDeps): RouterInstance {
233
227
  endings: NavigationEndings,
234
228
  opts: {
235
229
  /** Omitted by refresh(): the server renders the complete payload. */
236
- stateTree?: { segments: string[] };
230
+ stateTree?: StateTree;
237
231
  /** Restored after paint when present — traversals only. */
238
232
  scrollY?: number;
239
233
  externalSignal?: AbortSignal;
@@ -256,7 +250,6 @@ export function createRouter(deps: RouterDeps): RouterInstance {
256
250
  payload: result.payload,
257
251
  params,
258
252
  segmentInfo: result.segmentInfo,
259
- skippedSegments: result.skippedSegments,
260
253
  });
261
254
  return { ...result, params, navState, commit };
262
255
  });
@@ -353,9 +346,9 @@ export function createRouter(deps: RouterDeps): RouterInstance {
353
346
  // whatever was in flight before it (TIM-1022) — but the render still
354
347
  // goes out through a transition React may hold (a replayed tree can
355
348
  // suspend), so the publish rides that commit rather than running
356
- // here. Publishing first would advertise the replayed route's slot
357
- // keys while the slot content cache still describes the departing
358
- // one (TIM-1423, codex on #1108).
349
+ // here. Publishing first would report the replayed route's tree
350
+ // paths while the departing tree is still on screen (TIM-1423,
351
+ // codex on #1108).
359
352
  //
360
353
  // Routed through renderViaTransition so the replay gets the same
361
354
  // lifecycle every other render has — handoff tracking, commit-on-
@@ -377,7 +370,6 @@ export function createRouter(deps: RouterDeps): RouterInstance {
377
370
  commit,
378
371
  decodePromise: null,
379
372
  segmentInfo: entry.segmentInfo ?? null,
380
- skippedSegments: null,
381
373
  };
382
374
  });
383
375
  restoreScrollAfterPaint(scrollY);
@@ -525,7 +517,6 @@ export function createRouter(deps: RouterDeps): RouterInstance {
525
517
  commit,
526
518
  decodePromise: null,
527
519
  segmentInfo,
528
- skippedSegments: null,
529
520
  };
530
521
  }
531
522
  );
@@ -536,12 +527,6 @@ export function createRouter(deps: RouterDeps): RouterInstance {
536
527
  onIdle: (listener) => lifecycle.onIdle(listener),
537
528
  onTreeCommit: (listener) => lifecycle.onTreeCommit(listener),
538
529
  settleHandoffs: () => lifecycle.settleHandoffs(),
539
- suppressSegmentReuse(): void {
540
- // TIM-1466: uses invalidateReuse() instead of clear() to preserve
541
- // treePaths for interception scoping — a modal mounted on the current
542
- // tree must still be navigable (codex on #1167).
543
- segmentCache.invalidateReuse();
544
- },
545
530
  evictStaleCaches(): void {
546
531
  prefetchCache.clearReady();
547
532
  historyStack.clear();
@@ -52,8 +52,6 @@ export interface FetchResult {
52
52
  decodePromise: Promise<void> | null;
53
53
  /** Segment metadata from X-Timber-Segments header for populating the segment cache. */
54
54
  segmentInfo: SegmentInfo[] | null;
55
- /** Segment paths that were skipped by the server (for client-side merging). */
56
- skippedSegments: string[] | null;
57
55
  }
58
56
 
59
57
  // ─── URL Helpers ─────────────────────────────────────────────────
@@ -334,9 +332,9 @@ function warnMalformedHeader(headerName: string, raw: string): void {
334
332
  * Extract segment metadata from the X-Timber-Segments response header.
335
333
  * Returns null if the header is missing or malformed.
336
334
  *
337
- * Format: JSON array of {path, isRequestDependent} objects describing the rendered
338
- * segment chain from root to leaf. Used to populate the client-side
339
- * segment cache for state tree diffing on subsequent navigations.
335
+ * Format: JSON array of {path, segmentId?, treePath?} objects describing the
336
+ * mounted layout-bearing segments from root to leaf. The client reports the
337
+ * tree paths back for interception scoping (TIM-1282).
340
338
  */
341
339
  export function extractSegmentInfo(response: Response): SegmentInfo[] | null {
342
340
  const header = response.headers.get('X-Timber-Segments');
@@ -349,26 +347,6 @@ export function extractSegmentInfo(response: Response): SegmentInfo[] | null {
349
347
  }
350
348
  }
351
349
 
352
- /**
353
- * Extract skipped segment paths from the X-Timber-Skipped-Segments header.
354
- * Returns null if the header is missing or malformed.
355
- *
356
- * When the server skips sync layouts the client already has cached,
357
- * it sends this header listing the skipped segment paths (outermost first).
358
- * The client uses this to merge the partial payload with cached segments.
359
- */
360
- export function extractSkippedSegments(response: Response): string[] | null {
361
- const header = response.headers.get('X-Timber-Skipped-Segments');
362
- if (!header) return null;
363
- try {
364
- const parsed = JSON.parse(header);
365
- return Array.isArray(parsed) ? parsed : null;
366
- } catch {
367
- warnMalformedHeader('X-Timber-Skipped-Segments', header);
368
- return null;
369
- }
370
- }
371
-
372
350
  // ─── Redirect Error ──────────────────────────────────────────────
373
351
 
374
352
  /**
@@ -494,7 +472,7 @@ function trackStreamCompletion(body: ReadableStream<Uint8Array>): {
494
472
  export async function fetchRscPayload(
495
473
  url: string,
496
474
  deps: RouterDeps,
497
- stateTree?: { segments: string[] },
475
+ stateTree?: StateTree,
498
476
  currentUrl?: string,
499
477
  signal?: AbortSignal
500
478
  ): Promise<FetchResult> {
@@ -503,7 +481,7 @@ export async function fetchRscPayload(
503
481
  // Accept headers, so the route URL would return HTML.
504
482
  const staticTarget = staticMode ? toStaticRscUrl(url) : null;
505
483
  const fetchTarget = staticTarget ? staticTarget.url : url;
506
- // Static hosts resolve neither partial payloads nor intercepting routes,
484
+ // Static hosts resolve neither segment hashes nor intercepting routes,
507
485
  // so neither the state tree nor the source URL is sent — and neither may
508
486
  // fragment the cache key of a file that does not vary on them.
509
487
  const headers = staticMode
@@ -525,7 +503,6 @@ export async function fetchRscPayload(
525
503
  // consumes the body. Reading headers does NOT consume the body stream.
526
504
  const fetchPromise = deps.fetch(rscUrl, { headers, redirect: 'manual', signal });
527
505
  let segmentInfo: SegmentInfo[] | null = null;
528
- let skippedSegments: string[] | null = null;
529
506
  // Track when the full RSC body stream is consumed (not just shell).
530
507
  // Initialized to resolved for bodyless responses; overwritten when
531
508
  // the response has a body.
@@ -579,7 +556,6 @@ export async function fetchRscPayload(
579
556
  // Metadata (<title>/<meta>/<link>) now rides the RSC Flight payload
580
557
  // as React elements — React 19 Float handles them. See TIM-1151.
581
558
  segmentInfo = extractSegmentInfo(response);
582
- skippedSegments = extractSkippedSegments(response);
583
559
 
584
560
  // Wrap the body to track full stream consumption. createFromFetch's
585
561
  // thenable resolves when the root model (shell) arrives, but we need
@@ -630,6 +606,5 @@ export async function fetchRscPayload(
630
606
  params,
631
607
  decodePromise,
632
608
  segmentInfo,
633
- skippedSegments,
634
609
  };
635
610
  }
@@ -1,4 +1,4 @@
1
- // Segment Cache — stores the mounted segment tree and prefetched payloads
1
+ // Segment Cache — the mounted segment tree, and prefetched payloads.
2
2
  // See design/19-client-navigation.md for architecture details.
3
3
 
4
4
  import type { PublishedParams } from '../shared/payload-root.ts';
@@ -25,283 +25,38 @@ export interface PrefetchResult {
25
25
  * about to render, and not the ones already on screen.
26
26
  */
27
27
  params?: PublishedParams | Promise<PublishedParams>;
28
- /** Segment paths skipped by the server (for client-side merging). */
29
- skippedSegments?: string[] | null;
30
- }
31
-
32
- /**
33
- * A node in the client-side segment tree. Each node represents a mounted
34
- * layout or page segment with its RSC flight payload.
35
- */
36
- export interface SegmentNode {
37
- /** The segment's URL pattern (e.g., "/", "/dashboard", "/projects/[id]") */
38
- segment: string;
39
- /**
40
- * The segment's `app/` directory path, groups included (e.g. `/(browse)/feed`).
41
- * Undefined for slot nodes and for servers that predate the field.
42
- */
43
- treePath?: string;
44
- /** The RSC flight payload for this segment (opaque to the cache) */
45
- payload: unknown;
46
- /**
47
- * Whether the segment/slot is request-dependent (calls getHeaders,
48
- * getSearchParams, cookies, etc.). Request-dependent segments always
49
- * re-render on navigation. For segments, this is still based on the
50
- * AsyncFunction heuristic (to be replaced separately). For slots,
51
- * this is taint-tracked via ALS.
52
- */
53
- isRequestDependent: boolean;
54
- /** Child segments keyed by segment path */
55
- children: Map<string, SegmentNode>;
56
- /** Parallel route slots keyed by slot path (e.g., "/@sidebar") */
57
- slots?: Map<string, SegmentNode>;
58
- /** Whether this slot's access.ts denied on its last render. */
59
- denied?: boolean;
60
- /**
61
- * Content key for slot nodes — opaque string the server computed from
62
- * owner parts, slot name, entry file, and slot params. Advertised back
63
- * to the server so it can decide skips by key membership (TIM-1370).
64
- */
65
- contentKey?: string;
66
28
  }
67
29
 
68
30
  // ─── Segment Cache ───────────────────────────────────────────────
69
31
 
70
32
  /**
71
- * Maintains the client-side segment tree representing currently mounted
72
- * layouts and pages. Used for navigation reconciliation — the router diffs
73
- * new routes against this tree to determine which segments to re-fetch.
74
- */
75
- export class SegmentCache {
76
- private root: SegmentNode | undefined;
77
- /**
78
- * Monotonic counter. Bumped by `invalidateReuse()` (TIM-1466).
79
- * `serializeStateTree` suppresses `segments` and `slots` when
80
- * `reuseInvalidatedAt > reuseRestoredAt`. Only `restoreReuse()`
81
- * advances `reuseRestoredAt` — `set()` does not, because a
82
- * pre-invalidation navigation's commit thunk would lift suppression
83
- * before a post-invalidation request has been sent (codex on #1167).
84
- */
85
- private reuseInvalidatedAt = 0;
86
- private reuseRestoredAt = 0;
87
-
88
- get(segment: string): SegmentNode | undefined {
89
- if (segment === '/' || segment === this.root?.segment) {
90
- return this.root;
91
- }
92
- return undefined;
93
- }
94
-
95
- set(segment: string, node: SegmentNode): void {
96
- if (segment === '/' || !this.root) {
97
- this.root = node;
98
- }
99
- }
100
-
101
- clear(): void {
102
- this.root = undefined;
103
- this.reuseRestoredAt = this.reuseInvalidatedAt;
104
- }
105
-
106
- /**
107
- * Suppress segment and slot reuse without destroying the tree
108
- * structure (TIM-1466). `serializeStateTree` sends empty
109
- * `segments`/`slots` (forcing a full render) while `treePaths`
110
- * still reflects the mounted tree for interception scoping.
111
- * Call `restoreReuse()` once post-invalidation data has been
112
- * fetched and committed.
113
- */
114
- invalidateReuse(): void {
115
- this.reuseInvalidatedAt++;
116
- }
117
-
118
- /**
119
- * Lift reuse suppression. Called after the segment cache has been
120
- * rebuilt from a response that was fetched with suppression active
121
- * (i.e. the server sent a full render). Safe to call idempotently.
122
- */
123
- restoreReuse(): void {
124
- this.reuseRestoredAt = this.reuseInvalidatedAt;
125
- }
126
-
127
- /** Whether segment/slot reuse is currently suppressed (TIM-1466). */
128
- isReuseSuppressed(): boolean {
129
- return this.reuseInvalidatedAt > this.reuseRestoredAt;
130
- }
131
-
132
- /**
133
- * Serialize the mounted segment tree for the X-Timber-State-Tree header.
134
- * Only includes sync segments — async segments are excluded because the
135
- * server must always re-render them (they may depend on request context).
136
- *
137
- * When mergeableFilter is provided, only segments whose paths are in the
138
- * set are included. This ensures the server only skips segments that the
139
- * client can actually merge (i.e., segments whose cached element tree
140
- * contains an inner SegmentProvider the merger can splice into).
141
- *
142
- * `treePaths` is collected UNFILTERED, unlike `segments` and `slots`. Those
143
- * two answer "what may the server skip re-rendering?", so every reason a
144
- * segment cannot be reused is a reason to leave it out. `treePaths` answers
145
- * "what is mounted right now?" for interception scoping — a request-dependent
146
- * layout is still on screen, and dropping it would silently narrow the scope
147
- * the server sees and cancel a modal that should open (TIM-1282).
148
- *
149
- * This is a performance optimization only, NOT a security boundary.
150
- * The server always runs all access.ts files regardless of the state tree.
151
- */
152
- serializeStateTree(mergeableFilter?: Set<string>): StateTree {
153
- const segments: string[] = [];
154
- const slots: string[] = [];
155
- const treePaths: string[] = [];
156
- const suppressed = this.reuseInvalidatedAt > this.reuseRestoredAt;
157
- if (this.root) {
158
- if (!suppressed) {
159
- collectSyncSegments(this.root, segments, mergeableFilter);
160
- collectSyncSlots(this.root, slots);
161
- }
162
- collectTreePaths(this.root, treePaths);
163
- }
164
- const tree: StateTree = { segments };
165
- if (slots.length > 0) {
166
- tree.slots = slots;
167
- }
168
- if (treePaths.length > 0) {
169
- tree.treePaths = treePaths;
170
- }
171
- return tree;
172
- }
173
- }
174
-
175
- /** Recursively collect sync segment paths from the tree */
176
- function collectSyncSegments(
177
- node: SegmentNode,
178
- out: string[],
179
- mergeableFilter?: Set<string>
180
- ): void {
181
- if (!node.isRequestDependent && (!mergeableFilter || mergeableFilter.has(node.segment))) {
182
- out.push(node.segment);
183
- }
184
- for (const child of node.children.values()) {
185
- collectSyncSegments(child, out, mergeableFilter);
186
- }
187
- }
188
-
189
- /**
190
- * Recursively collect the `app/` directory path of every mounted segment.
33
+ * The client's record of which layout-bearing segments are mounted — the
34
+ * `treePaths` half of `X-Timber-State-Tree`, which the server reads for
35
+ * interception scoping (TIM-1282).
191
36
  *
192
- * Slots are not walked: a slot's own sub-tree can never own an intercepting
193
- * slot's scope, because scopes are always ordinary segments (`interception.ts`
194
- * derives one from the slot owner's ancestor chain).
195
- */
196
- function collectTreePaths(node: SegmentNode, out: string[]): void {
197
- if (node.treePath) out.push(node.treePath);
198
- for (const child of node.children.values()) {
199
- collectTreePaths(child, out);
200
- }
201
- }
202
-
203
- /**
204
- * Recursively collect content keys from cacheable slots.
37
+ * Content reuse is not decided here. The outlet content cache holds what the
38
+ * client can reuse, keyed by segment hash (client/outlet-content-cache.ts,
39
+ * design/52-segment-hash-dedupe.md).
205
40
  *
206
- * The server advertises a content key per slot on every render (TIM-1370),
207
- * encoding the owner's URL parts, the slot name, the matched entry file,
208
- * and the slot's params. The client stores this key and sends it back on
209
- * the next navigation so the server can decide skips by key membership —
210
- * no departing URL reconstruction needed.
41
+ * Written only by a navigation's commit (`navigation-commit.ts`), so a
42
+ * superseded navigation never describes the mounted tree (TIM-1301).
211
43
  */
212
- function collectSyncSlots(node: SegmentNode, out: string[]): void {
213
- if (node.slots) {
214
- for (const slot of node.slots.values()) {
215
- if (!slot.isRequestDependent && !slot.denied && slot.contentKey) {
216
- out.push(slot.contentKey);
217
- }
218
- }
219
- }
220
- for (const child of node.children.values()) {
221
- collectSyncSlots(child, out);
222
- }
223
- }
224
-
225
- // ─── Segment Tree Builder ────────────────────────────────────────
226
-
227
- /**
228
- * Build a SegmentNode tree from flat segment metadata.
229
- *
230
- * Takes an ordered list of segment descriptors (root → leaf) from the
231
- * server's X-Timber-Segments header and constructs the hierarchical
232
- * tree structure that SegmentCache expects.
233
- *
234
- * Each segment is nested as a child of the previous one, forming a
235
- * linear chain from root to leaf. The leaf segment (page) is excluded
236
- * from the tree — pages are never cached across navigations.
237
- */
238
- export function buildSegmentTree(segments: SegmentInfo[]): SegmentNode | undefined {
239
- // Need at least a root segment to build a tree
240
- if (segments.length === 0) return undefined;
44
+ export class SegmentCache {
45
+ private paths: string[] = [];
241
46
 
242
- // Separate slot entries from segment entries. Slots are attached to
243
- // their parent segment node after the main chain is built.
244
- const segmentEntries: SegmentInfo[] = [];
245
- const slotEntries: SegmentInfo[] = [];
246
- for (const info of segments) {
247
- if (info.slot) {
248
- slotEntries.push(info);
249
- } else {
250
- segmentEntries.push(info);
251
- }
47
+ /** Replace the record with the chain a committed page mounted. */
48
+ record(segmentInfo: readonly SegmentInfo[]): void {
49
+ this.paths = segmentInfo.flatMap((info) => (info.treePath ? [info.treePath] : []));
252
50
  }
253
51
 
254
- // Build the main segment chain.
255
- let root: SegmentNode | undefined;
256
- let parent: SegmentNode | undefined;
257
- const nodeById = new Map<string, SegmentNode>();
258
-
259
- for (const info of segmentEntries) {
260
- const id = info.segmentId ?? info.path;
261
- const node: SegmentNode = {
262
- segment: id,
263
- treePath: info.treePath,
264
- payload: null,
265
- isRequestDependent: info.isRequestDependent,
266
- children: new Map(),
267
- };
268
-
269
- nodeById.set(id, node);
270
-
271
- if (!root) {
272
- root = node;
273
- }
274
-
275
- if (parent) {
276
- parent.children.set(id, node);
277
- }
278
-
279
- parent = node;
52
+ clear(): void {
53
+ this.paths = [];
280
54
  }
281
55
 
282
- // Attach slot entries to their parent segment nodes.
283
- for (const slotInfo of slotEntries) {
284
- const parentId = slotInfo.parentSegment;
285
- const parentNode = parentId ? nodeById.get(parentId) : root;
286
- if (!parentNode) continue;
287
-
288
- const slotId = slotInfo.segmentId ?? slotInfo.path;
289
- const slotNode: SegmentNode = {
290
- segment: slotId,
291
- payload: null,
292
- isRequestDependent: slotInfo.isRequestDependent,
293
- children: new Map(),
294
- denied: slotInfo.denied,
295
- contentKey: slotInfo.contentKey,
296
- };
297
-
298
- if (!parentNode.slots) {
299
- parentNode.slots = new Map();
300
- }
301
- parentNode.slots.set(slotId, slotNode);
56
+ /** The `app/` directory paths of the mounted segments, root first. */
57
+ treePaths(): string[] {
58
+ return [...this.paths];
302
59
  }
303
-
304
- return root;
305
60
  }
306
61
 
307
62
  // ─── Prefetch Cache ──────────────────────────────────────────────