@tanstack/react-router 0.0.1-beta.56 → 0.0.1-beta.57

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":"9447-89","name":"\u0000rollupPluginBabelHelpers.js"},{"name":"node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js","uid":"9447-91"},{"name":"packages","children":[{"name":"store/build/esm/index.js","uid":"9447-93"},{"name":"router/build/esm/index.js","uid":"9447-95"},{"name":"react-store/build/esm/index.js","uid":"9447-97"},{"name":"react-router/src/index.tsx","uid":"9447-99"}]}]}],"isRoot":true},"nodeParts":{"9447-89":{"renderedLength":429,"gzipLength":238,"brotliLength":0,"mainUid":"9447-88"},"9447-91":{"renderedLength":181,"gzipLength":129,"brotliLength":0,"mainUid":"9447-90"},"9447-93":{"renderedLength":1247,"gzipLength":489,"brotliLength":0,"mainUid":"9447-92"},"9447-95":{"renderedLength":43403,"gzipLength":10501,"brotliLength":0,"mainUid":"9447-94"},"9447-97":{"renderedLength":1571,"gzipLength":594,"brotliLength":0,"mainUid":"9447-96"},"9447-99":{"renderedLength":11728,"gzipLength":3116,"brotliLength":0,"mainUid":"9447-98"}},"nodeMetas":{"9447-88":{"id":"\u0000rollupPluginBabelHelpers.js","moduleParts":{"index.production.js":"9447-89"},"imported":[],"importedBy":[{"uid":"9447-98"}]},"9447-90":{"id":"/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js","moduleParts":{"index.production.js":"9447-91"},"imported":[],"importedBy":[{"uid":"9447-94"}]},"9447-92":{"id":"/packages/store/build/esm/index.js","moduleParts":{"index.production.js":"9447-93"},"imported":[],"importedBy":[{"uid":"9447-94"}]},"9447-94":{"id":"/packages/router/build/esm/index.js","moduleParts":{"index.production.js":"9447-95"},"imported":[{"uid":"9447-90"},{"uid":"9447-92"}],"importedBy":[{"uid":"9447-98"}]},"9447-96":{"id":"/packages/react-store/build/esm/index.js","moduleParts":{"index.production.js":"9447-97"},"imported":[{"uid":"9447-101"}],"importedBy":[{"uid":"9447-98"}]},"9447-98":{"id":"/packages/react-router/src/index.tsx","moduleParts":{"index.production.js":"9447-99"},"imported":[{"uid":"9447-88"},{"uid":"9447-100"},{"uid":"9447-94"},{"uid":"9447-96"}],"importedBy":[],"isEntry":true},"9447-100":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"9447-98"}],"isExternal":true},"9447-101":{"id":"use-sync-external-store/shim/with-selector","moduleParts":{},"imported":[],"importedBy":[{"uid":"9447-96"}],"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":"740d-89","name":"\u0000rollupPluginBabelHelpers.js"},{"name":"node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js","uid":"740d-91"},{"name":"packages","children":[{"name":"store/build/esm/index.js","uid":"740d-93"},{"name":"router/build/esm/index.js","uid":"740d-95"},{"name":"react-store/build/esm/index.js","uid":"740d-97"},{"name":"react-router/src/index.tsx","uid":"740d-99"}]}]}],"isRoot":true},"nodeParts":{"740d-89":{"renderedLength":429,"gzipLength":238,"brotliLength":0,"mainUid":"740d-88"},"740d-91":{"renderedLength":181,"gzipLength":129,"brotliLength":0,"mainUid":"740d-90"},"740d-93":{"renderedLength":1290,"gzipLength":496,"brotliLength":0,"mainUid":"740d-92"},"740d-95":{"renderedLength":43501,"gzipLength":10525,"brotliLength":0,"mainUid":"740d-94"},"740d-97":{"renderedLength":1571,"gzipLength":594,"brotliLength":0,"mainUid":"740d-96"},"740d-99":{"renderedLength":11728,"gzipLength":3116,"brotliLength":0,"mainUid":"740d-98"}},"nodeMetas":{"740d-88":{"id":"\u0000rollupPluginBabelHelpers.js","moduleParts":{"index.production.js":"740d-89"},"imported":[],"importedBy":[{"uid":"740d-98"}]},"740d-90":{"id":"/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js","moduleParts":{"index.production.js":"740d-91"},"imported":[],"importedBy":[{"uid":"740d-94"}]},"740d-92":{"id":"/packages/store/build/esm/index.js","moduleParts":{"index.production.js":"740d-93"},"imported":[],"importedBy":[{"uid":"740d-94"}]},"740d-94":{"id":"/packages/router/build/esm/index.js","moduleParts":{"index.production.js":"740d-95"},"imported":[{"uid":"740d-90"},{"uid":"740d-92"}],"importedBy":[{"uid":"740d-98"}]},"740d-96":{"id":"/packages/react-store/build/esm/index.js","moduleParts":{"index.production.js":"740d-97"},"imported":[{"uid":"740d-101"}],"importedBy":[{"uid":"740d-98"}]},"740d-98":{"id":"/packages/react-router/src/index.tsx","moduleParts":{"index.production.js":"740d-99"},"imported":[{"uid":"740d-88"},{"uid":"740d-100"},{"uid":"740d-94"},{"uid":"740d-96"}],"importedBy":[],"isEntry":true},"740d-100":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"740d-98"}],"isExternal":true},"740d-101":{"id":"use-sync-external-store/shim/with-selector","moduleParts":{},"imported":[],"importedBy":[{"uid":"740d-96"}],"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,31 +7,31 @@
7
7
  "name": "index.production.js",
