@tanstack/react-router 1.4.5 → 1.4.6
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/Matches.js.map +1 -1
- package/build/cjs/router.js +5 -2
- package/build/cjs/router.js.map +1 -1
- package/build/esm/index.js +5 -2
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +353 -353
- package/build/types/Matches.d.ts +1 -0
- package/build/umd/index.development.js +5 -2
- 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/Matches.tsx +1 -0
- package/src/router.ts +8 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/react-router",
|
|
3
3
|
"author": "Tanner Linsley",
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.6",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "tanstack/router",
|
|
7
7
|
"homepage": "https://tanstack.com/router",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@tanstack/store": "^0.1.3",
|
|
45
45
|
"tiny-invariant": "^1.3.1",
|
|
46
46
|
"tiny-warning": "^1.0.3",
|
|
47
|
-
"@tanstack/history": "1.4.
|
|
47
|
+
"@tanstack/history": "1.4.6"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "rollup --config rollup.config.js"
|
package/src/Matches.tsx
CHANGED
package/src/router.ts
CHANGED
|
@@ -1058,6 +1058,12 @@ export class Router<
|
|
|
1058
1058
|
const parentContext =
|
|
1059
1059
|
parentMatch?.context ?? this.options.context ?? {}
|
|
1060
1060
|
|
|
1061
|
+
const pendingMs =
|
|
1062
|
+
route.options.pendingMs ?? this.options.defaultPendingMs
|
|
1063
|
+
const pendingPromise = new Promise<void>((r) =>
|
|
1064
|
+
setTimeout(r, pendingMs),
|
|
1065
|
+
)
|
|
1066
|
+
|
|
1061
1067
|
const beforeLoadContext =
|
|
1062
1068
|
(await route.options.beforeLoad?.({
|
|
1063
1069
|
search: match.search,
|
|
@@ -1090,6 +1096,7 @@ export class Router<
|
|
|
1090
1096
|
),
|
|
1091
1097
|
context: replaceEqualDeep(match.context, context),
|
|
1092
1098
|
abortController,
|
|
1099
|
+
pendingPromise,
|
|
1093
1100
|
}
|
|
1094
1101
|
} catch (err) {
|
|
1095
1102
|
handleErrorAndRedirect(err, 'BEFORE_LOAD')
|
|
@@ -1274,7 +1281,7 @@ export class Router<
|
|
|
1274
1281
|
// If we need to potentially show the pending component,
|
|
1275
1282
|
// start a timer to show it after the pendingMs
|
|
1276
1283
|
if (shouldPending) {
|
|
1277
|
-
|
|
1284
|
+
match.pendingPromise?.then(async () => {
|
|
1278
1285
|
if ((latestPromise = checkLatest())) return latestPromise
|
|
1279
1286
|
|
|
1280
1287
|
didShowPending = true
|