@solidjs/signals 0.13.1 → 0.13.3
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 -3
- package/dist/node.cjs +147 -144
- package/dist/prod.js +147 -144
- package/dist/types/core/types.d.ts +3 -0
- package/package.json +1 -1
package/dist/dev.js
CHANGED
|
@@ -1021,6 +1021,8 @@ function runEffect() {
|
|
|
1021
1021
|
try {
|
|
1022
1022
|
this._cleanup = this._effectFn(this._value, this._prevValue);
|
|
1023
1023
|
} catch (error) {
|
|
1024
|
+
this._error = new StatusError(this, error);
|
|
1025
|
+
this._statusFlags |= STATUS_ERROR;
|
|
1024
1026
|
if (!this._queue.notify(this, STATUS_ERROR, STATUS_ERROR)) throw error;
|
|
1025
1027
|
} finally {
|
|
1026
1028
|
setStrictRead(prevStrictRead);
|
|
@@ -1355,6 +1357,7 @@ function signal(v, options, firewall = null) {
|
|
|
1355
1357
|
const s = {
|
|
1356
1358
|
_equals: options?.equals != null ? options.equals : isEqual,
|
|
1357
1359
|
_pureWrite: !!options?.pureWrite,
|
|
1360
|
+
_noSnapshot: !!options?._noSnapshot,
|
|
1358
1361
|
_unobserved: options?.unobserved,
|
|
1359
1362
|
_value: v,
|
|
1360
1363
|
_subs: null,
|
|
@@ -1366,7 +1369,11 @@ function signal(v, options, firewall = null) {
|
|
|
1366
1369
|
};
|
|
1367
1370
|
s._name = options?.name ?? "signal";
|
|
1368
1371
|
firewall && (firewall._child = s);
|
|
1369
|
-
if (
|
|
1372
|
+
if (
|
|
1373
|
+
snapshotCaptureActive &&
|
|
1374
|
+
!s._noSnapshot &&
|
|
1375
|
+
!((firewall?._statusFlags ?? 0) & STATUS_PENDING)
|
|
1376
|
+
) {
|
|
1370
1377
|
s._snapshotValue = v === undefined ? NO_SNAPSHOT : v;
|
|
1371
1378
|
snapshotSources.add(s);
|
|
1372
1379
|
}
|
|
@@ -1519,7 +1526,7 @@ function read(el) {
|
|
|
1519
1526
|
(currentOptimisticLane !== null &&
|
|
1520
1527
|
(el._overrideValue !== undefined ||
|
|
1521
1528
|
el._optimisticLane ||
|
|
1522
|
-
owner === el ||
|
|
1529
|
+
(owner === el && stale) ||
|
|
1523
1530
|
!!(owner._statusFlags & STATUS_PENDING))) ||
|
|
1524
1531
|
el._pendingValue === NOT_PENDING ||
|
|
1525
1532
|
(stale && el._transition && activeTransition !== el._transition)
|
|
@@ -3016,7 +3023,7 @@ const ON_INIT = Symbol();
|
|
|
3016
3023
|
class CollectionQueue extends Queue {
|
|
3017
3024
|
_collectionType;
|
|
3018
3025
|
_sources = new Set();
|
|
3019
|
-
_disabled = signal(false, { pureWrite: true });
|
|
3026
|
+
_disabled = signal(false, { pureWrite: true, _noSnapshot: true });
|
|
3020
3027
|
_initialized = false;
|
|
3021
3028
|
_onFn;
|
|
3022
3029
|
_prevOn = ON_INIT;
|
package/dist/node.cjs
CHANGED
|
@@ -955,6 +955,8 @@ function runEffect() {
|
|
|
955
955
|
try {
|
|
956
956
|
this.Te = this.Re(this.ae, this.He);
|
|
957
957
|
} catch (e) {
|
|
958
|
+
this.Y = new StatusError(this, e);
|
|
959
|
+
this.de |= d;
|
|
958
960
|
if (!this.fe.notify(this, d, d)) throw e;
|
|
959
961
|
} finally {
|
|
960
962
|
this.He = this.ae;
|
|
@@ -1256,6 +1258,7 @@ function signal(e, t, n = null) {
|
|
|
1256
1258
|
const r = {
|
|
1257
1259
|
me: t?.equals != null ? t.equals : isEqual,
|
|
1258
1260
|
Fe: !!t?.pureWrite,
|
|
1261
|
+
Me: !!t?.Me,
|
|
1259
1262
|
Pe: t?.unobserved,
|
|
1260
1263
|
ae: e,
|
|
1261
1264
|
O: null,
|
|
@@ -1266,7 +1269,7 @@ function signal(e, t, n = null) {
|
|
|
1266
1269
|
ce: S
|
|
1267
1270
|
};
|
|
1268
1271
|
n && (n.C = r);
|
|
1269
|
-
if (D && !r.
|
|
1272
|
+
if (D && !r.Me && !((n?.de ?? 0) & a)) {
|
|
1270
1273
|
r.ie = e === undefined ? w : e;
|
|
1271
1274
|
B.add(r);
|
|
1272
1275
|
}
|
|
@@ -1392,7 +1395,7 @@ function read(e) {
|
|
|
1392
1395
|
}
|
|
1393
1396
|
if (e.pe !== undefined && e.pe !== S) return e.pe;
|
|
1394
1397
|
return !t ||
|
|
1395
|
-
(V !== null && (e.pe !== undefined || e.re || n === e || !!(n.de & a))) ||
|
|
1398
|
+
(V !== null && (e.pe !== undefined || e.re || (n === e && R) || !!(n.de & a))) ||
|
|
1396
1399
|
e.ce === S ||
|
|
1397
1400
|
(R && e.ne && C !== e.ne)
|
|
1398
1401
|
? e.ae
|
|
@@ -1449,14 +1452,14 @@ function runWithOwner(e, t) {
|
|
|
1449
1452
|
}
|
|
1450
1453
|
}
|
|
1451
1454
|
function getPendingSignal(e) {
|
|
1452
|
-
if (!e.
|
|
1453
|
-
e.
|
|
1455
|
+
if (!e.Ve) {
|
|
1456
|
+
e.Ve = optimisticSignal(false, { pureWrite: true });
|
|
1454
1457
|
if (e.ye) {
|
|
1455
|
-
e.
|
|
1458
|
+
e.Ve.ye = e;
|
|
1456
1459
|
}
|
|
1457
|
-
if (computePendingState(e)) setSignal(e.
|
|
1460
|
+
if (computePendingState(e)) setSignal(e.Ve, true);
|
|
1458
1461
|
}
|
|
1459
|
-
return e.
|
|
1462
|
+
return e.Ve;
|
|
1460
1463
|
}
|
|
1461
1464
|
function computePendingState(e) {
|
|
1462
1465
|
const t = e;
|
|
@@ -1472,9 +1475,9 @@ function computePendingState(e) {
|
|
|
1472
1475
|
return !!(t.de & a && !(t.de & p));
|
|
1473
1476
|
}
|
|
1474
1477
|
function updatePendingSignal(e) {
|
|
1475
|
-
if (e.
|
|
1478
|
+
if (e.Ve) {
|
|
1476
1479
|
const t = computePendingState(e);
|
|
1477
|
-
const n = e.
|
|
1480
|
+
const n = e.Ve;
|
|
1478
1481
|
setSignal(n, t);
|
|
1479
1482
|
if (!t && n.re) {
|
|
1480
1483
|
const t = resolveLane(e);
|
|
@@ -2504,65 +2507,65 @@ function mapArray(e, t, n) {
|
|
|
2504
2507
|
const s = t;
|
|
2505
2508
|
return createMemo(
|
|
2506
2509
|
updateKeyedMap.bind({
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
ze: [],
|
|
2510
|
+
De: createOwner(),
|
|
2511
|
+
Be: 0,
|
|
2512
|
+
Ge: e,
|
|
2513
|
+
Ke: [],
|
|
2514
|
+
ze: s,
|
|
2513
2515
|
Ue: [],
|
|
2514
|
-
Je:
|
|
2515
|
-
Xe: r
|
|
2516
|
-
Ye:
|
|
2517
|
-
Ze:
|
|
2516
|
+
Je: [],
|
|
2517
|
+
Xe: r,
|
|
2518
|
+
Ye: r || n?.keyed === false ? [] : undefined,
|
|
2519
|
+
Ze: i ? [] : undefined,
|
|
2520
|
+
$e: n?.fallback
|
|
2518
2521
|
})
|
|
2519
2522
|
);
|
|
2520
2523
|
}
|
|
2521
2524
|
const pe = { pureWrite: true };
|
|
2522
2525
|
function updateKeyedMap() {
|
|
2523
|
-
const e = this.
|
|
2526
|
+
const e = this.Ge() || [],
|
|
2524
2527
|
t = e.length;
|
|
2525
2528
|
e[K];
|
|
2526
|
-
runWithOwner(this.
|
|
2529
|
+
runWithOwner(this.De, () => {
|
|
2527
2530
|
let n,
|
|
2528
2531
|
r,
|
|
2529
|
-
i = this.
|
|
2532
|
+
i = this.Ye
|
|
2530
2533
|
? () => {
|
|
2531
|
-
this.
|
|
2532
|
-
this.
|
|
2533
|
-
return this.
|
|
2534
|
+
this.Ye[r] = signal(e[r], pe);
|
|
2535
|
+
this.Ze && (this.Ze[r] = signal(r, pe));
|
|
2536
|
+
return this.ze(accessor(this.Ye[r]), this.Ze ? accessor(this.Ze[r]) : undefined);
|
|
2534
2537
|
}
|
|
2535
|
-
: this.
|
|
2538
|
+
: this.Ze
|
|
2536
2539
|
? () => {
|
|
2537
2540
|
const t = e[r];
|
|
2538
|
-
this.
|
|
2539
|
-
return this.
|
|
2541
|
+
this.Ze[r] = signal(r, pe);
|
|
2542
|
+
return this.ze(() => t, accessor(this.Ze[r]));
|
|
2540
2543
|
}
|
|
2541
2544
|
: () => {
|
|
2542
2545
|
const t = e[r];
|
|
2543
|
-
return this.
|
|
2546
|
+
return this.ze(() => t);
|
|
2544
2547
|
};
|
|
2545
2548
|
if (t === 0) {
|
|
2546
|
-
if (this.
|
|
2547
|
-
this.
|
|
2549
|
+
if (this.Be !== 0) {
|
|
2550
|
+
this.De.dispose(false);
|
|
2551
|
+
this.Je = [];
|
|
2552
|
+
this.Ke = [];
|
|
2548
2553
|
this.Ue = [];
|
|
2549
|
-
this.
|
|
2550
|
-
this.ze = [];
|
|
2551
|
-
this.De = 0;
|
|
2552
|
-
this.Xe && (this.Xe = []);
|
|
2554
|
+
this.Be = 0;
|
|
2553
2555
|
this.Ye && (this.Ye = []);
|
|
2556
|
+
this.Ze && (this.Ze = []);
|
|
2554
2557
|
}
|
|
2555
|
-
if (this
|
|
2556
|
-
this.
|
|
2558
|
+
if (this.$e && !this.Ue[0]) {
|
|
2559
|
+
this.Ue[0] = runWithOwner((this.Je[0] = createOwner()), this.$e);
|
|
2557
2560
|
}
|
|
2558
|
-
} else if (this.
|
|
2559
|
-
if (this.
|
|
2560
|
-
this.
|
|
2561
|
+
} else if (this.Be === 0) {
|
|
2562
|
+
if (this.Je[0]) this.Je[0].dispose();
|
|
2563
|
+
this.Ue = new Array(t);
|
|
2561
2564
|
for (r = 0; r < t; r++) {
|
|
2562
|
-
this.
|
|
2563
|
-
this.
|
|
2565
|
+
this.Ke[r] = e[r];
|
|
2566
|
+
this.Ue[r] = runWithOwner((this.Je[r] = createOwner()), i);
|
|
2564
2567
|
}
|
|
2565
|
-
this.
|
|
2568
|
+
this.Be = t;
|
|
2566
2569
|
} else {
|
|
2567
2570
|
let s,
|
|
2568
2571
|
o,
|
|
@@ -2573,131 +2576,131 @@ function updateKeyedMap() {
|
|
|
2573
2576
|
a,
|
|
2574
2577
|
d = new Array(t),
|
|
2575
2578
|
p = new Array(t),
|
|
2576
|
-
h = this.
|
|
2577
|
-
y = this.
|
|
2579
|
+
h = this.Ye ? new Array(t) : undefined,
|
|
2580
|
+
y = this.Ze ? new Array(t) : undefined;
|
|
2578
2581
|
for (
|
|
2579
|
-
s = 0, o = Math.min(this.
|
|
2580
|
-
s < o && (this.
|
|
2582
|
+
s = 0, o = Math.min(this.Be, t);
|
|
2583
|
+
s < o && (this.Ke[s] === e[s] || (this.Ye && compare(this.Xe, this.Ke[s], e[s])));
|
|
2581
2584
|
s++
|
|
2582
2585
|
) {
|
|
2583
|
-
if (this.
|
|
2586
|
+
if (this.Ye) setSignal(this.Ye[s], e[s]);
|
|
2584
2587
|
}
|
|
2585
2588
|
for (
|
|
2586
|
-
o = this.
|
|
2589
|
+
o = this.Be - 1, u = t - 1;
|
|
2587
2590
|
o >= s &&
|
|
2588
2591
|
u >= s &&
|
|
2589
|
-
(this.
|
|
2592
|
+
(this.Ke[o] === e[u] || (this.Ye && compare(this.Xe, this.Ke[o], e[u])));
|
|
2590
2593
|
o--, u--
|
|
2591
2594
|
) {
|
|
2592
|
-
d[u] = this.
|
|
2593
|
-
p[u] = this.
|
|
2594
|
-
h && (h[u] = this.
|
|
2595
|
-
y && (y[u] = this.
|
|
2595
|
+
d[u] = this.Ue[o];
|
|
2596
|
+
p[u] = this.Je[o];
|
|
2597
|
+
h && (h[u] = this.Ye[o]);
|
|
2598
|
+
y && (y[u] = this.Ze[o]);
|
|
2596
2599
|
}
|
|
2597
2600
|
c = new Map();
|
|
2598
2601
|
a = new Array(u + 1);
|
|
2599
2602
|
for (r = u; r >= s; r--) {
|
|
2600
2603
|
f = e[r];
|
|
2601
|
-
l = this.
|
|
2604
|
+
l = this.Xe ? this.Xe(f) : f;
|
|
2602
2605
|
n = c.get(l);
|
|
2603
2606
|
a[r] = n === undefined ? -1 : n;
|
|
2604
2607
|
c.set(l, r);
|
|
2605
2608
|
}
|
|
2606
2609
|
for (n = s; n <= o; n++) {
|
|
2607
|
-
f = this.
|
|
2608
|
-
l = this.
|
|
2610
|
+
f = this.Ke[n];
|
|
2611
|
+
l = this.Xe ? this.Xe(f) : f;
|
|
2609
2612
|
r = c.get(l);
|
|
2610
2613
|
if (r !== undefined && r !== -1) {
|
|
2611
|
-
d[r] = this.
|
|
2612
|
-
p[r] = this.
|
|
2613
|
-
h && (h[r] = this.
|
|
2614
|
-
y && (y[r] = this.
|
|
2614
|
+
d[r] = this.Ue[n];
|
|
2615
|
+
p[r] = this.Je[n];
|
|
2616
|
+
h && (h[r] = this.Ye[n]);
|
|
2617
|
+
y && (y[r] = this.Ze[n]);
|
|
2615
2618
|
r = a[r];
|
|
2616
2619
|
c.set(l, r);
|
|
2617
|
-
} else this.
|
|
2620
|
+
} else this.Je[n].dispose();
|
|
2618
2621
|
}
|
|
2619
2622
|
for (r = s; r < t; r++) {
|
|
2620
2623
|
if (r in d) {
|
|
2621
|
-
this.
|
|
2622
|
-
this.
|
|
2624
|
+
this.Ue[r] = d[r];
|
|
2625
|
+
this.Je[r] = p[r];
|
|
2623
2626
|
if (h) {
|
|
2624
|
-
this.
|
|
2625
|
-
setSignal(this.
|
|
2627
|
+
this.Ye[r] = h[r];
|
|
2628
|
+
setSignal(this.Ye[r], e[r]);
|
|
2626
2629
|
}
|
|
2627
2630
|
if (y) {
|
|
2628
|
-
this.
|
|
2629
|
-
setSignal(this.
|
|
2631
|
+
this.Ze[r] = y[r];
|
|
2632
|
+
setSignal(this.Ze[r], r);
|
|
2630
2633
|
}
|
|
2631
2634
|
} else {
|
|
2632
|
-
this.
|
|
2635
|
+
this.Ue[r] = runWithOwner((this.Je[r] = createOwner()), i);
|
|
2633
2636
|
}
|
|
2634
2637
|
}
|
|
2635
|
-
this.
|
|
2636
|
-
this.
|
|
2638
|
+
this.Ue = this.Ue.slice(0, (this.Be = t));
|
|
2639
|
+
this.Ke = e.slice(0);
|
|
2637
2640
|
}
|
|
2638
2641
|
});
|
|
2639
|
-
return this.
|
|
2642
|
+
return this.Ue;
|
|
2640
2643
|
}
|
|
2641
2644
|
function repeat(e, t, n) {
|
|
2642
2645
|
const r = t;
|
|
2643
2646
|
return updateRepeat.bind({
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2647
|
+
De: createOwner(),
|
|
2648
|
+
Be: 0,
|
|
2649
|
+
et: 0,
|
|
2650
|
+
tt: e,
|
|
2651
|
+
ze: r,
|
|
2652
|
+
Je: [],
|
|
2649
2653
|
Ue: [],
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
Ze: n?.fallback
|
|
2654
|
+
nt: n?.from,
|
|
2655
|
+
$e: n?.fallback
|
|
2653
2656
|
});
|
|
2654
2657
|
}
|
|
2655
2658
|
function updateRepeat() {
|
|
2656
|
-
const e = this.
|
|
2657
|
-
const t = this.
|
|
2658
|
-
runWithOwner(this.
|
|
2659
|
+
const e = this.tt();
|
|
2660
|
+
const t = this.nt?.() || 0;
|
|
2661
|
+
runWithOwner(this.De, () => {
|
|
2659
2662
|
if (e === 0) {
|
|
2660
|
-
if (this.
|
|
2661
|
-
this.
|
|
2663
|
+
if (this.Be !== 0) {
|
|
2664
|
+
this.De.dispose(false);
|
|
2665
|
+
this.Je = [];
|
|
2662
2666
|
this.Ue = [];
|
|
2663
|
-
this.
|
|
2664
|
-
this.De = 0;
|
|
2667
|
+
this.Be = 0;
|
|
2665
2668
|
}
|
|
2666
|
-
if (this
|
|
2667
|
-
this.
|
|
2669
|
+
if (this.$e && !this.Ue[0]) {
|
|
2670
|
+
this.Ue[0] = runWithOwner((this.Je[0] = createOwner()), this.$e);
|
|
2668
2671
|
}
|
|
2669
2672
|
return;
|
|
2670
2673
|
}
|
|
2671
2674
|
const n = t + e;
|
|
2672
|
-
const r = this
|
|
2673
|
-
if (this.
|
|
2674
|
-
for (let e = n; e < r; e++) this.
|
|
2675
|
-
if (this
|
|
2676
|
-
let e = this
|
|
2677
|
-
while (e < t && e < this.
|
|
2678
|
-
this.
|
|
2679
|
-
this.
|
|
2680
|
-
} else if (this
|
|
2681
|
-
let n = r - this
|
|
2682
|
-
let i = this
|
|
2683
|
-
this.
|
|
2675
|
+
const r = this.et + this.Be;
|
|
2676
|
+
if (this.Be === 0 && this.Je[0]) this.Je[0].dispose();
|
|
2677
|
+
for (let e = n; e < r; e++) this.Je[e - this.et].dispose();
|
|
2678
|
+
if (this.et < t) {
|
|
2679
|
+
let e = this.et;
|
|
2680
|
+
while (e < t && e < this.Be) this.Je[e++].dispose();
|
|
2681
|
+
this.Je.splice(0, t - this.et);
|
|
2682
|
+
this.Ue.splice(0, t - this.et);
|
|
2683
|
+
} else if (this.et > t) {
|
|
2684
|
+
let n = r - this.et - 1;
|
|
2685
|
+
let i = this.et - t;
|
|
2686
|
+
this.Je.length = this.Ue.length = e;
|
|
2684
2687
|
while (n >= i) {
|
|
2688
|
+
this.Je[n] = this.Je[n - i];
|
|
2685
2689
|
this.Ue[n] = this.Ue[n - i];
|
|
2686
|
-
this.ze[n] = this.ze[n - i];
|
|
2687
2690
|
n--;
|
|
2688
2691
|
}
|
|
2689
2692
|
for (let e = 0; e < i; e++) {
|
|
2690
|
-
this.
|
|
2693
|
+
this.Ue[e] = runWithOwner((this.Je[e] = createOwner()), () => this.ze(e + t));
|
|
2691
2694
|
}
|
|
2692
2695
|
}
|
|
2693
2696
|
for (let e = r; e < n; e++) {
|
|
2694
|
-
this.
|
|
2697
|
+
this.Ue[e - t] = runWithOwner((this.Je[e - t] = createOwner()), () => this.ze(e));
|
|
2695
2698
|
}
|
|
2696
|
-
this.
|
|
2697
|
-
this
|
|
2698
|
-
this.
|
|
2699
|
+
this.Ue = this.Ue.slice(0, e);
|
|
2700
|
+
this.et = t;
|
|
2701
|
+
this.Be = e;
|
|
2699
2702
|
});
|
|
2700
|
-
return this.
|
|
2703
|
+
return this.Ue;
|
|
2701
2704
|
}
|
|
2702
2705
|
function compare(e, t, n) {
|
|
2703
2706
|
return e ? e(t) === e(n) : true;
|
|
@@ -2707,10 +2710,10 @@ function boundaryComputed(e, t) {
|
|
|
2707
2710
|
n._e = (e, t) => {
|
|
2708
2711
|
const r = e !== undefined ? e : n.de;
|
|
2709
2712
|
const i = t !== undefined ? t : n.Y;
|
|
2710
|
-
n.de &= ~n.
|
|
2711
|
-
n.fe.notify(n, n.
|
|
2713
|
+
n.de &= ~n.rt;
|
|
2714
|
+
n.fe.notify(n, n.rt, r, i);
|
|
2712
2715
|
};
|
|
2713
|
-
n.
|
|
2716
|
+
n.rt = t;
|
|
2714
2717
|
n.ve = true;
|
|
2715
2718
|
recompute(n, true);
|
|
2716
2719
|
return n;
|
|
@@ -2726,57 +2729,57 @@ function createBoundChildren(e, t, n, r) {
|
|
|
2726
2729
|
}
|
|
2727
2730
|
const he = Symbol();
|
|
2728
2731
|
class CollectionQueue extends Queue {
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2732
|
+
it;
|
|
2733
|
+
st = new Set();
|
|
2734
|
+
ot = signal(false, { pureWrite: true, Me: true });
|
|
2735
|
+
ut = false;
|
|
2736
|
+
ft;
|
|
2737
|
+
lt = he;
|
|
2735
2738
|
constructor(e) {
|
|
2736
2739
|
super();
|
|
2737
|
-
this.
|
|
2740
|
+
this.it = e;
|
|
2738
2741
|
}
|
|
2739
2742
|
run(e) {
|
|
2740
|
-
if (!e || read(this.
|
|
2743
|
+
if (!e || read(this.ot)) return;
|
|
2741
2744
|
return super.run(e);
|
|
2742
2745
|
}
|
|
2743
2746
|
notify(e, t, n, r) {
|
|
2744
|
-
if (!(t & this.
|
|
2745
|
-
if (this.
|
|
2747
|
+
if (!(t & this.it)) return super.notify(e, t, n, r);
|
|
2748
|
+
if (this.ut && this.ft) {
|
|
2746
2749
|
const e = untrack(() => {
|
|
2747
2750
|
try {
|
|
2748
|
-
return this.
|
|
2751
|
+
return this.ft();
|
|
2749
2752
|
} catch {
|
|
2750
2753
|
return he;
|
|
2751
2754
|
}
|
|
2752
2755
|
});
|
|
2753
|
-
if (e !== this.
|
|
2754
|
-
this.
|
|
2755
|
-
this.
|
|
2756
|
-
this.
|
|
2756
|
+
if (e !== this.lt) {
|
|
2757
|
+
this.lt = e;
|
|
2758
|
+
this.ut = false;
|
|
2759
|
+
this.st.clear();
|
|
2757
2760
|
}
|
|
2758
2761
|
}
|
|
2759
|
-
if (this.
|
|
2760
|
-
if (n & this.
|
|
2762
|
+
if (this.it & a && this.ut) return super.notify(e, t, n, r);
|
|
2763
|
+
if (n & this.it) {
|
|
2761
2764
|
const t = r?.source || e.Y?.source;
|
|
2762
2765
|
if (t) {
|
|
2763
|
-
const e = this.
|
|
2764
|
-
this.
|
|
2765
|
-
if (e) setSignal(this.
|
|
2766
|
+
const e = this.st.size === 0;
|
|
2767
|
+
this.st.add(t);
|
|
2768
|
+
if (e) setSignal(this.ot, true);
|
|
2766
2769
|
}
|
|
2767
2770
|
}
|
|
2768
|
-
t &= ~this.
|
|
2771
|
+
t &= ~this.it;
|
|
2769
2772
|
return t ? super.notify(e, t, n, r) : true;
|
|
2770
2773
|
}
|
|
2771
2774
|
checkSources() {
|
|
2772
|
-
for (const e of this.
|
|
2773
|
-
if (!(e.de & this.
|
|
2775
|
+
for (const e of this.st) {
|
|
2776
|
+
if (!(e.de & this.it)) this.st.delete(e);
|
|
2774
2777
|
}
|
|
2775
|
-
if (!this.
|
|
2776
|
-
setSignal(this.
|
|
2777
|
-
if (this.
|
|
2778
|
+
if (!this.st.size) {
|
|
2779
|
+
setSignal(this.ot, false);
|
|
2780
|
+
if (this.ft) {
|
|
2778
2781
|
try {
|
|
2779
|
-
this.
|
|
2782
|
+
this.lt = untrack(() => this.ft());
|
|
2780
2783
|
} catch {}
|
|
2781
2784
|
}
|
|
2782
2785
|
}
|
|
@@ -2785,13 +2788,13 @@ class CollectionQueue extends Queue {
|
|
|
2785
2788
|
function createCollectionBoundary(e, t, n, r) {
|
|
2786
2789
|
const i = createOwner();
|
|
2787
2790
|
const s = new CollectionQueue(e);
|
|
2788
|
-
if (r) s.
|
|
2791
|
+
if (r) s.ft = r;
|
|
2789
2792
|
const o = createBoundChildren(i, t, s, e);
|
|
2790
2793
|
const u = computed(() => {
|
|
2791
|
-
if (!read(s.
|
|
2794
|
+
if (!read(s.ot)) {
|
|
2792
2795
|
const e = read(o);
|
|
2793
|
-
if (!untrack(() => read(s.
|
|
2794
|
-
s.
|
|
2796
|
+
if (!untrack(() => read(s.ot))) {
|
|
2797
|
+
s.ut = true;
|
|
2795
2798
|
return e;
|
|
2796
2799
|
}
|
|
2797
2800
|
}
|
|
@@ -2804,10 +2807,10 @@ function createLoadingBoundary(e, t, n) {
|
|
|
2804
2807
|
}
|
|
2805
2808
|
function createErrorBoundary(e, t) {
|
|
2806
2809
|
return createCollectionBoundary(d, e, e => {
|
|
2807
|
-
let n = e.
|
|
2810
|
+
let n = e.st.values().next().value;
|
|
2808
2811
|
const r = n.Y?.cause ?? n.Y;
|
|
2809
2812
|
return t(r, () => {
|
|
2810
|
-
for (const t of e.
|
|
2813
|
+
for (const t of e.st) recompute(t);
|
|
2811
2814
|
schedule();
|
|
2812
2815
|
});
|
|
2813
2816
|
});
|
package/dist/prod.js
CHANGED
|
@@ -954,6 +954,8 @@ function runEffect() {
|
|
|
954
954
|
try {
|
|
955
955
|
this.We = this.Ue(this.fe, this.ke);
|
|
956
956
|
} catch (e) {
|
|
957
|
+
this.q = new StatusError(this, e);
|
|
958
|
+
this.Ee |= STATUS_ERROR;
|
|
957
959
|
if (!this.ce.notify(this, STATUS_ERROR, STATUS_ERROR)) throw e;
|
|
958
960
|
} finally {
|
|
959
961
|
this.ke = this.fe;
|
|
@@ -1256,6 +1258,7 @@ function signal(e, t, n = null) {
|
|
|
1256
1258
|
const i = {
|
|
1257
1259
|
Ie: t?.equals != null ? t.equals : isEqual,
|
|
1258
1260
|
Ge: !!t?.pureWrite,
|
|
1261
|
+
Qe: !!t?.Qe,
|
|
1259
1262
|
ge: t?.unobserved,
|
|
1260
1263
|
fe: e,
|
|
1261
1264
|
I: null,
|
|
@@ -1266,7 +1269,7 @@ function signal(e, t, n = null) {
|
|
|
1266
1269
|
le: NOT_PENDING
|
|
1267
1270
|
};
|
|
1268
1271
|
n && (n.A = i);
|
|
1269
|
-
if (snapshotCaptureActive && !i.
|
|
1272
|
+
if (snapshotCaptureActive && !i.Qe && !((n?.Ee ?? 0) & STATUS_PENDING)) {
|
|
1270
1273
|
i.re = e === undefined ? NO_SNAPSHOT : e;
|
|
1271
1274
|
snapshotSources.add(i);
|
|
1272
1275
|
}
|
|
@@ -1393,7 +1396,7 @@ function read(e) {
|
|
|
1393
1396
|
if (e.Te !== undefined && e.Te !== NOT_PENDING) return e.Te;
|
|
1394
1397
|
return !t ||
|
|
1395
1398
|
(currentOptimisticLane !== null &&
|
|
1396
|
-
(e.Te !== undefined || e.ie || n === e || !!(n.Ee & STATUS_PENDING))) ||
|
|
1399
|
+
(e.Te !== undefined || e.ie || (n === e && stale) || !!(n.Ee & STATUS_PENDING))) ||
|
|
1397
1400
|
e.le === NOT_PENDING ||
|
|
1398
1401
|
(stale && e.ne && activeTransition !== e.ne)
|
|
1399
1402
|
? e.fe
|
|
@@ -1450,14 +1453,14 @@ function runWithOwner(e, t) {
|
|
|
1450
1453
|
}
|
|
1451
1454
|
}
|
|
1452
1455
|
function getPendingSignal(e) {
|
|
1453
|
-
if (!e.
|
|
1454
|
-
e.
|
|
1456
|
+
if (!e.Fe) {
|
|
1457
|
+
e.Fe = optimisticSignal(false, { pureWrite: true });
|
|
1455
1458
|
if (e.Se) {
|
|
1456
|
-
e.
|
|
1459
|
+
e.Fe.Se = e;
|
|
1457
1460
|
}
|
|
1458
|
-
if (computePendingState(e)) setSignal(e.
|
|
1461
|
+
if (computePendingState(e)) setSignal(e.Fe, true);
|
|
1459
1462
|
}
|
|
1460
|
-
return e.
|
|
1463
|
+
return e.Fe;
|
|
1461
1464
|
}
|
|
1462
1465
|
function computePendingState(e) {
|
|
1463
1466
|
const t = e;
|
|
@@ -1473,9 +1476,9 @@ function computePendingState(e) {
|
|
|
1473
1476
|
return !!(t.Ee & STATUS_PENDING && !(t.Ee & STATUS_UNINITIALIZED));
|
|
1474
1477
|
}
|
|
1475
1478
|
function updatePendingSignal(e) {
|
|
1476
|
-
if (e.
|
|
1479
|
+
if (e.Fe) {
|
|
1477
1480
|
const t = computePendingState(e);
|
|
1478
|
-
const n = e.
|
|
1481
|
+
const n = e.Fe;
|
|
1479
1482
|
setSignal(n, t);
|
|
1480
1483
|
if (!t && n.ie) {
|
|
1481
1484
|
const t = resolveLane(e);
|
|
@@ -2555,65 +2558,65 @@ function mapArray(e, t, n) {
|
|
|
2555
2558
|
const o = t;
|
|
2556
2559
|
return createMemo(
|
|
2557
2560
|
updateKeyedMap.bind({
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
Ye: [],
|
|
2561
|
+
Me: createOwner(),
|
|
2562
|
+
$e: 0,
|
|
2563
|
+
je: e,
|
|
2564
|
+
Ke: [],
|
|
2565
|
+
Ye: o,
|
|
2564
2566
|
Be: [],
|
|
2565
|
-
Ze:
|
|
2566
|
-
qe: i
|
|
2567
|
-
Xe:
|
|
2568
|
-
ze:
|
|
2567
|
+
Ze: [],
|
|
2568
|
+
qe: i,
|
|
2569
|
+
Xe: i || n?.keyed === false ? [] : undefined,
|
|
2570
|
+
ze: r ? [] : undefined,
|
|
2571
|
+
Je: n?.fallback
|
|
2569
2572
|
})
|
|
2570
2573
|
);
|
|
2571
2574
|
}
|
|
2572
2575
|
const pureOptions = { pureWrite: true };
|
|
2573
2576
|
function updateKeyedMap() {
|
|
2574
|
-
const e = this
|
|
2577
|
+
const e = this.je() || [],
|
|
2575
2578
|
t = e.length;
|
|
2576
2579
|
e[$TRACK];
|
|
2577
|
-
runWithOwner(this.
|
|
2580
|
+
runWithOwner(this.Me, () => {
|
|
2578
2581
|
let n,
|
|
2579
2582
|
i,
|
|
2580
|
-
r = this.
|
|
2583
|
+
r = this.Xe
|
|
2581
2584
|
? () => {
|
|
2582
|
-
this.
|
|
2583
|
-
this.
|
|
2584
|
-
return this.
|
|
2585
|
+
this.Xe[i] = signal(e[i], pureOptions);
|
|
2586
|
+
this.ze && (this.ze[i] = signal(i, pureOptions));
|
|
2587
|
+
return this.Ye(accessor(this.Xe[i]), this.ze ? accessor(this.ze[i]) : undefined);
|
|
2585
2588
|
}
|
|
2586
|
-
: this.
|
|
2589
|
+
: this.ze
|
|
2587
2590
|
? () => {
|
|
2588
2591
|
const t = e[i];
|
|
2589
|
-
this.
|
|
2590
|
-
return this.
|
|
2592
|
+
this.ze[i] = signal(i, pureOptions);
|
|
2593
|
+
return this.Ye(() => t, accessor(this.ze[i]));
|
|
2591
2594
|
}
|
|
2592
2595
|
: () => {
|
|
2593
2596
|
const t = e[i];
|
|
2594
|
-
return this.
|
|
2597
|
+
return this.Ye(() => t);
|
|
2595
2598
|
};
|
|
2596
2599
|
if (t === 0) {
|
|
2597
|
-
if (this
|
|
2598
|
-
this.
|
|
2600
|
+
if (this.$e !== 0) {
|
|
2601
|
+
this.Me.dispose(false);
|
|
2602
|
+
this.Ze = [];
|
|
2603
|
+
this.Ke = [];
|
|
2599
2604
|
this.Be = [];
|
|
2600
|
-
this
|
|
2601
|
-
this.Ye = [];
|
|
2602
|
-
this.Me = 0;
|
|
2603
|
-
this.qe && (this.qe = []);
|
|
2605
|
+
this.$e = 0;
|
|
2604
2606
|
this.Xe && (this.Xe = []);
|
|
2607
|
+
this.ze && (this.ze = []);
|
|
2605
2608
|
}
|
|
2606
|
-
if (this.
|
|
2607
|
-
this.
|
|
2609
|
+
if (this.Je && !this.Be[0]) {
|
|
2610
|
+
this.Be[0] = runWithOwner((this.Ze[0] = createOwner()), this.Je);
|
|
2608
2611
|
}
|
|
2609
|
-
} else if (this
|
|
2610
|
-
if (this.
|
|
2611
|
-
this.
|
|
2612
|
+
} else if (this.$e === 0) {
|
|
2613
|
+
if (this.Ze[0]) this.Ze[0].dispose();
|
|
2614
|
+
this.Be = new Array(t);
|
|
2612
2615
|
for (i = 0; i < t; i++) {
|
|
2613
|
-
this.
|
|
2614
|
-
this.
|
|
2616
|
+
this.Ke[i] = e[i];
|
|
2617
|
+
this.Be[i] = runWithOwner((this.Ze[i] = createOwner()), r);
|
|
2615
2618
|
}
|
|
2616
|
-
this
|
|
2619
|
+
this.$e = t;
|
|
2617
2620
|
} else {
|
|
2618
2621
|
let o,
|
|
2619
2622
|
s,
|
|
@@ -2624,131 +2627,131 @@ function updateKeyedMap() {
|
|
|
2624
2627
|
f,
|
|
2625
2628
|
E = new Array(t),
|
|
2626
2629
|
T = new Array(t),
|
|
2627
|
-
d = this.
|
|
2628
|
-
S = this.
|
|
2630
|
+
d = this.Xe ? new Array(t) : undefined,
|
|
2631
|
+
S = this.ze ? new Array(t) : undefined;
|
|
2629
2632
|
for (
|
|
2630
|
-
o = 0, s = Math.min(this
|
|
2631
|
-
o < s && (this.
|
|
2633
|
+
o = 0, s = Math.min(this.$e, t);
|
|
2634
|
+
o < s && (this.Ke[o] === e[o] || (this.Xe && compare(this.qe, this.Ke[o], e[o])));
|
|
2632
2635
|
o++
|
|
2633
2636
|
) {
|
|
2634
|
-
if (this.
|
|
2637
|
+
if (this.Xe) setSignal(this.Xe[o], e[o]);
|
|
2635
2638
|
}
|
|
2636
2639
|
for (
|
|
2637
|
-
s = this
|
|
2640
|
+
s = this.$e - 1, u = t - 1;
|
|
2638
2641
|
s >= o &&
|
|
2639
2642
|
u >= o &&
|
|
2640
|
-
(this.
|
|
2643
|
+
(this.Ke[s] === e[u] || (this.Xe && compare(this.qe, this.Ke[s], e[u])));
|
|
2641
2644
|
s--, u--
|
|
2642
2645
|
) {
|
|
2643
|
-
E[u] = this.
|
|
2644
|
-
T[u] = this.
|
|
2645
|
-
d && (d[u] = this.
|
|
2646
|
-
S && (S[u] = this.
|
|
2646
|
+
E[u] = this.Be[s];
|
|
2647
|
+
T[u] = this.Ze[s];
|
|
2648
|
+
d && (d[u] = this.Xe[s]);
|
|
2649
|
+
S && (S[u] = this.ze[s]);
|
|
2647
2650
|
}
|
|
2648
2651
|
l = new Map();
|
|
2649
2652
|
f = new Array(u + 1);
|
|
2650
2653
|
for (i = u; i >= o; i--) {
|
|
2651
2654
|
c = e[i];
|
|
2652
|
-
a = this.
|
|
2655
|
+
a = this.qe ? this.qe(c) : c;
|
|
2653
2656
|
n = l.get(a);
|
|
2654
2657
|
f[i] = n === undefined ? -1 : n;
|
|
2655
2658
|
l.set(a, i);
|
|
2656
2659
|
}
|
|
2657
2660
|
for (n = o; n <= s; n++) {
|
|
2658
|
-
c = this.
|
|
2659
|
-
a = this.
|
|
2661
|
+
c = this.Ke[n];
|
|
2662
|
+
a = this.qe ? this.qe(c) : c;
|
|
2660
2663
|
i = l.get(a);
|
|
2661
2664
|
if (i !== undefined && i !== -1) {
|
|
2662
|
-
E[i] = this.
|
|
2663
|
-
T[i] = this.
|
|
2664
|
-
d && (d[i] = this.
|
|
2665
|
-
S && (S[i] = this.
|
|
2665
|
+
E[i] = this.Be[n];
|
|
2666
|
+
T[i] = this.Ze[n];
|
|
2667
|
+
d && (d[i] = this.Xe[n]);
|
|
2668
|
+
S && (S[i] = this.ze[n]);
|
|
2666
2669
|
i = f[i];
|
|
2667
2670
|
l.set(a, i);
|
|
2668
|
-
} else this.
|
|
2671
|
+
} else this.Ze[n].dispose();
|
|
2669
2672
|
}
|
|
2670
2673
|
for (i = o; i < t; i++) {
|
|
2671
2674
|
if (i in E) {
|
|
2672
|
-
this.
|
|
2673
|
-
this.
|
|
2675
|
+
this.Be[i] = E[i];
|
|
2676
|
+
this.Ze[i] = T[i];
|
|
2674
2677
|
if (d) {
|
|
2675
|
-
this.
|
|
2676
|
-
setSignal(this.
|
|
2678
|
+
this.Xe[i] = d[i];
|
|
2679
|
+
setSignal(this.Xe[i], e[i]);
|
|
2677
2680
|
}
|
|
2678
2681
|
if (S) {
|
|
2679
|
-
this.
|
|
2680
|
-
setSignal(this.
|
|
2682
|
+
this.ze[i] = S[i];
|
|
2683
|
+
setSignal(this.ze[i], i);
|
|
2681
2684
|
}
|
|
2682
2685
|
} else {
|
|
2683
|
-
this.
|
|
2686
|
+
this.Be[i] = runWithOwner((this.Ze[i] = createOwner()), r);
|
|
2684
2687
|
}
|
|
2685
2688
|
}
|
|
2686
|
-
this.
|
|
2687
|
-
this.
|
|
2689
|
+
this.Be = this.Be.slice(0, (this.$e = t));
|
|
2690
|
+
this.Ke = e.slice(0);
|
|
2688
2691
|
}
|
|
2689
2692
|
});
|
|
2690
|
-
return this.
|
|
2693
|
+
return this.Be;
|
|
2691
2694
|
}
|
|
2692
2695
|
function repeat(e, t, n) {
|
|
2693
2696
|
const i = t;
|
|
2694
2697
|
return updateRepeat.bind({
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2698
|
+
Me: createOwner(),
|
|
2699
|
+
$e: 0,
|
|
2700
|
+
et: 0,
|
|
2701
|
+
tt: e,
|
|
2702
|
+
Ye: i,
|
|
2703
|
+
Ze: [],
|
|
2700
2704
|
Be: [],
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
ze: n?.fallback
|
|
2705
|
+
nt: n?.from,
|
|
2706
|
+
Je: n?.fallback
|
|
2704
2707
|
});
|
|
2705
2708
|
}
|
|
2706
2709
|
function updateRepeat() {
|
|
2707
|
-
const e = this.
|
|
2708
|
-
const t = this.
|
|
2709
|
-
runWithOwner(this.
|
|
2710
|
+
const e = this.tt();
|
|
2711
|
+
const t = this.nt?.() || 0;
|
|
2712
|
+
runWithOwner(this.Me, () => {
|
|
2710
2713
|
if (e === 0) {
|
|
2711
|
-
if (this
|
|
2712
|
-
this.
|
|
2714
|
+
if (this.$e !== 0) {
|
|
2715
|
+
this.Me.dispose(false);
|
|
2716
|
+
this.Ze = [];
|
|
2713
2717
|
this.Be = [];
|
|
2714
|
-
this
|
|
2715
|
-
this.Me = 0;
|
|
2718
|
+
this.$e = 0;
|
|
2716
2719
|
}
|
|
2717
|
-
if (this.
|
|
2718
|
-
this.
|
|
2720
|
+
if (this.Je && !this.Be[0]) {
|
|
2721
|
+
this.Be[0] = runWithOwner((this.Ze[0] = createOwner()), this.Je);
|
|
2719
2722
|
}
|
|
2720
2723
|
return;
|
|
2721
2724
|
}
|
|
2722
2725
|
const n = t + e;
|
|
2723
|
-
const i = this.
|
|
2724
|
-
if (this
|
|
2725
|
-
for (let e = n; e < i; e++) this.
|
|
2726
|
-
if (this.
|
|
2727
|
-
let e = this.
|
|
2728
|
-
while (e < t && e < this
|
|
2729
|
-
this.
|
|
2730
|
-
this.
|
|
2731
|
-
} else if (this.
|
|
2732
|
-
let n = i - this.
|
|
2733
|
-
let r = this.
|
|
2734
|
-
this.
|
|
2726
|
+
const i = this.et + this.$e;
|
|
2727
|
+
if (this.$e === 0 && this.Ze[0]) this.Ze[0].dispose();
|
|
2728
|
+
for (let e = n; e < i; e++) this.Ze[e - this.et].dispose();
|
|
2729
|
+
if (this.et < t) {
|
|
2730
|
+
let e = this.et;
|
|
2731
|
+
while (e < t && e < this.$e) this.Ze[e++].dispose();
|
|
2732
|
+
this.Ze.splice(0, t - this.et);
|
|
2733
|
+
this.Be.splice(0, t - this.et);
|
|
2734
|
+
} else if (this.et > t) {
|
|
2735
|
+
let n = i - this.et - 1;
|
|
2736
|
+
let r = this.et - t;
|
|
2737
|
+
this.Ze.length = this.Be.length = e;
|
|
2735
2738
|
while (n >= r) {
|
|
2739
|
+
this.Ze[n] = this.Ze[n - r];
|
|
2736
2740
|
this.Be[n] = this.Be[n - r];
|
|
2737
|
-
this.Ye[n] = this.Ye[n - r];
|
|
2738
2741
|
n--;
|
|
2739
2742
|
}
|
|
2740
2743
|
for (let e = 0; e < r; e++) {
|
|
2741
|
-
this.
|
|
2744
|
+
this.Be[e] = runWithOwner((this.Ze[e] = createOwner()), () => this.Ye(e + t));
|
|
2742
2745
|
}
|
|
2743
2746
|
}
|
|
2744
2747
|
for (let e = i; e < n; e++) {
|
|
2745
|
-
this.
|
|
2748
|
+
this.Be[e - t] = runWithOwner((this.Ze[e - t] = createOwner()), () => this.Ye(e));
|
|
2746
2749
|
}
|
|
2747
|
-
this.
|
|
2748
|
-
this.
|
|
2749
|
-
this
|
|
2750
|
+
this.Be = this.Be.slice(0, e);
|
|
2751
|
+
this.et = t;
|
|
2752
|
+
this.$e = e;
|
|
2750
2753
|
});
|
|
2751
|
-
return this.
|
|
2754
|
+
return this.Be;
|
|
2752
2755
|
}
|
|
2753
2756
|
function compare(e, t, n) {
|
|
2754
2757
|
return e ? e(t) === e(n) : true;
|
|
@@ -2758,10 +2761,10 @@ function boundaryComputed(e, t) {
|
|
|
2758
2761
|
n.he = (e, t) => {
|
|
2759
2762
|
const i = e !== undefined ? e : n.Ee;
|
|
2760
2763
|
const r = t !== undefined ? t : n.q;
|
|
2761
|
-
n.Ee &= ~n.
|
|
2762
|
-
n.ce.notify(n, n.
|
|
2764
|
+
n.Ee &= ~n.it;
|
|
2765
|
+
n.ce.notify(n, n.it, i, r);
|
|
2763
2766
|
};
|
|
2764
|
-
n.
|
|
2767
|
+
n.it = t;
|
|
2765
2768
|
n.Pe = true;
|
|
2766
2769
|
recompute(n, true);
|
|
2767
2770
|
return n;
|
|
@@ -2777,57 +2780,57 @@ function createBoundChildren(e, t, n, i) {
|
|
|
2777
2780
|
}
|
|
2778
2781
|
const ON_INIT = Symbol();
|
|
2779
2782
|
class CollectionQueue extends Queue {
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2783
|
+
rt;
|
|
2784
|
+
ot = new Set();
|
|
2785
|
+
st = signal(false, { pureWrite: true, Qe: true });
|
|
2786
|
+
ut = false;
|
|
2787
|
+
ct;
|
|
2788
|
+
lt = ON_INIT;
|
|
2786
2789
|
constructor(e) {
|
|
2787
2790
|
super();
|
|
2788
|
-
this.
|
|
2791
|
+
this.rt = e;
|
|
2789
2792
|
}
|
|
2790
2793
|
run(e) {
|
|
2791
|
-
if (!e || read(this.
|
|
2794
|
+
if (!e || read(this.st)) return;
|
|
2792
2795
|
return super.run(e);
|
|
2793
2796
|
}
|
|
2794
2797
|
notify(e, t, n, i) {
|
|
2795
|
-
if (!(t & this.
|
|
2796
|
-
if (this.
|
|
2798
|
+
if (!(t & this.rt)) return super.notify(e, t, n, i);
|
|
2799
|
+
if (this.ut && this.ct) {
|
|
2797
2800
|
const e = untrack(() => {
|
|
2798
2801
|
try {
|
|
2799
|
-
return this.
|
|
2802
|
+
return this.ct();
|
|
2800
2803
|
} catch {
|
|
2801
2804
|
return ON_INIT;
|
|
2802
2805
|
}
|
|
2803
2806
|
});
|
|
2804
|
-
if (e !== this.
|
|
2805
|
-
this.
|
|
2806
|
-
this.
|
|
2807
|
-
this.
|
|
2807
|
+
if (e !== this.lt) {
|
|
2808
|
+
this.lt = e;
|
|
2809
|
+
this.ut = false;
|
|
2810
|
+
this.ot.clear();
|
|
2808
2811
|
}
|
|
2809
2812
|
}
|
|
2810
|
-
if (this.
|
|
2811
|
-
if (n & this.
|
|
2813
|
+
if (this.rt & STATUS_PENDING && this.ut) return super.notify(e, t, n, i);
|
|
2814
|
+
if (n & this.rt) {
|
|
2812
2815
|
const t = i?.source || e.q?.source;
|
|
2813
2816
|
if (t) {
|
|
2814
|
-
const e = this.
|
|
2815
|
-
this.
|
|
2816
|
-
if (e) setSignal(this.
|
|
2817
|
+
const e = this.ot.size === 0;
|
|
2818
|
+
this.ot.add(t);
|
|
2819
|
+
if (e) setSignal(this.st, true);
|
|
2817
2820
|
}
|
|
2818
2821
|
}
|
|
2819
|
-
t &= ~this.
|
|
2822
|
+
t &= ~this.rt;
|
|
2820
2823
|
return t ? super.notify(e, t, n, i) : true;
|
|
2821
2824
|
}
|
|
2822
2825
|
checkSources() {
|
|
2823
|
-
for (const e of this.
|
|
2824
|
-
if (!(e.Ee & this.
|
|
2826
|
+
for (const e of this.ot) {
|
|
2827
|
+
if (!(e.Ee & this.rt)) this.ot.delete(e);
|
|
2825
2828
|
}
|
|
2826
|
-
if (!this.
|
|
2827
|
-
setSignal(this.
|
|
2828
|
-
if (this.
|
|
2829
|
+
if (!this.ot.size) {
|
|
2830
|
+
setSignal(this.st, false);
|
|
2831
|
+
if (this.ct) {
|
|
2829
2832
|
try {
|
|
2830
|
-
this.
|
|
2833
|
+
this.lt = untrack(() => this.ct());
|
|
2831
2834
|
} catch {}
|
|
2832
2835
|
}
|
|
2833
2836
|
}
|
|
@@ -2836,13 +2839,13 @@ class CollectionQueue extends Queue {
|
|
|
2836
2839
|
function createCollectionBoundary(e, t, n, i) {
|
|
2837
2840
|
const r = createOwner();
|
|
2838
2841
|
const o = new CollectionQueue(e);
|
|
2839
|
-
if (i) o.
|
|
2842
|
+
if (i) o.ct = i;
|
|
2840
2843
|
const s = createBoundChildren(r, t, o, e);
|
|
2841
2844
|
const u = computed(() => {
|
|
2842
|
-
if (!read(o.
|
|
2845
|
+
if (!read(o.st)) {
|
|
2843
2846
|
const e = read(s);
|
|
2844
|
-
if (!untrack(() => read(o.
|
|
2845
|
-
o.
|
|
2847
|
+
if (!untrack(() => read(o.st))) {
|
|
2848
|
+
o.ut = true;
|
|
2846
2849
|
return e;
|
|
2847
2850
|
}
|
|
2848
2851
|
}
|
|
@@ -2855,10 +2858,10 @@ function createLoadingBoundary(e, t, n) {
|
|
|
2855
2858
|
}
|
|
2856
2859
|
function createErrorBoundary(e, t) {
|
|
2857
2860
|
return createCollectionBoundary(STATUS_ERROR, e, e => {
|
|
2858
|
-
let n = e.
|
|
2861
|
+
let n = e.ot.values().next().value;
|
|
2859
2862
|
const i = n.q?.cause ?? n.q;
|
|
2860
2863
|
return t(i, () => {
|
|
2861
|
-
for (const t of e.
|
|
2864
|
+
for (const t of e.ot) recompute(t);
|
|
2862
2865
|
schedule();
|
|
2863
2866
|
});
|
|
2864
2867
|
});
|
|
@@ -17,6 +17,8 @@ export interface NodeOptions<T> {
|
|
|
17
17
|
transparent?: boolean;
|
|
18
18
|
equals?: ((prev: T, next: T) => boolean) | false;
|
|
19
19
|
pureWrite?: boolean;
|
|
20
|
+
/** Exclude this signal from snapshot capture (internal — not part of public API) */
|
|
21
|
+
_noSnapshot?: boolean;
|
|
20
22
|
unobserved?: () => void;
|
|
21
23
|
lazy?: boolean;
|
|
22
24
|
}
|
|
@@ -28,6 +30,7 @@ export interface RawSignal<T> {
|
|
|
28
30
|
_name?: string;
|
|
29
31
|
_equals: false | ((a: T, b: T) => boolean);
|
|
30
32
|
_pureWrite?: boolean;
|
|
33
|
+
_noSnapshot?: boolean;
|
|
31
34
|
_unobserved?: () => void;
|
|
32
35
|
_time: number;
|
|
33
36
|
_transition: Transition | null;
|