@solidjs/signals 2.0.0-rc.14 → 2.0.0-rc.16

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 (98) hide show
  1. package/dist/dev-shared.js +882 -405
  2. package/dist/dev.attribution.js +172 -66
  3. package/dist/dev.js +1529 -745
  4. package/dist/observe/affects-marks.js +86 -0
  5. package/dist/observe/affects.js +32 -80
  6. package/dist/observe/boundaries.js +202 -166
  7. package/dist/observe/core/async.js +192 -141
  8. package/dist/observe/core/attribution-queries.js +1 -1
  9. package/dist/observe/core/attribution.js +315 -214
  10. package/dist/observe/core/constants.js +23 -4
  11. package/dist/observe/core/context.js +3 -3
  12. package/dist/observe/core/core.js +532 -360
  13. package/dist/observe/core/dev.js +63 -35
  14. package/dist/observe/core/effect.js +47 -47
  15. package/dist/observe/core/error.js +5 -3
  16. package/dist/observe/core/external.js +5 -6
  17. package/dist/observe/core/graph.js +56 -42
  18. package/dist/observe/core/heap.js +33 -33
  19. package/dist/observe/core/identities.js +62 -0
  20. package/dist/observe/core/lanes.js +242 -229
  21. package/dist/observe/core/owner.js +62 -50
  22. package/dist/observe/core/scheduler.js +322 -168
  23. package/dist/observe/core/truth.js +45 -0
  24. package/dist/observe/core/verdict.js +114 -64
  25. package/dist/observe/deferred.js +184 -0
  26. package/dist/observe/index.js +7 -1
  27. package/dist/observe/map.js +339 -254
  28. package/dist/observe/reveal.js +77 -77
  29. package/dist/observe/signals.js +54 -33
  30. package/dist/observe/store/affects.js +76 -69
  31. package/dist/observe/store/edges.js +39 -0
  32. package/dist/observe/store/hooks.js +13 -0
  33. package/dist/observe/store/index.js +0 -2
  34. package/dist/observe/store/optimistic.js +82 -44
  35. package/dist/observe/store/projection.js +83 -64
  36. package/dist/observe/store/reconcile.js +32 -30
  37. package/dist/observe/store/store.js +219 -123
  38. package/dist/prod/affects-marks.js +86 -0
  39. package/dist/prod/affects.js +33 -79
  40. package/dist/prod/boundaries.js +185 -149
  41. package/dist/prod/core/async.js +176 -135
  42. package/dist/prod/core/constants.js +23 -4
  43. package/dist/prod/core/context.js +3 -3
  44. package/dist/prod/core/core.js +521 -353
  45. package/dist/prod/core/effect.js +66 -66
  46. package/dist/prod/core/error.js +5 -3
  47. package/dist/prod/core/external.js +5 -6
  48. package/dist/prod/core/graph.js +56 -42
  49. package/dist/prod/core/heap.js +38 -38
  50. package/dist/prod/core/identities.js +62 -0
  51. package/dist/prod/core/lanes.js +237 -224
  52. package/dist/prod/core/owner.js +62 -51
  53. package/dist/prod/core/scheduler.js +312 -158
  54. package/dist/prod/core/truth.js +45 -0
  55. package/dist/prod/core/verdict.js +113 -63
  56. package/dist/prod/deferred.js +182 -0
  57. package/dist/prod/index.js +7 -1
  58. package/dist/prod/map.js +366 -281
  59. package/dist/prod/reveal.js +77 -77
  60. package/dist/prod/signals.js +59 -38
  61. package/dist/prod/store/affects.js +76 -69
  62. package/dist/prod/store/edges.js +39 -0
  63. package/dist/prod/store/hooks.js +13 -0
  64. package/dist/prod/store/index.js +0 -2
  65. package/dist/prod/store/optimistic.js +121 -84
  66. package/dist/prod/store/projection.js +46 -34
  67. package/dist/prod/store/reconcile.js +32 -30
  68. package/dist/prod/store/store.js +205 -116
  69. package/dist/types/affects-marks.d.ts +14 -0
  70. package/dist/types/boundaries.d.ts +5 -1
  71. package/dist/types/core/async.d.ts +10 -0
  72. package/dist/types/core/attribution.d.ts +6 -2
  73. package/dist/types/core/constants.d.ts +18 -1
  74. package/dist/types/core/core.d.ts +77 -5
  75. package/dist/types/core/dev.d.ts +43 -13
  76. package/dist/types/core/graph.d.ts +11 -0
  77. package/dist/types/core/identities.d.ts +17 -0
  78. package/dist/types/core/index.d.ts +2 -1
  79. package/dist/types/core/lanes.d.ts +2 -4
  80. package/dist/types/core/owner.d.ts +5 -3
  81. package/dist/types/core/scheduler.d.ts +59 -34
  82. package/dist/types/core/truth.d.ts +16 -0
  83. package/dist/types/core/types.d.ts +21 -6
  84. package/dist/types/core/verdict.d.ts +32 -0
  85. package/dist/types/deferred.d.ts +28 -0
  86. package/dist/types/index.d.ts +6 -0
  87. package/dist/types/map.d.ts +2 -2
  88. package/dist/types/signals.d.ts +28 -7
  89. package/dist/types/store/affects.d.ts +11 -0
  90. package/dist/types/store/edges.d.ts +9 -0
  91. package/dist/types/store/hooks.d.ts +48 -0
  92. package/dist/types/store/index.d.ts +10 -4
  93. package/dist/types/store/optimistic.d.ts +3 -2
  94. package/dist/types/store/projection.d.ts +4 -3
  95. package/dist/types/store/store.d.ts +4 -39
  96. package/dist/types/store/target.d.ts +16 -8
  97. package/dist/types/store/types.d.ts +14 -0
  98. package/package.json +1 -1
