@rangojs/router 0.0.0-experimental.e16b7c00 → 0.0.0-experimental.e9c0b2f2

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 (1155) hide show
  1. package/AGENTS.md +8 -0
  2. package/README.md +64 -6
  3. package/dist/__internal.d.ts +83 -0
  4. package/dist/__internal.d.ts.map +1 -0
  5. package/dist/__internal.js +19 -0
  6. package/dist/__internal.js.map +1 -0
  7. package/dist/__mocks__/version.d.ts +7 -0
  8. package/dist/__mocks__/version.d.ts.map +1 -0
  9. package/dist/__mocks__/version.js +7 -0
  10. package/dist/__mocks__/version.js.map +1 -0
  11. package/dist/__tests__/client-href.test.d.ts +2 -0
  12. package/dist/__tests__/client-href.test.d.ts.map +1 -0
  13. package/dist/__tests__/client-href.test.js +74 -0
  14. package/dist/__tests__/client-href.test.js.map +1 -0
  15. package/dist/__tests__/component-utils.test.d.ts +2 -0
  16. package/dist/__tests__/component-utils.test.d.ts.map +1 -0
  17. package/dist/__tests__/component-utils.test.js +51 -0
  18. package/dist/__tests__/component-utils.test.js.map +1 -0
  19. package/dist/__tests__/event-controller.test.d.ts +2 -0
  20. package/dist/__tests__/event-controller.test.d.ts.map +1 -0
  21. package/dist/__tests__/event-controller.test.js +538 -0
  22. package/dist/__tests__/event-controller.test.js.map +1 -0
  23. package/dist/__tests__/helpers/route-tree.d.ts +118 -0
  24. package/dist/__tests__/helpers/route-tree.d.ts.map +1 -0
  25. package/dist/__tests__/helpers/route-tree.js +374 -0
  26. package/dist/__tests__/helpers/route-tree.js.map +1 -0
  27. package/dist/__tests__/match-result.test.d.ts +2 -0
  28. package/dist/__tests__/match-result.test.d.ts.map +1 -0
  29. package/dist/__tests__/match-result.test.js +154 -0
  30. package/dist/__tests__/match-result.test.js.map +1 -0
  31. package/dist/__tests__/navigation-store.test.d.ts +2 -0
  32. package/dist/__tests__/navigation-store.test.d.ts.map +1 -0
  33. package/dist/__tests__/navigation-store.test.js +440 -0
  34. package/dist/__tests__/navigation-store.test.js.map +1 -0
  35. package/dist/__tests__/partial-update.test.d.ts +2 -0
  36. package/dist/__tests__/partial-update.test.d.ts.map +1 -0
  37. package/dist/__tests__/partial-update.test.js +1009 -0
  38. package/dist/__tests__/partial-update.test.js.map +1 -0
  39. package/dist/__tests__/reverse-types.test.d.ts +8 -0
  40. package/dist/__tests__/reverse-types.test.d.ts.map +1 -0
  41. package/dist/__tests__/reverse-types.test.js +656 -0
  42. package/dist/__tests__/reverse-types.test.js.map +1 -0
  43. package/dist/__tests__/route-definition.test.d.ts +2 -0
  44. package/dist/__tests__/route-definition.test.d.ts.map +1 -0
  45. package/dist/__tests__/route-definition.test.js +55 -0
  46. package/dist/__tests__/route-definition.test.js.map +1 -0
  47. package/dist/__tests__/router-helpers.test.d.ts +2 -0
  48. package/dist/__tests__/router-helpers.test.d.ts.map +1 -0
  49. package/dist/__tests__/router-helpers.test.js +377 -0
  50. package/dist/__tests__/router-helpers.test.js.map +1 -0
  51. package/dist/__tests__/router-integration-2.test.d.ts +2 -0
  52. package/dist/__tests__/router-integration-2.test.d.ts.map +1 -0
  53. package/dist/__tests__/router-integration-2.test.js +426 -0
  54. package/dist/__tests__/router-integration-2.test.js.map +1 -0
  55. package/dist/__tests__/router-integration.test.d.ts +2 -0
  56. package/dist/__tests__/router-integration.test.d.ts.map +1 -0
  57. package/dist/__tests__/router-integration.test.js +1051 -0
  58. package/dist/__tests__/router-integration.test.js.map +1 -0
  59. package/dist/__tests__/search-params.test.d.ts +5 -0
  60. package/dist/__tests__/search-params.test.d.ts.map +1 -0
  61. package/dist/__tests__/search-params.test.js +306 -0
  62. package/dist/__tests__/search-params.test.js.map +1 -0
  63. package/dist/__tests__/segment-system.test.d.ts +2 -0
  64. package/dist/__tests__/segment-system.test.d.ts.map +1 -0
  65. package/dist/__tests__/segment-system.test.js +627 -0
  66. package/dist/__tests__/segment-system.test.js.map +1 -0
  67. package/dist/__tests__/static-handler-types.test.d.ts +8 -0
  68. package/dist/__tests__/static-handler-types.test.d.ts.map +1 -0
  69. package/dist/__tests__/static-handler-types.test.js +63 -0
  70. package/dist/__tests__/static-handler-types.test.js.map +1 -0
  71. package/dist/__tests__/urls.test.d.ts +2 -0
  72. package/dist/__tests__/urls.test.d.ts.map +1 -0
  73. package/dist/__tests__/urls.test.js +421 -0
  74. package/dist/__tests__/urls.test.js.map +1 -0
  75. package/dist/__tests__/use-mount.test.d.ts +2 -0
  76. package/dist/__tests__/use-mount.test.d.ts.map +1 -0
  77. package/dist/__tests__/use-mount.test.js +35 -0
  78. package/dist/__tests__/use-mount.test.js.map +1 -0
  79. package/dist/bin/rango.d.ts +2 -0
  80. package/dist/bin/rango.d.ts.map +1 -0
  81. package/dist/bin/rango.js +195 -52
  82. package/dist/bin/rango.js.map +1 -0
  83. package/dist/browser/event-controller.d.ts +191 -0
  84. package/dist/browser/event-controller.d.ts.map +1 -0
  85. package/dist/browser/event-controller.js +559 -0
  86. package/dist/browser/event-controller.js.map +1 -0
  87. package/dist/browser/index.d.ts +2 -0
  88. package/dist/browser/index.d.ts.map +1 -0
  89. package/dist/browser/index.js +14 -0
  90. package/dist/browser/index.js.map +1 -0
  91. package/dist/browser/link-interceptor.d.ts +38 -0
  92. package/dist/browser/link-interceptor.d.ts.map +1 -0
  93. package/dist/browser/link-interceptor.js +99 -0
  94. package/dist/browser/link-interceptor.js.map +1 -0
  95. package/dist/browser/logging.d.ts +10 -0
  96. package/dist/browser/logging.d.ts.map +1 -0
  97. package/dist/browser/logging.js +29 -0
  98. package/dist/browser/logging.js.map +1 -0
  99. package/dist/browser/lru-cache.d.ts +17 -0
  100. package/dist/browser/lru-cache.d.ts.map +1 -0
  101. package/dist/browser/lru-cache.js +50 -0
  102. package/dist/browser/lru-cache.js.map +1 -0
  103. package/dist/browser/merge-segment-loaders.d.ts +39 -0
  104. package/dist/browser/merge-segment-loaders.d.ts.map +1 -0
  105. package/dist/browser/merge-segment-loaders.js +102 -0
  106. package/dist/browser/merge-segment-loaders.js.map +1 -0
  107. package/dist/browser/navigation-bridge.d.ts +102 -0
  108. package/dist/browser/navigation-bridge.d.ts.map +1 -0
  109. package/dist/browser/navigation-bridge.js +708 -0
  110. package/dist/browser/navigation-bridge.js.map +1 -0
  111. package/dist/browser/navigation-client.d.ts +25 -0
  112. package/dist/browser/navigation-client.d.ts.map +1 -0
  113. package/dist/browser/navigation-client.js +157 -0
  114. package/dist/browser/navigation-client.js.map +1 -0
  115. package/dist/browser/navigation-store.d.ts +101 -0
  116. package/dist/browser/navigation-store.d.ts.map +1 -0
  117. package/dist/browser/navigation-store.js +625 -0
  118. package/dist/browser/navigation-store.js.map +1 -0
  119. package/dist/browser/partial-update.d.ts +75 -0
  120. package/dist/browser/partial-update.d.ts.map +1 -0
  121. package/dist/browser/partial-update.js +426 -0
  122. package/dist/browser/partial-update.js.map +1 -0
  123. package/dist/browser/react/Link.d.ts +86 -0
  124. package/dist/browser/react/Link.d.ts.map +1 -0
  125. package/dist/browser/react/Link.js +128 -0
  126. package/dist/browser/react/Link.js.map +1 -0
  127. package/dist/browser/react/NavigationProvider.d.ts +63 -0
  128. package/dist/browser/react/NavigationProvider.d.ts.map +1 -0
  129. package/dist/browser/react/NavigationProvider.js +216 -0
  130. package/dist/browser/react/NavigationProvider.js.map +1 -0
  131. package/dist/browser/react/ScrollRestoration.d.ts +75 -0
  132. package/dist/browser/react/ScrollRestoration.d.ts.map +1 -0
  133. package/dist/browser/react/ScrollRestoration.js +57 -0
  134. package/dist/browser/react/ScrollRestoration.js.map +1 -0
  135. package/dist/browser/react/context.d.ts +46 -0
  136. package/dist/browser/react/context.d.ts.map +1 -0
  137. package/dist/browser/react/context.js +10 -0
  138. package/dist/browser/react/context.js.map +1 -0
  139. package/dist/browser/react/index.d.ts +11 -0
  140. package/dist/browser/react/index.d.ts.map +1 -0
  141. package/dist/browser/react/index.js +22 -0
  142. package/dist/browser/react/index.js.map +1 -0
  143. package/dist/browser/react/location-state-shared.d.ts +63 -0
  144. package/dist/browser/react/location-state-shared.d.ts.map +1 -0
  145. package/dist/browser/react/location-state-shared.js +81 -0
  146. package/dist/browser/react/location-state-shared.js.map +1 -0
  147. package/dist/browser/react/location-state.d.ts +23 -0
  148. package/dist/browser/react/location-state.d.ts.map +1 -0
  149. package/dist/browser/react/location-state.js +29 -0
  150. package/dist/browser/react/location-state.js.map +1 -0
  151. package/dist/browser/react/mount-context.d.ts +24 -0
  152. package/dist/browser/react/mount-context.d.ts.map +1 -0
  153. package/dist/browser/react/mount-context.js +24 -0
  154. package/dist/browser/react/mount-context.js.map +1 -0
  155. package/dist/browser/react/use-action.d.ts +64 -0
  156. package/dist/browser/react/use-action.d.ts.map +1 -0
  157. package/dist/browser/react/use-action.js +134 -0
  158. package/dist/browser/react/use-action.js.map +1 -0
  159. package/dist/browser/react/use-client-cache.d.ts +41 -0
  160. package/dist/browser/react/use-client-cache.d.ts.map +1 -0
  161. package/{src/browser/react/use-client-cache.ts → dist/browser/react/use-client-cache.js} +9 -28
  162. package/dist/browser/react/use-client-cache.js.map +1 -0
  163. package/dist/browser/react/use-handle.d.ts +31 -0
  164. package/dist/browser/react/use-handle.d.ts.map +1 -0
  165. package/dist/browser/react/use-handle.js +144 -0
  166. package/dist/browser/react/use-handle.js.map +1 -0
  167. package/dist/browser/react/use-href.d.ts +33 -0
  168. package/dist/browser/react/use-href.d.ts.map +1 -0
  169. package/dist/browser/react/use-href.js +39 -0
  170. package/dist/browser/react/use-href.js.map +1 -0
  171. package/dist/browser/react/use-link-status.d.ts +37 -0
  172. package/dist/browser/react/use-link-status.d.ts.map +1 -0
  173. package/dist/browser/react/use-link-status.js +99 -0
  174. package/dist/browser/react/use-link-status.js.map +1 -0
  175. package/dist/browser/react/use-mount.d.ts +25 -0
  176. package/dist/browser/react/use-mount.d.ts.map +1 -0
  177. package/dist/browser/react/use-mount.js +30 -0
  178. package/dist/browser/react/use-mount.js.map +1 -0
  179. package/dist/browser/react/use-navigation.d.ts +27 -0
  180. package/dist/browser/react/use-navigation.d.ts.map +1 -0
  181. package/dist/browser/react/use-navigation.js +87 -0
  182. package/dist/browser/react/use-navigation.js.map +1 -0
  183. package/dist/browser/react/use-segments.d.ts +38 -0
  184. package/dist/browser/react/use-segments.d.ts.map +1 -0
  185. package/dist/browser/react/use-segments.js +130 -0
  186. package/dist/browser/react/use-segments.js.map +1 -0
  187. package/dist/browser/request-controller.d.ts +26 -0
  188. package/dist/browser/request-controller.d.ts.map +1 -0
  189. package/dist/browser/request-controller.js +147 -0
  190. package/dist/browser/request-controller.js.map +1 -0
  191. package/dist/browser/rsc-router.d.ts +129 -0
  192. package/dist/browser/rsc-router.d.ts.map +1 -0
  193. package/dist/browser/rsc-router.js +195 -0
  194. package/dist/browser/rsc-router.js.map +1 -0
  195. package/dist/browser/scroll-restoration.d.ts +93 -0
  196. package/dist/browser/scroll-restoration.d.ts.map +1 -0
  197. package/dist/browser/scroll-restoration.js +321 -0
  198. package/dist/browser/scroll-restoration.js.map +1 -0
  199. package/dist/browser/segment-structure-assert.d.ts +17 -0
  200. package/dist/browser/segment-structure-assert.d.ts.map +1 -0
  201. package/dist/browser/segment-structure-assert.js +59 -0
  202. package/dist/browser/segment-structure-assert.js.map +1 -0
  203. package/dist/browser/server-action-bridge.d.ts +26 -0
  204. package/dist/browser/server-action-bridge.d.ts.map +1 -0
  205. package/dist/browser/server-action-bridge.js +668 -0
  206. package/dist/browser/server-action-bridge.js.map +1 -0
  207. package/dist/browser/shallow.d.ts +12 -0
  208. package/dist/browser/shallow.d.ts.map +1 -0
  209. package/dist/browser/shallow.js +34 -0
  210. package/dist/browser/shallow.js.map +1 -0
  211. package/dist/browser/types.d.ts +369 -0
  212. package/dist/browser/types.d.ts.map +1 -0
  213. package/dist/browser/types.js +2 -0
  214. package/dist/browser/types.js.map +1 -0
  215. package/dist/build/__tests__/generate-cli.test.d.ts +2 -0
  216. package/dist/build/__tests__/generate-cli.test.d.ts.map +1 -0
  217. package/dist/build/__tests__/generate-cli.test.js +237 -0
  218. package/dist/build/__tests__/generate-cli.test.js.map +1 -0
  219. package/dist/build/__tests__/generate-manifest.test.d.ts +2 -0
  220. package/dist/build/__tests__/generate-manifest.test.d.ts.map +1 -0
  221. package/dist/build/__tests__/generate-manifest.test.js +119 -0
  222. package/dist/build/__tests__/generate-manifest.test.js.map +1 -0
  223. package/dist/build/__tests__/generate-route-types.test.d.ts +2 -0
  224. package/dist/build/__tests__/generate-route-types.test.d.ts.map +1 -0
  225. package/dist/build/__tests__/generate-route-types.test.js +620 -0
  226. package/dist/build/__tests__/generate-route-types.test.js.map +1 -0
  227. package/dist/build/__tests__/per-router-manifest.test.d.ts +2 -0
  228. package/dist/build/__tests__/per-router-manifest.test.d.ts.map +1 -0
  229. package/dist/build/__tests__/per-router-manifest.test.js +308 -0
  230. package/dist/build/__tests__/per-router-manifest.test.js.map +1 -0
  231. package/dist/build/generate-manifest.d.ts +81 -0
  232. package/dist/build/generate-manifest.d.ts.map +1 -0
  233. package/dist/build/generate-manifest.js +276 -0
  234. package/dist/build/generate-manifest.js.map +1 -0
  235. package/dist/build/generate-route-types.d.ts +115 -0
  236. package/dist/build/generate-route-types.d.ts.map +1 -0
  237. package/dist/build/generate-route-types.js +740 -0
  238. package/dist/build/generate-route-types.js.map +1 -0
  239. package/dist/build/index.d.ts +21 -0
  240. package/dist/build/index.d.ts.map +1 -0
  241. package/dist/build/index.js +21 -0
  242. package/dist/build/index.js.map +1 -0
  243. package/dist/build/route-trie.d.ts +71 -0
  244. package/dist/build/route-trie.d.ts.map +1 -0
  245. package/dist/build/route-trie.js +175 -0
  246. package/dist/build/route-trie.js.map +1 -0
  247. package/dist/cache/__tests__/cache-scope.test.d.ts +2 -0
  248. package/dist/cache/__tests__/cache-scope.test.d.ts.map +1 -0
  249. package/dist/cache/__tests__/cache-scope.test.js +208 -0
  250. package/dist/cache/__tests__/cache-scope.test.js.map +1 -0
  251. package/dist/cache/__tests__/document-cache.test.d.ts +2 -0
  252. package/dist/cache/__tests__/document-cache.test.d.ts.map +1 -0
  253. package/dist/cache/__tests__/document-cache.test.js +345 -0
  254. package/dist/cache/__tests__/document-cache.test.js.map +1 -0
  255. package/dist/cache/__tests__/memory-segment-store.test.d.ts +2 -0
  256. package/dist/cache/__tests__/memory-segment-store.test.d.ts.map +1 -0
  257. package/dist/cache/__tests__/memory-segment-store.test.js +425 -0
  258. package/dist/cache/__tests__/memory-segment-store.test.js.map +1 -0
  259. package/dist/cache/__tests__/memory-store.test.d.ts +2 -0
  260. package/dist/cache/__tests__/memory-store.test.d.ts.map +1 -0
  261. package/dist/cache/__tests__/memory-store.test.js +367 -0
  262. package/dist/cache/__tests__/memory-store.test.js.map +1 -0
  263. package/dist/cache/cache-scope.d.ts +102 -0
  264. package/dist/cache/cache-scope.d.ts.map +1 -0
  265. package/dist/cache/cache-scope.js +440 -0
  266. package/dist/cache/cache-scope.js.map +1 -0
  267. package/dist/cache/cf/__tests__/cf-cache-store.test.d.ts +2 -0
  268. package/dist/cache/cf/__tests__/cf-cache-store.test.d.ts.map +1 -0
  269. package/dist/cache/cf/__tests__/cf-cache-store.test.js +330 -0
  270. package/dist/cache/cf/__tests__/cf-cache-store.test.js.map +1 -0
  271. package/dist/cache/cf/cf-cache-store.d.ts +165 -0
  272. package/dist/cache/cf/cf-cache-store.d.ts.map +1 -0
  273. package/dist/cache/cf/cf-cache-store.js +242 -0
  274. package/dist/cache/cf/cf-cache-store.js.map +1 -0
  275. package/dist/cache/cf/index.d.ts +14 -0
  276. package/dist/cache/cf/index.d.ts.map +1 -0
  277. package/dist/cache/cf/index.js +17 -0
  278. package/dist/cache/cf/index.js.map +1 -0
  279. package/dist/cache/document-cache.d.ts +64 -0
  280. package/dist/cache/document-cache.d.ts.map +1 -0
  281. package/dist/cache/document-cache.js +228 -0
  282. package/dist/cache/document-cache.js.map +1 -0
  283. package/dist/cache/index.d.ts +19 -0
  284. package/dist/cache/index.d.ts.map +1 -0
  285. package/dist/cache/index.js +21 -0
  286. package/dist/cache/index.js.map +1 -0
  287. package/dist/cache/memory-segment-store.d.ts +110 -0
  288. package/dist/cache/memory-segment-store.d.ts.map +1 -0
  289. package/dist/cache/memory-segment-store.js +117 -0
  290. package/dist/cache/memory-segment-store.js.map +1 -0
  291. package/dist/cache/memory-store.d.ts +41 -0
  292. package/dist/cache/memory-store.d.ts.map +1 -0
  293. package/dist/cache/memory-store.js +191 -0
  294. package/dist/cache/memory-store.js.map +1 -0
  295. package/dist/cache/types.d.ts +317 -0
  296. package/dist/cache/types.d.ts.map +1 -0
  297. package/dist/cache/types.js +12 -0
  298. package/dist/cache/types.js.map +1 -0
  299. package/dist/client.d.ts +248 -0
  300. package/dist/client.d.ts.map +1 -0
  301. package/dist/client.js +367 -0
  302. package/dist/client.js.map +1 -0
  303. package/dist/client.rsc.d.ts +26 -0
  304. package/dist/client.rsc.d.ts.map +1 -0
  305. package/dist/client.rsc.js +46 -0
  306. package/dist/client.rsc.js.map +1 -0
  307. package/dist/component-utils.d.ts +36 -0
  308. package/dist/component-utils.d.ts.map +1 -0
  309. package/dist/component-utils.js +61 -0
  310. package/dist/component-utils.js.map +1 -0
  311. package/dist/components/DefaultDocument.d.ts +13 -0
  312. package/dist/components/DefaultDocument.d.ts.map +1 -0
  313. package/dist/components/DefaultDocument.js +15 -0
  314. package/dist/components/DefaultDocument.js.map +1 -0
  315. package/dist/debug.d.ts +58 -0
  316. package/dist/debug.d.ts.map +1 -0
  317. package/dist/debug.js +157 -0
  318. package/dist/debug.js.map +1 -0
  319. package/dist/default-error-boundary.d.ts +11 -0
  320. package/dist/default-error-boundary.d.ts.map +1 -0
  321. package/dist/default-error-boundary.js +45 -0
  322. package/dist/default-error-boundary.js.map +1 -0
  323. package/dist/deps/browser.d.ts +2 -0
  324. package/dist/deps/browser.d.ts.map +1 -0
  325. package/dist/deps/browser.js +3 -0
  326. package/dist/deps/browser.js.map +1 -0
  327. package/dist/deps/html-stream-client.d.ts +2 -0
  328. package/dist/deps/html-stream-client.d.ts.map +1 -0
  329. package/dist/deps/html-stream-client.js +3 -0
  330. package/dist/deps/html-stream-client.js.map +1 -0
  331. package/dist/deps/html-stream-server.d.ts +2 -0
  332. package/dist/deps/html-stream-server.d.ts.map +1 -0
  333. package/dist/deps/html-stream-server.js +3 -0
  334. package/dist/deps/html-stream-server.js.map +1 -0
  335. package/dist/deps/rsc.d.ts +2 -0
  336. package/dist/deps/rsc.d.ts.map +1 -0
  337. package/dist/deps/rsc.js +4 -0
  338. package/dist/deps/rsc.js.map +1 -0
  339. package/dist/deps/ssr.d.ts +2 -0
  340. package/dist/deps/ssr.d.ts.map +1 -0
  341. package/dist/deps/ssr.js +3 -0
  342. package/dist/deps/ssr.js.map +1 -0
  343. package/dist/errors.d.ts +174 -0
  344. package/dist/errors.d.ts.map +1 -0
  345. package/dist/errors.js +241 -0
  346. package/dist/errors.js.map +1 -0
  347. package/dist/handle.d.ts +78 -0
  348. package/dist/handle.d.ts.map +1 -0
  349. package/dist/handle.js +82 -0
  350. package/dist/handle.js.map +1 -0
  351. package/dist/handles/MetaTags.d.ts +14 -0
  352. package/dist/handles/MetaTags.d.ts.map +1 -0
  353. package/dist/handles/MetaTags.js +136 -0
  354. package/dist/handles/MetaTags.js.map +1 -0
  355. package/{src/handles/index.ts → dist/handles/index.d.ts} +1 -2
  356. package/dist/handles/index.d.ts.map +1 -0
  357. package/dist/handles/index.js +6 -0
  358. package/dist/handles/index.js.map +1 -0
  359. package/dist/handles/meta.d.ts +39 -0
  360. package/dist/handles/meta.d.ts.map +1 -0
  361. package/dist/handles/meta.js +202 -0
  362. package/dist/handles/meta.js.map +1 -0
  363. package/dist/host/__tests__/errors.test.d.ts +2 -0
  364. package/dist/host/__tests__/errors.test.d.ts.map +1 -0
  365. package/dist/host/__tests__/errors.test.js +76 -0
  366. package/dist/host/__tests__/errors.test.js.map +1 -0
  367. package/dist/host/__tests__/pattern-comprehensive.test.d.ts +2 -0
  368. package/dist/host/__tests__/pattern-comprehensive.test.d.ts.map +1 -0
  369. package/dist/host/__tests__/pattern-comprehensive.test.js +732 -0
  370. package/dist/host/__tests__/pattern-comprehensive.test.js.map +1 -0
  371. package/dist/host/__tests__/pattern-matcher.test.d.ts +2 -0
  372. package/dist/host/__tests__/pattern-matcher.test.d.ts.map +1 -0
  373. package/dist/host/__tests__/pattern-matcher.test.js +251 -0
  374. package/dist/host/__tests__/pattern-matcher.test.js.map +1 -0
  375. package/dist/host/__tests__/router.test.d.ts +2 -0
  376. package/dist/host/__tests__/router.test.d.ts.map +1 -0
  377. package/dist/host/__tests__/router.test.js +241 -0
  378. package/dist/host/__tests__/router.test.js.map +1 -0
  379. package/dist/host/__tests__/testing.test.d.ts +2 -0
  380. package/dist/host/__tests__/testing.test.d.ts.map +1 -0
  381. package/dist/host/__tests__/testing.test.js +64 -0
  382. package/dist/host/__tests__/testing.test.js.map +1 -0
  383. package/dist/host/__tests__/utils.test.d.ts +2 -0
  384. package/dist/host/__tests__/utils.test.d.ts.map +1 -0
  385. package/dist/host/__tests__/utils.test.js +29 -0
  386. package/dist/host/__tests__/utils.test.js.map +1 -0
  387. package/dist/host/cookie-handler.d.ts +34 -0
  388. package/dist/host/cookie-handler.d.ts.map +1 -0
  389. package/dist/host/cookie-handler.js +124 -0
  390. package/dist/host/cookie-handler.js.map +1 -0
  391. package/dist/host/errors.d.ts +56 -0
  392. package/dist/host/errors.d.ts.map +1 -0
  393. package/dist/host/errors.js +79 -0
  394. package/dist/host/errors.js.map +1 -0
  395. package/dist/host/index.d.ts +29 -0
  396. package/dist/host/index.d.ts.map +1 -0
  397. package/dist/host/index.js +32 -0
  398. package/dist/host/index.js.map +1 -0
  399. package/dist/host/pattern-matcher.d.ts +36 -0
  400. package/dist/host/pattern-matcher.d.ts.map +1 -0
  401. package/dist/host/pattern-matcher.js +172 -0
  402. package/dist/host/pattern-matcher.js.map +1 -0
  403. package/dist/host/router.d.ts +26 -0
  404. package/dist/host/router.d.ts.map +1 -0
  405. package/dist/host/router.js +218 -0
  406. package/dist/host/router.js.map +1 -0
  407. package/dist/host/testing.d.ts +36 -0
  408. package/dist/host/testing.d.ts.map +1 -0
  409. package/dist/host/testing.js +55 -0
  410. package/dist/host/testing.js.map +1 -0
  411. package/dist/host/types.d.ts +115 -0
  412. package/dist/host/types.d.ts.map +1 -0
  413. package/dist/host/types.js +7 -0
  414. package/dist/host/types.js.map +1 -0
  415. package/dist/host/utils.d.ts +21 -0
  416. package/dist/host/utils.d.ts.map +1 -0
  417. package/dist/host/utils.js +23 -0
  418. package/dist/host/utils.js.map +1 -0
  419. package/dist/href-client.d.ts +131 -0
  420. package/dist/href-client.d.ts.map +1 -0
  421. package/dist/href-client.js +64 -0
  422. package/dist/href-client.js.map +1 -0
  423. package/dist/href-context.d.ts +29 -0
  424. package/dist/href-context.d.ts.map +1 -0
  425. package/dist/href-context.js +21 -0
  426. package/dist/href-context.js.map +1 -0
  427. package/dist/index.d.ts +73 -0
  428. package/dist/index.d.ts.map +1 -0
  429. package/dist/index.js +91 -0
  430. package/dist/index.js.map +1 -0
  431. package/dist/index.rsc.d.ts +32 -0
  432. package/dist/index.rsc.d.ts.map +1 -0
  433. package/dist/index.rsc.js +40 -0
  434. package/dist/index.rsc.js.map +1 -0
  435. package/dist/internal-debug.d.ts +2 -0
  436. package/dist/internal-debug.d.ts.map +1 -0
  437. package/dist/internal-debug.js +5 -0
  438. package/dist/internal-debug.js.map +1 -0
  439. package/dist/loader.d.ts +14 -0
  440. package/dist/loader.d.ts.map +1 -0
  441. package/dist/loader.js +20 -0
  442. package/dist/loader.js.map +1 -0
  443. package/dist/loader.rsc.d.ts +19 -0
  444. package/dist/loader.rsc.d.ts.map +1 -0
  445. package/dist/loader.rsc.js +99 -0
  446. package/dist/loader.rsc.js.map +1 -0
  447. package/dist/network-error-thrower.d.ts +17 -0
  448. package/dist/network-error-thrower.d.ts.map +1 -0
  449. package/dist/network-error-thrower.js +14 -0
  450. package/dist/network-error-thrower.js.map +1 -0
  451. package/dist/outlet-context.d.ts +13 -0
  452. package/dist/outlet-context.d.ts.map +1 -0
  453. package/dist/outlet-context.js +3 -0
  454. package/dist/outlet-context.js.map +1 -0
  455. package/dist/prerender/__tests__/param-hash.test.d.ts +2 -0
  456. package/dist/prerender/__tests__/param-hash.test.d.ts.map +1 -0
  457. package/dist/prerender/__tests__/param-hash.test.js +148 -0
  458. package/dist/prerender/__tests__/param-hash.test.js.map +1 -0
  459. package/dist/prerender/param-hash.d.ts +16 -0
  460. package/dist/prerender/param-hash.d.ts.map +1 -0
  461. package/dist/prerender/param-hash.js +36 -0
  462. package/dist/prerender/param-hash.js.map +1 -0
  463. package/dist/prerender/store.d.ts +38 -0
  464. package/dist/prerender/store.d.ts.map +1 -0
  465. package/dist/prerender/store.js +61 -0
  466. package/dist/prerender/store.js.map +1 -0
  467. package/dist/prerender.d.ts +66 -0
  468. package/dist/prerender.d.ts.map +1 -0
  469. package/dist/prerender.js +57 -0
  470. package/dist/prerender.js.map +1 -0
  471. package/dist/reverse.d.ts +196 -0
  472. package/dist/reverse.d.ts.map +1 -0
  473. package/dist/reverse.js +78 -0
  474. package/dist/reverse.js.map +1 -0
  475. package/dist/root-error-boundary.d.ts +33 -0
  476. package/dist/root-error-boundary.d.ts.map +1 -0
  477. package/dist/root-error-boundary.js +165 -0
  478. package/dist/root-error-boundary.js.map +1 -0
  479. package/dist/route-content-wrapper.d.ts +46 -0
  480. package/dist/route-content-wrapper.d.ts.map +1 -0
  481. package/dist/route-content-wrapper.js +77 -0
  482. package/dist/route-content-wrapper.js.map +1 -0
  483. package/dist/route-definition.d.ts +421 -0
  484. package/dist/route-definition.d.ts.map +1 -0
  485. package/dist/route-definition.js +868 -0
  486. package/dist/route-definition.js.map +1 -0
  487. package/dist/route-map-builder.d.ts +155 -0
  488. package/dist/route-map-builder.d.ts.map +1 -0
  489. package/dist/route-map-builder.js +237 -0
  490. package/dist/route-map-builder.js.map +1 -0
  491. package/dist/route-types.d.ts +165 -0
  492. package/dist/route-types.d.ts.map +1 -0
  493. package/dist/route-types.js +7 -0
  494. package/dist/route-types.js.map +1 -0
  495. package/dist/router/__tests__/handler-context.test.d.ts +2 -0
  496. package/dist/router/__tests__/handler-context.test.d.ts.map +1 -0
  497. package/dist/router/__tests__/handler-context.test.js +65 -0
  498. package/dist/router/__tests__/handler-context.test.js.map +1 -0
  499. package/dist/router/__tests__/loader-cycle-detection.test.d.ts +2 -0
  500. package/dist/router/__tests__/loader-cycle-detection.test.d.ts.map +1 -0
  501. package/dist/router/__tests__/loader-cycle-detection.test.js +221 -0
  502. package/dist/router/__tests__/loader-cycle-detection.test.js.map +1 -0
  503. package/dist/router/__tests__/match-context.test.d.ts +2 -0
  504. package/dist/router/__tests__/match-context.test.d.ts.map +1 -0
  505. package/dist/router/__tests__/match-context.test.js +92 -0
  506. package/dist/router/__tests__/match-context.test.js.map +1 -0
  507. package/dist/router/__tests__/match-pipelines.test.d.ts +2 -0
  508. package/dist/router/__tests__/match-pipelines.test.d.ts.map +1 -0
  509. package/dist/router/__tests__/match-pipelines.test.js +417 -0
  510. package/dist/router/__tests__/match-pipelines.test.js.map +1 -0
  511. package/dist/router/__tests__/match-result.test.d.ts +2 -0
  512. package/dist/router/__tests__/match-result.test.d.ts.map +1 -0
  513. package/dist/router/__tests__/match-result.test.js +457 -0
  514. package/dist/router/__tests__/match-result.test.js.map +1 -0
  515. package/dist/router/__tests__/on-error.test.d.ts +2 -0
  516. package/dist/router/__tests__/on-error.test.d.ts.map +1 -0
  517. package/dist/router/__tests__/on-error.test.js +678 -0
  518. package/dist/router/__tests__/on-error.test.js.map +1 -0
  519. package/dist/router/__tests__/pattern-matching.test.d.ts +2 -0
  520. package/dist/router/__tests__/pattern-matching.test.d.ts.map +1 -0
  521. package/dist/router/__tests__/pattern-matching.test.js +629 -0
  522. package/dist/router/__tests__/pattern-matching.test.js.map +1 -0
  523. package/dist/router/__tests__/segment-resolution-parallel-loading.test.d.ts +2 -0
  524. package/dist/router/__tests__/segment-resolution-parallel-loading.test.d.ts.map +1 -0
  525. package/dist/router/__tests__/segment-resolution-parallel-loading.test.js +155 -0
  526. package/dist/router/__tests__/segment-resolution-parallel-loading.test.js.map +1 -0
  527. package/dist/router/error-handling.d.ts +77 -0
  528. package/dist/router/error-handling.d.ts.map +1 -0
  529. package/dist/router/error-handling.js +202 -0
  530. package/dist/router/error-handling.js.map +1 -0
  531. package/dist/router/handler-context.d.ts +20 -0
  532. package/dist/router/handler-context.d.ts.map +1 -0
  533. package/dist/router/handler-context.js +198 -0
  534. package/dist/router/handler-context.js.map +1 -0
  535. package/dist/router/intercept-resolution.d.ts +66 -0
  536. package/dist/router/intercept-resolution.d.ts.map +1 -0
  537. package/dist/router/intercept-resolution.js +246 -0
  538. package/dist/router/intercept-resolution.js.map +1 -0
  539. package/dist/router/loader-resolution.d.ts +64 -0
  540. package/dist/router/loader-resolution.d.ts.map +1 -0
  541. package/dist/router/loader-resolution.js +284 -0
  542. package/dist/router/loader-resolution.js.map +1 -0
  543. package/dist/router/logging.d.ts +15 -0
  544. package/dist/router/logging.d.ts.map +1 -0
  545. package/dist/router/logging.js +99 -0
  546. package/dist/router/logging.js.map +1 -0
  547. package/dist/router/manifest.d.ts +22 -0
  548. package/dist/router/manifest.d.ts.map +1 -0
  549. package/dist/router/manifest.js +181 -0
  550. package/dist/router/manifest.js.map +1 -0
  551. package/dist/router/match-api.d.ts +35 -0
  552. package/dist/router/match-api.d.ts.map +1 -0
  553. package/dist/router/match-api.js +406 -0
  554. package/dist/router/match-api.js.map +1 -0
  555. package/dist/router/match-context.d.ts +206 -0
  556. package/dist/router/match-context.d.ts.map +1 -0
  557. package/dist/router/match-context.js +17 -0
  558. package/dist/router/match-context.js.map +1 -0
  559. package/dist/router/match-middleware/background-revalidation.d.ts +127 -0
  560. package/dist/router/match-middleware/background-revalidation.d.ts.map +1 -0
  561. package/dist/router/match-middleware/background-revalidation.js +75 -0
  562. package/dist/router/match-middleware/background-revalidation.js.map +1 -0
  563. package/dist/router/match-middleware/cache-lookup.d.ts +112 -0
  564. package/dist/router/match-middleware/cache-lookup.d.ts.map +1 -0
  565. package/dist/router/match-middleware/cache-lookup.js +257 -0
  566. package/dist/router/match-middleware/cache-lookup.js.map +1 -0
  567. package/dist/router/match-middleware/cache-store.d.ts +113 -0
  568. package/dist/router/match-middleware/cache-store.d.ts.map +1 -0
  569. package/dist/router/match-middleware/cache-store.js +108 -0
  570. package/dist/router/match-middleware/cache-store.js.map +1 -0
  571. package/dist/router/match-middleware/index.d.ts +81 -0
  572. package/dist/router/match-middleware/index.d.ts.map +1 -0
  573. package/dist/router/match-middleware/index.js +80 -0
  574. package/dist/router/match-middleware/index.js.map +1 -0
  575. package/dist/router/match-middleware/intercept-resolution.d.ts +117 -0
  576. package/dist/router/match-middleware/intercept-resolution.d.ts.map +1 -0
  577. package/dist/router/match-middleware/intercept-resolution.js +134 -0
  578. package/dist/router/match-middleware/intercept-resolution.js.map +1 -0
  579. package/dist/router/match-middleware/segment-resolution.d.ts +99 -0
  580. package/dist/router/match-middleware/segment-resolution.d.ts.map +1 -0
  581. package/dist/router/match-middleware/segment-resolution.js +53 -0
  582. package/dist/router/match-middleware/segment-resolution.js.map +1 -0
  583. package/dist/router/match-pipelines.d.ts +147 -0
  584. package/dist/router/match-pipelines.d.ts.map +1 -0
  585. package/dist/router/match-pipelines.js +82 -0
  586. package/dist/router/match-pipelines.js.map +1 -0
  587. package/dist/router/match-result.d.ts +126 -0
  588. package/dist/router/match-result.d.ts.map +1 -0
  589. package/dist/router/match-result.js +93 -0
  590. package/dist/router/match-result.js.map +1 -0
  591. package/dist/router/metrics.d.ts +20 -0
  592. package/dist/router/metrics.d.ts.map +1 -0
  593. package/dist/router/metrics.js +47 -0
  594. package/dist/router/metrics.js.map +1 -0
  595. package/dist/router/middleware.d.ts +249 -0
  596. package/dist/router/middleware.d.ts.map +1 -0
  597. package/dist/router/middleware.js +434 -0
  598. package/dist/router/middleware.js.map +1 -0
  599. package/dist/router/middleware.test.d.ts +2 -0
  600. package/dist/router/middleware.test.d.ts.map +1 -0
  601. package/dist/router/middleware.test.js +816 -0
  602. package/dist/router/middleware.test.js.map +1 -0
  603. package/dist/router/pattern-matching.d.ts +149 -0
  604. package/dist/router/pattern-matching.d.ts.map +1 -0
  605. package/dist/router/pattern-matching.js +349 -0
  606. package/dist/router/pattern-matching.js.map +1 -0
  607. package/dist/router/revalidation.d.ts +44 -0
  608. package/dist/router/revalidation.d.ts.map +1 -0
  609. package/dist/router/revalidation.js +147 -0
  610. package/dist/router/revalidation.js.map +1 -0
  611. package/dist/router/router-context.d.ts +135 -0
  612. package/dist/router/router-context.d.ts.map +1 -0
  613. package/dist/router/router-context.js +36 -0
  614. package/dist/router/router-context.js.map +1 -0
  615. package/dist/router/segment-resolution.d.ts +127 -0
  616. package/dist/router/segment-resolution.d.ts.map +1 -0
  617. package/dist/router/segment-resolution.js +919 -0
  618. package/dist/router/segment-resolution.js.map +1 -0
  619. package/dist/router/trie-matching.d.ts +40 -0
  620. package/dist/router/trie-matching.d.ts.map +1 -0
  621. package/dist/router/trie-matching.js +127 -0
  622. package/dist/router/trie-matching.js.map +1 -0
  623. package/dist/router/types.d.ts +136 -0
  624. package/dist/router/types.d.ts.map +1 -0
  625. package/dist/router/types.js +7 -0
  626. package/dist/router/types.js.map +1 -0
  627. package/dist/router.d.ts +753 -0
  628. package/dist/router.d.ts.map +1 -0
  629. package/dist/router.gen.d.ts +6 -0
  630. package/dist/router.gen.d.ts.map +1 -0
  631. package/dist/router.gen.js +6 -0
  632. package/dist/router.gen.js.map +1 -0
  633. package/dist/router.js +1304 -0
  634. package/dist/router.js.map +1 -0
  635. package/dist/rsc/__tests__/helpers.test.d.ts +2 -0
  636. package/dist/rsc/__tests__/helpers.test.d.ts.map +1 -0
  637. package/dist/rsc/__tests__/helpers.test.js +140 -0
  638. package/dist/rsc/__tests__/helpers.test.js.map +1 -0
  639. package/dist/rsc/handler.d.ts +45 -0
  640. package/dist/rsc/handler.d.ts.map +1 -0
  641. package/dist/rsc/handler.js +1172 -0
  642. package/dist/rsc/handler.js.map +1 -0
  643. package/dist/rsc/helpers.d.ts +16 -0
  644. package/dist/rsc/helpers.d.ts.map +1 -0
  645. package/dist/rsc/helpers.js +55 -0
  646. package/dist/rsc/helpers.js.map +1 -0
  647. package/dist/rsc/index.d.ts +22 -0
  648. package/dist/rsc/index.d.ts.map +1 -0
  649. package/dist/rsc/index.js +23 -0
  650. package/dist/rsc/index.js.map +1 -0
  651. package/dist/rsc/nonce.d.ts +9 -0
  652. package/dist/rsc/nonce.d.ts.map +1 -0
  653. package/dist/rsc/nonce.js +18 -0
  654. package/dist/rsc/nonce.js.map +1 -0
  655. package/dist/rsc/types.d.ts +206 -0
  656. package/dist/rsc/types.d.ts.map +1 -0
  657. package/dist/rsc/types.js +8 -0
  658. package/dist/rsc/types.js.map +1 -0
  659. package/dist/search-params.d.ts +103 -0
  660. package/dist/search-params.d.ts.map +1 -0
  661. package/dist/search-params.js +74 -0
  662. package/dist/search-params.js.map +1 -0
  663. package/dist/segment-system.d.ts +75 -0
  664. package/dist/segment-system.d.ts.map +1 -0
  665. package/dist/segment-system.js +336 -0
  666. package/dist/segment-system.js.map +1 -0
  667. package/dist/server/context.d.ts +245 -0
  668. package/dist/server/context.d.ts.map +1 -0
  669. package/dist/server/context.js +197 -0
  670. package/dist/server/context.js.map +1 -0
  671. package/dist/server/fetchable-loader-store.d.ts +18 -0
  672. package/dist/server/fetchable-loader-store.d.ts.map +1 -0
  673. package/dist/server/fetchable-loader-store.js +18 -0
  674. package/dist/server/fetchable-loader-store.js.map +1 -0
  675. package/dist/server/handle-store.d.ts +85 -0
  676. package/dist/server/handle-store.d.ts.map +1 -0
  677. package/dist/server/handle-store.js +142 -0
  678. package/dist/server/handle-store.js.map +1 -0
  679. package/dist/server/loader-registry.d.ts +55 -0
  680. package/dist/server/loader-registry.d.ts.map +1 -0
  681. package/dist/server/loader-registry.js +132 -0
  682. package/dist/server/loader-registry.js.map +1 -0
  683. package/dist/server/request-context.d.ts +226 -0
  684. package/dist/server/request-context.d.ts.map +1 -0
  685. package/dist/server/request-context.js +290 -0
  686. package/dist/server/request-context.js.map +1 -0
  687. package/dist/server/root-layout.d.ts +4 -0
  688. package/dist/server/root-layout.d.ts.map +1 -0
  689. package/dist/server/root-layout.js +5 -0
  690. package/dist/server/root-layout.js.map +1 -0
  691. package/dist/server.d.ts +15 -0
  692. package/dist/server.d.ts.map +1 -0
  693. package/dist/server.js +20 -0
  694. package/dist/server.js.map +1 -0
  695. package/dist/ssr/__tests__/ssr-handler.test.d.ts +2 -0
  696. package/dist/ssr/__tests__/ssr-handler.test.d.ts.map +1 -0
  697. package/dist/ssr/__tests__/ssr-handler.test.js +132 -0
  698. package/dist/ssr/__tests__/ssr-handler.test.js.map +1 -0
  699. package/dist/ssr/index.d.ts +98 -0
  700. package/dist/ssr/index.d.ts.map +1 -0
  701. package/dist/ssr/index.js +158 -0
  702. package/dist/ssr/index.js.map +1 -0
  703. package/dist/static-handler.d.ts +50 -0
  704. package/dist/static-handler.d.ts.map +1 -0
  705. package/dist/static-handler.gen.d.ts +5 -0
  706. package/dist/static-handler.gen.d.ts.map +1 -0
  707. package/dist/static-handler.gen.js +5 -0
  708. package/dist/static-handler.gen.js.map +1 -0
  709. package/dist/static-handler.js +29 -0
  710. package/dist/static-handler.js.map +1 -0
  711. package/dist/testing/vitest.js +82 -0
  712. package/dist/theme/ThemeProvider.d.ts +20 -0
  713. package/dist/theme/ThemeProvider.d.ts.map +1 -0
  714. package/dist/theme/ThemeProvider.js +240 -0
  715. package/dist/theme/ThemeProvider.js.map +1 -0
  716. package/dist/theme/ThemeScript.d.ts +48 -0
  717. package/dist/theme/ThemeScript.d.ts.map +1 -0
  718. package/dist/theme/ThemeScript.js +13 -0
  719. package/dist/theme/ThemeScript.js.map +1 -0
  720. package/dist/theme/__tests__/theme.test.d.ts +2 -0
  721. package/dist/theme/__tests__/theme.test.d.ts.map +1 -0
  722. package/dist/theme/__tests__/theme.test.js +103 -0
  723. package/dist/theme/__tests__/theme.test.js.map +1 -0
  724. package/dist/theme/constants.d.ts +29 -0
  725. package/dist/theme/constants.d.ts.map +1 -0
  726. package/dist/theme/constants.js +48 -0
  727. package/dist/theme/constants.js.map +1 -0
  728. package/dist/theme/index.d.ts +31 -0
  729. package/dist/theme/index.d.ts.map +1 -0
  730. package/dist/theme/index.js +36 -0
  731. package/dist/theme/index.js.map +1 -0
  732. package/dist/theme/theme-context.d.ts +40 -0
  733. package/dist/theme/theme-context.d.ts.map +1 -0
  734. package/dist/theme/theme-context.js +60 -0
  735. package/dist/theme/theme-context.js.map +1 -0
  736. package/dist/theme/theme-script.d.ts +27 -0
  737. package/dist/theme/theme-script.d.ts.map +1 -0
  738. package/dist/theme/theme-script.js +147 -0
  739. package/dist/theme/theme-script.js.map +1 -0
  740. package/dist/theme/types.d.ts +163 -0
  741. package/dist/theme/types.d.ts.map +1 -0
  742. package/dist/theme/types.js +11 -0
  743. package/dist/theme/types.js.map +1 -0
  744. package/dist/theme/use-theme.d.ts +12 -0
  745. package/dist/theme/use-theme.d.ts.map +1 -0
  746. package/dist/theme/use-theme.js +40 -0
  747. package/dist/theme/use-theme.js.map +1 -0
  748. package/dist/types.d.ts +1479 -0
  749. package/dist/types.d.ts.map +1 -0
  750. package/dist/types.js +10 -0
  751. package/dist/types.js.map +1 -0
  752. package/dist/urls.d.ts +441 -0
  753. package/dist/urls.d.ts.map +1 -0
  754. package/dist/urls.gen.d.ts +8 -0
  755. package/dist/urls.gen.d.ts.map +1 -0
  756. package/dist/urls.gen.js +8 -0
  757. package/dist/urls.gen.js.map +1 -0
  758. package/dist/urls.js +443 -0
  759. package/dist/urls.js.map +1 -0
  760. package/dist/use-loader.d.ts +127 -0
  761. package/dist/use-loader.d.ts.map +1 -0
  762. package/dist/use-loader.js +237 -0
  763. package/dist/use-loader.js.map +1 -0
  764. package/dist/vite/__tests__/ast-handler-extract.test.d.ts +2 -0
  765. package/dist/vite/__tests__/ast-handler-extract.test.d.ts.map +1 -0
  766. package/dist/vite/__tests__/ast-handler-extract.test.js +294 -0
  767. package/dist/vite/__tests__/ast-handler-extract.test.js.map +1 -0
  768. package/dist/vite/__tests__/expose-id-utils.test.d.ts +2 -0
  769. package/dist/vite/__tests__/expose-id-utils.test.d.ts.map +1 -0
  770. package/dist/vite/__tests__/expose-id-utils.test.js +224 -0
  771. package/dist/vite/__tests__/expose-id-utils.test.js.map +1 -0
  772. package/dist/vite/__tests__/expose-internal-ids.test.d.ts +2 -0
  773. package/dist/vite/__tests__/expose-internal-ids.test.d.ts.map +1 -0
  774. package/dist/vite/__tests__/expose-internal-ids.test.js +647 -0
  775. package/dist/vite/__tests__/expose-internal-ids.test.js.map +1 -0
  776. package/dist/vite/__tests__/expose-router-id.test.d.ts +2 -0
  777. package/dist/vite/__tests__/expose-router-id.test.d.ts.map +1 -0
  778. package/dist/vite/__tests__/expose-router-id.test.js +39 -0
  779. package/dist/vite/__tests__/expose-router-id.test.js.map +1 -0
  780. package/dist/vite/ast-handler-extract.d.ts +49 -0
  781. package/dist/vite/ast-handler-extract.d.ts.map +1 -0
  782. package/dist/vite/ast-handler-extract.js +249 -0
  783. package/dist/vite/ast-handler-extract.js.map +1 -0
  784. package/dist/vite/expose-action-id.d.ts +19 -0
  785. package/dist/vite/expose-action-id.d.ts.map +1 -0
  786. package/dist/vite/expose-action-id.js +250 -0
  787. package/dist/vite/expose-action-id.js.map +1 -0
  788. package/dist/vite/expose-id-utils.d.ts +69 -0
  789. package/dist/vite/expose-id-utils.d.ts.map +1 -0
  790. package/dist/vite/expose-id-utils.js +289 -0
  791. package/dist/vite/expose-id-utils.js.map +1 -0
  792. package/dist/vite/expose-internal-ids.d.ts +22 -0
  793. package/dist/vite/expose-internal-ids.d.ts.map +1 -0
  794. package/dist/vite/expose-internal-ids.js +886 -0
  795. package/dist/vite/expose-internal-ids.js.map +1 -0
  796. package/dist/vite/index.d.ts +149 -0
  797. package/dist/vite/index.d.ts.map +1 -0
  798. package/dist/vite/index.js +1165 -310
  799. package/dist/vite/index.js.bak +5448 -0
  800. package/dist/vite/index.js.map +1 -0
  801. package/dist/vite/index.named-routes.gen.ts +103 -0
  802. package/dist/vite/package-resolution.d.ts +43 -0
  803. package/dist/vite/package-resolution.d.ts.map +1 -0
  804. package/dist/vite/package-resolution.js +112 -0
  805. package/dist/vite/package-resolution.js.map +1 -0
  806. package/dist/vite/virtual-entries.d.ts +25 -0
  807. package/dist/vite/virtual-entries.d.ts.map +1 -0
  808. package/dist/vite/virtual-entries.js +110 -0
  809. package/dist/vite/virtual-entries.js.map +1 -0
  810. package/package.json +71 -7
  811. package/skills/api-client/SKILL.md +211 -0
  812. package/skills/breadcrumbs/SKILL.md +61 -1
  813. package/skills/bundle-analysis/SKILL.md +2 -2
  814. package/skills/cache-guide/SKILL.md +2 -2
  815. package/skills/caching/SKILL.md +92 -10
  816. package/skills/css/SKILL.md +76 -0
  817. package/skills/debug-manifest/SKILL.md +4 -2
  818. package/skills/document-cache/SKILL.md +2 -2
  819. package/skills/handler-use/SKILL.md +1 -1
  820. package/skills/hooks/SKILL.md +40 -29
  821. package/skills/host-router/SKILL.md +80 -3
  822. package/skills/intercept/SKILL.md +5 -3
  823. package/skills/layout/SKILL.md +11 -6
  824. package/skills/loader/SKILL.md +25 -19
  825. package/skills/middleware/SKILL.md +4 -2
  826. package/skills/migrate-nextjs/SKILL.md +3 -1
  827. package/skills/migrate-react-router/SKILL.md +4 -2
  828. package/skills/mime-routes/SKILL.md +2 -2
  829. package/skills/observability/SKILL.md +61 -4
  830. package/skills/parallel/SKILL.md +9 -4
  831. package/skills/prerender/SKILL.md +31 -10
  832. package/skills/rango/SKILL.md +31 -10
  833. package/skills/response-routes/SKILL.md +63 -45
  834. package/skills/route/SKILL.md +14 -2
  835. package/skills/router-setup/SKILL.md +27 -3
  836. package/skills/scripts/SKILL.md +179 -0
  837. package/skills/server-actions/SKILL.md +25 -1
  838. package/skills/tailwind/SKILL.md +27 -3
  839. package/skills/testing/SKILL.md +129 -0
  840. package/skills/testing/bindings.md +103 -0
  841. package/skills/testing/cache-prerender.md +127 -0
  842. package/skills/testing/client-components.md +124 -0
  843. package/skills/testing/e2e-parity.md +125 -0
  844. package/skills/testing/flight.md +91 -0
  845. package/skills/testing/handles.md +129 -0
  846. package/skills/testing/loader.md +128 -0
  847. package/skills/testing/middleware.md +99 -0
  848. package/skills/testing/render-handler.md +121 -0
  849. package/skills/testing/response-routes.md +95 -0
  850. package/skills/testing/reverse-and-types.md +84 -0
  851. package/skills/testing/server-actions.md +107 -0
  852. package/skills/testing/server-tree.md +128 -0
  853. package/skills/testing/setup.md +123 -0
  854. package/skills/typesafety/SKILL.md +6 -5
  855. package/skills/use-cache/SKILL.md +10 -9
  856. package/skills/vercel/SKILL.md +128 -0
  857. package/src/__augment-tests__/augmented.check.ts +2 -3
  858. package/src/__internal.ts +0 -65
  859. package/src/browser/action-coordinator.ts +1 -1
  860. package/src/browser/action-fence.ts +47 -0
  861. package/src/browser/app-shell.ts +14 -27
  862. package/src/browser/connection-warmup.ts +134 -0
  863. package/src/browser/cookie-name.ts +140 -0
  864. package/src/browser/event-controller.ts +115 -89
  865. package/src/browser/invalidate-client-cache.ts +52 -0
  866. package/src/browser/navigation-bridge.ts +16 -52
  867. package/src/browser/navigation-client.ts +84 -69
  868. package/src/browser/navigation-store-handle.ts +38 -0
  869. package/src/browser/navigation-store.ts +25 -74
  870. package/src/browser/navigation-transaction.ts +0 -32
  871. package/src/browser/partial-update.ts +81 -127
  872. package/src/browser/prefetch/cache.ts +99 -72
  873. package/src/browser/prefetch/fetch.ts +176 -34
  874. package/src/browser/prefetch/queue.ts +6 -3
  875. package/src/browser/rango-state.ts +157 -115
  876. package/src/browser/react/Link.tsx +30 -7
  877. package/src/browser/react/NavigationProvider.tsx +32 -95
  878. package/src/browser/react/ScrollRestoration.tsx +10 -6
  879. package/src/browser/react/filter-segment-order.ts +17 -2
  880. package/src/browser/react/index.ts +0 -51
  881. package/src/browser/react/location-state-shared.ts +14 -15
  882. package/src/browser/react/location-state.ts +0 -1
  883. package/src/browser/react/use-action.ts +6 -15
  884. package/src/browser/react/use-handle.ts +0 -5
  885. package/src/browser/react/use-href.tsx +8 -1
  886. package/src/browser/react/use-link-status.ts +33 -8
  887. package/src/browser/react/use-navigation.ts +10 -5
  888. package/src/browser/react/use-params.ts +0 -2
  889. package/src/browser/react/use-router.ts +6 -4
  890. package/src/browser/react/use-search-params.ts +0 -5
  891. package/src/browser/react/use-segments.ts +0 -13
  892. package/src/browser/response-adapter.ts +41 -4
  893. package/src/browser/rsc-router.tsx +43 -18
  894. package/src/browser/scroll-restoration.ts +8 -3
  895. package/src/browser/server-action-bridge.ts +194 -28
  896. package/src/browser/types.ts +40 -21
  897. package/src/browser/validate-redirect-origin.ts +43 -16
  898. package/src/build/generate-route-types.ts +1 -1
  899. package/src/build/index.ts +8 -4
  900. package/src/build/prefix-tree-utils.ts +123 -0
  901. package/src/build/route-trie.ts +117 -15
  902. package/src/build/route-types/ast-route-extraction.ts +15 -8
  903. package/src/build/route-types/codegen.ts +12 -1
  904. package/src/build/route-types/include-resolution.ts +116 -22
  905. package/src/build/route-types/param-extraction.ts +6 -3
  906. package/src/build/route-types/per-module-writer.ts +15 -2
  907. package/src/build/route-types/router-processing.ts +77 -41
  908. package/src/build/route-types/source-scan.ts +105 -7
  909. package/src/cache/cache-key-utils.ts +29 -13
  910. package/src/cache/cache-policy.ts +42 -62
  911. package/src/cache/cache-runtime.ts +126 -30
  912. package/src/cache/cache-scope.ts +118 -43
  913. package/src/cache/cache-tag.ts +7 -39
  914. package/src/cache/cf/cf-base64.ts +33 -0
  915. package/src/cache/cf/cf-cache-constants.ts +127 -0
  916. package/src/cache/cf/cf-cache-store.ts +1257 -537
  917. package/src/cache/cf/cf-cache-types.ts +349 -0
  918. package/src/cache/cf/cf-kv-utils.ts +46 -0
  919. package/src/cache/cf/cf-tag-marker-memo.ts +105 -0
  920. package/src/cache/cf/index.ts +6 -19
  921. package/src/cache/document-cache.ts +32 -32
  922. package/src/cache/handle-snapshot.ts +70 -0
  923. package/src/cache/index.ts +20 -24
  924. package/src/cache/memory-segment-store.ts +3 -48
  925. package/src/cache/profile-registry.ts +31 -31
  926. package/src/cache/read-through-swr.ts +41 -11
  927. package/src/cache/segment-codec.ts +9 -17
  928. package/src/cache/tag-invalidation.ts +29 -5
  929. package/src/cache/types.ts +14 -104
  930. package/src/cache/vercel/index.ts +11 -0
  931. package/src/cache/vercel/vercel-cache-store.ts +855 -0
  932. package/src/client.rsc.tsx +42 -22
  933. package/src/client.tsx +31 -58
  934. package/src/cloudflare/index.ts +11 -0
  935. package/src/cloudflare/tracing.ts +109 -0
  936. package/src/component-utils.ts +19 -0
  937. package/src/components/DefaultDocument.tsx +8 -2
  938. package/src/context-var.ts +13 -1
  939. package/src/decode-loader-results.ts +18 -2
  940. package/src/defer.ts +196 -0
  941. package/src/deps/ssr.ts +0 -1
  942. package/src/encode-kv.ts +49 -0
  943. package/src/errors.ts +0 -3
  944. package/src/escape-script.ts +52 -0
  945. package/src/handle.ts +28 -18
  946. package/src/handles/MetaTags.tsx +56 -19
  947. package/src/handles/Scripts.tsx +183 -0
  948. package/src/handles/breadcrumbs.ts +37 -8
  949. package/src/handles/is-thenable.ts +19 -0
  950. package/src/handles/meta.ts +51 -40
  951. package/src/handles/script.ts +244 -0
  952. package/src/host/cookie-handler.ts +9 -60
  953. package/src/host/errors.ts +0 -24
  954. package/src/host/index.ts +6 -0
  955. package/src/host/pattern-matcher.ts +23 -52
  956. package/src/host/router.ts +1 -65
  957. package/src/host/testing.ts +40 -27
  958. package/src/host/types.ts +6 -2
  959. package/src/href-client.ts +7 -12
  960. package/src/index.rsc.ts +75 -8
  961. package/src/index.ts +60 -4
  962. package/src/internal-debug.ts +2 -4
  963. package/src/loader.rsc.ts +19 -9
  964. package/src/loader.ts +12 -4
  965. package/src/network-error-thrower.tsx +1 -6
  966. package/src/outlet-provider.tsx +1 -5
  967. package/src/prerender/param-hash.ts +16 -16
  968. package/src/prerender/store.ts +32 -37
  969. package/src/prerender.ts +58 -3
  970. package/src/redirect-origin.ts +100 -0
  971. package/src/regex-escape.ts +8 -0
  972. package/src/response-utils.ts +25 -0
  973. package/src/root-error-boundary.tsx +1 -19
  974. package/src/route-content-wrapper.tsx +1 -44
  975. package/src/route-definition/dsl-helpers.ts +39 -21
  976. package/src/route-definition/helpers-types.ts +3 -3
  977. package/src/route-definition/redirect.ts +44 -11
  978. package/src/route-definition/resolve-handler-use.ts +6 -0
  979. package/src/route-map-builder.ts +0 -16
  980. package/src/router/basename.ts +14 -0
  981. package/src/router/content-negotiation.ts +58 -23
  982. package/src/router/error-handling.ts +44 -17
  983. package/src/router/find-match.ts +44 -23
  984. package/src/router/handler-context.ts +6 -1
  985. package/src/router/instrument.ts +350 -0
  986. package/src/router/intercept-resolution.ts +35 -2
  987. package/src/router/lazy-includes.ts +7 -44
  988. package/src/router/loader-resolution.ts +139 -73
  989. package/src/router/logging.ts +0 -6
  990. package/src/router/manifest.ts +18 -29
  991. package/src/router/match-api.ts +0 -20
  992. package/src/router/match-context.ts +0 -22
  993. package/src/router/match-handlers.ts +57 -58
  994. package/src/router/match-middleware/background-revalidation.ts +6 -7
  995. package/src/router/match-middleware/cache-lookup.ts +115 -194
  996. package/src/router/match-middleware/cache-store.ts +28 -32
  997. package/src/router/match-middleware/intercept-resolution.ts +0 -22
  998. package/src/router/match-middleware/segment-resolution.ts +0 -22
  999. package/src/router/match-pipelines.ts +1 -42
  1000. package/src/router/match-result.ts +1 -52
  1001. package/src/router/metrics.ts +0 -34
  1002. package/src/router/middleware-types.ts +0 -116
  1003. package/src/router/middleware.ts +175 -90
  1004. package/src/router/navigation-snapshot.ts +0 -51
  1005. package/src/router/params-util.ts +23 -0
  1006. package/src/router/pattern-matching.ts +47 -89
  1007. package/src/router/prefetch-cache-ttl.ts +51 -0
  1008. package/src/router/prerender-match.ts +101 -64
  1009. package/src/router/request-classification.ts +25 -35
  1010. package/src/router/revalidation.ts +75 -81
  1011. package/src/router/route-snapshot.ts +0 -1
  1012. package/src/router/router-context.ts +3 -28
  1013. package/src/router/router-interfaces.ts +38 -7
  1014. package/src/router/router-options.ts +111 -4
  1015. package/src/router/segment-resolution/fresh.ts +66 -78
  1016. package/src/router/segment-resolution/helpers.ts +86 -6
  1017. package/src/router/segment-resolution/loader-cache.ts +57 -23
  1018. package/src/router/segment-resolution/revalidation.ts +212 -304
  1019. package/src/router/segment-resolution/static-store.ts +19 -5
  1020. package/src/router/segment-resolution/streamed-handler-telemetry.ts +52 -0
  1021. package/src/router/segment-resolution.ts +5 -1
  1022. package/src/router/segment-wrappers.ts +6 -5
  1023. package/src/router/state-cookie-name.ts +33 -0
  1024. package/src/router/telemetry-otel.ts +161 -199
  1025. package/src/router/telemetry.ts +96 -19
  1026. package/src/router/timeout.ts +0 -20
  1027. package/src/router/tracing.ts +206 -0
  1028. package/src/router/trie-matching.ts +163 -64
  1029. package/src/router/types.ts +1 -63
  1030. package/src/router/url-params.ts +0 -5
  1031. package/src/router.ts +87 -37
  1032. package/src/rsc/handler-context.ts +1 -0
  1033. package/src/rsc/handler.ts +232 -153
  1034. package/src/rsc/helpers.ts +97 -4
  1035. package/src/rsc/index.ts +1 -4
  1036. package/src/rsc/json-route-result.ts +38 -0
  1037. package/src/rsc/loader-fetch.ts +114 -38
  1038. package/src/rsc/manifest-init.ts +28 -41
  1039. package/src/rsc/origin-guard.ts +11 -15
  1040. package/src/rsc/progressive-enhancement.ts +59 -9
  1041. package/src/rsc/redirect-guard.ts +99 -0
  1042. package/src/rsc/response-cache-serve.ts +238 -0
  1043. package/src/rsc/response-error.ts +79 -12
  1044. package/src/rsc/response-route-handler.ts +57 -147
  1045. package/src/rsc/rsc-rendering.ts +64 -24
  1046. package/src/rsc/runtime-warnings.ts +14 -0
  1047. package/src/rsc/server-action.ts +244 -81
  1048. package/src/rsc/types.ts +15 -3
  1049. package/src/runtime-env.ts +18 -0
  1050. package/src/search-params.ts +31 -26
  1051. package/src/segment-loader-promise.ts +31 -4
  1052. package/src/segment-system.tsx +89 -89
  1053. package/src/server/context.ts +32 -0
  1054. package/src/server/cookie-parse.ts +32 -0
  1055. package/src/server/cookie-store.ts +52 -1
  1056. package/src/server/handle-store.ts +21 -38
  1057. package/src/server/loader-registry.ts +21 -42
  1058. package/src/server/request-context.ts +189 -131
  1059. package/src/ssr/index.tsx +19 -18
  1060. package/src/static-handler.ts +10 -13
  1061. package/src/testing/cache-status.ts +162 -0
  1062. package/src/testing/collect-handle.ts +40 -0
  1063. package/src/testing/dispatch.ts +701 -0
  1064. package/src/testing/dom.entry.ts +22 -0
  1065. package/src/testing/e2e/fixture.ts +188 -0
  1066. package/src/testing/e2e/index.ts +128 -0
  1067. package/src/testing/e2e/matchers.ts +35 -0
  1068. package/src/testing/e2e/page-helpers.ts +272 -0
  1069. package/src/testing/e2e/parity.ts +387 -0
  1070. package/src/testing/e2e/server.ts +195 -0
  1071. package/src/testing/flight-matchers.ts +97 -0
  1072. package/src/testing/flight-normalize.ts +11 -0
  1073. package/src/testing/flight-runtime.d.ts +57 -0
  1074. package/src/testing/flight-tree.ts +682 -0
  1075. package/src/testing/flight.entry.ts +52 -0
  1076. package/src/testing/flight.ts +257 -0
  1077. package/src/testing/generated-routes.ts +183 -0
  1078. package/src/testing/index.ts +99 -0
  1079. package/src/testing/internal/context.ts +371 -0
  1080. package/src/testing/internal/flight-client-globals.ts +30 -0
  1081. package/src/testing/internal/seed-vars.ts +54 -0
  1082. package/src/testing/render-handler.ts +343 -0
  1083. package/src/testing/render-route.tsx +581 -0
  1084. package/src/testing/run-loader.ts +385 -0
  1085. package/src/testing/run-middleware.ts +205 -0
  1086. package/src/testing/vitest-stubs/cloudflare-email.ts +9 -0
  1087. package/src/testing/vitest-stubs/cloudflare-workers.ts +21 -0
  1088. package/src/testing/vitest-stubs/plugin-rsc.ts +16 -0
  1089. package/src/testing/vitest-stubs/version.ts +5 -0
  1090. package/src/testing/vitest.ts +305 -0
  1091. package/src/theme/ThemeProvider.tsx +20 -58
  1092. package/src/theme/ThemeScript.tsx +7 -9
  1093. package/src/theme/constants.ts +52 -13
  1094. package/src/theme/index.ts +0 -7
  1095. package/src/theme/theme-context.ts +1 -5
  1096. package/src/theme/theme-script.ts +22 -21
  1097. package/src/theme/use-theme.ts +0 -3
  1098. package/src/types/boundaries.ts +0 -35
  1099. package/src/types/cache-types.ts +3 -3
  1100. package/src/types/error-types.ts +25 -89
  1101. package/src/types/global-namespace.ts +15 -15
  1102. package/src/types/handler-context.ts +44 -14
  1103. package/src/types/index.ts +0 -10
  1104. package/src/types/loader-types.ts +6 -3
  1105. package/src/types/request-scope.ts +8 -22
  1106. package/src/types/route-config.ts +6 -50
  1107. package/src/types/route-entry.ts +0 -6
  1108. package/src/types/segments.ts +0 -13
  1109. package/src/urls/include-helper.ts +0 -4
  1110. package/src/urls/index.ts +1 -8
  1111. package/src/urls/path-helper-types.ts +8 -2
  1112. package/src/urls/path-helper.ts +0 -54
  1113. package/src/urls/type-extraction.ts +33 -24
  1114. package/src/urls/urls-function.ts +0 -13
  1115. package/src/use-loader.tsx +0 -186
  1116. package/src/vercel/index.ts +11 -0
  1117. package/src/vercel/tracing.ts +88 -0
  1118. package/src/vite/discovery/bundle-postprocess.ts +2 -1
  1119. package/src/vite/discovery/discover-routers.ts +33 -42
  1120. package/src/vite/discovery/prerender-collection.ts +33 -46
  1121. package/src/vite/discovery/state.ts +12 -1
  1122. package/src/vite/discovery/virtual-module-codegen.ts +1 -11
  1123. package/src/vite/index.ts +2 -0
  1124. package/src/vite/plugin-types.ts +143 -10
  1125. package/src/vite/plugins/cjs-to-esm.ts +8 -12
  1126. package/src/vite/plugins/client-ref-dedup.ts +0 -11
  1127. package/src/vite/plugins/client-ref-hashing.ts +0 -10
  1128. package/src/vite/plugins/cloudflare-protocol-stub.ts +0 -20
  1129. package/src/vite/plugins/expose-action-id.ts +2 -73
  1130. package/src/vite/plugins/expose-id-utils.ts +85 -56
  1131. package/src/vite/plugins/expose-ids/export-analysis.ts +30 -43
  1132. package/src/vite/plugins/expose-ids/handler-transform.ts +5 -31
  1133. package/src/vite/plugins/expose-ids/loader-transform.ts +12 -20
  1134. package/src/vite/plugins/expose-ids/router-transform.ts +98 -26
  1135. package/src/vite/plugins/expose-internal-ids.ts +10 -1
  1136. package/src/vite/plugins/performance-tracks.ts +0 -3
  1137. package/src/vite/plugins/refresh-cmd.ts +1 -1
  1138. package/src/vite/plugins/use-cache-transform.ts +21 -46
  1139. package/src/vite/plugins/vercel-output.ts +295 -0
  1140. package/src/vite/plugins/version-injector.ts +0 -20
  1141. package/src/vite/plugins/version-plugin.ts +6 -66
  1142. package/src/vite/plugins/virtual-entries.ts +70 -17
  1143. package/src/vite/rango.ts +135 -134
  1144. package/src/vite/router-discovery.ts +21 -8
  1145. package/src/vite/utils/ast-handler-extract.ts +11 -20
  1146. package/src/vite/utils/bundle-analysis.ts +6 -13
  1147. package/src/vite/utils/client-chunks.ts +0 -6
  1148. package/src/vite/utils/directive-prologue.ts +40 -0
  1149. package/src/vite/utils/forward-user-plugins.ts +0 -22
  1150. package/src/vite/utils/manifest-utils.ts +4 -75
  1151. package/src/vite/utils/package-resolution.ts +1 -73
  1152. package/src/vite/utils/prerender-utils.ts +54 -40
  1153. package/src/vite/utils/shared-utils.ts +8 -37
  1154. package/src/browser/shallow.ts +0 -40
  1155. package/src/router/middleware-cookies.ts +0 -55
