@rangojs/router 0.0.0-experimental.116 → 0.0.0-experimental.118

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 (852) hide show
  1. package/dist/__internal.d.ts +83 -0
  2. package/dist/__internal.d.ts.map +1 -0
  3. package/dist/__internal.js +19 -0
  4. package/dist/__internal.js.map +1 -0
  5. package/dist/__mocks__/version.d.ts +7 -0
  6. package/dist/__mocks__/version.d.ts.map +1 -0
  7. package/dist/__mocks__/version.js +7 -0
  8. package/dist/__mocks__/version.js.map +1 -0
  9. package/dist/__tests__/client-href.test.d.ts +2 -0
  10. package/dist/__tests__/client-href.test.d.ts.map +1 -0
  11. package/dist/__tests__/client-href.test.js +74 -0
  12. package/dist/__tests__/client-href.test.js.map +1 -0
  13. package/dist/__tests__/component-utils.test.d.ts +2 -0
  14. package/dist/__tests__/component-utils.test.d.ts.map +1 -0
  15. package/dist/__tests__/component-utils.test.js +51 -0
  16. package/dist/__tests__/component-utils.test.js.map +1 -0
  17. package/dist/__tests__/event-controller.test.d.ts +2 -0
  18. package/dist/__tests__/event-controller.test.d.ts.map +1 -0
  19. package/dist/__tests__/event-controller.test.js +538 -0
  20. package/dist/__tests__/event-controller.test.js.map +1 -0
  21. package/dist/__tests__/helpers/route-tree.d.ts +118 -0
  22. package/dist/__tests__/helpers/route-tree.d.ts.map +1 -0
  23. package/dist/__tests__/helpers/route-tree.js +374 -0
  24. package/dist/__tests__/helpers/route-tree.js.map +1 -0
  25. package/dist/__tests__/match-result.test.d.ts +2 -0
  26. package/dist/__tests__/match-result.test.d.ts.map +1 -0
  27. package/dist/__tests__/match-result.test.js +154 -0
  28. package/dist/__tests__/match-result.test.js.map +1 -0
  29. package/dist/__tests__/navigation-store.test.d.ts +2 -0
  30. package/dist/__tests__/navigation-store.test.d.ts.map +1 -0
  31. package/dist/__tests__/navigation-store.test.js +440 -0
  32. package/dist/__tests__/navigation-store.test.js.map +1 -0
  33. package/dist/__tests__/partial-update.test.d.ts +2 -0
  34. package/dist/__tests__/partial-update.test.d.ts.map +1 -0
  35. package/dist/__tests__/partial-update.test.js +1009 -0
  36. package/dist/__tests__/partial-update.test.js.map +1 -0
  37. package/dist/__tests__/reverse-types.test.d.ts +8 -0
  38. package/dist/__tests__/reverse-types.test.d.ts.map +1 -0
  39. package/dist/__tests__/reverse-types.test.js +656 -0
  40. package/dist/__tests__/reverse-types.test.js.map +1 -0
  41. package/dist/__tests__/route-definition.test.d.ts +2 -0
  42. package/dist/__tests__/route-definition.test.d.ts.map +1 -0
  43. package/dist/__tests__/route-definition.test.js +55 -0
  44. package/dist/__tests__/route-definition.test.js.map +1 -0
  45. package/dist/__tests__/router-helpers.test.d.ts +2 -0
  46. package/dist/__tests__/router-helpers.test.d.ts.map +1 -0
  47. package/dist/__tests__/router-helpers.test.js +377 -0
  48. package/dist/__tests__/router-helpers.test.js.map +1 -0
  49. package/dist/__tests__/router-integration-2.test.d.ts +2 -0
  50. package/dist/__tests__/router-integration-2.test.d.ts.map +1 -0
  51. package/dist/__tests__/router-integration-2.test.js +426 -0
  52. package/dist/__tests__/router-integration-2.test.js.map +1 -0
  53. package/dist/__tests__/router-integration.test.d.ts +2 -0
  54. package/dist/__tests__/router-integration.test.d.ts.map +1 -0
  55. package/dist/__tests__/router-integration.test.js +1051 -0
  56. package/dist/__tests__/router-integration.test.js.map +1 -0
  57. package/dist/__tests__/search-params.test.d.ts +5 -0
  58. package/dist/__tests__/search-params.test.d.ts.map +1 -0
  59. package/dist/__tests__/search-params.test.js +306 -0
  60. package/dist/__tests__/search-params.test.js.map +1 -0
  61. package/dist/__tests__/segment-system.test.d.ts +2 -0
  62. package/dist/__tests__/segment-system.test.d.ts.map +1 -0
  63. package/dist/__tests__/segment-system.test.js +627 -0
  64. package/dist/__tests__/segment-system.test.js.map +1 -0
  65. package/dist/__tests__/static-handler-types.test.d.ts +8 -0
  66. package/dist/__tests__/static-handler-types.test.d.ts.map +1 -0
  67. package/dist/__tests__/static-handler-types.test.js +63 -0
  68. package/dist/__tests__/static-handler-types.test.js.map +1 -0
  69. package/dist/__tests__/urls.test.d.ts +2 -0
  70. package/dist/__tests__/urls.test.d.ts.map +1 -0
  71. package/dist/__tests__/urls.test.js +421 -0
  72. package/dist/__tests__/urls.test.js.map +1 -0
  73. package/dist/__tests__/use-mount.test.d.ts +2 -0
  74. package/dist/__tests__/use-mount.test.d.ts.map +1 -0
  75. package/dist/__tests__/use-mount.test.js +35 -0
  76. package/dist/__tests__/use-mount.test.js.map +1 -0
  77. package/dist/bin/rango.d.ts +2 -0
  78. package/dist/bin/rango.d.ts.map +1 -0
  79. package/dist/bin/rango.js.map +1 -0
  80. package/dist/browser/event-controller.d.ts +191 -0
  81. package/dist/browser/event-controller.d.ts.map +1 -0
  82. package/dist/browser/event-controller.js +559 -0
  83. package/dist/browser/event-controller.js.map +1 -0
  84. package/dist/browser/index.d.ts +2 -0
  85. package/dist/browser/index.d.ts.map +1 -0
  86. package/dist/browser/index.js +14 -0
  87. package/dist/browser/index.js.map +1 -0
  88. package/dist/browser/link-interceptor.d.ts +38 -0
  89. package/dist/browser/link-interceptor.d.ts.map +1 -0
  90. package/dist/browser/link-interceptor.js +99 -0
  91. package/dist/browser/link-interceptor.js.map +1 -0
  92. package/dist/browser/logging.d.ts +10 -0
  93. package/dist/browser/logging.d.ts.map +1 -0
  94. package/dist/browser/logging.js +29 -0
  95. package/dist/browser/logging.js.map +1 -0
  96. package/dist/browser/lru-cache.d.ts +17 -0
  97. package/dist/browser/lru-cache.d.ts.map +1 -0
  98. package/dist/browser/lru-cache.js +50 -0
  99. package/dist/browser/lru-cache.js.map +1 -0
  100. package/dist/browser/merge-segment-loaders.d.ts +39 -0
  101. package/dist/browser/merge-segment-loaders.d.ts.map +1 -0
  102. package/dist/browser/merge-segment-loaders.js +102 -0
  103. package/dist/browser/merge-segment-loaders.js.map +1 -0
  104. package/dist/browser/navigation-bridge.d.ts +102 -0
  105. package/dist/browser/navigation-bridge.d.ts.map +1 -0
  106. package/dist/browser/navigation-bridge.js +708 -0
  107. package/dist/browser/navigation-bridge.js.map +1 -0
  108. package/dist/browser/navigation-client.d.ts +25 -0
  109. package/dist/browser/navigation-client.d.ts.map +1 -0
  110. package/dist/browser/navigation-client.js +157 -0
  111. package/dist/browser/navigation-client.js.map +1 -0
  112. package/dist/browser/navigation-store.d.ts +101 -0
  113. package/dist/browser/navigation-store.d.ts.map +1 -0
  114. package/dist/browser/navigation-store.js +625 -0
  115. package/dist/browser/navigation-store.js.map +1 -0
  116. package/dist/browser/partial-update.d.ts +75 -0
  117. package/dist/browser/partial-update.d.ts.map +1 -0
  118. package/dist/browser/partial-update.js +426 -0
  119. package/dist/browser/partial-update.js.map +1 -0
  120. package/dist/browser/react/Link.d.ts +86 -0
  121. package/dist/browser/react/Link.d.ts.map +1 -0
  122. package/dist/browser/react/Link.js +128 -0
  123. package/dist/browser/react/Link.js.map +1 -0
  124. package/dist/browser/react/NavigationProvider.d.ts +63 -0
  125. package/dist/browser/react/NavigationProvider.d.ts.map +1 -0
  126. package/dist/browser/react/NavigationProvider.js +216 -0
  127. package/dist/browser/react/NavigationProvider.js.map +1 -0
  128. package/dist/browser/react/ScrollRestoration.d.ts +75 -0
  129. package/dist/browser/react/ScrollRestoration.d.ts.map +1 -0
  130. package/dist/browser/react/ScrollRestoration.js +57 -0
  131. package/dist/browser/react/ScrollRestoration.js.map +1 -0
  132. package/dist/browser/react/context.d.ts +46 -0
  133. package/dist/browser/react/context.d.ts.map +1 -0
  134. package/dist/browser/react/context.js +10 -0
  135. package/dist/browser/react/context.js.map +1 -0
  136. package/dist/browser/react/index.d.ts +11 -0
  137. package/dist/browser/react/index.d.ts.map +1 -0
  138. package/dist/browser/react/index.js +22 -0
  139. package/dist/browser/react/index.js.map +1 -0
  140. package/dist/browser/react/location-state-shared.d.ts +63 -0
  141. package/dist/browser/react/location-state-shared.d.ts.map +1 -0
  142. package/dist/browser/react/location-state-shared.js +81 -0
  143. package/dist/browser/react/location-state-shared.js.map +1 -0
  144. package/dist/browser/react/location-state.d.ts +23 -0
  145. package/dist/browser/react/location-state.d.ts.map +1 -0
  146. package/dist/browser/react/location-state.js +29 -0
  147. package/dist/browser/react/location-state.js.map +1 -0
  148. package/dist/browser/react/mount-context.d.ts +24 -0
  149. package/dist/browser/react/mount-context.d.ts.map +1 -0
  150. package/dist/browser/react/mount-context.js +24 -0
  151. package/dist/browser/react/mount-context.js.map +1 -0
  152. package/dist/browser/react/use-action.d.ts +64 -0
  153. package/dist/browser/react/use-action.d.ts.map +1 -0
  154. package/dist/browser/react/use-action.js +134 -0
  155. package/dist/browser/react/use-action.js.map +1 -0
  156. package/dist/browser/react/use-client-cache.d.ts +41 -0
  157. package/dist/browser/react/use-client-cache.d.ts.map +1 -0
  158. package/dist/browser/react/use-client-cache.js +39 -0
  159. package/dist/browser/react/use-client-cache.js.map +1 -0
  160. package/dist/browser/react/use-handle.d.ts +31 -0
  161. package/dist/browser/react/use-handle.d.ts.map +1 -0
  162. package/dist/browser/react/use-handle.js +144 -0
  163. package/dist/browser/react/use-handle.js.map +1 -0
  164. package/dist/browser/react/use-href.d.ts +33 -0
  165. package/dist/browser/react/use-href.d.ts.map +1 -0
  166. package/dist/browser/react/use-href.js +39 -0
  167. package/dist/browser/react/use-href.js.map +1 -0
  168. package/dist/browser/react/use-link-status.d.ts +37 -0
  169. package/dist/browser/react/use-link-status.d.ts.map +1 -0
  170. package/dist/browser/react/use-link-status.js +99 -0
  171. package/dist/browser/react/use-link-status.js.map +1 -0
  172. package/dist/browser/react/use-mount.d.ts +25 -0
  173. package/dist/browser/react/use-mount.d.ts.map +1 -0
  174. package/dist/browser/react/use-mount.js +30 -0
  175. package/dist/browser/react/use-mount.js.map +1 -0
  176. package/dist/browser/react/use-navigation.d.ts +27 -0
  177. package/dist/browser/react/use-navigation.d.ts.map +1 -0
  178. package/dist/browser/react/use-navigation.js +87 -0
  179. package/dist/browser/react/use-navigation.js.map +1 -0
  180. package/dist/browser/react/use-segments.d.ts +38 -0
  181. package/dist/browser/react/use-segments.d.ts.map +1 -0
  182. package/dist/browser/react/use-segments.js +130 -0
  183. package/dist/browser/react/use-segments.js.map +1 -0
  184. package/dist/browser/request-controller.d.ts +26 -0
  185. package/dist/browser/request-controller.d.ts.map +1 -0
  186. package/dist/browser/request-controller.js +147 -0
  187. package/dist/browser/request-controller.js.map +1 -0
  188. package/dist/browser/rsc-router.d.ts +129 -0
  189. package/dist/browser/rsc-router.d.ts.map +1 -0
  190. package/dist/browser/rsc-router.js +195 -0
  191. package/dist/browser/rsc-router.js.map +1 -0
  192. package/dist/browser/scroll-restoration.d.ts +93 -0
  193. package/dist/browser/scroll-restoration.d.ts.map +1 -0
  194. package/dist/browser/scroll-restoration.js +321 -0
  195. package/dist/browser/scroll-restoration.js.map +1 -0
  196. package/dist/browser/segment-structure-assert.d.ts +17 -0
  197. package/dist/browser/segment-structure-assert.d.ts.map +1 -0
  198. package/dist/browser/segment-structure-assert.js +59 -0
  199. package/dist/browser/segment-structure-assert.js.map +1 -0
  200. package/dist/browser/server-action-bridge.d.ts +26 -0
  201. package/dist/browser/server-action-bridge.d.ts.map +1 -0
  202. package/dist/browser/server-action-bridge.js +668 -0
  203. package/dist/browser/server-action-bridge.js.map +1 -0
  204. package/dist/browser/shallow.d.ts +12 -0
  205. package/dist/browser/shallow.d.ts.map +1 -0
  206. package/dist/browser/shallow.js +34 -0
  207. package/dist/browser/shallow.js.map +1 -0
  208. package/dist/browser/types.d.ts +369 -0
  209. package/dist/browser/types.d.ts.map +1 -0
  210. package/dist/browser/types.js +2 -0
  211. package/dist/browser/types.js.map +1 -0
  212. package/dist/build/__tests__/generate-cli.test.d.ts +2 -0
  213. package/dist/build/__tests__/generate-cli.test.d.ts.map +1 -0
  214. package/dist/build/__tests__/generate-cli.test.js +237 -0
  215. package/dist/build/__tests__/generate-cli.test.js.map +1 -0
  216. package/dist/build/__tests__/generate-manifest.test.d.ts +2 -0
  217. package/dist/build/__tests__/generate-manifest.test.d.ts.map +1 -0
  218. package/dist/build/__tests__/generate-manifest.test.js +119 -0
  219. package/dist/build/__tests__/generate-manifest.test.js.map +1 -0
  220. package/dist/build/__tests__/generate-route-types.test.d.ts +2 -0
  221. package/dist/build/__tests__/generate-route-types.test.d.ts.map +1 -0
  222. package/dist/build/__tests__/generate-route-types.test.js +620 -0
  223. package/dist/build/__tests__/generate-route-types.test.js.map +1 -0
  224. package/dist/build/__tests__/per-router-manifest.test.d.ts +2 -0
  225. package/dist/build/__tests__/per-router-manifest.test.d.ts.map +1 -0
  226. package/dist/build/__tests__/per-router-manifest.test.js +308 -0
  227. package/dist/build/__tests__/per-router-manifest.test.js.map +1 -0
  228. package/dist/build/generate-manifest.d.ts +81 -0
  229. package/dist/build/generate-manifest.d.ts.map +1 -0
  230. package/dist/build/generate-manifest.js +276 -0
  231. package/dist/build/generate-manifest.js.map +1 -0
  232. package/dist/build/generate-route-types.d.ts +115 -0
  233. package/dist/build/generate-route-types.d.ts.map +1 -0
  234. package/dist/build/generate-route-types.js +740 -0
  235. package/dist/build/generate-route-types.js.map +1 -0
  236. package/dist/build/index.d.ts +21 -0
  237. package/dist/build/index.d.ts.map +1 -0
  238. package/dist/build/index.js +21 -0
  239. package/dist/build/index.js.map +1 -0
  240. package/dist/build/route-trie.d.ts +71 -0
  241. package/dist/build/route-trie.d.ts.map +1 -0
  242. package/dist/build/route-trie.js +175 -0
  243. package/dist/build/route-trie.js.map +1 -0
  244. package/dist/cache/__tests__/cache-scope.test.d.ts +2 -0
  245. package/dist/cache/__tests__/cache-scope.test.d.ts.map +1 -0
  246. package/dist/cache/__tests__/cache-scope.test.js +208 -0
  247. package/dist/cache/__tests__/cache-scope.test.js.map +1 -0
  248. package/dist/cache/__tests__/document-cache.test.d.ts +2 -0
  249. package/dist/cache/__tests__/document-cache.test.d.ts.map +1 -0
  250. package/dist/cache/__tests__/document-cache.test.js +345 -0
  251. package/dist/cache/__tests__/document-cache.test.js.map +1 -0
  252. package/dist/cache/__tests__/memory-segment-store.test.d.ts +2 -0
  253. package/dist/cache/__tests__/memory-segment-store.test.d.ts.map +1 -0
  254. package/dist/cache/__tests__/memory-segment-store.test.js +425 -0
  255. package/dist/cache/__tests__/memory-segment-store.test.js.map +1 -0
  256. package/dist/cache/__tests__/memory-store.test.d.ts +2 -0
  257. package/dist/cache/__tests__/memory-store.test.d.ts.map +1 -0
  258. package/dist/cache/__tests__/memory-store.test.js +367 -0
  259. package/dist/cache/__tests__/memory-store.test.js.map +1 -0
  260. package/dist/cache/cache-scope.d.ts +102 -0
  261. package/dist/cache/cache-scope.d.ts.map +1 -0
  262. package/dist/cache/cache-scope.js +440 -0
  263. package/dist/cache/cache-scope.js.map +1 -0
  264. package/dist/cache/cf/__tests__/cf-cache-store.test.d.ts +2 -0
  265. package/dist/cache/cf/__tests__/cf-cache-store.test.d.ts.map +1 -0
  266. package/dist/cache/cf/__tests__/cf-cache-store.test.js +330 -0
  267. package/dist/cache/cf/__tests__/cf-cache-store.test.js.map +1 -0
  268. package/dist/cache/cf/cf-cache-store.d.ts +165 -0
  269. package/dist/cache/cf/cf-cache-store.d.ts.map +1 -0
  270. package/dist/cache/cf/cf-cache-store.js +242 -0
  271. package/dist/cache/cf/cf-cache-store.js.map +1 -0
  272. package/dist/cache/cf/index.d.ts +14 -0
  273. package/dist/cache/cf/index.d.ts.map +1 -0
  274. package/dist/cache/cf/index.js +17 -0
  275. package/dist/cache/cf/index.js.map +1 -0
  276. package/dist/cache/document-cache.d.ts +64 -0
  277. package/dist/cache/document-cache.d.ts.map +1 -0
  278. package/dist/cache/document-cache.js +228 -0
  279. package/dist/cache/document-cache.js.map +1 -0
  280. package/dist/cache/index.d.ts +19 -0
  281. package/dist/cache/index.d.ts.map +1 -0
  282. package/dist/cache/index.js +21 -0
  283. package/dist/cache/index.js.map +1 -0
  284. package/dist/cache/memory-segment-store.d.ts +110 -0
  285. package/dist/cache/memory-segment-store.d.ts.map +1 -0
  286. package/dist/cache/memory-segment-store.js +117 -0
  287. package/dist/cache/memory-segment-store.js.map +1 -0
  288. package/dist/cache/memory-store.d.ts +41 -0
  289. package/dist/cache/memory-store.d.ts.map +1 -0
  290. package/dist/cache/memory-store.js +191 -0
  291. package/dist/cache/memory-store.js.map +1 -0
  292. package/dist/cache/types.d.ts +317 -0
  293. package/dist/cache/types.d.ts.map +1 -0
  294. package/dist/cache/types.js +12 -0
  295. package/dist/cache/types.js.map +1 -0
  296. package/dist/client.d.ts +248 -0
  297. package/dist/client.d.ts.map +1 -0
  298. package/dist/client.js +367 -0
  299. package/dist/client.js.map +1 -0
  300. package/dist/client.rsc.d.ts +26 -0
  301. package/dist/client.rsc.d.ts.map +1 -0
  302. package/dist/client.rsc.js +46 -0
  303. package/dist/client.rsc.js.map +1 -0
  304. package/dist/component-utils.d.ts +36 -0
  305. package/dist/component-utils.d.ts.map +1 -0
  306. package/dist/component-utils.js +61 -0
  307. package/dist/component-utils.js.map +1 -0
  308. package/dist/components/DefaultDocument.d.ts +13 -0
  309. package/dist/components/DefaultDocument.d.ts.map +1 -0
  310. package/dist/components/DefaultDocument.js +15 -0
  311. package/dist/components/DefaultDocument.js.map +1 -0
  312. package/dist/debug.d.ts +58 -0
  313. package/dist/debug.d.ts.map +1 -0
  314. package/dist/debug.js +157 -0
  315. package/dist/debug.js.map +1 -0
  316. package/dist/default-error-boundary.d.ts +11 -0
  317. package/dist/default-error-boundary.d.ts.map +1 -0
  318. package/dist/default-error-boundary.js +45 -0
  319. package/dist/default-error-boundary.js.map +1 -0
  320. package/dist/deps/browser.d.ts +2 -0
  321. package/dist/deps/browser.d.ts.map +1 -0
  322. package/dist/deps/browser.js +3 -0
  323. package/dist/deps/browser.js.map +1 -0
  324. package/dist/deps/html-stream-client.d.ts +2 -0
  325. package/dist/deps/html-stream-client.d.ts.map +1 -0
  326. package/dist/deps/html-stream-client.js +3 -0
  327. package/dist/deps/html-stream-client.js.map +1 -0
  328. package/dist/deps/html-stream-server.d.ts +2 -0
  329. package/dist/deps/html-stream-server.d.ts.map +1 -0
  330. package/dist/deps/html-stream-server.js +3 -0
  331. package/dist/deps/html-stream-server.js.map +1 -0
  332. package/dist/deps/rsc.d.ts +2 -0
  333. package/dist/deps/rsc.d.ts.map +1 -0
  334. package/dist/deps/rsc.js +4 -0
  335. package/dist/deps/rsc.js.map +1 -0
  336. package/dist/deps/ssr.d.ts +2 -0
  337. package/dist/deps/ssr.d.ts.map +1 -0
  338. package/dist/deps/ssr.js +3 -0
  339. package/dist/deps/ssr.js.map +1 -0
  340. package/dist/errors.d.ts +174 -0
  341. package/dist/errors.d.ts.map +1 -0
  342. package/dist/errors.js +241 -0
  343. package/dist/errors.js.map +1 -0
  344. package/dist/handle.d.ts +78 -0
  345. package/dist/handle.d.ts.map +1 -0
  346. package/dist/handle.js +82 -0
  347. package/dist/handle.js.map +1 -0
  348. package/dist/handles/MetaTags.d.ts +14 -0
  349. package/dist/handles/MetaTags.d.ts.map +1 -0
  350. package/dist/handles/MetaTags.js +136 -0
  351. package/dist/handles/MetaTags.js.map +1 -0
  352. package/dist/handles/index.d.ts +6 -0
  353. package/dist/handles/index.d.ts.map +1 -0
  354. package/dist/handles/index.js +6 -0
  355. package/dist/handles/index.js.map +1 -0
  356. package/dist/handles/meta.d.ts +39 -0
  357. package/dist/handles/meta.d.ts.map +1 -0
  358. package/dist/handles/meta.js +202 -0
  359. package/dist/handles/meta.js.map +1 -0
  360. package/dist/host/__tests__/errors.test.d.ts +2 -0
  361. package/dist/host/__tests__/errors.test.d.ts.map +1 -0
  362. package/dist/host/__tests__/errors.test.js +76 -0
  363. package/dist/host/__tests__/errors.test.js.map +1 -0
  364. package/dist/host/__tests__/pattern-comprehensive.test.d.ts +2 -0
  365. package/dist/host/__tests__/pattern-comprehensive.test.d.ts.map +1 -0
  366. package/dist/host/__tests__/pattern-comprehensive.test.js +732 -0
  367. package/dist/host/__tests__/pattern-comprehensive.test.js.map +1 -0
  368. package/dist/host/__tests__/pattern-matcher.test.d.ts +2 -0
  369. package/dist/host/__tests__/pattern-matcher.test.d.ts.map +1 -0
  370. package/dist/host/__tests__/pattern-matcher.test.js +251 -0
  371. package/dist/host/__tests__/pattern-matcher.test.js.map +1 -0
  372. package/dist/host/__tests__/router.test.d.ts +2 -0
  373. package/dist/host/__tests__/router.test.d.ts.map +1 -0
  374. package/dist/host/__tests__/router.test.js +241 -0
  375. package/dist/host/__tests__/router.test.js.map +1 -0
  376. package/dist/host/__tests__/testing.test.d.ts +2 -0
  377. package/dist/host/__tests__/testing.test.d.ts.map +1 -0
  378. package/dist/host/__tests__/testing.test.js +64 -0
  379. package/dist/host/__tests__/testing.test.js.map +1 -0
  380. package/dist/host/__tests__/utils.test.d.ts +2 -0
  381. package/dist/host/__tests__/utils.test.d.ts.map +1 -0
  382. package/dist/host/__tests__/utils.test.js +29 -0
  383. package/dist/host/__tests__/utils.test.js.map +1 -0
  384. package/dist/host/cookie-handler.d.ts +34 -0
  385. package/dist/host/cookie-handler.d.ts.map +1 -0
  386. package/dist/host/cookie-handler.js +124 -0
  387. package/dist/host/cookie-handler.js.map +1 -0
  388. package/dist/host/errors.d.ts +56 -0
  389. package/dist/host/errors.d.ts.map +1 -0
  390. package/dist/host/errors.js +79 -0
  391. package/dist/host/errors.js.map +1 -0
  392. package/dist/host/index.d.ts +29 -0
  393. package/dist/host/index.d.ts.map +1 -0
  394. package/dist/host/index.js +32 -0
  395. package/dist/host/index.js.map +1 -0
  396. package/dist/host/pattern-matcher.d.ts +36 -0
  397. package/dist/host/pattern-matcher.d.ts.map +1 -0
  398. package/dist/host/pattern-matcher.js +172 -0
  399. package/dist/host/pattern-matcher.js.map +1 -0
  400. package/dist/host/router.d.ts +26 -0
  401. package/dist/host/router.d.ts.map +1 -0
  402. package/dist/host/router.js +218 -0
  403. package/dist/host/router.js.map +1 -0
  404. package/dist/host/testing.d.ts +36 -0
  405. package/dist/host/testing.d.ts.map +1 -0
  406. package/dist/host/testing.js +55 -0
  407. package/dist/host/testing.js.map +1 -0
  408. package/dist/host/types.d.ts +115 -0
  409. package/dist/host/types.d.ts.map +1 -0
  410. package/dist/host/types.js +7 -0
  411. package/dist/host/types.js.map +1 -0
  412. package/dist/host/utils.d.ts +21 -0
  413. package/dist/host/utils.d.ts.map +1 -0
  414. package/dist/host/utils.js +23 -0
  415. package/dist/host/utils.js.map +1 -0
  416. package/dist/href-client.d.ts +131 -0
  417. package/dist/href-client.d.ts.map +1 -0
  418. package/dist/href-client.js +64 -0
  419. package/dist/href-client.js.map +1 -0
  420. package/dist/href-context.d.ts +29 -0
  421. package/dist/href-context.d.ts.map +1 -0
  422. package/dist/href-context.js +21 -0
  423. package/dist/href-context.js.map +1 -0
  424. package/dist/index.d.ts +73 -0
  425. package/dist/index.d.ts.map +1 -0
  426. package/dist/index.js +91 -0
  427. package/dist/index.js.map +1 -0
  428. package/dist/index.rsc.d.ts +32 -0
  429. package/dist/index.rsc.d.ts.map +1 -0
  430. package/dist/index.rsc.js +40 -0
  431. package/dist/index.rsc.js.map +1 -0
  432. package/dist/internal-debug.d.ts +2 -0
  433. package/dist/internal-debug.d.ts.map +1 -0
  434. package/dist/internal-debug.js +5 -0
  435. package/dist/internal-debug.js.map +1 -0
  436. package/dist/loader.d.ts +14 -0
  437. package/dist/loader.d.ts.map +1 -0
  438. package/dist/loader.js +20 -0
  439. package/dist/loader.js.map +1 -0
  440. package/dist/loader.rsc.d.ts +19 -0
  441. package/dist/loader.rsc.d.ts.map +1 -0
  442. package/dist/loader.rsc.js +99 -0
  443. package/dist/loader.rsc.js.map +1 -0
  444. package/dist/network-error-thrower.d.ts +17 -0
  445. package/dist/network-error-thrower.d.ts.map +1 -0
  446. package/dist/network-error-thrower.js +14 -0
  447. package/dist/network-error-thrower.js.map +1 -0
  448. package/dist/outlet-context.d.ts +13 -0
  449. package/dist/outlet-context.d.ts.map +1 -0
  450. package/dist/outlet-context.js +3 -0
  451. package/dist/outlet-context.js.map +1 -0
  452. package/dist/prerender/__tests__/param-hash.test.d.ts +2 -0
  453. package/dist/prerender/__tests__/param-hash.test.d.ts.map +1 -0
  454. package/dist/prerender/__tests__/param-hash.test.js +148 -0
  455. package/dist/prerender/__tests__/param-hash.test.js.map +1 -0
  456. package/dist/prerender/param-hash.d.ts +16 -0
  457. package/dist/prerender/param-hash.d.ts.map +1 -0
  458. package/dist/prerender/param-hash.js +36 -0
  459. package/dist/prerender/param-hash.js.map +1 -0
  460. package/dist/prerender/store.d.ts +38 -0
  461. package/dist/prerender/store.d.ts.map +1 -0
  462. package/dist/prerender/store.js +61 -0
  463. package/dist/prerender/store.js.map +1 -0
  464. package/dist/prerender.d.ts +66 -0
  465. package/dist/prerender.d.ts.map +1 -0
  466. package/dist/prerender.js +57 -0
  467. package/dist/prerender.js.map +1 -0
  468. package/dist/reverse.d.ts +196 -0
  469. package/dist/reverse.d.ts.map +1 -0
  470. package/dist/reverse.js +78 -0
  471. package/dist/reverse.js.map +1 -0
  472. package/dist/root-error-boundary.d.ts +33 -0
  473. package/dist/root-error-boundary.d.ts.map +1 -0
  474. package/dist/root-error-boundary.js +165 -0
  475. package/dist/root-error-boundary.js.map +1 -0
  476. package/dist/route-content-wrapper.d.ts +46 -0
  477. package/dist/route-content-wrapper.d.ts.map +1 -0
  478. package/dist/route-content-wrapper.js +77 -0
  479. package/dist/route-content-wrapper.js.map +1 -0
  480. package/dist/route-definition.d.ts +421 -0
  481. package/dist/route-definition.d.ts.map +1 -0
  482. package/dist/route-definition.js +868 -0
  483. package/dist/route-definition.js.map +1 -0
  484. package/dist/route-map-builder.d.ts +155 -0
  485. package/dist/route-map-builder.d.ts.map +1 -0
  486. package/dist/route-map-builder.js +237 -0
  487. package/dist/route-map-builder.js.map +1 -0
  488. package/dist/route-types.d.ts +165 -0
  489. package/dist/route-types.d.ts.map +1 -0
  490. package/dist/route-types.js +7 -0
  491. package/dist/route-types.js.map +1 -0
  492. package/dist/router/__tests__/handler-context.test.d.ts +2 -0
  493. package/dist/router/__tests__/handler-context.test.d.ts.map +1 -0
  494. package/dist/router/__tests__/handler-context.test.js +65 -0
  495. package/dist/router/__tests__/handler-context.test.js.map +1 -0
  496. package/dist/router/__tests__/loader-cycle-detection.test.d.ts +2 -0
  497. package/dist/router/__tests__/loader-cycle-detection.test.d.ts.map +1 -0
  498. package/dist/router/__tests__/loader-cycle-detection.test.js +221 -0
  499. package/dist/router/__tests__/loader-cycle-detection.test.js.map +1 -0
  500. package/dist/router/__tests__/match-context.test.d.ts +2 -0
  501. package/dist/router/__tests__/match-context.test.d.ts.map +1 -0
  502. package/dist/router/__tests__/match-context.test.js +92 -0
  503. package/dist/router/__tests__/match-context.test.js.map +1 -0
  504. package/dist/router/__tests__/match-pipelines.test.d.ts +2 -0
  505. package/dist/router/__tests__/match-pipelines.test.d.ts.map +1 -0
  506. package/dist/router/__tests__/match-pipelines.test.js +417 -0
  507. package/dist/router/__tests__/match-pipelines.test.js.map +1 -0
  508. package/dist/router/__tests__/match-result.test.d.ts +2 -0
  509. package/dist/router/__tests__/match-result.test.d.ts.map +1 -0
  510. package/dist/router/__tests__/match-result.test.js +457 -0
  511. package/dist/router/__tests__/match-result.test.js.map +1 -0
  512. package/dist/router/__tests__/on-error.test.d.ts +2 -0
  513. package/dist/router/__tests__/on-error.test.d.ts.map +1 -0
  514. package/dist/router/__tests__/on-error.test.js +678 -0
  515. package/dist/router/__tests__/on-error.test.js.map +1 -0
  516. package/dist/router/__tests__/pattern-matching.test.d.ts +2 -0
  517. package/dist/router/__tests__/pattern-matching.test.d.ts.map +1 -0
  518. package/dist/router/__tests__/pattern-matching.test.js +629 -0
  519. package/dist/router/__tests__/pattern-matching.test.js.map +1 -0
  520. package/dist/router/__tests__/segment-resolution-parallel-loading.test.d.ts +2 -0
  521. package/dist/router/__tests__/segment-resolution-parallel-loading.test.d.ts.map +1 -0
  522. package/dist/router/__tests__/segment-resolution-parallel-loading.test.js +155 -0
  523. package/dist/router/__tests__/segment-resolution-parallel-loading.test.js.map +1 -0
  524. package/dist/router/error-handling.d.ts +77 -0
  525. package/dist/router/error-handling.d.ts.map +1 -0
  526. package/dist/router/error-handling.js +202 -0
  527. package/dist/router/error-handling.js.map +1 -0
  528. package/dist/router/handler-context.d.ts +20 -0
  529. package/dist/router/handler-context.d.ts.map +1 -0
  530. package/dist/router/handler-context.js +198 -0
  531. package/dist/router/handler-context.js.map +1 -0
  532. package/dist/router/intercept-resolution.d.ts +66 -0
  533. package/dist/router/intercept-resolution.d.ts.map +1 -0
  534. package/dist/router/intercept-resolution.js +246 -0
  535. package/dist/router/intercept-resolution.js.map +1 -0
  536. package/dist/router/loader-resolution.d.ts +64 -0
  537. package/dist/router/loader-resolution.d.ts.map +1 -0
  538. package/dist/router/loader-resolution.js +284 -0
  539. package/dist/router/loader-resolution.js.map +1 -0
  540. package/dist/router/logging.d.ts +15 -0
  541. package/dist/router/logging.d.ts.map +1 -0
  542. package/dist/router/logging.js +99 -0
  543. package/dist/router/logging.js.map +1 -0
  544. package/dist/router/manifest.d.ts +22 -0
  545. package/dist/router/manifest.d.ts.map +1 -0
  546. package/dist/router/manifest.js +181 -0
  547. package/dist/router/manifest.js.map +1 -0
  548. package/dist/router/match-api.d.ts +35 -0
  549. package/dist/router/match-api.d.ts.map +1 -0
  550. package/dist/router/match-api.js +406 -0
  551. package/dist/router/match-api.js.map +1 -0
  552. package/dist/router/match-context.d.ts +206 -0
  553. package/dist/router/match-context.d.ts.map +1 -0
  554. package/dist/router/match-context.js +17 -0
  555. package/dist/router/match-context.js.map +1 -0
  556. package/dist/router/match-middleware/background-revalidation.d.ts +127 -0
  557. package/dist/router/match-middleware/background-revalidation.d.ts.map +1 -0
  558. package/dist/router/match-middleware/background-revalidation.js +75 -0
  559. package/dist/router/match-middleware/background-revalidation.js.map +1 -0
  560. package/dist/router/match-middleware/cache-lookup.d.ts +112 -0
  561. package/dist/router/match-middleware/cache-lookup.d.ts.map +1 -0
  562. package/dist/router/match-middleware/cache-lookup.js +257 -0
  563. package/dist/router/match-middleware/cache-lookup.js.map +1 -0
  564. package/dist/router/match-middleware/cache-store.d.ts +113 -0
  565. package/dist/router/match-middleware/cache-store.d.ts.map +1 -0
  566. package/dist/router/match-middleware/cache-store.js +108 -0
  567. package/dist/router/match-middleware/cache-store.js.map +1 -0
  568. package/dist/router/match-middleware/index.d.ts +81 -0
  569. package/dist/router/match-middleware/index.d.ts.map +1 -0
  570. package/dist/router/match-middleware/index.js +80 -0
  571. package/dist/router/match-middleware/index.js.map +1 -0
  572. package/dist/router/match-middleware/intercept-resolution.d.ts +117 -0
  573. package/dist/router/match-middleware/intercept-resolution.d.ts.map +1 -0
  574. package/dist/router/match-middleware/intercept-resolution.js +134 -0
  575. package/dist/router/match-middleware/intercept-resolution.js.map +1 -0
  576. package/dist/router/match-middleware/segment-resolution.d.ts +99 -0
  577. package/dist/router/match-middleware/segment-resolution.d.ts.map +1 -0
  578. package/dist/router/match-middleware/segment-resolution.js +53 -0
  579. package/dist/router/match-middleware/segment-resolution.js.map +1 -0
  580. package/dist/router/match-pipelines.d.ts +147 -0
  581. package/dist/router/match-pipelines.d.ts.map +1 -0
  582. package/dist/router/match-pipelines.js +82 -0
  583. package/dist/router/match-pipelines.js.map +1 -0
  584. package/dist/router/match-result.d.ts +126 -0
  585. package/dist/router/match-result.d.ts.map +1 -0
  586. package/dist/router/match-result.js +93 -0
  587. package/dist/router/match-result.js.map +1 -0
  588. package/dist/router/metrics.d.ts +20 -0
  589. package/dist/router/metrics.d.ts.map +1 -0
  590. package/dist/router/metrics.js +47 -0
  591. package/dist/router/metrics.js.map +1 -0
  592. package/dist/router/middleware.d.ts +249 -0
  593. package/dist/router/middleware.d.ts.map +1 -0
  594. package/dist/router/middleware.js +434 -0
  595. package/dist/router/middleware.js.map +1 -0
  596. package/dist/router/middleware.test.d.ts +2 -0
  597. package/dist/router/middleware.test.d.ts.map +1 -0
  598. package/dist/router/middleware.test.js +816 -0
  599. package/dist/router/middleware.test.js.map +1 -0
  600. package/dist/router/pattern-matching.d.ts +149 -0
  601. package/dist/router/pattern-matching.d.ts.map +1 -0
  602. package/dist/router/pattern-matching.js +349 -0
  603. package/dist/router/pattern-matching.js.map +1 -0
  604. package/dist/router/revalidation.d.ts +44 -0
  605. package/dist/router/revalidation.d.ts.map +1 -0
  606. package/dist/router/revalidation.js +147 -0
  607. package/dist/router/revalidation.js.map +1 -0
  608. package/dist/router/router-context.d.ts +135 -0
  609. package/dist/router/router-context.d.ts.map +1 -0
  610. package/dist/router/router-context.js +36 -0
  611. package/dist/router/router-context.js.map +1 -0
  612. package/dist/router/segment-resolution.d.ts +127 -0
  613. package/dist/router/segment-resolution.d.ts.map +1 -0
  614. package/dist/router/segment-resolution.js +919 -0
  615. package/dist/router/segment-resolution.js.map +1 -0
  616. package/dist/router/trie-matching.d.ts +40 -0
  617. package/dist/router/trie-matching.d.ts.map +1 -0
  618. package/dist/router/trie-matching.js +127 -0
  619. package/dist/router/trie-matching.js.map +1 -0
  620. package/dist/router/types.d.ts +136 -0
  621. package/dist/router/types.d.ts.map +1 -0
  622. package/dist/router/types.js +7 -0
  623. package/dist/router/types.js.map +1 -0
  624. package/dist/router.d.ts +753 -0
  625. package/dist/router.d.ts.map +1 -0
  626. package/dist/router.gen.d.ts +6 -0
  627. package/dist/router.gen.d.ts.map +1 -0
  628. package/dist/router.gen.js +6 -0
  629. package/dist/router.gen.js.map +1 -0
  630. package/dist/router.js +1304 -0
  631. package/dist/router.js.map +1 -0
  632. package/dist/rsc/__tests__/helpers.test.d.ts +2 -0
  633. package/dist/rsc/__tests__/helpers.test.d.ts.map +1 -0
  634. package/dist/rsc/__tests__/helpers.test.js +140 -0
  635. package/dist/rsc/__tests__/helpers.test.js.map +1 -0
  636. package/dist/rsc/handler.d.ts +45 -0
  637. package/dist/rsc/handler.d.ts.map +1 -0
  638. package/dist/rsc/handler.js +1172 -0
  639. package/dist/rsc/handler.js.map +1 -0
  640. package/dist/rsc/helpers.d.ts +16 -0
  641. package/dist/rsc/helpers.d.ts.map +1 -0
  642. package/dist/rsc/helpers.js +55 -0
  643. package/dist/rsc/helpers.js.map +1 -0
  644. package/dist/rsc/index.d.ts +22 -0
  645. package/dist/rsc/index.d.ts.map +1 -0
  646. package/dist/rsc/index.js +23 -0
  647. package/dist/rsc/index.js.map +1 -0
  648. package/dist/rsc/nonce.d.ts +9 -0
  649. package/dist/rsc/nonce.d.ts.map +1 -0
  650. package/dist/rsc/nonce.js +18 -0
  651. package/dist/rsc/nonce.js.map +1 -0
  652. package/dist/rsc/types.d.ts +206 -0
  653. package/dist/rsc/types.d.ts.map +1 -0
  654. package/dist/rsc/types.js +8 -0
  655. package/dist/rsc/types.js.map +1 -0
  656. package/dist/search-params.d.ts +103 -0
  657. package/dist/search-params.d.ts.map +1 -0
  658. package/dist/search-params.js +74 -0
  659. package/dist/search-params.js.map +1 -0
  660. package/dist/segment-system.d.ts +75 -0
  661. package/dist/segment-system.d.ts.map +1 -0
  662. package/dist/segment-system.js +336 -0
  663. package/dist/segment-system.js.map +1 -0
  664. package/dist/server/context.d.ts +245 -0
  665. package/dist/server/context.d.ts.map +1 -0
  666. package/dist/server/context.js +197 -0
  667. package/dist/server/context.js.map +1 -0
  668. package/dist/server/fetchable-loader-store.d.ts +18 -0
  669. package/dist/server/fetchable-loader-store.d.ts.map +1 -0
  670. package/dist/server/fetchable-loader-store.js +18 -0
  671. package/dist/server/fetchable-loader-store.js.map +1 -0
  672. package/dist/server/handle-store.d.ts +85 -0
  673. package/dist/server/handle-store.d.ts.map +1 -0
  674. package/dist/server/handle-store.js +142 -0
  675. package/dist/server/handle-store.js.map +1 -0
  676. package/dist/server/loader-registry.d.ts +55 -0
  677. package/dist/server/loader-registry.d.ts.map +1 -0
  678. package/dist/server/loader-registry.js +132 -0
  679. package/dist/server/loader-registry.js.map +1 -0
  680. package/dist/server/request-context.d.ts +226 -0
  681. package/dist/server/request-context.d.ts.map +1 -0
  682. package/dist/server/request-context.js +290 -0
  683. package/dist/server/request-context.js.map +1 -0
  684. package/dist/server/root-layout.d.ts +4 -0
  685. package/dist/server/root-layout.d.ts.map +1 -0
  686. package/dist/server/root-layout.js +5 -0
  687. package/dist/server/root-layout.js.map +1 -0
  688. package/dist/server.d.ts +15 -0
  689. package/dist/server.d.ts.map +1 -0
  690. package/dist/server.js +20 -0
  691. package/dist/server.js.map +1 -0
  692. package/dist/ssr/__tests__/ssr-handler.test.d.ts +2 -0
  693. package/dist/ssr/__tests__/ssr-handler.test.d.ts.map +1 -0
  694. package/dist/ssr/__tests__/ssr-handler.test.js +132 -0
  695. package/dist/ssr/__tests__/ssr-handler.test.js.map +1 -0
  696. package/dist/ssr/index.d.ts +98 -0
  697. package/dist/ssr/index.d.ts.map +1 -0
  698. package/dist/ssr/index.js +158 -0
  699. package/dist/ssr/index.js.map +1 -0
  700. package/dist/static-handler.d.ts +50 -0
  701. package/dist/static-handler.d.ts.map +1 -0
  702. package/dist/static-handler.gen.d.ts +5 -0
  703. package/dist/static-handler.gen.d.ts.map +1 -0
  704. package/dist/static-handler.gen.js +5 -0
  705. package/dist/static-handler.gen.js.map +1 -0
  706. package/dist/static-handler.js +29 -0
  707. package/dist/static-handler.js.map +1 -0
  708. package/dist/testing/vitest.js +82 -0
  709. package/dist/theme/ThemeProvider.d.ts +20 -0
  710. package/dist/theme/ThemeProvider.d.ts.map +1 -0
  711. package/dist/theme/ThemeProvider.js +240 -0
  712. package/dist/theme/ThemeProvider.js.map +1 -0
  713. package/dist/theme/ThemeScript.d.ts +48 -0
  714. package/dist/theme/ThemeScript.d.ts.map +1 -0
  715. package/dist/theme/ThemeScript.js +13 -0
  716. package/dist/theme/ThemeScript.js.map +1 -0
  717. package/dist/theme/__tests__/theme.test.d.ts +2 -0
  718. package/dist/theme/__tests__/theme.test.d.ts.map +1 -0
  719. package/dist/theme/__tests__/theme.test.js +103 -0
  720. package/dist/theme/__tests__/theme.test.js.map +1 -0
  721. package/dist/theme/constants.d.ts +29 -0
  722. package/dist/theme/constants.d.ts.map +1 -0
  723. package/dist/theme/constants.js +48 -0
  724. package/dist/theme/constants.js.map +1 -0
  725. package/dist/theme/index.d.ts +31 -0
  726. package/dist/theme/index.d.ts.map +1 -0
  727. package/dist/theme/index.js +36 -0
  728. package/dist/theme/index.js.map +1 -0
  729. package/dist/theme/theme-context.d.ts +40 -0
  730. package/dist/theme/theme-context.d.ts.map +1 -0
  731. package/dist/theme/theme-context.js +60 -0
  732. package/dist/theme/theme-context.js.map +1 -0
  733. package/dist/theme/theme-script.d.ts +27 -0
  734. package/dist/theme/theme-script.d.ts.map +1 -0
  735. package/dist/theme/theme-script.js +147 -0
  736. package/dist/theme/theme-script.js.map +1 -0
  737. package/dist/theme/types.d.ts +163 -0
  738. package/dist/theme/types.d.ts.map +1 -0
  739. package/dist/theme/types.js +11 -0
  740. package/dist/theme/types.js.map +1 -0
  741. package/dist/theme/use-theme.d.ts +12 -0
  742. package/dist/theme/use-theme.d.ts.map +1 -0
  743. package/dist/theme/use-theme.js +40 -0
  744. package/dist/theme/use-theme.js.map +1 -0
  745. package/dist/types.d.ts +1479 -0
  746. package/dist/types.d.ts.map +1 -0
  747. package/dist/types.js +10 -0
  748. package/dist/types.js.map +1 -0
  749. package/dist/urls.d.ts +441 -0
  750. package/dist/urls.d.ts.map +1 -0
  751. package/dist/urls.gen.d.ts +8 -0
  752. package/dist/urls.gen.d.ts.map +1 -0
  753. package/dist/urls.gen.js +8 -0
  754. package/dist/urls.gen.js.map +1 -0
  755. package/dist/urls.js +443 -0
  756. package/dist/urls.js.map +1 -0
  757. package/dist/use-loader.d.ts +127 -0
  758. package/dist/use-loader.d.ts.map +1 -0
  759. package/dist/use-loader.js +237 -0
  760. package/dist/use-loader.js.map +1 -0
  761. package/dist/vite/__tests__/ast-handler-extract.test.d.ts +2 -0
  762. package/dist/vite/__tests__/ast-handler-extract.test.d.ts.map +1 -0
  763. package/dist/vite/__tests__/ast-handler-extract.test.js +294 -0
  764. package/dist/vite/__tests__/ast-handler-extract.test.js.map +1 -0
  765. package/dist/vite/__tests__/expose-id-utils.test.d.ts +2 -0
  766. package/dist/vite/__tests__/expose-id-utils.test.d.ts.map +1 -0
  767. package/dist/vite/__tests__/expose-id-utils.test.js +224 -0
  768. package/dist/vite/__tests__/expose-id-utils.test.js.map +1 -0
  769. package/dist/vite/__tests__/expose-internal-ids.test.d.ts +2 -0
  770. package/dist/vite/__tests__/expose-internal-ids.test.d.ts.map +1 -0
  771. package/dist/vite/__tests__/expose-internal-ids.test.js +647 -0
  772. package/dist/vite/__tests__/expose-internal-ids.test.js.map +1 -0
  773. package/dist/vite/__tests__/expose-router-id.test.d.ts +2 -0
  774. package/dist/vite/__tests__/expose-router-id.test.d.ts.map +1 -0
  775. package/dist/vite/__tests__/expose-router-id.test.js +39 -0
  776. package/dist/vite/__tests__/expose-router-id.test.js.map +1 -0
  777. package/dist/vite/ast-handler-extract.d.ts +49 -0
  778. package/dist/vite/ast-handler-extract.d.ts.map +1 -0
  779. package/dist/vite/ast-handler-extract.js +249 -0
  780. package/dist/vite/ast-handler-extract.js.map +1 -0
  781. package/dist/vite/expose-action-id.d.ts +19 -0
  782. package/dist/vite/expose-action-id.d.ts.map +1 -0
  783. package/dist/vite/expose-action-id.js +250 -0
  784. package/dist/vite/expose-action-id.js.map +1 -0
  785. package/dist/vite/expose-id-utils.d.ts +69 -0
  786. package/dist/vite/expose-id-utils.d.ts.map +1 -0
  787. package/dist/vite/expose-id-utils.js +289 -0
  788. package/dist/vite/expose-id-utils.js.map +1 -0
  789. package/dist/vite/expose-internal-ids.d.ts +22 -0
  790. package/dist/vite/expose-internal-ids.d.ts.map +1 -0
  791. package/dist/vite/expose-internal-ids.js +886 -0
  792. package/dist/vite/expose-internal-ids.js.map +1 -0
  793. package/dist/vite/index.d.ts +149 -0
  794. package/dist/vite/index.d.ts.map +1 -0
  795. package/dist/vite/index.js +8 -10
  796. package/dist/vite/index.js.bak +5448 -0
  797. package/dist/vite/index.js.map +1 -0
  798. package/dist/vite/index.named-routes.gen.ts +103 -0
  799. package/dist/vite/package-resolution.d.ts +43 -0
  800. package/dist/vite/package-resolution.d.ts.map +1 -0
  801. package/dist/vite/package-resolution.js +112 -0
  802. package/dist/vite/package-resolution.js.map +1 -0
  803. package/dist/vite/virtual-entries.d.ts +25 -0
  804. package/dist/vite/virtual-entries.d.ts.map +1 -0
  805. package/dist/vite/virtual-entries.js +110 -0
  806. package/dist/vite/virtual-entries.js.map +1 -0
  807. package/package.json +18 -17
  808. package/skills/css/SKILL.md +76 -0
  809. package/skills/host-router/SKILL.md +21 -0
  810. package/skills/loader/SKILL.md +17 -17
  811. package/skills/rango/SKILL.md +1 -0
  812. package/skills/tailwind/SKILL.md +27 -3
  813. package/src/browser/app-shell.ts +14 -27
  814. package/src/browser/navigation-bridge.ts +2 -51
  815. package/src/browser/navigation-client.ts +70 -68
  816. package/src/browser/navigation-store.ts +1 -25
  817. package/src/browser/partial-update.ts +19 -32
  818. package/src/browser/prefetch/cache.ts +97 -48
  819. package/src/browser/prefetch/fetch.ts +101 -33
  820. package/src/browser/rango-state.ts +6 -22
  821. package/src/browser/react/NavigationProvider.tsx +12 -9
  822. package/src/browser/react/use-router.ts +4 -3
  823. package/src/browser/response-adapter.ts +27 -1
  824. package/src/browser/rsc-router.tsx +20 -13
  825. package/src/browser/server-action-bridge.ts +21 -0
  826. package/src/browser/types.ts +4 -15
  827. package/src/cache/cache-runtime.ts +17 -5
  828. package/src/cache/cache-scope.ts +23 -7
  829. package/src/cache/cf/cf-cache-store.ts +4 -4
  830. package/src/cache/handle-snapshot.ts +103 -0
  831. package/src/cache/memory-segment-store.ts +3 -2
  832. package/src/cache/types.ts +10 -6
  833. package/src/prerender/store.ts +9 -7
  834. package/src/router/lazy-includes.ts +1 -1
  835. package/src/router/loader-resolution.ts +63 -34
  836. package/src/router/manifest.ts +1 -1
  837. package/src/router/match-middleware/cache-lookup.ts +13 -4
  838. package/src/router/prerender-match.ts +39 -14
  839. package/src/router/request-classification.ts +36 -9
  840. package/src/router/router-interfaces.ts +6 -7
  841. package/src/router/segment-resolution/static-store.ts +19 -5
  842. package/src/rsc/handler.ts +30 -8
  843. package/src/rsc/origin-guard.ts +2 -0
  844. package/src/rsc/response-route-handler.ts +20 -1
  845. package/src/rsc/rsc-rendering.ts +10 -0
  846. package/src/rsc/server-action.ts +16 -2
  847. package/src/server/context.ts +32 -0
  848. package/src/server/request-context.ts +47 -9
  849. package/src/types/loader-types.ts +6 -3
  850. package/src/urls/path-helper-types.ts +6 -0
  851. package/src/vite/discovery/prerender-collection.ts +5 -5
  852. package/src/vite/router-discovery.ts +3 -4
