@solidjs/signals 2.0.0-beta.12 → 2.0.0-beta.13
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/README.md +5 -4
- package/dist/dev.js +30 -8
- package/dist/node.cjs +264 -247
- package/dist/prod.js +217 -200
- package/dist/types/boundaries.d.ts +7 -5
- package/dist/types/core/core.d.ts +11 -3
- package/dist/types-cjs/boundaries.d.cts +7 -5
- package/dist/types-cjs/core/core.d.cts +11 -3
- package/package.json +1 -1
package/dist/prod.js
CHANGED
|
@@ -172,7 +172,7 @@ function getOrCreateLane(e) {
|
|
|
172
172
|
}
|
|
173
173
|
const n = e.U;
|
|
174
174
|
const i = n?.G ? findLane(n.G) : null;
|
|
175
|
-
t = {
|
|
175
|
+
t = { k: e, F: new Set(), W: [[], []], H: null, M: activeTransition, j: i };
|
|
176
176
|
signalLanes.set(e, t);
|
|
177
177
|
activeLanes.add(t);
|
|
178
178
|
e.$ = false;
|
|
@@ -187,7 +187,7 @@ function mergeLanes(e, t) {
|
|
|
187
187
|
t = findLane(t);
|
|
188
188
|
if (e === t) return e;
|
|
189
189
|
t.H = e;
|
|
190
|
-
for (const n of t.
|
|
190
|
+
for (const n of t.F) e.F.add(n);
|
|
191
191
|
e.W[0].push(...t.W[0]);
|
|
192
192
|
e.W[1].push(...t.W[1]);
|
|
193
193
|
return e;
|
|
@@ -269,7 +269,7 @@ function shouldReadStashedOptimisticValue(e) {
|
|
|
269
269
|
}
|
|
270
270
|
function runLaneEffects(e) {
|
|
271
271
|
for (const t of activeLanes) {
|
|
272
|
-
if (t.H || t.
|
|
272
|
+
if (t.H || t.F.size > 0) continue;
|
|
273
273
|
const n = t.W[e - 1];
|
|
274
274
|
if (n.length) {
|
|
275
275
|
t.W[e - 1] = [];
|
|
@@ -332,22 +332,22 @@ function cleanupCompletedLanes(e) {
|
|
|
332
332
|
if (t.W[0].length) runQueue(t.W[0], EFFECT_RENDER);
|
|
333
333
|
if (t.W[1].length) runQueue(t.W[1], EFFECT_USER);
|
|
334
334
|
}
|
|
335
|
-
if (t.
|
|
336
|
-
t.
|
|
335
|
+
if (t.k.G === t) t.k.G = undefined;
|
|
336
|
+
t.F.clear();
|
|
337
337
|
t.W[0].length = 0;
|
|
338
338
|
t.W[1].length = 0;
|
|
339
339
|
activeLanes.delete(t);
|
|
340
|
-
signalLanes.delete(t.
|
|
340
|
+
signalLanes.delete(t.k);
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
343
|
function schedule() {
|
|
344
344
|
if (scheduled) return;
|
|
345
345
|
scheduled = true;
|
|
346
|
-
if (!syncDepth && !globalQueue.
|
|
346
|
+
if (!syncDepth && !globalQueue.ce && !projectionWriteActive) queueMicrotask(flush);
|
|
347
347
|
}
|
|
348
348
|
class Queue {
|
|
349
349
|
i = null;
|
|
350
|
-
|
|
350
|
+
le = [[], []];
|
|
351
351
|
Y = [];
|
|
352
352
|
created = clock;
|
|
353
353
|
addChild(e) {
|
|
@@ -366,9 +366,9 @@ class Queue {
|
|
|
366
366
|
return false;
|
|
367
367
|
}
|
|
368
368
|
run(e) {
|
|
369
|
-
if (this.
|
|
370
|
-
const t = this.
|
|
371
|
-
this.
|
|
369
|
+
if (this.le[e - 1].length) {
|
|
370
|
+
const t = this.le[e - 1];
|
|
371
|
+
this.le[e - 1] = [];
|
|
372
372
|
runQueue(t, e);
|
|
373
373
|
}
|
|
374
374
|
for (let t = 0; t < this.Y.length; t++) this.Y[t].run?.(e);
|
|
@@ -379,28 +379,28 @@ class Queue {
|
|
|
379
379
|
const n = findLane(currentOptimisticLane);
|
|
380
380
|
n.W[e - 1].push(t);
|
|
381
381
|
} else {
|
|
382
|
-
this.
|
|
382
|
+
this.le[e - 1].push(t);
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
385
|
schedule();
|
|
386
386
|
}
|
|
387
387
|
stashQueues(e) {
|
|
388
|
-
e.
|
|
389
|
-
e.
|
|
390
|
-
this.
|
|
388
|
+
e.le[0].push(...this.le[0]);
|
|
389
|
+
e.le[1].push(...this.le[1]);
|
|
390
|
+
this.le = [[], []];
|
|
391
391
|
for (let t = 0; t < this.Y.length; t++) {
|
|
392
392
|
let n = this.Y[t];
|
|
393
393
|
let i = e.Y[t];
|
|
394
394
|
if (!i) {
|
|
395
|
-
i = {
|
|
395
|
+
i = { le: [[], []], Y: [] };
|
|
396
396
|
e.Y[t] = i;
|
|
397
397
|
}
|
|
398
398
|
n.stashQueues(i);
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
restoreQueues(e) {
|
|
402
|
-
this.
|
|
403
|
-
this.
|
|
402
|
+
this.le[0].push(...e.le[0]);
|
|
403
|
+
this.le[1].push(...e.le[1]);
|
|
404
404
|
for (let t = 0; t < e.Y.length; t++) {
|
|
405
405
|
const n = e.Y[t];
|
|
406
406
|
let i = this.Y[t];
|
|
@@ -409,7 +409,7 @@ class Queue {
|
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
411
|
class GlobalQueue extends Queue {
|
|
412
|
-
|
|
412
|
+
ce = false;
|
|
413
413
|
ae = null;
|
|
414
414
|
fe = [];
|
|
415
415
|
Z = [];
|
|
@@ -419,8 +419,8 @@ class GlobalQueue extends Queue {
|
|
|
419
419
|
static Te;
|
|
420
420
|
static de = null;
|
|
421
421
|
flush() {
|
|
422
|
-
if (this.
|
|
423
|
-
this.
|
|
422
|
+
if (this.ce) return;
|
|
423
|
+
this.ce = true;
|
|
424
424
|
try {
|
|
425
425
|
runHeap(dirtyQueue, GlobalQueue.Ee);
|
|
426
426
|
if (activeTransition) {
|
|
@@ -482,7 +482,7 @@ class GlobalQueue extends Queue {
|
|
|
482
482
|
this.run(EFFECT_USER);
|
|
483
483
|
if (false);
|
|
484
484
|
} finally {
|
|
485
|
-
this.
|
|
485
|
+
this.ce = false;
|
|
486
486
|
}
|
|
487
487
|
}
|
|
488
488
|
notify(e, t, n, i) {
|
|
@@ -514,7 +514,7 @@ class GlobalQueue extends Queue {
|
|
|
514
514
|
Z: [],
|
|
515
515
|
q: new Set(),
|
|
516
516
|
re: [],
|
|
517
|
-
Oe: {
|
|
517
|
+
Oe: { le: [[], []], Y: [] },
|
|
518
518
|
ie: false,
|
|
519
519
|
oe: new Set()
|
|
520
520
|
};
|
|
@@ -691,7 +691,7 @@ function flush(e) {
|
|
|
691
691
|
syncDepth--;
|
|
692
692
|
}
|
|
693
693
|
}
|
|
694
|
-
if (globalQueue.
|
|
694
|
+
if (globalQueue.ce) {
|
|
695
695
|
return;
|
|
696
696
|
}
|
|
697
697
|
while (scheduled || activeTransition) {
|
|
@@ -816,17 +816,17 @@ function disposeChildren(e, t = false, n) {
|
|
|
816
816
|
e.me = 0;
|
|
817
817
|
}
|
|
818
818
|
if (t && !n && !(i & REACTIVE_ZOMBIE) && e.i !== null && !(e.i._ & REACTIVE_DISPOSED)) {
|
|
819
|
-
const t = e.
|
|
819
|
+
const t = e.we;
|
|
820
820
|
const n = e.De;
|
|
821
821
|
if (t !== null) t.De = n;
|
|
822
822
|
else e.i.ge = n;
|
|
823
|
-
if (n !== null) n.
|
|
824
|
-
e.
|
|
823
|
+
if (n !== null) n.we = t;
|
|
824
|
+
e.we = null;
|
|
825
825
|
}
|
|
826
826
|
runDisposal(e, n);
|
|
827
827
|
}
|
|
828
828
|
function runDisposal(e, t) {
|
|
829
|
-
let n = t ? e.Ae : e.
|
|
829
|
+
let n = t ? e.Ae : e.be;
|
|
830
830
|
if (!n) return;
|
|
831
831
|
if (Array.isArray(n)) {
|
|
832
832
|
for (let e = 0; e < n.length; e++) {
|
|
@@ -836,7 +836,7 @@ function runDisposal(e, t) {
|
|
|
836
836
|
} else {
|
|
837
837
|
n.call(n);
|
|
838
838
|
}
|
|
839
|
-
t ? (e.Ae = null) : (e.
|
|
839
|
+
t ? (e.Ae = null) : (e.be = null);
|
|
840
840
|
}
|
|
841
841
|
function childId(e, t) {
|
|
842
842
|
let n = e;
|
|
@@ -864,9 +864,9 @@ function getOwner() {
|
|
|
864
864
|
}
|
|
865
865
|
function cleanup(e) {
|
|
866
866
|
if (!context) return e;
|
|
867
|
-
if (!context.
|
|
868
|
-
else if (Array.isArray(context.
|
|
869
|
-
else context.
|
|
867
|
+
if (!context.be) context.be = e;
|
|
868
|
+
else if (Array.isArray(context.be)) context.be.push(e);
|
|
869
|
+
else context.be = [context.be, e];
|
|
870
870
|
return e;
|
|
871
871
|
}
|
|
872
872
|
function isDisposed(e) {
|
|
@@ -885,8 +885,8 @@ function createOwner(e) {
|
|
|
885
885
|
u: t?.t ? t.u : t,
|
|
886
886
|
ge: null,
|
|
887
887
|
De: null,
|
|
888
|
-
be: null,
|
|
889
888
|
we: null,
|
|
889
|
+
be: null,
|
|
890
890
|
te: t?.te ?? globalQueue,
|
|
891
891
|
Ve: t?.Ve || defaultContext,
|
|
892
892
|
me: 0,
|
|
@@ -901,7 +901,7 @@ function createOwner(e) {
|
|
|
901
901
|
t.ge = i;
|
|
902
902
|
} else {
|
|
903
903
|
i.De = e;
|
|
904
|
-
e.
|
|
904
|
+
e.we = i;
|
|
905
905
|
t.ge = i;
|
|
906
906
|
}
|
|
907
907
|
}
|
|
@@ -1101,7 +1101,7 @@ function handleAsync(e, t, n) {
|
|
|
1101
1101
|
trimStaleDeps(e);
|
|
1102
1102
|
clearStatus(e);
|
|
1103
1103
|
const o = resolveLane(e);
|
|
1104
|
-
if (o) o.
|
|
1104
|
+
if (o) o.F.delete(e);
|
|
1105
1105
|
if (n) n(i);
|
|
1106
1106
|
else if (e.K !== undefined) {
|
|
1107
1107
|
if (e.K !== undefined && e.K !== NOT_PENDING) e.B = i;
|
|
@@ -1113,12 +1113,12 @@ function handleAsync(e, t, n) {
|
|
|
1113
1113
|
} else if (o) {
|
|
1114
1114
|
const t = e.J;
|
|
1115
1115
|
const n = e.ue;
|
|
1116
|
-
const r = e.
|
|
1116
|
+
const r = e.ke;
|
|
1117
1117
|
if ((!t && s) || !r || !r(i, n)) {
|
|
1118
1118
|
e.ue = i;
|
|
1119
1119
|
e.Ie = clock;
|
|
1120
|
-
if (e.
|
|
1121
|
-
setSignal(e.
|
|
1120
|
+
if (e.Fe) {
|
|
1121
|
+
setSignal(e.Fe, i);
|
|
1122
1122
|
}
|
|
1123
1123
|
insertSubs(e, true);
|
|
1124
1124
|
}
|
|
@@ -1167,10 +1167,10 @@ function handleAsync(e, t, n) {
|
|
|
1167
1167
|
const iterate = () => {
|
|
1168
1168
|
let o,
|
|
1169
1169
|
u = false,
|
|
1170
|
-
|
|
1170
|
+
c = true;
|
|
1171
1171
|
n.next().then(
|
|
1172
1172
|
n => {
|
|
1173
|
-
if (
|
|
1173
|
+
if (c) {
|
|
1174
1174
|
o = n;
|
|
1175
1175
|
u = true;
|
|
1176
1176
|
if (n.done) r = true;
|
|
@@ -1184,13 +1184,13 @@ function handleAsync(e, t, n) {
|
|
|
1184
1184
|
}
|
|
1185
1185
|
},
|
|
1186
1186
|
n => {
|
|
1187
|
-
if (!
|
|
1187
|
+
if (!c && e.ve === t) {
|
|
1188
1188
|
r = true;
|
|
1189
1189
|
handleError(n);
|
|
1190
1190
|
}
|
|
1191
1191
|
}
|
|
1192
1192
|
);
|
|
1193
|
-
|
|
1193
|
+
c = false;
|
|
1194
1194
|
if (u && !o.done) {
|
|
1195
1195
|
s = o.value;
|
|
1196
1196
|
i = true;
|
|
@@ -1220,7 +1220,7 @@ function notifyStatus(e, t, n, i, r) {
|
|
|
1220
1220
|
const s = t === STATUS_PENDING && n instanceof NotReadyError ? n.source : undefined;
|
|
1221
1221
|
const o = s === e;
|
|
1222
1222
|
const u = t === STATUS_PENDING && e.K !== undefined && !o;
|
|
1223
|
-
const
|
|
1223
|
+
const c = u && hasActiveOverride(e);
|
|
1224
1224
|
if (!i) {
|
|
1225
1225
|
if (t === STATUS_PENDING && s) {
|
|
1226
1226
|
addPendingSource(e, s);
|
|
@@ -1236,13 +1236,13 @@ function notifyStatus(e, t, n, i, r) {
|
|
|
1236
1236
|
if (r && !i) {
|
|
1237
1237
|
assignOrMergeLane(e, r);
|
|
1238
1238
|
}
|
|
1239
|
-
const
|
|
1239
|
+
const l = i || c;
|
|
1240
1240
|
const a = i || u ? undefined : r;
|
|
1241
1241
|
if (e.xe) {
|
|
1242
1242
|
if (i && t === STATUS_PENDING) {
|
|
1243
1243
|
return;
|
|
1244
1244
|
}
|
|
1245
|
-
if (
|
|
1245
|
+
if (l) {
|
|
1246
1246
|
e.xe(t, n);
|
|
1247
1247
|
} else {
|
|
1248
1248
|
e.xe();
|
|
@@ -1255,8 +1255,8 @@ function notifyStatus(e, t, n, i, r) {
|
|
|
1255
1255
|
(t === STATUS_PENDING && s && e.Ce !== s && !e.Pe?.has(s)) ||
|
|
1256
1256
|
(t !== STATUS_PENDING && (e.Re !== n || e.Ce || e.Pe))
|
|
1257
1257
|
) {
|
|
1258
|
-
if (!
|
|
1259
|
-
notifyStatus(e, t, n,
|
|
1258
|
+
if (!l && !e.M) queuePendingNode(e);
|
|
1259
|
+
notifyStatus(e, t, n, l, a);
|
|
1260
1260
|
}
|
|
1261
1261
|
});
|
|
1262
1262
|
}
|
|
@@ -1293,6 +1293,7 @@ let foundPending = false;
|
|
|
1293
1293
|
let latestReadActive = false;
|
|
1294
1294
|
let context = null;
|
|
1295
1295
|
let currentOptimisticLane = null;
|
|
1296
|
+
let pendingCheckLoadingPath = false;
|
|
1296
1297
|
let snapshotCaptureActive = false;
|
|
1297
1298
|
let snapshotSources = null;
|
|
1298
1299
|
function ownerInSnapshotScope(e) {
|
|
@@ -1353,11 +1354,11 @@ function recompute(e, t = false) {
|
|
|
1353
1354
|
deleteFromHeap(e, e._ & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
|
|
1354
1355
|
e.ve = null;
|
|
1355
1356
|
if (e.M || n === EFFECT_TRACKED) disposeChildren(e);
|
|
1356
|
-
else if (e.ge !== null || e.
|
|
1357
|
+
else if (e.ge !== null || e.be !== null) {
|
|
1357
1358
|
markDisposal(e);
|
|
1358
|
-
e.Ae = e.
|
|
1359
|
+
e.Ae = e.be;
|
|
1359
1360
|
e.Ne = e.ge;
|
|
1360
|
-
e.
|
|
1361
|
+
e.be = null;
|
|
1361
1362
|
e.ge = null;
|
|
1362
1363
|
e.me = 0;
|
|
1363
1364
|
} else;
|
|
@@ -1371,8 +1372,8 @@ function recompute(e, t = false) {
|
|
|
1371
1372
|
e.ye = null;
|
|
1372
1373
|
e._ = REACTIVE_RECOMPUTING_DEPS;
|
|
1373
1374
|
e.Ie = clock;
|
|
1374
|
-
let
|
|
1375
|
-
let
|
|
1375
|
+
let c = e.B === NOT_PENDING ? e.ue : e.B;
|
|
1376
|
+
let l = e.o;
|
|
1376
1377
|
let a = tracking;
|
|
1377
1378
|
let f = currentOptimisticLane;
|
|
1378
1379
|
tracking = true;
|
|
@@ -1399,31 +1400,31 @@ function recompute(e, t = false) {
|
|
|
1399
1400
|
if (E) stale = true;
|
|
1400
1401
|
try {
|
|
1401
1402
|
if (!false && e._e & CONFIG_SYNC) {
|
|
1402
|
-
|
|
1403
|
+
c = e.L(c);
|
|
1403
1404
|
e.ve = null;
|
|
1404
1405
|
} else {
|
|
1405
1406
|
const t = e.ve;
|
|
1406
|
-
const n = e.L(
|
|
1407
|
+
const n = e.L(c);
|
|
1407
1408
|
const i = typeof n === "object" && n !== null;
|
|
1408
1409
|
const r = e.ve !== t;
|
|
1409
|
-
|
|
1410
|
+
c = r || !i ? n : handleAsync(e, n);
|
|
1410
1411
|
if (!r && !i) e.ve = null;
|
|
1411
1412
|
}
|
|
1412
1413
|
clearStatus(e, t);
|
|
1413
1414
|
if (e.G) {
|
|
1414
1415
|
const t = resolveLane(e);
|
|
1415
1416
|
if (t) {
|
|
1416
|
-
t.
|
|
1417
|
-
updatePendingSignal(t.
|
|
1417
|
+
t.F.delete(e);
|
|
1418
|
+
updatePendingSignal(t.k);
|
|
1418
1419
|
}
|
|
1419
1420
|
}
|
|
1420
1421
|
} catch (t) {
|
|
1421
1422
|
if (t instanceof NotReadyError && currentOptimisticLane) {
|
|
1422
1423
|
const t = findLane(currentOptimisticLane);
|
|
1423
|
-
if (t.
|
|
1424
|
-
t.
|
|
1424
|
+
if (t.k !== e) {
|
|
1425
|
+
t.F.add(e);
|
|
1425
1426
|
e.G = t;
|
|
1426
|
-
updatePendingSignal(t.
|
|
1427
|
+
updatePendingSignal(t.k);
|
|
1427
1428
|
}
|
|
1428
1429
|
}
|
|
1429
1430
|
if (t instanceof NotReadyError) e.Ge = true;
|
|
@@ -1443,7 +1444,7 @@ function recompute(e, t = false) {
|
|
|
1443
1444
|
if (!e.Re) {
|
|
1444
1445
|
trimStaleDeps(e);
|
|
1445
1446
|
const u = r ? e.K : e.B === NOT_PENDING ? e.ue : e.B;
|
|
1446
|
-
const a = (!n && o) || !e.
|
|
1447
|
+
const a = (!n && o) || !e.ke || !e.ke(u, c);
|
|
1447
1448
|
if (n && a) {
|
|
1448
1449
|
e.ee = !e.Re;
|
|
1449
1450
|
if (!t) e.te.enqueue(n, GlobalQueue.Te.bind(null, e));
|
|
@@ -1451,17 +1452,17 @@ function recompute(e, t = false) {
|
|
|
1451
1452
|
if (a) {
|
|
1452
1453
|
const o = r ? e.K : undefined;
|
|
1453
1454
|
if (t || (n && activeTransition !== e.M) || i) {
|
|
1454
|
-
e.ue =
|
|
1455
|
+
e.ue = c;
|
|
1455
1456
|
if (r && i) {
|
|
1456
|
-
e.K =
|
|
1457
|
-
e.B =
|
|
1457
|
+
e.K = c;
|
|
1458
|
+
e.B = c;
|
|
1458
1459
|
}
|
|
1459
|
-
} else e.B =
|
|
1460
|
-
if (r && !i && s && !e.$) e.K =
|
|
1460
|
+
} else e.B = c;
|
|
1461
|
+
if (r && !i && s && !e.$) e.K = c;
|
|
1461
1462
|
if (!r || i || e.K !== o) insertSubs(e, i || r);
|
|
1462
1463
|
} else if (r) {
|
|
1463
|
-
e.B =
|
|
1464
|
-
} else if (e.o !=
|
|
1464
|
+
e.B = c;
|
|
1465
|
+
} else if (e.o != l) {
|
|
1465
1466
|
for (let t = e.I; t !== null; t = t.p) {
|
|
1466
1467
|
insertIntoHeapHeight(t.h, t.h._ & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
|
|
1467
1468
|
}
|
|
@@ -1504,9 +1505,9 @@ function computed(e, t) {
|
|
|
1504
1505
|
(!context || t?.lazy ? CONFIG_AUTO_DISPOSE : 0) |
|
|
1505
1506
|
(t?.sync ? CONFIG_SYNC : 0) |
|
|
1506
1507
|
(snapshotCaptureActive && ownerInSnapshotScope(context) ? CONFIG_IN_SNAPSHOT_SCOPE : 0),
|
|
1507
|
-
|
|
1508
|
+
ke: t?.equals != null ? t.equals : isEqual,
|
|
1508
1509
|
X: t?.unobserved,
|
|
1509
|
-
|
|
1510
|
+
be: null,
|
|
1510
1511
|
te: context?.te ?? globalQueue,
|
|
1511
1512
|
Ve: context?.Ve ?? defaultContext,
|
|
1512
1513
|
me: 0,
|
|
@@ -1522,7 +1523,7 @@ function computed(e, t) {
|
|
|
1522
1523
|
Ue: null,
|
|
1523
1524
|
i: context,
|
|
1524
1525
|
De: null,
|
|
1525
|
-
|
|
1526
|
+
we: null,
|
|
1526
1527
|
ge: null,
|
|
1527
1528
|
_: t?.lazy ? REACTIVE_LAZY : REACTIVE_NONE,
|
|
1528
1529
|
he: STATUS_UNINITIALIZED,
|
|
@@ -1545,9 +1546,9 @@ function createEffectNode(e, t, n, i, r, s) {
|
|
|
1545
1546
|
(s?.ownedWrite ? CONFIG_OWNED_WRITE : 0) |
|
|
1546
1547
|
(s?.sync ? CONFIG_SYNC : 0) |
|
|
1547
1548
|
(snapshotCaptureActive && ownerInSnapshotScope(context) ? CONFIG_IN_SNAPSHOT_SCOPE : 0),
|
|
1548
|
-
|
|
1549
|
+
ke: false,
|
|
1549
1550
|
X: s?.unobserved,
|
|
1550
|
-
|
|
1551
|
+
be: null,
|
|
1551
1552
|
te: context?.te ?? globalQueue,
|
|
1552
1553
|
Ve: context?.Ve ?? defaultContext,
|
|
1553
1554
|
me: 0,
|
|
@@ -1563,7 +1564,7 @@ function createEffectNode(e, t, n, i, r, s) {
|
|
|
1563
1564
|
Ue: null,
|
|
1564
1565
|
i: context,
|
|
1565
1566
|
De: null,
|
|
1566
|
-
|
|
1567
|
+
we: null,
|
|
1567
1568
|
ge: null,
|
|
1568
1569
|
_: REACTIVE_LAZY,
|
|
1569
1570
|
he: STATUS_UNINITIALIZED,
|
|
@@ -1595,7 +1596,7 @@ function setupComputedNode(e, t) {
|
|
|
1595
1596
|
context.ge = e;
|
|
1596
1597
|
} else {
|
|
1597
1598
|
e.De = t;
|
|
1598
|
-
t.
|
|
1599
|
+
t.we = e;
|
|
1599
1600
|
context.ge = e;
|
|
1600
1601
|
}
|
|
1601
1602
|
}
|
|
@@ -1621,7 +1622,7 @@ function setupComputedNode(e, t) {
|
|
|
1621
1622
|
}
|
|
1622
1623
|
function signal(e, t, n = null) {
|
|
1623
1624
|
const i = {
|
|
1624
|
-
|
|
1625
|
+
ke: t?.equals != null ? t.equals : isEqual,
|
|
1625
1626
|
_e: (t?.ownedWrite ? CONFIG_OWNED_WRITE : 0) | (t?.Ye ? CONFIG_NO_SNAPSHOT : 0),
|
|
1626
1627
|
X: t?.unobserved,
|
|
1627
1628
|
ue: e,
|
|
@@ -1682,7 +1683,7 @@ function read(e) {
|
|
|
1682
1683
|
if (stale && currentOptimisticLane && t.G) {
|
|
1683
1684
|
const e = findLane(t.G);
|
|
1684
1685
|
const n = findLane(currentOptimisticLane);
|
|
1685
|
-
if (e !== n && e.
|
|
1686
|
+
if (e !== n && e.F.size > 0) {
|
|
1686
1687
|
return i;
|
|
1687
1688
|
}
|
|
1688
1689
|
}
|
|
@@ -1692,6 +1693,14 @@ function read(e) {
|
|
|
1692
1693
|
const t = e.V;
|
|
1693
1694
|
const n = pendingCheckActive;
|
|
1694
1695
|
pendingCheckActive = false;
|
|
1696
|
+
const i = t || e;
|
|
1697
|
+
if (pendingCheckLoadingPath && i.he & STATUS_PENDING && i.he & STATUS_UNINITIALIZED) {
|
|
1698
|
+
let t = context;
|
|
1699
|
+
if (t?.t) t = t.u;
|
|
1700
|
+
if (t && tracking) link(e, t);
|
|
1701
|
+
pendingCheckActive = n;
|
|
1702
|
+
throw i.Re;
|
|
1703
|
+
}
|
|
1695
1704
|
if (t && e.K !== undefined) {
|
|
1696
1705
|
if (e.K !== NOT_PENDING && (t.ve || !!(t.he & STATUS_PENDING))) {
|
|
1697
1706
|
foundPending = true;
|
|
@@ -1826,7 +1835,7 @@ function setSignal(e, t) {
|
|
|
1826
1835
|
const i = e.K !== undefined && e.K !== NOT_PENDING;
|
|
1827
1836
|
const r = n ? (i ? e.K : e.ue) : e.B === NOT_PENDING ? e.ue : e.B;
|
|
1828
1837
|
if (typeof t === "function") t = t(r);
|
|
1829
|
-
const s = !e.
|
|
1838
|
+
const s = !e.ke || !e.ke(r, t) || !!(e.he & STATUS_UNINITIALIZED);
|
|
1830
1839
|
if (!s) {
|
|
1831
1840
|
if (n && i && e.L) {
|
|
1832
1841
|
insertSubs(e, true);
|
|
@@ -1850,8 +1859,8 @@ function setSignal(e, t) {
|
|
|
1850
1859
|
e.B = t;
|
|
1851
1860
|
}
|
|
1852
1861
|
if (e.We) updatePendingSignal(e);
|
|
1853
|
-
if (e.
|
|
1854
|
-
setSignal(e.
|
|
1862
|
+
if (e.Fe) {
|
|
1863
|
+
setSignal(e.Fe, t);
|
|
1855
1864
|
}
|
|
1856
1865
|
e.Ie = clock;
|
|
1857
1866
|
insertSubs(e, n);
|
|
@@ -1900,7 +1909,7 @@ function computePendingState(e) {
|
|
|
1900
1909
|
if (t.he & STATUS_PENDING && !(t.he & STATUS_UNINITIALIZED)) return true;
|
|
1901
1910
|
if (e.U) {
|
|
1902
1911
|
const t = e.G ? findLane(e.G) : null;
|
|
1903
|
-
return !!(t && t.
|
|
1912
|
+
return !!(t && t.F.size > 0);
|
|
1904
1913
|
}
|
|
1905
1914
|
return true;
|
|
1906
1915
|
}
|
|
@@ -1917,7 +1926,7 @@ function updatePendingSignal(e) {
|
|
|
1917
1926
|
setSignal(n, t);
|
|
1918
1927
|
if (!t && n.G) {
|
|
1919
1928
|
const t = resolveLane(e);
|
|
1920
|
-
if (t && t.
|
|
1929
|
+
if (t && t.F.size > 0) {
|
|
1921
1930
|
const e = findLane(n.G);
|
|
1922
1931
|
if (e !== t) {
|
|
1923
1932
|
mergeLanes(t, e);
|
|
@@ -1929,20 +1938,20 @@ function updatePendingSignal(e) {
|
|
|
1929
1938
|
}
|
|
1930
1939
|
}
|
|
1931
1940
|
function getLatestValueComputed(e) {
|
|
1932
|
-
if (!e.
|
|
1941
|
+
if (!e.Fe) {
|
|
1933
1942
|
const t = latestReadActive;
|
|
1934
1943
|
latestReadActive = false;
|
|
1935
1944
|
const n = pendingCheckActive;
|
|
1936
1945
|
pendingCheckActive = false;
|
|
1937
1946
|
const i = context;
|
|
1938
1947
|
context = null;
|
|
1939
|
-
e.
|
|
1940
|
-
e.
|
|
1948
|
+
e.Fe = optimisticComputed(() => read(e));
|
|
1949
|
+
e.Fe.U = e;
|
|
1941
1950
|
context = i;
|
|
1942
1951
|
pendingCheckActive = n;
|
|
1943
1952
|
latestReadActive = t;
|
|
1944
1953
|
}
|
|
1945
|
-
return e.
|
|
1954
|
+
return e.Fe;
|
|
1946
1955
|
}
|
|
1947
1956
|
function staleValues(e, t = true) {
|
|
1948
1957
|
const n = stale;
|
|
@@ -1962,19 +1971,24 @@ function latest(e) {
|
|
|
1962
1971
|
latestReadActive = t;
|
|
1963
1972
|
}
|
|
1964
1973
|
}
|
|
1965
|
-
function isPending(e) {
|
|
1966
|
-
const
|
|
1967
|
-
const
|
|
1974
|
+
function isPending(e, t) {
|
|
1975
|
+
const n = pendingCheckActive;
|
|
1976
|
+
const i = pendingCheckLoadingPath;
|
|
1977
|
+
const r = foundPending;
|
|
1978
|
+
const s = t === true;
|
|
1968
1979
|
pendingCheckActive = true;
|
|
1980
|
+
pendingCheckLoadingPath = s;
|
|
1969
1981
|
foundPending = false;
|
|
1970
1982
|
try {
|
|
1971
1983
|
e();
|
|
1972
1984
|
return foundPending;
|
|
1973
|
-
} catch {
|
|
1985
|
+
} catch (e) {
|
|
1986
|
+
if (s && e instanceof NotReadyError) throw e;
|
|
1974
1987
|
return foundPending;
|
|
1975
1988
|
} finally {
|
|
1976
|
-
pendingCheckActive =
|
|
1977
|
-
|
|
1989
|
+
pendingCheckActive = n;
|
|
1990
|
+
pendingCheckLoadingPath = i;
|
|
1991
|
+
foundPending = r;
|
|
1978
1992
|
}
|
|
1979
1993
|
}
|
|
1980
1994
|
function refresh(e) {
|
|
@@ -2266,25 +2280,25 @@ function applyStateFast(e, t, n) {
|
|
|
2266
2280
|
let r = false;
|
|
2267
2281
|
const s = i.length;
|
|
2268
2282
|
if (e.length && s && e[0] && n(e[0]) != null) {
|
|
2269
|
-
let o, u,
|
|
2283
|
+
let o, u, c, l, a, f, E, S;
|
|
2270
2284
|
for (
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2285
|
+
c = 0, l = Math.min(s, e.length);
|
|
2286
|
+
c < l && ((f = i[c]) === e[c] || (f && e[c] && n(f) === n(e[c])));
|
|
2287
|
+
c++
|
|
2274
2288
|
) {
|
|
2275
|
-
applyState(e[
|
|
2289
|
+
applyState(e[c], wrap(f, t), n);
|
|
2276
2290
|
}
|
|
2277
2291
|
const T = new Array(e.length),
|
|
2278
2292
|
d = new Map();
|
|
2279
2293
|
for (
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2294
|
+
l = s - 1, a = e.length - 1;
|
|
2295
|
+
l >= c && a >= c && ((f = i[l]) === e[a] || (f && e[a] && n(f) === n(e[a])));
|
|
2296
|
+
l--, a--
|
|
2283
2297
|
) {
|
|
2284
2298
|
T[a] = f;
|
|
2285
2299
|
}
|
|
2286
|
-
if (
|
|
2287
|
-
for (u =
|
|
2300
|
+
if (c > a || c > l) {
|
|
2301
|
+
for (u = c; u <= a; u++) {
|
|
2288
2302
|
r = true;
|
|
2289
2303
|
t[STORE_NODE][u] && setSignal(t[STORE_NODE][u], wrap(e[u], t));
|
|
2290
2304
|
}
|
|
@@ -2299,14 +2313,14 @@ function applyStateFast(e, t, n) {
|
|
|
2299
2313
|
return;
|
|
2300
2314
|
}
|
|
2301
2315
|
E = new Array(a + 1);
|
|
2302
|
-
for (u = a; u >=
|
|
2316
|
+
for (u = a; u >= c; u--) {
|
|
2303
2317
|
f = e[u];
|
|
2304
2318
|
S = f ? n(f) : f;
|
|
2305
2319
|
o = d.get(S);
|
|
2306
2320
|
E[u] = o === undefined ? -1 : o;
|
|
2307
2321
|
d.set(S, u);
|
|
2308
2322
|
}
|
|
2309
|
-
for (o =
|
|
2323
|
+
for (o = c; o <= l; o++) {
|
|
2310
2324
|
f = i[o];
|
|
2311
2325
|
S = f ? n(f) : f;
|
|
2312
2326
|
u = d.get(S);
|
|
@@ -2316,14 +2330,14 @@ function applyStateFast(e, t, n) {
|
|
|
2316
2330
|
d.set(S, u);
|
|
2317
2331
|
}
|
|
2318
2332
|
}
|
|
2319
|
-
for (u =
|
|
2333
|
+
for (u = c; u < e.length; u++) {
|
|
2320
2334
|
if (u in T) {
|
|
2321
2335
|
const i = wrap(T[u], t);
|
|
2322
2336
|
t[STORE_NODE][u] && setSignal(t[STORE_NODE][u], i);
|
|
2323
2337
|
applyState(e[u], i, n);
|
|
2324
2338
|
} else t[STORE_NODE][u] && setSignal(t[STORE_NODE][u], wrap(e[u], t));
|
|
2325
2339
|
}
|
|
2326
|
-
if (
|
|
2340
|
+
if (c < e.length) r = true;
|
|
2327
2341
|
} else if (e.length) {
|
|
2328
2342
|
for (let r = 0, s = e.length; r < s; r++) {
|
|
2329
2343
|
const s = i[r];
|
|
@@ -2343,15 +2357,15 @@ function applyStateFast(e, t, n) {
|
|
|
2343
2357
|
if (r) {
|
|
2344
2358
|
const s = r[$TRACK];
|
|
2345
2359
|
const o = s ? getAllKeys(i, undefined, e) : Object.keys(r);
|
|
2346
|
-
for (let u = 0,
|
|
2347
|
-
const
|
|
2348
|
-
const
|
|
2349
|
-
const a = unwrap(i[
|
|
2350
|
-
let f = unwrap(e[
|
|
2360
|
+
for (let u = 0, c = o.length; u < c; u++) {
|
|
2361
|
+
const c = o[u];
|
|
2362
|
+
const l = r[c];
|
|
2363
|
+
const a = unwrap(i[c]);
|
|
2364
|
+
let f = unwrap(e[c]);
|
|
2351
2365
|
if (a === f) continue;
|
|
2352
2366
|
if (!a || !isWrappable(a) || !isWrappable(f) || (n(a) != null && n(a) !== n(f))) {
|
|
2353
2367
|
s && setSignal(s, void 0);
|
|
2354
|
-
|
|
2368
|
+
l && setSignal(l, isWrappable(f) ? wrap(f, t) : f);
|
|
2355
2369
|
} else applyState(f, wrap(a, t), n);
|
|
2356
2370
|
}
|
|
2357
2371
|
}
|
|
@@ -2375,7 +2389,7 @@ function applyStateSlow(e, t, n) {
|
|
|
2375
2389
|
let o = false;
|
|
2376
2390
|
const u = getOverrideValue(i, r, "length", s);
|
|
2377
2391
|
if (e.length && u && e[0] && n(e[0]) != null) {
|
|
2378
|
-
let
|
|
2392
|
+
let c, l, a, f, E, S, T, d;
|
|
2379
2393
|
for (
|
|
2380
2394
|
a = 0, f = Math.min(u, e.length);
|
|
2381
2395
|
a < f && ((S = getOverrideValue(i, r, a, s)) === e[a] || (S && e[a] && n(S) === n(e[a])));
|
|
@@ -2395,44 +2409,44 @@ function applyStateSlow(e, t, n) {
|
|
|
2395
2409
|
O[E] = S;
|
|
2396
2410
|
}
|
|
2397
2411
|
if (a > E || a > f) {
|
|
2398
|
-
for (
|
|
2412
|
+
for (l = a; l <= E; l++) {
|
|
2399
2413
|
o = true;
|
|
2400
|
-
t[STORE_NODE][
|
|
2414
|
+
t[STORE_NODE][l] && setSignal(t[STORE_NODE][l], wrap(e[l], t));
|
|
2401
2415
|
}
|
|
2402
|
-
for (;
|
|
2416
|
+
for (; l < e.length; l++) {
|
|
2403
2417
|
o = true;
|
|
2404
|
-
const i = wrap(O[
|
|
2405
|
-
t[STORE_NODE][
|
|
2406
|
-
applyState(e[
|
|
2418
|
+
const i = wrap(O[l], t);
|
|
2419
|
+
t[STORE_NODE][l] && setSignal(t[STORE_NODE][l], i);
|
|
2420
|
+
applyState(e[l], i, n);
|
|
2407
2421
|
}
|
|
2408
2422
|
o && t[STORE_NODE][$TRACK] && setSignal(t[STORE_NODE][$TRACK], void 0);
|
|
2409
2423
|
u !== e.length && t[STORE_NODE].length && setSignal(t[STORE_NODE].length, e.length);
|
|
2410
2424
|
return;
|
|
2411
2425
|
}
|
|
2412
2426
|
T = new Array(E + 1);
|
|
2413
|
-
for (
|
|
2414
|
-
S = e[
|
|
2427
|
+
for (l = E; l >= a; l--) {
|
|
2428
|
+
S = e[l];
|
|
2415
2429
|
d = S ? n(S) : S;
|
|
2416
|
-
|
|
2417
|
-
T[
|
|
2418
|
-
_.set(d,
|
|
2430
|
+
c = _.get(d);
|
|
2431
|
+
T[l] = c === undefined ? -1 : c;
|
|
2432
|
+
_.set(d, l);
|
|
2419
2433
|
}
|
|
2420
|
-
for (
|
|
2421
|
-
S = getOverrideValue(i, r,
|
|
2434
|
+
for (c = a; c <= f; c++) {
|
|
2435
|
+
S = getOverrideValue(i, r, c, s);
|
|
2422
2436
|
d = S ? n(S) : S;
|
|
2423
|
-
|
|
2424
|
-
if (
|
|
2425
|
-
O[
|
|
2426
|
-
|
|
2427
|
-
_.set(d,
|
|
2437
|
+
l = _.get(d);
|
|
2438
|
+
if (l !== undefined && l !== -1) {
|
|
2439
|
+
O[l] = S;
|
|
2440
|
+
l = T[l];
|
|
2441
|
+
_.set(d, l);
|
|
2428
2442
|
}
|
|
2429
2443
|
}
|
|
2430
|
-
for (
|
|
2431
|
-
if (
|
|
2432
|
-
const i = wrap(O[
|
|
2433
|
-
t[STORE_NODE][
|
|
2434
|
-
applyState(e[
|
|
2435
|
-
} else t[STORE_NODE][
|
|
2444
|
+
for (l = a; l < e.length; l++) {
|
|
2445
|
+
if (l in O) {
|
|
2446
|
+
const i = wrap(O[l], t);
|
|
2447
|
+
t[STORE_NODE][l] && setSignal(t[STORE_NODE][l], i);
|
|
2448
|
+
applyState(e[l], i, n);
|
|
2449
|
+
} else t[STORE_NODE][l] && setSignal(t[STORE_NODE][l], wrap(e[l], t));
|
|
2436
2450
|
}
|
|
2437
2451
|
if (a < e.length) o = true;
|
|
2438
2452
|
} else if (e.length) {
|
|
@@ -2452,9 +2466,9 @@ function applyStateSlow(e, t, n) {
|
|
|
2452
2466
|
}
|
|
2453
2467
|
if (o) {
|
|
2454
2468
|
const u = o[$TRACK];
|
|
2455
|
-
const
|
|
2456
|
-
for (let
|
|
2457
|
-
const a = l
|
|
2469
|
+
const c = u ? getAllKeys(i, r, e) : Object.keys(o);
|
|
2470
|
+
for (let l = 0, a = c.length; l < a; l++) {
|
|
2471
|
+
const a = c[l];
|
|
2458
2472
|
const f = o[a];
|
|
2459
2473
|
const E = unwrap(getOverrideValue(i, r, a, s));
|
|
2460
2474
|
let S = unwrap(e[a]);
|
|
@@ -2736,35 +2750,35 @@ function upsertStoreNode(e, t, n, i, r) {
|
|
|
2736
2750
|
function notifyStoreProperty(e, t, n, i, r, s) {
|
|
2737
2751
|
const o = projectionWriteActive || e[STORE_OPTIMISTIC];
|
|
2738
2752
|
const u = n !== "delete";
|
|
2739
|
-
const
|
|
2740
|
-
if (
|
|
2741
|
-
setSignal(
|
|
2753
|
+
const c = e[STORE_HAS]?.[t];
|
|
2754
|
+
if (c) {
|
|
2755
|
+
setSignal(c, u);
|
|
2742
2756
|
} else if (!o && n !== "invalidate" && s !== u) {
|
|
2743
2757
|
const n = upsertStoreNode(e, getNodes(e, STORE_HAS), t, s);
|
|
2744
2758
|
setSignal(n, u);
|
|
2745
2759
|
}
|
|
2746
|
-
const
|
|
2760
|
+
const l = getNodes(e, STORE_NODE);
|
|
2747
2761
|
if (n === "set") {
|
|
2748
|
-
if (
|
|
2749
|
-
setSignal(
|
|
2762
|
+
if (l[t]) {
|
|
2763
|
+
setSignal(l[t], () => (isWrappable(i) ? wrap(i, e) : i));
|
|
2750
2764
|
} else if (!o) {
|
|
2751
|
-
const n = upsertStoreNode(e,
|
|
2765
|
+
const n = upsertStoreNode(e, l, t, r, e[STORE_SNAPSHOT_PROPS]);
|
|
2752
2766
|
setSignal(n, () => (isWrappable(i) ? wrap(i, e) : i));
|
|
2753
2767
|
}
|
|
2754
2768
|
} else if (n === "invalidate") {
|
|
2755
|
-
if (
|
|
2756
|
-
setSignal(
|
|
2757
|
-
delete
|
|
2769
|
+
if (l[t]) {
|
|
2770
|
+
setSignal(l[t], {});
|
|
2771
|
+
delete l[t];
|
|
2758
2772
|
}
|
|
2759
2773
|
} else {
|
|
2760
|
-
if (
|
|
2761
|
-
setSignal(
|
|
2774
|
+
if (l[t]) {
|
|
2775
|
+
setSignal(l[t], undefined);
|
|
2762
2776
|
} else if (!o) {
|
|
2763
|
-
const n = upsertStoreNode(e,
|
|
2777
|
+
const n = upsertStoreNode(e, l, t, r, e[STORE_SNAPSHOT_PROPS]);
|
|
2764
2778
|
setSignal(n, undefined);
|
|
2765
2779
|
}
|
|
2766
2780
|
}
|
|
2767
|
-
|
|
2781
|
+
l[$TRACK] && setSignal(l[$TRACK], undefined);
|
|
2768
2782
|
}
|
|
2769
2783
|
let Writing = null;
|
|
2770
2784
|
const storeTraps = {
|
|
@@ -2795,46 +2809,46 @@ const storeTraps = {
|
|
|
2795
2809
|
}
|
|
2796
2810
|
const o = e[STORE_OPTIMISTIC_OVERRIDE] && t in e[STORE_OPTIMISTIC_OVERRIDE];
|
|
2797
2811
|
const u = o || (e[STORE_OVERRIDE] && t in e[STORE_OVERRIDE]);
|
|
2798
|
-
const
|
|
2799
|
-
const
|
|
2812
|
+
const c = !!e[STORE_VALUE][$TARGET];
|
|
2813
|
+
const l = o
|
|
2800
2814
|
? e[STORE_OPTIMISTIC_OVERRIDE]
|
|
2801
2815
|
: e[STORE_OVERRIDE] && t in e[STORE_OVERRIDE]
|
|
2802
2816
|
? e[STORE_OVERRIDE]
|
|
2803
2817
|
: e[STORE_VALUE];
|
|
2804
2818
|
if (!r) {
|
|
2805
|
-
const i = Object.getOwnPropertyDescriptor(
|
|
2819
|
+
const i = Object.getOwnPropertyDescriptor(l, t);
|
|
2806
2820
|
if (i && i.get) return i.get.call(n);
|
|
2807
2821
|
if (!i && !u && e[STORE_CUSTOM_PROTO]) {
|
|
2808
|
-
const e = unwrapStoreValue(
|
|
2822
|
+
const e = unwrapStoreValue(l);
|
|
2809
2823
|
if (hasInheritedAccessor(e, t)) {
|
|
2810
|
-
return Reflect.get(
|
|
2824
|
+
return Reflect.get(l, t, n);
|
|
2811
2825
|
}
|
|
2812
2826
|
}
|
|
2813
2827
|
}
|
|
2814
2828
|
if (writeOnly(n)) {
|
|
2815
2829
|
let n =
|
|
2816
|
-
r && (u || !
|
|
2830
|
+
r && (u || !c)
|
|
2817
2831
|
? r.K !== undefined && r.K !== NOT_PENDING
|
|
2818
2832
|
? r.K
|
|
2819
2833
|
: r.B !== NOT_PENDING
|
|
2820
2834
|
? r.B
|
|
2821
2835
|
: r.ue
|
|
2822
|
-
:
|
|
2836
|
+
: l[t];
|
|
2823
2837
|
n === $DELETED && (n = undefined);
|
|
2824
2838
|
if (!isWrappable(n)) return n;
|
|
2825
2839
|
const i = wrap(n, e);
|
|
2826
2840
|
Writing?.add(i);
|
|
2827
2841
|
return i;
|
|
2828
2842
|
}
|
|
2829
|
-
let a = r ? (u || !
|
|
2843
|
+
let a = r ? (u || !c ? read(i[t]) : (read(i[t]), l[t])) : l[t];
|
|
2830
2844
|
a === $DELETED && (a = undefined);
|
|
2831
2845
|
if (!r) {
|
|
2832
|
-
if (!u && typeof a === "function" && !
|
|
2846
|
+
if (!u && typeof a === "function" && !l.hasOwnProperty(t)) {
|
|
2833
2847
|
let t;
|
|
2834
2848
|
return !Array.isArray(e[STORE_VALUE]) &&
|
|
2835
2849
|
(t = Object.getPrototypeOf(e[STORE_VALUE])) &&
|
|
2836
2850
|
t !== Object.prototype
|
|
2837
|
-
? a.bind(
|
|
2851
|
+
? a.bind(l)
|
|
2838
2852
|
: a;
|
|
2839
2853
|
} else if (getObserver()) {
|
|
2840
2854
|
return read(
|
|
@@ -2879,13 +2893,13 @@ const storeTraps = {
|
|
|
2879
2893
|
: e[STORE_OVERRIDE] && t in e[STORE_OVERRIDE]
|
|
2880
2894
|
? e[STORE_OVERRIDE][t]
|
|
2881
2895
|
: r;
|
|
2882
|
-
const
|
|
2896
|
+
const c =
|
|
2883
2897
|
e[STORE_OPTIMISTIC_OVERRIDE] && t in e[STORE_OPTIMISTIC_OVERRIDE]
|
|
2884
2898
|
? e[STORE_OPTIMISTIC_OVERRIDE][t] !== $DELETED
|
|
2885
2899
|
: e[STORE_OVERRIDE] && t in e[STORE_OVERRIDE]
|
|
2886
2900
|
? e[STORE_OVERRIDE][t] !== $DELETED
|
|
2887
2901
|
: t in e[STORE_VALUE];
|
|
2888
|
-
const
|
|
2902
|
+
const l = unwrapStoreValue(n);
|
|
2889
2903
|
const a = Array.isArray(o) && t !== "length";
|
|
2890
2904
|
const f = a ? parseInt(t) + 1 : 0;
|
|
2891
2905
|
const E =
|
|
@@ -2896,14 +2910,14 @@ const storeTraps = {
|
|
|
2896
2910
|
? e[STORE_OVERRIDE].length
|
|
2897
2911
|
: o.length);
|
|
2898
2912
|
const S = a && f > E ? f : undefined;
|
|
2899
|
-
if (u ===
|
|
2900
|
-
if (
|
|
2913
|
+
if (u === l && S === undefined) return true;
|
|
2914
|
+
if (l !== undefined && l === r && S === undefined) delete e[s]?.[t];
|
|
2901
2915
|
else {
|
|
2902
2916
|
const n = e[s] || (e[s] = Object.create(null));
|
|
2903
|
-
n[t] =
|
|
2917
|
+
n[t] = l;
|
|
2904
2918
|
if (S !== undefined) n.length = S;
|
|
2905
2919
|
}
|
|
2906
|
-
notifyStoreProperty(e, t, "set",
|
|
2920
|
+
notifyStoreProperty(e, t, "set", l, u, c);
|
|
2907
2921
|
if (Array.isArray(o) && t !== "length" && S !== undefined) {
|
|
2908
2922
|
const t = getNodes(e, STORE_NODE);
|
|
2909
2923
|
if (t.length) {
|
|
@@ -3173,7 +3187,7 @@ const storePath = Object.assign(
|
|
|
3173
3187
|
{ DELETE: DELETE }
|
|
3174
3188
|
);
|
|
3175
3189
|
function snapshotImpl(e, t, n, i) {
|
|
3176
|
-
let r, s, o, u,
|
|
3190
|
+
let r, s, o, u, c, l;
|
|
3177
3191
|
if (!isWrappable(e)) return e;
|
|
3178
3192
|
if (n && n.has(e)) return n.get(e);
|
|
3179
3193
|
if (!n) n = new Map();
|
|
@@ -3194,12 +3208,12 @@ function snapshotImpl(e, t, n, i) {
|
|
|
3194
3208
|
if (s) {
|
|
3195
3209
|
const s = o?.length || e.length;
|
|
3196
3210
|
for (let a = 0; a < s; a++) {
|
|
3197
|
-
|
|
3198
|
-
if (
|
|
3199
|
-
if (t && isWrappable(
|
|
3200
|
-
if ((
|
|
3211
|
+
l = o && a in o ? o[a] : e[a];
|
|
3212
|
+
if (l === $DELETED) continue;
|
|
3213
|
+
if (t && isWrappable(l)) wrap(l, r);
|
|
3214
|
+
if ((c = snapshotImpl(l, t, n, i)) !== l || u) {
|
|
3201
3215
|
if (!u) n.set(e, (u = [...e]));
|
|
3202
|
-
u[a] =
|
|
3216
|
+
u[a] = c;
|
|
3203
3217
|
}
|
|
3204
3218
|
}
|
|
3205
3219
|
} else {
|
|
@@ -3208,14 +3222,14 @@ function snapshotImpl(e, t, n, i) {
|
|
|
3208
3222
|
let f = s[a];
|
|
3209
3223
|
const E = getPropertyDescriptor(e, o, f);
|
|
3210
3224
|
if (E.get) continue;
|
|
3211
|
-
|
|
3212
|
-
if (t && isWrappable(
|
|
3213
|
-
if ((
|
|
3225
|
+
l = o && f in o ? o[f] : e[f];
|
|
3226
|
+
if (t && isWrappable(l)) wrap(l, r);
|
|
3227
|
+
if ((c = snapshotImpl(l, t, n, i)) !== e[f] || u) {
|
|
3214
3228
|
if (!u) {
|
|
3215
3229
|
u = Object.create(Object.getPrototypeOf(e));
|
|
3216
3230
|
Object.assign(u, e);
|
|
3217
3231
|
}
|
|
3218
|
-
u[f] =
|
|
3232
|
+
u[f] = c;
|
|
3219
3233
|
}
|
|
3220
3234
|
}
|
|
3221
3235
|
}
|
|
@@ -3439,8 +3453,8 @@ function updateKeyedMap() {
|
|
|
3439
3453
|
let s,
|
|
3440
3454
|
o,
|
|
3441
3455
|
u,
|
|
3442
|
-
l,
|
|
3443
3456
|
c,
|
|
3457
|
+
l,
|
|
3444
3458
|
a,
|
|
3445
3459
|
f,
|
|
3446
3460
|
E = new Array(t),
|
|
@@ -3469,23 +3483,23 @@ function updateKeyedMap() {
|
|
|
3469
3483
|
a = new Map();
|
|
3470
3484
|
f = new Array(u + 1);
|
|
3471
3485
|
for (i = u; i >= s; i--) {
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
n = a.get(
|
|
3486
|
+
c = e[i];
|
|
3487
|
+
l = this.tt ? this.tt(c) : c;
|
|
3488
|
+
n = a.get(l);
|
|
3475
3489
|
f[i] = n === undefined ? -1 : n;
|
|
3476
|
-
a.set(
|
|
3490
|
+
a.set(l, i);
|
|
3477
3491
|
}
|
|
3478
3492
|
for (n = s; n <= o; n++) {
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
i = a.get(
|
|
3493
|
+
c = this.ze[n];
|
|
3494
|
+
l = this.tt ? this.tt(c) : c;
|
|
3495
|
+
i = a.get(l);
|
|
3482
3496
|
if (i !== undefined && i !== -1) {
|
|
3483
3497
|
E[i] = this.Je[n];
|
|
3484
3498
|
S[i] = this.et[n];
|
|
3485
3499
|
T && (T[i] = this.nt[n]);
|
|
3486
3500
|
d && (d[i] = this.it[n]);
|
|
3487
3501
|
i = f[i];
|
|
3488
|
-
a.set(
|
|
3502
|
+
a.set(l, i);
|
|
3489
3503
|
} else this.et[n].dispose();
|
|
3490
3504
|
}
|
|
3491
3505
|
for (i = s; i < t; i++) {
|
|
@@ -3521,7 +3535,7 @@ function repeat(e, t, n) {
|
|
|
3521
3535
|
Xe: i,
|
|
3522
3536
|
et: [],
|
|
3523
3537
|
Je: [],
|
|
3524
|
-
|
|
3538
|
+
ct: n?.from,
|
|
3525
3539
|
st: n?.fallback
|
|
3526
3540
|
})
|
|
3527
3541
|
);
|
|
@@ -3530,7 +3544,7 @@ function repeat(e, t, n) {
|
|
|
3530
3544
|
}
|
|
3531
3545
|
function updateRepeat() {
|
|
3532
3546
|
const e = this.ut();
|
|
3533
|
-
const t = this.
|
|
3547
|
+
const t = this.ct?.() || 0;
|
|
3534
3548
|
runWithOwner(this.Ze, () => {
|
|
3535
3549
|
if (e === 0) {
|
|
3536
3550
|
if (this.qe !== 0) {
|
|
@@ -3583,10 +3597,10 @@ function boundaryComputed(e, t) {
|
|
|
3583
3597
|
n.xe = (e, t) => {
|
|
3584
3598
|
const i = e !== undefined ? e : n.he;
|
|
3585
3599
|
const r = t !== undefined ? t : n.Re;
|
|
3586
|
-
n.he &= ~n.
|
|
3587
|
-
n.te.notify(n, n.
|
|
3600
|
+
n.he &= ~n.lt;
|
|
3601
|
+
n.te.notify(n, n.lt, i, r);
|
|
3588
3602
|
};
|
|
3589
|
-
n.
|
|
3603
|
+
n.lt = t;
|
|
3590
3604
|
n._e &= ~CONFIG_AUTO_DISPOSE;
|
|
3591
3605
|
recompute(n, true);
|
|
3592
3606
|
return n;
|
|
@@ -3736,6 +3750,7 @@ class CollectionQueue extends Queue {
|
|
|
3736
3750
|
Dt;
|
|
3737
3751
|
Et = true;
|
|
3738
3752
|
St = signal(false, { ownedWrite: true, Ye: true });
|
|
3753
|
+
Re;
|
|
3739
3754
|
Tt = signal(false, { ownedWrite: true, Ye: true });
|
|
3740
3755
|
Ot;
|
|
3741
3756
|
_t = false;
|
|
@@ -3776,6 +3791,9 @@ class CollectionQueue extends Queue {
|
|
|
3776
3791
|
const e = this.ft.size === 0;
|
|
3777
3792
|
this.ft.add(t);
|
|
3778
3793
|
if (e) setSignal(this.St, true);
|
|
3794
|
+
if (this.gt & STATUS_ERROR) {
|
|
3795
|
+
setSignal(this.Re, t.Re?.cause ?? t.Re);
|
|
3796
|
+
}
|
|
3779
3797
|
}
|
|
3780
3798
|
}
|
|
3781
3799
|
t &= ~this.gt;
|
|
@@ -3811,6 +3829,7 @@ function createCollectionBoundary(e, t, n, i) {
|
|
|
3811
3829
|
const r = createOwner();
|
|
3812
3830
|
if (_revealUsed) setContext(RevealControllerContext, null, r);
|
|
3813
3831
|
const s = new CollectionQueue(e);
|
|
3832
|
+
if (e === STATUS_ERROR) s.Re = signal(undefined, { ownedWrite: true, Ye: true });
|
|
3814
3833
|
if (i) s.yt = i;
|
|
3815
3834
|
const o = (s.Dt = createBoundChildren(r, t, s, e));
|
|
3816
3835
|
untrack(() => {
|
|
@@ -3844,14 +3863,12 @@ function createLoadingBoundary(e, t, n) {
|
|
|
3844
3863
|
return createCollectionBoundary(STATUS_PENDING, e, () => t(), n?.on);
|
|
3845
3864
|
}
|
|
3846
3865
|
function createErrorBoundary(e, t) {
|
|
3847
|
-
return createCollectionBoundary(STATUS_ERROR, e, e =>
|
|
3848
|
-
|
|
3849
|
-
const i = n.Re?.cause ?? n.Re;
|
|
3850
|
-
return t(i, () => {
|
|
3866
|
+
return createCollectionBoundary(STATUS_ERROR, e, e =>
|
|
3867
|
+
t(accessor(e.Re), () => {
|
|
3851
3868
|
for (const t of e.ft) recompute(t);
|
|
3852
3869
|
schedule();
|
|
3853
|
-
})
|
|
3854
|
-
|
|
3870
|
+
})
|
|
3871
|
+
);
|
|
3855
3872
|
}
|
|
3856
3873
|
function createRevealOrder(e, t) {
|
|
3857
3874
|
_revealUsed = true;
|