@rangojs/router 0.4.2 → 0.4.3

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 (837) hide show
  1. package/dist/types/browser/prefetch/cache.d.ts +11 -8
  2. package/dist/types/cache/read-through-swr.d.ts +7 -6
  3. package/dist/types/cloudflare/tracing.d.ts +16 -12
  4. package/dist/types/router/instrument.d.ts +45 -15
  5. package/dist/types/router/telemetry-otel.d.ts +4 -4
  6. package/dist/types/router/timeout.d.ts +12 -1
  7. package/dist/types/router/tracing.d.ts +31 -17
  8. package/dist/types/rsc/capture-queue.d.ts +22 -1
  9. package/dist/types/rsc/shell-capture.d.ts +7 -1
  10. package/dist/types/rsc/stream-idle.d.ts +60 -0
  11. package/dist/types/server/request-context.d.ts +7 -1
  12. package/dist/types/vercel/tracing.d.ts +9 -8
  13. package/dist/vite/index.js +1 -1
  14. package/package.json +1 -1
  15. package/skills/observability/SKILL.md +33 -4
  16. package/src/browser/prefetch/cache.ts +22 -10
  17. package/src/cache/cache-runtime.ts +39 -25
  18. package/src/cache/document-cache.ts +39 -23
  19. package/src/cache/read-through-swr.ts +22 -16
  20. package/src/cloudflare/tracing.ts +16 -12
  21. package/src/router/instrument.ts +61 -15
  22. package/src/router/segment-resolution/loader-cache.ts +12 -1
  23. package/src/router/segment-resolution/revalidation.ts +16 -1
  24. package/src/router/telemetry-otel.ts +4 -4
  25. package/src/router/timeout.ts +12 -1
  26. package/src/router/tracing.ts +37 -17
  27. package/src/rsc/capture-queue.ts +72 -17
  28. package/src/rsc/handler.ts +171 -73
  29. package/src/rsc/shell-capture.ts +64 -12
  30. package/src/rsc/stream-idle.ts +137 -0
  31. package/src/server/request-context.ts +8 -0
  32. package/src/testing/dispatch.ts +55 -1
  33. package/src/vercel/tracing.ts +9 -8
  34. package/dist/__internal.d.ts +0 -83
  35. package/dist/__internal.d.ts.map +0 -1
  36. package/dist/__internal.js +0 -19
  37. package/dist/__internal.js.map +0 -1
  38. package/dist/__mocks__/version.d.ts +0 -7
  39. package/dist/__mocks__/version.d.ts.map +0 -1
  40. package/dist/__mocks__/version.js +0 -7
  41. package/dist/__mocks__/version.js.map +0 -1
  42. package/dist/__tests__/client-href.test.d.ts +0 -2
  43. package/dist/__tests__/client-href.test.d.ts.map +0 -1
  44. package/dist/__tests__/client-href.test.js +0 -74
  45. package/dist/__tests__/client-href.test.js.map +0 -1
  46. package/dist/__tests__/component-utils.test.d.ts +0 -2
  47. package/dist/__tests__/component-utils.test.d.ts.map +0 -1
  48. package/dist/__tests__/component-utils.test.js +0 -51
  49. package/dist/__tests__/component-utils.test.js.map +0 -1
  50. package/dist/__tests__/event-controller.test.d.ts +0 -2
  51. package/dist/__tests__/event-controller.test.d.ts.map +0 -1
  52. package/dist/__tests__/event-controller.test.js +0 -538
  53. package/dist/__tests__/event-controller.test.js.map +0 -1
  54. package/dist/__tests__/helpers/route-tree.d.ts +0 -118
  55. package/dist/__tests__/helpers/route-tree.d.ts.map +0 -1
  56. package/dist/__tests__/helpers/route-tree.js +0 -374
  57. package/dist/__tests__/helpers/route-tree.js.map +0 -1
  58. package/dist/__tests__/match-result.test.d.ts +0 -2
  59. package/dist/__tests__/match-result.test.d.ts.map +0 -1
  60. package/dist/__tests__/match-result.test.js +0 -154
  61. package/dist/__tests__/match-result.test.js.map +0 -1
  62. package/dist/__tests__/navigation-store.test.d.ts +0 -2
  63. package/dist/__tests__/navigation-store.test.d.ts.map +0 -1
  64. package/dist/__tests__/navigation-store.test.js +0 -440
  65. package/dist/__tests__/navigation-store.test.js.map +0 -1
  66. package/dist/__tests__/partial-update.test.d.ts +0 -2
  67. package/dist/__tests__/partial-update.test.d.ts.map +0 -1
  68. package/dist/__tests__/partial-update.test.js +0 -1009
  69. package/dist/__tests__/partial-update.test.js.map +0 -1
  70. package/dist/__tests__/reverse-types.test.d.ts +0 -8
  71. package/dist/__tests__/reverse-types.test.d.ts.map +0 -1
  72. package/dist/__tests__/reverse-types.test.js +0 -656
  73. package/dist/__tests__/reverse-types.test.js.map +0 -1
  74. package/dist/__tests__/route-definition.test.d.ts +0 -2
  75. package/dist/__tests__/route-definition.test.d.ts.map +0 -1
  76. package/dist/__tests__/route-definition.test.js +0 -55
  77. package/dist/__tests__/route-definition.test.js.map +0 -1
  78. package/dist/__tests__/router-helpers.test.d.ts +0 -2
  79. package/dist/__tests__/router-helpers.test.d.ts.map +0 -1
  80. package/dist/__tests__/router-helpers.test.js +0 -377
  81. package/dist/__tests__/router-helpers.test.js.map +0 -1
  82. package/dist/__tests__/router-integration-2.test.d.ts +0 -2
  83. package/dist/__tests__/router-integration-2.test.d.ts.map +0 -1
  84. package/dist/__tests__/router-integration-2.test.js +0 -426
  85. package/dist/__tests__/router-integration-2.test.js.map +0 -1
  86. package/dist/__tests__/router-integration.test.d.ts +0 -2
  87. package/dist/__tests__/router-integration.test.d.ts.map +0 -1
  88. package/dist/__tests__/router-integration.test.js +0 -1051
  89. package/dist/__tests__/router-integration.test.js.map +0 -1
  90. package/dist/__tests__/search-params.test.d.ts +0 -5
  91. package/dist/__tests__/search-params.test.d.ts.map +0 -1
  92. package/dist/__tests__/search-params.test.js +0 -306
  93. package/dist/__tests__/search-params.test.js.map +0 -1
  94. package/dist/__tests__/segment-system.test.d.ts +0 -2
  95. package/dist/__tests__/segment-system.test.d.ts.map +0 -1
  96. package/dist/__tests__/segment-system.test.js +0 -627
  97. package/dist/__tests__/segment-system.test.js.map +0 -1
  98. package/dist/__tests__/static-handler-types.test.d.ts +0 -8
  99. package/dist/__tests__/static-handler-types.test.d.ts.map +0 -1
  100. package/dist/__tests__/static-handler-types.test.js +0 -63
  101. package/dist/__tests__/static-handler-types.test.js.map +0 -1
  102. package/dist/__tests__/urls.test.d.ts +0 -2
  103. package/dist/__tests__/urls.test.d.ts.map +0 -1
  104. package/dist/__tests__/urls.test.js +0 -421
  105. package/dist/__tests__/urls.test.js.map +0 -1
  106. package/dist/__tests__/use-mount.test.d.ts +0 -2
  107. package/dist/__tests__/use-mount.test.d.ts.map +0 -1
  108. package/dist/__tests__/use-mount.test.js +0 -35
  109. package/dist/__tests__/use-mount.test.js.map +0 -1
  110. package/dist/bin/rango.d.ts +0 -2
  111. package/dist/bin/rango.d.ts.map +0 -1
  112. package/dist/bin/rango.js.map +0 -1
  113. package/dist/browser/event-controller.d.ts +0 -191
  114. package/dist/browser/event-controller.d.ts.map +0 -1
  115. package/dist/browser/event-controller.js +0 -559
  116. package/dist/browser/event-controller.js.map +0 -1
  117. package/dist/browser/index.d.ts +0 -2
  118. package/dist/browser/index.d.ts.map +0 -1
  119. package/dist/browser/index.js +0 -14
  120. package/dist/browser/index.js.map +0 -1
  121. package/dist/browser/link-interceptor.d.ts +0 -38
  122. package/dist/browser/link-interceptor.d.ts.map +0 -1
  123. package/dist/browser/link-interceptor.js +0 -99
  124. package/dist/browser/link-interceptor.js.map +0 -1
  125. package/dist/browser/logging.d.ts +0 -10
  126. package/dist/browser/logging.d.ts.map +0 -1
  127. package/dist/browser/logging.js +0 -29
  128. package/dist/browser/logging.js.map +0 -1
  129. package/dist/browser/lru-cache.d.ts +0 -17
  130. package/dist/browser/lru-cache.d.ts.map +0 -1
  131. package/dist/browser/lru-cache.js +0 -50
  132. package/dist/browser/lru-cache.js.map +0 -1
  133. package/dist/browser/merge-segment-loaders.d.ts +0 -39
  134. package/dist/browser/merge-segment-loaders.d.ts.map +0 -1
  135. package/dist/browser/merge-segment-loaders.js +0 -102
  136. package/dist/browser/merge-segment-loaders.js.map +0 -1
  137. package/dist/browser/navigation-bridge.d.ts +0 -102
  138. package/dist/browser/navigation-bridge.d.ts.map +0 -1
  139. package/dist/browser/navigation-bridge.js +0 -708
  140. package/dist/browser/navigation-bridge.js.map +0 -1
  141. package/dist/browser/navigation-client.d.ts +0 -25
  142. package/dist/browser/navigation-client.d.ts.map +0 -1
  143. package/dist/browser/navigation-client.js +0 -157
  144. package/dist/browser/navigation-client.js.map +0 -1
  145. package/dist/browser/navigation-store.d.ts +0 -101
  146. package/dist/browser/navigation-store.d.ts.map +0 -1
  147. package/dist/browser/navigation-store.js +0 -625
  148. package/dist/browser/navigation-store.js.map +0 -1
  149. package/dist/browser/partial-update.d.ts +0 -75
  150. package/dist/browser/partial-update.d.ts.map +0 -1
  151. package/dist/browser/partial-update.js +0 -426
  152. package/dist/browser/partial-update.js.map +0 -1
  153. package/dist/browser/react/Link.d.ts +0 -86
  154. package/dist/browser/react/Link.d.ts.map +0 -1
  155. package/dist/browser/react/Link.js +0 -128
  156. package/dist/browser/react/Link.js.map +0 -1
  157. package/dist/browser/react/NavigationProvider.d.ts +0 -63
  158. package/dist/browser/react/NavigationProvider.d.ts.map +0 -1
  159. package/dist/browser/react/NavigationProvider.js +0 -216
  160. package/dist/browser/react/NavigationProvider.js.map +0 -1
  161. package/dist/browser/react/ScrollRestoration.d.ts +0 -75
  162. package/dist/browser/react/ScrollRestoration.d.ts.map +0 -1
  163. package/dist/browser/react/ScrollRestoration.js +0 -57
  164. package/dist/browser/react/ScrollRestoration.js.map +0 -1
  165. package/dist/browser/react/context.d.ts +0 -46
  166. package/dist/browser/react/context.d.ts.map +0 -1
  167. package/dist/browser/react/context.js +0 -10
  168. package/dist/browser/react/context.js.map +0 -1
  169. package/dist/browser/react/index.d.ts +0 -11
  170. package/dist/browser/react/index.d.ts.map +0 -1
  171. package/dist/browser/react/index.js +0 -22
  172. package/dist/browser/react/index.js.map +0 -1
  173. package/dist/browser/react/location-state-shared.d.ts +0 -63
  174. package/dist/browser/react/location-state-shared.d.ts.map +0 -1
  175. package/dist/browser/react/location-state-shared.js +0 -81
  176. package/dist/browser/react/location-state-shared.js.map +0 -1
  177. package/dist/browser/react/location-state.d.ts +0 -23
  178. package/dist/browser/react/location-state.d.ts.map +0 -1
  179. package/dist/browser/react/location-state.js +0 -29
  180. package/dist/browser/react/location-state.js.map +0 -1
  181. package/dist/browser/react/mount-context.d.ts +0 -24
  182. package/dist/browser/react/mount-context.d.ts.map +0 -1
  183. package/dist/browser/react/mount-context.js +0 -24
  184. package/dist/browser/react/mount-context.js.map +0 -1
  185. package/dist/browser/react/use-action.d.ts +0 -64
  186. package/dist/browser/react/use-action.d.ts.map +0 -1
  187. package/dist/browser/react/use-action.js +0 -134
  188. package/dist/browser/react/use-action.js.map +0 -1
  189. package/dist/browser/react/use-client-cache.d.ts +0 -41
  190. package/dist/browser/react/use-client-cache.d.ts.map +0 -1
  191. package/dist/browser/react/use-client-cache.js +0 -39
  192. package/dist/browser/react/use-client-cache.js.map +0 -1
  193. package/dist/browser/react/use-handle.d.ts +0 -31
  194. package/dist/browser/react/use-handle.d.ts.map +0 -1
  195. package/dist/browser/react/use-handle.js +0 -144
  196. package/dist/browser/react/use-handle.js.map +0 -1
  197. package/dist/browser/react/use-href.d.ts +0 -33
  198. package/dist/browser/react/use-href.d.ts.map +0 -1
  199. package/dist/browser/react/use-href.js +0 -39
  200. package/dist/browser/react/use-href.js.map +0 -1
  201. package/dist/browser/react/use-link-status.d.ts +0 -37
  202. package/dist/browser/react/use-link-status.d.ts.map +0 -1
  203. package/dist/browser/react/use-link-status.js +0 -99
  204. package/dist/browser/react/use-link-status.js.map +0 -1
  205. package/dist/browser/react/use-mount.d.ts +0 -25
  206. package/dist/browser/react/use-mount.d.ts.map +0 -1
  207. package/dist/browser/react/use-mount.js +0 -30
  208. package/dist/browser/react/use-mount.js.map +0 -1
  209. package/dist/browser/react/use-navigation.d.ts +0 -27
  210. package/dist/browser/react/use-navigation.d.ts.map +0 -1
  211. package/dist/browser/react/use-navigation.js +0 -87
  212. package/dist/browser/react/use-navigation.js.map +0 -1
  213. package/dist/browser/react/use-segments.d.ts +0 -38
  214. package/dist/browser/react/use-segments.d.ts.map +0 -1
  215. package/dist/browser/react/use-segments.js +0 -130
  216. package/dist/browser/react/use-segments.js.map +0 -1
  217. package/dist/browser/request-controller.d.ts +0 -26
  218. package/dist/browser/request-controller.d.ts.map +0 -1
  219. package/dist/browser/request-controller.js +0 -147
  220. package/dist/browser/request-controller.js.map +0 -1
  221. package/dist/browser/rsc-router.d.ts +0 -129
  222. package/dist/browser/rsc-router.d.ts.map +0 -1
  223. package/dist/browser/rsc-router.js +0 -195
  224. package/dist/browser/rsc-router.js.map +0 -1
  225. package/dist/browser/scroll-restoration.d.ts +0 -93
  226. package/dist/browser/scroll-restoration.d.ts.map +0 -1
  227. package/dist/browser/scroll-restoration.js +0 -321
  228. package/dist/browser/scroll-restoration.js.map +0 -1
  229. package/dist/browser/segment-structure-assert.d.ts +0 -17
  230. package/dist/browser/segment-structure-assert.d.ts.map +0 -1
  231. package/dist/browser/segment-structure-assert.js +0 -59
  232. package/dist/browser/segment-structure-assert.js.map +0 -1
  233. package/dist/browser/server-action-bridge.d.ts +0 -26
  234. package/dist/browser/server-action-bridge.d.ts.map +0 -1
  235. package/dist/browser/server-action-bridge.js +0 -668
  236. package/dist/browser/server-action-bridge.js.map +0 -1
  237. package/dist/browser/shallow.d.ts +0 -12
  238. package/dist/browser/shallow.d.ts.map +0 -1
  239. package/dist/browser/shallow.js +0 -34
  240. package/dist/browser/shallow.js.map +0 -1
  241. package/dist/browser/types.d.ts +0 -369
  242. package/dist/browser/types.d.ts.map +0 -1
  243. package/dist/browser/types.js +0 -2
  244. package/dist/browser/types.js.map +0 -1
  245. package/dist/build/__tests__/generate-cli.test.d.ts +0 -2
  246. package/dist/build/__tests__/generate-cli.test.d.ts.map +0 -1
  247. package/dist/build/__tests__/generate-cli.test.js +0 -237
  248. package/dist/build/__tests__/generate-cli.test.js.map +0 -1
  249. package/dist/build/__tests__/generate-manifest.test.d.ts +0 -2
  250. package/dist/build/__tests__/generate-manifest.test.d.ts.map +0 -1
  251. package/dist/build/__tests__/generate-manifest.test.js +0 -119
  252. package/dist/build/__tests__/generate-manifest.test.js.map +0 -1
  253. package/dist/build/__tests__/generate-route-types.test.d.ts +0 -2
  254. package/dist/build/__tests__/generate-route-types.test.d.ts.map +0 -1
  255. package/dist/build/__tests__/generate-route-types.test.js +0 -620
  256. package/dist/build/__tests__/generate-route-types.test.js.map +0 -1
  257. package/dist/build/__tests__/per-router-manifest.test.d.ts +0 -2
  258. package/dist/build/__tests__/per-router-manifest.test.d.ts.map +0 -1
  259. package/dist/build/__tests__/per-router-manifest.test.js +0 -308
  260. package/dist/build/__tests__/per-router-manifest.test.js.map +0 -1
  261. package/dist/build/generate-manifest.d.ts +0 -81
  262. package/dist/build/generate-manifest.d.ts.map +0 -1
  263. package/dist/build/generate-manifest.js +0 -276
  264. package/dist/build/generate-manifest.js.map +0 -1
  265. package/dist/build/generate-route-types.d.ts +0 -115
  266. package/dist/build/generate-route-types.d.ts.map +0 -1
  267. package/dist/build/generate-route-types.js +0 -740
  268. package/dist/build/generate-route-types.js.map +0 -1
  269. package/dist/build/index.d.ts +0 -21
  270. package/dist/build/index.d.ts.map +0 -1
  271. package/dist/build/index.js +0 -21
  272. package/dist/build/index.js.map +0 -1
  273. package/dist/build/route-trie.d.ts +0 -71
  274. package/dist/build/route-trie.d.ts.map +0 -1
  275. package/dist/build/route-trie.js +0 -175
  276. package/dist/build/route-trie.js.map +0 -1
  277. package/dist/cache/__tests__/cache-scope.test.d.ts +0 -2
  278. package/dist/cache/__tests__/cache-scope.test.d.ts.map +0 -1
  279. package/dist/cache/__tests__/cache-scope.test.js +0 -208
  280. package/dist/cache/__tests__/cache-scope.test.js.map +0 -1
  281. package/dist/cache/__tests__/document-cache.test.d.ts +0 -2
  282. package/dist/cache/__tests__/document-cache.test.d.ts.map +0 -1
  283. package/dist/cache/__tests__/document-cache.test.js +0 -345
  284. package/dist/cache/__tests__/document-cache.test.js.map +0 -1
  285. package/dist/cache/__tests__/memory-segment-store.test.d.ts +0 -2
  286. package/dist/cache/__tests__/memory-segment-store.test.d.ts.map +0 -1
  287. package/dist/cache/__tests__/memory-segment-store.test.js +0 -425
  288. package/dist/cache/__tests__/memory-segment-store.test.js.map +0 -1
  289. package/dist/cache/__tests__/memory-store.test.d.ts +0 -2
  290. package/dist/cache/__tests__/memory-store.test.d.ts.map +0 -1
  291. package/dist/cache/__tests__/memory-store.test.js +0 -367
  292. package/dist/cache/__tests__/memory-store.test.js.map +0 -1
  293. package/dist/cache/cache-scope.d.ts +0 -102
  294. package/dist/cache/cache-scope.d.ts.map +0 -1
  295. package/dist/cache/cache-scope.js +0 -440
  296. package/dist/cache/cache-scope.js.map +0 -1
  297. package/dist/cache/cf/__tests__/cf-cache-store.test.d.ts +0 -2
  298. package/dist/cache/cf/__tests__/cf-cache-store.test.d.ts.map +0 -1
  299. package/dist/cache/cf/__tests__/cf-cache-store.test.js +0 -330
  300. package/dist/cache/cf/__tests__/cf-cache-store.test.js.map +0 -1
  301. package/dist/cache/cf/cf-cache-store.d.ts +0 -165
  302. package/dist/cache/cf/cf-cache-store.d.ts.map +0 -1
  303. package/dist/cache/cf/cf-cache-store.js +0 -242
  304. package/dist/cache/cf/cf-cache-store.js.map +0 -1
  305. package/dist/cache/cf/index.d.ts +0 -14
  306. package/dist/cache/cf/index.d.ts.map +0 -1
  307. package/dist/cache/cf/index.js +0 -17
  308. package/dist/cache/cf/index.js.map +0 -1
  309. package/dist/cache/document-cache.d.ts +0 -64
  310. package/dist/cache/document-cache.d.ts.map +0 -1
  311. package/dist/cache/document-cache.js +0 -228
  312. package/dist/cache/document-cache.js.map +0 -1
  313. package/dist/cache/index.d.ts +0 -19
  314. package/dist/cache/index.d.ts.map +0 -1
  315. package/dist/cache/index.js +0 -21
  316. package/dist/cache/index.js.map +0 -1
  317. package/dist/cache/memory-segment-store.d.ts +0 -110
  318. package/dist/cache/memory-segment-store.d.ts.map +0 -1
  319. package/dist/cache/memory-segment-store.js +0 -117
  320. package/dist/cache/memory-segment-store.js.map +0 -1
  321. package/dist/cache/memory-store.d.ts +0 -41
  322. package/dist/cache/memory-store.d.ts.map +0 -1
  323. package/dist/cache/memory-store.js +0 -191
  324. package/dist/cache/memory-store.js.map +0 -1
  325. package/dist/cache/types.d.ts +0 -317
  326. package/dist/cache/types.d.ts.map +0 -1
  327. package/dist/cache/types.js +0 -12
  328. package/dist/cache/types.js.map +0 -1
  329. package/dist/client.d.ts +0 -248
  330. package/dist/client.d.ts.map +0 -1
  331. package/dist/client.js +0 -367
  332. package/dist/client.js.map +0 -1
  333. package/dist/client.rsc.d.ts +0 -26
  334. package/dist/client.rsc.d.ts.map +0 -1
  335. package/dist/client.rsc.js +0 -46
  336. package/dist/client.rsc.js.map +0 -1
  337. package/dist/component-utils.d.ts +0 -36
  338. package/dist/component-utils.d.ts.map +0 -1
  339. package/dist/component-utils.js +0 -61
  340. package/dist/component-utils.js.map +0 -1
  341. package/dist/components/DefaultDocument.d.ts +0 -13
  342. package/dist/components/DefaultDocument.d.ts.map +0 -1
  343. package/dist/components/DefaultDocument.js +0 -15
  344. package/dist/components/DefaultDocument.js.map +0 -1
  345. package/dist/debug.d.ts +0 -58
  346. package/dist/debug.d.ts.map +0 -1
  347. package/dist/debug.js +0 -157
  348. package/dist/debug.js.map +0 -1
  349. package/dist/default-error-boundary.d.ts +0 -11
  350. package/dist/default-error-boundary.d.ts.map +0 -1
  351. package/dist/default-error-boundary.js +0 -45
  352. package/dist/default-error-boundary.js.map +0 -1
  353. package/dist/deps/browser.d.ts +0 -2
  354. package/dist/deps/browser.d.ts.map +0 -1
  355. package/dist/deps/browser.js +0 -3
  356. package/dist/deps/browser.js.map +0 -1
  357. package/dist/deps/html-stream-client.d.ts +0 -2
  358. package/dist/deps/html-stream-client.d.ts.map +0 -1
  359. package/dist/deps/html-stream-client.js +0 -3
  360. package/dist/deps/html-stream-client.js.map +0 -1
  361. package/dist/deps/html-stream-server.d.ts +0 -2
  362. package/dist/deps/html-stream-server.d.ts.map +0 -1
  363. package/dist/deps/html-stream-server.js +0 -3
  364. package/dist/deps/html-stream-server.js.map +0 -1
  365. package/dist/deps/rsc.d.ts +0 -2
  366. package/dist/deps/rsc.d.ts.map +0 -1
  367. package/dist/deps/rsc.js +0 -4
  368. package/dist/deps/rsc.js.map +0 -1
  369. package/dist/deps/ssr.d.ts +0 -2
  370. package/dist/deps/ssr.d.ts.map +0 -1
  371. package/dist/deps/ssr.js +0 -3
  372. package/dist/deps/ssr.js.map +0 -1
  373. package/dist/errors.d.ts +0 -174
  374. package/dist/errors.d.ts.map +0 -1
  375. package/dist/errors.js +0 -241
  376. package/dist/errors.js.map +0 -1
  377. package/dist/handle.d.ts +0 -78
  378. package/dist/handle.d.ts.map +0 -1
  379. package/dist/handle.js +0 -82
  380. package/dist/handle.js.map +0 -1
  381. package/dist/handles/MetaTags.d.ts +0 -14
  382. package/dist/handles/MetaTags.d.ts.map +0 -1
  383. package/dist/handles/MetaTags.js +0 -136
  384. package/dist/handles/MetaTags.js.map +0 -1
  385. package/dist/handles/index.d.ts +0 -6
  386. package/dist/handles/index.d.ts.map +0 -1
  387. package/dist/handles/index.js +0 -6
  388. package/dist/handles/index.js.map +0 -1
  389. package/dist/handles/meta.d.ts +0 -39
  390. package/dist/handles/meta.d.ts.map +0 -1
  391. package/dist/handles/meta.js +0 -202
  392. package/dist/handles/meta.js.map +0 -1
  393. package/dist/host/__tests__/errors.test.d.ts +0 -2
  394. package/dist/host/__tests__/errors.test.d.ts.map +0 -1
  395. package/dist/host/__tests__/errors.test.js +0 -76
  396. package/dist/host/__tests__/errors.test.js.map +0 -1
  397. package/dist/host/__tests__/pattern-comprehensive.test.d.ts +0 -2
  398. package/dist/host/__tests__/pattern-comprehensive.test.d.ts.map +0 -1
  399. package/dist/host/__tests__/pattern-comprehensive.test.js +0 -732
  400. package/dist/host/__tests__/pattern-comprehensive.test.js.map +0 -1
  401. package/dist/host/__tests__/pattern-matcher.test.d.ts +0 -2
  402. package/dist/host/__tests__/pattern-matcher.test.d.ts.map +0 -1
  403. package/dist/host/__tests__/pattern-matcher.test.js +0 -251
  404. package/dist/host/__tests__/pattern-matcher.test.js.map +0 -1
  405. package/dist/host/__tests__/router.test.d.ts +0 -2
  406. package/dist/host/__tests__/router.test.d.ts.map +0 -1
  407. package/dist/host/__tests__/router.test.js +0 -241
  408. package/dist/host/__tests__/router.test.js.map +0 -1
  409. package/dist/host/__tests__/testing.test.d.ts +0 -2
  410. package/dist/host/__tests__/testing.test.d.ts.map +0 -1
  411. package/dist/host/__tests__/testing.test.js +0 -64
  412. package/dist/host/__tests__/testing.test.js.map +0 -1
  413. package/dist/host/__tests__/utils.test.d.ts +0 -2
  414. package/dist/host/__tests__/utils.test.d.ts.map +0 -1
  415. package/dist/host/__tests__/utils.test.js +0 -29
  416. package/dist/host/__tests__/utils.test.js.map +0 -1
  417. package/dist/host/cookie-handler.d.ts +0 -34
  418. package/dist/host/cookie-handler.d.ts.map +0 -1
  419. package/dist/host/cookie-handler.js +0 -124
  420. package/dist/host/cookie-handler.js.map +0 -1
  421. package/dist/host/errors.d.ts +0 -56
  422. package/dist/host/errors.d.ts.map +0 -1
  423. package/dist/host/errors.js +0 -79
  424. package/dist/host/errors.js.map +0 -1
  425. package/dist/host/index.d.ts +0 -29
  426. package/dist/host/index.d.ts.map +0 -1
  427. package/dist/host/index.js +0 -32
  428. package/dist/host/index.js.map +0 -1
  429. package/dist/host/pattern-matcher.d.ts +0 -36
  430. package/dist/host/pattern-matcher.d.ts.map +0 -1
  431. package/dist/host/pattern-matcher.js +0 -172
  432. package/dist/host/pattern-matcher.js.map +0 -1
  433. package/dist/host/router.d.ts +0 -26
  434. package/dist/host/router.d.ts.map +0 -1
  435. package/dist/host/router.js +0 -218
  436. package/dist/host/router.js.map +0 -1
  437. package/dist/host/testing.d.ts +0 -36
  438. package/dist/host/testing.d.ts.map +0 -1
  439. package/dist/host/testing.js +0 -55
  440. package/dist/host/testing.js.map +0 -1
  441. package/dist/host/types.d.ts +0 -115
  442. package/dist/host/types.d.ts.map +0 -1
  443. package/dist/host/types.js +0 -7
  444. package/dist/host/types.js.map +0 -1
  445. package/dist/host/utils.d.ts +0 -21
  446. package/dist/host/utils.d.ts.map +0 -1
  447. package/dist/host/utils.js +0 -23
  448. package/dist/host/utils.js.map +0 -1
  449. package/dist/href-client.d.ts +0 -131
  450. package/dist/href-client.d.ts.map +0 -1
  451. package/dist/href-client.js +0 -64
  452. package/dist/href-client.js.map +0 -1
  453. package/dist/href-context.d.ts +0 -29
  454. package/dist/href-context.d.ts.map +0 -1
  455. package/dist/href-context.js +0 -21
  456. package/dist/href-context.js.map +0 -1
  457. package/dist/index.d.ts +0 -73
  458. package/dist/index.d.ts.map +0 -1
  459. package/dist/index.js +0 -91
  460. package/dist/index.js.map +0 -1
  461. package/dist/index.rsc.d.ts +0 -32
  462. package/dist/index.rsc.d.ts.map +0 -1
  463. package/dist/index.rsc.js +0 -40
  464. package/dist/index.rsc.js.map +0 -1
  465. package/dist/internal-debug.d.ts +0 -2
  466. package/dist/internal-debug.d.ts.map +0 -1
  467. package/dist/internal-debug.js +0 -5
  468. package/dist/internal-debug.js.map +0 -1
  469. package/dist/loader.d.ts +0 -14
  470. package/dist/loader.d.ts.map +0 -1
  471. package/dist/loader.js +0 -20
  472. package/dist/loader.js.map +0 -1
  473. package/dist/loader.rsc.d.ts +0 -19
  474. package/dist/loader.rsc.d.ts.map +0 -1
  475. package/dist/loader.rsc.js +0 -99
  476. package/dist/loader.rsc.js.map +0 -1
  477. package/dist/network-error-thrower.d.ts +0 -17
  478. package/dist/network-error-thrower.d.ts.map +0 -1
  479. package/dist/network-error-thrower.js +0 -14
  480. package/dist/network-error-thrower.js.map +0 -1
  481. package/dist/outlet-context.d.ts +0 -13
  482. package/dist/outlet-context.d.ts.map +0 -1
  483. package/dist/outlet-context.js +0 -3
  484. package/dist/outlet-context.js.map +0 -1
  485. package/dist/prerender/__tests__/param-hash.test.d.ts +0 -2
  486. package/dist/prerender/__tests__/param-hash.test.d.ts.map +0 -1
  487. package/dist/prerender/__tests__/param-hash.test.js +0 -148
  488. package/dist/prerender/__tests__/param-hash.test.js.map +0 -1
  489. package/dist/prerender/param-hash.d.ts +0 -16
  490. package/dist/prerender/param-hash.d.ts.map +0 -1
  491. package/dist/prerender/param-hash.js +0 -36
  492. package/dist/prerender/param-hash.js.map +0 -1
  493. package/dist/prerender/store.d.ts +0 -38
  494. package/dist/prerender/store.d.ts.map +0 -1
  495. package/dist/prerender/store.js +0 -61
  496. package/dist/prerender/store.js.map +0 -1
  497. package/dist/prerender.d.ts +0 -66
  498. package/dist/prerender.d.ts.map +0 -1
  499. package/dist/prerender.js +0 -57
  500. package/dist/prerender.js.map +0 -1
  501. package/dist/reverse.d.ts +0 -196
  502. package/dist/reverse.d.ts.map +0 -1
  503. package/dist/reverse.js +0 -78
  504. package/dist/reverse.js.map +0 -1
  505. package/dist/root-error-boundary.d.ts +0 -33
  506. package/dist/root-error-boundary.d.ts.map +0 -1
  507. package/dist/root-error-boundary.js +0 -165
  508. package/dist/root-error-boundary.js.map +0 -1
  509. package/dist/route-content-wrapper.d.ts +0 -46
  510. package/dist/route-content-wrapper.d.ts.map +0 -1
  511. package/dist/route-content-wrapper.js +0 -77
  512. package/dist/route-content-wrapper.js.map +0 -1
  513. package/dist/route-definition.d.ts +0 -421
  514. package/dist/route-definition.d.ts.map +0 -1
  515. package/dist/route-definition.js +0 -868
  516. package/dist/route-definition.js.map +0 -1
  517. package/dist/route-map-builder.d.ts +0 -155
  518. package/dist/route-map-builder.d.ts.map +0 -1
  519. package/dist/route-map-builder.js +0 -237
  520. package/dist/route-map-builder.js.map +0 -1
  521. package/dist/route-types.d.ts +0 -165
  522. package/dist/route-types.d.ts.map +0 -1
  523. package/dist/route-types.js +0 -7
  524. package/dist/route-types.js.map +0 -1
  525. package/dist/router/__tests__/handler-context.test.d.ts +0 -2
  526. package/dist/router/__tests__/handler-context.test.d.ts.map +0 -1
  527. package/dist/router/__tests__/handler-context.test.js +0 -65
  528. package/dist/router/__tests__/handler-context.test.js.map +0 -1
  529. package/dist/router/__tests__/loader-cycle-detection.test.d.ts +0 -2
  530. package/dist/router/__tests__/loader-cycle-detection.test.d.ts.map +0 -1
  531. package/dist/router/__tests__/loader-cycle-detection.test.js +0 -221
  532. package/dist/router/__tests__/loader-cycle-detection.test.js.map +0 -1
  533. package/dist/router/__tests__/match-context.test.d.ts +0 -2
  534. package/dist/router/__tests__/match-context.test.d.ts.map +0 -1
  535. package/dist/router/__tests__/match-context.test.js +0 -92
  536. package/dist/router/__tests__/match-context.test.js.map +0 -1
  537. package/dist/router/__tests__/match-pipelines.test.d.ts +0 -2
  538. package/dist/router/__tests__/match-pipelines.test.d.ts.map +0 -1
  539. package/dist/router/__tests__/match-pipelines.test.js +0 -417
  540. package/dist/router/__tests__/match-pipelines.test.js.map +0 -1
  541. package/dist/router/__tests__/match-result.test.d.ts +0 -2
  542. package/dist/router/__tests__/match-result.test.d.ts.map +0 -1
  543. package/dist/router/__tests__/match-result.test.js +0 -457
  544. package/dist/router/__tests__/match-result.test.js.map +0 -1
  545. package/dist/router/__tests__/on-error.test.d.ts +0 -2
  546. package/dist/router/__tests__/on-error.test.d.ts.map +0 -1
  547. package/dist/router/__tests__/on-error.test.js +0 -678
  548. package/dist/router/__tests__/on-error.test.js.map +0 -1
  549. package/dist/router/__tests__/pattern-matching.test.d.ts +0 -2
  550. package/dist/router/__tests__/pattern-matching.test.d.ts.map +0 -1
  551. package/dist/router/__tests__/pattern-matching.test.js +0 -629
  552. package/dist/router/__tests__/pattern-matching.test.js.map +0 -1
  553. package/dist/router/__tests__/segment-resolution-parallel-loading.test.d.ts +0 -2
  554. package/dist/router/__tests__/segment-resolution-parallel-loading.test.d.ts.map +0 -1
  555. package/dist/router/__tests__/segment-resolution-parallel-loading.test.js +0 -155
  556. package/dist/router/__tests__/segment-resolution-parallel-loading.test.js.map +0 -1
  557. package/dist/router/error-handling.d.ts +0 -77
  558. package/dist/router/error-handling.d.ts.map +0 -1
  559. package/dist/router/error-handling.js +0 -202
  560. package/dist/router/error-handling.js.map +0 -1
  561. package/dist/router/handler-context.d.ts +0 -20
  562. package/dist/router/handler-context.d.ts.map +0 -1
  563. package/dist/router/handler-context.js +0 -198
  564. package/dist/router/handler-context.js.map +0 -1
  565. package/dist/router/intercept-resolution.d.ts +0 -66
  566. package/dist/router/intercept-resolution.d.ts.map +0 -1
  567. package/dist/router/intercept-resolution.js +0 -246
  568. package/dist/router/intercept-resolution.js.map +0 -1
  569. package/dist/router/loader-resolution.d.ts +0 -64
  570. package/dist/router/loader-resolution.d.ts.map +0 -1
  571. package/dist/router/loader-resolution.js +0 -284
  572. package/dist/router/loader-resolution.js.map +0 -1
  573. package/dist/router/logging.d.ts +0 -15
  574. package/dist/router/logging.d.ts.map +0 -1
  575. package/dist/router/logging.js +0 -99
  576. package/dist/router/logging.js.map +0 -1
  577. package/dist/router/manifest.d.ts +0 -22
  578. package/dist/router/manifest.d.ts.map +0 -1
  579. package/dist/router/manifest.js +0 -181
  580. package/dist/router/manifest.js.map +0 -1
  581. package/dist/router/match-api.d.ts +0 -35
  582. package/dist/router/match-api.d.ts.map +0 -1
  583. package/dist/router/match-api.js +0 -406
  584. package/dist/router/match-api.js.map +0 -1
  585. package/dist/router/match-context.d.ts +0 -206
  586. package/dist/router/match-context.d.ts.map +0 -1
  587. package/dist/router/match-context.js +0 -17
  588. package/dist/router/match-context.js.map +0 -1
  589. package/dist/router/match-middleware/background-revalidation.d.ts +0 -127
  590. package/dist/router/match-middleware/background-revalidation.d.ts.map +0 -1
  591. package/dist/router/match-middleware/background-revalidation.js +0 -75
  592. package/dist/router/match-middleware/background-revalidation.js.map +0 -1
  593. package/dist/router/match-middleware/cache-lookup.d.ts +0 -112
  594. package/dist/router/match-middleware/cache-lookup.d.ts.map +0 -1
  595. package/dist/router/match-middleware/cache-lookup.js +0 -257
  596. package/dist/router/match-middleware/cache-lookup.js.map +0 -1
  597. package/dist/router/match-middleware/cache-store.d.ts +0 -113
  598. package/dist/router/match-middleware/cache-store.d.ts.map +0 -1
  599. package/dist/router/match-middleware/cache-store.js +0 -108
  600. package/dist/router/match-middleware/cache-store.js.map +0 -1
  601. package/dist/router/match-middleware/index.d.ts +0 -81
  602. package/dist/router/match-middleware/index.d.ts.map +0 -1
  603. package/dist/router/match-middleware/index.js +0 -80
  604. package/dist/router/match-middleware/index.js.map +0 -1
  605. package/dist/router/match-middleware/intercept-resolution.d.ts +0 -117
  606. package/dist/router/match-middleware/intercept-resolution.d.ts.map +0 -1
  607. package/dist/router/match-middleware/intercept-resolution.js +0 -134
  608. package/dist/router/match-middleware/intercept-resolution.js.map +0 -1
  609. package/dist/router/match-middleware/segment-resolution.d.ts +0 -99
  610. package/dist/router/match-middleware/segment-resolution.d.ts.map +0 -1
  611. package/dist/router/match-middleware/segment-resolution.js +0 -53
  612. package/dist/router/match-middleware/segment-resolution.js.map +0 -1
  613. package/dist/router/match-pipelines.d.ts +0 -147
  614. package/dist/router/match-pipelines.d.ts.map +0 -1
  615. package/dist/router/match-pipelines.js +0 -82
  616. package/dist/router/match-pipelines.js.map +0 -1
  617. package/dist/router/match-result.d.ts +0 -126
  618. package/dist/router/match-result.d.ts.map +0 -1
  619. package/dist/router/match-result.js +0 -93
  620. package/dist/router/match-result.js.map +0 -1
  621. package/dist/router/metrics.d.ts +0 -20
  622. package/dist/router/metrics.d.ts.map +0 -1
  623. package/dist/router/metrics.js +0 -47
  624. package/dist/router/metrics.js.map +0 -1
  625. package/dist/router/middleware.d.ts +0 -249
  626. package/dist/router/middleware.d.ts.map +0 -1
  627. package/dist/router/middleware.js +0 -434
  628. package/dist/router/middleware.js.map +0 -1
  629. package/dist/router/middleware.test.d.ts +0 -2
  630. package/dist/router/middleware.test.d.ts.map +0 -1
  631. package/dist/router/middleware.test.js +0 -816
  632. package/dist/router/middleware.test.js.map +0 -1
  633. package/dist/router/pattern-matching.d.ts +0 -149
  634. package/dist/router/pattern-matching.d.ts.map +0 -1
  635. package/dist/router/pattern-matching.js +0 -349
  636. package/dist/router/pattern-matching.js.map +0 -1
  637. package/dist/router/revalidation.d.ts +0 -44
  638. package/dist/router/revalidation.d.ts.map +0 -1
  639. package/dist/router/revalidation.js +0 -147
  640. package/dist/router/revalidation.js.map +0 -1
  641. package/dist/router/router-context.d.ts +0 -135
  642. package/dist/router/router-context.d.ts.map +0 -1
  643. package/dist/router/router-context.js +0 -36
  644. package/dist/router/router-context.js.map +0 -1
  645. package/dist/router/segment-resolution.d.ts +0 -127
  646. package/dist/router/segment-resolution.d.ts.map +0 -1
  647. package/dist/router/segment-resolution.js +0 -919
  648. package/dist/router/segment-resolution.js.map +0 -1
  649. package/dist/router/trie-matching.d.ts +0 -40
  650. package/dist/router/trie-matching.d.ts.map +0 -1
  651. package/dist/router/trie-matching.js +0 -127
  652. package/dist/router/trie-matching.js.map +0 -1
  653. package/dist/router/types.d.ts +0 -136
  654. package/dist/router/types.d.ts.map +0 -1
  655. package/dist/router/types.js +0 -7
  656. package/dist/router/types.js.map +0 -1
  657. package/dist/router.d.ts +0 -753
  658. package/dist/router.d.ts.map +0 -1
  659. package/dist/router.gen.d.ts +0 -6
  660. package/dist/router.gen.d.ts.map +0 -1
  661. package/dist/router.gen.js +0 -6
  662. package/dist/router.gen.js.map +0 -1
  663. package/dist/router.js +0 -1304
  664. package/dist/router.js.map +0 -1
  665. package/dist/rsc/__tests__/helpers.test.d.ts +0 -2
  666. package/dist/rsc/__tests__/helpers.test.d.ts.map +0 -1
  667. package/dist/rsc/__tests__/helpers.test.js +0 -140
  668. package/dist/rsc/__tests__/helpers.test.js.map +0 -1
  669. package/dist/rsc/handler.d.ts +0 -45
  670. package/dist/rsc/handler.d.ts.map +0 -1
  671. package/dist/rsc/handler.js +0 -1172
  672. package/dist/rsc/handler.js.map +0 -1
  673. package/dist/rsc/helpers.d.ts +0 -16
  674. package/dist/rsc/helpers.d.ts.map +0 -1
  675. package/dist/rsc/helpers.js +0 -55
  676. package/dist/rsc/helpers.js.map +0 -1
  677. package/dist/rsc/index.d.ts +0 -22
  678. package/dist/rsc/index.d.ts.map +0 -1
  679. package/dist/rsc/index.js +0 -23
  680. package/dist/rsc/index.js.map +0 -1
  681. package/dist/rsc/nonce.d.ts +0 -9
  682. package/dist/rsc/nonce.d.ts.map +0 -1
  683. package/dist/rsc/nonce.js +0 -18
  684. package/dist/rsc/nonce.js.map +0 -1
  685. package/dist/rsc/types.d.ts +0 -206
  686. package/dist/rsc/types.d.ts.map +0 -1
  687. package/dist/rsc/types.js +0 -8
  688. package/dist/rsc/types.js.map +0 -1
  689. package/dist/search-params.d.ts +0 -103
  690. package/dist/search-params.d.ts.map +0 -1
  691. package/dist/search-params.js +0 -74
  692. package/dist/search-params.js.map +0 -1
  693. package/dist/segment-system.d.ts +0 -75
  694. package/dist/segment-system.d.ts.map +0 -1
  695. package/dist/segment-system.js +0 -336
  696. package/dist/segment-system.js.map +0 -1
  697. package/dist/server/context.d.ts +0 -245
  698. package/dist/server/context.d.ts.map +0 -1
  699. package/dist/server/context.js +0 -197
  700. package/dist/server/context.js.map +0 -1
  701. package/dist/server/fetchable-loader-store.d.ts +0 -18
  702. package/dist/server/fetchable-loader-store.d.ts.map +0 -1
  703. package/dist/server/fetchable-loader-store.js +0 -18
  704. package/dist/server/fetchable-loader-store.js.map +0 -1
  705. package/dist/server/handle-store.d.ts +0 -85
  706. package/dist/server/handle-store.d.ts.map +0 -1
  707. package/dist/server/handle-store.js +0 -142
  708. package/dist/server/handle-store.js.map +0 -1
  709. package/dist/server/loader-registry.d.ts +0 -55
  710. package/dist/server/loader-registry.d.ts.map +0 -1
  711. package/dist/server/loader-registry.js +0 -132
  712. package/dist/server/loader-registry.js.map +0 -1
  713. package/dist/server/request-context.d.ts +0 -226
  714. package/dist/server/request-context.d.ts.map +0 -1
  715. package/dist/server/request-context.js +0 -290
  716. package/dist/server/request-context.js.map +0 -1
  717. package/dist/server/root-layout.d.ts +0 -4
  718. package/dist/server/root-layout.d.ts.map +0 -1
  719. package/dist/server/root-layout.js +0 -5
  720. package/dist/server/root-layout.js.map +0 -1
  721. package/dist/server.d.ts +0 -15
  722. package/dist/server.d.ts.map +0 -1
  723. package/dist/server.js +0 -20
  724. package/dist/server.js.map +0 -1
  725. package/dist/ssr/__tests__/ssr-handler.test.d.ts +0 -2
  726. package/dist/ssr/__tests__/ssr-handler.test.d.ts.map +0 -1
  727. package/dist/ssr/__tests__/ssr-handler.test.js +0 -132
  728. package/dist/ssr/__tests__/ssr-handler.test.js.map +0 -1
  729. package/dist/ssr/index.d.ts +0 -98
  730. package/dist/ssr/index.d.ts.map +0 -1
  731. package/dist/ssr/index.js +0 -158
  732. package/dist/ssr/index.js.map +0 -1
  733. package/dist/static-handler.d.ts +0 -50
  734. package/dist/static-handler.d.ts.map +0 -1
  735. package/dist/static-handler.gen.d.ts +0 -5
  736. package/dist/static-handler.gen.d.ts.map +0 -1
  737. package/dist/static-handler.gen.js +0 -5
  738. package/dist/static-handler.gen.js.map +0 -1
  739. package/dist/static-handler.js +0 -29
  740. package/dist/static-handler.js.map +0 -1
  741. package/dist/theme/ThemeProvider.d.ts +0 -20
  742. package/dist/theme/ThemeProvider.d.ts.map +0 -1
  743. package/dist/theme/ThemeProvider.js +0 -240
  744. package/dist/theme/ThemeProvider.js.map +0 -1
  745. package/dist/theme/ThemeScript.d.ts +0 -48
  746. package/dist/theme/ThemeScript.d.ts.map +0 -1
  747. package/dist/theme/ThemeScript.js +0 -13
  748. package/dist/theme/ThemeScript.js.map +0 -1
  749. package/dist/theme/__tests__/theme.test.d.ts +0 -2
  750. package/dist/theme/__tests__/theme.test.d.ts.map +0 -1
  751. package/dist/theme/__tests__/theme.test.js +0 -103
  752. package/dist/theme/__tests__/theme.test.js.map +0 -1
  753. package/dist/theme/constants.d.ts +0 -29
  754. package/dist/theme/constants.d.ts.map +0 -1
  755. package/dist/theme/constants.js +0 -48
  756. package/dist/theme/constants.js.map +0 -1
  757. package/dist/theme/index.d.ts +0 -31
  758. package/dist/theme/index.d.ts.map +0 -1
  759. package/dist/theme/index.js +0 -36
  760. package/dist/theme/index.js.map +0 -1
  761. package/dist/theme/theme-context.d.ts +0 -40
  762. package/dist/theme/theme-context.d.ts.map +0 -1
  763. package/dist/theme/theme-context.js +0 -60
  764. package/dist/theme/theme-context.js.map +0 -1
  765. package/dist/theme/theme-script.d.ts +0 -27
  766. package/dist/theme/theme-script.d.ts.map +0 -1
  767. package/dist/theme/theme-script.js +0 -147
  768. package/dist/theme/theme-script.js.map +0 -1
  769. package/dist/theme/types.d.ts +0 -163
  770. package/dist/theme/types.d.ts.map +0 -1
  771. package/dist/theme/types.js +0 -11
  772. package/dist/theme/types.js.map +0 -1
  773. package/dist/theme/use-theme.d.ts +0 -12
  774. package/dist/theme/use-theme.d.ts.map +0 -1
  775. package/dist/theme/use-theme.js +0 -40
  776. package/dist/theme/use-theme.js.map +0 -1
  777. package/dist/types.d.ts +0 -1479
  778. package/dist/types.d.ts.map +0 -1
  779. package/dist/types.js +0 -10
  780. package/dist/types.js.map +0 -1
  781. package/dist/urls.d.ts +0 -441
  782. package/dist/urls.d.ts.map +0 -1
  783. package/dist/urls.gen.d.ts +0 -8
  784. package/dist/urls.gen.d.ts.map +0 -1
  785. package/dist/urls.gen.js +0 -8
  786. package/dist/urls.gen.js.map +0 -1
  787. package/dist/urls.js +0 -443
  788. package/dist/urls.js.map +0 -1
  789. package/dist/use-loader.d.ts +0 -127
  790. package/dist/use-loader.d.ts.map +0 -1
  791. package/dist/use-loader.js +0 -237
  792. package/dist/use-loader.js.map +0 -1
  793. package/dist/vite/__tests__/ast-handler-extract.test.d.ts +0 -2
  794. package/dist/vite/__tests__/ast-handler-extract.test.d.ts.map +0 -1
  795. package/dist/vite/__tests__/ast-handler-extract.test.js +0 -294
  796. package/dist/vite/__tests__/ast-handler-extract.test.js.map +0 -1
  797. package/dist/vite/__tests__/expose-id-utils.test.d.ts +0 -2
  798. package/dist/vite/__tests__/expose-id-utils.test.d.ts.map +0 -1
  799. package/dist/vite/__tests__/expose-id-utils.test.js +0 -224
  800. package/dist/vite/__tests__/expose-id-utils.test.js.map +0 -1
  801. package/dist/vite/__tests__/expose-internal-ids.test.d.ts +0 -2
  802. package/dist/vite/__tests__/expose-internal-ids.test.d.ts.map +0 -1
  803. package/dist/vite/__tests__/expose-internal-ids.test.js +0 -647
  804. package/dist/vite/__tests__/expose-internal-ids.test.js.map +0 -1
  805. package/dist/vite/__tests__/expose-router-id.test.d.ts +0 -2
  806. package/dist/vite/__tests__/expose-router-id.test.d.ts.map +0 -1
  807. package/dist/vite/__tests__/expose-router-id.test.js +0 -39
  808. package/dist/vite/__tests__/expose-router-id.test.js.map +0 -1
  809. package/dist/vite/ast-handler-extract.d.ts +0 -49
  810. package/dist/vite/ast-handler-extract.d.ts.map +0 -1
  811. package/dist/vite/ast-handler-extract.js +0 -249
  812. package/dist/vite/ast-handler-extract.js.map +0 -1
  813. package/dist/vite/expose-action-id.d.ts +0 -19
  814. package/dist/vite/expose-action-id.d.ts.map +0 -1
  815. package/dist/vite/expose-action-id.js +0 -250
  816. package/dist/vite/expose-action-id.js.map +0 -1
  817. package/dist/vite/expose-id-utils.d.ts +0 -69
  818. package/dist/vite/expose-id-utils.d.ts.map +0 -1
  819. package/dist/vite/expose-id-utils.js +0 -289
  820. package/dist/vite/expose-id-utils.js.map +0 -1
  821. package/dist/vite/expose-internal-ids.d.ts +0 -22
  822. package/dist/vite/expose-internal-ids.d.ts.map +0 -1
  823. package/dist/vite/expose-internal-ids.js +0 -886
  824. package/dist/vite/expose-internal-ids.js.map +0 -1
  825. package/dist/vite/index.d.ts +0 -149
  826. package/dist/vite/index.d.ts.map +0 -1
  827. package/dist/vite/index.js.bak +0 -5448
  828. package/dist/vite/index.js.map +0 -1
  829. package/dist/vite/index.named-routes.gen.ts +0 -103
  830. package/dist/vite/package-resolution.d.ts +0 -43
  831. package/dist/vite/package-resolution.d.ts.map +0 -1
  832. package/dist/vite/package-resolution.js +0 -112
  833. package/dist/vite/package-resolution.js.map +0 -1
  834. package/dist/vite/virtual-entries.d.ts +0 -25
  835. package/dist/vite/virtual-entries.d.ts.map +0 -1
  836. package/dist/vite/virtual-entries.js +0 -110
  837. package/dist/vite/virtual-entries.js.map +0 -1
