@solidjs/signals 2.0.0-beta.21 → 2.0.0-beta.23

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/prod/map.js CHANGED
@@ -21,24 +21,24 @@ function mapArray(t, s, i) {
21
21
  const r = s.length > 1;
22
22
  const n = s;
23
23
  const h = {
24
- jt: createOwner(),
25
- Wt: 0,
26
- Kt: t,
24
+ wt: createOwner(),
25
+ jt: 0,
26
+ Wt: t,
27
+ Mt: [],
28
+ Kt: n,
27
29
  xt: [],
28
- $t: n,
29
- qt: [],
30
- zt: [],
31
- Ht: e,
32
- Jt: e || i?.keyed === false ? [] : undefined,
33
- Xt: r && i?.keyed !== false ? [] : undefined,
34
- Yt: i?.keyed === false,
35
- Zt: i?.fallback
30
+ Ft: [],
31
+ Gt: e,
32
+ Ut: e || i?.keyed === false ? [] : undefined,
33
+ $t: r && i?.keyed !== false ? [] : undefined,
34
+ qt: i?.keyed === false,
35
+ zt: i?.fallback
36
36
  };
37
37
  const o = computed(updateKeyedMap.bind(h));
38
38
  // Untracked reads inside the internal owner resolve via _parentComputed; routing
39
39
  // them through node lets store-proxy lookups see pending writes (not stale _value).
40
- h.jt.Ct = o;
41
- o.U &= ~CONFIG_AUTO_DISPOSE;
40
+ h.wt.Nt = o;
41
+ o.T &= ~CONFIG_AUTO_DISPOSE;
42
42
  return accessor(o);
43
43
  }
44
44
 
