@timber-js/app 0.2.0-alpha.196 → 0.2.0-alpha.198

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 (289) hide show
  1. package/dist/_chunks/{actions-CWYtq6ii.js → actions-BS-m5SLv.js} +3 -3
  2. package/dist/_chunks/{actions-CWYtq6ii.js.map → actions-BS-m5SLv.js.map} +1 -1
  3. package/dist/_chunks/als-registry-C6kcfprT.js.map +1 -1
  4. package/dist/_chunks/{build-manifest-DWppEdLB.js → build-manifest-DTmSGLRz.js} +51 -2
  5. package/dist/_chunks/build-manifest-DTmSGLRz.js.map +1 -0
  6. package/dist/_chunks/{cache-api-CQeYzA5g.js → cache-api-DqzgTEqk.js} +4 -49
  7. package/dist/_chunks/cache-api-DqzgTEqk.js.map +1 -0
  8. package/dist/_chunks/{chains-h7EO-u3n.js → chains-CZG7E5zg.js} +2 -2
  9. package/dist/_chunks/{chains-h7EO-u3n.js.map → chains-CZG7E5zg.js.map} +1 -1
  10. package/dist/_chunks/{cli-check-BVthpfLS.js → cli-check-dVDi1GQz.js} +3 -3
  11. package/dist/_chunks/{cli-check-BVthpfLS.js.map → cli-check-dVDi1GQz.js.map} +1 -1
  12. package/dist/_chunks/{cli-schema-sync-3Wutm8pH.js → cli-schema-sync-DTy_-Msq.js} +2 -2
  13. package/dist/_chunks/{cli-schema-sync-3Wutm8pH.js.map → cli-schema-sync-DTy_-Msq.js.map} +1 -1
  14. package/dist/_chunks/{cloudflare-BKJC3SC_.js → cloudflare-BFb__LYG.js} +2 -2
  15. package/dist/_chunks/{cloudflare-BKJC3SC_.js.map → cloudflare-BFb__LYG.js.map} +1 -1
  16. package/dist/_chunks/{convention-lint-DO10_pVl.js → convention-lint-Ph6luW4c.js} +4 -2
  17. package/dist/_chunks/convention-lint-Ph6luW4c.js.map +1 -0
  18. package/dist/_chunks/{error-boundary-D-lkwyaD.js → error-boundary-BvRCCmbN.js} +3 -3
  19. package/dist/_chunks/{error-boundary-D-lkwyaD.js.map → error-boundary-BvRCCmbN.js.map} +1 -1
  20. package/dist/_chunks/{href-validation-CMc5JRls.js → href-validation-BIrxavIy.js} +74 -2
  21. package/dist/_chunks/href-validation-BIrxavIy.js.map +1 -0
  22. package/dist/_chunks/{live-graph-Bx4HodF1.js → live-graph-BXDsdzBv.js} +3 -3
  23. package/dist/_chunks/{live-graph-Bx4HodF1.js.map → live-graph-BXDsdzBv.js.map} +1 -1
  24. package/dist/_chunks/{logger-pumCm3Il.js → logger-DDirEsn7.js} +3 -4
  25. package/dist/_chunks/{logger-pumCm3Il.js.map → logger-DDirEsn7.js.map} +1 -1
  26. package/dist/_chunks/navigation-root-B00jjGd5.js +233 -0
  27. package/dist/_chunks/navigation-root-B00jjGd5.js.map +1 -0
  28. package/dist/_chunks/{segment-context-CjOlyB8Y.js → param-value-C8TNYchQ.js} +2 -33
  29. package/dist/_chunks/param-value-C8TNYchQ.js.map +1 -0
  30. package/dist/_chunks/{poison-scan-BAxfTT5L.js → poison-scan-BoDLgbix.js} +2 -2
  31. package/dist/_chunks/{poison-scan-BAxfTT5L.js.map → poison-scan-BoDLgbix.js.map} +1 -1
  32. package/dist/_chunks/{router-ref-BzqbPwYC.js → router-ref-8gr8qsxN.js} +2 -2
  33. package/dist/_chunks/{router-ref-BzqbPwYC.js.map → router-ref-8gr8qsxN.js.map} +1 -1
  34. package/dist/_chunks/{rsc-cache-key-DD0fl_-s.js → rsc-cache-key-ClUiXQnK.js} +2 -2
  35. package/dist/_chunks/{rsc-cache-key-DD0fl_-s.js.map → rsc-cache-key-ClUiXQnK.js.map} +1 -1
  36. package/dist/_chunks/{scanner-BRIOmHE2.js → scanner-tdFPvDYi.js} +174 -7
  37. package/dist/_chunks/scanner-tdFPvDYi.js.map +1 -0
  38. package/dist/_chunks/segment-context-D9_89u34.js +34 -0
  39. package/dist/_chunks/segment-context-D9_89u34.js.map +1 -0
  40. package/dist/_chunks/singleflight-2lUWfcAk.js +54 -0
  41. package/dist/_chunks/singleflight-2lUWfcAk.js.map +1 -0
  42. package/dist/_chunks/{ssr-data-Ya2HJPFp.js → ssr-data-BQGhTPAK.js} +2 -17
  43. package/dist/_chunks/ssr-data-BQGhTPAK.js.map +1 -0
  44. package/dist/_chunks/{walkers-BU6z9xRV.js → walkers-DNX05dC0.js} +2 -2
  45. package/dist/_chunks/{walkers-BU6z9xRV.js.map → walkers-DNX05dC0.js.map} +1 -1
  46. package/dist/adapters/cloudflare-dev.js +1 -1
  47. package/dist/adapters/cloudflare-kv-cache.js +1 -1
  48. package/dist/adapters/cloudflare.js +1 -1
  49. package/dist/adapters/nitro.d.ts +1 -1
  50. package/dist/adapters/nitro.d.ts.map +1 -1
  51. package/dist/adapters/nitro.js.map +1 -1
  52. package/dist/analyze/crawl-entry.js +2 -2
  53. package/dist/analyze/graph-command.js +2 -2
  54. package/dist/cache/index.js +1 -1
  55. package/dist/cache/singleflight.d.ts +2 -0
  56. package/dist/cache/singleflight.d.ts.map +1 -1
  57. package/dist/cli.js +2 -2
  58. package/dist/client/browser-entry/hydrate.d.ts +21 -15
  59. package/dist/client/browser-entry/hydrate.d.ts.map +1 -1
  60. package/dist/client/browser-entry/index.d.ts +4 -3
  61. package/dist/client/browser-entry/index.d.ts.map +1 -1
  62. package/dist/client/browser-entry/post-hydration.d.ts.map +1 -1
  63. package/dist/client/browser-entry/router-init.d.ts +17 -1
  64. package/dist/client/browser-entry/router-init.d.ts.map +1 -1
  65. package/dist/client/error-boundary.js +1 -1
  66. package/dist/client/global-context.d.ts +15 -0
  67. package/dist/client/global-context.d.ts.map +1 -0
  68. package/dist/client/index.js +138 -35
  69. package/dist/client/index.js.map +1 -1
  70. package/dist/client/internal.d.ts +0 -1
  71. package/dist/client/internal.d.ts.map +1 -1
  72. package/dist/client/internal.js +206 -55
  73. package/dist/client/internal.js.map +1 -1
  74. package/dist/client/link.d.ts.map +1 -1
  75. package/dist/client/location-search.d.ts +12 -0
  76. package/dist/client/location-search.d.ts.map +1 -0
  77. package/dist/client/navigation-api.d.ts.map +1 -1
  78. package/dist/client/navigation-commit.d.ts +18 -0
  79. package/dist/client/navigation-commit.d.ts.map +1 -1
  80. package/dist/client/navigation-context.d.ts +13 -11
  81. package/dist/client/navigation-context.d.ts.map +1 -1
  82. package/dist/client/navigation-root.d.ts +47 -108
  83. package/dist/client/navigation-root.d.ts.map +1 -1
  84. package/dist/client/navigation-transition.d.ts +136 -0
  85. package/dist/client/navigation-transition.d.ts.map +1 -0
  86. package/dist/client/nuqs-adapter.d.ts.map +1 -1
  87. package/dist/client/params-context.d.ts +4 -5
  88. package/dist/client/params-context.d.ts.map +1 -1
  89. package/dist/client/react-root.d.ts +44 -0
  90. package/dist/client/react-root.d.ts.map +1 -0
  91. package/dist/client/router-pipeline.d.ts +2 -2
  92. package/dist/client/router-pipeline.d.ts.map +1 -1
  93. package/dist/client/router-types.d.ts +12 -2
  94. package/dist/client/router-types.d.ts.map +1 -1
  95. package/dist/client/router.d.ts.map +1 -1
  96. package/dist/client/segment-cache.d.ts +39 -0
  97. package/dist/client/segment-cache.d.ts.map +1 -1
  98. package/dist/client/segment-context.d.ts.map +1 -1
  99. package/dist/client/segment-outlet.d.ts +25 -14
  100. package/dist/client/segment-outlet.d.ts.map +1 -1
  101. package/dist/client/segment-update-context.d.ts +3 -9
  102. package/dist/client/segment-update-context.d.ts.map +1 -1
  103. package/dist/client/slot-content-cache-context.d.ts +35 -0
  104. package/dist/client/slot-content-cache-context.d.ts.map +1 -0
  105. package/dist/client/ssr-data.d.ts +8 -2
  106. package/dist/client/ssr-data.d.ts.map +1 -1
  107. package/dist/client/state.d.ts +0 -15
  108. package/dist/client/state.d.ts.map +1 -1
  109. package/dist/client/use-pathname.d.ts +13 -11
  110. package/dist/client/use-pathname.d.ts.map +1 -1
  111. package/dist/client/use-search-params.d.ts +13 -13
  112. package/dist/client/use-search-params.d.ts.map +1 -1
  113. package/dist/client/use-segment-params.d.ts +18 -68
  114. package/dist/client/use-segment-params.d.ts.map +1 -1
  115. package/dist/config-types.d.ts +17 -0
  116. package/dist/config-types.d.ts.map +1 -1
  117. package/dist/config-validation.d.ts.map +1 -1
  118. package/dist/cookies/index.js +1 -1
  119. package/dist/dev-tools/holding-server.d.ts +15 -10
  120. package/dist/dev-tools/holding-server.d.ts.map +1 -1
  121. package/dist/index.d.ts.map +1 -1
  122. package/dist/index.js +44 -43
  123. package/dist/index.js.map +1 -1
  124. package/dist/plugins/dev-server.d.ts.map +1 -1
  125. package/dist/plugins/entries.d.ts.map +1 -1
  126. package/dist/plugins/shims.d.ts.map +1 -1
  127. package/dist/plugins/static-build.d.ts +2 -2
  128. package/dist/plugins/static-build.d.ts.map +1 -1
  129. package/dist/routing/codegen-write.d.ts.map +1 -1
  130. package/dist/routing/index.js +2 -2
  131. package/dist/routing/interception-overlap.d.ts +35 -0
  132. package/dist/routing/interception-overlap.d.ts.map +1 -0
  133. package/dist/routing/interception.d.ts.map +1 -1
  134. package/dist/rsc-runtime/ssr.d.ts +3 -1
  135. package/dist/rsc-runtime/ssr.d.ts.map +1 -1
  136. package/dist/server/als-registry.d.ts +6 -0
  137. package/dist/server/als-registry.d.ts.map +1 -1
  138. package/dist/server/csp-nonce.d.ts +45 -0
  139. package/dist/server/csp-nonce.d.ts.map +1 -0
  140. package/dist/server/default-status-page.d.ts.map +1 -1
  141. package/dist/server/deny-renderer.d.ts.map +1 -1
  142. package/dist/server/flight-scripts.d.ts +5 -2
  143. package/dist/server/flight-scripts.d.ts.map +1 -1
  144. package/dist/server/html-injector-core.d.ts +17 -2
  145. package/dist/server/html-injector-core.d.ts.map +1 -1
  146. package/dist/server/html-injectors.d.ts +3 -2
  147. package/dist/server/html-injectors.d.ts.map +1 -1
  148. package/dist/server/index.js +2 -2
  149. package/dist/server/internal.js +86 -37
  150. package/dist/server/internal.js.map +1 -1
  151. package/dist/server/metadata-render.d.ts.map +1 -1
  152. package/dist/server/node-stream-transforms.d.ts +3 -17
  153. package/dist/server/node-stream-transforms.d.ts.map +1 -1
  154. package/dist/server/nuqs-ssr-provider.d.ts +7 -3
  155. package/dist/server/nuqs-ssr-provider.d.ts.map +1 -1
  156. package/dist/server/pipeline-phases.d.ts.map +1 -1
  157. package/dist/server/prebuilt/key-discipline.d.ts +32 -3
  158. package/dist/server/prebuilt/key-discipline.d.ts.map +1 -1
  159. package/dist/server/primitives.d.ts.map +1 -1
  160. package/dist/server/render-utils.d.ts +4 -3
  161. package/dist/server/render-utils.d.ts.map +1 -1
  162. package/dist/server/rsc-entry/action-middleware-runner.d.ts.map +1 -1
  163. package/dist/server/rsc-entry/error-renderer.d.ts.map +1 -1
  164. package/dist/server/rsc-entry/index.d.ts.map +1 -1
  165. package/dist/server/rsc-entry/ssr-renderer.d.ts.map +1 -1
  166. package/dist/server/ssr-bridge-types.d.ts +22 -2
  167. package/dist/server/ssr-bridge-types.d.ts.map +1 -1
  168. package/dist/server/ssr-entry.d.ts.map +1 -1
  169. package/dist/server/ssr-render.d.ts +5 -1
  170. package/dist/server/ssr-render.d.ts.map +1 -1
  171. package/dist/server/ssr-wrappers.d.ts +59 -27
  172. package/dist/server/ssr-wrappers.d.ts.map +1 -1
  173. package/dist/server/types.d.ts +10 -0
  174. package/dist/server/types.d.ts.map +1 -1
  175. package/dist/shims/navigation-rsc.d.ts +21 -0
  176. package/dist/shims/navigation-rsc.d.ts.map +1 -0
  177. package/docs/api/30-api-server.mdx +1 -0
  178. package/docs/api/35-api-typescript.mdx +4 -83
  179. package/docs/learn/03-fetching-data.mdx +1 -1
  180. package/docs/learn/{03b-access-control.mdx → 04-access-control.mdx} +2 -17
  181. package/docs/learn/05-the-flush-point.mdx +175 -0
  182. package/docs/learn/{05-typed-params.mdx → 06-typed-params.mdx} +1 -1
  183. package/docs/learn/07-typed-routes.mdx +25 -49
  184. package/docs/learn/{08-streaming.mdx → 09-streaming.mdx} +1 -7
  185. package/docs/learn/{10-middleware.mdx → 11-middleware.mdx} +1 -0
  186. package/package.json +3 -3
  187. package/src/adapters/nitro.ts +7 -7
  188. package/src/cache/singleflight.ts +5 -0
  189. package/src/client/browser-entry/hydrate.ts +54 -104
  190. package/src/client/browser-entry/index.ts +16 -6
  191. package/src/client/browser-entry/post-hydration.ts +3 -2
  192. package/src/client/browser-entry/router-init.ts +84 -33
  193. package/src/client/global-context.ts +31 -0
  194. package/src/client/internal.ts +1 -2
  195. package/src/client/link.tsx +18 -18
  196. package/src/client/location-search.ts +15 -0
  197. package/src/client/navigation-api.ts +4 -2
  198. package/src/client/navigation-commit.ts +48 -2
  199. package/src/client/navigation-context.ts +25 -37
  200. package/src/client/navigation-root.tsx +55 -411
  201. package/src/client/navigation-transition.ts +278 -0
  202. package/src/client/nuqs-adapter.tsx +4 -5
  203. package/src/client/params-context.ts +13 -18
  204. package/src/client/react-root.ts +72 -0
  205. package/src/client/router-lifecycle.ts +1 -1
  206. package/src/client/router-pipeline.ts +96 -22
  207. package/src/client/router-types.ts +12 -2
  208. package/src/client/router.ts +48 -36
  209. package/src/client/segment-cache.ts +70 -2
  210. package/src/client/segment-context.ts +7 -4
  211. package/src/client/segment-outlet.tsx +41 -86
  212. package/src/client/segment-update-context.ts +7 -26
  213. package/src/client/slot-content-cache-context.ts +43 -0
  214. package/src/client/ssr-data.ts +8 -2
  215. package/src/client/state.ts +0 -26
  216. package/src/client/use-pathname.ts +21 -31
  217. package/src/client/use-search-params.ts +31 -29
  218. package/src/client/use-segment-params.ts +27 -126
  219. package/src/config-types.ts +17 -0
  220. package/src/config-validation.ts +17 -0
  221. package/src/dev-tools/holding-server.ts +23 -12
  222. package/src/index.ts +26 -11
  223. package/src/plugins/dev-server.ts +9 -12
  224. package/src/plugins/entries.ts +3 -0
  225. package/src/plugins/shims.ts +8 -7
  226. package/src/plugins/static-build.ts +9 -5
  227. package/src/react-canary.d.ts +2 -0
  228. package/src/routing/codegen-write.ts +2 -0
  229. package/src/routing/interception-overlap.ts +141 -0
  230. package/src/routing/interception.ts +118 -5
  231. package/src/rsc-runtime/ssr.ts +3 -2
  232. package/src/server/als-registry.ts +6 -0
  233. package/src/server/csp-nonce.ts +70 -0
  234. package/src/server/default-status-page.ts +1 -0
  235. package/src/server/deny-renderer.ts +7 -3
  236. package/src/server/flight-scripts.ts +9 -4
  237. package/src/server/html-injector-core.ts +26 -9
  238. package/src/server/html-injectors.ts +8 -8
  239. package/src/server/metadata-render.ts +26 -4
  240. package/src/server/node-stream-transforms.ts +7 -20
  241. package/src/server/nuqs-ssr-provider.tsx +8 -7
  242. package/src/server/pipeline-phases.ts +5 -0
  243. package/src/server/prebuilt/key-discipline.ts +82 -13
  244. package/src/server/prebuilt-runtime.ts +2 -2
  245. package/src/server/primitives.ts +4 -4
  246. package/src/server/render-utils.ts +8 -4
  247. package/src/server/rsc-entry/action-middleware-runner.ts +7 -0
  248. package/src/server/rsc-entry/error-renderer.ts +5 -2
  249. package/src/server/rsc-entry/index.ts +8 -0
  250. package/src/server/rsc-entry/ssr-renderer.ts +11 -4
  251. package/src/server/ssr-bridge-types.ts +22 -2
  252. package/src/server/ssr-entry.ts +35 -28
  253. package/src/server/ssr-render.ts +13 -4
  254. package/src/server/ssr-wrappers.tsx +81 -61
  255. package/src/server/types.ts +10 -0
  256. package/src/shared/slot-params.ts +3 -4
  257. package/src/shims/navigation-rsc.ts +47 -0
  258. package/dist/_chunks/build-manifest-DWppEdLB.js.map +0 -1
  259. package/dist/_chunks/cache-api-CQeYzA5g.js.map +0 -1
  260. package/dist/_chunks/convention-lint-DO10_pVl.js.map +0 -1
  261. package/dist/_chunks/href-validation-CMc5JRls.js.map +0 -1
  262. package/dist/_chunks/scanner-BRIOmHE2.js.map +0 -1
  263. package/dist/_chunks/segment-context-CjOlyB8Y.js.map +0 -1
  264. package/dist/_chunks/slot-params-BCTmZkQB.js +0 -76
  265. package/dist/_chunks/slot-params-BCTmZkQB.js.map +0 -1
  266. package/dist/_chunks/ssr-data-Ya2HJPFp.js.map +0 -1
  267. package/dist/_chunks/use-segment-params-DzTBpkvj.js +0 -398
  268. package/dist/_chunks/use-segment-params-DzTBpkvj.js.map +0 -1
  269. package/docs/learn/04-loading-states.mdx +0 -67
  270. package/docs/learn/04b-the-flush-point.mdx +0 -115
  271. package/docs/learn/12-client-navigation.mdx +0 -176
  272. package/docs/learn/13-configuration.mdx +0 -166
  273. package/docs/more/01-advanced-routing.mdx +0 -344
  274. package/docs/more/02-advanced-forms.mdx +0 -137
  275. package/docs/more/03-coming-from-nextjs.mdx +0 -186
  276. package/docs/more/04-metadata-and-fonts.mdx +0 -193
  277. package/docs/more/04b-mdx.mdx +0 -229
  278. package/docs/more/05-content-collections.mdx +0 -90
  279. package/docs/more/06-instrumentation.mdx +0 -214
  280. package/docs/more/07-security.mdx +0 -129
  281. package/docs/more/08-developer-experience.mdx +0 -134
  282. package/docs/more/40-why-timber.mdx +0 -50
  283. package/docs/more/41-timber-vs-nextjs.mdx +0 -81
  284. package/docs/more/42-timber-vs-others.mdx +0 -68
  285. package/docs/more/50-ai-agent-instructions.mdx +0 -171
  286. /package/docs/learn/{06-forms-and-actions.mdx → 08-forms-and-actions.mdx} +0 -0
  287. /package/docs/learn/{09-caching.mdx → 10-caching.mdx} +0 -0
  288. /package/docs/learn/{11-error-handling.mdx → 12-error-handling.mdx} +0 -0
  289. /package/docs/learn/{14-deploying.mdx → 13-deploying.mdx} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/client/link.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAIL,KAAK,oBAAoB,EACzB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACrF,OAAO,EACL,sBAAsB,IAAI,gBAAgB,EAC1C,cAAc,EACf,MAAM,8BAA8B,CAAC;AA6BtC,MAAM,MAAM,eAAe,GAAG;IAC5B,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B,CA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* The app-visible search string from the address bar.
