@solidjs/signals 2.0.0-beta.30 → 2.0.0-beta.32

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/node.cjs CHANGED
@@ -806,6 +806,12 @@ class GlobalQueue extends Queue {
806
806
  }
807
807
  if (t.G.length) activeTransition.G.push(...t.G);
808
808
  for (const e of t.V) activeTransition.V.add(e);
809
+ // Gated readers recorded against the ambient batch move with it: their
810
+ // replay-at-commit now happens at the transaction's completion.
811
+ if (t.q.size) {
812
+ for (const e of t.q) activeTransition.q.add(e);
813
+ t.q.clear();
814
+ }
809
815
  currentBatch = this.m = activeTransition;
810
816
  }
811
817
  for (const e of activeLanes) {
@@ -867,10 +873,10 @@ function commitPendingNode(e) {
867
873
  e.We = e.k;
868
874
  e.k = NOT_PENDING;
869
875
  // Set _modified for effects, but not for tracked effects (they handle their own scheduling)
870
- if (e.Fe && e.Fe !== EFFECT_TRACKED) e.xe = true;
876
+ if (e.Fe && e.Fe !== EFFECT_TRACKED) e.Qe = true;
871
877
  }
872
878
  t.D &= ~REACTIVE_MANUAL_WRITE;
873
- if (!(t.Qe & STATUS_PENDING)) t.Qe &= ~STATUS_UNINITIALIZED;
879
+ if (!(t.xe & STATUS_PENDING)) t.xe &= ~STATUS_UNINITIALIZED;
874
880
  if (t.He !== null || t.Me !== null) GlobalQueue.ee(t, false, true);
875
881
  if (e._ || e.R) GlobalQueue.Ee(e);
876
882
  }
