@tanstack/router-core 1.115.3 → 1.117.1

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.
@@ -774,9 +774,17 @@ class RouterCore {
774
774
  if (shouldViewTransition && typeof document !== "undefined" && "startViewTransition" in document && typeof document.startViewTransition === "function") {
775
775
  let startViewTransitionParams;
776
776
  if (typeof shouldViewTransition === "object" && this.isViewTransitionTypesSupported) {
777
+ const next = this.latestLocation;
778
+ const prevLocation = this.state.resolvedLocation;
779
+ const resolvedViewTransitionTypes = typeof shouldViewTransition.types === "function" ? shouldViewTransition.types(
780
+ getLocationChangeInfo({
781
+ resolvedLocation: prevLocation,
782
+ location: next
783
+ })
784
+ ) : shouldViewTransition.types;
777
785
  startViewTransitionParams = {
778
786
  update: fn,
779
- types: shouldViewTransition.types
787
+ types: resolvedViewTransitionTypes
780
788
  };
781
789
  } else {
782
790
  startViewTransitionParams = fn;
@@ -832,9 +840,6 @@ class RouterCore {
832
840
  const resolvePreload = (matchId) => {
833
841
  return !!(allPreload && !this.state.matches.find((d) => d.id === matchId));
834
842
  };
835
- if (!this.isServer && !this.state.matches.length) {
836
- triggerOnReady();
837
- }
838
843
  const handleRedirectAndNotFound = (match, err) => {
839
844
  var _a, _b, _c, _d;
840
845
  if (redirect.isResolvedRedirect(err)) {
@@ -915,7 +920,7 @@ class RouterCore {
915
920
  const parentMatchId = (_a = matches[index - 1]) == null ? void 0 : _a.id;
916
921
  const route = this.looseRoutesById[routeId];
917
922
  const pendingMs = route.options.pendingMs ?? this.options.defaultPendingMs;
918
- const shouldPending = !!(onReady && !this.isServer && !resolvePreload(matchId) && (route.options.loader || route.options.beforeLoad) && typeof pendingMs === "number" && pendingMs !== Infinity && (route.options.pendingComponent ?? ((_b = this.options) == null ? void 0 : _b.defaultPendingComponent)));
923
+ const shouldPending = !!(onReady && !this.isServer && !resolvePreload(matchId) && (route.options.loader || route.options.beforeLoad || routeNeedsPreload(route)) && typeof pendingMs === "number" && pendingMs !== Infinity && (route.options.pendingComponent ?? ((_b = this.options) == null ? void 0 : _b.defaultPendingComponent)));
919
924
  let executeBeforeLoad = true;
920
925
  if (
921
926
  // If we are in the middle of a load, either of these will be present
@@ -1103,6 +1108,7 @@ class RouterCore {
1103
1108
  const headers = (_h = (_g = route.options).headers) == null ? void 0 : _h.call(_g, {
1104
1109
  loaderData
1105
1110
  });
1111
+ await route._componentsPromise;
1106
1112
  updateMatch(matchId, (prev) => ({
1107
1113
  ...prev,
1108
1114
  error: void 0,
@@ -1140,7 +1146,6 @@ class RouterCore {
1140
1146
  router: this,
1141
1147
  match: this.getMatch(matchId)
1142
1148
  });
1143
- await route._componentsPromise;
1144
1149
  } catch (err) {
1145
1150
  updateMatch(matchId, (prev) => ({
1146
1151
  ...prev,