@solidjs/signals 0.13.0 → 0.13.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 +10 -2
- package/dist/node.cjs +125 -117
- package/dist/prod.js +10 -2
- package/package.json +1 -1
package/dist/dev.js
CHANGED
|
@@ -398,7 +398,13 @@ function commitPendingNodes() {
|
|
|
398
398
|
n._pendingValue = NOT_PENDING;
|
|
399
399
|
if (n._type && n._type !== EFFECT_TRACKED) n._modified = true;
|
|
400
400
|
}
|
|
401
|
-
if (
|
|
401
|
+
if (n._statusFlags & STATUS_PENDING) {
|
|
402
|
+
const _src = n._error?.source;
|
|
403
|
+
if (_src && !(_src._statusFlags & STATUS_PENDING)) {
|
|
404
|
+
n._statusFlags &= -6;
|
|
405
|
+
n._error = null;
|
|
406
|
+
}
|
|
407
|
+
} else n._statusFlags &= ~STATUS_UNINITIALIZED;
|
|
402
408
|
if (n._fn) GlobalQueue._dispose(n, false, true);
|
|
403
409
|
}
|
|
404
410
|
pendingNodes.length = 0;
|
|
@@ -1469,7 +1475,9 @@ function read(el) {
|
|
|
1469
1475
|
}
|
|
1470
1476
|
}
|
|
1471
1477
|
if (owner._statusFlags & STATUS_PENDING) {
|
|
1472
|
-
|
|
1478
|
+
const _errSource = owner._error?.source;
|
|
1479
|
+
if (_errSource && !(_errSource._statusFlags & STATUS_PENDING)) clearStatus(owner);
|
|
1480
|
+
else if (c && !(stale && owner._transition && activeTransition !== owner._transition)) {
|
|
1473
1481
|
if (currentOptimisticLane) {
|
|
1474
1482
|
const pendingLane = owner._optimisticLane;
|
|
1475
1483
|
const lane = findLane(currentOptimisticLane);
|
package/dist/node.cjs
CHANGED
|
@@ -32,8 +32,8 @@ const s = 1 << 4;
|
|
|
32
32
|
const o = 1 << 5;
|
|
33
33
|
const u = 1 << 6;
|
|
34
34
|
const f = 1 << 7;
|
|
35
|
-
const
|
|
36
|
-
const
|
|
35
|
+
const l = 1 << 8;
|
|
36
|
+
const c = 1 << 9;
|
|
37
37
|
const a = 1 << 0;
|
|
38
38
|
const d = 1 << 1;
|
|
39
39
|
const p = 1 << 2;
|
|
@@ -351,7 +351,7 @@ function insertSubs(e, t = false) {
|
|
|
351
351
|
const r = e.ie !== undefined;
|
|
352
352
|
for (let i = e.O; i !== null; i = i.P) {
|
|
353
353
|
if (r && i.k.se) {
|
|
354
|
-
i.k.m |=
|
|
354
|
+
i.k.m |= l;
|
|
355
355
|
continue;
|
|
356
356
|
}
|
|
357
357
|
if (t && n) {
|
|
@@ -365,7 +365,7 @@ function insertSubs(e, t = false) {
|
|
|
365
365
|
if (e.oe === g) {
|
|
366
366
|
if (!e.ue) {
|
|
367
367
|
e.ue = true;
|
|
368
|
-
e.fe.enqueue(y, e.
|
|
368
|
+
e.fe.enqueue(y, e.le);
|
|
369
369
|
}
|
|
370
370
|
continue;
|
|
371
371
|
}
|
|
@@ -378,12 +378,18 @@ function commitPendingNodes() {
|
|
|
378
378
|
const e = A.D;
|
|
379
379
|
for (let t = 0; t < e.length; t++) {
|
|
380
380
|
const n = e[t];
|
|
381
|
-
if (n.
|
|
382
|
-
n.ae = n.
|
|
383
|
-
n.
|
|
381
|
+
if (n.ce !== S) {
|
|
382
|
+
n.ae = n.ce;
|
|
383
|
+
n.ce = S;
|
|
384
384
|
if (n.oe && n.oe !== g) n.ue = true;
|
|
385
385
|
}
|
|
386
|
-
if (
|
|
386
|
+
if (n.de & a) {
|
|
387
|
+
const e = n.Y?.source;
|
|
388
|
+
if (e && !(e.de & a)) {
|
|
389
|
+
n.de &= -6;
|
|
390
|
+
n.Y = null;
|
|
391
|
+
}
|
|
392
|
+
} else n.de &= ~p;
|
|
387
393
|
if (n.H) GlobalQueue.U(n, false, true);
|
|
388
394
|
}
|
|
389
395
|
e.length = 0;
|
|
@@ -399,9 +405,9 @@ function finalizePureQueue(e = null, t = false) {
|
|
|
399
405
|
for (let e = 0; e < t.length; e++) {
|
|
400
406
|
const n = t[e];
|
|
401
407
|
n.re = undefined;
|
|
402
|
-
if (n.
|
|
403
|
-
n.ae = n.
|
|
404
|
-
n.
|
|
408
|
+
if (n.ce !== S) {
|
|
409
|
+
n.ae = n.ce;
|
|
410
|
+
n.ce = S;
|
|
405
411
|
}
|
|
406
412
|
const r = n.pe;
|
|
407
413
|
n.pe = S;
|
|
@@ -573,7 +579,7 @@ function handleAsync(e, t, r) {
|
|
|
573
579
|
if (o) o.T.delete(e);
|
|
574
580
|
if (r) r(i);
|
|
575
581
|
else if (e.pe !== undefined) {
|
|
576
|
-
if (e.pe !== undefined && e.pe !== S) e.
|
|
582
|
+
if (e.pe !== undefined && e.pe !== S) e.ce = i;
|
|
577
583
|
else {
|
|
578
584
|
e.ae = i;
|
|
579
585
|
insertSubs(e);
|
|
@@ -682,7 +688,7 @@ function notifyStatus(e, t, n, r, i) {
|
|
|
682
688
|
}
|
|
683
689
|
}
|
|
684
690
|
const f = r || u;
|
|
685
|
-
const
|
|
691
|
+
const l = r || o ? undefined : i;
|
|
686
692
|
if (e._e) {
|
|
687
693
|
if (f) {
|
|
688
694
|
e._e(t, n);
|
|
@@ -695,7 +701,7 @@ function notifyStatus(e, t, n, r, i) {
|
|
|
695
701
|
r.k.$ = k;
|
|
696
702
|
if (r.k.Y !== n) {
|
|
697
703
|
!r.k.ne && A.D.push(r.k);
|
|
698
|
-
notifyStatus(r.k, t, n, f,
|
|
704
|
+
notifyStatus(r.k, t, n, f, l);
|
|
699
705
|
}
|
|
700
706
|
}
|
|
701
707
|
for (let r = e.C; r !== null; r = r.j) {
|
|
@@ -703,7 +709,7 @@ function notifyStatus(e, t, n, r, i) {
|
|
|
703
709
|
e.k.$ = k;
|
|
704
710
|
if (e.k.Y !== n) {
|
|
705
711
|
!e.k.ne && A.D.push(e.k);
|
|
706
|
-
notifyStatus(e.k, t, n, f,
|
|
712
|
+
notifyStatus(e.k, t, n, f, l);
|
|
707
713
|
}
|
|
708
714
|
}
|
|
709
715
|
}
|
|
@@ -976,7 +982,7 @@ function trackedEffect(e, t) {
|
|
|
976
982
|
n.Te = undefined;
|
|
977
983
|
n.ue = true;
|
|
978
984
|
n.oe = g;
|
|
979
|
-
n.
|
|
985
|
+
n.le = run;
|
|
980
986
|
n.fe.enqueue(y, run);
|
|
981
987
|
onCleanup(() => n.Te?.());
|
|
982
988
|
}
|
|
@@ -1044,8 +1050,8 @@ function releaseSubtree(e) {
|
|
|
1044
1050
|
if (t.H) {
|
|
1045
1051
|
const e = t;
|
|
1046
1052
|
e.se = false;
|
|
1047
|
-
if (e.m &
|
|
1048
|
-
e.m &= ~
|
|
1053
|
+
if (e.m & l) {
|
|
1054
|
+
e.m &= ~l;
|
|
1049
1055
|
e.m |= n;
|
|
1050
1056
|
if (P.A > e.o) P.A = e.o;
|
|
1051
1057
|
insertIntoHeap(e, P);
|
|
@@ -1082,13 +1088,13 @@ function recompute(t, n = false) {
|
|
|
1082
1088
|
}
|
|
1083
1089
|
const s = !!(t.m & f);
|
|
1084
1090
|
const u = t.pe !== undefined && t.pe !== S;
|
|
1085
|
-
const
|
|
1091
|
+
const c = !!(t.de & a);
|
|
1086
1092
|
const p = M;
|
|
1087
1093
|
M = t;
|
|
1088
1094
|
t.ke = null;
|
|
1089
1095
|
t.m = r;
|
|
1090
1096
|
t.$ = k;
|
|
1091
|
-
let h = t.
|
|
1097
|
+
let h = t.ce === S ? t.ae : t.ce;
|
|
1092
1098
|
let y = t.o;
|
|
1093
1099
|
let w = H;
|
|
1094
1100
|
let m = V;
|
|
@@ -1123,7 +1129,7 @@ function recompute(t, n = false) {
|
|
|
1123
1129
|
);
|
|
1124
1130
|
} finally {
|
|
1125
1131
|
H = w;
|
|
1126
|
-
t.m = e | (n ? t.m &
|
|
1132
|
+
t.m = e | (n ? t.m & l : 0);
|
|
1127
1133
|
M = p;
|
|
1128
1134
|
}
|
|
1129
1135
|
if (!t.Y) {
|
|
@@ -1136,21 +1142,21 @@ function recompute(t, n = false) {
|
|
|
1136
1142
|
if (e !== null) e.N = null;
|
|
1137
1143
|
else t.W = null;
|
|
1138
1144
|
}
|
|
1139
|
-
const f = u ? t.pe : t.
|
|
1140
|
-
const
|
|
1141
|
-
if (
|
|
1145
|
+
const f = u ? t.pe : t.ce === S ? t.ae : t.ce;
|
|
1146
|
+
const l = !t.me || !t.me(f, h);
|
|
1147
|
+
if (l) {
|
|
1142
1148
|
const e = u ? t.pe : undefined;
|
|
1143
1149
|
if (n || (i && C !== t.ne) || s) {
|
|
1144
1150
|
t.ae = h;
|
|
1145
1151
|
if (u && s) {
|
|
1146
1152
|
t.pe = h;
|
|
1147
|
-
t.
|
|
1153
|
+
t.ce = h;
|
|
1148
1154
|
}
|
|
1149
|
-
} else t.
|
|
1150
|
-
if (u && !s &&
|
|
1155
|
+
} else t.ce = h;
|
|
1156
|
+
if (u && !s && c && !t.Se) t.pe = h;
|
|
1151
1157
|
if (!u || s || t.pe !== e) insertSubs(t, s || u);
|
|
1152
1158
|
} else if (u) {
|
|
1153
|
-
t.
|
|
1159
|
+
t.ce = h;
|
|
1154
1160
|
} else if (t.o != y) {
|
|
1155
1161
|
for (let e = t.O; e !== null; e = e.P) {
|
|
1156
1162
|
insertIntoHeapHeight(e.k, e.k.m & o ? v : P);
|
|
@@ -1177,7 +1183,7 @@ function updateIfNecessary(r) {
|
|
|
1177
1183
|
if (r.m & (n | f) || (r.Y && r.$ < k && !r.we)) {
|
|
1178
1184
|
recompute(r);
|
|
1179
1185
|
}
|
|
1180
|
-
r.m = e | (r.m &
|
|
1186
|
+
r.m = e | (r.m & l);
|
|
1181
1187
|
}
|
|
1182
1188
|
function computed(t, n, r) {
|
|
1183
1189
|
const i = r?.transparent ?? false;
|
|
@@ -1204,10 +1210,10 @@ function computed(t, n, r) {
|
|
|
1204
1210
|
i: M,
|
|
1205
1211
|
Ee: null,
|
|
1206
1212
|
Ce: null,
|
|
1207
|
-
m: r?.lazy ?
|
|
1213
|
+
m: r?.lazy ? c : e,
|
|
1208
1214
|
de: p,
|
|
1209
1215
|
$: k,
|
|
1210
|
-
|
|
1216
|
+
ce: S,
|
|
1211
1217
|
We: null,
|
|
1212
1218
|
je: null,
|
|
1213
1219
|
we: null,
|
|
@@ -1257,7 +1263,7 @@ function signal(e, t, n = null) {
|
|
|
1257
1263
|
$: k,
|
|
1258
1264
|
I: n,
|
|
1259
1265
|
j: n?.C || null,
|
|
1260
|
-
|
|
1266
|
+
ce: S
|
|
1261
1267
|
};
|
|
1262
1268
|
n && (n.C = r);
|
|
1263
1269
|
if (D && !r.Fe && !((n?.de ?? 0) & a)) {
|
|
@@ -1329,8 +1335,8 @@ function read(e) {
|
|
|
1329
1335
|
let t = M;
|
|
1330
1336
|
if (t?.t) t = t.u;
|
|
1331
1337
|
if (Q && e.H) recompute(e);
|
|
1332
|
-
if (e.m &
|
|
1333
|
-
e.m &= ~
|
|
1338
|
+
if (e.m & c) {
|
|
1339
|
+
e.m &= ~c;
|
|
1334
1340
|
recompute(e, true);
|
|
1335
1341
|
}
|
|
1336
1342
|
const n = e.I || e;
|
|
@@ -1351,7 +1357,9 @@ function read(e) {
|
|
|
1351
1357
|
}
|
|
1352
1358
|
}
|
|
1353
1359
|
if (n.de & a) {
|
|
1354
|
-
|
|
1360
|
+
const r = n.Y?.source;
|
|
1361
|
+
if (r && !(r.de & a)) clearStatus(n);
|
|
1362
|
+
else if (t && !(R && n.ne && C !== n.ne)) {
|
|
1355
1363
|
if (V) {
|
|
1356
1364
|
const r = n.re;
|
|
1357
1365
|
const i = findLane(V);
|
|
@@ -1377,24 +1385,24 @@ function read(e) {
|
|
|
1377
1385
|
const n = e.ie;
|
|
1378
1386
|
if (n !== undefined) {
|
|
1379
1387
|
const r = n === w ? undefined : n;
|
|
1380
|
-
const i = e.
|
|
1381
|
-
if (i !== r) t.m |=
|
|
1388
|
+
const i = e.ce !== S ? e.ce : e.ae;
|
|
1389
|
+
if (i !== r) t.m |= l;
|
|
1382
1390
|
return r;
|
|
1383
1391
|
}
|
|
1384
1392
|
}
|
|
1385
1393
|
if (e.pe !== undefined && e.pe !== S) return e.pe;
|
|
1386
1394
|
return !t ||
|
|
1387
1395
|
(V !== null && (e.pe !== undefined || e.re || n === e || !!(n.de & a))) ||
|
|
1388
|
-
e.
|
|
1396
|
+
e.ce === S ||
|
|
1389
1397
|
(R && e.ne && C !== e.ne)
|
|
1390
1398
|
? e.ae
|
|
1391
|
-
: e.
|
|
1399
|
+
: e.ce;
|
|
1392
1400
|
}
|
|
1393
1401
|
function setSignal(e, t) {
|
|
1394
1402
|
if (e.ne && C !== e.ne) A.initTransition(e.ne);
|
|
1395
1403
|
const n = e.pe !== undefined && !j;
|
|
1396
1404
|
const r = e.pe !== undefined && e.pe !== S;
|
|
1397
|
-
const i = n ? (r ? e.pe : e.ae) : e.
|
|
1405
|
+
const i = n ? (r ? e.pe : e.ae) : e.ce === S ? e.ae : e.ce;
|
|
1398
1406
|
if (typeof t === "function") t = t(i);
|
|
1399
1407
|
const s = !e.me || !e.me(i, t) || !!(e.de & p);
|
|
1400
1408
|
if (!s) {
|
|
@@ -1408,7 +1416,7 @@ function setSignal(e, t) {
|
|
|
1408
1416
|
const n = e.pe === S;
|
|
1409
1417
|
if (!n && e.ne) A.initTransition(e.ne);
|
|
1410
1418
|
if (n) {
|
|
1411
|
-
e.
|
|
1419
|
+
e.ce = e.ae;
|
|
1412
1420
|
A.B.push(e);
|
|
1413
1421
|
}
|
|
1414
1422
|
e.Se = true;
|
|
@@ -1416,8 +1424,8 @@ function setSignal(e, t) {
|
|
|
1416
1424
|
e.re = r;
|
|
1417
1425
|
e.pe = t;
|
|
1418
1426
|
} else {
|
|
1419
|
-
if (e.
|
|
1420
|
-
e.
|
|
1427
|
+
if (e.ce === S) A.D.push(e);
|
|
1428
|
+
e.ce = t;
|
|
1421
1429
|
}
|
|
1422
1430
|
updatePendingSignal(e);
|
|
1423
1431
|
if (e.be) {
|
|
@@ -1460,7 +1468,7 @@ function computePendingState(e) {
|
|
|
1460
1468
|
}
|
|
1461
1469
|
return true;
|
|
1462
1470
|
}
|
|
1463
|
-
if (e.
|
|
1471
|
+
if (e.ce !== S && !(t.de & p)) return true;
|
|
1464
1472
|
return !!(t.de & a && !(t.de & p));
|
|
1465
1473
|
}
|
|
1466
1474
|
function updatePendingSignal(e) {
|
|
@@ -1718,7 +1726,7 @@ function applyState(e, t, n) {
|
|
|
1718
1726
|
let t = false;
|
|
1719
1727
|
const f = getOverrideValue(i, s, u, "length", o);
|
|
1720
1728
|
if (e.length && f && e[0] && n(e[0]) != null) {
|
|
1721
|
-
let
|
|
1729
|
+
let l, c, a, d, p, h, y, g;
|
|
1722
1730
|
for (
|
|
1723
1731
|
a = 0, d = Math.min(f, e.length);
|
|
1724
1732
|
a < d &&
|
|
@@ -1739,44 +1747,44 @@ function applyState(e, t, n) {
|
|
|
1739
1747
|
S[p] = h;
|
|
1740
1748
|
}
|
|
1741
1749
|
if (a > p || a > d) {
|
|
1742
|
-
for (
|
|
1750
|
+
for (c = a; c <= p; c++) {
|
|
1743
1751
|
t = true;
|
|
1744
|
-
r[$][
|
|
1752
|
+
r[$][c] && setSignal(r[$][c], wrap(e[c], r));
|
|
1745
1753
|
}
|
|
1746
|
-
for (;
|
|
1754
|
+
for (; c < e.length; c++) {
|
|
1747
1755
|
t = true;
|
|
1748
|
-
const i = wrap(S[
|
|
1749
|
-
r[$][
|
|
1750
|
-
applyState(e[
|
|
1756
|
+
const i = wrap(S[c], r);
|
|
1757
|
+
r[$][c] && setSignal(r[$][c], i);
|
|
1758
|
+
applyState(e[c], i, n);
|
|
1751
1759
|
}
|
|
1752
1760
|
t && r[$][K] && setSignal(r[$][K], void 0);
|
|
1753
1761
|
f !== e.length && r[$].length && setSignal(r[$].length, e.length);
|
|
1754
1762
|
return;
|
|
1755
1763
|
}
|
|
1756
1764
|
y = new Array(p + 1);
|
|
1757
|
-
for (
|
|
1758
|
-
h = e[
|
|
1765
|
+
for (c = p; c >= a; c--) {
|
|
1766
|
+
h = e[c];
|
|
1759
1767
|
g = h ? n(h) : h;
|
|
1760
|
-
|
|
1761
|
-
y[
|
|
1762
|
-
w.set(g,
|
|
1768
|
+
l = w.get(g);
|
|
1769
|
+
y[c] = l === undefined ? -1 : l;
|
|
1770
|
+
w.set(g, c);
|
|
1763
1771
|
}
|
|
1764
|
-
for (
|
|
1765
|
-
h = getOverrideValue(i, s, u,
|
|
1772
|
+
for (l = a; l <= d; l++) {
|
|
1773
|
+
h = getOverrideValue(i, s, u, l, o);
|
|
1766
1774
|
g = h ? n(h) : h;
|
|
1767
|
-
|
|
1768
|
-
if (
|
|
1769
|
-
S[
|
|
1770
|
-
|
|
1771
|
-
w.set(g,
|
|
1775
|
+
c = w.get(g);
|
|
1776
|
+
if (c !== undefined && c !== -1) {
|
|
1777
|
+
S[c] = h;
|
|
1778
|
+
c = y[c];
|
|
1779
|
+
w.set(g, c);
|
|
1772
1780
|
}
|
|
1773
1781
|
}
|
|
1774
|
-
for (
|
|
1775
|
-
if (
|
|
1776
|
-
const t = wrap(S[
|
|
1777
|
-
r[$][
|
|
1778
|
-
applyState(e[
|
|
1779
|
-
} else r[$][
|
|
1782
|
+
for (c = a; c < e.length; c++) {
|
|
1783
|
+
if (c in S) {
|
|
1784
|
+
const t = wrap(S[c], r);
|
|
1785
|
+
r[$][c] && setSignal(r[$][c], t);
|
|
1786
|
+
applyState(e[c], t, n);
|
|
1787
|
+
} else r[$][c] && setSignal(r[$][c], wrap(e[c], r));
|
|
1780
1788
|
}
|
|
1781
1789
|
if (a < e.length) t = true;
|
|
1782
1790
|
} else if (e.length) {
|
|
@@ -1795,11 +1803,11 @@ function applyState(e, t, n) {
|
|
|
1795
1803
|
if (u) {
|
|
1796
1804
|
const t = u[K];
|
|
1797
1805
|
const f = t ? getAllKeys(i, s, e) : Object.keys(u);
|
|
1798
|
-
for (let
|
|
1799
|
-
const
|
|
1800
|
-
const a = u[
|
|
1801
|
-
const d = unwrap(getOverrideValue(i, s, u,
|
|
1802
|
-
let p = unwrap(e[
|
|
1806
|
+
for (let l = 0, c = f.length; l < c; l++) {
|
|
1807
|
+
const c = f[l];
|
|
1808
|
+
const a = u[c];
|
|
1809
|
+
const d = unwrap(getOverrideValue(i, s, u, c, o));
|
|
1810
|
+
let p = unwrap(e[c]);
|
|
1803
1811
|
if (d === p) continue;
|
|
1804
1812
|
if (!d || !isWrappable(d) || !isWrappable(p) || (n(d) != null && n(d) !== n(p))) {
|
|
1805
1813
|
t && setSignal(t, void 0);
|
|
@@ -2010,8 +2018,8 @@ const fe = {
|
|
|
2010
2018
|
i && (o || !u)
|
|
2011
2019
|
? i.pe !== undefined && i.pe !== S
|
|
2012
2020
|
? i.pe
|
|
2013
|
-
: i.
|
|
2014
|
-
? i.
|
|
2021
|
+
: i.ce !== S
|
|
2022
|
+
? i.ce
|
|
2015
2023
|
: i.ae
|
|
2016
2024
|
: f[t];
|
|
2017
2025
|
n === J && (n = undefined);
|
|
@@ -2020,19 +2028,19 @@ const fe = {
|
|
|
2020
2028
|
ue?.add(r);
|
|
2021
2029
|
return r;
|
|
2022
2030
|
}
|
|
2023
|
-
let
|
|
2024
|
-
|
|
2031
|
+
let l = i ? (o || !u ? read(r[t]) : (read(r[t]), f[t])) : f[t];
|
|
2032
|
+
l === J && (l = undefined);
|
|
2025
2033
|
if (!i) {
|
|
2026
|
-
if (!o && typeof
|
|
2034
|
+
if (!o && typeof l === "function" && !f.hasOwnProperty(t)) {
|
|
2027
2035
|
let t;
|
|
2028
2036
|
return !Array.isArray(e[X]) && (t = Object.getPrototypeOf(e[X])) && t !== Object.prototype
|
|
2029
|
-
?
|
|
2030
|
-
:
|
|
2037
|
+
? l.bind(f)
|
|
2038
|
+
: l;
|
|
2031
2039
|
} else if (getObserver()) {
|
|
2032
|
-
return read(getNode(r, t, isWrappable(
|
|
2040
|
+
return read(getNode(r, t, isWrappable(l) ? wrap(l, e) : l, e[re], isEqual, e[ie], e[m]));
|
|
2033
2041
|
}
|
|
2034
2042
|
}
|
|
2035
|
-
return isWrappable(
|
|
2043
|
+
return isWrappable(l) ? wrap(l, e) : l;
|
|
2036
2044
|
},
|
|
2037
2045
|
has(e, t) {
|
|
2038
2046
|
if (t === U || t === K || t === "__proto__") return true;
|
|
@@ -2065,21 +2073,21 @@ const fe = {
|
|
|
2065
2073
|
const u = o ? Z : Y;
|
|
2066
2074
|
if (o) trackOptimisticStore(r);
|
|
2067
2075
|
const f = e[Z] && t in e[Z] ? e[Z][t] : e[Y] && t in e[Y] ? e[Y][t] : s;
|
|
2068
|
-
const
|
|
2069
|
-
if (f ===
|
|
2070
|
-
const
|
|
2071
|
-
if (
|
|
2072
|
-
else (e[u] || (e[u] = Object.create(null)))[t] =
|
|
2073
|
-
const d = isWrappable(
|
|
2076
|
+
const l = n?.[z]?.[X] ?? n;
|
|
2077
|
+
if (f === l) return true;
|
|
2078
|
+
const c = e[Z]?.length || e[Y]?.length || i.length;
|
|
2079
|
+
if (l !== undefined && l === s) delete e[u][t];
|
|
2080
|
+
else (e[u] || (e[u] = Object.create(null)))[t] = l;
|
|
2081
|
+
const d = isWrappable(l);
|
|
2074
2082
|
e[ee]?.[t] && setSignal(e[ee][t], true);
|
|
2075
2083
|
const p = getNodes(e, $);
|
|
2076
|
-
p[t] && setSignal(p[t], () => (d ? wrap(
|
|
2084
|
+
p[t] && setSignal(p[t], () => (d ? wrap(l, e) : l));
|
|
2077
2085
|
if (Array.isArray(i)) {
|
|
2078
2086
|
if (t === "length") {
|
|
2079
|
-
p.length && setSignal(p.length,
|
|
2087
|
+
p.length && setSignal(p.length, l);
|
|
2080
2088
|
} else {
|
|
2081
2089
|
const e = parseInt(t) + 1;
|
|
2082
|
-
if (e >
|
|
2090
|
+
if (e > c) p.length && setSignal(p.length, e);
|
|
2083
2091
|
}
|
|
2084
2092
|
}
|
|
2085
2093
|
p[K] && setSignal(p[K], undefined);
|
|
@@ -2246,7 +2254,7 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2246
2254
|
}
|
|
2247
2255
|
return { store: s, node: r };
|
|
2248
2256
|
}
|
|
2249
|
-
const
|
|
2257
|
+
const le = Symbol(0);
|
|
2250
2258
|
function updatePath(e, t, n = 0) {
|
|
2251
2259
|
let r,
|
|
2252
2260
|
i = e;
|
|
@@ -2290,7 +2298,7 @@ function updatePath(e, t, n = 0) {
|
|
|
2290
2298
|
if (s === i) return;
|
|
2291
2299
|
}
|
|
2292
2300
|
if (r === undefined && s == undefined) return;
|
|
2293
|
-
if (s ===
|
|
2301
|
+
if (s === le) {
|
|
2294
2302
|
delete e[r];
|
|
2295
2303
|
} else if (r === undefined || (isWrappable(i) && isWrappable(s) && !Array.isArray(s))) {
|
|
2296
2304
|
const t = r !== undefined ? e[r] : e;
|
|
@@ -2300,16 +2308,16 @@ function updatePath(e, t, n = 0) {
|
|
|
2300
2308
|
e[r] = s;
|
|
2301
2309
|
}
|
|
2302
2310
|
}
|
|
2303
|
-
const
|
|
2311
|
+
const ce = Object.assign(
|
|
2304
2312
|
function storePath(...e) {
|
|
2305
2313
|
return t => {
|
|
2306
2314
|
updatePath(t, e);
|
|
2307
2315
|
};
|
|
2308
2316
|
},
|
|
2309
|
-
{ DELETE:
|
|
2317
|
+
{ DELETE: le }
|
|
2310
2318
|
);
|
|
2311
2319
|
function snapshotImpl(e, t, n, r) {
|
|
2312
|
-
let i, s, o, u, f,
|
|
2320
|
+
let i, s, o, u, f, l;
|
|
2313
2321
|
if (!isWrappable(e)) return e;
|
|
2314
2322
|
if (n && n.has(e)) return n.get(e);
|
|
2315
2323
|
if (!n) n = new Map();
|
|
@@ -2326,24 +2334,24 @@ function snapshotImpl(e, t, n, r) {
|
|
|
2326
2334
|
}
|
|
2327
2335
|
if (s) {
|
|
2328
2336
|
const s = o?.length || e.length;
|
|
2329
|
-
for (let
|
|
2330
|
-
|
|
2331
|
-
if (
|
|
2332
|
-
if (t && isWrappable(
|
|
2333
|
-
if ((f = snapshotImpl(
|
|
2337
|
+
for (let c = 0; c < s; c++) {
|
|
2338
|
+
l = o && c in o ? o[c] : e[c];
|
|
2339
|
+
if (l === J) continue;
|
|
2340
|
+
if (t && isWrappable(l)) wrap(l, i);
|
|
2341
|
+
if ((f = snapshotImpl(l, t, n, r)) !== l || u) {
|
|
2334
2342
|
if (!u) n.set(e, (u = [...e]));
|
|
2335
|
-
u[
|
|
2343
|
+
u[c] = f;
|
|
2336
2344
|
}
|
|
2337
2345
|
}
|
|
2338
2346
|
} else {
|
|
2339
2347
|
const s = getKeys(e, o);
|
|
2340
|
-
for (let
|
|
2341
|
-
let a = s[
|
|
2348
|
+
for (let c = 0, a = s.length; c < a; c++) {
|
|
2349
|
+
let a = s[c];
|
|
2342
2350
|
const d = getPropertyDescriptor(e, o, a);
|
|
2343
2351
|
if (d.get) continue;
|
|
2344
|
-
|
|
2345
|
-
if (t && isWrappable(
|
|
2346
|
-
if ((f = snapshotImpl(
|
|
2352
|
+
l = o && a in o ? o[a] : e[a];
|
|
2353
|
+
if (t && isWrappable(l)) wrap(l, i);
|
|
2354
|
+
if ((f = snapshotImpl(l, t, n, r)) !== e[a] || u) {
|
|
2347
2355
|
if (!u) {
|
|
2348
2356
|
u = Object.create(Object.getPrototypeOf(e));
|
|
2349
2357
|
Object.assign(u, e);
|
|
@@ -2560,8 +2568,8 @@ function updateKeyedMap() {
|
|
|
2560
2568
|
o,
|
|
2561
2569
|
u,
|
|
2562
2570
|
f,
|
|
2563
|
-
c,
|
|
2564
2571
|
l,
|
|
2572
|
+
c,
|
|
2565
2573
|
a,
|
|
2566
2574
|
d = new Array(t),
|
|
2567
2575
|
p = new Array(t),
|
|
@@ -2586,26 +2594,26 @@ function updateKeyedMap() {
|
|
|
2586
2594
|
h && (h[u] = this.Xe[o]);
|
|
2587
2595
|
y && (y[u] = this.Ye[o]);
|
|
2588
2596
|
}
|
|
2589
|
-
|
|
2597
|
+
c = new Map();
|
|
2590
2598
|
a = new Array(u + 1);
|
|
2591
2599
|
for (r = u; r >= s; r--) {
|
|
2592
2600
|
f = e[r];
|
|
2593
|
-
|
|
2594
|
-
n =
|
|
2601
|
+
l = this.Je ? this.Je(f) : f;
|
|
2602
|
+
n = c.get(l);
|
|
2595
2603
|
a[r] = n === undefined ? -1 : n;
|
|
2596
|
-
|
|
2604
|
+
c.set(l, r);
|
|
2597
2605
|
}
|
|
2598
2606
|
for (n = s; n <= o; n++) {
|
|
2599
2607
|
f = this.Ge[n];
|
|
2600
|
-
|
|
2601
|
-
r =
|
|
2608
|
+
l = this.Je ? this.Je(f) : f;
|
|
2609
|
+
r = c.get(l);
|
|
2602
2610
|
if (r !== undefined && r !== -1) {
|
|
2603
2611
|
d[r] = this.ze[n];
|
|
2604
2612
|
p[r] = this.Ue[n];
|
|
2605
2613
|
h && (h[r] = this.Xe[n]);
|
|
2606
2614
|
y && (y[r] = this.Ye[n]);
|
|
2607
2615
|
r = a[r];
|
|
2608
|
-
|
|
2616
|
+
c.set(l, r);
|
|
2609
2617
|
} else this.Ue[n].dispose();
|
|
2610
2618
|
}
|
|
2611
2619
|
for (r = s; r < t; r++) {
|
|
@@ -2909,5 +2917,5 @@ exports.runWithOwner = runWithOwner;
|
|
|
2909
2917
|
exports.setContext = setContext;
|
|
2910
2918
|
exports.setSnapshotCapture = setSnapshotCapture;
|
|
2911
2919
|
exports.snapshot = snapshot;
|
|
2912
|
-
exports.storePath =
|
|
2920
|
+
exports.storePath = ce;
|
|
2913
2921
|
exports.untrack = untrack;
|
package/dist/prod.js
CHANGED
|
@@ -382,7 +382,13 @@ function commitPendingNodes() {
|
|
|
382
382
|
n.le = NOT_PENDING;
|
|
383
383
|
if (n.se && n.se !== EFFECT_TRACKED) n.ue = true;
|
|
384
384
|
}
|
|
385
|
-
if (
|
|
385
|
+
if (n.Ee & STATUS_PENDING) {
|
|
386
|
+
const e = n.q?.source;
|
|
387
|
+
if (e && !(e.Ee & STATUS_PENDING)) {
|
|
388
|
+
n.Ee &= -6;
|
|
389
|
+
n.q = null;
|
|
390
|
+
}
|
|
391
|
+
} else n.Ee &= ~STATUS_UNINITIALIZED;
|
|
386
392
|
if (n.L) GlobalQueue.Y(n, false, true);
|
|
387
393
|
}
|
|
388
394
|
e.length = 0;
|
|
@@ -1351,7 +1357,9 @@ function read(e) {
|
|
|
1351
1357
|
}
|
|
1352
1358
|
}
|
|
1353
1359
|
if (n.Ee & STATUS_PENDING) {
|
|
1354
|
-
|
|
1360
|
+
const i = n.q?.source;
|
|
1361
|
+
if (i && !(i.Ee & STATUS_PENDING)) clearStatus(n);
|
|
1362
|
+
else if (t && !(stale && n.ne && activeTransition !== n.ne)) {
|
|
1355
1363
|
if (currentOptimisticLane) {
|
|
1356
1364
|
const i = n.ie;
|
|
1357
1365
|
const r = findLane(currentOptimisticLane);
|