8
8
  "children": [
9
9
  {
10
- "uid": "9447-103",
10
+ "uid": "740d-103",
11
11
  "name": "\u0000rollupPluginBabelHelpers.js"
12
12
  },
13
13
  {
14
14
  "name": "node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
15
- "uid": "9447-105"
15
+ "uid": "740d-105"
16
16
  },
17
17
  {
18
18
  "name": "packages",
19
19
  "children": [
20
20
  {
21
21
  "name": "store/build/esm/index.js",
22
- "uid": "9447-107"
22
+ "uid": "740d-107"
23
23
  },
24
24
  {
25
25
  "name": "router/build/esm/index.js",
26
- "uid": "9447-109"
26
+ "uid": "740d-109"
27
27
  },
28
28
  {
29
29
  "name": "react-store/build/esm/index.js",
30
- "uid": "9447-111"
30
+ "uid": "740d-111"
31
31
  },
32
32
  {
33
33
  "name": "react-router/src/index.tsx",
34
- "uid": "9447-113"
34
+ "uid": "740d-113"
35
35
  }
36
36
  ]
37
37
  }
@@ -41,155 +41,155 @@
41
41
  "isRoot": true
42
42
  },
43
43
  "nodeParts": {
44
- "9447-103": {
44
+ "740d-103": {
45
45
  "renderedLength": 429,
46
46
  "gzipLength": 238,
47
47
  "brotliLength": 0,
48
- "mainUid": "9447-102"
48
+ "mainUid": "740d-102"
49
49
  },
50
- "9447-105": {
50
+ "740d-105": {
51
51
  "renderedLength": 181,
52
52
  "gzipLength": 129,
53
53
  "brotliLength": 0,
54
- "mainUid": "9447-104"
54
+ "mainUid": "740d-104"
55
55
  },
56
- "9447-107": {
57
- "renderedLength": 1247,
58
- "gzipLength": 489,
56
+ "740d-107": {
57
+ "renderedLength": 1290,
58
+ "gzipLength": 496,
59
59
  "brotliLength": 0,
60
- "mainUid": "9447-106"
60
+ "mainUid": "740d-106"
61
61
  },
62
- "9447-109": {
63
- "renderedLength": 43403,
64
- "gzipLength": 10501,
62
+ "740d-109": {
63
+ "renderedLength": 43501,
64
+ "gzipLength": 10525,
65
65
  "brotliLength": 0,
66
- "mainUid": "9447-108"
66
+ "mainUid": "740d-108"
67
67
  },
68
- "9447-111": {
68
+ "740d-111": {
69
69
  "renderedLength": 1571,
70
70
  "gzipLength": 594,
71
71
  "brotliLength": 0,
72
- "mainUid": "9447-110"
72
+ "mainUid": "740d-110"
73
73
  },
74
- "9447-113": {
74
+ "740d-113": {
75
75
  "renderedLength": 11728,
76
76
  "gzipLength": 3116,
77
77
  "brotliLength": 0,
78
- "mainUid": "9447-112"
78
+ "mainUid": "740d-112"
79
79
  }
80
80
  },
81
81
  "nodeMetas": {
82
- "9447-102": {
82
+ "740d-102": {
83
83
  "id": "\u0000rollupPluginBabelHelpers.js",
84
84
  "moduleParts": {
85
- "index.production.js": "9447-103"
85
+ "index.production.js": "740d-103"
86
86
  },
87
87
  "imported": [],
88
88
  "importedBy": [
89
89
  {
90
- "uid": "9447-112"
90
+ "uid": "740d-112"
91
91
  }
92
92
  ]
93
93
  },
94
- "9447-104": {
94
+ "740d-104": {
95
95
  "id": "/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
96
96
  "moduleParts": {
97
- "index.production.js": "9447-105"
97
+ "index.production.js": "740d-105"
98
98
  },
99
99
  "imported": [],
100
100
  "importedBy": [
101
101
  {
102
- "uid": "9447-108"
102
+ "uid": "740d-108"
103
103
  }
104
104
  ]
105
105
  },
106
- "9447-106": {
106
+ "740d-106": {
107
107
  "id": "/packages/store/build/esm/index.js",
108
108
  "moduleParts": {
109
- "index.production.js": "9447-107"
109
+ "index.production.js": "740d-107"
110
110
  },
111
111
  "imported": [],
112
112
  "importedBy": [
113
113
  {
114
- "uid": "9447-108"
114
+ "uid": "740d-108"
115
115
  }
116
116
  ]
117
117
  },
118
- "9447-108": {
118
+ "740d-108": {
119
119
  "id": "/packages/router/build/esm/index.js",
120
120
  "moduleParts": {
121
- "index.production.js": "9447-109"
121
+ "index.production.js": "740d-109"
122
122
  },
123
123
  "imported": [
124
124
  {
125
- "uid": "9447-104"
125
+ "uid": "740d-104"
126
126
  },
127
127
  {
128
- "uid": "9447-106"
128
+ "uid": "740d-106"
129
129
  }
130
130
  ],
131
131
  "importedBy": [
132
132
  {
133
- "uid": "9447-112"
133
+ "uid": "740d-112"
134
134
  }
135
135
  ]
136
136
  },
137
- "9447-110": {
137
+ "740d-110": {
138
138
  "id": "/packages/react-store/build/esm/index.js",
139
139
  "moduleParts": {
140
- "index.production.js": "9447-111"
140
+ "index.production.js": "740d-111"
141
141
  },
142
142
  "imported": [
143
143
  {
144
- "uid": "9447-115"
144
+ "uid": "740d-115"
145
145
  }
146
146
  ],
147
147
  "importedBy": [
148
148
  {
149
- "uid": "9447-112"
149
+ "uid": "740d-112"
150
150
  }
151
151
  ]
152
152
  },
153
- "9447-112": {
153
+ "740d-112": {
154
154
  "id": "/packages/react-router/src/index.tsx",
155
155
  "moduleParts": {
156
- "index.production.js": "9447-113"
156
+ "index.production.js": "740d-113"
157
157
  },
158
158
  "imported": [
159
159
  {
160
- "uid": "9447-102"
160
+ "uid": "740d-102"
161
161
  },
162
162
  {
163
- "uid": "9447-114"
163
+ "uid": "740d-114"
164
164
  },
165
165
  {
166
- "uid": "9447-108"
166
+ "uid": "740d-108"
167
167
  },
168
168
  {
169
- "uid": "9447-110"
169
+ "uid": "740d-110"
170
170
  }
171
171
  ],
172
172
  "importedBy": [],
173
173
  "isEntry": true
174
174
  },
175
- "9447-114": {
175
+ "740d-114": {
176
176
  "id": "react",
177
177
  "moduleParts": {},
178
178
  "imported": [],
179
179
  "importedBy": [
180
180
  {
181
- "uid": "9447-112"
181
+ "uid": "740d-112"
182
182
  }
183
183
  ],
184
184
  "isExternal": true
185
185
  },
186
- "9447-115": {
186
+ "740d-115": {
187
187
  "id": "use-sync-external-store/shim/with-selector",
188
188
  "moduleParts": {},
189
189
  "imported": [],
190
190
  "importedBy": [
191
191
  {
192
- "uid": "9447-110"
192
+ "uid": "740d-110"
193
193
  }
194
194
  ],
195
195
  "isExternal": true
@@ -88,6 +88,7 @@
88
88
  setState = updater => {
89
89
  const previous = this.state;
90
90
  this.state = this.options?.updateFn ? this.options.updateFn(previous)(updater) : updater(previous);
91
+ if (this.state === previous) return;
91
92
  this.queue.push(() => {
92
93
  this.listeners.forEach(listener => listener(this.state, previous));
93
94
  this.options?.onUpdate?.(this.state, previous);
@@ -651,14 +652,14 @@
651
652
  cancel = () => {
652
653
  this.abortController?.abort();
653
654
  };
654
- load = async () => {
655
+ load = async opts => {
655
656
  // If the match is invalid, errored or idle, trigger it to load
656
657
  if (this.store.state.status !== 'pending') {
657
- await this.fetch();
658
+ await this.fetch(opts);
658
659
  }
659
660
  };
660
661
  #latestId = '';
661
- fetch = async () => {
662
+ fetch = async opts => {
662
663
  this.__loadPromise = Promise.resolve().then(async () => {
663
664
  const loadId = '' + Date.now() + Math.random();
664
665
  this.#latestId = loadId;
@@ -693,7 +694,8 @@
693
694
  return this.route.options.onLoad({
694
695
  params: this.params,
695
696
  search: this.store.state.search,
696
- signal: this.abortController.signal
697
+ signal: this.abortController.signal,
698
+ preload: !!opts?.preload
697
699
  });
698
700
  }
699
701
  return;
@@ -1144,7 +1146,9 @@
1144
1146
  if (search.__data?.matchId && search.__data.matchId !== match.id) {
1145
1147
  return;
1146
1148
  }
1147
- match.load();
1149
+ match.load({
1150
+ preload: loaderOpts?.preload
1151
+ });
1148
1152
  if (match.store.state.status !== 'success' && match.__loadPromise) {
1149
1153
  // Wait for the first sign of activity from the match
1150
1154
  await match.__loadPromise;