react-router 7.16.0 → 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 +0 -1
  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 -1475
  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-CNAx3TXj.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 -1475
  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-CNAx3TXj.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-D3uq9sI1.d.ts +0 -318
  323. package/dist/development/browser-nIQ4Nsyi.d.mts +0 -318
  324. package/dist/development/chunk-IBI7OMNB.js +0 -1363
  325. package/dist/development/chunk-QUQL4437.mjs +0 -11529
  326. package/dist/development/chunk-S54KXAEJ.mjs +0 -2585
  327. package/dist/development/chunk-SRID2YZ2.js +0 -10229
  328. package/dist/development/chunk-XEJDWL2B.js +0 -188
  329. package/dist/development/context-m8rizgnE.d.mts +0 -1771
  330. package/dist/development/data-D4xhSy90.d.ts +0 -1732
  331. package/dist/development/data-U8FS-wNn.d.mts +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-BLiUx67a.d.ts +0 -3655
  335. package/dist/development/index-react-server-client-CdKROblb.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 -1478
  341. package/dist/development/index.mjs +0 -277
  342. package/dist/development/instrumentation-1q4YhLGP.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-CqK96Zfk.d.mts +0 -30
  346. package/dist/production/browser-D3uq9sI1.d.ts +0 -318
  347. package/dist/production/browser-nIQ4Nsyi.d.mts +0 -318
  348. package/dist/production/chunk-EAQNHM3N.js +0 -188
  349. package/dist/production/chunk-NALGHHKE.mjs +0 -2585
  350. package/dist/production/chunk-Q65P7S7Y.mjs +0 -11529
  351. package/dist/production/chunk-SKEDDLRM.js +0 -1363
  352. package/dist/production/chunk-Y7DNFQZP.js +0 -10229
  353. package/dist/production/context-m8rizgnE.d.mts +0 -1771
  354. package/dist/production/data-D4xhSy90.d.ts +0 -1732
  355. package/dist/production/data-U8FS-wNn.d.mts +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-BLiUx67a.d.ts +0 -3655
  359. package/dist/production/index-react-server-client-CdKROblb.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 -1478
  365. package/dist/production/index.mjs +0 -277
  366. package/dist/production/instrumentation-1q4YhLGP.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-CqK96Zfk.d.mts +0 -30
