@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.
@@ -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 strictParams = interpolatePathResult.usedParams;
1009
- let paramsError = parseErrors[index];
1010
- const strictParseParams = route.options.params?.parse ?? route.options.parseParams;
1011
- if (strictParseParams) {
1012
- try {
1013
- Object.assign(strictParams, strictParseParams(strictParams));
1014
- } catch (err) {
1015
- if (!paramsError) {
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
- const matchId = interpolatePathResult.interpolatedPath + loaderDepsHash;
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) {