@@ -10,12 +10,12 @@
10
10
  * scopes are in play:
11
11
  * - Wildcard (default): built by `buildPrefetchKey(rangoState, target)` —
12
12
  * shape `rangoState\0/target?...`. Shared across all source pages and
13
- * invalidated automatically when Rango state bumps (deploy or
14
- * server-action invalidation).
13
+ * source segment trees; `_rsc_segments` is omitted from this key. Invalidated
14
+ * automatically when Rango state bumps (deploy or server-action invalidation).
15
15
  * - Source-scoped: built by `buildSourceKey(rangoState, sourceHref, target)`
16
16
  * — shape `rangoState\0sourceHref\0/target?...`. Embeds the Rango state
17
- * (so rotation invalidates source-scoped entries too) plus the source
18
- * href (so each originating page gets its own slot). Populated when the
17
+ * (so rotation invalidates source-scoped entries too), the source href, and
18
+ * the exact source segment tree. Populated when the
19
19
  * server tags a response with `X-RSC-Prefetch-Scope: source` (intercept
20
20
  * modals etc.), OR when a Link opts in with `prefetchKey=":source"` — in
21
21
  * both cases so source-sensitive responses cannot bleed into navigations
@@ -141,7 +141,9 @@ let generation = 0;
141
141
  * - Wildcard (source-agnostic): prefix is the Rango state value from