@@ -899,13 +905,19 @@ function finalizePureQueue(e = null, t = false) {
899
905
  // which installed the engine's hooks.
900
906
  if (t.L.length) GlobalQueue.Ie(t.L);
901
907
  // Replay entanglement: subs recorded by the read-time gate get rescheduled
902
- // so they re-run with the now-committed values visible.
903
- if (e && e.q.size) {
904
- for (const t of e.q) {
905
- if (t.D & REACTIVE_DISPOSED) continue;
906
- enqueueSub(t);
908
+ // so they re-run with the now-committed values visible. The ambient batch
909
+ // replays too laneReadsCommitted records readers whose committed-view
910
+ // read hid a same-tick plain write that just committed above (#2963).
911
+ if (t.q.size) {
912
+ for (const e of t.q) {
913
+ if (e.D & REACTIVE_DISPOSED) continue;
914
+ enqueueSub(e);
907
915
  }
908
- e.q.clear();
916
+ t.q.clear();
917
+ // A completing transition keeps the outer flush loop alive by itself;
918
+ // the ambient batch needs the re-arm or the replay sits in the heap
919
+ // until the next unrelated write.
920
+ schedule();
909
921
  }
910
922
  // Declared motion ends with the transaction: settle (or plain flush end
911
923
  // for ambient marks) releases each registration's refcount. A non-empty
@@ -1006,7 +1018,7 @@ function reporterBlocksSource(e, t) {
1006
1018
  e = e.t;
1007
1019
  }
1008
1020
  }
1009
- return !!(e.Qe & STATUS_PENDING && e.me instanceof NotReadyError && e.me.source === t);
1021
+ return !!(e.xe & STATUS_PENDING && e.me instanceof NotReadyError && e.me.source === t);
1010
1022
  }
1011
1023
 
1012
1024
  function transitionComplete(e) {
@@ -1022,7 +1034,7 @@ function transitionComplete(e) {
1022
1034
  }
1023
1035
  r.delete(e);
1024
1036
  }
1025
- if (!i) e.$.delete(n); else if (n.Qe & STATUS_PENDING && n.me?.source === n) {
1037
+ if (!i) e.$.delete(n); else if (n.xe & STATUS_PENDING && n.me?.source === n) {
1026
1038
  t = false;
1027
1039
  break;
1028
1040
  }
@@ -1061,8 +1073,8 @@ function runInTransition(e, t) {
1061
1073
  */ function enqueueSub(e) {
1062
1074
  if (e.Fe === EFFECT_TRACKED) {
1063
1075
  const t = e;
1064
- if (!t.xe) {
1065
- t.xe = true;
1076
+ if (!t.Qe) {
1077
+ t.Qe = true;
1066
1078
  t.Ze.enqueue(EFFECT_USER, t.Xe);
1067
1079
  }
1068
1080
  return;
@@ -1485,7 +1497,7 @@ function unlinkSubs(e) {
1485
1497
  // this same last-one-out check when that observer releases (the
1486
1498
  // untracked-read dispose in core.ts guards on pending identically).
1487
1499
  const e = t;
1488
- e.ke && e.Ue & CONFIG_AUTO_DISPOSE && !(e.D & REACTIVE_ZOMBIE) && !(e.Qe & STATUS_PENDING) && unobserved(e);
1500
+ e.ke && e.Ue & CONFIG_AUTO_DISPOSE && !(e.D & REACTIVE_ZOMBIE) && !(e.xe & STATUS_PENDING) && unobserved(e);
1489
1501
  }
1490
1502
  }
1491
1503
  return n;
@@ -1618,7 +1630,7 @@ function forEachDependent(e, t) {
1618
1630
  // callbacks handle their own release (settleAutodispose in handleAsync); this
1619
1631
  // covers derivatively-pending dependents, which have no callbacks of their own.
1620
1632
  function releaseIfSettledUnobserved(e) {
1621
- e.ke && e.Ue & CONFIG_AUTO_DISPOSE && !e.U && !(e.D & REACTIVE_ZOMBIE) && !(e.Qe & STATUS_PENDING) && unobserved(e);
1633
+ e.ke && e.Ue & CONFIG_AUTO_DISPOSE && !e.U && !(e.D & REACTIVE_ZOMBIE) && !(e.xe & STATUS_PENDING) && unobserved(e);
1622
1634
  }
1623
1635
 
1624
1636
  // Error-path sweep: notifyStatus(STATUS_ERROR) clears dependents' pending
@@ -1684,7 +1696,7 @@ function settlePendingSource(e) {
1684
1696
  setPendingError(o, s);
1685
1697
  i !== null && i(o);
1686
1698
  } else {
1687
- o.Qe &= ~STATUS_PENDING;
1699
+ o.xe &= ~STATUS_PENDING;
1688
1700
  setPendingError(o);
1689
1701
  i !== null && i(o);
1690
1702
  if (o.At) {
@@ -1738,7 +1750,7 @@ function handleAsync(e, t, n) {
1738
1750
  // are the transaction's reveal machinery and always re-enter.
1739
1751
  const settleTransition = () => {
1740
1752
  const t = resolveTransition(e);
1741
- if (t && e.Qe & STATUS_UNINITIALIZED && !currentTransition(t).$.has(e)) {
1753
+ if (t && e.xe & STATUS_UNINITIALIZED && !currentTransition(t).$.has(e)) {
1742
1754
  // Drop the stale stamp too: the plain settle write (setSignal) and the
1743
1755
  // stash-path restamp both re-enter the transaction through it.
1744
1756
  e.T = null;
@@ -1765,7 +1777,7 @@ function handleAsync(e, t, n) {
1765
1777
  // with the new value, creating a fresh Promise that supersedes this one.
1766
1778
  if (e.D & (REACTIVE_DIRTY | REACTIVE_OPTIMISTIC_DIRTY)) return;
1767
1779
  settleTransition();
1768
- const o = !!(e.Qe & STATUS_UNINITIALIZED);
1780
+ const o = !!(e.xe & STATUS_UNINITIALIZED);
1769
1781
  trimStaleDeps(e);
1770
1782
  clearStatus(e);
1771
1783
  const s = resolveLane(e);
@@ -1839,7 +1851,7 @@ function handleAsync(e, t, n) {
1839
1851
  // Returns whether the node released, so the iterator branch can stop
1840
1852
  // pulling values instead of pumping an unobserved stream forever (#2935).
1841
1853
  const settleAutodispose = () => {
1842
- if (e.Ue & CONFIG_AUTO_DISPOSE && !e.U && !(e.Qe & STATUS_PENDING)) {
1854
+ if (e.Ue & CONFIG_AUTO_DISPOSE && !e.U && !(e.xe & STATUS_PENDING)) {
1843
1855
  unobserved(e);
1844
1856
  return true;
1845
1857
  }
@@ -1897,8 +1909,23 @@ function handleAsync(e, t, n) {
1897
1909
  };
1898
1910
  const iterate = () => {
1899
1911
  let u, l, a = false, c = false, f = true;
1900
- n.next().then(n => {
1901
- if (f) {
1912
+ // Protocol tolerance, matching `for await`: `await` unwraps whatever
1913
+ // next() returns — a thenable OR a bare IteratorResult. Real producers
1914
+ // use the bare form as a promise-free fast path when a value is already
1915
+ // buffered (seroval's deserialized streams do), so a bare result is
1916
+ // assimilated as an already-settled step instead of crashing on `.then`.
1917
+ const E = n.next();
1918
+ const d = isThenable(E) ? E : {
1919
+ then: e => void e(E)
1920
+ };
1921
+ d.then(n => {
1922
+ // The sync stash only serves the INITIAL drain (handleAsync's caller
1923
+ // consumes syncValue / throws NotReady from it). A sync-settled step
1924
+ // after an async gap — seroval buffering values between pulls, a
1925
+ // sync-thenable producer mid-stream — has no caller reading the
1926
+ // stash: it must write through the async path or the value is
1927
+ // silently dropped.
1928
+ if (f && s) {
1902
1929
  u = n;
1903
1930
  a = true;
1904
1931
  if (n.done) i = true;
@@ -1961,7 +1988,7 @@ function clearStatus(e, t = false) {
1961
1988
  // (Unconditional: _reask is baked into the node literals, so this is a
1962
1989
  // plain store to an existing slot — no shape change.)
1963
1990
  e.Nt = false;
1964
- e.Qe = t ? 0 : e.Qe & STATUS_UNINITIALIZED;
1991
+ e.xe = t ? 0 : e.xe & STATUS_UNINITIALIZED;
1965
1992
  if (e.me) setPendingError(e);
1966
1993
  // Update pending signal for isPending() reactivity (companions only exist
1967
1994
  // once the verdict layer created them, which installs the hooks).
@@ -1980,13 +2007,13 @@ function notifyStatus(e, t, n, r, i) {
1980
2007
  if (!r) {
1981
2008
  if (t === STATUS_PENDING && o) {
1982
2009
  addPendingSource(e, o);
1983
- e.Qe = STATUS_PENDING | e.Qe & STATUS_UNINITIALIZED;
2010
+ e.xe = STATUS_PENDING | e.xe & STATUS_UNINITIALIZED;
1984
2011
  // Preserve the current source on this propagation so render-effect notification
1985
2012
  // can register every distinct pending source with the transition.
1986
2013
  setPendingError(e, o, n);
1987
2014
  } else {
1988
2015
  clearPendingSources(e);
1989
- e.Qe = t | (t !== STATUS_ERROR ? e.Qe & STATUS_UNINITIALIZED : 0);
2016
+ e.xe = t | (t !== STATUS_ERROR ? e.xe & STATUS_UNINITIALIZED : 0);
1990
2017
  e.me = n;
1991
2018
  }
1992
2019
  GlobalQueue.ce !== null && GlobalQueue.ce(e);
@@ -2136,11 +2163,11 @@ function recompute(e, t = false) {
2136
2163
  }
2137
2164
  let r = !!(e.D & REACTIVE_OPTIMISTIC_DIRTY);
2138
2165
  const i = e.A !== undefined && e.A !== NOT_PENDING;
2139
- const o = !!(e.Qe & STATUS_UNINITIALIZED);
2166
+ const o = !!(e.xe & STATUS_UNINITIALIZED);
2140
2167
  // Outgoing error, captured before the compute clears status: if this run
2141
2168
  // recovers to an unchanged value, dependents still holding this object must
2142
2169
  // be swept (settleErroredDependents, #2949).
2143
- const s = e.Qe & STATUS_ERROR ? e.me : undefined;
2170
+ const s = e.xe & STATUS_ERROR ? e.me : undefined;
2144
2171
  // Re-ask classification lives in the verdict module; capture the flag before
2145
2172
  // the recompute wipes _flags below.
2146
2173
  const u = (e.D & REACTIVE_REASK) !== 0;
@@ -2202,7 +2229,7 @@ function recompute(e, t = false) {
2202
2229
  // On a status-free node clearStatus is a guaranteed no-op: every branch
2203
2230
  // in its body is gated on one of these fields, and with _statusFlags === 0
2204
2231
  // the flags write (create or not) stores the 0 already there.
2205
- if (e.Qe !== 0 || e.yt !== undefined || e.me || e.Nt || e.At || e.je !== undefined || e._ !== undefined || e.R !== undefined || e.rt !== null) clearStatus(e, t);
2232
+ if (e.xe !== 0 || e.yt !== undefined || e.me || e.Nt || e.At || e.je !== undefined || e._ !== undefined || e.R !== undefined || e.rt !== null) clearStatus(e, t);
2206
2233
  // _optimisticLane is only ever assigned by engine paths.
2207
2234
  if (e.i) GlobalQueue.De(e);
2208
2235
  } catch (t) {
@@ -2242,7 +2269,7 @@ function recompute(e, t = false) {
2242
2269
  // gate: the explicit recompute(node, true) inside effect() does not enqueue, so
2243
2270
  // effect() can call its runner synchronously for the first run.
2244
2271
  if (n && l) {
2245
- e.xe = !e.me;
2272
+ e.Qe = !e.me;
2246
2273
  // Reuse one bound runner per effect — runEffect no-ops on a stale
2247
2274
  // `_modified`, so re-enqueueing the same function is harmless.
2248
2275
  if (!t) e.Ze.enqueue(n, e.Ct ??= GlobalQueue.te.bind(null, e));
@@ -2295,13 +2322,13 @@ function recompute(e, t = false) {
2295
2322
  if (s !== undefined && !l && !e.me) settleErroredDependents(e, s);
2296
2323
  }
2297
2324
  currentOptimisticLane = E;
2298
- const O = e.k !== NOT_PENDING || e.He !== null || e.Me !== null || (e.Qe & (STATUS_PENDING | STATUS_UNINITIALIZED)) !== 0;
2325
+ const O = e.k !== NOT_PENDING || e.He !== null || e.Me !== null || (e.xe & (STATUS_PENDING | STATUS_UNINITIALIZED)) !== 0;
2299
2326
  // Override-covered holds (hasOverride) always queue: their commit belongs
2300
2327
  // to their own transition's schedule (A18 re-rule) and is unobservable
2301
2328
  // under the override (A17). Revert no longer commits anything, so an
2302
2329
  // unqueued covered hold would leak (INV-7) once the revert clears
2303
2330
  // _transition.
2304
- O && (!t || e.Qe & STATUS_PENDING) && (!e.T || i) && queuePendingNode(e);
2331
+ O && (!t || e.xe & STATUS_PENDING) && (!e.T || i) && queuePendingNode(e);
2305
2332
  e.T && n && activeTransition !== e.T && runInTransition(e.T, () => recompute(e));
2306
2333
  }
2307
2334
 
@@ -2351,7 +2378,7 @@ function computed(e, t) {
2351
2378
  ft: null,
2352
2379
  ot: null,
2353
2380
  D: t?.lazy ? REACTIVE_LAZY : REACTIVE_NONE,
2354
- Qe: STATUS_UNINITIALIZED,
2381
+ xe: STATUS_UNINITIALIZED,
2355
2382
  H: clock,
2356
2383
  k: NOT_PENDING,
2357
2384
  Me: null,
@@ -2396,7 +2423,7 @@ function computed(e, t) {
2396
2423
  ft: null,
2397
2424
  ot: null,
2398
2425
  D: REACTIVE_LAZY,
2399
- Qe: STATUS_UNINITIALIZED,
2426
+ xe: STATUS_UNINITIALIZED,
2400
2427
  H: clock,
2401
2428
  k: NOT_PENDING,
2402
2429
  Me: null,
@@ -2404,7 +2431,7 @@ function computed(e, t) {
2404
2431
  lt: null,
2405
2432
  T: null,
2406
2433
  Nt: false,
2407
- xe: false,
2434
+ Qe: false,
2408
2435
  bt: undefined,
2409
2436
  Dt: t,
2410
2437
  wt: n,
@@ -2437,7 +2464,7 @@ function setupComputedNode(e, t) {
2437
2464
  if (GlobalQueue.ue !== null) GlobalQueue.ue(e);
2438
2465
  !t?.lazy && recompute(e, true);
2439
2466
  if (snapshotCaptureActive && !t?.lazy) {
2440
- if (!(e.Qe & STATUS_PENDING) && !(e.Ue & CONFIG_NO_SNAPSHOT)) {
2467
+ if (!(e.xe & STATUS_PENDING) && !(e.Ue & CONFIG_NO_SNAPSHOT)) {
2441
2468
  e.Le = e.We === undefined ? NO_SNAPSHOT : e.We;
2442
2469
  snapshotSources.add(e);
2443
2470
  }
@@ -2458,7 +2485,7 @@ function signal(e, t, n = null) {
2458
2485
  k: NOT_PENDING
2459
2486
  };
2460
2487
  n && (n.rt = r);
2461
- if (snapshotCaptureActive && !(r.Ue & CONFIG_NO_SNAPSHOT) && !((n?.Qe ?? 0) & STATUS_PENDING)) {
2488
+ if (snapshotCaptureActive && !(r.Ue & CONFIG_NO_SNAPSHOT) && !((n?.xe ?? 0) & STATUS_PENDING)) {
2462
2489
  r.Le = e === undefined ? NO_SNAPSHOT : e;
2463
2490
  snapshotSources.add(r);
2464
2491
  }
@@ -2589,7 +2616,7 @@ function read(e) {
2589
2616
  }
2590
2617
  }
2591
2618
  }
2592
- if (i.Qe & STATUS_PENDING) {
2619
+ if (i.xe & STATUS_PENDING) {
2593
2620
  if (t && !(stale && i.T && activeTransition !== i.T)) {
2594
2621
  // Per-lane suspension lives with the engine (a non-null lane implies it
2595
2622
  // is installed): under a lane, only same-lane pending async without an
@@ -2598,10 +2625,10 @@ function read(e) {
2598
2625
  if (!tracking && e !== t) link(e, t);
2599
2626
  throw i.me;
2600
2627
  }
2601
- } else if (t && i !== e && i.Qe & STATUS_UNINITIALIZED) {
2628
+ } else if (t && i !== e && i.xe & STATUS_UNINITIALIZED) {
2602
2629
  if (!tracking && e !== t) link(e, t);
2603
2630
  throw i.me;
2604
- } else if (!t && i.Qe & STATUS_UNINITIALIZED) {
2631
+ } else if (!t && i.xe & STATUS_UNINITIALIZED) {
2605
2632
  throw i.me;
2606
2633
  }
2607
2634
  }
@@ -2609,7 +2636,7 @@ function read(e) {
2609
2636
  // firewall-backed reads follow the same rules (memo parity, #2897 ruling):
2610
2637
  // an errored derive throws for every late reader instead of silently
2611
2638
  // serving node values (the seed, or last-good data after a failed refetch).
2612
- if (i.ke && i.Qe & STATUS_ERROR) {
2639
+ if (i.ke && i.xe & STATUS_ERROR) {
2613
2640
  // Only a genuine reactive re-read may retry an errored async source:
2614
2641
  // - tracking: owned/tracked scope only (never events / `untrack` / effect side-effect phase)
2615
2642
  // - !pendingCheckActive: an `isPending` probe observes the error, never refetches
@@ -2650,7 +2677,7 @@ function read(e) {
2650
2677
  // Record that this isPending() probe observed the fresh pending value, so
2651
2678
  // the probe doesn't pair "pending" with the new value (#2831).
2652
2679
  if (pendingCheckActive) GlobalQueue.Te(e, o);
2653
- if (!t && i === e && typeof n.ke === "function" && e.Ue & CONFIG_AUTO_DISPOSE && !(i.Qe & STATUS_PENDING) && !e.U) {
2680
+ if (!t && i === e && typeof n.ke === "function" && e.Ue & CONFIG_AUTO_DISPOSE && !(i.xe & STATUS_PENDING) && !e.U) {
2654
2681
  unobserved(e);
2655
2682
  }
2656
2683
  return o;
@@ -2667,7 +2694,7 @@ function setSignal(e, t) {
2667
2694
  if (typeof t === "function") t = t(n);
2668
2695
  // Uninitialized check first: the first commit has no previous value, so the
2669
2696
  // user comparator must not run against `undefined` (matches recompute).
2670
- const r = !!(e.Qe & STATUS_UNINITIALIZED) || !e.ht || !e.ht(n, t);
2697
+ const r = !!(e.xe & STATUS_UNINITIALIZED) || !e.ht || !e.ht(n, t);
2671
2698
  if (!r) return t;
2672
2699
  if (e.k === NOT_PENDING) queuePendingNode(e);
2673
2700
  e.k = t;
@@ -2960,7 +2987,7 @@ function isUndefined(e) {
2960
2987
  const n = e.A !== NOT_PENDING;
2961
2988
  const r = n ? unwrapOverride(e.A) : e.We;
2962
2989
  if (typeof t === "function") t = t(r);
2963
- const i = !!(e.Qe & STATUS_UNINITIALIZED) || !e.ht || !e.ht(r, t);
2990
+ const i = !!(e.xe & STATUS_UNINITIALIZED) || !e.ht || !e.ht(r, t);
2964
2991
  if (!i) {
2965
2992
  // Same-value write with an active override still entangles the current
2966
2993
  // action's transition — the hold must outlast all overlapping actions.
@@ -3001,7 +3028,7 @@ function isUndefined(e) {
3001
3028
  */ function transitionBlocked(e) {
3002
3029
  for (let t = 0; t < e.L.length; t++) {
3003
3030
  const n = e.L[t];
3004
- if (hasActiveOverride(n) && "Qe" in n && n.Qe & STATUS_PENDING && n.me instanceof NotReadyError) {
3031
+ if (hasActiveOverride(n) && "xe" in n && n.xe & STATUS_PENDING && n.me instanceof NotReadyError) {
3005
3032
  return true;
3006
3033
  }
3007
3034
  }
@@ -3019,7 +3046,7 @@ function resolveOptimisticNodes(e) {
3019
3046
  // Revert is a pure drop: there is no revert target to commit —
3020
3047
  // override-covered authoritative values hold in _pendingValue and
3021
3048
  // elevate on their OWN transition's schedule (A18 as re-ruled 2026-07-07).
3022
- if (!(t.Qe & STATUS_PENDING)) t.Qe &= ~STATUS_UNINITIALIZED;
3049
+ if (!(t.xe & STATUS_PENDING)) t.xe &= ~STATUS_UNINITIALIZED;
3023
3050
  const r = t.A;
3024
3051
  t.A = NOT_PENDING;
3025
3052
  if (r !== NOT_PENDING && t.We !== unwrapOverride(r)) insertSubs(t, true);
@@ -3097,7 +3124,19 @@ function cleanupCompletedLanes(e) {
3097
3124
  * read()'s value selection under a lane: return the committed `_value` for
3098
3125
  * optimistic/lane-assigned signals, stale-mode reads, and pending owners.
3099
3126
  */ function laneReadsCommitted(e, t, n) {
3100
- return e.A !== undefined || !!e.i || t === e && stale && n.t !== e || !!(t.Qe & STATUS_PENDING);
3127
+ if (e.A !== undefined || !!e.i || !!(t.xe & STATUS_PENDING)) return true;
3128
+ if (t === e && stale && n.t !== e) {
3129
+ // The committed view can hide a same-tick ambient write (a lane member —
3130
+ // even just an isPending companion flip — puts the reader "under a lane"
3131
+ // against unrelated plain writes). With no transaction the write commits
3132
+ // at THIS flush's end with no re-delivery, so record the reader for
3133
+ // replay at commit — the same contract gatedRead provides when a
3134
+ // transaction is active (#2963). If a transaction forms mid-flush,
3135
+ // initTransition carries the recording over to it.
3136
+ if (e.k !== NOT_PENDING && activeTransition === null) globalQueue.m.q.add(n);
3137
+ return true;
3138
+ }
3139
+ return false;
3101
3140
  }
3102
3141
 
3103
3142
  /**
@@ -3223,7 +3262,7 @@ function collectPendingSources(e) {
3223
3262
  // not flow through it — matching the rails' behavior, where propagation
3224
3263
  // stopped at errored nodes. A DIRECT mark on an errored node still reads
3225
3264
  // pending (the count check above), also matching.
3226
- if (e.Qe & STATUS_ERROR) return false;
3265
+ if (e.xe & STATUS_ERROR) return false;
3227
3266
  if (t.has(e)) return false;
3228
3267
  t.add(e);
3229
3268
  const n = e.Be;
@@ -3256,7 +3295,7 @@ function quietPending(e) {
3256
3295
  }
3257
3296
 
3258
3297
  function newQuestionInFlight(e) {
3259
- return !!(e.Qe & STATUS_PENDING) && !(e.Qe & STATUS_UNINITIALIZED) && !quietPending(e);
3298
+ return !!(e.xe & STATUS_PENDING) && !(e.xe & STATUS_UNINITIALIZED) && !quietPending(e);
3260
3299
  }
3261
3300
 
3262
3301
  function computePendingState(e) {
@@ -3273,9 +3312,9 @@ function computePendingState(e) {
3273
3312
  return newQuestionInFlight(n);
3274
3313
  }
3275
3314
  if (n && e.k !== NOT_PENDING && !hasActiveOverride(e)) {
3276
- return !!(n.D & REACTIVE_MANUAL_WRITE) || !n.lt && !(n.Qe & STATUS_PENDING) || !!(n.Qe & STATUS_PENDING) && quietPending(n);
3315
+ return !!(n.D & REACTIVE_MANUAL_WRITE) || !n.lt && !(n.xe & STATUS_PENDING) || !!(n.xe & STATUS_PENDING) && quietPending(n);
3277
3316
  }
3278
- if (e.k !== NOT_PENDING && !(t.Qe & STATUS_UNINITIALIZED)) {
3317
+ if (e.k !== NOT_PENDING && !(t.xe & STATUS_UNINITIALIZED)) {
3279
3318
  if (hasActiveOverride(e)) return !e.ht || !e.ht(e.k, unwrapOverride(e.A));
3280
3319
  return true;
3281
3320
  }
@@ -3385,12 +3424,12 @@ function getLatestValueComputed(e) {
3385
3424
  }
3386
3425
  i = read(t);
3387
3426
  } catch (t) {
3388
- if (t instanceof NotReadyError && (!context || !(e.Qe & STATUS_UNINITIALIZED))) return r;
3427
+ if (t instanceof NotReadyError && (!context || !(e.xe & STATUS_UNINITIALIZED))) return r;
3389
3428
  throw t;
3390
3429
  } finally {
3391
3430
  setLatestReadActive(n);
3392
3431
  }
3393
- if (t.Qe & STATUS_PENDING) return r;
3432
+ if (t.xe & STATUS_PENDING) return r;
3394
3433
  if (stale && currentOptimisticLane && t.i) {
3395
3434
  const e = findLane(t.i);
3396
3435
  const n = findLane(currentOptimisticLane);
@@ -3409,7 +3448,7 @@ function getLatestValueComputed(e) {
3409
3448
  /** The isPending()-probe read path, installed as GlobalQueue._pendingCheck. */ function pendingCheckRead(e, t, n, r) {
3410
3449
  setPendingCheckActive(false);
3411
3450
  if (typeof e.ke === "function") prepareComputed(e, true);
3412
- const i = n.Qe;
3451
+ const i = n.xe;
3413
3452
  if (t && i & STATUS_PENDING && i & STATUS_UNINITIALIZED) {
3414
3453
  if (tracking && e !== t) link(e, t);
3415
3454
  setPendingCheckActive(true);
@@ -3425,7 +3464,7 @@ function recordFreshRead(e, t) {
3425
3464
  }
3426
3465
 
3427
3466
  function applyReask(e, t) {
3428
- const n = !!(e.Qe & STATUS_PENDING);
3467
+ const n = !!(e.xe & STATUS_PENDING);
3429
3468
  const r = t && !(n && !e.Nt);
3430
3469
  const i = n && e.Nt !== r;
3431
3470
  e.Nt = r;
@@ -3468,7 +3507,7 @@ function isPending(e) {
3468
3507
  } catch (e) {
3469
3508
  collectPending();
3470
3509
  if (e instanceof NotReadyError) {
3471
- const t = !!(e.source?.Qe & STATUS_UNINITIALIZED);
3510
+ const t = !!(e.source?.xe & STATUS_UNINITIALIZED);
3472
3511
  if (r.found && !t) return true;
3473
3512
  if (context && t) throw e;
3474
3513
  }
@@ -3515,7 +3554,7 @@ GlobalQueue.Re = witnessAffects;
3515
3554
 
3516
3555
  function notifyEffectStatus(e, t) {
3517
3556
  // Use passed values if provided, otherwise read from node
3518
- const n = e !== undefined ? e : this.Qe;
3557
+ const n = e !== undefined ? e : this.xe;
3519
3558
  const r = t !== undefined ? t : this.me;
3520
3559
  if (n & STATUS_ERROR) {
3521
3560
  this.Ze.notify(this, STATUS_PENDING, 0);
@@ -3529,8 +3568,8 @@ function notifyEffectStatus(e, t) {
3529
3568
  // phase takes the success arm instead. Blocked forwards (explicit
3530
3569
  // `status` arg without node-state writes) don't queue: the status
3531
3570
  // re-propagates unblocked at commit.
3532
- if (this.Qe & STATUS_ERROR) {
3533
- this.xe = true;
3571
+ if (this.xe & STATUS_ERROR) {
3572
+ this.Qe = true;
3534
3573
  this.Ze.enqueue(this.Fe, this.Ct ??= runEffect.bind(null, this));
3535
3574
  }
3536
3575
  return;
@@ -3545,7 +3584,7 @@ function notifyEffectStatus(e, t) {
3545
3584
  }
3546
3585
 
3547
3586
  function runEffect(e) {
3548
- if (!e.xe || e.D & REACTIVE_DISPOSED) return;
3587
+ if (!e.Qe || e.D & REACTIVE_DISPOSED) return;
3549
3588
  // Error arm (#2840), user effects only: a compute-phase error that is still
3550
3589
  // the node's settled state at effect time runs the bundle's error handler in
3551
3590
  // this same imperative, writable scope. Unwrap the StatusError used for
@@ -3556,10 +3595,10 @@ function runEffect(e) {
3556
3595
  // Render effects bypass: their errors route to boundaries synchronously in
3557
3596
  // notifyEffectStatus, and a runner queued by an earlier valueChanged in the
3558
3597
  // same flush must not be hijacked by a later-arriving error status.
3559
- if (e.Qe & STATUS_ERROR && e.Fe === EFFECT_USER) {
3598
+ if (e.xe & STATUS_ERROR && e.Fe === EFFECT_USER) {
3560
3599
  const t = unwrapStatusError(e.me);
3561
3600
  e.bt = e.We;
3562
- e.xe = false;
3601
+ e.Qe = false;
3563
3602
  try {
3564
3603
  e.wt ? e.wt(t, () => {
3565
3604
  const t = e.Et;
@@ -3584,14 +3623,14 @@ function runEffect(e) {
3584
3623
  e.Et = n;
3585
3624
  } catch (t) {
3586
3625
  e.me = new StatusError(e, t);
3587
- e.Qe |= STATUS_ERROR;
3626
+ e.xe |= STATUS_ERROR;
3588
3627
  if (!e.Ze.notify(e, STATUS_ERROR, STATUS_ERROR)) {
3589
3628
  haltReactivity(t);
3590
3629
  throw t;
3591
3630
  }
3592
3631
  } finally {
3593
3632
  e.bt = e.We;
3594
- e.xe = false;
3633
+ e.Qe = false;
3595
3634
  }
3596
3635
  }
3597
3636
 
@@ -3603,9 +3642,9 @@ GlobalQueue.te = runEffect;
3603
3642
  * Uses stale reads.
3604
3643
  */ function trackedEffect(e, t) {
3605
3644
  const run = () => {
3606
- if (!n.xe || n.D & REACTIVE_DISPOSED) return;
3645
+ if (!n.Qe || n.D & REACTIVE_DISPOSED) return;
3607
3646
  try {
3608
- n.xe = false;
3647
+ n.Qe = false;
3609
3648
  recompute(n);
3610
3649
  } finally {}
3611
3650
  };
@@ -3621,10 +3660,10 @@ GlobalQueue.te = runEffect;
3621
3660
  });
3622
3661
  n.Et = undefined;
3623
3662
  n.Ue = n.Ue & ~CONFIG_AUTO_DISPOSE | CONFIG_CHILDREN_FORBIDDEN;
3624
- n.xe = true;
3663
+ n.Qe = true;
3625
3664
  n.Fe = EFFECT_TRACKED;
3626
3665
  n.yt = (e, t) => {
3627
- const r = e !== undefined ? e : n.Qe;
3666
+ const r = e !== undefined ? e : n.xe;
3628
3667
  if (r & STATUS_ERROR) {
3629
3668
  n.Ze.notify(n, STATUS_PENDING, 0);
3630
3669
  const e = t !== undefined ? t : n.me;
@@ -5629,7 +5668,7 @@ function prepareStoreWrite(e, t, n) {
5629
5668
  }
5630
5669
  const r = e[STORE_VALUE];
5631
5670
  const i = r[n];
5632
- if (snapshotCaptureActive && typeof n !== "symbol" && !((e[STORE_FIREWALL]?.Qe ?? 0) & STATUS_PENDING)) {
5671
+ if (snapshotCaptureActive && typeof n !== "symbol" && !((e[STORE_FIREWALL]?.xe ?? 0) & STATUS_PENDING)) {
5633
5672
  if (!e[STORE_SNAPSHOT_PROPS]) {
5634
5673
  e[STORE_SNAPSHOT_PROPS] = Object.create(null);
5635
5674
  snapshotSources?.add(e);
@@ -5752,7 +5791,7 @@ let Writing = null;
5752
5791
  */ function throwIfUnreadable(e) {
5753
5792
  const t = e[STORE_FIREWALL];
5754
5793
  if (!t) return;
5755
- const n = t.Qe;
5794
+ const n = t.xe;
5756
5795
  if (n & STATUS_ERROR || n & STATUS_UNINITIALIZED && n & STATUS_PENDING) throw t.me ?? new NotReadyError(t);
5757
5796
  }
5758
5797
 
@@ -6218,7 +6257,7 @@ function createOptimisticStore(e, t, n) {
6218
6257
  const e = GlobalQueue.Ae;
6219
6258
  GlobalQueue.Ae = t => {
6220
6259
  for (const e of t.V) {
6221
- if ((e[$TARGET]?.[STORE_FIREWALL]?.Qe ?? 0) & STATUS_PENDING) return true;
6260
+ if ((e[$TARGET]?.[STORE_FIREWALL]?.xe ?? 0) & STATUS_PENDING) return true;
6222
6261
  }
6223
6262
  return e(t);
6224
6263
  };
@@ -6815,8 +6854,8 @@ function mapArray(e, t, n) {
6815
6854
  kt: [],
6816
6855
  Wt: [],
6817
6856
  Ft: r,
6818
- xt: r || n?.keyed === false ? [] : undefined,
6819
- Qt: i && n?.keyed !== false ? [] : undefined,
6857
+ Qt: r || n?.keyed === false ? [] : undefined,
6858
+ xt: i && n?.keyed !== false ? [] : undefined,
6820
6859
  Ht: n?.keyed === false,
6821
6860
  Mt: n?.fallback
6822
6861
  };
@@ -6849,14 +6888,14 @@ function updateKeyedMap() {
6849
6888
  let n, r, i, o,
6850
6889
  // Mappers write freshly-created row/index signals into the STAGE
6851
6890
  // arrays (`rows`/`indexes`), never into `this._rows`/`this._indexes`.
6852
- s = this.xt ? this.Ht ? () => {
6891
+ s = this.Qt ? this.Ht ? () => {
6853
6892
  i[r] = signal(e[r], pureOptions);
6854
6893
  return this.Ut(accessor(i[r]), r);
6855
6894
  } : () => {
6856
6895
  i[r] = signal(e[r], pureOptions);
6857
6896
  o && (o[r] = signal(r, pureOptions));
6858
6897
  return this.Ut(accessor(i[r]), o ? accessor(o[r]) : undefined);
6859
- } : this.Qt ? () => {
6898
+ } : this.xt ? () => {
6860
6899
  const t = e[r];
6861
6900
  o[r] = signal(r, pureOptions);
6862
6901
  return this.Ut(t, accessor(o[r]));
@@ -6872,8 +6911,8 @@ function updateKeyedMap() {
6872
6911
  this.Vt = [];
6873
6912
  this.kt = [];
6874
6913
  this.Lt = 0;
6875
- this.xt && (this.xt = []);
6876
6914
  this.Qt && (this.Qt = []);
6915
+ this.xt && (this.xt = []);
6877
6916
  }
6878
6917
  if (this.Mt && !this.kt[0]) {
6879
6918
  // an aborted fallback attempt leaves an owner without a mapping;
@@ -6886,8 +6925,8 @@ function updateKeyedMap() {
6886
6925
  else if (this.Lt === 0) {
6887
6926
  const u = new Array(t);
6888
6927
  const l = new Array(t);
6889
- i = this.xt && new Array(t);
6890
- o = this.Qt && new Array(t);
6928
+ i = this.Qt && new Array(t);
6929
+ o = this.xt && new Array(t);
6891
6930
  try {
6892
6931
  for (r = 0; r < t; r++) u[r] = runWithOwner(l[r] = createOwner(), s);
6893
6932
  } catch (e) {
@@ -6899,19 +6938,19 @@ function updateKeyedMap() {
6899
6938
  // previous fallback
6900
6939
  this.kt = u;
6901
6940
  this.Wt = l;
6902
- i && (this.xt = i);
6903
- o && (this.Qt = o);
6941
+ i && (this.Qt = i);
6942
+ o && (this.xt = o);
6904
6943
  this.Vt = e.slice(0);
6905
6944
  this.Lt = t;
6906
6945
  } else {
6907
6946
  let u, l, a, c, f, E, d, S, T;
6908
6947
  // skip common prefix
6909
- for (u = 0, l = Math.min(this.Lt, t); u < l && (this.Vt[u] === e[u] || this.xt && compare(this.Ft, this.Vt[u], e[u])); u++) {
6910
- if (this.xt) setSignal(this.xt[u], e[u]);
6948
+ for (u = 0, l = Math.min(this.Lt, t); u < l && (this.Vt[u] === e[u] || this.Qt && compare(this.Ft, this.Vt[u], e[u])); u++) {
6949
+ if (this.Qt) setSignal(this.Qt[u], e[u]);
6911
6950
  }
6912
6951
  // skip common suffix — counted only; retained entries land in one pass
6913
6952
  // at commit instead of being staged and copied twice
6914
- for (l = this.Lt - 1, a = t - 1; l >= u && a >= u && (this.Vt[l] === e[a] || this.xt && compare(this.Ft, this.Vt[l], e[a])); l--,
6953
+ for (l = this.Lt - 1, a = t - 1; l >= u && a >= u && (this.Vt[l] === e[a] || this.Qt && compare(this.Ft, this.Vt[l], e[a])); l--,
6915
6954
  a--) ;
6916
6955
  // no structural change (every position matched in place at equal
6917
6956
  // length — the common post-reconcile shape): keep the same mapped
@@ -6923,8 +6962,8 @@ function updateKeyedMap() {
6923
6962
  const O = t - this.Lt;
6924
6963
  const _ = new Array(t);
6925
6964
  const R = new Array(t);
6926
- i = this.xt ? new Array(t) : undefined;
6927
- o = this.Qt ? new Array(t) : undefined;
6965
+ i = this.Qt ? new Array(t) : undefined;
6966
+ o = this.xt ? new Array(t) : undefined;
6928
6967
  // 0) prepare a map of all indices in the changed window of newItems,
6929
6968
  // scanning backwards so we encounter them in natural order
6930
6969
  E = new Map;
@@ -6946,8 +6985,8 @@ function updateKeyedMap() {
6946
6985
  if (r !== undefined && r !== -1) {
6947
6986
  _[r] = this.kt[n];
6948
6987
  R[r] = this.Wt[n];
6949
- i && (i[r] = this.xt[n]);
6950
- o && (o[r] = this.Qt[n]);
6988
+ i && (i[r] = this.Qt[n]);
6989
+ o && (o[r] = this.xt[n]);
6951
6990
  r = d[r];
6952
6991
  E.set(f, r);
6953
6992
  } else (S ??= []).push(this.Wt[n]);
@@ -6969,8 +7008,8 @@ function updateKeyedMap() {
6969
7008
  for (n = 0; n < u; n++) {
6970
7009
  _[n] = this.kt[n];
6971
7010
  R[n] = this.Wt[n];
6972
- i && (i[n] = this.xt[n]);
6973
- o && (o[n] = this.Qt[n]);
7011
+ i && (i[n] = this.Qt[n]);
7012
+ o && (o[n] = this.xt[n]);
6974
7013
  }
6975
7014
  for (r = u; r <= a; r++) {
6976
7015
  if (i) setSignal(i[r], e[r]);
@@ -6980,18 +7019,18 @@ function updateKeyedMap() {
6980
7019
  _[r] = this.kt[r - O];
6981
7020
  R[r] = this.Wt[r - O];
6982
7021
  if (i) {
6983
- i[r] = this.xt[r - O];
7022
+ i[r] = this.Qt[r - O];
6984
7023
  setSignal(i[r], e[r]);
6985
7024
  }
6986
7025
  if (o) {
6987
- o[r] = this.Qt[r - O];
7026
+ o[r] = this.xt[r - O];
6988
7027
  if (O !== 0) setSignal(o[r], r);
6989
7028
  }
6990
7029
  }
6991
7030
  this.kt = _;
6992
7031
  this.Wt = R;
6993
- i && (this.xt = i);
6994
- o && (this.Qt = o);
7032
+ i && (this.Qt = i);
7033
+ o && (this.xt = o);
6995
7034
  this.Lt = t;
6996
7035
  // save a copy of the mapped items for the next update
6997
7036
  this.Vt = e.slice(0);
@@ -7106,12 +7145,12 @@ function boundaryComputed(e, t) {
7106
7145
  });
7107
7146
  n.yt = (e, t) => {
7108
7147
  // Use passed values if provided, otherwise read from node
7109
- const r = e !== undefined ? e : n.Qe;
7148
+ const r = e !== undefined ? e : n.xe;
7110
7149
  const i = t !== undefined ? t : n.me;
7111
7150
  // Notify both status dimensions like a render effect does; the queue chain
7112
7151
  // consumes this boundary's own type and forwards the remainder upward until
7113
7152
  // a boundary that handles it is found.
7114
- n.Qe &= ~n.Yt;
7153
+ n.xe &= ~n.Yt;
7115
7154
  const o = n.Ze.notify(n, STATUS_PENDING | STATUS_ERROR, r, i);
7116
7155
  // The queue is the only propagation channel: a foreign status must not stay
7117
7156
  // reader-visible on the tree, or reads re-throw it across the boundary and
@@ -7119,8 +7158,8 @@ function boundaryComputed(e, t) {
7119
7158
  // untouched, so the tree still recomputes when the foreign source settles.
7120
7159
  const s = r & ~n.Yt & (STATUS_PENDING | STATUS_ERROR);
7121
7160
  if (s) {
7122
- n.Qe &= ~s;
7123
- if (n.me === i && !(n.Qe & (STATUS_PENDING | STATUS_ERROR))) n.me = undefined;
7161
+ n.xe &= ~s;
7162
+ if (n.me === i && !(n.xe & (STATUS_PENDING | STATUS_ERROR))) n.me = undefined;
7124
7163
  }
7125
7164
  // An ERROR the chain could not deliver to any boundary is uncaught. The
7126
7165
  // scrub above already removed it from reader-visible state, so without
@@ -7388,11 +7427,11 @@ class CollectionQueue extends Queue {
7388
7427
  // mark's lifetime (the visual channel): the marked node carries no
7389
7428
  // status of its own, so the count is the liveness test. The release
7390
7429
  // sweep (finalizePureQueue after mark release) re-runs this check.
7391
- if (e.D & REACTIVE_DISPOSED || !e.W && !(e.Qe & this.Tn) && !(this.Tn & STATUS_ERROR && e.Qe & STATUS_PENDING)) this.Bt.delete(e);
7430
+ if (e.D & REACTIVE_DISPOSED || !e.W && !(e.xe & this.Tn) && !(this.Tn & STATUS_ERROR && e.xe & STATUS_PENDING)) this.Bt.delete(e);
7392
7431
  }
7393
7432
  if (!this.Bt.size) {
7394
7433
  if (this.Tn & STATUS_PENDING && this.Zt && !this.rn && this.On) {
7395
- this.Zt = !!(this.On.Qe & this.Tn);
7434
+ this.Zt = !!(this.On.xe & this.Tn);
7396
7435
  } else {
7397
7436
  this.Zt = false;
7398
7437
  }
@@ -7428,7 +7467,7 @@ function createCollectionBoundary(e, t, n, r) {
7428
7467
  } catch (e) {
7429
7468
  if (e instanceof NotReadyError) t = true; else throw e;
7430
7469
  }
7431
- o.Zt = t || !!(s.Qe & e) || s.me instanceof NotReadyError;
7470
+ o.Zt = t || !!(s.xe & e) || s.me instanceof NotReadyError;
7432
7471
  });
7433
7472
  const u = _revealUsed && e === STATUS_PENDING ? getContext(RevealControllerContext) : null;
7434
7473
  if (u) {