@solidjs/signals 2.0.0-rc.2 → 2.0.0-rc.4

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 (57) hide show
  1. package/dist/dev.js +1454 -118
  2. package/dist/node.cjs +2709 -1396
  3. package/dist/prod/affects.js +13 -12
  4. package/dist/prod/boundaries.js +39 -34
  5. package/dist/prod/core/action.js +3 -3
  6. package/dist/prod/core/async.js +48 -46
  7. package/dist/prod/core/core.js +99 -67
  8. package/dist/prod/core/effect.js +25 -28
  9. package/dist/prod/core/external.js +2 -2
  10. package/dist/prod/core/graph.js +85 -49
  11. package/dist/prod/core/heap.js +10 -10
  12. package/dist/prod/core/lanes.js +19 -19
  13. package/dist/prod/core/optimistic.js +66 -41
  14. package/dist/prod/core/owner.js +13 -13
  15. package/dist/prod/core/scheduler.js +131 -85
  16. package/dist/prod/core/verdict.js +36 -15
  17. package/dist/prod/index.js +4 -0
  18. package/dist/prod/map.js +101 -101
  19. package/dist/prod/signals.js +1 -1
  20. package/dist/prod/store/index.js +2 -0
  21. package/dist/prod/store/next/optimistic.js +65 -11
  22. package/dist/prod/store/next/patch-hooks.js +13 -0
  23. package/dist/prod/store/next/patch.js +614 -0
  24. package/dist/prod/store/next/projection.js +107 -45
  25. package/dist/prod/store/next/reconcile.js +307 -120
  26. package/dist/prod/store/next/store.js +321 -92
  27. package/dist/prod/store/next/target.js +13 -4
  28. package/dist/prod/store/store.js +5 -5
  29. package/dist/types/core/core.d.ts +15 -1
  30. package/dist/types/core/dev.d.ts +8 -0
  31. package/dist/types/core/graph.d.ts +22 -0
  32. package/dist/types/core/invariants.d.ts +1 -1
  33. package/dist/types/core/scheduler.d.ts +12 -0
  34. package/dist/types/store/index.d.ts +2 -0
  35. package/dist/types/store/next/patch-hooks.d.ts +41 -0
  36. package/dist/types/store/next/patch.d.ts +91 -0
  37. package/dist/types/store/next/reconcile.d.ts +14 -0
  38. package/dist/types/store/next/store.d.ts +30 -2
  39. package/dist/types/store/next/target.d.ts +58 -8
  40. package/dist/types-cjs/core/core.d.cts +15 -1
  41. package/dist/types-cjs/core/dev.d.cts +8 -0
  42. package/dist/types-cjs/core/graph.d.cts +22 -0
  43. package/dist/types-cjs/core/invariants.d.cts +1 -1
  44. package/dist/types-cjs/core/scheduler.d.cts +12 -0
  45. package/dist/types-cjs/store/index.d.cts +2 -0
  46. package/dist/types-cjs/store/next/patch-hooks.d.cts +41 -0
  47. package/dist/types-cjs/store/next/patch.d.cts +91 -0
  48. package/dist/types-cjs/store/next/reconcile.d.cts +14 -0
  49. package/dist/types-cjs/store/next/store.d.cts +30 -2
  50. package/dist/types-cjs/store/next/target.d.cts +58 -8
  51. package/package.json +14 -14
  52. package/dist/types/store/optimistic.d.ts +0 -45
  53. package/dist/types/store/projection.d.ts +0 -70
  54. package/dist/types/store/reconcile.d.ts +0 -46
  55. package/dist/types-cjs/store/optimistic.d.cts +0 -45
  56. package/dist/types-cjs/store/projection.d.cts +0 -70
  57. package/dist/types-cjs/store/reconcile.d.cts +0 -46
@@ -1,6 +1,6 @@
1
1
  import { forEachDependent } from "./core/async.js";
2
2
 
3
- import { ext } from "./core/core.js";
3
+ import { ext, statusNotifierOf } from "./core/core.js";
4
4
 
5
5
  import { $REFRESH, STATUS_PENDING } from "./core/constants.js";
