@rangojs/router 0.0.0-experimental.124 → 0.0.0-experimental.125

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 (1009) hide show
  1. package/dist/bin/rango.js +3 -4
  2. package/dist/vite/index.js +9 -43
  3. package/package.json +1 -1
  4. package/skills/hooks/SKILL.md +2 -2
  5. package/skills/route/SKILL.md +6 -0
  6. package/src/__internal.ts +0 -65
  7. package/src/browser/action-coordinator.ts +1 -1
  8. package/src/browser/action-fence.ts +10 -0
  9. package/src/browser/event-controller.ts +1 -83
  10. package/src/browser/navigation-store-handle.ts +3 -4
  11. package/src/browser/navigation-store.ts +0 -39
  12. package/src/browser/navigation-transaction.ts +0 -32
  13. package/src/browser/partial-update.ts +1 -83
  14. package/src/browser/prefetch/cache.ts +6 -45
  15. package/src/browser/prefetch/queue.ts +6 -3
  16. package/src/browser/rango-state.ts +2 -23
  17. package/src/browser/react/Link.tsx +0 -2
  18. package/src/browser/react/NavigationProvider.tsx +2 -1
  19. package/src/browser/react/ScrollRestoration.tsx +10 -6
  20. package/src/browser/react/filter-segment-order.ts +0 -2
  21. package/src/browser/react/index.ts +0 -45
  22. package/src/browser/react/location-state-shared.ts +0 -13
  23. package/src/browser/react/location-state.ts +0 -1
  24. package/src/browser/react/use-action.ts +6 -15
  25. package/src/browser/react/use-handle.ts +0 -5
  26. package/src/browser/react/use-link-status.ts +0 -4
  27. package/src/browser/react/use-navigation.ts +0 -3
  28. package/src/browser/react/use-params.ts +0 -2
  29. package/src/browser/react/use-search-params.ts +0 -5
  30. package/src/browser/react/use-segments.ts +0 -13
  31. package/src/browser/rsc-router.tsx +2 -2
  32. package/src/browser/types.ts +0 -1
  33. package/src/browser/validate-redirect-origin.ts +4 -5
  34. package/src/build/route-trie.ts +3 -0
  35. package/src/build/route-types/param-extraction.ts +6 -3
  36. package/src/build/route-types/router-processing.ts +0 -8
  37. package/src/cache/cache-policy.ts +0 -54
  38. package/src/cache/cache-runtime.ts +27 -24
  39. package/src/cache/cache-scope.ts +0 -27
  40. package/src/cache/cache-tag.ts +0 -37
  41. package/src/cache/cf/cf-cache-store.ts +72 -45
  42. package/src/cache/cf/index.ts +0 -24
  43. package/src/cache/document-cache.ts +0 -36
  44. package/src/cache/handle-snapshot.ts +0 -40
  45. package/src/cache/index.ts +0 -27
  46. package/src/cache/memory-segment-store.ts +0 -52
  47. package/src/cache/profile-registry.ts +7 -3
  48. package/src/cache/read-through-swr.ts +41 -11
  49. package/src/cache/segment-codec.ts +0 -16
  50. package/src/cache/types.ts +0 -98
  51. package/src/client.rsc.tsx +1 -22
  52. package/src/client.tsx +14 -32
  53. package/src/deps/ssr.ts +0 -1
  54. package/src/handle.ts +2 -12
  55. package/src/handles/MetaTags.tsx +0 -14
  56. package/src/handles/meta.ts +0 -39
  57. package/src/host/cookie-handler.ts +0 -36
  58. package/src/host/errors.ts +0 -24
  59. package/src/host/index.ts +6 -0
  60. package/src/host/pattern-matcher.ts +7 -50
  61. package/src/host/router.ts +1 -65
  62. package/src/host/testing.ts +0 -16
  63. package/src/host/types.ts +6 -2
  64. package/src/href-client.ts +0 -4
  65. package/src/index.rsc.ts +20 -2
  66. package/src/internal-debug.ts +2 -4
  67. package/src/loader.rsc.ts +4 -15
  68. package/src/loader.ts +3 -9
  69. package/src/network-error-thrower.tsx +1 -6
  70. package/src/outlet-provider.tsx +1 -5
  71. package/src/prerender/param-hash.ts +10 -11
  72. package/src/prerender/store.ts +23 -30
  73. package/src/prerender.ts +34 -0
  74. package/src/root-error-boundary.tsx +1 -19
  75. package/src/route-content-wrapper.tsx +1 -44
  76. package/src/route-definition/dsl-helpers.ts +7 -19
  77. package/src/route-definition/helpers-types.ts +3 -3
  78. package/src/route-definition/redirect.ts +11 -1
  79. package/src/route-map-builder.ts +0 -16
  80. package/src/router/content-negotiation.ts +0 -13
  81. package/src/router/error-handling.ts +12 -16
  82. package/src/router/find-match.ts +4 -30
  83. package/src/router/intercept-resolution.ts +10 -1
  84. package/src/router/lazy-includes.ts +1 -57
  85. package/src/router/loader-resolution.ts +3 -2
  86. package/src/router/logging.ts +0 -6
  87. package/src/router/manifest.ts +1 -25
  88. package/src/router/match-api.ts +0 -20
  89. package/src/router/match-context.ts +0 -22
  90. package/src/router/match-handlers.ts +0 -43
  91. package/src/router/match-middleware/background-revalidation.ts +0 -7
  92. package/src/router/match-middleware/cache-lookup.ts +1 -54
  93. package/src/router/match-middleware/cache-store.ts +0 -31
  94. package/src/router/match-middleware/intercept-resolution.ts +0 -22
  95. package/src/router/match-middleware/segment-resolution.ts +0 -21
  96. package/src/router/match-pipelines.ts +1 -42
  97. package/src/router/match-result.ts +1 -52
  98. package/src/router/metrics.ts +0 -34
  99. package/src/router/middleware-cookies.ts +0 -13
  100. package/src/router/middleware-types.ts +0 -115
  101. package/src/router/middleware.ts +7 -30
  102. package/src/router/navigation-snapshot.ts +0 -51
  103. package/src/router/params-util.ts +23 -0
  104. package/src/router/pattern-matching.ts +1 -33
  105. package/src/router/prerender-match.ts +29 -45
  106. package/src/router/request-classification.ts +1 -38
  107. package/src/router/revalidation.ts +5 -58
  108. package/src/router/router-context.ts +0 -26
  109. package/src/router/segment-resolution/fresh.ts +25 -57
  110. package/src/router/segment-resolution/helpers.ts +34 -0
  111. package/src/router/segment-resolution/loader-cache.ts +10 -13
  112. package/src/router/segment-resolution/revalidation.ts +5 -42
  113. package/src/router/segment-resolution/streamed-handler-telemetry.ts +52 -0
  114. package/src/router/segment-resolution.ts +4 -1
  115. package/src/router/telemetry-otel.ts +0 -20
  116. package/src/router/telemetry.ts +0 -22
  117. package/src/router/timeout.ts +0 -20
  118. package/src/router/trie-matching.ts +63 -40
  119. package/src/router/types.ts +1 -63
  120. package/src/router/url-params.ts +0 -5
  121. package/src/router.ts +4 -2
  122. package/src/rsc/handler.ts +11 -2
  123. package/src/rsc/helpers.ts +15 -0
  124. package/src/rsc/origin-guard.ts +0 -12
  125. package/src/rsc/progressive-enhancement.ts +2 -1
  126. package/src/rsc/rsc-rendering.ts +2 -7
  127. package/src/rsc/runtime-warnings.ts +14 -0
  128. package/src/rsc/server-action.ts +30 -28
  129. package/src/rsc/types.ts +0 -1
  130. package/src/search-params.ts +0 -16
  131. package/src/segment-loader-promise.ts +14 -2
  132. package/src/segment-system.tsx +79 -88
  133. package/src/server/handle-store.ts +7 -24
  134. package/src/server/loader-registry.ts +5 -24
  135. package/src/server/request-context.ts +6 -78
  136. package/src/ssr/index.tsx +14 -14
  137. package/src/static-handler.ts +2 -27
  138. package/src/testing/cache-status.ts +0 -47
  139. package/src/testing/collect-handle.ts +1 -24
  140. package/src/testing/e2e/index.ts +0 -22
  141. package/src/testing/e2e/matchers.ts +0 -16
  142. package/src/testing/flight-matchers.ts +0 -13
  143. package/src/testing/flight-normalize.ts +3 -30
  144. package/src/testing/flight.ts +0 -48
  145. package/src/testing/generated-routes.ts +1 -41
  146. package/src/testing/index.ts +0 -21
  147. package/src/testing/internal/context.ts +3 -45
  148. package/src/testing/internal/seed-vars.ts +0 -26
  149. package/src/testing/render-handler.ts +0 -49
  150. package/src/testing/render-route.tsx +0 -90
  151. package/src/testing/run-loader.ts +0 -96
  152. package/src/testing/run-middleware.ts +0 -26
  153. package/src/theme/ThemeProvider.tsx +0 -52
  154. package/src/theme/ThemeScript.tsx +0 -6
  155. package/src/theme/constants.ts +0 -12
  156. package/src/theme/index.ts +0 -7
  157. package/src/theme/theme-context.ts +1 -5
  158. package/src/theme/theme-script.ts +0 -14
  159. package/src/theme/use-theme.ts +0 -3
  160. package/src/types/boundaries.ts +0 -35
  161. package/src/types/error-types.ts +25 -89
  162. package/src/types/global-namespace.ts +4 -14
  163. package/src/types/handler-context.ts +0 -8
  164. package/src/types/index.ts +0 -10
  165. package/src/types/request-scope.ts +0 -19
  166. package/src/types/route-config.ts +6 -50
  167. package/src/types/route-entry.ts +0 -6
  168. package/src/types/segments.ts +0 -13
  169. package/src/urls/include-helper.ts +0 -4
  170. package/src/urls/index.ts +0 -6
  171. package/src/urls/path-helper-types.ts +2 -2
  172. package/src/urls/path-helper.ts +0 -54
  173. package/src/urls/urls-function.ts +0 -13
  174. package/src/use-loader.tsx +0 -186
  175. package/src/vite/discovery/bundle-postprocess.ts +2 -1
  176. package/src/vite/discovery/discover-routers.ts +6 -7
  177. package/src/vite/discovery/virtual-module-codegen.ts +1 -11
  178. package/src/vite/plugin-types.ts +3 -1
  179. package/src/vite/plugins/cjs-to-esm.ts +0 -11
  180. package/src/vite/plugins/client-ref-dedup.ts +0 -11
  181. package/src/vite/plugins/client-ref-hashing.ts +0 -10
  182. package/src/vite/plugins/cloudflare-protocol-stub.ts +0 -20
  183. package/src/vite/plugins/expose-action-id.ts +2 -73
  184. package/src/vite/plugins/expose-id-utils.ts +0 -55
  185. package/src/vite/plugins/expose-ids/export-analysis.ts +0 -38
  186. package/src/vite/plugins/expose-ids/handler-transform.ts +0 -15
  187. package/src/vite/plugins/expose-ids/loader-transform.ts +0 -15
  188. package/src/vite/plugins/expose-ids/router-transform.ts +0 -13
  189. package/src/vite/plugins/expose-internal-ids.ts +10 -0
  190. package/src/vite/plugins/performance-tracks.ts +0 -3
  191. package/src/vite/plugins/use-cache-transform.ts +0 -36
  192. package/src/vite/plugins/version-injector.ts +0 -20
  193. package/src/vite/plugins/version-plugin.ts +1 -49
  194. package/src/vite/plugins/virtual-entries.ts +0 -15
  195. package/src/vite/rango.ts +1 -108
  196. package/src/vite/router-discovery.ts +2 -1
  197. package/src/vite/utils/ast-handler-extract.ts +0 -16
  198. package/src/vite/utils/bundle-analysis.ts +6 -13
  199. package/src/vite/utils/client-chunks.ts +0 -6
  200. package/src/vite/utils/forward-user-plugins.ts +0 -22
  201. package/src/vite/utils/manifest-utils.ts +0 -4
  202. package/src/vite/utils/package-resolution.ts +1 -73
  203. package/src/vite/utils/prerender-utils.ts +0 -35
  204. package/src/vite/utils/shared-utils.ts +3 -35
  205. package/dist/__internal.d.ts +0 -83
  206. package/dist/__internal.d.ts.map +0 -1
  207. package/dist/__internal.js +0 -19
  208. package/dist/__internal.js.map +0 -1
  209. package/dist/__mocks__/version.d.ts +0 -7
  210. package/dist/__mocks__/version.d.ts.map +0 -1
  211. package/dist/__mocks__/version.js +0 -7
  212. package/dist/__mocks__/version.js.map +0 -1
  213. package/dist/__tests__/client-href.test.d.ts +0 -2
  214. package/dist/__tests__/client-href.test.d.ts.map +0 -1
  215. package/dist/__tests__/client-href.test.js +0 -74
  216. package/dist/__tests__/client-href.test.js.map +0 -1
  217. package/dist/__tests__/component-utils.test.d.ts +0 -2
  218. package/dist/__tests__/component-utils.test.d.ts.map +0 -1
  219. package/dist/__tests__/component-utils.test.js +0 -51
  220. package/dist/__tests__/component-utils.test.js.map +0 -1
  221. package/dist/__tests__/event-controller.test.d.ts +0 -2
  222. package/dist/__tests__/event-controller.test.d.ts.map +0 -1
  223. package/dist/__tests__/event-controller.test.js +0 -538
  224. package/dist/__tests__/event-controller.test.js.map +0 -1
  225. package/dist/__tests__/helpers/route-tree.d.ts +0 -118
  226. package/dist/__tests__/helpers/route-tree.d.ts.map +0 -1
  227. package/dist/__tests__/helpers/route-tree.js +0 -374
  228. package/dist/__tests__/helpers/route-tree.js.map +0 -1
  229. package/dist/__tests__/match-result.test.d.ts +0 -2
  230. package/dist/__tests__/match-result.test.d.ts.map +0 -1
  231. package/dist/__tests__/match-result.test.js +0 -154
  232. package/dist/__tests__/match-result.test.js.map +0 -1
  233. package/dist/__tests__/navigation-store.test.d.ts +0 -2
  234. package/dist/__tests__/navigation-store.test.d.ts.map +0 -1
  235. package/dist/__tests__/navigation-store.test.js +0 -440
  236. package/dist/__tests__/navigation-store.test.js.map +0 -1
  237. package/dist/__tests__/partial-update.test.d.ts +0 -2
  238. package/dist/__tests__/partial-update.test.d.ts.map +0 -1
  239. package/dist/__tests__/partial-update.test.js +0 -1009
  240. package/dist/__tests__/partial-update.test.js.map +0 -1
  241. package/dist/__tests__/reverse-types.test.d.ts +0 -8
  242. package/dist/__tests__/reverse-types.test.d.ts.map +0 -1
  243. package/dist/__tests__/reverse-types.test.js +0 -656
  244. package/dist/__tests__/reverse-types.test.js.map +0 -1
  245. package/dist/__tests__/route-definition.test.d.ts +0 -2
  246. package/dist/__tests__/route-definition.test.d.ts.map +0 -1
  247. package/dist/__tests__/route-definition.test.js +0 -55
  248. package/dist/__tests__/route-definition.test.js.map +0 -1
  249. package/dist/__tests__/router-helpers.test.d.ts +0 -2
  250. package/dist/__tests__/router-helpers.test.d.ts.map +0 -1
  251. package/dist/__tests__/router-helpers.test.js +0 -377
  252. package/dist/__tests__/router-helpers.test.js.map +0 -1
  253. package/dist/__tests__/router-integration-2.test.d.ts +0 -2
  254. package/dist/__tests__/router-integration-2.test.d.ts.map +0 -1
  255. package/dist/__tests__/router-integration-2.test.js +0 -426
  256. package/dist/__tests__/router-integration-2.test.js.map +0 -1
  257. package/dist/__tests__/router-integration.test.d.ts +0 -2
  258. package/dist/__tests__/router-integration.test.d.ts.map +0 -1
  259. package/dist/__tests__/router-integration.test.js +0 -1051
  260. package/dist/__tests__/router-integration.test.js.map +0 -1
  261. package/dist/__tests__/search-params.test.d.ts +0 -5
  262. package/dist/__tests__/search-params.test.d.ts.map +0 -1
  263. package/dist/__tests__/search-params.test.js +0 -306
  264. package/dist/__tests__/search-params.test.js.map +0 -1
  265. package/dist/__tests__/segment-system.test.d.ts +0 -2
  266. package/dist/__tests__/segment-system.test.d.ts.map +0 -1
  267. package/dist/__tests__/segment-system.test.js +0 -627
  268. package/dist/__tests__/segment-system.test.js.map +0 -1
  269. package/dist/__tests__/static-handler-types.test.d.ts +0 -8
  270. package/dist/__tests__/static-handler-types.test.d.ts.map +0 -1
  271. package/dist/__tests__/static-handler-types.test.js +0 -63
  272. package/dist/__tests__/static-handler-types.test.js.map +0 -1
  273. package/dist/__tests__/urls.test.d.ts +0 -2
  274. package/dist/__tests__/urls.test.d.ts.map +0 -1
  275. package/dist/__tests__/urls.test.js +0 -421
  276. package/dist/__tests__/urls.test.js.map +0 -1
  277. package/dist/__tests__/use-mount.test.d.ts +0 -2
  278. package/dist/__tests__/use-mount.test.d.ts.map +0 -1
  279. package/dist/__tests__/use-mount.test.js +0 -35
  280. package/dist/__tests__/use-mount.test.js.map +0 -1
  281. package/dist/bin/rango.d.ts +0 -2
  282. package/dist/bin/rango.d.ts.map +0 -1
  283. package/dist/bin/rango.js.map +0 -1
  284. package/dist/browser/event-controller.d.ts +0 -191
  285. package/dist/browser/event-controller.d.ts.map +0 -1
  286. package/dist/browser/event-controller.js +0 -559
  287. package/dist/browser/event-controller.js.map +0 -1
  288. package/dist/browser/index.d.ts +0 -2
  289. package/dist/browser/index.d.ts.map +0 -1
  290. package/dist/browser/index.js +0 -14
  291. package/dist/browser/index.js.map +0 -1
  292. package/dist/browser/link-interceptor.d.ts +0 -38
  293. package/dist/browser/link-interceptor.d.ts.map +0 -1
  294. package/dist/browser/link-interceptor.js +0 -99
  295. package/dist/browser/link-interceptor.js.map +0 -1
  296. package/dist/browser/logging.d.ts +0 -10
  297. package/dist/browser/logging.d.ts.map +0 -1
  298. package/dist/browser/logging.js +0 -29
  299. package/dist/browser/logging.js.map +0 -1
  300. package/dist/browser/lru-cache.d.ts +0 -17
  301. package/dist/browser/lru-cache.d.ts.map +0 -1
  302. package/dist/browser/lru-cache.js +0 -50
  303. package/dist/browser/lru-cache.js.map +0 -1
  304. package/dist/browser/merge-segment-loaders.d.ts +0 -39
  305. package/dist/browser/merge-segment-loaders.d.ts.map +0 -1
  306. package/dist/browser/merge-segment-loaders.js +0 -102
  307. package/dist/browser/merge-segment-loaders.js.map +0 -1
  308. package/dist/browser/navigation-bridge.d.ts +0 -102
  309. package/dist/browser/navigation-bridge.d.ts.map +0 -1
  310. package/dist/browser/navigation-bridge.js +0 -708
  311. package/dist/browser/navigation-bridge.js.map +0 -1
  312. package/dist/browser/navigation-client.d.ts +0 -25
  313. package/dist/browser/navigation-client.d.ts.map +0 -1
  314. package/dist/browser/navigation-client.js +0 -157
  315. package/dist/browser/navigation-client.js.map +0 -1
  316. package/dist/browser/navigation-store.d.ts +0 -101
  317. package/dist/browser/navigation-store.d.ts.map +0 -1
  318. package/dist/browser/navigation-store.js +0 -625
  319. package/dist/browser/navigation-store.js.map +0 -1
  320. package/dist/browser/partial-update.d.ts +0 -75
  321. package/dist/browser/partial-update.d.ts.map +0 -1
  322. package/dist/browser/partial-update.js +0 -426
  323. package/dist/browser/partial-update.js.map +0 -1
  324. package/dist/browser/react/Link.d.ts +0 -86
  325. package/dist/browser/react/Link.d.ts.map +0 -1
  326. package/dist/browser/react/Link.js +0 -128
  327. package/dist/browser/react/Link.js.map +0 -1
  328. package/dist/browser/react/NavigationProvider.d.ts +0 -63
  329. package/dist/browser/react/NavigationProvider.d.ts.map +0 -1
  330. package/dist/browser/react/NavigationProvider.js +0 -216
  331. package/dist/browser/react/NavigationProvider.js.map +0 -1
  332. package/dist/browser/react/ScrollRestoration.d.ts +0 -75
  333. package/dist/browser/react/ScrollRestoration.d.ts.map +0 -1
  334. package/dist/browser/react/ScrollRestoration.js +0 -57
  335. package/dist/browser/react/ScrollRestoration.js.map +0 -1
  336. package/dist/browser/react/context.d.ts +0 -46
  337. package/dist/browser/react/context.d.ts.map +0 -1
  338. package/dist/browser/react/context.js +0 -10
  339. package/dist/browser/react/context.js.map +0 -1
  340. package/dist/browser/react/index.d.ts +0 -11
  341. package/dist/browser/react/index.d.ts.map +0 -1
  342. package/dist/browser/react/index.js +0 -22
  343. package/dist/browser/react/index.js.map +0 -1
  344. package/dist/browser/react/location-state-shared.d.ts +0 -63
  345. package/dist/browser/react/location-state-shared.d.ts.map +0 -1
  346. package/dist/browser/react/location-state-shared.js +0 -81
  347. package/dist/browser/react/location-state-shared.js.map +0 -1
  348. package/dist/browser/react/location-state.d.ts +0 -23
  349. package/dist/browser/react/location-state.d.ts.map +0 -1
  350. package/dist/browser/react/location-state.js +0 -29
  351. package/dist/browser/react/location-state.js.map +0 -1
  352. package/dist/browser/react/mount-context.d.ts +0 -24
  353. package/dist/browser/react/mount-context.d.ts.map +0 -1
  354. package/dist/browser/react/mount-context.js +0 -24
  355. package/dist/browser/react/mount-context.js.map +0 -1
  356. package/dist/browser/react/use-action.d.ts +0 -64
  357. package/dist/browser/react/use-action.d.ts.map +0 -1
  358. package/dist/browser/react/use-action.js +0 -134
  359. package/dist/browser/react/use-action.js.map +0 -1
  360. package/dist/browser/react/use-client-cache.d.ts +0 -41
  361. package/dist/browser/react/use-client-cache.d.ts.map +0 -1
  362. package/dist/browser/react/use-client-cache.js +0 -39
  363. package/dist/browser/react/use-client-cache.js.map +0 -1
  364. package/dist/browser/react/use-handle.d.ts +0 -31
  365. package/dist/browser/react/use-handle.d.ts.map +0 -1
  366. package/dist/browser/react/use-handle.js +0 -144
  367. package/dist/browser/react/use-handle.js.map +0 -1
  368. package/dist/browser/react/use-href.d.ts +0 -33
  369. package/dist/browser/react/use-href.d.ts.map +0 -1
  370. package/dist/browser/react/use-href.js +0 -39
  371. package/dist/browser/react/use-href.js.map +0 -1
  372. package/dist/browser/react/use-link-status.d.ts +0 -37
  373. package/dist/browser/react/use-link-status.d.ts.map +0 -1
  374. package/dist/browser/react/use-link-status.js +0 -99
  375. package/dist/browser/react/use-link-status.js.map +0 -1
  376. package/dist/browser/react/use-mount.d.ts +0 -25
  377. package/dist/browser/react/use-mount.d.ts.map +0 -1
  378. package/dist/browser/react/use-mount.js +0 -30
  379. package/dist/browser/react/use-mount.js.map +0 -1
  380. package/dist/browser/react/use-navigation.d.ts +0 -27
  381. package/dist/browser/react/use-navigation.d.ts.map +0 -1
  382. package/dist/browser/react/use-navigation.js +0 -87
  383. package/dist/browser/react/use-navigation.js.map +0 -1
  384. package/dist/browser/react/use-segments.d.ts +0 -38
  385. package/dist/browser/react/use-segments.d.ts.map +0 -1
  386. package/dist/browser/react/use-segments.js +0 -130
  387. package/dist/browser/react/use-segments.js.map +0 -1
  388. package/dist/browser/request-controller.d.ts +0 -26
  389. package/dist/browser/request-controller.d.ts.map +0 -1
  390. package/dist/browser/request-controller.js +0 -147
  391. package/dist/browser/request-controller.js.map +0 -1
  392. package/dist/browser/rsc-router.d.ts +0 -129
  393. package/dist/browser/rsc-router.d.ts.map +0 -1
  394. package/dist/browser/rsc-router.js +0 -195
  395. package/dist/browser/rsc-router.js.map +0 -1
  396. package/dist/browser/scroll-restoration.d.ts +0 -93
  397. package/dist/browser/scroll-restoration.d.ts.map +0 -1
  398. package/dist/browser/scroll-restoration.js +0 -321
  399. package/dist/browser/scroll-restoration.js.map +0 -1
  400. package/dist/browser/segment-structure-assert.d.ts +0 -17
  401. package/dist/browser/segment-structure-assert.d.ts.map +0 -1
  402. package/dist/browser/segment-structure-assert.js +0 -59
  403. package/dist/browser/segment-structure-assert.js.map +0 -1
  404. package/dist/browser/server-action-bridge.d.ts +0 -26
  405. package/dist/browser/server-action-bridge.d.ts.map +0 -1
  406. package/dist/browser/server-action-bridge.js +0 -668
  407. package/dist/browser/server-action-bridge.js.map +0 -1
  408. package/dist/browser/shallow.d.ts +0 -12
  409. package/dist/browser/shallow.d.ts.map +0 -1
  410. package/dist/browser/shallow.js +0 -34
  411. package/dist/browser/shallow.js.map +0 -1
  412. package/dist/browser/types.d.ts +0 -369
  413. package/dist/browser/types.d.ts.map +0 -1
  414. package/dist/browser/types.js +0 -2
  415. package/dist/browser/types.js.map +0 -1
  416. package/dist/build/__tests__/generate-cli.test.d.ts +0 -2
  417. package/dist/build/__tests__/generate-cli.test.d.ts.map +0 -1
  418. package/dist/build/__tests__/generate-cli.test.js +0 -237
  419. package/dist/build/__tests__/generate-cli.test.js.map +0 -1
  420. package/dist/build/__tests__/generate-manifest.test.d.ts +0 -2
  421. package/dist/build/__tests__/generate-manifest.test.d.ts.map +0 -1
  422. package/dist/build/__tests__/generate-manifest.test.js +0 -119
  423. package/dist/build/__tests__/generate-manifest.test.js.map +0 -1
  424. package/dist/build/__tests__/generate-route-types.test.d.ts +0 -2
  425. package/dist/build/__tests__/generate-route-types.test.d.ts.map +0 -1
  426. package/dist/build/__tests__/generate-route-types.test.js +0 -620
  427. package/dist/build/__tests__/generate-route-types.test.js.map +0 -1
  428. package/dist/build/__tests__/per-router-manifest.test.d.ts +0 -2
  429. package/dist/build/__tests__/per-router-manifest.test.d.ts.map +0 -1
  430. package/dist/build/__tests__/per-router-manifest.test.js +0 -308
  431. package/dist/build/__tests__/per-router-manifest.test.js.map +0 -1
  432. package/dist/build/generate-manifest.d.ts +0 -81
  433. package/dist/build/generate-manifest.d.ts.map +0 -1
  434. package/dist/build/generate-manifest.js +0 -276
  435. package/dist/build/generate-manifest.js.map +0 -1
  436. package/dist/build/generate-route-types.d.ts +0 -115
  437. package/dist/build/generate-route-types.d.ts.map +0 -1
  438. package/dist/build/generate-route-types.js +0 -740
  439. package/dist/build/generate-route-types.js.map +0 -1
  440. package/dist/build/index.d.ts +0 -21
  441. package/dist/build/index.d.ts.map +0 -1
  442. package/dist/build/index.js +0 -21
  443. package/dist/build/index.js.map +0 -1
  444. package/dist/build/route-trie.d.ts +0 -71
  445. package/dist/build/route-trie.d.ts.map +0 -1
  446. package/dist/build/route-trie.js +0 -175
  447. package/dist/build/route-trie.js.map +0 -1
  448. package/dist/cache/__tests__/cache-scope.test.d.ts +0 -2
  449. package/dist/cache/__tests__/cache-scope.test.d.ts.map +0 -1
  450. package/dist/cache/__tests__/cache-scope.test.js +0 -208
  451. package/dist/cache/__tests__/cache-scope.test.js.map +0 -1
  452. package/dist/cache/__tests__/document-cache.test.d.ts +0 -2
  453. package/dist/cache/__tests__/document-cache.test.d.ts.map +0 -1
  454. package/dist/cache/__tests__/document-cache.test.js +0 -345
  455. package/dist/cache/__tests__/document-cache.test.js.map +0 -1
  456. package/dist/cache/__tests__/memory-segment-store.test.d.ts +0 -2
  457. package/dist/cache/__tests__/memory-segment-store.test.d.ts.map +0 -1
  458. package/dist/cache/__tests__/memory-segment-store.test.js +0 -425
  459. package/dist/cache/__tests__/memory-segment-store.test.js.map +0 -1
  460. package/dist/cache/__tests__/memory-store.test.d.ts +0 -2
  461. package/dist/cache/__tests__/memory-store.test.d.ts.map +0 -1
  462. package/dist/cache/__tests__/memory-store.test.js +0 -367
  463. package/dist/cache/__tests__/memory-store.test.js.map +0 -1
  464. package/dist/cache/cache-scope.d.ts +0 -102
  465. package/dist/cache/cache-scope.d.ts.map +0 -1
  466. package/dist/cache/cache-scope.js +0 -440
  467. package/dist/cache/cache-scope.js.map +0 -1
  468. package/dist/cache/cf/__tests__/cf-cache-store.test.d.ts +0 -2
  469. package/dist/cache/cf/__tests__/cf-cache-store.test.d.ts.map +0 -1
  470. package/dist/cache/cf/__tests__/cf-cache-store.test.js +0 -330
  471. package/dist/cache/cf/__tests__/cf-cache-store.test.js.map +0 -1
  472. package/dist/cache/cf/cf-cache-store.d.ts +0 -165
  473. package/dist/cache/cf/cf-cache-store.d.ts.map +0 -1
  474. package/dist/cache/cf/cf-cache-store.js +0 -242
  475. package/dist/cache/cf/cf-cache-store.js.map +0 -1
  476. package/dist/cache/cf/index.d.ts +0 -14
  477. package/dist/cache/cf/index.d.ts.map +0 -1
  478. package/dist/cache/cf/index.js +0 -17
  479. package/dist/cache/cf/index.js.map +0 -1
  480. package/dist/cache/document-cache.d.ts +0 -64
  481. package/dist/cache/document-cache.d.ts.map +0 -1
  482. package/dist/cache/document-cache.js +0 -228
  483. package/dist/cache/document-cache.js.map +0 -1
  484. package/dist/cache/index.d.ts +0 -19
  485. package/dist/cache/index.d.ts.map +0 -1
  486. package/dist/cache/index.js +0 -21
  487. package/dist/cache/index.js.map +0 -1
  488. package/dist/cache/memory-segment-store.d.ts +0 -110
  489. package/dist/cache/memory-segment-store.d.ts.map +0 -1
  490. package/dist/cache/memory-segment-store.js +0 -117
  491. package/dist/cache/memory-segment-store.js.map +0 -1
  492. package/dist/cache/memory-store.d.ts +0 -41
  493. package/dist/cache/memory-store.d.ts.map +0 -1
  494. package/dist/cache/memory-store.js +0 -191
  495. package/dist/cache/memory-store.js.map +0 -1
  496. package/dist/cache/types.d.ts +0 -317
  497. package/dist/cache/types.d.ts.map +0 -1
  498. package/dist/cache/types.js +0 -12
  499. package/dist/cache/types.js.map +0 -1
  500. package/dist/client.d.ts +0 -248
  501. package/dist/client.d.ts.map +0 -1
  502. package/dist/client.js +0 -367
  503. package/dist/client.js.map +0 -1
  504. package/dist/client.rsc.d.ts +0 -26
  505. package/dist/client.rsc.d.ts.map +0 -1
  506. package/dist/client.rsc.js +0 -46
  507. package/dist/client.rsc.js.map +0 -1
  508. package/dist/component-utils.d.ts +0 -36
  509. package/dist/component-utils.d.ts.map +0 -1
  510. package/dist/component-utils.js +0 -61
  511. package/dist/component-utils.js.map +0 -1
  512. package/dist/components/DefaultDocument.d.ts +0 -13
  513. package/dist/components/DefaultDocument.d.ts.map +0 -1
  514. package/dist/components/DefaultDocument.js +0 -15
  515. package/dist/components/DefaultDocument.js.map +0 -1
  516. package/dist/debug.d.ts +0 -58
  517. package/dist/debug.d.ts.map +0 -1
  518. package/dist/debug.js +0 -157
  519. package/dist/debug.js.map +0 -1
  520. package/dist/default-error-boundary.d.ts +0 -11
  521. package/dist/default-error-boundary.d.ts.map +0 -1
  522. package/dist/default-error-boundary.js +0 -45
  523. package/dist/default-error-boundary.js.map +0 -1
  524. package/dist/deps/browser.d.ts +0 -2
  525. package/dist/deps/browser.d.ts.map +0 -1
  526. package/dist/deps/browser.js +0 -3
  527. package/dist/deps/browser.js.map +0 -1
  528. package/dist/deps/html-stream-client.d.ts +0 -2
  529. package/dist/deps/html-stream-client.d.ts.map +0 -1
  530. package/dist/deps/html-stream-client.js +0 -3
  531. package/dist/deps/html-stream-client.js.map +0 -1
  532. package/dist/deps/html-stream-server.d.ts +0 -2
  533. package/dist/deps/html-stream-server.d.ts.map +0 -1
  534. package/dist/deps/html-stream-server.js +0 -3
  535. package/dist/deps/html-stream-server.js.map +0 -1
  536. package/dist/deps/rsc.d.ts +0 -2
  537. package/dist/deps/rsc.d.ts.map +0 -1
  538. package/dist/deps/rsc.js +0 -4
  539. package/dist/deps/rsc.js.map +0 -1
  540. package/dist/deps/ssr.d.ts +0 -2
  541. package/dist/deps/ssr.d.ts.map +0 -1
  542. package/dist/deps/ssr.js +0 -3
  543. package/dist/deps/ssr.js.map +0 -1
  544. package/dist/errors.d.ts +0 -174
  545. package/dist/errors.d.ts.map +0 -1
  546. package/dist/errors.js +0 -241
  547. package/dist/errors.js.map +0 -1
  548. package/dist/handle.d.ts +0 -78
  549. package/dist/handle.d.ts.map +0 -1
  550. package/dist/handle.js +0 -82
  551. package/dist/handle.js.map +0 -1
  552. package/dist/handles/MetaTags.d.ts +0 -14
  553. package/dist/handles/MetaTags.d.ts.map +0 -1
  554. package/dist/handles/MetaTags.js +0 -136
  555. package/dist/handles/MetaTags.js.map +0 -1
  556. package/dist/handles/index.d.ts +0 -6
  557. package/dist/handles/index.d.ts.map +0 -1
  558. package/dist/handles/index.js +0 -6
  559. package/dist/handles/index.js.map +0 -1
  560. package/dist/handles/meta.d.ts +0 -39
  561. package/dist/handles/meta.d.ts.map +0 -1
  562. package/dist/handles/meta.js +0 -202
  563. package/dist/handles/meta.js.map +0 -1
  564. package/dist/host/__tests__/errors.test.d.ts +0 -2
  565. package/dist/host/__tests__/errors.test.d.ts.map +0 -1
  566. package/dist/host/__tests__/errors.test.js +0 -76
  567. package/dist/host/__tests__/errors.test.js.map +0 -1
  568. package/dist/host/__tests__/pattern-comprehensive.test.d.ts +0 -2
  569. package/dist/host/__tests__/pattern-comprehensive.test.d.ts.map +0 -1
  570. package/dist/host/__tests__/pattern-comprehensive.test.js +0 -732
  571. package/dist/host/__tests__/pattern-comprehensive.test.js.map +0 -1
  572. package/dist/host/__tests__/pattern-matcher.test.d.ts +0 -2
  573. package/dist/host/__tests__/pattern-matcher.test.d.ts.map +0 -1
  574. package/dist/host/__tests__/pattern-matcher.test.js +0 -251
  575. package/dist/host/__tests__/pattern-matcher.test.js.map +0 -1
  576. package/dist/host/__tests__/router.test.d.ts +0 -2
  577. package/dist/host/__tests__/router.test.d.ts.map +0 -1
  578. package/dist/host/__tests__/router.test.js +0 -241
  579. package/dist/host/__tests__/router.test.js.map +0 -1
  580. package/dist/host/__tests__/testing.test.d.ts +0 -2
  581. package/dist/host/__tests__/testing.test.d.ts.map +0 -1
  582. package/dist/host/__tests__/testing.test.js +0 -64
  583. package/dist/host/__tests__/testing.test.js.map +0 -1
  584. package/dist/host/__tests__/utils.test.d.ts +0 -2
  585. package/dist/host/__tests__/utils.test.d.ts.map +0 -1
  586. package/dist/host/__tests__/utils.test.js +0 -29
  587. package/dist/host/__tests__/utils.test.js.map +0 -1
  588. package/dist/host/cookie-handler.d.ts +0 -34
  589. package/dist/host/cookie-handler.d.ts.map +0 -1
  590. package/dist/host/cookie-handler.js +0 -124
  591. package/dist/host/cookie-handler.js.map +0 -1
  592. package/dist/host/errors.d.ts +0 -56
  593. package/dist/host/errors.d.ts.map +0 -1
  594. package/dist/host/errors.js +0 -79
  595. package/dist/host/errors.js.map +0 -1
  596. package/dist/host/index.d.ts +0 -29
  597. package/dist/host/index.d.ts.map +0 -1
  598. package/dist/host/index.js +0 -32
  599. package/dist/host/index.js.map +0 -1
  600. package/dist/host/pattern-matcher.d.ts +0 -36
  601. package/dist/host/pattern-matcher.d.ts.map +0 -1
  602. package/dist/host/pattern-matcher.js +0 -172
  603. package/dist/host/pattern-matcher.js.map +0 -1
  604. package/dist/host/router.d.ts +0 -26
  605. package/dist/host/router.d.ts.map +0 -1
  606. package/dist/host/router.js +0 -218
  607. package/dist/host/router.js.map +0 -1
  608. package/dist/host/testing.d.ts +0 -36
  609. package/dist/host/testing.d.ts.map +0 -1
  610. package/dist/host/testing.js +0 -55
  611. package/dist/host/testing.js.map +0 -1
  612. package/dist/host/types.d.ts +0 -115
  613. package/dist/host/types.d.ts.map +0 -1
  614. package/dist/host/types.js +0 -7
  615. package/dist/host/types.js.map +0 -1
  616. package/dist/host/utils.d.ts +0 -21
  617. package/dist/host/utils.d.ts.map +0 -1
  618. package/dist/host/utils.js +0 -23
  619. package/dist/host/utils.js.map +0 -1
  620. package/dist/href-client.d.ts +0 -131
  621. package/dist/href-client.d.ts.map +0 -1
  622. package/dist/href-client.js +0 -64
  623. package/dist/href-client.js.map +0 -1
  624. package/dist/href-context.d.ts +0 -29
  625. package/dist/href-context.d.ts.map +0 -1
  626. package/dist/href-context.js +0 -21
  627. package/dist/href-context.js.map +0 -1
  628. package/dist/index.d.ts +0 -73
  629. package/dist/index.d.ts.map +0 -1
  630. package/dist/index.js +0 -91
  631. package/dist/index.js.map +0 -1
  632. package/dist/index.rsc.d.ts +0 -32
  633. package/dist/index.rsc.d.ts.map +0 -1
  634. package/dist/index.rsc.js +0 -40
  635. package/dist/index.rsc.js.map +0 -1
  636. package/dist/internal-debug.d.ts +0 -2
  637. package/dist/internal-debug.d.ts.map +0 -1
  638. package/dist/internal-debug.js +0 -5
  639. package/dist/internal-debug.js.map +0 -1
  640. package/dist/loader.d.ts +0 -14
  641. package/dist/loader.d.ts.map +0 -1
  642. package/dist/loader.js +0 -20
  643. package/dist/loader.js.map +0 -1
  644. package/dist/loader.rsc.d.ts +0 -19
  645. package/dist/loader.rsc.d.ts.map +0 -1
  646. package/dist/loader.rsc.js +0 -99
  647. package/dist/loader.rsc.js.map +0 -1
  648. package/dist/network-error-thrower.d.ts +0 -17
  649. package/dist/network-error-thrower.d.ts.map +0 -1
  650. package/dist/network-error-thrower.js +0 -14
  651. package/dist/network-error-thrower.js.map +0 -1
  652. package/dist/outlet-context.d.ts +0 -13
  653. package/dist/outlet-context.d.ts.map +0 -1
  654. package/dist/outlet-context.js +0 -3
  655. package/dist/outlet-context.js.map +0 -1
  656. package/dist/prerender/__tests__/param-hash.test.d.ts +0 -2
  657. package/dist/prerender/__tests__/param-hash.test.d.ts.map +0 -1
  658. package/dist/prerender/__tests__/param-hash.test.js +0 -148
  659. package/dist/prerender/__tests__/param-hash.test.js.map +0 -1
  660. package/dist/prerender/param-hash.d.ts +0 -16
  661. package/dist/prerender/param-hash.d.ts.map +0 -1
  662. package/dist/prerender/param-hash.js +0 -36
  663. package/dist/prerender/param-hash.js.map +0 -1
  664. package/dist/prerender/store.d.ts +0 -38
  665. package/dist/prerender/store.d.ts.map +0 -1
  666. package/dist/prerender/store.js +0 -61
  667. package/dist/prerender/store.js.map +0 -1
  668. package/dist/prerender.d.ts +0 -66
  669. package/dist/prerender.d.ts.map +0 -1
  670. package/dist/prerender.js +0 -57
  671. package/dist/prerender.js.map +0 -1
  672. package/dist/reverse.d.ts +0 -196
  673. package/dist/reverse.d.ts.map +0 -1
  674. package/dist/reverse.js +0 -78
  675. package/dist/reverse.js.map +0 -1
  676. package/dist/root-error-boundary.d.ts +0 -33
  677. package/dist/root-error-boundary.d.ts.map +0 -1
  678. package/dist/root-error-boundary.js +0 -165
  679. package/dist/root-error-boundary.js.map +0 -1
  680. package/dist/route-content-wrapper.d.ts +0 -46
  681. package/dist/route-content-wrapper.d.ts.map +0 -1
  682. package/dist/route-content-wrapper.js +0 -77
  683. package/dist/route-content-wrapper.js.map +0 -1
  684. package/dist/route-definition.d.ts +0 -421
  685. package/dist/route-definition.d.ts.map +0 -1
  686. package/dist/route-definition.js +0 -868
  687. package/dist/route-definition.js.map +0 -1
  688. package/dist/route-map-builder.d.ts +0 -155
  689. package/dist/route-map-builder.d.ts.map +0 -1
  690. package/dist/route-map-builder.js +0 -237
  691. package/dist/route-map-builder.js.map +0 -1
  692. package/dist/route-types.d.ts +0 -165
  693. package/dist/route-types.d.ts.map +0 -1
  694. package/dist/route-types.js +0 -7
  695. package/dist/route-types.js.map +0 -1
  696. package/dist/router/__tests__/handler-context.test.d.ts +0 -2
  697. package/dist/router/__tests__/handler-context.test.d.ts.map +0 -1
  698. package/dist/router/__tests__/handler-context.test.js +0 -65
  699. package/dist/router/__tests__/handler-context.test.js.map +0 -1
  700. package/dist/router/__tests__/loader-cycle-detection.test.d.ts +0 -2
  701. package/dist/router/__tests__/loader-cycle-detection.test.d.ts.map +0 -1
  702. package/dist/router/__tests__/loader-cycle-detection.test.js +0 -221
  703. package/dist/router/__tests__/loader-cycle-detection.test.js.map +0 -1
  704. package/dist/router/__tests__/match-context.test.d.ts +0 -2
  705. package/dist/router/__tests__/match-context.test.d.ts.map +0 -1
  706. package/dist/router/__tests__/match-context.test.js +0 -92
  707. package/dist/router/__tests__/match-context.test.js.map +0 -1
  708. package/dist/router/__tests__/match-pipelines.test.d.ts +0 -2
  709. package/dist/router/__tests__/match-pipelines.test.d.ts.map +0 -1
  710. package/dist/router/__tests__/match-pipelines.test.js +0 -417
  711. package/dist/router/__tests__/match-pipelines.test.js.map +0 -1
  712. package/dist/router/__tests__/match-result.test.d.ts +0 -2
  713. package/dist/router/__tests__/match-result.test.d.ts.map +0 -1
  714. package/dist/router/__tests__/match-result.test.js +0 -457
  715. package/dist/router/__tests__/match-result.test.js.map +0 -1
  716. package/dist/router/__tests__/on-error.test.d.ts +0 -2
  717. package/dist/router/__tests__/on-error.test.d.ts.map +0 -1
  718. package/dist/router/__tests__/on-error.test.js +0 -678
  719. package/dist/router/__tests__/on-error.test.js.map +0 -1
  720. package/dist/router/__tests__/pattern-matching.test.d.ts +0 -2
  721. package/dist/router/__tests__/pattern-matching.test.d.ts.map +0 -1
  722. package/dist/router/__tests__/pattern-matching.test.js +0 -629
  723. package/dist/router/__tests__/pattern-matching.test.js.map +0 -1
  724. package/dist/router/__tests__/segment-resolution-parallel-loading.test.d.ts +0 -2
  725. package/dist/router/__tests__/segment-resolution-parallel-loading.test.d.ts.map +0 -1
  726. package/dist/router/__tests__/segment-resolution-parallel-loading.test.js +0 -155
  727. package/dist/router/__tests__/segment-resolution-parallel-loading.test.js.map +0 -1
  728. package/dist/router/error-handling.d.ts +0 -77
  729. package/dist/router/error-handling.d.ts.map +0 -1
  730. package/dist/router/error-handling.js +0 -202
  731. package/dist/router/error-handling.js.map +0 -1
  732. package/dist/router/handler-context.d.ts +0 -20
  733. package/dist/router/handler-context.d.ts.map +0 -1
  734. package/dist/router/handler-context.js +0 -198
  735. package/dist/router/handler-context.js.map +0 -1
  736. package/dist/router/intercept-resolution.d.ts +0 -66
  737. package/dist/router/intercept-resolution.d.ts.map +0 -1
  738. package/dist/router/intercept-resolution.js +0 -246
  739. package/dist/router/intercept-resolution.js.map +0 -1
  740. package/dist/router/loader-resolution.d.ts +0 -64
  741. package/dist/router/loader-resolution.d.ts.map +0 -1
  742. package/dist/router/loader-resolution.js +0 -284
  743. package/dist/router/loader-resolution.js.map +0 -1
  744. package/dist/router/logging.d.ts +0 -15
  745. package/dist/router/logging.d.ts.map +0 -1
  746. package/dist/router/logging.js +0 -99
  747. package/dist/router/logging.js.map +0 -1
  748. package/dist/router/manifest.d.ts +0 -22
  749. package/dist/router/manifest.d.ts.map +0 -1
  750. package/dist/router/manifest.js +0 -181
  751. package/dist/router/manifest.js.map +0 -1
  752. package/dist/router/match-api.d.ts +0 -35
  753. package/dist/router/match-api.d.ts.map +0 -1
  754. package/dist/router/match-api.js +0 -406
  755. package/dist/router/match-api.js.map +0 -1
  756. package/dist/router/match-context.d.ts +0 -206
  757. package/dist/router/match-context.d.ts.map +0 -1
  758. package/dist/router/match-context.js +0 -17
  759. package/dist/router/match-context.js.map +0 -1
  760. package/dist/router/match-middleware/background-revalidation.d.ts +0 -127
  761. package/dist/router/match-middleware/background-revalidation.d.ts.map +0 -1
  762. package/dist/router/match-middleware/background-revalidation.js +0 -75
  763. package/dist/router/match-middleware/background-revalidation.js.map +0 -1
  764. package/dist/router/match-middleware/cache-lookup.d.ts +0 -112
  765. package/dist/router/match-middleware/cache-lookup.d.ts.map +0 -1
  766. package/dist/router/match-middleware/cache-lookup.js +0 -257
  767. package/dist/router/match-middleware/cache-lookup.js.map +0 -1
  768. package/dist/router/match-middleware/cache-store.d.ts +0 -113
  769. package/dist/router/match-middleware/cache-store.d.ts.map +0 -1
  770. package/dist/router/match-middleware/cache-store.js +0 -108
  771. package/dist/router/match-middleware/cache-store.js.map +0 -1
  772. package/dist/router/match-middleware/index.d.ts +0 -81
  773. package/dist/router/match-middleware/index.d.ts.map +0 -1
  774. package/dist/router/match-middleware/index.js +0 -80
  775. package/dist/router/match-middleware/index.js.map +0 -1
  776. package/dist/router/match-middleware/intercept-resolution.d.ts +0 -117
  777. package/dist/router/match-middleware/intercept-resolution.d.ts.map +0 -1
  778. package/dist/router/match-middleware/intercept-resolution.js +0 -134
  779. package/dist/router/match-middleware/intercept-resolution.js.map +0 -1
  780. package/dist/router/match-middleware/segment-resolution.d.ts +0 -99
  781. package/dist/router/match-middleware/segment-resolution.d.ts.map +0 -1
  782. package/dist/router/match-middleware/segment-resolution.js +0 -53
  783. package/dist/router/match-middleware/segment-resolution.js.map +0 -1
  784. package/dist/router/match-pipelines.d.ts +0 -147
  785. package/dist/router/match-pipelines.d.ts.map +0 -1
  786. package/dist/router/match-pipelines.js +0 -82
  787. package/dist/router/match-pipelines.js.map +0 -1
  788. package/dist/router/match-result.d.ts +0 -126
  789. package/dist/router/match-result.d.ts.map +0 -1
  790. package/dist/router/match-result.js +0 -93
  791. package/dist/router/match-result.js.map +0 -1
  792. package/dist/router/metrics.d.ts +0 -20
  793. package/dist/router/metrics.d.ts.map +0 -1
  794. package/dist/router/metrics.js +0 -47
  795. package/dist/router/metrics.js.map +0 -1
  796. package/dist/router/middleware.d.ts +0 -249
  797. package/dist/router/middleware.d.ts.map +0 -1
  798. package/dist/router/middleware.js +0 -434
  799. package/dist/router/middleware.js.map +0 -1
  800. package/dist/router/middleware.test.d.ts +0 -2
  801. package/dist/router/middleware.test.d.ts.map +0 -1
  802. package/dist/router/middleware.test.js +0 -816
  803. package/dist/router/middleware.test.js.map +0 -1
  804. package/dist/router/pattern-matching.d.ts +0 -149
  805. package/dist/router/pattern-matching.d.ts.map +0 -1
  806. package/dist/router/pattern-matching.js +0 -349
  807. package/dist/router/pattern-matching.js.map +0 -1
  808. package/dist/router/revalidation.d.ts +0 -44
  809. package/dist/router/revalidation.d.ts.map +0 -1
  810. package/dist/router/revalidation.js +0 -147
  811. package/dist/router/revalidation.js.map +0 -1
  812. package/dist/router/router-context.d.ts +0 -135
  813. package/dist/router/router-context.d.ts.map +0 -1
  814. package/dist/router/router-context.js +0 -36
  815. package/dist/router/router-context.js.map +0 -1
  816. package/dist/router/segment-resolution.d.ts +0 -127
  817. package/dist/router/segment-resolution.d.ts.map +0 -1
  818. package/dist/router/segment-resolution.js +0 -919
  819. package/dist/router/segment-resolution.js.map +0 -1
  820. package/dist/router/trie-matching.d.ts +0 -40
  821. package/dist/router/trie-matching.d.ts.map +0 -1
  822. package/dist/router/trie-matching.js +0 -127
  823. package/dist/router/trie-matching.js.map +0 -1
  824. package/dist/router/types.d.ts +0 -136
  825. package/dist/router/types.d.ts.map +0 -1
  826. package/dist/router/types.js +0 -7
  827. package/dist/router/types.js.map +0 -1
  828. package/dist/router.d.ts +0 -753
  829. package/dist/router.d.ts.map +0 -1
  830. package/dist/router.gen.d.ts +0 -6
  831. package/dist/router.gen.d.ts.map +0 -1
  832. package/dist/router.gen.js +0 -6
  833. package/dist/router.gen.js.map +0 -1
  834. package/dist/router.js +0 -1304
  835. package/dist/router.js.map +0 -1
  836. package/dist/rsc/__tests__/helpers.test.d.ts +0 -2
  837. package/dist/rsc/__tests__/helpers.test.d.ts.map +0 -1
  838. package/dist/rsc/__tests__/helpers.test.js +0 -140
  839. package/dist/rsc/__tests__/helpers.test.js.map +0 -1
  840. package/dist/rsc/handler.d.ts +0 -45
  841. package/dist/rsc/handler.d.ts.map +0 -1
  842. package/dist/rsc/handler.js +0 -1172
  843. package/dist/rsc/handler.js.map +0 -1
  844. package/dist/rsc/helpers.d.ts +0 -16
  845. package/dist/rsc/helpers.d.ts.map +0 -1
  846. package/dist/rsc/helpers.js +0 -55
  847. package/dist/rsc/helpers.js.map +0 -1
  848. package/dist/rsc/index.d.ts +0 -22
  849. package/dist/rsc/index.d.ts.map +0 -1
  850. package/dist/rsc/index.js +0 -23
  851. package/dist/rsc/index.js.map +0 -1
  852. package/dist/rsc/nonce.d.ts +0 -9
  853. package/dist/rsc/nonce.d.ts.map +0 -1
  854. package/dist/rsc/nonce.js +0 -18
  855. package/dist/rsc/nonce.js.map +0 -1
  856. package/dist/rsc/types.d.ts +0 -206
  857. package/dist/rsc/types.d.ts.map +0 -1
  858. package/dist/rsc/types.js +0 -8
  859. package/dist/rsc/types.js.map +0 -1
  860. package/dist/search-params.d.ts +0 -103
  861. package/dist/search-params.d.ts.map +0 -1
  862. package/dist/search-params.js +0 -74
  863. package/dist/search-params.js.map +0 -1
  864. package/dist/segment-system.d.ts +0 -75
  865. package/dist/segment-system.d.ts.map +0 -1
  866. package/dist/segment-system.js +0 -336
  867. package/dist/segment-system.js.map +0 -1
  868. package/dist/server/context.d.ts +0 -245
  869. package/dist/server/context.d.ts.map +0 -1
  870. package/dist/server/context.js +0 -197
  871. package/dist/server/context.js.map +0 -1
  872. package/dist/server/fetchable-loader-store.d.ts +0 -18
  873. package/dist/server/fetchable-loader-store.d.ts.map +0 -1
  874. package/dist/server/fetchable-loader-store.js +0 -18
  875. package/dist/server/fetchable-loader-store.js.map +0 -1
  876. package/dist/server/handle-store.d.ts +0 -85
  877. package/dist/server/handle-store.d.ts.map +0 -1
  878. package/dist/server/handle-store.js +0 -142
  879. package/dist/server/handle-store.js.map +0 -1
  880. package/dist/server/loader-registry.d.ts +0 -55
  881. package/dist/server/loader-registry.d.ts.map +0 -1
  882. package/dist/server/loader-registry.js +0 -132
  883. package/dist/server/loader-registry.js.map +0 -1
  884. package/dist/server/request-context.d.ts +0 -226
  885. package/dist/server/request-context.d.ts.map +0 -1
  886. package/dist/server/request-context.js +0 -290
  887. package/dist/server/request-context.js.map +0 -1
  888. package/dist/server/root-layout.d.ts +0 -4
  889. package/dist/server/root-layout.d.ts.map +0 -1
  890. package/dist/server/root-layout.js +0 -5
  891. package/dist/server/root-layout.js.map +0 -1
  892. package/dist/server.d.ts +0 -15
  893. package/dist/server.d.ts.map +0 -1
  894. package/dist/server.js +0 -20
  895. package/dist/server.js.map +0 -1
  896. package/dist/ssr/__tests__/ssr-handler.test.d.ts +0 -2
  897. package/dist/ssr/__tests__/ssr-handler.test.d.ts.map +0 -1
  898. package/dist/ssr/__tests__/ssr-handler.test.js +0 -132
  899. package/dist/ssr/__tests__/ssr-handler.test.js.map +0 -1
  900. package/dist/ssr/index.d.ts +0 -98
  901. package/dist/ssr/index.d.ts.map +0 -1
  902. package/dist/ssr/index.js +0 -158
  903. package/dist/ssr/index.js.map +0 -1
  904. package/dist/static-handler.d.ts +0 -50
  905. package/dist/static-handler.d.ts.map +0 -1
  906. package/dist/static-handler.gen.d.ts +0 -5
  907. package/dist/static-handler.gen.d.ts.map +0 -1
  908. package/dist/static-handler.gen.js +0 -5
  909. package/dist/static-handler.gen.js.map +0 -1
  910. package/dist/static-handler.js +0 -29
  911. package/dist/static-handler.js.map +0 -1
  912. package/dist/theme/ThemeProvider.d.ts +0 -20
  913. package/dist/theme/ThemeProvider.d.ts.map +0 -1
  914. package/dist/theme/ThemeProvider.js +0 -240
  915. package/dist/theme/ThemeProvider.js.map +0 -1
  916. package/dist/theme/ThemeScript.d.ts +0 -48
  917. package/dist/theme/ThemeScript.d.ts.map +0 -1
  918. package/dist/theme/ThemeScript.js +0 -13
  919. package/dist/theme/ThemeScript.js.map +0 -1
  920. package/dist/theme/__tests__/theme.test.d.ts +0 -2
  921. package/dist/theme/__tests__/theme.test.d.ts.map +0 -1
  922. package/dist/theme/__tests__/theme.test.js +0 -103
  923. package/dist/theme/__tests__/theme.test.js.map +0 -1
  924. package/dist/theme/constants.d.ts +0 -29
  925. package/dist/theme/constants.d.ts.map +0 -1
  926. package/dist/theme/constants.js +0 -48
  927. package/dist/theme/constants.js.map +0 -1
  928. package/dist/theme/index.d.ts +0 -31
  929. package/dist/theme/index.d.ts.map +0 -1
  930. package/dist/theme/index.js +0 -36
  931. package/dist/theme/index.js.map +0 -1
  932. package/dist/theme/theme-context.d.ts +0 -40
  933. package/dist/theme/theme-context.d.ts.map +0 -1
  934. package/dist/theme/theme-context.js +0 -60
  935. package/dist/theme/theme-context.js.map +0 -1
  936. package/dist/theme/theme-script.d.ts +0 -27
  937. package/dist/theme/theme-script.d.ts.map +0 -1
  938. package/dist/theme/theme-script.js +0 -147
  939. package/dist/theme/theme-script.js.map +0 -1
  940. package/dist/theme/types.d.ts +0 -163
  941. package/dist/theme/types.d.ts.map +0 -1
  942. package/dist/theme/types.js +0 -11
  943. package/dist/theme/types.js.map +0 -1
  944. package/dist/theme/use-theme.d.ts +0 -12
  945. package/dist/theme/use-theme.d.ts.map +0 -1
  946. package/dist/theme/use-theme.js +0 -40
  947. package/dist/theme/use-theme.js.map +0 -1
  948. package/dist/types.d.ts +0 -1479
  949. package/dist/types.d.ts.map +0 -1
  950. package/dist/types.js +0 -10
  951. package/dist/types.js.map +0 -1
  952. package/dist/urls.d.ts +0 -441
  953. package/dist/urls.d.ts.map +0 -1
  954. package/dist/urls.gen.d.ts +0 -8
  955. package/dist/urls.gen.d.ts.map +0 -1
  956. package/dist/urls.gen.js +0 -8
  957. package/dist/urls.gen.js.map +0 -1
  958. package/dist/urls.js +0 -443
  959. package/dist/urls.js.map +0 -1
  960. package/dist/use-loader.d.ts +0 -127
  961. package/dist/use-loader.d.ts.map +0 -1
  962. package/dist/use-loader.js +0 -237
  963. package/dist/use-loader.js.map +0 -1
  964. package/dist/vite/__tests__/ast-handler-extract.test.d.ts +0 -2
  965. package/dist/vite/__tests__/ast-handler-extract.test.d.ts.map +0 -1
  966. package/dist/vite/__tests__/ast-handler-extract.test.js +0 -294
  967. package/dist/vite/__tests__/ast-handler-extract.test.js.map +0 -1
  968. package/dist/vite/__tests__/expose-id-utils.test.d.ts +0 -2
  969. package/dist/vite/__tests__/expose-id-utils.test.d.ts.map +0 -1
  970. package/dist/vite/__tests__/expose-id-utils.test.js +0 -224
  971. package/dist/vite/__tests__/expose-id-utils.test.js.map +0 -1
  972. package/dist/vite/__tests__/expose-internal-ids.test.d.ts +0 -2
  973. package/dist/vite/__tests__/expose-internal-ids.test.d.ts.map +0 -1
  974. package/dist/vite/__tests__/expose-internal-ids.test.js +0 -647
  975. package/dist/vite/__tests__/expose-internal-ids.test.js.map +0 -1
  976. package/dist/vite/__tests__/expose-router-id.test.d.ts +0 -2
  977. package/dist/vite/__tests__/expose-router-id.test.d.ts.map +0 -1
  978. package/dist/vite/__tests__/expose-router-id.test.js +0 -39
  979. package/dist/vite/__tests__/expose-router-id.test.js.map +0 -1
  980. package/dist/vite/ast-handler-extract.d.ts +0 -49
  981. package/dist/vite/ast-handler-extract.d.ts.map +0 -1
  982. package/dist/vite/ast-handler-extract.js +0 -249
  983. package/dist/vite/ast-handler-extract.js.map +0 -1
  984. package/dist/vite/expose-action-id.d.ts +0 -19
  985. package/dist/vite/expose-action-id.d.ts.map +0 -1
  986. package/dist/vite/expose-action-id.js +0 -250
  987. package/dist/vite/expose-action-id.js.map +0 -1
  988. package/dist/vite/expose-id-utils.d.ts +0 -69
  989. package/dist/vite/expose-id-utils.d.ts.map +0 -1
  990. package/dist/vite/expose-id-utils.js +0 -289
  991. package/dist/vite/expose-id-utils.js.map +0 -1
  992. package/dist/vite/expose-internal-ids.d.ts +0 -22
  993. package/dist/vite/expose-internal-ids.d.ts.map +0 -1
  994. package/dist/vite/expose-internal-ids.js +0 -886
  995. package/dist/vite/expose-internal-ids.js.map +0 -1
  996. package/dist/vite/index.d.ts +0 -149
  997. package/dist/vite/index.d.ts.map +0 -1
  998. package/dist/vite/index.js.bak +0 -5448
  999. package/dist/vite/index.js.map +0 -1
  1000. package/dist/vite/index.named-routes.gen.ts +0 -103
  1001. package/dist/vite/package-resolution.d.ts +0 -43
  1002. package/dist/vite/package-resolution.d.ts.map +0 -1
  1003. package/dist/vite/package-resolution.js +0 -112
  1004. package/dist/vite/package-resolution.js.map +0 -1
  1005. package/dist/vite/virtual-entries.d.ts +0 -25
  1006. package/dist/vite/virtual-entries.d.ts.map +0 -1
  1007. package/dist/vite/virtual-entries.js +0 -110
  1008. package/dist/vite/virtual-entries.js.map +0 -1
  1009. package/src/browser/shallow.ts +0 -40
