react-router 7.13.0 → 7.13.1-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 (68) hide show
  1. package/CHANGELOG.md +70 -20
  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/{production/chunk-GSFLVUYQ.mjs → development/chunk-BPFEYQ6M.mjs} +13 -4
  5. package/dist/{production/chunk-NGWWS4QJ.js → development/chunk-CGPAOPIJ.js} +7 -7
  6. package/dist/development/{chunk-WICQJKU6.js → chunk-LF5SS6XE.js} +203 -128
  7. package/dist/development/{chunk-HMDR2CVH.js → chunk-TC44ITIJ.js} +124 -107
  8. package/dist/development/{chunk-JZWAC4HX.mjs → chunk-WQZSGSJA.mjs} +153 -63
  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-Y3R63HEB.mjs → chunk-2K4LVAAG.mjs} +153 -63
  38. package/dist/{development/chunk-7PAHGFS4.js → production/chunk-I63A6YSE.js} +7 -7
  39. package/dist/{development/chunk-4LKRSAEJ.mjs → production/chunk-ROHSFSEU.mjs} +13 -4
  40. package/dist/production/{chunk-QSNCZFX5.js → chunk-XCKC4VBJ.js} +203 -128
  41. package/dist/production/{chunk-N2HZAAIG.js → chunk-ZXYVKLN7.js} +124 -107
  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,67 @@
1
1
  # `react-router`
2
2
 
