@tanstack/react-router 0.0.1-beta.72 → 0.0.1-beta.74

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.
@@ -4024,7 +4024,7 @@ var drawChart = (function (exports) {
4024
4024
  </script>
4025
4025
  <script>
4026
4026
  /*<!--*/
4027
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"uid":"7ba6-93","name":"\u0000rollupPluginBabelHelpers.js"},{"name":"node_modules/.pnpm","children":[{"name":"tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js","uid":"7ba6-95"},{"name":"tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js","uid":"7ba6-97"}]},{"name":"packages","children":[{"name":"store/build/esm/index.js","uid":"7ba6-99"},{"name":"router/build/esm/index.js","uid":"7ba6-101"},{"name":"react-store/build/esm/index.js","uid":"7ba6-103"},{"name":"react-router/src/index.tsx","uid":"7ba6-105"}]}]}],"isRoot":true},"nodeParts":{"7ba6-93":{"renderedLength":429,"gzipLength":238,"brotliLength":0,"mainUid":"7ba6-92"},"7ba6-95":{"renderedLength":181,"gzipLength":129,"brotliLength":0,"mainUid":"7ba6-94"},"7ba6-97":{"renderedLength":44,"gzipLength":62,"brotliLength":0,"mainUid":"7ba6-96"},"7ba6-99":{"renderedLength":1288,"gzipLength":497,"brotliLength":0,"mainUid":"7ba6-98"},"7ba6-101":{"renderedLength":46930,"gzipLength":11106,"brotliLength":0,"mainUid":"7ba6-100"},"7ba6-103":{"renderedLength":1571,"gzipLength":594,"brotliLength":0,"mainUid":"7ba6-102"},"7ba6-105":{"renderedLength":12514,"gzipLength":3242,"brotliLength":0,"mainUid":"7ba6-104"}},"nodeMetas":{"7ba6-92":{"id":"\u0000rollupPluginBabelHelpers.js","moduleParts":{"index.production.js":"7ba6-93"},"imported":[],"importedBy":[{"uid":"7ba6-104"}]},"7ba6-94":{"id":"/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js","moduleParts":{"index.production.js":"7ba6-95"},"imported":[],"importedBy":[{"uid":"7ba6-100"}]},"7ba6-96":{"id":"/node_modules/.pnpm/tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js","moduleParts":{"index.production.js":"7ba6-97"},"imported":[],"importedBy":[{"uid":"7ba6-100"}]},"7ba6-98":{"id":"/packages/store/build/esm/index.js","moduleParts":{"index.production.js":"7ba6-99"},"imported":[],"importedBy":[{"uid":"7ba6-100"}]},"7ba6-100":{"id":"/packages/router/build/esm/index.js","moduleParts":{"index.production.js":"7ba6-101"},"imported":[{"uid":"7ba6-94"},{"uid":"7ba6-96"},{"uid":"7ba6-98"}],"importedBy":[{"uid":"7ba6-104"}]},"7ba6-102":{"id":"/packages/react-store/build/esm/index.js","moduleParts":{"index.production.js":"7ba6-103"},"imported":[{"uid":"7ba6-107"}],"importedBy":[{"uid":"7ba6-104"}]},"7ba6-104":{"id":"/packages/react-router/src/index.tsx","moduleParts":{"index.production.js":"7ba6-105"},"imported":[{"uid":"7ba6-92"},{"uid":"7ba6-106"},{"uid":"7ba6-100"},{"uid":"7ba6-102"}],"importedBy":[],"isEntry":true},"7ba6-106":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"7ba6-104"}],"isExternal":true},"7ba6-107":{"id":"use-sync-external-store/shim/with-selector","moduleParts":{},"imported":[],"importedBy":[{"uid":"7ba6-102"}],"isExternal":true}},"env":{"rollup":"2.79.1"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
4027
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"uid":"ef61-93","name":"\u0000rollupPluginBabelHelpers.js"},{"name":"node_modules/.pnpm","children":[{"name":"tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js","uid":"ef61-95"},{"name":"tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js","uid":"ef61-97"}]},{"name":"packages","children":[{"name":"store/build/esm/index.js","uid":"ef61-99"},{"name":"router/build/esm/index.js","uid":"ef61-101"},{"name":"react-store/build/esm/index.js","uid":"ef61-103"},{"name":"react-router/src/index.tsx","uid":"ef61-105"}]}]}],"isRoot":true},"nodeParts":{"ef61-93":{"renderedLength":429,"gzipLength":238,"brotliLength":0,"mainUid":"ef61-92"},"ef61-95":{"renderedLength":181,"gzipLength":129,"brotliLength":0,"mainUid":"ef61-94"},"ef61-97":{"renderedLength":44,"gzipLength":62,"brotliLength":0,"mainUid":"ef61-96"},"ef61-99":{"renderedLength":1288,"gzipLength":497,"brotliLength":0,"mainUid":"ef61-98"},"ef61-101":{"renderedLength":46875,"gzipLength":11092,"brotliLength":0,"mainUid":"ef61-100"},"ef61-103":{"renderedLength":1571,"gzipLength":594,"brotliLength":0,"mainUid":"ef61-102"},"ef61-105":{"renderedLength":12514,"gzipLength":3242,"brotliLength":0,"mainUid":"ef61-104"}},"nodeMetas":{"ef61-92":{"id":"\u0000rollupPluginBabelHelpers.js","moduleParts":{"index.production.js":"ef61-93"},"imported":[],"importedBy":[{"uid":"ef61-104"}]},"ef61-94":{"id":"/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js","moduleParts":{"index.production.js":"ef61-95"},"imported":[],"importedBy":[{"uid":"ef61-100"}]},"ef61-96":{"id":"/node_modules/.pnpm/tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js","moduleParts":{"index.production.js":"ef61-97"},"imported":[],"importedBy":[{"uid":"ef61-100"}]},"ef61-98":{"id":"/packages/store/build/esm/index.js","moduleParts":{"index.production.js":"ef61-99"},"imported":[],"importedBy":[{"uid":"ef61-100"}]},"ef61-100":{"id":"/packages/router/build/esm/index.js","moduleParts":{"index.production.js":"ef61-101"},"imported":[{"uid":"ef61-94"},{"uid":"ef61-96"},{"uid":"ef61-98"}],"importedBy":[{"uid":"ef61-104"}]},"ef61-102":{"id":"/packages/react-store/build/esm/index.js","moduleParts":{"index.production.js":"ef61-103"},"imported":[{"uid":"ef61-107"}],"importedBy":[{"uid":"ef61-104"}]},"ef61-104":{"id":"/packages/react-router/src/index.tsx","moduleParts":{"index.production.js":"ef61-105"},"imported":[{"uid":"ef61-92"},{"uid":"ef61-106"},{"uid":"ef61-100"},{"uid":"ef61-102"}],"importedBy":[],"isEntry":true},"ef61-106":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"ef61-104"}],"isExternal":true},"ef61-107":{"id":"use-sync-external-store/shim/with-selector","moduleParts":{},"imported":[],"importedBy":[{"uid":"ef61-102"}],"isExternal":true}},"env":{"rollup":"2.79.1"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
4028
4028
 
4029
4029
  const run = () => {
4030
4030
  const width = window.innerWidth;
@@ -7,7 +7,7 @@
7
7
  "name": "index.production.js",
8
8
  "children": [
9
9
  {
10
- "uid": "7ba6-109",
10
+ "uid": "ef61-109",
11
11
  "name": "\u0000rollupPluginBabelHelpers.js"
12
12
  },
13
13
  {
@@ -15,11 +15,11 @@
15
15
  "children": [
16
16
  {
17
17
  "name": "tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
18
- "uid": "7ba6-111"
18
+ "uid": "ef61-111"
19
19
  },
20
20
  {
21
21
  "name": "tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js",
22
- "uid": "7ba6-113"
22
+ "uid": "ef61-113"
23
23
  }
24
24
  ]
25
25
  },
@@ -28,19 +28,19 @@
28
28
  "children": [
29
29
  {
30
30
  "name": "store/build/esm/index.js",
31
- "uid": "7ba6-115"
31
+ "uid": "ef61-115"
32
32
  },
33
33
  {
34
34
  "name": "router/build/esm/index.js",
35
- "uid": "7ba6-117"
35
+ "uid": "ef61-117"
36
36
  },
37
37
  {
38
38
  "name": "react-store/build/esm/index.js",
39
- "uid": "7ba6-119"
39
+ "uid": "ef61-119"
40
40
  },
41
41
  {
42
42
  "name": "react-router/src/index.tsx",
43
- "uid": "7ba6-121"
43
+ "uid": "ef61-121"
44
44
  }
45
45
  ]
46
46
  }
@@ -50,176 +50,176 @@
50
50
  "isRoot": true
51
51
  },
52
52
  "nodeParts": {
53
- "7ba6-109": {
53
+ "ef61-109": {
54
54
  "renderedLength": 429,
55
55
  "gzipLength": 238,
56
56
  "brotliLength": 0,
57
- "mainUid": "7ba6-108"
57
+ "mainUid": "ef61-108"
58
58
  },
59
- "7ba6-111": {
59
+ "ef61-111": {
60
60
  "renderedLength": 181,
61
61
  "gzipLength": 129,
62
62
  "brotliLength": 0,
63
- "mainUid": "7ba6-110"
63
+ "mainUid": "ef61-110"
64
64
  },
65
- "7ba6-113": {
65
+ "ef61-113": {
66
66
  "renderedLength": 44,
67
67
  "gzipLength": 62,
68
68
  "brotliLength": 0,
69
- "mainUid": "7ba6-112"
69
+ "mainUid": "ef61-112"
70
70
  },
71
- "7ba6-115": {
71
+ "ef61-115": {
72
72
  "renderedLength": 1288,
73
73
  "gzipLength": 497,
74
74
  "brotliLength": 0,
75
- "mainUid": "7ba6-114"
75
+ "mainUid": "ef61-114"
76
76
  },
77
- "7ba6-117": {
78
- "renderedLength": 46930,
79
- "gzipLength": 11106,
77
+ "ef61-117": {
78
+ "renderedLength": 46875,
79
+ "gzipLength": 11092,
80
80
  "brotliLength": 0,
81
- "mainUid": "7ba6-116"
81
+ "mainUid": "ef61-116"
82
82
  },
83
- "7ba6-119": {
83
+ "ef61-119": {
84
84
  "renderedLength": 1571,
85
85
  "gzipLength": 594,
86
86
  "brotliLength": 0,
87
- "mainUid": "7ba6-118"
87
+ "mainUid": "ef61-118"
88
88
  },
89
- "7ba6-121": {
89
+ "ef61-121": {
90
90
  "renderedLength": 12514,
91
91
  "gzipLength": 3242,
92
92
  "brotliLength": 0,
93
- "mainUid": "7ba6-120"
93
+ "mainUid": "ef61-120"
94
94
  }
95
95
  },
96
96
  "nodeMetas": {
97
- "7ba6-108": {
97
+ "ef61-108": {
98
98
  "id": "\u0000rollupPluginBabelHelpers.js",
99
99
  "moduleParts": {
100
- "index.production.js": "7ba6-109"
100
+ "index.production.js": "ef61-109"
101
101
  },
102
102
  "imported": [],
103
103
  "importedBy": [
104
104
  {
105
- "uid": "7ba6-120"
105
+ "uid": "ef61-120"
106
106
  }
107
107
  ]
108
108
  },
109
- "7ba6-110": {
109
+ "ef61-110": {
110
110
  "id": "/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
111
111
  "moduleParts": {
112
- "index.production.js": "7ba6-111"
112
+ "index.production.js": "ef61-111"
113
113
  },
114
114
  "imported": [],
115
115
  "importedBy": [
116
116
  {
117
- "uid": "7ba6-116"
117
+ "uid": "ef61-116"
118
118
  }
119
119
  ]
120
120
  },
121
- "7ba6-112": {
121
+ "ef61-112": {
122
122
  "id": "/node_modules/.pnpm/tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js",
123
123
  "moduleParts": {
124
- "index.production.js": "7ba6-113"
124
+ "index.production.js": "ef61-113"
125
125
  },
126
126
  "imported": [],
127
127
  "importedBy": [
128
128
  {
129
- "uid": "7ba6-116"
129
+ "uid": "ef61-116"
130
130
  }
131
131
  ]
132
132
  },
133
- "7ba6-114": {
133
+ "ef61-114": {
134
134
  "id": "/packages/store/build/esm/index.js",
135
135
  "moduleParts": {
136
- "index.production.js": "7ba6-115"
136
+ "index.production.js": "ef61-115"
137
137
  },
138
138
  "imported": [],
139
139
  "importedBy": [
140
140
  {
141
- "uid": "7ba6-116"
141
+ "uid": "ef61-116"
142
142
  }
143
143
  ]
144
144
  },
145
- "7ba6-116": {
145
+ "ef61-116": {
146
146
  "id": "/packages/router/build/esm/index.js",
147
147
  "moduleParts": {
148
- "index.production.js": "7ba6-117"
148
+ "index.production.js": "ef61-117"
149
149
  },
150
150
  "imported": [
151
151
  {
152
- "uid": "7ba6-110"
152
+ "uid": "ef61-110"
153
153
  },
154
154
  {
155
- "uid": "7ba6-112"
155
+ "uid": "ef61-112"
156
156
  },
157
157
  {
158
- "uid": "7ba6-114"
158
+ "uid": "ef61-114"
159
159
  }
160
160
  ],
161
161
  "importedBy": [
162
162
  {
163
- "uid": "7ba6-120"
163
+ "uid": "ef61-120"
164
164
  }
165
165
  ]
166
166
  },
167
- "7ba6-118": {
167
+ "ef61-118": {
168
168
  "id": "/packages/react-store/build/esm/index.js",
169
169
  "moduleParts": {
170
- "index.production.js": "7ba6-119"
170
+ "index.production.js": "ef61-119"
171
171
  },
172
172
  "imported": [
173
173
  {
174
- "uid": "7ba6-123"
174
+ "uid": "ef61-123"
175
175
  }
176
176
  ],
177
177
  "importedBy": [
178
178
  {
179
- "uid": "7ba6-120"
179
+ "uid": "ef61-120"
180
180
  }
181
181
  ]
182
182
  },
183
- "7ba6-120": {
183
+ "ef61-120": {
184
184
  "id": "/packages/react-router/src/index.tsx",
185
185
  "moduleParts": {
186
- "index.production.js": "7ba6-121"
186
+ "index.production.js": "ef61-121"
187
187
  },
188
188
  "imported": [
189
189
  {
190
- "uid": "7ba6-108"
190
+ "uid": "ef61-108"
191
191
  },
192
192
  {
193
- "uid": "7ba6-122"
193
+ "uid": "ef61-122"
194
194
  },
195
195
  {
196
- "uid": "7ba6-116"
196
+ "uid": "ef61-116"
197
197
  },
198
198
  {
199
- "uid": "7ba6-118"
199
+ "uid": "ef61-118"
200
200
  }
201
201
  ],
202
202
  "importedBy": [],
203
203
  "isEntry": true
204
204
  },
205
- "7ba6-122": {
205
+ "ef61-122": {
206
206
  "id": "react",
207
207
  "moduleParts": {},
208
208
  "imported": [],
209
209
  "importedBy": [
210
210
  {
211
- "uid": "7ba6-120"
211
+ "uid": "ef61-120"
212
212
  }
213
213
  ],
214
214
  "isExternal": true
215
215
  },
216
- "7ba6-123": {
216
+ "ef61-123": {
217
217
  "id": "use-sync-external-store/shim/with-selector",
218
218
  "moduleParts": {},
219
219
  "imported": [],
220
220
  "importedBy": [
221
221
  {
222
- "uid": "7ba6-118"
222
+ "uid": "ef61-118"
223
223
  }
224
224
  ],
225
225
  "isExternal": true
@@ -852,13 +852,10 @@
852
852
  };
853
853
  buildNext = opts => {
854
854
  const next = this.#buildLocation(opts);
855
- const matches = this.matchRoutes(next.pathname);
856
- const __preSearchFilters = matches.map(match => match.route.options.preSearchFilters ?? []).flat().filter(Boolean);
857
- const __postSearchFilters = matches.map(match => match.route.options.postSearchFilters ?? []).flat().filter(Boolean);
855
+ const __matches = this.matchRoutes(next.pathname);
858
856
  return this.#buildLocation({
859
857
  ...opts,
860
- __preSearchFilters,
861
- __postSearchFilters
858
+ __matches
862
859
  });
863
860
  };
864
861
  cancelMatches = () => {
@@ -1373,29 +1370,33 @@
1373
1370
  const fromMatches = this.matchRoutes(this.state.latestLocation.pathname, {
1374
1371
  strictParseParams: true
1375
1372
  });
1376
- const toMatches = this.matchRoutes(pathname);
1377
1373
  const prevParams = {
1378
1374
  ...last(fromMatches)?.params
1379
1375
  };
1380
1376
  let nextParams = (dest.params ?? true) === true ? prevParams : functionalUpdate(dest.params, prevParams);
1381
1377
  if (nextParams) {
1382
- toMatches.map(d => d.route.options.stringifyParams).filter(Boolean).forEach(fn => {
1383
- Object.assign({}, nextParams, fn(nextParams));
1378
+ dest.__matches?.map(d => d.route.options.stringifyParams).filter(Boolean).forEach(fn => {
1379
+ nextParams = {
1380
+ ...nextParams,
1381
+ ...fn(nextParams)
1382
+ };
1384
1383
  });
1385
1384
  }
1386
1385
  pathname = interpolatePath(pathname, nextParams ?? {});
1386
+ const preSearchFilters = dest.__matches?.map(match => match.route.options.preSearchFilters ?? []).flat().filter(Boolean) ?? [];
1387
+ const postSearchFilters = dest.__matches?.map(match => match.route.options.postSearchFilters ?? []).flat().filter(Boolean) ?? [];
1387
1388
 
1388
1389
  // Pre filters first
1389
- const preFilteredSearch = dest.__preSearchFilters?.length ? dest.__preSearchFilters?.reduce((prev, next) => next(prev), this.state.latestLocation.search) : this.state.latestLocation.search;
1390
+ const preFilteredSearch = preSearchFilters?.length ? preSearchFilters?.reduce((prev, next) => next(prev), this.state.latestLocation.search) : this.state.latestLocation.search;
1390
1391
 
1391
1392
  // Then the link/navigate function
1392
1393
  const destSearch = dest.search === true ? preFilteredSearch // Preserve resolvedFrom true
1393
1394
  : dest.search ? functionalUpdate(dest.search, preFilteredSearch) ?? {} // Updater
1394
- : dest.__preSearchFilters?.length ? preFilteredSearch // Preserve resolvedFrom filters
1395
+ : preSearchFilters?.length ? preFilteredSearch // Preserve resolvedFrom filters
1395
1396
  : {};
1396
1397
 
1397
1398
  // Then post filters
1398
- const postFilteredSearch = dest.__postSearchFilters?.length ? dest.__postSearchFilters.reduce((prev, next) => next(prev), destSearch) : destSearch;
1399
+ const postFilteredSearch = postSearchFilters?.length ? postSearchFilters.reduce((prev, next) => next(prev), destSearch) : destSearch;
1399
1400
  const search = replaceEqualDeep(this.state.latestLocation.search, postFilteredSearch);
1400
1401
  const searchStr = this.options.stringifySearch(search);
1401
1402
  let hash = dest.hash === true ? this.state.latestLocation.hash : functionalUpdate(dest.hash, this.state.latestLocation.hash);