@@ -56,52 +56,52 @@ const pureOptions = {
56
56
  // strong-abort ordering: removed rows now dispose AFTER the pass's new rows
57
57
  // are created (you cannot destroy state before knowing the pass will land).
58
58
  function updateKeyedMap() {
59
- const t = this.Kt() || [], s = t.length;
59
+ const t = this.Wt() || [], s = t.length;
60
60
  t[$TRACK];
61
61
  // top level tracking
62
- runWithOwner(this.jt, () => {
62
+ runWithOwner(this.wt, () => {
63
63
  let i, e, r, n,
64
64
  // Mappers write freshly-created row/index signals into the STAGE
65
65
  // arrays (`rows`/`indexes`), never into `this._rows`/`this._indexes`.
66
- h = this.Jt ? this.Yt ? () => {
66
+ h = this.Ut ? this.qt ? () => {
67
67
  r[e] = signal(t[e], pureOptions);
68
- return this.$t(accessor(r[e]), e);
68
+ return this.Kt(accessor(r[e]), e);
69
69
  } : () => {
70
70
  r[e] = signal(t[e], pureOptions);
71
71
  n && (n[e] = signal(e, pureOptions));
72
- return this.$t(accessor(r[e]), n ? accessor(n[e]) : undefined);
73
- } : this.Xt ? () => {
72
+ return this.Kt(accessor(r[e]), n ? accessor(n[e]) : undefined);
73
+ } : this.$t ? () => {
74
74
  const s = t[e];
75
75
  n[e] = signal(e, pureOptions);
76
- return this.$t(s, accessor(n[e]));
76
+ return this.Kt(s, accessor(n[e]));
77
77
  } : () => {
78
78
  const s = t[e];
79
- return this.$t(s);
79
+ return this.Kt(s);
80
80
  };
81
81
  // fast path for empty arrays
82
82
  if (s === 0) {
83
- if (this.Wt !== 0) {
84
- this.jt.dispose(false);
85
- this.zt = [];
83
+ if (this.jt !== 0) {
84
+ this.wt.dispose(false);
85
+ this.Ft = [];
86
+ this.Mt = [];
86
87
  this.xt = [];
87
- this.qt = [];
88
- this.Wt = 0;
89
- this.Jt && (this.Jt = []);
90
- this.Xt && (this.Xt = []);
88
+ this.jt = 0;
89
+ this.Ut && (this.Ut = []);
90
+ this.$t && (this.$t = []);
91
91
  }
92
- if (this.Zt && !this.qt[0]) {
92
+ if (this.zt && !this.xt[0]) {
93
93
  // an aborted fallback attempt leaves an owner without a mapping;
94
94
  // dispose it before re-creating
95
- this.zt[0]?.dispose();
96
- this.qt[0] = runWithOwner(this.zt[0] = createOwner(), this.Zt);
95
+ this.Ft[0]?.dispose();
96
+ this.xt[0] = runWithOwner(this.Ft[0] = createOwner(), this.zt);
97
97
  }
98
98
  }
99
99
  // fast path for new create
100
- else if (this.Wt === 0) {
100
+ else if (this.jt === 0) {
101
101
  const o = new Array(s);
102
102
  const c = new Array(s);
103
- r = this.Jt && new Array(s);
104
- n = this.Xt && new Array(s);
103
+ r = this.Ut && new Array(s);
104
+ n = this.$t && new Array(s);
105
105
  try {
106
106
  for (e = 0; e < s; e++) o[e] = runWithOwner(c[e] = createOwner(), h);
107
107
  } catch (t) {
@@ -109,53 +109,53 @@ function updateKeyedMap() {
109
109
  throw t;
110
110
  }
111
111
  // commit
112
- if (this.zt[0]) this.zt[0].dispose();
112
+ if (this.Ft[0]) this.Ft[0].dispose();
113
113
  // previous fallback
114
- this.qt = o;
115
- this.zt = c;
116
- r && (this.Jt = r);
117
- n && (this.Xt = n);
118
- this.xt = t.slice(0);
119
- this.Wt = s;
114
+ this.xt = o;
115
+ this.Ft = c;
116
+ r && (this.Ut = r);
117
+ n && (this.$t = n);
118
+ this.Mt = t.slice(0);
119
+ this.jt = s;
120
120
  } else {
121
121
  let o, c, a, f, u, p, w, l, d, O = new Array(s), m = new Array(s);
122
- r = this.Jt ? new Array(s) : undefined;
123
- n = this.Xt ? new Array(s) : undefined;
122
+ r = this.Ut ? new Array(s) : undefined;
123
+ n = this.$t ? new Array(s) : undefined;
124
124
  // skip common prefix
125
- for (o = 0, c = Math.min(this.Wt, s); o < c && (this.xt[o] === t[o] || this.Jt && compare(this.Ht, this.xt[o], t[o])); o++) {
126
- if (this.Jt) setSignal(this.Jt[o], t[o]);
125
+ for (o = 0, c = Math.min(this.jt, s); o < c && (this.Mt[o] === t[o] || this.Ut && compare(this.Gt, this.Mt[o], t[o])); o++) {
126
+ if (this.Ut) setSignal(this.Ut[o], t[o]);
127
127
  }
128
128
  // common suffix
129
- for (c = this.Wt - 1, a = s - 1; c >= o && a >= o && (this.xt[c] === t[a] || this.Jt && compare(this.Ht, this.xt[c], t[a])); c--,
129
+ for (c = this.jt - 1, a = s - 1; c >= o && a >= o && (this.Mt[c] === t[a] || this.Ut && compare(this.Gt, this.Mt[c], t[a])); c--,
130
130
  a--) {
131
- O[a] = this.qt[c];
132
- m[a] = this.zt[c];
133
- r && (r[a] = this.Jt[c]);
134
- n && (n[a] = this.Xt[c]);
131
+ O[a] = this.xt[c];
132
+ m[a] = this.Ft[c];
133
+ r && (r[a] = this.Ut[c]);
134
+ n && (n[a] = this.$t[c]);
135
135
  }
136
136
  // 0) prepare a map of all indices in newItems, scanning backwards so we encounter them in natural order
137
137
  p = new Map;
138
138
  w = new Array(a + 1);
139
139
  for (e = a; e >= o; e--) {
140
140
  f = t[e];
141
- u = this.Ht ? this.Ht(f) : f;
141
+ u = this.Gt ? this.Gt(f) : f;
142
142
  i = p.get(u);
143
143
  w[e] = i === undefined ? -1 : i;
144
144
  p.set(u, e);
145
145
  }
146
146
  // 1) step through all old items and see if they can be found in the new set; if so, save them in a temp array and mark them moved; if not, queue them for disposal at commit
147
147
  for (i = o; i <= c; i++) {
148
- f = this.xt[i];
149
- u = this.Ht ? this.Ht(f) : f;
148
+ f = this.Mt[i];
149
+ u = this.Gt ? this.Gt(f) : f;
150
150
  e = p.get(u);
151
151
  if (e !== undefined && e !== -1) {
152
- O[e] = this.qt[i];
153
- m[e] = this.zt[i];
154
- r && (r[e] = this.Jt[i]);
155
- n && (n[e] = this.Xt[i]);
152
+ O[e] = this.xt[i];
153
+ m[e] = this.Ft[i];
154
+ r && (r[e] = this.Ut[i]);
155
+ n && (n[e] = this.$t[i]);
156
156
  e = w[e];
157
157
  p.set(u, e);
158
- } else (l ??= []).push(this.zt[i]);
158
+ } else (l ??= []).push(this.Ft[i]);
159
159
  }
160
160
  // 2) create new rows into the temp arrays; an abort disposes only these
161
161
  try {
@@ -170,25 +170,25 @@ function updateKeyedMap() {
170
170
  }
171
171
  // 3) commit: land positions, then dispose exited rows
172
172
  for (e = o; e < s; e++) {
173
- this.qt[e] = O[e];
174
- this.zt[e] = m[e];
173
+ this.xt[e] = O[e];
174
+ this.Ft[e] = m[e];
175
175
  if (r) {
176
- this.Jt[e] = r[e];
177
- setSignal(this.Jt[e], t[e]);
176
+ this.Ut[e] = r[e];
177
+ setSignal(this.Ut[e], t[e]);
178
178
  }
179
179
  if (n) {
180
- this.Xt[e] = n[e];
181
- setSignal(this.Xt[e], e);
180
+ this.$t[e] = n[e];
181
+ setSignal(this.$t[e], e);
182
182
  }
183
183
  }
184
184
  if (l) for (i = 0; i < l.length; i++) l[i].dispose();
185
185
  // 4) in case the new set is shorter than the old, set the length of the mapped array
186
- this.qt = this.qt.slice(0, this.Wt = s);
186
+ this.xt = this.xt.slice(0, this.jt = s);
187
187
  // 5) save a copy of the mapped items for the next update
188
- this.xt = t.slice(0);
188
+ this.Mt = t.slice(0);
189
189
  }
190
190
  });
191
- return this.qt;
191
+ return this.xt;
192
192
  }
193
193
 
194
194
  /**
@@ -208,22 +208,22 @@ function updateKeyedMap() {
208
208
  */ function repeat(t, s, i) {
209
209
  const e = s;
210
210
  const r = {
211
- jt: createOwner(),
212
- Wt: 0,
213
- ts: 0,
214
- ss: t,
215
- $t: e,
216
- zt: [],
217
- qt: [],
218
- es: i?.from,
219
- Zt: i?.fallback
211
+ wt: createOwner(),
212
+ jt: 0,
213
+ Bt: 0,
214
+ Ht: t,
215
+ Kt: e,
216
+ Ft: [],
217
+ xt: [],
218
+ Jt: i?.from,
219
+ zt: i?.fallback
220
220
  };
221
221
  const n = computed(updateRepeat.bind(r));
222
222
  // Same as mapArray: untracked reads inside the internal owner resolve via
223
223
  // _parentComputed, so async reads in row callbacks register with the node
224
224
  // (pending tracking + post-settle retry) instead of vanishing.
225
- r.jt.Ct = n;
226
- n.U &= ~CONFIG_AUTO_DISPOSE;
225
+ r.wt.Nt = n;
226
+ n.T &= ~CONFIG_AUTO_DISPOSE;
227
227
  return accessor(n);
228
228
  }
229
229
 
@@ -235,55 +235,55 @@ function updateKeyedMap() {
235
235
  // for the post-settle retry. The overlap math also subsumes the previous
236
236
  // disjoint-window/front-clear/end-clear/shift special cases.
237
237
  function updateRepeat() {
238
- const t = this.ss();
239
- const s = this.es?.() || 0;
240
- runWithOwner(this.jt, () => {
238
+ const t = this.Ht();
239
+ const s = this.Jt?.() || 0;
240
+ runWithOwner(this.wt, () => {
241
241
  if (t === 0) {
242
- if (this.Wt !== 0) {
243
- this.jt.dispose(false);
244
- this.zt = [];
245
- this.qt = [];
246
- this.Wt = 0;
242
+ if (this.jt !== 0) {
243
+ this.wt.dispose(false);
244
+ this.Ft = [];
245
+ this.xt = [];
246
+ this.jt = 0;
247
247
  // Reset offset to match the cleared data (#2767, repro 2).
248
- this.ts = 0;
248
+ this.Bt = 0;
249
249
  }
250
- if (this.Zt && !this.qt[0]) {
250
+ if (this.zt && !this.xt[0]) {
251
251
  // an aborted fallback attempt leaves an owner without a mapping;
252
252
  // dispose it before re-creating
253
- this.zt[0]?.dispose();
254
- this.qt[0] = runWithOwner(this.zt[0] = createOwner(), this.Zt);
253
+ this.Ft[0]?.dispose();
254
+ this.xt[0] = runWithOwner(this.Ft[0] = createOwner(), this.zt);
255
255
  }
256
256
  return;
257
257
  }
258
258
  const i = s + t;
259
- const e = this.ts + this.Wt;
259
+ const e = this.Bt + this.jt;
260
260
  // Retained overlap [keepStart, keepEnd) in global indexes; empty when the
261
261
  // windows are disjoint or when coming from empty/fallback.
262
- const r = Math.max(s, this.ts);
262
+ const r = Math.max(s, this.Bt);
263
263
  const n = Math.min(i, e);
264
264
  const h = new Array(t);
265
265
  const o = new Array(t);
266
266
  for (let t = r; t < n; t++) {
267
- o[t - s] = this.zt[t - this.ts];
268
- h[t - s] = this.qt[t - this.ts];
267
+ o[t - s] = this.Ft[t - this.Bt];
268
+ h[t - s] = this.xt[t - this.Bt];
269
269
  }
270
270
  try {
271
271
  for (let t = s; t < i; t++) {
272
272
  if (t >= r && t < n) continue;
273
- h[t - s] = runWithOwner(o[t - s] = createOwner(), () => this.$t(t));
273
+ h[t - s] = runWithOwner(o[t - s] = createOwner(), () => this.Kt(t));
274
274
  }
275
275
  } catch (t) {
276
276
  for (let t = s; t < i; t++) if ((t < r || t >= n) && o[t - s]) o[t - s].dispose();
277
277
  throw t;
278
278
  }
279
279
  // commit: dispose the previous fallback or the rows leaving the window
280
- if (this.Wt === 0) this.zt[0]?.dispose(); else for (let t = this.ts; t < e; t++) if (t < s || t >= i) this.zt[t - this.ts].dispose();
281
- this.qt = h;
282
- this.zt = o;
283
- this.ts = s;
284
- this.Wt = t;
280
+ if (this.jt === 0) this.Ft[0]?.dispose(); else for (let t = this.Bt; t < e; t++) if (t < s || t >= i) this.Ft[t - this.Bt].dispose();
281
+ this.xt = h;
282
+ this.Ft = o;
283
+ this.Bt = s;
284
+ this.jt = t;
285
285
  });
286
- return this.qt;
286
+ return this.xt;
287
287
  }
288
288
 
289
289
  function compare(t, s, i) {
@@ -2,7 +2,7 @@ import { computed, optimisticComputed, setSignal, optimisticSignal, runWithOwner
2
2
 
3
3
  import { cleanup, createRoot, getOwner, dispose } from "./core/owner.js";
4
4
 
5
- import { globalQueue } from "./core/scheduler.js";
5
+ import { globalQueue, Queue } from "./core/scheduler.js";
6
6
 
7
7
  import { CONFIG_AUTO_DISPOSE, CONFIG_CHILDREN_FORBIDDEN, EFFECT_USER, $REFRESH } from "./core/constants.js";
8
8
 
@@ -65,7 +65,7 @@ function accessor(e) {
65
65
  function createSignal(e, t) {
66
66
  if (typeof e === "function") {
67
67
  const n = computed(e, t);
68
- n.U &= ~CONFIG_AUTO_DISPOSE;
68
+ n.T &= ~CONFIG_AUTO_DISPOSE;
69
69
  return [ accessor(n), setMemo.bind(null, n) ];
70
70
  }
71
71
  const n = signal(e, t);
@@ -239,6 +239,12 @@ function createEffect(e, t, n) {
239
239
  };
240
240
  }
241
241
 
242
+ /** Delivers effect applies on a microtask instead of queueing them (#2930). */ class MicrotaskQueue extends Queue {
243
+ enqueue(e, t) {
244
+ queueMicrotask(() => t(e));
245
+ }
246
+ }
247
+
242
248
  /**
243
249
  * Awaits a reactive expression and returns its first fully-settled value as a
244
250
  * `Promise`. Pending async reads (`createMemo` returning a promise, etc.) are
@@ -262,11 +268,23 @@ function createEffect(e, t, n) {
262
268
  */ function resolve(e) {
263
269
  return new Promise((t, n) => {
264
270
  createRoot(c => {
271
+ // Deliver effect applies on a microtask instead of the owner queue: an
272
+ // incomplete transition stashes its effect queues until it settles, but
273
+ // an action yielding this promise is itself what keeps the transition
274
+ // open — the stashed res() deadlocked the action (#2930). The compute
275
+ // still runs in place (under the transaction's view when created inside
276
+ // an action step), and status/boundary notifications keep their normal
277
+ // route through the inherited queue.
278
+ const r = getOwner();
279
+ const o = new MicrotaskQueue;
280
+ o.Ge = r.C;
281
+ // notify() forwards up the normal chain
282
+ r.C = o;
265
283
  // A user effect rather than a bare computed: computeds are pull-based and
266
284
  // are only re-enqueued when a pending source *resolves* — a rejection just
267
285
  // marks them errored, so nothing would re-run and the promise would never
268
286
  // settle (#2842). The effect's error channel is notified on rejection.
269
- effect(e, e => {
287
+ effect(e, e => {
270
288
  t(e);
271
289
  c();
272
290
  }, e => {
@@ -288,7 +306,7 @@ function createOptimistic(e, t) {
288
306
  installOptimisticEngine();
289
307
  if (typeof e === "function") {
290
308
  const n = optimisticComputed(e, t);
291
- n.U &= ~CONFIG_AUTO_DISPOSE;
309
+ n.T &= ~CONFIG_AUTO_DISPOSE;
292
310
  return [ accessor(n), setSignal.bind(null, n) ];
293
311
  }
294
312
  const n = optimisticSignal(e, t);
@@ -377,7 +395,7 @@ function createOptimistic(e, t) {
377
395
  * on owner disposal
378
396
  */ function onSettled(e) {
379
397
  const t = getOwner();
380
- t && !(t.U & CONFIG_CHILDREN_FORBIDDEN) ? createTrackedEffect(() => untrack(e), undefined) : globalQueue.enqueue(EFFECT_USER, () => {
398
+ t && !(t.T & CONFIG_CHILDREN_FORBIDDEN) ? createTrackedEffect(() => untrack(e), undefined) : globalQueue.enqueue(EFFECT_USER, () => {
381
399
  // Unowned, out-of-band fire (no owner, or a children-forbidden one this
382
400
  // one-shot must not bind to): a returned cleanup has no lifecycle to
383
401
  // attach to. Reject it in dev; in production the return is simply
@@ -21,7 +21,7 @@ function createOptimisticStore(e, t, r) {
21
21
  // STORE_OPTIMISTIC take the engine's write path, so install it before any
22
22
  // node can be created.
23
23
  installOptimisticEngine();
24
- GlobalQueue.Vt ||= clearOptimisticStores;
24
+ GlobalQueue.Dt ||= clearOptimisticStores;
25
25
  const i = typeof e === "function";
26
26
  const o = i ? t : e;
27
27
  const n = i ? e : undefined;
@@ -76,8 +76,8 @@ function clearOptimisticStores(e, t) {
76
76
  // (initTransition mid-batch) or to the plain flush, so it clears on
77
77
  // whichever clear call reaches this store first.
78
78
  if (e) {
79
- if (typeof e.cn === "object") e = o[O] = currentTransition(e);
80
- if (e !== t && e.cn !== true) {
79
+ if (typeof e.fn === "object") e = o[O] = currentTransition(e);
80
+ if (e !== t && e.fn !== true) {
81
81
  s = true;
82
82
  continue;
83
83
  }
@@ -89,7 +89,7 @@ function clearOptimisticStores(e, t) {
89
89
  const T = i?.[O];
90
90
  if (T) {
91
91
  // Clear lane association so effects go to regular queue
92
- T.Je = undefined;
92
+ T.je = undefined;
93
93
  // Re-read from base — this key left the optimistic layer above, so the
94
94
  // overlay resolves to STORE_OVERRIDE or STORE_VALUE.
95
95
  const t = getOverlayLayer(e, O);
@@ -97,11 +97,11 @@ function clearOptimisticStores(e, t) {
97
97
  const i = r === $DELETED ? undefined : r;
98
98
  const o = isWrappable(i) ? wrap(i, e) : i;
99
99
  const n = visibleNodeValue(T);
100
- T.be = NOT_PENDING;
101
- T.fn = null;
102
- T.ge = NOT_PENDING;
103
- T.Ue = o;
104
- if (!T.Ge || !T.Ge(n, o)) {
100
+ T.Ee = NOT_PENDING;
101
+ T.sn = null;
102
+ T.Ne = NOT_PENDING;
103
+ T.Pe = o;
104
+ if (!T.Re || !T.Re(n, o)) {
105
105
  insertSubs(T, true);
106
106
  schedule();
107
107
  }
@@ -113,7 +113,7 @@ function clearOptimisticStores(e, t) {
113
113
  }
114
114
  // Notify $TRACK
115
115
  if (c && i?.[$TRACK]) {
116
- i[$TRACK].Je = undefined;
116
+ i[$TRACK].je = undefined;
117
117
  notifySelf(e);
118
118
  }
119
119
  } finally {
@@ -173,7 +173,7 @@ function createOptimisticProjectionInternal(e, t, r) {
173
173
  setProjectionWriteActive(false);
174
174
  }
175
175
  }, undefined);
176
- i.U &= ~CONFIG_AUTO_DISPOSE;
176
+ i.T &= ~CONFIG_AUTO_DISPOSE;
177
177
  }
178
178
  return {
179
179
  store: n,
@@ -41,7 +41,7 @@ function createProjectionInternal(e, r, t) {
41
41
  if (!o) o = getOwner();
42
42
  runProjectionComputed(n, e, t?.key || "id");
43
43
  }, undefined);
44
- o.U &= ~CONFIG_AUTO_DISPOSE;
44
+ o.T &= ~CONFIG_AUTO_DISPOSE;
45
45
  return {
46
46
  store: n,
47
47
  node: o
@@ -110,7 +110,7 @@ function createProjectionInternal(e, r, t) {
110
110
  const n = getOwner();
111
111
  let c = false;
112
112
  let s;
113
- const u = new Proxy(e, createWriteTraps(() => !c || n.Ae === s, i));
113
+ const u = new Proxy(e, createWriteTraps(() => !c || n.Te === s, i));
114
114
  storeSetter(u, i => {
115
115
  s = r(i);
116
116
  c = true;
@@ -154,7 +154,7 @@ function ownEnumerableKeysPlain(e) {
154
154
  * The value a store leaf's backing signal currently shows to readers: active
155
155
  * override, else held pending value, else committed value.
156
156
  */ function visibleNodeValue(e) {
157
- return e.be !== undefined && e.be !== NOT_PENDING ? unwrapOverride(e.be) : e.ge !== NOT_PENDING ? e.ge : e.Ue;
157
+ return e.Ee !== undefined && e.Ee !== NOT_PENDING ? unwrapOverride(e.Ee) : e.Ne !== NOT_PENDING ? e.Ne : e.Pe;
158
158
  }
159
159
 
160
160
  function hasOwnStoreProperty(e, t) {
@@ -205,11 +205,11 @@ function getNode(e, t, r, n, o = isEqual, i) {
205
205
  }
206
206
  }, e[STORE_FIREWALL]);
207
207
  if (e[STORE_OPTIMISTIC]) {
208
- s.be = NOT_PENDING;
208
+ s.Ee = NOT_PENDING;
209
209
  }
210
210
  if (i && r in i) {
211
211
  const e = i[r];
212
- s.Ye = e === undefined ? NO_SNAPSHOT : e;
212
+ s.Ve = e === undefined ? NO_SNAPSHOT : e;
213
213
  snapshotSources?.add(s);
214
214
  }
215
215
  if (typeof r === "symbol" && r !== $TRACK && r !== $AFFECTS) symbolKeyedRecords.add(t);
@@ -238,8 +238,8 @@ function getNode(e, t, r, n, o = isEqual, i) {
238
238
  */ function inheritAffectsMarks(e, t, r) {
239
239
  // A live scope exists, so affects.ts already installed the mark engine.
240
240
  for (const [n, o] of affectsScopes) {
241
- if (n.M && o.scope.has(t) && (o.key === undefined || o.key === r)) {
242
- GlobalQueue.D(e);
241
+ if (n.t && o.scope.has(t) && (o.key === undefined || o.key === r)) {
242
+ GlobalQueue.M(e);
243
243
  o.inherited.push(e);
244
244
  }
245
245
  }
@@ -327,11 +327,11 @@ o) {
327
327
  // Callers guard on `pendingCheckActive`, which only flips inside
328
328
  // isPending() — the verdict layer is loaded and its hook installed.
329
329
  const r = e[STORE_NODE]?.[$AFFECTS];
330
- if (r?.M) GlobalQueue.wt(r);
330
+ if (r?.t) GlobalQueue.Lt(r);
331
331
  if (affectsScopes.size) {
332
332
  const n = e[STORE_VALUE];
333
333
  for (const [e, o] of affectsScopes) {
334
- if (e !== r && e.M && o.scope.has(n) && (o.key === undefined || o.key === t)) GlobalQueue.wt(e);
334
+ if (e !== r && e.t && o.scope.has(n) && (o.key === undefined || o.key === t)) GlobalQueue.Lt(e);
335
335
  }
336
336
  }
337
337
  }
@@ -348,11 +348,11 @@ o) {
348
348
  * @internal
349
349
  */ function getStoreAffectsNodes(e, t) {
350
350
  const r = getNodes(e, STORE_NODE);
351
- GlobalQueue.T ||= e => {
351
+ GlobalQueue.p ||= e => {
352
352
  const t = affectsScopes.get(e);
353
353
  if (!t) return;
354
354
  affectsScopes.delete(e);
355
- for (let e = 0; e < t.inherited.length; e++) GlobalQueue.F(t.inherited[e]);
355
+ for (let e = 0; e < t.inherited.length; e++) GlobalQueue.h(t.inherited[e]);
356
356
  };
357
357
  if (t === undefined) {
358
358
  const t = getNode(e, r, $AFFECTS, undefined, false);
@@ -473,13 +473,13 @@ function getPropertyDescriptor(e, t, r) {
473
473
  function prepareStoreWrite(e, t, r) {
474
474
  if (e[STORE_OPTIMISTIC]) {
475
475
  const t = e[STORE_FIREWALL];
476
- if (t?.ve) {
477
- globalQueue.initTransition(t.ve);
476
+ if (t?.Ue) {
477
+ globalQueue.initTransition(t.Ue);
478
478
  }
479
479
  }
480
480
  const n = e[STORE_VALUE];
481
481
  const o = n[r];
482
- if (snapshotCaptureActive && typeof r !== "symbol" && !((e[STORE_FIREWALL]?.i ?? 0) & STATUS_PENDING)) {
482
+ if (snapshotCaptureActive && typeof r !== "symbol" && !((e[STORE_FIREWALL]?.S ?? 0) & STATUS_PENDING)) {
483
483
  if (!e[STORE_SNAPSHOT_PROPS]) {
484
484
  e[STORE_SNAPSHOT_PROPS] = Object.create(null);
485
485
  snapshotSources?.add(e);
@@ -507,7 +507,7 @@ function prepareStoreWrite(e, t, r) {
507
507
  // STORE_OPTIMISTIC is only set by createOptimisticStore, which installs the
508
508
  // optimistic engine before wrapping.
509
509
  if (e[STORE_OPTIMISTIC] && !projectionWriteActive) {
510
- GlobalQueue.mn(t);
510
+ GlobalQueue.Nn(t);
511
511
  }
512
512
  }
513
513
 
@@ -580,7 +580,7 @@ let Writing = null;
580
580
  * itself (the derive function works its own draft while uninitialized).
581
581
  */ function throwIfUninitialized(e) {
582
582
  const t = e[STORE_FIREWALL];
583
- if (t && t.i & STATUS_UNINITIALIZED) throw t.k ?? new NotReadyError(t);
583
+ if (t && t.S & STATUS_UNINITIALIZED) throw t._ ?? new NotReadyError(t);
584
584
  }
585
585
 
586
586
  const storeTraps = {
@@ -4,15 +4,15 @@ import { type Store } from "./store/store.js";
4
4
  * Declares that in-flight work will change the targeted data: the named
5
5
  * slot(s) — and everything DERIVED from them — read as pending
6
6
  * (`isPending` → `true`) from the declaration until the surrounding
7
- * transaction settles or reverts. Marks ride the same status rails as real
8
- * in-flight async, so pendingness flows through memos and effects like any
9
- * other pending source, while the marked values themselves stay readable
10
- * (a mark is a promise of change, not an absence of value). This is the
11
- * declaration verb of the pending model — additive only. A mark can turn
12
- * pending ON for data the graph can't see changing yet; nothing can turn
13
- * pending OFF while a real change is in flight a quiet `refresh()`
14
- * re-ask under a mark still reads pending (declaring the reload is what
15
- * makes it a real question).
7
+ * transaction settles or reverts. A mark lives on its own channel — a
8
+ * refcount on the marked node plus dep-graph reachability in the verdict
9
+ * layer so the marked values themselves stay readable (a mark is a promise
10
+ * of change, not an absence of value), no reader ever suspends on one, and
11
+ * completion/settlement accounting never sees one. This is the declaration
12
+ * verb of the pending model additive only. A mark can turn pending ON for
13
+ * data the graph can't see changing yet; nothing can turn pending OFF while
14
+ * a real change is in flight a quiet `refresh()` re-ask under a mark still
15
+ * reads pending (declaring the reload is what makes it a real question).
16
16
  *
17
17
  * Targets:
18
18
  * - `affects(store)` — a store proxy (any record, root or nested): every
@@ -3,7 +3,7 @@ import type { Computed, Link } from "./types.js";
3
3
  export declare function addPendingSource(el: Computed<any>, source: Computed<any>): boolean;
4
4
  export declare function setPendingError(el: Computed<any>, source?: Computed<any>, error?: any): void;
5
5
  export declare function forEachDependent(el: Computed<any>, fn: (node: Computed<any>, link: Link) => void): void;
6
- export declare function settlePendingSource(el: Computed<any>, source?: Computed<any>, snap?: boolean): void;
6
+ export declare function settlePendingSource(el: Computed<any>): void;
7
7
  export declare function isThenable<T>(value: T | PromiseLike<T>): value is PromiseLike<T>;
8
8
  export declare function handleAsync<T>(el: Computed<T>, result: T | PromiseLike<T> | AsyncIterable<T>, setter?: (value: T) => void): T;
9
9
  export declare function clearStatus(el: Computed<any>, clearUninitialized?: boolean): void;
@@ -24,6 +24,13 @@
24
24
  */
25
25
  export declare class NotReadyError extends Error {
26
26
  source: any;
27
+ /**
28
+ * Tags a visibility-only notification on the affects() boundary channel:
29
+ * boundaries update display state from it, but the root queue never
30
+ * registers a reporter — marks are invisible to completion accounting by
31
+ * construction.
32
+ */
33
+ _markVisual?: boolean;
27
34
  constructor(source: any);
28
35
  }
29
36
  export declare class StatusError extends Error {