142
142
  * `getRangoState()`. Shared across all source pages. Invalidated
143
143
  * automatically when Rango state bumps (deploy or server-action).
144
- * Key shape: `rangoState\0/target?...`.
144
+ * `_rsc_segments` is omitted so sibling payloads prefetched from one page
145
+ * remain reusable after another prefetched navigation commits. Key shape:
146
+ * `rangoState\0/target?...`.
145
147
  * - Source-scoped: use `buildSourceKey()`. Key shape:
146
148
  * `rangoState\0sourceHref\0/target?...` — embeds the Rango state so
147
149
  * rotation invalidates source-scoped entries alongside wildcard ones,
@@ -150,12 +152,15 @@ let generation = 0;
150
152
  * `X-RSC-Prefetch-Scope: source` (intercept modals, etc.) or when a
151
153
  * Link opts in via `prefetchKey=":source"`.
152
154
  *
153
- * The `_rsc_segments` query param that travels in the target URL means
154
- * clients with different mounted segment trees naturally get different
155
- * keys so segment-level diffs remain consistent across both scopes.
155
+ * Source-scoped keys retain `_rsc_segments` because their exact source tree is
156
+ * part of the opt-in contract. Wildcard responses are source-agnostic by
157
+ * contract; callers use source scope when a custom revalidation decision makes
158
+ * the response depend on the current URL or segment tree.
156
159
  */
