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