@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
@@ -1 +1 @@
1
- {"version":3,"file":"slot-resolver.d.ts","sourceRoot":"","sources":["../../src/server/slot-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAOH,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAIrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAO9D,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAK5E,KAAK,eAAe,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,KAAK,CAAC,YAAY,CAAC;AAgClE;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,mBAAmB,EAC7B,KAAK,EAAE,UAAU,EACjB,CAAC,EAAE,eAAe,EAClB,GAAG,EAAE,OAAO,EACZ,YAAY,CAAC,EAAE,mBAAmB,EAClC,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC,CAyJpC;AA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CAAC,YAAY,GAAG,IAAI,CAAC,CAyJpC;AAqND,sEAAsE;AACtE,MAAM,WAAW,eAAe;IAC9B,yCAAyC;IACzC,IAAI,EAAE,WAAW,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC/C,+EAA+E;IAC/E,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,wGAAwG;IACxG,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;CAC/C;AAED;;;;;;;;;;;;;;GAcG;AACH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,mBAAmB,EAC7B,QAAQ,EAAE,mBAAmB,EAAE,GAC9B,MAAM,CAQR;AA6BD,UAAU,oBAAoB;IAC5B,OAAO,EAAE,mBAAmB,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,UAAU,CAAC;IAClB,CAAC,EAAE,eAAe,CAAC;IACnB,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,kCAAkC;IAClC,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,EAAE,iBAAiB,CAAC;CAC3B;AAED,0DAA0D;AAC1D,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,OAAO,EAAE,UAAU,EAAE,CAAC;CACvB;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,EACrC,OAAO,EACP,SAAS,EACT,KAAK,EACL,CAAC,EACD,YAAY,EACZ,cAAc,EACd,GAAG,EACH,MAAM,GACP,EAAE,oBAAoB,GAAG,OAAO,CAAC,aAAa,CAAC,CAuB/C"}
@@ -11,7 +11,7 @@
11
11
  * hydrate.ts too) wraps the RSC element with:
12
12
  * NavigationRoot → Fragment(TopLoader | null, ...) →
13
13
  * TimberNuqsAdapter → NuqsAdapterProvider →
14
- * SlotContentCacheContext.Provider → SegmentUpdateContext.Provider →
14
+ * OutletContentCacheContext.Provider →
15
15
  * NavigationProvider → PayloadRoot → ParamsProvider → element
16
16
  *
17
17
  * The SSR tree renders the REAL NavigationProvider and PayloadRoot rather
@@ -38,9 +38,8 @@
38
38
  * child — here, `Fragment(TopLoader, element)`. A single-child wrapper, plain
39
39
  * component or context provider, leaves every id below it unchanged; that is
40
40
  * verified by tests/ssr-wrapper-parity.test.ts, not assumed. So the
41
- * client-only `SegmentUpdateContext.Provider` and
42
- * `SlotContentCacheContext.Provider` (single child each) have no mirror
43
- * here and need none. Mirror a new wrapper only if it branches.
41
+ * client-only `OutletContentCacheContext.Provider` (single child) has no
42
+ * mirror here and needs none. Mirror a new wrapper only if it branches.
44
43
  *
45
44
  * Related issues: facebook/react#24669, radix-ui/primitives#3700
46
45
  * See design/02-rendering-pipeline.md §"RSC → SSR → Client Hydration"