157
160
  export function buildPrefetchKey(prefix: string, targetUrl: URL): string {
158
- return prefix + "\0" + targetUrl.pathname + targetUrl.search;
161
+ const normalizedTarget = new URL(targetUrl);
162
+ normalizedTarget.searchParams.delete("_rsc_segments");
163
+ return prefix + "\0" + normalizedTarget.pathname + normalizedTarget.search;
159
164
  }
160
165
 
161
166
  /**
@@ -171,7 +176,14 @@ export function buildSourceKey(
171
176
  sourceHref: string,
172
177
  targetUrl: URL,
173
178
  ): string {
174
- return buildPrefetchKey(rangoState + "\0" + sourceHref, targetUrl);
179
+ return (
180
+ rangoState +
181
+ "\0" +
182
+ sourceHref +
183
+ "\0" +
184
+ targetUrl.pathname +
185
+ targetUrl.search
186
+ );
175
187
  }
176
188
 
177
189
  /**
@@ -45,6 +45,7 @@ import { startHandleCapture, type HandleCapture } from "./handle-capture.js";
45
45
  import { sortedSearchString } from "./cache-key-utils.js";
46
46
  import { encodeKV } from "../encode-kv.js";
47
47
  import { runBackground } from "./background-task.js";
48
+ import { observePhase, PHASES } from "../router/instrument.js";
48
49
  import {
49
50
  normalizeTags,
50
51
  recordRequestTags,
@@ -464,32 +465,45 @@ export function registerCachedFunction<T extends (...args: any[]) => any>(
464
465
  // synchronous kickoff; its async continuations inherit it. The
465
466
  // DERIVED context goes in, so ambient _handleStore reads inside
466
467
  // the body resolve to the isolated store.
467
- const scoped = runWithRequestContext(bgCtx, () =>
468
- runWithCacheTagScope(() => fn.apply(this, args)),
469
- );
470
- const freshResult = await scoped.result;
471
- bgStopCapture?.();
472
- // Merge profile/DSL tags with runtime cacheTag() tags, read after
473
- // awaiting so post-await cacheTag() calls are included. Normalize
474
- // (drops empty profile tags, matching the invalidate path) + dedupe.
475
- const freshTags = [
476
- ...new Set(
477
- normalizeTags([...(profile.tags ?? []), ...scoped.tags]),
468
+ //
469
+ // The span opens inside the request ALS and wraps the WHOLE task —
470
+ // fn kickoff through the store write — so its platform spans nest
471
+ // under rango.background and a slow or failing setItem is part of
472
+ // the traced revalidation, not an untraced tail.
473
+ await runWithRequestContext(bgCtx, () =>
474
+ observePhase(
475
+ PHASES.background("use-cache-revalidation"),
476
+ async () => {
477
+ const scoped = runWithCacheTagScope(() =>
478
+ fn.apply(this, args),
479
+ );
480
+ const freshResult = await scoped.result;
481
+ bgStopCapture?.();
482
+ // Merge profile/DSL tags with runtime cacheTag() tags, read
483
+ // after awaiting so post-await cacheTag() calls are included.
484
+ // Normalize (drops empty profile tags, matching the
485
+ // invalidate path) + dedupe.
486
+ const freshTags = [
487
+ ...new Set(
488
+ normalizeTags([...(profile.tags ?? []), ...scoped.tags]),
489
+ ),
490
+ ];
491
+ recordRequestTags(freshTags, requestCtx);
492
+ const serialized = await serializeResult(freshResult);
493
+ if (serialized !== null) {
494
+ const encodedHandles = bgCapture?.data
495
+ ? await encodeHandles(bgCapture.data)
496
+ : undefined;
497
+ await store.setItem!(cacheKey, serialized, {
498
+ handles: encodedHandles,
499
+ ttl: profile.ttl,
500
+ swr: profile.swr,
501
+ tags: freshTags.length > 0 ? freshTags : undefined,
502
+ });
503
+ }
504
+ },
478
505
  ),
479
- ];
480
- recordRequestTags(freshTags, requestCtx);
481
- const serialized = await serializeResult(freshResult);
482
- if (serialized !== null) {
483
- const encodedHandles = bgCapture?.data
484
- ? await encodeHandles(bgCapture.data)
485
- : undefined;
486
- await store.setItem!(cacheKey, serialized, {
487
- handles: encodedHandles,
488
- ttl: profile.ttl,
489
- swr: profile.swr,
490
- tags: freshTags.length > 0 ? freshTags : undefined,
491
- });
492
- }
506
+ );
493
507
  } catch (bgError) {
494
508
  bgStopCapture?.();
495
509
  // Pass requestCtx explicitly: this runs in a detached background
@@ -24,6 +24,7 @@ import { mayNeedSSR } from "../rsc/ssr-setup.js";
24
24
  import { cacheKeyBase } from "./cache-key-utils.js";
25
25
  import { runBackground } from "./background-task.js";
26
26
  import { reportCacheError } from "./cache-error.js";
27
+ import { observePhase, PHASES } from "../router/instrument.js";
27
28
  import {
28
29
  SEGMENT_FRAGMENT_CAPABILITY_HEADER,
29
30
  SEGMENT_FRAGMENT_RECOVERY_HEADER,
@@ -378,29 +379,44 @@ export function createDocumentCacheMiddleware<TEnv = any>(
378
379
 
379
380
  runBackground(requestCtx, async () => {
380
381
  try {
381
- // Re-establish the request-context ALS around the background
382
- // re-render: next() re-runs the full handler pipeline, and on
383
- // workerd a waitUntil task runs detached from the request's I/O
384
- // context, so a handler/component reading getRequestContext() would
385
- // otherwise throw. Same fix as the route-level/use-cache background
386
- // revalidation paths.
387
- const fresh = await runWithRequestContext(requestCtx, () => next());
388
- const directives = shouldCacheResponse(fresh);
389
-
390
- if (directives && fresh.body) {
391
- // Background revalidation: nothing streams to a client, so drain
392
- // the fresh render fully before snapshotting tags (same
393
- // render-complete barrier as the miss path).
394
- const body = await new Response(fresh.body).arrayBuffer();
395
- await store.putResponse!(
396
- cacheKey,
397
- new Response(body, fresh),
398
- directives.sMaxAge!,
399
- directives.staleWhileRevalidate,
400
- collectRequestTags(requestCtx),
401
- );
402
- log(`[DocumentCache] REVALIDATED ${typeLabel}: ${url.pathname}`);
403
- }
382
+ // Re-establish the request-context ALS around the whole background
383
+ // task: next() re-runs the full handler pipeline, and on workerd a
384
+ // waitUntil task runs detached from the request's I/O context, so a
385
+ // handler/component reading getRequestContext() would otherwise
386
+ // throw. Same fix as the route-level/use-cache background
387
+ // revalidation paths. The rango.background span (kind=
388
+ // document-revalidation) wraps the re-render AND the store write so
389
+ // the task's spans — the re-run's own rango.* set and the drain/put
390
+ // platform spans — nest under one explanatory parent instead of
391
+ // dangling under the ended foreground phases. Running the put
392
+ // inside the ALS matches the MISS path, where putResponse already
393
+ // executes within the foreground request context.
394
+ await runWithRequestContext(requestCtx, () =>
395
+ observePhase(
396
+ PHASES.background("document-revalidation"),
397
+ async () => {
398
+ const fresh = await next();
399
+ const directives = shouldCacheResponse(fresh);
400
+
401
+ if (!directives || !fresh.body) return;
402
+
403
+ // Background revalidation: nothing streams to a client, so
404
+ // drain the fresh render fully before snapshotting tags
405
+ // (same render-complete barrier as the miss path).
406
+ const body = await new Response(fresh.body).arrayBuffer();
407
+ await store.putResponse!(
408
+ cacheKey,
409
+ new Response(body, fresh),
410
+ directives.sMaxAge!,
411
+ directives.staleWhileRevalidate,
412
+ collectRequestTags(requestCtx),
413
+ );
414
+ log(
415
+ `[DocumentCache] REVALIDATED ${typeLabel}: ${url.pathname}`,
416
+ );
417
+ },
418
+ ),
419
+ );
404
420
  } catch (error) {
405
421
  // Pass requestCtx explicitly: this runs in a detached waitUntil task
406
422
  // where the ALS context is gone, so onError only fires if we hand it
@@ -37,13 +37,14 @@ export interface ReadThroughItemConfig<T> {
37
37
  /** Execute the underlying function/loader on miss or revalidation */
