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