react-router 7.17.0 → 7.18.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.
- package/CHANGELOG.md +13 -1
- package/dist/development/{browser-D3uq9sI1.d.ts → browser-B2PdsXXH.d.ts} +2 -2
- package/dist/development/{browser-CGcs-0pD.d.mts → browser-DBmQ1yAR.d.mts} +2 -2
- package/dist/development/{chunk-6CSD65Y2.mjs → chunk-4ZMWKKQ3.mjs} +115 -38
- package/dist/{production/chunk-5TQZEVD5.mjs → development/chunk-E4MTK73K.mjs} +45 -113
- package/dist/development/{chunk-KFNXW4AL.js → chunk-U7ORXROY.js} +113 -35
- package/dist/development/{chunk-PBLBZ3QU.js → chunk-WW7PN6QI.js} +7 -7
- package/dist/development/{chunk-PULC7NLK.js → chunk-YL5M26XI.js} +111 -108
- package/dist/{production/context-CmHpk1Ws.d.mts → development/context-CeD5LmaF.d.mts} +12 -4
- package/dist/{production/data-D4xhSy90.d.ts → development/data-CjO11-hU.d.ts} +9 -1
- package/dist/development/{data-U8FS-wNn.d.mts → data-DEjBmEfD.d.mts} +9 -1
- package/dist/development/dom-export.d.mts +3 -3
- package/dist/development/dom-export.d.ts +3 -3
- package/dist/development/dom-export.js +46 -44
- package/dist/development/dom-export.mjs +23 -21
- package/dist/development/{index-react-server-client-CwU9bE5R.d.ts → index-react-server-client-3ykjivgQ.d.ts} +29 -7
- package/dist/development/{index-react-server-client-DPrDrCew.d.mts → index-react-server-client-CACgcj2J.d.mts} +19 -5
- package/dist/development/index-react-server-client.d.mts +3 -3
- package/dist/development/index-react-server-client.d.ts +3 -3
- package/dist/development/index-react-server-client.js +4 -4
- package/dist/development/index-react-server-client.mjs +2 -2
- package/dist/development/index-react-server.d.mts +9 -1
- package/dist/development/index-react-server.d.ts +9 -1
- package/dist/development/index-react-server.js +144 -121
- package/dist/development/index-react-server.mjs +143 -120
- package/dist/development/index.d.mts +15 -14
- package/dist/development/index.d.ts +15 -14
- package/dist/development/index.js +137 -205
- package/dist/development/index.mjs +3 -5
- package/dist/{production/instrumentation-1q4YhLGP.d.ts → development/instrumentation-Dkmpzd13.d.ts} +2 -2
- package/dist/development/lib/types/internal.d.mts +2 -2
- package/dist/development/lib/types/internal.d.ts +2 -2
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/development/{register-CqK96Zfk.d.mts → register-CmkRspdl.d.mts} +1 -1
- package/dist/development/{register-CNAx3TXj.d.ts → register-roq_0qYo.d.ts} +1 -1
- package/dist/production/{browser-D3uq9sI1.d.ts → browser-B2PdsXXH.d.ts} +2 -2
- package/dist/production/{browser-CGcs-0pD.d.mts → browser-DBmQ1yAR.d.mts} +2 -2
- package/dist/production/{chunk-CTIXC7EV.js → chunk-3Z6WS2WZ.js} +7 -7
- package/dist/production/{chunk-EN242BO4.js → chunk-BIP66BKV.js} +111 -108
- package/dist/{development/chunk-ASILSGTR.mjs → production/chunk-EGOTSXNH.mjs} +45 -113
- package/dist/production/{chunk-RTRY3JFT.js → chunk-IUPBOWYO.js} +113 -35
- package/dist/production/{chunk-OSYEOCBT.mjs → chunk-M7NGGUU6.mjs} +115 -38
- package/dist/{development/context-CmHpk1Ws.d.mts → production/context-CeD5LmaF.d.mts} +12 -4
- package/dist/{development/data-D4xhSy90.d.ts → production/data-CjO11-hU.d.ts} +9 -1
- package/dist/production/{data-U8FS-wNn.d.mts → data-DEjBmEfD.d.mts} +9 -1
- package/dist/production/dom-export.d.mts +3 -3
- package/dist/production/dom-export.d.ts +3 -3
- package/dist/production/dom-export.js +46 -44
- package/dist/production/dom-export.mjs +23 -21
- package/dist/production/{index-react-server-client-CwU9bE5R.d.ts → index-react-server-client-3ykjivgQ.d.ts} +29 -7
- package/dist/production/{index-react-server-client-DPrDrCew.d.mts → index-react-server-client-CACgcj2J.d.mts} +19 -5
- package/dist/production/index-react-server-client.d.mts +3 -3
- package/dist/production/index-react-server-client.d.ts +3 -3
- package/dist/production/index-react-server-client.js +4 -4
- package/dist/production/index-react-server-client.mjs +2 -2
- package/dist/production/index-react-server.d.mts +9 -1
- package/dist/production/index-react-server.d.ts +9 -1
- package/dist/production/index-react-server.js +144 -121
- package/dist/production/index-react-server.mjs +143 -120
- package/dist/production/index.d.mts +15 -14
- package/dist/production/index.d.ts +15 -14
- package/dist/production/index.js +137 -205
- package/dist/production/index.mjs +3 -5
- package/dist/{development/instrumentation-1q4YhLGP.d.ts → production/instrumentation-Dkmpzd13.d.ts} +2 -2
- package/dist/production/lib/types/internal.d.mts +2 -2
- package/dist/production/lib/types/internal.d.ts +2 -2
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/production/{register-CqK96Zfk.d.mts → register-CmkRspdl.d.mts} +1 -1
- package/dist/production/{register-CNAx3TXj.d.ts → register-roq_0qYo.d.ts} +1 -1
- package/docs/explanation/type-safety.md +1 -1
- package/docs/how-to/headers.md +2 -1
- package/docs/how-to/security.md +8 -6
- package/docs/start/data/installation.md +4 -0
- package/docs/start/framework/deploying.md +4 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.
|
|
2
|
+
* react-router v7.18.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -21,14 +21,13 @@ import {
|
|
|
21
21
|
createRoutesStub,
|
|
22
22
|
createSession,
|
|
23
23
|
createSessionStorage,
|
|
24
|
-
deserializeErrors,
|
|
25
24
|
getHydrationData,
|
|
26
25
|
href,
|
|
27
26
|
isCookie,
|
|
28
27
|
isSession,
|
|
29
28
|
routeRSCServerRequest,
|
|
30
29
|
setDevServerHooks
|
|
31
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-EGOTSXNH.mjs";
|
|
32
31
|
import {
|
|
33
32
|
Action,
|
|
34
33
|
Await,
|
|
@@ -142,7 +141,7 @@ import {
|
|
|
142
141
|
withComponentProps,
|
|
143
142
|
withErrorBoundaryProps,
|
|
144
143
|
withHydrateFallbackProps
|
|
145
|
-
} from "./chunk-
|
|
144
|
+
} from "./chunk-M7NGGUU6.mjs";
|
|
146
145
|
export {
|
|
147
146
|
Await,
|
|
148
147
|
BrowserRouter,
|
|
@@ -194,7 +193,6 @@ export {
|
|
|
194
193
|
createMemoryHistory as UNSAFE_createMemoryHistory,
|
|
195
194
|
createRouter as UNSAFE_createRouter,
|
|
196
195
|
decodeViaTurboStream as UNSAFE_decodeViaTurboStream,
|
|
197
|
-
deserializeErrors as UNSAFE_deserializeErrors,
|
|
198
196
|
getHydrationData as UNSAFE_getHydrationData,
|
|
199
197
|
getPatchRoutesOnNavigationFunction as UNSAFE_getPatchRoutesOnNavigationFunction,
|
|
200
198
|
getTurboStreamSingleFetchDataStrategy as UNSAFE_getTurboStreamSingleFetchDataStrategy,
|
package/dist/{development/instrumentation-1q4YhLGP.d.ts → production/instrumentation-Dkmpzd13.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { e as RouteObject, f as History, g as MaybePromise, c as RouterContextProvider, h as MapRoutePropertiesFunction, i as Action, L as Location, D as DataRouteMatch, j as Submission, k as RouteData, l as DataStrategyFunction, m as PatchRoutesOnNavigationFunction, n as DataRouteObject, o as RouteBranch, p as RouteManifest, U as UIMatch, T as To, q as HTMLFormMethod, F as FormEncType, r as Path, s as LoaderFunctionArgs, t as MiddlewareEnabled, u as AppLoadContext } from './data-
|
|
1
|
+
import { e as RouteObject, f as History, g as MaybePromise, c as RouterContextProvider, h as MapRoutePropertiesFunction, i as Action, L as Location, D as DataRouteMatch, j as Submission, k as RouteData, l as DataStrategyFunction, m as PatchRoutesOnNavigationFunction, n as DataRouteObject, o as RouteBranch, p as RouteManifest, U as UIMatch, T as To, q as HTMLFormMethod, F as FormEncType, r as Path, s as LoaderFunctionArgs, t as MiddlewareEnabled, u as AppLoadContext } from './data-CjO11-hU.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* A Router instance manages all navigation and data loading/mutations
|
|
@@ -712,4 +712,4 @@ type RequestHandlerInstrumentationInfo = Readonly<{
|
|
|
712
712
|
context: ReadonlyContext | undefined;
|
|
713
713
|
}>;
|
|
714
714
|
|
|
715
|
-
export { type BlockerFunction as B, type ClientInstrumentation as C, type Fetcher as F, type GetScrollPositionFunction as G, type HydrationState as H, type InstrumentRequestHandlerFunction as I, type NavigationStates as N, type RouterInit as R, type StaticHandler as S, type Router as a, type Blocker as b, type RelativeRoutingType as c, type
|
|
715
|
+
export { type BlockerFunction as B, type ClientInstrumentation as C, type Fetcher as F, type GetScrollPositionFunction as G, type HydrationState as H, type InstrumentRequestHandlerFunction as I, type NavigationStates as N, type RouterInit as R, type StaticHandler as S, type Router as a, type Blocker as b, type RelativeRoutingType as c, type GetScrollRestorationKeyFunction as d, type StaticHandlerContext as e, type Navigation as f, type RouterState as g, type RouterSubscriber as h, type RouterNavigateOptions as i, type RouterFetchOptions as j, type RevalidationState as k, type ServerInstrumentation as l, type InstrumentRouterFunction as m, type InstrumentRouteFunction as n, type InstrumentationHandlerResult as o, IDLE_NAVIGATION as p, IDLE_FETCHER as q, IDLE_BLOCKER as r, createRouter as s, type FutureConfig as t, type CreateStaticHandlerOptions as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RouteModule, e as LinkDescriptor, L as Location, F as Func, f as Pretty, g as MetaDescriptor, G as GetLoaderData, h as ServerDataFunctionArgs, i as MiddlewareNextFunction, j as ClientDataFunctionArgs, D as DataStrategyResult, k as ServerDataFrom, N as Normalize, l as GetActionData } from '../../data-
|
|
2
|
-
import { R as RouteFiles, P as Pages } from '../../register-
|
|
1
|
+
import { R as RouteModule, e as LinkDescriptor, L as Location, F as Func, f as Pretty, g as MetaDescriptor, G as GetLoaderData, h as ServerDataFunctionArgs, i as MiddlewareNextFunction, j as ClientDataFunctionArgs, D as DataStrategyResult, k as ServerDataFrom, N as Normalize, l as GetActionData } from '../../data-DEjBmEfD.mjs';
|
|
2
|
+
import { R as RouteFiles, P as Pages } from '../../register-CmkRspdl.mjs';
|
|
3
3
|
import 'react';
|
|
4
4
|
|
|
5
5
|
type MaybePromise<T> = T | Promise<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RouteModule, v as LinkDescriptor, L as Location, w as Func, x as Pretty, y as MetaDescriptor, G as GetLoaderData, z as ServerDataFunctionArgs, B as MiddlewareNextFunction, E as ClientDataFunctionArgs, I as DataStrategyResult, J as ServerDataFrom, N as Normalize, K as GetActionData } from '../../data-
|
|
2
|
-
import { R as RouteFiles, P as Pages } from '../../register-
|
|
1
|
+
import { R as RouteModule, v as LinkDescriptor, L as Location, w as Func, x as Pretty, y as MetaDescriptor, G as GetLoaderData, z as ServerDataFunctionArgs, B as MiddlewareNextFunction, E as ClientDataFunctionArgs, I as DataStrategyResult, J as ServerDataFrom, N as Normalize, K as GetActionData } from '../../data-CjO11-hU.js';
|
|
2
|
+
import { R as RouteFiles, P as Pages } from '../../register-roq_0qYo.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
|
|
5
5
|
type MaybePromise<T> = T | Promise<T>;
|
|
@@ -50,7 +50,7 @@ React Router's type generation executes your route config (`app/routes.ts` by de
|
|
|
50
50
|
It then generates a `+types/<route file>.d.ts` for each route within a special `.react-router/types/` directory.
|
|
51
51
|
With [`rootDirs` configured][route-module-type-safety], TypeScript can import these generated files as if they were right next to their corresponding route modules.
|
|
52
52
|
|
|
53
|
-
For a deeper dive into some of the design decisions, check out our [type inference decision doc](https://github.com/remix-run/react-router/blob/
|
|
53
|
+
For a deeper dive into some of the design decisions, check out our [type inference decision doc](https://github.com/remix-run/react-router/blob/main/decisions/0012-type-inference.md).
|
|
54
54
|
|
|
55
55
|
[route-module-type-safety]: ../how-to/route-module-type-safety
|
|
56
56
|
|
package/docs/how-to/headers.md
CHANGED
|
@@ -110,7 +110,8 @@ The easiest way is to simply append to the parent headers. This avoids overwriti
|
|
|
110
110
|
```tsx
|
|
111
111
|
export function headers({ parentHeaders }: HeadersArgs) {
|
|
112
112
|
parentHeaders.append(
|
|
113
|
-
"Permissions-Policy
|
|
113
|
+
"Permissions-Policy",
|
|
114
|
+
"geolocation=()",
|
|
114
115
|
);
|
|
115
116
|
return parentHeaders;
|
|
116
117
|
}
|
package/docs/how-to/security.md
CHANGED
|
@@ -13,15 +13,17 @@ This is by no means a comprehensive guide, but React Router provides features to
|
|
|
13
13
|
|
|
14
14
|
## `Content-Security-Policy`
|
|
15
15
|
|
|
16
|
-
If you are implementing a [Content-Security-Policy (CSP)][csp] in your application, specifically one using the `unsafe-inline` directive, you will need to specify a [`nonce`][nonce] attribute on the inline `<script>` elements rendered in your HTML.
|
|
16
|
+
If you are implementing a [Content-Security-Policy (CSP)][csp] in your application, specifically one using the `unsafe-inline` directive, you will need to specify a [`nonce`][nonce] attribute on the inline `<script>` elements rendered in your HTML.
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- [`<ServerRouter nonce>`][serverrouter]
|
|
21
|
-
-
|
|
22
|
-
-
|
|
18
|
+
Add a nonce to these two spots in [`entry.server.tsx`][entryserver]:
|
|
19
|
+
|
|
20
|
+
- The [`<ServerRouter nonce>`][serverrouter] prop
|
|
21
|
+
- This will be proxied along through React Context and used for other Framework Mode components that output `nonce`-aware elements, including [`<Scripts>`][scripts], [`<ScrollRestoration>`][scrollrestoration]
|
|
22
|
+
- If those components specify their own `nonce` prop, it will override the `ServerRouter` value
|
|
23
|
+
- The `nonce` options of [`renderToPipeableStream`][renderToPipeableStream]/[`renderToReadableStream`][renderToReadableStream]
|
|
23
24
|
|
|
24
25
|
[csp]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP
|
|
26
|
+
[entryserver]: ../api/framework-conventions/entry.server.tsx
|
|
25
27
|
[nonce]: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce
|
|
26
28
|
[renderToPipeableStream]: https://react.dev/reference/react-dom/server/renderToPipeableStream
|
|
27
29
|
[renderToReadableStream]: https://react.dev/reference/react-dom/server/renderToReadableStream
|
|
@@ -47,6 +47,10 @@ ReactDOM.createRoot(root).render(
|
|
|
47
47
|
);
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
+
<docs-info>Data Routers should not be held in React state. You should create your router
|
|
51
|
+
once outside of the React tree and pass it to `<RouterProvider>`. You can use
|
|
52
|
+
`patchRoutesOnNavigation` to add additional routes programmatically.</docs-info>
|
|
53
|
+
|
|
50
54
|
---
|
|
51
55
|
|
|
52
56
|
Next: [Routing](./routing)
|
|
@@ -94,3 +94,7 @@ Netlify maintains their own template for React Router. Checkout the [Netlify Gui
|
|
|
94
94
|
### EdgeOne Pages
|
|
95
95
|
|
|
96
96
|
EdgeOne Pages maintains their own template for React Router. Checkout the [EdgeOne Pages Guide](https://pages.edgeone.ai/document/framework-react-router) for more information.
|
|
97
|
+
|
|
98
|
+
### DeployHQ
|
|
99
|
+
|
|
100
|
+
DeployHQ maintains their own guide for deploying React Router v7 to your own server. Checkout the [DeployHQ Guide](https://www.deployhq.com/guides/deploy-react-router-from-github) for more information.
|