react-router 0.0.0-experimental-d07149147 → 0.0.0-experimental-479e73b7b

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 (307) hide show
  1. package/CHANGELOG.md +154 -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 +1787 -1663
  7. package/dist/development/index-react-server.js +3067 -3708
  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 +875 -0
  13. package/dist/development/lib/context.d.ts +88 -0
  14. package/dist/development/lib/context.js +47 -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 +2054 -0
  18. package/dist/development/lib/dom/lib.js +1272 -0
  19. package/dist/development/lib/dom/server.d.ts +138 -0
  20. package/dist/development/lib/dom/server.js +321 -0
  21. package/dist/development/lib/dom/ssr/components.d.ts +198 -0
  22. package/dist/development/lib/dom/ssr/components.js +597 -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 +185 -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 +75 -0
  38. package/dist/development/lib/dom/ssr/routes-test-stub.js +121 -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 +974 -0
  51. package/dist/development/lib/hooks.js +1422 -0
  52. package/dist/development/lib/href.d.ts +36 -0
  53. package/dist/development/lib/href.js +70 -0
  54. package/dist/development/lib/router/history.d.ts +264 -0
  55. package/dist/development/lib/router/history.js +378 -0
  56. package/dist/development/lib/router/instrumentation.d.ts +111 -0
  57. package/dist/development/lib/router/instrumentation.js +290 -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 +2993 -0
  61. package/dist/development/lib/router/url.js +18 -0
  62. package/dist/development/lib/router/utils.d.ts +960 -0
  63. package/dist/development/lib/router/utils.js +881 -0
  64. package/dist/development/lib/rsc/browser.d.ts +137 -0
  65. package/dist/development/lib/rsc/browser.js +612 -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 +97 -0
  71. package/dist/development/lib/rsc/route-modules.js +27 -0
  72. package/dist/development/lib/rsc/server.rsc.d.ts +224 -0
  73. package/dist/development/lib/rsc/server.ssr.d.ts +152 -0
  74. package/dist/development/lib/rsc/server.ssr.js +419 -0
  75. package/dist/development/lib/server-runtime/build.d.ts +66 -0
  76. package/dist/development/lib/server-runtime/cookies.d.ts +92 -0
  77. package/dist/development/lib/server-runtime/cookies.js +153 -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 +22 -0
  92. package/dist/development/lib/server-runtime/server.js +364 -0
  93. package/dist/development/lib/server-runtime/serverHandoff.js +17 -0
  94. package/dist/development/lib/server-runtime/sessions/cookieStorage.d.ts +33 -0
  95. package/dist/development/lib/server-runtime/sessions/cookieStorage.js +53 -0
  96. package/dist/development/lib/server-runtime/sessions/memoryStorage.d.ts +29 -0
  97. package/dist/development/lib/server-runtime/sessions/memoryStorage.js +58 -0
  98. package/dist/development/lib/server-runtime/sessions.d.ts +174 -0
  99. package/dist/development/lib/server-runtime/sessions.js +115 -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 +1787 -1663
  122. package/dist/production/index-react-server.js +3058 -3708
  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 +875 -0
  128. package/dist/production/lib/context.d.ts +88 -0
  129. package/dist/production/lib/context.js +47 -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 +2054 -0
  133. package/dist/production/lib/dom/lib.js +1272 -0
  134. package/dist/production/lib/dom/server.d.ts +138 -0
  135. package/dist/production/lib/dom/server.js +321 -0
  136. package/dist/production/lib/dom/ssr/components.d.ts +198 -0
  137. package/dist/production/lib/dom/ssr/components.js +597 -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 +185 -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 +75 -0
  153. package/dist/production/lib/dom/ssr/routes-test-stub.js +121 -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 +974 -0
  166. package/dist/production/lib/hooks.js +1407 -0
  167. package/dist/production/lib/href.d.ts +36 -0
  168. package/dist/production/lib/href.js +70 -0
  169. package/dist/production/lib/router/history.d.ts +264 -0
  170. package/dist/production/lib/router/history.js +378 -0
  171. package/dist/production/lib/router/instrumentation.d.ts +111 -0
  172. package/dist/production/lib/router/instrumentation.js +290 -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 +2993 -0
  176. package/dist/production/lib/router/url.js +18 -0
  177. package/dist/production/lib/router/utils.d.ts +960 -0
  178. package/dist/production/lib/router/utils.js +872 -0
  179. package/dist/production/lib/rsc/browser.d.ts +137 -0
  180. package/dist/production/lib/rsc/browser.js +612 -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 +97 -0
  186. package/dist/production/lib/rsc/route-modules.js +27 -0
  187. package/dist/production/lib/rsc/server.rsc.d.ts +224 -0
  188. package/dist/production/lib/rsc/server.ssr.d.ts +152 -0
  189. package/dist/production/lib/rsc/server.ssr.js +419 -0
  190. package/dist/production/lib/server-runtime/build.d.ts +66 -0
  191. package/dist/production/lib/server-runtime/cookies.d.ts +92 -0
  192. package/dist/production/lib/server-runtime/cookies.js +153 -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 +22 -0
  207. package/dist/production/lib/server-runtime/server.js +364 -0
  208. package/dist/production/lib/server-runtime/serverHandoff.js +17 -0
  209. package/dist/production/lib/server-runtime/sessions/cookieStorage.d.ts +33 -0
  210. package/dist/production/lib/server-runtime/sessions/cookieStorage.js +53 -0
  211. package/dist/production/lib/server-runtime/sessions/memoryStorage.d.ts +29 -0
  212. package/dist/production/lib/server-runtime/sessions/memoryStorage.js +58 -0
  213. package/dist/production/lib/server-runtime/sessions.d.ts +174 -0
  214. package/dist/production/lib/server-runtime/sessions.js +115 -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/explanation/hot-module-replacement.md +1 -1
  234. package/docs/explanation/sessions-and-cookies.md +13 -13
  235. package/docs/explanation/state-management.md +2 -2
  236. package/docs/how-to/data-strategy.md +1 -1
  237. package/docs/how-to/instrumentation.md +131 -26
  238. package/docs/how-to/middleware.md +14 -130
  239. package/docs/how-to/presets.md +2 -2
  240. package/docs/how-to/react-server-components.md +54 -2
  241. package/docs/how-to/route-module-type-safety.md +1 -16
  242. package/docs/how-to/security.md +8 -1
  243. package/docs/how-to/server-bundles.md +2 -2
  244. package/docs/how-to/status.md +1 -1
  245. package/docs/index.md +3 -6
  246. package/docs/start/data/route-object.md +2 -2
  247. package/docs/start/data/routing.md +1 -1
  248. package/docs/start/framework/deploying.md +5 -1
  249. package/docs/start/framework/pending-ui.md +1 -1
  250. package/docs/start/framework/route-module.md +8 -8
  251. package/docs/start/framework/routing.md +1 -1
  252. package/docs/start/modes.md +1 -2
  253. package/docs/upgrading/component-routes.md +4 -4
  254. package/docs/upgrading/future.md +33 -202
  255. package/docs/upgrading/router-provider.md +12 -9
  256. package/docs/upgrading/v7.md +460 -0
  257. package/package.json +43 -87
  258. package/dist/development/browser-B2PdsXXH.d.ts +0 -318
  259. package/dist/development/browser-DBmQ1yAR.d.mts +0 -318
  260. package/dist/development/chunk-2LN5XYLV.mjs +0 -2535
  261. package/dist/development/chunk-FXH6PCLA.js +0 -188
  262. package/dist/development/chunk-INNQPBPI.js +0 -1366
  263. package/dist/development/chunk-NPZCI77A.js +0 -10307
  264. package/dist/development/chunk-YXISIC3F.mjs +0 -11606
  265. package/dist/development/context-CeD5LmaF.d.mts +0 -1779
  266. package/dist/development/data-CjO11-hU.d.ts +0 -1740
  267. package/dist/development/data-DEjBmEfD.d.mts +0 -1740
  268. package/dist/development/dom-export.d.mts +0 -172
  269. package/dist/development/dom-export.mjs +0 -1010
  270. package/dist/development/index-react-server-client-3ykjivgQ.d.ts +0 -3677
  271. package/dist/development/index-react-server-client-CACgcj2J.d.mts +0 -2614
  272. package/dist/development/index-react-server-client.d.mts +0 -4
  273. package/dist/development/index-react-server-client.mjs +0 -59
  274. package/dist/development/index-react-server.d.mts +0 -2711
  275. package/dist/development/index-react-server.mjs +0 -3821
  276. package/dist/development/index.d.mts +0 -1479
  277. package/dist/development/index.mjs +0 -275
  278. package/dist/development/instrumentation-Dkmpzd13.d.ts +0 -715
  279. package/dist/development/lib/types/internal.d.mts +0 -184
  280. package/dist/development/lib/types/internal.mjs +0 -10
  281. package/dist/development/register-CmkRspdl.d.mts +0 -30
  282. package/dist/production/browser-B2PdsXXH.d.ts +0 -318
  283. package/dist/production/browser-DBmQ1yAR.d.mts +0 -318
  284. package/dist/production/chunk-CTPMZNY4.mjs +0 -2535
  285. package/dist/production/chunk-EGIXHPKG.js +0 -10307
  286. package/dist/production/chunk-L4O4PVIV.js +0 -1366
  287. package/dist/production/chunk-OINPVNTA.js +0 -188
  288. package/dist/production/chunk-TPWBPI22.mjs +0 -11606
  289. package/dist/production/context-CeD5LmaF.d.mts +0 -1779
  290. package/dist/production/data-CjO11-hU.d.ts +0 -1740
  291. package/dist/production/data-DEjBmEfD.d.mts +0 -1740
  292. package/dist/production/dom-export.d.mts +0 -172
  293. package/dist/production/dom-export.mjs +0 -1010
  294. package/dist/production/index-react-server-client-3ykjivgQ.d.ts +0 -3677
  295. package/dist/production/index-react-server-client-CACgcj2J.d.mts +0 -2614
  296. package/dist/production/index-react-server-client.d.mts +0 -4
  297. package/dist/production/index-react-server-client.mjs +0 -59
  298. package/dist/production/index-react-server.d.mts +0 -2711
  299. package/dist/production/index-react-server.mjs +0 -3821
  300. package/dist/production/index.d.mts +0 -1479
  301. package/dist/production/index.mjs +0 -275
  302. package/dist/production/instrumentation-Dkmpzd13.d.ts +0 -715
  303. package/dist/production/lib/types/internal.d.mts +0 -184
  304. package/dist/production/lib/types/internal.mjs +0 -10
  305. package/dist/production/register-CmkRspdl.d.mts +0 -30
  306. package/docs/upgrading/remix.md +0 -403
  307. package/docs/upgrading/v6.md +0 -382
