react-router 7.15.1 → 8.0.0-pre.0

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 (369) hide show
  1. package/CHANGELOG.md +18 -2
  2. package/dist/development/dom-export.d.ts +6 -172
  3. package/dist/development/dom-export.js +12 -1007
  4. package/dist/development/index-react-server-client.d.ts +7 -4
  5. package/dist/development/index-react-server-client.js +8 -52
  6. package/dist/development/index-react-server.d.ts +1645 -1635
  7. package/dist/development/index-react-server.js +2880 -3642
  8. package/dist/development/index.d.ts +43 -1469
  9. package/dist/development/index.js +37 -2621
  10. package/dist/development/lib/actions.js +62 -0
  11. package/dist/development/lib/components.d.ts +1022 -0
  12. package/dist/development/lib/components.js +835 -0
  13. package/dist/development/lib/context.d.ts +83 -0
  14. package/dist/development/lib/context.js +41 -0
  15. package/dist/development/lib/dom/dom.d.ts +119 -0
  16. package/dist/development/lib/dom/dom.js +143 -0
  17. package/dist/development/lib/dom/lib.d.ts +2042 -0
  18. package/dist/development/lib/dom/lib.js +1259 -0
  19. package/dist/development/lib/dom/server.d.ts +138 -0
  20. package/dist/development/lib/dom/server.js +301 -0
  21. package/dist/development/lib/dom/ssr/components.d.ts +196 -0
  22. package/dist/development/lib/dom/ssr/components.js +579 -0
  23. package/dist/development/lib/dom/ssr/data.js +29 -0
  24. package/dist/development/lib/dom/ssr/entry.d.ts +59 -0
  25. package/dist/development/lib/dom/ssr/errorBoundaries.d.ts +27 -0
  26. package/dist/development/lib/dom/ssr/errorBoundaries.js +83 -0
  27. package/dist/development/lib/dom/ssr/errors.d.ts +7 -0
  28. package/dist/development/lib/dom/ssr/errors.js +36 -0
  29. package/dist/development/lib/dom/ssr/fallback.js +28 -0
  30. package/dist/development/lib/dom/ssr/fog-of-war.d.ts +12 -0
  31. package/dist/development/lib/dom/ssr/fog-of-war.js +170 -0
  32. package/dist/development/lib/dom/ssr/hydration.d.ts +32 -0
  33. package/dist/development/lib/dom/ssr/hydration.js +29 -0
  34. package/dist/development/lib/dom/ssr/invariant.js +16 -0
  35. package/dist/development/lib/dom/ssr/links.js +170 -0
  36. package/dist/development/lib/dom/ssr/markup.js +24 -0
  37. package/dist/development/lib/dom/ssr/routeModules.d.ts +206 -0
  38. package/dist/development/lib/dom/ssr/routeModules.js +31 -0
  39. package/dist/development/lib/dom/ssr/routes-test-stub.d.ts +62 -0
  40. package/dist/development/lib/dom/ssr/routes-test-stub.js +108 -0
  41. package/dist/development/lib/dom/ssr/routes.d.ts +33 -0
  42. package/dist/development/lib/dom/ssr/routes.js +303 -0
  43. package/dist/development/lib/dom/ssr/server.d.ts +45 -0
  44. package/dist/development/lib/dom/ssr/server.js +68 -0
  45. package/dist/development/lib/dom/ssr/single-fetch.d.ts +14 -0
  46. package/dist/development/lib/dom/ssr/single-fetch.js +346 -0
  47. package/dist/development/lib/dom-export/dom-router-provider.d.ts +9 -0
  48. package/dist/development/lib/dom-export/dom-router-provider.js +22 -0
  49. package/dist/development/lib/dom-export/hydrated-router.d.ts +125 -0
  50. package/dist/development/lib/dom-export/hydrated-router.js +153 -0
  51. package/dist/development/lib/errors.js +29 -0
  52. package/dist/development/lib/hooks.d.ts +947 -0
  53. package/dist/development/lib/hooks.js +1386 -0
  54. package/dist/development/lib/href.d.ts +20 -0
  55. package/dist/development/lib/href.js +50 -0
  56. package/dist/development/lib/router/history.d.ts +258 -0
  57. package/dist/development/lib/router/history.js +371 -0
  58. package/dist/development/lib/router/instrumentation.d.ts +86 -0
  59. package/dist/development/lib/router/instrumentation.js +213 -0
  60. package/dist/development/lib/router/links.d.ts +113 -0
  61. package/dist/development/lib/router/router.d.ts +663 -0
  62. package/dist/development/lib/router/router.js +2981 -0
  63. package/dist/development/lib/router/utils.d.ts +942 -0
  64. package/dist/development/lib/router/utils.js +791 -0
  65. package/dist/development/lib/rsc/browser.d.ts +137 -0
  66. package/dist/development/lib/rsc/browser.js +599 -0
  67. package/dist/development/lib/rsc/errorBoundaries.d.ts +11 -0
  68. package/dist/development/lib/rsc/errorBoundaries.js +90 -0
  69. package/dist/development/lib/rsc/html-stream/browser.d.ts +48 -0
  70. package/dist/development/lib/rsc/html-stream/browser.js +74 -0
  71. package/dist/development/lib/rsc/html-stream/server.js +78 -0
  72. package/dist/development/lib/rsc/route-modules.js +27 -0
  73. package/dist/development/lib/rsc/server.rsc.d.ts +219 -0
  74. package/dist/development/lib/rsc/server.ssr.d.ts +129 -0
  75. package/dist/development/lib/rsc/server.ssr.js +388 -0
  76. package/dist/development/lib/server-runtime/build.d.ts +66 -0
  77. package/dist/development/lib/server-runtime/cookies.d.ts +66 -0
  78. package/dist/development/lib/server-runtime/cookies.js +139 -0
  79. package/dist/development/lib/server-runtime/crypto.js +43 -0
  80. package/dist/development/lib/server-runtime/data.d.ts +13 -0
  81. package/dist/development/lib/server-runtime/data.js +25 -0
  82. package/dist/development/lib/server-runtime/dev.d.ts +9 -0
  83. package/dist/development/lib/server-runtime/dev.js +26 -0
  84. package/dist/development/lib/server-runtime/entry.js +20 -0
  85. package/dist/development/lib/server-runtime/errors.js +95 -0
  86. package/dist/development/lib/server-runtime/headers.js +73 -0
  87. package/dist/development/lib/server-runtime/invariant.js +19 -0
  88. package/dist/development/lib/server-runtime/mode.d.ts +12 -0
  89. package/dist/development/lib/server-runtime/mode.js +25 -0
  90. package/dist/development/lib/server-runtime/routeMatching.js +28 -0
  91. package/dist/development/lib/server-runtime/routes.d.ts +13 -0
  92. package/dist/development/lib/server-runtime/routes.js +74 -0
  93. package/dist/development/lib/server-runtime/server.d.ts +10 -0
  94. package/dist/development/lib/server-runtime/server.js +351 -0
  95. package/dist/development/lib/server-runtime/serverHandoff.js +17 -0
  96. package/dist/development/lib/server-runtime/sessions/cookieStorage.d.ts +25 -0
  97. package/dist/development/lib/server-runtime/sessions/cookieStorage.js +45 -0
  98. package/dist/development/lib/server-runtime/sessions/memoryStorage.d.ts +23 -0
  99. package/dist/development/lib/server-runtime/sessions/memoryStorage.js +52 -0
  100. package/dist/development/lib/server-runtime/sessions.d.ts +145 -0
  101. package/dist/development/lib/server-runtime/sessions.js +98 -0
  102. package/dist/development/lib/server-runtime/single-fetch.d.ts +7 -0
  103. package/dist/development/lib/server-runtime/single-fetch.js +215 -0
  104. package/dist/development/lib/server-runtime/urls.js +31 -0
  105. package/dist/development/lib/server-runtime/warnings.js +20 -0
  106. package/dist/development/lib/types/future.d.ts +9 -0
  107. package/dist/development/lib/types/internal.d.ts +26 -177
  108. package/dist/development/lib/types/internal.js +3 -2
  109. package/dist/{production/register-Bsscfj79.d.ts → development/lib/types/register.d.ts} +9 -15
  110. package/dist/development/lib/types/route-data.d.ts +113 -0
  111. package/dist/development/lib/types/route-module-annotations.d.ts +149 -0
  112. package/dist/development/lib/types/route-module.d.ts +19 -0
  113. package/dist/development/lib/types/serializes-to.d.ts +13 -0
  114. package/dist/development/lib/types/utils.d.ts +11 -0
  115. package/dist/development/vendor/turbo-stream-v2/flatten.js +159 -0
  116. package/dist/development/vendor/turbo-stream-v2/turbo-stream.js +178 -0
  117. package/dist/development/vendor/turbo-stream-v2/unflatten.js +198 -0
  118. package/dist/development/vendor/turbo-stream-v2/utils.js +47 -0
  119. package/dist/production/dom-export.d.ts +6 -172
  120. package/dist/production/dom-export.js +12 -1007
  121. package/dist/production/index-react-server-client.d.ts +7 -4
  122. package/dist/production/index-react-server-client.js +8 -52
  123. package/dist/production/index-react-server.d.ts +1645 -1635
  124. package/dist/production/index-react-server.js +2871 -3642
  125. package/dist/production/index.d.ts +43 -1469
  126. package/dist/production/index.js +37 -2621
  127. package/dist/production/lib/actions.js +62 -0
  128. package/dist/production/lib/components.d.ts +1022 -0
  129. package/dist/production/lib/components.js +835 -0
  130. package/dist/production/lib/context.d.ts +83 -0
  131. package/dist/production/lib/context.js +41 -0
  132. package/dist/production/lib/dom/dom.d.ts +119 -0
  133. package/dist/production/lib/dom/dom.js +143 -0
  134. package/dist/production/lib/dom/lib.d.ts +2042 -0
  135. package/dist/production/lib/dom/lib.js +1259 -0
  136. package/dist/production/lib/dom/server.d.ts +138 -0
  137. package/dist/production/lib/dom/server.js +301 -0
  138. package/dist/production/lib/dom/ssr/components.d.ts +196 -0
  139. package/dist/production/lib/dom/ssr/components.js +579 -0
  140. package/dist/production/lib/dom/ssr/data.js +29 -0
  141. package/dist/production/lib/dom/ssr/entry.d.ts +59 -0
  142. package/dist/production/lib/dom/ssr/errorBoundaries.d.ts +27 -0
  143. package/dist/production/lib/dom/ssr/errorBoundaries.js +83 -0
  144. package/dist/production/lib/dom/ssr/errors.d.ts +7 -0
  145. package/dist/production/lib/dom/ssr/errors.js +36 -0
  146. package/dist/production/lib/dom/ssr/fallback.js +21 -0
  147. package/dist/production/lib/dom/ssr/fog-of-war.d.ts +12 -0
  148. package/dist/production/lib/dom/ssr/fog-of-war.js +170 -0
  149. package/dist/production/lib/dom/ssr/hydration.d.ts +32 -0
  150. package/dist/production/lib/dom/ssr/hydration.js +29 -0
  151. package/dist/production/lib/dom/ssr/invariant.js +16 -0
  152. package/dist/production/lib/dom/ssr/links.js +170 -0
  153. package/dist/production/lib/dom/ssr/markup.js +24 -0
  154. package/dist/production/lib/dom/ssr/routeModules.d.ts +206 -0
  155. package/dist/production/lib/dom/ssr/routeModules.js +31 -0
  156. package/dist/production/lib/dom/ssr/routes-test-stub.d.ts +62 -0
  157. package/dist/production/lib/dom/ssr/routes-test-stub.js +108 -0
  158. package/dist/production/lib/dom/ssr/routes.d.ts +33 -0
  159. package/dist/production/lib/dom/ssr/routes.js +303 -0
  160. package/dist/production/lib/dom/ssr/server.d.ts +45 -0
  161. package/dist/production/lib/dom/ssr/server.js +68 -0
  162. package/dist/production/lib/dom/ssr/single-fetch.d.ts +14 -0
  163. package/dist/production/lib/dom/ssr/single-fetch.js +346 -0
  164. package/dist/production/lib/dom-export/dom-router-provider.d.ts +9 -0
  165. package/dist/production/lib/dom-export/dom-router-provider.js +22 -0
  166. package/dist/production/lib/dom-export/hydrated-router.d.ts +125 -0
  167. package/dist/production/lib/dom-export/hydrated-router.js +153 -0
  168. package/dist/production/lib/errors.js +29 -0
  169. package/dist/production/lib/hooks.d.ts +947 -0
  170. package/dist/production/lib/hooks.js +1371 -0
  171. package/dist/production/lib/href.d.ts +20 -0
  172. package/dist/production/lib/href.js +50 -0
  173. package/dist/production/lib/router/history.d.ts +258 -0
  174. package/dist/production/lib/router/history.js +371 -0
  175. package/dist/production/lib/router/instrumentation.d.ts +86 -0
  176. package/dist/production/lib/router/instrumentation.js +213 -0
  177. package/dist/production/lib/router/links.d.ts +113 -0
  178. package/dist/production/lib/router/router.d.ts +663 -0
  179. package/dist/production/lib/router/router.js +2981 -0
  180. package/dist/production/lib/router/utils.d.ts +942 -0
  181. package/dist/production/lib/router/utils.js +782 -0
  182. package/dist/production/lib/rsc/browser.d.ts +137 -0
  183. package/dist/production/lib/rsc/browser.js +599 -0
  184. package/dist/production/lib/rsc/errorBoundaries.d.ts +11 -0
  185. package/dist/production/lib/rsc/errorBoundaries.js +90 -0
  186. package/dist/production/lib/rsc/html-stream/browser.d.ts +48 -0
  187. package/dist/production/lib/rsc/html-stream/browser.js +74 -0
  188. package/dist/production/lib/rsc/html-stream/server.js +78 -0
  189. package/dist/production/lib/rsc/route-modules.js +27 -0
  190. package/dist/production/lib/rsc/server.rsc.d.ts +219 -0
  191. package/dist/production/lib/rsc/server.ssr.d.ts +129 -0
  192. package/dist/production/lib/rsc/server.ssr.js +388 -0
  193. package/dist/production/lib/server-runtime/build.d.ts +66 -0
  194. package/dist/production/lib/server-runtime/cookies.d.ts +66 -0
  195. package/dist/production/lib/server-runtime/cookies.js +139 -0
  196. package/dist/production/lib/server-runtime/crypto.js +43 -0
  197. package/dist/production/lib/server-runtime/data.d.ts +13 -0
  198. package/dist/production/lib/server-runtime/data.js +25 -0
  199. package/dist/production/lib/server-runtime/dev.d.ts +9 -0
  200. package/dist/production/lib/server-runtime/dev.js +26 -0
  201. package/dist/production/lib/server-runtime/entry.js +20 -0
  202. package/dist/production/lib/server-runtime/errors.js +95 -0
  203. package/dist/production/lib/server-runtime/headers.js +73 -0
  204. package/dist/production/lib/server-runtime/invariant.js +19 -0
  205. package/dist/production/lib/server-runtime/mode.d.ts +12 -0
  206. package/dist/production/lib/server-runtime/mode.js +25 -0
  207. package/dist/production/lib/server-runtime/routeMatching.js +28 -0
  208. package/dist/production/lib/server-runtime/routes.d.ts +13 -0
  209. package/dist/production/lib/server-runtime/routes.js +74 -0
  210. package/dist/production/lib/server-runtime/server.d.ts +10 -0
  211. package/dist/production/lib/server-runtime/server.js +351 -0
  212. package/dist/production/lib/server-runtime/serverHandoff.js +17 -0
  213. package/dist/production/lib/server-runtime/sessions/cookieStorage.d.ts +25 -0
  214. package/dist/production/lib/server-runtime/sessions/cookieStorage.js +45 -0
  215. package/dist/production/lib/server-runtime/sessions/memoryStorage.d.ts +23 -0
  216. package/dist/production/lib/server-runtime/sessions/memoryStorage.js +52 -0
  217. package/dist/production/lib/server-runtime/sessions.d.ts +145 -0
  218. package/dist/production/lib/server-runtime/sessions.js +98 -0
  219. package/dist/production/lib/server-runtime/single-fetch.d.ts +7 -0
  220. package/dist/production/lib/server-runtime/single-fetch.js +215 -0
  221. package/dist/production/lib/server-runtime/urls.js +31 -0
  222. package/dist/production/lib/server-runtime/warnings.js +20 -0
  223. package/dist/production/lib/types/future.d.ts +9 -0
  224. package/dist/production/lib/types/internal.d.ts +26 -177
  225. package/dist/production/lib/types/internal.js +3 -2
  226. package/dist/{development/register-Bsscfj79.d.ts → production/lib/types/register.d.ts} +9 -15
  227. package/dist/production/lib/types/route-data.d.ts +113 -0
  228. package/dist/production/lib/types/route-module-annotations.d.ts +149 -0
  229. package/dist/production/lib/types/route-module.d.ts +19 -0
  230. package/dist/production/lib/types/serializes-to.d.ts +13 -0
  231. package/dist/production/lib/types/utils.d.ts +11 -0
  232. package/dist/production/vendor/turbo-stream-v2/flatten.js +159 -0
  233. package/dist/production/vendor/turbo-stream-v2/turbo-stream.js +178 -0
  234. package/dist/production/vendor/turbo-stream-v2/unflatten.js +198 -0
  235. package/dist/production/vendor/turbo-stream-v2/utils.js +47 -0
  236. package/docs/explanation/backend-for-frontend.md +50 -0
  237. package/docs/explanation/code-splitting.md +77 -0
  238. package/docs/explanation/concurrency.md +135 -0
  239. package/docs/explanation/form-vs-fetcher.md +292 -0
  240. package/docs/explanation/hot-module-replacement.md +137 -0
  241. package/docs/explanation/hydration.md +14 -0
  242. package/docs/explanation/index-query-param.md +86 -0
  243. package/docs/explanation/index.md +4 -0
  244. package/docs/explanation/lazy-route-discovery.md +78 -0
  245. package/docs/explanation/location.md +6 -0
  246. package/docs/explanation/progressive-enhancement.md +150 -0
  247. package/docs/explanation/race-conditions.md +88 -0
  248. package/docs/explanation/react-transitions.md +160 -0
  249. package/docs/explanation/route-matching.md +7 -0
  250. package/docs/explanation/server-client-execution.md +4 -0
  251. package/docs/explanation/sessions-and-cookies.md +465 -0
  252. package/docs/explanation/special-files.md +16 -0
  253. package/docs/explanation/state-management.md +524 -0
  254. package/docs/explanation/styling.md +87 -0
  255. package/docs/explanation/type-safety.md +82 -0
  256. package/docs/how-to/accessibility.md +44 -0
  257. package/docs/how-to/client-data.md +199 -0
  258. package/docs/how-to/data-strategy.md +317 -0
  259. package/docs/how-to/error-boundary.md +231 -0
  260. package/docs/how-to/error-reporting.md +134 -0
  261. package/docs/how-to/fetchers.md +307 -0
  262. package/docs/how-to/file-route-conventions.md +410 -0
  263. package/docs/how-to/file-uploads.md +217 -0
  264. package/docs/how-to/form-validation.md +120 -0
  265. package/docs/how-to/headers.md +164 -0
  266. package/docs/how-to/index.md +4 -0
  267. package/docs/how-to/instrumentation.md +556 -0
  268. package/docs/how-to/meta.md +40 -0
  269. package/docs/how-to/middleware.md +728 -0
  270. package/docs/how-to/navigation-blocking.md +233 -0
  271. package/docs/how-to/optimize-revalidation.md +12 -0
  272. package/docs/how-to/pre-rendering.md +225 -0
  273. package/docs/how-to/presets.md +103 -0
  274. package/docs/how-to/react-server-components.md +899 -0
  275. package/docs/how-to/resource-routes.md +126 -0
  276. package/docs/how-to/route-module-type-safety.md +100 -0
  277. package/docs/how-to/search-params.md +4 -0
  278. package/docs/how-to/security.md +30 -0
  279. package/docs/how-to/server-bundles.md +66 -0
  280. package/docs/how-to/spa.md +120 -0
  281. package/docs/how-to/status.md +63 -0
  282. package/docs/how-to/suspense.md +132 -0
  283. package/docs/how-to/using-handle.md +117 -0
  284. package/docs/how-to/view-transitions.md +237 -0
  285. package/docs/how-to/webhook.md +50 -0
  286. package/docs/index.md +39 -0
  287. package/docs/start/data/actions.md +138 -0
  288. package/docs/start/data/custom.md +198 -0
  289. package/docs/start/data/data-loading.md +44 -0
  290. package/docs/start/data/index.md +4 -0
  291. package/docs/start/data/installation.md +52 -0
  292. package/docs/start/data/navigating.md +12 -0
  293. package/docs/start/data/pending-ui.md +12 -0
  294. package/docs/start/data/route-object.md +248 -0
  295. package/docs/start/data/routing.md +281 -0
  296. package/docs/start/data/testing.md +8 -0
  297. package/docs/start/declarative/index.md +4 -0
  298. package/docs/start/declarative/installation.md +43 -0
  299. package/docs/start/declarative/navigating.md +133 -0
  300. package/docs/start/declarative/routing.md +237 -0
  301. package/docs/start/declarative/url-values.md +65 -0
  302. package/docs/start/framework/actions.md +175 -0
  303. package/docs/start/framework/data-loading.md +201 -0
  304. package/docs/start/framework/deploying.md +96 -0
  305. package/docs/start/framework/index.md +4 -0
  306. package/docs/start/framework/installation.md +42 -0
  307. package/docs/start/framework/navigating.md +182 -0
  308. package/docs/start/framework/pending-ui.md +142 -0
  309. package/docs/start/framework/rendering.md +59 -0
  310. package/docs/start/framework/route-module.md +527 -0
  311. package/docs/start/framework/routing.md +362 -0
  312. package/docs/start/framework/testing.md +133 -0
  313. package/docs/start/index.md +4 -0
  314. package/docs/start/modes.md +201 -0
  315. package/docs/upgrading/component-routes.md +363 -0
  316. package/docs/upgrading/future.md +31 -0
  317. package/docs/upgrading/index.md +4 -0
  318. package/docs/upgrading/remix.md +403 -0
  319. package/docs/upgrading/router-provider.md +442 -0
  320. package/docs/upgrading/v6.md +379 -0
  321. package/package.json +44 -87
  322. package/dist/development/browser-3AnU12UI.d.mts +0 -318
  323. package/dist/development/browser-BOdXz9dK.d.ts +0 -318
  324. package/dist/development/chunk-4N6VE7H7.mjs +0 -11528
  325. package/dist/development/chunk-4YRVXM2U.js +0 -188
  326. package/dist/development/chunk-66UKHEGQ.js +0 -1362
  327. package/dist/development/chunk-D6LUOGOQ.js +0 -10229
  328. package/dist/development/chunk-RJYABSBD.mjs +0 -2585
  329. package/dist/development/context-ByvtofY2.d.mts +0 -1771
  330. package/dist/development/data-BVUf681J.d.mts +0 -1732
  331. package/dist/development/data-BqZ2x964.d.ts +0 -1732
  332. package/dist/development/dom-export.d.mts +0 -172
  333. package/dist/development/dom-export.mjs +0 -1008
  334. package/dist/development/index-react-server-client-BS5F89FR.d.ts +0 -3655
  335. package/dist/development/index-react-server-client-DY04-103.d.mts +0 -2600
  336. package/dist/development/index-react-server-client.d.mts +0 -4
  337. package/dist/development/index-react-server-client.mjs +0 -59
  338. package/dist/development/index-react-server.d.mts +0 -2703
  339. package/dist/development/index-react-server.mjs +0 -3780
  340. package/dist/development/index.d.mts +0 -1472
  341. package/dist/development/index.mjs +0 -277
  342. package/dist/development/instrumentation-cRWWLfsU.d.ts +0 -715
  343. package/dist/development/lib/types/internal.d.mts +0 -184
  344. package/dist/development/lib/types/internal.mjs +0 -10
  345. package/dist/development/register-Df8okEea.d.mts +0 -30
  346. package/dist/production/browser-3AnU12UI.d.mts +0 -318
  347. package/dist/production/browser-BOdXz9dK.d.ts +0 -318
  348. package/dist/production/chunk-6S4627ZB.mjs +0 -2585
  349. package/dist/production/chunk-HUBUW7R3.js +0 -10229
  350. package/dist/production/chunk-JAKZPQZC.mjs +0 -11528
  351. package/dist/production/chunk-PNZCCTKT.js +0 -1362
  352. package/dist/production/chunk-Y6IFXO7V.js +0 -188
  353. package/dist/production/context-ByvtofY2.d.mts +0 -1771
  354. package/dist/production/data-BVUf681J.d.mts +0 -1732
  355. package/dist/production/data-BqZ2x964.d.ts +0 -1732
  356. package/dist/production/dom-export.d.mts +0 -172
  357. package/dist/production/dom-export.mjs +0 -1008
  358. package/dist/production/index-react-server-client-BS5F89FR.d.ts +0 -3655
  359. package/dist/production/index-react-server-client-DY04-103.d.mts +0 -2600
  360. package/dist/production/index-react-server-client.d.mts +0 -4
  361. package/dist/production/index-react-server-client.mjs +0 -59
  362. package/dist/production/index-react-server.d.mts +0 -2703
  363. package/dist/production/index-react-server.mjs +0 -3780
  364. package/dist/production/index.d.mts +0 -1472
  365. package/dist/production/index.mjs +0 -277
  366. package/dist/production/instrumentation-cRWWLfsU.d.ts +0 -715
  367. package/dist/production/lib/types/internal.d.mts +0 -184
  368. package/dist/production/lib/types/internal.mjs +0 -10
  369. package/dist/production/register-Df8okEea.d.mts +0 -30