3
+ *
4
+ * Mirrors what `appVisibleSearch()` does on the server: strips key-shaped
5
+ * `_rsc` values so the client and server agree on search state regardless
6
+ * of whether the document URL itself carries a payload cache key (a user
7
+ * pasting/sharing an RSC payload URL). Non-key-shaped `_rsc` values — an
8
+ * application legitimately owning that name — survive, using the same
9
+ * `isRscCacheKeyShape` predicate the server uses.
10
+ */
11
+ export declare function locationSearch(): string;
12
+ //# sourceMappingURL=location-search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"location-search.d.ts","sourceRoot":"","sources":["../../src/client/location-search.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC"}
@@ -1 +1 @@
1
- {"version":3,"file":"navigation-api.d.ts","sourceRoot":"","sources":["../../src/client/navigation-api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAMH;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,UAAU,GAAG,IAAI,CAGpD;AAID;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;;OAKG;IACH,kBAAkB,EAAE,CAClB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,WAAW,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,KACxF,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnB;;;OAGG;IACH,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjF;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C;AAED;;;GAGG;A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KG;IACH,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;;;;;;;;;;;OAcG;IACH,mBAAmB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAE9C;;;;;OAKG;IACH,wBAAwB,EAAE,MAAM,IAAI,CAAC;IAErC;;;;;;;;OAQG;IACH,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAElD;;;OAGG;IACH,kBAAkB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAE9C;;;OAGG;IACH,mBAAmB,EAAE,MAAM,OAAO,CAAC;IAEnC,0CAA0C;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,sBAAsB,GAAG,uBAAuB,CA6M7F"}
@@ -52,7 +52,25 @@ export interface NavigationCommitInput {
52
52
  * See TIM-1356.
53
53
  */
54
54
  status?: number;
55
+ /**
56
+ * Layouts the server skipped on this response (`X-Timber-Skipped-Segments`),
57
+ * when it came from a fetch. Omitted by replays and revalidation.
58
+ *
59
+ * Together with `skipped` slot entries in `segmentInfo`, this decides
60
+ * whether the payload can be *replayed*. A partial payload only renders
61
+ * merged over the tree on screen, and a `skip=true` outlet resolves against
62
+ * the slot content cache at render time — so a stored copy of either,
63
+ * replayed later, shows whatever the client holds *then*, not what was on
64
+ * screen when the entry committed. Such entries store a null payload and
65
+ * traversals to them fetch instead. Decided here, not at the fetch call
66
+ * sites, for the same reason as `status`: `performNavigationFetch` had the
67
+ * check and `fetchCommitAndRender` did not, so a back/forward fetch that
68
+ * was answered with skips stored the holes (TIM-1432).
69
+ */
70
+ skippedSegments?: string[] | null;
55
71
  }
72
+ /** Whether a response skipped layouts — its payload merges over the tree on screen. */
73
+ export declare function isPartialNavigation(skippedSegments: string[] | null | undefined): boolean;
56
74
  /**
57
75
  * A navigation's destination, split into what a render needs and what a
58
76
  * commit publishes.
@@ -1 +1 @@
1
- {"version":3,"file":"navigation-commit.d.ts","sourceRoot":"","sources":["../../src/client/navigation-commit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEnF,uEAAuE;AACvE,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,wEAAwE;IACxE,MAAM,EAAE,YAAY,CAAC;IACrB;;;;;;;;;;;;OAYG;IACH,WAAW,CAAC,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IACnC;iEAC6D;IAC7D,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,4EAA4E;IAC5E,QAAQ,EAAE,eAAe,CAAC;IAC1B,oEAAoE;IACpE,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,GAAG,kBAAkB,CAAC;IAChF,gBAAgB,IAAI,SAAS,GAAG,SAAS,CAAC;IAC1C,kBAAkB,CAAC,WAAW,EAAE,WAAW,EAAE,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC;CACzE;AAED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jC,4EAA4E;IAC5E,QAAQ,EAAE,eAAe,CAAC;IAC1B,oEAAoE;IACpE,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,GAAG,kBAAkB,CAAC;IAChF,gBAAgB,IAAI,SAAS,GAAG,SAAS,CAAC;IAC1C,kBAAkB,CAAC,WAAW,EAAE,WAAW,EAAE,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC;CACzE;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAQlE;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE;IAC9C,YAAY,EAAE,YAAY,CAAC;IAC3B,YAAY,EAAE,YAAY,CAAC;IAC3B,oEAAoE;IACpE,kBAAkB,EAAE,MAAM,OAAO,GAAG,SAAS,CAAC;CAC/C,GAAG,mBAAmB,CAkGtB"}
@@ -16,14 +16,15 @@
16
16
  * All consumers (usePathname, useSearchParams) see the new values in the
17
17
  * same render pass as the new tree.
18
18
  *
19
- * During SSR, no NavigationProvider is mounted. Hooks fall back to
20
- * the ALS-backed getSsrData() for per-request isolation.
19
+ * During SSR, the wrapper chain mounts this same provider with the
20
+ * request's pathname and raw search string (TIM-1424), so the hooks
21
+ * resolve through the identical code path on both sides. Per-request
22
+ * isolation is by construction — the value is part of the request's
23
+ * element tree.
21
24
  *
22
- * IMPORTANT: createContext and useContext are NOT available in the RSC
23
- * environment (React Server Components use a stripped-down React).
24
- * The context is lazily initialized on first access, and all functions
25
- * that depend on these APIs are safe to call from any environment —
26
- * they return null or no-op when the APIs aren't available.
25
+ * This module is `'use client'` and is never evaluated in the RSC
26
+ * environment. The shims plugin resolves next/navigation to
27
+ * navigation-rsc.ts in RSC, which has throwing stubs (TIM-1420).
27
28
  *
28
29
  * SINGLETON GUARANTEE: All shared mutable state uses globalThis via
29
30
  * Symbol.for keys. The RSC client bundler can duplicate this module
@@ -38,7 +39,7 @@
38
39
  *
39
40
  * See design/19-client-navigation.md §"NavigationContext"
40
41
  */
41
- import React, { type ReactNode } from 'react';
42
+ import { type ReactNode } from 'react';
42
43
  /**
43
44
  * What the browser knows about the current location.
44
45
  *
@@ -54,8 +55,9 @@ export interface NavigationState {
54
55
  search: string;
55
56
  }
56
57
  /**
57
- * Read the navigation context. Returns null during SSR (no provider)
58
- * or in the RSC environment (no context available).
58
+ * Read the navigation context. Returns null only when no provider is above
59
+ * the caller — a component rendered outside the timber app.
60
+ *
59
61
  * Internal — used by usePathname() and useSearchParams().
60
62
  */
61
63
  export declare function useNavigationContext(): NavigationState | null;
@@ -69,7 +71,7 @@ export interface NavigationProviderProps {
69
71
  * Used in browser-entry.ts renderRoot to wrap the RSC payload element
70
72
  * so that navigation state updates atomically with the tree render.
71
73
  */
72
- export declare function NavigationProvider({ value, children, }: NavigationProviderProps): React.ReactElement;
74
+ export declare function NavigationProvider({ value, children, }: NavigationProviderProps): import('react').ReactElement;
73
75
  export declare function setNavigationState(state: NavigationState): void;
74
76
  export declare function getNavigationState(): NavigationState;
75
77
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"navigation-context.d.ts","sourceRoot":"","sources":["../../src/client/navigation-context.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,KAAK,EAAE,EAAiB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAO7D;;;;;;;;;GASG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAsCD;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,eAAe,GAAG,IAAI,CAO7D;AAMD,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,QAAQ,GACT,EAAE,uBAAuB,GAAG,KAAK,CAAC,YAAY,CAO9C;AA6BD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAE/D;AAED,wBAAgB,kBAAkB,IAAI,eAAe,CAEpD;AAMD;;;;;;;;;;;;;;;;;;GAkBG"}
1
+ {"version":3,"file":"navigation-context.d.ts","sourceRoot":"","sources":["../../src/client/navigation-context.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,EAA4C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAOjF;;;;;;;;;GASG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAkCD;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,eAAe,GAAG,IAAI,CAE7D;AAMD,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,QAAQ,GACT,EAAE,uBAAuB,GAAG,OAAO,OAAO,EAAE,YAAY,CAExD;AA6BD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAE/D;AAED,wBAAgB,kBAAkB,IAAI,eAAe,CAEpD;AAMD;;;;;;;;;;;;;;;;;;GAkBG"}
@@ -1,21 +1,26 @@
1
1
  /**
2
- * NavigationRoot — Wrapper component for transition-based rendering.
3
- *
4
- * Solves the "new boundary has no old content" problem for client-side
5
- * navigation. When React renders a completely new Suspense boundary via
6
- * root.render(), it shows the fallback immediately — root.render() is
7
- * always an urgent update regardless of startTransition.
8
- *
9
- * NavigationRoot holds the current element in React state. Navigation
10
- * updates call startTransition(() => setState(newElement)), which IS
11
- * a transition update. React keeps the old committed tree visible while
12
- * the new tree resolves, instead of hiding it behind a Suspense fallback.
13
- *
14
- * The navigation's async work runs OUTSIDE the transition scope and every
15
- * state update it schedules gets its own synchronous `startTransition` — a
16
- * transition scope does not survive an `await`, and an async callback that
17
- * returns a thenable defers the commit past the promise callers await. See
18
- * the long comment on `_navigateTransition` (TIM-1306).
2
+ * NavigationRoot — the component the router renders the page through.
3
+ *
4
+ * It is stateless. The router owns the displayed tree and drives React with
5
+ * `root.render(<NavigationRoot rendered={{ element, publish }} />)` inside a
6
+ * synchronous `startTransition` (see `client/react-root.ts`). A transition
7
+ * update keeps the committed tree on screen while the incoming one resolves,
8
+ * instead of replacing it with a Suspense fallback — the reason this
9
+ * component exists (TIM-1306).
10
+ *
11
+ * It used to hold the tree in `useState` and register `setState` closures
12
+ * into module globals during render so the router could reach into it, with a
13
+ * second set of stand-in closures for the window before a root existed
14
+ * (TIM-600). Inverting that — router calls React, not the reverse — deleted
15
+ * all of it (TIM-1431). Next.js's `use-action-queue.ts` says it wants this
16
+ * shape and cannot have it because it must decode Flight during render;
17
+ * timber decodes in `router-pipeline.ts`, so nothing stands in the way.
18
+ *
19
+ * What this component does own is **the commit-time publish**: a navigation's
20
+ * state (segment cache, address bar, history stack, pathname) is published
21
+ * from a layout effect keyed on the tree object, so the event that puts a
22
+ * route on screen is the event that makes it current (TIM-1301). Props work
23
+ * for that exactly as state did.
19
24
  *
20
25
  * This component holds no pending state. The `TopLoader` it renders and the
21
26
  * public `usePendingNavigation()` both subscribe to the router's external
@@ -37,44 +42,32 @@
37
42
  import { type ReactNode } from 'react';
38
43
  import { type TopLoaderConfig } from './top-loader.tsx';
39
44
  /**
40
- * What a navigation's `perform()` hands back to the transition.
41
- *
42
- * Declared once and shared by every layer that passes it along — the router's
43
- * `RouterDeps.navigateTransition` imports it too — so a field cannot be added
44
- * to the producer and dropped by the adapter in between. `E` is the element
45
- * type: `ReactNode` here, `unknown` in the router, which never touches it.
45
+ * The tree the router has handed to React, and the state publish that belongs
46
+ * to it. They travel as one object so React's commit of the tree is the event
47
+ * that publishes — see the effect in NavigationRoot. Every `render` builds a
48
+ * fresh one, which is what keys that effect: a tree is published once, however
49
+ * many times React re-runs the effect for it.
46
50
  */
47
- export interface TransitionResult<E = ReactNode> {
48
- /** The wrapped tree to render. */
49
- element: E;
50
- /** Resolves when the Flight stream finishes decoding, or null. */
51
- decodePromise: Promise<void> | null;
51
+ export interface RenderedTree {
52
+ element: ReactNode;
52
53
  /**
53
54
  * Publishes the navigation's state — segment cache, pathname, address bar,
54
55
  * history stack, and the client's record of the mounted tree — and
55
- * announces it to listeners outside React.
56
- *
57
- * Run when React commits this tree, not when the tree is handed over: a
58
- * tree React is still waiting on, or one a later navigation replaces first,
59
- * has been given to React without being on screen. A superseded navigation
60
- * never runs it and leaves every one of those consumers describing the
61
- * route still on screen (TIM-1301).
56
+ * announces it to listeners outside React. Runs when React commits
57
+ * `element`, never before (TIM-1301). Null for a render that has nothing to
58
+ * publish on commit (hydration, the shallow search re-wrap).
62
59
  */
63
- commit: () => void;
60
+ publish: (() => void) | null;
64
61
  }
65
62
  /**
66
- * Invalidate all in-flight navigation transitions. Any navigateTransition()
67
- * call whose perform() has not yet committed will reject with AbortError
68
- * instead of committing its element.
63
+ * Hand a tree to React in a transition. `publish` runs when React commits it.
69
64
  *
70
- * Called by the router when a render supersedes in-flight navigations
71
- * WITHOUT going through navigateTransition() — the cached popstate replay
72
- * renders via transitionRender(), which doesn't bump the counter, so a
73
- * stale forward navigation's setElement would otherwise pass the
74
- * `counter.id !== transId` guard and commit the forward page over the
75
- * replayed back page (TIM-1022).
65
+ * Every path that puts a page on screen goes through one of these — a
66
+ * navigation, a revalidation, a popstate replay, a shallow search re-wrap —
67
+ * and it is always a synchronous `startTransition` around `root.render`.
68
+ * The production one is `createReactRoot().render`.
76
69
  */
77
- export declare function supersedeNavigationTransitions(): void;
70
+ export type NavigationRender = (element: ReactNode, publish: (() => void) | null) => void;
78
71
  /**
79
72
  * Set the hard-navigating flag. Call this BEFORE setting
80
73
  * window.location.href or window.location.reload() to prevent:
@@ -89,71 +82,17 @@ export declare function setHardNavigating(value: boolean): void;
89
82
  */
90
83
  export declare function isHardNavigating(): boolean;
91
84
  /**
92
- * Root wrapper component that enables transition-based rendering.
93
- *
94
- * Renders the TopLoader alongside the tree it holds in state. Neither adds a
95
- * DOM element on the hydration path, so the tree matches the server HTML.
85
+ * Root component the router renders the page through.
96
86
  *
97
- * Usage in browser-entry.ts:
98
- * const rootEl = createElement(NavigationRoot, { initial: wrapped });
99
- * reactRoot = hydrateRoot(document, rootEl);
87
+ * Renders the TopLoader alongside the tree it is given. Neither adds a DOM
88
+ * element on the hydration path, so the tree matches the server HTML.
100
89
  *
101
- * Subsequent navigations:
102
- * navigateTransition(url, async () => { fetch; return wrappedElement; });
103
- *
104
- * Non-navigation renders:
105
- * transitionRender(newWrappedElement);
90
+ * Rendered only by `createReactRoot` (client/react-root.ts): hydration passes
91
+ * `{ element, publish: null }`, and every later render is a synchronous
92
+ * `startTransition(() => root.render(...))` with a fresh `rendered` object.
106
93
  */
107
- export declare function NavigationRoot({ initial, topLoaderConfig, }: {
108
- initial: ReactNode;
94
+ export declare function NavigationRoot({ rendered, topLoaderConfig, }: {
95
+ rendered: RenderedTree;
109
96
  topLoaderConfig?: TopLoaderConfig;
110
97
  }): ReactNode;
111
- /**
112
- * Trigger a transition render for non-navigation updates.
113
- * React keeps the old committed tree visible while any new Suspense
114
- * boundaries in the update resolve.
115
- *
116
- * Used for: applyRevalidation, popstate replay with cached payload.
117
- */
118
- export declare function transitionRender(element: ReactNode): void;
119
- /**
120
- * Run a full navigation, handing its tree to React in a transition.
121
- *
122
- * The `perform` callback fetches the RSC payload, updates router state, and
123
- * returns the wrapped React element. `perform` is async by contract and runs
124
- * OUTSIDE any transition scope — only the `setRendered` that hands its result
125
- * over is wrapped, in a synchronous `startTransition`.
126
- *
127
- * Do not call this from inside a React action scope, and never let a
128
- * `startTransition` callback in this path return a thenable: either opens an
129
- * action scope that entangles the update and defers the commit until the
130
- * action settles (TIM-1306, TIM-1307).
131
- *
132
- * Returns a Promise that resolves when the async work completes — the payload
133
- * is fetched, decoded, and handed to React. It does **not** wait for React to
134
- * commit the tree, so the state that publishes on that commit (address bar,
135
- * segment cache, history entry, pathname) may still be a beat behind when it
136
- * resolves. Anything that needs the destination to be current should listen
137
- * for `timber:navigation-end`, which is dispatched by the publish itself.
138
- *
139
- * Awaiting the publish here was tried and rejected: it makes the promise
140
- * depend on a React commit, which never arrives if the root unmounts
141
- * mid-navigation, and deadlocks any caller that awaits a navigation inside
142
- * `act()`.
143
- *
144
- * Used for: navigate(), refresh(), popstate with fetch.
145
- */
146
- export declare function navigateTransition(url: string, perform: () => Promise<TransitionResult>): Promise<void>;
147
- /**
148
- * Install one-shot deferred callbacks for the no-RSC bootstrap path (TIM-600).
149
- *
150
- * When there's no RSC payload, we can't create a React root immediately —
151
- * `createRoot(document).render(...)` would blank the SSR HTML. Instead,
152
- * this sets up `_transitionRender` and `_navigateTransition` so that the
153
- * first client navigation triggers root creation via `createAndMount`.
154
- *
155
- * After `createAndMount` runs, NavigationRoot renders and overwrites these
156
- * callbacks with its real `startTransition`-based implementations.
157
- */
158
- export declare function installDeferredNavigation(createAndMount: (initial: ReactNode) => void): void;
159
98
  //# sourceMappingURL=navigation-root.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"navigation-root.d.ts","sourceRoot":"","sources":["../../src/client/navigation-root.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAa,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAInE;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC,GAAG,SAAS;IAC7C,kCAAkC;IAClC,OAAO,EAAE,CAA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nB;;;;;;OAMG;IACH,OAAO,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;CAC9B;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;AA8B1F;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAEtD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C;AAgBD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,eAAe,GAChB,EAAE;IACD,QAAQ,EAAE,YAAY,CAAC;IACvB,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC,GAAG,SAAS,CAsEZ"}
@@ -0,0 +1,136 @@
1
+ /**
2
+ * Navigation transition — the router-level hand-off of a navigation's tree to
3
+ * React, and the supersession that governs it.
4
+ *
5
+ * `navigateTransition` runs a navigation's fetch OUTSIDE any transition scope
6
+ * and hands the resulting tree to React through a `NavigationRender`, which
7
+ * is a synchronous `startTransition` around `root.render` (client/react-root.ts).
8
+ * Two React behaviours force that shape; both were measured on React 19.2.7
9
+ * (tests/navigation-transition-suspense.test.ts pins the observable half).
10
+ *
11
+ * 1. A transition scope does not survive an `await`. `startTransition`
12
+ * restores the previous scope in its `finally`, which for an async
13
+ * callback runs when that callback RETURNS — i.e. at its first `await`.
14
+ * So an update scheduled past an await inside `startTransition(async …)`
15
+ * is an ordinary urgent update:
16
+ *
17
+ * startTransition(() => render(x)) -> 'HOME' held
18
+ * startTransition(async () => { await p; render(x) }) -> fallback shown
19
+ *
20
+ * Left uncorrected, every navigation whose new tree suspends replaces the
21
+ * visible page with a Suspense fallback — the exact thing NavigationRoot
22
+ * exists to prevent (TIM-1306). React documents the caveat under
23
+ * `startTransition`: updates after an await need their own transition.
24
+ *
25
+ * 2. Re-wrapping *inside* the async callback is not enough. Returning a
26
+ * thenable from `startTransition` hands it to `ReactSharedInternals.S`,
27
+ * which calls react-dom's `entangleAsyncAction`. That opens an action
28
+ * scope: `currentEntangledLane` collects EVERY transition update
29
+ * scheduled while the scope is open — including one from a nested,
30
+ * fully synchronous `startTransition` — and rendering that lane throws
31
+ * `currentEntangledActionThenable`, suspending until the action settles.
32
+ * Which is after the promise `navigateTransition` hands back, so a caller
33
+ * that awaits a navigation and then reads the DOM sees the departing
34
+ * page, and the TIM-1301 publish (a layout effect on the commit) is just
35
+ * as late. (Not `ReactSharedInternals.asyncTransitions` — that counter is
36
+ * write-only in 19.2.7.)
37
+ *
38
+ * No async action is created here, so every navigation commits as soon as
39
+ * React can render its destination — where TIM-1301 put it. That holds for
40
+ * ALL of them. It used not to hold for `<Link>`, which wrapped
41
+ * `router.navigate()` in its own `useTransition`: that action scope entangled
42
+ * the root's updates just the same, so a Link navigation committed only once
43
+ * the payload had finished decoding, and with it `pushState`, the segment
44
+ * cache and `timber:navigation-end`. Link now calls `router.navigate()`
45
+ * outside any transition and tracks its own `isPending` with a plain
46
+ * `useState` (TIM-1307).
47
+ *
48
+ * Nothing here may reopen an action scope: no `startTransition` callback in
49
+ * this path may return a thenable, and no caller may invoke this from inside
50
+ * a React action scope. That is a rule about `startTransition`, not about
51
+ * `perform` — `perform` is async by contract and is awaited OUTSIDE any
52
+ * transition scope, which is exactly why it is safe.
53
+ *
54
+ * Standalone `startTransition` rather than `useTransition`'s is deliberate:
55
+ * the hook's is tied to a single fiber and tracks one async callback at a
56
+ * time, and two overlapping navigations through it corrupted React's hook
57
+ * tracking ("Rendered more hooks than during the previous render"). Each
58
+ * navigation needs an independent lane. This matches the Next.js pattern
59
+ * (TIM-625): "No useTransition in the router at all — only standalone
60
+ * startTransition."
61
+ *
62
+ * See design/19-client-navigation.md §"How Pending State Works"
63
+ */
64
+ import type { ReactNode } from 'react';
65
+ import type { NavigationRender } from './navigation-root.tsx';
66
+ /**
67
+ * What a navigation's `perform()` hands back to the transition.
68
+ *
69
+ * Declared once and shared by every layer that passes it along — the router's
70
+ * `RouterDeps.navigateTransition` imports it too — so a field cannot be added
71
+ * to the producer and dropped by the adapter in between. `E` is the element
72
+ * type: `ReactNode` here, `unknown` in the router, which never touches it.
73
+ */
74
+ export interface TransitionResult<E = ReactNode> {
75
+ /** The wrapped tree to render. */
76
+ element: E;
77
+ /** Resolves when the Flight stream finishes decoding, or null. */
78
+ decodePromise: Promise<void> | null;
79
+ /**
80
+ * Publishes the navigation's state — segment cache, pathname, address bar,
81
+ * history stack, and the client's record of the mounted tree — and
82
+ * announces it to listeners outside React.
83
+ *
84
+ * Run when React commits this tree, not when the tree is handed over: a
85
+ * tree React is still waiting on, or one a later navigation replaces first,
86
+ * has been given to React without being on screen. A superseded navigation
87
+ * never runs it and leaves every one of those consumers describing the
88
+ * route still on screen (TIM-1301).
89
+ */
90
+ commit: () => void;
91
+ }
92
+ /**
93
+ * Invalidate all in-flight navigation transitions. Any navigateTransition()
94
+ * call whose perform() has not yet committed will reject with AbortError
95
+ * instead of committing its element.
96
+ *
97
+ * Called by the router when a render supersedes in-flight navigations
98
+ * WITHOUT going through navigateTransition() — the cached popstate replay
99
+ * renders directly, which doesn't bump the counter, so a stale forward
100
+ * navigation's render would otherwise pass the `counter.id !== transId`
101
+ * guard and commit the forward page over the replayed back page (TIM-1022).
102
+ */
103
+ export declare function supersedeNavigationTransitions(): void;
104
+ /**
105
+ * Run a full navigation, handing its tree to React in a transition.
106
+ *
107
+ * The `perform` callback fetches the RSC payload, updates router state, and
108
+ * returns the wrapped React element. `perform` is async by contract and runs
109
+ * OUTSIDE any transition scope — only the `render` that hands its result over
110
+ * is wrapped, in a synchronous `startTransition` (see the module comment).
111
+ *
112
+ * Do not call this from inside a React action scope, and never let a
113
+ * `startTransition` callback in this path return a thenable: either opens an
114
+ * action scope that entangles the update and defers the commit until the
115
+ * action settles (TIM-1306, TIM-1307).
116
+ *
117
+ * Returns a Promise that resolves when the async work completes — the payload
118
+ * is fetched, decoded, and handed to React. It does **not** wait for React to
119
+ * commit the tree, so the state that publishes on that commit (address bar,
120
+ * segment cache, history entry, pathname) may still be a beat behind when it
121
+ * resolves. Anything that needs the destination to be current should listen
122
+ * for `timber:navigation-end`, which is dispatched by the publish itself.
123
+ *
124
+ * Awaiting the publish here was tried and rejected: it makes the promise
125
+ * depend on a React commit, which never arrives if the root unmounts
126
+ * mid-navigation, and deadlocks any caller that awaits a navigation inside
127
+ * `act()`.
128
+ *
129
+ * Rejects with an `AbortError` when a newer transition started while this
130
+ * one's `perform()` was in flight — the stale tree is never handed to React
131
+ * and its `commit` never runs (TIM-629, TIM-1301).
132
+ *
133
+ * Used for: navigate(), refresh(), popstate with fetch.
134
+ */
135
+ export declare function navigateTransition(perform: () => Promise<TransitionResult>, render: NavigationRender): Promise<void>;
136
+ //# sourceMappingURL=navigation-transition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation-transition.d.ts","sourceRoot":"","sources":["../../src/client/navigation-transition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAI9D;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC,GAAG,SAAS;IAC7C,kCAAkC;IAClC,OAAO,EAAE,CAAC,CAAC;IACX,kEAAkE;IAClE,aAAa,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACpC;;;;;;;;;;OAUG;IACH,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAkDD;;;;;;;;;;GAUG;AACH,wBAAgB,8BAA8B,IAAI,IAAI,CAErD;AAmDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC,EACxC,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,IAAI,CAAC,CAmCf"}
@@ -1 +1 @@
1
- {"version":3,"file":"nuqs-adapter.d.ts","sourceRoot":"","sources":["../../src/client/nuqs-adapter.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAgC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAgGrE;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,+BAatE"}
1
+ {"version":3,"file":"nuqs-adapter.d.ts","sourceRoot":"","sources":["../../src/client/nuqs-adapter.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAgC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AA+FrE;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,+BAatE"}
@@ -33,11 +33,10 @@ import { type PublishedParams } from '../shared/payload-root.ts';
33
33
  import type { SlotParamsRecord } from '../shared/slot-params.ts';
34
34
  export type ParamsContextValue = PublishedParams;
35
35
  /**
36
- * Read the params provided by the tree. Returns null when no provider is
37
- * above the caller — a component rendered outside a timber route, a
38
- * `useSegmentParams()` call from outside React entirely, or any component
39
- * during SSR (where the params reach the hook through the ALS-backed SSR data
40
- * context instead, and there is no client-owned tree to hold a provider).
36
+ * Read the params provided by the tree. Returns null only when no provider
37
+ * is above the caller — a component rendered outside a timber route. During
38
+ * SSR the wrapper chain mounts `PayloadRoot` too (TIM-1424), so both sides
39
+ * resolve through this context.
41
40
  */
42
41
  export declare function useParamsContext(): ParamsContextValue | null;
43
42
  interface ParamsProviderProps {
@@ -1 +1 @@
1
- {"version":3,"file":"params-context.d.ts","sourceRoot":"","sources":["../../src/client/params-context.ts"],"names":[],"mappings":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Aa,CAAC;IACtB,UAAU,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAqCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,uDAIhG"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * React root host — the one React root the router renders the page through.
3
+ *
4
+ * The router owns the displayed tree and drives React: every render is
5
+ * `startTransition(() => root.render(<NavigationRoot rendered={…} />))`,
6
+ * synchronous, with a fresh `rendered` object whose `publish` NavigationRoot
7
+ * runs when React commits that tree (TIM-1301, TIM-1431).
8
+ *
9
+ * The root itself is created lazily. On the RSC-payload path `hydrate()`
10
+ * creates it by hydrating the server HTML. On the JS-only path (no inlined
11
+ * payload, TIM-600) nothing may create it at bootstrap — `createRoot(document)`
12
+ * followed by a render would take React ownership of the document and blank
13
+ * the SSR HTML — so the first `render()` (the first navigation, or a
14
+ * revalidation after a server action) creates it with the tree it renders.
15
+ * That first render carries no placeholder, and a fresh root with nothing
16
+ * committed leaves the container alone until it can commit, so the SSR HTML
17
+ * stays until the destination is ready (TIM-580).
18
+ *
19
+ * `container` is `document` in production; tests pass an element.
20
+ */
21
+ import { type ReactNode } from 'react';
22
+ import { type HydrationOptions } from 'react-dom/client';
23
+ import { type NavigationRender } from './navigation-root.tsx';
24
+ import type { TopLoaderConfig } from './top-loader.tsx';
25
+ export interface ReactRootHost {
26
+ /**
27
+ * Hydrate the server HTML with `element` as the initial tree. Nothing is
28
+ * published on that commit — the address bar, pathname and history already
29
+ * describe the page the server sent.
30
+ */
31
+ hydrate(element: ReactNode, options?: HydrationOptions): void;
32
+ /**
33
+ * Hand a tree to React in a synchronous transition; `publish` runs when
34
+ * React commits it. Creates the root on first use.
35
+ */
36
+ render: NavigationRender;
37
+ /** Tear the root down (tests). */
38
+ unmount(): void;
39
+ }
40
+ export declare function createReactRoot(options: {
41
+ container: Document | Element;
42
+ topLoaderConfig?: TopLoaderConfig;
43
+ }): ReactRootHost;
44
+ //# sourceMappingURL=react-root.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-root.d.ts","sourceRoot":"","sources":["../../src/client/react-root.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAkC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvE,OAAO,EAA2B,KAAK,gBAAgB,EAAa,MAAM,kBAAkB,CAAC;AAC7F,OAAO,EAAkB,KAAK,gBAAgB,EAAqB,MAAM,uBAAuB,CAAC;AACjG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,OAAO,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC9D;;;OAGG;IACH,MAAM,EAAE,gBAAgB,CAAC;IACzB,kCAAkC;IAClC,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE;IACvC,SAAS,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC9B,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC,GAAG,aAAa,CA0BhB"}
@@ -17,7 +17,7 @@ import { type ParamsSource } from '../shared/payload-root.ts';
17
17
  import type { PrefetchCache, PrefetchKey } from './segment-cache.ts';
18
18
  import type { StateTree } from '../shared/segment-info.ts';
19
19
  import type { NavigationState } from './navigation-context.ts';
20
- import type { NavigationCommitter } from './navigation-commit.ts';
20
+ import { type NavigationCommitter } from './navigation-commit.ts';
21
21
  import type { RouterDeps } from './router-types.ts';
22
22
  /** A fetched payload plus the state update that makes it the current page. */
23
23
  export type NavigationPayload = FetchResult & {
@@ -46,7 +46,7 @@ export interface NavigationPipeline {
46
46
  /** Hand a payload to React inside a transition, or render it directly in tests. */
47
47
  renderViaTransition: (url: string, owner: AbortController, perform: () => Promise<NavigationPayload>) => Promise<void>;
48
48
  /** Render a decoded payload into the DOM if a renderer is available. */
49
- renderPayload: (payload: unknown, navState: NavigationState, params: ParamsSource) => void;
49
+ renderPayload: (payload: unknown, navState: NavigationState, params: ParamsSource, commit: () => void) => void;
50
50
  /** Resolve thenable payloads on the fallback (test) path. */
51
51
  resolveForFallback: (payload: unknown) => Promise<unknown>;
52
52
  }
@@ -1 +1 @@
1
- {"version":3,"file":"router-pipeline.d.ts","sourceRoot":"","sources":["../../src/client/router-pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACnF,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAErE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGpD,8EAA8E;AAC9E,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG;IAC5C,QAAQ,EAAE,eAAe,CAAC;IAC1B,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC;AAEF,0DAA0D;AAC1D,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,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C;CACvD;AAED,MAAM,WAAW,kBAAkB;IACjC,2DAA2D;IAC3D,sBAAsB,EAAE,CACtB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,sBAAsB,KAC5B,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAChC,mFAAmF;IACnF,mBAAmB,EAAE,CACnB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,eAAe,EACtB,OAAO,EAAE,MAAM,OAAO,CAAC,iBAAiB,CAAC,KACtC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,wEAAwE;IACxE,aAAa,EAAE,CACb,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,eAAe,EACzB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,MAAM,IAAI,KACf,IAAI,CAAC;IACV,6DAA6D;IAC7D,kBAAkB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAC5D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,SAAS,GAAG,SAAS,GAC/B,WAAW,CAEb;AAoCD,wBAAgB,wBAAwB,CAAC,EACvC,IAAI,EACJ,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,mBAAmB,GACpB,EAAE,sBAAsB,GAAG,kBAAkB,CAmS7C"}
@@ -13,7 +13,7 @@ import type { ParamsSource } from '../shared/payload-root.ts';
13
13
  import type { SegmentInfo } from '../shared/segment-info.ts';
14
14
  import type { SegmentCache, PrefetchCache } from './segment-cache.ts';
15
15
  import type { HistoryStack } from './history.ts';
16
- import type { TransitionResult } from './navigation-root.tsx';
16
+ import type { TransitionResult } from './navigation-transition.ts';
17
17
  export interface NavigationOptions {
18
18
  /** Set to false to prevent scroll-to-top on forward navigation */
19
19
  scroll?: boolean;
@@ -54,7 +54,17 @@ export type RscDecoder = (fetchPromise: Promise<Response>) => unknown;
54
54
  * coupling with setNavigationState/getNavigationState. The renderer
55
55
  * wraps the element in NavigationProvider with this state.
56
56
  */
57
- export type RootRenderer = (element: unknown, navState: NavigationState, params: ParamsSource) => void;
57
+ export type RootRenderer = (element: unknown, navState: NavigationState, params: ParamsSource,
58
+ /**
59
+ * Publishes the state that makes this tree the current page (segment
60
+ * cache, pathname, history stack, address bar). The renderer runs it when
61
+ * the tree is on screen — in production from React's commit of the tree
62
+ * (`NavigationRoot`'s layout effect), a test double synchronously. It is not run before
63
+ * handing the tree over: a replay or revalidation whose tree suspends is
64
+ * given to React without being on screen, and publishing then advertises
65
+ * slot content keys the slot content cache has not recorded (TIM-1423).
66
+ */
67
+ commit: () => void) => void;
58
68
  /**
59
69
  * Platform dependencies injected for testability. In production these
60
70
  * map to browser APIs; in tests they're replaced with mocks.