react-router 7.13.0 → 7.13.1

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 (68) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/dist/development/{browser-BEPxnEBW.d.mts → browser-DzsJABDQ.d.mts} +3 -2
  3. package/dist/{production/browser-BEPxnEBW.d.mts → development/browser-sPQ7eaK4.d.ts} +3 -2
  4. package/dist/development/{chunk-HMDR2CVH.js → chunk-2YMDXNOJ.js} +124 -107
  5. package/dist/{production/chunk-GSFLVUYQ.mjs → development/chunk-JPUPSTYD.mjs} +13 -4
  6. package/dist/{production/chunk-NGWWS4QJ.js → development/chunk-KSEWV2VO.js} +7 -7
  7. package/dist/development/{chunk-JZWAC4HX.mjs → chunk-LFPYN7LY.mjs} +153 -63
  8. package/dist/development/{chunk-WICQJKU6.js → chunk-XOLAXE2Z.js} +203 -128
  9. package/dist/development/dom-export.d.mts +2 -2
  10. package/dist/development/dom-export.d.ts +2 -2
  11. package/dist/development/dom-export.js +34 -27
  12. package/dist/development/dom-export.mjs +10 -3
  13. package/dist/development/{index-react-server-client-1TI9M9o1.d.ts → index-react-server-client-C4tCIird.d.ts} +54 -2
  14. package/dist/development/{index-react-server-client-MKTlCGL3.d.mts → index-react-server-client-EzWJGpN_.d.mts} +54 -2
  15. package/dist/development/index-react-server-client.d.mts +2 -2
  16. package/dist/development/index-react-server-client.d.ts +2 -2
  17. package/dist/development/index-react-server-client.js +4 -4
  18. package/dist/development/index-react-server-client.mjs +2 -2
  19. package/dist/development/index-react-server.d.mts +12 -1
  20. package/dist/development/index-react-server.d.ts +12 -1
  21. package/dist/development/index-react-server.js +80 -44
  22. package/dist/development/index-react-server.mjs +80 -45
  23. package/dist/development/index.d.mts +11 -10
  24. package/dist/development/index.d.ts +11 -10
  25. package/dist/development/index.js +94 -85
  26. package/dist/development/index.mjs +3 -3
  27. package/dist/{production/instrumentation-DvHY1sgY.d.ts → development/instrumentation--6Pioq_G.d.ts} +14 -2
  28. package/dist/development/lib/types/internal.d.mts +4 -4
  29. package/dist/development/lib/types/internal.d.ts +4 -4
  30. package/dist/development/lib/types/internal.js +1 -1
  31. package/dist/development/lib/types/internal.mjs +1 -1
  32. package/dist/development/{register-Bm80E9qL.d.ts → register-CBoanF80.d.ts} +1 -1
  33. package/dist/development/{register-CS_tiXsm.d.mts → register-cRYJ3CjG.d.mts} +1 -1
  34. package/dist/{production/router-5iOvts3c.d.mts → development/router-cLsU7kHk.d.mts} +14 -2
  35. package/dist/{development/browser-CJ9_du-U.d.ts → production/browser-DzsJABDQ.d.mts} +3 -2
  36. package/dist/production/{browser-CJ9_du-U.d.ts → browser-sPQ7eaK4.d.ts} +3 -2
  37. package/dist/production/{chunk-QSNCZFX5.js → chunk-772H4TVR.js} +203 -128
  38. package/dist/production/{chunk-N2HZAAIG.js → chunk-B5UMK6O7.js} +124 -107
  39. package/dist/production/{chunk-Y3R63HEB.mjs → chunk-RJCJ3EYF.mjs} +153 -63
  40. package/dist/{development/chunk-4LKRSAEJ.mjs → production/chunk-TXB4YXR2.mjs} +13 -4
  41. package/dist/{development/chunk-7PAHGFS4.js → production/chunk-ZJMCM6KT.js} +7 -7
  42. package/dist/production/dom-export.d.mts +2 -2
  43. package/dist/production/dom-export.d.ts +2 -2
  44. package/dist/production/dom-export.js +34 -27
  45. package/dist/production/dom-export.mjs +10 -3
  46. package/dist/production/{index-react-server-client-1TI9M9o1.d.ts → index-react-server-client-C4tCIird.d.ts} +54 -2
  47. package/dist/production/{index-react-server-client-MKTlCGL3.d.mts → index-react-server-client-EzWJGpN_.d.mts} +54 -2
  48. package/dist/production/index-react-server-client.d.mts +2 -2
  49. package/dist/production/index-react-server-client.d.ts +2 -2
  50. package/dist/production/index-react-server-client.js +4 -4
  51. package/dist/production/index-react-server-client.mjs +2 -2
  52. package/dist/production/index-react-server.d.mts +12 -1
  53. package/dist/production/index-react-server.d.ts +12 -1
  54. package/dist/production/index-react-server.js +80 -44
  55. package/dist/production/index-react-server.mjs +80 -45
  56. package/dist/production/index.d.mts +11 -10
  57. package/dist/production/index.d.ts +11 -10
  58. package/dist/production/index.js +94 -85
  59. package/dist/production/index.mjs +3 -3
  60. package/dist/{development/instrumentation-DvHY1sgY.d.ts → production/instrumentation--6Pioq_G.d.ts} +14 -2
  61. package/dist/production/lib/types/internal.d.mts +4 -4
  62. package/dist/production/lib/types/internal.d.ts +4 -4
  63. package/dist/production/lib/types/internal.js +1 -1
  64. package/dist/production/lib/types/internal.mjs +1 -1
  65. package/dist/production/{register-Bm80E9qL.d.ts → register-CBoanF80.d.ts} +1 -1
  66. package/dist/production/{register-CS_tiXsm.d.mts → register-cRYJ3CjG.d.mts} +1 -1
  67. package/dist/{development/router-5iOvts3c.d.mts → production/router-cLsU7kHk.d.mts} +14 -2
  68. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,74 @@
