@tanstack/router-core 0.0.1-beta.202 → 0.0.1-beta.203
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/build/cjs/router.js +27 -27
- package/build/cjs/router.js.map +1 -1
- package/build/esm/index.js +27 -27
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +124 -124
- package/build/umd/index.development.js +27 -27
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +2 -2
- package/src/router.ts +36 -31
|
@@ -1872,6 +1872,7 @@
|
|
|
1872
1872
|
const fromPathname = dest.from ?? from.pathname;
|
|
1873
1873
|
let pathname = resolvePath(this.basepath ?? '/', fromPathname, `${dest.to ?? ''}`);
|
|
1874
1874
|
const fromMatches = this.matchRoutes(fromPathname, from.search);
|
|
1875
|
+
const stayingMatches = matches?.filter(d => fromMatches?.find(e => e.routeId === d.routeId));
|
|
1875
1876
|
const prevParams = {
|
|
1876
1877
|
...last(fromMatches)?.params
|
|
1877
1878
|
};
|
|
@@ -1885,8 +1886,8 @@
|
|
|
1885
1886
|
});
|
|
1886
1887
|
}
|
|
1887
1888
|
pathname = interpolatePath(pathname, nextParams ?? {});
|
|
1888
|
-
const preSearchFilters =
|
|
1889
|
-
const postSearchFilters =
|
|
1889
|
+
const preSearchFilters = stayingMatches?.map(match => this.getRoute(match.routeId).options.preSearchFilters ?? []).flat().filter(Boolean) ?? [];
|
|
1890
|
+
const postSearchFilters = stayingMatches?.map(match => this.getRoute(match.routeId).options.postSearchFilters ?? []).flat().filter(Boolean) ?? [];
|
|
1890
1891
|
|
|
1891
1892
|
// Pre filters first
|
|
1892
1893
|
const preFilteredSearch = preSearchFilters?.length ? preSearchFilters?.reduce((prev, next) => next(prev), from.search) : from.search;
|
|
@@ -1975,36 +1976,35 @@
|
|
|
1975
1976
|
|
|
1976
1977
|
// If the next urls are the same and we're not replacing,
|
|
1977
1978
|
// do nothing
|
|
1978
|
-
if (isSameUrl
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
key: undefined
|
|
1979
|
+
if (!isSameUrl || next.replace) {
|
|
1980
|
+
let {
|
|
1981
|
+
maskedLocation,
|
|
1982
|
+
...nextHistory
|
|
1983
|
+
} = next;
|
|
1984
|
+
if (maskedLocation) {
|
|
1985
|
+
nextHistory = {
|
|
1986
|
+
...maskedLocation,
|
|
1987
|
+
state: {
|
|
1988
|
+
...maskedLocation.state,
|
|
1989
|
+
__tempKey: undefined,
|
|
1990
|
+
__tempLocation: {
|
|
1991
|
+
...nextHistory,
|
|
1992
|
+
search: nextHistory.searchStr,
|
|
1993
|
+
state: {
|
|
1994
|
+
...nextHistory.state,
|
|
1995
|
+
__tempKey: undefined,
|
|
1996
|
+
__tempLocation: undefined,
|
|
1997
|
+
key: undefined
|
|
1998
|
+
}
|
|
1999
1999
|
}
|
|
2000
2000
|
}
|
|
2001
|
+
};
|
|
2002
|
+
if (nextHistory.unmaskOnReload ?? this.options.unmaskOnReload ?? false) {
|
|
2003
|
+
nextHistory.state.__tempKey = this.tempLocationKey;
|
|
2001
2004
|
}
|
|
2002
|
-
};
|
|
2003
|
-
if (nextHistory.unmaskOnReload ?? this.options.unmaskOnReload ?? false) {
|
|
2004
|
-
nextHistory.state.__tempKey = this.tempLocationKey;
|
|
2005
2005
|
}
|
|
2006
|
+
this.history[next.replace ? 'replace' : 'push'](nextHistory.href, nextHistory.state);
|
|
2006
2007
|
}
|
|
2007
|
-
this.history[next.replace ? 'replace' : 'push'](nextHistory.href, nextHistory.state);
|
|
2008
2008
|
this.resetNextScroll = next.resetScroll ?? true;
|
|
2009
2009
|
return this.latestLoadPromise;
|
|
2010
2010
|
};
|