@rangojs/router 0.0.0-experimental.121 → 0.0.0-experimental.122

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 (833) hide show
  1. package/dist/vite/index.js +1 -1
  2. package/package.json +1 -1
  3. package/skills/cache-guide/SKILL.md +8 -6
  4. package/skills/caching/SKILL.md +146 -0
  5. package/skills/migrate-nextjs/SKILL.md +35 -15
  6. package/skills/rango/SKILL.md +15 -15
  7. package/skills/use-cache/SKILL.md +9 -7
  8. package/src/cache/cache-error.ts +104 -0
  9. package/src/cache/cache-policy.ts +95 -1
  10. package/src/cache/cache-runtime.ts +79 -13
  11. package/src/cache/cache-scope.ts +55 -4
  12. package/src/cache/cache-tag.ts +135 -0
  13. package/src/cache/cf/cf-cache-store.ts +2058 -223
  14. package/src/cache/cf/index.ts +15 -1
  15. package/src/cache/document-cache.ts +63 -7
  16. package/src/cache/index.ts +17 -0
  17. package/src/cache/memory-segment-store.ts +158 -14
  18. package/src/cache/tag-invalidation.ts +230 -0
  19. package/src/cache/types.ts +27 -0
  20. package/src/index.rsc.ts +7 -0
  21. package/src/index.ts +12 -0
  22. package/src/router/prerender-match.ts +2 -0
  23. package/src/router/segment-resolution/loader-cache.ts +8 -17
  24. package/src/rsc/handler.ts +10 -1
  25. package/src/rsc/response-route-handler.ts +8 -1
  26. package/src/server/request-context.ts +36 -2
  27. package/src/types/cache-types.ts +13 -4
  28. package/src/types/error-types.ts +5 -1
  29. package/dist/__internal.d.ts +0 -83
  30. package/dist/__internal.d.ts.map +0 -1
  31. package/dist/__internal.js +0 -19
  32. package/dist/__internal.js.map +0 -1
  33. package/dist/__mocks__/version.d.ts +0 -7
  34. package/dist/__mocks__/version.d.ts.map +0 -1
  35. package/dist/__mocks__/version.js +0 -7
  36. package/dist/__mocks__/version.js.map +0 -1
  37. package/dist/__tests__/client-href.test.d.ts +0 -2
  38. package/dist/__tests__/client-href.test.d.ts.map +0 -1
  39. package/dist/__tests__/client-href.test.js +0 -74
  40. package/dist/__tests__/client-href.test.js.map +0 -1
  41. package/dist/__tests__/component-utils.test.d.ts +0 -2
  42. package/dist/__tests__/component-utils.test.d.ts.map +0 -1
  43. package/dist/__tests__/component-utils.test.js +0 -51
  44. package/dist/__tests__/component-utils.test.js.map +0 -1
  45. package/dist/__tests__/event-controller.test.d.ts +0 -2
  46. package/dist/__tests__/event-controller.test.d.ts.map +0 -1
  47. package/dist/__tests__/event-controller.test.js +0 -538
  48. package/dist/__tests__/event-controller.test.js.map +0 -1
  49. package/dist/__tests__/helpers/route-tree.d.ts +0 -118
  50. package/dist/__tests__/helpers/route-tree.d.ts.map +0 -1
  51. package/dist/__tests__/helpers/route-tree.js +0 -374
  52. package/dist/__tests__/helpers/route-tree.js.map +0 -1
  53. package/dist/__tests__/match-result.test.d.ts +0 -2
  54. package/dist/__tests__/match-result.test.d.ts.map +0 -1
  55. package/dist/__tests__/match-result.test.js +0 -154
  56. package/dist/__tests__/match-result.test.js.map +0 -1
  57. package/dist/__tests__/navigation-store.test.d.ts +0 -2
  58. package/dist/__tests__/navigation-store.test.d.ts.map +0 -1
  59. package/dist/__tests__/navigation-store.test.js +0 -440
  60. package/dist/__tests__/navigation-store.test.js.map +0 -1
  61. package/dist/__tests__/partial-update.test.d.ts +0 -2
  62. package/dist/__tests__/partial-update.test.d.ts.map +0 -1
  63. package/dist/__tests__/partial-update.test.js +0 -1009
  64. package/dist/__tests__/partial-update.test.js.map +0 -1
  65. package/dist/__tests__/reverse-types.test.d.ts +0 -8
  66. package/dist/__tests__/reverse-types.test.d.ts.map +0 -1
  67. package/dist/__tests__/reverse-types.test.js +0 -656
  68. package/dist/__tests__/reverse-types.test.js.map +0 -1
  69. package/dist/__tests__/route-definition.test.d.ts +0 -2
  70. package/dist/__tests__/route-definition.test.d.ts.map +0 -1
  71. package/dist/__tests__/route-definition.test.js +0 -55
  72. package/dist/__tests__/route-definition.test.js.map +0 -1
  73. package/dist/__tests__/router-helpers.test.d.ts +0 -2
  74. package/dist/__tests__/router-helpers.test.d.ts.map +0 -1
  75. package/dist/__tests__/router-helpers.test.js +0 -377
  76. package/dist/__tests__/router-helpers.test.js.map +0 -1
  77. package/dist/__tests__/router-integration-2.test.d.ts +0 -2
  78. package/dist/__tests__/router-integration-2.test.d.ts.map +0 -1
  79. package/dist/__tests__/router-integration-2.test.js +0 -426
  80. package/dist/__tests__/router-integration-2.test.js.map +0 -1
  81. package/dist/__tests__/router-integration.test.d.ts +0 -2
  82. package/dist/__tests__/router-integration.test.d.ts.map +0 -1
  83. package/dist/__tests__/router-integration.test.js +0 -1051
  84. package/dist/__tests__/router-integration.test.js.map +0 -1
  85. package/dist/__tests__/search-params.test.d.ts +0 -5
  86. package/dist/__tests__/search-params.test.d.ts.map +0 -1
  87. package/dist/__tests__/search-params.test.js +0 -306
  88. package/dist/__tests__/search-params.test.js.map +0 -1
  89. package/dist/__tests__/segment-system.test.d.ts +0 -2
  90. package/dist/__tests__/segment-system.test.d.ts.map +0 -1
  91. package/dist/__tests__/segment-system.test.js +0 -627
  92. package/dist/__tests__/segment-system.test.js.map +0 -1
  93. package/dist/__tests__/static-handler-types.test.d.ts +0 -8
  94. package/dist/__tests__/static-handler-types.test.d.ts.map +0 -1
  95. package/dist/__tests__/static-handler-types.test.js +0 -63
  96. package/dist/__tests__/static-handler-types.test.js.map +0 -1
  97. package/dist/__tests__/urls.test.d.ts +0 -2
  98. package/dist/__tests__/urls.test.d.ts.map +0 -1
  99. package/dist/__tests__/urls.test.js +0 -421
  100. package/dist/__tests__/urls.test.js.map +0 -1
  101. package/dist/__tests__/use-mount.test.d.ts +0 -2
  102. package/dist/__tests__/use-mount.test.d.ts.map +0 -1
  103. package/dist/__tests__/use-mount.test.js +0 -35
  104. package/dist/__tests__/use-mount.test.js.map +0 -1
  105. package/dist/bin/rango.d.ts +0 -2
  106. package/dist/bin/rango.d.ts.map +0 -1
  107. package/dist/bin/rango.js.map +0 -1
  108. package/dist/browser/event-controller.d.ts +0 -191
  109. package/dist/browser/event-controller.d.ts.map +0 -1
  110. package/dist/browser/event-controller.js +0 -559
  111. package/dist/browser/event-controller.js.map +0 -1
  112. package/dist/browser/index.d.ts +0 -2
  113. package/dist/browser/index.d.ts.map +0 -1
  114. package/dist/browser/index.js +0 -14
  115. package/dist/browser/index.js.map +0 -1
  116. package/dist/browser/link-interceptor.d.ts +0 -38
  117. package/dist/browser/link-interceptor.d.ts.map +0 -1
  118. package/dist/browser/link-interceptor.js +0 -99
  119. package/dist/browser/link-interceptor.js.map +0 -1
  120. package/dist/browser/logging.d.ts +0 -10
  121. package/dist/browser/logging.d.ts.map +0 -1
  122. package/dist/browser/logging.js +0 -29
  123. package/dist/browser/logging.js.map +0 -1
  124. package/dist/browser/lru-cache.d.ts +0 -17
  125. package/dist/browser/lru-cache.d.ts.map +0 -1
  126. package/dist/browser/lru-cache.js +0 -50
  127. package/dist/browser/lru-cache.js.map +0 -1
  128. package/dist/browser/merge-segment-loaders.d.ts +0 -39
  129. package/dist/browser/merge-segment-loaders.d.ts.map +0 -1
  130. package/dist/browser/merge-segment-loaders.js +0 -102
  131. package/dist/browser/merge-segment-loaders.js.map +0 -1
  132. package/dist/browser/navigation-bridge.d.ts +0 -102
  133. package/dist/browser/navigation-bridge.d.ts.map +0 -1
  134. package/dist/browser/navigation-bridge.js +0 -708
  135. package/dist/browser/navigation-bridge.js.map +0 -1
  136. package/dist/browser/navigation-client.d.ts +0 -25
  137. package/dist/browser/navigation-client.d.ts.map +0 -1
  138. package/dist/browser/navigation-client.js +0 -157
  139. package/dist/browser/navigation-client.js.map +0 -1
  140. package/dist/browser/navigation-store.d.ts +0 -101
  141. package/dist/browser/navigation-store.d.ts.map +0 -1
  142. package/dist/browser/navigation-store.js +0 -625
  143. package/dist/browser/navigation-store.js.map +0 -1
  144. package/dist/browser/partial-update.d.ts +0 -75
  145. package/dist/browser/partial-update.d.ts.map +0 -1
  146. package/dist/browser/partial-update.js +0 -426
  147. package/dist/browser/partial-update.js.map +0 -1
  148. package/dist/browser/react/Link.d.ts +0 -86
  149. package/dist/browser/react/Link.d.ts.map +0 -1
  150. package/dist/browser/react/Link.js +0 -128
  151. package/dist/browser/react/Link.js.map +0 -1
  152. package/dist/browser/react/NavigationProvider.d.ts +0 -63
  153. package/dist/browser/react/NavigationProvider.d.ts.map +0 -1
  154. package/dist/browser/react/NavigationProvider.js +0 -216
  155. package/dist/browser/react/NavigationProvider.js.map +0 -1
  156. package/dist/browser/react/ScrollRestoration.d.ts +0 -75
  157. package/dist/browser/react/ScrollRestoration.d.ts.map +0 -1
  158. package/dist/browser/react/ScrollRestoration.js +0 -57
  159. package/dist/browser/react/ScrollRestoration.js.map +0 -1
  160. package/dist/browser/react/context.d.ts +0 -46
  161. package/dist/browser/react/context.d.ts.map +0 -1
  162. package/dist/browser/react/context.js +0 -10
  163. package/dist/browser/react/context.js.map +0 -1
  164. package/dist/browser/react/index.d.ts +0 -11
  165. package/dist/browser/react/index.d.ts.map +0 -1
  166. package/dist/browser/react/index.js +0 -22
  167. package/dist/browser/react/index.js.map +0 -1
  168. package/dist/browser/react/location-state-shared.d.ts +0 -63
  169. package/dist/browser/react/location-state-shared.d.ts.map +0 -1
  170. package/dist/browser/react/location-state-shared.js +0 -81
  171. package/dist/browser/react/location-state-shared.js.map +0 -1
  172. package/dist/browser/react/location-state.d.ts +0 -23
  173. package/dist/browser/react/location-state.d.ts.map +0 -1
  174. package/dist/browser/react/location-state.js +0 -29
  175. package/dist/browser/react/location-state.js.map +0 -1
  176. package/dist/browser/react/mount-context.d.ts +0 -24
  177. package/dist/browser/react/mount-context.d.ts.map +0 -1
  178. package/dist/browser/react/mount-context.js +0 -24
  179. package/dist/browser/react/mount-context.js.map +0 -1
  180. package/dist/browser/react/use-action.d.ts +0 -64
  181. package/dist/browser/react/use-action.d.ts.map +0 -1
  182. package/dist/browser/react/use-action.js +0 -134
  183. package/dist/browser/react/use-action.js.map +0 -1
  184. package/dist/browser/react/use-client-cache.d.ts +0 -41
  185. package/dist/browser/react/use-client-cache.d.ts.map +0 -1
  186. package/dist/browser/react/use-client-cache.js +0 -39
  187. package/dist/browser/react/use-client-cache.js.map +0 -1
  188. package/dist/browser/react/use-handle.d.ts +0 -31
  189. package/dist/browser/react/use-handle.d.ts.map +0 -1
  190. package/dist/browser/react/use-handle.js +0 -144
  191. package/dist/browser/react/use-handle.js.map +0 -1
  192. package/dist/browser/react/use-href.d.ts +0 -33
  193. package/dist/browser/react/use-href.d.ts.map +0 -1
  194. package/dist/browser/react/use-href.js +0 -39
  195. package/dist/browser/react/use-href.js.map +0 -1
  196. package/dist/browser/react/use-link-status.d.ts +0 -37
  197. package/dist/browser/react/use-link-status.d.ts.map +0 -1
  198. package/dist/browser/react/use-link-status.js +0 -99
  199. package/dist/browser/react/use-link-status.js.map +0 -1
  200. package/dist/browser/react/use-mount.d.ts +0 -25
  201. package/dist/browser/react/use-mount.d.ts.map +0 -1
  202. package/dist/browser/react/use-mount.js +0 -30
  203. package/dist/browser/react/use-mount.js.map +0 -1
  204. package/dist/browser/react/use-navigation.d.ts +0 -27
  205. package/dist/browser/react/use-navigation.d.ts.map +0 -1
  206. package/dist/browser/react/use-navigation.js +0 -87
  207. package/dist/browser/react/use-navigation.js.map +0 -1
  208. package/dist/browser/react/use-segments.d.ts +0 -38
  209. package/dist/browser/react/use-segments.d.ts.map +0 -1
  210. package/dist/browser/react/use-segments.js +0 -130
  211. package/dist/browser/react/use-segments.js.map +0 -1
  212. package/dist/browser/request-controller.d.ts +0 -26
  213. package/dist/browser/request-controller.d.ts.map +0 -1
  214. package/dist/browser/request-controller.js +0 -147
  215. package/dist/browser/request-controller.js.map +0 -1
  216. package/dist/browser/rsc-router.d.ts +0 -129
  217. package/dist/browser/rsc-router.d.ts.map +0 -1
  218. package/dist/browser/rsc-router.js +0 -195
  219. package/dist/browser/rsc-router.js.map +0 -1
  220. package/dist/browser/scroll-restoration.d.ts +0 -93
  221. package/dist/browser/scroll-restoration.d.ts.map +0 -1
  222. package/dist/browser/scroll-restoration.js +0 -321
  223. package/dist/browser/scroll-restoration.js.map +0 -1
  224. package/dist/browser/segment-structure-assert.d.ts +0 -17
  225. package/dist/browser/segment-structure-assert.d.ts.map +0 -1
  226. package/dist/browser/segment-structure-assert.js +0 -59
  227. package/dist/browser/segment-structure-assert.js.map +0 -1
  228. package/dist/browser/server-action-bridge.d.ts +0 -26
  229. package/dist/browser/server-action-bridge.d.ts.map +0 -1
  230. package/dist/browser/server-action-bridge.js +0 -668
  231. package/dist/browser/server-action-bridge.js.map +0 -1
  232. package/dist/browser/shallow.d.ts +0 -12
  233. package/dist/browser/shallow.d.ts.map +0 -1
  234. package/dist/browser/shallow.js +0 -34
  235. package/dist/browser/shallow.js.map +0 -1
  236. package/dist/browser/types.d.ts +0 -369
  237. package/dist/browser/types.d.ts.map +0 -1
  238. package/dist/browser/types.js +0 -2
  239. package/dist/browser/types.js.map +0 -1
  240. package/dist/build/__tests__/generate-cli.test.d.ts +0 -2
  241. package/dist/build/__tests__/generate-cli.test.d.ts.map +0 -1
  242. package/dist/build/__tests__/generate-cli.test.js +0 -237
  243. package/dist/build/__tests__/generate-cli.test.js.map +0 -1
  244. package/dist/build/__tests__/generate-manifest.test.d.ts +0 -2
  245. package/dist/build/__tests__/generate-manifest.test.d.ts.map +0 -1
  246. package/dist/build/__tests__/generate-manifest.test.js +0 -119
  247. package/dist/build/__tests__/generate-manifest.test.js.map +0 -1
  248. package/dist/build/__tests__/generate-route-types.test.d.ts +0 -2
  249. package/dist/build/__tests__/generate-route-types.test.d.ts.map +0 -1
  250. package/dist/build/__tests__/generate-route-types.test.js +0 -620
  251. package/dist/build/__tests__/generate-route-types.test.js.map +0 -1
  252. package/dist/build/__tests__/per-router-manifest.test.d.ts +0 -2
  253. package/dist/build/__tests__/per-router-manifest.test.d.ts.map +0 -1
  254. package/dist/build/__tests__/per-router-manifest.test.js +0 -308
  255. package/dist/build/__tests__/per-router-manifest.test.js.map +0 -1
  256. package/dist/build/generate-manifest.d.ts +0 -81
  257. package/dist/build/generate-manifest.d.ts.map +0 -1
  258. package/dist/build/generate-manifest.js +0 -276
  259. package/dist/build/generate-manifest.js.map +0 -1
  260. package/dist/build/generate-route-types.d.ts +0 -115
  261. package/dist/build/generate-route-types.d.ts.map +0 -1
  262. package/dist/build/generate-route-types.js +0 -740
  263. package/dist/build/generate-route-types.js.map +0 -1
  264. package/dist/build/index.d.ts +0 -21
  265. package/dist/build/index.d.ts.map +0 -1
  266. package/dist/build/index.js +0 -21
  267. package/dist/build/index.js.map +0 -1
  268. package/dist/build/route-trie.d.ts +0 -71
  269. package/dist/build/route-trie.d.ts.map +0 -1
  270. package/dist/build/route-trie.js +0 -175
  271. package/dist/build/route-trie.js.map +0 -1
  272. package/dist/cache/__tests__/cache-scope.test.d.ts +0 -2
  273. package/dist/cache/__tests__/cache-scope.test.d.ts.map +0 -1
  274. package/dist/cache/__tests__/cache-scope.test.js +0 -208
  275. package/dist/cache/__tests__/cache-scope.test.js.map +0 -1
  276. package/dist/cache/__tests__/document-cache.test.d.ts +0 -2
  277. package/dist/cache/__tests__/document-cache.test.d.ts.map +0 -1
  278. package/dist/cache/__tests__/document-cache.test.js +0 -345
  279. package/dist/cache/__tests__/document-cache.test.js.map +0 -1
  280. package/dist/cache/__tests__/memory-segment-store.test.d.ts +0 -2
  281. package/dist/cache/__tests__/memory-segment-store.test.d.ts.map +0 -1
  282. package/dist/cache/__tests__/memory-segment-store.test.js +0 -425
  283. package/dist/cache/__tests__/memory-segment-store.test.js.map +0 -1
  284. package/dist/cache/__tests__/memory-store.test.d.ts +0 -2
  285. package/dist/cache/__tests__/memory-store.test.d.ts.map +0 -1
  286. package/dist/cache/__tests__/memory-store.test.js +0 -367
  287. package/dist/cache/__tests__/memory-store.test.js.map +0 -1
  288. package/dist/cache/cache-scope.d.ts +0 -102
  289. package/dist/cache/cache-scope.d.ts.map +0 -1
  290. package/dist/cache/cache-scope.js +0 -440
  291. package/dist/cache/cache-scope.js.map +0 -1
  292. package/dist/cache/cf/__tests__/cf-cache-store.test.d.ts +0 -2
  293. package/dist/cache/cf/__tests__/cf-cache-store.test.d.ts.map +0 -1
  294. package/dist/cache/cf/__tests__/cf-cache-store.test.js +0 -330
  295. package/dist/cache/cf/__tests__/cf-cache-store.test.js.map +0 -1
  296. package/dist/cache/cf/cf-cache-store.d.ts +0 -165
  297. package/dist/cache/cf/cf-cache-store.d.ts.map +0 -1
  298. package/dist/cache/cf/cf-cache-store.js +0 -242
  299. package/dist/cache/cf/cf-cache-store.js.map +0 -1
  300. package/dist/cache/cf/index.d.ts +0 -14
  301. package/dist/cache/cf/index.d.ts.map +0 -1
  302. package/dist/cache/cf/index.js +0 -17
  303. package/dist/cache/cf/index.js.map +0 -1
  304. package/dist/cache/document-cache.d.ts +0 -64
  305. package/dist/cache/document-cache.d.ts.map +0 -1
  306. package/dist/cache/document-cache.js +0 -228
  307. package/dist/cache/document-cache.js.map +0 -1
  308. package/dist/cache/index.d.ts +0 -19
  309. package/dist/cache/index.d.ts.map +0 -1
  310. package/dist/cache/index.js +0 -21
  311. package/dist/cache/index.js.map +0 -1
  312. package/dist/cache/memory-segment-store.d.ts +0 -110
  313. package/dist/cache/memory-segment-store.d.ts.map +0 -1
  314. package/dist/cache/memory-segment-store.js +0 -117
  315. package/dist/cache/memory-segment-store.js.map +0 -1
  316. package/dist/cache/memory-store.d.ts +0 -41
  317. package/dist/cache/memory-store.d.ts.map +0 -1
  318. package/dist/cache/memory-store.js +0 -191
  319. package/dist/cache/memory-store.js.map +0 -1
  320. package/dist/cache/types.d.ts +0 -317
  321. package/dist/cache/types.d.ts.map +0 -1
  322. package/dist/cache/types.js +0 -12
  323. package/dist/cache/types.js.map +0 -1
  324. package/dist/client.d.ts +0 -248
  325. package/dist/client.d.ts.map +0 -1
  326. package/dist/client.js +0 -367
  327. package/dist/client.js.map +0 -1
  328. package/dist/client.rsc.d.ts +0 -26
  329. package/dist/client.rsc.d.ts.map +0 -1
  330. package/dist/client.rsc.js +0 -46
  331. package/dist/client.rsc.js.map +0 -1
  332. package/dist/component-utils.d.ts +0 -36
  333. package/dist/component-utils.d.ts.map +0 -1
  334. package/dist/component-utils.js +0 -61
  335. package/dist/component-utils.js.map +0 -1
  336. package/dist/components/DefaultDocument.d.ts +0 -13
  337. package/dist/components/DefaultDocument.d.ts.map +0 -1
  338. package/dist/components/DefaultDocument.js +0 -15
  339. package/dist/components/DefaultDocument.js.map +0 -1
  340. package/dist/debug.d.ts +0 -58
  341. package/dist/debug.d.ts.map +0 -1
  342. package/dist/debug.js +0 -157
  343. package/dist/debug.js.map +0 -1
  344. package/dist/default-error-boundary.d.ts +0 -11
  345. package/dist/default-error-boundary.d.ts.map +0 -1
  346. package/dist/default-error-boundary.js +0 -45
  347. package/dist/default-error-boundary.js.map +0 -1
  348. package/dist/deps/browser.d.ts +0 -2
  349. package/dist/deps/browser.d.ts.map +0 -1
  350. package/dist/deps/browser.js +0 -3
  351. package/dist/deps/browser.js.map +0 -1
  352. package/dist/deps/html-stream-client.d.ts +0 -2
  353. package/dist/deps/html-stream-client.d.ts.map +0 -1
  354. package/dist/deps/html-stream-client.js +0 -3
  355. package/dist/deps/html-stream-client.js.map +0 -1
  356. package/dist/deps/html-stream-server.d.ts +0 -2
  357. package/dist/deps/html-stream-server.d.ts.map +0 -1
  358. package/dist/deps/html-stream-server.js +0 -3
  359. package/dist/deps/html-stream-server.js.map +0 -1
  360. package/dist/deps/rsc.d.ts +0 -2
  361. package/dist/deps/rsc.d.ts.map +0 -1
  362. package/dist/deps/rsc.js +0 -4
  363. package/dist/deps/rsc.js.map +0 -1
  364. package/dist/deps/ssr.d.ts +0 -2
  365. package/dist/deps/ssr.d.ts.map +0 -1
  366. package/dist/deps/ssr.js +0 -3
  367. package/dist/deps/ssr.js.map +0 -1
  368. package/dist/errors.d.ts +0 -174
  369. package/dist/errors.d.ts.map +0 -1
  370. package/dist/errors.js +0 -241
  371. package/dist/errors.js.map +0 -1
  372. package/dist/handle.d.ts +0 -78
  373. package/dist/handle.d.ts.map +0 -1
  374. package/dist/handle.js +0 -82
  375. package/dist/handle.js.map +0 -1
  376. package/dist/handles/MetaTags.d.ts +0 -14
  377. package/dist/handles/MetaTags.d.ts.map +0 -1
  378. package/dist/handles/MetaTags.js +0 -136
  379. package/dist/handles/MetaTags.js.map +0 -1
  380. package/dist/handles/index.d.ts +0 -6
  381. package/dist/handles/index.d.ts.map +0 -1
  382. package/dist/handles/index.js +0 -6
  383. package/dist/handles/index.js.map +0 -1
  384. package/dist/handles/meta.d.ts +0 -39
  385. package/dist/handles/meta.d.ts.map +0 -1
  386. package/dist/handles/meta.js +0 -202
  387. package/dist/handles/meta.js.map +0 -1
  388. package/dist/host/__tests__/errors.test.d.ts +0 -2
  389. package/dist/host/__tests__/errors.test.d.ts.map +0 -1
  390. package/dist/host/__tests__/errors.test.js +0 -76
  391. package/dist/host/__tests__/errors.test.js.map +0 -1
  392. package/dist/host/__tests__/pattern-comprehensive.test.d.ts +0 -2
  393. package/dist/host/__tests__/pattern-comprehensive.test.d.ts.map +0 -1
  394. package/dist/host/__tests__/pattern-comprehensive.test.js +0 -732
  395. package/dist/host/__tests__/pattern-comprehensive.test.js.map +0 -1
  396. package/dist/host/__tests__/pattern-matcher.test.d.ts +0 -2
  397. package/dist/host/__tests__/pattern-matcher.test.d.ts.map +0 -1
  398. package/dist/host/__tests__/pattern-matcher.test.js +0 -251
  399. package/dist/host/__tests__/pattern-matcher.test.js.map +0 -1
  400. package/dist/host/__tests__/router.test.d.ts +0 -2
  401. package/dist/host/__tests__/router.test.d.ts.map +0 -1
  402. package/dist/host/__tests__/router.test.js +0 -241
  403. package/dist/host/__tests__/router.test.js.map +0 -1
  404. package/dist/host/__tests__/testing.test.d.ts +0 -2
  405. package/dist/host/__tests__/testing.test.d.ts.map +0 -1
  406. package/dist/host/__tests__/testing.test.js +0 -64
  407. package/dist/host/__tests__/testing.test.js.map +0 -1
  408. package/dist/host/__tests__/utils.test.d.ts +0 -2
  409. package/dist/host/__tests__/utils.test.d.ts.map +0 -1
  410. package/dist/host/__tests__/utils.test.js +0 -29
  411. package/dist/host/__tests__/utils.test.js.map +0 -1
  412. package/dist/host/cookie-handler.d.ts +0 -34
  413. package/dist/host/cookie-handler.d.ts.map +0 -1
  414. package/dist/host/cookie-handler.js +0 -124
  415. package/dist/host/cookie-handler.js.map +0 -1
  416. package/dist/host/errors.d.ts +0 -56
  417. package/dist/host/errors.d.ts.map +0 -1
  418. package/dist/host/errors.js +0 -79
  419. package/dist/host/errors.js.map +0 -1
  420. package/dist/host/index.d.ts +0 -29
  421. package/dist/host/index.d.ts.map +0 -1
  422. package/dist/host/index.js +0 -32
  423. package/dist/host/index.js.map +0 -1
  424. package/dist/host/pattern-matcher.d.ts +0 -36
  425. package/dist/host/pattern-matcher.d.ts.map +0 -1
  426. package/dist/host/pattern-matcher.js +0 -172
  427. package/dist/host/pattern-matcher.js.map +0 -1
  428. package/dist/host/router.d.ts +0 -26
  429. package/dist/host/router.d.ts.map +0 -1
  430. package/dist/host/router.js +0 -218
  431. package/dist/host/router.js.map +0 -1
  432. package/dist/host/testing.d.ts +0 -36
  433. package/dist/host/testing.d.ts.map +0 -1
  434. package/dist/host/testing.js +0 -55
  435. package/dist/host/testing.js.map +0 -1
  436. package/dist/host/types.d.ts +0 -115
  437. package/dist/host/types.d.ts.map +0 -1
  438. package/dist/host/types.js +0 -7
  439. package/dist/host/types.js.map +0 -1
  440. package/dist/host/utils.d.ts +0 -21
  441. package/dist/host/utils.d.ts.map +0 -1
  442. package/dist/host/utils.js +0 -23
  443. package/dist/host/utils.js.map +0 -1
  444. package/dist/href-client.d.ts +0 -131
  445. package/dist/href-client.d.ts.map +0 -1
  446. package/dist/href-client.js +0 -64
  447. package/dist/href-client.js.map +0 -1
  448. package/dist/href-context.d.ts +0 -29
  449. package/dist/href-context.d.ts.map +0 -1
  450. package/dist/href-context.js +0 -21
  451. package/dist/href-context.js.map +0 -1
  452. package/dist/index.d.ts +0 -73
  453. package/dist/index.d.ts.map +0 -1
  454. package/dist/index.js +0 -91
  455. package/dist/index.js.map +0 -1
  456. package/dist/index.rsc.d.ts +0 -32
  457. package/dist/index.rsc.d.ts.map +0 -1
  458. package/dist/index.rsc.js +0 -40
  459. package/dist/index.rsc.js.map +0 -1
  460. package/dist/internal-debug.d.ts +0 -2
  461. package/dist/internal-debug.d.ts.map +0 -1
  462. package/dist/internal-debug.js +0 -5
  463. package/dist/internal-debug.js.map +0 -1
  464. package/dist/loader.d.ts +0 -14
  465. package/dist/loader.d.ts.map +0 -1
  466. package/dist/loader.js +0 -20
  467. package/dist/loader.js.map +0 -1
  468. package/dist/loader.rsc.d.ts +0 -19
  469. package/dist/loader.rsc.d.ts.map +0 -1
  470. package/dist/loader.rsc.js +0 -99
  471. package/dist/loader.rsc.js.map +0 -1
  472. package/dist/network-error-thrower.d.ts +0 -17
  473. package/dist/network-error-thrower.d.ts.map +0 -1
  474. package/dist/network-error-thrower.js +0 -14
  475. package/dist/network-error-thrower.js.map +0 -1
  476. package/dist/outlet-context.d.ts +0 -13
  477. package/dist/outlet-context.d.ts.map +0 -1
  478. package/dist/outlet-context.js +0 -3
  479. package/dist/outlet-context.js.map +0 -1
  480. package/dist/prerender/__tests__/param-hash.test.d.ts +0 -2
  481. package/dist/prerender/__tests__/param-hash.test.d.ts.map +0 -1
  482. package/dist/prerender/__tests__/param-hash.test.js +0 -148
  483. package/dist/prerender/__tests__/param-hash.test.js.map +0 -1
  484. package/dist/prerender/param-hash.d.ts +0 -16
  485. package/dist/prerender/param-hash.d.ts.map +0 -1
  486. package/dist/prerender/param-hash.js +0 -36
  487. package/dist/prerender/param-hash.js.map +0 -1
  488. package/dist/prerender/store.d.ts +0 -38
  489. package/dist/prerender/store.d.ts.map +0 -1
  490. package/dist/prerender/store.js +0 -61
  491. package/dist/prerender/store.js.map +0 -1
  492. package/dist/prerender.d.ts +0 -66
  493. package/dist/prerender.d.ts.map +0 -1
  494. package/dist/prerender.js +0 -57
  495. package/dist/prerender.js.map +0 -1
  496. package/dist/reverse.d.ts +0 -196
  497. package/dist/reverse.d.ts.map +0 -1
  498. package/dist/reverse.js +0 -78
  499. package/dist/reverse.js.map +0 -1
  500. package/dist/root-error-boundary.d.ts +0 -33
  501. package/dist/root-error-boundary.d.ts.map +0 -1
  502. package/dist/root-error-boundary.js +0 -165
  503. package/dist/root-error-boundary.js.map +0 -1
  504. package/dist/route-content-wrapper.d.ts +0 -46
  505. package/dist/route-content-wrapper.d.ts.map +0 -1
  506. package/dist/route-content-wrapper.js +0 -77
  507. package/dist/route-content-wrapper.js.map +0 -1
  508. package/dist/route-definition.d.ts +0 -421
  509. package/dist/route-definition.d.ts.map +0 -1
  510. package/dist/route-definition.js +0 -868
  511. package/dist/route-definition.js.map +0 -1
  512. package/dist/route-map-builder.d.ts +0 -155
  513. package/dist/route-map-builder.d.ts.map +0 -1
  514. package/dist/route-map-builder.js +0 -237
  515. package/dist/route-map-builder.js.map +0 -1
  516. package/dist/route-types.d.ts +0 -165
  517. package/dist/route-types.d.ts.map +0 -1
  518. package/dist/route-types.js +0 -7
  519. package/dist/route-types.js.map +0 -1
  520. package/dist/router/__tests__/handler-context.test.d.ts +0 -2
  521. package/dist/router/__tests__/handler-context.test.d.ts.map +0 -1
  522. package/dist/router/__tests__/handler-context.test.js +0 -65
  523. package/dist/router/__tests__/handler-context.test.js.map +0 -1
  524. package/dist/router/__tests__/loader-cycle-detection.test.d.ts +0 -2
  525. package/dist/router/__tests__/loader-cycle-detection.test.d.ts.map +0 -1
  526. package/dist/router/__tests__/loader-cycle-detection.test.js +0 -221
  527. package/dist/router/__tests__/loader-cycle-detection.test.js.map +0 -1
  528. package/dist/router/__tests__/match-context.test.d.ts +0 -2
  529. package/dist/router/__tests__/match-context.test.d.ts.map +0 -1
  530. package/dist/router/__tests__/match-context.test.js +0 -92
  531. package/dist/router/__tests__/match-context.test.js.map +0 -1
  532. package/dist/router/__tests__/match-pipelines.test.d.ts +0 -2
  533. package/dist/router/__tests__/match-pipelines.test.d.ts.map +0 -1
  534. package/dist/router/__tests__/match-pipelines.test.js +0 -417
  535. package/dist/router/__tests__/match-pipelines.test.js.map +0 -1
  536. package/dist/router/__tests__/match-result.test.d.ts +0 -2
  537. package/dist/router/__tests__/match-result.test.d.ts.map +0 -1
  538. package/dist/router/__tests__/match-result.test.js +0 -457
  539. package/dist/router/__tests__/match-result.test.js.map +0 -1
  540. package/dist/router/__tests__/on-error.test.d.ts +0 -2
  541. package/dist/router/__tests__/on-error.test.d.ts.map +0 -1
  542. package/dist/router/__tests__/on-error.test.js +0 -678
  543. package/dist/router/__tests__/on-error.test.js.map +0 -1
  544. package/dist/router/__tests__/pattern-matching.test.d.ts +0 -2
  545. package/dist/router/__tests__/pattern-matching.test.d.ts.map +0 -1
  546. package/dist/router/__tests__/pattern-matching.test.js +0 -629
  547. package/dist/router/__tests__/pattern-matching.test.js.map +0 -1
  548. package/dist/router/__tests__/segment-resolution-parallel-loading.test.d.ts +0 -2
  549. package/dist/router/__tests__/segment-resolution-parallel-loading.test.d.ts.map +0 -1
  550. package/dist/router/__tests__/segment-resolution-parallel-loading.test.js +0 -155
  551. package/dist/router/__tests__/segment-resolution-parallel-loading.test.js.map +0 -1
  552. package/dist/router/error-handling.d.ts +0 -77
  553. package/dist/router/error-handling.d.ts.map +0 -1
  554. package/dist/router/error-handling.js +0 -202
  555. package/dist/router/error-handling.js.map +0 -1
  556. package/dist/router/handler-context.d.ts +0 -20
  557. package/dist/router/handler-context.d.ts.map +0 -1
  558. package/dist/router/handler-context.js +0 -198
  559. package/dist/router/handler-context.js.map +0 -1
  560. package/dist/router/intercept-resolution.d.ts +0 -66
  561. package/dist/router/intercept-resolution.d.ts.map +0 -1
  562. package/dist/router/intercept-resolution.js +0 -246
  563. package/dist/router/intercept-resolution.js.map +0 -1
  564. package/dist/router/loader-resolution.d.ts +0 -64
  565. package/dist/router/loader-resolution.d.ts.map +0 -1
  566. package/dist/router/loader-resolution.js +0 -284
  567. package/dist/router/loader-resolution.js.map +0 -1
  568. package/dist/router/logging.d.ts +0 -15
  569. package/dist/router/logging.d.ts.map +0 -1
  570. package/dist/router/logging.js +0 -99
  571. package/dist/router/logging.js.map +0 -1
  572. package/dist/router/manifest.d.ts +0 -22
  573. package/dist/router/manifest.d.ts.map +0 -1
  574. package/dist/router/manifest.js +0 -181
  575. package/dist/router/manifest.js.map +0 -1
  576. package/dist/router/match-api.d.ts +0 -35
  577. package/dist/router/match-api.d.ts.map +0 -1
  578. package/dist/router/match-api.js +0 -406
  579. package/dist/router/match-api.js.map +0 -1
  580. package/dist/router/match-context.d.ts +0 -206
  581. package/dist/router/match-context.d.ts.map +0 -1
  582. package/dist/router/match-context.js +0 -17
  583. package/dist/router/match-context.js.map +0 -1
  584. package/dist/router/match-middleware/background-revalidation.d.ts +0 -127
  585. package/dist/router/match-middleware/background-revalidation.d.ts.map +0 -1
  586. package/dist/router/match-middleware/background-revalidation.js +0 -75
  587. package/dist/router/match-middleware/background-revalidation.js.map +0 -1
  588. package/dist/router/match-middleware/cache-lookup.d.ts +0 -112
  589. package/dist/router/match-middleware/cache-lookup.d.ts.map +0 -1
  590. package/dist/router/match-middleware/cache-lookup.js +0 -257
  591. package/dist/router/match-middleware/cache-lookup.js.map +0 -1
  592. package/dist/router/match-middleware/cache-store.d.ts +0 -113
  593. package/dist/router/match-middleware/cache-store.d.ts.map +0 -1
  594. package/dist/router/match-middleware/cache-store.js +0 -108
  595. package/dist/router/match-middleware/cache-store.js.map +0 -1
  596. package/dist/router/match-middleware/index.d.ts +0 -81
  597. package/dist/router/match-middleware/index.d.ts.map +0 -1
  598. package/dist/router/match-middleware/index.js +0 -80
  599. package/dist/router/match-middleware/index.js.map +0 -1
  600. package/dist/router/match-middleware/intercept-resolution.d.ts +0 -117
  601. package/dist/router/match-middleware/intercept-resolution.d.ts.map +0 -1
  602. package/dist/router/match-middleware/intercept-resolution.js +0 -134
  603. package/dist/router/match-middleware/intercept-resolution.js.map +0 -1
  604. package/dist/router/match-middleware/segment-resolution.d.ts +0 -99
  605. package/dist/router/match-middleware/segment-resolution.d.ts.map +0 -1
  606. package/dist/router/match-middleware/segment-resolution.js +0 -53
  607. package/dist/router/match-middleware/segment-resolution.js.map +0 -1
  608. package/dist/router/match-pipelines.d.ts +0 -147
  609. package/dist/router/match-pipelines.d.ts.map +0 -1
  610. package/dist/router/match-pipelines.js +0 -82
  611. package/dist/router/match-pipelines.js.map +0 -1
  612. package/dist/router/match-result.d.ts +0 -126
  613. package/dist/router/match-result.d.ts.map +0 -1
  614. package/dist/router/match-result.js +0 -93
  615. package/dist/router/match-result.js.map +0 -1
  616. package/dist/router/metrics.d.ts +0 -20
  617. package/dist/router/metrics.d.ts.map +0 -1
  618. package/dist/router/metrics.js +0 -47
  619. package/dist/router/metrics.js.map +0 -1
  620. package/dist/router/middleware.d.ts +0 -249
  621. package/dist/router/middleware.d.ts.map +0 -1
  622. package/dist/router/middleware.js +0 -434
  623. package/dist/router/middleware.js.map +0 -1
  624. package/dist/router/middleware.test.d.ts +0 -2
  625. package/dist/router/middleware.test.d.ts.map +0 -1
  626. package/dist/router/middleware.test.js +0 -816
  627. package/dist/router/middleware.test.js.map +0 -1
  628. package/dist/router/pattern-matching.d.ts +0 -149
  629. package/dist/router/pattern-matching.d.ts.map +0 -1
  630. package/dist/router/pattern-matching.js +0 -349
  631. package/dist/router/pattern-matching.js.map +0 -1
  632. package/dist/router/revalidation.d.ts +0 -44
  633. package/dist/router/revalidation.d.ts.map +0 -1
  634. package/dist/router/revalidation.js +0 -147
  635. package/dist/router/revalidation.js.map +0 -1
  636. package/dist/router/router-context.d.ts +0 -135
  637. package/dist/router/router-context.d.ts.map +0 -1
  638. package/dist/router/router-context.js +0 -36
  639. package/dist/router/router-context.js.map +0 -1
  640. package/dist/router/segment-resolution.d.ts +0 -127
  641. package/dist/router/segment-resolution.d.ts.map +0 -1
  642. package/dist/router/segment-resolution.js +0 -919
  643. package/dist/router/segment-resolution.js.map +0 -1
  644. package/dist/router/trie-matching.d.ts +0 -40
  645. package/dist/router/trie-matching.d.ts.map +0 -1
  646. package/dist/router/trie-matching.js +0 -127
  647. package/dist/router/trie-matching.js.map +0 -1
  648. package/dist/router/types.d.ts +0 -136
  649. package/dist/router/types.d.ts.map +0 -1
  650. package/dist/router/types.js +0 -7
  651. package/dist/router/types.js.map +0 -1
  652. package/dist/router.d.ts +0 -753
  653. package/dist/router.d.ts.map +0 -1
  654. package/dist/router.gen.d.ts +0 -6
  655. package/dist/router.gen.d.ts.map +0 -1
  656. package/dist/router.gen.js +0 -6
  657. package/dist/router.gen.js.map +0 -1
  658. package/dist/router.js +0 -1304
  659. package/dist/router.js.map +0 -1
  660. package/dist/rsc/__tests__/helpers.test.d.ts +0 -2
  661. package/dist/rsc/__tests__/helpers.test.d.ts.map +0 -1
  662. package/dist/rsc/__tests__/helpers.test.js +0 -140
  663. package/dist/rsc/__tests__/helpers.test.js.map +0 -1
  664. package/dist/rsc/handler.d.ts +0 -45
  665. package/dist/rsc/handler.d.ts.map +0 -1
  666. package/dist/rsc/handler.js +0 -1172
  667. package/dist/rsc/handler.js.map +0 -1
  668. package/dist/rsc/helpers.d.ts +0 -16
  669. package/dist/rsc/helpers.d.ts.map +0 -1
  670. package/dist/rsc/helpers.js +0 -55
  671. package/dist/rsc/helpers.js.map +0 -1
  672. package/dist/rsc/index.d.ts +0 -22
  673. package/dist/rsc/index.d.ts.map +0 -1
  674. package/dist/rsc/index.js +0 -23
  675. package/dist/rsc/index.js.map +0 -1
  676. package/dist/rsc/nonce.d.ts +0 -9
  677. package/dist/rsc/nonce.d.ts.map +0 -1
  678. package/dist/rsc/nonce.js +0 -18
  679. package/dist/rsc/nonce.js.map +0 -1
  680. package/dist/rsc/types.d.ts +0 -206
  681. package/dist/rsc/types.d.ts.map +0 -1
  682. package/dist/rsc/types.js +0 -8
  683. package/dist/rsc/types.js.map +0 -1
  684. package/dist/search-params.d.ts +0 -103
  685. package/dist/search-params.d.ts.map +0 -1
  686. package/dist/search-params.js +0 -74
  687. package/dist/search-params.js.map +0 -1
  688. package/dist/segment-system.d.ts +0 -75
  689. package/dist/segment-system.d.ts.map +0 -1
  690. package/dist/segment-system.js +0 -336
  691. package/dist/segment-system.js.map +0 -1
  692. package/dist/server/context.d.ts +0 -245
  693. package/dist/server/context.d.ts.map +0 -1
  694. package/dist/server/context.js +0 -197
  695. package/dist/server/context.js.map +0 -1
  696. package/dist/server/fetchable-loader-store.d.ts +0 -18
  697. package/dist/server/fetchable-loader-store.d.ts.map +0 -1
  698. package/dist/server/fetchable-loader-store.js +0 -18
  699. package/dist/server/fetchable-loader-store.js.map +0 -1
  700. package/dist/server/handle-store.d.ts +0 -85
  701. package/dist/server/handle-store.d.ts.map +0 -1
  702. package/dist/server/handle-store.js +0 -142
  703. package/dist/server/handle-store.js.map +0 -1
  704. package/dist/server/loader-registry.d.ts +0 -55
  705. package/dist/server/loader-registry.d.ts.map +0 -1
  706. package/dist/server/loader-registry.js +0 -132
  707. package/dist/server/loader-registry.js.map +0 -1
  708. package/dist/server/request-context.d.ts +0 -226
  709. package/dist/server/request-context.d.ts.map +0 -1
  710. package/dist/server/request-context.js +0 -290
  711. package/dist/server/request-context.js.map +0 -1
  712. package/dist/server/root-layout.d.ts +0 -4
  713. package/dist/server/root-layout.d.ts.map +0 -1
  714. package/dist/server/root-layout.js +0 -5
  715. package/dist/server/root-layout.js.map +0 -1
  716. package/dist/server.d.ts +0 -15
  717. package/dist/server.d.ts.map +0 -1
  718. package/dist/server.js +0 -20
  719. package/dist/server.js.map +0 -1
  720. package/dist/ssr/__tests__/ssr-handler.test.d.ts +0 -2
  721. package/dist/ssr/__tests__/ssr-handler.test.d.ts.map +0 -1
  722. package/dist/ssr/__tests__/ssr-handler.test.js +0 -132
  723. package/dist/ssr/__tests__/ssr-handler.test.js.map +0 -1
  724. package/dist/ssr/index.d.ts +0 -98
  725. package/dist/ssr/index.d.ts.map +0 -1
  726. package/dist/ssr/index.js +0 -158
  727. package/dist/ssr/index.js.map +0 -1
  728. package/dist/static-handler.d.ts +0 -50
  729. package/dist/static-handler.d.ts.map +0 -1
  730. package/dist/static-handler.gen.d.ts +0 -5
  731. package/dist/static-handler.gen.d.ts.map +0 -1
  732. package/dist/static-handler.gen.js +0 -5
  733. package/dist/static-handler.gen.js.map +0 -1
  734. package/dist/static-handler.js +0 -29
  735. package/dist/static-handler.js.map +0 -1
  736. package/dist/testing/vitest.js +0 -82
  737. package/dist/theme/ThemeProvider.d.ts +0 -20
  738. package/dist/theme/ThemeProvider.d.ts.map +0 -1
  739. package/dist/theme/ThemeProvider.js +0 -240
  740. package/dist/theme/ThemeProvider.js.map +0 -1
  741. package/dist/theme/ThemeScript.d.ts +0 -48
  742. package/dist/theme/ThemeScript.d.ts.map +0 -1
  743. package/dist/theme/ThemeScript.js +0 -13
  744. package/dist/theme/ThemeScript.js.map +0 -1
  745. package/dist/theme/__tests__/theme.test.d.ts +0 -2
  746. package/dist/theme/__tests__/theme.test.d.ts.map +0 -1
  747. package/dist/theme/__tests__/theme.test.js +0 -103
  748. package/dist/theme/__tests__/theme.test.js.map +0 -1
  749. package/dist/theme/constants.d.ts +0 -29
  750. package/dist/theme/constants.d.ts.map +0 -1
  751. package/dist/theme/constants.js +0 -48
  752. package/dist/theme/constants.js.map +0 -1
  753. package/dist/theme/index.d.ts +0 -31
  754. package/dist/theme/index.d.ts.map +0 -1
  755. package/dist/theme/index.js +0 -36
  756. package/dist/theme/index.js.map +0 -1
  757. package/dist/theme/theme-context.d.ts +0 -40
  758. package/dist/theme/theme-context.d.ts.map +0 -1
  759. package/dist/theme/theme-context.js +0 -60
  760. package/dist/theme/theme-context.js.map +0 -1
  761. package/dist/theme/theme-script.d.ts +0 -27
  762. package/dist/theme/theme-script.d.ts.map +0 -1
  763. package/dist/theme/theme-script.js +0 -147
  764. package/dist/theme/theme-script.js.map +0 -1
  765. package/dist/theme/types.d.ts +0 -163
  766. package/dist/theme/types.d.ts.map +0 -1
  767. package/dist/theme/types.js +0 -11
  768. package/dist/theme/types.js.map +0 -1
  769. package/dist/theme/use-theme.d.ts +0 -12
  770. package/dist/theme/use-theme.d.ts.map +0 -1
  771. package/dist/theme/use-theme.js +0 -40
  772. package/dist/theme/use-theme.js.map +0 -1
  773. package/dist/types.d.ts +0 -1479
  774. package/dist/types.d.ts.map +0 -1
  775. package/dist/types.js +0 -10
  776. package/dist/types.js.map +0 -1
  777. package/dist/urls.d.ts +0 -441
  778. package/dist/urls.d.ts.map +0 -1
  779. package/dist/urls.gen.d.ts +0 -8
  780. package/dist/urls.gen.d.ts.map +0 -1
  781. package/dist/urls.gen.js +0 -8
  782. package/dist/urls.gen.js.map +0 -1
  783. package/dist/urls.js +0 -443
  784. package/dist/urls.js.map +0 -1
  785. package/dist/use-loader.d.ts +0 -127
  786. package/dist/use-loader.d.ts.map +0 -1
  787. package/dist/use-loader.js +0 -237
  788. package/dist/use-loader.js.map +0 -1
  789. package/dist/vite/__tests__/ast-handler-extract.test.d.ts +0 -2
  790. package/dist/vite/__tests__/ast-handler-extract.test.d.ts.map +0 -1
  791. package/dist/vite/__tests__/ast-handler-extract.test.js +0 -294
  792. package/dist/vite/__tests__/ast-handler-extract.test.js.map +0 -1
  793. package/dist/vite/__tests__/expose-id-utils.test.d.ts +0 -2
  794. package/dist/vite/__tests__/expose-id-utils.test.d.ts.map +0 -1
  795. package/dist/vite/__tests__/expose-id-utils.test.js +0 -224
  796. package/dist/vite/__tests__/expose-id-utils.test.js.map +0 -1
  797. package/dist/vite/__tests__/expose-internal-ids.test.d.ts +0 -2
  798. package/dist/vite/__tests__/expose-internal-ids.test.d.ts.map +0 -1
  799. package/dist/vite/__tests__/expose-internal-ids.test.js +0 -647
  800. package/dist/vite/__tests__/expose-internal-ids.test.js.map +0 -1
  801. package/dist/vite/__tests__/expose-router-id.test.d.ts +0 -2
  802. package/dist/vite/__tests__/expose-router-id.test.d.ts.map +0 -1
  803. package/dist/vite/__tests__/expose-router-id.test.js +0 -39
  804. package/dist/vite/__tests__/expose-router-id.test.js.map +0 -1
  805. package/dist/vite/ast-handler-extract.d.ts +0 -49
  806. package/dist/vite/ast-handler-extract.d.ts.map +0 -1
  807. package/dist/vite/ast-handler-extract.js +0 -249
  808. package/dist/vite/ast-handler-extract.js.map +0 -1
  809. package/dist/vite/expose-action-id.d.ts +0 -19
  810. package/dist/vite/expose-action-id.d.ts.map +0 -1
  811. package/dist/vite/expose-action-id.js +0 -250
  812. package/dist/vite/expose-action-id.js.map +0 -1
  813. package/dist/vite/expose-id-utils.d.ts +0 -69
  814. package/dist/vite/expose-id-utils.d.ts.map +0 -1
  815. package/dist/vite/expose-id-utils.js +0 -289
  816. package/dist/vite/expose-id-utils.js.map +0 -1
  817. package/dist/vite/expose-internal-ids.d.ts +0 -22
  818. package/dist/vite/expose-internal-ids.d.ts.map +0 -1
  819. package/dist/vite/expose-internal-ids.js +0 -886
  820. package/dist/vite/expose-internal-ids.js.map +0 -1
  821. package/dist/vite/index.d.ts +0 -149
  822. package/dist/vite/index.d.ts.map +0 -1
  823. package/dist/vite/index.js.bak +0 -5448
  824. package/dist/vite/index.js.map +0 -1
  825. package/dist/vite/index.named-routes.gen.ts +0 -103
  826. package/dist/vite/package-resolution.d.ts +0 -43
  827. package/dist/vite/package-resolution.d.ts.map +0 -1
  828. package/dist/vite/package-resolution.js +0 -112
  829. package/dist/vite/package-resolution.js.map +0 -1
  830. package/dist/vite/virtual-entries.d.ts +0 -25
  831. package/dist/vite/virtual-entries.d.ts.map +0 -1
  832. package/dist/vite/virtual-entries.js +0 -110
  833. package/dist/vite/virtual-entries.js.map +0 -1