@@ -0,0 +1,198 @@
1
+ /**
2
+ * react-router v8.0.0-pre.0
3
+ *
4
+ * Copyright (c) Remix Software Inc.
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE.md file in the root directory of this source tree.
8
+ *
9
+ * @license MIT
10
+ */
11
+ import { Deferred, SUPPORTED_ERROR_TYPES } from "./utils.js";
12
+ //#region vendor/turbo-stream-v2/unflatten.ts
13
+ const globalObj = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : void 0;
14
+ function unflatten(parsed) {
15
+ const { hydrated, values } = this;
16
+ if (typeof parsed === "number") return hydrate.call(this, parsed);
17
+ if (!Array.isArray(parsed) || !parsed.length) throw new SyntaxError();
18
+ const startIndex = values.length;
19
+ for (const value of parsed) values.push(value);
20
+ hydrated.length = values.length;
21
+ return hydrate.call(this, startIndex);
22
+ }
23
+ function hydrate(index) {
24
+ const { hydrated, values, deferred, plugins } = this;
25
+ let result;
26
+ const stack = [[index, (v) => {
27
+ result = v;
28
+ }]];
29
+ let postRun = [];
30
+ while (stack.length > 0) {
31
+ const [index, set] = stack.pop();
32
+ switch (index) {
33
+ case -7:
34
+ set(void 0);
35
+ continue;
36
+ case -5:
37
+ set(null);
38
+ continue;
39
+ case -2:
40
+ set(NaN);
41
+ continue;
42
+ case -6:
43
+ set(Infinity);
44
+ continue;
45
+ case -3:
46
+ set(-Infinity);
47
+ continue;
48
+ case -4:
49
+ set(-0);
50
+ continue;
51
+ }
52
+ if (hydrated[index]) {
53
+ set(hydrated[index]);
54
+ continue;
55
+ }
56
+ const value = values[index];
57
+ if (!value || typeof value !== "object") {
58
+ hydrated[index] = value;
59
+ set(value);
60
+ continue;
61
+ }
62
+ if (Array.isArray(value)) if (typeof value[0] === "string") {
63
+ const [type, b, c] = value;
64
+ switch (type) {
65
+ case "D":
66
+ set(hydrated[index] = new Date(b));
67
+ continue;
68
+ case "U":
69
+ set(hydrated[index] = new URL(b));
70
+ continue;
71
+ case "B":
72
+ set(hydrated[index] = BigInt(b));
73
+ continue;
74
+ case "R":
75
+ set(hydrated[index] = new RegExp(b, c));
76
+ continue;
77
+ case "Y":
78
+ set(hydrated[index] = Symbol.for(b));
79
+ continue;
80
+ case "S":
81
+ const newSet = /* @__PURE__ */ new Set();
82
+ hydrated[index] = newSet;
83
+ for (let i = value.length - 1; i > 0; i--) stack.push([value[i], (v) => {
84
+ newSet.add(v);
85
+ }]);
86
+ set(newSet);
87
+ continue;
88
+ case "M":
89
+ const map = /* @__PURE__ */ new Map();
90
+ hydrated[index] = map;
91
+ for (let i = value.length - 2; i > 0; i -= 2) {
92
+ const r = [];
93
+ stack.push([value[i + 1], (v) => {
94
+ r[1] = v;
95
+ }]);
96
+ stack.push([value[i], (k) => {
97
+ r[0] = k;
98
+ }]);
99
+ postRun.push(() => {
100
+ map.set(r[0], r[1]);
101
+ });
102
+ }
103
+ set(map);
104
+ continue;
105
+ case "N":
106
+ const obj = Object.create(null);
107
+ hydrated[index] = obj;
108
+ for (const key of Object.keys(b).reverse()) {
109
+ const r = [];
110
+ stack.push([b[key], (v) => {
111
+ r[1] = v;
112
+ }]);
113
+ stack.push([Number(key.slice(1)), (k) => {
114
+ r[0] = k;
115
+ }]);
116
+ postRun.push(() => {
117
+ obj[r[0]] = r[1];
118
+ });
119
+ }
120
+ set(obj);
121
+ continue;
122
+ case "P":
123
+ if (hydrated[b]) set(hydrated[index] = hydrated[b]);
124
+ else {
125
+ const d = new Deferred();
126
+ deferred[b] = d;
127
+ set(hydrated[index] = d.promise);
128
+ }
129
+ continue;
130
+ case "E":
131
+ const [, message, errorType] = value;
132
+ let error = errorType && globalObj && SUPPORTED_ERROR_TYPES.includes(errorType) && errorType in globalObj && typeof globalObj[errorType] === "function" ? new globalObj[errorType](message) : new Error(message);
133
+ hydrated[index] = error;
134
+ set(error);
135
+ continue;
136
+ case "Z":
137
+ set(hydrated[index] = hydrated[b]);
138
+ continue;
139
+ default:
140
+ if (Array.isArray(plugins)) {
141
+ const r = [];
142
+ const vals = value.slice(1);
143
+ for (let i = 0; i < vals.length; i++) {
144
+ const v = vals[i];
145
+ stack.push([v, (v) => {
146
+ r[i] = v;
147
+ }]);
148
+ }
149
+ postRun.push(() => {
150
+ for (const plugin of plugins) {
151
+ const result = plugin(value[0], ...r);
152
+ if (result) {
153
+ set(hydrated[index] = result.value);
154
+ return;
155
+ }
156
+ }
157
+ throw new SyntaxError();
158
+ });
159
+ continue;
160
+ }
161
+ throw new SyntaxError();
162
+ }
163
+ } else {
164
+ const array = [];
165
+ hydrated[index] = array;
166
+ for (let i = 0; i < value.length; i++) {
167
+ const n = value[i];
168
+ if (n !== -1) stack.push([n, (v) => {
169
+ array[i] = v;
170
+ }]);
171
+ }
172
+ set(array);
173
+ continue;
174
+ }
175
+ else {
176
+ const object = {};
177
+ hydrated[index] = object;
178
+ for (const key of Object.keys(value).reverse()) {
179
+ const r = [];
180
+ stack.push([value[key], (v) => {
181
+ r[1] = v;
182
+ }]);
183
+ stack.push([Number(key.slice(1)), (k) => {
184
+ r[0] = k;
185
+ }]);
186
+ postRun.push(() => {
187
+ object[r[0]] = r[1];
188
+ });
189
+ }
190
+ set(object);
191
+ continue;
192
+ }
193
+ }
194
+ while (postRun.length > 0) postRun.pop()();
195
+ return result;
196
+ }
197
+ //#endregion
198
+ export { unflatten };
@@ -0,0 +1,47 @@
1
+ /**
2
+ * react-router v8.0.0-pre.0
3
+ *
4
+ * Copyright (c) Remix Software Inc.
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE.md file in the root directory of this source tree.
8
+ *
9
+ * @license MIT
10
+ */
11
+ //#region vendor/turbo-stream-v2/utils.ts
12
+ const SUPPORTED_ERROR_TYPES = [
13
+ "EvalError",
14
+ "RangeError",
15
+ "ReferenceError",
16
+ "SyntaxError",
17
+ "TypeError",
18
+ "URIError"
19
+ ];
20
+ var Deferred = class {
21
+ promise;
22
+ resolve;
23
+ reject;
24
+ constructor() {
25
+ this.promise = new Promise((resolve, reject) => {
26
+ this.resolve = resolve;
27
+ this.reject = reject;
28
+ });
29
+ }
30
+ };
31
+ function createLineSplittingTransform() {
32
+ const decoder = new TextDecoder();
33
+ let leftover = "";
34
+ return new TransformStream({
35
+ transform(chunk, controller) {
36
+ const str = decoder.decode(chunk, { stream: true });
37
+ const parts = (leftover + str).split("\n");
38
+ leftover = parts.pop() || "";
39
+ for (const part of parts) controller.enqueue(part);
40
+ },
41
+ flush(controller) {
42
+ if (leftover) controller.enqueue(leftover);
43
+ }
44
+ });
45
+ }
46
+ //#endregion
47
+ export { Deferred, SUPPORTED_ERROR_TYPES, createLineSplittingTransform };
@@ -1,173 +1,7 @@
1
- import * as React from 'react';
2
- import { RouterProviderProps as RouterProviderProps$1, RouterInit, ClientOnErrorFunction } from 'react-router';
3
- import { C as ClientInstrumentation } from './instrumentation-cRWWLfsU.js';
4
- export { D as unstable_DecodeActionFunction, a as unstable_DecodeFormStateFunction, b as unstable_DecodeReplyFunction, R as unstable_RSCHydratedRouter, d as unstable_RSCManifestPayload, e as unstable_RSCPayload, f as unstable_RSCRenderPayload, c as unstable_createCallServer } from './browser-BOdXz9dK.js';
5
- import './data-BqZ2x964.js';
6
1
 