@@ -1,318 +0,0 @@
1
- import * as React from 'react';
2
- import { R as RouterInit } from './context-m8rizgnE.mjs';
3
- import { L as Location, C as ClientActionFunction, a as ClientLoaderFunction, b as LinksFunction, M as MetaFunction, S as ShouldRevalidateFunction, P as Params, c as RouterContextProvider, A as ActionFunction, H as HeadersFunction, d as LoaderFunction } from './data-U8FS-wNn.mjs';
4
-
5
- declare function getRequest(): Request;
6
- type RSCRouteConfigEntryBase = {
7
- action?: ActionFunction;
8
- clientAction?: ClientActionFunction;
9
- clientLoader?: ClientLoaderFunction;
10
- ErrorBoundary?: React.ComponentType<any>;
11
- handle?: any;
12
- headers?: HeadersFunction;
13
- HydrateFallback?: React.ComponentType<any>;
14
- Layout?: React.ComponentType<any>;
15
- links?: LinksFunction;
16
- loader?: LoaderFunction;
17
- meta?: MetaFunction;
18
- shouldRevalidate?: ShouldRevalidateFunction;
19
- };
20
- type RSCRouteConfigEntry = RSCRouteConfigEntryBase & {
21
- id: string;
22
- path?: string;
23
- Component?: React.ComponentType<any>;
24
- lazy?: () => Promise<RSCRouteConfigEntryBase & ({
25
- default?: React.ComponentType<any>;
26
- Component?: never;
27
- } | {
28
- default?: never;
29
- Component?: React.ComponentType<any>;
30
- })>;
31
- } & ({
32
- index: true;
33
- } | {
34
- children?: RSCRouteConfigEntry[];
35
- });
36
- type RSCRouteConfig = Array<RSCRouteConfigEntry>;
37
- type RSCRouteManifest = {
38
- clientAction?: ClientActionFunction;
39
- clientLoader?: ClientLoaderFunction;
40
- element?: React.ReactElement | false;
41
- errorElement?: React.ReactElement;
42
- handle?: any;
43
- hasAction: boolean;
44
- hasComponent: boolean;
45
- hasErrorBoundary: boolean;
46
- hasLoader: boolean;
47
- hydrateFallbackElement?: React.ReactElement;
48
- id: string;
49
- index?: boolean;
50
- links?: LinksFunction;
51
- meta?: MetaFunction;
52
- parentId?: string;
53
- path?: string;
54
- shouldRevalidate?: ShouldRevalidateFunction;
55
- };
56
- type RSCRouteMatch = RSCRouteManifest & {
57
- params: Params;
58
- pathname: string;
59
- pathnameBase: string;
60
- };
61
- type RSCRenderPayload = {
62
- type: "render";
63
- actionData: Record<string, any> | null;
64
- basename: string | undefined;
65
- errors: Record<string, any> | null;
66
- loaderData: Record<string, any>;
67
- location: Location;
68
- routeDiscovery: RouteDiscovery;
69
- matches: RSCRouteMatch[];
70
- patches?: Promise<RSCRouteManifest[]>;
71
- nonce?: string;
72
- formState?: unknown;
73
- };
74
- type RSCManifestPayload = {
75
- type: "manifest";
76
- patches: Promise<RSCRouteManifest[]>;
77
- };
78
- type RSCActionPayload = {
79
- type: "action";
80
- actionResult: Promise<unknown>;
81
- rerender?: Promise<RSCRenderPayload | RSCRedirectPayload>;
82
- };
83
- type RSCRedirectPayload = {
84
- type: "redirect";
85
- status: number;
86
- location: string;
87
- replace: boolean;
88
- reload: boolean;
89
- actionResult?: Promise<unknown>;
90
- };
91
- type RSCPayload = RSCRenderPayload | RSCManifestPayload | RSCActionPayload | RSCRedirectPayload;
92
- type RSCMatch = {
93
- statusCode: number;
94
- headers: Headers;
95
- payload: RSCPayload;
96
- };
97
- type DecodeActionFunction = (formData: FormData) => Promise<() => Promise<unknown>>;
98
- type DecodeFormStateFunction = (result: unknown, formData: FormData) => unknown;
99
- type DecodeReplyFunction = (reply: FormData | string, options: {
100
- temporaryReferences: unknown;
101
- }) => Promise<unknown[]>;
102
- type LoadServerActionFunction = (id: string) => Promise<Function>;
103
- type RouteDiscovery = {
104
- mode: "lazy";
105
- manifestPath?: string | undefined;
106
- } | {
107
- mode: "initial";
108
- };
109
- /**
110
- * Matches the given routes to a [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request)
111
- * and returns an [RSC](https://react.dev/reference/rsc/server-components)
112
- * [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)
113
- * encoding an {@link unstable_RSCPayload} for consumption by an [RSC](https://react.dev/reference/rsc/server-components)
114
- * enabled client router.
115
- *
116
- * @example
117
- * import {
118
- * createTemporaryReferenceSet,
119
- * decodeAction,
120
- * decodeReply,
121
- * loadServerAction,
122
- * renderToReadableStream,
123
- * } from "@vitejs/plugin-rsc/rsc";
124
- * import { unstable_matchRSCServerRequest as matchRSCServerRequest } from "react-router";
125
- *
126
- * matchRSCServerRequest({
127
- * createTemporaryReferenceSet,
128
- * decodeAction,
129
- * decodeFormState,
130
- * decodeReply,
131
- * loadServerAction,
132
- * request,
133
- * routes: routes(),
134
- * generateResponse(match) {
135
- * return new Response(
136
- * renderToReadableStream(match.payload),
137
- * {
138
- * status: match.statusCode,
139
- * headers: match.headers,
140
- * }
141
- * );
142
- * },
143
- * });
144
- *
145
- * @name unstable_matchRSCServerRequest
146
- * @public
147
- * @category RSC
148
- * @mode data
149
- * @param opts Options
150
- * @param opts.allowedActionOrigins Origin patterns that are allowed to execute actions.
151
- * @param opts.basename The basename to use when matching the request.
152
- * @param opts.createTemporaryReferenceSet A function that returns a temporary
153
- * reference set for the request, used to track temporary references in the [RSC](https://react.dev/reference/rsc/server-components)
154
- * stream.
155
- * @param opts.decodeAction Your `react-server-dom-xyz/server`'s `decodeAction`
156
- * function, responsible for loading a server action.
157
- * @param opts.decodeFormState A function responsible for decoding form state for
158
- * progressively enhanceable forms with React's [`useActionState`](https://react.dev/reference/react/useActionState)
159
- * using your `react-server-dom-xyz/server`'s `decodeFormState`.
160
- * @param opts.decodeReply Your `react-server-dom-xyz/server`'s `decodeReply`
161
- * function, used to decode the server function's arguments and bind them to the
162
- * implementation for invocation by the router.
163
- * @param opts.generateResponse A function responsible for using your
164
- * `renderToReadableStream` to generate a [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)
165
- * encoding the {@link unstable_RSCPayload}.
166
- * @param opts.loadServerAction Your `react-server-dom-xyz/server`'s
167
- * `loadServerAction` function, used to load a server action by ID.
168
- * @param opts.onError An optional error handler that will be called with any
169
- * errors that occur during the request processing.
170
- * @param opts.request The [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request)
171
- * to match against.
172
- * @param opts.requestContext An instance of {@link RouterContextProvider}
173
- * that should be created per request, to be passed to [`action`](../../start/data/route-object#action)s,
174
- * [`loader`](../../start/data/route-object#loader)s and [middleware](../../how-to/middleware).
175
- * @param opts.routeDiscovery The route discovery configuration, used to determine how the router should discover new routes during navigations.
176
- * @param opts.routes Your {@link unstable_RSCRouteConfigEntry | route definitions}.
177
- * @returns A [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)
178
- * that contains the [RSC](https://react.dev/reference/rsc/server-components)
179
- * data for hydration.
180
- */
181
- declare function matchRSCServerRequest({ allowedActionOrigins, createTemporaryReferenceSet, basename, decodeReply, requestContext, routeDiscovery, loadServerAction, decodeAction, decodeFormState, onError, request, routes, generateResponse, }: {
182
- allowedActionOrigins?: string[];
183
- createTemporaryReferenceSet: () => unknown;
184
- basename?: string;
185
- decodeReply?: DecodeReplyFunction;
186
- decodeAction?: DecodeActionFunction;
187
- decodeFormState?: DecodeFormStateFunction;
188
- requestContext?: RouterContextProvider;
189
- loadServerAction?: LoadServerActionFunction;
190
- onError?: (error: unknown) => void;
191
- request: Request;
192
- routes: RSCRouteConfigEntry[];
193
- routeDiscovery?: RouteDiscovery;
194
- generateResponse: (match: RSCMatch, { onError, temporaryReferences, }: {
195
- onError(error: unknown): string | undefined;
196
- temporaryReferences: unknown;
197
- }) => Response;
198
- }): Promise<Response>;
199
-
200
- type BrowserCreateFromReadableStreamFunction = (body: ReadableStream<Uint8Array>, { temporaryReferences, }: {
201
- temporaryReferences: unknown;
202
- }) => Promise<unknown>;
203
- type EncodeReplyFunction = (args: unknown[], options: {
204
- temporaryReferences: unknown;
205
- }) => Promise<BodyInit>;
206
- /**
207
- * Create a React `callServer` implementation for React Router.
208
- *
209
- * @example
210
- * import {
211
- * createFromReadableStream,
212
- * createTemporaryReferenceSet,
213
- * encodeReply,
214
- * setServerCallback,
215
- * } from "@vitejs/plugin-rsc/browser";
216
- * import { unstable_createCallServer as createCallServer } from "react-router";
217
- *
218
- * setServerCallback(
219
- * createCallServer({
220
- * createFromReadableStream,
221
- * createTemporaryReferenceSet,
222
- * encodeReply,
223
- * })
224
- * );
225
- *
226
- * @name unstable_createCallServer
227
- * @public
228
- * @category RSC
229
- * @mode data
230
- * @param opts Options
231
- * @param opts.createFromReadableStream Your `react-server-dom-xyz/client`'s
232
- * `createFromReadableStream`. Used to decode payloads from the server.
233
- * @param opts.createTemporaryReferenceSet A function that creates a temporary
234
- * reference set for the [RSC](https://react.dev/reference/rsc/server-components)
235
- * payload.
236
- * @param opts.encodeReply Your `react-server-dom-xyz/client`'s `encodeReply`.
237
- * Used when sending payloads to the server.
238
- * @param opts.fetch Optional [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)
239
- * implementation. Defaults to global [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/fetch).
240
- * @returns A function that can be used to call server actions.
241
- */
242
- declare function createCallServer({ createFromReadableStream, createTemporaryReferenceSet, encodeReply, fetch: fetchImplementation, }: {
243
- createFromReadableStream: BrowserCreateFromReadableStreamFunction;
244
- createTemporaryReferenceSet: () => unknown;
245
- encodeReply: EncodeReplyFunction;
246
- fetch?: (request: Request) => Promise<Response>;
247
- }): (id: string, args: unknown[]) => Promise<unknown>;
248
- /**
249
- * Props for the {@link unstable_RSCHydratedRouter} component.
250
- *
251
- * @name unstable_RSCHydratedRouterProps
252
- * @category Types
253
- */
254
- interface RSCHydratedRouterProps {
255
- /**
256
- * Your `react-server-dom-xyz/client`'s `createFromReadableStream` function,
257
- * used to decode payloads from the server.
258
- */
259
- createFromReadableStream: BrowserCreateFromReadableStreamFunction;
260
- /**
261
- * Optional fetch implementation. Defaults to global [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/fetch).
262
- */
263
- fetch?: (request: Request) => Promise<Response>;
264
- /**
265
- * The decoded {@link unstable_RSCPayload} to hydrate.
266
- */
267
- payload: RSCPayload;
268
- /**
269
- * A function that returns an {@link RouterContextProvider} instance
270
- * which is provided as the `context` argument to client [`action`](../../start/data/route-object#action)s,
271
- * [`loader`](../../start/data/route-object#loader)s and [middleware](../../how-to/middleware).
272
- * This function is called to generate a fresh `context` instance on each
273
- * navigation or fetcher call.
274
- */
275
- getContext?: RouterInit["getContext"];
276
- }
277
- /**
278
- * Hydrates a server rendered {@link unstable_RSCPayload} in the browser.
279
- *
280
- * @example
281
- * import { startTransition, StrictMode } from "react";
282
- * import { hydrateRoot } from "react-dom/client";
283
- * import {
284
- * unstable_getRSCStream as getRSCStream,
285
- * unstable_RSCHydratedRouter as RSCHydratedRouter,
286
- * } from "react-router";
287
- * import type { unstable_RSCPayload as RSCPayload } from "react-router";
288
- *
289
- * createFromReadableStream(getRSCStream()).then((payload) =>
290
- * startTransition(async () => {
291
- * hydrateRoot(
292
- * document,
293
- * <StrictMode>
294
- * <RSCHydratedRouter
295
- * createFromReadableStream={createFromReadableStream}
296
- * payload={payload}
297
- * />
298
- * </StrictMode>,
299
- * { formState: await getFormState(payload) },
300
- * );
301
- * }),
302
- * );
303
- *
304
- * @name unstable_RSCHydratedRouter
305
- * @public
306
- * @category RSC
307
- * @mode data
308
- * @param props Props
309
- * @param {unstable_RSCHydratedRouterProps.createFromReadableStream} props.createFromReadableStream n/a
310
- * @param {unstable_RSCHydratedRouterProps.fetch} props.fetch n/a
311
- * @param {unstable_RSCHydratedRouterProps.getContext} props.getContext n/a
312
- * @param {unstable_RSCHydratedRouterProps.payload} props.payload n/a
313
- * @returns A hydrated {@link DataRouter} that can be used to navigate and
314
- * render routes.
315
- */
316
- declare function RSCHydratedRouter({ createFromReadableStream, fetch: fetchImplementation, payload, getContext, }: RSCHydratedRouterProps): React.JSX.Element;
317
-
318
- export { type BrowserCreateFromReadableStreamFunction as B, type DecodeActionFunction as D, type EncodeReplyFunction as E, type LoadServerActionFunction as L, RSCHydratedRouter as R, type DecodeFormStateFunction as a, type DecodeReplyFunction as b, createCallServer as c, type RSCManifestPayload as d, type RSCPayload as e, type RSCRenderPayload as f, getRequest as g, type RSCHydratedRouterProps as h, type RSCMatch as i, type RSCRouteManifest as j, type RSCRouteMatch as k, type RSCRouteConfigEntry as l, matchRSCServerRequest as m, type RSCRouteConfig as n };
@@ -1,188 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/**
2
- * react-router v7.16.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
-
12
-
13
-
14
-
15
-
16
-
17
- var _chunkY7DNFQZPjs = require('./chunk-Y7DNFQZP.js');
18
-
19
- // lib/dom/ssr/hydration.tsx
20
- function getHydrationData({
21
- state,
22
- routes,
23
- getRouteInfo,
24
- location,
25
- basename,
26
- isSpaMode
27
- }) {
28
- let hydrationData = {
29
- ...state,
30
- loaderData: { ...state.loaderData }
31
- };
32
- let initialMatches = _chunkY7DNFQZPjs.matchRoutes.call(void 0, routes, location, basename);
33
- if (initialMatches) {
34
- for (let match of initialMatches) {
35
- let routeId = match.route.id;
36
- let routeInfo = getRouteInfo(routeId);
37
- if (_chunkY7DNFQZPjs.shouldHydrateRouteLoader.call(void 0,
38
- routeId,
39
- routeInfo.clientLoader,
40
- routeInfo.hasLoader,
41
- isSpaMode
42
- ) && (routeInfo.hasHydrateFallback || !routeInfo.hasLoader)) {
43
- delete hydrationData.loaderData[routeId];
44
- } else if (!routeInfo.hasLoader) {
45
- hydrationData.loaderData[routeId] = null;
46
- }
47
- }
48
- }
49
- return hydrationData;
50
- }
51
-
52
- // lib/rsc/errorBoundaries.tsx
53
- var _react = require('react'); var _react2 = _interopRequireDefault(_react);
54
- var RSCRouterGlobalErrorBoundary = class extends _react2.default.Component {
55
- constructor(props) {
56
- super(props);
57
- this.state = { error: null, location: props.location };
58
- }
59
- static getDerivedStateFromError(error) {
60
- return { error };
61
- }
62
- static getDerivedStateFromProps(props, state) {
63
- if (state.location !== props.location) {
64
- return { error: null, location: props.location };
65
- }
66
- return { error: state.error, location: state.location };
67
- }
68
- render() {
69
- if (this.state.error) {
70
- return /* @__PURE__ */ _react2.default.createElement(
71
- RSCDefaultRootErrorBoundaryImpl,
72
- {
73
- error: this.state.error,
74
- renderAppShell: true
75
- }
76
- );
77
- } else {
78
- return this.props.children;
79
- }
80
- }
81
- };
82
- function ErrorWrapper({
83
- renderAppShell,
84
- title,
85
- children
86
- }) {
87
- if (!renderAppShell) {
88
- return children;
89
- }
90
- return /* @__PURE__ */ _react2.default.createElement("html", { lang: "en" }, /* @__PURE__ */ _react2.default.createElement("head", null, /* @__PURE__ */ _react2.default.createElement("meta", { charSet: "utf-8" }), /* @__PURE__ */ _react2.default.createElement(
91
- "meta",
92
- {
93
- name: "viewport",
94
- content: "width=device-width,initial-scale=1,viewport-fit=cover"
95
- }
96
- ), /* @__PURE__ */ _react2.default.createElement("title", null, title)), /* @__PURE__ */ _react2.default.createElement("body", null, /* @__PURE__ */ _react2.default.createElement("main", { style: { fontFamily: "system-ui, sans-serif", padding: "2rem" } }, children)));
97
- }
98
- function RSCDefaultRootErrorBoundaryImpl({
99
- error,
100
- renderAppShell
101
- }) {
102
- console.error(error);
103
- let heyDeveloper = /* @__PURE__ */ _react2.default.createElement(
104
- "script",
105
- {
106
- dangerouslySetInnerHTML: {
107
- __html: `
108
- console.log(
109
- "\u{1F4BF} Hey developer \u{1F44B}. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."
110
- );
111
- `
112
- }
113
- }
114
- );
115
- if (_chunkY7DNFQZPjs.isRouteErrorResponse.call(void 0, error)) {
116
- return /* @__PURE__ */ _react2.default.createElement(
117
- ErrorWrapper,
118
- {
119
- renderAppShell,
120
- title: "Unhandled Thrown Response!"
121
- },
122
- /* @__PURE__ */ _react2.default.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText),
123
- _chunkY7DNFQZPjs.ENABLE_DEV_WARNINGS ? heyDeveloper : null
124
- );
125
- }
126
- let errorInstance;
127
- if (error instanceof Error) {
128
- errorInstance = error;
129
- } else {
130
- let errorString = error == null ? "Unknown Error" : typeof error === "object" && "toString" in error ? error.toString() : JSON.stringify(error);
131
- errorInstance = new Error(errorString);
132
- }
133
- return /* @__PURE__ */ _react2.default.createElement(ErrorWrapper, { renderAppShell, title: "Application Error!" }, /* @__PURE__ */ _react2.default.createElement("h1", { style: { fontSize: "24px" } }, "Application Error"), /* @__PURE__ */ _react2.default.createElement(
134
- "pre",
135
- {
136
- style: {
137
- padding: "2rem",
138
- background: "hsla(10, 50%, 50%, 0.1)",
139
- color: "red",
140
- overflow: "auto"
141
- }
142
- },
143
- errorInstance.stack
144
- ), heyDeveloper);
145
- }
146
- function RSCDefaultRootErrorBoundary({
147
- hasRootLayout
148
- }) {
149
- let error = _chunkY7DNFQZPjs.useRouteError.call(void 0, );
150
- if (hasRootLayout === void 0) {
151
- throw new Error("Missing 'hasRootLayout' prop");
152
- }
153
- return /* @__PURE__ */ _react2.default.createElement(
154
- RSCDefaultRootErrorBoundaryImpl,
155
- {
156
- renderAppShell: !hasRootLayout,
157
- error
158
- }
159
- );
160
- }
161
-
162
- // lib/rsc/route-modules.ts
163
- function createRSCRouteModules(payload) {
164
- const routeModules = {};
165
- for (const match of payload.matches) {
166
- populateRSCRouteModules(routeModules, match);
167
- }
168
- return routeModules;
169
- }
170
- function populateRSCRouteModules(routeModules, matches) {
171
- matches = Array.isArray(matches) ? matches : [matches];
172
- for (const match of matches) {
173
- routeModules[match.id] = {
174
- links: match.links,
175
- meta: match.meta,
176
- default: noopComponent
177
- };
178
- }
179
- }
180
- var noopComponent = () => null;
181
-
182
-
183
-
184
-
185
-
186
-
187
-
188
- exports.getHydrationData = getHydrationData; exports.RSCRouterGlobalErrorBoundary = RSCRouterGlobalErrorBoundary; exports.RSCDefaultRootErrorBoundary = RSCDefaultRootErrorBoundary; exports.createRSCRouteModules = createRSCRouteModules; exports.populateRSCRouteModules = populateRSCRouteModules;