@solidjs/signals 0.13.13 → 2.0.0-beta.7

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.
Files changed (39) hide show
  1. package/README.md +8 -7
  2. package/dist/dev.js +90 -61
  3. package/dist/node.cjs +156 -137
  4. package/dist/prod.js +108 -81
  5. package/dist/types/core/graph.d.ts +1 -0
  6. package/dist/types/core/types.d.ts +2 -2
  7. package/dist/types/signals.d.ts +15 -21
  8. package/dist/types/store/optimistic.d.ts +2 -2
  9. package/dist/types/store/projection.d.ts +4 -4
  10. package/dist/types/store/store.d.ts +2 -2
  11. package/dist/types-cjs/boundaries.d.cts +52 -0
  12. package/dist/types-cjs/core/action.d.cts +1 -0
  13. package/dist/types-cjs/core/async.d.cts +6 -0
  14. package/dist/types-cjs/core/constants.d.cts +25 -0
  15. package/dist/types-cjs/core/context.d.cts +28 -0
  16. package/dist/types-cjs/core/core.d.cts +54 -0
  17. package/dist/types-cjs/core/dev.d.cts +49 -0
  18. package/dist/types-cjs/core/effect.d.cts +30 -0
  19. package/dist/types-cjs/core/error.d.cts +14 -0
  20. package/dist/types-cjs/core/external.d.cts +26 -0
  21. package/dist/types-cjs/core/graph.d.cts +4 -0
  22. package/dist/types-cjs/core/heap.d.cts +14 -0
  23. package/dist/types-cjs/core/index.d.cts +12 -0
  24. package/dist/types-cjs/core/lanes.d.cts +54 -0
  25. package/dist/types-cjs/core/owner.d.cts +26 -0
  26. package/dist/types-cjs/core/scheduler.d.cts +81 -0
  27. package/dist/types-cjs/core/types.d.cts +86 -0
  28. package/dist/types-cjs/index.d.cts +9 -0
  29. package/dist/types-cjs/map.d.cts +24 -0
  30. package/dist/types-cjs/package.json +3 -0
  31. package/dist/types-cjs/signals.d.cts +186 -0
  32. package/dist/types-cjs/store/index.d.cts +9 -0
  33. package/dist/types-cjs/store/optimistic.d.cts +19 -0
  34. package/dist/types-cjs/store/projection.d.cts +26 -0
  35. package/dist/types-cjs/store/reconcile.d.cts +1 -0
  36. package/dist/types-cjs/store/store.d.cts +68 -0
  37. package/dist/types-cjs/store/storePath.d.cts +30 -0
  38. package/dist/types-cjs/store/utils.d.cts +43 -0
  39. package/package.json +31 -24