@@ -73,11 +72,10 @@ export interface SsrWrapOptions {
73
72
  * → Fragment(TopLoader | null, element)
74
73
  * → TimberNuqsAdapter
75
74
  * → NuqsAdapterProvider (from createAdapterProvider)
76
- * → SlotContentCacheContext.Provider (client-only, single child)
77
- * → SegmentUpdateContext.Provider (client-only, single child)
78
- * → NavigationProvider
79
- * → PayloadRoot → ParamsProvider
80
- * → [RSC element]
75
+ * → OutletContentCacheContext.Provider (client-only, single child)
76
+ * → NavigationProvider
77
+ * → PayloadRoot → ParamsProvider
78
+ * → [RSC element]
81
79
  *
82
80
  * SSR tree (this function):
83
81
  * SsrNavigationRoot
@@ -1 +1 @@
1
- {"version":3,"file":"ssr-wrappers.d.ts","sourceRoot":"","sources":["../../src/server/ssr-wrappers.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,OAAO,EAA2B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAyChE,oDAAoD;AACpD,MAAM,WAAW,cAAc;IAC7B,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,YAAY,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,cAAc,GAAG,SAAS,CAmBlF"}
1
+ {"version":3,"file":"ssr-wrappers.d.ts","sourceRoot":"","sources":["../../src/server/ssr-wrappers.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,OAAO,EAA2B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAyChE,oDAAoD;AACpD,MAAM,WAAW,cAAc;IAC7B,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,YAAY,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,cAAc,GAAG,SAAS,CAmBlF"}
@@ -36,13 +36,22 @@ import type { DenyLastResort } from '../client/deny-last-resort.tsx';
36
36
  * decoder; the runtime only ever passes a stream and inspects the result, and
37
37
  * the narrower type is what a test double can satisfy.
38
38
  */
39
+ /**
40
+ * The decode half of Flight's temporary references: each `$T<id>` in the
41
+ * stream is replaced by `get('$' + id)`. React's client reads only `get`.
42
+ */
43
+ export interface TemporaryReferenceLookup {
44
+ get(key: string): unknown;
45
+ }
39
46
  export interface RscFlightRuntime {
40
47
  renderFlight: typeof FlightAdapter.renderFlight;
41
48
  loadServerAction: typeof FlightAdapter.loadServerAction;
42
49
  decodeReply: typeof FlightAdapter.decodeReply;
43
50
  decodeAction: typeof FlightAdapter.decodeAction;
44
51
  decodeFormState: typeof FlightAdapter.decodeFormState;
45
- createFromReadableStream: (stream: ReadableStream<Uint8Array>) => Promise<unknown>;
52
+ createFromReadableStream: (stream: ReadableStream<Uint8Array>, options?: {
53
+ temporaryReferences?: TemporaryReferenceLookup;
54
+ }) => Promise<unknown>;
46
55
  }
47
56
  /**
48
57
  * timber's own `'use client'` components that server code renders. In the RSC
@@ -1 +1 @@
1
- {"version":3,"file":"vite-handoff-rsc.d.ts","sourceRoot":"","sources":["../../src/server/vite-handoff-rsc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,KAAK,aAAa,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,KAAK,iBAAiB,MAAM,mCAAmC,CAAC;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAErE;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,OAAO,aAAa,CAAC,YAAY,CAAC;IAChD,gBAAgB,EAAE,OAAO,aAAa,CAAC,gBAAgB,CAAC;IACxD,WAAW,EAAE,OAAO,aAAa,CAAC,WAAW,CAAC;IAC9C,YAAY,EAAE,OAAO,aAAa,CAAC,YAAY,CAAC;IA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MAAM,wBAAwB,EAAE,gBAAgB,CAAC,0BAA0B,CACnC,CAAC;AAChD,eAAO,MAAM,OAAO,EAAE,OAAO,OAA+C,CAAC"}
@@ -0,0 +1,48 @@
1
+ /**
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).
5
+ *
6
+ * A segment is either sent or skipped:
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
+ * - **Skip** — the client already holds content with this `hash`, and the
14
+ * server just produced identical output. `outlets` carries the decisions
15
+ * for the segments nested directly inside it, because the client renders
16
+ * its cached copy of this segment and that copy still holds the old ones.
17
+ *
18
+ * The outlet receives the decision as a promise when the server had to
19
+ * render the segment once before deciding, and as a plain value otherwise.
20
+ *
21
+ * See design/52-segment-hash-dedupe.md §"Wire format".
22
+ */
23
+ import type { ReactNode } from 'react';
24
+ export type OutletDecision = LiveDecision | SkipDecision;
25
+ export interface LiveDecision {
26
+ skip?: undefined;
27
+ hash?: PromiseLike<string | null>;
28
+ children: ReactNode;
29
+ }
30
+ export interface SkipDecision {
31
+ skip: true;
32
+ hash: string;
33
+ /** The decisions of the segments nested directly inside, by segment path. */
34
+ outlets: Record<string, OutletDecisionValue>;
35
+ }
36
+ /**
37
+ * What a nested outlet carries inside a segment-hash capture, in place of a
38
+ * decision: an opaque marker Flight writes as a temporary reference and the
39
+ * capture's decoder replaces with the real decision. Never reaches a client.
40
+ */
41
+ export interface CaptureHole {
42
+ readonly captureHole: true;
43
+ }
44
+ /** A decision as an outlet receives it. */
45
+ export type OutletDecisionValue = OutletDecision | PromiseLike<OutletDecision>;
46
+ /** The `segmentPath` of the metadata outlet — one per payload. */
47
+ export declare const METADATA_OUTLET_PATH = "#metadata";
48
+ //# sourceMappingURL=outlet-decision.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outlet-decision.d.ts","sourceRoot":"","sources":["../../src/shared/outlet-decision.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,YAAY,CAAC;AAEzD,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAClC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;CAC9C;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC;CAC5B;AAED,2CAA2C;AAC3C,MAAM,MAAM,mBAAmB,GAAG,cAAc,GAAG,WAAW,CAAC,cAAc,CAAC,CAAC;AAE/E,kEAAkE;AAClE,eAAO,MAAM,oBAAoB,cAAc,CAAC"}
@@ -9,15 +9,12 @@
9
9
  * Two reasons it is a sibling field rather than a provider inside the payload
10
10
  * (TIM-1297, which is TIM-1294's mechanism corrected):
11
11
  *
12
- * 1. **A provider inside the payload cannot serve a partial navigation.** The
13
- * client keeps the previous tree and splices the new payload in at the
14
- * first updated `SegmentOutlet`, so the payload's own provider lands
15
- * *below* the retained region — and the retained region's root is the
16
- * *departing* route's provider, which therefore wins for every reader in a
17
- * skipped layout. Wrapping something above it does not help: context
18
- * resolves to the nearest provider, and the departing one is nearer.
12
+ * 1. **A provider inside the payload cannot reach a skipped segment.** A
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
15
+ * inside it when it was committed — never the incoming route's provider.
19
16
  * Params belong to the *navigation*, so the provider has to be owned by the
20
- * client, above the merge point, and there must be exactly one.
17
+ * client, above the payload root, and there must be exactly one.
21
18
  *
22
19
  * 2. **Element props are not readable at the instant the root resolves.**
23
20
  * Flight outlines a React element's props and fills the record in after the
@@ -1 +1 @@
1
- {"version":3,"file":"payload-root.d.ts","sourceRoot":"","sources":["../../src/shared/payload-root.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,0CAA0C;AAC1C,MAAM,WAAW,eAAe;IAC9B,uCAAuC;IACvC,MAAM,EAAE,aAAa,CAAC;IACtB,6EAA6E;IAC7E,UAAU,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACrC;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,GAAG,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAEtE,sCAAsC;AACtC,MAAM,WAAW,cAAe,SAAQ,eAAe;IACrD,gCAAgC;IAChC,IAAI,EAAE,OAAO,CAAC;CACf;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB,EAAE,eAAkD,CAAC;AAarF;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,eAAe,CAGpE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAKtD;AAED,4EAA4E;AAC5E,MAAM,WAAW,YAAY;IAC3B,yEAAyE;IACzE,IAAI,EAAE,OAAO,CAAC;IACd;;;;;;;;;;OAUG;IACH,MAAM,EAAE,YAAY,CAAC;CACtB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,YAAY,CAgB5D"}
1
+ {"version":3,"file":"payload-root.d.ts","sourceRoot":"","sources":["../../src/shared/payload-root.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,0CAA0C;AAC1C,MAAM,WAAW,eAAe;IAC9B,uCAAuC;IACvC,MAAM,EAAE,aAAa,CAAC;IACtB,6EAA6E;IAC7E,UAAU,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACrC;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,GAAG,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAEtE,sCAAsC;AACtC,MAAM,WAAW,cAAe,SAAQ,eAAe;IACrD,gCAAgC;IAChC,IAAI,EAAE,OAAO,CAAC;CACf;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB,EAAE,eAAkD,CAAC;AAarF;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,eAAe,CAGpE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAKtD;AAED,4EAA4E;AAC5E,MAAM,WAAW,YAAY;IAC3B,yEAAyE;IACzE,IAAI,EAAE,OAAO,CAAC;IACd;;;;;;;;;;OAUG;IACH,MAAM,EAAE,YAAY,CAAC;CACtB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,YAAY,CAgB5D"}
@@ -12,16 +12,16 @@
12
12
  * See design/07-routing.md §"Intercepting Routes"
13
13
  */
14
14
  /**
15
- * Metadata for one rendered segment or slot, sent via `X-Timber-Segments`.
15
+ * One mounted layout-bearing segment, sent via `X-Timber-Segments`.
16
16
  */
17
17
  export interface SegmentInfo {
18
- /** The segment's URL path (e.g. `/`, `/feed`), or the slot key for slots. */
18
+ /** The segment's URL path (e.g. `/`, `/feed`). */
19
19
  path: string;
20
20
  /** Outlet key — includes route group name when applicable (e.g. `/(marketing)`). */
21
21
  segmentId?: string;
22
22
  /**
23
23
  * The segment's directory path in `app/`, groups included and slots elided
24
- * (e.g. `app/(browse)/feed` → `/(browse)/feed`). Absent on slot entries.
24
+ * (e.g. `app/(browse)/feed` → `/(browse)/feed`).
25
25
  *
26
26
  * This is the identity interception scoping compares against, and it is the
27
27
  * reason it travels: `path`/`segmentId` are URL-addressed and collapse
@@ -29,38 +29,23 @@ export interface SegmentInfo {
29
29
  * tell those two directories apart. See `computeSegmentTreePaths`.
30
30
  */
31
31
  treePath?: string;
32
- isRequestDependent: boolean;
33
- /** True for parallel route slot entries, keyed by slot path (e.g. `/@sidebar`). */
34
- slot?: boolean;
35
- /** Parent segment path for slot entries — attaches the slot to its SegmentNode. */
36
- parentSegment?: string;
37
- /** True when the slot's access.ts denied on this render. Denied slots are excluded from the state tree. */
38
- denied?: boolean;
39
- /** True when the slot was skipped (cached content reused). Payloads with skipped slots are not replayable. */
40
- skipped?: boolean;
41
- /**
42
- * Content key for slot entries — encodes owner parts, slot name, matched
43
- * entry file, and slot params. The client stores and advertises this key;
44
- * the server computes the destination key and checks membership.
45
- * Replaces URL-based departing/destination diffing (TIM-1370).
46
- */
47
- contentKey?: string;
48
32
  }
49
33
  /**
50
34
  * The client's `X-Timber-State-Tree` request header.
51
35
  *
52
- * `segments` and `slots` are a caching optimization — they tell the server what
53
- * the client can reuse. `treePaths` is not: it describes the *shape* of the
54
- * tree currently on screen, so the server can answer "does the rendered route
55
- * pass through the segment that owns this intercepting slot?" without
56
- * re-deriving it from the address bar, which stops being the source route the
57
- * moment a modal is open (TIM-1282).
36
+ * `hashes` is the caching half: the segment hashes the client holds content
37
+ * for, by outlet path, sent only when the app opted into
38
+ * `clientSegmentCache` (design/52-segment-hash-dedupe.md). `treePaths` is
39
+ * not caching: it describes the *shape* of the tree currently on screen, so
40
+ * the server can answer "does the rendered route pass through the segment
41
+ * that owns this intercepting slot?" without re-deriving it from the address
42
+ * bar, which stops being the source route the moment a modal is open
43
+ * (TIM-1282).
58
44
  *
59
- * None of the three is a security input. Every `access.ts` runs regardless.
45
+ * Neither is a security input. Every `access.ts` runs regardless.
60
46
  */
61
47
  export interface StateTree {
62
- segments: string[];
63
- slots?: string[];
48
+ hashes?: Record<string, string>;
64
49
  treePaths?: string[];
65
50
  }
66
51
  //# sourceMappingURL=segment-info.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"segment-info.d.ts","sourceRoot":"","sources":["../../src/shared/segment-info.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,oFAAoF;IACpF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,mFAAmF;IACnF,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,mFAAmF;IACnF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2GAA2G;IAC3G,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,8GAA8G;IAC9G,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB"}
1
+ {"version":3,"file":"segment-info.d.ts","sourceRoot":"","sources":["../../src/shared/segment-info.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,oFAAoF;IACpF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timber-js/app",
3
- "version": "0.2.0-alpha.239",
3
+ "version": "0.2.0-alpha.240",
4
4
  "description": "Vite-native React framework built for Servers and Serverless Platforms — correct HTTP semantics, real status codes, pages that work without JavaScript",
5
5
  "keywords": [
6
6
  "cloudflare-workers",
@@ -125,29 +125,15 @@ export function setupServerActions(): void {
125
125
  } catch (error) {
126
126
  // A raw server function that throws arrives as a rejected root
127
127
  // (TIM-1570). It may have mutated before it threw, so no payload
128
- // cached before it may be reused, nor the mounted shared layouts on
129
- // the next navigation. No refresh: the rejection renders the nearest
128
+ // cached before it may be reused. No refresh: the rejection renders the nearest
130
129
  // error boundary, and a refresh would hand that boundary new
131
130
  // children, which resets it and hides the error (error-boundary.tsx).
132
131
  if (answered && router) {
133
- router.suppressSegmentReuse();
134
132
  router.evictStaleCaches();
135
133
  }
136
134
  throw error;
137
135
  }
138
136
 
139
- // The mutation happened server-side, and the next thing on screen is
140
- // not a full render of the current page: revalidatePath named only
141
- // other pages (TIM-1454), or the action redirected — from its body, or
142
- // from a current-page revalidation whose render redirected (TIM-1461).
143
- // Cached payloads go with the eviction below; this covers the mounted
144
- // shared layouts the segment cache would otherwise let the server skip
145
- // on the next navigation (TIM-1466). The tree and refresh branches
146
- // re-render every layout, so they need neither.
147
- if (router && (invalidated || hasRedirect)) {
148
- router.suppressSegmentReuse();
149
- }
150
-
151
137
  // TIM-1476: Evict all prefetch cache entries and history stack
152
138
  // payloads after every action — the mutation may affect data any route
153
139
  // reads, not just the paths the server named, and an action that
@@ -102,7 +102,7 @@ function takeEmbeddedSegmentInfo(): SegmentInfo[] | null {
102
102
  * when an RSC payload is available.
103
103
  *
104
104
  * Wraps the payload with the router's chain (NavigationProvider,
105
- * TimberNuqsAdapter, the slot content cache, ...) and hydrates the router's
105
+ * TimberNuqsAdapter, the outlet content cache, ...) and hydrates the router's
106
106
  * React root with it, on the document.
107
107
  *
108
108
  * When no RSC payload is available (JS-only client) the page is committed
@@ -117,8 +117,8 @@ export function hydrateApp({ rscResult, reactRoot, hydrate, formState }: Hydrate
117
117
  // The chain is the router's own `renderTree`, not a copy: an element type
118
118
  // that is present here and absent on the first navigation (or the
119
119
  // reverse) changes the type at that position, and React remounts
120
- // everything below it — losing the layout state partial navigation exists
121
- // to preserve. Sharing the function makes that impossible by construction.
120
+ // everything below it — losing the layout state an unchanged segment keeps
121
+ // across a navigation. Sharing the function makes that impossible by construction.
122
122
  //
123
123
  // `rscResult.params` is the payload's params promise, not a resolved
124
124
  // record: the inlined Flight stream is still arriving and hydration cannot
@@ -19,8 +19,7 @@ import { TimberNuqsAdapter } from '../nuqs-adapter.tsx';
19
19
  import { NavigationProvider } from '../navigation-context.ts';
20
20
  import { navigateTransition, type RenderOwner } from '../navigation-transition.ts';
21
21
  import type { NavigationRender } from '../navigation-root.tsx';
22
- import { SegmentUpdateContext, EMPTY_SEGMENT_UPDATES } from '../segment-update-context.ts';
23
- import { SlotContentCacheContext, type SlotContentCache } from '../slot-content-cache-context.ts';
22
+ import { OutletContentCache, OutletContentCacheContext } from '../outlet-content-cache.ts';
24
23
  import {
25
24
  hasNavigationApi,
26
25
  setupNavigationApi,
@@ -72,12 +71,10 @@ export function createTimberRouter(options: RouterInitOptions): RouterInitResult
72
71
  * it renders — the client's one record of the displayed page. Null until
73
72
  * a page with a payload is on screen (a document hydrated without one).
74
73
  *
75
- * The unwrapped tree is kept because a partial navigation re-wraps this
76
- * same element with new context so mounted SegmentOutlets are preserved
77
- * (they pick up changes via SegmentUpdateContext, not from new children
78
- * props). The params and location are kept beside it because the render
79
- * paths that do NOT receive a payload — a shallow search update, a partial
80
- * navigation — must republish them rather than drop them.
74
+ * The unwrapped tree is kept because a shallow search update re-wraps this
75
+ * same element with new context. The params and location are kept beside
76
+ * it because that render path does NOT receive a payload, and must
77
+ * republish them rather than drop them.
81
78
  *
82
79
  * The location used to live in a separate `globalThis` store as well,
83
80
  * written by the router's commit, by hydration and by the shallow search
@@ -85,12 +82,13 @@ export function createTimberRouter(options: RouterInitOptions): RouterInitResult
85
82
  */
86
83
  let displayed: { tree: unknown; params: ParamsSource; navState: NavigationState } | null = null;
87
84
 
88
- // The slot content the client has committed, by segmentPath. Owned here so
89
- // there is exactly one per router (never a module or globalThis singleton —
90
- // SegmentOutlet also executes during SSR, where a process-wide Map would be
91
- // shared across requests). Read by SegmentOutlet in render, written by it
92
- // at commit only. See client/slot-content-cache-context.ts (TIM-1423).
93
- const slotContentCache: SlotContentCache = new Map();
85
+ // The outlet content the client has committed, by segment path and hash.
86
+ // Owned here so there is exactly one per router (never a module or
87
+ // globalThis singleton — SegmentOutlet also executes during SSR, where a
88
+ // process-wide record would be shared across requests). Read by
89
+ // SegmentOutlet in render, written by it at commit only, and read by the
90
+ // router for the hashes it advertises. See client/outlet-content-cache.ts.
91
+ const outletContentCache = new OutletContentCache();
94
92
 
95
93
  /**
96
94
  * Build the client's wrapper chain around a tree. **The only place it is
@@ -101,14 +99,15 @@ export function createTimberRouter(options: RouterInitOptions): RouterInitResult
101
99
  * search update, a popstate replay and a revalidation all call this. That
102
100
  * matters beyond tidiness: an element type present on one render and absent
103
101
  * on the next changes the type at that position, so React unmounts and
104
- * remounts everything below it, destroying the layout state partial
105
- * navigation exists to preserve (caught by
102
+ * remounts everything below it, destroying the layout state an unchanged
103
+ * segment keeps across a navigation (caught by
106
104
  * tests/e2e/segment-merge-navigation.test.ts when the params wrapper was
107
105
  * conditional).
108
106
  *
109
- * `PayloadRoot` is *above* the displayed tree, which on a partial navigation
110
- * is the retained tree. That position is the whole design: it is the only
111
- * provider a reader in a skipped layout can resolve to (TIM-1297).
107
+ * `PayloadRoot` is *above* the displayed tree. That position is the whole
108
+ * design: a segment the server skipped renders the content the client
109
+ * cached for it, which carries no provider of its own, so this is the only
110
+ * provider a reader in it can resolve to (TIM-1297).
112
111
  *
113
112
  * Pure — building the element does not make it the displayed one. Every
114
113
  * caller pairs this with `publishTree` at the point the tree is actually
@@ -119,29 +118,22 @@ export function createTimberRouter(options: RouterInitOptions): RouterInitResult
119
118
  function renderTree(
120
119
  tree: unknown,
121
120
  navState: NavigationState,
122
- params: ParamsSource,
123
- segmentUpdates?: Map<string, React.ReactNode>
121
+ params: ParamsSource
124
122
  ): React.ReactElement {
125
123
  const withParams = createElement(PayloadRoot, { source: params }, tree as React.ReactNode);
126
124
  const withNav = createElement(NavigationProvider, { value: navState }, withParams);
127
- const withUpdates = createElement(
128
- SegmentUpdateContext.Provider,
129
- { value: segmentUpdates ?? EMPTY_SEGMENT_UPDATES },
125
+ const withOutletCache = createElement(
126
+ OutletContentCacheContext.Provider,
127
+ { value: outletContentCache },
130
128
  withNav
131
129
  );
132
- const withSlotCache = createElement(
133
- SlotContentCacheContext.Provider,
134
- { value: slotContentCache },
135
- withUpdates
136
- );
137
- return createElement(TimberNuqsAdapter, null, withSlotCache);
130
+ return createElement(TimberNuqsAdapter, null, withOutletCache);
138
131
  }
139
132
 
140
133
  /**
141
134
  * Record the tree the client is now displaying, the params published over
142
- * it and the location it renders. Written together — the paths that re-wrap
143
- * without a fresh payload (a shallow search update, a partial navigation)
144
- * read them back as one and would otherwise restore one route's tree with
135
+ * it and the location it renders. Written together — the path that re-wraps
136
+ * without a fresh payload (a shallow search update) reads them back as one and would otherwise restore one route's tree with
145
137
  * another's params or pathname.
146
138
  */
147
139
  function publishTree(tree: unknown, params: ParamsSource, navState: NavigationState): void {
@@ -246,6 +238,7 @@ export function createTimberRouter(options: RouterInitOptions): RouterInitResult
246
238
 
247
239
  const deps: RouterDeps = {
248
240
  clientSegmentCache: options?.clientSegmentCache ?? false,
241
+ outletContentCache,
249
242
  fetch: (url, init) => window.fetch(url, init),
250
243
  pushState: (data, unused, url) => {
251
244
  gFlags[ROUTER_HISTORY_FLAG] = true;
@@ -308,19 +301,9 @@ export function createTimberRouter(options: RouterInitOptions): RouterInitResult
308
301
  let built: { tree: unknown; params: ParamsSource; navState: NavigationState } | null =
309
302
  null;
310
303
  const { element, decodePromise, commit } = await perform(
311
- (
312
- rawPayload: unknown,
313
- navState: NavigationState,
314
- params: ParamsSource,
315
- segmentUpdates?: Map<string, unknown>
316
- ) => {
304
+ (rawPayload: unknown, navState: NavigationState, params: ParamsSource) => {
317
305
  built = { tree: rawPayload, params, navState };
318
- return renderTree(
319
- rawPayload,
320
- navState,
321
- params,
322
- segmentUpdates as Map<string, React.ReactNode> | undefined
323
- );
306
+ return renderTree(rawPayload, navState, params);
324
307
  }
325
308
  );
326
309
  return {
@@ -337,8 +320,6 @@ export function createTimberRouter(options: RouterInitOptions): RouterInitResult
337
320
  );
338
321
  },
339
322
 
340
- _getCurrentPayload: () => displayed?.tree ?? null,
341
-
342
323
  // Schedule a callback after the next paint so scroll operations
343
324
  // happen after React commits the new content to the DOM.
344
325
  // Double-rAF ensures the browser has painted the new frame.
@@ -18,7 +18,16 @@
18
18
  * See design/10-error-handling.md §"Status-Code Files"
19
19
  */
20
20
 
21
- import { Component, createContext, createElement, useContext, type ReactNode } from 'react';
21
+ import {
22
+ Component,
23
+ createContext,
24
+ createElement,
25
+ useContext,
26
+ useEffect,
27
+ useRef,
28
+ type ReactNode,
29
+ } from 'react';
30
+ import { OutletScopeContext } from './outlet-scope-context.ts';
22
31
  import { getRouterOrNull } from './router-ref.ts';
23
32
  import { markStaleFromError } from './stale-client.ts';
24
33
  import { StatusPageMarker } from './status-page-marker.tsx';
@@ -29,6 +38,7 @@ import { leaveSpa } from './router-effects.ts';
29
38
  // application. unload-guard.ts is the single owner of that state; this module
30
39
  // used to keep its own copy, which drifted (TIM-1260).
31
40
  import { isPageUnloading } from './unload-guard.ts';
41
+ import { recoverFromStaleSegment, type StaleSegmentDigest } from './stale-segment.ts';
32
42
 
33
43
  // ─── Ancestry Context ────────────────────────────────────────────────────────
34
44
 
@@ -73,7 +83,7 @@ interface RedirectDigest {
73
83
  status: number;
74
84
  }
75
85
 
76
- type ParsedDigest = DenyDigest | RedirectDigest;
86
+ type ParsedDigest = DenyDigest | RedirectDigest | StaleSegmentDigest;
77
87
 
78
88
  // ─── Props & State ───────────────────────────────────────────────────────────
79
89
 
@@ -140,6 +150,25 @@ let _pendingRedirectLocation: string | null = null;
140
150
 
141
151
  // ─── Component ───────────────────────────────────────────────────────────────
142
152
 
153
+ /**
154
+ * Resets a boundary showing an error once a new navigation reaches it.
155
+ *
156
+ * Live content resets the boundary through new `children`. Content a skip
157
+ * reuses (design/52) is the same element tree as before — the boundary sees
158
+ * the same `children` and would keep showing the old error, never mounting
159
+ * the nested outlet that holds the new decision. What a skip does change is
160
+ * the outlet scope: a new one for every decision. A scope other than the one
161
+ * the error was shown under is a navigation that reached this boundary.
162
+ */
163
+ function ResetOnNewDecisions({ reset, children }: { reset: () => void; children?: ReactNode }) {
164
+ const scope = useContext(OutletScopeContext);
165
+ const shownUnder = useRef(scope);
166
+ useEffect(() => {
167
+ if (scope !== shownUnder.current) reset();
168
+ }, [scope, reset]);
169
+ return children;
170
+ }
171
+
143
172
  export class TimberErrorBoundary extends Component<
144
173
  TimberErrorBoundaryProps,
145
174
  TimberErrorBoundaryState
@@ -207,8 +236,14 @@ export class TimberErrorBoundary extends Component<
207
236
  this.props.children
208
237
  );
209
238
  }
239
+ return createElement(
240
+ ResetOnNewDecisions,
241
+ { reset: this.reset },
242
+ this.fallback(this.state.error)
243
+ );
244
+ }
210
245
 
211
- const error = this.state.error;
246
+ private fallback(error: Error): ReactNode {
212
247
  const parsed = parseDigest(error);
213
248
 
214
249
  // RedirectSignal handling splits by environment:
@@ -267,13 +302,15 @@ export class TimberErrorBoundary extends Component<
267
302
  return this.markStatusPage(null);
268
303
  }
269
304
 
270
- // A deny the tree cannot hold: its deny pages, and the layouts they
271
- // render in, belong to a route this tree is not. Nothing here may claim
272
- // it — not a keyed owner, not a slot, not a status filter — so it passes
273
- // every boundary to the terminal, which leaves the SPA below and lets the
274
- // document request render the URL's own answer (TIM-1607).
305
+ // An error the tree cannot hold: a deny whose deny pages, and the
306
+ // layouts they render in, belong to a route this tree is not (TIM-1607),
307
+ // or a skipped segment whose content the client no longer holds
308
+ // (client/stale-segment.ts). Nothing here may claim it — not a keyed
309
+ // owner, not a slot, not a status filter — so it passes every boundary to
310
+ // the terminal, which leaves the SPA below and lets the document request
311
+ // render the URL's own answer.
275
312
  const leavesSpa = parsed?.type !== 'deny' || parsed.leaveSpa === true;
276
- if (parsed?.type === 'deny' && parsed.leaveSpa && !this.props.lastResort) {
313
+ if (parsed && 'leaveSpa' in parsed && parsed.leaveSpa && !this.props.lastResort) {
277
314
  throw error;
278
315
  }
279
316
 
@@ -324,6 +361,9 @@ export class TimberErrorBoundary extends Component<
324
361
  if (!_handledExits.has(error)) {
325
362
  _handledExits.add(error);
326
363
  const router = getRouterOrNull();
364
+ // A skip whose content the client no longer holds: fetch the page
365
+ // again inside the SPA, and leave only if that fails the same way.
366
+ if (parsed?.type === 'stale-segment' && recoverFromStaleSegment(router)) return null;
327
367
  const current = window.location.pathname + window.location.search;
328
368
  // The row arrived for the navigation in flight, whose URL is not on
329
369
  // the address bar yet; fall back to the current document.
@@ -25,11 +25,10 @@ export interface HistoryEntry {
25
25
  params: ParamsSource;
26
26
  /**
27
27
  * Segment metadata for this page's route. Restored into the segment cache
28
- * on popstate cached replay so the next forward navigation computes a
29
- * correct state tree. Without this, the segment cache retains the
30
- * *previous* page's segments after back-button, causing the server to
31
- * skip segments that aren't mounted — and the partial payload targets
32
- * a non-existent outlet.
28
+ * on popstate cached replay so the next navigation reports the tree paths
29
+ * actually mounted. Without this, the segment cache retains the *previous*
30
+ * page's tree after back-button, and interception scoping reads a tree
31
+ * that is not on screen (TIM-1282).
33
32
  */
34
33
  segmentInfo?: SegmentInfo[] | null;
35
34
  }
@@ -32,7 +32,7 @@ export type { SegmentContextValue } from './segment-context.ts';
32
32
 
33
33
  // ── Segment cache ────────────────────────────────────────────────────────
34
34
  export { SegmentCache, PrefetchCache } from './segment-cache.ts';
35
- export type { SegmentNode, PrefetchKey } from './segment-cache.ts';
35
+ export type { PrefetchKey } from './segment-cache.ts';
36
36
  export type { SegmentInfo, StateTree } from '../shared/segment-info.ts';
37
37
 
38
38
  // ── History ──────────────────────────────────────────────────────────────