@tanstack/router-core 1.132.0-alpha.19 → 1.132.0-alpha.20
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/cjs/router.cjs +17 -32
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/esm/router.js +17 -32
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/router.ts +29 -52
package/dist/esm/router.js
CHANGED
|
@@ -936,25 +936,6 @@ class RouterCore {
|
|
|
936
936
|
}
|
|
937
937
|
return rootRouteId;
|
|
938
938
|
})();
|
|
939
|
-
const parseErrors = matchedRoutes.map((route) => {
|
|
940
|
-
let parsedParamsError;
|
|
941
|
-
const parseParams = route.options.params?.parse ?? route.options.parseParams;
|
|
942
|
-
if (parseParams) {
|
|
943
|
-
try {
|
|
944
|
-
const parsedParams = parseParams(routeParams);
|
|
945
|
-
Object.assign(routeParams, parsedParams);
|
|
946
|
-
} catch (err) {
|
|
947
|
-
parsedParamsError = new PathParamError(err.message, {
|
|
948
|
-
cause: err
|
|
949
|
-
});
|
|
950
|
-
if (opts?.throwOnError) {
|
|
951
|
-
throw parsedParamsError;
|
|
952
|
-
}
|
|
953
|
-
return parsedParamsError;
|
|
954
|
-
}
|
|
955
|
-
}
|
|
956
|
-
return;
|
|
957
|
-
});
|
|
958
939
|
const matches = [];
|
|
959
940
|
const getParentContext = (parentMatch) => {
|
|
960
941
|
const parentMatchId = parentMatch?.id;
|
|
@@ -1005,14 +986,22 @@ class RouterCore {
|
|
|
1005
986
|
decodeCharMap: this.pathParamsDecodeCharMap,
|
|
1006
987
|
parseCache: this.parsePathnameCache
|
|
1007
988
|
});
|
|
1008
|
-
const
|
|
1009
|
-
|
|
1010
|
-
const
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
989
|
+
const matchId = interpolatePathResult.interpolatedPath + loaderDepsHash;
|
|
990
|
+
const existingMatch = this.getMatch(matchId);
|
|
991
|
+
const previousMatch = this.state.matches.find(
|
|
992
|
+
(d) => d.routeId === route.id
|
|
993
|
+
);
|
|
994
|
+
const strictParams = existingMatch?._strictParams ?? interpolatePathResult.usedParams;
|
|
995
|
+
let paramsError = void 0;
|
|
996
|
+
if (!existingMatch) {
|
|
997
|
+
const strictParseParams = route.options.params?.parse ?? route.options.parseParams;
|
|
998
|
+
if (strictParseParams) {
|
|
999
|
+
try {
|
|
1000
|
+
Object.assign(
|
|
1001
|
+
strictParams,
|
|
1002
|
+
strictParseParams(strictParams)
|
|
1003
|
+
);
|
|
1004
|
+
} catch (err) {
|
|
1016
1005
|
paramsError = new PathParamError(err.message, {
|
|
1017
1006
|
cause: err
|
|
1018
1007
|
});
|
|
@@ -1022,11 +1011,7 @@ class RouterCore {
|
|
|
1022
1011
|
}
|
|
1023
1012
|
}
|
|
1024
1013
|
}
|
|
1025
|
-
|
|
1026
|
-
const existingMatch = this.getMatch(matchId);
|
|
1027
|
-
const previousMatch = this.state.matches.find(
|
|
1028
|
-
(d) => d.routeId === route.id
|
|
1029
|
-
);
|
|
1014
|
+
Object.assign(routeParams, strictParams);
|
|
1030
1015
|
const cause = previousMatch ? "stay" : "enter";
|
|
1031
1016
|
let match;
|
|
1032
1017
|
if (existingMatch) {
|