react-router 7.14.1 → 7.15.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 +105 -0
- package/dist/development/{browser-D-3-U2Jj.d.mts → browser-CRsXgNrY.d.mts} +2 -2
- package/dist/{production/browser-D-3-U2Jj.d.mts → development/browser-wDl1FZEL.d.ts} +2 -2
- package/dist/{production/chunk-3SUPTI2U.js → development/chunk-2D5H3HU3.js} +7 -7
- package/dist/development/{chunk-OE4NN4TA.mjs → chunk-5KNZJZUH.mjs} +362 -213
- package/dist/development/{chunk-YMKMFAYZ.js → chunk-AM3XM4LS.js} +314 -172
- package/dist/development/{chunk-BFXCU3MI.mjs → chunk-RMD3H4O3.mjs} +81 -62
- package/dist/development/{chunk-3F6IB66O.js → chunk-Z5YQYACE.js} +146 -139
- package/dist/{production/context-BzhbVly6.d.mts → development/context-BQs41HrG.d.mts} +94 -42
- package/dist/development/{routeModules-CM_clkdE.d.ts → data-BVUf681J.d.mts} +89 -56
- package/dist/{production/routeModules-CM_clkdE.d.ts → development/data-BqZ2x964.d.ts} +79 -46
- package/dist/development/dom-export.d.mts +9 -9
- package/dist/development/dom-export.d.ts +9 -9
- package/dist/development/dom-export.js +37 -40
- package/dist/development/dom-export.mjs +12 -15
- package/dist/development/{index-react-server-client-CimaPp9o.d.ts → index-react-server-client-CSv-KZBk.d.ts} +123 -121
- package/dist/{production/index-react-server-client-WSaoxloq.d.mts → development/index-react-server-client-Ck_yZ1qL.d.mts} +102 -100
- 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 +107 -36
- package/dist/development/index-react-server.d.ts +107 -36
- package/dist/development/index-react-server.js +60 -33
- package/dist/development/index-react-server.mjs +60 -33
- package/dist/development/index.d.mts +11 -11
- package/dist/development/index.d.ts +11 -11
- package/dist/development/index.js +174 -155
- package/dist/development/index.mjs +3 -3
- package/dist/{production/instrumentation-CMVbvxj9.d.ts → development/instrumentation-DlJ2QV7d.d.ts} +73 -21
- 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-D1WlEpq9.d.ts → register-Bsscfj79.d.ts} +1 -1
- package/dist/{production/register-D1WlEpq9.d.ts → development/register-Df8okEea.d.mts} +1 -1
- package/dist/production/{browser-CtktEGQs.d.ts → browser-CRsXgNrY.d.mts} +2 -2
- package/dist/{development/browser-CtktEGQs.d.ts → production/browser-wDl1FZEL.d.ts} +2 -2
- package/dist/production/{chunk-G5ZWO7Q6.mjs → chunk-23ZOHYE5.mjs} +81 -62
- package/dist/{development/chunk-7VLQJKNG.js → production/chunk-7YXKJMLN.js} +7 -7
- package/dist/production/{chunk-SPR7R4GU.mjs → chunk-GM3PW4GX.mjs} +362 -213
- package/dist/production/{chunk-UVEQGZIH.js → chunk-LCJTIOKZ.js} +314 -172
- package/dist/production/{chunk-LIOP3ILM.js → chunk-YBQJ3ABE.js} +146 -139
- package/dist/{development/context-BzhbVly6.d.mts → production/context-BQs41HrG.d.mts} +94 -42
- package/dist/{development/routeModules-Djumx26z.d.mts → production/data-BVUf681J.d.mts} +79 -46
- package/dist/production/{routeModules-Djumx26z.d.mts → data-BqZ2x964.d.ts} +89 -56
- package/dist/production/dom-export.d.mts +9 -9
- package/dist/production/dom-export.d.ts +9 -9
- package/dist/production/dom-export.js +37 -40
- package/dist/production/dom-export.mjs +12 -15
- package/dist/production/{index-react-server-client-CimaPp9o.d.ts → index-react-server-client-CSv-KZBk.d.ts} +123 -121
- package/dist/{development/index-react-server-client-WSaoxloq.d.mts → production/index-react-server-client-Ck_yZ1qL.d.mts} +102 -100
- 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 +107 -36
- package/dist/production/index-react-server.d.ts +107 -36
- package/dist/production/index-react-server.js +60 -33
- package/dist/production/index-react-server.mjs +60 -33
- package/dist/production/index.d.mts +11 -11
- package/dist/production/index.d.ts +11 -11
- package/dist/production/index.js +174 -155
- package/dist/production/index.mjs +3 -3
- package/dist/{development/instrumentation-CMVbvxj9.d.ts → production/instrumentation-DlJ2QV7d.d.ts} +73 -21
- 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/{development/register-aE9ob3TK.d.mts → production/register-Bsscfj79.d.ts} +1 -1
- package/dist/production/{register-aE9ob3TK.d.mts → register-Df8okEea.d.mts} +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,110 @@
|
|
|
1
1
|
# `react-router`
|
|
2
2
|
|
|
3
|
+
## v7.15.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Stabilize `unstable_defaultShouldRevalidate` as `defaultShouldRevalidate` on `<Link>`, `<Form>`, `useLinkClickHandler`, `useSubmit`, `fetcher.submit`, and `setSearchParams` ([a993f09](https://github.com/remix-run/react-router/commit/a993f09))
|
|
8
|
+
|
|
9
|
+
- ⚠️ This is a breaking change if you have already opted into the unstable version - you will need to update your code accordingly
|
|
10
|
+
|
|
11
|
+
- Stabilize the instrumentation APIs. `unstable_instrumentations` is now `instrumentations` and `unstable_pattern` is now `pattern` ([a993f09](https://github.com/remix-run/react-router/commit/a993f09))
|
|
12
|
+
|
|
13
|
+
- The `unstable_ServerInstrumentation`, `unstable_ClientInstrumentation`, `unstable_InstrumentRequestHandlerFunction`, `unstable_InstrumentRouterFunction`, `unstable_InstrumentRouteFunction`, and `unstable_InstrumentationHandlerResult` types have had their `unstable_` prefixes removed
|
|
14
|
+
- ⚠️ This is a breaking change if you have already opted into the unstable version - you will need to update your code accordingly
|
|
15
|
+
|
|
16
|
+
- Stabilize `unstable_mask` as `mask` on `<Link>`, `useLinkClickHandler`, and `useNavigate`, and rename the corresponding `Location.unstable_mask` field to `Location.mask` ([a993f09](https://github.com/remix-run/react-router/commit/a993f09))
|
|
17
|
+
|
|
18
|
+
- ⚠️ This is a breaking change if you have already opted into the unstable version - you will need to update your code accordingly
|
|
19
|
+
|
|
20
|
+
- Stabilize the `unstable_normalizePath` option on `staticHandler.query` and `staticHandler.queryRoute` as `normalizePath` ([a993f09](https://github.com/remix-run/react-router/commit/a993f09))
|
|
21
|
+
|
|
22
|
+
- ⚠️ This is a breaking change if you have already opted into the unstable version - you will need to update your code accordingly
|
|
23
|
+
|
|
24
|
+
- Stabilize `future.unstable_passThroughRequests` as `future.v8_passThroughRequests` ([a993f09](https://github.com/remix-run/react-router/commit/a993f09))
|
|
25
|
+
|
|
26
|
+
- ⚠️ This is a breaking change if you have already opted into the unstable version - you will need to update your code accordingly
|
|
27
|
+
|
|
28
|
+
- Remove `unstable_subResourceIntegrity` from the runtime `FutureConfig` type; the flag is now controlled by the top-level `subResourceIntegrity` option in `react-router.config.ts` ([a993f09](https://github.com/remix-run/react-router/commit/a993f09))
|
|
29
|
+
|
|
30
|
+
- ⚠️ This is a breaking change if you have already opted into the unstable version - you will need to update your code accordingly
|
|
31
|
+
|
|
32
|
+
- Stabilize `unstable_url` as `url` on `loader`, `action`, and `middleware` function args ([a993f09](https://github.com/remix-run/react-router/commit/a993f09))
|
|
33
|
+
|
|
34
|
+
- ⚠️ This is a breaking change if you have already opted into the unstable version - you will need to update your code accordingly
|
|
35
|
+
|
|
36
|
+
- Stabilize `unstable_useTransitions` as `useTransitions` on `<BrowserRouter>`, `<HashRouter>`, `<HistoryRouter>`, `<MemoryRouter>`, `<Router>`, `<RouterProvider>`, `<HydratedRouter>`, and `useLinkClickHandler` ([a993f09](https://github.com/remix-run/react-router/commit/a993f09))
|
|
37
|
+
|
|
38
|
+
- ⚠️ This is a breaking change if you have already opted into the unstable version - you will need to update your code accordingly
|
|
39
|
+
|
|
40
|
+
### Patch Changes
|
|
41
|
+
|
|
42
|
+
- Add `nonce` to `<Scripts>` `<link rel="modulepreload">` elements (if provided) ([af5d49b](https://github.com/remix-run/react-router/commit/af5d49b))
|
|
43
|
+
|
|
44
|
+
- Fix a bug with `unstable_defaultShouldRevalidate={false}` where parent routes that did not export a `shouldRevalidate` function could be incorrectly included in the single fetch call for new child route data ([#15012](https://github.com/remix-run/react-router/pull/15012))
|
|
45
|
+
|
|
46
|
+
- Improve server-side route matching performance by pre-computing flattened/cached route branches ([#14967](https://github.com/remix-run/react-router/pull/14967)) ([af5d49b](https://github.com/remix-run/react-router/commit/af5d49b))
|
|
47
|
+
|
|
48
|
+
- Performance benchmarks showed roughly a 10-15% improvement in server-side request handling performance
|
|
49
|
+
|
|
50
|
+
- Mark `mask` as an optional field in `Location` for easier mocking in unit tests ([#14999](https://github.com/remix-run/react-router/pull/14999))
|
|
51
|
+
|
|
52
|
+
- Cache flattened/ranked route branches to optimize server-side route matching ([#14967](https://github.com/remix-run/react-router/pull/14967))
|
|
53
|
+
|
|
54
|
+
- Improve route matching performance in Framework/Data Mode ([#14971](https://github.com/remix-run/react-router/pull/14971)) ([af5d49b](https://github.com/remix-run/react-router/commit/af5d49b))
|
|
55
|
+
|
|
56
|
+
- Avoiding unnecessary calls to `matchRoutes` in data router scenarios
|
|
57
|
+
- This includes adding back the optimization that was removed in `7.6.0` ([#13562](https://github.com/remix-run/react-router/pull/13562))
|
|
58
|
+
- The issues that prompted the revert have been addressed by using the available router `matches` but always updating `match.route` to the latest route in the `manifest`
|
|
59
|
+
- Leverage pre-computed pre-computing flattened/cached route branches during client side route matching
|
|
60
|
+
- Performance benchmarks showed roughly a 15-30% improvement in server-side request handling performance
|
|
61
|
+
|
|
62
|
+
## v7.14.2
|
|
63
|
+
|
|
64
|
+
### Patch Changes
|
|
65
|
+
|
|
66
|
+
- Remove the un-documented custom error serialization logic from the internal turbo-stream implementation. React Router only automatically handles serialization of `Error` and it's standard subtypes (`SyntaxError`, `TypeError`, etc.). ([[aabf4a1](https://github.com/remix-run/react-router/commit/aabf4a1))
|
|
67
|
+
|
|
68
|
+
- Properly handle parent middleware redirects during `fetcher.load` ([[aabf4a1](https://github.com/remix-run/react-router/commit/aabf4a1))
|
|
69
|
+
|
|
70
|
+
- Remove redundant `Omit<RouterProviderProps, "flushSync">` from `react-router/dom` `RouterProvider` ([[aabf4a1](https://github.com/remix-run/react-router/commit/aabf4a1))
|
|
71
|
+
|
|
72
|
+
- Improved types for `generatePath`'s `param` arg ([[aabf4a1](https://github.com/remix-run/react-router/commit/aabf4a1))
|
|
73
|
+
|
|
74
|
+
Type errors when required params are omitted:
|
|
75
|
+
|
|
76
|
+
```ts
|
|
77
|
+
// Before
|
|
78
|
+
// Passes type checks, but throws at runtime 💥
|
|
79
|
+
generatePath(":required", { required: null });
|
|
80
|
+
|
|
81
|
+
// After
|
|
82
|
+
generatePath(":required", { required: null });
|
|
83
|
+
// ^^^^^^^^ Type 'null' is not assignable to type 'string'.ts(2322)
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Allow omission of optional params:
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
// Before
|
|
90
|
+
generatePath(":optional?", {});
|
|
91
|
+
// ^^ Property 'optional' is missing in type '{}' but required in type '{ optional: string | null | undefined; }'.ts(2741)
|
|
92
|
+
|
|
93
|
+
// After
|
|
94
|
+
generatePath(":optional?", {});
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Allows extra keys:
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
// Before
|
|
101
|
+
generatePath(":a", { a: "1", b: "2" });
|
|
102
|
+
// ^ Object literal may only specify known properties, and 'b' does not exist in type '{ a: string; }'.ts(2353)
|
|
103
|
+
|
|
104
|
+
// After
|
|
105
|
+
generatePath(":a", { a: "1", b: "2" });
|
|
106
|
+
```
|
|
107
|
+
|
|
3
108
|
## v7.14.1
|
|
4
109
|
|
|
5
110
|
### Patch Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { R as RouterInit } from './context-
|
|
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 './
|
|
2
|
+
import { R as RouterInit } from './context-BQs41HrG.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 './data-BVUf681J.mjs';
|
|
4
4
|
|
|
5
5
|
declare function getRequest(): Request;
|
|
6
6
|
type RSCRouteConfigEntryBase = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { R as RouterInit } from './
|
|
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 './
|
|
2
|
+
import { R as RouterInit } from './instrumentation-DlJ2QV7d.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 './data-BqZ2x964.js';
|
|
4
4
|
|
|
5
5
|
declare function getRequest(): Request;
|
|
6
6
|
type RSCRouteConfigEntryBase = {
|
|
@@ -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.
|
|
2
|
+
* react-router v7.15.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkAM3XM4LSjs = require('./chunk-AM3XM4LS.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 =
|
|
32
|
+
let initialMatches = _chunkAM3XM4LSjs.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 (
|
|
37
|
+
if (_chunkAM3XM4LSjs.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 (
|
|
115
|
+
if (_chunkAM3XM4LSjs.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
|
-
|
|
123
|
+
_chunkAM3XM4LSjs.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 =
|
|
149
|
+
let error = _chunkAM3XM4LSjs.useRouteError.call(void 0, );
|
|
150
150
|
if (hasRootLayout === void 0) {
|
|
151
151
|
throw new Error("Missing 'hasRootLayout' prop");
|
|
152
152
|
}
|