package/dist/node.cjs CHANGED
@@ -172,7 +172,7 @@ function queueStashedOptimisticEffects(e) {
172
172
  if (e.D === g) {
173
173
  if (!e.F) {
174
174
  e.F = true;
175
- e.M.enqueue(y, e.V);
175
+ e.V.enqueue(y, e.M);
176
176
  }
177
177
  continue;
178
178
  }
@@ -445,7 +445,7 @@ function insertSubs(e, t = false) {
445
445
  if (e.D === g) {
446
446
  if (!e.F) {
447
447
  e.F = true;
448
- e.M.enqueue(y, e.V);
448
+ e.V.enqueue(y, e.M);
449
449
  }
450
450
  continue;
451
451
  }
@@ -667,6 +667,7 @@ function unobserved(e) {
667
667
  t = unlinkSubs(t);
668
668
  }
669
669
  e.A = null;
670
+ e.Pe = null;
670
671
  disposeChildren(e, true);
671
672
  }
672
673
  function link(e, t) {
@@ -782,24 +783,24 @@ function formatId(e, t) {
782
783
  return e + (r ? String.fromCharCode(64 + r) : "") + n;
783
784
  }
784
785
  function getObserver() {
785
- if (D || M) return I;
786
- return H ? V : null;
786
+ if (D || V) return I;
787
+ return H ? M : null;
787
788
  }
788
789
  function getOwner() {
789
- return V;
790
+ return M;
790
791
  }
791
792
  function cleanup(e) {
792
- if (!V) return e;
793
- if (!V.Ne) V.Ne = e;
794
- else if (Array.isArray(V.Ne)) V.Ne.push(e);
795
- else V.Ne = [V.Ne, e];
793
+ if (!M) return e;
794
+ if (!M.Ne) M.Ne = e;
795
+ else if (Array.isArray(M.Ne)) M.Ne.push(e);
796
+ else M.Ne = [M.Ne, e];
796
797
  return e;
797
798
  }
798
799
  function isDisposed(e) {
799
800
  return !!(e.m & (u | o));
800
801
  }
801
802
  function createOwner(e) {
802
- const t = V;
803
+ const t = M;
803
804
  const n = e?.transparent ?? false;
804
805
  const r = {
805
806
  id: e?.id ?? (n ? t?.id : t?.id != null ? getNextChildId(t) : undefined),
@@ -809,7 +810,7 @@ function createOwner(e) {
809
810
  ke: null,
810
811
  Ee: null,
811
812
  Ne: null,
812
- M: t?.M ?? N,
813
+ V: t?.V ?? N,
813
814
  Le: t?.Le || _,
814
815
  je: 0,
815
816
  Ae: null,
@@ -908,7 +909,7 @@ function settlePendingSource(e) {
908
909
  const e = r;
909
910
  if (!e.F) {
910
911
  e.F = true;
911
- e.M.enqueue(y, e.V);
912
+ e.V.enqueue(y, e.M);
912
913
  }
913
914
  } else {
914
915
  const e = r.m & o ? k : P;
@@ -993,7 +994,7 @@ function handleAsync(e, t, r) {
993
994
  r = false;
994
995
  if (!n) {
995
996
  N.initTransition(resolveTransition(e));
996
- throw new NotReadyError(V);
997
+ throw new NotReadyError(M);
997
998
  }
998
999
  }
999
1000
  if (s) {
@@ -1047,7 +1048,7 @@ function handleAsync(e, t, r) {
1047
1048
  const s = iterate();
1048
1049
  if (!r && !s) {
1049
1050
  N.initTransition(resolveTransition(e));
1050
- throw new NotReadyError(V);
1051
+ throw new NotReadyError(M);
1051
1052
  }
1052
1053
  }
1053
1054
  return u;
@@ -1136,8 +1137,8 @@ let Q = false;
1136
1137
  let q = false;
1137
1138
  let D = false;
1138
1139
  let F = false;
1139
- let M = false;
1140
- let V = null;
1140
+ let V = false;
1141
+ let M = null;
1141
1142
  let B = null;
1142
1143
  let K = false;
1143
1144
  let G = null;
@@ -1211,8 +1212,8 @@ function recompute(t, n = false) {
1211
1212
  const u = t.ee !== undefined && t.ee !== S;
1212
1213
  const c = !!(t.ye & a);
1213
1214
  const p = !!(t.ye & h);
1214
- const y = V;
1215
- V = t;
1215
+ const y = M;
1216
+ M = t;
1216
1217
  t.Pe = null;
1217
1218
  t.m = r;
1218
1219
  t.de = E;
@@ -1253,7 +1254,7 @@ function recompute(t, n = false) {
1253
1254
  } finally {
1254
1255
  H = b;
1255
1256
  t.m = e | (n ? t.m & l : 0);
1256
- V = y;
1257
+ M = y;
1257
1258
  }
1258
1259
  if (!t.ae) {
1259
1260
  const e = t.Pe;
@@ -1311,14 +1312,14 @@ function updateIfNecessary(e) {
1311
1312
  function computed(t, n, r) {
1312
1313
  const i = r?.transparent ?? false;
1313
1314
  const s = {
1314
- id: r?.id ?? (i ? V?.id : V?.id != null ? getNextChildId(V) : undefined),
1315
+ id: r?.id ?? (i ? M?.id : M?.id != null ? getNextChildId(M) : undefined),
1315
1316
  Re: i || undefined,
1316
1317
  Te: r?.equals != null ? r.equals : isEqual,
1317
- ce: !!r?.pureWrite,
1318
+ ce: !!r?.ownedWrite,
1318
1319
  xe: r?.unobserved,
1319
1320
  Ne: null,
1320
- M: V?.M ?? N,
1321
- Le: V?.Le ?? _,
1321
+ V: M?.V ?? N,
1322
+ Le: M?.Le ?? _,
1322
1323
  je: 0,
1323
1324
  I: t,
1324
1325
  $: n,
@@ -1330,7 +1331,7 @@ function computed(t, n, r) {
1330
1331
  Pe: null,
1331
1332
  O: null,
1332
1333
  Oe: null,
1333
- i: V,
1334
+ i: M,
1334
1335
  Ee: null,
1335
1336
  ke: null,
1336
1337
  m: r?.lazy ? c : e,
@@ -1343,20 +1344,20 @@ function computed(t, n, r) {
1343
1344
  G: null
1344
1345
  };
1345
1346
  s.h = s;
1346
- const o = V?.t ? V.u : V;
1347
- if (V) {
1348
- const e = V.ke;
1347
+ const o = M?.t ? M.u : M;
1348
+ if (M) {
1349
+ const e = M.ke;
1349
1350
  if (e === null) {
1350
- V.ke = s;
1351
+ M.ke = s;
1351
1352
  } else {
1352
1353
  s.Ee = e;
1353
- V.ke = s;
1354
+ M.ke = s;
1354
1355
  }
1355
1356
  }
1356
1357
  if (o) s.o = o.o + 1;
1357
- if (K && ownerInSnapshotScope(V)) s.pe = true;
1358
+ if (K && ownerInSnapshotScope(M)) s.pe = true;
1358
1359
  if (T) {
1359
- const e = signal(undefined, { equals: false, pureWrite: true });
1360
+ const e = signal(undefined, { equals: false, ownedWrite: true });
1360
1361
  const t = T.factory(s.I, () => {
1361
1362
  setSignal(e, undefined);
1362
1363
  });
@@ -1378,7 +1379,7 @@ function computed(t, n, r) {
1378
1379
  function signal(e, t, n = null) {
1379
1380
  const r = {
1380
1381
  Te: t?.equals != null ? t.equals : isEqual,
1381
- ce: !!t?.pureWrite,
1382
+ ce: !!t?.ownedWrite,
1382
1383
  De: !!t?.De,
1383
1384
  xe: t?.unobserved,
1384
1385
  $: e,
@@ -1421,19 +1422,19 @@ function untrack(e, t) {
1421
1422
  }
1422
1423
  }
1423
1424
  function read(e) {
1424
- if (M) {
1425
+ if (V) {
1425
1426
  const t = getLatestValueComputed(e);
1426
- const n = M;
1427
- M = false;
1427
+ const n = V;
1428
+ V = false;
1428
1429
  const r = e.ee !== undefined && e.ee !== S ? e.ee : e.$;
1429
1430
  let i;
1430
1431
  try {
1431
1432
  i = read(t);
1432
1433
  } catch (e) {
1433
- if (!V && e instanceof NotReadyError) return r;
1434
+ if (!M && e instanceof NotReadyError) return r;
1434
1435
  throw e;
1435
1436
  } finally {
1436
- M = n;
1437
+ V = n;
1437
1438
  }
1438
1439
  if (t.ye & a) return r;
1439
1440
  if (Q && B && t.Y) {
@@ -1453,7 +1454,7 @@ function read(e) {
1453
1454
  if (e.ee !== S && (t.Ce || !!(t.ye & a))) {
1454
1455
  F = true;
1455
1456
  }
1456
- let n = V;
1457
+ let n = M;
1457
1458
  if (n?.t) n = n.u;
1458
1459
  if (n && H) link(e, n);
1459
1460
  read(getPendingSignal(e));
@@ -1465,48 +1466,53 @@ function read(e) {
1465
1466
  D = n;
1466
1467
  return e.$;
1467
1468
  }
1468
- let t = V;
1469
+ let t = M;
1469
1470
  if (t?.t) t = t.u;
1470
- if (q && e.I) recompute(e);
1471
- if (e.m & c) {
1472
- e.m &= ~c;
1473
- recompute(e, true);
1474
- }
1475
- const n = e.L || e;
1471
+ const n = e;
1472
+ if (typeof n.I === "function") {
1473
+ const t = e;
1474
+ if (q && !(t.m & u)) recompute(t);
1475
+ if (t.m & c) {
1476
+ t.m &= ~c;
1477
+ recompute(t, true);
1478
+ } else if (t.m & u) {
1479
+ recompute(t, true);
1480
+ }
1481
+ }
1482
+ const r = e.L || e;
1476
1483
  if (t && H) {
1477
- if (e.I && e.m & u) recompute(e);
1478
1484
  link(e, t);
1479
- if (n.I) {
1480
- const r = e.m & o;
1481
- if (n.o >= (r ? k.j : P.j)) {
1485
+ if (r.I) {
1486
+ const n = e.m & o;
1487
+ if (r.o >= (n ? k.j : P.j)) {
1482
1488
  markNode(t);
1483
- markHeap(r ? k : P);
1484
- updateIfNecessary(n);
1489
+ markHeap(n ? k : P);
1490
+ updateIfNecessary(r);
1485
1491
  }
1486
- const i = n.o;
1492
+ const i = r.o;
1487
1493
  if (i >= t.o && e.i !== t) {
1488
1494
  t.o = i + 1;
1489
1495
  }
1490
1496
  }
1491
1497
  }
1492
- if (n.ye & a) {
1493
- if (t && !(Q && n.G && C !== n.G)) {
1498
+ if (r.ye & a) {
1499
+ if (t && !(Q && r.G && C !== r.G)) {
1494
1500
  if (B) {
1495
- const r = n.Y;
1501
+ const n = r.Y;
1496
1502
  const i = findLane(B);
1497
- if (r && findLane(r) === i && !hasActiveOverride(n)) {
1503
+ if (n && findLane(n) === i && !hasActiveOverride(r)) {
1498
1504
  if (!H && e !== t) link(e, t);
1499
- throw n.ae;
1505
+ throw r.ae;
1500
1506
  }
1501
1507
  } else {
1502
1508
  if (!H && e !== t) link(e, t);
1503
- throw n.ae;
1509
+ throw r.ae;
1504
1510
  }
1505
- } else if (t && n !== e && n.ye & h) {
1511
+ } else if (t && r !== e && r.ye & h) {
1506
1512
  if (!H && e !== t) link(e, t);
1507
- throw n.ae;
1508
- } else if (!t && n.ye & h) {
1509
- throw n.ae;
1513
+ throw r.ae;
1514
+ } else if (!t && r.ye & h) {
1515
+ throw r.ae;
1510
1516
  }
1511
1517
  }
1512
1518
  if (e.I && e.ye & d) {
@@ -1528,12 +1534,17 @@ function read(e) {
1528
1534
  if (t && Q && shouldReadStashedOptimisticValue(e)) return e.$;
1529
1535
  return e.ee;
1530
1536
  }
1531
- return !t ||
1532
- (B !== null && (e.ee !== undefined || e.Y || (n === e && Q) || !!(n.ye & a))) ||
1537
+ const i =
1538
+ !t ||
1539
+ (B !== null && (e.ee !== undefined || e.Y || (r === e && Q) || !!(r.ye & a))) ||
1533
1540
  e.Z === S ||
1534
1541
  (Q && e.G && C !== e.G)
1535
- ? e.$
1536
- : e.Z;
1542
+ ? e.$
1543
+ : e.Z;
1544
+ if (!t && r === e && typeof n.I === "function" && !n.ve && !(r.ye & a) && !n.i && !e.O) {
1545
+ unobserved(e);
1546
+ }
1547
+ return i;
1537
1548
  }
1538
1549
  function setSignal(e, t) {
1539
1550
  if (e.G && C !== e.G) N.initTransition(e.G);
@@ -1574,20 +1585,20 @@ function setSignal(e, t) {
1574
1585
  return t;
1575
1586
  }
1576
1587
  function runWithOwner(e, t) {
1577
- const n = V;
1588
+ const n = M;
1578
1589
  const r = H;
1579
- V = e;
1590
+ M = e;
1580
1591
  H = false;
1581
1592
  try {
1582
1593
  return t();
1583
1594
  } finally {
1584
- V = n;
1595
+ M = n;
1585
1596
  H = r;
1586
1597
  }
1587
1598
  }
1588
1599
  function getPendingSignal(e) {
1589
1600
  if (!e.Fe) {
1590
- e.Fe = optimisticSignal(false, { pureWrite: true });
1601
+ e.Fe = optimisticSignal(false, { ownedWrite: true });
1591
1602
  if (e.we) {
1592
1603
  e.Fe.we = e;
1593
1604
  }
@@ -1635,17 +1646,17 @@ function updatePendingSignal(e) {
1635
1646
  }
1636
1647
  function getLatestValueComputed(e) {
1637
1648
  if (!e.He) {
1638
- const t = M;
1639
- M = false;
1649
+ const t = V;
1650
+ V = false;
1640
1651
  const n = D;
1641
1652
  D = false;
1642
- const r = V;
1643
- V = null;
1653
+ const r = M;
1654
+ M = null;
1644
1655
  e.He = optimisticComputed(() => read(e));
1645
1656
  e.He.we = e;
1646
- V = r;
1657
+ M = r;
1647
1658
  D = n;
1648
- M = t;
1659
+ V = t;
1649
1660
  }
1650
1661
  return e.He;
1651
1662
  }
@@ -1659,12 +1670,12 @@ function staleValues(e, t = true) {
1659
1670
  }
1660
1671
  }
1661
1672
  function latest(e) {
1662
- const t = M;
1663
- M = true;
1673
+ const t = V;
1674
+ V = true;
1664
1675
  try {
1665
1676
  return e();
1666
1677
  } finally {
1667
- M = t;
1678
+ V = t;
1668
1679
  }
1669
1680
  }
1670
1681
  function isPending(e) {
@@ -1732,13 +1743,13 @@ function effect(e, t, n, r, i) {
1732
1743
  ...i,
1733
1744
  equals: () => {
1734
1745
  o.F = !o.ae;
1735
- if (s) o.M.enqueue(o.D, runEffect.bind(o));
1746
+ if (s) o.V.enqueue(o.D, runEffect.bind(o));
1736
1747
  return false;
1737
1748
  },
1738
1749
  lazy: true
1739
1750
  });
1740
- o.Me = r;
1741
- o.Ve = t;
1751
+ o.Ve = r;
1752
+ o.Me = t;
1742
1753
  o.Be = n;
1743
1754
  o.Ke = undefined;
1744
1755
  o.D = i?.render ? p : y;
@@ -1747,7 +1758,7 @@ function effect(e, t, n, r, i) {
1747
1758
  const r = t !== undefined ? t : o.ae;
1748
1759
  if (n & d) {
1749
1760
  let e = r;
1750
- o.M.notify(o, a, 0);
1761
+ o.V.notify(o, a, 0);
1751
1762
  if (o.D === y) {
1752
1763
  try {
1753
1764
  return o.Be
@@ -1760,13 +1771,13 @@ function effect(e, t, n, r, i) {
1760
1771
  e = t;
1761
1772
  }
1762
1773
  }
1763
- if (!o.M.notify(o, d, d)) throw e;
1774
+ if (!o.V.notify(o, d, d)) throw e;
1764
1775
  } else if (o.D === p) {
1765
- o.M.notify(o, a | d, n, r);
1776
+ o.V.notify(o, a | d, n, r);
1766
1777
  }
1767
1778
  };
1768
1779
  recompute(o, true);
1769
- !i?.defer && (o.D === y ? o.M.enqueue(o.D, runEffect.bind(o)) : runEffect.call(o));
1780
+ !i?.defer && (o.D === y ? o.V.enqueue(o.D, runEffect.bind(o)) : runEffect.call(o));
1770
1781
  s = true;
1771
1782
  cleanup(() => o.Ke?.());
1772
1783
  }
@@ -1775,15 +1786,15 @@ function runEffect() {
1775
1786
  this.Ke?.();
1776
1787
  this.Ke = undefined;
1777
1788
  try {
1778
- const e = this.Ve(this.$, this.Me);
1789
+ const e = this.Me(this.$, this.Ve);
1779
1790
  if (false && e !== undefined && typeof e !== "function");
1780
1791
  this.Ke = e;
1781
1792
  } catch (e) {
1782
1793
  this.ae = new StatusError(this, e);
1783
1794
  this.ye |= d;
1784
- if (!this.M.notify(this, d, d)) throw e;
1795
+ if (!this.V.notify(this, d, d)) throw e;
1785
1796
  } finally {
1786
- this.Me = this.$;
1797
+ this.Ve = this.$;
1787
1798
  this.F = false;
1788
1799
  }
1789
1800
  }
@@ -1813,13 +1824,13 @@ function trackedEffect(e, t) {
1813
1824
  n.Qe = (e, t) => {
1814
1825
  const r = e !== undefined ? e : n.ye;
1815
1826
  if (r & d) {
1816
- n.M.notify(n, a, 0);
1827
+ n.V.notify(n, a, 0);
1817
1828
  const e = t !== undefined ? t : n.ae;
1818
- if (!n.M.notify(n, d, d)) throw e;
1829
+ if (!n.V.notify(n, d, d)) throw e;
1819
1830
  }
1820
1831
  };
1821
- n.V = run;
1822
- n.M.enqueue(y, run);
1832
+ n.M = run;
1833
+ n.V.enqueue(y, run);
1823
1834
  cleanup(() => n.Ke?.());
1824
1835
  }
1825
1836
  function restoreTransition(e, t) {
@@ -1874,23 +1885,24 @@ function accessor(e) {
1874
1885
  t.$r = true;
1875
1886
  return t;
1876
1887
  }
1877
- function createSignal(e, t, n) {
1888
+ function createSignal(e, t) {
1878
1889
  if (typeof e === "function") {
1879
- const r = computed(e, t, n);
1880
- return [accessor(r), setSignal.bind(null, r)];
1890
+ const n = computed(e, undefined, t);
1891
+ n.ve = true;
1892
+ return [accessor(n), setSignal.bind(null, n)];
1881
1893
  }
1882
- const r = signal(e, t);
1883
- return [accessor(r), setSignal.bind(null, r)];
1894
+ const n = signal(e, t);
1895
+ return [accessor(n), setSignal.bind(null, n)];
1884
1896
  }
1885
- function createMemo(e, t, n) {
1886
- let r = computed(e, t, n);
1887
- return accessor(r);
1897
+ function createMemo(e, t) {
1898
+ let n = computed(e, undefined, t);
1899
+ return accessor(n);
1888
1900
  }
1889
- function createEffect(e, t, n, r) {
1890
- effect(e, t.effect || t, t.error, n, r);
1901
+ function createEffect(e, t, n) {
1902
+ effect(e, t.effect || t, t.error, undefined, n);
1891
1903
  }
1892
- function createRenderEffect(e, t, n, r) {
1893
- effect(e, t, undefined, n, { render: true, ...r });
1904
+ function createRenderEffect(e, t, n) {
1905
+ effect(e, t, undefined, undefined, { render: true, ...n });
1894
1906
  }
1895
1907
  function createTrackedEffect(e, t) {
1896
1908
  trackedEffect(e, t);
@@ -1932,13 +1944,14 @@ function resolve(e) {
1932
1944
  });
1933
1945
  });
1934
1946
  }
1935
- function createOptimistic(e, t, n) {
1947
+ function createOptimistic(e, t) {
1936
1948
  if (typeof e === "function") {
1937
- const r = optimisticComputed(e, t, n);
1938
- return [accessor(r), setSignal.bind(null, r)];
1949
+ const n = optimisticComputed(e, undefined, t);
1950
+ n.ve = true;
1951
+ return [accessor(n), setSignal.bind(null, n)];
1939
1952
  }
1940
- const r = optimisticSignal(e, t);
1941
- return [accessor(r), setSignal.bind(null, r)];
1953
+ const n = optimisticSignal(e, t);
1954
+ return [accessor(n), setSignal.bind(null, n)];
1942
1955
  }
1943
1956
  function onSettled(e) {
1944
1957
  const t = getOwner();
@@ -2083,7 +2096,7 @@ function reconcile(e, t) {
2083
2096
  applyState(e, n, r);
2084
2097
  };
2085
2098
  }
2086
- function createProjectionInternal(e, t = {}, n) {
2099
+ function createProjectionInternal(e, t, n) {
2087
2100
  let r;
2088
2101
  const i = new WeakMap();
2089
2102
  const wrapper = e => {
@@ -2124,7 +2137,7 @@ function createProjectionInternal(e, t = {}, n) {
2124
2137
  r.ve = true;
2125
2138
  return { store: s, node: r };
2126
2139
  }
2127
- function createProjection(e, t = {}, n) {
2140
+ function createProjection(e, t, n) {
2128
2141
  return createProjectionInternal(e, t, n).store;
2129
2142
  }
2130
2143
  function createWriteTraps(e) {
@@ -2491,7 +2504,7 @@ function createStore(e, t, n) {
2491
2504
  function createOptimisticStore(e, t, n) {
2492
2505
  GlobalQueue.fe ||= clearOptimisticStore;
2493
2506
  const r = typeof e === "function";
2494
- const i = (r ? t : e) ?? {};
2507
+ const i = r ? t : e;
2495
2508
  const s = r ? e : undefined;
2496
2509
  const { store: o } = createOptimisticProjectionInternal(s, i, n);
2497
2510
  return [o, e => storeSetter(o, e)];
@@ -2522,7 +2535,7 @@ function clearOptimisticStore(e) {
2522
2535
  }
2523
2536
  delete t[$];
2524
2537
  }
2525
- function createOptimisticProjectionInternal(e, t = {}, n) {
2538
+ function createOptimisticProjectionInternal(e, t, n) {
2526
2539
  let r;
2527
2540
  const i = new WeakMap();
2528
2541
  const wrapper = e => {
@@ -2829,7 +2842,7 @@ function mapArray(e, t, n) {
2829
2842
  const r = typeof n?.keyed === "function" ? n.keyed : undefined;
2830
2843
  const i = t.length > 1;
2831
2844
  const s = t;
2832
- return createMemo(
2845
+ const o = computed(
2833
2846
  updateKeyedMap.bind({
2834
2847
  ze: createOwner(),
2835
2848
  Ue: 0,
@@ -2844,8 +2857,10 @@ function mapArray(e, t, n) {
2844
2857
  rt: n?.fallback
2845
2858
  })
2846
2859
  );
2860
+ o.ve = true;
2861
+ return accessor(o);
2847
2862
  }
2848
- const pe = { pureWrite: true };
2863
+ const pe = { ownedWrite: true };
2849
2864
  function updateKeyedMap() {
2850
2865
  const e = this.Je() || [],
2851
2866
  t = e.length;
@@ -2967,17 +2982,21 @@ function updateKeyedMap() {
2967
2982
  }
2968
2983
  function repeat(e, t, n) {
2969
2984
  const r = t;
2970
- return updateRepeat.bind({
2971
- ze: createOwner(),
2972
- Ue: 0,
2973
- it: 0,
2974
- st: e,
2975
- Ye: r,
2976
- $e: [],
2977
- Ze: [],
2978
- ot: n?.from,
2979
- rt: n?.fallback
2980
- });
2985
+ const i = computed(
2986
+ updateRepeat.bind({
2987
+ ze: createOwner(),
2988
+ Ue: 0,
2989
+ it: 0,
2990
+ st: e,
2991
+ Ye: r,
2992
+ $e: [],
2993
+ Ze: [],
2994
+ ot: n?.from,
2995
+ rt: n?.fallback
2996
+ })
2997
+ );
2998
+ i.ve = true;
2999
+ return accessor(i);
2981
3000
  }
2982
3001
  function updateRepeat() {
2983
3002
  const e = this.st();
@@ -3035,7 +3054,7 @@ function boundaryComputed(e, t) {
3035
3054
  const r = e !== undefined ? e : n.ye;
3036
3055
  const i = t !== undefined ? t : n.ae;
3037
3056
  n.ye &= ~n.ut;
3038
- n.M.notify(n, n.ut, r, i);
3057
+ n.V.notify(n, n.ut, r, i);
3039
3058
  };
3040
3059
  n.ut = t;
3041
3060
  n.ve = true;
@@ -3043,9 +3062,9 @@ function boundaryComputed(e, t) {
3043
3062
  return n;
3044
3063
  }
3045
3064
  function createBoundChildren(e, t, n, r) {
3046
- const i = e.M;
3047
- i.addChild((e.M = n));
3048
- cleanup(() => i.removeChild(e.M));
3065
+ const i = e.V;
3066
+ i.addChild((e.V = n));
3067
+ cleanup(() => i.removeChild(e.V));
3049
3068
  return runWithOwner(e, () => {
3050
3069
  const e = computed(t);
3051
3070
  return boundaryComputed(() => staleValues(() => flatten(read(e))), r);
@@ -3075,8 +3094,8 @@ class RevealController {
3075
3094
  wt;
3076
3095
  bt = [];
3077
3096
  ht;
3078
- ct = signal(false, { pureWrite: true, De: true });
3079
- dt = signal(false, { pureWrite: true, De: true });
3097
+ ct = signal(false, { ownedWrite: true, De: true });
3098
+ dt = signal(false, { ownedWrite: true, De: true });
3080
3099
  _t = true;
3081
3100
  Ot = false;
3082
3101
  constructor(e, t) {
@@ -3098,7 +3117,7 @@ class RevealController {
3098
3117
  if (this.bt.includes(e)) return;
3099
3118
  this.bt.push(e);
3100
3119
  const t = !!untrack(this.St);
3101
- setSignal(e.ct, true), setSignal(e.dt, t ? false : !!untrack(this.wt));
3120
+ (setSignal(e.ct, true), setSignal(e.dt, t ? false : !!untrack(this.wt)));
3102
3121
  untrack(() => this.evaluate());
3103
3122
  }
3104
3123
  unregister(e) {
@@ -3139,8 +3158,8 @@ class CollectionQueue extends Queue {
3139
3158
  ft = new Set();
3140
3159
  Pt;
3141
3160
  lt = true;
3142
- ct = signal(false, { pureWrite: true, De: true });
3143
- dt = signal(false, { pureWrite: true, De: true });
3161
+ ct = signal(false, { ownedWrite: true, De: true });
3162
+ dt = signal(false, { ownedWrite: true, De: true });
3144
3163
  yt;
3145
3164
  gt = false;
3146
3165
  kt;
@@ -3232,7 +3251,7 @@ function createCollectionBoundary(e, t, n, r) {
3232
3251
  const f = computed(() => {
3233
3252
  if (!read(s.ct)) {
3234
3253
  const e = read(o);
3235
- if (!untrack(() => read(s.ct))) return (s.gt = true), e;
3254
+ if (!untrack(() => read(s.ct))) return ((s.gt = true), e);
3236
3255
  }
3237
3256
  if (Se && read(s.dt)) return undefined;
3238
3257
  return n(s);