@tanstack/router-core 0.0.1-beta.188 → 0.0.1-beta.189
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/history.js.map +1 -1
- package/build/cjs/route.js.map +1 -1
- package/build/cjs/router.js +16 -39
- package/build/cjs/router.js.map +1 -1
- package/build/esm/index.js +16 -39
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +124 -124
- package/build/types/history.d.ts +2 -2
- package/build/types/link.d.ts +1 -2
- package/build/types/router.d.ts +6 -9
- package/build/umd/index.development.js +16 -39
- 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 +1 -1
- package/src/history.ts +5 -5
- package/src/link.ts +2 -10
- package/src/route.ts +4 -13
- package/src/router.ts +25 -50
package/build/esm/index.js
CHANGED
|
@@ -1345,11 +1345,7 @@ class Router {
|
|
|
1345
1345
|
navigate = async ({
|
|
1346
1346
|
from,
|
|
1347
1347
|
to = '',
|
|
1348
|
-
|
|
1349
|
-
hash,
|
|
1350
|
-
replace,
|
|
1351
|
-
params,
|
|
1352
|
-
resetScroll
|
|
1348
|
+
...rest
|
|
1353
1349
|
}) => {
|
|
1354
1350
|
// If this link simply reloads the current route,
|
|
1355
1351
|
// make sure it has a new key so it will trigger a data refresh
|
|
@@ -1365,13 +1361,9 @@ class Router {
|
|
|
1365
1361
|
} catch (e) {}
|
|
1366
1362
|
invariant(!isExternal, 'Attempting to navigate to external url with this.navigate!');
|
|
1367
1363
|
return this.#buildAndCommitLocation({
|
|
1364
|
+
...rest,
|
|
1368
1365
|
from: fromString,
|
|
1369
|
-
to: toString
|
|
1370
|
-
search,
|
|
1371
|
-
hash,
|
|
1372
|
-
params,
|
|
1373
|
-
replace,
|
|
1374
|
-
resetScroll
|
|
1366
|
+
to: toString
|
|
1375
1367
|
});
|
|
1376
1368
|
};
|
|
1377
1369
|
matchRoute = (location, opts) => {
|
|
@@ -1399,28 +1391,23 @@ class Router {
|
|
|
1399
1391
|
}
|
|
1400
1392
|
return match;
|
|
1401
1393
|
};
|
|
1402
|
-
buildLink =
|
|
1403
|
-
from,
|
|
1404
|
-
to = '.',
|
|
1405
|
-
search,
|
|
1406
|
-
params,
|
|
1407
|
-
hash,
|
|
1408
|
-
target,
|
|
1409
|
-
replace,
|
|
1410
|
-
activeOptions,
|
|
1411
|
-
preload,
|
|
1412
|
-
preloadDelay: userPreloadDelay,
|
|
1413
|
-
disabled,
|
|
1414
|
-
state,
|
|
1415
|
-
mask,
|
|
1416
|
-
resetScroll
|
|
1417
|
-
}) => {
|
|
1394
|
+
buildLink = dest => {
|
|
1418
1395
|
// If this link simply reloads the current route,
|
|
1419
1396
|
// make sure it has a new key so it will trigger a data refresh
|
|
1420
1397
|
|
|
1421
1398
|
// If this `to` is a valid external URL, return
|
|
1422
1399
|
// null for LinkUtils
|
|
1423
1400
|
|
|
1401
|
+
const {
|
|
1402
|
+
to,
|
|
1403
|
+
preload: userPreload,
|
|
1404
|
+
preloadDelay: userPreloadDelay,
|
|
1405
|
+
activeOptions,
|
|
1406
|
+
disabled,
|
|
1407
|
+
target,
|
|
1408
|
+
replace,
|
|
1409
|
+
resetScroll
|
|
1410
|
+
} = dest;
|
|
1424
1411
|
try {
|
|
1425
1412
|
new URL(`${to}`);
|
|
1426
1413
|
return {
|
|
@@ -1428,19 +1415,9 @@ class Router {
|
|
|
1428
1415
|
href: to
|
|
1429
1416
|
};
|
|
1430
1417
|
} catch (e) {}
|
|
1431
|
-
const nextOpts =
|
|
1432
|
-
from,
|
|
1433
|
-
to,
|
|
1434
|
-
search,
|
|
1435
|
-
params,
|
|
1436
|
-
hash,
|
|
1437
|
-
replace,
|
|
1438
|
-
state,
|
|
1439
|
-
mask,
|
|
1440
|
-
resetScroll
|
|
1441
|
-
};
|
|
1418
|
+
const nextOpts = dest;
|
|
1442
1419
|
const next = this.buildLocation(nextOpts);
|
|
1443
|
-
preload =
|
|
1420
|
+
const preload = userPreload ?? this.options.defaultPreload;
|
|
1444
1421
|
const preloadDelay = userPreloadDelay ?? this.options.defaultPreloadDelay ?? 0;
|
|
1445
1422
|
|
|
1446
1423
|
// Compare path/hash for matches
|