6
6
 
@@ -40,17 +40,18 @@ import { $TARGET, getStoreAffectsNodes } from "./store/store.js";
40
40
  * flush that would surface them, before effects run — verdict-only, netting
41
41
  * no visual change.
42
42
  */ function notifyMarkBoundaries(e) {
43
- if (!e.u && !e.o?.l) return;
43
+ if (!e.u && !e.o?.i) return;
44
44
  const r = new NotReadyError(e);
45
- r.i = true;
45
+ r.l = true;
46
46
  const t = new Set;
47
47
  const visit = e => {
48
48
  if (t.has(e)) return;
49
49
  t.add(e);
50
50
  // Display consumers (render effects, boundary computeds) act on the
51
51
  // notification; descent stops there, exactly like the status rails.
52
- if (e.o?.A) {
53
- e.o.A.call(e, STATUS_PENDING, r);
52
+ const o = statusNotifierOf(e);
53
+ if (o) {
54
+ o.call(e, STATUS_PENDING, r);
54
55
  return;
55
56
  }
56
57
  forEachDependent(e, visit);
@@ -68,10 +69,10 @@ import { $TARGET, getStoreAffectsNodes } from "./store/store.js";
68
69
  * earlier overlapping registration get covered, and dedup stops re-descent.
69
70
  */ function registerAffectsMark(e) {
70
71
  markAffects(e);
71
- globalQueue.k.m.push(e);
72
+ globalQueue.m.A.push(e);
72
73
  // Companions only exist once the verdict layer (isPending/latest) loaded;
73
74
  // without them there is no materialized verdict to poke.
74
- GlobalQueue.p !== null && GlobalQueue.p(e);
75
+ GlobalQueue.k !== null && GlobalQueue.k(e);
75
76
  notifyMarkBoundaries(e);
76
77
  schedule();
77
78
  }
@@ -85,8 +86,8 @@ import { $TARGET, getStoreAffectsNodes } from "./store/store.js";
85
86
  shiftAffectsMarks(-1);
86
87
  e.o.t--;
87
88
  if (!e.o.t) {
88
- GlobalQueue.p !== null && GlobalQueue.p(e, true);
89
- GlobalQueue.G?.(e);
89
+ GlobalQueue.k !== null && GlobalQueue.k(e, true);
90
+ GlobalQueue.p?.(e);
90
91
  }
91
92
  }
92
93
 
@@ -103,11 +104,11 @@ import { $TARGET, getStoreAffectsNodes } from "./store/store.js";
103
104
  // Each call site is gated by state only this module creates (a non-empty
104
105
  // `_affectsNodes` batch, a live scope in the store's `affectsScopes`), so the
105
106
  // hooks are installed before the first time any of them can fire.
106
- GlobalQueue.M = releaseAffectsMarks;
107
+ GlobalQueue.G = releaseAffectsMarks;
107
108
 
108
- GlobalQueue.h = markAffects;
109
+ GlobalQueue.M = markAffects;
109
110
 
110
- GlobalQueue.j = releaseAffectsMark;
111
+ GlobalQueue.N = releaseAffectsMark;
111
112
 
112
113
  function affects(e, r) {
113
114
  const t = e?.[$TARGET];
@@ -22,7 +22,7 @@ function boundaryComputed(e, t) {
22
22
  const r = computed(e, {
23
23
  lazy: true
24
24
  });
25
- ext(r).A = (e, t) => {
25
+ ext(r).h = (e, t) => {
26
26
  // Use passed values if provided, otherwise read from node
27
27
  const n = e !== undefined ? e : r.S;
28
28
  const s = t !== undefined ? t : r.o?._;
@@ -80,18 +80,18 @@ function isRevealController(e) {
80
80
  }
81
81
 
82
82
  function isSlotReady(e) {
83
- return isRevealController(e) ? e.O() : e.v.size === 0 && !e.N;
83
+ return isRevealController(e) ? e.O() : e.v.size === 0 && !e.U;
84
84
  }
85
85
 
86
86
  function isSlotMinimallyReady(e) {
87
- return isRevealController(e) ? e.U() : isSlotReady(e);
87
+ return isRevealController(e) ? e.I() : isSlotReady(e);
88
88
  }
89
89
 
90
90
  function setSlotState(e, t, r, n) {
91
- setSignal(e.I, r);
92
- setSignal(e.D, n);
91
+ setSignal(e.D, r);
92
+ setSignal(e.P, n);
93
93
  if (isRevealController(e)) {
94
- if (!r && e.P === t) e.P = undefined;
94
+ if (!r && e.j === t) e.j = undefined;
95
95
  return e.B(r, n);
96
96
  }
97
97
  if (!r && e.W === t && e.L) e.W = undefined;
@@ -101,12 +101,12 @@ class RevealController {
101
101
  F;
102
102
  q;
103
103
  V=[];
104
- P;
105
- I=signal(false, {
104
+ j;
105
+ D=signal(false, {
106
106
  ownedWrite: true,
107
107
  H: true
108
108
  });
109
- D=signal(false, {
109
+ P=signal(false, {
110
110
  ownedWrite: true,
111
111
  H: true
112
112
  });
@@ -120,7 +120,7 @@ class RevealController {
120
120
  Y(e) {
121
121
  for (let t = 0; t < this.V.length; t++) {
122
122
  const r = this.V[t];
123
- if ((isRevealController(r) ? r.P : r.W) !== this) continue;
123
+ if ((isRevealController(r) ? r.j : r.W) !== this) continue;
124
124
  if (e(r) === false) return false;
125
125
  }
126
126
  return true;
@@ -134,7 +134,7 @@ class RevealController {
134
134
  * - `together`: every direct slot is minimally ready.
135
135
  * - `sequential`: the first owned slot is minimally ready (frontier can advance).
136
136
  * - `natural`: any owned slot is minimally ready.
137
- */ U() {
137
+ */ I() {
138
138
  const e = untrack(this.F);
139
139
  if (e === "together") return this.Y(isSlotMinimallyReady);
140
140
  if (e === "natural") {
@@ -161,7 +161,7 @@ class RevealController {
161
161
  if (this.V.includes(e)) return;
162
162
  this.V.push(e);
163
163
  const t = untrack(this.F);
164
- setSignal(e.I, true), setSignal(e.D, t === "sequential" ? !!untrack(this.q) : false);
164
+ setSignal(e.D, true), setSignal(e.P, t === "sequential" ? !!untrack(this.q) : false);
165
165
  untrack(() => this.B());
166
166
  }
167
167
  $(e) {
@@ -175,7 +175,7 @@ class RevealController {
175
175
  const r = this.J;
176
176
  const n = this.K;
177
177
  try {
178
- const r = e ?? read(this.I), n = untrack(this.F), s = n === "sequential" && !!untrack(this.q), i = t ?? s;
178
+ const r = e ?? read(this.D), n = untrack(this.F), s = n === "sequential" && !!untrack(this.q), i = t ?? s;
179
179
  if (r) {
180
180
  // Held by an outer group. Propagate the hold (and whatever collapsed policy
181
181
  // the outer asked for) down the whole subtree. Inner order is ignored while
@@ -187,8 +187,8 @@ class RevealController {
187
187
  // so the parent backpointer survives for upward readiness notifications.
188
188
  this.Y(e => {
189
189
  if (isRevealController(e)) {
190
+ setSignal(e.P, false);
190
191
  setSignal(e.D, false);
191
- setSignal(e.I, false);
192
192
  e.B(false, false);
193
193
  } else {
194
194
  setSlotState(e, this, !isSlotReady(e), false);
@@ -215,8 +215,8 @@ class RevealController {
215
215
  // advancing past this slot, and we bypass setSlotState so the parent
216
216
  // backpointer survives for upward readiness notifications.
217
217
  if (isRevealController(t)) {
218
+ setSignal(t.P, false);
218
219
  setSignal(t.D, false);
219
- setSignal(t.I, false);
220
220
  t.B(false, false);
221
221
  } else {
222
222
  setSlotState(t, this, true, false);
@@ -225,10 +225,10 @@ class RevealController {
225
225
  }
226
226
  } finally {
227
227
  this.J = this.O();
228
- this.K = this.U();
228
+ this.K = this.I();
229
229
  this.X = false;
230
230
  }
231
- if (this.P && (r !== this.J || n !== this.K)) this.P.B();
231
+ if (this.j && (r !== this.J || n !== this.K)) this.j.B();
232
232
  }
233
233
  }
234
234
 
@@ -236,13 +236,13 @@ class CollectionQueue extends Queue {
236
236
  ee;
237
237
  v=new Set;
238
238
  te;
239
- N=true;
240
- I=signal(false, {
239
+ U=true;
240
+ D=signal(false, {
241
241
  ownedWrite: true,
242
242
  H: true
243
243
  });
244
244
  _;
245
- D=signal(false, {
245
+ P=signal(false, {
246
246
  ownedWrite: true,
247
247
  H: true
248
248
  });
@@ -255,7 +255,7 @@ class CollectionQueue extends Queue {
255
255
  this.ee = e;
256
256
  }
257
257
  run(e) {
258
- if (!e || read(this.I) && (!_revealUsed || read(this.D))) return;
258
+ if (!e || read(this.D) && (!_revealUsed || read(this.P))) return;
259
259
  return super.run(e);
260
260
  }
261
261
  notify(e, t, r, n) {
@@ -286,12 +286,12 @@ class CollectionQueue extends Queue {
286
286
  // (the Loading > Errored > content composition escape, #2856).
287
287
  if (this.ee & STATUS_PENDING && this.L) return super.notify(e, t, r, n);
288
288
  if (r & this.ee) {
289
- this.N = true;
289
+ this.U = true;
290
290
  const t = n?.source || e.o?._?.source;
291
291
  if (t) {
292
292
  const e = this.v.size === 0;
293
293
  this.v.add(t);
294
- if (e) setSignal(this.I, true);
294
+ if (e) setSignal(this.D, true);
295
295
  if (this.ee & STATUS_ERROR) {
296
296
  setSignal(this._, unwrapStatusError(t.o?._));
297
297
  }
@@ -309,13 +309,13 @@ class CollectionQueue extends Queue {
309
309
  if (e.ie & REACTIVE_DISPOSED || !e.o?.t && !(e.S & this.ee) && !(this.ee & STATUS_ERROR && e.S & STATUS_PENDING)) this.v.delete(e);
310
310
  }
311
311
  if (!this.v.size) {
312
- if (this.ee & STATUS_PENDING && this.N && !this.L && this.te) {
313
- this.N = !!(this.te.S & this.ee);
312
+ if (this.ee & STATUS_PENDING && this.U && !this.L && this.te) {
313
+ this.U = !!(this.te.S & this.ee);
314
314
  } else {
315
- this.N = false;
315
+ this.U = false;
316
316
  }
317
- if (!this.N) {
318
- setSignal(this.I, false);
317
+ if (!this.U) {
318
+ setSignal(this.D, false);
319
319
  if (this.re) {
320
320
  try {
321
321
  this.ne = untrack(() => this.re());
@@ -346,7 +346,7 @@ function createCollectionBoundary(e, t, r, n) {
346
346
  } catch (e) {
347
347
  if (e instanceof NotReadyError) t = true; else throw e;
348
348
  }
349
- i.N = t || !!(o.S & e) || o.o?._ instanceof NotReadyError;
349
+ i.U = t || !!(o.S & e) || o.o?._ instanceof NotReadyError;
350
350
  });
351
351
  const l = _revealUsed && e === STATUS_PENDING ? getContext(RevealControllerContext) : null;
352
352
  if (l) {
@@ -355,14 +355,14 @@ function createCollectionBoundary(e, t, r, n) {
355
355
  cleanup(() => l.$(i));
356
356
  }
357
357
  return accessor(computed(() => {
358
- if (!read(i.I)) {
358
+ if (!read(i.D)) {
359
359
  const e = read(o);
360
- if (!untrack(() => read(i.I))) return i.L = true, e;
360
+ if (!untrack(() => read(i.D))) return i.L = true, e;
361
361
  }
362
362
  // Collapsed reveal slots suppress their own output entirely; the
363
363
  // renderer treats the hole as empty, so the cast never leaks to users
364
364
  // outside a `createRevealOrder` scope.
365
- if (_revealUsed && read(i.D)) return undefined;
365
+ if (_revealUsed && read(i.P)) return undefined;
366
366
  return r(i);
367
367
  },
368
368
  // Boundary structure, not a user source: its value is fallback-or-content and
@@ -424,7 +424,12 @@ function createCollectionBoundary(e, t, r, n) {
424
424
  * ```
425
425
  */ function createErrorBoundary(e, t) {
426
426
  return createCollectionBoundary(STATUS_ERROR, e, e => t(accessor(e._), () => {
427
- for (const t of e.v) recompute(t);
427
+ for (const t of e.v) {
428
+ // Non-computed sources (patch-channel registrations under plain
429
+ // owners) are not recomputable — their reset is the record's next
430
+ // transition re-applying the patch (re-audit 2, P1-4).
431
+ if (t.oe !== undefined) recompute(t);
432
+ }
428
433
  schedule();
429
434
  }));
430
435
  }
@@ -484,7 +489,7 @@ function createCollectionBoundary(e, t, r, n) {
484
489
  o.B();
485
490
  });
486
491
  if (n) {
487
- o.P = n;
492
+ o.j = n;
488
493
  n.Z(o);
489
494
  cleanup(() => n.$(o));
490
495
  }
@@ -78,11 +78,11 @@ function restoreTransition(e, r) {
78
78
  const i = e(...r);
79
79
  globalQueue.initTransition();
80
80
  let o = activeTransition;
81
- o.oe.push(i);
81
+ o.ue.push(i);
82
82
  const done = (e, r, u = false) => {
83
83
  o = currentTransition(o);
84
- const s = o.oe.indexOf(i);
85
- if (s >= 0) o.oe.splice(s, 1);
84
+ const s = o.ue.indexOf(i);
85
+ if (s >= 0) o.ue.splice(s, 1);
86
86
  // Re-adopt through initTransition like every other resumption site:
87
87
  // a bare setActiveTransition leaves globalQueue._batch as a detached
88
88
  // ambient batch, and anything registered before the scheduled flush
@@ -1,6 +1,6 @@
1
1
  import { STATUS_UNINITIALIZED, CONFIG_CHILD_COMPANIONS, STATUS_ERROR, STATUS_PENDING, REACTIVE_DIRTY, REACTIVE_OPTIMISTIC_DIRTY, NOT_PENDING, CONFIG_AUTO_DISPOSE, REACTIVE_ZOMBIE, REACTIVE_DISPOSED } from "./constants.js";
2
2
 
3
- import { untrack, ext, setSignal, context } from "./core.js";
3
+ import { untrack, ext, statusNotifierOf, setSignal, context } from "./core.js";
4
4
 
5
5
  import "./invariants.js";
6
6
 
@@ -45,7 +45,7 @@ function clearPendingSources(e) {
45
45
  * with NO read-visible pending status, no downstream propagation, no
46
46
  * transition, no lane registration. Commit #0 keeps serving.
47
47
  */ function parkLoadingWindow(e, n) {
48
- ext(e).ue = true;
48
+ ext(e).fe = true;
49
49
  if (n.source) addPendingSource(e, n.source);
50
50
  // A settled error is the node's answer ("the error stays the answer until
51
51
  // this retry can actually run") — the park must not replace it: reads
@@ -70,10 +70,10 @@ function setPendingError(e, n, t) {
70
70
  }
71
71
 
72
72
  function forEachDependent(e, n) {
73
- for (let t = e.u; t !== null; t = t.fe) n(t.ae, t);
73
+ for (let t = e.u; t !== null; t = t.ae) n(t.ce, t);
74
74
  // `?? null`: affects() marks route plain signals (no `_child` slot) through here.
75
- for (let t = e.o?.l ?? null; t !== null; t = t.ce) {
76
- for (let e = t.u; e !== null; e = e.fe) n(e.ae, e);
75
+ for (let t = e.o?.i ?? null; t !== null; t = t.Se) {
76
+ for (let e = t.u; e !== null; e = e.ae) n(e.ce, e);
77
77
  }
78
78
  }
79
79
 
@@ -88,7 +88,7 @@ function forEachDependent(e, n) {
88
88
  // callbacks handle their own release (settleAutodispose in handleAsync); this
89
89
  // covers derivatively-pending dependents, which have no callbacks of their own.
90
90
  function releaseIfSettledUnobserved(e) {
91
- e.Se && e.T & CONFIG_AUTO_DISPOSE && !e.u && !(e.ie & REACTIVE_ZOMBIE) && !(e.S & STATUS_PENDING) && unobserved(e);
91
+ e.oe && e.T & CONFIG_AUTO_DISPOSE && !e.u && !(e.ie & REACTIVE_ZOMBIE) && !(e.S & STATUS_PENDING) && unobserved(e);
92
92
  }
93
93
 
94
94
  // Error-path sweep: notifyStatus(STATUS_ERROR) clears dependents' pending
@@ -149,25 +149,25 @@ function settlePendingSource(e) {
149
149
  if (r.has(l) || !removePendingSource(l, e)) return;
150
150
  r.add(l);
151
151
  l.Te = clock;
152
- const u = l.o?.le?.values().next().value;
152
+ const i = l.o?.le?.values().next().value;
153
153
  // STATUS_ERROR + pending sources only coexist via an errored loading
154
154
  // window's park (notifyStatus(STATUS_ERROR) clears pending sources
155
155
  // otherwise): the settled error stays the answer through the settle —
156
156
  // nulling it here would have reads throw `null` until the re-enqueued
157
157
  // retry lands, or lose it entirely if that retry parks again (#2989).
158
- const i = l.S & STATUS_ERROR;
159
- if (u) {
160
- if (!i) setPendingError(l, u);
158
+ const u = l.S & STATUS_ERROR;
159
+ if (i) {
160
+ if (!u) setPendingError(l, i);
161
161
  o !== null && o(l);
162
162
  } else {
163
163
  l.S &= ~STATUS_PENDING;
164
- if (!i) setPendingError(l);
164
+ if (!u) setPendingError(l);
165
165
  o !== null && o(l);
166
- if (l.o?.ue) {
166
+ if (l.o?.fe) {
167
167
  enqueueSub(l);
168
168
  n = true;
169
169
  }
170
- if (l.o !== null) l.o.ue = false;
170
+ if (l.o !== null) l.o.fe = false;
171
171
  // Fully settled with nobody watching: release candidate (#2934). Checked
172
172
  // again at release time — deferred so unobserved() can't unlink subs
173
173
  // lists this walk is still iterating.
@@ -256,8 +256,8 @@ function handleAsync(e, n, t) {
256
256
  const l = !!(e.S & STATUS_UNINITIALIZED);
257
257
  trimStaleDeps(e);
258
258
  clearStatus(e);
259
- const u = resolveLane(e);
260
- if (u) u.Ae.delete(e);
259
+ const i = resolveLane(e);
260
+ if (i) i.Ae.delete(e);
261
261
  if (t) {
262
262
  t(r);
263
263
  if (l) clearStatus(e, true);
@@ -285,7 +285,7 @@ function handleAsync(e, n, t) {
285
285
  insertSubs(e);
286
286
  }
287
287
  e.Te = clock;
288
- } else if (u) {
288
+ } else if (i) {
289
289
  // Route through lane's effect queue for independent flushing
290
290
  const n = e.Re;
291
291
  const t = e.be;
@@ -355,12 +355,12 @@ function handleAsync(e, n, t) {
355
355
  // meaningful only in the live posture.
356
356
  const consumeIterator = (t, r) => {
357
357
  const o = t[Symbol.asyncIterator]();
358
- let u = false;
359
358
  let i = false;
359
+ let u = false;
360
360
  let s = !r;
361
361
  const close = () => {
362
- if (i) return;
363
- i = true;
362
+ if (u) return;
363
+ u = true;
364
364
  try {
365
365
  const e = o.return?.();
366
366
  if (isThenable(e)) e.then(undefined, () => {});
@@ -395,15 +395,15 @@ function handleAsync(e, n, t) {
395
395
  if (c && s) {
396
396
  t = r;
397
397
  f = true;
398
- if (r.done) i = true;
398
+ if (r.done) u = true;
399
399
  } else if (e.o?.Ee !== n) {
400
400
  return;
401
401
  } else if (!r.done) {
402
- u = true;
402
+ i = true;
403
403
  asyncWrite(r.value, iterateOrRelease);
404
404
  } else {
405
- i = true;
406
- if (u) {
405
+ u = true;
406
+ if (i) {
407
407
  schedule();
408
408
  flush();
409
409
  } else {
@@ -417,7 +417,7 @@ function handleAsync(e, n, t) {
417
417
  r = t;
418
418
  a = true;
419
419
  } else if (e.o?.Ee === n) {
420
- i = true;
420
+ u = true;
421
421
  handleError(t);
422
422
  settleAutodispose();
423
423
  }
@@ -425,14 +425,14 @@ function handleAsync(e, n, t) {
425
425
  c = false;
426
426
  if (a) {
427
427
  // Match the promise branch, but only rethrow during the initial read.
428
- i = true;
428
+ u = true;
429
429
  handleError(r);
430
430
  if (s) throw r;
431
431
  return true;
432
432
  }
433
433
  if (f && !t.done) {
434
434
  l = t.value;
435
- u = true;
435
+ i = true;
436
436
  return iterate();
437
437
  }
438
438
  return f && t.done;
@@ -440,12 +440,12 @@ function handleAsync(e, n, t) {
440
440
  const f = iterate();
441
441
  // Later iterate() calls run from asyncWrite, where rethrowing would be unhandled.
442
442
  s = false;
443
- return u || f;
443
+ return i || f;
444
444
  };
445
445
  // Landed-synchronously verdict for a LIVE iterator drain; null when no live
446
446
  // drain ran (plain promise flight, or a deferred flatten). Drives the
447
447
  // shared NotReady/loading tail below.
448
- let u = null;
448
+ let i = null;
449
449
  // Flatten one async level: a thenable that RESOLVES to an AsyncIterable —
450
450
  // the shape every async stub returning a stream produces — consumes as the
451
451
  // stream itself rather than settling on the iterable object. One level
@@ -460,11 +460,11 @@ function handleAsync(e, n, t) {
460
460
  }
461
461
  if (!t) return false;
462
462
  const r = consumeIterator(e, n);
463
- if (!n) u = r;
463
+ if (!n) i = r;
464
464
  return true;
465
465
  };
466
466
  if (o) {
467
- let t = false, r = false, o, u = true;
467
+ let t = false, r = false, o, i = true;
468
468
  // Close registration for the flattening path. Consumption starts in a
469
469
  // microtask where the ambient owner is gone (or worse, someone else's),
470
470
  // so `cleanup()` can't be used — the close targets el's disposal list
@@ -479,7 +479,7 @@ function handleAsync(e, n, t) {
479
479
  if (!e.he) e.he = n; else if (Array.isArray(e.he)) e.he.push(n); else e.he = [ e.he, n ];
480
480
  };
481
481
  n.then(r => {
482
- if (u) {
482
+ if (i) {
483
483
  l = r;
484
484
  t = true;
485
485
  } else if (e.o?.Ee === n && !(e.ie & REACTIVE_DISPOSED) && flattenIfIterable(r, registerDeferredClose)) ; else {
@@ -487,7 +487,7 @@ function handleAsync(e, n, t) {
487
487
  settleAutodispose();
488
488
  }
489
489
  }, e => {
490
- if (u) {
490
+ if (i) {
491
491
  o = e;
492
492
  r = true;
493
493
  } else {
@@ -495,7 +495,7 @@ function handleAsync(e, n, t) {
495
495
  settleAutodispose();
496
496
  }
497
497
  });
498
- u = false;
498
+ i = false;
499
499
  if (r) {
500
500
  // Settle through the same status path an async rejection uses, then
501
501
  // unwind the in-progress synchronous read so the errored node isn't
@@ -519,8 +519,8 @@ function handleAsync(e, n, t) {
519
519
  // apply and the shared tail below settles the verdict.
520
520
  }
521
521
  if (r) flattenIfIterable(n);
522
- if (u !== null) {
523
- if (!u) {
522
+ if (i !== null) {
523
+ if (!i) {
524
524
  // Loading window: serve commit #0 (see the promise branch above).
525
525
  if (e.Ie) return e.be;
526
526
  globalQueue.initTransition(resolveTransition(e));
@@ -535,7 +535,7 @@ function handleAsync(e, n, t) {
535
535
 
536
536
  function clearStatus(e, n = false) {
537
537
  if (e.o?.le) clearPendingSources(e);
538
- if (e.o?.ue) if (e.o !== null) e.o.ue = false;
538
+ if (e.o?.fe) if (e.o !== null) e.o.fe = false;
539
539
  // The pending window is over; its quiet classification dies with it.
540
540
  // (Unconditional: _reask is baked into the node literals, so this is a
541
541
  // plain store to an existing slot — no shape change.)
@@ -545,17 +545,18 @@ function clearStatus(e, n = false) {
545
545
  // Update pending signal for isPending() reactivity (companions only exist
546
546
  // once the verdict layer created them, which installs the hooks).
547
547
  if (e.o?.Ge || e.o?.ge) GlobalQueue.de(e);
548
- if (e.o?.l && e.T & CONFIG_CHILD_COMPANIONS && GlobalQueue.ye !== null) GlobalQueue.ye(e);
549
- if (e.o?.A) e.o.A.call(e);
548
+ if (e.o?.i && e.T & CONFIG_CHILD_COMPANIONS && GlobalQueue.ye !== null) GlobalQueue.ye(e);
549
+ const t = statusNotifierOf(e);
550
+ if (t) t.call(e);
550
551
  }
551
552
 
552
553
  function notifyStatus(e, n, t, r, o) {
553
554
  // Wrap regular errors to track source node
554
555
  if (n === STATUS_ERROR && !(t instanceof StatusError) && !(t instanceof NotReadyError)) t = new StatusError(e, t);
555
556
  const l = n === STATUS_PENDING && t instanceof NotReadyError ? t.source : undefined;
556
- const u = l === e;
557
- const i = n === STATUS_PENDING && e.o?.De !== undefined && !u;
558
- const s = i && hasActiveOverride(e);
557
+ const i = l === e;
558
+ const u = n === STATUS_PENDING && e.o?.De !== undefined && !i;
559
+ const s = u && hasActiveOverride(e);
559
560
  if (!r) {
560
561
  if (n === STATUS_PENDING && l) {
561
562
  addPendingSource(e, l);
@@ -569,21 +570,22 @@ function notifyStatus(e, n, t, r, o) {
569
570
  ext(e)._ = t;
570
571
  }
571
572
  GlobalQueue.de !== null && GlobalQueue.de(e);
572
- if (e.o?.l && e.T & CONFIG_CHILD_COMPANIONS && GlobalQueue.ye !== null) GlobalQueue.ye(e);
573
+ if (e.o?.i && e.T & CONFIG_CHILD_COMPANIONS && GlobalQueue.ye !== null) GlobalQueue.ye(e);
573
574
  }
574
575
  if (o && !r) {
575
576
  assignOrMergeLane(e, o);
576
577
  }
577
578
  const f = r || s;
578
- const a = r || i ? undefined : o;
579
- if (e.o?.A) {
579
+ const a = r || u ? undefined : o;
580
+ const c = statusNotifierOf(e);
581
+ if (c) {
580
582
  if (r && n === STATUS_PENDING) {
581
583
  return;
582
584
  }
583
585
  if (f) {
584
- e.o.A.call(e, n, t);
586
+ c.call(e, n, t);
585
587
  } else {
586
- e.o.A.call(e);
588
+ c.call(e);
587
589
  }
588
590
  return;
589
591
  }