@solidjs/signals 0.10.0 → 0.10.1
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/dist/dev.js +22 -20
- package/dist/node.cjs +516 -513
- package/dist/prod.js +535 -532
- package/dist/types/core/error.d.ts +4 -4
- package/package.json +1 -1
package/dist/prod.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
class NotReadyError extends Error {
|
|
2
|
-
|
|
2
|
+
source;
|
|
3
3
|
constructor(e) {
|
|
4
4
|
super();
|
|
5
|
-
this.
|
|
5
|
+
this.source = e;
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
8
|
class StatusError extends Error {
|
|
9
|
-
|
|
9
|
+
source;
|
|
10
10
|
constructor(e, t) {
|
|
11
11
|
super(t instanceof Error ? t.message : String(t), { cause: t });
|
|
12
|
-
this.
|
|
12
|
+
this.source = e;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
class NoOwnerError extends Error {
|
|
@@ -42,114 +42,114 @@ const SUPPORTS_PROXY = typeof Proxy === "function";
|
|
|
42
42
|
const defaultContext = {};
|
|
43
43
|
const $REFRESH = Symbol("refresh");
|
|
44
44
|
function actualInsertIntoHeap(e, t) {
|
|
45
|
-
const n = (e.
|
|
46
|
-
if (n >= e.
|
|
47
|
-
const i = e.
|
|
48
|
-
const r = t.
|
|
49
|
-
if (r === undefined) t.
|
|
45
|
+
const n = (e.i?.t ? e.i.u?.o : e.i?.o) ?? -1;
|
|
46
|
+
if (n >= e.o) e.o = n + 1;
|
|
47
|
+
const i = e.o;
|
|
48
|
+
const r = t.l[i];
|
|
49
|
+
if (r === undefined) t.l[i] = e;
|
|
50
50
|
else {
|
|
51
|
-
const t = r.
|
|
52
|
-
t.
|
|
53
|
-
e.
|
|
54
|
-
r.
|
|
51
|
+
const t = r.T;
|
|
52
|
+
t.R = e;
|
|
53
|
+
e.T = t;
|
|
54
|
+
r.T = e;
|
|
55
55
|
}
|
|
56
|
-
if (i > t.
|
|
56
|
+
if (i > t.O) t.O = i;
|
|
57
57
|
}
|
|
58
58
|
function insertIntoHeap(e, t) {
|
|
59
|
-
let n = e.
|
|
59
|
+
let n = e.S;
|
|
60
60
|
if (n & (REACTIVE_IN_HEAP | REACTIVE_RECOMPUTING_DEPS)) return;
|
|
61
61
|
if (n & REACTIVE_CHECK) {
|
|
62
|
-
e.
|
|
63
|
-
} else e.
|
|
62
|
+
e.S = (n & -4) | REACTIVE_DIRTY | REACTIVE_IN_HEAP;
|
|
63
|
+
} else e.S = n | REACTIVE_IN_HEAP;
|
|
64
64
|
if (!(n & REACTIVE_IN_HEAP_HEIGHT)) actualInsertIntoHeap(e, t);
|
|
65
65
|
}
|
|
66
66
|
function insertIntoHeapHeight(e, t) {
|
|
67
|
-
let n = e.
|
|
67
|
+
let n = e.S;
|
|
68
68
|
if (n & (REACTIVE_IN_HEAP | REACTIVE_RECOMPUTING_DEPS | REACTIVE_IN_HEAP_HEIGHT)) return;
|
|
69
|
-
e.
|
|
69
|
+
e.S = n | REACTIVE_IN_HEAP_HEIGHT;
|
|
70
70
|
actualInsertIntoHeap(e, t);
|
|
71
71
|
}
|
|
72
72
|
function deleteFromHeap(e, t) {
|
|
73
|
-
const n = e.
|
|
73
|
+
const n = e.S;
|
|
74
74
|
if (!(n & (REACTIVE_IN_HEAP | REACTIVE_IN_HEAP_HEIGHT))) return;
|
|
75
|
-
e.
|
|
76
|
-
const i = e.
|
|
77
|
-
if (e.
|
|
75
|
+
e.S = n & -25;
|
|
76
|
+
const i = e.o;
|
|
77
|
+
if (e.T === e) t.l[i] = undefined;
|
|
78
78
|
else {
|
|
79
|
-
const n = e.
|
|
80
|
-
const r = t.
|
|
79
|
+
const n = e.R;
|
|
80
|
+
const r = t.l[i];
|
|
81
81
|
const o = n ?? r;
|
|
82
|
-
if (e === r) t.
|
|
83
|
-
else e.R
|
|
84
|
-
o.
|
|
82
|
+
if (e === r) t.l[i] = n;
|
|
83
|
+
else e.T.R = n;
|
|
84
|
+
o.T = e.T;
|
|
85
85
|
}
|
|
86
|
-
e.
|
|
87
|
-
e.
|
|
86
|
+
e.T = e;
|
|
87
|
+
e.R = undefined;
|
|
88
88
|
}
|
|
89
89
|
function markHeap(e) {
|
|
90
|
-
if (e.
|
|
91
|
-
e.
|
|
92
|
-
for (let t = 0; t <= e.
|
|
93
|
-
for (let n = e.
|
|
94
|
-
if (n.
|
|
90
|
+
if (e._) return;
|
|
91
|
+
e._ = true;
|
|
92
|
+
for (let t = 0; t <= e.O; t++) {
|
|
93
|
+
for (let n = e.l[t]; n !== undefined; n = n.R) {
|
|
94
|
+
if (n.S & REACTIVE_IN_HEAP) markNode(n);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
function markNode(e, t = REACTIVE_DIRTY) {
|
|
99
|
-
const n = e.
|
|
99
|
+
const n = e.S;
|
|
100
100
|
if ((n & (REACTIVE_CHECK | REACTIVE_DIRTY)) >= t) return;
|
|
101
|
-
e.
|
|
102
|
-
for (let t = e.
|
|
103
|
-
markNode(t.
|
|
101
|
+
e.S = (n & -4) | t;
|
|
102
|
+
for (let t = e.I; t !== null; t = t.p) {
|
|
103
|
+
markNode(t.h, REACTIVE_CHECK);
|
|
104
104
|
}
|
|
105
|
-
if (e.
|
|
106
|
-
for (let t = e.
|
|
107
|
-
for (let e = t.
|
|
108
|
-
markNode(e.
|
|
105
|
+
if (e.A !== null) {
|
|
106
|
+
for (let t = e.A; t !== null; t = t.P) {
|
|
107
|
+
for (let e = t.I; e !== null; e = e.p) {
|
|
108
|
+
markNode(e.h, REACTIVE_CHECK);
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
function runHeap(e, t) {
|
|
114
|
-
e.
|
|
115
|
-
for (e.
|
|
116
|
-
let n = e.
|
|
114
|
+
e._ = false;
|
|
115
|
+
for (e.C = 0; e.C <= e.O; e.C++) {
|
|
116
|
+
let n = e.l[e.C];
|
|
117
117
|
while (n !== undefined) {
|
|
118
|
-
if (n.
|
|
118
|
+
if (n.S & REACTIVE_IN_HEAP) t(n);
|
|
119
119
|
else adjustHeight(n, e);
|
|
120
|
-
n = e.
|
|
120
|
+
n = e.l[e.C];
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
e.
|
|
123
|
+
e.O = 0;
|
|
124
124
|
}
|
|
125
125
|
function adjustHeight(e, t) {
|
|
126
126
|
deleteFromHeap(e, t);
|
|
127
|
-
let n = e.
|
|
128
|
-
for (let t = e.
|
|
129
|
-
const e = t.
|
|
130
|
-
const i = e.
|
|
131
|
-
if (i.
|
|
127
|
+
let n = e.o;
|
|
128
|
+
for (let t = e.N; t; t = t.D) {
|
|
129
|
+
const e = t.V;
|
|
130
|
+
const i = e.m || e;
|
|
131
|
+
if (i.L && i.o >= n) n = i.o + 1;
|
|
132
132
|
}
|
|
133
|
-
if (e.
|
|
134
|
-
e.
|
|
135
|
-
for (let n = e.
|
|
136
|
-
insertIntoHeapHeight(n.
|
|
133
|
+
if (e.o !== n) {
|
|
134
|
+
e.o = n;
|
|
135
|
+
for (let n = e.I; n !== null; n = n.p) {
|
|
136
|
+
insertIntoHeapHeight(n.h, t);
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
const transitions = new Set();
|
|
141
|
-
const dirtyQueue = {
|
|
142
|
-
const zombieQueue = {
|
|
141
|
+
const dirtyQueue = { l: new Array(2e3).fill(undefined), _: false, C: 0, O: 0 };
|
|
142
|
+
const zombieQueue = { l: new Array(2e3).fill(undefined), _: false, C: 0, O: 0 };
|
|
143
143
|
let clock = 0;
|
|
144
144
|
let activeTransition = null;
|
|
145
145
|
let scheduled = false;
|
|
146
146
|
let projectionWriteActive = false;
|
|
147
147
|
function runLaneEffects(e) {
|
|
148
148
|
for (const t of activeLanes) {
|
|
149
|
-
if (t.
|
|
150
|
-
const n = t.
|
|
149
|
+
if (t.k || t.U.size > 0) continue;
|
|
150
|
+
const n = t.W[e - 1];
|
|
151
151
|
if (n.length) {
|
|
152
|
-
t.
|
|
152
|
+
t.W[e - 1] = [];
|
|
153
153
|
runQueue(n, e);
|
|
154
154
|
}
|
|
155
155
|
}
|
|
@@ -160,129 +160,129 @@ function setProjectionWriteActive(e) {
|
|
|
160
160
|
function schedule() {
|
|
161
161
|
if (scheduled) return;
|
|
162
162
|
scheduled = true;
|
|
163
|
-
if (!globalQueue.
|
|
163
|
+
if (!globalQueue.M) queueMicrotask(flush);
|
|
164
164
|
}
|
|
165
165
|
class Queue {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
166
|
+
i = null;
|
|
167
|
+
F = [[], []];
|
|
168
|
+
G = [];
|
|
169
169
|
created = clock;
|
|
170
170
|
addChild(e) {
|
|
171
|
-
this
|
|
172
|
-
e.
|
|
171
|
+
this.G.push(e);
|
|
172
|
+
e.i = this;
|
|
173
173
|
}
|
|
174
174
|
removeChild(e) {
|
|
175
|
-
const t = this
|
|
175
|
+
const t = this.G.indexOf(e);
|
|
176
176
|
if (t >= 0) {
|
|
177
|
-
this
|
|
178
|
-
e.
|
|
177
|
+
this.G.splice(t, 1);
|
|
178
|
+
e.i = null;
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
notify(e, t, n, i) {
|
|
182
|
-
if (this.
|
|
182
|
+
if (this.i) return this.i.notify(e, t, n, i);
|
|
183
183
|
return false;
|
|
184
184
|
}
|
|
185
185
|
run(e) {
|
|
186
|
-
if (this.
|
|
187
|
-
const t = this.
|
|
188
|
-
this.
|
|
186
|
+
if (this.F[e - 1].length) {
|
|
187
|
+
const t = this.F[e - 1];
|
|
188
|
+
this.F[e - 1] = [];
|
|
189
189
|
runQueue(t, e);
|
|
190
190
|
}
|
|
191
|
-
for (let t = 0; t < this
|
|
191
|
+
for (let t = 0; t < this.G.length; t++) this.G[t].run?.(e);
|
|
192
192
|
}
|
|
193
193
|
enqueue(e, t) {
|
|
194
194
|
if (e) {
|
|
195
195
|
if (currentOptimisticLane) {
|
|
196
196
|
const n = findLane(currentOptimisticLane);
|
|
197
|
-
n.
|
|
197
|
+
n.W[e - 1].push(t);
|
|
198
198
|
} else {
|
|
199
|
-
this.
|
|
199
|
+
this.F[e - 1].push(t);
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
202
|
schedule();
|
|
203
203
|
}
|
|
204
204
|
stashQueues(e) {
|
|
205
|
-
e.
|
|
206
|
-
e.
|
|
207
|
-
this.
|
|
208
|
-
for (let t = 0; t < this
|
|
209
|
-
let n = this
|
|
210
|
-
let i = e
|
|
205
|
+
e.F[0].push(...this.F[0]);
|
|
206
|
+
e.F[1].push(...this.F[1]);
|
|
207
|
+
this.F = [[], []];
|
|
208
|
+
for (let t = 0; t < this.G.length; t++) {
|
|
209
|
+
let n = this.G[t];
|
|
210
|
+
let i = e.G[t];
|
|
211
211
|
if (!i) {
|
|
212
|
-
i = {
|
|
213
|
-
e
|
|
212
|
+
i = { F: [[], []], G: [] };
|
|
213
|
+
e.G[t] = i;
|
|
214
214
|
}
|
|
215
215
|
n.stashQueues(i);
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
restoreQueues(e) {
|
|
219
|
-
this.
|
|
220
|
-
this.
|
|
221
|
-
for (let t = 0; t < e
|
|
222
|
-
const n = e
|
|
223
|
-
let i = this
|
|
219
|
+
this.F[0].push(...e.F[0]);
|
|
220
|
+
this.F[1].push(...e.F[1]);
|
|
221
|
+
for (let t = 0; t < e.G.length; t++) {
|
|
222
|
+
const n = e.G[t];
|
|
223
|
+
let i = this.G[t];
|
|
224
224
|
if (i) i.restoreQueues(n);
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
class GlobalQueue extends Queue {
|
|
229
|
-
|
|
229
|
+
M = false;
|
|
230
|
+
$ = [];
|
|
230
231
|
H = [];
|
|
231
|
-
j =
|
|
232
|
-
K
|
|
232
|
+
j = new Set();
|
|
233
|
+
static K;
|
|
233
234
|
static Y;
|
|
234
|
-
static B;
|
|
235
|
-
static X = null;
|
|
235
|
+
static B = null;
|
|
236
236
|
flush() {
|
|
237
|
-
if (this.
|
|
238
|
-
this.
|
|
237
|
+
if (this.M) return;
|
|
238
|
+
this.M = true;
|
|
239
239
|
try {
|
|
240
|
-
runHeap(dirtyQueue, GlobalQueue.
|
|
240
|
+
runHeap(dirtyQueue, GlobalQueue.K);
|
|
241
241
|
if (activeTransition) {
|
|
242
242
|
const e = transitionComplete(activeTransition);
|
|
243
243
|
if (!e) {
|
|
244
244
|
let e = activeTransition;
|
|
245
|
-
runHeap(zombieQueue, GlobalQueue.
|
|
245
|
+
runHeap(zombieQueue, GlobalQueue.K);
|
|
246
|
+
this.$ = [];
|
|
246
247
|
this.H = [];
|
|
247
|
-
this.j =
|
|
248
|
-
this.K = new Set();
|
|
248
|
+
this.j = new Set();
|
|
249
249
|
runLaneEffects(EFFECT_RENDER);
|
|
250
250
|
runLaneEffects(EFFECT_USER);
|
|
251
|
-
this.stashQueues(activeTransition.
|
|
251
|
+
this.stashQueues(activeTransition.X);
|
|
252
252
|
clock++;
|
|
253
|
-
scheduled = dirtyQueue.
|
|
254
|
-
reassignPendingTransition(activeTransition
|
|
253
|
+
scheduled = dirtyQueue.O >= dirtyQueue.C;
|
|
254
|
+
reassignPendingTransition(activeTransition.$);
|
|
255
255
|
activeTransition = null;
|
|
256
256
|
finalizePureQueue(null, true);
|
|
257
257
|
return;
|
|
258
258
|
}
|
|
259
|
-
this
|
|
260
|
-
this.restoreQueues(activeTransition.
|
|
259
|
+
this.$ !== activeTransition.$ && this.$.push(...activeTransition.$);
|
|
260
|
+
this.restoreQueues(activeTransition.X);
|
|
261
261
|
transitions.delete(activeTransition);
|
|
262
262
|
const t = activeTransition;
|
|
263
263
|
activeTransition = null;
|
|
264
|
-
reassignPendingTransition(this
|
|
264
|
+
reassignPendingTransition(this.$);
|
|
265
265
|
finalizePureQueue(t);
|
|
266
266
|
} else {
|
|
267
|
-
if (transitions.size) runHeap(zombieQueue, GlobalQueue.
|
|
267
|
+
if (transitions.size) runHeap(zombieQueue, GlobalQueue.K);
|
|
268
268
|
finalizePureQueue();
|
|
269
269
|
}
|
|
270
270
|
clock++;
|
|
271
|
-
scheduled = dirtyQueue.
|
|
271
|
+
scheduled = dirtyQueue.O >= dirtyQueue.C;
|
|
272
272
|
runLaneEffects(EFFECT_RENDER);
|
|
273
273
|
this.run(EFFECT_RENDER);
|
|
274
274
|
runLaneEffects(EFFECT_USER);
|
|
275
275
|
this.run(EFFECT_USER);
|
|
276
276
|
} finally {
|
|
277
|
-
this.
|
|
277
|
+
this.M = false;
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
280
|
notify(e, t, n, i) {
|
|
281
281
|
if (t & STATUS_PENDING) {
|
|
282
282
|
if (n & STATUS_PENDING) {
|
|
283
|
-
const t = i !== undefined ? i : e.
|
|
284
|
-
if (activeTransition && t && !activeTransition.
|
|
285
|
-
activeTransition.
|
|
283
|
+
const t = i !== undefined ? i : e.q;
|
|
284
|
+
if (activeTransition && t && !activeTransition.Z.includes(t.source)) {
|
|
285
|
+
activeTransition.Z.push(t.source);
|
|
286
286
|
schedule();
|
|
287
287
|
}
|
|
288
288
|
}
|
|
@@ -293,143 +293,143 @@ class GlobalQueue extends Queue {
|
|
|
293
293
|
initTransition(e) {
|
|
294
294
|
if (e) e = currentTransition(e);
|
|
295
295
|
if (e && e === activeTransition) return;
|
|
296
|
-
if (!e && activeTransition && activeTransition.
|
|
296
|
+
if (!e && activeTransition && activeTransition.J === clock) return;
|
|
297
297
|
if (!activeTransition) {
|
|
298
298
|
activeTransition = e ?? {
|
|
299
|
-
|
|
299
|
+
J: clock,
|
|
300
|
+
$: [],
|
|
301
|
+
Z: [],
|
|
300
302
|
H: [],
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
te:
|
|
305
|
-
q: { M: [[], []], $: [] },
|
|
306
|
-
ne: false
|
|
303
|
+
j: new Set(),
|
|
304
|
+
ee: [],
|
|
305
|
+
X: { F: [[], []], G: [] },
|
|
306
|
+
te: false
|
|
307
307
|
};
|
|
308
308
|
} else if (e) {
|
|
309
309
|
const t = activeTransition;
|
|
310
|
-
t.
|
|
311
|
-
e.
|
|
310
|
+
t.te = e;
|
|
311
|
+
e.ee.push(...t.ee);
|
|
312
312
|
for (const n of activeLanes) {
|
|
313
|
-
if (n.
|
|
313
|
+
if (n.ne === t) n.ne = e;
|
|
314
314
|
}
|
|
315
|
-
e.
|
|
316
|
-
for (const n of t.
|
|
317
|
-
e.
|
|
315
|
+
e.H.push(...t.H);
|
|
316
|
+
for (const n of t.j) {
|
|
317
|
+
e.j.add(n);
|
|
318
318
|
}
|
|
319
319
|
transitions.delete(t);
|
|
320
320
|
activeTransition = e;
|
|
321
321
|
}
|
|
322
322
|
transitions.add(activeTransition);
|
|
323
|
-
activeTransition.
|
|
323
|
+
activeTransition.J = clock;
|
|
324
|
+
for (let e = 0; e < this.$.length; e++) {
|
|
325
|
+
const t = this.$[e];
|
|
326
|
+
t.ne = activeTransition;
|
|
327
|
+
activeTransition.$.push(t);
|
|
328
|
+
}
|
|
329
|
+
this.$ = activeTransition.$;
|
|
324
330
|
for (let e = 0; e < this.H.length; e++) {
|
|
325
331
|
const t = this.H[e];
|
|
326
|
-
t.
|
|
332
|
+
t.ne = activeTransition;
|
|
327
333
|
activeTransition.H.push(t);
|
|
328
334
|
}
|
|
329
335
|
this.H = activeTransition.H;
|
|
330
|
-
for (let e = 0; e < this.j.length; e++) {
|
|
331
|
-
const t = this.j[e];
|
|
332
|
-
t.ie = activeTransition;
|
|
333
|
-
activeTransition.j.push(t);
|
|
334
|
-
}
|
|
335
|
-
this.j = activeTransition.j;
|
|
336
336
|
for (const e of activeLanes) {
|
|
337
|
-
if (!e.
|
|
337
|
+
if (!e.ne) e.ne = activeTransition;
|
|
338
338
|
}
|
|
339
|
-
for (const e of this.
|
|
340
|
-
this.
|
|
339
|
+
for (const e of this.j) activeTransition.j.add(e);
|
|
340
|
+
this.j = activeTransition.j;
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
343
|
function insertSubs(e, t = false) {
|
|
344
|
-
const n = e.
|
|
345
|
-
for (let i = e.
|
|
344
|
+
const n = e.ie || currentOptimisticLane;
|
|
345
|
+
for (let i = e.I; i !== null; i = i.p) {
|
|
346
346
|
if (t && n) {
|
|
347
|
-
i.
|
|
348
|
-
assignOrMergeLane(i.
|
|
347
|
+
i.h.S |= REACTIVE_OPTIMISTIC_DIRTY;
|
|
348
|
+
assignOrMergeLane(i.h, n);
|
|
349
349
|
} else if (t) {
|
|
350
|
-
i.
|
|
351
|
-
i.
|
|
350
|
+
i.h.S |= REACTIVE_OPTIMISTIC_DIRTY;
|
|
351
|
+
i.h.ie = undefined;
|
|
352
352
|
}
|
|
353
|
-
const e = i.
|
|
354
|
-
if (e.
|
|
355
|
-
if (!e.
|
|
356
|
-
e.
|
|
357
|
-
e.
|
|
353
|
+
const e = i.h;
|
|
354
|
+
if (e.re === EFFECT_TRACKED) {
|
|
355
|
+
if (!e.oe) {
|
|
356
|
+
e.oe = true;
|
|
357
|
+
e.se.enqueue(EFFECT_USER, e.ue);
|
|
358
358
|
}
|
|
359
359
|
continue;
|
|
360
360
|
}
|
|
361
|
-
const r = i.
|
|
362
|
-
if (r.
|
|
363
|
-
insertIntoHeap(i.
|
|
361
|
+
const r = i.h.S & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue;
|
|
362
|
+
if (r.C > i.h.o) r.C = i.h.o;
|
|
363
|
+
insertIntoHeap(i.h, r);
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
366
|
function finalizePureQueue(e = null, t = false) {
|
|
367
367
|
let n = !t;
|
|
368
368
|
if (!t) checkBoundaryChildren(globalQueue);
|
|
369
|
-
if (dirtyQueue.
|
|
369
|
+
if (dirtyQueue.O >= dirtyQueue.C) runHeap(dirtyQueue, GlobalQueue.K);
|
|
370
370
|
if (n) {
|
|
371
|
-
const t = globalQueue
|
|
371
|
+
const t = globalQueue.$;
|
|
372
372
|
for (let e = 0; e < t.length; e++) {
|
|
373
373
|
const n = t[e];
|
|
374
|
-
if (n.
|
|
375
|
-
n.
|
|
376
|
-
n.
|
|
377
|
-
if (n.
|
|
374
|
+
if (n.ce !== NOT_PENDING) {
|
|
375
|
+
n.le = n.ce;
|
|
376
|
+
n.ce = NOT_PENDING;
|
|
377
|
+
if (n.re && n.re !== EFFECT_TRACKED) n.oe = true;
|
|
378
378
|
}
|
|
379
|
-
n.
|
|
380
|
-
if (n.
|
|
379
|
+
n.ae &= ~STATUS_UNINITIALIZED;
|
|
380
|
+
if (n.L) GlobalQueue.Y(n, false, true);
|
|
381
381
|
}
|
|
382
382
|
t.length = 0;
|
|
383
|
-
const n = e ? e.
|
|
383
|
+
const n = e ? e.H : globalQueue.H;
|
|
384
384
|
for (let e = 0; e < n.length; e++) {
|
|
385
385
|
const t = n[e];
|
|
386
|
-
const i = t.
|
|
387
|
-
t.
|
|
388
|
-
if (i !== NOT_PENDING && t.
|
|
389
|
-
t.
|
|
386
|
+
const i = t.ce;
|
|
387
|
+
t.ie = undefined;
|
|
388
|
+
if (i !== NOT_PENDING && t.le !== i) {
|
|
389
|
+
t.le = i;
|
|
390
390
|
insertSubs(t, true);
|
|
391
391
|
}
|
|
392
|
-
t.
|
|
393
|
-
t.
|
|
392
|
+
t.ce = NOT_PENDING;
|
|
393
|
+
t.ne = null;
|
|
394
394
|
}
|
|
395
395
|
n.length = 0;
|
|
396
|
-
const i = e ? e.
|
|
397
|
-
if (GlobalQueue.
|
|
396
|
+
const i = e ? e.j : globalQueue.j;
|
|
397
|
+
if (GlobalQueue.B && i.size) {
|
|
398
398
|
for (const e of i) {
|
|
399
|
-
GlobalQueue.
|
|
399
|
+
GlobalQueue.B(e);
|
|
400
400
|
}
|
|
401
401
|
i.clear();
|
|
402
402
|
schedule();
|
|
403
403
|
}
|
|
404
404
|
for (const t of activeLanes) {
|
|
405
|
-
const n = e ? t.
|
|
405
|
+
const n = e ? t.ne === e : !t.ne;
|
|
406
406
|
if (!n) continue;
|
|
407
|
-
if (!t.
|
|
408
|
-
if (t.
|
|
409
|
-
if (t.
|
|
410
|
-
}
|
|
411
|
-
if (t.
|
|
412
|
-
t.
|
|
413
|
-
t.
|
|
414
|
-
t.
|
|
407
|
+
if (!t.k) {
|
|
408
|
+
if (t.W[0].length) runQueue(t.W[0], EFFECT_RENDER);
|
|
409
|
+
if (t.W[1].length) runQueue(t.W[1], EFFECT_USER);
|
|
410
|
+
}
|
|
411
|
+
if (t.fe.ie === t) t.fe.ie = undefined;
|
|
412
|
+
t.U.clear();
|
|
413
|
+
t.W[0].length = 0;
|
|
414
|
+
t.W[1].length = 0;
|
|
415
415
|
activeLanes.delete(t);
|
|
416
|
-
signalLanes.delete(t.
|
|
416
|
+
signalLanes.delete(t.fe);
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
420
|
function checkBoundaryChildren(e) {
|
|
421
|
-
for (const t of e
|
|
421
|
+
for (const t of e.G) {
|
|
422
422
|
t.checkSources?.();
|
|
423
423
|
checkBoundaryChildren(t);
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
426
|
function trackOptimisticStore(e) {
|
|
427
|
-
globalQueue.
|
|
427
|
+
globalQueue.j.add(e);
|
|
428
428
|
schedule();
|
|
429
429
|
}
|
|
430
430
|
function reassignPendingTransition(e) {
|
|
431
431
|
for (let t = 0; t < e.length; t++) {
|
|
432
|
-
e[t].
|
|
432
|
+
e[t].ne = activeTransition;
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
const globalQueue = new GlobalQueue();
|
|
@@ -442,21 +442,21 @@ function runQueue(e, t) {
|
|
|
442
442
|
for (let n = 0; n < e.length; n++) e[n](t);
|
|
443
443
|
}
|
|
444
444
|
function transitionComplete(e) {
|
|
445
|
-
if (e.
|
|
446
|
-
if (e.
|
|
445
|
+
if (e.te) return true;
|
|
446
|
+
if (e.ee.length) return false;
|
|
447
447
|
let t = true;
|
|
448
|
-
for (let n = 0; n < e.
|
|
449
|
-
const i = e.
|
|
450
|
-
if (i.
|
|
448
|
+
for (let n = 0; n < e.Z.length; n++) {
|
|
449
|
+
const i = e.Z[n];
|
|
450
|
+
if (i.ae & STATUS_PENDING && i.q?.source === i) {
|
|
451
451
|
t = false;
|
|
452
452
|
break;
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
|
-
t && (e.
|
|
455
|
+
t && (e.te = true);
|
|
456
456
|
return t;
|
|
457
457
|
}
|
|
458
458
|
function currentTransition(e) {
|
|
459
|
-
while (e.
|
|
459
|
+
while (e.te && typeof e.te === "object") e = e.te;
|
|
460
460
|
return e;
|
|
461
461
|
}
|
|
462
462
|
function setActiveTransition(e) {
|
|
@@ -479,58 +479,58 @@ function getOrCreateLane(e) {
|
|
|
479
479
|
return findLane(t);
|
|
480
480
|
}
|
|
481
481
|
const n = e.Ee;
|
|
482
|
-
const i = n?.
|
|
483
|
-
t = {
|
|
482
|
+
const i = n?.ie ? findLane(n.ie) : null;
|
|
483
|
+
t = { fe: e, U: new Set(), W: [[], []], k: null, ne: activeTransition, Te: i };
|
|
484
484
|
signalLanes.set(e, t);
|
|
485
485
|
activeLanes.add(t);
|
|
486
486
|
e.de = e.Re || 0;
|
|
487
487
|
return t;
|
|
488
488
|
}
|
|
489
489
|
function findLane(e) {
|
|
490
|
-
while (e.
|
|
490
|
+
while (e.k) e = e.k;
|
|
491
491
|
return e;
|
|
492
492
|
}
|
|
493
493
|
function mergeLanes(e, t) {
|
|
494
494
|
e = findLane(e);
|
|
495
495
|
t = findLane(t);
|
|
496
496
|
if (e === t) return e;
|
|
497
|
-
t.
|
|
498
|
-
for (const n of t.
|
|
499
|
-
e.
|
|
500
|
-
e.
|
|
497
|
+
t.k = e;
|
|
498
|
+
for (const n of t.U) e.U.add(n);
|
|
499
|
+
e.W[0].push(...t.W[0]);
|
|
500
|
+
e.W[1].push(...t.W[1]);
|
|
501
501
|
return e;
|
|
502
502
|
}
|
|
503
503
|
function resolveLane(e) {
|
|
504
|
-
const t = e.
|
|
504
|
+
const t = e.ie;
|
|
505
505
|
if (!t) return undefined;
|
|
506
506
|
const n = findLane(t);
|
|
507
507
|
if (activeLanes.has(n)) return n;
|
|
508
|
-
e.
|
|
508
|
+
e.ie = undefined;
|
|
509
509
|
return undefined;
|
|
510
510
|
}
|
|
511
511
|
function hasActiveOverride(e) {
|
|
512
|
-
return !!(e.Oe && e.
|
|
512
|
+
return !!(e.Oe && e.ce !== NOT_PENDING);
|
|
513
513
|
}
|
|
514
514
|
function assignOrMergeLane(e, t) {
|
|
515
515
|
const n = findLane(t);
|
|
516
|
-
const i = e.
|
|
516
|
+
const i = e.ie;
|
|
517
517
|
if (i) {
|
|
518
|
-
if (i.
|
|
519
|
-
e.
|
|
518
|
+
if (i.k) {
|
|
519
|
+
e.ie = t;
|
|
520
520
|
return;
|
|
521
521
|
}
|
|
522
522
|
const r = findLane(i);
|
|
523
523
|
if (activeLanes.has(r)) {
|
|
524
524
|
if (r !== n && !hasActiveOverride(e)) {
|
|
525
525
|
if (n.Te && findLane(n.Te) === r) {
|
|
526
|
-
e.
|
|
526
|
+
e.ie = t;
|
|
527
527
|
} else if (r.Te && findLane(r.Te) === n);
|
|
528
528
|
else mergeLanes(n, r);
|
|
529
529
|
}
|
|
530
530
|
return;
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
|
-
e.
|
|
533
|
+
e.ie = t;
|
|
534
534
|
}
|
|
535
535
|
function handleAsync(e, t, n) {
|
|
536
536
|
const i = typeof t === "object" && t !== null;
|
|
@@ -544,32 +544,32 @@ function handleAsync(e, t, n) {
|
|
|
544
544
|
let s;
|
|
545
545
|
const handleError = n => {
|
|
546
546
|
if (e.Se !== t) return;
|
|
547
|
-
globalQueue.initTransition(e.
|
|
547
|
+
globalQueue.initTransition(e.ne);
|
|
548
548
|
notifyStatus(e, n instanceof NotReadyError ? STATUS_PENDING : STATUS_ERROR, n);
|
|
549
|
-
e.
|
|
549
|
+
e.J = clock;
|
|
550
550
|
};
|
|
551
551
|
const asyncWrite = (i, r) => {
|
|
552
552
|
if (e.Se !== t) return;
|
|
553
|
-
if (e.
|
|
554
|
-
globalQueue.initTransition(e.
|
|
553
|
+
if (e.S & (REACTIVE_DIRTY | REACTIVE_OPTIMISTIC_DIRTY)) return;
|
|
554
|
+
globalQueue.initTransition(e.ne);
|
|
555
555
|
clearStatus(e);
|
|
556
556
|
const o = resolveLane(e);
|
|
557
|
-
if (o) o.
|
|
557
|
+
if (o) o.U.delete(e);
|
|
558
558
|
if (n) n(i);
|
|
559
559
|
else if (e.Oe) {
|
|
560
|
-
const t = e.
|
|
561
|
-
if (e.
|
|
560
|
+
const t = e.ce !== NOT_PENDING;
|
|
561
|
+
if (e.L) e.ce = i;
|
|
562
562
|
if (!t) {
|
|
563
|
-
e.
|
|
563
|
+
e.le = i;
|
|
564
564
|
insertSubs(e);
|
|
565
565
|
}
|
|
566
|
-
e.
|
|
566
|
+
e.J = clock;
|
|
567
567
|
} else if (o) {
|
|
568
|
-
const t = e.
|
|
568
|
+
const t = e.le;
|
|
569
569
|
const n = e._e;
|
|
570
570
|
if (!n || !n(i, t)) {
|
|
571
|
-
e.
|
|
572
|
-
e.
|
|
571
|
+
e.le = i;
|
|
572
|
+
e.J = clock;
|
|
573
573
|
if (e.Ie) {
|
|
574
574
|
setSignal(e.Ie, i);
|
|
575
575
|
}
|
|
@@ -598,7 +598,7 @@ function handleAsync(e, t, n) {
|
|
|
598
598
|
);
|
|
599
599
|
i = false;
|
|
600
600
|
if (!n) {
|
|
601
|
-
globalQueue.initTransition(e.
|
|
601
|
+
globalQueue.initTransition(e.ne);
|
|
602
602
|
throw new NotReadyError(context);
|
|
603
603
|
}
|
|
604
604
|
}
|
|
@@ -630,36 +630,36 @@ function handleAsync(e, t, n) {
|
|
|
630
630
|
};
|
|
631
631
|
const r = iterate();
|
|
632
632
|
if (!i && !r) {
|
|
633
|
-
globalQueue.initTransition(e.
|
|
633
|
+
globalQueue.initTransition(e.ne);
|
|
634
634
|
throw new NotReadyError(context);
|
|
635
635
|
}
|
|
636
636
|
}
|
|
637
637
|
return s;
|
|
638
638
|
}
|
|
639
639
|
function clearStatus(e) {
|
|
640
|
-
e.
|
|
641
|
-
e.
|
|
640
|
+
e.ae = e.ae & STATUS_UNINITIALIZED;
|
|
641
|
+
e.q = null;
|
|
642
642
|
updatePendingSignal(e);
|
|
643
643
|
e.pe?.();
|
|
644
644
|
}
|
|
645
645
|
function notifyStatus(e, t, n, i, r) {
|
|
646
646
|
if (t === STATUS_ERROR && !(n instanceof StatusError) && !(n instanceof NotReadyError))
|
|
647
647
|
n = new StatusError(e, n);
|
|
648
|
-
const o = n instanceof NotReadyError && n.
|
|
648
|
+
const o = n instanceof NotReadyError && n.source === e;
|
|
649
649
|
const s = t === STATUS_PENDING && e.Oe && !o;
|
|
650
650
|
const u = s && hasActiveOverride(e);
|
|
651
651
|
if (!i) {
|
|
652
|
-
e.
|
|
653
|
-
e.
|
|
652
|
+
e.ae = t | (t !== STATUS_ERROR ? e.ae & STATUS_UNINITIALIZED : 0);
|
|
653
|
+
e.q = n;
|
|
654
654
|
updatePendingSignal(e);
|
|
655
655
|
}
|
|
656
656
|
if (r && !i) {
|
|
657
657
|
assignOrMergeLane(e, r);
|
|
658
658
|
}
|
|
659
659
|
if (u && activeTransition && n instanceof NotReadyError) {
|
|
660
|
-
const e = n.
|
|
661
|
-
if (!activeTransition.
|
|
662
|
-
activeTransition.
|
|
660
|
+
const e = n.source;
|
|
661
|
+
if (!activeTransition.Z.includes(e)) {
|
|
662
|
+
activeTransition.Z.push(e);
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
665
|
const c = i || u;
|
|
@@ -672,19 +672,19 @@ function notifyStatus(e, t, n, i, r) {
|
|
|
672
672
|
}
|
|
673
673
|
return;
|
|
674
674
|
}
|
|
675
|
-
for (let i = e.
|
|
676
|
-
i.
|
|
677
|
-
if (i.
|
|
678
|
-
!i.
|
|
679
|
-
notifyStatus(i.
|
|
675
|
+
for (let i = e.I; i !== null; i = i.p) {
|
|
676
|
+
i.h.J = clock;
|
|
677
|
+
if (i.h.q !== n) {
|
|
678
|
+
!i.h.ne && globalQueue.$.push(i.h);
|
|
679
|
+
notifyStatus(i.h, t, n, c, l);
|
|
680
680
|
}
|
|
681
681
|
}
|
|
682
|
-
for (let i = e.
|
|
683
|
-
for (let e = i.
|
|
684
|
-
e.
|
|
685
|
-
if (e.
|
|
686
|
-
!e.
|
|
687
|
-
notifyStatus(e.
|
|
682
|
+
for (let i = e.A; i !== null; i = i.P) {
|
|
683
|
+
for (let e = i.I; e !== null; e = e.p) {
|
|
684
|
+
e.h.J = clock;
|
|
685
|
+
if (e.h.q !== n) {
|
|
686
|
+
!e.h.ne && globalQueue.$.push(e.h);
|
|
687
|
+
notifyStatus(e.h, t, n, c, l);
|
|
688
688
|
}
|
|
689
689
|
}
|
|
690
690
|
}
|
|
@@ -694,8 +694,8 @@ function effect(e, t, n, i, r) {
|
|
|
694
694
|
const s = computed(r?.render ? t => staleValues(() => e(t)) : e, i, {
|
|
695
695
|
...r,
|
|
696
696
|
equals: () => {
|
|
697
|
-
s.
|
|
698
|
-
if (o) s.
|
|
697
|
+
s.oe = !s.q;
|
|
698
|
+
if (o) s.se.enqueue(s.re, runEffect.bind(s));
|
|
699
699
|
return false;
|
|
700
700
|
},
|
|
701
701
|
lazy: true
|
|
@@ -704,14 +704,14 @@ function effect(e, t, n, i, r) {
|
|
|
704
704
|
s.Ae = t;
|
|
705
705
|
s.ge = n;
|
|
706
706
|
s.Pe = undefined;
|
|
707
|
-
s.
|
|
707
|
+
s.re = r?.render ? EFFECT_RENDER : EFFECT_USER;
|
|
708
708
|
s.pe = (e, t) => {
|
|
709
|
-
const n = e !== undefined ? e : s.
|
|
710
|
-
const i = t !== undefined ? t : s.
|
|
709
|
+
const n = e !== undefined ? e : s.ae;
|
|
710
|
+
const i = t !== undefined ? t : s.q;
|
|
711
711
|
if (n & STATUS_ERROR) {
|
|
712
712
|
let e = i;
|
|
713
|
-
s.
|
|
714
|
-
if (s.
|
|
713
|
+
s.se.notify(s, STATUS_PENDING, 0);
|
|
714
|
+
if (s.re === EFFECT_USER) {
|
|
715
715
|
try {
|
|
716
716
|
return s.ge
|
|
717
717
|
? s.ge(e, () => {
|
|
@@ -723,31 +723,31 @@ function effect(e, t, n, i, r) {
|
|
|
723
723
|
e = t;
|
|
724
724
|
}
|
|
725
725
|
}
|
|
726
|
-
if (!s.
|
|
727
|
-
} else if (s.
|
|
726
|
+
if (!s.se.notify(s, STATUS_ERROR, STATUS_ERROR)) throw e;
|
|
727
|
+
} else if (s.re === EFFECT_RENDER) s.se.notify(s, STATUS_PENDING | STATUS_ERROR, n, i);
|
|
728
728
|
};
|
|
729
729
|
recompute(s, true);
|
|
730
|
-
!r?.defer && (s.
|
|
730
|
+
!r?.defer && (s.re === EFFECT_USER ? s.se.enqueue(s.re, runEffect.bind(s)) : runEffect.call(s));
|
|
731
731
|
o = true;
|
|
732
732
|
onCleanup(() => s.Pe?.());
|
|
733
733
|
}
|
|
734
734
|
function runEffect() {
|
|
735
|
-
if (!this.
|
|
735
|
+
if (!this.oe || this.S & REACTIVE_DISPOSED) return;
|
|
736
736
|
this.Pe?.();
|
|
737
737
|
this.Pe = undefined;
|
|
738
738
|
try {
|
|
739
|
-
this.Pe = this.Ae(this.
|
|
739
|
+
this.Pe = this.Ae(this.le, this.he);
|
|
740
740
|
} catch (e) {
|
|
741
|
-
if (!this.
|
|
741
|
+
if (!this.se.notify(this, STATUS_ERROR, STATUS_ERROR)) throw e;
|
|
742
742
|
} finally {
|
|
743
|
-
this.he = this.
|
|
744
|
-
this.
|
|
743
|
+
this.he = this.le;
|
|
744
|
+
this.oe = false;
|
|
745
745
|
}
|
|
746
746
|
}
|
|
747
747
|
function trackedEffect(e, t) {
|
|
748
748
|
const run = () => {
|
|
749
|
-
if (!n.
|
|
750
|
-
n.
|
|
749
|
+
if (!n.oe || n.S & REACTIVE_DISPOSED) return;
|
|
750
|
+
n.oe = false;
|
|
751
751
|
recompute(n);
|
|
752
752
|
};
|
|
753
753
|
const n = computed(
|
|
@@ -763,18 +763,18 @@ function trackedEffect(e, t) {
|
|
|
763
763
|
{ ...t, lazy: true, pureWrite: true }
|
|
764
764
|
);
|
|
765
765
|
n.Pe = undefined;
|
|
766
|
-
n.
|
|
767
|
-
n.
|
|
768
|
-
n.
|
|
769
|
-
n.
|
|
766
|
+
n.oe = true;
|
|
767
|
+
n.re = EFFECT_TRACKED;
|
|
768
|
+
n.ue = run;
|
|
769
|
+
n.se.enqueue(EFFECT_USER, run);
|
|
770
770
|
onCleanup(() => n.Pe?.());
|
|
771
771
|
}
|
|
772
772
|
const PENDING_OWNER = {};
|
|
773
773
|
function markDisposal(e) {
|
|
774
774
|
let t = e.Ce;
|
|
775
775
|
while (t) {
|
|
776
|
-
t.
|
|
777
|
-
if (t.
|
|
776
|
+
t.S |= REACTIVE_ZOMBIE;
|
|
777
|
+
if (t.S & REACTIVE_IN_HEAP) {
|
|
778
778
|
deleteFromHeap(t, dirtyQueue);
|
|
779
779
|
insertIntoHeap(t, zombieQueue);
|
|
780
780
|
}
|
|
@@ -783,28 +783,28 @@ function markDisposal(e) {
|
|
|
783
783
|
}
|
|
784
784
|
}
|
|
785
785
|
function dispose(e) {
|
|
786
|
-
let t = e.
|
|
786
|
+
let t = e.N || null;
|
|
787
787
|
do {
|
|
788
788
|
t = unlinkSubs(t);
|
|
789
789
|
} while (t !== null);
|
|
790
|
-
e.
|
|
790
|
+
e.N = null;
|
|
791
791
|
e.ye = null;
|
|
792
792
|
disposeChildren(e, true);
|
|
793
793
|
}
|
|
794
794
|
function disposeChildren(e, t = false, n) {
|
|
795
|
-
if (e.
|
|
796
|
-
if (t) e.
|
|
795
|
+
if (e.S & REACTIVE_DISPOSED) return;
|
|
796
|
+
if (t) e.S = REACTIVE_DISPOSED;
|
|
797
797
|
let i = n ? e.De : e.Ce;
|
|
798
798
|
while (i) {
|
|
799
799
|
const e = i.Ne;
|
|
800
|
-
if (i.
|
|
800
|
+
if (i.N) {
|
|
801
801
|
const e = i;
|
|
802
|
-
deleteFromHeap(e, e.
|
|
803
|
-
let t = e.
|
|
802
|
+
deleteFromHeap(e, e.S & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
|
|
803
|
+
let t = e.N;
|
|
804
804
|
do {
|
|
805
805
|
t = unlinkSubs(t);
|
|
806
806
|
} while (t !== null);
|
|
807
|
-
e.
|
|
807
|
+
e.N = null;
|
|
808
808
|
e.ye = null;
|
|
809
809
|
}
|
|
810
810
|
disposeChildren(i, true);
|
|
@@ -858,17 +858,17 @@ function createOwner(e) {
|
|
|
858
858
|
const t = context;
|
|
859
859
|
const n = {
|
|
860
860
|
id: e?.id ?? (t?.id != null ? getNextChildId(t) : undefined),
|
|
861
|
-
|
|
862
|
-
|
|
861
|
+
t: true,
|
|
862
|
+
u: t?.t ? t.u : t,
|
|
863
863
|
Ce: null,
|
|
864
864
|
Ne: null,
|
|
865
865
|
we: null,
|
|
866
|
-
|
|
866
|
+
se: t?.se ?? globalQueue,
|
|
867
867
|
Ve: t?.Ve || defaultContext,
|
|
868
868
|
be: 0,
|
|
869
869
|
ve: null,
|
|
870
870
|
De: null,
|
|
871
|
-
|
|
871
|
+
i: t,
|
|
872
872
|
dispose(e = true) {
|
|
873
873
|
disposeChildren(n, e);
|
|
874
874
|
}
|
|
@@ -889,65 +889,65 @@ function createRoot(e, t) {
|
|
|
889
889
|
return runWithOwner(n, () => e(n.dispose));
|
|
890
890
|
}
|
|
891
891
|
function unlinkSubs(e) {
|
|
892
|
-
const t = e.
|
|
893
|
-
const n = e.
|
|
894
|
-
const i = e.
|
|
892
|
+
const t = e.V;
|
|
893
|
+
const n = e.D;
|
|
894
|
+
const i = e.p;
|
|
895
895
|
const r = e.me;
|
|
896
896
|
if (i !== null) i.me = r;
|
|
897
897
|
else t.Le = r;
|
|
898
|
-
if (r !== null) r.
|
|
898
|
+
if (r !== null) r.p = i;
|
|
899
899
|
else {
|
|
900
|
-
t.
|
|
900
|
+
t.I = i;
|
|
901
901
|
if (i === null) {
|
|
902
902
|
t.ke?.();
|
|
903
|
-
t.
|
|
903
|
+
t.L && !t.Ue && unobserved(t);
|
|
904
904
|
}
|
|
905
905
|
}
|
|
906
906
|
return n;
|
|
907
907
|
}
|
|
908
908
|
function unobserved(e) {
|
|
909
|
-
deleteFromHeap(e, e.
|
|
910
|
-
let t = e.
|
|
909
|
+
deleteFromHeap(e, e.S & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
|
|
910
|
+
let t = e.N;
|
|
911
911
|
while (t !== null) {
|
|
912
912
|
t = unlinkSubs(t);
|
|
913
913
|
}
|
|
914
|
-
e.
|
|
914
|
+
e.N = null;
|
|
915
915
|
disposeChildren(e, true);
|
|
916
916
|
}
|
|
917
917
|
function link(e, t) {
|
|
918
918
|
const n = t.ye;
|
|
919
|
-
if (n !== null && n.
|
|
919
|
+
if (n !== null && n.V === e) return;
|
|
920
920
|
let i = null;
|
|
921
|
-
const r = t.
|
|
921
|
+
const r = t.S & REACTIVE_RECOMPUTING_DEPS;
|
|
922
922
|
if (r) {
|
|
923
|
-
i = n !== null ? n.
|
|
924
|
-
if (i !== null && i.
|
|
923
|
+
i = n !== null ? n.D : t.N;
|
|
924
|
+
if (i !== null && i.V === e) {
|
|
925
925
|
t.ye = i;
|
|
926
926
|
return;
|
|
927
927
|
}
|
|
928
928
|
}
|
|
929
929
|
const o = e.Le;
|
|
930
|
-
if (o !== null && o.
|
|
931
|
-
const s = (t.ye = e.Le = {
|
|
932
|
-
if (n !== null) n.
|
|
933
|
-
else t.
|
|
934
|
-
if (o !== null) o.
|
|
935
|
-
else e.
|
|
930
|
+
if (o !== null && o.h === t && (!r || isValidLink(o, t))) return;
|
|
931
|
+
const s = (t.ye = e.Le = { V: e, h: t, D: i, me: o, p: null });
|
|
932
|
+
if (n !== null) n.D = s;
|
|
933
|
+
else t.N = s;
|
|
934
|
+
if (o !== null) o.p = s;
|
|
935
|
+
else e.I = s;
|
|
936
936
|
}
|
|
937
937
|
function isValidLink(e, t) {
|
|
938
938
|
const n = t.ye;
|
|
939
939
|
if (n !== null) {
|
|
940
|
-
let i = t.
|
|
940
|
+
let i = t.N;
|
|
941
941
|
do {
|
|
942
942
|
if (i === e) return true;
|
|
943
943
|
if (i === n) break;
|
|
944
|
-
i = i.
|
|
944
|
+
i = i.D;
|
|
945
945
|
} while (i !== null);
|
|
946
946
|
}
|
|
947
947
|
return false;
|
|
948
948
|
}
|
|
949
|
-
GlobalQueue.
|
|
950
|
-
GlobalQueue.
|
|
949
|
+
GlobalQueue.K = recompute;
|
|
950
|
+
GlobalQueue.Y = disposeChildren;
|
|
951
951
|
let tracking = false;
|
|
952
952
|
let stale = false;
|
|
953
953
|
let refreshing = false;
|
|
@@ -957,12 +957,12 @@ let pendingReadActive = false;
|
|
|
957
957
|
let context = null;
|
|
958
958
|
let currentOptimisticLane = null;
|
|
959
959
|
function recompute(e, t = false) {
|
|
960
|
-
const n = e.
|
|
960
|
+
const n = e.re;
|
|
961
961
|
if (!t) {
|
|
962
|
-
if (e.
|
|
963
|
-
globalQueue.initTransition(e.
|
|
964
|
-
deleteFromHeap(e, e.
|
|
965
|
-
if (e.
|
|
962
|
+
if (e.ne && (!n || activeTransition) && activeTransition !== e.ne)
|
|
963
|
+
globalQueue.initTransition(e.ne);
|
|
964
|
+
deleteFromHeap(e, e.S & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
|
|
965
|
+
if (e.ne || n === EFFECT_TRACKED) disposeChildren(e);
|
|
966
966
|
else {
|
|
967
967
|
markDisposal(e);
|
|
968
968
|
e.ve = e.we;
|
|
@@ -971,16 +971,16 @@ function recompute(e, t = false) {
|
|
|
971
971
|
e.Ce = null;
|
|
972
972
|
}
|
|
973
973
|
}
|
|
974
|
-
const i = !!(e.
|
|
974
|
+
const i = !!(e.S & REACTIVE_OPTIMISTIC_DIRTY);
|
|
975
975
|
const r = hasActiveOverride(e);
|
|
976
|
-
const o = !!(e.
|
|
976
|
+
const o = !!(e.ae & STATUS_PENDING);
|
|
977
977
|
const s = context;
|
|
978
978
|
context = e;
|
|
979
979
|
e.ye = null;
|
|
980
|
-
e.
|
|
981
|
-
e.
|
|
982
|
-
let u = e.
|
|
983
|
-
let c = e.
|
|
980
|
+
e.S = REACTIVE_RECOMPUTING_DEPS;
|
|
981
|
+
e.J = clock;
|
|
982
|
+
let u = e.ce === NOT_PENDING ? e.le : e.ce;
|
|
983
|
+
let c = e.o;
|
|
984
984
|
let l = tracking;
|
|
985
985
|
let a = currentOptimisticLane;
|
|
986
986
|
tracking = true;
|
|
@@ -989,20 +989,20 @@ function recompute(e, t = false) {
|
|
|
989
989
|
if (t) currentOptimisticLane = t;
|
|
990
990
|
}
|
|
991
991
|
try {
|
|
992
|
-
u = handleAsync(e, e.
|
|
992
|
+
u = handleAsync(e, e.L(u));
|
|
993
993
|
clearStatus(e);
|
|
994
994
|
const t = resolveLane(e);
|
|
995
995
|
if (t) {
|
|
996
|
-
t.
|
|
997
|
-
updatePendingSignal(t.
|
|
996
|
+
t.U.delete(e);
|
|
997
|
+
updatePendingSignal(t.fe);
|
|
998
998
|
}
|
|
999
999
|
} catch (t) {
|
|
1000
1000
|
if (t instanceof NotReadyError && currentOptimisticLane) {
|
|
1001
1001
|
const t = findLane(currentOptimisticLane);
|
|
1002
|
-
if (t.
|
|
1003
|
-
t.
|
|
1004
|
-
e.
|
|
1005
|
-
updatePendingSignal(t.
|
|
1002
|
+
if (t.fe !== e) {
|
|
1003
|
+
t.U.add(e);
|
|
1004
|
+
e.ie = t;
|
|
1005
|
+
updatePendingSignal(t.fe);
|
|
1006
1006
|
}
|
|
1007
1007
|
}
|
|
1008
1008
|
notifyStatus(
|
|
@@ -1010,66 +1010,66 @@ function recompute(e, t = false) {
|
|
|
1010
1010
|
t instanceof NotReadyError ? STATUS_PENDING : STATUS_ERROR,
|
|
1011
1011
|
t,
|
|
1012
1012
|
undefined,
|
|
1013
|
-
t instanceof NotReadyError ? e.
|
|
1013
|
+
t instanceof NotReadyError ? e.ie : undefined
|
|
1014
1014
|
);
|
|
1015
1015
|
} finally {
|
|
1016
1016
|
tracking = l;
|
|
1017
|
-
e.
|
|
1017
|
+
e.S = REACTIVE_NONE;
|
|
1018
1018
|
context = s;
|
|
1019
1019
|
}
|
|
1020
|
-
if (!e.
|
|
1020
|
+
if (!e.q) {
|
|
1021
1021
|
const s = e.ye;
|
|
1022
|
-
let l = s !== null ? s.
|
|
1022
|
+
let l = s !== null ? s.D : e.N;
|
|
1023
1023
|
if (l !== null) {
|
|
1024
1024
|
do {
|
|
1025
1025
|
l = unlinkSubs(l);
|
|
1026
1026
|
} while (l !== null);
|
|
1027
|
-
if (s !== null) s.
|
|
1028
|
-
else e.
|
|
1027
|
+
if (s !== null) s.D = null;
|
|
1028
|
+
else e.N = null;
|
|
1029
1029
|
}
|
|
1030
|
-
const a = r ? e.
|
|
1030
|
+
const a = r ? e.le : e.ce === NOT_PENDING ? e.le : e.ce;
|
|
1031
1031
|
const f = !e._e || !e._e(a, u);
|
|
1032
1032
|
if (f) {
|
|
1033
|
-
const s = r ? e.
|
|
1034
|
-
if (t || (n && activeTransition !== e.
|
|
1035
|
-
else e.
|
|
1033
|
+
const s = r ? e.le : undefined;
|
|
1034
|
+
if (t || (n && activeTransition !== e.ne) || i) e.le = u;
|
|
1035
|
+
else e.ce = u;
|
|
1036
1036
|
if (r && !i && o) {
|
|
1037
1037
|
const t = e.Re || 0;
|
|
1038
1038
|
const n = e.de || 0;
|
|
1039
|
-
if (t <= n) e.
|
|
1039
|
+
if (t <= n) e.le = u;
|
|
1040
1040
|
}
|
|
1041
|
-
if (!r || i || e.
|
|
1041
|
+
if (!r || i || e.le !== s) {
|
|
1042
1042
|
insertSubs(e, i || r);
|
|
1043
1043
|
}
|
|
1044
1044
|
} else if (r) {
|
|
1045
|
-
e.
|
|
1046
|
-
} else if (e.
|
|
1047
|
-
for (let t = e.
|
|
1048
|
-
insertIntoHeapHeight(t.
|
|
1045
|
+
e.ce = u;
|
|
1046
|
+
} else if (e.o != c) {
|
|
1047
|
+
for (let t = e.I; t !== null; t = t.p) {
|
|
1048
|
+
insertIntoHeapHeight(t.h, t.h.S & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
|
|
1049
1049
|
}
|
|
1050
1050
|
}
|
|
1051
1051
|
}
|
|
1052
1052
|
currentOptimisticLane = a;
|
|
1053
|
-
(!t || e.
|
|
1054
|
-
e.
|
|
1053
|
+
(!t || e.ae & STATUS_PENDING) && !e.ne && !(activeTransition && e.Oe) && globalQueue.$.push(e);
|
|
1054
|
+
e.ne && n && activeTransition !== e.ne && runInTransition(e.ne, () => recompute(e));
|
|
1055
1055
|
}
|
|
1056
1056
|
function updateIfNecessary(e) {
|
|
1057
|
-
if (e.
|
|
1058
|
-
for (let t = e.
|
|
1059
|
-
const n = t.
|
|
1060
|
-
const i = n.
|
|
1061
|
-
if (i.
|
|
1057
|
+
if (e.S & REACTIVE_CHECK) {
|
|
1058
|
+
for (let t = e.N; t; t = t.D) {
|
|
1059
|
+
const n = t.V;
|
|
1060
|
+
const i = n.m || n;
|
|
1061
|
+
if (i.L) {
|
|
1062
1062
|
updateIfNecessary(i);
|
|
1063
1063
|
}
|
|
1064
|
-
if (e.
|
|
1064
|
+
if (e.S & REACTIVE_DIRTY) {
|
|
1065
1065
|
break;
|
|
1066
1066
|
}
|
|
1067
1067
|
}
|
|
1068
1068
|
}
|
|
1069
|
-
if (e.
|
|
1069
|
+
if (e.S & (REACTIVE_DIRTY | REACTIVE_OPTIMISTIC_DIRTY) || (e.q && e.J < clock)) {
|
|
1070
1070
|
recompute(e);
|
|
1071
1071
|
}
|
|
1072
|
-
e.
|
|
1072
|
+
e.S = REACTIVE_NONE;
|
|
1073
1073
|
}
|
|
1074
1074
|
function computed(e, t, n) {
|
|
1075
1075
|
const i = {
|
|
@@ -1078,33 +1078,33 @@ function computed(e, t, n) {
|
|
|
1078
1078
|
We: !!n?.pureWrite,
|
|
1079
1079
|
ke: n?.unobserved,
|
|
1080
1080
|
we: null,
|
|
1081
|
-
|
|
1081
|
+
se: context?.se ?? globalQueue,
|
|
1082
1082
|
Ve: context?.Ve ?? defaultContext,
|
|
1083
1083
|
be: 0,
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1084
|
+
L: e,
|
|
1085
|
+
le: t,
|
|
1086
|
+
o: 0,
|
|
1087
|
+
A: null,
|
|
1088
|
+
R: undefined,
|
|
1089
|
+
T: null,
|
|
1090
|
+
N: null,
|
|
1091
1091
|
ye: null,
|
|
1092
|
-
|
|
1092
|
+
I: null,
|
|
1093
1093
|
Le: null,
|
|
1094
|
-
|
|
1094
|
+
i: context,
|
|
1095
1095
|
Ne: null,
|
|
1096
1096
|
Ce: null,
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1097
|
+
S: REACTIVE_NONE,
|
|
1098
|
+
ae: STATUS_UNINITIALIZED,
|
|
1099
|
+
J: clock,
|
|
1100
|
+
ce: NOT_PENDING,
|
|
1101
1101
|
ve: null,
|
|
1102
1102
|
De: null,
|
|
1103
1103
|
Se: null,
|
|
1104
|
-
|
|
1104
|
+
ne: null
|
|
1105
1105
|
};
|
|
1106
|
-
i.
|
|
1107
|
-
const r = context?.
|
|
1106
|
+
i.T = i;
|
|
1107
|
+
const r = context?.t ? context.u : context;
|
|
1108
1108
|
if (context) {
|
|
1109
1109
|
const e = context.Ce;
|
|
1110
1110
|
if (e === null) {
|
|
@@ -1114,7 +1114,7 @@ function computed(e, t, n) {
|
|
|
1114
1114
|
context.Ce = i;
|
|
1115
1115
|
}
|
|
1116
1116
|
}
|
|
1117
|
-
if (r) i.
|
|
1117
|
+
if (r) i.o = r.o + 1;
|
|
1118
1118
|
!n?.lazy && recompute(i, true);
|
|
1119
1119
|
return i;
|
|
1120
1120
|
}
|
|
@@ -1123,15 +1123,15 @@ function signal(e, t, n = null) {
|
|
|
1123
1123
|
_e: t?.equals != null ? t.equals : isEqual,
|
|
1124
1124
|
We: !!t?.pureWrite,
|
|
1125
1125
|
ke: t?.unobserved,
|
|
1126
|
-
|
|
1127
|
-
|
|
1126
|
+
le: e,
|
|
1127
|
+
I: null,
|
|
1128
1128
|
Le: null,
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1129
|
+
J: clock,
|
|
1130
|
+
m: n,
|
|
1131
|
+
P: n?.A || null,
|
|
1132
|
+
ce: NOT_PENDING
|
|
1133
1133
|
};
|
|
1134
|
-
n && (n.
|
|
1134
|
+
n && (n.A = i);
|
|
1135
1135
|
return i;
|
|
1136
1136
|
}
|
|
1137
1137
|
function optimisticSignal(e, t) {
|
|
@@ -1163,18 +1163,18 @@ function read(e) {
|
|
|
1163
1163
|
pendingReadActive = false;
|
|
1164
1164
|
const i = read(t);
|
|
1165
1165
|
pendingReadActive = n;
|
|
1166
|
-
if (t.
|
|
1167
|
-
if (stale && currentOptimisticLane && t.
|
|
1168
|
-
const n = findLane(t.
|
|
1166
|
+
if (t.ae & STATUS_PENDING) return e.le;
|
|
1167
|
+
if (stale && currentOptimisticLane && t.ie) {
|
|
1168
|
+
const n = findLane(t.ie);
|
|
1169
1169
|
const i = findLane(currentOptimisticLane);
|
|
1170
|
-
if (n !== i && n.
|
|
1171
|
-
return e.
|
|
1170
|
+
if (n !== i && n.U.size > 0) {
|
|
1171
|
+
return e.le;
|
|
1172
1172
|
}
|
|
1173
1173
|
}
|
|
1174
1174
|
return i;
|
|
1175
1175
|
}
|
|
1176
1176
|
if (pendingCheckActive) {
|
|
1177
|
-
const t = e.
|
|
1177
|
+
const t = e.m || e;
|
|
1178
1178
|
const n = getPendingSignal(t);
|
|
1179
1179
|
const i = pendingCheckActive;
|
|
1180
1180
|
pendingCheckActive = false;
|
|
@@ -1182,92 +1182,92 @@ function read(e) {
|
|
|
1182
1182
|
foundPending = true;
|
|
1183
1183
|
}
|
|
1184
1184
|
pendingCheckActive = i;
|
|
1185
|
-
return e.
|
|
1185
|
+
return e.le;
|
|
1186
1186
|
}
|
|
1187
1187
|
let t = context;
|
|
1188
|
-
if (t?.
|
|
1189
|
-
if (refreshing && e.
|
|
1188
|
+
if (t?.t) t = t.u;
|
|
1189
|
+
if (refreshing && e.L) recompute(e);
|
|
1190
1190
|
if (t && tracking) {
|
|
1191
|
-
if (e.
|
|
1191
|
+
if (e.L && e.S & REACTIVE_DISPOSED) recompute(e);
|
|
1192
1192
|
link(e, t);
|
|
1193
|
-
const n = e.
|
|
1194
|
-
if (n.
|
|
1195
|
-
const i = e.
|
|
1196
|
-
if (n.
|
|
1193
|
+
const n = e.m || e;
|
|
1194
|
+
if (n.L) {
|
|
1195
|
+
const i = e.S & REACTIVE_ZOMBIE;
|
|
1196
|
+
if (n.o >= (i ? zombieQueue.C : dirtyQueue.C)) {
|
|
1197
1197
|
markNode(t);
|
|
1198
1198
|
markHeap(i ? zombieQueue : dirtyQueue);
|
|
1199
1199
|
updateIfNecessary(n);
|
|
1200
1200
|
}
|
|
1201
|
-
const r = n.
|
|
1202
|
-
if (r >= t.
|
|
1203
|
-
t.
|
|
1201
|
+
const r = n.o;
|
|
1202
|
+
if (r >= t.o && e.i !== t) {
|
|
1203
|
+
t.o = r + 1;
|
|
1204
1204
|
}
|
|
1205
1205
|
}
|
|
1206
1206
|
}
|
|
1207
|
-
const n = e.
|
|
1208
|
-
if (t && n.
|
|
1207
|
+
const n = e.m || e;
|
|
1208
|
+
if (t && n.ae & STATUS_PENDING && !(stale && n.ne && activeTransition !== n.ne)) {
|
|
1209
1209
|
if (currentOptimisticLane) {
|
|
1210
|
-
const i = n.
|
|
1210
|
+
const i = n.ie;
|
|
1211
1211
|
const r = findLane(currentOptimisticLane);
|
|
1212
1212
|
if (i && findLane(i) === r && !hasActiveOverride(n)) {
|
|
1213
1213
|
if (!tracking) link(e, t);
|
|
1214
|
-
throw n.
|
|
1214
|
+
throw n.q;
|
|
1215
1215
|
}
|
|
1216
1216
|
} else {
|
|
1217
1217
|
if (!tracking) link(e, t);
|
|
1218
|
-
throw n.
|
|
1218
|
+
throw n.q;
|
|
1219
1219
|
}
|
|
1220
1220
|
}
|
|
1221
|
-
if (e.
|
|
1222
|
-
if (e.
|
|
1221
|
+
if (e.L && e.ae & STATUS_ERROR) {
|
|
1222
|
+
if (e.J < clock) {
|
|
1223
1223
|
recompute(e, true);
|
|
1224
1224
|
return read(e);
|
|
1225
|
-
} else throw e.
|
|
1225
|
+
} else throw e.q;
|
|
1226
1226
|
}
|
|
1227
1227
|
return !t ||
|
|
1228
1228
|
currentOptimisticLane !== null ||
|
|
1229
|
-
e.
|
|
1230
|
-
(stale && e.
|
|
1231
|
-
? e.
|
|
1232
|
-
: e.
|
|
1229
|
+
e.ce === NOT_PENDING ||
|
|
1230
|
+
(stale && e.ne && activeTransition !== e.ne)
|
|
1231
|
+
? e.le
|
|
1232
|
+
: e.ce;
|
|
1233
1233
|
}
|
|
1234
1234
|
function setSignal(e, t) {
|
|
1235
|
-
if (e.
|
|
1235
|
+
if (e.ne && activeTransition !== e.ne) globalQueue.initTransition(e.ne);
|
|
1236
1236
|
const n = e.Oe && !projectionWriteActive;
|
|
1237
|
-
const i = n ? e.
|
|
1237
|
+
const i = n ? e.le : e.ce === NOT_PENDING ? e.le : e.ce;
|
|
1238
1238
|
if (typeof t === "function") t = t(i);
|
|
1239
1239
|
const r = !e._e || !e._e(i, t);
|
|
1240
1240
|
if (!r) {
|
|
1241
|
-
if (n && e.
|
|
1241
|
+
if (n && e.ce !== NOT_PENDING && e.L) {
|
|
1242
1242
|
insertSubs(e, true);
|
|
1243
1243
|
schedule();
|
|
1244
1244
|
}
|
|
1245
1245
|
return t;
|
|
1246
1246
|
}
|
|
1247
1247
|
if (n) {
|
|
1248
|
-
const n = globalQueue.
|
|
1249
|
-
if (e.
|
|
1250
|
-
globalQueue.initTransition(e.
|
|
1248
|
+
const n = globalQueue.H.includes(e);
|
|
1249
|
+
if (e.ne && n) {
|
|
1250
|
+
globalQueue.initTransition(e.ne);
|
|
1251
1251
|
}
|
|
1252
|
-
if (e.
|
|
1253
|
-
e.
|
|
1252
|
+
if (e.ce === NOT_PENDING) {
|
|
1253
|
+
e.ce = e.le;
|
|
1254
1254
|
}
|
|
1255
1255
|
if (!n) {
|
|
1256
|
-
globalQueue.
|
|
1256
|
+
globalQueue.H.push(e);
|
|
1257
1257
|
}
|
|
1258
1258
|
e.Re = (e.Re || 0) + 1;
|
|
1259
1259
|
const i = getOrCreateLane(e);
|
|
1260
|
-
e.
|
|
1261
|
-
e.ae = t;
|
|
1262
|
-
} else {
|
|
1263
|
-
if (e.le === NOT_PENDING) globalQueue.H.push(e);
|
|
1260
|
+
e.ie = i;
|
|
1264
1261
|
e.le = t;
|
|
1262
|
+
} else {
|
|
1263
|
+
if (e.ce === NOT_PENDING) globalQueue.$.push(e);
|
|
1264
|
+
e.ce = t;
|
|
1265
1265
|
}
|
|
1266
1266
|
updatePendingSignal(e);
|
|
1267
1267
|
if (e.Ie) {
|
|
1268
1268
|
setSignal(e.Ie, t);
|
|
1269
1269
|
}
|
|
1270
|
-
e.
|
|
1270
|
+
e.J = clock;
|
|
1271
1271
|
insertSubs(e, n);
|
|
1272
1272
|
schedule();
|
|
1273
1273
|
return t;
|
|
@@ -1296,32 +1296,32 @@ function getPendingSignal(e) {
|
|
|
1296
1296
|
}
|
|
1297
1297
|
function computePendingState(e) {
|
|
1298
1298
|
const t = e;
|
|
1299
|
-
if (e.Oe && e.
|
|
1300
|
-
if (t.
|
|
1299
|
+
if (e.Oe && e.ce !== NOT_PENDING) {
|
|
1300
|
+
if (t.ae & STATUS_PENDING && !(t.ae & STATUS_UNINITIALIZED)) return true;
|
|
1301
1301
|
if (e.Ee) {
|
|
1302
|
-
const t = e.
|
|
1303
|
-
return !!(t && t.
|
|
1302
|
+
const t = e.ie ? findLane(e.ie) : null;
|
|
1303
|
+
return !!(t && t.U.size > 0);
|
|
1304
1304
|
}
|
|
1305
1305
|
return true;
|
|
1306
1306
|
}
|
|
1307
|
-
if (e.
|
|
1308
|
-
return !!(t.
|
|
1307
|
+
if (e.ce !== NOT_PENDING && !(t.ae & STATUS_UNINITIALIZED)) return true;
|
|
1308
|
+
return !!(t.ae & STATUS_PENDING && !(t.ae & STATUS_UNINITIALIZED));
|
|
1309
1309
|
}
|
|
1310
1310
|
function updatePendingSignal(e) {
|
|
1311
1311
|
if (e.Qe) {
|
|
1312
1312
|
const t = computePendingState(e);
|
|
1313
1313
|
const n = e.Qe;
|
|
1314
1314
|
setSignal(n, t);
|
|
1315
|
-
if (!t && n.
|
|
1315
|
+
if (!t && n.ie) {
|
|
1316
1316
|
const t = resolveLane(e);
|
|
1317
|
-
if (t && t.
|
|
1318
|
-
const e = findLane(n.
|
|
1317
|
+
if (t && t.U.size > 0) {
|
|
1318
|
+
const e = findLane(n.ie);
|
|
1319
1319
|
if (e !== t) {
|
|
1320
1320
|
mergeLanes(t, e);
|
|
1321
1321
|
}
|
|
1322
1322
|
}
|
|
1323
1323
|
signalLanes.delete(n);
|
|
1324
|
-
n.
|
|
1324
|
+
n.ie = undefined;
|
|
1325
1325
|
}
|
|
1326
1326
|
}
|
|
1327
1327
|
}
|
|
@@ -1430,11 +1430,11 @@ function action(e) {
|
|
|
1430
1430
|
const r = e(...t);
|
|
1431
1431
|
globalQueue.initTransition();
|
|
1432
1432
|
let o = activeTransition;
|
|
1433
|
-
o.
|
|
1433
|
+
o.ee.push(r);
|
|
1434
1434
|
const done = (e, t) => {
|
|
1435
1435
|
o = currentTransition(o);
|
|
1436
|
-
const s = o.
|
|
1437
|
-
if (s >= 0) o.
|
|
1436
|
+
const s = o.ee.indexOf(r);
|
|
1437
|
+
if (s >= 0) o.ee.splice(s, 1);
|
|
1438
1438
|
setActiveTransition(o);
|
|
1439
1439
|
schedule();
|
|
1440
1440
|
t ? i(t) : n(e);
|
|
@@ -1533,7 +1533,8 @@ function onSettled(e) {
|
|
|
1533
1533
|
function unwrap(e) {
|
|
1534
1534
|
return e?.[$TARGET]?.[STORE_NODE] ?? e;
|
|
1535
1535
|
}
|
|
1536
|
-
function getOverrideValue(e, t, n, i) {
|
|
1536
|
+
function getOverrideValue(e, t, n, i, r) {
|
|
1537
|
+
if (r && i in r) return r[i];
|
|
1537
1538
|
return t && i in t ? t[i] : e[i];
|
|
1538
1539
|
}
|
|
1539
1540
|
function getAllKeys(e, t, n) {
|
|
@@ -1546,110 +1547,112 @@ function applyState(e, t, n, i) {
|
|
|
1546
1547
|
if (!r) return;
|
|
1547
1548
|
const o = r[STORE_VALUE];
|
|
1548
1549
|
const s = r[STORE_OVERRIDE];
|
|
1549
|
-
|
|
1550
|
-
|
|
1550
|
+
const u = r[STORE_OPTIMISTIC_OVERRIDE];
|
|
1551
|
+
let c = r[STORE_NODE];
|
|
1552
|
+
if (e === o && !s && !u) return;
|
|
1551
1553
|
(r[STORE_LOOKUP] || storeLookup).set(e, r[$PROXY]);
|
|
1552
1554
|
r[STORE_VALUE] = e;
|
|
1553
1555
|
r[STORE_OVERRIDE] = undefined;
|
|
1554
1556
|
if (Array.isArray(o)) {
|
|
1555
1557
|
let t = false;
|
|
1556
|
-
const
|
|
1557
|
-
if (e.length &&
|
|
1558
|
-
let
|
|
1558
|
+
const l = getOverrideValue(o, s, c, "length", u);
|
|
1559
|
+
if (e.length && l && e[0] && n(e[0]) != null) {
|
|
1560
|
+
let a, f, E, T, d, R, O, S;
|
|
1559
1561
|
for (
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1562
|
+
E = 0, T = Math.min(l, e.length);
|
|
1563
|
+
E < T &&
|
|
1564
|
+
((R = getOverrideValue(o, s, c, E, u)) === e[E] || (R && e[E] && n(R) === n(e[E])));
|
|
1565
|
+
E++
|
|
1563
1566
|
) {
|
|
1564
|
-
applyState(e[
|
|
1567
|
+
applyState(e[E], wrap(R, r), n, i);
|
|
1565
1568
|
}
|
|
1566
|
-
const
|
|
1567
|
-
|
|
1569
|
+
const _ = new Array(e.length),
|
|
1570
|
+
I = new Map();
|
|
1568
1571
|
for (
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
((
|
|
1573
|
-
|
|
1572
|
+
T = l - 1, d = e.length - 1;
|
|
1573
|
+
T >= E &&
|
|
1574
|
+
d >= E &&
|
|
1575
|
+
((R = getOverrideValue(o, s, c, T, u)) === e[d] || (R && e[d] && n(R) === n(e[d])));
|
|
1576
|
+
T--, d--
|
|
1574
1577
|
) {
|
|
1575
|
-
|
|
1578
|
+
_[d] = R;
|
|
1576
1579
|
}
|
|
1577
|
-
if (
|
|
1578
|
-
for (
|
|
1580
|
+
if (E > d || E > T) {
|
|
1581
|
+
for (f = E; f <= d; f++) {
|
|
1579
1582
|
t = true;
|
|
1580
|
-
r[STORE_NODE][
|
|
1583
|
+
r[STORE_NODE][f] && setSignal(r[STORE_NODE][f], wrap(e[f], r));
|
|
1581
1584
|
}
|
|
1582
|
-
for (;
|
|
1585
|
+
for (; f < e.length; f++) {
|
|
1583
1586
|
t = true;
|
|
1584
|
-
const o = wrap(
|
|
1585
|
-
r[STORE_NODE][
|
|
1586
|
-
applyState(e[
|
|
1587
|
+
const o = wrap(_[f], r);
|
|
1588
|
+
r[STORE_NODE][f] && setSignal(r[STORE_NODE][f], o);
|
|
1589
|
+
applyState(e[f], o, n, i);
|
|
1587
1590
|
}
|
|
1588
1591
|
t && r[STORE_NODE][$TRACK] && setSignal(r[STORE_NODE][$TRACK], void 0);
|
|
1589
|
-
|
|
1592
|
+
l !== e.length && r[STORE_NODE].length && setSignal(r[STORE_NODE].length, e.length);
|
|
1590
1593
|
return;
|
|
1591
1594
|
}
|
|
1592
|
-
|
|
1593
|
-
for (
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
}
|
|
1600
|
-
for (
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
if (
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1595
|
+
O = new Array(d + 1);
|
|
1596
|
+
for (f = d; f >= E; f--) {
|
|
1597
|
+
R = e[f];
|
|
1598
|
+
S = R ? n(R) : R;
|
|
1599
|
+
a = I.get(S);
|
|
1600
|
+
O[f] = a === undefined ? -1 : a;
|
|
1601
|
+
I.set(S, f);
|
|
1602
|
+
}
|
|
1603
|
+
for (a = E; a <= T; a++) {
|
|
1604
|
+
R = getOverrideValue(o, s, c, a, u);
|
|
1605
|
+
S = R ? n(R) : R;
|
|
1606
|
+
f = I.get(S);
|
|
1607
|
+
if (f !== undefined && f !== -1) {
|
|
1608
|
+
_[f] = R;
|
|
1609
|
+
f = O[f];
|
|
1610
|
+
I.set(S, f);
|
|
1608
1611
|
}
|
|
1609
1612
|
}
|
|
1610
|
-
for (
|
|
1611
|
-
if (
|
|
1612
|
-
const t = wrap(
|
|
1613
|
-
r[STORE_NODE][
|
|
1614
|
-
applyState(e[
|
|
1615
|
-
} else r[STORE_NODE][
|
|
1613
|
+
for (f = E; f < e.length; f++) {
|
|
1614
|
+
if (f in _) {
|
|
1615
|
+
const t = wrap(_[f], r);
|
|
1616
|
+
r[STORE_NODE][f] && setSignal(r[STORE_NODE][f], t);
|
|
1617
|
+
applyState(e[f], t, n, i);
|
|
1618
|
+
} else r[STORE_NODE][f] && setSignal(r[STORE_NODE][f], wrap(e[f], r));
|
|
1616
1619
|
}
|
|
1617
|
-
if (
|
|
1620
|
+
if (E < e.length) t = true;
|
|
1618
1621
|
} else if (e.length) {
|
|
1619
|
-
for (let t = 0,
|
|
1620
|
-
const
|
|
1621
|
-
isWrappable(
|
|
1622
|
-
? applyState(e[t], wrap(
|
|
1622
|
+
for (let t = 0, l = e.length; t < l; t++) {
|
|
1623
|
+
const l = getOverrideValue(o, s, c, t, u);
|
|
1624
|
+
isWrappable(l)
|
|
1625
|
+
? applyState(e[t], wrap(l, r), n, i)
|
|
1623
1626
|
: r[STORE_NODE][t] && setSignal(r[STORE_NODE][t], e[t]);
|
|
1624
1627
|
}
|
|
1625
1628
|
}
|
|
1626
|
-
if (
|
|
1629
|
+
if (l !== e.length) {
|
|
1627
1630
|
t = true;
|
|
1628
1631
|
r[STORE_NODE].length && setSignal(r[STORE_NODE].length, e.length);
|
|
1629
1632
|
}
|
|
1630
1633
|
t && r[STORE_NODE][$TRACK] && setSignal(r[STORE_NODE][$TRACK], void 0);
|
|
1631
1634
|
return;
|
|
1632
1635
|
}
|
|
1633
|
-
if (
|
|
1634
|
-
const t =
|
|
1635
|
-
const
|
|
1636
|
-
for (let
|
|
1637
|
-
const
|
|
1638
|
-
const
|
|
1639
|
-
const
|
|
1640
|
-
let
|
|
1641
|
-
if (
|
|
1642
|
-
if (!
|
|
1636
|
+
if (c) {
|
|
1637
|
+
const t = c[$TRACK];
|
|
1638
|
+
const l = t || i ? getAllKeys(o, s, e) : Object.keys(c);
|
|
1639
|
+
for (let a = 0, f = l.length; a < f; a++) {
|
|
1640
|
+
const f = l[a];
|
|
1641
|
+
const E = c[f];
|
|
1642
|
+
const T = unwrap(getOverrideValue(o, s, c, f, u));
|
|
1643
|
+
let d = unwrap(e[f]);
|
|
1644
|
+
if (T === d) continue;
|
|
1645
|
+
if (!T || !isWrappable(T) || !isWrappable(d) || (n(T) != null && n(T) !== n(d))) {
|
|
1643
1646
|
t && setSignal(t, void 0);
|
|
1644
|
-
|
|
1645
|
-
} else applyState(
|
|
1647
|
+
E && setSignal(E, isWrappable(d) ? wrap(d, r) : d);
|
|
1648
|
+
} else applyState(d, wrap(T, r), n, i);
|
|
1646
1649
|
}
|
|
1647
1650
|
}
|
|
1648
|
-
if ((
|
|
1649
|
-
const t = Object.keys(
|
|
1651
|
+
if ((c = r[STORE_HAS])) {
|
|
1652
|
+
const t = Object.keys(c);
|
|
1650
1653
|
for (let n = 0, i = t.length; n < i; n++) {
|
|
1651
1654
|
const i = t[n];
|
|
1652
|
-
setSignal(
|
|
1655
|
+
setSignal(c[i], i in e);
|
|
1653
1656
|
}
|
|
1654
1657
|
}
|
|
1655
1658
|
}
|
|
@@ -1847,7 +1850,7 @@ const storeTraps = {
|
|
|
1847
1850
|
if (e && e.get) return e.get.call(n);
|
|
1848
1851
|
}
|
|
1849
1852
|
if (writeOnly(n)) {
|
|
1850
|
-
let n = r && (s || !u) ? (r.
|
|
1853
|
+
let n = r && (s || !u) ? (r.ce !== NOT_PENDING ? (r.Oe ? r.le : r.ce) : r.le) : c[t];
|
|
1851
1854
|
n === $DELETED && (n = undefined);
|
|
1852
1855
|
if (!isWrappable(n)) return n;
|
|
1853
1856
|
const i = wrap(n, e);
|
|
@@ -1896,8 +1899,8 @@ const storeTraps = {
|
|
|
1896
1899
|
if (writeOnly(i)) {
|
|
1897
1900
|
if (e[STORE_OPTIMISTIC]) {
|
|
1898
1901
|
const t = e[STORE_FIREWALL];
|
|
1899
|
-
if (t?.
|
|
1900
|
-
globalQueue.initTransition(t.
|
|
1902
|
+
if (t?.ne) {
|
|
1903
|
+
globalQueue.initTransition(t.ne);
|
|
1901
1904
|
}
|
|
1902
1905
|
}
|
|
1903
1906
|
untrack(() => {
|
|
@@ -2086,7 +2089,7 @@ function deep(e) {
|
|
|
2086
2089
|
return e[$DEEP];
|
|
2087
2090
|
}
|
|
2088
2091
|
function createOptimisticStore(e, t, n) {
|
|
2089
|
-
GlobalQueue.
|
|
2092
|
+
GlobalQueue.B ||= clearOptimisticStore;
|
|
2090
2093
|
const i = typeof e === "function";
|
|
2091
2094
|
const r = (i ? t : e) ?? {};
|
|
2092
2095
|
const o = i ? e : undefined;
|
|
@@ -2103,7 +2106,7 @@ function clearOptimisticStore(e) {
|
|
|
2103
2106
|
if (i) {
|
|
2104
2107
|
for (const e of Reflect.ownKeys(n)) {
|
|
2105
2108
|
if (i[e]) {
|
|
2106
|
-
i[e].
|
|
2109
|
+
i[e].ie = undefined;
|
|
2107
2110
|
const n =
|
|
2108
2111
|
t[STORE_OVERRIDE] && e in t[STORE_OVERRIDE] ? t[STORE_OVERRIDE][e] : t[STORE_VALUE][e];
|
|
2109
2112
|
const r = n === $DELETED ? undefined : n;
|
|
@@ -2111,7 +2114,7 @@ function clearOptimisticStore(e) {
|
|
|
2111
2114
|
}
|
|
2112
2115
|
}
|
|
2113
2116
|
if (i[$TRACK]) {
|
|
2114
|
-
i[$TRACK].
|
|
2117
|
+
i[$TRACK].ie = undefined;
|
|
2115
2118
|
setSignal(i[$TRACK], undefined);
|
|
2116
2119
|
}
|
|
2117
2120
|
}
|
|
@@ -2347,9 +2350,9 @@ function mapArray(e, t, n) {
|
|
|
2347
2350
|
return createMemo(
|
|
2348
2351
|
updateKeyedMap.bind({
|
|
2349
2352
|
xe: createOwner(),
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
+
Me: 0,
|
|
2354
|
+
Fe: e,
|
|
2355
|
+
Ge: [],
|
|
2353
2356
|
$e: t,
|
|
2354
2357
|
He: [],
|
|
2355
2358
|
je: [],
|
|
@@ -2362,7 +2365,7 @@ function mapArray(e, t, n) {
|
|
|
2362
2365
|
}
|
|
2363
2366
|
const pureOptions = { pureWrite: true };
|
|
2364
2367
|
function updateKeyedMap() {
|
|
2365
|
-
const e = this.
|
|
2368
|
+
const e = this.Fe() || [],
|
|
2366
2369
|
t = e.length;
|
|
2367
2370
|
e[$TRACK];
|
|
2368
2371
|
runWithOwner(this.xe, () => {
|
|
@@ -2388,26 +2391,26 @@ function updateKeyedMap() {
|
|
|
2388
2391
|
return this.$e(() => t);
|
|
2389
2392
|
};
|
|
2390
2393
|
if (t === 0) {
|
|
2391
|
-
if (this.
|
|
2394
|
+
if (this.Me !== 0) {
|
|
2392
2395
|
this.xe.dispose(false);
|
|
2393
2396
|
this.je = [];
|
|
2394
|
-
this.
|
|
2397
|
+
this.Ge = [];
|
|
2395
2398
|
this.He = [];
|
|
2396
|
-
this.
|
|
2399
|
+
this.Me = 0;
|
|
2397
2400
|
this.Ye && (this.Ye = []);
|
|
2398
2401
|
this.Be && (this.Be = []);
|
|
2399
2402
|
}
|
|
2400
2403
|
if (this.Xe && !this.He[0]) {
|
|
2401
2404
|
this.He[0] = runWithOwner((this.je[0] = createOwner()), this.Xe);
|
|
2402
2405
|
}
|
|
2403
|
-
} else if (this.
|
|
2406
|
+
} else if (this.Me === 0) {
|
|
2404
2407
|
if (this.je[0]) this.je[0].dispose();
|
|
2405
2408
|
this.He = new Array(t);
|
|
2406
2409
|
for (i = 0; i < t; i++) {
|
|
2407
|
-
this.
|
|
2410
|
+
this.Ge[i] = e[i];
|
|
2408
2411
|
this.He[i] = runWithOwner((this.je[i] = createOwner()), r);
|
|
2409
2412
|
}
|
|
2410
|
-
this.
|
|
2413
|
+
this.Me = t;
|
|
2411
2414
|
} else {
|
|
2412
2415
|
let o,
|
|
2413
2416
|
s,
|
|
@@ -2421,17 +2424,17 @@ function updateKeyedMap() {
|
|
|
2421
2424
|
d = this.Ye ? new Array(t) : undefined,
|
|
2422
2425
|
R = this.Be ? new Array(t) : undefined;
|
|
2423
2426
|
for (
|
|
2424
|
-
o = 0, s = Math.min(this.
|
|
2425
|
-
o < s && (this.
|
|
2427
|
+
o = 0, s = Math.min(this.Me, t);
|
|
2428
|
+
o < s && (this.Ge[o] === e[o] || (this.Ye && compare(this.Ke, this.Ge[o], e[o])));
|
|
2426
2429
|
o++
|
|
2427
2430
|
) {
|
|
2428
2431
|
if (this.Ye) setSignal(this.Ye[o], e[o]);
|
|
2429
2432
|
}
|
|
2430
2433
|
for (
|
|
2431
|
-
s = this.
|
|
2434
|
+
s = this.Me - 1, u = t - 1;
|
|
2432
2435
|
s >= o &&
|
|
2433
2436
|
u >= o &&
|
|
2434
|
-
(this.
|
|
2437
|
+
(this.Ge[s] === e[u] || (this.Ye && compare(this.Ke, this.Ge[s], e[u])));
|
|
2435
2438
|
s--, u--
|
|
2436
2439
|
) {
|
|
2437
2440
|
E[u] = this.He[s];
|
|
@@ -2449,7 +2452,7 @@ function updateKeyedMap() {
|
|
|
2449
2452
|
a.set(l, i);
|
|
2450
2453
|
}
|
|
2451
2454
|
for (n = o; n <= s; n++) {
|
|
2452
|
-
c = this.
|
|
2455
|
+
c = this.Ge[n];
|
|
2453
2456
|
l = this.Ke ? this.Ke(c) : c;
|
|
2454
2457
|
i = a.get(l);
|
|
2455
2458
|
if (i !== undefined && i !== -1) {
|
|
@@ -2477,8 +2480,8 @@ function updateKeyedMap() {
|
|
|
2477
2480
|
this.He[i] = runWithOwner((this.je[i] = createOwner()), r);
|
|
2478
2481
|
}
|
|
2479
2482
|
}
|
|
2480
|
-
this.He = this.He.slice(0, (this.
|
|
2481
|
-
this.
|
|
2483
|
+
this.He = this.He.slice(0, (this.Me = t));
|
|
2484
|
+
this.Ge = e.slice(0);
|
|
2482
2485
|
}
|
|
2483
2486
|
});
|
|
2484
2487
|
return this.He;
|
|
@@ -2486,7 +2489,7 @@ function updateKeyedMap() {
|
|
|
2486
2489
|
function repeat(e, t, n) {
|
|
2487
2490
|
return updateRepeat.bind({
|
|
2488
2491
|
xe: createOwner(),
|
|
2489
|
-
|
|
2492
|
+
Me: 0,
|
|
2490
2493
|
qe: 0,
|
|
2491
2494
|
ze: e,
|
|
2492
2495
|
$e: t,
|
|
@@ -2501,11 +2504,11 @@ function updateRepeat() {
|
|
|
2501
2504
|
const t = this.Ze?.() || 0;
|
|
2502
2505
|
runWithOwner(this.xe, () => {
|
|
2503
2506
|
if (e === 0) {
|
|
2504
|
-
if (this.
|
|
2507
|
+
if (this.Me !== 0) {
|
|
2505
2508
|
this.xe.dispose(false);
|
|
2506
2509
|
this.je = [];
|
|
2507
2510
|
this.He = [];
|
|
2508
|
-
this.
|
|
2511
|
+
this.Me = 0;
|
|
2509
2512
|
}
|
|
2510
2513
|
if (this.Xe && !this.He[0]) {
|
|
2511
2514
|
this.He[0] = runWithOwner((this.je[0] = createOwner()), this.Xe);
|
|
@@ -2513,12 +2516,12 @@ function updateRepeat() {
|
|
|
2513
2516
|
return;
|
|
2514
2517
|
}
|
|
2515
2518
|
const n = t + e;
|
|
2516
|
-
const i = this.qe + this.
|
|
2517
|
-
if (this.
|
|
2519
|
+
const i = this.qe + this.Me;
|
|
2520
|
+
if (this.Me === 0 && this.je[0]) this.je[0].dispose();
|
|
2518
2521
|
for (let e = n; e < i; e++) this.je[e - this.qe].dispose();
|
|
2519
2522
|
if (this.qe < t) {
|
|
2520
2523
|
let e = this.qe;
|
|
2521
|
-
while (e < t && e < this.
|
|
2524
|
+
while (e < t && e < this.Me) this.je[e++].dispose();
|
|
2522
2525
|
this.je.splice(0, t - this.qe);
|
|
2523
2526
|
this.He.splice(0, t - this.qe);
|
|
2524
2527
|
} else if (this.qe > t) {
|
|
@@ -2539,7 +2542,7 @@ function updateRepeat() {
|
|
|
2539
2542
|
}
|
|
2540
2543
|
this.He = this.He.slice(0, e);
|
|
2541
2544
|
this.qe = t;
|
|
2542
|
-
this.
|
|
2545
|
+
this.Me = e;
|
|
2543
2546
|
});
|
|
2544
2547
|
return this.He;
|
|
2545
2548
|
}
|
|
@@ -2549,10 +2552,10 @@ function compare(e, t, n) {
|
|
|
2549
2552
|
function boundaryComputed(e, t) {
|
|
2550
2553
|
const n = computed(e, undefined, { lazy: true });
|
|
2551
2554
|
n.pe = (e, t) => {
|
|
2552
|
-
const i = e !== undefined ? e : n.
|
|
2553
|
-
const r = t !== undefined ? t : n.
|
|
2554
|
-
n.
|
|
2555
|
-
n.
|
|
2555
|
+
const i = e !== undefined ? e : n.ae;
|
|
2556
|
+
const r = t !== undefined ? t : n.q;
|
|
2557
|
+
n.ae &= ~n.Je;
|
|
2558
|
+
n.se.notify(n, n.Je, i, r);
|
|
2556
2559
|
};
|
|
2557
2560
|
n.Je = t;
|
|
2558
2561
|
n.Ue = true;
|
|
@@ -2560,9 +2563,9 @@ function boundaryComputed(e, t) {
|
|
|
2560
2563
|
return n;
|
|
2561
2564
|
}
|
|
2562
2565
|
function createBoundChildren(e, t, n, i) {
|
|
2563
|
-
const r = e.
|
|
2564
|
-
r.addChild((e.
|
|
2565
|
-
onCleanup(() => r.removeChild(e.
|
|
2566
|
+
const r = e.se;
|
|
2567
|
+
r.addChild((e.se = n));
|
|
2568
|
+
onCleanup(() => r.removeChild(e.se));
|
|
2566
2569
|
return runWithOwner(e, () => {
|
|
2567
2570
|
const e = computed(t);
|
|
2568
2571
|
return boundaryComputed(() => staleValues(() => flatten(read(e))), i);
|
|
@@ -2584,7 +2587,7 @@ class CollectionQueue extends Queue {
|
|
|
2584
2587
|
notify(e, t, n, i) {
|
|
2585
2588
|
if (!(t & this.et) || (this.et & STATUS_PENDING && this.it)) return super.notify(e, t, n, i);
|
|
2586
2589
|
if (n & this.et) {
|
|
2587
|
-
const t = i?.
|
|
2590
|
+
const t = i?.source || e.q?.source;
|
|
2588
2591
|
if (t) {
|
|
2589
2592
|
const e = this.tt.size === 0;
|
|
2590
2593
|
this.tt.add(t);
|
|
@@ -2596,7 +2599,7 @@ class CollectionQueue extends Queue {
|
|
|
2596
2599
|
}
|
|
2597
2600
|
checkSources() {
|
|
2598
2601
|
for (const e of this.tt) {
|
|
2599
|
-
if (!(e.
|
|
2602
|
+
if (!(e.ae & this.et)) this.tt.delete(e);
|
|
2600
2603
|
}
|
|
2601
2604
|
if (!this.tt.size) setSignal(this.nt, false);
|
|
2602
2605
|
}
|
|
@@ -2623,7 +2626,7 @@ function createLoadBoundary(e, t) {
|
|
|
2623
2626
|
function createErrorBoundary(e, t) {
|
|
2624
2627
|
return createCollectionBoundary(STATUS_ERROR, e, e => {
|
|
2625
2628
|
let n = e.tt.values().next().value;
|
|
2626
|
-
const i = n.
|
|
2629
|
+
const i = n.q?.cause ?? n.q;
|
|
2627
2630
|
return t(i, () => {
|
|
2628
2631
|
for (const t of e.tt) recompute(t);
|
|
2629
2632
|
schedule();
|