@solidjs/signals 0.10.3 → 0.10.5
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 +157 -149
- package/dist/node.cjs +241 -234
- package/dist/prod.js +183 -176
- package/dist/types/core/core.d.ts +1 -6
- package/dist/types/core/index.d.ts +3 -1
- package/dist/types/core/owner.d.ts +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/store/store.d.ts +4 -4
- package/package.json +1 -1
package/dist/node.cjs
CHANGED
|
@@ -101,12 +101,12 @@ function markNode(e, r = n) {
|
|
|
101
101
|
if ((i & (t | n)) >= r) return;
|
|
102
102
|
e.m = (i & -4) | r;
|
|
103
103
|
for (let n = e.O; n !== null; n = n.P) {
|
|
104
|
-
markNode(n.
|
|
104
|
+
markNode(n.k, t);
|
|
105
105
|
}
|
|
106
|
-
if (e.
|
|
107
|
-
for (let n = e.
|
|
106
|
+
if (e.C !== null) {
|
|
107
|
+
for (let n = e.C; n !== null; n = n.A) {
|
|
108
108
|
for (let e = n.O; e !== null; e = e.P) {
|
|
109
|
-
markNode(e.
|
|
109
|
+
markNode(e.k, t);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
}
|
|
@@ -134,7 +134,7 @@ function adjustHeight(e, t) {
|
|
|
134
134
|
if (e.o !== n) {
|
|
135
135
|
e.o = n;
|
|
136
136
|
for (let n = e.O; n !== null; n = n.P) {
|
|
137
|
-
insertIntoHeapHeight(n.
|
|
137
|
+
insertIntoHeapHeight(n.k, t);
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
}
|
|
@@ -146,7 +146,7 @@ let x = null;
|
|
|
146
146
|
let v = false;
|
|
147
147
|
let P = false;
|
|
148
148
|
function runLaneEffects(e) {
|
|
149
|
-
for (const t of
|
|
149
|
+
for (const t of A) {
|
|
150
150
|
if (t.R || t.T.size > 0) continue;
|
|
151
151
|
const n = t.M[e - 1];
|
|
152
152
|
if (n.length) {
|
|
@@ -161,7 +161,7 @@ function setProjectionWriteActive(e) {
|
|
|
161
161
|
function schedule() {
|
|
162
162
|
if (v) return;
|
|
163
163
|
v = true;
|
|
164
|
-
if (!
|
|
164
|
+
if (!k.q) queueMicrotask(flush);
|
|
165
165
|
}
|
|
166
166
|
class Queue {
|
|
167
167
|
i = null;
|
|
@@ -310,7 +310,7 @@ class GlobalQueue extends Queue {
|
|
|
310
310
|
const t = x;
|
|
311
311
|
t.te = e;
|
|
312
312
|
e.ee.push(...t.ee);
|
|
313
|
-
for (const n of
|
|
313
|
+
for (const n of A) {
|
|
314
314
|
if (n.ne === t) n.ne = e;
|
|
315
315
|
}
|
|
316
316
|
e.B.push(...t.B);
|
|
@@ -334,7 +334,7 @@ class GlobalQueue extends Queue {
|
|
|
334
334
|
x.B.push(t);
|
|
335
335
|
}
|
|
336
336
|
this.B = x.B;
|
|
337
|
-
for (const e of
|
|
337
|
+
for (const e of A) {
|
|
338
338
|
if (!e.ne) e.ne = x;
|
|
339
339
|
}
|
|
340
340
|
for (const e of this.G) x.G.add(e);
|
|
@@ -345,13 +345,13 @@ function insertSubs(e, t = false) {
|
|
|
345
345
|
const n = e.re || R;
|
|
346
346
|
for (let r = e.O; r !== null; r = r.P) {
|
|
347
347
|
if (t && n) {
|
|
348
|
-
r.
|
|
349
|
-
assignOrMergeLane(r.
|
|
348
|
+
r.k.m |= f;
|
|
349
|
+
assignOrMergeLane(r.k, n);
|
|
350
350
|
} else if (t) {
|
|
351
|
-
r.
|
|
352
|
-
r.
|
|
351
|
+
r.k.m |= f;
|
|
352
|
+
r.k.re = undefined;
|
|
353
353
|
}
|
|
354
|
-
const e = r.
|
|
354
|
+
const e = r.k;
|
|
355
355
|
if (e.ie === h) {
|
|
356
356
|
if (!e.se) {
|
|
357
357
|
e.se = true;
|
|
@@ -359,17 +359,17 @@ function insertSubs(e, t = false) {
|
|
|
359
359
|
}
|
|
360
360
|
continue;
|
|
361
361
|
}
|
|
362
|
-
const i = r.
|
|
363
|
-
if (i.W > r.
|
|
364
|
-
insertIntoHeap(r.
|
|
362
|
+
const i = r.k.m & o ? b : _;
|
|
363
|
+
if (i.W > r.k.o) i.W = r.k.o;
|
|
364
|
+
insertIntoHeap(r.k, i);
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
367
|
function finalizePureQueue(e = null, t = false) {
|
|
368
368
|
let n = !t;
|
|
369
|
-
if (!t) checkBoundaryChildren(
|
|
369
|
+
if (!t) checkBoundaryChildren(k);
|
|
370
370
|
if (_.S >= _.W) runHeap(_, GlobalQueue.K);
|
|
371
371
|
if (n) {
|
|
372
|
-
const t =
|
|
372
|
+
const t = k.D;
|
|
373
373
|
for (let e = 0; e < t.length; e++) {
|
|
374
374
|
const n = t[e];
|
|
375
375
|
if (n.fe !== y) {
|
|
@@ -381,7 +381,7 @@ function finalizePureQueue(e = null, t = false) {
|
|
|
381
381
|
if (n.H) GlobalQueue.U(n, false, true);
|
|
382
382
|
}
|
|
383
383
|
t.length = 0;
|
|
384
|
-
const n = e ? e.B :
|
|
384
|
+
const n = e ? e.B : k.B;
|
|
385
385
|
for (let e = 0; e < n.length; e++) {
|
|
386
386
|
const t = n[e];
|
|
387
387
|
const r = t.fe;
|
|
@@ -394,7 +394,7 @@ function finalizePureQueue(e = null, t = false) {
|
|
|
394
394
|
t.ne = null;
|
|
395
395
|
}
|
|
396
396
|
n.length = 0;
|
|
397
|
-
const r = e ? e.G :
|
|
397
|
+
const r = e ? e.G : k.G;
|
|
398
398
|
if (GlobalQueue.J && r.size) {
|
|
399
399
|
for (const e of r) {
|
|
400
400
|
GlobalQueue.J(e);
|
|
@@ -402,7 +402,7 @@ function finalizePureQueue(e = null, t = false) {
|
|
|
402
402
|
r.clear();
|
|
403
403
|
schedule();
|
|
404
404
|
}
|
|
405
|
-
for (const t of
|
|
405
|
+
for (const t of A) {
|
|
406
406
|
const n = e ? t.ne === e : !t.ne;
|
|
407
407
|
if (!n) continue;
|
|
408
408
|
if (!t.R) {
|
|
@@ -413,8 +413,8 @@ function finalizePureQueue(e = null, t = false) {
|
|
|
413
413
|
t.T.clear();
|
|
414
414
|
t.M[0].length = 0;
|
|
415
415
|
t.M[1].length = 0;
|
|
416
|
-
|
|
417
|
-
|
|
416
|
+
A.delete(t);
|
|
417
|
+
C.delete(t.ae);
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
420
|
}
|
|
@@ -425,7 +425,7 @@ function checkBoundaryChildren(e) {
|
|
|
425
425
|
}
|
|
426
426
|
}
|
|
427
427
|
function trackOptimisticStore(e) {
|
|
428
|
-
|
|
428
|
+
k.G.add(e);
|
|
429
429
|
schedule();
|
|
430
430
|
}
|
|
431
431
|
function reassignPendingTransition(e) {
|
|
@@ -433,10 +433,10 @@ function reassignPendingTransition(e) {
|
|
|
433
433
|
e[t].ne = x;
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
-
const
|
|
436
|
+
const k = new GlobalQueue();
|
|
437
437
|
function flush() {
|
|
438
438
|
while (v) {
|
|
439
|
-
|
|
439
|
+
k.flush();
|
|
440
440
|
}
|
|
441
441
|
}
|
|
442
442
|
function runQueue(e, t) {
|
|
@@ -472,18 +472,18 @@ function runInTransition(e, t) {
|
|
|
472
472
|
x = n;
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
|
-
const
|
|
476
|
-
const
|
|
475
|
+
const C = new WeakMap();
|
|
476
|
+
const A = new Set();
|
|
477
477
|
function getOrCreateLane(e) {
|
|
478
|
-
let t =
|
|
478
|
+
let t = C.get(e);
|
|
479
479
|
if (t) {
|
|
480
480
|
return findLane(t);
|
|
481
481
|
}
|
|
482
482
|
const n = e.de;
|
|
483
483
|
const r = n?.re ? findLane(n.re) : null;
|
|
484
484
|
t = { ae: e, T: new Set(), M: [[], []], R: null, ne: x, pe: r };
|
|
485
|
-
|
|
486
|
-
|
|
485
|
+
C.set(e, t);
|
|
486
|
+
A.add(t);
|
|
487
487
|
e.he = e.ye || 0;
|
|
488
488
|
return t;
|
|
489
489
|
}
|
|
@@ -505,7 +505,7 @@ function resolveLane(e) {
|
|
|
505
505
|
const t = e.re;
|
|
506
506
|
if (!t) return undefined;
|
|
507
507
|
const n = findLane(t);
|
|
508
|
-
if (
|
|
508
|
+
if (A.has(n)) return n;
|
|
509
509
|
e.re = undefined;
|
|
510
510
|
return undefined;
|
|
511
511
|
}
|
|
@@ -521,7 +521,7 @@ function assignOrMergeLane(e, t) {
|
|
|
521
521
|
return;
|
|
522
522
|
}
|
|
523
523
|
const i = findLane(r);
|
|
524
|
-
if (
|
|
524
|
+
if (A.has(i)) {
|
|
525
525
|
if (i !== n && !hasActiveOverride(e)) {
|
|
526
526
|
if (n.pe && findLane(n.pe) === i) {
|
|
527
527
|
e.re = t;
|
|
@@ -545,14 +545,14 @@ function handleAsync(e, t, r) {
|
|
|
545
545
|
let u;
|
|
546
546
|
const handleError = n => {
|
|
547
547
|
if (e.we !== t) return;
|
|
548
|
-
|
|
548
|
+
k.initTransition(e.ne);
|
|
549
549
|
notifyStatus(e, n instanceof NotReadyError ? l : c, n);
|
|
550
550
|
e.$ = O;
|
|
551
551
|
};
|
|
552
552
|
const asyncWrite = (i, s) => {
|
|
553
553
|
if (e.we !== t) return;
|
|
554
554
|
if (e.m & (n | f)) return;
|
|
555
|
-
|
|
555
|
+
k.initTransition(e.ne);
|
|
556
556
|
clearStatus(e);
|
|
557
557
|
const o = resolveLane(e);
|
|
558
558
|
if (o) o.T.delete(e);
|
|
@@ -599,7 +599,7 @@ function handleAsync(e, t, r) {
|
|
|
599
599
|
);
|
|
600
600
|
r = false;
|
|
601
601
|
if (!n) {
|
|
602
|
-
|
|
602
|
+
k.initTransition(e.ne);
|
|
603
603
|
throw new NotReadyError(Q);
|
|
604
604
|
}
|
|
605
605
|
}
|
|
@@ -631,7 +631,7 @@ function handleAsync(e, t, r) {
|
|
|
631
631
|
};
|
|
632
632
|
const i = iterate();
|
|
633
633
|
if (!r && !i) {
|
|
634
|
-
|
|
634
|
+
k.initTransition(e.ne);
|
|
635
635
|
throw new NotReadyError(Q);
|
|
636
636
|
}
|
|
637
637
|
}
|
|
@@ -674,105 +674,83 @@ function notifyStatus(e, t, n, r, i) {
|
|
|
674
674
|
return;
|
|
675
675
|
}
|
|
676
676
|
for (let r = e.O; r !== null; r = r.P) {
|
|
677
|
-
r.
|
|
678
|
-
if (r.
|
|
679
|
-
!r.
|
|
680
|
-
notifyStatus(r.
|
|
677
|
+
r.k.$ = O;
|
|
678
|
+
if (r.k.Y !== n) {
|
|
679
|
+
!r.k.ne && k.D.push(r.k);
|
|
680
|
+
notifyStatus(r.k, t, n, f, d);
|
|
681
681
|
}
|
|
682
682
|
}
|
|
683
|
-
for (let r = e.
|
|
683
|
+
for (let r = e.C; r !== null; r = r.A) {
|
|
684
684
|
for (let e = r.O; e !== null; e = e.P) {
|
|
685
|
-
e.
|
|
686
|
-
if (e.
|
|
687
|
-
!e.
|
|
688
|
-
notifyStatus(e.
|
|
685
|
+
e.k.$ = O;
|
|
686
|
+
if (e.k.Y !== n) {
|
|
687
|
+
!e.k.ne && k.D.push(e.k);
|
|
688
|
+
notifyStatus(e.k, t, n, f, d);
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
691
|
}
|
|
692
692
|
}
|
|
693
|
-
function
|
|
694
|
-
|
|
695
|
-
const
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
o._e = (e, t) => {
|
|
710
|
-
const n = e !== undefined ? e : o.ce;
|
|
711
|
-
const r = t !== undefined ? t : o.Y;
|
|
712
|
-
if (n & c) {
|
|
713
|
-
let e = r;
|
|
714
|
-
o.oe.notify(o, l, 0);
|
|
715
|
-
if (o.ie === p) {
|
|
716
|
-
try {
|
|
717
|
-
return o.xe
|
|
718
|
-
? o.xe(e, () => {
|
|
719
|
-
o.ve?.();
|
|
720
|
-
o.ve = undefined;
|
|
721
|
-
})
|
|
722
|
-
: console.error(e);
|
|
723
|
-
} catch (t) {
|
|
724
|
-
e = t;
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
if (!o.oe.notify(o, c, c)) throw e;
|
|
728
|
-
} else if (o.ie === d) o.oe.notify(o, l | c, n, r);
|
|
729
|
-
};
|
|
730
|
-
recompute(o, true);
|
|
731
|
-
!i?.defer && (o.ie === p ? o.oe.enqueue(o.ie, runEffect.bind(o)) : runEffect.call(o));
|
|
732
|
-
s = true;
|
|
733
|
-
onCleanup(() => o.ve?.());
|
|
693
|
+
function unlinkSubs(e) {
|
|
694
|
+
const t = e.L;
|
|
695
|
+
const n = e.N;
|
|
696
|
+
const r = e.P;
|
|
697
|
+
const i = e.be;
|
|
698
|
+
if (r !== null) r.be = i;
|
|
699
|
+
else t.Oe = i;
|
|
700
|
+
if (i !== null) i.P = r;
|
|
701
|
+
else {
|
|
702
|
+
t.O = r;
|
|
703
|
+
if (r === null) {
|
|
704
|
+
t.xe?.();
|
|
705
|
+
t.H && !t.ve && !(t.m & o) && unobserved(t);
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
return n;
|
|
734
709
|
}
|
|
735
|
-
function
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
710
|
+
function unobserved(e) {
|
|
711
|
+
deleteFromHeap(e, e.m & o ? b : _);
|
|
712
|
+
let t = e.j;
|
|
713
|
+
while (t !== null) {
|
|
714
|
+
t = unlinkSubs(t);
|
|
715
|
+
}
|
|
716
|
+
e.j = null;
|
|
717
|
+
disposeChildren(e, true);
|
|
718
|
+
}
|
|
719
|
+
function link(e, t) {
|
|
720
|
+
const n = t.Pe;
|
|
721
|
+
if (n !== null && n.L === e) return;
|
|
722
|
+
let i = null;
|
|
723
|
+
const s = t.m & r;
|
|
724
|
+
if (s) {
|
|
725
|
+
i = n !== null ? n.N : t.j;
|
|
726
|
+
if (i !== null && i.L === e) {
|
|
727
|
+
t.Pe = i;
|
|
728
|
+
return;
|
|
729
|
+
}
|
|
746
730
|
}
|
|
731
|
+
const o = e.Oe;
|
|
732
|
+
if (o !== null && o.k === t && (!s || isValidLink(o, t))) return;
|
|
733
|
+
const u = (t.Pe = e.Oe = { L: e, k: t, N: i, be: o, P: null });
|
|
734
|
+
if (n !== null) n.N = u;
|
|
735
|
+
else t.j = u;
|
|
736
|
+
if (o !== null) o.P = u;
|
|
737
|
+
else e.O = u;
|
|
747
738
|
}
|
|
748
|
-
function
|
|
749
|
-
const
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
n.ve = staleValues(e) || undefined;
|
|
760
|
-
} finally {
|
|
761
|
-
}
|
|
762
|
-
},
|
|
763
|
-
undefined,
|
|
764
|
-
{ ...t, lazy: true, pureWrite: true }
|
|
765
|
-
);
|
|
766
|
-
n.ve = undefined;
|
|
767
|
-
n.se = true;
|
|
768
|
-
n.ie = h;
|
|
769
|
-
n.ue = run;
|
|
770
|
-
n.oe.enqueue(p, run);
|
|
771
|
-
onCleanup(() => n.ve?.());
|
|
739
|
+
function isValidLink(e, t) {
|
|
740
|
+
const n = t.Pe;
|
|
741
|
+
if (n !== null) {
|
|
742
|
+
let r = t.j;
|
|
743
|
+
do {
|
|
744
|
+
if (r === e) return true;
|
|
745
|
+
if (r === n) break;
|
|
746
|
+
r = r.N;
|
|
747
|
+
} while (r !== null);
|
|
748
|
+
}
|
|
749
|
+
return false;
|
|
772
750
|
}
|
|
773
751
|
const W = {};
|
|
774
752
|
function markDisposal(e) {
|
|
775
|
-
let t = e.
|
|
753
|
+
let t = e.ke;
|
|
776
754
|
while (t) {
|
|
777
755
|
t.m |= o;
|
|
778
756
|
if (t.m & i) {
|
|
@@ -780,7 +758,7 @@ function markDisposal(e) {
|
|
|
780
758
|
insertIntoHeap(t, b);
|
|
781
759
|
}
|
|
782
760
|
markDisposal(t);
|
|
783
|
-
t = t.
|
|
761
|
+
t = t.Ce;
|
|
784
762
|
}
|
|
785
763
|
}
|
|
786
764
|
function dispose(e) {
|
|
@@ -789,15 +767,15 @@ function dispose(e) {
|
|
|
789
767
|
t = unlinkSubs(t);
|
|
790
768
|
} while (t !== null);
|
|
791
769
|
e.j = null;
|
|
792
|
-
e.
|
|
770
|
+
e.Pe = null;
|
|
793
771
|
disposeChildren(e, true);
|
|
794
772
|
}
|
|
795
773
|
function disposeChildren(e, t = false, n) {
|
|
796
774
|
if (e.m & u) return;
|
|
797
775
|
if (t) e.m = u;
|
|
798
|
-
let r = n ? e.
|
|
776
|
+
let r = n ? e.Ae : e.ke;
|
|
799
777
|
while (r) {
|
|
800
|
-
const e = r.
|
|
778
|
+
const e = r.Ce;
|
|
801
779
|
if (r.j) {
|
|
802
780
|
const e = r;
|
|
803
781
|
deleteFromHeap(e, e.m & o ? b : _);
|
|
@@ -806,16 +784,16 @@ function disposeChildren(e, t = false, n) {
|
|
|
806
784
|
t = unlinkSubs(t);
|
|
807
785
|
} while (t !== null);
|
|
808
786
|
e.j = null;
|
|
809
|
-
e.
|
|
787
|
+
e.Pe = null;
|
|
810
788
|
}
|
|
811
789
|
disposeChildren(r, true);
|
|
812
790
|
r = e;
|
|
813
791
|
}
|
|
814
792
|
if (n) {
|
|
815
|
-
e.Ce = null;
|
|
816
|
-
} else {
|
|
817
|
-
e.Pe = null;
|
|
818
793
|
e.Ae = null;
|
|
794
|
+
} else {
|
|
795
|
+
e.ke = null;
|
|
796
|
+
e.Ce = null;
|
|
819
797
|
e.We = 0;
|
|
820
798
|
}
|
|
821
799
|
runDisposal(e, n);
|
|
@@ -833,12 +811,18 @@ function runDisposal(e, t) {
|
|
|
833
811
|
}
|
|
834
812
|
t ? (e.Ee = null) : (e.je = null);
|
|
835
813
|
}
|
|
836
|
-
function
|
|
837
|
-
let
|
|
838
|
-
while (
|
|
839
|
-
if (
|
|
814
|
+
function childId(e, t) {
|
|
815
|
+
let n = e;
|
|
816
|
+
while (n.Ne && n.i) n = n.i;
|
|
817
|
+
if (n.id != null) return formatId(n.id, t ? n.We++ : n.We);
|
|
840
818
|
throw new Error("Cannot get child id from owner without an id");
|
|
841
819
|
}
|
|
820
|
+
function getNextChildId(e) {
|
|
821
|
+
return childId(e, true);
|
|
822
|
+
}
|
|
823
|
+
function peekNextChildId(e) {
|
|
824
|
+
return childId(e, false);
|
|
825
|
+
}
|
|
842
826
|
function formatId(e, t) {
|
|
843
827
|
const n = t.toString(36),
|
|
844
828
|
r = n.length - 1;
|
|
@@ -866,26 +850,26 @@ function createOwner(e) {
|
|
|
866
850
|
Ne: n || undefined,
|
|
867
851
|
t: true,
|
|
868
852
|
u: t?.t ? t.u : t,
|
|
869
|
-
|
|
870
|
-
|
|
853
|
+
ke: null,
|
|
854
|
+
Ce: null,
|
|
871
855
|
je: null,
|
|
872
|
-
oe: t?.oe ??
|
|
856
|
+
oe: t?.oe ?? k,
|
|
873
857
|
Le: t?.Le || w,
|
|
874
858
|
We: 0,
|
|
875
859
|
Ee: null,
|
|
876
|
-
|
|
860
|
+
Ae: null,
|
|
877
861
|
i: t,
|
|
878
862
|
dispose(e = true) {
|
|
879
863
|
disposeChildren(r, e);
|
|
880
864
|
}
|
|
881
865
|
};
|
|
882
866
|
if (t) {
|
|
883
|
-
const e = t.
|
|
867
|
+
const e = t.ke;
|
|
884
868
|
if (e === null) {
|
|
885
|
-
t.
|
|
869
|
+
t.ke = r;
|
|
886
870
|
} else {
|
|
887
|
-
r.
|
|
888
|
-
t.
|
|
871
|
+
r.Ce = e;
|
|
872
|
+
t.ke = r;
|
|
889
873
|
}
|
|
890
874
|
}
|
|
891
875
|
return r;
|
|
@@ -894,63 +878,85 @@ function createRoot(e, t) {
|
|
|
894
878
|
const n = createOwner(t);
|
|
895
879
|
return runWithOwner(n, () => e(n.dispose));
|
|
896
880
|
}
|
|
897
|
-
function
|
|
898
|
-
|
|
899
|
-
const
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
881
|
+
function effect(e, t, n, r, i) {
|
|
882
|
+
let s = false;
|
|
883
|
+
const o = computed(i?.render ? t => staleValues(() => e(t)) : e, r, {
|
|
884
|
+
...i,
|
|
885
|
+
equals: () => {
|
|
886
|
+
o.se = !o.Y;
|
|
887
|
+
if (s) o.oe.enqueue(o.ie, runEffect.bind(o));
|
|
888
|
+
return false;
|
|
889
|
+
},
|
|
890
|
+
lazy: true
|
|
891
|
+
});
|
|
892
|
+
o.Ie = r;
|
|
893
|
+
o.He = t;
|
|
894
|
+
o.Qe = n;
|
|
895
|
+
o.Re = undefined;
|
|
896
|
+
o.ie = i?.render ? d : p;
|
|
897
|
+
o._e = (e, t) => {
|
|
898
|
+
const n = e !== undefined ? e : o.ce;
|
|
899
|
+
const r = t !== undefined ? t : o.Y;
|
|
900
|
+
if (n & c) {
|
|
901
|
+
let e = r;
|
|
902
|
+
o.oe.notify(o, l, 0);
|
|
903
|
+
if (o.ie === p) {
|
|
904
|
+
try {
|
|
905
|
+
return o.Qe
|
|
906
|
+
? o.Qe(e, () => {
|
|
907
|
+
o.Re?.();
|
|
908
|
+
o.Re = undefined;
|
|
909
|
+
})
|
|
910
|
+
: console.error(e);
|
|
911
|
+
} catch (t) {
|
|
912
|
+
e = t;
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
if (!o.oe.notify(o, c, c)) throw e;
|
|
916
|
+
} else if (o.ie === d) o.oe.notify(o, l | c, n, r);
|
|
917
|
+
};
|
|
918
|
+
recompute(o, true);
|
|
919
|
+
!i?.defer && (o.ie === p ? o.oe.enqueue(o.ie, runEffect.bind(o)) : runEffect.call(o));
|
|
920
|
+
s = true;
|
|
921
|
+
onCleanup(() => o.Re?.());
|
|
922
922
|
}
|
|
923
|
-
function
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
if (
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
923
|
+
function runEffect() {
|
|
924
|
+
if (!this.se || this.m & u) return;
|
|
925
|
+
this.Re?.();
|
|
926
|
+
this.Re = undefined;
|
|
927
|
+
try {
|
|
928
|
+
this.Re = this.He(this.le, this.Ie);
|
|
929
|
+
} catch (e) {
|
|
930
|
+
if (!this.oe.notify(this, c, c)) throw e;
|
|
931
|
+
} finally {
|
|
932
|
+
this.Ie = this.le;
|
|
933
|
+
this.se = false;
|
|
934
934
|
}
|
|
935
|
-
const o = e.He;
|
|
936
|
-
if (o !== null && o.A === t && (!s || isValidLink(o, t))) return;
|
|
937
|
-
const u = (t.ke = e.He = { L: e, A: t, N: i, Ie: o, P: null });
|
|
938
|
-
if (n !== null) n.N = u;
|
|
939
|
-
else t.j = u;
|
|
940
|
-
if (o !== null) o.P = u;
|
|
941
|
-
else e.O = u;
|
|
942
935
|
}
|
|
943
|
-
function
|
|
944
|
-
const
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
936
|
+
function trackedEffect(e, t) {
|
|
937
|
+
const run = () => {
|
|
938
|
+
if (!n.se || n.m & u) return;
|
|
939
|
+
n.se = false;
|
|
940
|
+
recompute(n);
|
|
941
|
+
};
|
|
942
|
+
const n = computed(
|
|
943
|
+
() => {
|
|
944
|
+
try {
|
|
945
|
+
n.Re?.();
|
|
946
|
+
n.Re = undefined;
|
|
947
|
+
n.Re = staleValues(e) || undefined;
|
|
948
|
+
} finally {
|
|
949
|
+
}
|
|
950
|
+
},
|
|
951
|
+
undefined,
|
|
952
|
+
{ ...t, lazy: true, pureWrite: true }
|
|
953
|
+
);
|
|
954
|
+
n.Re = undefined;
|
|
955
|
+
n.se = true;
|
|
956
|
+
n.ie = h;
|
|
957
|
+
n.ue = run;
|
|
958
|
+
n.oe.enqueue(p, run);
|
|
959
|
+
onCleanup(() => n.Re?.());
|
|
954
960
|
}
|
|
955
961
|
GlobalQueue.K = recompute;
|
|
956
962
|
GlobalQueue.U = disposeChildren;
|
|
@@ -965,15 +971,15 @@ let R = null;
|
|
|
965
971
|
function recompute(t, n = false) {
|
|
966
972
|
const i = t.ie;
|
|
967
973
|
if (!n) {
|
|
968
|
-
if (t.ne && (!i || x) && x !== t.ne)
|
|
974
|
+
if (t.ne && (!i || x) && x !== t.ne) k.initTransition(t.ne);
|
|
969
975
|
deleteFromHeap(t, t.m & o ? b : _);
|
|
970
976
|
if (t.ne || i === h) disposeChildren(t);
|
|
971
977
|
else {
|
|
972
978
|
markDisposal(t);
|
|
973
979
|
t.Ee = t.je;
|
|
974
|
-
t.
|
|
980
|
+
t.Ae = t.ke;
|
|
975
981
|
t.je = null;
|
|
976
|
-
t.
|
|
982
|
+
t.ke = null;
|
|
977
983
|
t.We = 0;
|
|
978
984
|
}
|
|
979
985
|
}
|
|
@@ -982,7 +988,7 @@ function recompute(t, n = false) {
|
|
|
982
988
|
const a = !!(t.ce & l);
|
|
983
989
|
const d = Q;
|
|
984
990
|
Q = t;
|
|
985
|
-
t.
|
|
991
|
+
t.Pe = null;
|
|
986
992
|
t.m = r;
|
|
987
993
|
t.$ = O;
|
|
988
994
|
let p = t.fe === y ? t.le : t.fe;
|
|
@@ -1024,7 +1030,7 @@ function recompute(t, n = false) {
|
|
|
1024
1030
|
Q = d;
|
|
1025
1031
|
}
|
|
1026
1032
|
if (!t.Y) {
|
|
1027
|
-
const e = t.
|
|
1033
|
+
const e = t.Pe;
|
|
1028
1034
|
let r = e !== null ? e.N : t.j;
|
|
1029
1035
|
if (r !== null) {
|
|
1030
1036
|
do {
|
|
@@ -1051,12 +1057,12 @@ function recompute(t, n = false) {
|
|
|
1051
1057
|
t.fe = p;
|
|
1052
1058
|
} else if (t.o != g) {
|
|
1053
1059
|
for (let e = t.O; e !== null; e = e.P) {
|
|
1054
|
-
insertIntoHeapHeight(e.
|
|
1060
|
+
insertIntoHeapHeight(e.k, e.k.m & o ? b : _);
|
|
1055
1061
|
}
|
|
1056
1062
|
}
|
|
1057
1063
|
}
|
|
1058
1064
|
R = S;
|
|
1059
|
-
(!n || t.ce & l) && !t.ne && !(x && t.ge) &&
|
|
1065
|
+
(!n || t.ce & l) && !t.ne && !(x && t.ge) && k.D.push(t);
|
|
1060
1066
|
t.ne && i && x !== t.ne && runInTransition(t.ne, () => recompute(t));
|
|
1061
1067
|
}
|
|
1062
1068
|
function updateIfNecessary(r) {
|
|
@@ -1084,42 +1090,42 @@ function computed(t, n, r) {
|
|
|
1084
1090
|
Ne: i || undefined,
|
|
1085
1091
|
Se: r?.equals != null ? r.equals : isEqual,
|
|
1086
1092
|
Te: !!r?.pureWrite,
|
|
1087
|
-
|
|
1093
|
+
xe: r?.unobserved,
|
|
1088
1094
|
je: null,
|
|
1089
|
-
oe: Q?.oe ??
|
|
1095
|
+
oe: Q?.oe ?? k,
|
|
1090
1096
|
Le: Q?.Le ?? w,
|
|
1091
1097
|
We: 0,
|
|
1092
1098
|
H: t,
|
|
1093
1099
|
le: n,
|
|
1094
1100
|
o: 0,
|
|
1095
|
-
|
|
1101
|
+
C: null,
|
|
1096
1102
|
h: undefined,
|
|
1097
1103
|
p: null,
|
|
1098
1104
|
j: null,
|
|
1099
|
-
|
|
1105
|
+
Pe: null,
|
|
1100
1106
|
O: null,
|
|
1101
|
-
|
|
1107
|
+
Oe: null,
|
|
1102
1108
|
i: Q,
|
|
1103
|
-
|
|
1104
|
-
|
|
1109
|
+
Ce: null,
|
|
1110
|
+
ke: null,
|
|
1105
1111
|
m: e,
|
|
1106
1112
|
ce: a,
|
|
1107
1113
|
$: O,
|
|
1108
1114
|
fe: y,
|
|
1109
1115
|
Ee: null,
|
|
1110
|
-
|
|
1116
|
+
Ae: null,
|
|
1111
1117
|
we: null,
|
|
1112
1118
|
ne: null
|
|
1113
1119
|
};
|
|
1114
1120
|
s.p = s;
|
|
1115
1121
|
const o = Q?.t ? Q.u : Q;
|
|
1116
1122
|
if (Q) {
|
|
1117
|
-
const e = Q.
|
|
1123
|
+
const e = Q.ke;
|
|
1118
1124
|
if (e === null) {
|
|
1119
|
-
Q.
|
|
1125
|
+
Q.ke = s;
|
|
1120
1126
|
} else {
|
|
1121
|
-
s.
|
|
1122
|
-
Q.
|
|
1127
|
+
s.Ce = e;
|
|
1128
|
+
Q.ke = s;
|
|
1123
1129
|
}
|
|
1124
1130
|
}
|
|
1125
1131
|
if (o) s.o = o.o + 1;
|
|
@@ -1130,16 +1136,16 @@ function signal(e, t, n = null) {
|
|
|
1130
1136
|
const r = {
|
|
1131
1137
|
Se: t?.equals != null ? t.equals : isEqual,
|
|
1132
1138
|
Te: !!t?.pureWrite,
|
|
1133
|
-
|
|
1139
|
+
xe: t?.unobserved,
|
|
1134
1140
|
le: e,
|
|
1135
1141
|
O: null,
|
|
1136
|
-
|
|
1142
|
+
Oe: null,
|
|
1137
1143
|
$: O,
|
|
1138
1144
|
I: n,
|
|
1139
|
-
|
|
1145
|
+
A: n?.C || null,
|
|
1140
1146
|
fe: y
|
|
1141
1147
|
};
|
|
1142
|
-
n && (n.
|
|
1148
|
+
n && (n.C = r);
|
|
1143
1149
|
return r;
|
|
1144
1150
|
}
|
|
1145
1151
|
function optimisticSignal(e, t) {
|
|
@@ -1235,7 +1241,7 @@ function read(e) {
|
|
|
1235
1241
|
return !t || R !== null || e.fe === y || (j && e.ne && x !== e.ne) ? e.le : e.fe;
|
|
1236
1242
|
}
|
|
1237
1243
|
function setSignal(e, t) {
|
|
1238
|
-
if (e.ne && x !== e.ne)
|
|
1244
|
+
if (e.ne && x !== e.ne) k.initTransition(e.ne);
|
|
1239
1245
|
const n = e.ge && !P;
|
|
1240
1246
|
const r = n ? e.le : e.fe === y ? e.le : e.fe;
|
|
1241
1247
|
if (typeof t === "function") t = t(r);
|
|
@@ -1248,22 +1254,22 @@ function setSignal(e, t) {
|
|
|
1248
1254
|
return t;
|
|
1249
1255
|
}
|
|
1250
1256
|
if (n) {
|
|
1251
|
-
const n =
|
|
1257
|
+
const n = k.B.includes(e);
|
|
1252
1258
|
if (e.ne && n) {
|
|
1253
|
-
|
|
1259
|
+
k.initTransition(e.ne);
|
|
1254
1260
|
}
|
|
1255
1261
|
if (e.fe === y) {
|
|
1256
1262
|
e.fe = e.le;
|
|
1257
1263
|
}
|
|
1258
1264
|
if (!n) {
|
|
1259
|
-
|
|
1265
|
+
k.B.push(e);
|
|
1260
1266
|
}
|
|
1261
1267
|
e.ye = (e.ye || 0) + 1;
|
|
1262
1268
|
const r = getOrCreateLane(e);
|
|
1263
1269
|
e.re = r;
|
|
1264
1270
|
e.le = t;
|
|
1265
1271
|
} else {
|
|
1266
|
-
if (e.fe === y)
|
|
1272
|
+
if (e.fe === y) k.D.push(e);
|
|
1267
1273
|
e.fe = t;
|
|
1268
1274
|
}
|
|
1269
1275
|
updatePendingSignal(e);
|
|
@@ -1323,7 +1329,7 @@ function updatePendingSignal(e) {
|
|
|
1323
1329
|
mergeLanes(t, e);
|
|
1324
1330
|
}
|
|
1325
1331
|
}
|
|
1326
|
-
|
|
1332
|
+
C.delete(n);
|
|
1327
1333
|
n.re = undefined;
|
|
1328
1334
|
}
|
|
1329
1335
|
}
|
|
@@ -1422,7 +1428,7 @@ function isUndefined(e) {
|
|
|
1422
1428
|
return typeof e === "undefined";
|
|
1423
1429
|
}
|
|
1424
1430
|
function restoreTransition(e, t) {
|
|
1425
|
-
|
|
1431
|
+
k.initTransition(e);
|
|
1426
1432
|
const n = t();
|
|
1427
1433
|
flush();
|
|
1428
1434
|
return n;
|
|
@@ -1431,7 +1437,7 @@ function action(e) {
|
|
|
1431
1437
|
return (...t) =>
|
|
1432
1438
|
new Promise((n, r) => {
|
|
1433
1439
|
const i = e(...t);
|
|
1434
|
-
|
|
1440
|
+
k.initTransition();
|
|
1435
1441
|
let s = x;
|
|
1436
1442
|
s.ee.push(i);
|
|
1437
1443
|
const done = (e, t) => {
|
|
@@ -1528,7 +1534,7 @@ function createOptimistic(e, t, n) {
|
|
|
1528
1534
|
function onSettled(e) {
|
|
1529
1535
|
getOwner()
|
|
1530
1536
|
? createTrackedEffect(() => untrack(e))
|
|
1531
|
-
:
|
|
1537
|
+
: k.enqueue(p, () => {
|
|
1532
1538
|
const t = e();
|
|
1533
1539
|
t?.();
|
|
1534
1540
|
});
|
|
@@ -1698,7 +1704,7 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
1698
1704
|
i !== r && i !== undefined && reconcile(i, n?.key || "id", n?.all)(s);
|
|
1699
1705
|
});
|
|
1700
1706
|
});
|
|
1701
|
-
r.
|
|
1707
|
+
r.ve = true;
|
|
1702
1708
|
return { store: s, node: r };
|
|
1703
1709
|
}
|
|
1704
1710
|
function createProjection(e, t = {}, n) {
|
|
@@ -1877,7 +1883,7 @@ const re = {
|
|
|
1877
1883
|
if (e[$]) {
|
|
1878
1884
|
const t = e[Z];
|
|
1879
1885
|
if (t?.ne) {
|
|
1880
|
-
|
|
1886
|
+
k.initTransition(t.ne);
|
|
1881
1887
|
}
|
|
1882
1888
|
}
|
|
1883
1889
|
untrack(() => {
|
|
@@ -2126,7 +2132,7 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2126
2132
|
setProjectionWriteActive(false);
|
|
2127
2133
|
}
|
|
2128
2134
|
});
|
|
2129
|
-
r.
|
|
2135
|
+
r.ve = true;
|
|
2130
2136
|
}
|
|
2131
2137
|
return { store: s, node: r };
|
|
2132
2138
|
}
|
|
@@ -2516,7 +2522,7 @@ function boundaryComputed(e, t) {
|
|
|
2516
2522
|
n.oe.notify(n, n.et, r, i);
|
|
2517
2523
|
};
|
|
2518
2524
|
n.et = t;
|
|
2519
|
-
n.
|
|
2525
|
+
n.ve = true;
|
|
2520
2526
|
recompute(n, true);
|
|
2521
2527
|
return n;
|
|
2522
2528
|
}
|
|
@@ -2679,6 +2685,7 @@ exports.merge = merge;
|
|
|
2679
2685
|
exports.omit = omit;
|
|
2680
2686
|
exports.onCleanup = onCleanup;
|
|
2681
2687
|
exports.onSettled = onSettled;
|
|
2688
|
+
exports.peekNextChildId = peekNextChildId;
|
|
2682
2689
|
exports.pending = pending;
|
|
2683
2690
|
exports.reconcile = reconcile;
|
|
2684
2691
|
exports.refresh = refresh;
|