@@ -5,9 +5,7 @@ import {
5
5
 
6
6
  /**
7
7
  * Find matching close paren in bundled code using depth counting.
8
- * Uses skipStringOrComment from expose-id-utils to correctly handle
9
- * template literal ${...} expressions, comments, and nested strings.
10
- * Returns the position after the closing paren, or -1 if unmatched.
8
+ * Uses skipStringOrComment to correctly handle template literals, comments, and nested strings.
11
9
  * @internal Exported for testing only.
12
10
  */
13
11
  export function findMatchingParenInBundle(
@@ -30,9 +28,8 @@ export function findMatchingParenInBundle(
30
28
  }
31
29
 
32
30
  /**
33
- * Scan a bundled chunk for handler exports of a given type and extract
34
- * their names + $$id values. Optionally detects passthrough flag.
35
- * @internal Exported for testing only.
31
+ * Scan a bundled chunk for handler exports and extract their names + $$id values.
32
+ * Optionally detects passthrough flag. @internal Exported for testing only.
36
33
  */
37
34
  export function extractHandlerExportsFromChunk(
38
35
  chunkCode: string,
@@ -67,7 +64,7 @@ export function extractHandlerExportsFromChunk(
67
64
  const closePos = findMatchingParenInBundle(chunkCode, afterOpen);
68
65
  if (closePos !== -1) {
69
66
  const callBody = chunkCode.slice(callStart.index, closePos);
70
- isPassthrough = /passthrough\s*:\s*(!0|true)/.test(callBody);
67
+ isPassthrough = /passthrough\s*:\s*(!0|true)/.test(callBody); // !0 is minified true
71
68
  }
72
69
  }
73
70
  }
@@ -79,9 +76,8 @@ export function extractHandlerExportsFromChunk(
79
76
  }
80
77
 
81
78
  /**
82
- * Evict handler code from a bundled chunk, replacing full handler call
83
- * expressions with lightweight stub objects. Returns the modified code
84
- * and bytes saved, or null if no changes were made.
79
+ * Evict handler code from a bundled chunk, replacing full call expressions with stubs.
80
+ * Returns the modified code and bytes saved, or null if no changes were made.
85
81
  * @internal Exported for testing only.
86
82
  */
87
83
  export function evictHandlerCode(
@@ -110,13 +106,11 @@ export function evictHandlerCode(
110
106
  const closePos = findMatchingParenInBundle(modified, afterOpen);
111
107
  if (closePos === -1) continue;
112
108
 
113
- // Skip trailing whitespace and optional semicolon
114
109
  let rangeEnd = closePos;
115
110
  while (rangeEnd < modified.length && /\s/.test(modified[rangeEnd]))
116
111
  rangeEnd++;
117
112
  if (modified[rangeEnd] === ";") rangeEnd++;
118
113
 
119
- // Validate: matched range must contain the expected handlerId
120
114
  const matched = modified.slice(startMatch.index, rangeEnd);
121
115
  if (!matched.includes(handlerId)) continue;
122
116
 
@@ -124,7 +118,6 @@ export function evictHandlerCode(
124
118
  modified =
125
119
  modified.slice(0, startMatch.index) + stub + modified.slice(rangeEnd);
126
120
 
127
- // Remove the now-redundant $$id assignment line.
128
121
  modified = modified.replace(
129
122
  new RegExp(`\\n${eName}\\.\\$\\$id\\s*=\\s*"[^"]+";`),
130
123
  "",
@@ -1,9 +1,3 @@
1
- // Resolution of the public `clientChunks` option into the callback shape that
2
- // @vitejs/plugin-rsc expects. See plugin-types.ts (ClientChunks) and
3
- // docs/client-chunking.md for the contract. The mechanism: a distinct returned
4
- // name yields a distinct, dynamically-imported client chunk, independent of how
5
- // the RSC/server build chunked the importing modules.
6
-
7
1
  import type { ClientChunkMeta, ClientChunks } from "../plugin-types.js";
8
2
  import { createRangoDebugger, NS } from "../debug.js";
9
3
  import { hashRefKey } from "../plugins/client-ref-hashing.js";
@@ -0,0 +1,40 @@
1
+ import { parseAst } from "vite";
2
+
3
+ /**
4
+ * Detect a leading `"use client"` (or `'use client'`) directive in a module's
5
+ * directive prologue, tolerating leading comments/whitespace before it.
6
+ *
7
+ * A bare `source.trimStart().startsWith` check only strips whitespace, so a
8
+ * license banner / `// @ts-nocheck` before the directive would be missed. This
9
+ * walks the leading ExpressionStatement string-literal directives via the AST
10
+ * (a leading comment is not a `program.body` node), the single source of truth
11
+ * shared by both the rango plugin's HMR client-module sniff and the version
12
+ * plugin's getClientModuleSignature — so the two can never drift on what counts
13
+ * as a client module.
14
+ *
15
+ * Returns false when the source cannot be parsed (a syntactically broken file is
16
+ * not treated as a client module).
17
+ */
18
+ export function hasUseClientDirective(source: string): boolean {
19
+ let program: { body?: any[] };
20
+ try {
21
+ program = parseAst(source, { lang: "tsx" }) as { body?: any[] };
22
+ } catch {
23
+ return false;
24
+ }
25
+ for (const node of program.body ?? []) {
26
+ if (
27
+ node?.type === "ExpressionStatement" &&
28
+ node.expression?.type === "Literal" &&
29
+ typeof node.expression.value === "string"
30
+ ) {
31
+ if (node.expression.value === "use client") return true;
32
+ // Another leading string-literal directive (e.g. "use strict"): keep
33
+ // scanning the prologue.
34
+ continue;
35
+ }
36
+ // First non-directive statement ends the prologue.
37
+ break;
38
+ }
39
+ return false;
40
+ }
@@ -1,25 +1,3 @@
1
- /**
2
- * Discovery Runner Config Parity
3
- *
4
- * The discovery temp server (createTempRscServer) runs the user's handler
5
- * graph through a throwaway Node Vite server built with `configFile: false`.
6
- * Without help, that server only sees a fixed Rango-owned plugin set, so any
7
- * user resolution is absent during discovery, prerender, and static handler
8
- * rendering — even though it applies at request time. Two flavors of user
9
- * resolution must be carried across:
10
- *
11
- * - Third-party resolveId plugins (e.g. vite-tsconfig-paths) — forwarded as
12
- * plugin instances, see selectForwardableResolvePlugins.
13
- * - Native config-driven resolution, including Vite 8's built-in
14
- * `resolve.tsconfigPaths` (which supersedes vite-tsconfig-paths) — forwarded
15
- * as the data slice, see pickForwardedRunnerConfig.
16
- *
17
- * These helpers extract the resolution-relevant slice of the user's resolved
18
- * config (resolve.*, define, oxc) and forward the user's resolution plugins
19
- * into the temp server so discovery resolves modules the same way the real
20
- * environment does.
21
- */
22
-
23
1
  import type { Plugin, ResolvedConfig, UserConfig } from "vite";
24
2
 
25
3
  /**
@@ -1,78 +1,7 @@
1
- /**
2
- * Flatten prefix tree leaf nodes into precomputed route entries.
3
- * Leaf nodes have no children (no nested includes), so their routes can be
4
- * used directly by evaluateLazyEntry() without running the handler.
5
- * Non-leaf nodes are skipped because they have nested lazy includes that
6
- * require the handler to run for discovery.
7
- *
8
- * A leaf is also skipped when its staticPrefix collides with an ancestor
9
- * include node's staticPrefix. That happens when a dynamic param collapses the
10
- * staticPrefix of nested includes onto the parent's (e.g. `/m/:id/edit` -> sp
11
- * `/m`): precomputing such a leaf under the collapsed prefix would let the
12
- * ancestor's lazy entry claim a route it cannot register (the route is behind
13
- * further nested lazy includes), producing a RouteNotFoundError at request time
14
- * (issue #506). Those routes are resolved via the handler chain instead.
15
- */
16
- export function flattenLeafEntries(
17
- prefixTree: Record<string, any>,
18
- routeManifest: Record<string, string>,
19
- result: Array<{ staticPrefix: string; routes: Record<string, string> }>,
20
- ): void {
21
- function visit(node: any, ancestorStaticPrefixes: Set<string>): void {
22
- const children = node.children || {};
23
- if (
24
- Object.keys(children).length === 0 &&
25
- node.routes &&
26
- node.routes.length > 0
27
- ) {
28
- // Leaf node. Skip if its staticPrefix collides with an ancestor include
29
- // node's staticPrefix (dynamic-param collapse) — see doc comment above.
30
- if (ancestorStaticPrefixes.has(node.staticPrefix)) {
31
- return;
32
- }
33
- // Collect its routes from the manifest
34
- const routes: Record<string, string> = {};
35
- for (const name of node.routes) {
36
- if (name in routeManifest) {
37
- routes[name] = routeManifest[name];
38
- }
39
- }
40
- result.push({ staticPrefix: node.staticPrefix, routes });
41
- } else {
42
- // Non-leaf: recurse into children, tracking this node's staticPrefix as
43
- // an ancestor so a collapsed nested leaf below it is not over-claimed.
44
- const nextAncestors = new Set(ancestorStaticPrefixes);
45
- nextAncestors.add(node.staticPrefix);
46
- for (const child of Object.values(children)) {
47
- visit(child, nextAncestors);
48
- }
49
- }
50
- }
51
- for (const node of Object.values(prefixTree)) {
52
- visit(node, new Set());
53
- }
54
- }
55
-
56
- /**
57
- * Walk prefix tree to map each route name to its scope's staticPrefix.
58
- */
59
- export function buildRouteToStaticPrefix(
60
- prefixTree: Record<string, any>,
61
- result: Record<string, string>,
62
- ): void {
63
- function visit(node: any): void {
64
- const sp = node.staticPrefix || "";
65
- for (const name of node.routes || []) {
66
- result[name] = sp;
67
- }
68
- for (const child of Object.values(node.children || {})) {
69
- visit(child);
70
- }
71
- }
72
- for (const node of Object.values(prefixTree)) {
73
- visit(node);
74
- }
75
- }
1
+ export {
2
+ flattenLeafEntries,
3
+ buildRouteToStaticPrefix,
4
+ } from "../../build/prefix-tree-utils.js";
76
5
 
77
6
  /**
78
7
  * Wrap a value as `JSON.parse('...')` instead of a JS object literal.
@@ -1,10 +1,3 @@
1
- /**
2
- * Package Resolution Utilities
3
- *
4
- * Handles detection of workspace vs npm install context and generates
5
- * appropriate aliases and exclude lists for Vite configuration.
6
- */
7
-
8
1
  import { existsSync } from "node:fs";
9
2
  import { createRequire } from "node:module";
10
3
  import { resolve } from "node:path";
@@ -17,44 +10,20 @@ const require = createRequire(import.meta.url);
17
10
  */
18
11
  const VIRTUAL_PACKAGE_NAME = "@rangojs/router";
19
12
 
20
- /**
21
- * Get the published package name (e.g., "@rangojs/router")
22
- */
23
13
  export function getPublishedPackageName(): string {
24
14
  return packageJson.name;
25
15
  }
26
16
 
27
- /**
28
- * Check if the package is installed from npm (scoped) vs workspace (unscoped)
29
- *
30
- * In workspace development:
31
- * - Package is installed as "@rangojs/router" via pnpm workspace alias
32
- * - The scoped name (@rangojs/router) doesn't exist in node_modules
33
- *
34
- * When installed from npm:
35
- * - Package is installed as "@rangojs/router"
36
- * - We need aliases to map "@rangojs/router/*" to "@rangojs/router/*"
37
- */
38
17
  export function isInstalledFromNpm(): boolean {
39
18
  const packageName = getPublishedPackageName();
40
19
  // Check if the scoped package exists in node_modules
41
20
  return existsSync(resolve(process.cwd(), "node_modules", packageName));
42
21
  }
43
22
 
44
- /**
45
- * Check if we're in a monorepo/workspace development context
46
- */
47
23
  export function isWorkspaceDevelopment(): boolean {
48
24
  return !isInstalledFromNpm();
49
25
  }
50
26
 
51
- /**
52
- * Subpaths derived from package.json exports that use TypeScript source.
53
- * These must be excluded from Vite's dependency optimization (they ship
54
- * as .ts/.tsx, not compiled JS) and aliased when installed from npm.
55
- *
56
- * Derived automatically from the exports field to prevent drift.
57
- */
58
27
  const SOURCE_EXPORT_SUBPATHS = Object.keys(packageJson.exports)
59
28
  .filter((key) => {
60
29
  const entry = (
@@ -70,12 +39,6 @@ const SOURCE_EXPORT_SUBPATHS = Object.keys(packageJson.exports)
70
39
  })
71
40
  .map((key) => key.replace(/^\./, ""));
72
41
 
73
- /**
74
- * Generate the list of modules to exclude from Vite's dependency optimization.
75
- *
76
- * We include both the published name and the virtual name because
77
- * Vite's optimizer runs before alias resolution.
78
- */
79
42
  export function getExcludeDeps(): string[] {
80
43
  const packageName = getPublishedPackageName();
81
44
  const excludes: string[] = [];
@@ -92,24 +55,10 @@ export function getExcludeDeps(): string[] {
92
55
  return excludes;
93
56
  }
94
57
 
95
- /**
96
- * Subpaths that need aliasing — same as SOURCE_EXPORT_SUBPATHS.
97
- * When installed from npm, virtual entries may use a different package name
98
- * than the published one; aliases bridge them.
99
- */
100
58
  const ALIAS_SUBPATHS = SOURCE_EXPORT_SUBPATHS;
101
59
 
102
- /**
103
- * Generate aliases to map virtual package paths to the actual published package.
104
- *
105
- * Only needed when installed from npm, where the package is under @rangojs/router
106
- * but virtual entries import from rsc-router/*.
107
- *
108
- * Returns empty object in workspace development where rsc-router resolves directly.
109
- */
110
60
  export function getPackageAliases(): Record<string, string> {
111
61
  if (isWorkspaceDevelopment()) {
112
- // No aliases needed - rsc-router resolves directly
113
62
  return {};
114
63
  }
115
64
 
@@ -123,28 +72,7 @@ export function getPackageAliases(): Record<string, string> {
123
72
  return aliases;
124
73
  }
125
74
 
126
- /**
127
- * Plugin-rsc pushes bare specs like
128
- * `@vitejs/plugin-rsc/vendor/react-server-dom/client.edge` into
129
- * `optimizeDeps.include` for the ssr and rsc environments. In strict pnpm
130
- * consumer apps, `@vitejs/plugin-rsc` is only reachable from @rangojs/router's
131
- * node_modules, so Vite's optimizer — which resolves from the project root —
132
- * can't find them and emits "Failed to resolve dependency" warnings.
133
- *
134
- * We resolve those specs from this plugin's location (where plugin-rsc is
135
- * guaranteed to be installed as our dep) and expose them as `resolve.alias`
136
- * entries. The optimizer's resolver honors aliases, so the bare specs map to
137
- * absolute paths and resolve cleanly.
138
- */
139
75
  export function getVendorAliases(): Record<string, string> {
140
- // client.browser is intentionally NOT aliased. plugin-rsc injects it into
141
- // the client env's optimizeDeps.include; Vite's manual-include path resolves
142
- // and pre-bundles regardless of optimizeDeps.exclude, so aliasing would
143
- // trigger esbuild pre-bundling of the CJS vendor file and bypass the
144
- // cjs-to-esm transform that patches `require('react'|'react-dom')` into
145
- // real ESM imports. The consumer may still see a single "Failed to resolve"
146
- // warning for client.browser; runtime resolution from plugin-rsc's own
147
- // importer works because Vite resolves relative to the importer (not root).
148
76
  const specs = [
149
77
  "@vitejs/plugin-rsc/vendor/react-server-dom/client.edge",
150
78
  "@vitejs/plugin-rsc/vendor/react-server-dom/server.edge",
@@ -154,7 +82,7 @@ export function getVendorAliases(): Record<string, string> {
154
82
  try {
155
83
  aliases[spec] = require.resolve(spec);
156
84
  } catch {
157
- // Spec unresolvable (unexpected but non-fatal Vite will warn as before).
85
+ // Non-fatal; Vite will warn if it cannot resolve the spec
158
86
  }
159
87
  }
160
88
  return aliases;
@@ -9,18 +9,8 @@ import {
9
9
  } from "node:fs";
10
10
  import { resolve } from "node:path";
11
11
 
12
- /**
13
- * Escape special RegExp characters in a string for safe interpolation
14
- * into new RegExp() patterns.
15
- */
16
- export function escapeRegExp(str: string): string {
17
- return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
18
- }
12
+ import { escapeRegExp } from "../../regex-escape.js";
19
13
 
20
- /**
21
- * Encode route param values for path interpolation while preserving path
22
- * separators for wildcard params (splat-style values can include `/`).
23
- */
24
14
  export function encodePathParam(value: unknown): string {
25
15
  return String(value)
26
16
  .split("/")
@@ -28,11 +18,6 @@ export function encodePathParam(value: unknown): string {
28
18
  .join("/");
29
19
  }
30
20
 
31
- /**
32
- * Substitute route params into a pattern, stripping constraint and optional
33
- * syntax (:param(a|b)? -> value). Also handles wildcard params (*key).
34
- * Optional params not present in `params` are removed from the output.
35
- */
36
21
  export function substituteRouteParams(
37
22
  pattern: string,
38
23
  params: Record<string, string>,
@@ -41,17 +26,9 @@ export function substituteRouteParams(
41
26
  let result = pattern;
42
27
  let hadOmittedOptional = false;
43
28
 
44
- // First pass: substitute provided params.
45
- // Empty string on an optional placeholder is treated as omitted —
46
- // caller-supplied params or `getParams()` shapes may pass `""` for an
47
- // absent optional, so letting the second pass strip them keeps slash
48
- // cleanup consistent. Empty string on required `:key` or wildcard
49
- // `*key` still substitutes, matching prior behaviour.
50
29
  for (const [key, value] of Object.entries(params)) {
51
30
  const escaped = escapeRegExp(key);
52
31
  if (value === "") {
53
- // Only replace required placeholders (negative lookahead for `?`);
54
- // leave `:key?` for the second pass.
55
32
  result = result.replace(
56
33
  new RegExp(`:${escaped}(\\([^)]*\\))?(?!\\?)`),
57
34
  "",
@@ -66,13 +43,11 @@ export function substituteRouteParams(
66
43
  }
67
44
  }
68
45
 
69
- // Second pass: strip remaining optional param placeholders not in params
70
46
  result = result.replace(/:([a-zA-Z_][a-zA-Z0-9_]*)(\([^)]*\))?\?/g, () => {
71
47
  hadOmittedOptional = true;
72
48
  return "";
73
49
  });
74
50
 
75
- // Clean up slashes from omitted optional segments
76
51
  if (hadOmittedOptional) {
77
52
  const hadTrailingSlash = pattern.length > 1 && pattern.endsWith("/");
78
53
  result = result.replace(/\/\/+/g, "/").replace(/\/+$/, "") || "/";
@@ -82,10 +57,6 @@ export function substituteRouteParams(
82
57
  return result;
83
58
  }
84
59
 
85
- /**
86
- * Run an async function over items with bounded concurrency.
87
- * Errors propagate immediately and abort remaining work.
88
- */
89
60
  export async function runWithConcurrency<T>(
90
61
  items: T[],
91
62
  concurrency: number,
@@ -97,19 +68,30 @@ export async function runWithConcurrency<T>(
97
68
  return;
98
69
  }
99
70
  let nextIndex = 0;
71
+ // On first failure (the default prerender.onError: "fail" re-throws), stop
72
+ // scheduling new work so the remaining workers don't keep running full RSC
73
+ // renders before the build aborts. The first error is surfaced after all
74
+ // in-flight workers settle, preserving the throw-to-fail-build behavior.
75
+ let firstError: unknown;
76
+ let failed = false;
100
77
  async function worker() {
101
- while (nextIndex < items.length) {
78
+ while (nextIndex < items.length && !failed) {
102
79
  const idx = nextIndex++;
103
- await fn(items[idx]);
80
+ try {
81
+ await fn(items[idx]);
82
+ } catch (err) {
83
+ if (!failed) {
84
+ failed = true;
85
+ firstError = err;
86
+ }
87
+ return;
88
+ }
104
89
  }
105
90
  }
106
91
  await Promise.all(Array.from({ length: limit }, () => worker()));
92
+ if (failed) throw firstError;
107
93
  }
108
94
 
109
- /**
110
- * Group prerender entries by their concurrency setting so each group
111
- * can be rendered with the appropriate parallelism.
112
- */
113
95
  export function groupByConcurrency<T extends { concurrency: number }>(
114
96
  entries: T[],
115
97
  ): { concurrency: number; entries: T[] }[] {
@@ -129,10 +111,6 @@ export function groupByConcurrency<T extends { concurrency: number }>(
129
111
  }));
130
112
  }
131
113
 
132
- /**
133
- * Notify all routers' onError callbacks about a build-time error.
134
- * Uses a synthetic request since there is no real request during build.
135
- */
136
114
  export function notifyOnError(
137
115
  registry: Map<string, any>,
138
116
  error: unknown,
@@ -172,6 +150,42 @@ export function notifyOnError(
172
150
  }
173
151
  }
174
152
 
153
+ /**
154
+ * Resolve a thrown build-time render error into the prerender build's policy and
155
+ * log a per-entry line. A `Skip` (or any render error under `prerender.onError:
156
+ * "warn"`) logs and returns so the caller skips the entry; a render error under
157
+ * the default "fail" logs FAIL, notifies `onError`, and re-throws to fail the
158
+ * build. Shared by `expandPrerenderRoutes` (prerender) and `renderStaticHandlers`
159
+ * (static) so the Skip/warn/fail policy lives in one place. `label` is the padded
160
+ * URL / handler name for the log line; `elapsed` is the per-entry duration string.
161
+ */
162
+ export function resolvePrerenderError(
163
+ registry: Map<string, any>,
164
+ error: any,
165
+ onError: "fail" | "warn",
166
+ label: string,
167
+ elapsed: string,
168
+ phase: "prerender" | "static",
169
+ routeKey?: string,
170
+ pathname?: string,
171
+ ): void {
172
+ const isSkip = error?.name === "Skip";
173
+ if (isSkip || onError === "warn") {
174
+ if (isSkip) {
175
+ console.log(`[rango] SKIP ${label} (${elapsed}ms) - ${error.message}`);
176
+ } else {
177
+ console.warn(
178
+ `[rango] WARN ${label} (${elapsed}ms) - render error, not pre-rendered (prerender.onError: "warn"): ${error.message}`,
179
+ );
180
+ }
181
+ notifyOnError(registry, error, phase, routeKey, pathname, true);
182
+ return;
183
+ }
184
+ console.error(`[rango] FAIL ${label} (${elapsed}ms) - ${error.message}`);
185
+ notifyOnError(registry, error, phase, routeKey, pathname);
186
+ throw error;
187
+ }
188
+
175
189
  function getStagedAssetDir(projectRoot: string): string {
176
190
  return resolve(projectRoot, "node_modules/.rangojs-router-build/rsc-assets");
177
191
  }
@@ -6,6 +6,7 @@ import {
6
6
  VIRTUAL_ENTRY_BROWSER,
7
7
  VIRTUAL_ENTRY_SSR,
8
8
  getVirtualEntryRSC,
9
+ getVirtualEntryRSCHost,
9
10
  getVirtualVersionContent,
10
11
  VIRTUAL_IDS,
11
12
  } from "../plugins/virtual-entries.js";
@@ -60,7 +61,7 @@ export const sharedRolldownOptions: {
60
61
  */
61
62
  export function createVirtualEntriesPlugin(
62
63
  entries: { client: string; ssr: string; rsc?: string },
63
- routerPathRef?: { path?: string },
64
+ routerPathRef?: { path?: string; kind?: "router" | "host" },
64
65
  ): Plugin {
65
66
  // Build virtual modules map based on which entries use virtual IDs
66
67
  const virtualModules: Record<string, string> = {};
@@ -108,7 +109,9 @@ export function createVirtualEntriesPlugin(
108
109
  : routerPathRef.path;
109
110
  // Normalize backslashes for Windows (path.join/slice preserve native separators)
110
111
  const absoluteRouterPath = raw.replaceAll("\\", "/");
111
- return getVirtualEntryRSC(absoluteRouterPath);
112
+ return routerPathRef.kind === "host"
113
+ ? getVirtualEntryRSCHost(absoluteRouterPath)
114
+ : getVirtualEntryRSC(absoluteRouterPath);
112
115
  }
113
116
  }
114
117
  return null;
@@ -161,23 +164,9 @@ function isContentHashedAssetConflict(message: string | undefined): boolean {
161
164
  }
162
165
 
163
166
  /**
164
- * Rollup onwarn handler that suppresses known harmless warnings:
165
- * - "use client" directives: handled by the RSC plugin, not relevant to Rollup
166
- * - sourcemap errors: caused by "use client" directive at line 1:0 confusing sourcemap resolution
167
- * - sourcemap incomplete: plugins that transform without generating sourcemaps (router + RSC plugin)
168
- * - dynamic/static mixed imports: expected for router internals (e.g. request-context, cache-scope).
169
- * Under Rolldown (Vite 8) this surfaces as the INEFFECTIVE_DYNAMIC_IMPORT code emitted directly
170
- * by the bundler, rather than the vite:reporter message handled below (Rollup/Vite 7 shape).
171
- * - empty bundle: @vitejs/plugin-rsc scan build (step 1/5) produces an empty "index" chunk
172
- * because the RSC entry is fully externalized during client-reference analysis
173
- * - file name conflicts on content-hashed assets: @vitejs/plugin-rsc copies the rsc
174
- * environment's imported CSS/assets into the client bundle (its assets-manifest
175
- * generateBundle re-emits each via emitFile with an explicit content-hashed
176
- * fileName). When the client bundle already produced that identical asset,
177
- * rollup raises FILE_NAME_CONFLICT even though the bytes are identical (a
178
- * content hash collision IS a content match). Only these are suppressed; a
179
- * collision on a stable name still surfaces. No upstream fix as of
180
- * @vitejs/plugin-rsc@0.5.27; remove when it skips the redundant emit.
167
+ * Suppress known harmless warnings: "use client" directives, sourcemap errors,
168
+ * mixed imports (expected for router internals), empty bundles, and content-hashed
169
+ * asset collisions from @vitejs/plugin-rsc copying RSC-env assets to the client bundle.
181
170
  */
182
171
  export function onwarn(
183
172
  warning: Vite.Rollup.RollupLog,
@@ -197,10 +186,6 @@ export function onwarn(
197
186
  ) {
198
187
  return;
199
188
  }
200
- // @vitejs/plugin-rsc@0.5.14: rsc:virtual:vite-rsc/assets-manifest renderChunk
201
- // returns { code } without map, causing Rollup to warn about incorrect sourcemaps.
202
- // This is harmless (simple string replacement). Remove this suppression if a
203
- // future version of @vitejs/plugin-rsc fixes the missing sourcemap.
204
189
  if (warning.message?.includes("Sourcemap is likely to be incorrect")) {
205
190
  return;
206
191
  }
@@ -215,10 +200,6 @@ export function onwarn(
215
200
  defaultHandler(warning);
216
201
  }
217
202
 
218
- /**
219
- * Manual chunks configuration for client build.
220
- * Splits React and router packages into separate chunks for better caching.
221
- */
222
203
  export function getManualChunks(id: string): string | undefined {
223
204
  const normalized = Vite.normalizePath(id);
224
205
 
@@ -230,16 +211,6 @@ export function getManualChunks(id: string): string | undefined {
230
211
  ) {
231
212
  return "react";
232
213
  }
233
- // Use dynamic package name from package.json
234
- // Check both npm install path and workspace symlink resolved path.
235
- //
236
- // The workspace patterns are anchored to the package's own `src`/`dist` so
237
- // they match the router runtime but NOT consumer apps that merely live under a
238
- // `packages/rangojs-router/` ancestor (the in-repo e2e apps at
239
- // `packages/rangojs-router/e2e/<app>/src/...`). Without the anchor those apps'
240
- // own client components were force-merged into the shared "router" chunk,
241
- // which both misrepresented real-consumer bundles and blocked `clientChunks`
242
- // splitting from relocating them.
243
214
  const packageName = getPublishedPackageName();
244
215
  if (
245
216
  normalized.includes(`node_modules/${packageName}/`) ||
@@ -1,40 +0,0 @@
1
- /**
2
- * Shallow comparison utility for selector optimization
3
- *
4
- * Used by useNavigation hook to prevent unnecessary re-renders
5
- * when the selected value hasn't changed.
6
- *
7
- * @param a - First value
8
- * @param b - Second value
9
- * @returns true if values are shallowly equal
10
- */
11
- export function shallow<T>(a: T, b: T): boolean {
12
- // Same reference or primitive equality
13
- if (Object.is(a, b)) return true;
14
-
15
- // Different types or non-objects
16
- if (typeof a !== "object" || typeof b !== "object") return false;
17
-
18
- // Null checks
19
- if (a === null || b === null) return false;
20
-
21
- // Compare object keys
22
- const keysA = Object.keys(a);
23
- const keysB = Object.keys(b);
24
-
25
- if (keysA.length !== keysB.length) return false;
26
-
27
- // Check each key's value with Object.is
28
- for (const key of keysA) {
29
- if (
30
- !Object.is(
31
- (a as Record<string, unknown>)[key],
32
- (b as Record<string, unknown>)[key],
33
- )
34
- ) {
35
- return false;
36
- }
37
- }
38
-
39
- return true;
40
- }