@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
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/router-core",
|
|
3
3
|
"author": "Tanner Linsley",
|
|
4
|
-
"version": "0.0.1-beta.
|
|
4
|
+
"version": "0.0.1-beta.203",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "tanstack/router",
|
|
7
7
|
"homepage": "https://tanstack.com/router",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"tiny-warning": "^1.0.3",
|
|
45
45
|
"@tanstack/store": "^0.0.1",
|
|
46
46
|
"@gisatcz/cross-package-react-context": "^0.2.0",
|
|
47
|
-
"@tanstack/history": "0.0.1-beta.
|
|
47
|
+
"@tanstack/history": "0.0.1-beta.203"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "rollup --config rollup.config.js",
|
package/src/router.ts
CHANGED
|
@@ -1682,6 +1682,9 @@ export class Router<
|
|
|
1682
1682
|
)
|
|
1683
1683
|
|
|
1684
1684
|
const fromMatches = this.matchRoutes(fromPathname, from.search)
|
|
1685
|
+
const stayingMatches = matches?.filter((d) =>
|
|
1686
|
+
fromMatches?.find((e) => e.routeId === d.routeId),
|
|
1687
|
+
)
|
|
1685
1688
|
|
|
1686
1689
|
const prevParams = { ...last(fromMatches)?.params }
|
|
1687
1690
|
|
|
@@ -1702,7 +1705,7 @@ export class Router<
|
|
|
1702
1705
|
pathname = interpolatePath(pathname, nextParams ?? {})
|
|
1703
1706
|
|
|
1704
1707
|
const preSearchFilters =
|
|
1705
|
-
|
|
1708
|
+
stayingMatches
|
|
1706
1709
|
?.map(
|
|
1707
1710
|
(match) =>
|
|
1708
1711
|
this.getRoute(match.routeId).options.preSearchFilters ?? [],
|
|
@@ -1711,7 +1714,7 @@ export class Router<
|
|
|
1711
1714
|
.filter(Boolean) ?? []
|
|
1712
1715
|
|
|
1713
1716
|
const postSearchFilters =
|
|
1714
|
-
|
|
1717
|
+
stayingMatches
|
|
1715
1718
|
?.map(
|
|
1716
1719
|
(match) =>
|
|
1717
1720
|
this.getRoute(match.routeId).options.postSearchFilters ?? [],
|
|
@@ -1856,40 +1859,42 @@ export class Router<
|
|
|
1856
1859
|
|
|
1857
1860
|
// If the next urls are the same and we're not replacing,
|
|
1858
1861
|
// do nothing
|
|
1859
|
-
if (isSameUrl
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
__tempLocation: undefined!,
|
|
1878
|
-
key: undefined!,
|
|
1862
|
+
if (!isSameUrl || next.replace) {
|
|
1863
|
+
let { maskedLocation, ...nextHistory } = next
|
|
1864
|
+
|
|
1865
|
+
if (maskedLocation) {
|
|
1866
|
+
nextHistory = {
|
|
1867
|
+
...maskedLocation,
|
|
1868
|
+
state: {
|
|
1869
|
+
...maskedLocation.state,
|
|
1870
|
+
__tempKey: undefined,
|
|
1871
|
+
__tempLocation: {
|
|
1872
|
+
...nextHistory,
|
|
1873
|
+
search: nextHistory.searchStr,
|
|
1874
|
+
state: {
|
|
1875
|
+
...nextHistory.state,
|
|
1876
|
+
__tempKey: undefined!,
|
|
1877
|
+
__tempLocation: undefined!,
|
|
1878
|
+
key: undefined!,
|
|
1879
|
+
},
|
|
1879
1880
|
},
|
|
1880
1881
|
},
|
|
1881
|
-
}
|
|
1882
|
-
}
|
|
1882
|
+
}
|
|
1883
1883
|
|
|
1884
|
-
|
|
1885
|
-
|
|
1884
|
+
if (
|
|
1885
|
+
nextHistory.unmaskOnReload ??
|
|
1886
|
+
this.options.unmaskOnReload ??
|
|
1887
|
+
false
|
|
1888
|
+
) {
|
|
1889
|
+
nextHistory.state.__tempKey = this.tempLocationKey
|
|
1890
|
+
}
|
|
1886
1891
|
}
|
|
1887
|
-
}
|
|
1888
1892
|
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
+
this.history[next.replace ? 'replace' : 'push'](
|
|
1894
|
+
nextHistory.href,
|
|
1895
|
+
nextHistory.state,
|
|
1896
|
+
)
|
|
1897
|
+
}
|
|
1893
1898
|
|
|
1894
1899
|
this.resetNextScroll = next.resetScroll ?? true
|
|
1895
1900
|
|