react-router 0.0.0-experimental-d07149147 → 0.0.0-experimental-abd9fc79b

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 (294) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/dist/development/dom-export.d.ts +6 -172
  3. package/dist/development/dom-export.js +12 -1009
  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 +1650 -1641
  7. package/dist/development/index-react-server.js +2883 -3683
  8. package/dist/development/index.d.ts +41 -1476
  9. package/dist/development/index.js +36 -2571
  10. package/dist/development/lib/actions.js +50 -0
  11. package/dist/development/lib/components.d.ts +1030 -0
  12. package/dist/development/lib/components.js +841 -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 +2053 -0
  18. package/dist/development/lib/dom/lib.js +1271 -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 +198 -0
  22. package/dist/development/lib/dom/ssr/components.js +589 -0
  23. package/dist/development/lib/dom/ssr/data.js +29 -0
  24. package/dist/development/lib/dom/ssr/entry.d.ts +60 -0
  25. package/dist/development/lib/dom/ssr/errorBoundaries.d.ts +27 -0
  26. package/dist/development/lib/dom/ssr/errorBoundaries.js +87 -0
  27. package/dist/development/lib/dom/ssr/fallback.js +33 -0
  28. package/dist/development/lib/dom/ssr/fog-of-war.d.ts +12 -0
  29. package/dist/development/lib/dom/ssr/fog-of-war.js +180 -0
  30. package/dist/development/lib/dom/ssr/hydration.d.ts +32 -0
  31. package/dist/development/lib/dom/ssr/hydration.js +29 -0
  32. package/dist/development/lib/dom/ssr/invariant.js +16 -0
  33. package/dist/development/lib/dom/ssr/links.js +170 -0
  34. package/dist/development/lib/dom/ssr/markup.js +24 -0
  35. package/dist/development/lib/dom/ssr/routeModules.d.ts +206 -0
  36. package/dist/development/lib/dom/ssr/routeModules.js +31 -0
  37. package/dist/development/lib/dom/ssr/routes-test-stub.d.ts +62 -0
  38. package/dist/development/lib/dom/ssr/routes-test-stub.js +108 -0
  39. package/dist/development/lib/dom/ssr/routes.d.ts +33 -0
  40. package/dist/development/lib/dom/ssr/routes.js +303 -0
  41. package/dist/development/lib/dom/ssr/server.d.ts +48 -0
  42. package/dist/development/lib/dom/ssr/server.js +69 -0
  43. package/dist/development/lib/dom/ssr/single-fetch.d.ts +14 -0
  44. package/dist/development/lib/dom/ssr/single-fetch.js +345 -0
  45. package/dist/development/lib/dom-export/dom-router-provider.d.ts +9 -0
  46. package/dist/development/lib/dom-export/dom-router-provider.js +22 -0
  47. package/dist/development/lib/dom-export/hydrated-router.d.ts +125 -0
  48. package/dist/development/lib/dom-export/hydrated-router.js +150 -0
  49. package/dist/development/lib/errors.js +29 -0
  50. package/dist/development/lib/hooks.d.ts +947 -0
  51. package/dist/development/lib/hooks.js +1388 -0
  52. package/dist/development/lib/href.d.ts +20 -0
  53. package/dist/development/lib/href.js +50 -0
  54. package/dist/development/lib/router/history.d.ts +258 -0
  55. package/dist/development/lib/router/history.js +372 -0
  56. package/dist/development/lib/router/instrumentation.d.ts +86 -0
  57. package/dist/development/lib/router/instrumentation.js +213 -0
  58. package/dist/development/lib/router/links.d.ts +114 -0
  59. package/dist/development/lib/router/router.d.ts +663 -0
  60. package/dist/development/lib/router/router.js +2988 -0
  61. package/dist/development/lib/router/url.js +18 -0
  62. package/dist/development/lib/router/utils.d.ts +948 -0
  63. package/dist/development/lib/router/utils.js +810 -0
  64. package/dist/development/lib/rsc/browser.d.ts +137 -0
  65. package/dist/development/lib/rsc/browser.js +602 -0
  66. package/dist/development/lib/rsc/errorBoundaries.d.ts +11 -0
  67. package/dist/development/lib/rsc/errorBoundaries.js +90 -0
  68. package/dist/development/lib/rsc/html-stream/browser.d.ts +48 -0
  69. package/dist/development/lib/rsc/html-stream/browser.js +74 -0
  70. package/dist/development/lib/rsc/html-stream/server.js +78 -0
  71. package/dist/development/lib/rsc/route-modules.js +27 -0
  72. package/dist/development/lib/rsc/server.rsc.d.ts +219 -0
  73. package/dist/development/lib/rsc/server.ssr.d.ts +129 -0
  74. package/dist/development/lib/rsc/server.ssr.js +404 -0
  75. package/dist/development/lib/server-runtime/build.d.ts +66 -0
  76. package/dist/development/lib/server-runtime/cookies.d.ts +66 -0
  77. package/dist/development/lib/server-runtime/cookies.js +139 -0
  78. package/dist/development/lib/server-runtime/crypto.js +43 -0
  79. package/dist/development/lib/server-runtime/data.js +25 -0
  80. package/dist/development/lib/server-runtime/dev.d.ts +9 -0
  81. package/dist/development/lib/server-runtime/dev.js +26 -0
  82. package/dist/development/lib/server-runtime/entry.js +20 -0
  83. package/dist/development/lib/server-runtime/errors.js +75 -0
  84. package/dist/development/lib/server-runtime/headers.js +73 -0
  85. package/dist/development/lib/server-runtime/invariant.js +19 -0
  86. package/dist/development/lib/server-runtime/mode.d.ts +12 -0
  87. package/dist/development/lib/server-runtime/mode.js +25 -0
  88. package/dist/development/lib/server-runtime/routeMatching.js +28 -0
  89. package/dist/development/lib/server-runtime/routes.d.ts +13 -0
  90. package/dist/development/lib/server-runtime/routes.js +74 -0
  91. package/dist/development/lib/server-runtime/server.d.ts +10 -0
  92. package/dist/development/lib/server-runtime/server.js +345 -0
  93. package/dist/development/lib/server-runtime/serverHandoff.js +17 -0
  94. package/dist/development/lib/server-runtime/sessions/cookieStorage.d.ts +25 -0
  95. package/dist/development/lib/server-runtime/sessions/cookieStorage.js +45 -0
  96. package/dist/development/lib/server-runtime/sessions/memoryStorage.d.ts +23 -0
  97. package/dist/development/lib/server-runtime/sessions/memoryStorage.js +52 -0
  98. package/dist/development/lib/server-runtime/sessions.d.ts +145 -0
  99. package/dist/development/lib/server-runtime/sessions.js +98 -0
  100. package/dist/development/lib/server-runtime/single-fetch.d.ts +7 -0
  101. package/dist/development/lib/server-runtime/single-fetch.js +215 -0
  102. package/dist/development/lib/server-runtime/urls.js +28 -0
  103. package/dist/development/lib/server-runtime/warnings.js +20 -0
  104. package/dist/development/lib/types/future.d.ts +9 -0
  105. package/dist/development/lib/types/internal.d.ts +26 -177
  106. package/dist/development/lib/types/internal.js +3 -2
  107. package/dist/development/{register-roq_0qYo.d.ts → lib/types/register.d.ts} +9 -15
  108. package/dist/development/lib/types/route-data.d.ts +113 -0
  109. package/dist/development/lib/types/route-module-annotations.d.ts +149 -0
  110. package/dist/development/lib/types/route-module.d.ts +19 -0
  111. package/dist/development/lib/types/serializes-to.d.ts +13 -0
  112. package/dist/development/lib/types/utils.d.ts +11 -0
  113. package/dist/development/vendor/turbo-stream-v2/flatten.js +159 -0
  114. package/dist/development/vendor/turbo-stream-v2/turbo-stream.js +179 -0
  115. package/dist/development/vendor/turbo-stream-v2/unflatten.js +199 -0
  116. package/dist/development/vendor/turbo-stream-v2/utils.js +39 -0
  117. package/dist/production/dom-export.d.ts +6 -172
  118. package/dist/production/dom-export.js +12 -1009
  119. package/dist/production/index-react-server-client.d.ts +7 -4
  120. package/dist/production/index-react-server-client.js +8 -52
  121. package/dist/production/index-react-server.d.ts +1650 -1641
  122. package/dist/production/index-react-server.js +2874 -3683
  123. package/dist/production/index.d.ts +41 -1476
  124. package/dist/production/index.js +36 -2571
  125. package/dist/production/lib/actions.js +50 -0
  126. package/dist/production/lib/components.d.ts +1030 -0
  127. package/dist/production/lib/components.js +841 -0
  128. package/dist/production/lib/context.d.ts +83 -0
  129. package/dist/production/lib/context.js +41 -0
  130. package/dist/production/lib/dom/dom.d.ts +119 -0
  131. package/dist/production/lib/dom/dom.js +143 -0
  132. package/dist/production/lib/dom/lib.d.ts +2053 -0
  133. package/dist/production/lib/dom/lib.js +1271 -0
  134. package/dist/production/lib/dom/server.d.ts +138 -0
  135. package/dist/production/lib/dom/server.js +301 -0
  136. package/dist/production/lib/dom/ssr/components.d.ts +198 -0
  137. package/dist/production/lib/dom/ssr/components.js +589 -0
  138. package/dist/production/lib/dom/ssr/data.js +29 -0
  139. package/dist/production/lib/dom/ssr/entry.d.ts +60 -0
  140. package/dist/production/lib/dom/ssr/errorBoundaries.d.ts +27 -0
  141. package/dist/production/lib/dom/ssr/errorBoundaries.js +87 -0
  142. package/dist/production/lib/dom/ssr/fallback.js +23 -0
  143. package/dist/production/lib/dom/ssr/fog-of-war.d.ts +12 -0
  144. package/dist/production/lib/dom/ssr/fog-of-war.js +180 -0
  145. package/dist/production/lib/dom/ssr/hydration.d.ts +32 -0
  146. package/dist/production/lib/dom/ssr/hydration.js +29 -0
  147. package/dist/production/lib/dom/ssr/invariant.js +16 -0
  148. package/dist/production/lib/dom/ssr/links.js +170 -0
  149. package/dist/production/lib/dom/ssr/markup.js +24 -0
  150. package/dist/production/lib/dom/ssr/routeModules.d.ts +206 -0
  151. package/dist/production/lib/dom/ssr/routeModules.js +31 -0
  152. package/dist/production/lib/dom/ssr/routes-test-stub.d.ts +62 -0
  153. package/dist/production/lib/dom/ssr/routes-test-stub.js +108 -0
  154. package/dist/production/lib/dom/ssr/routes.d.ts +33 -0
  155. package/dist/production/lib/dom/ssr/routes.js +303 -0
  156. package/dist/production/lib/dom/ssr/server.d.ts +48 -0
  157. package/dist/production/lib/dom/ssr/server.js +69 -0
  158. package/dist/production/lib/dom/ssr/single-fetch.d.ts +14 -0
  159. package/dist/production/lib/dom/ssr/single-fetch.js +345 -0
  160. package/dist/production/lib/dom-export/dom-router-provider.d.ts +9 -0
  161. package/dist/production/lib/dom-export/dom-router-provider.js +22 -0
  162. package/dist/production/lib/dom-export/hydrated-router.d.ts +125 -0
  163. package/dist/production/lib/dom-export/hydrated-router.js +150 -0
  164. package/dist/production/lib/errors.js +29 -0
  165. package/dist/production/lib/hooks.d.ts +947 -0
  166. package/dist/production/lib/hooks.js +1373 -0
  167. package/dist/production/lib/href.d.ts +20 -0
  168. package/dist/production/lib/href.js +50 -0
  169. package/dist/production/lib/router/history.d.ts +258 -0
  170. package/dist/production/lib/router/history.js +372 -0
  171. package/dist/production/lib/router/instrumentation.d.ts +86 -0
  172. package/dist/production/lib/router/instrumentation.js +213 -0
  173. package/dist/production/lib/router/links.d.ts +114 -0
  174. package/dist/production/lib/router/router.d.ts +663 -0
  175. package/dist/production/lib/router/router.js +2988 -0
  176. package/dist/production/lib/router/url.js +18 -0
  177. package/dist/production/lib/router/utils.d.ts +948 -0
  178. package/dist/production/lib/router/utils.js +801 -0
  179. package/dist/production/lib/rsc/browser.d.ts +137 -0
  180. package/dist/production/lib/rsc/browser.js +602 -0
  181. package/dist/production/lib/rsc/errorBoundaries.d.ts +11 -0
  182. package/dist/production/lib/rsc/errorBoundaries.js +90 -0
  183. package/dist/production/lib/rsc/html-stream/browser.d.ts +48 -0
  184. package/dist/production/lib/rsc/html-stream/browser.js +74 -0
  185. package/dist/production/lib/rsc/html-stream/server.js +78 -0
  186. package/dist/production/lib/rsc/route-modules.js +27 -0
  187. package/dist/production/lib/rsc/server.rsc.d.ts +219 -0
  188. package/dist/production/lib/rsc/server.ssr.d.ts +129 -0
  189. package/dist/production/lib/rsc/server.ssr.js +404 -0
  190. package/dist/production/lib/server-runtime/build.d.ts +66 -0
  191. package/dist/production/lib/server-runtime/cookies.d.ts +66 -0
  192. package/dist/production/lib/server-runtime/cookies.js +139 -0
  193. package/dist/production/lib/server-runtime/crypto.js +43 -0
  194. package/dist/production/lib/server-runtime/data.js +25 -0
  195. package/dist/production/lib/server-runtime/dev.d.ts +9 -0
  196. package/dist/production/lib/server-runtime/dev.js +26 -0
  197. package/dist/production/lib/server-runtime/entry.js +20 -0
  198. package/dist/production/lib/server-runtime/errors.js +75 -0
  199. package/dist/production/lib/server-runtime/headers.js +73 -0
  200. package/dist/production/lib/server-runtime/invariant.js +19 -0
  201. package/dist/production/lib/server-runtime/mode.d.ts +12 -0
  202. package/dist/production/lib/server-runtime/mode.js +25 -0
  203. package/dist/production/lib/server-runtime/routeMatching.js +28 -0
  204. package/dist/production/lib/server-runtime/routes.d.ts +13 -0
  205. package/dist/production/lib/server-runtime/routes.js +74 -0
  206. package/dist/production/lib/server-runtime/server.d.ts +10 -0
  207. package/dist/production/lib/server-runtime/server.js +345 -0
  208. package/dist/production/lib/server-runtime/serverHandoff.js +17 -0
  209. package/dist/production/lib/server-runtime/sessions/cookieStorage.d.ts +25 -0
  210. package/dist/production/lib/server-runtime/sessions/cookieStorage.js +45 -0
  211. package/dist/production/lib/server-runtime/sessions/memoryStorage.d.ts +23 -0
  212. package/dist/production/lib/server-runtime/sessions/memoryStorage.js +52 -0
  213. package/dist/production/lib/server-runtime/sessions.d.ts +145 -0
  214. package/dist/production/lib/server-runtime/sessions.js +98 -0
  215. package/dist/production/lib/server-runtime/single-fetch.d.ts +7 -0
  216. package/dist/production/lib/server-runtime/single-fetch.js +215 -0
  217. package/dist/production/lib/server-runtime/urls.js +28 -0
  218. package/dist/production/lib/server-runtime/warnings.js +20 -0
  219. package/dist/production/lib/types/future.d.ts +9 -0
  220. package/dist/production/lib/types/internal.d.ts +26 -177
  221. package/dist/production/lib/types/internal.js +3 -2
  222. package/dist/production/{register-roq_0qYo.d.ts → lib/types/register.d.ts} +9 -15
  223. package/dist/production/lib/types/route-data.d.ts +113 -0
  224. package/dist/production/lib/types/route-module-annotations.d.ts +149 -0
  225. package/dist/production/lib/types/route-module.d.ts +19 -0
  226. package/dist/production/lib/types/serializes-to.d.ts +13 -0
  227. package/dist/production/lib/types/utils.d.ts +11 -0
  228. package/dist/production/vendor/turbo-stream-v2/flatten.js +159 -0
  229. package/dist/production/vendor/turbo-stream-v2/turbo-stream.js +179 -0
  230. package/dist/production/vendor/turbo-stream-v2/unflatten.js +199 -0
  231. package/dist/production/vendor/turbo-stream-v2/utils.js +39 -0
  232. package/docs/explanation/code-splitting.md +16 -0
  233. package/docs/how-to/middleware.md +14 -130
  234. package/docs/how-to/react-server-components.md +1 -1
  235. package/docs/how-to/route-module-type-safety.md +1 -16
  236. package/docs/how-to/status.md +1 -1
  237. package/docs/index.md +3 -6
  238. package/docs/start/framework/deploying.md +1 -1
  239. package/docs/start/modes.md +1 -2
  240. package/docs/upgrading/component-routes.md +2 -2
  241. package/docs/upgrading/future.md +26 -228
  242. package/docs/upgrading/router-provider.md +6 -3
  243. package/docs/upgrading/v7.md +443 -0
  244. package/package.json +43 -87
  245. package/dist/development/browser-B2PdsXXH.d.ts +0 -318
  246. package/dist/development/browser-DBmQ1yAR.d.mts +0 -318
  247. package/dist/development/chunk-2LN5XYLV.mjs +0 -2535
  248. package/dist/development/chunk-FXH6PCLA.js +0 -188
  249. package/dist/development/chunk-INNQPBPI.js +0 -1366
  250. package/dist/development/chunk-NPZCI77A.js +0 -10307
  251. package/dist/development/chunk-YXISIC3F.mjs +0 -11606
  252. package/dist/development/context-CeD5LmaF.d.mts +0 -1779
  253. package/dist/development/data-CjO11-hU.d.ts +0 -1740
  254. package/dist/development/data-DEjBmEfD.d.mts +0 -1740
  255. package/dist/development/dom-export.d.mts +0 -172
  256. package/dist/development/dom-export.mjs +0 -1010
  257. package/dist/development/index-react-server-client-3ykjivgQ.d.ts +0 -3677
  258. package/dist/development/index-react-server-client-CACgcj2J.d.mts +0 -2614
  259. package/dist/development/index-react-server-client.d.mts +0 -4
  260. package/dist/development/index-react-server-client.mjs +0 -59
  261. package/dist/development/index-react-server.d.mts +0 -2711
  262. package/dist/development/index-react-server.mjs +0 -3821
  263. package/dist/development/index.d.mts +0 -1479
  264. package/dist/development/index.mjs +0 -275
  265. package/dist/development/instrumentation-Dkmpzd13.d.ts +0 -715
  266. package/dist/development/lib/types/internal.d.mts +0 -184
  267. package/dist/development/lib/types/internal.mjs +0 -10
  268. package/dist/development/register-CmkRspdl.d.mts +0 -30
  269. package/dist/production/browser-B2PdsXXH.d.ts +0 -318
  270. package/dist/production/browser-DBmQ1yAR.d.mts +0 -318
  271. package/dist/production/chunk-CTPMZNY4.mjs +0 -2535
  272. package/dist/production/chunk-EGIXHPKG.js +0 -10307
  273. package/dist/production/chunk-L4O4PVIV.js +0 -1366
  274. package/dist/production/chunk-OINPVNTA.js +0 -188
  275. package/dist/production/chunk-TPWBPI22.mjs +0 -11606
  276. package/dist/production/context-CeD5LmaF.d.mts +0 -1779
  277. package/dist/production/data-CjO11-hU.d.ts +0 -1740
  278. package/dist/production/data-DEjBmEfD.d.mts +0 -1740
  279. package/dist/production/dom-export.d.mts +0 -172
  280. package/dist/production/dom-export.mjs +0 -1010
  281. package/dist/production/index-react-server-client-3ykjivgQ.d.ts +0 -3677
  282. package/dist/production/index-react-server-client-CACgcj2J.d.mts +0 -2614
  283. package/dist/production/index-react-server-client.d.mts +0 -4
  284. package/dist/production/index-react-server-client.mjs +0 -59
  285. package/dist/production/index-react-server.d.mts +0 -2711
  286. package/dist/production/index-react-server.mjs +0 -3821
  287. package/dist/production/index.d.mts +0 -1479
  288. package/dist/production/index.mjs +0 -275
  289. package/dist/production/instrumentation-Dkmpzd13.d.ts +0 -715
  290. package/dist/production/lib/types/internal.d.mts +0 -184
  291. package/dist/production/lib/types/internal.mjs +0 -10
  292. package/dist/production/register-CmkRspdl.d.mts +0 -30
  293. package/docs/upgrading/remix.md +0 -403
  294. package/docs/upgrading/v6.md +0 -382
