react-router 7.0.0-pre.4 → 7.0.0-pre.6
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 +49 -7
- package/dist/{chunk-FT3T2DDR.mjs → development/chunk-CQOJUIYR.mjs} +4 -3
- package/dist/development/data-CQbyyGzl.d.mts +11 -0
- package/dist/development/data-CQbyyGzl.d.ts +11 -0
- package/dist/development/dom-export.d.mts +13 -0
- package/dist/{dom-export.d.ts → development/dom-export.d.ts} +2 -2
- package/dist/{dom-export.js → development/dom-export.js} +1 -1
- package/dist/{dom-export.mjs → development/dom-export.mjs} +2 -2
- package/dist/development/fog-of-war-BDQTYoRQ.d.mts +1595 -0
- package/dist/{fog-of-war-BijhfqFM.d.ts → development/fog-of-war-CbNQuoo8.d.ts} +2 -2
- package/dist/development/index.d.mts +840 -0
- package/dist/{index.d.ts → development/index.d.ts} +6 -5
- package/dist/{index.js → development/index.js} +4 -3
- package/dist/{index.mjs → development/index.mjs} +2 -2
- package/dist/development/lib/types/route-module.d.mts +102 -0
- package/dist/development/lib/types/route-module.d.ts +102 -0
- package/dist/{lib/types.js → development/lib/types/route-module.js} +4 -4
- package/dist/{lib/types.mjs → development/lib/types/route-module.mjs} +1 -1
- package/dist/{types-BlYP8xpH.d.mts → development/route-data-DuV3tXo2.d.mts} +20 -94
- package/dist/{types-BlYP8xpH.d.ts → development/route-data-DuV3tXo2.d.ts} +20 -94
- package/dist/production/chunk-X537FOHI.mjs +9618 -0
- package/dist/production/data-CQbyyGzl.d.mts +11 -0
- package/dist/production/data-CQbyyGzl.d.ts +11 -0
- package/dist/production/dom-export.d.mts +13 -0
- package/dist/{dom-export.d.mts → production/dom-export.d.ts} +2 -2
- package/dist/production/dom-export.js +5502 -0
- package/dist/production/dom-export.mjs +199 -0
- package/dist/production/fog-of-war-BDQTYoRQ.d.mts +1595 -0
- package/dist/{fog-of-war-Bz_EDtxF.d.mts → production/fog-of-war-CbNQuoo8.d.ts} +2 -2
- package/dist/production/index.d.mts +840 -0
- package/dist/{index.d.mts → production/index.d.ts} +6 -5
- package/dist/production/index.js +9764 -0
- package/dist/production/index.mjs +235 -0
- package/dist/production/lib/types/route-module.d.mts +102 -0
- package/dist/production/lib/types/route-module.d.ts +102 -0
- package/dist/production/lib/types/route-module.js +28 -0
- package/dist/production/lib/types/route-module.mjs +10 -0
- package/dist/production/route-data-DuV3tXo2.d.mts +1546 -0
- package/dist/production/route-data-DuV3tXo2.d.ts +1546 -0
- package/package.json +37 -23
- package/dist/lib/types.d.mts +0 -2
- package/dist/lib/types.d.ts +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
# `react-router`
|
|
2
2
|
|
|
3
|
-
## 7.0.0-pre.
|
|
3
|
+
## 7.0.0-pre.6
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
7
|
+
- chore: re-enable development warnings through a `development` exports condition. ([#12269](https://github.com/remix-run/react-router/pull/12269))
|
|
8
|
+
- Remove unneeded dependency on @web3-storage/multipart-parser ([#12274](https://github.com/remix-run/react-router/pull/12274))
|
|
9
|
+
- fix(react-router): (v7) fix static prerender of non-ascii characters ([#12161](https://github.com/remix-run/react-router/pull/12161))
|
|
10
|
+
- Remove unneeded dependency on source-map ([#12275](https://github.com/remix-run/react-router/pull/12275))
|
|
11
|
+
|
|
12
|
+
## 7.0.0-pre.5
|
|
13
|
+
|
|
14
|
+
## 7.0.0-pre.4
|
|
8
15
|
|
|
9
16
|
## 7.0.0-pre.3
|
|
10
17
|
|
|
@@ -363,6 +370,41 @@
|
|
|
363
370
|
- Updated dependencies:
|
|
364
371
|
- `react-router@7.0.0-pre.0`
|
|
365
372
|
|
|
373
|
+
## 6.28.0
|
|
374
|
+
|
|
375
|
+
### Minor Changes
|
|
376
|
+
|
|
377
|
+
- - Log deprecation warnings for v7 flags ([#11750](https://github.com/remix-run/react-router/pull/11750))
|
|
378
|
+
- Add deprecation warnings to `json`/`defer` in favor of returning raw objects
|
|
379
|
+
- These methods will be removed in React Router v7
|
|
380
|
+
|
|
381
|
+
### Patch Changes
|
|
382
|
+
|
|
383
|
+
- Update JSDoc URLs for new website structure (add /v6/ segment) ([#12141](https://github.com/remix-run/react-router/pull/12141))
|
|
384
|
+
- Updated dependencies:
|
|
385
|
+
- `@remix-run/router@1.21.0`
|
|
386
|
+
|
|
387
|
+
## 6.27.0
|
|
388
|
+
|
|
389
|
+
### Minor Changes
|
|
390
|
+
|
|
391
|
+
- Stabilize `unstable_patchRoutesOnNavigation` ([#11973](https://github.com/remix-run/react-router/pull/11973))
|
|
392
|
+
- Add new `PatchRoutesOnNavigationFunctionArgs` type for convenience ([#11967](https://github.com/remix-run/react-router/pull/11967))
|
|
393
|
+
- Stabilize `unstable_dataStrategy` ([#11974](https://github.com/remix-run/react-router/pull/11974))
|
|
394
|
+
- Stabilize the `unstable_flushSync` option for navigations and fetchers ([#11989](https://github.com/remix-run/react-router/pull/11989))
|
|
395
|
+
- Stabilize the `unstable_viewTransition` option for navigations and the corresponding `unstable_useViewTransitionState` hook ([#11989](https://github.com/remix-run/react-router/pull/11989))
|
|
396
|
+
|
|
397
|
+
### Patch Changes
|
|
398
|
+
|
|
399
|
+
- Fix bug when submitting to the current contextual route (parent route with an index child) when an `?index` param already exists from a prior submission ([#12003](https://github.com/remix-run/react-router/pull/12003))
|
|
400
|
+
|
|
401
|
+
- Fix `useFormAction` bug - when removing `?index` param it would not keep other non-Remix `index` params ([#12003](https://github.com/remix-run/react-router/pull/12003))
|
|
402
|
+
|
|
403
|
+
- Fix types for `RouteObject` within `PatchRoutesOnNavigationFunction`'s `patch` method so it doesn't expect agnostic route objects passed to `patch` ([#11967](https://github.com/remix-run/react-router/pull/11967))
|
|
404
|
+
|
|
405
|
+
- Updated dependencies:
|
|
406
|
+
- `@remix-run/router@1.20.0`
|
|
407
|
+
|
|
366
408
|
## 6.26.2
|
|
367
409
|
|
|
368
410
|
### Patch Changes
|
|
@@ -424,7 +466,7 @@ No significant changes to this package were made in this release. [See the repo
|
|
|
424
466
|
|
|
425
467
|
- Add support for Lazy Route Discovery (a.k.a. Fog of War) ([#11626](https://github.com/remix-run/react-router/pull/11626))
|
|
426
468
|
- RFC: <https://github.com/remix-run/react-router/discussions/11113>
|
|
427
|
-
- `unstable_patchRoutesOnMiss` docs: <https://reactrouter.com/
|
|
469
|
+
- `unstable_patchRoutesOnMiss` docs: <https://reactrouter.com/v6/routers/create-browser-router>
|
|
428
470
|
|
|
429
471
|
### Patch Changes
|
|
430
472
|
|
|
@@ -670,7 +712,7 @@ No significant changes to this package were made in this release. [See the repo
|
|
|
670
712
|
### Minor Changes
|
|
671
713
|
|
|
672
714
|
- Add `unstable_flushSync` option to `useNavigate`/`useSumbit`/`fetcher.load`/`fetcher.submit` to opt-out of `React.startTransition` and into `ReactDOM.flushSync` for state updates ([#11005](https://github.com/remix-run/react-router/pull/11005))
|
|
673
|
-
- Remove the `unstable_` prefix from the [`useBlocker`](https://reactrouter.com/
|
|
715
|
+
- Remove the `unstable_` prefix from the [`useBlocker`](https://reactrouter.com/v6/hooks/use-blocker) hook as it's been in use for enough time that we are confident in the API. We do not plan to remove the prefix from `unstable_usePrompt` due to differences in how browsers handle `window.confirm` that prevent React Router from guaranteeing consistent/correct behavior. ([#10991](https://github.com/remix-run/react-router/pull/10991))
|
|
674
716
|
|
|
675
717
|
### Patch Changes
|
|
676
718
|
|
|
@@ -760,7 +802,7 @@ No significant changes to this package were made in this release. [See the repo
|
|
|
760
802
|
|
|
761
803
|
### Minor Changes
|
|
762
804
|
|
|
763
|
-
- Move [`React.startTransition`](https://react.dev/reference/react/startTransition) usage behind a [future flag](https://reactrouter.com/
|
|
805
|
+
- Move [`React.startTransition`](https://react.dev/reference/react/startTransition) usage behind a [future flag](https://reactrouter.com/v6/guides/api-development-strategy) to avoid issues with existing incompatible `Suspense` usages. We recommend folks adopting this flag to be better compatible with React concurrent mode, but if you run into issues you can continue without the use of `startTransition` until v7. Issues usually boils down to creating net-new promises during the render cycle, so if you run into issues you should either lift your promise creation out of the render cycle or put it behind a `useMemo`. ([#10596](https://github.com/remix-run/react-router/pull/10596))
|
|
764
806
|
|
|
765
807
|
Existing behavior will no longer include `React.startTransition`:
|
|
766
808
|
|
|
@@ -843,7 +885,7 @@ No significant changes to this package were made in this release. [See the repo
|
|
|
843
885
|
|
|
844
886
|
### Minor Changes
|
|
845
887
|
|
|
846
|
-
- Added support for [**Future Flags**](https://reactrouter.com/
|
|
888
|
+
- Added support for [**Future Flags**](https://reactrouter.com/v6/guides/api-development-strategy) in React Router. The first flag being introduced is `future.v7_normalizeFormMethod` which will normalize the exposed `useNavigation()/useFetcher()` `formMethod` fields as uppercase HTTP methods to align with the `fetch()` behavior. ([#10207](https://github.com/remix-run/react-router/pull/10207))
|
|
847
889
|
|
|
848
890
|
- When `future.v7_normalizeFormMethod === false` (default v6 behavior),
|
|
849
891
|
- `useNavigation().formMethod` is lowercase
|
|
@@ -1120,7 +1162,7 @@ function Comp() {
|
|
|
1120
1162
|
|
|
1121
1163
|
## 6.4.0
|
|
1122
1164
|
|
|
1123
|
-
Whoa this is a big one! `6.4.0` brings all the data loading and mutation APIs over from Remix. Here's a quick high level overview, but it's recommended you go check out the [docs](https://reactrouter.com), especially the [feature overview](https://reactrouter.com/start/overview) and the [tutorial](https://reactrouter.com/start/tutorial).
|
|
1165
|
+
Whoa this is a big one! `6.4.0` brings all the data loading and mutation APIs over from Remix. Here's a quick high level overview, but it's recommended you go check out the [docs](https://reactrouter.com), especially the [feature overview](https://reactrouter.com/en/6.4.0/start/overview) and the [tutorial](https://reactrouter.com/en/6.4.0/start/tutorial).
|
|
1124
1166
|
|
|
1125
1167
|
**New APIs**
|
|
1126
1168
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.0.0-pre.
|
|
2
|
+
* react-router v7.0.0-pre.6
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -6980,7 +6980,7 @@ function mergeRefs(...refs) {
|
|
|
6980
6980
|
var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
6981
6981
|
try {
|
|
6982
6982
|
if (isBrowser) {
|
|
6983
|
-
window.__reactRouterVersion = "7.0.0-pre.
|
|
6983
|
+
window.__reactRouterVersion = "7.0.0-pre.6";
|
|
6984
6984
|
}
|
|
6985
6985
|
} catch (e) {
|
|
6986
6986
|
}
|
|
@@ -8571,9 +8571,10 @@ function createStaticHandlerDataRoutes(manifest, future, parentId = "", routesBy
|
|
|
8571
8571
|
// context even though we know it'll always be provided in remix
|
|
8572
8572
|
loader: route.module.loader ? async (args) => {
|
|
8573
8573
|
if (args.request.headers.has("X-React-Router-Prerender-Data")) {
|
|
8574
|
-
|
|
8574
|
+
const preRenderedData = args.request.headers.get(
|
|
8575
8575
|
"X-React-Router-Prerender-Data"
|
|
8576
8576
|
);
|
|
8577
|
+
let encoded = preRenderedData ? decodeURI(preRenderedData) : preRenderedData;
|
|
8577
8578
|
invariant3(encoded, "Missing prerendered data for route");
|
|
8578
8579
|
let uint8array = new TextEncoder().encode(encoded);
|
|
8579
8580
|
let stream = new ReadableStream({
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An object of unknown type for route loaders and actions provided by the
|
|
3
|
+
* server's `getLoadContext()` function. This is defined as an empty interface
|
|
4
|
+
* specifically so apps can leverage declaration merging to augment this type
|
|
5
|
+
* globally: https://www.typescriptlang.org/docs/handbook/declaration-merging.html
|
|
6
|
+
*/
|
|
7
|
+
interface AppLoadContext {
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type { AppLoadContext as A };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An object of unknown type for route loaders and actions provided by the
|
|
3
|
+
* server's `getLoadContext()` function. This is defined as an empty interface
|
|
4
|
+
* specifically so apps can leverage declaration merging to augment this type
|
|
5
|
+
* globally: https://www.typescriptlang.org/docs/handbook/declaration-merging.html
|
|
6
|
+
*/
|
|
7
|
+
interface AppLoadContext {
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type { AppLoadContext as A };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { R as RouterProviderProps$1 } from './fog-of-war-BDQTYoRQ.mjs';
|
|
3
|
+
import './route-data-DuV3tXo2.mjs';
|
|
4
|
+
|
|
5
|
+
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
|
|
6
|
+
declare function RouterProvider(props: Omit<RouterProviderProps, "flushSync">): React.JSX.Element;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @category Router Components
|
|
10
|
+
*/
|
|
11
|
+
declare function HydratedRouter(): React.JSX.Element;
|
|
12
|
+
|
|
13
|
+
export { HydratedRouter, RouterProvider, type RouterProviderProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { R as RouterProviderProps$1 } from './fog-of-war-
|
|
3
|
-
import './
|
|
2
|
+
import { R as RouterProviderProps$1 } from './fog-of-war-CbNQuoo8.js';
|
|
3
|
+
import './route-data-DuV3tXo2.js';
|
|
4
4
|
|
|
5
5
|
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
|
|
6
6
|
declare function RouterProvider(props: Omit<RouterProviderProps, "flushSync">): React.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.0.0-pre.
|
|
2
|
+
* react-router v7.0.0-pre.6
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
matchRoutes,
|
|
26
26
|
shouldHydrateRouteLoader,
|
|
27
27
|
useFogOFWarDiscovery
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-CQOJUIYR.mjs";
|
|
29
29
|
|
|
30
30
|
// lib/dom-export/dom-router-provider.tsx
|
|
31
31
|
import * as React from "react";
|