1
1
  # `react-router`
2
2
 
3
+ ## 7.13.1
4
+
5
+ ### Patch Changes
6
+
7
+ - fix null reference exception in bad codepath leading to invalid route tree comparisons ([#14780](https://github.com/remix-run/react-router/pull/14780))
8
+
9
+ - fix: clear timeout when turbo-stream encoding completes ([#14810](https://github.com/remix-run/react-router/pull/14810))
10
+
11
+ - Improve error message when Origin header is invalid ([#14743](https://github.com/remix-run/react-router/pull/14743))
12
+
13
+ - Fix matchPath optional params matching without a "/" separator. ([#14689](https://github.com/remix-run/react-router/pull/14689))
14
+ - matchPath("/users/:id?", "/usersblah") now returns null.
15
+ - matchPath("/test\_route/:part?", "/test\_route\_more") now returns null.
16
+
17
+ - add RSC unstable\_getRequest ([#14758](https://github.com/remix-run/react-router/pull/14758))
18
+
19
+ - Fix `HydrateFallback` rendering during initial lazy route discovery with matching splat route ([#14740](https://github.com/remix-run/react-router/pull/14740))
20
+
21
+ - \[UNSTABLE] Add support for `<Link unstable_mask>` in Data Mode which allows users to navigate to a URL in the router but "mask" the URL displayed in the browser. This is useful for contextual routing usages such as displaying an image in a model on top of a gallery, but displaying a browser URL directly to the image that can be shared and loaded without the contextual gallery in the background. ([#14716](https://github.com/remix-run/react-router/pull/14716))
22
+
23
+ ```tsx
24
+ // routes/gallery.tsx
25
+ export function clientLoader({ request }: Route.LoaderArgs) {
26
+ let sp = new URL(request.url).searchParams;
27
+ return {
28
+ images: getImages(),
29
+ // When the router location has the image param, load the modal data
30
+ modalImage: sp.has("image") ? getImage(sp.get("image")!) : null,
31
+ };
32
+ }
33
+
34
+ export default function Gallery({ loaderData }: Route.ComponentProps) {
35
+ return (
36
+ <>
37
+ <GalleryGrid>
38
+ {loaderData.images.map((image) => (
39
+ <Link
40
+ key={image.id}
41
+ {/* Navigate the router to /galley?image=N */}}
42
+ to={`/gallery?image=${image.id}`}
43
+ {/* But display /images/N in the URL bar */}}
44
+ unstable_mask={`/images/${image.id}`}
45
+ >
46
+ <img src={image.url} alt={image.alt} />
47
+ </Link>
48
+ ))}
49
+ </GalleryGrid>
50
+
51
+ {/* When the modal data exists, display the modal */}
52
+ {data.modalImage ? (
53
+ <dialog open>
54
+ <img src={data.modalImage.url} alt={data.modalImage.alt} />
55
+ </dialog>
56
+ ) : null}
57
+ </>
58
+ );
59
+ }
60
+ ```
61
+
62
+ Notes:
63
+
64
+ - The masked location, if present, will be available on `useLocation().unstable_mask` so you can detect whether you are currently masked or not.
65
+ - Masked URLs only work for SPA use cases, and will be removed from `history.state` during SSR.
66
+ - This provides a first-class API to mask URLs in Data Mode to achieve the same behavior you could do in Declarative Mode via [manual `backgroundLocation` management](https://github.com/remix-run/react-router/tree/main/examples/modal).
67
+
68
+ - RSC: Update failed origin checks to return a 400 status and appropriate UI instead of a generic 500 ([#14755](https://github.com/remix-run/react-router/pull/14755))
69
+
70
+ - Preserve query parameters and hash on manifest version mismatch reload ([#14813](https://github.com/remix-run/react-router/pull/14813))
71
+
3
72
  ## 7.13.0
4
73
 
5
74
  ### Minor Changes
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
- 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, e as RouterInit } from './router-5iOvts3c.mjs';
2
+ 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, e as RouterInit } from './router-cLsU7kHk.mjs';
3
3
 
4
+ declare function getRequest(): Request;
4
5
  type RSCRouteConfigEntryBase = {
5
6
  action?: ActionFunction;
6
7
  clientAction?: ClientActionFunction;
@@ -310,4 +311,4 @@ interface RSCHydratedRouterProps {
310
311
  */
311
312
  declare function RSCHydratedRouter({ createFromReadableStream, fetch: fetchImplementation, payload, routeDiscovery, getContext, }: RSCHydratedRouterProps): React.JSX.Element;
312
313
 
313
- 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, type RSCHydratedRouterProps as g, type RSCMatch as h, type RSCRouteManifest as i, type RSCRouteMatch as j, type RSCRouteConfigEntry as k, type RSCRouteConfig as l, matchRSCServerRequest as m };
314
+ 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,6 +1,7 @@
1
1
  import * as React from 'react';
2
- 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, e as RouterInit } from './router-5iOvts3c.mjs';
2
+ 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, e as RouterInit } from './instrumentation--6Pioq_G.js';
3
3
 
4
+ declare function getRequest(): Request;
4
5
  type RSCRouteConfigEntryBase = {
5
6
  action?: ActionFunction;
6
7
  clientAction?: ClientActionFunction;
@@ -310,4 +311,4 @@ interface RSCHydratedRouterProps {
310
311
  */
311
312
  declare function RSCHydratedRouter({ createFromReadableStream, fetch: fetchImplementation, payload, routeDiscovery, getContext, }: RSCHydratedRouterProps): React.JSX.Element;
312
313
 
313
- 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, type RSCHydratedRouterProps as g, type RSCMatch as h, type RSCRouteManifest as i, type RSCRouteMatch as j, type RSCRouteConfigEntry as k, type RSCRouteConfig as l, matchRSCServerRequest as m };
314
+ 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 };