@timber-js/app 0.2.0-alpha.6 → 0.2.0-alpha.61

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 (406) hide show
  1. package/LICENSE +8 -0
  2. package/dist/_chunks/{als-registry-B7DbZ2hS.js → als-registry-Ba7URUIn.js} +1 -1
  3. package/dist/_chunks/als-registry-Ba7URUIn.js.map +1 -0
  4. package/dist/_chunks/chunk-DYhsFzuS.js +33 -0
  5. package/dist/_chunks/{debug-gwlJkDuf.js → debug-ECi_61pb.js} +2 -2
  6. package/dist/_chunks/debug-ECi_61pb.js.map +1 -0
  7. package/dist/_chunks/define-CT98cU9c.js +121 -0
  8. package/dist/_chunks/define-CT98cU9c.js.map +1 -0
  9. package/dist/_chunks/define-TK8C1M3x.js +279 -0
  10. package/dist/_chunks/define-TK8C1M3x.js.map +1 -0
  11. package/dist/_chunks/define-cookie-BWr_52kY.js +93 -0
  12. package/dist/_chunks/define-cookie-BWr_52kY.js.map +1 -0
  13. package/dist/_chunks/error-boundary-DpZJBCqh.js +211 -0
  14. package/dist/_chunks/error-boundary-DpZJBCqh.js.map +1 -0
  15. package/dist/_chunks/{format-DviM89f0.js → format-cX7wzEp2.js} +2 -2
  16. package/dist/_chunks/{format-DviM89f0.js.map → format-cX7wzEp2.js.map} +1 -1
  17. package/dist/_chunks/{interception-BOoWmLUA.js → interception-Cey5DCGr.js} +129 -77
  18. package/dist/_chunks/interception-Cey5DCGr.js.map +1 -0
  19. package/dist/_chunks/{metadata-routes-Cjmvi3rQ.js → metadata-routes-BU684ls2.js} +1 -1
  20. package/dist/_chunks/{metadata-routes-Cjmvi3rQ.js.map → metadata-routes-BU684ls2.js.map} +1 -1
  21. package/dist/_chunks/{request-context-DIkVh_jG.js → request-context-rju2rbga.js} +97 -69
  22. package/dist/_chunks/request-context-rju2rbga.js.map +1 -0
  23. package/dist/_chunks/segment-context-CyaM1mrD.js +72 -0
  24. package/dist/_chunks/segment-context-CyaM1mrD.js.map +1 -0
  25. package/dist/_chunks/stale-reload-BSSym1MJ.js +64 -0
  26. package/dist/_chunks/stale-reload-BSSym1MJ.js.map +1 -0
  27. package/dist/_chunks/{tracing-Cwn7697K.js → tracing-VYETCQsg.js} +17 -3
  28. package/dist/_chunks/{tracing-Cwn7697K.js.map → tracing-VYETCQsg.js.map} +1 -1
  29. package/dist/_chunks/{use-query-states-D5KaffOK.js → use-query-states-wEXY2JQB.js} +1 -1
  30. package/dist/_chunks/use-query-states-wEXY2JQB.js.map +1 -0
  31. package/dist/_chunks/wrappers-BaG1bnM3.js +63 -0
  32. package/dist/_chunks/wrappers-BaG1bnM3.js.map +1 -0
  33. package/dist/adapters/compress-module.d.ts.map +1 -1
  34. package/dist/adapters/nitro.d.ts +17 -1
  35. package/dist/adapters/nitro.d.ts.map +1 -1
  36. package/dist/adapters/nitro.js +56 -13
  37. package/dist/adapters/nitro.js.map +1 -1
  38. package/dist/cache/fast-hash.d.ts +22 -0
  39. package/dist/cache/fast-hash.d.ts.map +1 -0
  40. package/dist/cache/index.d.ts +5 -2
  41. package/dist/cache/index.d.ts.map +1 -1
  42. package/dist/cache/index.js +90 -20
  43. package/dist/cache/index.js.map +1 -1
  44. package/dist/cache/register-cached-function.d.ts.map +1 -1
  45. package/dist/cache/singleflight.d.ts +18 -1
  46. package/dist/cache/singleflight.d.ts.map +1 -1
  47. package/dist/cache/timber-cache.d.ts +1 -1
  48. package/dist/cache/timber-cache.d.ts.map +1 -1
  49. package/dist/client/error-boundary.d.ts +10 -1
  50. package/dist/client/error-boundary.d.ts.map +1 -1
  51. package/dist/client/error-boundary.js +1 -125
  52. package/dist/client/error-reconstituter.d.ts +54 -0
  53. package/dist/client/error-reconstituter.d.ts.map +1 -0
  54. package/dist/client/form.d.ts +2 -2
  55. package/dist/client/form.d.ts.map +1 -1
  56. package/dist/client/index.d.ts +3 -2
  57. package/dist/client/index.d.ts.map +1 -1
  58. package/dist/client/index.js +433 -252
  59. package/dist/client/index.js.map +1 -1
  60. package/dist/client/link-pending-store.d.ts +78 -0
  61. package/dist/client/link-pending-store.d.ts.map +1 -0
  62. package/dist/client/link.d.ts +23 -9
  63. package/dist/client/link.d.ts.map +1 -1
  64. package/dist/client/navigation-context.d.ts +2 -2
  65. package/dist/client/navigation-context.d.ts.map +1 -1
  66. package/dist/client/router.d.ts +25 -3
  67. package/dist/client/router.d.ts.map +1 -1
  68. package/dist/client/rsc-fetch.d.ts +36 -2
  69. package/dist/client/rsc-fetch.d.ts.map +1 -1
  70. package/dist/client/segment-cache.d.ts +1 -1
  71. package/dist/client/segment-cache.d.ts.map +1 -1
  72. package/dist/client/segment-context.d.ts +1 -1
  73. package/dist/client/segment-context.d.ts.map +1 -1
  74. package/dist/client/segment-merger.d.ts.map +1 -1
  75. package/dist/client/segment-outlet.d.ts +63 -0
  76. package/dist/client/segment-outlet.d.ts.map +1 -0
  77. package/dist/client/stale-reload.d.ts +15 -0
  78. package/dist/client/stale-reload.d.ts.map +1 -1
  79. package/dist/client/top-loader.d.ts +1 -1
  80. package/dist/client/top-loader.d.ts.map +1 -1
  81. package/dist/client/transition-root.d.ts +1 -1
  82. package/dist/client/transition-root.d.ts.map +1 -1
  83. package/dist/client/use-params.d.ts +3 -3
  84. package/dist/client/use-params.d.ts.map +1 -1
  85. package/dist/client/use-query-states.d.ts +1 -1
  86. package/dist/client/use-query-states.d.ts.map +1 -1
  87. package/dist/codec.d.ts +21 -0
  88. package/dist/codec.d.ts.map +1 -0
  89. package/dist/cookies/define-cookie.d.ts +34 -13
  90. package/dist/cookies/define-cookie.d.ts.map +1 -1
  91. package/dist/cookies/index.js +1 -83
  92. package/dist/fonts/css.d.ts +1 -0
  93. package/dist/fonts/css.d.ts.map +1 -1
  94. package/dist/index.d.ts +127 -35
  95. package/dist/index.d.ts.map +1 -1
  96. package/dist/index.js +665 -242
  97. package/dist/index.js.map +1 -1
  98. package/dist/params/define.d.ts +100 -0
  99. package/dist/params/define.d.ts.map +1 -0
  100. package/dist/params/index.d.ts +8 -0
  101. package/dist/params/index.d.ts.map +1 -0
  102. package/dist/params/index.js +4 -0
  103. package/dist/plugins/adapter-build.d.ts +1 -1
  104. package/dist/plugins/adapter-build.d.ts.map +1 -1
  105. package/dist/plugins/build-manifest.d.ts +2 -2
  106. package/dist/plugins/build-manifest.d.ts.map +1 -1
  107. package/dist/plugins/build-report.d.ts +3 -3
  108. package/dist/plugins/build-report.d.ts.map +1 -1
  109. package/dist/plugins/client-chunks.d.ts +32 -0
  110. package/dist/plugins/client-chunks.d.ts.map +1 -0
  111. package/dist/plugins/content.d.ts +1 -1
  112. package/dist/plugins/content.d.ts.map +1 -1
  113. package/dist/plugins/dev-browser-logs.d.ts +84 -0
  114. package/dist/plugins/dev-browser-logs.d.ts.map +1 -0
  115. package/dist/plugins/dev-error-overlay.d.ts +26 -1
  116. package/dist/plugins/dev-error-overlay.d.ts.map +1 -1
  117. package/dist/plugins/dev-logs.d.ts +1 -1
  118. package/dist/plugins/dev-logs.d.ts.map +1 -1
  119. package/dist/plugins/dev-server.d.ts +1 -1
  120. package/dist/plugins/dev-server.d.ts.map +1 -1
  121. package/dist/plugins/entries.d.ts +1 -1
  122. package/dist/plugins/entries.d.ts.map +1 -1
  123. package/dist/plugins/fonts.d.ts +9 -2
  124. package/dist/plugins/fonts.d.ts.map +1 -1
  125. package/dist/plugins/mdx.d.ts +1 -1
  126. package/dist/plugins/mdx.d.ts.map +1 -1
  127. package/dist/plugins/routing.d.ts +1 -1
  128. package/dist/plugins/routing.d.ts.map +1 -1
  129. package/dist/plugins/server-bundle.d.ts.map +1 -1
  130. package/dist/plugins/shims.d.ts +6 -5
  131. package/dist/plugins/shims.d.ts.map +1 -1
  132. package/dist/plugins/static-build.d.ts +1 -1
  133. package/dist/plugins/static-build.d.ts.map +1 -1
  134. package/dist/routing/codegen.d.ts +2 -2
  135. package/dist/routing/codegen.d.ts.map +1 -1
  136. package/dist/routing/index.js +1 -1
  137. package/dist/routing/scanner.d.ts.map +1 -1
  138. package/dist/routing/status-file-lint.d.ts +2 -1
  139. package/dist/routing/status-file-lint.d.ts.map +1 -1
  140. package/dist/routing/types.d.ts +16 -4
  141. package/dist/routing/types.d.ts.map +1 -1
  142. package/dist/rsc-runtime/rsc.d.ts +1 -1
  143. package/dist/rsc-runtime/rsc.d.ts.map +1 -1
  144. package/dist/rsc-runtime/ssr.d.ts +12 -0
  145. package/dist/rsc-runtime/ssr.d.ts.map +1 -1
  146. package/dist/search-params/codecs.d.ts +1 -1
  147. package/dist/search-params/define.d.ts +159 -0
  148. package/dist/search-params/define.d.ts.map +1 -0
  149. package/dist/search-params/index.d.ts +4 -5
  150. package/dist/search-params/index.d.ts.map +1 -1
  151. package/dist/search-params/index.js +4 -474
  152. package/dist/search-params/registry.d.ts +1 -1
  153. package/dist/search-params/wrappers.d.ts +53 -0
  154. package/dist/search-params/wrappers.d.ts.map +1 -0
  155. package/dist/server/access-gate.d.ts +4 -0
  156. package/dist/server/access-gate.d.ts.map +1 -1
  157. package/dist/server/action-client.d.ts.map +1 -1
  158. package/dist/server/action-encryption.d.ts +76 -0
  159. package/dist/server/action-encryption.d.ts.map +1 -0
  160. package/dist/server/action-handler.d.ts.map +1 -1
  161. package/dist/server/actions.d.ts +1 -1
  162. package/dist/server/actions.d.ts.map +1 -1
  163. package/dist/server/als-registry.d.ts +25 -4
  164. package/dist/server/als-registry.d.ts.map +1 -1
  165. package/dist/server/build-manifest.d.ts +2 -2
  166. package/dist/server/build-manifest.d.ts.map +1 -1
  167. package/dist/server/debug.d.ts +1 -1
  168. package/dist/server/default-logger.d.ts +22 -0
  169. package/dist/server/default-logger.d.ts.map +1 -0
  170. package/dist/server/deny-renderer.d.ts.map +1 -1
  171. package/dist/server/early-hints.d.ts +13 -5
  172. package/dist/server/early-hints.d.ts.map +1 -1
  173. package/dist/server/error-boundary-wrapper.d.ts +4 -0
  174. package/dist/server/error-boundary-wrapper.d.ts.map +1 -1
  175. package/dist/server/fallback-error.d.ts +4 -3
  176. package/dist/server/fallback-error.d.ts.map +1 -1
  177. package/dist/server/flight-injection-state.d.ts +66 -0
  178. package/dist/server/flight-injection-state.d.ts.map +1 -0
  179. package/dist/server/flight-scripts.d.ts +42 -0
  180. package/dist/server/flight-scripts.d.ts.map +1 -0
  181. package/dist/server/flush.d.ts.map +1 -1
  182. package/dist/server/form-data.d.ts +29 -0
  183. package/dist/server/form-data.d.ts.map +1 -1
  184. package/dist/server/html-injectors.d.ts +51 -11
  185. package/dist/server/html-injectors.d.ts.map +1 -1
  186. package/dist/server/index.d.ts +4 -2
  187. package/dist/server/index.d.ts.map +1 -1
  188. package/dist/server/index.js +1977 -1648
  189. package/dist/server/index.js.map +1 -1
  190. package/dist/server/logger.d.ts +25 -7
  191. package/dist/server/logger.d.ts.map +1 -1
  192. package/dist/server/node-stream-transforms.d.ts +113 -0
  193. package/dist/server/node-stream-transforms.d.ts.map +1 -0
  194. package/dist/server/pipeline-interception.d.ts +1 -1
  195. package/dist/server/pipeline-interception.d.ts.map +1 -1
  196. package/dist/server/pipeline.d.ts +20 -6
  197. package/dist/server/pipeline.d.ts.map +1 -1
  198. package/dist/server/primitives.d.ts +30 -3
  199. package/dist/server/primitives.d.ts.map +1 -1
  200. package/dist/server/render-timeout.d.ts +51 -0
  201. package/dist/server/render-timeout.d.ts.map +1 -0
  202. package/dist/server/request-context.d.ts +65 -38
  203. package/dist/server/request-context.d.ts.map +1 -1
  204. package/dist/server/route-element-builder.d.ts +7 -0
  205. package/dist/server/route-element-builder.d.ts.map +1 -1
  206. package/dist/server/route-handler.d.ts.map +1 -1
  207. package/dist/server/route-matcher.d.ts +9 -2
  208. package/dist/server/route-matcher.d.ts.map +1 -1
  209. package/dist/server/rsc-entry/api-handler.d.ts +2 -2
  210. package/dist/server/rsc-entry/api-handler.d.ts.map +1 -1
  211. package/dist/server/rsc-entry/error-renderer.d.ts +26 -13
  212. package/dist/server/rsc-entry/error-renderer.d.ts.map +1 -1
  213. package/dist/server/rsc-entry/helpers.d.ts +48 -5
  214. package/dist/server/rsc-entry/helpers.d.ts.map +1 -1
  215. package/dist/server/rsc-entry/index.d.ts +8 -3
  216. package/dist/server/rsc-entry/index.d.ts.map +1 -1
  217. package/dist/server/rsc-entry/rsc-payload.d.ts +3 -3
  218. package/dist/server/rsc-entry/rsc-payload.d.ts.map +1 -1
  219. package/dist/server/rsc-entry/rsc-stream.d.ts +10 -1
  220. package/dist/server/rsc-entry/rsc-stream.d.ts.map +1 -1
  221. package/dist/server/rsc-entry/ssr-bridge.d.ts +1 -1
  222. package/dist/server/rsc-entry/ssr-bridge.d.ts.map +1 -1
  223. package/dist/server/rsc-entry/ssr-renderer.d.ts +19 -4
  224. package/dist/server/rsc-entry/ssr-renderer.d.ts.map +1 -1
  225. package/dist/server/slot-resolver.d.ts +1 -1
  226. package/dist/server/slot-resolver.d.ts.map +1 -1
  227. package/dist/server/ssr-entry.d.ts +22 -0
  228. package/dist/server/ssr-entry.d.ts.map +1 -1
  229. package/dist/server/ssr-render.d.ts +39 -21
  230. package/dist/server/ssr-render.d.ts.map +1 -1
  231. package/dist/server/ssr-wrappers.d.ts +50 -0
  232. package/dist/server/ssr-wrappers.d.ts.map +1 -0
  233. package/dist/server/status-code-resolver.d.ts +1 -1
  234. package/dist/server/status-code-resolver.d.ts.map +1 -1
  235. package/dist/server/stream-utils.d.ts +36 -0
  236. package/dist/server/stream-utils.d.ts.map +1 -0
  237. package/dist/server/tracing.d.ts +10 -0
  238. package/dist/server/tracing.d.ts.map +1 -1
  239. package/dist/server/tree-builder.d.ts +20 -13
  240. package/dist/server/tree-builder.d.ts.map +1 -1
  241. package/dist/server/types.d.ts +1 -3
  242. package/dist/server/types.d.ts.map +1 -1
  243. package/dist/server/version-skew.d.ts +61 -0
  244. package/dist/server/version-skew.d.ts.map +1 -0
  245. package/dist/server/waituntil-bridge.d.ts.map +1 -1
  246. package/dist/shared/merge-search-params.d.ts +22 -0
  247. package/dist/shared/merge-search-params.d.ts.map +1 -0
  248. package/dist/shims/font-google.d.ts +1 -1
  249. package/dist/shims/font-google.d.ts.map +1 -1
  250. package/dist/shims/navigation-client.d.ts +1 -1
  251. package/dist/shims/navigation-client.d.ts.map +1 -1
  252. package/dist/shims/navigation.d.ts +1 -1
  253. package/dist/shims/navigation.d.ts.map +1 -1
  254. package/dist/utils/state-machine.d.ts +80 -0
  255. package/dist/utils/state-machine.d.ts.map +1 -0
  256. package/package.json +17 -17
  257. package/src/adapters/compress-module.ts +24 -4
  258. package/src/adapters/nitro.ts +58 -9
  259. package/src/cache/fast-hash.ts +34 -0
  260. package/src/cache/index.ts +5 -2
  261. package/src/cache/register-cached-function.ts +7 -3
  262. package/src/cache/singleflight.ts +62 -4
  263. package/src/cache/timber-cache.ts +40 -29
  264. package/src/cli.ts +0 -0
  265. package/src/client/browser-entry.ts +151 -99
  266. package/src/client/error-boundary.tsx +18 -1
  267. package/src/client/error-reconstituter.tsx +65 -0
  268. package/src/client/form.tsx +2 -2
  269. package/src/client/index.ts +10 -1
  270. package/src/client/link-pending-store.ts +136 -0
  271. package/src/client/link.tsx +137 -22
  272. package/src/client/navigation-context.ts +6 -5
  273. package/src/client/router.ts +117 -60
  274. package/src/client/rsc-fetch.ts +90 -2
  275. package/src/client/segment-cache.ts +1 -1
  276. package/src/client/segment-context.ts +6 -1
  277. package/src/client/segment-merger.ts +2 -8
  278. package/src/client/segment-outlet.tsx +86 -0
  279. package/src/client/stale-reload.ts +73 -6
  280. package/src/client/top-loader.tsx +10 -9
  281. package/src/client/transition-root.tsx +20 -2
  282. package/src/client/use-params.ts +4 -4
  283. package/src/client/use-query-states.ts +2 -2
  284. package/src/codec.ts +21 -0
  285. package/src/cookies/define-cookie.ts +71 -20
  286. package/src/fonts/css.ts +2 -1
  287. package/src/index.ts +297 -85
  288. package/src/params/define.ts +327 -0
  289. package/src/params/index.ts +28 -0
  290. package/src/plugins/adapter-build.ts +8 -2
  291. package/src/plugins/build-manifest.ts +13 -2
  292. package/src/plugins/build-report.ts +3 -3
  293. package/src/plugins/cache-transform.ts +1 -1
  294. package/src/plugins/client-chunks.ts +65 -0
  295. package/src/plugins/content.ts +1 -1
  296. package/src/plugins/dev-browser-logs.ts +284 -0
  297. package/src/plugins/dev-error-overlay.ts +70 -1
  298. package/src/plugins/dev-logs.ts +1 -1
  299. package/src/plugins/dev-server.ts +41 -7
  300. package/src/plugins/entries.ts +6 -8
  301. package/src/plugins/fonts.ts +102 -55
  302. package/src/plugins/mdx.ts +1 -1
  303. package/src/plugins/routing.ts +57 -17
  304. package/src/plugins/server-action-exports.ts +1 -1
  305. package/src/plugins/server-bundle.ts +32 -1
  306. package/src/plugins/shims.ts +69 -31
  307. package/src/plugins/static-build.ts +10 -6
  308. package/src/routing/codegen.ts +109 -88
  309. package/src/routing/scanner.ts +86 -7
  310. package/src/routing/status-file-lint.ts +3 -2
  311. package/src/routing/types.ts +17 -4
  312. package/src/rsc-runtime/rsc.ts +2 -0
  313. package/src/rsc-runtime/ssr.ts +50 -0
  314. package/src/rsc-runtime/vendor-types.d.ts +7 -0
  315. package/src/search-params/codecs.ts +1 -1
  316. package/src/search-params/define.ts +518 -0
  317. package/src/search-params/index.ts +12 -18
  318. package/src/search-params/registry.ts +1 -1
  319. package/src/search-params/wrappers.ts +85 -0
  320. package/src/server/access-gate.tsx +40 -9
  321. package/src/server/action-client.ts +8 -2
  322. package/src/server/action-encryption.ts +144 -0
  323. package/src/server/action-handler.ts +20 -3
  324. package/src/server/actions.ts +1 -1
  325. package/src/server/als-registry.ts +25 -4
  326. package/src/server/build-manifest.ts +10 -4
  327. package/src/server/compress.ts +25 -7
  328. package/src/server/debug.ts +1 -1
  329. package/src/server/default-logger.ts +99 -0
  330. package/src/server/deny-renderer.ts +5 -3
  331. package/src/server/early-hints.ts +36 -15
  332. package/src/server/error-boundary-wrapper.ts +58 -15
  333. package/src/server/fallback-error.ts +29 -14
  334. package/src/server/flight-injection-state.ts +113 -0
  335. package/src/server/flight-scripts.ts +62 -0
  336. package/src/server/flush.ts +2 -1
  337. package/src/server/form-data.ts +76 -0
  338. package/src/server/html-injectors.ts +277 -117
  339. package/src/server/index.ts +9 -4
  340. package/src/server/logger.ts +44 -36
  341. package/src/server/node-stream-transforms.ts +509 -0
  342. package/src/server/pipeline-interception.ts +1 -1
  343. package/src/server/pipeline.ts +148 -41
  344. package/src/server/primitives.ts +47 -5
  345. package/src/server/render-timeout.ts +108 -0
  346. package/src/server/request-context.ts +125 -119
  347. package/src/server/route-element-builder.ts +107 -115
  348. package/src/server/route-handler.ts +2 -1
  349. package/src/server/route-matcher.ts +9 -2
  350. package/src/server/rsc-entry/api-handler.ts +8 -8
  351. package/src/server/rsc-entry/error-renderer.ts +286 -81
  352. package/src/server/rsc-entry/helpers.ts +134 -5
  353. package/src/server/rsc-entry/index.ts +177 -76
  354. package/src/server/rsc-entry/rsc-payload.ts +91 -18
  355. package/src/server/rsc-entry/rsc-stream.ts +74 -18
  356. package/src/server/rsc-entry/ssr-bridge.ts +2 -2
  357. package/src/server/rsc-entry/ssr-renderer.ts +152 -34
  358. package/src/server/slot-resolver.ts +231 -220
  359. package/src/server/ssr-entry.ts +211 -32
  360. package/src/server/ssr-render.ts +289 -67
  361. package/src/server/ssr-wrappers.tsx +139 -0
  362. package/src/server/status-code-resolver.ts +1 -1
  363. package/src/server/stream-utils.ts +213 -0
  364. package/src/server/tracing.ts +23 -0
  365. package/src/server/tree-builder.ts +92 -58
  366. package/src/server/types.ts +1 -3
  367. package/src/server/version-skew.ts +104 -0
  368. package/src/server/waituntil-bridge.ts +4 -1
  369. package/src/shared/merge-search-params.ts +55 -0
  370. package/src/shims/font-google.ts +1 -1
  371. package/src/shims/navigation-client.ts +1 -1
  372. package/src/shims/navigation.ts +2 -1
  373. package/src/utils/state-machine.ts +111 -0
  374. package/dist/_chunks/als-registry-B7DbZ2hS.js.map +0 -1
  375. package/dist/_chunks/debug-gwlJkDuf.js.map +0 -1
  376. package/dist/_chunks/interception-BOoWmLUA.js.map +0 -1
  377. package/dist/_chunks/request-context-DIkVh_jG.js.map +0 -1
  378. package/dist/_chunks/ssr-data-MjmprTmO.js +0 -88
  379. package/dist/_chunks/ssr-data-MjmprTmO.js.map +0 -1
  380. package/dist/_chunks/use-cookie-DX-l1_5E.js +0 -91
  381. package/dist/_chunks/use-cookie-DX-l1_5E.js.map +0 -1
  382. package/dist/_chunks/use-query-states-D5KaffOK.js.map +0 -1
  383. package/dist/client/error-boundary.js.map +0 -1
  384. package/dist/client/link-status-provider.d.ts +0 -11
  385. package/dist/client/link-status-provider.d.ts.map +0 -1
  386. package/dist/cookies/index.js.map +0 -1
  387. package/dist/plugins/dynamic-transform.d.ts +0 -72
  388. package/dist/plugins/dynamic-transform.d.ts.map +0 -1
  389. package/dist/search-params/analyze.d.ts +0 -54
  390. package/dist/search-params/analyze.d.ts.map +0 -1
  391. package/dist/search-params/builtin-codecs.d.ts +0 -105
  392. package/dist/search-params/builtin-codecs.d.ts.map +0 -1
  393. package/dist/search-params/create.d.ts +0 -106
  394. package/dist/search-params/create.d.ts.map +0 -1
  395. package/dist/search-params/index.js.map +0 -1
  396. package/dist/server/prerender.d.ts +0 -77
  397. package/dist/server/prerender.d.ts.map +0 -1
  398. package/dist/server/response-cache.d.ts +0 -53
  399. package/dist/server/response-cache.d.ts.map +0 -1
  400. package/src/client/link-status-provider.tsx +0 -30
  401. package/src/plugins/dynamic-transform.ts +0 -161
  402. package/src/search-params/analyze.ts +0 -192
  403. package/src/search-params/builtin-codecs.ts +0 -228
  404. package/src/search-params/create.ts +0 -321
  405. package/src/server/prerender.ts +0 -139
  406. package/src/server/response-cache.ts +0 -277
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Link Pending Store — module-level singleton for per-link pending state.
3
+ *
4
+ * Tracks which link instance is currently navigating so that only the
5
+ * clicked link shows pending. All other links remain unaffected — zero
6
+ * wasted re-renders.
7
+ *
8
+ * The store holds:
9
+ * - A reference to the currently navigating link's state setter
10
+ * - A navigation counter to guard against stale clears (race condition
11
+ * when the user clicks Link B before Link A's navigation completes)
12
+ *
13
+ * Flow:
14
+ * 1. Link click handler: setLinkForCurrentNavigation(instance) →
15
+ * resets previous link (urgent), sets new link pending (urgent),
16
+ * stores setter + increments navId
17
+ * 2. TransitionRoot startTransition: captures navId, does async work
18
+ * 3. TransitionRoot commit: resetLinkPending(capturedNavId) →
19
+ * calls setter(IDLE) inside the transition (batched, atomic with tree)
20
+ * Only clears if navId matches (prevents stale T1 from clearing T2's link)
21
+ *
22
+ * SINGLETON GUARANTEE: Uses `globalThis` via `Symbol.for` keys (same
23
+ * pattern as NavigationContext) because the RSC client bundler can
24
+ * duplicate this module across chunks. Module-level variables would
25
+ * create separate instances per chunk.
26
+ *
27
+ * See design/19-client-navigation.md §"Per-Link Pending State"
28
+ */
29
+ import type { LinkStatus } from './use-link-status.js';
30
+ export interface LinkPendingInstance {
31
+ setLinkStatus: (status: LinkStatus) => void;
32
+ }
33
+ /** Status object indicating link is pending — shared reference */
34
+ export declare const PENDING_LINK_STATUS: LinkStatus;
35
+ /** Status object indicating link is idle — shared reference */
36
+ export declare const IDLE_LINK_STATUS: LinkStatus;
37
+ /**
38
+ * Register the link instance that initiated the current navigation.
39
+ *
40
+ * Called from <Link>'s click handler before router.navigate().
41
+ * - Resets the previous pending link to IDLE (urgent update, immediate)
42
+ * - Does NOT set the new link to PENDING here — the Link's click handler
43
+ * calls setLinkStatus(PENDING) directly for the eager show
44
+ * - Increments the navId counter for stale-clear protection
45
+ *
46
+ * Pass `null` to clear (e.g., for programmatic navigations).
47
+ */
48
+ export declare function setLinkForCurrentNavigation(link: LinkPendingInstance | null): void;
49
+ /**
50
+ * Get the current navigation ID. Called at the start of the transition
51
+ * to capture the ID before async work begins.
52
+ */
53
+ export declare function getCurrentNavId(): number;
54
+ /**
55
+ * Reset the current link's pending state to IDLE, but only if the navId
56
+ * matches. Called inside TransitionRoot's startTransition after the async
57
+ * work completes — the setter call is a transition update, so it commits
58
+ * atomically with the new tree.
59
+ *
60
+ * The navId guard prevents stale transitions from clearing a newer
61
+ * navigation's pending state. Scenario:
62
+ * Click A → navId=1, T1 starts
63
+ * Click B → navId=2, A reset to IDLE, T2 starts
64
+ * T1 completes → resetLinkPending(1) → navId is 2, skip ✓
65
+ * T2 completes → resetLinkPending(2) → navId is 2, clear ✓
66
+ */
67
+ export declare function resetLinkPending(forNavId: number): void;
68
+ /**
69
+ * Clean up the link pending store entirely. Safety net for error paths.
70
+ */
71
+ export declare function clearLinkPendingSetter(): void;
72
+ /**
73
+ * Unmount a link instance from navigation tracking. Called when a Link
74
+ * component unmounts while it is the current navigation link. Prevents
75
+ * calling setState on an unmounted component.
76
+ */
77
+ export declare function unmountLinkForCurrentNavigation(link: LinkPendingInstance): void;
78
+ //# sourceMappingURL=link-pending-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link-pending-store.d.ts","sourceRoot":"","sources":["../../src/client/link-pending-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIvD,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CAC7C;AAMD,kEAAkE;AAClE,eAAO,MAAM,mBAAmB,EAAE,UAA8B,CAAC;AAEjE,+DAA+D;AAC/D,eAAO,MAAM,gBAAgB,EAAE,UAA+B,CAAC;AAmB/D;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,mBAAmB,GAAG,IAAI,GAAG,IAAI,CAWlF;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAMvD;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAG7C;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,mBAAmB,GAAG,IAAI,CAK/E"}
@@ -1,5 +1,5 @@
1
- import type { AnchorHTMLAttributes, ReactNode } from 'react';
2
- import type { SearchParamsDefinition } from '#/search-params/create.js';
1
+ import { type AnchorHTMLAttributes, type ReactNode } from 'react';
2
+ import type { SearchParamsDefinition } from '../search-params/define.js';
3
3
  export type OnNavigateEvent = {
4
4
  preventDefault: () => void;
5
5
  };
@@ -15,6 +15,20 @@ interface LinkBaseProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'h
15
15
  * Set to false for tabbed interfaces where content changes within a fixed layout.
16
16
  */
17
17
  scroll?: boolean;
18
+ /**
19
+ * Preserve search params from the current URL across navigation.
20
+ *
21
+ * - `true` — preserve ALL current search params (target params take precedence)
22
+ * - `string[]` — preserve only the named params (e.g. `['private', 'token']`)
23
+ *
24
+ * Useful for route-group gating where a search param (e.g. `?private=access`)
25
+ * must persist across internal navigations. The target href's own search params
26
+ * always take precedence over preserved ones.
27
+ *
28
+ * During SSR, reads search params from the request context. On the client,
29
+ * reads from the current URL and updates reactively when the URL changes.
30
+ */
31
+ preserveSearchParams?: true | string[];
18
32
  /**
19
33
  * Called before client-side navigation commits. Call `e.preventDefault()`
20
34
  * to cancel the default navigation — the caller is then responsible for
@@ -33,7 +47,7 @@ interface LinkBaseProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'h
33
47
  */
34
48
  export interface LinkPropsWithHref extends LinkBaseProps {
35
49
  href: string;
36
- params?: never;
50
+ segmentParams?: never;
37
51
  /**
38
52
  * Typed search params — serialized via the route's SearchParamsDefinition.
39
53
  * Mutually exclusive with an inline query string in href.
@@ -44,9 +58,9 @@ export interface LinkPropsWithHref extends LinkBaseProps {
44
58
  };
45
59
  }
46
60
  /**
47
- * Link with a route pattern + params for interpolation.
48
- * e.g. <Link href="/products/[id]" params={{ id: "123" }}>
49
- * <Link href="/products/[id]" params={{ id: 123 }}>
61
+ * Link with a route pattern + segmentParams for interpolation.
62
+ * e.g. <Link href="/products/[id]" segmentParams={{ id: "123" }}>
63
+ * <Link href="/products/[id]" segmentParams={{ id: 123 }}>
50
64
  */
51
65
  export interface LinkPropsWithParams extends LinkBaseProps {
52
66
  /** Route pattern with dynamic segments (e.g. "/products/[id]") */
@@ -56,7 +70,7 @@ export interface LinkPropsWithParams extends LinkBaseProps {
56
70
  * Single dynamic segments accept string | number (numbers are stringified).
57
71
  * Catch-all segments accept string[].
58
72
  */
59
- params: Record<string, string | number | string[]>;
73
+ segmentParams: Record<string, string | number | string[]>;
60
74
  /**
61
75
  * Typed search params — serialized via the route's SearchParamsDefinition.
62
76
  */
@@ -114,9 +128,9 @@ export declare function buildLinkProps(props: Pick<LinkPropsWithHref, 'href'> &
114
128
  * its own click handling.
115
129
  *
116
130
  * Supports typed routes via codegen overloads. At runtime:
117
- * - `params` prop interpolates dynamic segments in the href pattern
131
+ * - `segmentParams` prop interpolates dynamic segments in the href pattern
118
132
  * - `searchParams` prop serializes query parameters via a SearchParamsDefinition
119
133
  */
120
- export declare function Link({ href, prefetch, scroll, params, searchParams, onNavigate, onClick: userOnClick, onMouseEnter: userOnMouseEnter, children, ...rest }: LinkProps): import("react/jsx-runtime").JSX.Element;
134
+ export declare function Link({ href, prefetch, scroll, segmentParams, searchParams, preserveSearchParams, onNavigate, onClick: userOnClick, onMouseEnter: userOnMouseEnter, children, ...rest }: LinkProps): import("react/jsx-runtime").JSX.Element;
121
135
  export {};
122
136
  //# sourceMappingURL=link.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/client/link.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAiC,MAAM,OAAO,CAAC;AAC5F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAMxE,MAAM,MAAM,eAAe,GAAG;IAC5B,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,iBA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AAO,CAAC,CAAC,CAAC;QAC5D,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACjC,CAAC;CACH,GACA,eAAe,CAIjB;AAkCD;;;;;;;;;;;GAWG;AACH,wBAAgB,IAAI,CAAC,EACnB,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,UAAU,EACV,OAAO,EAAE,WAAW,EACpB,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,SAAS,2CAsHX"}
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Holds the current route params and pathname, updated atomically
5
5
  * with the RSC tree on each navigation. This replaces the previous
6
- * useSyncExternalStore approach for useParams() and usePathname(),
6
+ * useSyncExternalStore approach for useSegmentParams() and usePathname(),
7
7
  * which suffered from a timing gap: the new tree could commit before
8
8
  * the external store re-renders fired, causing a frame where both
9
9
  * old and new active states were visible simultaneously.
@@ -44,7 +44,7 @@ export interface NavigationState {
44
44
  /**
45
45
  * Read the navigation context. Returns null during SSR (no provider)
46
46
  * or in the RSC environment (no context available).
47
- * Internal — used by useParams() and usePathname().
47
+ * Internal — used by useSegmentParams() and usePathname().
48
48
  */
49
49
  export declare function useNavigationContext(): NavigationState | null;
50
50
  export interface NavigationProviderProps {
@@ -1 +1 @@
1
- {"version":3,"file":"navigation-context.d.ts","sourceRoot":"","sources":["../../src/client/navigation-context.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,KAAK,EAAE,EAAiB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAM7D,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IAC1C,QAAQ,EAAE,MAAM,CAAC;CAClB;AAuCD;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,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,YAAY,CAO9C;AA6BD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAE/D;AAED,wBAAgB,kBAAkB,IAAI,eAAe,CAEpD;AA8BD;;;GAGG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,GAAG,IAAI,CAKvD;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,EACxC,KAAK,EACL,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,GAAG,KAAK,CAAC,YAAY,CAMrB"}
@@ -2,6 +2,7 @@ import { SegmentCache, PrefetchCache } from './segment-cache';
2
2
  import type { SegmentInfo } from './segment-cache';
3
3
  import { HistoryStack } from './history';
4
4
  import type { HeadElement } from './head';
5
+ import { type NavigationState } from './navigation-context.js';
5
6
  export interface NavigationOptions {
6
7
  /** Set to false to prevent scroll-to-top on forward navigation */
7
8
  scroll?: boolean;
@@ -18,8 +19,12 @@ export type RscDecoder = (fetchPromise: Promise<Response>) => unknown;
18
19
  * Function that renders a decoded RSC element tree into the DOM.
19
20
  * In production: reactRoot.render(element).
20
21
  * In tests: a no-op or mock.
22
+ *
23
+ * Receives the current NavigationState explicitly — no temporal
24
+ * coupling with setNavigationState/getNavigationState. The renderer
25
+ * wraps the element in NavigationProvider with this state.
21
26
  */
22
- export type RootRenderer = (element: unknown) => void;
27
+ export type RootRenderer = (element: unknown, navState: NavigationState) => void;
23
28
  /**
24
29
  * Platform dependencies injected for testability. In production these
25
30
  * map to browser APIs; in tests they're replaced with mocks.
@@ -50,11 +55,13 @@ export interface RouterDeps {
50
55
  *
51
56
  * The `perform` callback receives a `wrapPayload` function to wrap the
52
57
  * decoded RSC payload with NavigationProvider + NuqsAdapter before
53
- * TransitionRoot sets it as the new element.
58
+ * TransitionRoot sets it as the new element. The `wrapPayload` function
59
+ * receives the NavigationState explicitly — no temporal coupling with
60
+ * getNavigationState().
54
61
  *
55
62
  * If not provided (tests), the router falls back to renderRoot.
56
63
  */
57
- navigateTransition?: (pendingUrl: string, perform: (wrapPayload: (payload: unknown) => unknown) => Promise<unknown>) => Promise<void>;
64
+ navigateTransition?: (pendingUrl: string, perform: (wrapPayload: (payload: unknown, navState: NavigationState) => unknown) => Promise<unknown>) => Promise<void>;
58
65
  }
59
66
  export interface RouterInstance {
60
67
  /** Navigate to a new URL (forward navigation) */
@@ -99,5 +106,20 @@ export interface RouterInstance {
99
106
  * Create a router instance. In production, called once at app hydration
100
107
  * with real browser APIs. In tests, called with mock dependencies.
101
108
  */
109
+ /**
110
+ * Router navigation phase — discriminated union replacing scattered
111
+ * `pending` + `pendingUrl` boolean flags.
112
+ *
113
+ * - `idle`: No navigation in flight. The committed params/pathname
114
+ * are current.
115
+ * - `navigating`: A fetch or render is in progress. `targetUrl` is
116
+ * the destination being navigated to.
117
+ */
118
+ export type RouterPhase = {
119
+ phase: 'idle';
120
+ } | {
121
+ phase: 'navigating';
122
+ targetUrl: string;
123
+ };
102
124
  export declare function createRouter(deps: RouterDeps): RouterInstance;
103
125
  //# sourceMappingURL=router.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/client/router.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAoB,MAAM,iBAAiB,CAAC;AAChF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAa1C,MAAM,WAAW,iBAAiB;IAChC,kEAAkE;IAClE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,QAAQ,CAAC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IAC7B,4CAA4C;IAC5C,YAAY,EAAE,YAAY,CAAC;CAC5B;AAcD;;;GAGG;AACH;;;;;;;;GAQG;AACH,MAAM,MAAM,WAAW,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,YAAY,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzF,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,cAAc,CAuY7D"}
@@ -19,12 +19,25 @@ export interface FetchResult {
19
19
  headElements: HeadElement[] | null;
20
20
  /** Segment metadata from X-Timber-Segments header for populating the segment cache. */
21
21
  segmentInfo: SegmentInfo[] | null;
22
- /** Route params from X-Timber-Params header for populating useParams(). */
22
+ /** Route params from X-Timber-Params header for populating useSegmentParams(). */
23
23
  params: Record<string, string | string[]> | null;
24
24
  /** Segment paths that were skipped by the server (for client-side merging). */
25
25
  skippedSegments: string[] | null;
26
26
  }
27
27
  export declare const RSC_CONTENT_TYPE = "text/x-component";
28
+ /** Set the client deployment ID. Called once at bootstrap. */
29
+ export declare function setClientDeploymentId(id: string | null): void;
30
+ /** Get the client deployment ID. */
31
+ export declare function getClientDeploymentId(): string | null;
32
+ /** Header name used by the server to signal a version skew reload. */
33
+ export declare const RELOAD_HEADER = "X-Timber-Reload";
34
+ /** Header name for the client's deployment ID. */
35
+ export declare const DEPLOYMENT_ID_HEADER = "X-Timber-Deployment-Id";
36
+ /**
37
+ * Check if a response signals a version skew reload.
38
+ * Triggers a full page reload if the server indicates the client is stale.
39
+ */
40
+ export declare function checkReloadSignal(response: Response): boolean;
28
41
  export declare function buildRscHeaders(stateTree: {
29
42
  segments: string[];
30
43
  } | undefined, currentUrl?: string): Record<string, string>;
@@ -55,7 +68,7 @@ export declare function extractSkippedSegments(response: Response): string[] | n
55
68
  * Extract route params from the X-Timber-Params response header.
56
69
  * Returns null if the header is missing or malformed.
57
70
  *
58
- * Used to populate useParams() after client-side navigation.
71
+ * Used to populate useSegmentParams() after client-side navigation.
59
72
  */
60
73
  export declare function extractParams(response: Response): Record<string, string | string[]> | null;
61
74
  /**
@@ -66,6 +79,27 @@ export declare class RedirectError extends Error {
66
79
  readonly redirectUrl: string;
67
80
  constructor(url: string);
68
81
  }
82
+ /**
83
+ * Thrown when the server signals a version skew (X-Timber-Reload header).
84
+ * Caught in navigate() to trigger a full page reload via triggerStaleReload().
85
+ * See TIM-446.
86
+ */
87
+ export declare class VersionSkewError extends Error {
88
+ constructor();
89
+ }
90
+ /**
91
+ * Thrown when the server returns a 5xx error for an RSC payload request.
92
+ * The server sends X-Timber-Error header and a JSON body instead of a
93
+ * broken RSC stream. Caught in navigate() to trigger a hard navigation
94
+ * so the server can render the error page as HTML.
95
+ *
96
+ * See design/10-error-handling.md §"Error Page Rendering for Client Navigation"
97
+ */
98
+ export declare class ServerErrorResponse extends Error {
99
+ readonly status: number;
100
+ readonly url: string;
101
+ constructor(status: number, url: string);
102
+ }
69
103
  /**
70
104
  * Fetch an RSC payload from the server. If a decodeRsc function is provided,
71
105
  * the response is decoded into a React element tree via createFromFetch.
@@ -1 +1 @@
1
- {"version":3,"file":"rsc-fetch.d.ts","sourceRoot":"","sources":["../../src/client/rsc-fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAI3C,uFAAuF;AACvF,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IACnC,uFAAuF;IACvF,WAAW,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAClC,2EAA2E;IAC3E,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAA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,GAAG,WAAW,EAAE,GAAG,IAAI,CAQ3E;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,EAAE,GAAG,IAAI,CAS1E;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,IAAI,CAQ1F;AAID;;;GAGG;AACH,qBAAa,aAAc,SAAQ,KAAK;IACtC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;gBACjB,GAAG,EAAE,MAAM;CAIxB;AAED;;;;GAIG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;;CAI1C;AAED;;;;;;;GAOG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;gBACT,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;CAKxC;AAID;;;;;;;GAOG;AACH,wBAAsB,eAAe,CACnC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,UAAU,EAChB,SAAS,CAAC,EAAE;IAAE,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,EAClC,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,WAAW,CAAC,CAsEtB"}
@@ -5,7 +5,7 @@ export interface PrefetchResult {
5
5
  headElements: HeadElement[] | null;
6
6
  /** Segment metadata from X-Timber-Segments header for populating the segment cache. */
7
7
  segmentInfo?: SegmentInfo[] | null;
8
- /** Route params from X-Timber-Params header for populating useParams(). */
8
+ /** Route params from X-Timber-Params header for populating useSegmentParams(). */
9
9
  params?: Record<string, string | string[]> | null;
10
10
  /** Segment paths skipped by the server (for client-side merging). */
11
11
  skippedSegments?: string[] | null;
@@ -1 +1 @@
1
- {"version":3,"file":"segment-cache.d.ts","sourceRoot":"","sources":["../../src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WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAID;;;;GAIG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,IAAI,CAA0B;IAEtC,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;IAO7C,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI;IAM7C,KAAK,IAAI,IAAI;IAIb;;;;;;;;;;;;OAYG;IACH,kBAAkB,CAAC,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,SAAS;CAO7D;AAkBD;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,WAAW,GAAG,SAAS,CA+BjF;AASD;;;;;;;GAOG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAU;IACxC,OAAO,CAAC,OAAO,CAAoC;IAEnD,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,IAAI;IAO9C,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAU5C,0EAA0E;IAC1E,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;CAOjD"}
@@ -34,6 +34,6 @@ interface SegmentProviderProps {
34
34
  * Wraps each layout to provide segment position context.
35
35
  * Injected by rsc-entry.ts during element tree construction.
36
36
  */
37
- export declare function SegmentProvider({ segments, segmentId: _segmentId, parallelRouteKeys, children }: SegmentProviderProps): import("react").FunctionComponentElement<import("react").ProviderProps<SegmentContextValue | null>>;
37
+ export declare function SegmentProvider({ segments, segmentId: _segmentId, parallelRouteKeys, children, }: SegmentProviderProps): import("react").FunctionComponentElement<import("react").ProviderProps<SegmentContextValue | null>>;
38
38
  export {};
39
39
  //# sourceMappingURL=segment-context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"segment-context.d.ts","sourceRoot":"","sources":["../../src/client/segment-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAQH,MAAM,WAAW,mBAAmB;IAClC,iFAAiF;IACjF,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,0FAA0F;IAC1F,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B;AAMD,qFAAqF;AACrF,wBAAgB,iBAAiB,IAAI,mBAAmB,GAAG,IAAI,CAE9D;AAID,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,EAAE,QAAQ,EAAE,EAAE,oBAAoB,uGASrH"}
1
+ {"version":3,"file":"segment-context.d.ts","sourceRoot":"","sources":["../../src/client/segment-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAQH,MAAM,WAAW,mBAAmB;IAClC,iFAAiF;IACjF,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,0FAA0F;IAC1F,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B;AAMD,qFAAqF;AACrF,wBAAgB,iBAAiB,IAAI,mBAAmB,GAAG,IAAI,CAE9D;AAID,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS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AgB,cAAc,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAM5D;AAID;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,kBAAkB,EAAE,CAUtE;AAuCD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,mBAAmB,GAAG,IAAI,CAKvF;AAkDD;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,YAAY,EAC3B,eAAe,EAAE,SAAS,EAC1B,gBAAgB,CAAC,EAAE,MAAM,GACxB,YAAY,CAoCd;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAC9B,cAAc,EAAE,OAAO,EACvB,eAAe,EAAE,MAAM,EAAE,EACzB,KAAK,EAAE,mBAAmB,GACzB,OAAO,CA0BT"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * SegmentOutlet — client component boundary at each layout segment.
3
+ *
4
+ * Replaces the post-hoc tree walking in segment-merger.ts with an explicit
5
+ * client component at each segment boundary. Each outlet:
6
+ *
7
+ * 1. Knows its own segment path (prop from the server)
8
+ * 2. Caches its children in a ref across navigations
9
+ * 3. When `keepCurrent` is true (partial navigation, this segment skipped),
10
+ * returns the previously cached children — layout state is preserved
11
+ * 4. When `keepCurrent` is false (full navigation or this segment changed),
12
+ * stores and renders the new children
13
+ *
14
+ * This eliminates the need for client-side element tree walking, which
15
+ * breaks on real RSC trees due to opaque client component lazy refs,
16
+ * Suspense thenables, and AccessGate wrappers.
17
+ *
18
+ * Architecture is similar to Next.js's `<LayoutRouter>` client component —
19
+ * each layout boundary is an explicit client component that manages its
20
+ * own subtree. See design/19-client-navigation.md.
21
+ *
22
+ * Security: This is a performance optimization only. The server always
23
+ * runs all access.ts files regardless of segment skipping. A fabricated
24
+ * keepCurrent prop can only cause stale layouts — never auth bypass.
25
+ * See design/13-security.md §"State tree manipulation".
26
+ */
27
+ import { type ReactNode } from 'react';
28
+ export interface SegmentOutletProps {
29
+ /**
30
+ * Unique identifier for this segment. For normal segments this is the
31
+ * urlPath (e.g., "/", "/dashboard"). For route groups this includes the
32
+ * group name (e.g., "/(marketing)") to distinguish siblings that share
33
+ * the same urlPath. Must match the segmentId used in state-tree-diff.ts.
34
+ */
35
+ segmentPath: string;
36
+ /**
37
+ * When true, the outlet returns its previously cached children instead
38
+ * of rendering the new children prop. Set by the server when this
39
+ * segment was skipped (the client already has the layout mounted).
40
+ *
41
+ * On the first render (SSR/hydration), this is always false — there's
42
+ * no cached content yet. On subsequent partial navigations, the server
43
+ * sets this to true for segments it skipped rendering.
44
+ */
45
+ keepCurrent?: boolean;
46
+ /** The segment's React subtree (layout + inner content). */
47
+ children: ReactNode;
48
+ }
49
+ /**
50
+ * Client component boundary at each layout segment in the element tree.
51
+ *
52
+ * On full navigation: receives new children, stores them, renders them.
53
+ * On partial navigation (keepCurrent=true): ignores children prop,
54
+ * returns previously stored content — React reconciles the same elements,
55
+ * preserving all client component state in the layout subtree.
56
+ *
57
+ * React preserves the ref across `reactRoot.render()` calls because:
58
+ * - SegmentOutlet has a stable type (client component module reference)
59
+ * - It appears at the same tree position on every navigation
60
+ * - React reconciles same-type, same-position → instance preserved
61
+ */
62
+ export declare function SegmentOutlet({ segmentPath: _segmentPath, keepCurrent, children, }: SegmentOutletProps): ReactNode;
63
+ //# sourceMappingURL=segment-outlet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"segment-outlet.d.ts","sourceRoot":"","sources":["../../src/client/segment-outlet.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAIH,OAAO,EAAU,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE/C,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,4DAA4D;IAC5D,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,EAC5B,WAAW,EAAE,YAAY,EACzB,WAAmB,EACnB,QAAQ,GACT,EAAE,kBAAkB,aAapB"}
@@ -24,6 +24,21 @@
24
24
  * new bundle hashes while the client is still running old JavaScript.
25
25
  */
26
26
  export declare function isStaleClientReference(error: unknown): boolean;
27
+ /**
28
+ * Check if an error is a chunk load failure from a dynamic import.
29
+ *
30
+ * After a deployment, old chunk filenames no longer exist. When the client
31
+ * tries to dynamically import a chunk that's been replaced, the browser
32
+ * throws one of these errors:
33
+ *
34
+ * - Chromium: "Failed to fetch dynamically imported module: <url>"
35
+ * - Firefox: "error loading dynamically imported module: <url>"
36
+ * - Safari: "Importing a module script failed."
37
+ * - Vite/Rollup: "Unable to preload CSS for <url>"
38
+ *
39
+ * See TIM-446
40
+ */
41
+ export declare function isChunkLoadError(error: unknown): boolean;
27
42
  /**
28
43
  * Trigger a full page reload to pick up new bundles.
29
44
  *
@@ -1 +1 @@
1
- {"version":3,"file":"stale-reload.d.ts","sourceRoot":"","sources":["../../src/client/stale-reload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAI9D;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CA+B5C;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAM3C"}
1
+ {"version":3,"file":"stale-reload.d.ts","sourceRoot":"","sources":["../../src/client/stale-reload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAcH;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAI9D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAYxD;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAqD5C;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAa3C"}
@@ -31,7 +31,7 @@ export interface TopLoaderConfig {
31
31
  color?: string;
32
32
  /** Bar height in pixels. Default: 3. */
33
33
  height?: number;
34
- /** Show subtle glow/shadow effect. Default: true. */
34
+ /** Show subtle glow/shadow effect. Default: false. */
35
35
  shadow?: boolean;
36
36
  /** Delay in ms before showing the bar. Default: 0. */
37
37
  delay?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"top-loader.d.ts","sourceRoot":"","sources":["../../src/client/top-loader.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AASH,MAAM,WAAW,eAAe;IAC9B,wDAAwD;IACxD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAmDD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,eAAe,CAAA;CAAE,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CA0F7F"}
1
+ {"version":3,"file":"top-loader.d.ts","sourceRoot":"","sources":["../../src/client/top-loader.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AASH,MAAM,WAAW,eAAe;IAC9B,wDAAwD;IACxD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAmDD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,eAAe,CAAA;CAAE,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CA2F7F"}
@@ -40,7 +40,7 @@ import { type TopLoaderConfig } from './top-loader.js';
40
40
  * Non-navigation renders:
41
41
  * transitionRender(newWrappedElement);
42
42
  */
43
- export declare function TransitionRoot({ initial, topLoaderConfig }: {
43
+ export declare function TransitionRoot({ initial, topLoaderConfig, }: {
44
44
  initial: ReactNode;
45
45
  topLoaderConfig?: TopLoaderConfig;
46
46
  }): ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"transition-root.d.ts","sourceRoot":"","sources":["../../src/client/transition-root.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAoD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzF,OAAO,EAAa,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAqBlE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,EAAE;IAAE,OAAO,EAAE,SAAS,CAAC;IAAC,eAAe,CAAC,EAAE,eAAe,CAAA;CAAE,GAAG,SAAS,CAgDjI;AAID;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,SAAS,GAAG,IAAI,CAIzD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,OAAO,CAAC,SAAS,CAAC,GAChC,OAAO,CAAC,IAAI,CAAC,CAMf;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,OAAO,CAE/C"}
1
+ {"version":3,"file":"transition-root.d.ts","sourceRoot":"","sources":["../../src/client/transition-root.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAoD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzF,OAAO,EAAa,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAsBlE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,eAAe,GAChB,EAAE;IACD,OAAO,EAAE,SAAS,CAAC;IACnB,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC,GAAG,SAAS,CA2DZ;AAID;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,SAAS,GAAG,IAAI,CAIzD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,OAAO,CAAC,SAAS,CAAC,GAChC,OAAO,CAAC,IAAI,CAAC,CAMf;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,OAAO,CAE/C"}
@@ -29,7 +29,7 @@
29
29
  *
30
30
  * Design doc: design/09-typescript.md §"Typed Routes"
31
31
  */
32
- import type { Routes } from '#/index.js';
32
+ import type { Routes } from '../index.js';
33
33
  /**
34
34
  * Subscribe to params changes.
35
35
  * Retained for backward compatibility with tests that verify the
@@ -87,6 +87,6 @@ export declare function notifyParamsListeners(): void;
87
87
  * exact params shape from the generated Routes interface.
88
88
  * @overload Fallback — returns the generic params record.
89
89
  */
90
- export declare function useParams<R extends keyof Routes>(route: R): Routes[R]['params'];
91
- export declare function useParams(route?: string): Record<string, string | string[]>;
90
+ export declare function useSegmentParams<R extends keyof Routes>(route: R): Routes[R]['params'];
91
+ export declare function useSegmentParams(route?: string): Record<string, string | string[]>;
92
92
  //# sourceMappingURL=use-params.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-params.d.ts","sourceRoot":"","sources":["../../src/client/use-params.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AASzC;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAG1D;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAE/D;AAMD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,IAAI,CAEhF;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAI5C;AAMD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;AACjF,wBAAgB,SAAS,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC"}
1
+ {"version":3,"file":"use-params.d.ts","sourceRoot":"","sources":["../../src/client/use-params.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAS1C;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAG1D;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAE/D;AAMD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,IAAI,CAEhF;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAI5C;AAMD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;AACxF,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC"}
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * Design doc: design/23-search-params.md §"Codec Bridge"
9
9
  */
10
- import type { SearchParamCodec, SearchParamsDefinition, SetParams, QueryStatesOptions } from '#/search-params/create.js';
10
+ import type { SearchParamCodec, SearchParamsDefinition, SetParams, QueryStatesOptions } from '../search-params/define.js';
11
11
  /**
12
12
  * Read and write typed search params from/to the URL.
13
13
  *
@@ -1 +1 @@
1
- {"version":3,"file":"use-query-states.d.ts","sourceRoot":"","sources":["../../src/client/use-query-states.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,KAAK,EACV,gBAAgB,EAChB,sBAAsB,EACtB,SAAS,EACT,kBAAkB,EACnB,MAAM,2BAA2B,CAAC;AAoCnC;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9D,aAAa,EAAE;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAAG,MAAM,EAClE,QAA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D"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Shared codec protocol for parsing and serializing string values.
3
+ *
4
+ * Used by both search params and cookies. Any object with parse + serialize
5
+ * methods satisfies this interface. nuqs parsers are valid codecs natively.
6
+ *
7
+ * Design doc: design/23a-search-params-triage.md §"Unify Codec<T> type"
8
+ */
9
+ /**
10
+ * A codec that converts between string values and typed values.
11
+ *
12
+ * The canonical protocol shared across search params, cookies, and
13
+ * any future timber feature that needs string ↔ typed conversion.
14
+ */
15
+ export interface Codec<T> {
16
+ /** String → typed value. Receives undefined when the value is absent. */
17
+ parse(value: string | string[] | undefined): T;
18
+ /** Typed value → string. Return null to omit/clear. */
19
+ serialize(value: T): string | null;
20
+ }
21
+ //# sourceMappingURL=codec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../src/codec.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,KAAK,CAAC,CAAC;IACtB,yEAAyE;IACzE,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,GAAG,CAAC,CAAC;IAC/C,uDAAuD;IACvD,SAAS,CAAC,KAAK,EAAE,CAAC,GAAG,MAAM,GAAG,IAAI,CAAC;CACpC"}