@@ -61,13 +61,6 @@ export interface PartialUpdateConfig {
61
61
  ) => Promise<ReactNode> | ReactNode;
62
62
  /** RSC version getter — returns the current version (may change after HMR) */
63
63
  getVersion?: () => string | undefined;
64
- /**
65
- * Replace the active app-shell when a cross-app navigation is detected.
66
- * Called before the full-update tree replacement renders, so the new
67
- * payload's rootLayout, basename, and version are picked up. Theme,
68
- * warmup, and prefetch TTL are not part of the shell — see AppShell.
69
- */
70
- applyAppShell?: (next: import("./app-shell.js").AppShell) => void;
71
64
  }
72
65
 
73
66
  /**
@@ -137,7 +130,6 @@ export function createPartialUpdater(
137
130
  onUpdate,
138
131
  renderSegments,
139
132
  getVersion = () => undefined,
140
- applyAppShell,
141
133
  } = config;
142
134
 
143
135
  /**
@@ -245,30 +237,25 @@ export function createPartialUpdater(
245
237
  streamingToken.end();
246
238
  });
247
239
 
248
- // Detect app switch: if routerId changed, the navigation crossed into
249
- // a different router (e.g., via host router path mount). Downgrade
250
- // partial to full so the entire tree is replaced without reconciliation
251
- // against stale segments from the previous app, and replace the app
252
- // shell (rootLayout, basename, version) so the target app's document
253
- // and router config take effect instead of remaining captured from the
254
- // initial load. Theme, warmup, and prefetch TTL are intentionally
255
- // document-lifetime (see AppShell doc); a new document navigation
256
- // applies them.
257
- if (payload.metadata?.routerId) {
258
- const prevRouterId = store.getRouterId?.();
259
- if (prevRouterId && prevRouterId !== payload.metadata.routerId) {
260
- debugLog(
261
- `[Browser] App switch detected (${prevRouterId} → ${payload.metadata.routerId}), forcing full update`,
262
- );
263
- payload.metadata.isPartial = false;
264
- applyAppShell?.({
265
- routerId: payload.metadata.routerId,
266
- rootLayout: payload.metadata.rootLayout,
267
- basename: payload.metadata.basename,
268
- version: payload.metadata.version,
269
- });
270
- }
271
- store.setRouterId?.(payload.metadata.routerId);
240
+ // Integrity guard (defense in depth). The server redirects on a cross-app
241
+ // routerId mismatch (X-RSC-Reload), so a partial payload's routerId must
242
+ // match this client's. If it doesn't a stale/edge cache keyed without the
243
+ // routerId, a proxy mixing app responses, or a server classification bug —
244
+ // do NOT splice a foreign app's segments and client references into this
245
+ // document. Force a full reload so the server re-establishes the
246
+ // authoritative document for this URL.
247
+ const currentRouterId = store.getRouterId?.();
248
+ if (
249
+ payload.metadata?.routerId &&
250
+ currentRouterId &&
251
+ payload.metadata.routerId !== currentRouterId
252
+ ) {
253
+ console.error(
254
+ `[rango] Partial response router id "${payload.metadata.routerId}" does not ` +
255
+ `match this client ("${currentRouterId}"); discarding it and reloading to re-sync.`,
256
+ );
257
+ window.location.href = url;
258
+ return;
272
259
  }
273
260
 
274
261
  // Handle server-side redirect with state
@@ -1,8 +1,13 @@
1
1
  /**
2
2
  * Prefetch Cache
3
3
  *
4
- * In-memory cache storing prefetched Response objects for instant cache hits
5
- * on subsequent navigation. Two key scopes are in play:
4
+ * In-memory cache storing eagerly-decoded prefetch payloads for instant,
5
+ * already-warm cache hits on subsequent navigation. A prefetch fetches the
6
+ * RSC partial AND decodes it (createFromFetch) up front — decoding the Flight
7
+ * stream resolves the route's client references, so the route's JS chunks are
8
+ * imported during prefetch rather than on click. The decoded payload is reused
9
+ * verbatim by navigation, so a prefetched click loads no new code. Two key
10
+ * scopes are in play:
6
11
  * - Wildcard (default): built by `buildPrefetchKey(rangoState, target)` —
7
12
  * shape `rangoState\0/target?...`. Shared across all source pages and
8
13
  * invalidated automatically when Rango state bumps (deploy or
@@ -17,8 +22,8 @@
17
22
  * from other pages.
18
23
  *
19
24
  * Also tracks in-flight prefetch promises. Each promise resolves to the
20
- * navigation branch of a tee'd Response, allowing navigation to adopt a
21
- * still-downloading prefetch without reparsing or buffering the body. A
25
+ * decoded prefetch entry (or null), letting navigation adopt a
26
+ * still-downloading prefetch without issuing a duplicate request. A
22
27
  * single promise can be registered under multiple alias keys (see
23
28
  * `setInflightPromiseWithAliases`) so same-source navigations adopt via
24
29
  * their source key while cross-source ones fall through to the wildcard
@@ -30,6 +35,31 @@
30
35
 
31
36
  import { abortAllPrefetches } from "./queue.js";
32
37
  import { invalidateRangoState } from "../rango-state.js";
38
+ import type { RscPayload } from "../types.js";
39
+
40
+ /**
41
+ * A prefetch that has been fetched AND eagerly decoded. Storing the decoded
42
+ * payload (not the raw Response) is what makes a prefetched navigation "warm":
43
+ * decoding the Flight stream during prefetch pulls the route's client chunks,
44
+ * so the click reuses ready elements and loads no new JS.
45
+ */
46
+ export interface DecodedPrefetch {
47
+ /** The eagerly-decoded RSC payload. Reused verbatim by navigation. */
48
+ payload: Promise<RscPayload>;
49
+ /**
50
+ * Resolves when the underlying RSC stream finishes draining. Navigation
51
+ * forwards this as its streamComplete so scroll/revalidation gating is
52
+ * unchanged from the fresh-fetch path.
53
+ */
54
+ streamComplete: Promise<void>;
55
+ /**
56
+ * Prefetch scope as tagged by the server via `X-RSC-Prefetch-Scope`.
57
+ * `"source"` means the response is source-page-sensitive and must not be
58
+ * reused by a navigation from a different page — navigation enforces this
59
+ * when it adopted an inflight entry through the wildcard key.
60
+ */
61
+ scope: "source" | "wildcard";
62
+ }
33
63
 
