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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/prod/map.js CHANGED
@@ -1,8 +1,10 @@
1
- import { computed, runWithOwner, signal, setSignal } from "./core/core.js";
1
+ import { computed, runWithOwner, signal, currentOptimisticLane, setSignal } from "./core/core.js";
2
+
3
+ import { activeLanes } from "./core/lanes.js";
2
4
 
3
5
  import { createOwner } from "./core/owner.js";
4
6
 
5
- import "./core/scheduler.js";
7
+ import { GlobalQueue } from "./core/scheduler.js";
6
8
 
7
9
  import { CONFIG_AUTO_DISPOSE } from "./core/constants.js";
8
10
 
@@ -20,8 +22,8 @@ import { $TRACK } from "./store/store.js";
20
22
 
21
23
  import "./store/next/store.js";
22
24
 
23
- function mapArray(t, s, i) {
24
- const e = typeof i?.keyed === "function" ? i.keyed : undefined;
25
+ function mapArray(t, s, e) {
26
+ const i = typeof e?.keyed === "function" ? e.keyed : undefined;
25
27
  const r = s.length > 1;
26
28
  const n = s;
27
29
  const o = {
@@ -30,13 +32,13 @@ function mapArray(t, s, i) {
30
32
  Ot: t,
31
33
  yt: [],
32
34
  At: n,
35
+ Mt: [],
33
36
  St: [],
34
- gt: [],
35
- Kn: e,
36
- Mt: e || i?.keyed === false ? [] : undefined,
37
- jt: r && i?.keyed !== false ? [] : undefined,
38
- kt: i?.keyed === false,
39
- Wt: i?.fallback
37
+ Kn: i,
38
+ jt: i || e?.keyed === false ? [] : undefined,
39
+ kt: r && e?.keyed !== false ? [] : undefined,
40
+ gt: e?.keyed === false,
41
+ bt: e?.fallback
40
42
  };
41
43
  const h = computed(updateKeyedMap.bind(o), undefined);
42
44
  // Untracked reads inside the internal owner resolve via _parentComputed; routing
@@ -50,7 +52,7 @@ const pureOptions = {
50
52
  ownedWrite: true
51
53
  };
52
54
 
53
- function trySmallMove(t, s, i, e) {
55
+ function trySmallMove(t, s, e, i) {
54
56
  const r = t.yt;
55
57
  const n = t.wt - 1;
56
58
  const o = [];
@@ -58,63 +60,63 @@ function trySmallMove(t, s, i, e) {
58
60
  const f = [];
59
61
  // flat triples: oldStart, newStart, length
60
62
  let c = 256;
61
- let a = e;
62
- let l = e;
63
- let u = false;
64
- while (a <= n && l <= i - 1) {
63
+ let a = i;
64
+ let u = i;
65
+ let l = false;
66
+ while (a <= n && u <= e - 1) {
65
67
  const t = r[a];
66
- const e = s[l];
67
- if (t === e) {
68
- if (!u) {
69
- f.push(a, l, 0);
70
- u = true;
68
+ const i = s[u];
69
+ if (t === i) {
70
+ if (!l) {
71
+ f.push(a, u, 0);
72
+ l = true;
71
73
  }
72
74
  f[f.length - 1]++;
73
75
  a++;
74
- l++;
76
+ u++;
75
77
  continue;
76
78
  }
77
- u = false;
79
+ l = false;
78
80
  // Bounded realignment lookahead, shorter distance wins.
79
81
  let p = -1;
80
82
  let d = Math.min(32 - o.length, n - a, c);
81
83
  for (let t = 1; t <= d; t++) {
82
- if (r[a + t] === e) {
84
+ if (r[a + t] === i) {
83
85
  p = t;
84
86
  break;
85
87
  }
86
88
  }
87
89
  c -= p === -1 ? d : p;
88
- let w = -1;
89
- d = Math.min(32 - h.length, i - 1 - l, c);
90
- for (let i = 1; i <= d; i++) {
91
- if (s[l + i] === t) {
92
- w = i;
90
+ let m = -1;
91
+ d = Math.min(32 - h.length, e - 1 - u, c);
92
+ for (let e = 1; e <= d; e++) {
93
+ if (s[u + e] === t) {
94
+ m = e;
93
95
  break;
94
96
  }
95
97
  }
96
- c -= w === -1 ? d : w;
97
- if (p !== -1 && (w === -1 || p <= w)) {
98
+ c -= m === -1 ? d : m;
99
+ if (p !== -1 && (m === -1 || p <= m)) {
98
100
  while (p-- > 0) o.push(a++);
99
101
  continue;
100
102
  }
101
- if (w !== -1) {
102
- while (w-- > 0) h.push(l++);
103
+ if (m !== -1) {
104
+ while (m-- > 0) h.push(u++);
103
105
  continue;
104
106
  }
105
107
  if (c <= 0 || o.length === 32 || h.length === 32) return false;
106
108
  o.push(a++);
107
- h.push(l++);
109
+ h.push(u++);
108
110
  }
109
111
  for (;a <= n; a++) {
110
112
  if (o.length === 32) return false;
111
113
  o.push(a);
112
114
  }
113
- for (;l <= i - 1; l++) {
115
+ for (;u <= e - 1; u++) {
114
116
  if (h.length === 32) return false;
115
- h.push(l);
117
+ h.push(u);
116
118
  }
117
- return commitSmallMove(t, s, i, o, h, f);
119
+ return commitSmallMove(t, s, e, o, h, f);
118
120
  }
119
121
 
120
122
  /** PHASE 2 of the small-move path, in its OWN function so that a pass which
@@ -123,17 +125,17 @@ function trySmallMove(t, s, i, e) {
123
125
  * per function, and cold `replace` measured +0.5 ms with both phases in one
124
126
  * body. Pairs displaced sources with destinations (an unmatched destination
125
127
  * is a replacement/insertion → general path), then commits: slice() the live
126
- * arrays, copy shifted runs, patch displaced pairs, dispose leftovers. */ function commitSmallMove(t, s, i, e, r, n) {
128
+ * arrays, copy shifted runs, patch displaced pairs, dispose leftovers. */ function commitSmallMove(t, s, e, i, r, n) {
127
129
  const o = t.yt;
128
130
  let h;
129
131
  let f;
130
132
  let c;
131
133
  if (r.length !== 0) {
132
- c = new Array(e.length);
134
+ c = new Array(i.length);
133
135
  for (f = 0; f < r.length; f++) {
134
136
  let t = -1;
135
- for (h = 0; h < e.length; h++) {
136
- if (!c[h] && o[e[h]] === s[r[f]]) {
137
+ for (h = 0; h < i.length; h++) {
138
+ if (!c[h] && o[i[h]] === s[r[f]]) {
137
139
  t = h;
138
140
  break;
139
141
  }
@@ -150,42 +152,42 @@ function trySmallMove(t, s, i, e) {
150
152
  // and if a displaced identity also occurs inside a run the two algorithms
151
153
  // can hand different occurrences different owners (row-local state moves;
152
154
  // a shrink could dispose the wrong one). Decline that case — general path.
153
- if (e.length !== 0 || r.length !== 0) {
155
+ if (i.length !== 0 || r.length !== 0) {
154
156
  const t = new Set;
155
- for (h = 0; h < e.length; h++) t.add(o[e[h]]);
157
+ for (h = 0; h < i.length; h++) t.add(o[i[h]]);
156
158
  for (f = 0; f < r.length; f++) t.add(s[r[f] >> 6]);
157
159
  for (let s = 0; s < n.length; s += 3) {
158
- const i = n[s];
159
- for (let e = 0, r = n[s + 2]; e < r; e++) if (t.has(o[i + e])) return false;
160
+ const e = n[s];
161
+ for (let i = 0, r = n[s + 2]; i < r; i++) if (t.has(o[e + i])) return false;
160
162
  }
161
163
  }
162
- const a = t.St;
163
- const l = t.gt;
164
- const u = a.slice(0, i);
165
- const p = l.slice(0, i);
164
+ const a = t.Mt;
165
+ const u = t.St;
166
+ const l = a.slice(0, e);
167
+ const p = u.slice(0, e);
166
168
  for (let t = 0; t < n.length; t += 3) {
167
169
  const s = n[t];
168
- const i = n[t + 1];
169
- if (s !== i) {
170
- for (let e = 0; e < n[t + 2]; e++) {
171
- u[i + e] = a[s + e];
172
- p[i + e] = l[s + e];
170
+ const e = n[t + 1];
171
+ if (s !== e) {
172
+ for (let i = 0; i < n[t + 2]; i++) {
173
+ l[e + i] = a[s + i];
174
+ p[e + i] = u[s + i];
173
175
  }
174
176
  }
175
177
  }
176
178
  for (f = 0; f < r.length; f++) {
177
179
  const t = r[f] >> 6;
178
- const s = e[r[f] & 63];
179
- u[t] = a[s];
180
- p[t] = l[s];
180
+ const s = i[r[f] & 63];
181
+ l[t] = a[s];
182
+ p[t] = u[s];
181
183
  }
182
- t.St = u;
183
- t.gt = p;
184
- t.wt = i;
184
+ t.Mt = l;
185
+ t.St = p;
186
+ t.wt = e;
185
187
  t.yt = s.slice(0);
186
188
  // Dispose unmatched sources LAST (general-path ordering).
187
- for (h = 0; h < e.length; h++) {
188
- if (c === undefined || !c[h]) l[e[h]].dispose();
189
+ for (h = 0; h < i.length; h++) {
190
+ if (c === undefined || !c[h]) u[i[h]].dispose();
189
191
  }
190
192
  return true;
191
193
  }
@@ -195,75 +197,96 @@ function updateKeyedMap() {
195
197
  t[$TRACK];
196
198
  // top level tracking
197
199
  runWithOwner(this.ie, () => {
198
- let i, e, r, n,
200
+ let e, i, r, n,
199
201
  // Mappers write freshly-created row/index signals into the STAGE
200
202
  // arrays (`rows`/`indexes`), never into `this._rows`/`this._indexes`.
201
- o = this.Mt ? this.kt ? () => {
202
- r[e] = signal(t[e], pureOptions);
203
- return this.At(accessor(r[e]), e);
203
+ o = this.jt ? this.gt ? () => {
204
+ r[i] = signal(t[i], pureOptions);
205
+ return this.At(accessor(r[i]), i);
204
206
  } : () => {
205
- r[e] = signal(t[e], pureOptions);
206
- n && (n[e] = signal(e, pureOptions));
207
- return this.At(accessor(r[e]), n ? accessor(n[e]) : undefined);
208
- } : this.jt ? () => {
209
- const s = t[e];
210
- n[e] = signal(e, pureOptions);
211
- return this.At(s, accessor(n[e]));
207
+ r[i] = signal(t[i], pureOptions);
208
+ n && (n[i] = signal(i, pureOptions));
209
+ return this.At(accessor(r[i]), n ? accessor(n[i]) : undefined);
210
+ } : this.kt ? () => {
211
+ const s = t[i];
212
+ n[i] = signal(i, pureOptions);
213
+ return this.At(s, accessor(n[i]));
212
214
  } : () => {
213
- const s = t[e];
215
+ const s = t[i];
214
216
  return this.At(s);
215
217
  };
216
218
  // fast path for empty arrays
217
219
  if (s === 0) {
218
220
  if (this.wt !== 0) {
219
221
  this.ie.dispose(false);
220
- this.gt = [];
221
- this.yt = [];
222
222
  this.St = [];
223
+ this.yt = [];
224
+ this.Mt = [];
223
225
  this.wt = 0;
224
- this.Mt && (this.Mt = []);
225
226
  this.jt && (this.jt = []);
227
+ this.kt && (this.kt = []);
226
228
  }
227
- if (this.Wt && !this.St[0]) {
229
+ if (this.bt && !this.Mt[0]) {
228
230
  // an aborted fallback attempt leaves an owner without a mapping;
229
231
  // dispose it before re-creating
230
- this.gt[0]?.dispose();
231
- this.St[0] = runWithOwner(this.gt[0] = createOwner(), this.Wt);
232
+ this.St[0]?.dispose();
233
+ this.Mt[0] = runWithOwner(this.St[0] = createOwner(), this.bt);
232
234
  }
233
235
  }
234
236
  // fast path for new create
235
237
  else if (this.wt === 0) {
236
238
  const h = new Array(s);
237
239
  const f = new Array(s);
238
- r = this.Mt && new Array(s);
239
- n = this.jt && new Array(s);
240
+ r = this.jt && new Array(s);
241
+ n = this.kt && new Array(s);
240
242
  try {
241
- for (e = 0; e < s; e++) h[e] = runWithOwner(f[e] = createOwner(), o);
243
+ for (i = 0; i < s; i++) h[i] = runWithOwner(f[i] = createOwner(), o);
242
244
  } catch (t) {
243
- for (i = 0; i <= e; i++) f[i]?.dispose();
245
+ for (e = 0; e <= i; e++) f[e]?.dispose();
244
246
  throw t;
245
247
  }
246
248
  // commit
247
- if (this.gt[0]) this.gt[0].dispose();
249
+ if (this.St[0]) this.St[0].dispose();
248
250
  // previous fallback
249
- this.St = h;
250
- this.gt = f;
251
- r && (this.Mt = r);
252
- n && (this.jt = n);
251
+ this.Mt = h;
252
+ this.St = f;
253
+ r && (this.jt = r);
254
+ n && (this.kt = n);
253
255
  this.yt = t.slice(0);
254
256
  this.wt = s;
255
257
  } else {
256
- let h, f, c, a, l, u, p, d, w,
258
+ let h, f, c, a, u, l, p, d, m,
257
259
  // Dev (attribution engine installed): the items behind the exited and
258
260
  // entered rows, for the list-identity census.
259
- m, O;
261
+ w, O;
262
+ // The pass's write to a per-slot signal (a row accessor in index mode,
263
+ // an index accessor in keyed mode). The list's frame lives in these
264
+ // writes as much as in the computed's result, so under a LANE pass they
265
+ // are the lane's frame too (F1): a plain `setSignal` staged them into
266
+ // the action's transaction and the row readers were served the
267
+ // committed value until the action landed — `<For>` without `keyed`
268
+ // showed the pre-action list for the whole action while the keyed modes
269
+ // showed the optimistic one. The engine publishes the write as a
270
+ // derived override on the slot (lanes stage, A17) and lands or
271
+ // supersedes it when a plain pass later writes a slot still carrying
272
+ // one (A18) — `landOnOverride`'s slot arm. Decided once per pass, not
273
+ // per slot: a lane pass marks the map (`_laneSlots`: its slots may
274
+ // carry overrides), a marked map routes every slot write through the
275
+ // engine while any lane is live — a slot's override resolves with its
276
+ // lane's transaction, or with the batch for an orphan lane
277
+ // (resolveOptimisticNodes, then cleanupCompletedLanes, both before the
278
+ // completion wakes any recompute), so a pass that finds no lane live
279
+ // knows the slots are clean and drops the mark — and an unmarked map
280
+ // takes `setSignal` directly. The engine is installed whenever a lane
281
+ // is active.
282
+ const _ = (this.Wt = currentOptimisticLane !== null || this.Wt && activeLanes.size !== 0) ? GlobalQueue.st : setSignal;
260
283
  // skip common prefix
261
- for (h = 0, f = Math.min(this.wt, s); h < f && (this.yt[h] === t[h] || this.Mt && compare(this.Kn, this.yt[h], t[h])); h++) {
262
- if (this.Mt) setSignal(this.Mt[h], t[h]);
284
+ for (h = 0, f = Math.min(this.wt, s); h < f && (this.yt[h] === t[h] || this.jt && compare(this.Kn, this.yt[h], t[h])); h++) {
285
+ if (this.jt) _(this.jt[h], t[h]);
263
286
  }
264
287
  // skip common suffix — counted only; retained entries land in one pass
265
288
  // at commit instead of being staged and copied twice
266
- for (f = this.wt - 1, c = s - 1; f >= h && c >= h && (this.yt[f] === t[c] || this.Mt && compare(this.Kn, this.yt[f], t[c])); f--,
289
+ for (f = this.wt - 1, c = s - 1; f >= h && c >= h && (this.yt[f] === t[c] || this.jt && compare(this.Kn, this.yt[f], t[c])); f--,
267
290
  c--) ;
268
291
  // no structural change (every position matched in place at equal
269
292
  // length — the common post-reconcile shape): keep the same mapped
@@ -279,103 +302,103 @@ function updateKeyedMap() {
279
302
  // (plain removals, tail edits), the general path is window-
280
303
  // proportional and cheap — the fast path would only re-walk what the
281
304
  // trims proved.
282
- if (s <= this.wt && f - h > 64 && this.Mt === undefined && this.jt === undefined) {
305
+ if (s <= this.wt && f - h > 64 && this.jt === undefined && this.kt === undefined) {
283
306
  // PROBE before the scan: a small move keeps a mid-window item within
284
307
  // ±32 of its old position; a REPLACE (all fresh items — the shape
285
308
  // every page's first structural pass usually is) has it nowhere.
286
309
  // ~65 compares, no allocation, and the scan function is never
287
310
  // compiled for a replace (its cold first-call compile was the cost).
288
- const i = h + (c - h >> 1);
289
- const e = t[i];
290
- const r = Math.min(f, i + 32);
291
- let n = Math.max(h, i - 32);
292
- while (n <= r && this.yt[n] !== e) n++;
311
+ const e = h + (c - h >> 1);
312
+ const i = t[e];
313
+ const r = Math.min(f, e + 32);
314
+ let n = Math.max(h, e - 32);
315
+ while (n <= r && this.yt[n] !== i) n++;
293
316
  if (n <= r && trySmallMove(this, t, s, h)) return;
294
317
  }
295
- const _ = s - this.wt;
296
- const y = new Array(s);
318
+ const y = s - this.wt;
297
319
  const A = new Array(s);
298
- r = this.Mt ? new Array(s) : undefined;
299
- n = this.jt ? new Array(s) : undefined;
320
+ const M = new Array(s);
321
+ r = this.jt ? new Array(s) : undefined;
322
+ n = this.kt ? new Array(s) : undefined;
300
323
  // 0) prepare a map of all indices in the changed window of newItems,
301
324
  // scanning backwards so we encounter them in natural order
302
- u = new Map;
325
+ l = new Map;
303
326
  p = new Array(c + 1);
304
- for (e = c; e >= h; e--) {
305
- a = t[e];
306
- l = this.Kn ? this.Kn(a) : a;
307
- i = u.get(l);
308
- p[e] = i === undefined ? -1 : i;
309
- u.set(l, e);
327
+ for (i = c; i >= h; i--) {
328
+ a = t[i];
329
+ u = this.Kn ? this.Kn(a) : a;
330
+ e = l.get(u);
331
+ p[i] = e === undefined ? -1 : e;
332
+ l.set(u, i);
310
333
  }
311
334
  // 1) step through the old changed window and see if items can be found
312
335
  // in the new set; if so, stage them at their new positions; if not,
313
336
  // queue them for disposal at commit
314
- for (i = h; i <= f; i++) {
315
- a = this.yt[i];
316
- l = this.Kn ? this.Kn(a) : a;
317
- e = u.get(l);
318
- if (e !== undefined && e !== -1) {
319
- y[e] = this.St[i];
320
- A[e] = this.gt[i];
321
- r && (r[e] = this.Mt[i]);
322
- n && (n[e] = this.jt[i]);
323
- e = p[e];
324
- u.set(l, e);
337
+ for (e = h; e <= f; e++) {
338
+ a = this.yt[e];
339
+ u = this.Kn ? this.Kn(a) : a;
340
+ i = l.get(u);
341
+ if (i !== undefined && i !== -1) {
342
+ A[i] = this.Mt[e];
343
+ M[i] = this.St[e];
344
+ r && (r[i] = this.jt[e]);
345
+ n && (n[i] = this.kt[e]);
346
+ i = p[i];
347
+ l.set(u, i);
325
348
  } else {
326
- (d ??= []).push(this.gt[i]);
349
+ (d ??= []).push(this.St[e]);
327
350
  if (false && attrHooks !== null) ;
328
351
  }
329
352
  }
330
353
  // 2) create new rows into the temp arrays; an abort disposes only these
331
354
  try {
332
- for (e = h; e <= c; e++) {
333
- if (A[e] !== undefined) continue;
334
- (w ??= []).push(A[e] = createOwner());
355
+ for (i = h; i <= c; i++) {
356
+ if (M[i] !== undefined) continue;
357
+ (m ??= []).push(M[i] = createOwner());
335
358
  if (false && attrHooks !== null) ;
336
- y[e] = runWithOwner(A[e], o);
359
+ A[i] = runWithOwner(M[i], o);
337
360
  }
338
361
  } catch (t) {
339
- if (w) for (i = 0; i < w.length; i++) w[i].dispose();
362
+ if (m) for (e = 0; e < m.length; e++) m[e].dispose();
340
363
  throw t;
341
364
  }
342
365
  // 3) commit: land the retained prefix and suffix plus the staged window
343
366
  // into the fresh arrays, swap them in (new identity for downstream
344
367
  // change propagation), then dispose exited rows
345
- for (i = 0; i < h; i++) {
346
- y[i] = this.St[i];
347
- A[i] = this.gt[i];
348
- r && (r[i] = this.Mt[i]);
349
- n && (n[i] = this.jt[i]);
368
+ for (e = 0; e < h; e++) {
369
+ A[e] = this.Mt[e];
370
+ M[e] = this.St[e];
371
+ r && (r[e] = this.jt[e]);
372
+ n && (n[e] = this.kt[e]);
350
373
  }
351
- for (e = h; e <= c; e++) {
352
- if (r) setSignal(r[e], t[e]);
353
- if (n) setSignal(n[e], e);
374
+ for (i = h; i <= c; i++) {
375
+ if (r) _(r[i], t[i]);
376
+ if (n) _(n[i], i);
354
377
  }
355
- for (e = c + 1; e < s; e++) {
356
- y[e] = this.St[e - _];
357
- A[e] = this.gt[e - _];
378
+ for (i = c + 1; i < s; i++) {
379
+ A[i] = this.Mt[i - y];
380
+ M[i] = this.St[i - y];
358
381
  if (r) {
359
- r[e] = this.Mt[e - _];
360
- setSignal(r[e], t[e]);
382
+ r[i] = this.jt[i - y];
383
+ _(r[i], t[i]);
361
384
  }
362
385
  if (n) {
363
- n[e] = this.jt[e - _];
364
- if (_ !== 0) setSignal(n[e], e);
386
+ n[i] = this.kt[i - y];
387
+ if (y !== 0) _(n[i], i);
365
388
  }
366
389
  }
367
- this.St = y;
368
- this.gt = A;
369
- r && (this.Mt = r);
370
- n && (this.jt = n);
390
+ this.Mt = A;
391
+ this.St = M;
392
+ r && (this.jt = r);
393
+ n && (this.kt = n);
371
394
  this.wt = s;
372
395
  // save a copy of the mapped items for the next update
373
396
  this.yt = t.slice(0);
374
- if (d) for (i = 0; i < d.length; i++) d[i].dispose();
375
- if (false && attrHooks !== null && m !== undefined && O !== undefined) ;
397
+ if (d) for (e = 0; e < d.length; e++) d[e].dispose();
398
+ if (false && attrHooks !== null && w !== undefined && O !== undefined) ;
376
399
  }
377
400
  });
378
- return this.St;
401
+ return this.Mt;
379
402
  }
380
403
 
381
404
  /**
@@ -392,18 +415,18 @@ function updateKeyedMap() {
392
415
  * ```
393
416
  *
394
417
  * @description https://docs.solidjs.com/reference/reactive-utilities/repeat
395
- */ function repeat(t, s, i) {
396
- const e = s;
418
+ */ function repeat(t, s, e) {
419
+ const i = s;
397
420
  const r = {
398
421
  ie: createOwner(),
399
422
  wt: 0,
400
- bt: 0,
423
+ vt: 0,
401
424
  It: t,
402
- At: e,
403
- gt: [],
425
+ At: i,
404
426
  St: [],
405
- vt: i?.from,
406
- Wt: i?.fallback
427
+ Mt: [],
428
+ Ct: e?.from,
429
+ bt: e?.fallback
407
430
  };
408
431
  const n = computed(updateRepeat.bind(r));
409
432
  // Same as mapArray: untracked reads inside the internal owner resolve via
@@ -423,58 +446,58 @@ function updateKeyedMap() {
423
446
  // disjoint-window/front-clear/end-clear/shift special cases.
424
447
  function updateRepeat() {
425
448
  const t = this.It();
426
- const s = this.vt?.() || 0;
449
+ const s = this.Ct?.() || 0;
427
450
  runWithOwner(this.ie, () => {
428
451
  if (t === 0) {
429
452
  if (this.wt !== 0) {
430
453
  this.ie.dispose(false);
431
- this.gt = [];
432
454
  this.St = [];
455
+ this.Mt = [];
433
456
  this.wt = 0;
434
457
  // Reset offset to match the cleared data (#2767, repro 2).
435
- this.bt = 0;
458
+ this.vt = 0;
436
459
  }
437
- if (this.Wt && !this.St[0]) {
460
+ if (this.bt && !this.Mt[0]) {
438
461
  // an aborted fallback attempt leaves an owner without a mapping;
439
462
  // dispose it before re-creating
440
- this.gt[0]?.dispose();
441
- this.St[0] = runWithOwner(this.gt[0] = createOwner(), this.Wt);
463
+ this.St[0]?.dispose();
464
+ this.Mt[0] = runWithOwner(this.St[0] = createOwner(), this.bt);
442
465
  }
443
466
  return;
444
467
  }
445
- const i = s + t;
446
- const e = this.bt + this.wt;
468
+ const e = s + t;
469
+ const i = this.vt + this.wt;
447
470
  // Retained overlap [keepStart, keepEnd) in global indexes; empty when the
448
471
  // windows are disjoint or when coming from empty/fallback.
449
- const r = Math.max(s, this.bt);
450
- const n = Math.min(i, e);
472
+ const r = Math.max(s, this.vt);
473
+ const n = Math.min(e, i);
451
474
  const o = new Array(t);
452
475
  const h = new Array(t);
453
476
  for (let t = r; t < n; t++) {
454
- h[t - s] = this.gt[t - this.bt];
455
- o[t - s] = this.St[t - this.bt];
477
+ h[t - s] = this.St[t - this.vt];
478
+ o[t - s] = this.Mt[t - this.vt];
456
479
  }
457
480
  try {
458
- for (let t = s; t < i; t++) {
481
+ for (let t = s; t < e; t++) {
459
482
  if (t >= r && t < n) continue;
460
483
  o[t - s] = runWithOwner(h[t - s] = createOwner(), () => this.At(t));
461
484
  }
462
485
  } catch (t) {
463
- for (let t = s; t < i; t++) if ((t < r || t >= n) && h[t - s]) h[t - s].dispose();
486
+ for (let t = s; t < e; t++) if ((t < r || t >= n) && h[t - s]) h[t - s].dispose();
464
487
  throw t;
465
488
  }
466
489
  // commit: dispose the previous fallback or the rows leaving the window
467
- if (this.wt === 0) this.gt[0]?.dispose(); else for (let t = this.bt; t < e; t++) if (t < s || t >= i) this.gt[t - this.bt].dispose();
468
- this.St = o;
469
- this.gt = h;
470
- this.bt = s;
490
+ if (this.wt === 0) this.St[0]?.dispose(); else for (let t = this.vt; t < i; t++) if (t < s || t >= e) this.St[t - this.vt].dispose();
491
+ this.Mt = o;
492
+ this.St = h;
493
+ this.vt = s;
471
494
  this.wt = t;
472
495
  });
473
- return this.St;
496
+ return this.Mt;
474
497
  }
475
498
 
476
- function compare(t, s, i) {
477
- return t ? t(s) === t(i) : true;
499
+ function compare(t, s, e) {
500
+ return t ? t(s) === t(e) : true;
478
501
  }
479
502
 
480
503
  export { mapArray, repeat };
@@ -55,7 +55,7 @@ import { setOptHooks, $OWNER, lookupTarget } from "./target.js";
55
55
  * staged values to converge (normal speculation). Resolves merges first:
56
56
  * merge unions optimistic nodes/stores into the target. */ function transitionHoldsOptimism(e) {
57
57
  const t = currentTransition(e);
58
- return t.Rn !== true && (t.cn.length !== 0 || t.ri.size !== 0);
58
+ return t.Rn !== true && (t.cn.length !== 0 || t.ti.size !== 0);
59
59
  }
60
60
 
61
61
  let blockedInstalled = false;
@@ -135,7 +135,7 @@ function installNextBlockedHalf() {
135
135
  };
136
136
  const t = GlobalQueue.ai;
137
137
  GlobalQueue.ai = e => {
138
- for (const t of e.ri) {
138
+ for (const t of e.ti) {
139
139
  const n = t?.[$TARGET];
140
140
  const i = n?.fam;
141
141
  const r = i?.node;