package/CHANGELOG.md CHANGED
@@ -1,5 +1,69 @@
1
1
  # `react-router`
2
2
 
3
+ ## v8.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Remove the obsolete `AppLoadContext` type export accidentally left over from v7 now that middleware is always enabled and server request context is provided through `RouterContextProvider`. ([#15207](https://github.com/remix-run/react-router/pull/15207))
8
+
9
+ ## v8.0.0
10
+
11
+ ### Major Changes
12
+
13
+ - Remove the `future.v8_trailingSlashAwareDataRequests` flag ([#15100](https://github.com/remix-run/react-router/pull/15100))
14
+ - Trailing slash-aware data request URLs are now the default behavior.
15
+ - Update `tsconfig.json` `target`/`lib` from `ES2020 -> ES2022` ([591853e](https://github.com/remix-run/react-router/commit/591853e))
16
+ - Switch the published packages in `packages/` to ESM-only. ([#14895](https://github.com/remix-run/react-router/pull/14895)) ([59ebcf1](https://github.com/remix-run/react-router/commit/59ebcf1))
17
+ - Remove deprecated `data` parameter in favor of `loaderData` for `meta` APIs (to align with `Route.ComponentProps`) ([#14931](https://github.com/remix-run/react-router/pull/14931))
18
+ - `Route.MetaArgs`, `Route.MetaMatch`, `MetaArgs`, `MetaMatch`, `Route.ComponentProps.matches`, `UIMatch`
19
+ - Remove `future.v8_passThroughRequests` flag - the raw incoming `request` is now always passed through to `loader`/`action`. Use `url` for the normalized URL without React Router-specific implementation details (`.data` suffixes, `index`/`_routes` search params). ([#15079](https://github.com/remix-run/react-router/pull/15079))
20
+ - Remove internal `hasErrorBoundary` field added to `router.routes` when using a data router ([#15074](https://github.com/remix-run/react-router/pull/15074))
21
+ - This should not impact user-facing code since this was an internal prop and was computed based on the presence of `ErrorBoundary` or `errorElement` on your route
22
+ - `hasErrorBoundary` is no longer accepted on `RouteObject` (`IndexRouteObject`/`NonIndexRouteObject`), `DataRouteObject`, `<Route>` JSX props, or as a key in `lazy` route definitions.
23
+ - The `MapRoutePropertiesFunction` signature no longer requires returning `hasErrorBoundary`; the router infers it directly.
24
+ - Remove `react-router-dom` package ([#15076](https://github.com/remix-run/react-router/pull/15076))
25
+ - In v7 everything DOM-specific was collapsed into `react-router/dom`
26
+ - `react-router-dom` was kept around as a convenience so existing v6 app imports would still work
27
+ - For v8, you will need to swap `react-router-dom` imports:
28
+ - `RouterProvider`/`HydratedRouter` should be imported from `react-router/dom`
29
+ - Everything else should be imported from `react-router`
30
+ - Remove `future.v8_middleware` flag — middleware is always enabled in v8 ([#15078](https://github.com/remix-run/react-router/pull/15078))
31
+ - The `future.v8_middleware` flag has been removed; middleware is now always enabled
32
+ - The `context` parameter passed to `loader`, `action`, and `middleware` functions is always a `RouterContextProvider` instance
33
+ - `getLoadContext` functions in custom servers must return a `RouterContextProvider` — returning a plain object is no longer supported
34
+ - The `MiddlewareEnabled` type (previously exported as `UNSAFE_MiddlewareEnabled`) has been removed since the conditional it gated is now unconditional
35
+ - The `Future` module augmentation pattern (`interface Future { v8_middleware: true }`) is no longer needed to type `context` in Data Mode
36
+ - Update minimum Node version to 22.22.0 ([#14928](https://github.com/remix-run/react-router/pull/14928))
37
+ - Update minimum React version to 19.2.7 ([#15062](https://github.com/remix-run/react-router/pull/15062))
38
+
39
+ ### Minor Changes
40
+
41
+ - Bump dependencies ([#15080](https://github.com/remix-run/react-router/pull/15080))
42
+ - Bumped `cookie` from `^1.0.1` to `^1.1.1`
43
+ - Bumped `set-cookie-parser` from `^2.6.0` to `^3.1.0`
44
+
45
+ ### Patch Changes
46
+
47
+ - Ensure client middleware errors load lazy route error boundaries before bubbling ([#15086](https://github.com/remix-run/react-router/pull/15086))
48
+ - Remove explicit `onSubmit` type override from `SharedFormProps` to fix deprecation warning with `@types/react@19.x` ([#14932](https://github.com/remix-run/react-router/pull/14932)) ([59ebcf1](https://github.com/remix-run/react-router/commit/59ebcf1))
49
+ - Update package builds to preserve individual module files in published artifacts. Public APIs and documented import paths are unchanged. ([#15092](https://github.com/remix-run/react-router/pull/15092))
50
+ - Updated package TypeScript configs to support modern module syntax used by the build configuration.
51
+ - Migrate package builds from `tsup` to `tsdown`. Published package entry points and public APIs are unchanged. ([#15092](https://github.com/remix-run/react-router/pull/15092))
52
+ - Upgrade React Router's TypeScript tooling to TypeScript 6. Runtime behavior and public APIs are unchanged. ([#15092](https://github.com/remix-run/react-router/pull/15092))
53
+
54
+ ## v7.18.0
55
+
56
+ ### Patch Changes
57
+
58
+ - Fix server handler prerender responses when using `ssr: false` and `future.v8_trailingSlashAwareDataRequests: true`. Avoids false positive "SPA Mode" detection when serving prerendered paths ([#15173](https://github.com/remix-run/react-router/pull/15173))
59
+ - Use the `ServerRouter` nonce for nonce-aware SSR components when they don't provide their own value so strict CSP pages can load them. ([#15170](https://github.com/remix-run/react-router/pull/15170))
60
+ - Use `turbo-stream` to serialize and deserialize Framework Mode hydration errors ([#15175](https://github.com/remix-run/react-router/pull/15175))
61
+ - Precompute route branch matchers to avoid recompiling route path regexes during matching ([#15186](https://github.com/remix-run/react-router/pull/15186))
62
+ - Use the constructed request URL host when validating action request origins. ([#15185](https://github.com/remix-run/react-router/pull/15185))
63
+ - Remove the un-documented custom error serialization logic from Data Mode SSR built-in hydration flows ([#15175](https://github.com/remix-run/react-router/pull/15175))
64
+ - Validate protocols in RSC render redirects ([#15177](https://github.com/remix-run/react-router/pull/15177))
65
+ - Consolidate url normalization logic and better handle mixed slashes ([#15176](https://github.com/remix-run/react-router/pull/15176))
66
+
3
67
  ## v7.17.0
4
68
 
5
69
  ### Minor Changes
@@ -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-Dkmpzd13.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-B2PdsXXH.js';
5
- import './data-CjO11-hU.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 };