react-router 7.13.1 → 7.13.2
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 +53 -0
- package/dist/{production/browser-DzsJABDQ.d.mts → development/browser-Bfn3xw9E.d.ts} +2 -1
- package/dist/development/{browser-DzsJABDQ.d.mts → browser-Di6-vSl-.d.mts} +2 -1
- package/dist/development/{chunk-XOLAXE2Z.js → chunk-GO74ODU3.js} +190 -111
- package/dist/{production/chunk-B5UMK6O7.js → development/chunk-HPFFRPKK.js} +100 -99
- package/dist/development/{chunk-KSEWV2VO.js → chunk-LLP6DRWX.js} +7 -7
- package/dist/{production/chunk-TXB4YXR2.mjs → development/chunk-UALY5CBT.mjs} +83 -49
- package/dist/development/{chunk-LFPYN7LY.mjs → chunk-UVKPFVEO.mjs} +124 -44
- package/dist/development/context-phCt_zmH.d.mts +1713 -0
- package/dist/development/dom-export.d.mts +3 -2
- package/dist/development/dom-export.d.ts +3 -2
- package/dist/development/dom-export.js +45 -29
- package/dist/development/dom-export.mjs +21 -5
- package/dist/development/{index-react-server-client-C4tCIird.d.ts → index-react-server-client-BcrVT7Dd.d.mts} +4 -2
- package/dist/{production/index-react-server-client-EzWJGpN_.d.mts → development/index-react-server-client-CCwMoQIT.d.ts} +1067 -10
- package/dist/development/index-react-server-client.d.mts +3 -2
- package/dist/development/index-react-server-client.d.ts +3 -2
- 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 +293 -246
- package/dist/development/index-react-server.d.ts +293 -246
- package/dist/development/index-react-server.js +121 -43
- package/dist/development/index-react-server.mjs +121 -43
- package/dist/development/index.d.mts +15 -13
- package/dist/development/index.d.ts +15 -13
- package/dist/development/index.js +176 -142
- package/dist/development/index.mjs +3 -3
- package/dist/development/instrumentation-BYr6ff5D.d.ts +657 -0
- 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-CBoanF80.d.ts → register-CTxsJBKQ.d.mts} +1 -1
- package/dist/development/{register-cRYJ3CjG.d.mts → register-CkcGwv27.d.ts} +1 -1
- package/dist/development/routeModules-BRrCYrSL.d.mts +1693 -0
- package/dist/development/routeModules-CA7kSxJJ.d.ts +1693 -0
- package/dist/production/{browser-sPQ7eaK4.d.ts → browser-Bfn3xw9E.d.ts} +2 -1
- package/dist/{development/browser-sPQ7eaK4.d.ts → production/browser-Di6-vSl-.d.mts} +2 -1
- package/dist/production/{chunk-RJCJ3EYF.mjs → chunk-2BDJPJTA.mjs} +124 -44
- package/dist/production/{chunk-ZJMCM6KT.js → chunk-CAFVLUDY.js} +7 -7
- package/dist/production/{chunk-772H4TVR.js → chunk-LKUVSIBA.js} +190 -111
- package/dist/{development/chunk-JPUPSTYD.mjs → production/chunk-PY35PE22.mjs} +83 -49
- package/dist/{development/chunk-2YMDXNOJ.js → production/chunk-XAAX7KIK.js} +100 -99
- package/dist/production/context-phCt_zmH.d.mts +1713 -0
- package/dist/production/dom-export.d.mts +3 -2
- package/dist/production/dom-export.d.ts +3 -2
- package/dist/production/dom-export.js +45 -29
- package/dist/production/dom-export.mjs +21 -5
- package/dist/{development/index-react-server-client-EzWJGpN_.d.mts → production/index-react-server-client-BcrVT7Dd.d.mts} +4 -2
- package/dist/production/{index-react-server-client-C4tCIird.d.ts → index-react-server-client-CCwMoQIT.d.ts} +1067 -10
- package/dist/production/index-react-server-client.d.mts +3 -2
- package/dist/production/index-react-server-client.d.ts +3 -2
- 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 +293 -246
- package/dist/production/index-react-server.d.ts +293 -246
- package/dist/production/index-react-server.js +121 -43
- package/dist/production/index-react-server.mjs +121 -43
- package/dist/production/index.d.mts +15 -13
- package/dist/production/index.d.ts +15 -13
- package/dist/production/index.js +176 -142
- package/dist/production/index.mjs +3 -3
- package/dist/production/instrumentation-BYr6ff5D.d.ts +657 -0
- 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-CBoanF80.d.ts → register-CTxsJBKQ.d.mts} +1 -1
- package/dist/production/{register-cRYJ3CjG.d.mts → register-CkcGwv27.d.ts} +1 -1
- package/dist/production/routeModules-BRrCYrSL.d.mts +1693 -0
- package/dist/production/routeModules-CA7kSxJJ.d.ts +1693 -0
- package/package.json +1 -1
- package/dist/development/instrumentation--6Pioq_G.d.ts +0 -3344
- package/dist/development/router-cLsU7kHk.d.mts +0 -3344
- package/dist/production/instrumentation--6Pioq_G.d.ts +0 -3344
- package/dist/production/router-cLsU7kHk.d.mts +0 -3344
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,58 @@
|
|
|
1
1
|
# `react-router`
|
|
2
2
|
|
|
3
|
+
## 7.13.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fix clientLoader.hydrate when an ancestor route is also hydrating a clientLoader ([#14835](https://github.com/remix-run/react-router/pull/14835))
|
|
8
|
+
|
|
9
|
+
- Fix type error when passing Framework Mode route components using `Route.ComponentProps` to `createRoutesStub` ([#14892](https://github.com/remix-run/react-router/pull/14892))
|
|
10
|
+
|
|
11
|
+
- Fix percent encoding in relative path navigation ([#14786](https://github.com/remix-run/react-router/pull/14786))
|
|
12
|
+
|
|
13
|
+
- Add `future.unstable_passThroughRequests` flag ([#14775](https://github.com/remix-run/react-router/pull/14775))
|
|
14
|
+
|
|
15
|
+
By default, React Router normalizes the `request.url` passed to your `loader`, `action`, and `middleware` functions by removing React Router's internal implementation details (`.data` suffixes, `index` + `_routes` query params).
|
|
16
|
+
|
|
17
|
+
Enabling this flag removes that normalization and passes the raw HTTP `request` instance to your handlers. This provides a few benefits:
|
|
18
|
+
|
|
19
|
+
- Reduces server-side overhead by eliminating multiple `new Request()` calls on the critical path
|
|
20
|
+
- Allows you to distinguish document from data requests in your handlers base don the presence of a `.data` suffix (useful for observability purposes)
|
|
21
|
+
|
|
22
|
+
If you were previously relying on the normalization of `request.url`, you can switch to use the new sibling `unstable_url` parameter which contains a `URL` instance representing the normalized location:
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
// ❌ Before: you could assume there was no `.data` suffix in `request.url`
|
|
26
|
+
export async function loader({ request }: Route.LoaderArgs) {
|
|
27
|
+
let url = new URL(request.url);
|
|
28
|
+
if (url.pathname === "/path") {
|
|
29
|
+
// This check will fail with the flag enabled because the `.data` suffix will
|
|
30
|
+
// exist on data requests
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// ✅ After: use `unstable_url` for normalized routing logic and `request.url`
|
|
35
|
+
// for raw routing logic
|
|
36
|
+
export async function loader({ request, unstable_url }: Route.LoaderArgs) {
|
|
37
|
+
if (unstable_url.pathname === "/path") {
|
|
38
|
+
// This will always have the `.data` suffix stripped
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// And now you can distinguish between document versus data requests
|
|
42
|
+
let isDataRequest = new URL(request.url).pathname.endsWith(".data");
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
- Internal refactor to consolidate framework-agnostic/React-specific route type layers - no public API changes ([#14765](https://github.com/remix-run/react-router/pull/14765))
|
|
47
|
+
|
|
48
|
+
- Sync protocol validation to rsc flows ([#14882](https://github.com/remix-run/react-router/pull/14882))
|
|
49
|
+
|
|
50
|
+
- Add a new `unstable_url: URL` parameter to route handler methods (`loader`, `action`, `middleware`, etc.) representing the normalized URL the application is navigating to or fetching, with React Router implementation details removed (`.data`suffix, `index`/`_routes` query params) ([#14775](https://github.com/remix-run/react-router/pull/14775))
|
|
51
|
+
|
|
52
|
+
This is being added alongside the new `future.unstable_passthroughRequests` future flag so that users still have a way to access the normalized URL when that flag is enabled and non-normalized `request`'s are being passed to your handlers. When adopting this flag, you will only need to start leveraging this new parameter if you are relying on the normalization of `request.url` in your application code.
|
|
53
|
+
|
|
54
|
+
If you don't have the flag enabled, then `unstable_url` will match `request.url`.
|
|
55
|
+
|
|
3
56
|
## 7.13.1
|
|
4
57
|
|
|
5
58
|
### Patch Changes
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { R as RouterInit } from './instrumentation-BYr6ff5D.js';
|
|
3
|
+
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 } from './routeModules-CA7kSxJJ.js';
|
|
3
4
|
|
|
4
5
|
declare function getRequest(): Request;
|
|
5
6
|
type RSCRouteConfigEntryBase = {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { R as RouterInit } from './context-phCt_zmH.mjs';
|
|
3
|
+
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 } from './routeModules-BRrCYrSL.mjs';
|
|
3
4
|
|
|
4
5
|
declare function getRequest(): Request;
|
|
5
6
|
type RSCRouteConfigEntryBase = {
|