@@ -2130,7 +2130,7 @@ import { resolve } from "node:path";
2130
2130
  // package.json
2131
2131
  var package_default = {
2132
2132
  name: "@rangojs/router",
2133
- version: "0.0.0-experimental.121",
2133
+ version: "0.0.0-experimental.122",
2134
2134
  description: "Django-inspired RSC router with composable URL patterns",
2135
2135
  keywords: [
2136
2136
  "react",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rangojs/router",
3
- "version": "0.0.0-experimental.121",
3
+ "version": "0.0.0-experimental.122",
4
4
  "description": "Django-inspired RSC router with composable URL patterns",
5
5
  "keywords": [
6
6
  "react",
@@ -7,8 +7,9 @@ argument-hint:
7
7
  # cache() vs "use cache" — When to Use Which
8
8
 
9
9
  Both mechanisms share the same backing store and cache profiles, and both accept
10
- an optional `tags` field (not yet honored by the built-in stores — see "Two axes"
11
- below). They differ in scope, cache key, execution model, and runtime control.
10
+ an optional `tags` field (honored by the built-in stores — invalidate with
11
+ `updateTag`/`revalidateTag`; see "Two axes" below). They differ in scope, cache
12
+ key, execution model, and runtime control.
12
13
 
13
14
  ## Two axes — do not conflate
14
15
 
@@ -18,10 +19,11 @@ caching:
18
19
 
19
20
  1. **Stored-value freshness** — _is a cached value still good?_
20
21
  → `"use cache"` (fn/component), `cache()` (segment), loader `cache()` (loader data).
21
- Entries expire by **TTL/SWR**. They accept an optional `tags` field, but the
22
- built-in stores (`MemorySegmentCacheStore`, `CFCacheStore`) do not yet index or
23
- invalidate by tag, so tag-based invalidation (`revalidateTag`) is a
24
- forward-looking API requiring a custom store with secondary indices.
22
+ Entries expire by **TTL/SWR** and can be tagged (`cache({ tags })` or runtime
23
+ `cacheTag(...tags)`). Built-in stores (`MemorySegmentCacheStore`, `CFCacheStore`)
24
+ index by tag; invalidate on demand with `updateTag(...tags)` (awaitable,
25
+ read-your-own-writes) or `revalidateTag(...tags)` (background, non-blocking).
26
+ Both hard-purge; the difference is awaitability, not stale-serving.
25
27
  2. **Client-update selection** — _should this segment re-run and stream to the
26
28
  client on this navigation/action?_
27
29
  → `revalidate()`. Covered in `/loader` and `/route`, **not here**.
@@ -81,6 +81,78 @@ cache(
81
81
  );
82
82
  ```
83
83
 
84
+ ## Tag-Based Invalidation
85
+
86
+ Tag cached entries, then invalidate them on demand. Tags can be attached three ways:
87
+
88
+ ```typescript
89
+ // 1. Static tags in the cache() DSL
90
+ cache({ ttl: 300, tags: ["products"] }, () => [path("/products", List)]);
91
+
92
+ // 2. Dynamic tags (function of ctx)
93
+ cache(
94
+ { ttl: 300, tags: (ctx) => [`product:${ctx.params.id}`, "products"] },
95
+ () => [path("/products/:id", Detail)],
96
+ );
97
+
98
+ // 3. Runtime tags inside a "use cache" function
99
+ async function getProduct(id: string) {
100
+ "use cache";
101
+ cacheTag(`product:${id}`, "products"); // variadic, additive
102
+ return db.getProduct(id);
103
+ }
104
+ ```
105
+
106
+ Invalidate with one of two server-only verbs (both variadic, imported from
107
+ `@rangojs/router`):
108
+
109
+ ```typescript
110
+ // Server Action — read-your-own-writes. Await it so the action's own re-render
111
+ // (and the next navigation) sees fresh data.
112
+ async function updateProduct(formData: FormData) {
113
+ "use server";
114
+ await db.updateProduct(formData);
115
+ await updateTag("products");
116
+ }
117
+
118
+ // Route handler / webhook — background, non-blocking (waitUntil). Hard-purge:
119
+ // the next read re-renders fresh (NOT stale-while-revalidate).
120
+ export async function POST() {
121
+ "use server";
122
+ revalidateTag("products");
123
+ return new Response("ok");
124
+ }
125
+ ```
126
+
127
+ | API | Timing | Use in | Semantics |
128
+ | ------------------------ | --------------------------- | ------------------------- | ----------------------------------------------------- |
129
+ | `updateTag(...tags)` | awaitable (`Promise<void>`) | server actions | immediate; next read is fresh |
130
+ | `revalidateTag(...tags)` | background (`void`) | route handlers / webhooks | background (non-blocking); next read re-renders fresh |
131
+
132
+ Both built-in stores support tags. For `CFCacheStore`, distributed (cross-colo)
133
+ invalidation requires a `kv` namespace — the tag-invalidation markers live in
134
+ that same namespace; there is **no** separate tag-invalidation store to wire.
135
+ If no tag-capable store is configured, `updateTag`/`revalidateTag` warn and no-op.
136
+
137
+ By default `CFCacheStore` reads the KV marker on every tagged cache read
138
+ (strongest invalidation latency). To cut KV reads on hot tagged routes, set
139
+ `tagCacheTtl` (seconds) to cache each marker in the per-colo edge cache for that
140
+ window — the colo running `updateTag`/`revalidateTag` writes the fresh marker
141
+ into its own edge cache immediately (read-your-own-writes), while other colos
142
+ converge within `tagCacheTtl` (the **maximum extra cross-colo invalidation
143
+ latency** when no purge is wired). Keep it small (e.g. 30–60), or wire a purge
144
+ (below) and set it large. (Contrast `tagInvalidationTtl`, which must be _large_
145
+ — it bounds how long the KV marker itself lives and must exceed your max entry
146
+ TTL+SWR.)
147
+
148
+ To make other colos prompt without a short `tagCacheTtl`, pass `onRevalidateTag`:
149
+ each cached marker carries a namespaced Cloudflare `Cache-Tag`, and the hook is
150
+ handed exactly those tags (batched, once per `updateTag`/`revalidateTag` call) to
151
+ feed Cloudflare's purge-by-tag API — evicting the cached lookups everywhere.
152
+ Purge-by-tag is available on all plans (since April 2025), subject to per-plan
153
+ rate limits, so the batched single call matters. With a purge wired, `tagCacheTtl`
154
+ becomes a pure read-cost reducer + fallback window.
155
+
84
156
  ## Named Profile Shorthand
85
157
 
86
158
  Use a named cache profile string instead of an options object. The profile must be
@@ -212,6 +284,80 @@ const router = createRouter<AppBindings>({
212
284
  KV entries require `expirationTtl >= 60s`. Short-lived entries (< 60s total TTL)
213
285
  are only cached in L1.
214
286
 
287
+ ### Resilience & latency budgets
288
+
289
+ Every cache read is **fail-safe**: a degraded tier never stalls or fails the
290
+ request — it degrades to the next tier (L1 → L2 → render). Three optional latency
291
+ budgets (milliseconds) bound each tier so a slow colo or KV namespace cannot pin
292
+ a request behind it:
293
+
294
+ | Option | Default | Bounds |
295
+ | --------------------- | ------- | ----------------------------------- |
296
+ | `edgeLookupTimeoutMs` | `10` | L1 `cache.match` (the lookup) |
297
+ | `edgeReadTimeoutMs` | `20` | L1 body read (CF streams it lazily) |
298
+ | `kvReadTimeoutMs` | `170` | L2 / KV read |
299
+
300
+ Set any to `0` (or a negative value) to disable that budget and always await the
301
+ read. A non-finite value (e.g. `Number(env.UNSET)`) falls back to the default.
302
+ The tag-invalidation marker reads inherit these same budgets and **fail open** on
303
+ a KV timeout — the entry is served rather than wrongly treated as invalidated.
304
+
305
+ ```typescript
306
+ new CFCacheStore({
307
+ ctx,
308
+ kv: env.CACHE_KV,
309
+ defaults: { ttl: 60, swr: 300 },
310
+ // Raise a budget only if your HEALTHY reads legitimately run slower (large
311
+ // Flight payloads, far-from-colo regions); measure the p99 first. These are
312
+ // degradation guard-rails, not tuning levers for "slow is normal here".
313
+ kvReadTimeoutMs: 250,
314
+ });
315
+ ```
316
+
317
+ Failure handling, by kind — none of these fail the request:
318
+
319
+ | Failure | Behavior |
320
+ | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
321
+ | Transient read error (5xx/blip) | Degrade to the next tier; entry left intact |
322
+ | Read budget exceeded (timeout) | Abandon the read, degrade to the next tier |
323
+ | Corrupt / unparseable L1 entry | Reported corrupt; degrade to L2 (served if present). The L1 entry is evicted ONLY when L2 has no copy — so the evict can't race the L2→L1 promote |
324
+ | Corrupt / unparseable KV entry | Reported corrupt; evicted (self-heal) + render (no tier below it) |
325
+ | Write failure | No-op (entry simply not cached); never throws |
326
+
327
+ Each is surfaced to the router's `onError` callback (phase `"cache"`, with
328
+ `metadata.category` one of `cache-read`, `cache-corrupt`, `cache-write`,
329
+ `cache-delete`, `cache-invalidate`, `stale-revalidation`) so you can observe
330
+ cache health without affecting users.
331
+
332
+ ### Validating cache behavior with `debug`
333
+
334
+ Pass `debug` to emit one structured event per L1 read — use it to confirm on a
335
+ real deployment (via `wrangler tail`) that the store behaves as expected before
336
+ relying on it. It is intended for validation, not steady-state production.
337
+
338
+ ```typescript
339
+ new CFCacheStore({
340
+ ctx,
341
+ kv: env.CACHE_KV,
342
+ debug: true, // logs each CFCacheReadDebugEvent to the console
343
+ // ...or capture programmatically:
344
+ // debug: (event) => myTelemetry.record(event),
345
+ });
346
+ ```
347
+
348
+ Each event reports which tier answered and why (`outcome`: `l1-fresh`,
349
+ `l1-stale-revalidate`, `l1-revalidating-guarded`, `match-timeout`, `match-error`,
350
+ `body-timeout`, `body-error`, `non-200`, `tag-invalidated`, `l1-miss`, `kv-fresh`,
351
+ `kv-stale`, `kv-stale-suppressed`, `kv-miss`, `kv-timeout`, `error`), the
352
+ staleness / revalidating timestamps, and the measured per-tier durations:
353
+ `matchMs` (the L1 `match`), `markerMs` (the tag-marker resolution tail for a
354
+ tagged entry, between `matchMs` and `bodyReadMs`; absent or 0 for an untagged
355
+ entry or a per-request memo hit), and `bodyReadMs` (the L1 body read). A
356
+ persistently large `markerMs` signals a degraded KV namespace; on a healthy
357
+ deployment KV keeps markers hot in its per-colo edge cache, so it stays a few
358
+ milliseconds. `match-error` (a transient `cache.match` rejection that falls
359
+ through to L2) is kept distinct from a plain `l1-miss`.
360
+
215
361
  ## Cache purity & tainted objects
216
362
 
217
363
  A `cache()` boundary caches everything except loaders, so anything read inside a
@@ -288,16 +288,33 @@ export const Product = Passthrough(ProductDef, async (ctx) => {
288
288
  Use `Passthrough()` whenever the Next.js route has `dynamicParams: true` (the
289
289
  default) or serves an open-ended param space. See `/prerender` for full API.
290
290
 
291
- ### Revalidation: different model
291
+ ### Revalidation: two distinct axes
292
292
 
293
- Next.js uses path/tag-based cache invalidation (`revalidatePath`, `revalidateTag`)
294
- to bust cached responses. Rango does not currently have a direct equivalent.
293
+ Next.js conflates two things under "revalidation." Rango separates them — and
294
+ tag-based cache invalidation now maps directly.
295
295
 
296
- In Rango, separate these two concepts:
296
+ **1. Cache invalidation (bust cached values) — direct equivalent.** Tag entries
297
+ with `cache({ tags })` or, inside a `"use cache"` function, runtime
298
+ `cacheTag(...tags)`. Then invalidate by tag:
297
299
 
298
- **Partial rendering revalidation** — `revalidate()` controls which segments
299
- (layouts, paths, loaders, parallels) should re-run during partial action
300
- re-rendering. This is about the segment tree, not cache invalidation:
300
+ ```typescript
301
+ // Next.js Rango
302
+ // revalidateTag("products") → await updateTag("products") // in a server action: awaitable,
303
+ // // read-your-own-writes (next render is fresh)
304
+ // or revalidateTag("products") // in a route handler / webhook:
305
+ // // background, non-blocking (hard-purge)
306
+ ```
307
+
308
+ `updateTag` is awaitable and immediate; `revalidateTag` is fire-and-forget. Both
309
+ hard-purge (the next read re-renders fresh); the only difference is awaitability —
310
+ despite the Next.js name, `revalidateTag` here is NOT stale-while-revalidate.
311
+ Built-in stores (`MemorySegmentCacheStore`, `CFCacheStore`) index by tag. Next's
312
+ `revalidatePath` has no path-based equivalent — tag the relevant entries instead.
313
+
314
+ **2. Partial-render selection (which segments re-run after an action).** This is
315
+ NOT cache invalidation — it is `revalidate()`, controlling which segments
316
+ (layouts, paths, loaders, parallels) recompute during partial action
317
+ re-rendering:
301
318
 
302
319
  ```typescript
303
320
  // Re-run this layout when a blog action fires
@@ -323,15 +340,18 @@ cache({ ttl: 60, swr: 300 }, () => [
323
340
  ]);
324
341
  ```
325
342
 
326
- The key shift is:
343
+ The two axes compose: `updateTag()` / `revalidateTag()` bust cached values;
344
+ `revalidate()` selects which segments re-render and stream to the client after an
345
+ action.
327
346
 
328
- - Next.js asks "which cached path or tag should I invalidate?"
329
- - Rango asks "which segments should re-run after this action?"
347
+ When migrating:
330
348
 
331
- When migrating `revalidatePath()` / `revalidateTag()` usage, the Rango version
332
- usually is not a 1:1 API replacement. Instead, decide which layouts, routes,
333
- loaders, or parallels should recompute after an action and declare
334
- `revalidate()` at those segment boundaries.
349
+ - `revalidateTag(tag)` `await updateTag(tag)` (in a server action) or
350
+ `revalidateTag(tag)` (in a route handler / webhook). Effectively 1:1.
351
+ - `revalidatePath(path)` no path-based equivalent; tag the entries on that
352
+ route (`cache({ tags })` / `cacheTag(...)`) and invalidate by tag.
353
+ - To also force specific segments to re-render after the action (independent of
354
+ cache busting), attach a `revalidate()` rule at those segment boundaries.
335
355
 
336
356
  ## 4. Middleware
337
357
 
@@ -463,7 +483,7 @@ Server actions work the same way — `"use server"` directive, `useActionState`,
463
483
 
464
484
  Key difference: in Rango, route middleware does NOT wrap action execution. Actions only see global middleware context. Use `getRequestContext()` in actions to access `ctx.set()`/`ctx.get()`.
465
485
 
466
- Next.js's `revalidatePath()` / `revalidateTag()` have no direct equivalent — Rango partially re-renders matched route segments (path/layout/parallel/intercept) and re-resolves their loaders, and you scope re-runs by attaching a `revalidate(({ actionId }) => ...)` rule to any segment or loader registration. See `/server-actions` for the full pattern (validation, error handling, file uploads) and `/loader` for revalidation rule semantics.
486
+ Next.js's `revalidateTag()` maps directly: tag entries via `cache({ tags })` / `cacheTag(...)`, then invalidate. **In a server action use `await updateTag(tag)`** — it is read-your-own-writes, so the action's own re-render sees fresh data; `revalidateTag(tag)` is a background (non-blocking) hard-purge and is NOT read-your-own-writes, so reserve it for route handlers / webhooks (calling it from an action can leave that action's re-render stale). `revalidatePath()` has no path-based equivalent — tag the route's entries instead. Separately, to force specific matched segments (path/layout/parallel/intercept) and their loaders to re-render after an action, attach a `revalidate(({ actionId }) => ...)` rule to that segment or loader registration. See `/server-actions` for the full pattern (validation, error handling, file uploads), `/caching` for tag invalidation, and `/loader` for revalidation rule semantics.
467
487
 
468
488
  ## 8. Metadata / Head
469
489
 
@@ -28,10 +28,10 @@ with the shape, then pick a primitive.
28
28
  cache hit streams UI instantly while loaders resolve fresh alongside). Opt into
29
29
  caching explicitly. See `/loader` → "Parallel and streaming".
30
30
  - **One identity, one store** — loaders, handles, cached fns, and actions are all
31
- `path#export`; all caches share one store. Entries expire by TTL/SWR; cache
32
- entries accept an optional `tags` field, but built-in stores do not yet index
33
- or invalidate by tag, so tag-based invalidation (`revalidateTag`) is a
34
- forward-looking API requiring a custom store.
31
+ `path#export`; all caches share one store. Entries expire by TTL/SWR, and are
32
+ tagged via `cache({ tags })` or runtime `cacheTag(...tags)`; built-in stores
33
+ index by tag and invalidate via `updateTag(...tags)` (awaitable, read-your-own-writes)
34
+ or `revalidateTag(...tags)` (background, non-blocking).
35
35
  - **Type-safe end to end** — route names, params, search schemas, loader return
36
36
  types, context vars, and `href` / `reverse` are checked at compile time
37
37
  (`/typesafety`).
@@ -85,10 +85,10 @@ To decide where something can live: **does it define a URL? structure, stays in
85
85
  (`set`/`header`/`setTheme`/`onResponse`/`setLocationState`) throw; `ctx.use(Handle)`
86
86
  is captured on miss and replayed on hit. (The non-cacheable read guard is a
87
87
  separate `cache()`-boundary check — see the correctness bullet below.)
88
- - One identity `path#export` (`functionId`/`$$id`/`actionId`); one store. The
89
- cross-cutting freshness mechanism today is TTL/SWR expiry; cache entries accept
90
- an optional `tags` field, but built-in stores do not yet index or invalidate by
91
- tag, so `revalidateTag` is forward-looking (requires a custom store).
88
+ - One identity `path#export` (`functionId`/`$$id`/`actionId`); one store. Freshness
89
+ is TTL/SWR expiry plus tag-based invalidation: tag via `cache({ tags })` /
90
+ `cacheTag(...tags)`, then `updateTag(...tags)` (awaitable) or `revalidateTag(...tags)`
91
+ (background). Built-in stores index by tag.
92
92
  - `useLoader` / `useHandle` / `useFetchLoader` are client-only.
93
93
  - Caches are correctness-first: persistent store keys are version-segmented (no
94
94
  cross-deploy drift), the forward/back cache is mutation-aware, and
@@ -111,13 +111,13 @@ To decide where something can live: **does it define a URL? structure, stays in
111
111
  Same words, different jobs — this is the most common source of the
112
112
  `revalidate()`-is-caching misread.
113
113
 
114
- | You may know | Maps to Rango axis | Watch out |
115
- | ------------------------------------------ | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
116
- | Next.js `export const revalidate = N` | **Axis 1** (cache) | Same word, opposite meaning. Next's `revalidate` is time-based cache expiry; Rango's `revalidate()` is **axis 2**. Use `cache({ ttl })` for the Next behavior. |
117
- | Next.js `revalidatePath` / `revalidateTag` | **Axis 1** (cache) | Cache busting. No shipped equivalent: entries accept `tags`, but built-in stores don't yet index/invalidate by tag, so `revalidateTag` is forward-looking (custom store); today entries expire by TTL/SWR. No `revalidatePath`. |
118
- | React Router / Remix `shouldRevalidate` | **Axis 2** | This is the correct mental model for Rango's `revalidate()`. |
119
- | HTTP `Cache-Control` / ISR | **Axis 1** | Edge/document layer — see `/document-cache`. Separate from both `cache()` and `revalidate()`. |
120
- | Remix/RR `loader` | live data | Like Rango loaders, fresh per request — but Rango loaders run in parallel and stream (latency overlaps first paint), and can opt into caching on demand. |
114
+ | You may know | Maps to Rango axis | Watch out |
115
+ | --------------------------------------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
116
+ | Next.js `export const revalidate = N` | **Axis 1** (cache) | Same word, opposite meaning. Next's `revalidate` is time-based cache expiry; Rango's `revalidate()` is **axis 2**. Use `cache({ ttl })` for the Next behavior. |
117
+ | Next.js `revalidateTag` / `updateTag` | **Axis 1** (cache) | Cache busting by tag. Tag via `cache({ tags })` / `cacheTag(...tags)`; invalidate with `updateTag(...tags)` (awaitable, read-your-own-writes) or `revalidateTag(...tags)` (background, non-blocking). Built-in stores index by tag. No `revalidatePath` (path-based busting); use tags. |
118
+ | React Router / Remix `shouldRevalidate` | **Axis 2** | This is the correct mental model for Rango's `revalidate()`. |
119
+ | HTTP `Cache-Control` / ISR | **Axis 1** | Edge/document layer — see `/document-cache`. Separate from both `cache()` and `revalidate()`. |
120
+ | Remix/RR `loader` | live data | Like Rango loaders, fresh per request — but Rango loaders run in parallel and stream (latency overlaps first paint), and can opt into caching on demand. |
121
121
 
122
122
  See `/cache-guide` for the axis-1 decision guide, `/loader` and `/route` for
123
123
  `revalidate()` (axis 2), and `/document-cache` for the edge layer.
@@ -328,13 +328,15 @@ export async function getProducts() {
328
328
  Writes to the same `SegmentCacheStore` as `cache()` DSL, `Static()`, and `Prerender()`.
329
329
  One store, one configuration.
330
330
 
331
- Cache entries (and `cacheProfiles`) accept an optional `tags` field, but the
332
- built-in stores (`MemorySegmentCacheStore`, `CFCacheStore`) do not yet index or
333
- invalidate by tag -- tags are passed through to the store and otherwise ignored.
334
- Tag-based invalidation (`revalidateTag`) is a forward-looking API that requires a
335
- custom store with secondary indices. Today entries expire by TTL/SWR. The separate
336
- `revalidate()` export is the client-update axis (which segments re-render on a
337
- navigation or action), not a cache bust.
331
+ Cache entries (and `cacheProfiles`) can be tagged via `cache({ tags })` or, inside
332
+ a `"use cache"` function, runtime `cacheTag(...tags)`. The built-in
333
+ `MemorySegmentCacheStore` and `CFCacheStore` index by tag. Invalidate on demand
334
+ with `updateTag(...tags)` (awaitable, read-your-own-writes; for server actions) or
335
+ `revalidateTag(...tags)` (background, non-blocking; for route handlers/webhooks).
336
+ Both hard-purge; the difference is awaitability, not stale-serving. For
337
+ `CFCacheStore`, distributed invalidation needs a `kv` namespace (markers live in
338
+ that same namespace). The separate `revalidate()` export is the client-update axis
339
+ (which segments re-render on a navigation or action), not a cache bust.
338
340
 
339
341
  ## Interaction with Other Caching
340
342
 
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Cache error reporting.
3
+ *
4
+ * Caches are best-effort: a read failure degrades to a miss (render fresh) and a
5
+ * write failure degrades to a no-op - they MUST NOT throw up and fail the
6
+ * request. But the failure must still be LOUD: it is logged to the console (so
7
+ * it is visible even in a background waitUntil task or when no hook is wired)
8
+ * AND routed through the router's onError callback (via the request context's
9
+ * deduped _reportBackgroundError) so consumers can observe cache degradation in
10
+ * their own telemetry.
11
+ *
12
+ * The one deliberate exception is the invalidation WRITE verb (updateTag ->
13
+ * store.invalidateTags): a failed durable marker write is rejected so an awaited
14
+ * updateTag() surfaces it (read-your-own-writes honesty). That is not a data
15
+ * read/write and does not go through this helper's swallow-and-degrade path.
16
+ */
17
+
18
+ import { _getRequestContext } from "../server/request-context.js";
19
+
20
+ /**
21
+ * Minimal shape of a request context for error reporting. Passed explicitly by
22
+ * background tasks (waitUntil) where the ALS context is already gone, so the
23
+ * error can still reach the router's onError. Structural to avoid importing the
24
+ * full RequestContext type (request-context.ts imports CacheErrorCategory from
25
+ * here - a mutual type-only reference).
26
+ */
27
+ export interface CacheErrorReporter {
28
+ _reportBackgroundError?: (
29
+ error: unknown,
30
+ category: CacheErrorCategory,
31
+ ) => void;
32
+ }
33
+
34
+ export type CacheErrorCategory =
35
+ /** A read failed (transient infra: KV/Cache API error). Degrade to a miss. */
36
+ | "cache-read"
37
+ /** A write failed. Degrade to a no-op (entry simply not cached). */
38
+ | "cache-write"
39
+ /** A delete/eviction failed. Best-effort. */
40
+ | "cache-delete"
41
+ /**
42
+ * A STORED entry could not be parsed/deserialized (partial KV read, truncated
43
+ * Cache API body, malformed envelope/RSC payload). The entry is faulty and is
44
+ * evicted so subsequent reads do not keep failing on it. Distinct from
45
+ * cache-read so consumers can tell corruption from a transient outage.
46
+ */
47
+ | "cache-corrupt"
48
+ /** A tag-invalidation side effect failed (e.g. the eager CDN purge hook). */
49
+ | "cache-invalidate"
50
+ /**
51
+ * A background stale-while-revalidate refresh failed (the `"use cache"`
52
+ * read-through path). The stale value was already served; the refresh that
53
+ * would have replaced it errored.
54
+ */
55
+ | "stale-revalidation";
56
+
57
+ /**
58
+ * Report a non-fatal cache error loudly without failing the request: always logs
59
+ * (label + error) and, when a request context is available, routes the error
60
+ * through the router's onError callback. Never throws.
61
+ *
62
+ * `ctx` is for callers running in a detached background task (waitUntil), where
63
+ * the ALS request context is already gone (so `_getRequestContext()` is null):
64
+ * they capture the context up front and pass it here so onError still fires.
65
+ * Foreground callers omit it and fall back to the ALS context.
66
+ */
67
+ export function reportCacheError(
68
+ error: unknown,
69
+ category: CacheErrorCategory,
70
+ label: string,
71
+ ctx?: CacheErrorReporter,
72
+ ): void {
73
+ console.error(`${label}:`, error);
74
+ try {
75
+ const target = ctx ?? _getRequestContext();
76
+ target?._reportBackgroundError?.(error, category);
77
+ } catch {
78
+ // Reporting must never itself break the cache path.
79
+ }
80
+ }
81
+
82
+ /**
83
+ * Run a best-effort async cache task (typically scheduled via waitUntil), catching
84
+ * any rejection and routing it through reportCacheError so background cache work
85
+ * (non-blocking L1 writes, KV persistence, L1 promotion) reports failures via
86
+ * onError instead of throwing or silently swallowing. Never rejects.
87
+ *
88
+ * Pass `ctx` when the task runs detached (the ALS context is gone) and the
89
+ * failure should still reach onError; omit it to fall back to the ALS context.
90
+ *
91
+ * @example this.waitUntil(() => reportingAsync(() => cache.put(req, res), "cache-write", "[CFCacheStore] L1 write"))
92
+ */
93
+ export async function reportingAsync(
94
+ task: () => Promise<unknown>,
95
+ category: CacheErrorCategory,
96
+ label: string,
97
+ ctx?: CacheErrorReporter,
98
+ ): Promise<void> {
99
+ try {
100
+ await task();
101
+ } catch (error) {
102
+ reportCacheError(error, category, label, ctx);
103
+ }
104
+ }
@@ -9,6 +9,7 @@
9
9
  import type { CacheDefaults, SegmentCacheStore } from "./types.js";
10
10
  import { _getRequestContext } from "../server/request-context.js";
11
11
  import type { RequestContext } from "../server/request-context.js";
12
+ import { normalizeTags } from "./cache-tag.js";
12
13
 
13
14
  /**
14
15
  * Default TTL for route-level cache() DSL and loader cache.
@@ -108,6 +109,64 @@ export async function resolveCacheKey(
108
109
  return defaultKey;
109
110
  }
110
111
 
112
+ // ============================================================================
113
+ // Cache Tag Resolution
114
+ // ============================================================================
115
+
116
+ /**
117
+ * Resolve cache tags from a tags option (static array or function of ctx).
118
+ *
119
+ * Fails open: a thrown tag callback falls back to no tags rather than
120
+ * aborting the request. Tags are additive metadata (not identity), so a
121
+ * missing tag does not cause cache collisions, only a missed invalidation.
122
+ *
123
+ * Shared by the cache() DSL (cache-scope) and loader caching (loader-cache)
124
+ * so tag resolution behaves identically across every cache axis.
125
+ */
126
+ export function resolveTagsOption<TEnv>(
127
+ tags: string[] | ((ctx: RequestContext<TEnv>) => string[]) | undefined,
128
+ ctx: RequestContext<TEnv> | undefined,
129
+ label: string,
130
+ ): string[] | undefined {
131
+ if (!tags) return undefined;
132
+ if (typeof tags === "function") {
133
+ if (!ctx) {
134
+ // A dynamic tags function needs the request context to run. Without it
135
+ // (e.g. resolved outside a request, at build/prerender time) the entry is
136
+ // cached UNTAGGED and can never be invalidated - surface that rather than
137
+ // silently dropping the tags, matching the thrown-callback branch below.
138
+ console.warn(
139
+ `[${label}] Dynamic tags function present but no request context; ` +
140
+ `caching without tags (this entry will not be tag-invalidatable).`,
141
+ );
142
+ return undefined;
143
+ }
144
+ try {
145
+ return normalizeTagList(tags(ctx));
146
+ } catch (error) {
147
+ console.error(
148
+ `[${label}] Tags function failed, caching without tags:`,
149
+ error,
150
+ );
151
+ return undefined;
152
+ }
153
+ }
154
+ return normalizeTagList(tags);
155
+ }
156
+
157
+ /**
158
+ * Normalize a resolved tags array so the WRITE path matches the invalidate path:
159
+ * updateTag()/revalidateTag()/cacheTag() all drop empty/whitespace-only tags via
160
+ * normalizeTag(). Without this, an empty tag attached at write time would enter
161
+ * the store index but could never be invalidated (the verbs normalize it away),
162
+ * and on CFCacheStore would also cost a wasted KV marker read per request.
163
+ * Returns undefined when nothing usable remains, keeping the entry header-free.
164
+ */
165
+ function normalizeTagList(tags: string[]): string[] | undefined {
166
+ const out = normalizeTags(tags);
167
+ return out.length > 0 ? out : undefined;
168
+ }
169
+
111
170
  // ============================================================================
112
171
  // Cache Store Resolution
113
172
  // ============================================================================
@@ -120,6 +179,41 @@ export async function resolveCacheKey(
120
179
  export function resolveCacheStore(
121
180
  explicitStore: SegmentCacheStore | undefined,
122
181
  ): SegmentCacheStore | null {
123
- if (explicitStore) return explicitStore;
182
+ if (explicitStore) {
183
+ // Register explicit per-scope stores so updateTag()/revalidateTag() can
184
+ // reach them. This is the single chokepoint every cache axis (segment,
185
+ // response, loader) resolves through, so registering here covers them all
186
+ // eagerly - no dependence on whether a tagged write has happened yet. The
187
+ // app-level store is intentionally not registered (always reachable via
188
+ // ctx._cacheStore).
189
+ registerExplicitTaggedStore(explicitStore);
190
+ return explicitStore;
191
+ }
124
192
  return _getRequestContext()?._cacheStore ?? null;
125
193
  }
194
+
195
+ /**
196
+ * Upper bound on the per-handler explicit-store registry. A module-singleton
197
+ * store (the recommended pattern) dedupes to a single entry and never approaches
198
+ * this. The cap bounds the niche case of an explicit store constructed PER
199
+ * request/boundary (e.g. a ctx-bound CFCacheStore, which must take a per-request
200
+ * ctx): without it the registry - which intentionally persists across requests so
201
+ * a server action's updateTag() can reach stores a prior render registered -
202
+ * would accumulate one dead instance per request and fan invalidation out to
203
+ * finished execution contexts. LRU-touch on re-resolution keeps a live, re-used
204
+ * store from being evicted by that churn.
205
+ */
206
+ const EXPLICIT_STORE_REGISTRY_CAP = 64;
207
+
208
+ function registerExplicitTaggedStore(store: SegmentCacheStore): void {
209
+ const set = _getRequestContext()?._explicitTaggedStores;
210
+ if (!set) return;
211
+ // LRU touch: move an already-present store to the most-recent position (Set
212
+ // preserves insertion order) so a store re-resolved every request stays live.
213
+ set.delete(store);
214
+ set.add(store);
215
+ if (set.size > EXPLICIT_STORE_REGISTRY_CAP) {
216
+ const oldest = set.values().next().value;
217
+ if (oldest !== undefined) set.delete(oldest);
218
+ }
219
+ }