38
38
  execute: () => Promise<T>;
39
39
  /**
40
- * Optional wrapper applied to execute() ONLY on the background
41
- * stale-revalidation path (not the foreground miss, where the caller's context
42
- * is already established). Used to re-establish the request-context ALS, which
43
- * a detached waitUntil task loses on workerd. Defaults to calling execute()
44
- * directly.
40
+ * Optional wrapper applied to the WHOLE background stale-revalidation task
41
+ * (execute + serialize + setItem) — not the foreground miss, where the
42
+ * caller's context is already established. Used to re-establish the
43
+ * request-context ALS, which a detached waitUntil task loses on workerd,
44
+ * and to open the rango.background span so the write is covered too.
45
+ * Defaults to running the task directly.
45
46
  */
46
- wrapBackground?: (run: () => Promise<T>) => Promise<T>;
47
+ wrapBackground?: (run: () => Promise<void>) => Promise<void>;
47
48
  /** Serialize result for storage. Return null to skip caching. */
48
49
  serialize: (data: T) => Promise<string | null>;
49
50
  /** Deserialize cached value back to the original type */
@@ -111,20 +112,25 @@ export async function readThroughItem<T>(
111
112
 
112
113
  // Stale hit — return stale data, revalidate in background
113
114
  onStale?.(cached);
115
+ // The whole task — execute AND serialize/setItem — goes through
116
+ // wrapBackground so the ALS re-establishment and the rango.background
117
+ // span cover the write too (a slow or failing store write is part of
118
+ // the revalidation, not an untraced tail). The foreground miss below
119
+ // stays unwrapped: its context is already established.
120
+ const revalidateTask = async () => {
121
+ const fresh = await execute();
122
+ const serialized = await serialize(fresh);
123
+ if (serialized !== null) {
124
+ await setItem(key, serialized, storeOptions);
125
+ }
126
+ };
114
127
  runBackground(
115
128
  host,
116
129
  async () => {
117
130
  try {
118
- // Re-establish the caller's context (request-context ALS) for the
119
- // detached background execution; the foreground miss below calls
120
- // execute() directly since its context is already established.
121
- const fresh = await (wrapBackground
122
- ? wrapBackground(execute)
123
- : execute());
124
- const serialized = await serialize(fresh);
125
- if (serialized !== null) {
126
- await setItem(key, serialized, storeOptions);
127
- }
131
+ await (wrapBackground
132
+ ? wrapBackground(revalidateTask)
133
+ : revalidateTask());
128
134
  } catch (error) {
129
135
  reportCacheError(
130
136
  error,
@@ -1,10 +1,11 @@
1
1
  /**
2
2
  * Cloudflare custom-spans integration.
3
3
  *
4
- * Bridges the router's performance phases (request, middleware, action,
5
- * loaders, handler, render, ssr) onto Cloudflare Workers custom spans so they show
6
- * up in the trace waterfall and OpenTelemetry exports next to the platform's
7
- * automatic spans (KV reads, D1 queries, fetch calls), with correct nesting.
4
+ * Bridges the router's observable phases (request, middleware, action, loaders,
5
+ * handler, render, ssr, response, background) onto Cloudflare Workers custom
6
+ * spans so they show up in the trace waterfall and OpenTelemetry exports next
7
+ * to the platform's automatic spans (KV reads, D1 queries, fetch calls), with
8
+ * correct nesting.
8
9
  *
9
10
  * Usage (Cloudflare preset only):
10
11
  *
@@ -27,12 +28,15 @@
27
28
  *
28
29
  * Span duration note: enterSpan ends a span when its callback's returned value
29
30
  * (or promise) settles. For the streaming phases (request/render/ssr) that is at
30
- * stream CONSTRUCTION, not body-drain. Instrumentation is best-effort and never
31
- * wraps or buffers the response body, so it cannot regress streaming or latency.
32
- * A loader/Suspense child that resolves mid-stream therefore keeps a rango.loader
33
- * span that can extend past its render parent overlapping spans are valid. Uses
34
- * only the typed enterSpan API; spans bound work up to stream-handoff, matching
35
- * the co-emitted perf metric.
31
+ * stream CONSTRUCTION, not body-drain; rango.response marks that handoff
32
+ * boundary explicitly (it wraps only response finalization, never the body).
33
+ * Instrumentation is best-effort and never wraps or buffers the response body,
34
+ * so it cannot regress streaming or latency. A loader/Suspense child that
35
+ * resolves mid-stream therefore keeps a rango.loader span that can extend past
36
+ * its render parent — overlapping spans are valid. Uses only the typed enterSpan
37
+ * API; spans bound work up to stream-handoff, matching the co-emitted perf
38
+ * metric. On deployed Workers a rango.response span may report 0 ms (non-I/O
39
+ * timers are frozen); its position and attributes are the value.
36
40
  */
37
41
 
38
42
  import { _getRequestContext } from "../server/request-context.js";
@@ -91,8 +95,8 @@ const cloudflareSpanRunner: SpanRunner = (name, fn) => {
91
95
  /**
92
96
  * Create the tracing config for a Cloudflare router. Pass the result to
93
97
  * `createRouter({ tracing })`. Spans are emitted for the request, middleware,
94
- * action, loaders, handler, render, and ssr phases; pass `spans` to turn
95
- * individual phases off.
98
+ * action, loaders, handler, render, ssr, response, and background phases; pass
99
+ * `spans` to turn individual phases off.
96
100
  *
97
101
  * @see createOTelTracing (`@rangojs/router`) for the same slot on any platform
98
102
  * with an OpenTelemetry SDK.
@@ -5,13 +5,11 @@
5
5
  * The router exposes the same work on three surfaces, and the rule is: each
6
6
  * surface has exactly one owner here, so they cannot drift.
7
7
  *
8
- * - observePhase(): a span of work. Co-emits the `debugPerformance` perf
9
- * metric (metrics store -> [RSC Perf] timeline + Server-Timing) AND the
10
- * platform span (tracing runner -> Cloudflare custom spans / OTel). From one
11
- * wrap site, so the span set is always a subset of the perf phases and the
12
- * two can't disagree. Phases that meter their own perf metric with a finer
13
- * decomposition (request, middleware) pass `metric: false` and get the span
14
- * only — still co-located, still one owner per surface.
8
+ * - observePhase(): a span of work. From one wrap site, emits the platform
9
+ * span (tracing runner -> Cloudflare custom spans / OTel) and, when the
10
+ * phase has one, its `debugPerformance` metric (metrics store -> [RSC Perf]
11
+ * timeline + Server-Timing). Phases that meter their own perf metric with a
12
+ * finer decomposition, or are deliberately span-only, pass `metric: false`.
15
13
  * - observeEvent(): a discrete fact (TelemetrySink): cache decisions,
16
14
  * revalidation decisions, handler errors, timeouts, origin rejections.
17
15
  * Event-shaped, not phase-shaped — derived from the same call sites but a
@@ -85,6 +83,16 @@ function currentRouteName(): string | undefined {
85
83
  : undefined;
86
84
  }
87
85
 
86
+ /**
87
+ * The detached background lanes wrapped by the rango.background span (the
88
+ * `rango.background.kind` attribute). One name per task execution boundary.
89
+ */
90
+ export type BackgroundTaskKind =
91
+ | "shell-capture"
92
+ | "document-revalidation"
93
+ | "loader-revalidation"
94
+ | "use-cache-revalidation";
95
+
88
96
  /**
89
97
  * The router's observable phases. One definition per phase keeps the `rango.*`
90
98
  * span names, perf-metric labels, and identifying attributes from spreading
@@ -176,6 +184,43 @@ export const PHASES = {
176
184
  tracePhase: "ssr",
177
185
  spanName: "rango.ssr",
178
186
  } as PhaseSpec,
187
+
188
+ /**
189
+ * One detached background task (waitUntil work that outlives the response):
190
+ * a PPR shell capture or an SWR background revalidation. The wrapper is the
191
+ * explanatory parent for everything the task does — the platform's automatic
192
+ * KV/fetch/cache spans, and (for the revalidation lanes) the re-run's own
193
+ * rango.* phase spans — so post-handoff work never appears as orphan spans
194
+ * dangling under an ended foreground phase. `kind` identifies the lane.
195
+ * Span only (metric:false): the perf timeline is finalized with the
196
+ * response, so a background metric could never reach it. The shell-capture
197
+ * lane keeps its INNER phase spans suppressed (derived context strips
198
+ * _tracing — a capture re-render duplicating the foreground's span set was
199
+ * the original #670 leak); the revalidation lanes keep theirs, nested here.
200
+ */
201
+ background: (kind: BackgroundTaskKind): PhaseSpec => ({
202
+ metric: false,
203
+ tracePhase: "background",
204
+ spanName: "rango.background",
205
+ attributes: { "rango.background.kind": kind },
206
+ }),
207
+
208
+ /** Final response construction + host handoff: opened AFTER downstream
209
+ * middleware/core execution returns a Response, wrapping only finalization
210
+ * (redirect interception/guarding, Server-Timing mutation, final response
211
+ * selection) and ending immediately before the router handler returns the
212
+ * response to the host. Handoff-bound, never drain-bound — it must never
213
+ * read, tee, buffer, or await response.body, so it cannot regress streaming.
214
+ * At most one per traced request; absent when the request throws before a
215
+ * response exists. Span only (metric:false) — a co-emitted metric would
216
+ * circularly mutate the Server-Timing header this phase itself finalizes.
217
+ * On Cloudflare it may report 0 ms (non-I/O timers are frozen); its position
218
+ * and attributes (status/mode/body kind, set by the handler) are the value. */
219
+ response: {
220
+ metric: false,
221
+ tracePhase: "response",
222
+ spanName: "rango.response",
223
+ } as PhaseSpec,
179
224
  } as const;
180
225
 
181
226
  /** Apply a phase spec's static attributes to a span (the no-op span ignores them). */
@@ -209,14 +254,15 @@ function recordPhaseMetric(
209
254
  * returns a promise both the metric duration and the span end when it settles.
210
255
  *
211
256
  * This is the ONLY phase primitive: every phase (request/middleware/action/
212
- * loader/handler/render/ssr) is construction-bound the span and metric settle
213
- * when fn's own work completes (for the streaming phases, when the RSC/HTML
214
- * stream is constructed, NOT when the body drains). Instrumentation is strictly
215
- * best-effort: it never wraps or buffers the response and adds no work on the
216
- * streaming path, so it cannot regress response latency or streaming. A loader
217
- * that resolves while the body streams therefore keeps a rango.loader span that
218
- * may extend past its render parent overlapping spans are valid; the loader
219
- * really did take that long.
257
+ * loader/handler/render/ssr/response/background) settles when fn's own work
258
+ * completes. For streaming phases that means when the RSC/HTML stream is
259
+ * constructed, NOT when the body drains; for response, when finalization hands
260
+ * the stream to the host. Instrumentation is strictly best-effort: it never
261
+ * wraps or buffers the response and adds no work on the streaming path, so it
262
+ * cannot regress response latency or streaming. A loader that resolves while
263
+ * the body streams therefore keeps a rango.loader span that may extend past its
264
+ * render parent — overlapping spans are valid; the loader really did take that
265
+ * long.
220
266
  *
221
267
  * Reads the metrics store + tracing off the RequestContext ALS, which is active
222
268
  * for the WHOLE request — contrast observeEvent, which reads the RouterContext
@@ -26,6 +26,7 @@ import {
26
26
  _getRequestContext,
27
27
  runWithRequestContext,
28
28
  } from "../../server/request-context.js";
29
+ import { observePhase, PHASES } from "../instrument.js";
29
30
  import { sortedRouteParams } from "../../cache/cache-key-utils.js";
30
31
  import {
31
32
  resolveTtl,
@@ -328,7 +329,17 @@ function executeLoaderData<TEnv>(
328
329
  setItem: (k, v, o) => store.setItem!(k, v, o),
329
330
  key,
330
331
  execute: () => runMiss(loaderEntry.loader),
331
- wrapBackground: (run) => runWithRequestContext(requestCtxForExecute, run),
332
+ // The rango.background span (kind=loader-revalidation) wraps the WHOLE
333
+ // stale revalidation — the re-execution AND the serialize/setItem write
334
+ // (read-through-swr routes the full task through wrapBackground) — so
335
+ // the loader's rango.loader span, its fetch/KV platform spans, and the
336
+ // store write all nest under one explanatory parent instead of dangling
337
+ // under the ended foreground phases. Inside runWithRequestContext so
338
+ // observePhase can read tracing on workerd (ALS detaches in waitUntil).
339
+ wrapBackground: (run) =>
340
+ runWithRequestContext(requestCtxForExecute, () =>
341
+ observePhase(PHASES.background("loader-revalidation"), run),
342
+ ),
332
343
  serialize: (d) => codec.serializeResult(d),
333
344
  deserialize: (v) => codec.deserializeResult(v),
334
345
  storeOptions: { ttl, swr, tags },
@@ -33,6 +33,7 @@ import {
33
33
  isTraceActive,
34
34
  } from "../logging.js";
35
35
  import { resolveLoaderData } from "./loader-cache.js";
36
+ import { entryLoadingMasksLoaders } from "./loader-mask.js";
36
37
  import {
37
38
  handleHandlerResult,
38
39
  warnOnStreamedResponse,
@@ -206,6 +207,15 @@ export async function resolveLoadersWithRevalidation<TEnv>(
206
207
  // onError/loader.error. isPartial flags the reporting phase accordingly.
207
208
  const errorContext = { ...buildLoaderErrorContext(ctx), isPartial: true };
208
209
 
210
+ // PPR lane decision, same rule as the fresh funnel (fresh.ts): an entry
211
+ // without renderable loading() puts its loaders on the BAKE lane. The key
212
+ // must thread through EVERY resolveLoaderData funnel — omitting it here made
213
+ // a capture-active context whole-container-mask every loader on this path
214
+ // (a never-settling promise for a loader that should have executed).
215
+ // Outside capture the key only activates the _shellLoaderSeed overlay,
216
+ // which document-only serveShellHit seeds — inert for partial requests.
217
+ const bakeLane = !entryLoadingMasksLoaders(entry.loading);
218
+
209
219
  const loadersToRun = revalidationChecks.filter((c) => c.shouldRun);
210
220
  const segments: ResolvedSegment[] = loadersToRun.map(
211
221
  ({ loaderEntry, loader, segmentId, index }) => ({
@@ -218,7 +228,12 @@ export async function resolveLoadersWithRevalidation<TEnv>(
218
228
  loaderId: loader.$$id,
219
229
  loaderData: deps.wrapLoaderPromise(
220
230
  runInsideLoaderScope(() =>
221
- resolveLoaderData(loaderEntry, ctx, ctx.pathname),
231
+ resolveLoaderData(
232
+ loaderEntry,
233
+ ctx,
234
+ ctx.pathname,
235
+ bakeLane ? segmentId : null,
236
+ ),
222
237
  ),
223
238
  entry,
224
239
  segmentId,
@@ -6,10 +6,10 @@
6
6
  * - createOTelTracing(tracer): the OTel adapter for the `tracing` SLOT — the
7
7
  * canonical phase-span layer. It bridges observePhase's callback boundary
8
8
  * onto OTel's callback-bound `startActiveSpan`, so the router's phase spans
9
- * (rango.request/middleware/loader/render/ssr) nest by async context and the
10
- * loader's own OTel spans (db/fetch) land under rango.loader. This is the
11
- * OTel equivalent of createCloudflareTracing pass it to
12
- * `createRouter({ tracing })`.
9
+ * (rango.request/middleware/action/loader/handler/render/ssr/response/
10
+ * background) nest by async context and the loader's own OTel spans
11
+ * (db/fetch) land under rango.loader. This is the OTel equivalent of
12
+ * createCloudflareTracing — pass it to `createRouter({ tracing })`.
13
13
  *
14
14
  * - createOTelSink(tracer): the OTel adapter for the `telemetry` SLOT — a
15
15
  * TelemetrySink for the EVENT-shaped facts (handler errors, cache decisions,
@@ -11,7 +11,18 @@ export interface RouterTimeouts {
11
11
  actionMs?: number;
12
12
  /** Timeout for initial render/response production (ms). */
13
13
  renderStartMs?: number;
14
- /** Timeout for idle streaming after render starts (ms). Reserved for PR 2. */
14
+ /**
15
+ * Timeout for idle streaming after the response is handed off (ms): when no
16
+ * chunk flows to the client for this long, the body stream is errored with a
17
+ * RouterTimeoutError ("stream-idle") and the source render is canceled —
18
+ * bounding hangs from never-settling promises embedded in the payload.
19
+ * END-TO-END semantics: a stalled slow client counts as idle the same as a
20
+ * wedged producer, so pick generous budgets (seconds). Opt-in (unset =
21
+ * unbounded, and the `timeout` shorthand deliberately does not apply);
22
+ * onTimeout does NOT fire — no replacement Response can be served
23
+ * mid-stream — the trip reports via onError + the request.timeout event.
24
+ * Enforcement: rsc/stream-idle.ts, wired at the handler's response tail.
25
+ */
15
26
  streamIdleMs?: number;
16
27
  }
17
28
 
@@ -1,11 +1,12 @@
1
1
  /**
2
2
  * Span tracing hook (platform-agnostic).
3
3
  *
4
- * The core router emits its existing performance phases (request, middleware, action,
5
- * loaders, render, ssr) as spans by calling traceSpan() at a small set of
6
- * execution boundaries. When no tracing is configured the call is a direct
7
- * pass-through: fn is invoked with a no-op span, with no wrapper and no
8
- * allocation, so a non-traced request behaves exactly as before.
4
+ * The core router emits its observable phases (request, middleware, action,
5
+ * loaders, handler, render, ssr, response, background) as spans by calling
6
+ * traceSpan() at a small set of execution boundaries. When no tracing is
7
+ * configured the call is a direct pass-through: fn is invoked with a no-op
8
+ * span, with no wrapper and no allocation, so a non-traced request behaves
9
+ * exactly as before.
9
10
  *
10
11
  * A platform integration supplies a SpanRunner that wraps fn in a real span.
11
12
  * Two runners ship: the Cloudflare one (createCloudflareTracing in
@@ -29,7 +30,10 @@
29
30
  * useLoader, plus the fetchable path), rango.handler (span-only, one per segment
30
31
  * route/layout handler execution; the handler:<id> perf metric is owned by the
31
32
  * track() at the call site), rango.render (render:total:<route>; normal AND
32
- * action-revalidation renders), rango.ssr (ssr:render-html).
33
+ * action-revalidation renders), rango.ssr (ssr:render-html), rango.response
34
+ * (span-only; final response construction + host handoff — the explicit
35
+ * stream-handoff marker), and rango.background (span-only; detached work, see
36
+ * below).
33
37
  *
34
38
  * Span-duration caveat (best-effort, never buffers): a span ends when its
35
39
  * callback's value (or promise) settles. For the streaming phases (request,
@@ -40,6 +44,19 @@
40
44
  * rango.loader span that can extend past its render parent; overlapping spans are
41
45
  * valid (the loader really did take that long). Phase spans bound the work up to
42
46
  * stream-handoff, which is also what the co-emitted perf metric measures.
47
+ * rango.response makes that handoff boundary explicit: it wraps only response
48
+ * finalization (redirect interception/guarding, Server-Timing mutation, final
49
+ * response selection) after downstream execution returns, ending immediately
50
+ * before the handler returns the Response to the host. It is handoff-bound,
51
+ * never drain-bound — it never reads, tees, or awaits response.body, and it is
52
+ * absent when the request throws before a response exists.
53
+ *
54
+ * rango.background wraps DETACHED work (waitUntil tasks that outlive the
55
+ * response): PPR shell captures and SWR background revalidations. It is the
56
+ * explanatory parent for spans those tasks produce after the foreground
57
+ * phases ended — without it, post-handoff work reads as orphan spans dangling
58
+ * under an ended parent. See PHASES.background (instrument.ts) for the lane
59
+ * kinds and per-lane inner-span policy.
43
60
  *
44
61
  * Both shipped runners (Cloudflare, OTel) keep the core agnostic: the
45
62
  * platform-specific bridge lives at the edge behind the SpanRunner contract.
@@ -68,18 +85,17 @@ export type TracePhase =
68
85
  | "loader"
69
86
  | "handler"
70
87
  | "render"
71
- | "ssr";
88
+ | "ssr"
89
+ | "response"
90
+ | "background";
72
91
 
73
- /** Per-phase span toggles. Omitted phases default to enabled. */
74
- export interface TracePhaseToggles {
75
- request?: boolean;
76
- middleware?: boolean;
77
- action?: boolean;
78
- loader?: boolean;
79
- handler?: boolean;
80
- render?: boolean;
81
- ssr?: boolean;
82
- }
92
+ /**
93
+ * Per-phase span toggles. Omitted phases default to enabled. Derived from
94
+ * TracePhase so a new phase cannot be silently missing here — the other phase
95
+ * lists in this file (ALL_PHASES_ON, resolveTracing) are exhaustiveness-checked
96
+ * by their Record<TracePhase, boolean> annotations.
97
+ */
98
+ export type TracePhaseToggles = Partial<Record<TracePhase, boolean>>;
83
99
 
84
100
  /**
85
101
  * The option pair shared by every tracing factory (enabled master switch +
@@ -125,6 +141,8 @@ const ALL_PHASES_ON: Record<TracePhase, boolean> = {
125
141
  handler: true,
126
142
  render: true,
127
143
  ssr: true,
144
+ response: true,
145
+ background: true,
128
146
  };
129
147
 
130
148
  /**
@@ -153,6 +171,8 @@ export function resolveTracing(
153
171
  handler: spans.handler ?? true,
154
172
  render: spans.render ?? true,
155
173
  ssr: spans.ssr ?? true,
174
+ response: spans.response ?? true,
175
+ background: spans.background ?? true,
156
176
  }
157
177
  : ALL_PHASES_ON,
158
178
  };