package/CHANGELOG.md CHANGED
@@ -1,5 +1,159 @@
1
1
  # `react-router`
2
2
 
3
+ ## v8.3.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Encode path params in `href`/`generatePath` per RFC 3986 path-segment rules instead of `encodeURIComponent` ([#15310](https://github.com/remix-run/react-router/pull/15310))
8
+ - Characters that are valid literally in a path segment (`$ & + , ; = : @` — RFC 3986 `pchar`) are no longer percent-encoded, so values like a semver build `1.0.0+1` interpolate unchanged instead of becoming `1.0.0%2B1`
9
+ - Structural/unsafe characters (`/ ? # %`, whitespace, non-ASCII) are still escaped exactly as before
10
+ - Use `crypto.randomUUID()` for `createMemorySessionStorage` session ids ([#15302](https://github.com/remix-run/react-router/pull/15302))
11
+ - `createMemorySessionStorage` is only intended for local development and testing - sessions are lost when the server restarts
12
+ - Fix `NavLink` not applying its `pending` state when `to` has a trailing slash ([#15300](https://github.com/remix-run/react-router/pull/15300))
13
+ - Preserve RSC route component metadata so routes with a `clientLoader` can skip unnecessary server requests once their components have rendered while still fetching missing server-rendered elements ([#15323](https://github.com/remix-run/react-router/pull/15323))
14
+ - Harden RSC CSRF code paths ([#15311](https://github.com/remix-run/react-router/pull/15311))
15
+ - Fix server crash (`TypeError: Invalid state: Unable to enqueue`) when a request is aborted while the RSC HTML stream has a pending flush ([#15286](https://github.com/remix-run/react-router/pull/15286))
16
+ - Handle cancellation of the `injectRSCPayload` readable side, clear the pending flush, and cancel the underlying RSC payload stream
17
+
18
+ ### Unstable Changes
19
+
20
+ ⚠️ _[Unstable features](https://reactrouter.com/community/api-development-strategy#unstable-flags) are not recommended for production use_
21
+
22
+ - Detect stale RSC clients during lazy route discovery and reload the destination document ([#15318](https://github.com/remix-run/react-router/pull/15318))
23
+
24
+ #### Migration
25
+
26
+ Apps using the default RSC Framework entry do not need to make any changes. Apps with a custom `entry.rsc.tsx` should import the generated client version and pass it to `unstable_matchRSCServerRequest`:
27
+
28
+ ```tsx
29
+ import clientVersion from "virtual:react-router/unstable_rsc/client-version";
30
+
31
+ return unstable_matchRSCServerRequest({
32
+ // ...
33
+ clientVersion,
34
+ });
35
+ ```
36
+
37
+ - Add CSP nonce support to RSC document rendering ([#15320](https://github.com/remix-run/react-router/pull/15320))
38
+ - Add `nonce` options to `unstable_routeRSCServerRequest` and `unstable_RSCStaticRouter`
39
+ - Forward the nonce to the HTML renderer and apply it to injected RSC payload scripts and nonce-aware framework components
40
+
41
+ To adopt nonce-based CSP, update your `entry.ssr.tsx` (run `react-router reveal entry.ssr` first in RSC Framework Mode) to generate a fresh nonce for each request. Pass it to `routeRSCServerRequest`, spread the `renderHTML` options into React's HTML renderer, pass `options.nonce` to `RSCStaticRouter`, and use the same nonce in the `Content-Security-Policy` response header:
42
+
43
+ ```tsx
44
+ const nonce = crypto.randomUUID();
45
+ const response = await routeRSCServerRequest({
46
+ request,
47
+ serverResponse,
48
+ createFromReadableStream,
49
+ nonce,
50
+ async renderHTML(getPayload, options) {
51
+ const payload = getPayload();
52
+ return renderHTMLToReadableStream(
53
+ <RSCStaticRouter getPayload={getPayload} nonce={options.nonce} />,
54
+ {
55
+ ...options,
56
+ bootstrapScriptContent,
57
+ formState: await payload.formState,
58
+ signal: request.signal,
59
+ },
60
+ );
61
+ },
62
+ });
63
+ response.headers.set(
64
+ "Content-Security-Policy",
65
+ `script-src 'self' 'nonce-${nonce}'`,
66
+ );
67
+ ```
68
+
69
+ ## v8.2.0
70
+
71
+ ### Patch Changes
72
+
73
+ - Fix `href()` to properly stringify and URL-encode param values, matching `generatePath()` ([#15277](https://github.com/remix-run/react-router/pull/15277))
74
+ - splat params preserve path separators while encoding each segment individually
75
+ - Fix dynamic param extraction for routes with optional static segments ([#15200](https://github.com/remix-run/react-router/pull/15200))
76
+ - When a route path contains optional static segments (e.g. `/school?/user/:id`), the internal regex's incorrectly shifted parameter indices resulting in incorrect parameter extraction
77
+ - Consecutive optional static segments (e.g. `/one?/two?`) were only partially handled
78
+ - Preserve navigation blocker state through a revalidation ([#15246](https://github.com/remix-run/react-router/pull/15246))
79
+ - Fix route ranking for dynamic parameters with static extension suffixes ([#15273](https://github.com/remix-run/react-router/pull/15273))
80
+ - These were not being detected as dynamic param segments and instead got incorrectly scored higher as a static segment
81
+ - This meant they could potentially tie truly static routes like `/sitemap.xml` and outrank them based on definition order
82
+ - These are now correctly identified as dynamic parameter segments and scored correctly
83
+ - Use ReactFormState types instead of unknown ([#15263](https://github.com/remix-run/react-router/pull/15263))
84
+
85
+ ## v8.1.0
86
+
87
+ ### Minor Changes
88
+
89
+ - Return route metadata from server request, client navigation, and client fetcher instrumentations ([#15235](https://github.com/remix-run/react-router/pull/15235))
90
+ - Adds result metadata after instrumented calls complete, including the URL, matched route pattern, and params
91
+ - Adds known HTTP status codes to server request handler instrumentation results
92
+
93
+ ## v8.0.1
94
+
95
+ ### Patch Changes
96
+
97
+ - 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))
98
+
99
+ ## v8.0.0
100
+
101
+ ### Major Changes
102
+
103
+ - Remove the `future.v8_trailingSlashAwareDataRequests` flag ([#15100](https://github.com/remix-run/react-router/pull/15100))
104
+ - Trailing slash-aware data request URLs are now the default behavior.
105
+ - Update `tsconfig.json` `target`/`lib` from `ES2020 -> ES2022` ([591853e](https://github.com/remix-run/react-router/commit/591853e))
106
+ - 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))
107
+ - 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))
108
+ - `Route.MetaArgs`, `Route.MetaMatch`, `MetaArgs`, `MetaMatch`, `Route.ComponentProps.matches`, `UIMatch`
109
+ - 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))
110
+ - Remove internal `hasErrorBoundary` field added to `router.routes` when using a data router ([#15074](https://github.com/remix-run/react-router/pull/15074))
111
+ - 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
112
+ - `hasErrorBoundary` is no longer accepted on `RouteObject` (`IndexRouteObject`/`NonIndexRouteObject`), `DataRouteObject`, `<Route>` JSX props, or as a key in `lazy` route definitions.
113
+ - The `MapRoutePropertiesFunction` signature no longer requires returning `hasErrorBoundary`; the router infers it directly.
114
+ - Remove `react-router-dom` package ([#15076](https://github.com/remix-run/react-router/pull/15076))
115
+ - In v7 everything DOM-specific was collapsed into `react-router/dom`
116
+ - `react-router-dom` was kept around as a convenience so existing v6 app imports would still work
117
+ - For v8, you will need to swap `react-router-dom` imports:
118
+ - `RouterProvider`/`HydratedRouter` should be imported from `react-router/dom`
119
+ - Everything else should be imported from `react-router`
120
+ - Remove `future.v8_middleware` flag — middleware is always enabled in v8 ([#15078](https://github.com/remix-run/react-router/pull/15078))
121
+ - The `future.v8_middleware` flag has been removed; middleware is now always enabled
122
+ - The `context` parameter passed to `loader`, `action`, and `middleware` functions is always a `RouterContextProvider` instance
123
+ - `getLoadContext` functions in custom servers must return a `RouterContextProvider` — returning a plain object is no longer supported
124
+ - The `MiddlewareEnabled` type (previously exported as `UNSAFE_MiddlewareEnabled`) has been removed since the conditional it gated is now unconditional
125
+ - The `Future` module augmentation pattern (`interface Future { v8_middleware: true }`) is no longer needed to type `context` in Data Mode
126
+ - Update minimum Node version to 22.22.0 ([#14928](https://github.com/remix-run/react-router/pull/14928))
127
+ - Update minimum React version to 19.2.7 ([#15062](https://github.com/remix-run/react-router/pull/15062))
128
+
129
+ ### Minor Changes
130
+
131
+ - Bump dependencies ([#15080](https://github.com/remix-run/react-router/pull/15080))
132
+ - Bumped `cookie` from `^1.0.1` to `^1.1.1`
133
+ - Bumped `set-cookie-parser` from `^2.6.0` to `^3.1.0`
134
+
135
+ ### Patch Changes
136
+
137
+ - Ensure client middleware errors load lazy route error boundaries before bubbling ([#15086](https://github.com/remix-run/react-router/pull/15086))
138
+ - 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))
139
+ - 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))
140
+ - Updated package TypeScript configs to support modern module syntax used by the build configuration.
141
+ - 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))
142
+ - 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))
143
+
144
+ ## v7.18.0
145
+
146
+ ### Patch Changes
147
+
148
+ - 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))
149
+ - 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))
150
+ - Use `turbo-stream` to serialize and deserialize Framework Mode hydration errors ([#15175](https://github.com/remix-run/react-router/pull/15175))
151
+ - Precompute route branch matchers to avoid recompiling route path regexes during matching ([#15186](https://github.com/remix-run/react-router/pull/15186))
152
+ - Use the constructed request URL host when validating action request origins. ([#15185](https://github.com/remix-run/react-router/pull/15185))
153
+ - 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))
154
+ - Validate protocols in RSC render redirects ([#15177](https://github.com/remix-run/react-router/pull/15177))
155
+ - Consolidate url normalization logic and better handle mixed slashes ([#15176](https://github.com/remix-run/react-router/pull/15176))
156
+
3
157
  ## v7.17.0
4
158
 
5
159
  ### 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 };