3
+ ## 7.13.1-pre.0
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
+ - fix: clear timeout when turbo-stream encoding completes ([#14810](https://github.com/remix-run/react-router/pull/14810))
9
+ - Improve error message when Origin header is invalid ([#14743](https://github.com/remix-run/react-router/pull/14743))
10
+ - Fix matchPath optional params matching without a "/" separator. ([#14689](https://github.com/remix-run/react-router/pull/14689))
11
+ - matchPath("/users/:id?", "/usersblah") now returns null.
12
+ - matchPath("/test_route/:part?", "/test_route_more") now returns null.
13
+
14
+ - add RSC unstable_getRequest ([#14758](https://github.com/remix-run/react-router/pull/14758))
15
+ - Fix `HydrateFallback` rendering during initial lazy route discovery with matching splat route ([#14740](https://github.com/remix-run/react-router/pull/14740))
16
+ - [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))
17
+
18
+ ```tsx
19
+ // routes/gallery.tsx
20
+ export function clientLoader({ request }: Route.LoaderArgs) {
21
+ let sp = new URL(request.url).searchParams;
22
+ return {
23
+ images: getImages(),
24
+ // When the router location has the image param, load the modal data
25
+ modalImage: sp.has("image") ? getImage(sp.get("image")!) : null,
26
+ };
27
+ }
28
+
29
+ export default function Gallery({ loaderData }: Route.ComponentProps) {
30
+ return (
31
+ <>
32
+ <GalleryGrid>
33
+ {loaderData.images.map((image) => (
34
+ <Link
35
+ key={image.id}
36
+ {/* Navigate the router to /galley?image=N */}}
37
+ to={`/gallery?image=${image.id}`}
38
+ {/* But display /images/N in the URL bar */}}
39
+ unstable_mask={`/images/${image.id}`}
40
+ >
41
+ <img src={image.url} alt={image.alt} />
42
+ </Link>
43
+ ))}
44
+ </GalleryGrid>
45
+
46
+ {/* When the modal data exists, display the modal */}
47
+ {data.modalImage ? (
48
+ <dialog open>
49
+ <img src={data.modalImage.url} alt={data.modalImage.alt} />
50
+ </dialog>
51
+ ) : null}
52
+ </>
53
+ );
54
+ }
55
+ ```
56
+
57
+ Notes:
58
+ - The masked location, if present, will be available on `useLocation().unstable_mask` so you can detect whether you are currently masked or not.
59
+ - Masked URLs only work for SPA use cases, and will be removed from `history.state` during SSR.
60
+ - 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).
61
+
62
+ - 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))
63
+ - Preserve query parameters and hash on manifest version mismatch reload ([#14813](https://github.com/remix-run/react-router/pull/14813))
64
+
3
65
  ## 7.13.0
4
66
 
5
67
  ### Minor Changes
@@ -37,25 +99,25 @@
37
99
 
38
100
  | URL `/a/b/c` | **HTTP pathname** | **`request` pathname\`** |
39
101
  | ------------ | ----------------- | ------------------------ |
40
- | **Document** | `/a/b/c` | `/a/b/c` ✅ |
41
- | **Data** | `/a/b/c.data` | `/a/b/c` ✅ |
102
+ | **Document** | `/a/b/c` | `/a/b/c` ✅ |
103
+ | **Data** | `/a/b/c.data` | `/a/b/c` ✅ |
42
104
 
43
105
  | URL `/a/b/c/` | **HTTP pathname** | **`request` pathname\`** |
44
106
  | ------------- | ----------------- | ------------------------ |
45
- | **Document** | `/a/b/c/` | `/a/b/c/` ✅ |
107
+ | **Document** | `/a/b/c/` | `/a/b/c/` ✅ |
46
108
  | **Data** | `/a/b/c.data` | `/a/b/c` ⚠️ |
47
109
 
48
110
  With this flag enabled, these pathnames will be made consistent though a new `_.data` format for client-side `.data` requests:
49
111
 
50
112
  | URL `/a/b/c` | **HTTP pathname** | **`request` pathname\`** |
51
113
  | ------------ | ----------------- | ------------------------ |
52
- | **Document** | `/a/b/c` | `/a/b/c` ✅ |
53
- | **Data** | `/a/b/c.data` | `/a/b/c` ✅ |
114
+ | **Document** | `/a/b/c` | `/a/b/c` ✅ |
115
+ | **Data** | `/a/b/c.data` | `/a/b/c` ✅ |
54
116
 
55
117
  | URL `/a/b/c/` | **HTTP pathname** | **`request` pathname\`** |
56
118
  | ------------- | ------------------ | ------------------------ |
57
- | **Document** | `/a/b/c/` | `/a/b/c/` ✅ |
58
- | **Data** | `/a/b/c/_.data` ⬅️ | `/a/b/c/` ✅ |
119
+ | **Document** | `/a/b/c/` | `/a/b/c/` ✅ |
120
+ | **Data** | `/a/b/c/_.data` ⬅️ | `/a/b/c/` ✅ |
59
121
 
60
122
  This a bug fix but we are putting it behind an opt-in flag because it has the potential to be a "breaking bug fix" if you are relying on the URL format for any other application or caching logic.
61
123
 
@@ -82,14 +144,12 @@
82
144
  - \[UNSTABLE] Add a new `unstable_defaultShouldRevalidate` flag to various APIs to allow opt-ing out of standard revalidation behaviors. ([#14542](https://github.com/remix-run/react-router/pull/14542))
83
145
 
84
146
  If active routes include a `shouldRevalidate` function, then your value will be passed as `defaultShouldRevalidate` in those function so that the route always has the final revalidation determination.
85
-
86
147
  - `<Form method="post" unstable_defaultShouldRevalidate={false}>`
87
148
  - `submit(data, { method: "post", unstable_defaultShouldRevalidate: false })`
88
149
  - `<fetcher.Form method="post" unstable_defaultShouldRevalidate={false}>`
89
150
  - `fetcher.submit(data, { method: "post", unstable_defaultShouldRevalidate: false })`
90
151
 
91
152
  This is also available on non-submission APIs that may trigger revalidations due to changing search params:
92
-
93
153
  - `<Link to="/" unstable_defaultShouldRevalidate={false}>`
94
154
  - `navigate("/?foo=bar", { unstable_defaultShouldRevalidate: false })`
95
155
  - `setSearchParams(params, { unstable_defaultShouldRevalidate: false })`
@@ -112,7 +172,6 @@
112
172
  - ⚠️ This is a breaking change if you have begun using `fetcher.unstable_reset()`
113
173
 
114
174
  - Stabilize the `dataStrategy` `match.shouldRevalidateArgs`/`match.shouldCallHandler()` APIs. ([#14592](https://github.com/remix-run/react-router/pull/14592))
115
-
116
175
  - The `match.shouldLoad` API is now marked deprecated in favor of these more powerful alternatives
117
176
 
118
177
  - If you're using this API in a custom `dataStrategy` today, you can swap to the new API at your convenience:
@@ -241,7 +300,6 @@
241
300
  - Ensure action handlers run for routes with middleware even if no loader is present ([#14443](https://github.com/remix-run/react-router/pull/14443))
242
301
 
243
302
  - Add `unstable_instrumentations` API to allow users to add observablity to their apps by instrumenting route loaders, actions, middlewares, lazy, as well as server-side request handlers and client side navigations/fetches ([#14412](https://github.com/remix-run/react-router/pull/14412))
244
-
245
303
  - Framework Mode:
246
304
  - `entry.server.tsx`: `export const unstable_instrumentations = [...]`
247
305
  - `entry.client.tsx`: `<HydratedRouter unstable_instrumentations={[...]} />`
@@ -403,7 +461,6 @@
403
461
  - Stabilize middleware and context APIs. ([#14215](https://github.com/remix-run/react-router/pull/14215))
404
462
 
405
463
  We have removed the `unstable_` prefix from the following APIs and they are now considered stable and ready for production use:
406
-
407
464
  - [`RouterContextProvider`](https://reactrouter.com/api/utils/RouterContextProvider)
408
465
  - [`createContext`](https://reactrouter.com/api/utils/createContext)
409
466
  - `createBrowserRouter` [`getContext`](https://reactrouter.com/api/data-routers/createBrowserRouter#optsgetcontext) option
@@ -430,7 +487,7 @@
430
487
 
431
488
  - \[UNSTABLE] Add `<RouterProvider unstable_onError>`/`<HydratedRouter unstable_onError>` prop for client side error reporting ([#14162](https://github.com/remix-run/react-router/pull/14162))
432
489
 
433
- - server action revalidation opt out via $SKIP\_REVALIDATION field ([#14154](https://github.com/remix-run/react-router/pull/14154))
490
+ - server action revalidation opt out via $SKIP_REVALIDATION field ([#14154](https://github.com/remix-run/react-router/pull/14154))
434
491
 
435
492
  - Properly escape interpolated param values in `generatePath()` ([#13530](https://github.com/remix-run/react-router/pull/13530))
436
493
 
@@ -479,7 +536,6 @@
479
536
  - Remove dependency on `@types/node` in TypeScript declaration files ([#14059](https://github.com/remix-run/react-router/pull/14059))
480
537
 
481
538
  - Fix types for `UIMatch` to reflect that the `loaderData`/`data` properties may be `undefined` ([#12206](https://github.com/remix-run/react-router/pull/12206))
482
-
483
539
  - When an `ErrorBoundary` is being rendered, not all active matches will have loader data available, since it may have been their `loader` that threw to trigger the boundary
484
540
  - The `UIMatch.data` type was not correctly handing this and would always reflect the presence of data, leading to the unexpected runtime errors when an `ErrorBoundary` was rendered
485
541
  - ⚠️ This may cause some type errors to show up in your code for unguarded `match.data` accesses - you should properly guard for `undefined` values in those scenarios.
@@ -513,7 +569,6 @@
513
569
  - \[UNSTABLE] When middleware is enabled, make the `context` parameter read-only (via `Readonly<unstable_RouterContextProvider>`) so that TypeScript will not allow you to write arbitrary fields to it in loaders, actions, or middleware. ([#14097](https://github.com/remix-run/react-router/pull/14097))
514
570
 
515
571
  - \[UNSTABLE] Rename and alter the signature/functionality of the `unstable_respond` API in `staticHandler.query`/`staticHandler.queryRoute` ([#14103](https://github.com/remix-run/react-router/pull/14103))
516
-
517
572
  - The API has been renamed to `unstable_generateMiddlewareResponse` for clarity
518
573
  - The main functional change is that instead of running the loaders/actions before calling `unstable_respond` and handing you the result, we now pass a `query`/`queryRoute` function as a parameter and you execute the loaders/actions inside your callback, giving you full access to pre-processing and error handling
519
574
  - The `query` version of the API now has a signature of `(query: (r: Request) => Promise<StaticHandlerContext | Response>) => Promise<Response>`
@@ -1159,7 +1214,6 @@
1159
1214
  ```
1160
1215
 
1161
1216
  Similar to server-side requests, a fresh `context` will be created per navigation (or `fetcher` call). If you have initial data you'd like to populate in the context for every request, you can provide an `unstable_getContext` function at the root of your app:
1162
-
1163
1217
  - Library mode - `createBrowserRouter(routes, { unstable_getContext })`
1164
1218
  - Framework mode - `<HydratedRouter unstable_getContext>`
1165
1219
 
@@ -1347,7 +1401,6 @@ _No changes_
1347
1401
  - Remove `future.v7_normalizeFormMethod` future flag ([#11697](https://github.com/remix-run/react-router/pull/11697))
1348
1402
 
1349
1403
  - For Remix consumers migrating to React Router, the `crypto` global from the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) is now required when using cookie and session APIs. This means that the following APIs are provided from `react-router` rather than platform-specific packages: ([#11837](https://github.com/remix-run/react-router/pull/11837))
1350
-
1351
1404
  - `createCookie`
1352
1405
  - `createCookieSessionStorage`
1353
1406
  - `createMemorySessionStorage`
@@ -1356,7 +1409,6 @@ _No changes_
1356
1409
  For consumers running older versions of Node, the `installGlobals` function from `@remix-run/node` has been updated to define `globalThis.crypto`, using [Node's `require('node:crypto').webcrypto` implementation.](https://nodejs.org/api/webcrypto.html)
1357
1410
 
1358
1411
  Since platform-specific packages no longer need to implement this API, the following low-level APIs have been removed:
1359
-
1360
1412
  - `createCookieFactory`
1361
1413
  - `createSessionStorageFactory`
1362
1414
  - `createCookieSessionStorageFactory`
@@ -1512,7 +1564,6 @@ _No changes_
1512
1564
  ```
1513
1565
 
1514
1566
  This initial implementation targets type inference for:
1515
-
1516
1567
  - `Params` : Path parameters from your routing config in `routes.ts` including file-based routing
1517
1568
  - `LoaderData` : Loader data from `loader` and/or `clientLoader` within your route module
1518
1569
  - `ActionData` : Action data from `action` and/or `clientAction` within your route module
@@ -1527,7 +1578,6 @@ _No changes_
1527
1578
  ```
1528
1579
 
1529
1580
  Check out our docs for more:
1530
-
1531
1581
  - [_Explanations > Type Safety_](https://reactrouter.com/dev/guides/explanation/type-safety)
1532
1582
  - [_How-To > Setting up type safety_](https://reactrouter.com/dev/guides/how-to/setting-up-type-safety)
1533
1583
 
@@ -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 };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.13.0
2
+ * react-router v7.13.1-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -51,7 +51,7 @@ import {
51
51
  withComponentProps,
52
52
  withErrorBoundaryProps,
53
53
  withHydrateFallbackProps
54
- } from "./chunk-Y3R63HEB.mjs";
54
+ } from "./chunk-WQZSGSJA.mjs";
55
55
 
56
56
  // lib/dom/ssr/server.tsx
57
57
  import * as React from "react";
@@ -758,7 +758,14 @@ function prependCookies(parentHeaders, childHeaders) {
758
758
  // lib/actions.ts
759
759
  function throwIfPotentialCSRFAttack(headers, allowedActionOrigins) {
760
760
  let originHeader = headers.get("origin");
761
- let originDomain = typeof originHeader === "string" && originHeader !== "null" ? new URL(originHeader).host : originHeader;
761
+ let originDomain = null;
762
+ try {
763
+ originDomain = typeof originHeader === "string" && originHeader !== "null" ? new URL(originHeader).host : originHeader;
764
+ } catch {
765
+ throw new Error(
766
+ `\`origin\` header is not a valid URL. Aborting the action.`
767
+ );
768
+ }
762
769
  let host = parseHostHeader(headers);
763
770
  if (originDomain && (!host || originDomain !== host.value)) {
764
771
  if (!isAllowedOrigin(originDomain, allowedActionOrigins)) {
@@ -1049,9 +1056,11 @@ function encodeViaTurboStream(data2, requestSignal, streamTimeout, serverMode) {
1049
1056
  () => controller.abort(new Error("Server Timeout")),
1050
1057
  typeof streamTimeout === "number" ? streamTimeout : 4950
1051
1058
  );
1052
- requestSignal.addEventListener("abort", () => clearTimeout(timeoutId));
1059
+ let clearStreamTimeout = () => clearTimeout(timeoutId);
1060
+ requestSignal.addEventListener("abort", clearStreamTimeout);
1053
1061
  return encode(data2, {
1054
1062
  signal: controller.signal,
1063
+ onComplete: clearStreamTimeout,
1055
1064
  plugins: [
1056
1065
  (value) => {
1057
1066
  if (value instanceof Error) {
@@ -1,5 +1,5 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/**
2
- * react-router v7.13.0
2
+ * react-router v7.13.1-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -14,7 +14,7 @@
14
14
 
15
15
 
16
16
 
17
- var _chunkQSNCZFX5js = require('./chunk-QSNCZFX5.js');
17
+ var _chunkLF5SS6XEjs = require('./chunk-LF5SS6XE.js');
18
18
 
19
19
  // lib/dom/ssr/hydration.tsx
20
20
  function getHydrationData({
@@ -29,12 +29,12 @@ function getHydrationData({
29
29
  ...state,
30
30
  loaderData: { ...state.loaderData }
31
31
  };
32
- let initialMatches = _chunkQSNCZFX5js.matchRoutes.call(void 0, routes, location, basename);
32
+ let initialMatches = _chunkLF5SS6XEjs.matchRoutes.call(void 0, routes, location, basename);
33
33
  if (initialMatches) {
34
34
  for (let match of initialMatches) {
35
35
  let routeId = match.route.id;
36
36
  let routeInfo = getRouteInfo(routeId);
37
- if (_chunkQSNCZFX5js.shouldHydrateRouteLoader.call(void 0,
37
+ if (_chunkLF5SS6XEjs.shouldHydrateRouteLoader.call(void 0,
38
38
  routeId,
39
39
  routeInfo.clientLoader,
40
40
  routeInfo.hasLoader,
@@ -112,7 +112,7 @@ function RSCDefaultRootErrorBoundaryImpl({
112
112
  }
113
113
  }
114
114
  );
115
- if (_chunkQSNCZFX5js.isRouteErrorResponse.call(void 0, error)) {
115
+ if (_chunkLF5SS6XEjs.isRouteErrorResponse.call(void 0, error)) {
116
116
  return /* @__PURE__ */ _react2.default.createElement(
117
117
  ErrorWrapper,
118
118
  {
@@ -120,7 +120,7 @@ function RSCDefaultRootErrorBoundaryImpl({
120
120
  title: "Unhandled Thrown Response!"
121
121
  },
122
122
  /* @__PURE__ */ _react2.default.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText),
123
- _chunkQSNCZFX5js.ENABLE_DEV_WARNINGS ? heyDeveloper : null
123
+ _chunkLF5SS6XEjs.ENABLE_DEV_WARNINGS ? heyDeveloper : null
124
124
  );
125
125
  }
126
126
  let errorInstance;
@@ -146,7 +146,7 @@ function RSCDefaultRootErrorBoundaryImpl({
146
146
  function RSCDefaultRootErrorBoundary({
147
147
  hasRootLayout
148
148
  }) {
149
- let error = _chunkQSNCZFX5js.useRouteError.call(void 0, );
149
+ let error = _chunkLF5SS6XEjs.useRouteError.call(void 0, );
150
150
  if (hasRootLayout === void 0) {
151
151
  throw new Error("Missing 'hasRootLayout' prop");
152
152
  }