34
64
  // Default TTL: 5 minutes. Overridden by initPrefetchCache() with
35
65
  // the server-configured prefetchCacheTTL from router options.
@@ -55,7 +85,7 @@ export function isPrefetchCacheDisabled(): boolean {
55
85
  const MAX_PREFETCH_CACHE_SIZE = 50;
56
86
 
57
87
  interface PrefetchCacheEntry {
58
- response: Response;
88
+ entry: DecodedPrefetch;
59
89
  timestamp: number;
60
90
  }
61
91
 
@@ -63,20 +93,37 @@ const cache = new Map<string, PrefetchCacheEntry>();
63
93
  const inflight = new Set<string>();
64
94
 
65
95
  /**
66
- * In-flight promise map. When a prefetch fetch is in progress, its
67
- * Promise<Response | null> is stored here so navigation can await
68
- * it instead of starting a duplicate request.
96
+ * In-flight promise map. When a prefetch fetch+decode is in progress, its
97
+ * Promise<DecodedPrefetch | null> is stored here so navigation can await it
98
+ * instead of starting a duplicate request. Resolves to null when the prefetch
99
+ * failed, was aborted, or carried a control header (reload/redirect) that the
100
+ * navigation must re-fetch to act on.
69
101
  */
70
- const inflightPromises = new Map<string, Promise<Response | null>>();
102
+ const inflightPromises = new Map<string, Promise<DecodedPrefetch | null>>();
71
103
 
72
104
  /**
73
105
  * Alias map for in-flight promises registered under multiple keys (see
74
106
  * dual inflight in prefetch/fetch.ts). Records each key's sibling set so
75
107
  * that consuming or clearing any one key atomically removes every alias —
76
- * guaranteeing a single consumer for the shared Response stream.
108
+ * guaranteeing a single consumer for the shared decode.
77
109
  */
78
110
  const inflightAliases = new Map<string, string[]>();
79
111
 
112
+ /**
113
+ * Keys whose in-flight prefetch promise was adopted by a navigation (via
114
+ * `consumeInflightPrefetch`). A `DecodedPrefetch` carries a single-use
115
+ * `metadata.handles` async generator; the adopter drains it. The same entry is
116
+ * also published to the `cache` map by `storePrefetch` when the fetch resolves
117
+ * — which runs AFTER adoption (adoption only succeeds while the fetch is still
118
+ * in flight, so the entry is not yet cached). Without this guard the adopted,
119
+ * now-drained entry would be left in the cache and served to a later navigation
120
+ * whose handle generator yields nothing, silently dropping that route's
121
+ * breadcrumbs. Recording the adopted keys lets `storePrefetch` skip publishing
122
+ * them, keeping the existing one-time-consumption contract (a consumed prefetch
123
+ * is gone; the next navigation re-fetches).
124
+ */
125
+ const adoptedKeys = new Set<string>();
126
+
80
127
  // Generation counter incremented on each clearPrefetchCache(). Fetches that
81
128
  // started before a clear carry a stale generation and must not store their
82
129
  // response (the data may be stale due to a server action invalidation).
@@ -152,14 +199,14 @@ export function hasPrefetch(key: string): boolean {
152
199
  }
153
200
 
154
201
  /**
155
- * Consume a cached prefetch response. Returns null if not found or expired.
156
- * One-time consumption: the entry is deleted after retrieval.
202
+ * Consume a cached, eagerly-decoded prefetch. Returns null if not found or
203
+ * expired. One-time consumption: the entry is deleted after retrieval.
157
204
  * Returns null when caching is disabled (TTL <= 0).
158
205
  *
159
206
  * Does NOT check in-flight prefetches — use consumeInflightPrefetch()
160
- * for that (returns a Promise instead of a Response).
207
+ * for that (returns a Promise instead of a resolved entry).
161
208
  */
162
- export function consumePrefetch(key: string): Response | null {
209
+ export function consumePrefetch(key: string): DecodedPrefetch | null {
163
210
  if (cacheTTL <= 0) return null;
164
211
  const entry = cache.get(key);
165
212
  if (!entry) return null;
@@ -168,13 +215,14 @@ export function consumePrefetch(key: string): Response | null {
168
215
  return null;
169
216
  }
170
217
  cache.delete(key);
171
- return entry.response;
218
+ return entry.entry;
172
219
  }
173
220
 
174
221
  /**
175
222
  * Consume an in-flight prefetch promise. Returns null if no prefetch is
176
- * in-flight for this key. The returned Promise resolves to the buffered
177
- * Response (or null if the fetch failed/was aborted).
223
+ * in-flight for this key. The returned Promise resolves to the decoded
224
+ * prefetch entry (or null if the fetch failed/was aborted, or carried a
225
+ * control header the navigation must re-fetch to honor).
178
226
  *
179
227
  * One-time consumption: the promise entry is removed (along with any
180
228
  * sibling aliases registered via `setInflightPromiseWithAliases`) so a
@@ -188,38 +236,51 @@ export function consumePrefetch(key: string): Response | null {
188
236
  */
189
237
  export function consumeInflightPrefetch(
190
238
  key: string,
191
- ): Promise<Response | null> | null {
239
+ ): Promise<DecodedPrefetch | null> | null {
192
240
  const promise = inflightPromises.get(key);
193
241
  if (!promise) return null;
194
242
  // Remove the promise under every alias so a second consumer cannot
195
- // adopt the same stream and race on the body. `inflightAliases` is
196
- // intentionally preserved `clearPrefetchInflight()` in the fetch's
197
- // `.finally()` still needs it to clear every inflight flag; deleting
198
- // here would strand the sibling's flag forever.
199
- forEachAlias(key, (k) => inflightPromises.delete(k));
243
+ // adopt the same stream and race on the body, and mark every alias as
244
+ // adopted so the pending `storePrefetch` (which resolves later, after this
245
+ // adoption) does not leave the now-owned, single-use entry in the cache map.
246
+ // `inflightAliases` is intentionally preserved `clearPrefetchInflight()` in
247
+ // the fetch's `.finally()` still needs it to clear every inflight flag and
248
+ // adopted marker; deleting here would strand the sibling's flag forever.
249
+ forEachAlias(key, (k) => {
250
+ inflightPromises.delete(k);
251
+ adoptedKeys.add(k);
252
+ });
200
253
  return promise;
201
254
  }
202
255
 
203
256
  /**
204
- * Store a prefetch response in the in-memory cache.
205
- * The response should be a clone() of the original so the caller can
206
- * still consume the body. The clone's body streams independently.
257
+ * Store an eagerly-decoded prefetch in the in-memory cache.
207
258
  *
208
259
  * Skips storage if the generation has changed since the fetch started
209
260
  * (a server action invalidated the cache mid-flight).
210
261
  */
211
262
  export function storePrefetch(
212
263
  key: string,
213
- response: Response,
264
+ entry: DecodedPrefetch,
214
265
  fetchGeneration: number,
215
266
  ): void {
216
267
  if (cacheTTL <= 0) return;
217
268
  if (fetchGeneration !== generation) return;
218
269
 
270
+ // If a navigation already adopted this prefetch's in-flight promise, it owns
271
+ // the single-use entry (and has drained its handle generator). Do NOT also
272
+ // publish it to the cache map, or a later navigation would be served the
273
+ // exhausted entry and lose that route's handles. Clear the marker (under all
274
+ // aliases) now that the decision is made.
275
+ if (adoptedKeys.has(key)) {
276
+ forEachAlias(key, (k) => adoptedKeys.delete(k));
277
+ return;
278
+ }
279
+
219
280
  // Evict expired entries
220
281
  const now = Date.now();
221
- for (const [k, entry] of cache) {
222
- if (now - entry.timestamp > cacheTTL) {
282
+ for (const [k, cached] of cache) {
283
+ if (now - cached.timestamp > cacheTTL) {
223
284
  cache.delete(k);
224
285
  }
225
286
  }
@@ -230,7 +291,7 @@ export function storePrefetch(
230
291
  if (oldest) cache.delete(oldest);
231
292
  }
232
293
 
233
- cache.set(key, { response, timestamp: now });
294
+ cache.set(key, { entry, timestamp: now });
234
295
  }
235
296
 
236
297
  /**
@@ -250,7 +311,7 @@ export function markPrefetchInflight(key: string): void {
250
311
  */
251
312
  export function setInflightPromise(
252
313
  key: string,
253
- promise: Promise<Response | null>,
314
+ promise: Promise<DecodedPrefetch | null>,
254
315
  ): void {
255
316
  inflightPromises.set(key, promise);
256
317
  }
@@ -263,7 +324,7 @@ export function setInflightPromise(
263
324
  */
264
325
  export function setInflightPromiseWithAliases(
265
326
  keys: string[],
266
- promise: Promise<Response | null>,
327
+ promise: Promise<DecodedPrefetch | null>,
267
328
  ): void {
268
329
  for (const k of keys) {
269
330
  inflightPromises.set(k, promise);
@@ -276,6 +337,9 @@ export function clearPrefetchInflight(key: string): void {
276
337
  inflight.delete(k);
277
338
  inflightPromises.delete(k);
278
339
  inflightAliases.delete(k);
340
+ // Clear any adopted marker too, so a fetch that failed before storePrefetch
341
+ // (the marker's normal consumer) does not strand it across the next prefetch.
342
+ adoptedKeys.delete(k);
279
343
  });
280
344
  }
281
345
 
@@ -292,23 +356,8 @@ export function clearPrefetchCache(): void {
292
356
  inflight.clear();
293
357
  inflightPromises.clear();
294
358
  inflightAliases.clear();
359
+ adoptedKeys.clear();
295
360
  cache.clear();
296
361
  abortAllPrefetches();
297
362
  invalidateRangoState();
298
363
  }
299
-
300
- /**
301
- * Drop all in-memory prefetch state for this tab without rotating rango-state.
302
- *
303
- * Use for local-only invalidations (e.g. app switch in this tab) where
304
- * other tabs should NOT observe a state rotation. Unlike clearPrefetchCache,
305
- * does not call invalidateRangoState, so the shared X-Rango-State token
306
- * stays intact and siblings in the old app keep their prefetches.
307
- */
308
- export function clearPrefetchCacheLocal(): void {
309
- generation++;
310
- inflight.clear();
311
- inflightPromises.clear();
312
- cache.clear();
313
- abortAllPrefetches();
314
- }
@@ -3,12 +3,16 @@
3
3
  *
4
4
  * Fetch-based prefetch logic used by Link (hover/viewport/render strategies)
5
5
  * and useRouter().prefetch(). Sends the same headers and segment IDs as a
6
- * real navigation so the server returns a proper diff. The Response is fully
7
- * buffered and stored in an in-memory cache for instant consumption on
8
- * subsequent navigation.
6
+ * real navigation so the server returns a proper diff. The response is fetched
7
+ * AND eagerly decoded (createFromFetch) up front: decoding the Flight stream
8
+ * resolves the route's client references, so the route's JS chunks are imported
9
+ * during prefetch rather than on click. The decoded payload is stored in an
10
+ * in-memory cache and reused verbatim by navigation, so a prefetched click
11
+ * loads no new code.
9
12
  *
10
13
  * In-flight promises are tracked in the cache so that navigation can reuse
11
- * a prefetch that is still downloading instead of starting a duplicate request.
14
+ * a prefetch that is still downloading/decoding instead of starting a
15
+ * duplicate request.
12
16
  */
13
17
 
14
18
  import {
@@ -20,11 +24,34 @@ import {
20
24
  storePrefetch,
21
25
  clearPrefetchInflight,
22
26
  currentGeneration,
27
+ type DecodedPrefetch,
23
28
  } from "./cache.js";
24
29
  import { getRangoState } from "../rango-state.js";
25
30
  import { enqueuePrefetch } from "./queue.js";
26
31
  import { shouldPrefetch } from "./policy.js";
27
32
  import { debugLog } from "../logging.js";
33
+ import { teeWithCompletion, isForeignRouterId } from "../response-adapter.js";
34
+ import type { RscPayload } from "../types.js";
35
+
36
+ /**
37
+ * Decoder injected at app startup (see setPrefetchDecoder). This is
38
+ * `deps.createFromFetch` — decoupled from the RSC runtime exactly like the
39
+ * navigation client. Prefetch decodes through it so the route's client chunks
40
+ * are pulled during the prefetch, not on click.
41
+ */
42
+ type PrefetchDecoder = (response: Promise<Response>) => Promise<RscPayload>;
43
+
44
+ let decoder: PrefetchDecoder | null = null;
45
+
46
+ /**
47
+ * Wire the RSC decoder used to eagerly decode prefetched responses. Called
48
+ * once from initBrowserApp with the same createFromFetch the navigation client
49
+ * uses. Until set, prefetch warming is inert (prefetches are skipped) — the
50
+ * browser app always sets it before any Link can fire.
51
+ */
52
+ export function setPrefetchDecoder(fn: PrefetchDecoder): void {
53
+ decoder = fn;
54
+ }
28
55
 
29
56
  /**
30
57
  * Check if a URL resolves to the current page (same pathname + search).
@@ -78,39 +105,50 @@ function buildPrefetchUrl(
78
105
  }
79
106
 
80
107
  /**
81
- * Core prefetch fetch logic. Fetches the response, tees the body, and stores
82
- * one branch in the in-memory cache. The returned Promise resolves to the
83
- * sibling navigation branch (or null on failure) so navigation can safely
84
- * reuse an in-flight prefetch via consumeInflightPrefetch().
108
+ * Core prefetch fetch logic. Fetches the response, eagerly decodes it, and
109
+ * stores the decoded payload in the in-memory cache. The returned Promise
110
+ * resolves to the decoded entry (or null on failure / control header) so
111
+ * navigation can safely reuse an in-flight prefetch via
112
+ * consumeInflightPrefetch().
113
+ *
114
+ * Eager decode is the warming step: createFromFetch parses the Flight stream,
115
+ * which resolves the route's client references and imports its JS chunks. The
116
+ * stored payload is reused as-is by navigation, so the click loads no new code.
117
+ *
118
+ * Control headers are NOT acted on here. A speculative prefetch must never
119
+ * reload the page or throw a redirect — if the response carries X-RSC-Reload
120
+ * or X-RSC-Redirect, we drop it (resolve null) and let the real navigation
121
+ * re-fetch and honor it.
85
122
  *
86
123
  * Inflight + storage key selection:
87
124
  *
88
125
  * - `forceSourceScope` (Link opted in with `prefetchKey=":source"`): single
89
- * inflight registration under `sourceKey`; response stored under
90
- * `sourceKey`. No wildcard leak is possible.
126
+ * inflight registration under `sourceKey`; entry stored under `sourceKey`.
127
+ * No wildcard leak is possible.
91
128
  *
92
129
  * - Otherwise: dual inflight registration under both `wildcardKey` and
93
130
  * `sourceKey` so same-source navigations adopt directly via their own
94
131
  * source key. Storage key is chosen at response time from the
95
132
  * `X-RSC-Prefetch-Scope` header — `"source"` → `sourceKey` (intercept
96
- * modals etc.), anything else → `wildcardKey`. Cross-source navigations
97
- * that adopted via `wildcardKey` must bail out in `navigation-client.ts`
98
- * if the adopted response turns out to be source-scoped.
133
+ * modals etc.), anything else → `wildcardKey`. The entry records its scope
134
+ * so cross-source navigations that adopted via `wildcardKey` can bail out
135
+ * in `navigation-client.ts` when the adopted entry turns out source-scoped.
99
136
  */
100
137
  function executePrefetchFetch(
101
138
  wildcardKey: string,
102
139
  sourceKey: string,
103
140
  fetchUrl: string,
104
141
  forceSourceScope: boolean,
142
+ expectedRouterId?: string,
105
143
  signal?: AbortSignal,
106
- ): Promise<Response | null> {
144
+ ): Promise<DecodedPrefetch | null> {
107
145
  const gen = currentGeneration();
108
146
  const inflightKeys = forceSourceScope
109
147
  ? [sourceKey]
110
148
  : [wildcardKey, sourceKey];
111
149
  for (const k of inflightKeys) markPrefetchInflight(k);
112
150
 
113
- const promise: Promise<Response | null> = fetch(fetchUrl, {
151
+ const promise: Promise<DecodedPrefetch | null> = fetch(fetchUrl, {
114
152
  priority: "low" as RequestPriority,
115
153
  signal,
116
154
  headers: {
@@ -120,25 +158,53 @@ function executePrefetchFetch(
120
158
  },
121
159
  })
122
160
  .then((response) => {
123
- if (!response.ok) return null;
124
- // Don't buffer with arrayBuffer() that blocks until the entire
125
- // body downloads, defeating streaming for slow loaders.
126
- // Tee the body: one branch for navigation, one for cache storage.
127
- const [navStream, cacheStream] = response.body!.tee();
128
- const responseInit = {
129
- headers: response.headers,
130
- status: response.status,
131
- statusText: response.statusText,
132
- };
133
- let storageKey: string;
134
- if (forceSourceScope) {
135
- storageKey = sourceKey;
136
- } else {
137
- const scope = response.headers.get("x-rsc-prefetch-scope");
138
- storageKey = scope === "source" ? sourceKey : wildcardKey;
161
+ if (!response.ok || !decoder) return null;
162
+ // Control headers mean this response is stale (reload) or redirecting.
163
+ // Don't warm it drop so navigation re-fetches and acts on the header.
164
+ if (
165
+ response.headers.has("X-RSC-Reload") ||
166
+ response.headers.has("X-RSC-Redirect")
167
+ ) {
168
+ return null;
139
169
  }
140
- storePrefetch(storageKey, new Response(cacheStream, responseInit), gen);
141
- return new Response(navStream, responseInit);
170
+ // Integrity check: never warm (or decode/import the chunks of) a foreign
171
+ // app's payload. A speculative prefetch must never reload — just drop it;
172
+ // navigation re-fetches and the server steers it.
173
+ if (isForeignRouterId(response, expectedRouterId)) {
174
+ return null;
175
+ }
176
+
177
+ const scope: "source" | "wildcard" =
178
+ forceSourceScope ||
179
+ response.headers.get("x-rsc-prefetch-scope") === "source"
180
+ ? "source"
181
+ : "wildcard";
182
+ const storageKey = scope === "source" ? sourceKey : wildcardKey;
183
+
184
+ // Track stream completion off a tee so navigation's scroll/revalidation
185
+ // gating matches the fresh-fetch path; decode the other branch.
186
+ let resolveStreamComplete!: () => void;
187
+ const streamComplete = new Promise<void>((resolve) => {
188
+ resolveStreamComplete = resolve;
189
+ });
190
+ const tracked = teeWithCompletion(
191
+ response,
192
+ () => resolveStreamComplete(),
193
+ signal,
194
+ // Speculative prefetch: a never-consumed/aborted stream error is benign.
195
+ true,
196
+ );
197
+
198
+ // Eager decode: parsing the Flight stream imports the route's client
199
+ // chunks now, not on click.
200
+ const payload = decoder(Promise.resolve(tracked));
201
+ // Mark handled so an unconsumed prefetch decode error stays quiet; the
202
+ // error is still surfaced to navigation if it consumes the entry.
203
+ payload.catch(() => {});
204
+
205
+ const entry: DecodedPrefetch = { payload, streamComplete, scope };
206
+ storePrefetch(storageKey, entry, gen);
207
+ return entry;
142
208
  })
143
209
  .catch(() => null)
144
210
  .finally(() => {
@@ -223,6 +289,7 @@ export function prefetchDirect(
223
289
  sourceKey,
224
290
  targetUrl.toString(),
225
291
  forceSourceScope,
292
+ routerId,
226
293
  );
227
294
  }
228
295
 
@@ -275,6 +342,7 @@ export function prefetchQueued(
275
342
  sourceKey,
276
343
  fetchUrlStr,
277
344
  forceSourceScope,
345
+ routerId,
278
346
  signal,
279
347
  ).then(() => {});
280
348
  });
@@ -13,9 +13,9 @@
13
13
  * Storage key is namespaced per routerId (`rango-state:{routerId}`) so
14
14
  * tabs in different apps on the same origin do not collide. Two tabs in
15
15
  * the same app share a key → one tab's invalidation is picked up by the
16
- * other via the `storage` event. A smooth cross-app transition in this
17
- * tab rebinds to the target app's key; other tabs still in the old app
18
- * keep their own key intact.
16
+ * other via the `storage` event. The key is bound once at document init; a
17
+ * cross-app navigation is a full document load (X-RSC-Reload), so the target
18
+ * app's document binds its own key on load (tabs in the old app keep theirs).
19
19
  *
20
20
  * If no routerId is supplied, falls back to a single legacy key for
21
21
  * backward compatibility (single-app deployments unaffected).
@@ -31,10 +31,9 @@ function buildStorageKey(routerId: string | undefined): string {
31
31
  // Initialized from localStorage on first access or by initRangoState().
32
32
  let cachedState: string | null = null;
33
33
 
34
- // The localStorage key this tab is currently bound to. Rebinds on
35
- // initRangoState (document boot) and setRangoStateLocal (smooth app
36
- // switch). The storage listener filters cross-tab events by this key so
37
- // events from tabs in a different app are ignored.
34
+ // The localStorage key this tab is currently bound to. Bound on
35
+ // initRangoState (document boot). The storage listener filters cross-tab
36
+ // events by this key so events from tabs in a different app are ignored.
38
37
  let currentStorageKey: string = LEGACY_STORAGE_KEY;
39
38
 
40
39
  // Cross-tab sync: the `storage` event fires in OTHER tabs when one tab writes
@@ -114,21 +113,6 @@ export function getRangoState(): string {
114
113
  return "0:0";
115
114
  }
116
115
 
117
- /**
118
- * Update the in-memory rango-state to a new version WITHOUT writing
119
- * localStorage. Intended for smooth cross-app transitions in this tab only:
120
- * subsequent requests from this tab send the new token, but other tabs
121
- * still in the previous app do not observe a storage event. Rebinds this
122
- * tab's storage key to the target app's namespace (`rango-state:{routerId}`)
123
- * so subsequent storage events only reflect the new app. On the next hard
124
- * reload, initRangoState reconciles localStorage from the server's
125
- * authoritative version.
126
- */
127
- export function setRangoStateLocal(version: string, routerId?: string): void {
128
- currentStorageKey = buildStorageKey(routerId);
129
- cachedState = `${version}:${Date.now()}`;
130
- }
131
-
132
116
  /**
133
117
  * Invalidate the Rango state key. Called when server actions mutate data.
134
118
  * Updates the timestamp portion while keeping the version prefix.
@@ -157,9 +157,11 @@ export interface NavigationProviderProps {
157
157
  basename?: string;
158
158
 
159
159
  /**
160
- * Live app-shell ref. When provided, the context's `basename` and `version`
161
- * properties become live getters that track app-switch updates without
162
- * invalidating the memoized context value.
160
+ * App-shell ref. When provided, the context's `basename` and `version` are
161
+ * read through it (live getters) so they don't close over a stale snapshot or
162
+ * invalidate the memoized context value. The shell is set once at init and is
163
+ * not swapped within a session — a cross-app navigation is a full document
164
+ * load (X-RSC-Reload), so the target app establishes its own shell on load.
163
165
  */
164
166
  appShellRef?: AppShellRef;
165
167
  }
@@ -218,8 +220,9 @@ export function NavigationProvider({
218
220
  }, []);
219
221
 
220
222
  // basename/version are always read through a shell ref so the context value
221
- // has a single shape: a supplied appShellRef stays live (app-switch updates
222
- // it), the standalone fallback is a frozen ref over the mount-time props.
223
+ // has a single shape. Both are set once: a supplied appShellRef is seeded
224
+ // from the init payload (a cross-app navigation reloads, so it is not swapped
225
+ // in-session), and the standalone fallback wraps the mount-time props.
223
226
  const fallbackShellRef = useRef<AppShellRef | null>(null);
224
227
  if (!fallbackShellRef.current) {
225
228
  fallbackShellRef.current = createAppShellRef({ basename, version });
@@ -436,10 +439,10 @@ export function NavigationProvider({
436
439
  let content = <RootErrorBoundary>{root}</RootErrorBoundary>;
437
440
 
438
441
  // Wrap with ThemeProvider when theme is enabled. The ThemeProvider is
439
- // document-lifetime: its config comes from the initial load and does NOT
440
- // swap on cross-app transitions, because the ThemeProvider sits above the
441
- // segment tree and a smooth (no-reload) app switch cannot safely remount
442
- // it. A new theme config only takes effect on a full document load.
442
+ // document-lifetime: its config comes from the initial load and persists for
443
+ // the session. It sits above the segment tree and is not remounted in-session;
444
+ // a cross-app navigation is a full document load (X-RSC-Reload), so the target
445
+ // app's theme config takes effect on its own load.
443
446
  if (themeConfig) {
444
447
  content = (
445
448
  <ThemeProvider config={themeConfig} initialTheme={initialTheme}>
@@ -13,9 +13,10 @@ import type { RouterInstance, RouterNavigateOptions } from "../types.js";
13
13
  * useRouter() do not re-render on navigation state changes.
14
14
  * For reactive navigation state, use useNavigation() instead.
15
15
  *
16
- * Methods read `basename` from the live context on each call so that
17
- * cross-app navigation (app-switch) sees the current app's basename
18
- * rather than the one captured at mount time.
16
+ * Methods read `basename` from the context on each call. It is set once from
17
+ * the initial payload and is stable within a session — a cross-app navigation
18
+ * is a full document load (X-RSC-Reload), so the target app mounts fresh with
19
+ * its own basename.
19
20
  *
20
21
  * @example
21
22
  * ```tsx