react-router 0.0.0-experimental-5a6545bf7 → 0.0.0-experimental-d7bf770a8
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/dist/index.d.ts +2 -1
- package/dist/index.js +36 -5
- package/dist/index.js.map +1 -1
- package/dist/lib/deprecations.d.ts +4 -0
- package/dist/main.js +1 -1
- package/dist/react-router.development.js +36 -5
- package/dist/react-router.development.js.map +1 -1
- package/dist/react-router.production.min.js +2 -2
- package/dist/react-router.production.min.js.map +1 -1
- package/dist/umd/react-router.development.js +36 -4
- package/dist/umd/react-router.development.js.map +1 -1
- package/dist/umd/react-router.production.min.js +2 -2
- package/dist/umd/react-router.production.min.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type { DataRouteMatch, DataRouteObject, IndexRouteObject, NavigateOptions
|
|
|
6
6
|
import { DataRouterContext, DataRouterStateContext, LocationContext, NavigationContext, RouteContext } from "./lib/context";
|
|
7
7
|
import type { NavigateFunction } from "./lib/hooks";
|
|
8
8
|
import { useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteId, useRouteLoaderData, useRoutes, useRoutesImpl } from "./lib/hooks";
|
|
9
|
+
import { logV6DeprecationWarnings } from "./lib/deprecations";
|
|
9
10
|
type Hash = string;
|
|
10
11
|
type Pathname = string;
|
|
11
12
|
type Search = string;
|
|
@@ -26,4 +27,4 @@ export declare function createMemoryRouter(routes: RouteObject[], opts?: {
|
|
|
26
27
|
unstable_patchRoutesOnNavigation?: unstable_PatchRoutesOnNavigationFunction;
|
|
27
28
|
}): RemixRouter;
|
|
28
29
|
/** @internal */
|
|
29
|
-
export { DataRouterContext as UNSAFE_DataRouterContext, DataRouterStateContext as UNSAFE_DataRouterStateContext, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RouteContext as UNSAFE_RouteContext, mapRouteProperties as UNSAFE_mapRouteProperties, useRouteId as UNSAFE_useRouteId, useRoutesImpl as UNSAFE_useRoutesImpl, };
|
|
30
|
+
export { DataRouterContext as UNSAFE_DataRouterContext, DataRouterStateContext as UNSAFE_DataRouterStateContext, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RouteContext as UNSAFE_RouteContext, mapRouteProperties as UNSAFE_mapRouteProperties, useRouteId as UNSAFE_useRouteId, useRoutesImpl as UNSAFE_useRoutesImpl, logV6DeprecationWarnings as UNSAFE_logV6DeprecationWarnings, };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* React Router v0.0.0-experimental-
|
|
2
|
+
* React Router v0.0.0-experimental-d7bf770a8
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -920,14 +920,43 @@ function useNavigateStable() {
|
|
|
920
920
|
}, [router, id]);
|
|
921
921
|
return navigate;
|
|
922
922
|
}
|
|
923
|
-
const alreadyWarned = {};
|
|
923
|
+
const alreadyWarned$1 = {};
|
|
924
924
|
function warningOnce(key, cond, message) {
|
|
925
|
-
if (!cond && !alreadyWarned[key]) {
|
|
926
|
-
alreadyWarned[key] = true;
|
|
925
|
+
if (!cond && !alreadyWarned$1[key]) {
|
|
926
|
+
alreadyWarned$1[key] = true;
|
|
927
927
|
process.env.NODE_ENV !== "production" ? UNSAFE_warning(false, message) : void 0;
|
|
928
928
|
}
|
|
929
929
|
}
|
|
930
930
|
|
|
931
|
+
const alreadyWarned = {};
|
|
932
|
+
function warnOnce(key, message) {
|
|
933
|
+
if (!alreadyWarned[message]) {
|
|
934
|
+
alreadyWarned[message] = true;
|
|
935
|
+
console.warn(message);
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
const logDeprecation = (flag, msg, link) => warnOnce(flag, "\u26A0\uFE0F Future Flag Warning: " + msg + ". " + ("You can use the `" + flag + "` future flag to opt-in early. ") + ("For more information, see " + link + "."));
|
|
939
|
+
function logV6DeprecationWarnings(future) {
|
|
940
|
+
if (future != null && future.v7_fetcherPersist) {
|
|
941
|
+
logDeprecation("v7_fetcherPersist", "The persistence behavior of fetchers is changing in v7", "https://reactrouter.com/en/v7/upgrading/future#v7_fetcherpersist");
|
|
942
|
+
}
|
|
943
|
+
if (future != null && future.v7_normalizeFormMethod) {
|
|
944
|
+
logDeprecation("v7_normalizeFormMethod", "Casing of `formMethod` fields is being normalized to uppercase in v7", "https://reactrouter.com/en/v7/upgrading/future#v7_normalizeformmethod");
|
|
945
|
+
}
|
|
946
|
+
if (future != null && future.v7_partialHydration) {
|
|
947
|
+
logDeprecation("v7_partialHydration", "RouterProvider hydration behavior is changing in v7", "https://reactrouter.com/en/v7/upgrading/future#v7_partialhydration");
|
|
948
|
+
}
|
|
949
|
+
if (future != null && future.v7_relativeSplatPath) {
|
|
950
|
+
logDeprecation("v7_relativeSplatPath", "Relative route resolution within Splat routes is changing in v7", "https://reactrouter.com/en/v7/upgrading/future#v7_relativesplatpath");
|
|
951
|
+
}
|
|
952
|
+
if (future != null && future.v7_skipActionErrorRevalidation) {
|
|
953
|
+
logDeprecation("v7_skipActionErrorRevalidation", "The revalidation behavior after 4xx/5xx action responses is changing in v7", "https://reactrouter.com/en/v7/upgrading/future#v7_skipactionerrorrevalidation");
|
|
954
|
+
}
|
|
955
|
+
if (future != null && future.v7_startTransition) {
|
|
956
|
+
logDeprecation("v7_startTransition", "`RouterProvider` will begin wrapping state updates in `React.startTransition` in v7", "https://reactrouter.com/en/v7/upgrading/future#v7_starttransition");
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
|
|
931
960
|
/**
|
|
932
961
|
Webpack + React 17 fails to compile on any of the following because webpack
|
|
933
962
|
complains that `startTransition` doesn't exist in `React`:
|
|
@@ -1070,6 +1099,7 @@ function MemoryRouter(_ref3) {
|
|
|
1070
1099
|
v7_startTransition && startTransitionImpl ? startTransitionImpl(() => setStateImpl(newState)) : setStateImpl(newState);
|
|
1071
1100
|
}, [setStateImpl, v7_startTransition]);
|
|
1072
1101
|
React.useLayoutEffect(() => history.listen(setState), [history, setState]);
|
|
1102
|
+
React.useEffect(() => logV6DeprecationWarnings(future), [future]);
|
|
1073
1103
|
return /*#__PURE__*/React.createElement(Router, {
|
|
1074
1104
|
basename: basename,
|
|
1075
1105
|
children: children,
|
|
@@ -1446,6 +1476,7 @@ function mapRouteProperties(route) {
|
|
|
1446
1476
|
return updates;
|
|
1447
1477
|
}
|
|
1448
1478
|
function createMemoryRouter(routes, opts) {
|
|
1479
|
+
logV6DeprecationWarnings(opts == null ? void 0 : opts.future);
|
|
1449
1480
|
return createRouter({
|
|
1450
1481
|
basename: opts == null ? void 0 : opts.basename,
|
|
1451
1482
|
future: _extends({}, opts == null ? void 0 : opts.future, {
|
|
@@ -1463,5 +1494,5 @@ function createMemoryRouter(routes, opts) {
|
|
|
1463
1494
|
}).initialize();
|
|
1464
1495
|
}
|
|
1465
1496
|
|
|
1466
|
-
export { Await, MemoryRouter, Navigate, Outlet, Route, Router, RouterProvider, Routes, DataRouterContext as UNSAFE_DataRouterContext, DataRouterStateContext as UNSAFE_DataRouterStateContext, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RouteContext as UNSAFE_RouteContext, mapRouteProperties as UNSAFE_mapRouteProperties, useRouteId as UNSAFE_useRouteId, useRoutesImpl as UNSAFE_useRoutesImpl, createMemoryRouter, createRoutesFromChildren, createRoutesFromChildren as createRoutesFromElements, renderMatches, useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes };
|
|
1497
|
+
export { Await, MemoryRouter, Navigate, Outlet, Route, Router, RouterProvider, Routes, DataRouterContext as UNSAFE_DataRouterContext, DataRouterStateContext as UNSAFE_DataRouterStateContext, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RouteContext as UNSAFE_RouteContext, logV6DeprecationWarnings as UNSAFE_logV6DeprecationWarnings, mapRouteProperties as UNSAFE_mapRouteProperties, useRouteId as UNSAFE_useRouteId, useRoutesImpl as UNSAFE_useRoutesImpl, createMemoryRouter, createRoutesFromChildren, createRoutesFromChildren as createRoutesFromElements, renderMatches, useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes };
|
|
1467
1498
|
//# sourceMappingURL=index.js.map
|