7
- type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
8
- declare function RouterProvider(props: RouterProviderProps): React.JSX.Element;
9
-
10
- /**
11
- * Props for the {@link dom.HydratedRouter} component.
12
- *
13
- * @category Types
14
- */
15
- interface HydratedRouterProps {
16
- /**
17
- * Context factory function to be passed through to {@link createBrowserRouter}.
18
- * This function will be called to create a fresh `context` instance on each
19
- * navigation/fetch and made available to
20
- * [`clientAction`](../../start/framework/route-module#clientAction)/[`clientLoader`](../../start/framework/route-module#clientLoader)
21
- * functions.
22
- */
23
- getContext?: RouterInit["getContext"];
24
- /**
25
- * Array of instrumentation objects allowing you to instrument the router and
26
- * individual routes prior to router initialization (and on any subsequently
27
- * added routes via `route.lazy` or `patchRoutesOnNavigation`). This is
28
- * mostly useful for observability such as wrapping navigations, fetches,
29
- * as well as route loaders/actions/middlewares with logging and/or performance
30
- * tracing. See the [docs](../../how-to/instrumentation) for more information.
31
- *
32
- * ```tsx
33
- * const logging = {
34
- * router({ instrument }) {
35
- * instrument({
36
- * navigate: (impl, { to }) => logExecution(`navigate ${to}`, impl),
37
- * fetch: (impl, { to }) => logExecution(`fetch ${to}`, impl)
38
- * });
39
- * },
40
- * route({ instrument, id }) {
41
- * instrument({
42
- * middleware: (impl, { request }) => logExecution(
43
- * `middleware ${request.url} (route ${id})`,
44
- * impl
45
- * ),
46
- * loader: (impl, { request }) => logExecution(
47
- * `loader ${request.url} (route ${id})`,
48
- * impl
49
- * ),
50
- * action: (impl, { request }) => logExecution(
51
- * `action ${request.url} (route ${id})`,
52
- * impl
53
- * ),
54
- * })
55
- * }
56
- * };
57
- *
58
- * async function logExecution(label: string, impl: () => Promise<void>) {
59
- * let start = performance.now();
60
- * console.log(`start ${label}`);
61
- * await impl();
62
- * let duration = Math.round(performance.now() - start);
63
- * console.log(`end ${label} (${duration}ms)`);
64
- * }
65
- *
66
- * startTransition(() => {
67
- * hydrateRoot(
68
- * document,
69
- * <HydratedRouter instrumentations={[logging]} />
70
- * );
71
- * });
72
- * ```
73
- */
74
- instrumentations?: ClientInstrumentation[];
75
- /**
76
- * An error handler function that will be called for any middleware, loader, action,
77
- * or render errors that are encountered in your application. This is useful for
78
- * logging or reporting errors instead of in the {@link ErrorBoundary} because it's not
79
- * subject to re-rendering and will only run one time per error.
80
- *
81
- * The `errorInfo` parameter is passed along from
82
- * [`componentDidCatch`](https://react.dev/reference/react/Component#componentdidcatch)
83
- * and is only present for render errors.
84
- *
85
- * ```tsx
86
- * <HydratedRouter onError=(error, info) => {
87
- * let { location, params, pattern, errorInfo } = info;
88
- * console.error(error, location, errorInfo);
89
- * reportToErrorService(error, location, errorInfo);
90
- * }} />
91
- * ```
92
- */
93
- onError?: ClientOnErrorFunction;
94
- /**
95
- * Control whether router state updates are internally wrapped in
96
- * [`React.startTransition`](https://react.dev/reference/react/startTransition).
97
- *
98
- * - When left `undefined`, all state updates are wrapped in
99
- * `React.startTransition`
100
- * - This can lead to buggy behaviors if you are wrapping your own
101
- * navigations/fetchers in `startTransition`.
102
- * - When set to `true`, {@link Link} and {@link Form} navigations will be wrapped
103
- * in `React.startTransition` and router state changes will be wrapped in
104
- * `React.startTransition` and also sent through
105
- * [`useOptimistic`](https://react.dev/reference/react/useOptimistic) to
106
- * surface mid-navigation router state changes to the UI.
107
- * - When set to `false`, the router will not leverage `React.startTransition` or
108
- * `React.useOptimistic` on any navigations or state changes.
109
- *
110
- * For more information, please see the [docs](../../explanation/react-transitions).
111
- */
112
- useTransitions?: boolean;
113
- }
114
- /**
115
- * Framework-mode router component to be used to hydrate a router from a
116
- * {@link ServerRouter}. See [`entry.client.tsx`](../framework-conventions/entry.client.tsx).
117
- *
118
- * @public
119
- * @category Framework Routers
120
- * @mode framework
121
- * @param props Props
122
- * @param {dom.HydratedRouterProps.getContext} props.getContext n/a
123
- * @param {dom.HydratedRouterProps.onError} props.onError n/a
124
- * @returns A React element that represents the hydrated application.
125
- */
126
- declare function HydratedRouter(props: HydratedRouterProps): React.JSX.Element;
127
-
128
- declare global {
129
- interface Window {
130
- __FLIGHT_DATA: any[];
131
- }
132
- }
133
- /**
134
- * Get the prerendered [RSC](https://react.dev/reference/rsc/server-components)
135
- * stream for hydration. Usually passed directly to your
136
- * `react-server-dom-xyz/client`'s `createFromReadableStream`.
137
- *
138
- * @example
139
- * import { startTransition, StrictMode } from "react";
140
- * import { hydrateRoot } from "react-dom/client";
141
- * import {
142
- * unstable_getRSCStream as getRSCStream,
143
- * unstable_RSCHydratedRouter as RSCHydratedRouter,
144
- * } from "react-router";
145
- * import type { unstable_RSCPayload as RSCPayload } from "react-router";
146
- *
147
- * createFromReadableStream(getRSCStream()).then(
148
- * (payload: RSCServerPayload) => {
149
- * startTransition(async () => {
150
- * hydrateRoot(
151
- * document,
152
- * <StrictMode>
153
- * <RSCHydratedRouter {...props} />
154
- * </StrictMode>,
155
- * {
156
- * // Options
157
- * }
158
- * );
159
- * });
160
- * }
161
- * );
162
- *
163
- * @name unstable_getRSCStream
164
- * @public
165
- * @category RSC
166
- * @mode data
167
- * @returns A [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream)
168
- * that contains the [RSC](https://react.dev/reference/rsc/server-components)
169
- * data for hydration.
170
- */
171
- declare function getRSCStream(): ReadableStream;
172
-
173
- export { HydratedRouter, type HydratedRouterProps, RouterProvider, type RouterProviderProps, getRSCStream as unstable_getRSCStream };
2
+ import { RouterProvider, RouterProviderProps } from "./lib/dom-export/dom-router-provider.js";
3
+ import { DecodeActionFunction, DecodeFormStateFunction, DecodeReplyFunction, RSCManifestPayload, RSCPayload, RSCRenderPayload } from "./lib/rsc/server.rsc.js";
4
+ import { RSCHydratedRouter, createCallServer } from "./lib/rsc/browser.js";
5
+ import { HydratedRouter, HydratedRouterProps } from "./lib/dom-export/hydrated-router.js";
6
+ import { getRSCStream } from "./lib/rsc/html-stream/browser.js";
7
+ export { HydratedRouter, type HydratedRouterProps, RouterProvider, type RouterProviderProps, type DecodeActionFunction as unstable_DecodeActionFunction, type DecodeFormStateFunction as unstable_DecodeFormStateFunction, type DecodeReplyFunction as unstable_DecodeReplyFunction, RSCHydratedRouter as unstable_RSCHydratedRouter, type RSCManifestPayload as unstable_RSCManifestPayload, type RSCPayload as unstable_RSCPayload, type RSCRenderPayload as unstable_RSCRenderPayload, createCallServer as unstable_createCallServer, getRSCStream as unstable_getRSCStream };