@tanstack/router-core 0.0.1-alpha.5 → 0.0.1-alpha.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/packages/router-core/src/index.js +9 -4
- package/build/cjs/packages/router-core/src/index.js.map +1 -1
- package/build/esm/index.js +9 -4
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +42 -42
- package/build/types/index.d.ts +4 -1
- package/build/umd/index.development.js +9 -4
- 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/index.ts +11 -5
package/build/stats-html.html
CHANGED
|
@@ -4014,7 +4014,7 @@ var drawChart = (function (exports) {
|
|
|
4014
4014
|
</script>
|
|
4015
4015
|
<script>
|
|
4016
4016
|
/*<!--*/
|
|
4017
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"uid":"
|
|
4017
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"uid":"19e6-1","name":"\u0000rollupPluginBabelHelpers.js"},{"name":"node_modules","children":[{"name":"@babel/runtime/helpers/esm/extends.js","uid":"19e6-3"},{"name":"history/index.js","uid":"19e6-5"},{"name":"tiny-invariant/dist/esm/tiny-invariant.js","uid":"19e6-7"}]},{"name":"packages/router-core/src","children":[{"uid":"19e6-9","name":"qss.ts"},{"uid":"19e6-11","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"19e6-1":{"renderedLength":437,"gzipLength":243,"brotliLength":0,"mainUid":"19e6-0"},"19e6-3":{"renderedLength":431,"gzipLength":240,"brotliLength":0,"mainUid":"19e6-2"},"19e6-5":{"renderedLength":20618,"gzipLength":3797,"brotliLength":0,"mainUid":"19e6-4"},"19e6-7":{"renderedLength":181,"gzipLength":129,"brotliLength":0,"mainUid":"19e6-6"},"19e6-9":{"renderedLength":1241,"gzipLength":523,"brotliLength":0,"mainUid":"19e6-8"},"19e6-11":{"renderedLength":46842,"gzipLength":10342,"brotliLength":0,"mainUid":"19e6-10"}},"nodeMetas":{"19e6-0":{"id":"\u0000rollupPluginBabelHelpers.js","moduleParts":{"index.production.js":"19e6-1"},"imported":[],"importedBy":[{"uid":"19e6-10"}]},"19e6-2":{"id":"/node_modules/@babel/runtime/helpers/esm/extends.js","moduleParts":{"index.production.js":"19e6-3"},"imported":[],"importedBy":[{"uid":"19e6-4"}]},"19e6-4":{"id":"/node_modules/history/index.js","moduleParts":{"index.production.js":"19e6-5"},"imported":[{"uid":"19e6-2"}],"importedBy":[{"uid":"19e6-10"}]},"19e6-6":{"id":"/node_modules/tiny-invariant/dist/esm/tiny-invariant.js","moduleParts":{"index.production.js":"19e6-7"},"imported":[],"importedBy":[{"uid":"19e6-10"}]},"19e6-8":{"id":"/packages/router-core/src/qss.ts","moduleParts":{"index.production.js":"19e6-9"},"imported":[],"importedBy":[{"uid":"19e6-10"}]},"19e6-10":{"id":"/packages/router-core/src/index.ts","moduleParts":{"index.production.js":"19e6-11"},"imported":[{"uid":"19e6-0"},{"uid":"19e6-4"},{"uid":"19e6-6"},{"uid":"19e6-8"}],"importedBy":[],"isEntry":true}},"env":{"rollup":"2.77.2"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
|
|
4018
4018
|
|
|
4019
4019
|
const run = () => {
|
|
4020
4020
|
const width = window.innerWidth;
|
package/build/stats-react.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"name": "index.production.js",
|
|
8
8
|
"children": [
|
|
9
9
|
{
|
|
10
|
-
"uid": "
|
|
10
|
+
"uid": "19e6-13",
|
|
11
11
|
"name": "\u0000rollupPluginBabelHelpers.js"
|
|
12
12
|
},
|
|
13
13
|
{
|
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
"children": [
|
|
16
16
|
{
|
|
17
17
|
"name": "@babel/runtime/helpers/esm/extends.js",
|
|
18
|
-
"uid": "
|
|
18
|
+
"uid": "19e6-15"
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
"name": "history/index.js",
|
|
22
|
-
"uid": "
|
|
22
|
+
"uid": "19e6-17"
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"name": "tiny-invariant/dist/esm/tiny-invariant.js",
|
|
26
|
-
"uid": "
|
|
26
|
+
"uid": "19e6-19"
|
|
27
27
|
}
|
|
28
28
|
]
|
|
29
29
|
},
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"name": "packages/router-core/src",
|
|
32
32
|
"children": [
|
|
33
33
|
{
|
|
34
|
-
"uid": "
|
|
34
|
+
"uid": "19e6-21",
|
|
35
35
|
"name": "qss.ts"
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
|
-
"uid": "
|
|
38
|
+
"uid": "19e6-23",
|
|
39
39
|
"name": "index.ts"
|
|
40
40
|
}
|
|
41
41
|
]
|
|
@@ -46,125 +46,125 @@
|
|
|
46
46
|
"isRoot": true
|
|
47
47
|
},
|
|
48
48
|
"nodeParts": {
|
|
49
|
-
"
|
|
49
|
+
"19e6-13": {
|
|
50
50
|
"renderedLength": 437,
|
|
51
51
|
"gzipLength": 243,
|
|
52
52
|
"brotliLength": 0,
|
|
53
|
-
"mainUid": "
|
|
53
|
+
"mainUid": "19e6-12"
|
|
54
54
|
},
|
|
55
|
-
"
|
|
55
|
+
"19e6-15": {
|
|
56
56
|
"renderedLength": 431,
|
|
57
57
|
"gzipLength": 240,
|
|
58
58
|
"brotliLength": 0,
|
|
59
|
-
"mainUid": "
|
|
59
|
+
"mainUid": "19e6-14"
|
|
60
60
|
},
|
|
61
|
-
"
|
|
61
|
+
"19e6-17": {
|
|
62
62
|
"renderedLength": 20618,
|
|
63
63
|
"gzipLength": 3797,
|
|
64
64
|
"brotliLength": 0,
|
|
65
|
-
"mainUid": "
|
|
65
|
+
"mainUid": "19e6-16"
|
|
66
66
|
},
|
|
67
|
-
"
|
|
67
|
+
"19e6-19": {
|
|
68
68
|
"renderedLength": 181,
|
|
69
69
|
"gzipLength": 129,
|
|
70
70
|
"brotliLength": 0,
|
|
71
|
-
"mainUid": "
|
|
71
|
+
"mainUid": "19e6-18"
|
|
72
72
|
},
|
|
73
|
-
"
|
|
73
|
+
"19e6-21": {
|
|
74
74
|
"renderedLength": 1241,
|
|
75
75
|
"gzipLength": 523,
|
|
76
76
|
"brotliLength": 0,
|
|
77
|
-
"mainUid": "
|
|
77
|
+
"mainUid": "19e6-20"
|
|
78
78
|
},
|
|
79
|
-
"
|
|
80
|
-
"renderedLength":
|
|
81
|
-
"gzipLength":
|
|
79
|
+
"19e6-23": {
|
|
80
|
+
"renderedLength": 46842,
|
|
81
|
+
"gzipLength": 10342,
|
|
82
82
|
"brotliLength": 0,
|
|
83
|
-
"mainUid": "
|
|
83
|
+
"mainUid": "19e6-22"
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
86
|
"nodeMetas": {
|
|
87
|
-
"
|
|
87
|
+
"19e6-12": {
|
|
88
88
|
"id": "\u0000rollupPluginBabelHelpers.js",
|
|
89
89
|
"moduleParts": {
|
|
90
|
-
"index.production.js": "
|
|
90
|
+
"index.production.js": "19e6-13"
|
|
91
91
|
},
|
|
92
92
|
"imported": [],
|
|
93
93
|
"importedBy": [
|
|
94
94
|
{
|
|
95
|
-
"uid": "
|
|
95
|
+
"uid": "19e6-22"
|
|
96
96
|
}
|
|
97
97
|
]
|
|
98
98
|
},
|
|
99
|
-
"
|
|
99
|
+
"19e6-14": {
|
|
100
100
|
"id": "/node_modules/@babel/runtime/helpers/esm/extends.js",
|
|
101
101
|
"moduleParts": {
|
|
102
|
-
"index.production.js": "
|
|
102
|
+
"index.production.js": "19e6-15"
|
|
103
103
|
},
|
|
104
104
|
"imported": [],
|
|
105
105
|
"importedBy": [
|
|
106
106
|
{
|
|
107
|
-
"uid": "
|
|
107
|
+
"uid": "19e6-16"
|
|
108
108
|
}
|
|
109
109
|
]
|
|
110
110
|
},
|
|
111
|
-
"
|
|
111
|
+
"19e6-16": {
|
|
112
112
|
"id": "/node_modules/history/index.js",
|
|
113
113
|
"moduleParts": {
|
|
114
|
-
"index.production.js": "
|
|
114
|
+
"index.production.js": "19e6-17"
|
|
115
115
|
},
|
|
116
116
|
"imported": [
|
|
117
117
|
{
|
|
118
|
-
"uid": "
|
|
118
|
+
"uid": "19e6-14"
|
|
119
119
|
}
|
|
120
120
|
],
|
|
121
121
|
"importedBy": [
|
|
122
122
|
{
|
|
123
|
-
"uid": "
|
|
123
|
+
"uid": "19e6-22"
|
|
124
124
|
}
|
|
125
125
|
]
|
|
126
126
|
},
|
|
127
|
-
"
|
|
127
|
+
"19e6-18": {
|
|
128
128
|
"id": "/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
|
|
129
129
|
"moduleParts": {
|
|
130
|
-
"index.production.js": "
|
|
130
|
+
"index.production.js": "19e6-19"
|
|
131
131
|
},
|
|
132
132
|
"imported": [],
|
|
133
133
|
"importedBy": [
|
|
134
134
|
{
|
|
135
|
-
"uid": "
|
|
135
|
+
"uid": "19e6-22"
|
|
136
136
|
}
|
|
137
137
|
]
|
|
138
138
|
},
|
|
139
|
-
"
|
|
139
|
+
"19e6-20": {
|
|
140
140
|
"id": "/packages/router-core/src/qss.ts",
|
|
141
141
|
"moduleParts": {
|
|
142
|
-
"index.production.js": "
|
|
142
|
+
"index.production.js": "19e6-21"
|
|
143
143
|
},
|
|
144
144
|
"imported": [],
|
|
145
145
|
"importedBy": [
|
|
146
146
|
{
|
|
147
|
-
"uid": "
|
|
147
|
+
"uid": "19e6-22"
|
|
148
148
|
}
|
|
149
149
|
]
|
|
150
150
|
},
|
|
151
|
-
"
|
|
151
|
+
"19e6-22": {
|
|
152
152
|
"id": "/packages/router-core/src/index.ts",
|
|
153
153
|
"moduleParts": {
|
|
154
|
-
"index.production.js": "
|
|
154
|
+
"index.production.js": "19e6-23"
|
|
155
155
|
},
|
|
156
156
|
"imported": [
|
|
157
157
|
{
|
|
158
|
-
"uid": "
|
|
158
|
+
"uid": "19e6-12"
|
|
159
159
|
},
|
|
160
160
|
{
|
|
161
|
-
"uid": "
|
|
161
|
+
"uid": "19e6-16"
|
|
162
162
|
},
|
|
163
163
|
{
|
|
164
|
-
"uid": "
|
|
164
|
+
"uid": "19e6-18"
|
|
165
165
|
},
|
|
166
166
|
{
|
|
167
|
-
"uid": "
|
|
167
|
+
"uid": "19e6-20"
|
|
168
168
|
}
|
|
169
169
|
],
|
|
170
170
|
"importedBy": [],
|
package/build/types/index.d.ts
CHANGED
|
@@ -457,7 +457,9 @@ declare type SearchParamOptions<TAllRouteInfo extends AnyAllRouteInfo, TFrom, TT
|
|
|
457
457
|
} : {
|
|
458
458
|
search: SearchReducer<TFromSchema, TToSchema>;
|
|
459
459
|
};
|
|
460
|
-
declare type SearchReducer<TFrom, TTo> =
|
|
460
|
+
declare type SearchReducer<TFrom, TTo> = {
|
|
461
|
+
[TKey in keyof TTo]: TTo[TKey];
|
|
462
|
+
} | ((current: TFrom) => TTo);
|
|
461
463
|
declare type PathParamOptions<TAllRouteInfo extends AnyAllRouteInfo, TFrom, TTo, TFromParams = RouteInfoByPath<TAllRouteInfo, TFrom>['allParams'], TToParams = RouteInfoByPath<TAllRouteInfo, TTo>['allParams']> = StartsWith<TFrom, TTo> extends true ? {
|
|
462
464
|
params?: ParamsReducer<TFromParams, TToParams>;
|
|
463
465
|
} : AnyPathParams extends TToParams ? {
|
|
@@ -509,6 +511,7 @@ interface RouteMatch<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo
|
|
|
509
511
|
};
|
|
510
512
|
cancel: () => void;
|
|
511
513
|
load: () => Promise<void>;
|
|
514
|
+
invalidate: () => void;
|
|
512
515
|
}
|
|
513
516
|
declare function createRouteMatch<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TRouteInfo extends AnyRouteInfo = RouteInfo>(router: Router<any, any>, route: Route<TAllRouteInfo, TRouteInfo>, opts: {
|
|
514
517
|
matchId: string;
|
|
@@ -1202,7 +1202,6 @@
|
|
|
1202
1202
|
router.startedLoadingAt = id;
|
|
1203
1203
|
|
|
1204
1204
|
if (next) {
|
|
1205
|
-
// If the location.href has changed
|
|
1206
1205
|
// Ingest the new location
|
|
1207
1206
|
router.location = next;
|
|
1208
1207
|
} // Clear out old actions
|
|
@@ -1447,7 +1446,7 @@
|
|
|
1447
1446
|
const unloadedMatchIds = router.matchRoutes(next.pathname).map(d => d.matchId);
|
|
1448
1447
|
[...router.state.matches, ...((_router$state$pending5 = (_router$state$pending6 = router.state.pending) == null ? void 0 : _router$state$pending6.matches) != null ? _router$state$pending5 : [])].forEach(match => {
|
|
1449
1448
|
if (unloadedMatchIds.includes(match.matchId)) {
|
|
1450
|
-
match.
|
|
1449
|
+
match.invalidate();
|
|
1451
1450
|
}
|
|
1452
1451
|
});
|
|
1453
1452
|
},
|
|
@@ -1494,7 +1493,8 @@
|
|
|
1494
1493
|
to = '.',
|
|
1495
1494
|
search,
|
|
1496
1495
|
hash,
|
|
1497
|
-
replace
|
|
1496
|
+
replace,
|
|
1497
|
+
params
|
|
1498
1498
|
} = _ref2;
|
|
1499
1499
|
// If this link simply reloads the current route,
|
|
1500
1500
|
// make sure it has a new key so it will trigger a data refresh
|
|
@@ -1514,7 +1514,9 @@
|
|
|
1514
1514
|
from: fromString,
|
|
1515
1515
|
to: toString,
|
|
1516
1516
|
search,
|
|
1517
|
-
hash
|
|
1517
|
+
hash,
|
|
1518
|
+
replace,
|
|
1519
|
+
params
|
|
1518
1520
|
});
|
|
1519
1521
|
},
|
|
1520
1522
|
buildLink: _ref3 => {
|
|
@@ -1852,6 +1854,9 @@
|
|
|
1852
1854
|
|
|
1853
1855
|
routeMatch.__.cancelPending();
|
|
1854
1856
|
},
|
|
1857
|
+
invalidate: () => {
|
|
1858
|
+
routeMatch.isInvalid = true;
|
|
1859
|
+
},
|
|
1855
1860
|
load: async () => {
|
|
1856
1861
|
const id = '' + Date.now() + Math.random();
|
|
1857
1862
|
routeMatch.__.latestId = id; // If the match was in an error state, set it
|