package/src/index.rsc.ts CHANGED
@@ -75,6 +75,13 @@ export type {
75
75
  ResolveStreamingContext,
76
76
  } from "./router.js";
77
77
 
78
+ // Origin-check callback types (referenced by the RangoOptions.originCheck JSDoc)
79
+ export type {
80
+ OriginCheckConfig,
81
+ OriginCheckContext,
82
+ OriginCheckPhase,
83
+ } from "./rsc/origin-guard.js";
84
+
78
85
  // Server-side createLoader and redirect
79
86
  export {
80
87
  createLoader,
@@ -124,10 +131,15 @@ export {
124
131
  type BuildContext,
125
132
  type StaticBuildContext,
126
133
  type GetParamsContext,
134
+ type PrerenderPassthroughResult,
127
135
  } from "./prerender.js";
128
136
 
129
137
  // Static handler API
130
- export { Static, type StaticHandlerDefinition } from "./static-handler.js";
138
+ export {
139
+ Static,
140
+ type StaticHandlerDefinition,
141
+ type StaticHandlerOptions,
142
+ } from "./static-handler.js";
131
143
 
132
144
  // Django-style URL patterns (RSC/server context)
133
145
  export {
@@ -202,7 +214,13 @@ export { updateTag, revalidateTag } from "./cache/tag-invalidation.js";
202
214
  export type { MetaDescriptor, MetaDescriptorBase } from "./router/types.js";
203
215
 
204
216
  // Middleware context types
205
- export type { MiddlewareContext, CookieOptions } from "./router/middleware.js";
217
+ export type {
218
+ MiddlewareContext,
219
+ CookieOptions,
220
+ // The function type of a middleware. Public so the documented "extract the
221
+ // middleware and unit-test it with runMiddleware" pattern has a nameable type.
222
+ MiddlewareFn,
223
+ } from "./router/middleware.js";
206
224
 
207
225
  // Reverse type utilities for type-safe URL generation (Django-style URL reversal)
208
226
  export type {
@@ -1,7 +1,5 @@
1
- // Internal debug gate. Enable with INTERNAL_RANGO_DEBUG=1 in the environment.
2
- // Uses a Vite define (__RANGO_DEBUG__) for compile-time injection so it works
3
- // in all runtimes including Cloudflare Workers where process.env is unavailable.
4
- // Falls back to process.env for non-Vite contexts (tests, direct Node usage).
1
+ // Vite define for compile-time injection; falls back to process.env (tests, Node).
2
+ // Works in all runtimes including Cloudflare Workers where process.env is unavailable.
5
3
  export const INTERNAL_RANGO_DEBUG: boolean =
6
4
  typeof __RANGO_DEBUG__ !== "undefined"
7
5
  ? __RANGO_DEBUG__
package/src/loader.rsc.ts CHANGED
@@ -26,8 +26,7 @@ import { isUnderTestRunner } from "./runtime-env.js";
26
26
 
27
27
  export { getFetchableLoader };
28
28
 
29
- // Counter for runtime-fallback loader ids assigned only in a bare unit test
30
- // (no Vite plugin to inject one). Process-stable; never reached in a real build.
29
+ // Runtime-fallback counter for bare unit tests (no Vite plugin); process-stable.
31
30
  let runtimeLoaderIdCounter = 0;
32
31
 
33
32
  // Overload 1: With function only (not fetchable)
@@ -54,17 +53,10 @@ export function createLoader<T>(
54
53
  // Hidden parameter injected by Vite exposeInternalIds plugin
55
54
  __injectedId?: string,
56
55
  ): LoaderDefinition<Awaited<T>, Record<string, string | undefined>> {
57
- // The $$id will be set on the returned object by Vite plugin
58
- // For fetchable loaders, __injectedId is also passed as a parameter
59
56
  let loaderId = __injectedId || "";
60
57
 
61
- // No build-injected id. Under a test runner: fall back to a synthetic id so the
62
- // fn registers below and the loader is exercisable via runLoader(loaderHandle)
63
- // (it recovers the fn from the registry by $$id). Otherwise (dev or a real
64
- // build) it means an UNSUPPORTED shape (e.g. a namespace import
65
- // `rango.createLoader(...)`) the plugin skipped — fail loud. The rich
66
- // diagnostic stays behind the NODE_ENV check so production folds it away and
67
- // ships the small throw. isUnderTestRunner() is runtime-safe. Mirrors createHandle.
58
+ // Under test runner, fall back to synthetic id (recovers fn from registry by $$id).
59
+ // Otherwise (dev or prod), missing id means unsupported shape — fail loud.
68
60
  if (!loaderId) {
69
61
  if (isUnderTestRunner()) {
70
62
  loaderId = `__rango_runtime_loader_${runtimeLoaderIdCounter++}`;
@@ -90,12 +82,9 @@ export function createLoader<T>(
90
82
  };
91
83
  }
92
84
 
93
- // Fetchable loader - store fn in registry and return a serializable object
85
+ // Fetchable loader - store fn in registry and return a serializable object.
94
86
  const middleware: MiddlewareFn[] =
95
87
  fetchable === true ? [] : fetchable?.middleware || [];
96
-
97
- // Register the function in the internal registry by $$id (server-side only)
98
- // The loader fetch handler looks it up by $$id when load() is called from the client.
99
88
  if (fn && loaderId) {
100
89
  registerFetchableLoader(loaderId, fn, middleware, true);
101
90
  }
package/src/loader.ts CHANGED
@@ -38,8 +38,7 @@ export function createLoader<T>(
38
38
  options: FetchableLoaderOptions,
39
39
  ): LoaderDefinition<Awaited<T>, Record<string, string | undefined>>;
40
40
 
41
- // Implementation - client stub that just returns the loader definition
42
- // The $$id parameter is injected by Vite plugin, not user-provided
41
+ // Implementation - client stub ($$id injected by Vite plugin, not user-provided)
43
42
  export function createLoader<T>(
44
43
  _fn: LoaderFn<T, Record<string, string | undefined>, any>,
45
44
  _fetchable?: true | FetchableLoaderOptions,
@@ -47,13 +46,8 @@ export function createLoader<T>(
47
46
  ): LoaderDefinition<Awaited<T>, Record<string, string | undefined>> {
48
47
  const loaderId = __injectedId || "";
49
48
 
50
- // Client/SSR build of createLoader. Under a test runner it needs no id
51
- // (loaderId stays ""; the react-server build in loader.rsc.ts adds the runtime
52
- // fallback for whole-router construction). Otherwise (dev or a real build) a
53
- // missing id means an UNSUPPORTED shape the plugin skipped — fail loud rather
54
- // than ship `$$id: ""` (which would make a client useLoader read the wrong
55
- // key). The rich diagnostic stays behind the NODE_ENV check so production folds
56
- // it away and ships the small throw. isUnderTestRunner() is runtime-safe.
49
+ // Under test runner, no id needed (loaderId stays ""; loader.rsc.ts provides fallback).
50
+ // Otherwise, missing id means unsupported shape fail loud to avoid wrong key.
57
51
  if (!loaderId && !isUnderTestRunner()) {
58
52
  if (process.env.NODE_ENV !== "production") {
59
53
  throw missingInjectedIdError("Loader", "createLoader");
@@ -9,12 +9,7 @@ interface NetworkErrorThrowerProps {
9
9
 
10
10
  /**
11
11
  * Client component that throws a NetworkError during render.
12
- * Used to trigger the root error boundary when a network error occurs
13
- * during navigation or server actions.
14
- *
15
- * This must be a separate component because:
16
- * 1. Errors must be thrown during React's render phase to be caught by error boundaries
17
- * 2. The error occurs in async code (fetch), so we need to propagate it to React's render
12
+ * Errors thrown during render are caught by error boundaries; async errors are not.
18
13
  */
19
14
  export function NetworkErrorThrower({
20
15
  error,
@@ -5,11 +5,7 @@ import { OutletContext, type OutletContextValue } from "./outlet-context.js";
5
5
  import type { ResolvedSegment } from "./types.js";
6
6
 
7
7
  /**
8
- * Provider for outlet content - used internally by renderSegments
9
- *
10
- * Stores a reference to parent context so useLoader can walk up the chain
11
- * to find loader data from parent layouts. If this segment defines a loading
12
- * component, Outlet will wrap content with Suspense using that as fallback.
8
+ * Outlet content provider stores parent context for useLoader chain walking.
13
9
  */
14
10
  export function OutletProvider({
15
11
  content,
@@ -1,18 +1,10 @@
1
1
  /**
2
2
  * Deterministic param hashing for prerender storage keys.
3
- *
4
- * Used at build time (child process) to generate filenames and at
5
- * runtime (worker) to look up pre-rendered data. Both environments
6
- * must produce identical hashes for the same params.
7
- *
8
- * Uses a simple DJB2-based hash that works in all JS environments
9
- * (Node.js, Cloudflare Workers, browsers) without crypto imports.
3
+ * Used at build time and runtime; both must produce identical hashes.
4
+ * DJB2-based; works in all JS environments without crypto imports.
10
5
  */
11
6
 
12
- /**
13
- * Compute a deterministic hash string from route params.
14
- * For static routes (no params), returns "_".
15
- */
7
+ // For static routes (no params), returns "_".
16
8
  export function hashParams(params: Record<string, string>): string {
17
9
  const entries = Object.entries(params);
18
10
  if (entries.length === 0) return "_";
@@ -27,6 +19,13 @@ export function hashParams(params: Record<string, string>): string {
27
19
  /**
28
20
  * DJB2 hash returning an 8-char hex string.
29
21
  * Deterministic across all JS runtimes.
22
+ *
23
+ * 32-bit output: per-route collision probability hits ~50% near ~77k distinct
24
+ * param sets (birthday bound). The production store keys solely on
25
+ * routeName/paramHash and does not verify the canonical param string, so a
26
+ * collision serves the surviving entry for both param sets. Benign for typical
27
+ * catalogs; revisit (wider hash or stored-param verification) before
28
+ * pre-rendering hundreds of thousands of pages per route.
30
29
  */
31
30
  function djb2Hex(str: string): string {
32
31
  let hash = 5381;
@@ -1,11 +1,7 @@
1
1
  /**
2
- * Prerender Store
3
- *
4
- * Reads pre-rendered segment data from the worker bundle at build time.
5
- * The manifest module is lazily loaded via globalThis.__loadPrerenderManifestModule,
6
- * a function injected into the RSC entry that returns the manifest module
7
- * containing a key-to-specifier map and a `loadPrerenderAsset` function
8
- * that anchors import() resolution relative to the manifest file.
2
+ * Prerender Store — reads pre-rendered segment data from the worker bundle.
3
+ * Manifest module (injected via globalThis.__loadPrerenderManifestModule)
4
+ * contains key-to-specifier map and loadPrerenderAsset for import() resolution.
9
5
  */
10
6
 
11
7
  import type { SerializedSegmentData } from "../cache/types.js";
@@ -101,13 +97,20 @@ export function createPrerenderStore(): PrerenderStore | null {
101
97
  if (!globalThis.__loadPrerenderManifestModule) return null;
102
98
 
103
99
  const cache = new Map<string, Promise<PrerenderEntry | null>>();
104
- let manifestModulePromise: Promise<PrerenderManifestModule | null> | null =
105
- null;
100
+ let manifestModulePromise: Promise<PrerenderManifestModule> | null = null;
106
101
 
107
- function loadManifestModule(): Promise<PrerenderManifestModule | null> {
102
+ function loadManifestModule(): Promise<PrerenderManifestModule> {
108
103
  if (!manifestModulePromise) {
104
+ // Do not cache a failed manifest-module load: clear the memoized promise
105
+ // on rejection so the next get() retries, and let the error propagate
106
+ // (consistent with the per-asset load policy below) instead of caching a
107
+ // null for the isolate lifetime, which would silently degrade every
108
+ // prerendered route to a miss after one transient failure.
109
109
  manifestModulePromise = globalThis.__loadPrerenderManifestModule!().catch(
110
- () => null,
110
+ (err) => {
111
+ manifestModulePromise = null;
112
+ throw err;
113
+ },
111
114
  );
112
115
  }
113
116
  return manifestModulePromise;
@@ -120,7 +123,6 @@ export function createPrerenderStore(): PrerenderStore | null {
120
123
  if (cached) return cached;
121
124
 
122
125
  const promise = loadManifestModule().then((mod) => {
123
- if (!mod) return null;
124
126
  const specifier = mod.default[key];
125
127
  if (!specifier) return null;
126
128
  // Let asset load errors propagate — a missing/corrupted artifact
@@ -129,29 +131,20 @@ export function createPrerenderStore(): PrerenderStore | null {
129
131
  // (which the handler stub would misreport as a 404).
130
132
  return mod.loadPrerenderAsset(specifier).then((asset) => asset.default);
131
133
  });
132
- cache.set(key, promise);
134
+ // Only memoize once the manifest module resolved: a manifest-load
135
+ // rejection must not poison the per-key cache, or the retry above is moot.
136
+ cache.set(
137
+ key,
138
+ promise.catch((err) => {
139
+ cache.delete(key);
140
+ throw err;
141
+ }),
142
+ );
133
143
  return promise;
134
144
  },
135
145
  };
136
146
  }
137
147
 
138
- /**
139
- * Load the prerender manifest index for test introspection.
140
- * Returns the key→specifier map or null if unavailable.
141
- */
142
- export async function loadPrerenderManifestIndex(): Promise<Record<
143
- string,
144
- string
145
- > | null> {
146
- if (!globalThis.__loadPrerenderManifestModule) return null;
147
- try {
148
- const mod = await globalThis.__loadPrerenderManifestModule();
149
- return mod.default;
150
- } catch {
151
- return null;
152
- }
153
- }
154
-
155
148
  /**
156
149
  * Create a static segment store.
157
150
  * Production only: backed by globalThis.__STATIC_MANIFEST injected at build time.
package/src/prerender.ts CHANGED
@@ -442,6 +442,40 @@ export function isPrerenderPassthrough(
442
442
  );
443
443
  }
444
444
 
445
+ /**
446
+ * Detect whether any resolved segment carries the passthrough sentinel.
447
+ *
448
+ * A build handler signals passthrough by returning `ctx.passthrough()` (the
449
+ * PRERENDER_PASSTHROUGH sentinel), which lands on the segment's `component`.
450
+ * But when the route declares `loading()`, the handler result is deferred
451
+ * upstream (segment-resolution/fresh.ts), so `component` is a thenable resolving
452
+ * to the sentinel rather than the sentinel itself — a synchronous
453
+ * `isPrerenderPassthrough(component)` on the Promise returns false and the build
454
+ * bakes a corrupt artifact instead of deferring. Resolve thenables first.
455
+ *
456
+ * Rejections are swallowed here: a throwing build handler resurfaces during
457
+ * segment serialization, preserving the prior error-handling behavior.
458
+ */
459
+ export async function detectPrerenderPassthrough(
460
+ segments: ReadonlyArray<{ component: unknown }>,
461
+ ): Promise<boolean> {
462
+ for (const seg of segments) {
463
+ let component: unknown = seg.component;
464
+ if (
465
+ component &&
466
+ typeof (component as { then?: unknown }).then === "function"
467
+ ) {
468
+ try {
469
+ component = await component;
470
+ } catch {
471
+ continue;
472
+ }
473
+ }
474
+ if (isPrerenderPassthrough(component)) return true;
475
+ }
476
+ return false;
477
+ }
478
+
445
479
  // -- Type guards ------------------------------------------------------------
446
480
 
447
481
  /**
@@ -3,26 +3,17 @@
3
3
  import { Component, useState, type ReactNode } from "react";
4
4
  import type { ClientErrorBoundaryFallbackProps } from "./types.js";
5
5
 
6
- /**
7
- * Check if an error is a network-related error
8
- */
9
6
  function isNetworkError(error: Error): boolean {
10
7
  return error.name === "NetworkError";
11
8
  }
12
9
 
13
- /**
14
- * Network error fallback UI with retry functionality
15
- * Shows a connection-specific message and allows retrying via page refresh
16
- */
17
10
  function NetworkErrorFallback({
18
11
  error,
19
- reset,
20
12
  }: ClientErrorBoundaryFallbackProps): ReactNode {
21
13
  const [isRetrying, setIsRetrying] = useState(false);
22
14
 
23
15
  const handleRetry = (): void => {
24
16
  setIsRetrying(true);
25
- // Refresh the page to retry the request
26
17
  window.location.reload();
27
18
  };
28
19
 
@@ -42,7 +33,6 @@ function NetworkErrorFallback({
42
33
  marginBottom: "1rem",
43
34
  }}
44
35
  >
45
- {/* Simple cloud with x icon using CSS */}
46
36
  <span style={{ color: "#9ca3af" }}>&#9729;</span>
47
37
  </div>
48
38
  <h1
@@ -101,10 +91,6 @@ function NetworkErrorFallback({
101
91
  );
102
92
  }
103
93
 
104
- /**
105
- * Default fallback UI for root error boundary
106
- * This is shown when an unhandled error bubbles up to the root
107
- */
108
94
  function RootErrorFallback({
109
95
  error,
110
96
  reset,
@@ -230,7 +216,6 @@ export class RootErrorBoundary extends Component<
230
216
  }
231
217
 
232
218
  componentDidMount(): void {
233
- // Listen for popstate (back/forward navigation) to reset error state
234
219
  window.addEventListener("popstate", this.handlePopState);
235
220
  }
236
221
 
@@ -247,15 +232,13 @@ export class RootErrorBoundary extends Component<
247
232
  }
248
233
 
249
234
  componentDidUpdate(prevProps: { children: ReactNode }): void {
250
- // Reset error state when children change (e.g., navigation)
251
- // This allows the app to recover after navigation away from an errored route
235
+ // Reset error on children change (navigation).
252
236
  if (this.state.hasError && prevProps.children !== this.props.children) {
253
237
  this.setState({ hasError: false, error: null });
254
238
  }
255
239
  }
256
240
 
257
241
  handlePopState = (): void => {
258
- // Reset error state on back/forward navigation
259
242
  if (this.state.hasError) {
260
243
  this.setState({ hasError: false, error: null });
261
244
  }
@@ -276,7 +259,6 @@ export class RootErrorBoundary extends Component<
276
259
  segmentType: "route" as const,
277
260
  };
278
261
 
279
- // Use specialized fallback for network errors
280
262
  if (isNetworkError(this.state.error)) {
281
263
  return <NetworkErrorFallback error={errorInfo} reset={this.reset} />;
282
264
  }
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import type { ReactNode } from "react";
3
- import { Suspense, use, useId } from "react";
3
+ import { Suspense, use } from "react";
4
4
  import { invariant } from "./errors";
5
5
  import { OutletProvider } from "./outlet-provider.js";
6
6
  import type { ResolvedSegment } from "./types.js";
@@ -36,37 +36,6 @@ export function RouteContentWrapper({
36
36
  );
37
37
  }
38
38
 
39
- export function RouteContentWrapperCallback<T>({
40
- resolve,
41
- fallback,
42
- children,
43
- }: {
44
- resolve: Promise<T> | T;
45
- fallback?: ReactNode;
46
- children: (data: T) => ReactNode;
47
- }): ReactNode {
48
- const id = useId();
49
- invariant(children, "RouteContentWrapperCallback requires children");
50
- invariant(
51
- typeof children === "function",
52
- "RouteContentWrapperCallback requires children to be a function",
53
- );
54
- invariant(
55
- resolve !== undefined,
56
- "RouteContentWrapperCallback requires resolve",
57
- );
58
- return (
59
- <Suspense
60
- fallback={fallback ?? null}
61
- key={"route-content-suspense-callback-" + id}
62
- >
63
- <SuspenderCallback resolve={resolve} key={id}>
64
- {children}
65
- </SuspenderCallback>
66
- </Suspense>
67
- );
68
- }
69
-
70
39
  const Suspender = ({
71
40
  content,
72
41
  }: {
@@ -77,18 +46,6 @@ const Suspender = ({
77
46
  return use(content);
78
47
  };
79
48
 
80
- const SuspenderCallback = <T,>({
81
- resolve,
82
- children,
83
- }: {
84
- resolve: Promise<T> | T;
85
- children: (data: T) => ReactNode;
86
- }): ReactNode => {
87
- return resolve instanceof Promise
88
- ? children(use(resolve))
89
- : children(resolve);
90
- };
91
-
92
49
  /**
93
50
  * LoaderBoundary - Client component that resolves loader promises and renders OutletProvider
94
51
  *
@@ -302,15 +302,15 @@ const when: RouteHelpers<any, any>["when"] = (fn) => {
302
302
  * Supports these call signatures:
303
303
  * - cache() - no args, uses app-level defaults (for loader caching)
304
304
  * - cache(() => [...]) - wraps children with app-level defaults
305
- * - cache('profileName') - uses a named cache profile
306
- * - cache('profileName', () => [...]) - named profile with children
307
305
  * - cache({ ttl: 60 }, () => [...]) - with explicit options
306
+ *
307
+ * Named cache profiles are applied via the `"use cache: <profile>"` directive,
308
+ * not a `cache("profileName")` form in the route tree.
308
309
  */
309
310
  const cache: RouteHelpers<any, any>["cache"] = (
310
311
  optionsOrChildren?:
311
312
  | PartialCacheOptions
312
313
  | false
313
- | string
314
314
  | (() => UseItems<AllUseItems>),
315
315
  maybeChildren?: () => UseItems<AllUseItems>,
316
316
  ) => {
@@ -326,18 +326,6 @@ const cache: RouteHelpers<any, any>["cache"] = (
326
326
  // cache() - no args, use defaults
327
327
  options = {};
328
328
  children = undefined;
329
- } else if (typeof optionsOrChildren === "string") {
330
- // cache('profileName') or cache('profileName', () => [...])
331
- // Resolve from context-scoped profiles (set per-router via HelperContext).
332
- const ctxStore = RangoContext.getStore();
333
- const profile = ctxStore?.cacheProfiles?.[optionsOrChildren];
334
- invariant(
335
- profile,
336
- `cache("${optionsOrChildren}"): unknown cache profile. ` +
337
- `Define it in createRouter({ cacheProfiles: { "${optionsOrChildren}": { ttl: ... } } }).`,
338
- );
339
- options = { ttl: profile.ttl, swr: profile.swr, tags: profile.tags };
340
- children = maybeChildren;
341
329
  } else if (typeof optionsOrChildren === "function") {
342
330
  // cache(() => [...]) - use empty options (will use defaults)
343
331
  options = {};
@@ -393,10 +381,10 @@ const cache: RouteHelpers<any, any>["cache"] = (
393
381
  return { name: namespace, type: "cache" } as CacheItem;
394
382
  }
395
383
 
396
- // Inside a loader() use() callback, only the direct form — cache()/cache(opts)/
397
- // cache("profile") — writes cache config to the loader entry. The wrapper
398
- // form creates a structural cache boundary with its own children scope, which
399
- // has no effect on the loader and would silently no-op.
384
+ // Inside a loader() use() callback, only the direct form — cache()/cache(opts)
385
+ // — writes cache config to the loader entry. The wrapper form creates a
386
+ // structural cache boundary with its own children scope, which has no effect
387
+ // on the loader and would silently no-op.
400
388
  invariant(
401
389
  !(ctx.parent && (ctx.parent as any).type === "loader"),
402
390
  "cache() wrapper form is not valid inside loader() use(). Use cache({...}) without children to configure the loader's cache.",
@@ -441,10 +441,8 @@ export type RouteHelpers<T extends RouteDefinition, TEnv> = {
441
441
  cache: {
442
442
  (): CacheItem;
443
443
  (children: () => UseItems<AllUseItems>): CacheItem;
444
- (profileName: string): CacheItem;
445
- (profileName: string, use: () => UseItems<AllUseItems>): CacheItem;
446
444
  (
447
- options: PartialCacheOptions | false,
445
+ options: PartialCacheOptions<TEnv> | false,
448
446
  use?: () => UseItems<AllUseItems>,
449
447
  ): CacheItem;
450
448
  };
@@ -497,6 +495,8 @@ export type RouteHelpers<T extends RouteDefinition, TEnv> = {
497
495
  * @param children - Optional callback returning child routes to wrap
498
496
  */
499
497
  transition: {
498
+ (): TransitionItem;
499
+ (children: () => UseItems<AllUseItems>): TransitionItem;
500
500
  (config: TransitionConfig): TransitionItem;
501
501
  (
502
502
  config: TransitionConfig,
@@ -85,9 +85,19 @@ export function redirect(
85
85
  }
86
86
 
87
87
  // Auto-prefix root-relative URLs with basename for app-local redirects.
88
+ // Treat the URL as already-prefixed when the basename is followed by a path
89
+ // separator, a query, a fragment, or end-of-string, so "/admin?tab=x" and
90
+ // "/admin#frag" are not double-prefixed into "/admin/admin?tab=x".
88
91
  const bn = _getRequestContext()?._basename;
89
92
  let resolvedUrl = url;
90
- if (bn && url.startsWith("/") && !url.startsWith(bn + "/") && url !== bn) {
93
+ if (
94
+ bn &&
95
+ url.startsWith("/") &&
96
+ url !== bn &&
97
+ !url.startsWith(bn + "/") &&
98
+ !url.startsWith(bn + "?") &&
99
+ !url.startsWith(bn + "#")
100
+ ) {
91
101
  resolvedUrl = url === "/" ? bn : bn + url;
92
102
  }
93
103
 
@@ -8,15 +8,10 @@
8
8
  * See docs/manifests.md for the full data flow.
9
9
  */
10
10
 
11
- // Singleton route map instance - populated incrementally as routes are encountered
12
11
  let globalRouteMap: Record<string, string> = {};
13
12
 
14
- // Cached complete manifest - includes all routes (including lazy includes)
15
- // Set from runtime cache or build-time import
16
13
  let cachedManifest: Record<string, string> | null = null;
17
14
 
18
- // Pre-computed route entries from build-time prefix tree leaf nodes.
19
- // Used by evaluateLazyEntry() to skip running the handler for route matching.
20
15
  let cachedPrecomputedEntries: Array<{
21
16
  staticPrefix: string;
22
17
  routes: Record<string, string>;
@@ -43,7 +38,6 @@ export function registerRouteMap(map: Record<string, string>): void {
43
38
  * @internal
44
39
  */
45
40
  export function getGlobalRouteMap(): Record<string, string> {
46
- // Cached manifest is complete (includes lazy routes), so prefer it
47
41
  if (cachedManifest) {
48
42
  return cachedManifest;
49
43
  }
@@ -231,10 +225,6 @@ export function waitForManifestReady(): Promise<void> | null {
231
225
  return manifestReadyPromise;
232
226
  }
233
227
 
234
- // ============================================================================
235
- // Route Scope Registry
236
- // ============================================================================
237
-
238
228
  // Tracks whether each route is at root scope (no named include boundary above).
239
229
  // Used by dot-local reverse resolution to decide whether bare-name fallback
240
230
  // is allowed after scoped lookups are exhausted.
@@ -259,14 +249,8 @@ export function isRouteRootScoped(routeName: string): boolean | undefined {
259
249
  return rootScopeRoutes.get(routeName);
260
250
  }
261
251
 
262
- // ============================================================================
263
- // Search Schema Registry
264
- // ============================================================================
265
-
266
252
  import type { SearchSchema } from "./search-params.js";
267
253
 
268
- // Global search schema map: route name -> search schema descriptor.
269
- // Populated by path() when a search option is provided.
270
254
  const globalSearchSchemas: Map<string, SearchSchema> = new Map();
271
255
 
272
256
  export function registerSearchSchema(