@solidjs/signals 2.0.0-rc.10 → 2.0.0-rc.13

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.
@@ -100,7 +100,7 @@ const transientStoreNodes = new Set;
100
100
 
101
101
  function canUseSimpleSyncFlush(e) {
102
102
  const t = e.m;
103
- return transitions.size === 0 && activeLanes.size === 0 && e.ft.length === 0 && t.cn.length === 0 && t.A.length === 0 && t.ri.size === 0 && transientStoreNodes.size === 0 && pendingRearms.size === 0;
103
+ return transitions.size === 0 && activeLanes.size === 0 && e.ft.length === 0 && t.cn.length === 0 && t.A.length === 0 && t.ti.size === 0 && transientStoreNodes.size === 0 && pendingRearms.size === 0;
104
104
  }
105
105
 
106
106
  function sweepTransientStoreNodes() {
@@ -149,7 +149,7 @@ function setProjectionWriteActive(e) {
149
149
  le: new Map,
150
150
  cn: [],
151
151
  A: [],
152
- ri: new Set,
152
+ ti: new Set,
153
153
  pe: [],
154
154
  dt: {
155
155
  Tt: [ [], [] ],
@@ -180,7 +180,7 @@ function mergeTransitionState(e, t) {
180
180
  e.A.push(...t.A);
181
181
  t.A.length = 0;
182
182
  }
183
- for (const n of t.ri) e.ri.add(n);
183
+ for (const n of t.ti) e.ti.add(n);
184
184
  for (const [n, i] of t.le) {
185
185
  let t = e.le.get(n);
186
186
  if (!t) e.le.set(n, t = new Set);
@@ -547,7 +547,7 @@ class GlobalQueue extends Queue {
547
547
  static Ve=null;
548
548
  static Ge=null;
549
549
  static We=null;
550
- static ti=null;
550
+ static ri=null;
551
551
  static et=null;
552
552
  static nt=null;
553
553
  static rt=null;
@@ -625,7 +625,11 @@ class GlobalQueue extends Queue {
625
625
  * commit whatever its relation to the committed value — a landing equal to
626
626
  * committed still differs from the override — then _supersedeOverride
627
627
  * decides. Installed with the optimistic engine; only reachable on a node
628
- * that has an override. */
628
+ * that has an override — or, from `mapArray` once a lane pass has run over
629
+ * the map, on a per-slot signal (never CONFIG_OPTIMISTIC): the slot arm
630
+ * publishes a lane pass's write as the slot's derived override, lands a
631
+ * plain pass's write over one, and is the plain `setSignal` otherwise (F1,
632
+ * see optimistic.ts landOnOverride). */
629
633
  static st=null;
630
634
  static fi=null;
631
635
  flush() {
@@ -751,7 +755,7 @@ class GlobalQueue extends Queue {
751
755
  e.Gn = n.Gn;
752
756
  e.cn = n.cn;
753
757
  e.A = n.A;
754
- e.ri = n.ri;
758
+ e.ti = n.ti;
755
759
  currentBatch = this.m = e;
756
760
  }
757
761
  } else {
@@ -787,8 +791,13 @@ class GlobalQueue extends Queue {
787
791
  // sweep or recompute wrote a node it owns): effects computed under it
788
792
  // since are its to apply, not this flush's — runEffect leaves them queued
789
793
  // and the next pass parks them with it (#3319). Everything computed
790
- // mainline applies now.
791
- scheduled = dirtyQueue.EE >= dirtyQueue.ln || activeTransition !== null;
794
+ // mainline applies now. A write the finalize staged in the ambient
795
+ // batch with no subscriber to dirty (an optimistic store settle's
796
+ // keyset bump under a reader that never tracks the key set) is work
797
+ // too — the fast drain and the park exit already count it — so the
798
+ // next round commits it and the woken re-entry below does not adopt
799
+ // it into a parked transaction it never belonged to (matrix F6).
800
+ scheduled = dirtyQueue.EE >= dirtyQueue.ln || activeTransition !== null || this.m.Gn.length !== 0;
792
801
  // Run lane effects first (for ready lanes), then regular effects
793
802
  activeLanes.size && GlobalQueue.si(EFFECT_RENDER);
794
803
  this.run(EFFECT_RENDER);
@@ -802,9 +811,14 @@ class GlobalQueue extends Queue {
802
811
  // idle pass: entering adopts the ambient batch, and staged or dirty
803
812
  // ambient work would be held behind flights it never read. `scheduled`
804
813
  // is that test here — after the park exit as well as the normal one:
805
- // it was recomputed from the heap this pass, every write since re-armed
806
- // it, and optimistic ambient nodes reverted with the finalize — so a
807
- // wake in a pass with work simply falls to the next. Entering re-arms
814
+ // it was recomputed from the heap and the ambient batch's staged nodes
815
+ // this pass, every write since re-armed it, and optimistic ambient
816
+ // nodes reverted with the finalize — so a wake in a pass with work
817
+ // simply falls to the next. (A staged node with no subscriber — the
818
+ // finalize's keyset bump under a length-only reader — used to be
819
+ // missed here: the wake adopted it, stamped it, and a later ambient
820
+ // write to the same node joined the parked transaction and never
821
+ // reverted; matrix F6.) Entering re-arms
808
822
  // it itself; a dead (completed) wake is a bare return in
809
823
  // initTransition, and the loop moves on to the next.
810
824
  while (!scheduled && !activeTransition && wokenTransitions.length) this.initTransition(wokenTransitions.pop());
@@ -924,7 +938,7 @@ class GlobalQueue extends Queue {
924
938
  activeTransition.cn.push(n);
925
939
  }
926
940
  if (t.A.length) activeTransition.A.push(...t.A);
927
- for (const e of t.ri) activeTransition.ri.add(e);
941
+ for (const e of t.ti) activeTransition.ti.add(e);
928
942
  // Gated readers recorded against the ambient batch move with it: their
929
943
  // replay-at-commit now happens at the transaction's completion.
930
944
  if (t.In.size) {
@@ -1043,7 +1057,7 @@ function commitPendingNode(e) {
1043
1057
  e.ce = e._e;
1044
1058
  e._e = NOT_PENDING;
1045
1059
  }
1046
- if (e.C & CONFIG_HAS_COMPANIONS) GlobalQueue.ti(e);
1060
+ if (e.C & CONFIG_HAS_COMPANIONS) GlobalQueue.ri(e);
1047
1061
  return;
1048
1062
  }
1049
1063
  if (e._e !== NOT_PENDING) {
@@ -1081,7 +1095,7 @@ function commitPendingNode(e) {
1081
1095
  // against the frame. read()'s reveal carve-out keys on the mark (#3305).
1082
1096
  else e.C |= CONFIG_INPUTS_PUBLISHED;
1083
1097
  if (t.o != null && (t.o._n !== null || t.o.fn !== null)) GlobalQueue.en(t, false, true);
1084
- if (e.C & CONFIG_HAS_COMPANIONS) GlobalQueue.ti(e);
1098
+ if (e.C & CONFIG_HAS_COMPANIONS) GlobalQueue.ri(e);
1085
1099
  }
1086
1100
 
1087
1101
  // Store commit hook (INTERNALS-STORE-STATE.md §3): installed by the store
@@ -1213,7 +1227,7 @@ function finalizePureQueue(e = null, t = false) {
1213
1227
  // hook; the hook iterates, clears, and schedules (keeping the loop out of
1214
1228
  // core lets esbuild shake it — rollup already folds the null guard). The
1215
1229
  // completing transition scopes the clear to its own layer keys (#2899).
1216
- if (t.ri.size) GlobalQueue._t(t.ri, e);
1230
+ if (t.ti.size) GlobalQueue._t(t.ti, e);
1217
1231
  // Held-truth reveal wake (#3164), post-revert by construction: this
1218
1232
  // finalize committed confirming truth whose subscribers were masked all
1219
1233
  // hold — some re-derived against the committed view (the staging, or a
@@ -655,7 +655,7 @@ GlobalQueue.Ge = updatePendingSignal;
655
655
 
656
656
  GlobalQueue.We = updateChildCompanions;
657
657
 
658
- GlobalQueue.ti = snapCompanionsToState;
658
+ GlobalQueue.ri = snapCompanionsToState;
659
659
 
660
660
  GlobalQueue.et = latestRead;
661
661