react-router 0.0.0-experimental-a25eed86d → 0.0.0-experimental-818f8e08d
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/development/{chunk-JS5R3RPS.mjs → chunk-4O47XL4L.mjs} +40 -44
- package/dist/development/dom-export.d.ts +1 -2
- package/dist/development/dom-export.js +30 -6122
- package/dist/development/dom-export.mjs +2 -2
- package/dist/development/index.d.ts +1921 -181
- package/dist/development/index.js +40 -44
- package/dist/development/index.mjs +2 -2
- package/dist/development/lib/types/route-module.d.ts +1 -1
- package/dist/development/lib/types/route-module.js +1 -1
- package/dist/development/lib/types/route-module.mjs +1 -1
- package/dist/development/{route-data-BvrN3Sw4.d.ts → route-data-fNWkI-4T.d.ts} +1 -1
- package/dist/production/{chunk-N6ZF3R6Q.mjs → chunk-P2C2EGLF.mjs} +40 -44
- package/dist/production/dom-export.d.ts +1 -2
- package/dist/production/dom-export.js +30 -6122
- package/dist/production/dom-export.mjs +2 -2
- package/dist/production/index.d.ts +1921 -181
- package/dist/production/index.js +40 -44
- package/dist/production/index.mjs +2 -2
- package/dist/production/lib/types/route-module.d.ts +1 -1
- package/dist/production/lib/types/route-module.js +1 -1
- package/dist/production/lib/types/route-module.mjs +1 -1
- package/dist/production/{route-data-BvrN3Sw4.d.ts → route-data-fNWkI-4T.d.ts} +1 -1
- package/package.json +1 -4
- package/dist/development/fog-of-war-k8KWkMZc.d.ts +0 -1746
- package/dist/production/fog-of-war-k8KWkMZc.d.ts +0 -1746
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-818f8e08d
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -974,57 +974,53 @@ function createRouter(init) {
|
|
|
974
974
|
let initialMatches = matchRoutes(dataRoutes, init.history.location, basename);
|
|
975
975
|
let initialMatchesIsFOW = false;
|
|
976
976
|
let initialErrors = null;
|
|
977
|
-
let initialized;
|
|
978
977
|
if (initialMatches == null && !init.patchRoutesOnNavigation) {
|
|
979
978
|
let error = getInternalRouterError(404, {
|
|
980
979
|
pathname: init.history.location.pathname
|
|
981
980
|
});
|
|
982
981
|
let { matches, route } = getShortCircuitMatches(dataRoutes);
|
|
983
|
-
initialized = true;
|
|
984
982
|
initialMatches = matches;
|
|
985
983
|
initialErrors = { [route.id]: error };
|
|
986
|
-
}
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
}
|
|
984
|
+
}
|
|
985
|
+
if (initialMatches && !init.hydrationData) {
|
|
986
|
+
let fogOfWar = checkFogOfWar(
|
|
987
|
+
initialMatches,
|
|
988
|
+
dataRoutes,
|
|
989
|
+
init.history.location.pathname
|
|
990
|
+
);
|
|
991
|
+
if (fogOfWar.active) {
|
|
992
|
+
initialMatches = null;
|
|
996
993
|
}
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
994
|
+
}
|
|
995
|
+
let initialized;
|
|
996
|
+
if (!initialMatches) {
|
|
997
|
+
initialized = false;
|
|
998
|
+
initialMatches = [];
|
|
999
|
+
let fogOfWar = checkFogOfWar(
|
|
1000
|
+
null,
|
|
1001
|
+
dataRoutes,
|
|
1002
|
+
init.history.location.pathname
|
|
1003
|
+
);
|
|
1004
|
+
if (fogOfWar.active && fogOfWar.matches) {
|
|
1005
|
+
initialMatchesIsFOW = true;
|
|
1006
|
+
initialMatches = fogOfWar.matches;
|
|
1007
|
+
}
|
|
1008
|
+
} else if (initialMatches.some((m) => m.route.lazy)) {
|
|
1009
|
+
initialized = false;
|
|
1010
|
+
} else if (!initialMatches.some((m) => m.route.loader)) {
|
|
1011
|
+
initialized = true;
|
|
1012
|
+
} else {
|
|
1013
|
+
let loaderData = init.hydrationData ? init.hydrationData.loaderData : null;
|
|
1014
|
+
let errors = init.hydrationData ? init.hydrationData.errors : null;
|
|
1015
|
+
if (errors) {
|
|
1016
|
+
let idx = initialMatches.findIndex(
|
|
1017
|
+
(m) => errors[m.route.id] !== void 0
|
|
1004
1018
|
);
|
|
1005
|
-
|
|
1006
|
-
initialMatchesIsFOW = true;
|
|
1007
|
-
initialMatches = fogOfWar.matches;
|
|
1008
|
-
}
|
|
1009
|
-
} else if (initialMatches.some((m) => m.route.lazy)) {
|
|
1010
|
-
initialized = false;
|
|
1011
|
-
} else if (!initialMatches.some((m) => m.route.loader)) {
|
|
1012
|
-
initialized = true;
|
|
1019
|
+
initialized = initialMatches.slice(0, idx + 1).every((m) => !shouldLoadRouteOnHydration(m.route, loaderData, errors));
|
|
1013
1020
|
} else {
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
let idx = initialMatches.findIndex(
|
|
1018
|
-
(m) => errors[m.route.id] !== void 0
|
|
1019
|
-
);
|
|
1020
|
-
initialized = initialMatches.slice(0, idx + 1).every(
|
|
1021
|
-
(m) => !shouldLoadRouteOnHydration(m.route, loaderData, errors)
|
|
1022
|
-
);
|
|
1023
|
-
} else {
|
|
1024
|
-
initialized = initialMatches.every(
|
|
1025
|
-
(m) => !shouldLoadRouteOnHydration(m.route, loaderData, errors)
|
|
1026
|
-
);
|
|
1027
|
-
}
|
|
1021
|
+
initialized = initialMatches.every(
|
|
1022
|
+
(m) => !shouldLoadRouteOnHydration(m.route, loaderData, errors)
|
|
1023
|
+
);
|
|
1028
1024
|
}
|
|
1029
1025
|
}
|
|
1030
1026
|
let router;
|
|
@@ -3579,7 +3575,7 @@ function shouldLoadRouteOnHydration(route, loaderData, errors) {
|
|
|
3579
3575
|
if (!route.loader) {
|
|
3580
3576
|
return false;
|
|
3581
3577
|
}
|
|
3582
|
-
let hasData = loaderData != null && route.id
|
|
3578
|
+
let hasData = loaderData != null && loaderData[route.id] !== void 0;
|
|
3583
3579
|
let hasError = errors != null && errors[route.id] !== void 0;
|
|
3584
3580
|
if (!hasData && hasError) {
|
|
3585
3581
|
return false;
|
|
@@ -7969,7 +7965,7 @@ function mergeRefs(...refs) {
|
|
|
7969
7965
|
var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
7970
7966
|
try {
|
|
7971
7967
|
if (isBrowser) {
|
|
7972
|
-
window.__reactRouterVersion = "0.0.0-experimental-
|
|
7968
|
+
window.__reactRouterVersion = "0.0.0-experimental-818f8e08d";
|
|
7973
7969
|
}
|
|
7974
7970
|
} catch (e) {
|
|
7975
7971
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { R as RouterInit } from './route-data-BvrN3Sw4.js';
|
|
2
|
+
import { RouterProviderProps as RouterProviderProps$1, RouterInit } from 'react-router';
|
|
4
3
|
|
|
5
4
|
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
|
|
6
5
|
declare function RouterProvider(props: Omit<RouterProviderProps, "flushSync">): React.JSX.Element;
|