@@ -32,124 +32,124 @@ const SEQUENTIAL_ACCESSOR = () => "sequential";
32
32
 
33
33
  const isController = t => t instanceof RevealController;
34
34
 
35
- const slotReady = t => isController(t) ? t.Rt() : ready(t);
35
+ const slotReady = t => isController(t) ? t.St() : ready(t);
36
36
 
37
- const slotMinReady = t => isController(t) ? t.Ct() : ready(t);
37
+ const slotMinReady = t => isController(t) ? t.Rt() : ready(t);
38
38
 
39
39
  /** Force a slot's state. A boundary re-derives its output when it changes;
40
40
  * a nested controller passes the state on to its own slots. Released
41
41
  * (`!gated`), a nested controller leaves its parent's ownership and runs its
42
42
  * own order; a boundary leaves when it has shown content (boundaries.ts). */ function setSlotState(t, e, s, r) {
43
43
  if (isController(t)) {
44
- t.te = s;
45
- t.le = r;
46
- t.vt();
44
+ t.$ = s;
45
+ t.ee = r;
46
+ t._t();
47
47
  // Released and ready — every slot of its own has shown — it graduates,
48
48
  // as a boundary does when it shows content. Released at the frontier
49
49
  // but not ready, it stays the parent's frontier.
50
- if (!s && t.Lt && t._parent === e) t._parent = null;
50
+ if (!s && t.Ct && t._parent === e) t._parent = null;
51
51
  return;
52
52
  }
53
- if (t.te !== s || t.le !== r) {
54
- t.te = s;
55
- t.le = r;
53
+ if (t.$ !== s || t.ee !== r) {
54
+ t.$ = s;
55
+ t.ee = r;
56
56
  redraw(t);
57
57
  }
58
58
  }
59
59
 
60
60
  class RevealController {
61
- qt;
62
- Vt;
63
- Ft=[];
61
+ yt;
62
+ Et;
63
+ At=[];
64
64
  /** The controller gating this one, until it releases this one. */
65
65
  _parent=null;
66
66
  /** The state a parent forces on this whole group. */
67
- te=false;
68
- le=false;
69
- Lt=true;
70
- Qt=true;
71
- Ut=false;
67
+ $=false;
68
+ ee=false;
69
+ Ct=true;
70
+ kt=true;
71
+ vt=false;
72
72
  constructor(t, e) {
73
- this.qt = t;
74
- this.Vt = e;
73
+ this.yt = t;
74
+ this.Et = e;
75
75
  }
76
76
  /** A slot that has left this controller's ownership: a boundary that has
77
77
  * shown content, a nested group that is ready. Shown is shown — it counts
78
- * as ready whatever happens to it later (a re-arm gates nobody else). */ bt(t) {
79
- return (isController(t) ? t._parent : t.B) !== this;
78
+ * as ready whatever happens to it later (a re-arm gates nobody else). */ gt(t) {
79
+ return (isController(t) ? t._parent : t.V) !== this;
80
80
  }
81
81
  /** The slots this controller still owns, in registration order — the
82
- * ones the order's state is forced on. */ xt(t) {
83
- for (let e = 0; e < this.Ft.length; e++) {
84
- const s = this.Ft[e];
85
- if (!this.bt(s) && t(s) === false) return false;
82
+ * ones the order's state is forced on. */ Lt(t) {
83
+ for (let e = 0; e < this.At.length; e++) {
84
+ const s = this.At[e];
85
+ if (!this.gt(s) && t(s) === false) return false;
86
86
  }
87
87
  return true;
88
88
  }
89
- /** Readiness is judged over every slot, done ones as ready. */ Rt() {
90
- for (let t = 0; t < this.Ft.length; t++) {
91
- const e = this.Ft[t];
92
- if (!this.bt(e) && !slotReady(e)) return false;
89
+ /** Readiness is judged over every slot, done ones as ready. */ St() {
90
+ for (let t = 0; t < this.At.length; t++) {
91
+ const e = this.At[t];
92
+ if (!this.gt(e) && !slotReady(e)) return false;
93
93
  }
94
94
  return true;
95
95
  }
96
96
  /** Something visible to show under its own order — what an enclosing
97
97
  * `together` waits for: `together` — every slot minimally ready;
98
- * `sequential` — the first slot; `natural` — any. */ Ct() {
99
- const t = untrack(this.qt);
100
- const e = this.Ft;
98
+ * `sequential` — the first slot; `natural` — any. */ Rt() {
99
+ const t = untrack(this.yt);
100
+ const e = this.At;
101
101
  if (e.length === 0) return true;
102
- if (t === "sequential") return this.bt(e[0]) || slotMinReady(e[0]);
102
+ if (t === "sequential") return this.gt(e[0]) || slotMinReady(e[0]);
103
103
  for (let s = 0; s < e.length; s++) {
104
- const r = this.bt(e[s]) || slotMinReady(e[s]);
104
+ const r = this.gt(e[s]) || slotMinReady(e[s]);
105
105
  if (t === "natural" ? r : !r) return t === "natural";
106
106
  }
107
107
  return t !== "natural";
108
108
  }
109
- ae(t) {
110
- if (this.Ft.includes(t)) return;
111
- this.Ft.push(t);
109
+ oe(t) {
110
+ if (this.At.includes(t)) return;
111
+ this.At.push(t);
112
112
  // Gated from the start (collapsed in a collapsed sequential tail); the
113
113
  // evaluation releases what the order allows.
114
- const e = untrack(this.qt) === "sequential" && !!untrack(this.Vt);
114
+ const e = untrack(this.yt) === "sequential" && !!untrack(this.Et);
115
115
  if (isController(t)) {
116
116
  t._parent = this;
117
- t.te = true;
118
- t.le = e;
119
- t.vt();
117
+ t.$ = true;
118
+ t.ee = e;
119
+ t._t();
120
120
  } else {
121
- t.B = this;
122
- t.te = true;
123
- t.le = e;
121
+ t.V = this;
122
+ t.$ = true;
123
+ t.ee = e;
124
124
  }
125
- untrack(() => this.vt());
125
+ untrack(() => this._t());
126
126
  }
127
- ue(t) {
128
- const e = this.Ft.indexOf(t);
129
- if (e >= 0) this.Ft.splice(e, 1);
130
- untrack(() => this.vt());
127
+ te(t) {
128
+ const e = this.At.indexOf(t);
129
+ if (e >= 0) this.At.splice(e, 1);
130
+ untrack(() => this._t());
131
131
  }
132
132
  /** Apply the order to the owned slots — or, gated by a parent, its state
133
- * to all of them. */ vt() {
134
- if (this.Ut) return;
135
- this.Ut = true;
136
- const t = this.Lt;
137
- const e = this.Qt;
133
+ * to all of them. */ _t() {
134
+ if (this.vt) return;
135
+ this.vt = true;
136
+ const t = this.Ct;
137
+ const e = this.kt;
138
138
  try {
139
- const t = untrack(this.qt);
140
- const e = t === "sequential" && !!untrack(this.Vt);
141
- if (this.te) {
142
- this.xt(t => setSlotState(t, this, true, this.le));
139
+ const t = untrack(this.yt);
140
+ const e = t === "sequential" && !!untrack(this.Et);
141
+ if (this.$) {
142
+ this.Lt(t => setSlotState(t, this, true, this.ee));
143
143
  } else if (t === "natural") {
144
- this.xt(t => {
144
+ this.Lt(t => {
145
145
  if (isController(t)) setSlotState(t, this, false, false); else setSlotState(t, this, !ready(t), false);
146
146
  });
147
147
  } else if (t === "together") {
148
- const t = this.xt(slotMinReady);
149
- this.xt(e => setSlotState(e, this, !t, false));
148
+ const t = this.Lt(slotMinReady);
149
+ this.Lt(e => setSlotState(e, this, !t, false));
150
150
  } else {
151
151
  let t = false;
152
- this.xt(s => {
152
+ this.Lt(s => {
153
153
  if (t) return setSlotState(s, this, true, e);
154
154
  if (slotReady(s)) return setSlotState(s, this, false, false);
155
155
  t = true;
@@ -159,11 +159,11 @@ class RevealController {
159
159
  });
160
160
  }
161
161
  } finally {
162
- this.Lt = this.Rt();
163
- this.Qt = this.Ct();
164
- this.Ut = false;
162
+ this.Ct = this.St();
163
+ this.kt = this.Rt();
164
+ this.vt = false;
165
165
  }
166
- if (this._parent !== null && (t !== this.Lt || e !== this.Qt)) this._parent.vt();
166
+ if (this._parent !== null && (t !== this.Ct || e !== this.kt)) this._parent._t();
167
167
  }
168
168
  }
169
169
 
@@ -179,23 +179,23 @@ class RevealController {
179
179
  * slots behind the frontier render nothing instead of their fallbacks
180
180
  */ function createRevealOrder(t, e) {
181
181
  const s = createOwner();
182
- const r = s.U[REVEAL];
182
+ const r = s.A[REVEAL];
183
183
  const i = new RevealController(e?.order || SEQUENTIAL_ACCESSOR, e?.collapsed || FALSE_ACCESSOR);
184
- s.U = {
185
- ...s.U,
184
+ s.A = {
185
+ ...s.A,
186
186
  [REVEAL]: i
187
187
  };
188
188
  return runWithOwner(s, () => {
189
189
  const e = t();
190
190
  const s = computed(() => {
191
- i.qt();
192
- i.Vt();
193
- i.vt();
191
+ i.yt();
192
+ i.Et();
193
+ i._t();
194
194
  });
195
195
  if (false) ;
196
196
  if (r) {
197
- r.ae(i);
198
- cleanup(() => r.ue(i));
197
+ r.oe(i);
198
+ cleanup(() => r.te(i));
199
199
  }
200
200
  return e;
201
201
  });
@@ -204,9 +204,9 @@ class RevealController {
204
204
  // Installed at module evaluation — present exactly when something imports
205
205
  // `createRevealOrder`; a Loading boundary without one pays a null check.
206
206
  setRevealHooks({
207
- ae: (t, e) => t.ae(e),
208
- ue: (t, e) => t.ue(e),
209
- j: t => t.vt()
207
+ oe: (t, e) => t.oe(e),
208
+ te: (t, e) => t.te(e),
209
+ P: t => t._t()
210
210
  });
211
211
 
212
212
  export { createRevealOrder };
@@ -1,19 +1,23 @@
1
- import { NotReadyError, unwrapStatusError, TimeoutError } from "./core/error.js";
1
+ import { TimeoutError, NotReadyError, unwrapStatusError } from "./core/error.js";
2
2
 
3
3
  import "./core/verdict.js";
4
4
 
5
- import { CONFIG_CHILDREN_FORBIDDEN, EFFECT_USER, $REFRESH, CONFIG_REDERIVE, REACTIVE_JOINED, CONFIG_AUTO_DISPOSE, CONFIG_FRESH_READ, CONFIG_AUTHORITATIVE } from "./core/constants.js";
5
+ import { CONFIG_CHILDREN_FORBIDDEN, EFFECT_USER, $REFRESH, CONFIG_AUTO_DISPOSE, CONFIG_AUTHORITATIVE, CONFIG_REDERIVE, REACTIVE_JOINED, CONFIG_FRESH_READ, CONFIG_GUESS, STATUS_PENDING, STATUS_ERROR } from "./core/constants.js";
6
6
 
7
7
  import { computed, signal, runWithOwner, setMemo, setSignal, markRefresh, read, untrack } from "./core/core.js";
8
8
 
9
- import { globalQueue, flushTransaction, resolveTx, passTx, staleReader, dirtyQueue, joinFuture } from "./core/scheduler.js";
9
+ import { globalQueue, flushTransaction, dirtyQueue, GlobalQueue, resolveTx, passTx, staleReader, joinFuture } from "./core/scheduler.js";
10
10
 
11
11
  import { cleanup, createRoot, getOwner, dispose } from "./core/owner.js";
12
12
 
13
+ import { signalHook } from "./core/identities.js";
14
+
13
15
  import { effect, trackedEffect } from "./core/effect.js";
14
16
 
15
17
  import { optimisticWrite } from "./core/lanes.js";
16
18
 
19
+ import { truthRead, truthConfirmed } from "./core/truth.js";
20
+
17
21
  /**
18
22
  * Low-level reactive-cleanup primitive. Registers a callback that runs when
19
23
  * the surrounding owner is disposed.
@@ -71,17 +75,18 @@ function accessor(e) {
71
75
  function createSignal(e, t) {
72
76
  if (typeof e === "function") {
73
77
  const r = computed(e, t);
74
- r.u &= ~CONFIG_AUTO_DISPOSE;
78
+ r.l &= ~CONFIG_AUTO_DISPOSE;
75
79
  return [ accessor(r), setMemo.bind(null, r) ];
76
80
  }
77
81
  const r = signal(e, t);
82
+ if (signalHook !== null) signalHook(r);
78
83
  return [ accessor(r), setSignal.bind(null, r) ];
79
84
  }
80
85
 
81
86
  function createOptimistic(e, t) {
82
87
  if (typeof e === "function") {
83
88
  const r = computed(e, t);
84
- r.u &= ~CONFIG_AUTO_DISPOSE;
89
+ r.l &= ~CONFIG_AUTO_DISPOSE;
85
90
  return [ accessor(r), optimisticWrite.bind(null, r) ];
86
91
  }
87
92
  const r = signal(e, t);
@@ -158,7 +163,7 @@ function createMemo(e, t) {
158
163
  * );
159
164
  * ```
160
165
  *
161
- * @description https://docs.solidjs.com/reference/basic-reactivity/create-effect
166
+ * @description https://v2.solidjs.com/reference/solid-js/reactivity/create-effect
162
167
  */ function createEffect(e, t, r) {
163
168
  effect(e, t.effect || t, t.error, {
164
169
  user: true,
@@ -193,7 +198,7 @@ function createMemo(e, t) {
193
198
  * }
194
199
  * ```
195
200
  *
196
- * @description https://docs.solidjs.com/reference/secondary-primitives/create-render-effect
201
+ * @description https://v2.solidjs.com/reference/solid-js/advanced/specialized-reactivity/create-render-effect
197
202
  */ function createRenderEffect(e, t, r) {
198
203
  effect(e, t, undefined, r);
199
204
  }
@@ -241,7 +246,7 @@ function createMemo(e, t) {
241
246
  * });
242
247
  * ```
243
248
  *
244
- * @description https://docs.solidjs.com/reference/secondary-primitives/create-tracked-effect
249
+ * @description https://v2.solidjs.com/reference/solid-js/advanced/specialized-reactivity/create-tracked-effect
245
250
  */ function createTrackedEffect(e, t) {
246
251
  trackedEffect(e, t);
247
252
  }
@@ -270,7 +275,7 @@ function createMemo(e, t) {
270
275
  * setCount(1); // logs once, reaction re-armed for next change
271
276
  * ```
272
277
  *
273
- * @description https://docs.solidjs.com/reference/secondary-primitives/create-reaction
278
+ * @description https://v2.solidjs.com/reference/solid-js/advanced/specialized-reactivity/create-reaction
274
279
  */ function createReaction(e, t) {
275
280
  let r = undefined;
276
281
  cleanup(() => r?.());
@@ -320,31 +325,41 @@ function createMemo(e, t) {
320
325
  * - a mainline reader whose pass read a frame another transaction holds
321
326
  * joined it (L2, born held — A29) and delivers at that commit: the
322
327
  * committed view, never a foreign hold's unrevealed frame. */ function watch(e, t, r, n = 0, o, c = flushTransaction) {
328
+ if (n & CONFIG_AUTHORITATIVE) {
329
+ GlobalQueue.rn = truthRead;
330
+ GlobalQueue.sn = truthConfirmed;
331
+ }
323
332
  // `config` is on the node for its first pass too (the pass runs inside
324
333
  // `computed()`): `until`'s predicate is authoritative from its first read,
325
334
  // or an already-displayed guess would satisfy it in a later slice. (REDERIVE
326
335
  // after: the first pass's own error is the promise's rejection.)
327
- computed(() => {
328
- let n;
336
+ computed(() => {
337
+ let i, u = false;
329
338
  try {
330
- n = e();
339
+ i = e();
331
340
  } catch (e) {
332
341
  if (e instanceof NotReadyError) throw e;
333
- queueMicrotask(() => r(unwrapStatusError(e)));
334
- return;
342
+ // An error is an answer (D-41): delivered by the same frame rule.
343
+ i = unwrapStatusError(e);
344
+ u = true;
335
345
  }
336
- const u = getOwner();
346
+ const s = getOwner();
347
+ // A truth reader waits out a `createDeferred` flight its value derives
348
+ // from, which serves everyone else the stale answer (D-40).
349
+ const f = n & CONFIG_AUTHORITATIVE && GlobalQueue.er?.(s);
350
+ if (f) throw new NotReadyError(f);
337
351
  // (Outside a flush a mainline pass joins through `passTx`.)
338
- const i = flushTransaction ?? passTx;
339
- if (u.R & REACTIVE_JOINED && i !== null && (c === null || resolveTx(c) !== resolveTx(i))) {
340
- staleReader(u, resolveTx(i));
352
+ const a = flushTransaction ?? passTx;
353
+ if (s.R & REACTIVE_JOINED && a !== null && (c === null || resolveTx(c) !== resolveTx(a))) {
354
+ staleReader(s, resolveTx(a));
341
355
  return;
342
356
  }
343
- o?.(n);
344
- queueMicrotask(() => t(n));
357
+ if (u) return void queueMicrotask(() => r(i));
358
+ o?.(i);
359
+ queueMicrotask(() => t(i));
345
360
  }, {
346
- we: n
347
- }).u |= CONFIG_REDERIVE;
361
+ Le: n
362
+ }).l |= CONFIG_REDERIVE;
348
363
  }
349
364
 
350
365
  /**
@@ -430,23 +445,29 @@ function createMemo(e, t) {
430
445
  const r = flushTransaction;
431
446
  const n = new Promise((n, o) => {
432
447
  queueMicrotask(() => {
433
- // No createRoot: the microtask has no ambient owner, so the watcher is
434
- // naturally detached, and settle disposes the node directly (dev keeps
435
- // a root husk purely to stay quiet about the missing owner). The
436
- // capture runs inside the watcher's own pass, where the ambient owner
437
- // IS the watcher — exactly what dispose() takes.
448
+ // The root is load-bearing: an ownerless computed is auto-disposing,
449
+ // and the settle walk releases an unobserved one instead of re-running
450
+ // it, so the waiter would never see the refetch land (#3888). Settle
451
+ // disposes the waiter directly; the capture runs inside the watcher's
452
+ // own pass, where the ambient owner IS the watcher — exactly what
453
+ // dispose() takes.
438
454
  let c = null;
439
455
  const make = () => watch(() => {
440
456
  if (c === null) c = getOwner();
441
- return read(t);
457
+ // Authoritative: the truth beneath a guess (`until`'s view). A
458
+ // guessed node's own re-ask is not answered by it (#3895): park
459
+ // on that flight, or reject with its error.
460
+ const e = read(t);
461
+ if (t.l & CONFIG_GUESS && t.m & (STATUS_PENDING | STATUS_ERROR)) throw t.T?.F;
462
+ return e;
442
463
  }, t => {
443
464
  n(typeof e === "function" ? t : e);
444
465
  dispose(c);
445
466
  }, e => {
446
467
  o(e);
447
468
  dispose(c);
448
- }, CONFIG_FRESH_READ, undefined, r);
449
- make();
469
+ }, CONFIG_FRESH_READ | CONFIG_AUTHORITATIVE, undefined, r);
470
+ createRoot(make);
450
471
  });
451
472
  });
452
473
  // Fire-and-forget refresh must not turn a failed refetch into an unhandled
@@ -495,14 +516,14 @@ function createMemo(e, t) {
495
516
  // (`saving=true` beside the confirmed `version=1` is a tear no timeline
496
517
  // contains). Updates that do not flip the predicate reveal freely.
497
518
  const c = flushTransaction;
498
- createRoot(u => {
499
- let i;
519
+ createRoot(i => {
520
+ let u;
500
521
  let s;
501
522
  const settle = e => {
502
- if (i !== undefined) clearTimeout(i);
523
+ if (u !== undefined) clearTimeout(u);
503
524
  if (s !== undefined) o.removeEventListener("abort", s);
504
525
  e();
505
- u();
526
+ i();
506
527
  };
507
528
  // Authoritative: the predicate sees the truth, never the action's own
508
529
  // optimistic guess — a guess cannot satisfy the wait for its own
@@ -515,9 +536,9 @@ function createMemo(e, t) {
515
536
  // The flip, inside the pass of the flush carrying it: the flush
516
537
  // joins the action's transaction, and what it staged is held and
517
538
  // revealed with the action.
518
- if (e && c !== null && globalQueue.ee && resolveTx(c).tt !== 0) joinFuture(c);
539
+ if (e && c !== null && globalQueue.q && resolveTx(c).tt !== 0) joinFuture(c);
519
540
  });
520
- if (t?.timeout !== undefined) i = setTimeout(() => settle(() => n(new TimeoutError)), t.timeout);
541
+ if (t?.timeout !== undefined) u = setTimeout(() => settle(() => n(new TimeoutError)), t.timeout);
521
542
  if (o !== undefined) {
522
543
  s = () => settle(() => n(o.reason));
523
544
  o.addEventListener("abort", s, {
@@ -623,7 +644,7 @@ function createMemo(e, t) {
623
644
  * on owner disposal
624
645
  */ function onSettled(e) {
625
646
  const t = getOwner();
626
- t && !(t.u & CONFIG_CHILDREN_FORBIDDEN) ? trackedEffect(() => untrack(e), undefined) : globalQueue.enqueue(EFFECT_USER, function fire() {
647
+ t && !(t.l & CONFIG_CHILDREN_FORBIDDEN) ? trackedEffect(() => untrack(e), undefined) : globalQueue.enqueue(EFFECT_USER, function fire() {
627
648
  // Settled means derived. A settle that reverts optimism (or replays
628
649
  // gated reads) only enqueues the affected subscribers; the pass after
629
650
  // the commit re-derives them. Fired in the commit pass, the callback
@@ -631,7 +652,7 @@ function createMemo(e, t) {
631
652
  // still holding the optimistic value — reads do not pull (#3411). Fall
632
653
  // to the next pass while the heap has work; `run` swapped the queue,
633
654
  // so this lands there, and `enqueue` keeps the drain alive.
634
- if (dirtyQueue.At >= dirtyQueue.He) return globalQueue.enqueue(EFFECT_USER, fire);
655
+ if (dirtyQueue.et >= dirtyQueue.Ge) return globalQueue.enqueue(EFFECT_USER, fire);
635
656
  // Unowned, out-of-band fire (no owner, or a children-forbidden one this
636
657
  // one-shot must not bind to): a returned cleanup has no lifecycle to
637
658
  // attach to. Reject it in dev; in production the return is simply