@solidjs/signals 2.0.0-rc.2 → 2.0.0-rc.20
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/dev-shared.js +6505 -0
- package/dist/dev.attribution.js +3484 -0
- package/dist/dev.js +10227 -9508
- package/dist/observe/affects-marks.js +86 -0
- package/dist/observe/affects.js +112 -0
- package/dist/observe/attribution.js +7 -0
- package/dist/observe/boundaries.js +696 -0
- package/dist/observe/core/action.js +182 -0
- package/dist/observe/core/async.js +824 -0
- package/dist/observe/core/attribution-costs.js +66 -0
- package/dist/observe/core/attribution-feedback.js +280 -0
- package/dist/observe/core/attribution-hooks.js +83 -0
- package/dist/observe/core/attribution-queries.js +43 -0
- package/dist/observe/core/attribution.js +3079 -0
- package/dist/observe/core/constants.js +269 -0
- package/dist/observe/core/context.js +63 -0
- package/dist/observe/core/copies.js +10 -0
- package/dist/observe/core/core.js +1707 -0
- package/dist/observe/core/dev.js +394 -0
- package/dist/observe/core/effect.js +193 -0
- package/dist/observe/core/error-hooks.js +71 -0
- package/dist/observe/core/error.js +82 -0
- package/dist/observe/core/external.js +97 -0
- package/dist/observe/core/graph.js +162 -0
- package/dist/observe/core/heap.js +124 -0
- package/dist/observe/core/identities.js +62 -0
- package/dist/observe/core/invariants.js +12 -0
- package/dist/observe/core/lanes.js +972 -0
- package/dist/observe/core/owner.js +371 -0
- package/dist/observe/core/scheduler.js +1157 -0
- package/dist/observe/core/truth.js +47 -0
- package/dist/observe/core/verdict.js +470 -0
- package/dist/observe/deferred.js +186 -0
- package/dist/observe/flatten.js +79 -0
- package/dist/observe/from.js +248 -0
- package/dist/observe/index.js +71 -0
- package/dist/observe/map.js +593 -0
- package/dist/observe/reveal.js +212 -0
- package/dist/observe/signals.js +717 -0
- package/dist/observe/store/affects.js +142 -0
- package/dist/observe/store/edges.js +39 -0
- package/dist/observe/store/hooks.js +16 -0
- package/dist/observe/store/index.js +47 -0
- package/dist/observe/store/optimistic.js +713 -0
- package/dist/observe/store/projection.js +345 -0
- package/dist/observe/store/reconcile.js +281 -0
- package/dist/observe/store/store.js +2127 -0
- package/dist/observe/store/storePath.js +103 -0
- package/dist/observe/store/target.js +46 -0
- package/dist/observe/store/types.js +83 -0
- package/dist/observe/store/utils.js +1063 -0
- package/dist/prod/affects-marks.js +86 -0
- package/dist/prod/affects.js +98 -112
- package/dist/prod/attribution.js +45 -0
- package/dist/prod/boundaries.js +578 -468
- package/dist/prod/core/action.js +92 -59
- package/dist/prod/core/async.js +522 -336
- package/dist/prod/core/attribution-hooks.js +3 -0
- package/dist/prod/core/constants.js +168 -44
- package/dist/prod/core/context.js +12 -16
- package/dist/prod/core/copies.js +10 -0
- package/dist/prod/core/core.js +1345 -627
- package/dist/prod/core/dev.js +123 -1
- package/dist/prod/core/effect.js +113 -80
- package/dist/prod/core/error-hooks.js +71 -0
- package/dist/prod/core/error.js +18 -4
- package/dist/prod/core/external.js +6 -7
- package/dist/prod/core/graph.js +119 -72
- package/dist/prod/core/heap.js +85 -109
- package/dist/prod/core/identities.js +62 -0
- package/dist/prod/core/invariants.js +1 -32
- package/dist/prod/core/lanes.js +931 -132
- package/dist/prod/core/owner.js +192 -129
- package/dist/prod/core/scheduler.js +948 -642
- package/dist/prod/core/truth.js +47 -0
- package/dist/prod/core/verdict.js +409 -420
- package/dist/prod/deferred.js +184 -0
- package/dist/prod/flatten.js +77 -0
- package/dist/prod/from.js +248 -0
- package/dist/prod/index.js +40 -16
- package/dist/prod/map.js +481 -211
- package/dist/prod/reveal.js +212 -0
- package/dist/prod/signals.js +401 -84
- package/dist/prod/store/affects.js +142 -0
- package/dist/prod/store/edges.js +39 -0
- package/dist/prod/store/hooks.js +16 -0
- package/dist/prod/store/index.js +27 -18
- package/dist/prod/store/optimistic.js +707 -0
- package/dist/prod/store/projection.js +331 -0
- package/dist/prod/store/reconcile.js +281 -0
- package/dist/prod/store/store.js +1952 -267
- package/dist/prod/store/storePath.js +1 -1
- package/dist/prod/store/target.js +43 -0
- package/dist/prod/store/types.js +83 -0
- package/dist/prod/store/utils.js +997 -138
- package/dist/types/affects-marks.d.ts +14 -0
- package/dist/types/affects.d.ts +12 -30
- package/dist/types/attribution.d.ts +19 -0
- package/dist/types/attribution.prod.d.ts +22 -0
- package/dist/types/boundaries.d.ts +99 -124
- package/dist/types/carved.d.ts +1 -0
- package/dist/types/core/action.d.ts +23 -9
- package/dist/types/core/async.d.ts +34 -6
- package/dist/types/core/attribution-costs.d.ts +35 -0
- package/dist/types/core/attribution-feedback.d.ts +133 -0
- package/dist/types/core/attribution-hooks.d.ts +307 -8
- package/dist/types/core/attribution-queries.d.ts +24 -0
- package/dist/types/core/attribution.d.ts +802 -72
- package/dist/types/core/constants.d.ts +195 -38
- package/dist/types/core/copies.d.ts +54 -0
- package/dist/types/core/core.d.ts +295 -65
- package/dist/types/core/dev.d.ts +509 -22
- package/dist/types/core/effect.d.ts +1 -1
- package/dist/types/core/error-hooks.d.ts +71 -0
- package/dist/types/core/error.d.ts +18 -1
- package/dist/types/core/graph.d.ts +40 -1
- package/dist/types/core/heap.d.ts +5 -5
- package/dist/types/core/identities.d.ts +17 -0
- package/dist/types/core/index.d.ts +11 -7
- package/dist/types/core/invariants.d.ts +1 -26
- package/dist/types/core/lanes.d.ts +74 -43
- package/dist/types/core/owner.d.ts +27 -9
- package/dist/types/core/scheduler.d.ts +353 -102
- package/dist/types/core/truth.d.ts +18 -0
- package/dist/types/core/types.d.ts +97 -71
- package/dist/types/core/verdict.d.ts +35 -0
- package/dist/types/deferred.d.ts +28 -0
- package/dist/types/flatten.d.ts +8 -0
- package/dist/types/from.d.ts +47 -0
- package/dist/types/index.d.ts +33 -7
- package/dist/types/map.d.ts +4 -2
- package/dist/types/reveal.d.ts +19 -0
- package/dist/types/signals.d.ts +196 -45
- package/dist/types/store/affects.d.ts +12 -0
- package/dist/types/store/edges.d.ts +9 -0
- package/dist/types/store/hooks.d.ts +62 -0
- package/dist/types/store/index.d.ts +42 -15
- package/dist/types/store/optimistic.d.ts +24 -45
- package/dist/types/store/projection.d.ts +17 -68
- package/dist/types/store/reconcile.d.ts +3 -46
- package/dist/types/store/store.d.ts +133 -136
- package/dist/types/store/storePath.d.ts +1 -1
- package/dist/types/store/target.d.ts +166 -0
- package/dist/types/store/types.d.ts +105 -0
- package/dist/types/store/utils.d.ts +188 -0
- package/package.json +31 -26
- package/dist/node.cjs +0 -8745
- package/dist/prod/core/optimistic.js +0 -265
- package/dist/prod/store/next/optimistic.js +0 -385
- package/dist/prod/store/next/projection.js +0 -172
- package/dist/prod/store/next/reconcile.js +0 -331
- package/dist/prod/store/next/store.js +0 -1499
- package/dist/prod/store/next/target.js +0 -20
- package/dist/types/core/optimistic.d.ts +0 -6
- package/dist/types/store/next/optimistic.d.ts +0 -20
- package/dist/types/store/next/projection.d.ts +0 -8
- package/dist/types/store/next/reconcile.d.ts +0 -3
- package/dist/types/store/next/store.d.ts +0 -77
- package/dist/types/store/next/target.d.ts +0 -117
- package/dist/types-cjs/affects.d.cts +0 -47
- package/dist/types-cjs/boundaries.d.cts +0 -175
- package/dist/types-cjs/core/action.d.cts +0 -64
- package/dist/types-cjs/core/async.d.cts +0 -21
- package/dist/types-cjs/core/attribution-hooks.d.cts +0 -52
- package/dist/types-cjs/core/attribution.d.cts +0 -186
- package/dist/types-cjs/core/constants.d.cts +0 -97
- package/dist/types-cjs/core/context.d.cts +0 -36
- package/dist/types-cjs/core/core.d.cts +0 -163
- package/dist/types-cjs/core/dev.d.cts +0 -81
- package/dist/types-cjs/core/effect.d.cts +0 -30
- package/dist/types-cjs/core/error.d.cts +0 -47
- package/dist/types-cjs/core/external.d.cts +0 -15
- package/dist/types-cjs/core/graph.d.cts +0 -6
- package/dist/types-cjs/core/heap.d.cts +0 -22
- package/dist/types-cjs/core/index.d.cts +0 -13
- package/dist/types-cjs/core/invariants.d.cts +0 -59
- package/dist/types-cjs/core/lanes.d.cts +0 -44
- package/dist/types-cjs/core/optimistic.d.cts +0 -6
- package/dist/types-cjs/core/owner.d.cts +0 -124
- package/dist/types-cjs/core/scheduler.d.cts +0 -180
- package/dist/types-cjs/core/types.d.cts +0 -192
- package/dist/types-cjs/core/verdict.d.cts +0 -2
- package/dist/types-cjs/index.d.cts +0 -10
- package/dist/types-cjs/map.d.cts +0 -69
- package/dist/types-cjs/package.json +0 -3
- package/dist/types-cjs/signals.d.cts +0 -624
- package/dist/types-cjs/store/index.d.cts +0 -19
- package/dist/types-cjs/store/next/optimistic.d.cts +0 -20
- package/dist/types-cjs/store/next/projection.d.cts +0 -8
- package/dist/types-cjs/store/next/reconcile.d.cts +0 -3
- package/dist/types-cjs/store/next/store.d.cts +0 -77
- package/dist/types-cjs/store/next/target.d.cts +0 -117
- package/dist/types-cjs/store/optimistic.d.cts +0 -45
- package/dist/types-cjs/store/projection.d.cts +0 -70
- package/dist/types-cjs/store/reconcile.d.cts +0 -46
- package/dist/types-cjs/store/store.d.cts +0 -138
- package/dist/types-cjs/store/storePath.d.cts +0 -58
- package/dist/types-cjs/store/utils.d.cts +0 -74
package/dist/prod/map.js
CHANGED
|
@@ -1,220 +1,492 @@
|
|
|
1
1
|
import { computed, runWithOwner, signal, setSignal } from "./core/core.js";
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import "./core/scheduler.js";
|
|
3
|
+
import "./core/verdict.js";
|
|
6
4
|
|
|
7
5
|
import { CONFIG_AUTO_DISPOSE } from "./core/constants.js";
|
|
8
6
|
|
|
9
|
-
import "./core/
|
|
7
|
+
import { attrHooks } from "./core/attribution-hooks.js";
|
|
10
8
|
|
|
11
|
-
import "./core/
|
|
9
|
+
import "./core/scheduler.js";
|
|
10
|
+
|
|
11
|
+
import { createOwner, getOwner } from "./core/owner.js";
|
|
12
12
|
|
|
13
13
|
import "./core/effect.js";
|
|
14
14
|
|
|
15
15
|
import { accessor } from "./signals.js";
|
|
16
16
|
|
|
17
|
-
import { $TRACK } from "./store/
|
|
18
|
-
|
|
19
|
-
import "./store/next/store.js";
|
|
17
|
+
import { $TRACK, shallowView, $TARGET } from "./store/types.js";
|
|
20
18
|
|
|
21
|
-
function mapArray(t,
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
19
|
+
function mapArray(t, e, i) {
|
|
20
|
+
const s = typeof i?.keyed === "function" ? i.keyed : undefined;
|
|
21
|
+
const n = e.length > 1;
|
|
22
|
+
const r = e;
|
|
23
|
+
const o = {
|
|
24
|
+
H: createOwner(),
|
|
25
|
+
it: 0,
|
|
26
|
+
st: t,
|
|
27
|
+
ot: [],
|
|
28
|
+
ft: r,
|
|
29
|
+
ht: [],
|
|
30
|
+
tn: [],
|
|
31
|
+
Xe: s,
|
|
32
|
+
ct: s || i?.keyed === false ? [] : undefined,
|
|
33
|
+
lt: n && i?.keyed !== false ? [] : undefined,
|
|
34
|
+
ut: i?.keyed === false,
|
|
35
|
+
L: i?.fallback
|
|
38
36
|
};
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
h.jt.Ot = o;
|
|
43
|
-
o.T &= ~CONFIG_AUTO_DISPOSE;
|
|
44
|
-
return accessor(o);
|
|
37
|
+
const f = computed(updateKeyedMap.bind(o), undefined);
|
|
38
|
+
f.l &= ~CONFIG_AUTO_DISPOSE;
|
|
39
|
+
return accessor(f);
|
|
45
40
|
}
|
|
46
41
|
|
|
47
42
|
const pureOptions = {
|
|
48
43
|
ownedWrite: true
|
|
49
44
|
};
|
|
50
45
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
//
|
|
58
|
-
|
|
59
|
-
|
|
46
|
+
function trySmallMove(t, e, i, s) {
|
|
47
|
+
const n = t.ot;
|
|
48
|
+
const r = t.it - 1;
|
|
49
|
+
const o = [];
|
|
50
|
+
const f = [];
|
|
51
|
+
const h = [];
|
|
52
|
+
// flat triples: oldStart, newStart, length
|
|
53
|
+
let c = 256;
|
|
54
|
+
let a = s;
|
|
55
|
+
let l = s;
|
|
56
|
+
let u = false;
|
|
57
|
+
while (a <= r && l <= i - 1) {
|
|
58
|
+
const t = n[a];
|
|
59
|
+
const s = e[l];
|
|
60
|
+
if (t === s) {
|
|
61
|
+
if (!u) {
|
|
62
|
+
h.push(a, l, 0);
|
|
63
|
+
u = true;
|
|
64
|
+
}
|
|
65
|
+
h[h.length - 1]++;
|
|
66
|
+
a++;
|
|
67
|
+
l++;
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
u = false;
|
|
71
|
+
// Bounded realignment lookahead, shorter distance wins.
|
|
72
|
+
let w = -1;
|
|
73
|
+
let d = Math.min(32 - o.length, r - a, c);
|
|
74
|
+
for (let t = 1; t <= d; t++) {
|
|
75
|
+
if (n[a + t] === s) {
|
|
76
|
+
w = t;
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
c -= w === -1 ? d : w;
|
|
81
|
+
let p = -1;
|
|
82
|
+
d = Math.min(32 - f.length, i - 1 - l, c);
|
|
83
|
+
for (let i = 1; i <= d; i++) {
|
|
84
|
+
if (e[l + i] === t) {
|
|
85
|
+
p = i;
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
c -= p === -1 ? d : p;
|
|
90
|
+
if (w !== -1 && (p === -1 || w <= p)) {
|
|
91
|
+
while (w-- > 0) o.push(a++);
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
if (p !== -1) {
|
|
95
|
+
while (p-- > 0) f.push(l++);
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
if (c <= 0 || o.length === 32 || f.length === 32) return false;
|
|
99
|
+
o.push(a++);
|
|
100
|
+
f.push(l++);
|
|
101
|
+
}
|
|
102
|
+
for (;a <= r; a++) {
|
|
103
|
+
if (o.length === 32) return false;
|
|
104
|
+
o.push(a);
|
|
105
|
+
}
|
|
106
|
+
for (;l <= i - 1; l++) {
|
|
107
|
+
if (f.length === 32) return false;
|
|
108
|
+
f.push(l);
|
|
109
|
+
}
|
|
110
|
+
return commitSmallMove(t, e, i, o, f, h);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** PHASE 2 of the small-move path, in its OWN function so that a pass which
|
|
114
|
+
* only SCANS and bails (a full replace: the first structural pass of a page,
|
|
115
|
+
* typically) compiles nothing but the scan — V8 parses and compiles lazily
|
|
116
|
+
* per function, and cold `replace` measured +0.5 ms with both phases in one
|
|
117
|
+
* body. Pairs displaced sources with destinations (an unmatched destination
|
|
118
|
+
* is a replacement/insertion → general path), then commits: slice() the live
|
|
119
|
+
* arrays, copy shifted runs, patch displaced pairs, dispose leftovers. */ function commitSmallMove(t, e, i, s, n, r) {
|
|
120
|
+
const o = t.ot;
|
|
121
|
+
let f;
|
|
122
|
+
let h;
|
|
123
|
+
let c;
|
|
124
|
+
if (n.length !== 0) {
|
|
125
|
+
c = new Array(s.length);
|
|
126
|
+
for (h = 0; h < n.length; h++) {
|
|
127
|
+
let t = -1;
|
|
128
|
+
for (f = 0; f < s.length; f++) {
|
|
129
|
+
if (!c[f] && o[s[f]] === e[n[h]]) {
|
|
130
|
+
t = f;
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (t === -1) return false;
|
|
135
|
+
c[t] = true;
|
|
136
|
+
n[h] = n[h] << 6 | t;
|
|
137
|
+
// pack pairing (found < 32)
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
// DUPLICATES: the general path pairs equal identities by OCCURRENCE ORDER
|
|
141
|
+
// (the chained index map). Displaced↔displaced pairing above is ascending
|
|
142
|
+
// on both sides, so it agrees; but an aligned run was matched by POSITION,
|
|
143
|
+
// and if a displaced identity also occurs inside a run the two algorithms
|
|
144
|
+
// can hand different occurrences different owners (row-local state moves;
|
|
145
|
+
// a shrink could dispose the wrong one). Decline that case — general path.
|
|
146
|
+
if (s.length !== 0 || n.length !== 0) {
|
|
147
|
+
const t = new Set;
|
|
148
|
+
for (f = 0; f < s.length; f++) t.add(o[s[f]]);
|
|
149
|
+
for (h = 0; h < n.length; h++) t.add(e[n[h] >> 6]);
|
|
150
|
+
for (let e = 0; e < r.length; e += 3) {
|
|
151
|
+
const i = r[e];
|
|
152
|
+
for (let s = 0, n = r[e + 2]; s < n; s++) if (t.has(o[i + s])) return false;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
const a = t.ht;
|
|
156
|
+
const l = t.tn;
|
|
157
|
+
const u = a.slice(0, i);
|
|
158
|
+
const w = l.slice(0, i);
|
|
159
|
+
for (let t = 0; t < r.length; t += 3) {
|
|
160
|
+
const e = r[t];
|
|
161
|
+
const i = r[t + 1];
|
|
162
|
+
if (e !== i) {
|
|
163
|
+
for (let s = 0; s < r[t + 2]; s++) {
|
|
164
|
+
u[i + s] = a[e + s];
|
|
165
|
+
w[i + s] = l[e + s];
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
for (h = 0; h < n.length; h++) {
|
|
170
|
+
const t = n[h] >> 6;
|
|
171
|
+
const e = s[n[h] & 63];
|
|
172
|
+
u[t] = a[e];
|
|
173
|
+
w[t] = l[e];
|
|
174
|
+
}
|
|
175
|
+
t.ht = u;
|
|
176
|
+
t.tn = w;
|
|
177
|
+
t.it = i;
|
|
178
|
+
t.ot = e.slice(0);
|
|
179
|
+
// Dispose unmatched sources LAST (general-path ordering).
|
|
180
|
+
for (f = 0; f < s.length; f++) {
|
|
181
|
+
if (c === undefined || !c[f]) l[s[f]].dispose();
|
|
182
|
+
}
|
|
183
|
+
return true;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/** Stage a PURE REMOVAL without the key map: when the new window is the old
|
|
187
|
+
* window with items dropped, in order (one-item removals, every-nth, the
|
|
188
|
+
* table filters), a two-pointer walk lands every survivor in the window
|
|
189
|
+
* stage with one key call per item and returns the leavers; a shape that is
|
|
190
|
+
* not an ordered subsequence returns null with the node stage cleared, and
|
|
191
|
+
* the map path below starts from scratch (it rewrites every window slot of
|
|
192
|
+
* `temp` / `rows` / `indexes`, so only `tempNodes`' `!== undefined` probe
|
|
193
|
+
* needs the reset). The stage arrays are scratch — nothing live is touched. */ function stageRemoval(t, e, i, s, n, r, o, f, h) {
|
|
194
|
+
const c = t.Xe;
|
|
195
|
+
const a = t.ot;
|
|
196
|
+
const l = t.tn;
|
|
197
|
+
const u = [];
|
|
198
|
+
let w = i;
|
|
199
|
+
for (let d = i; d <= n; w++, d++) {
|
|
200
|
+
const n = c ? c(e[d]) : e[d];
|
|
201
|
+
while (w <= s && (c ? c(a[w]) : a[w]) !== n) u.push(l[w++]);
|
|
202
|
+
if (w > s) {
|
|
203
|
+
o.fill(undefined);
|
|
204
|
+
return null;
|
|
205
|
+
}
|
|
206
|
+
r[d] = t.ht[w];
|
|
207
|
+
o[d - i] = l[w];
|
|
208
|
+
if (f) f[d - i] = t.ct[w];
|
|
209
|
+
if (h) h[d - i] = t.lt[w];
|
|
210
|
+
}
|
|
211
|
+
for (;w <= s; w++) u.push(l[w]);
|
|
212
|
+
return u;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/** Land a staged window into the live bookkeeping arrays in place: shift the
|
|
216
|
+
* suffix by `dif` (a loop walked from the side that never overwrites an
|
|
217
|
+
* unread slot), take the window from the stage, write survivors' row and
|
|
218
|
+
* index signals. Its own function so the general path's body stays under
|
|
219
|
+
* the JIT's optimization budget — the inlined commit measured ~10% slower on
|
|
220
|
+
* full-window reorders (the small-move note has the same finding). */ function commitWindow(t, e, i, s, n, r, o, f, h) {
|
|
221
|
+
const c = t.tn;
|
|
222
|
+
const a = t.ct;
|
|
223
|
+
const l = t.lt;
|
|
224
|
+
const u = t.it;
|
|
225
|
+
const w = i - u;
|
|
226
|
+
let d, p;
|
|
227
|
+
if (w > 0) {
|
|
228
|
+
// Grow first: a store past the end from the top is a third slower than
|
|
229
|
+
// filling a pre-sized tail (measured on 1k refs, 2026-10-15).
|
|
230
|
+
c.length = i;
|
|
231
|
+
if (a) a.length = i;
|
|
232
|
+
if (l) l.length = i;
|
|
233
|
+
for (d = u - 1, p = i - 1; d > n; d--, p--) {
|
|
234
|
+
c[p] = c[d];
|
|
235
|
+
if (a) a[p] = a[d];
|
|
236
|
+
if (l) l[p] = l[d];
|
|
237
|
+
}
|
|
238
|
+
} else if (w < 0) {
|
|
239
|
+
for (d = n + 1, p = r + 1; d < u; d++, p++) {
|
|
240
|
+
c[p] = c[d];
|
|
241
|
+
if (a) a[p] = a[d];
|
|
242
|
+
if (l) l[p] = l[d];
|
|
243
|
+
}
|
|
244
|
+
c.length = i;
|
|
245
|
+
if (a) a.length = i;
|
|
246
|
+
if (l) l.length = i;
|
|
247
|
+
}
|
|
248
|
+
for (p = s; p <= r; p++) {
|
|
249
|
+
c[p] = o[p - s];
|
|
250
|
+
if (a) setSignal(a[p] = f[p - s], e[p]);
|
|
251
|
+
if (l) setSignal(l[p] = h[p - s], p);
|
|
252
|
+
}
|
|
253
|
+
for (p = r + 1; p < i; p++) {
|
|
254
|
+
if (a) setSignal(a[p], e[p]);
|
|
255
|
+
if (l && w !== 0) setSignal(l[p], p);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
60
259
|
function updateKeyedMap() {
|
|
61
|
-
|
|
260
|
+
// Untracked reads inside the internal owner resolve via _parentComputed:
|
|
261
|
+
// routed through the node, a store-proxy lookup sees pending writes (not a
|
|
262
|
+
// stale _value) and an async read in a row callback registers the node as
|
|
263
|
+
// the flight's reader (pending tracking + post-settle retry) instead of
|
|
264
|
+
// vanishing. Set per pass: the first pass runs inside `computed()`, before
|
|
265
|
+
// the node exists to the caller.
|
|
266
|
+
this.H.Ke = getOwner();
|
|
267
|
+
let t = this.st() || [];
|
|
62
268
|
t[$TRACK];
|
|
63
|
-
// top level tracking
|
|
64
|
-
|
|
65
|
-
|
|
269
|
+
// top level tracking (a store array's container node)
|
|
270
|
+
// A shallow store array diffs its backing: its slots are raw records, and
|
|
271
|
+
// a trap per slot read was most of a one-row write on a 1k-row list.
|
|
272
|
+
t = shallowView?.(t[$TARGET]) ?? t;
|
|
273
|
+
const e = t.length;
|
|
274
|
+
runWithOwner(this.H, () => {
|
|
275
|
+
let i, s,
|
|
276
|
+
// The stage slot a mapper writes its row/index signal into: `j` on the
|
|
277
|
+
// create-all path, `j - start` on the general path, whose stage arrays
|
|
278
|
+
// are sized to the changed WINDOW, not the list.
|
|
279
|
+
n, r, o,
|
|
66
280
|
// Mappers write freshly-created row/index signals into the STAGE
|
|
67
281
|
// arrays (`rows`/`indexes`), never into `this._rows`/`this._indexes`.
|
|
68
|
-
|
|
69
|
-
r[
|
|
70
|
-
return this
|
|
282
|
+
f = this.ct ? this.ut ? () => {
|
|
283
|
+
r[n] = signal(t[s], pureOptions);
|
|
284
|
+
return this.ft(accessor(r[n]), s);
|
|
71
285
|
} : () => {
|
|
72
|
-
r[
|
|
73
|
-
|
|
74
|
-
return this
|
|
75
|
-
} : this.
|
|
76
|
-
const
|
|
77
|
-
n
|
|
78
|
-
return this
|
|
286
|
+
r[n] = signal(t[s], pureOptions);
|
|
287
|
+
o && (o[n] = signal(s, pureOptions));
|
|
288
|
+
return this.ft(accessor(r[n]), o ? accessor(o[n]) : undefined);
|
|
289
|
+
} : this.lt ? () => {
|
|
290
|
+
const e = t[s];
|
|
291
|
+
o[n] = signal(s, pureOptions);
|
|
292
|
+
return this.ft(e, accessor(o[n]));
|
|
79
293
|
} : () => {
|
|
80
|
-
const
|
|
81
|
-
return this
|
|
294
|
+
const e = t[s];
|
|
295
|
+
return this.ft(e);
|
|
82
296
|
};
|
|
83
297
|
// fast path for empty arrays
|
|
84
|
-
if (
|
|
85
|
-
if (this.
|
|
86
|
-
this.
|
|
87
|
-
this.
|
|
88
|
-
this.
|
|
89
|
-
this.
|
|
90
|
-
this.
|
|
91
|
-
this.
|
|
92
|
-
this.
|
|
298
|
+
if (e === 0) {
|
|
299
|
+
if (this.it !== 0) {
|
|
300
|
+
this.H.dispose(false);
|
|
301
|
+
this.tn = [];
|
|
302
|
+
this.ot = [];
|
|
303
|
+
this.ht = [];
|
|
304
|
+
this.it = 0;
|
|
305
|
+
this.ct && (this.ct = []);
|
|
306
|
+
this.lt && (this.lt = []);
|
|
93
307
|
}
|
|
94
|
-
if (this.
|
|
308
|
+
if (this.L && !this.ht.length) {
|
|
95
309
|
// an aborted fallback attempt leaves an owner without a mapping;
|
|
96
310
|
// dispose it before re-creating
|
|
97
|
-
this.
|
|
98
|
-
this.
|
|
311
|
+
this.tn[0]?.dispose();
|
|
312
|
+
this.ht[0] = runWithOwner(this.tn[0] = createOwner(), this.L);
|
|
99
313
|
}
|
|
100
314
|
}
|
|
101
315
|
// fast path for new create
|
|
102
|
-
else if (this.
|
|
103
|
-
const
|
|
104
|
-
const c = new Array(
|
|
105
|
-
r = this.
|
|
106
|
-
|
|
316
|
+
else if (this.it === 0) {
|
|
317
|
+
const h = new Array(e);
|
|
318
|
+
const c = new Array(e);
|
|
319
|
+
r = this.ct && new Array(e);
|
|
320
|
+
o = this.lt && new Array(e);
|
|
107
321
|
try {
|
|
108
|
-
for (
|
|
322
|
+
for (s = 0; s < e; s++) {
|
|
323
|
+
n = s;
|
|
324
|
+
h[s] = runWithOwner(c[s] = createOwner(), f);
|
|
325
|
+
}
|
|
109
326
|
} catch (t) {
|
|
110
|
-
for (i = 0; i <=
|
|
327
|
+
for (i = 0; i <= s; i++) c[i]?.dispose();
|
|
111
328
|
throw t;
|
|
112
329
|
}
|
|
113
330
|
// commit
|
|
114
|
-
if (this.
|
|
331
|
+
if (this.tn[0]) this.tn[0].dispose();
|
|
115
332
|
// previous fallback
|
|
116
|
-
this.
|
|
117
|
-
this.
|
|
118
|
-
r && (this.
|
|
119
|
-
|
|
120
|
-
this.
|
|
121
|
-
this.
|
|
333
|
+
this.ht = h;
|
|
334
|
+
this.tn = c;
|
|
335
|
+
r && (this.ct = r);
|
|
336
|
+
o && (this.lt = o);
|
|
337
|
+
this.ot = t.slice(0);
|
|
338
|
+
this.it = e;
|
|
122
339
|
} else {
|
|
123
|
-
let
|
|
340
|
+
let h, c, a, l, u, w, d, p, m,
|
|
341
|
+
// Dev (attribution engine installed): the items behind the exited and
|
|
342
|
+
// entered rows, for the list-identity census.
|
|
343
|
+
O, _;
|
|
344
|
+
// The pass's write to a per-slot signal (a row accessor in index mode,
|
|
345
|
+
// an index accessor in keyed mode). The list's frame lives in these
|
|
346
|
+
// writes as much as in the computed's result, so under a LANE pass they
|
|
347
|
+
// are the lane's frame too (F1): a plain `setSignal` staged them into
|
|
348
|
+
// the action's transaction and the row readers were served the
|
|
349
|
+
// committed value until the action landed — `<For>` without `keyed`
|
|
350
|
+
// showed the pre-action list for the whole action while the keyed modes
|
|
351
|
+
// showed the optimistic one. The engine publishes the write as a
|
|
352
|
+
// derived override on the slot (lanes stage, A17) and lands or
|
|
353
|
+
// supersedes it when a plain pass later writes a slot still carrying
|
|
354
|
+
// one (A18) — `landOnOverride`'s slot arm. Decided once per pass, not
|
|
355
|
+
// per slot: a lane pass marks the map (`_laneSlots`: its slots may
|
|
356
|
+
// carry overrides), a marked map routes every slot write through the
|
|
357
|
+
// engine while any lane is live — a slot's override resolves with its
|
|
358
|
+
// lane's transaction, or with the batch for an orphan lane
|
|
359
|
+
// (resolveOptimisticNodes, then cleanupCompletedLanes, both before the
|
|
360
|
+
// completion wakes any recompute), so a pass that finds no lane live
|
|
361
|
+
// knows the slots are clean and drops the mark — and an unmarked map
|
|
362
|
+
// takes `setSignal` directly. The engine is installed whenever a lane
|
|
363
|
+
// is active.
|
|
364
|
+
// CARVE 2: the lane-slot arm (`_landOnOverride`, F1) went with the engine.
|
|
365
|
+
const y = setSignal;
|
|
124
366
|
// skip common prefix
|
|
125
|
-
for (
|
|
126
|
-
if (this.
|
|
367
|
+
for (h = 0, c = Math.min(this.it, e); h < c && (this.ot[h] === t[h] || this.ct && compare(this.Xe, this.ot[h], t[h])); h++) {
|
|
368
|
+
if (this.ct) y(this.ct[h], t[h]);
|
|
127
369
|
}
|
|
128
370
|
// skip common suffix — counted only; retained entries land in one pass
|
|
129
371
|
// at commit instead of being staged and copied twice
|
|
130
|
-
for (c = this.
|
|
372
|
+
for (c = this.it - 1, a = e - 1; c >= h && a >= h && (this.ot[c] === t[a] || this.ct && compare(this.Xe, this.ot[c], t[a])); c--,
|
|
131
373
|
a--) ;
|
|
132
374
|
// no structural change (every position matched in place at equal
|
|
133
375
|
// length — the common post-reconcile shape): keep the same mapped
|
|
134
376
|
// array identity so downstream consumers don't re-run at all
|
|
135
|
-
if (
|
|
136
|
-
this.
|
|
377
|
+
if (h === e && this.it === e) {
|
|
378
|
+
this.ot = t.slice(0);
|
|
137
379
|
return;
|
|
138
380
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
//
|
|
145
|
-
//
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
381
|
+
// SMALL-MOVE FAST PATH: extracted to its own function — inlining it
|
|
382
|
+
// here bloats updateKeyedMap past the JIT's optimization budget and
|
|
383
|
+
// deoptimizes the GENERAL path (measured 2x on reverse). Gated to
|
|
384
|
+
// LARGE trimmed windows: when the trims already shrank the window
|
|
385
|
+
// (plain removals, tail edits), the general path is window-
|
|
386
|
+
// proportional and cheap — the fast path would only re-walk what the
|
|
387
|
+
// trims proved.
|
|
388
|
+
if (e <= this.it && c - h > 64 && this.ct === undefined && this.lt === undefined) {
|
|
389
|
+
// PROBE before the scan: a small move keeps a mid-window item within
|
|
390
|
+
// ±32 of its old position; a REPLACE (all fresh items — the shape
|
|
391
|
+
// every page's first structural pass usually is) has it nowhere.
|
|
392
|
+
// ~65 compares, no allocation, and the scan function is never
|
|
393
|
+
// compiled for a replace (its cold first-call compile was the cost).
|
|
394
|
+
const i = h + (a - h >> 1);
|
|
395
|
+
const s = t[i];
|
|
396
|
+
const n = Math.min(c, i + 32);
|
|
397
|
+
let r = Math.max(h, i - 32);
|
|
398
|
+
while (r <= n && this.ot[r] !== s) r++;
|
|
399
|
+
if (r <= n && trySmallMove(this, t, e, h)) return;
|
|
154
400
|
}
|
|
155
|
-
|
|
156
|
-
//
|
|
157
|
-
//
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
401
|
+
const A = e - this.it;
|
|
402
|
+
// WINDOW-SIZED STAGING, IN-PLACE COMMIT (2026-10-15). The strong-abort
|
|
403
|
+
// contract (#2903) only needs the pass to touch nothing live before
|
|
404
|
+
// every mapper has succeeded; it never needed four fresh newLen-sized
|
|
405
|
+
// arrays. Only the changed window [start, newEnd] is staged — the
|
|
406
|
+
// prefix and suffix are, by construction, the rows that did not move
|
|
407
|
+
// relative to each other — and at commit the bookkeeping arrays
|
|
408
|
+
// (`_nodes`, `_rows`, `_indexes`) take the window in place with the
|
|
409
|
+
// suffix shifted by a plain loop (`copyWithin` is a generic
|
|
410
|
+
// per-element builtin in V8 — 30× slower than the loop on 1k refs,
|
|
411
|
+
// measured 2026-10-15). `_mappings` alone is
|
|
412
|
+
// rebuilt: its fresh identity is the change signal downstream relies
|
|
413
|
+
// on. A one-row edit on a 500-row list used to allocate ~20 KB of
|
|
414
|
+
// staging plus a position-sized chain array per commit (uibench's
|
|
415
|
+
// one-item tree ops at 4–6× Octane, jfb-reorder `removefirst` at
|
|
416
|
+
// 2.5×); now it stages one slot.
|
|
417
|
+
const g = a - h + 1;
|
|
418
|
+
const S = new Array(e);
|
|
419
|
+
const M = new Array(g);
|
|
420
|
+
r = this.ct ? new Array(g) : undefined;
|
|
421
|
+
o = this.lt ? new Array(g) : undefined;
|
|
422
|
+
// A shrinking pass is tried as a pure removal first (stageRemoval: no
|
|
423
|
+
// key map, one key call per item); anything else takes the map path.
|
|
424
|
+
const k = A < 0 ? stageRemoval(this, t, h, c, a, S, M, r, o) : null;
|
|
425
|
+
if (k !== null) {
|
|
426
|
+
// (The list-churn census below wants removals AND creations in one
|
|
427
|
+
// pass; a pure removal has none, so no item ledger is kept here.)
|
|
428
|
+
if (k.length !== 0) p = k;
|
|
429
|
+
} else {
|
|
430
|
+
// 0) prepare a map of all indices in the changed window of newItems,
|
|
431
|
+
// scanning backwards so we encounter them in natural order
|
|
432
|
+
w = new Map;
|
|
433
|
+
d = new Array(g);
|
|
434
|
+
for (s = a; s >= h; s--) {
|
|
435
|
+
l = t[s];
|
|
436
|
+
u = this.Xe ? this.Xe(l) : l;
|
|
437
|
+
i = w.get(u);
|
|
438
|
+
d[s - h] = i === undefined ? -1 : i;
|
|
439
|
+
w.set(u, s);
|
|
177
440
|
}
|
|
178
|
-
|
|
179
|
-
if
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
m[e] = this.qt[e - O];
|
|
197
|
-
_[e] = this.zt[e - O];
|
|
198
|
-
if (r) {
|
|
199
|
-
r[e] = this.Xt[e - O];
|
|
200
|
-
setSignal(r[e], t[e]);
|
|
441
|
+
// 1) step through the old changed window and see if items can be found
|
|
442
|
+
// in the new set; if so, stage them at their new positions; if not,
|
|
443
|
+
// queue them for disposal at commit
|
|
444
|
+
for (i = h; i <= c; i++) {
|
|
445
|
+
l = this.ot[i];
|
|
446
|
+
u = this.Xe ? this.Xe(l) : l;
|
|
447
|
+
s = w.get(u);
|
|
448
|
+
if (s !== undefined && s !== -1) {
|
|
449
|
+
S[s] = this.ht[i];
|
|
450
|
+
M[s - h] = this.tn[i];
|
|
451
|
+
r && (r[s - h] = this.ct[i]);
|
|
452
|
+
o && (o[s - h] = this.lt[i]);
|
|
453
|
+
s = d[s - h];
|
|
454
|
+
w.set(u, s);
|
|
455
|
+
} else {
|
|
456
|
+
(p ??= []).push(this.tn[i]);
|
|
457
|
+
if (false && attrHooks !== null) ;
|
|
458
|
+
}
|
|
201
459
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
460
|
+
// 2) create new rows into the window stage; an abort disposes only these
|
|
461
|
+
try {
|
|
462
|
+
for (s = h; s <= a; s++) {
|
|
463
|
+
if (M[s - h] !== undefined) continue;
|
|
464
|
+
(m ??= []).push(M[s - h] = createOwner());
|
|
465
|
+
if (false && attrHooks !== null) ;
|
|
466
|
+
n = s - h;
|
|
467
|
+
S[s] = runWithOwner(M[s - h], f);
|
|
468
|
+
}
|
|
469
|
+
} catch (t) {
|
|
470
|
+
if (m) for (i = 0; i < m.length; i++) m[i].dispose();
|
|
471
|
+
throw t;
|
|
205
472
|
}
|
|
206
473
|
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
474
|
+
// 3) commit: the retained prefix and suffix land in the fresh mapped
|
|
475
|
+
// array; the bookkeeping arrays take the staged window IN PLACE (own
|
|
476
|
+
// function: kept out of this body on purpose, see commitWindow); then
|
|
477
|
+
// the exited rows dispose
|
|
478
|
+
for (i = 0; i < h; i++) S[i] = this.ht[i];
|
|
479
|
+
for (s = a + 1; s < e; s++) S[s] = this.ht[s - A];
|
|
480
|
+
commitWindow(this, t, e, h, c, a, M, r, o);
|
|
481
|
+
this.ht = S;
|
|
482
|
+
this.it = e;
|
|
212
483
|
// save a copy of the mapped items for the next update
|
|
213
|
-
this.
|
|
214
|
-
if (
|
|
484
|
+
this.ot = t.slice(0);
|
|
485
|
+
if (p) for (i = 0; i < p.length; i++) p[i].dispose();
|
|
486
|
+
if (false && attrHooks !== null && O !== undefined && _ !== undefined) ;
|
|
215
487
|
}
|
|
216
488
|
});
|
|
217
|
-
return this.
|
|
489
|
+
return this.ht;
|
|
218
490
|
}
|
|
219
491
|
|
|
220
492
|
/**
|
|
@@ -230,27 +502,23 @@ function updateKeyedMap() {
|
|
|
230
502
|
* const view = repeat(count, i => `Item ${i}`, { fallback: () => "empty" });
|
|
231
503
|
* ```
|
|
232
504
|
*
|
|
233
|
-
* @description https://
|
|
234
|
-
*/ function repeat(t,
|
|
235
|
-
const
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
505
|
+
* @description https://v2.solidjs.com/reference/solid-js/advanced/jsx-component-primitives/repeat
|
|
506
|
+
*/ function repeat(t, e, i) {
|
|
507
|
+
const s = e;
|
|
508
|
+
const n = {
|
|
509
|
+
H: createOwner(),
|
|
510
|
+
it: 0,
|
|
511
|
+
wt: 0,
|
|
512
|
+
dt: t,
|
|
513
|
+
ft: s,
|
|
514
|
+
tn: [],
|
|
515
|
+
ht: [],
|
|
516
|
+
Ot: i?.from,
|
|
517
|
+
L: i?.fallback
|
|
246
518
|
};
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
// (pending tracking + post-settle retry) instead of vanishing.
|
|
251
|
-
r.jt.Ot = n;
|
|
252
|
-
n.T &= ~CONFIG_AUTO_DISPOSE;
|
|
253
|
-
return accessor(n);
|
|
519
|
+
const r = computed(updateRepeat.bind(n));
|
|
520
|
+
r.l &= ~CONFIG_AUTO_DISPOSE;
|
|
521
|
+
return accessor(r);
|
|
254
522
|
}
|
|
255
523
|
|
|
256
524
|
// Same staged-commit discipline as `updateKeyedMap` (#2903): the retained
|
|
@@ -261,59 +529,61 @@ function updateKeyedMap() {
|
|
|
261
529
|
// for the post-settle retry. The overlap math also subsumes the previous
|
|
262
530
|
// disjoint-window/front-clear/end-clear/shift special cases.
|
|
263
531
|
function updateRepeat() {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
532
|
+
// As in updateKeyedMap: the node is the row callbacks' reader, per pass.
|
|
533
|
+
this.H.Ke = getOwner();
|
|
534
|
+
const t = this.dt();
|
|
535
|
+
const e = this.Ot?.() || 0;
|
|
536
|
+
runWithOwner(this.H, () => {
|
|
267
537
|
if (t === 0) {
|
|
268
|
-
if (this.
|
|
269
|
-
this.
|
|
270
|
-
this.
|
|
271
|
-
this.
|
|
272
|
-
this.
|
|
538
|
+
if (this.it !== 0) {
|
|
539
|
+
this.H.dispose(false);
|
|
540
|
+
this.tn = [];
|
|
541
|
+
this.ht = [];
|
|
542
|
+
this.it = 0;
|
|
273
543
|
// Reset offset to match the cleared data (#2767, repro 2).
|
|
274
|
-
this.
|
|
544
|
+
this.wt = 0;
|
|
275
545
|
}
|
|
276
|
-
if (this.
|
|
546
|
+
if (this.L && !this.ht.length) {
|
|
277
547
|
// an aborted fallback attempt leaves an owner without a mapping;
|
|
278
548
|
// dispose it before re-creating
|
|
279
|
-
this.
|
|
280
|
-
this.
|
|
549
|
+
this.tn[0]?.dispose();
|
|
550
|
+
this.ht[0] = runWithOwner(this.tn[0] = createOwner(), this.L);
|
|
281
551
|
}
|
|
282
552
|
return;
|
|
283
553
|
}
|
|
284
|
-
const i =
|
|
285
|
-
const
|
|
554
|
+
const i = e + t;
|
|
555
|
+
const s = this.wt + this.it;
|
|
286
556
|
// Retained overlap [keepStart, keepEnd) in global indexes; empty when the
|
|
287
557
|
// windows are disjoint or when coming from empty/fallback.
|
|
288
|
-
const
|
|
289
|
-
const
|
|
290
|
-
const h = new Array(t);
|
|
558
|
+
const n = Math.max(e, this.wt);
|
|
559
|
+
const r = Math.min(i, s);
|
|
291
560
|
const o = new Array(t);
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
561
|
+
const f = new Array(t);
|
|
562
|
+
for (let t = n; t < r; t++) {
|
|
563
|
+
f[t - e] = this.tn[t - this.wt];
|
|
564
|
+
o[t - e] = this.ht[t - this.wt];
|
|
295
565
|
}
|
|
296
566
|
try {
|
|
297
|
-
for (let t =
|
|
298
|
-
if (t >=
|
|
299
|
-
|
|
567
|
+
for (let t = e; t < i; t++) {
|
|
568
|
+
if (t >= n && t < r) continue;
|
|
569
|
+
o[t - e] = runWithOwner(f[t - e] = createOwner(), () => this.ft(t));
|
|
300
570
|
}
|
|
301
571
|
} catch (t) {
|
|
302
|
-
for (let t =
|
|
572
|
+
for (let t = e; t < i; t++) if ((t < n || t >= r) && f[t - e]) f[t - e].dispose();
|
|
303
573
|
throw t;
|
|
304
574
|
}
|
|
305
575
|
// commit: dispose the previous fallback or the rows leaving the window
|
|
306
|
-
if (this.
|
|
307
|
-
this.
|
|
308
|
-
this.
|
|
309
|
-
this.
|
|
310
|
-
this.
|
|
576
|
+
if (this.it === 0) this.tn[0]?.dispose(); else for (let t = this.wt; t < s; t++) if (t < e || t >= i) this.tn[t - this.wt].dispose();
|
|
577
|
+
this.ht = o;
|
|
578
|
+
this.tn = f;
|
|
579
|
+
this.wt = e;
|
|
580
|
+
this.it = t;
|
|
311
581
|
});
|
|
312
|
-
return this.
|
|
582
|
+
return this.ht;
|
|
313
583
|
}
|
|
314
584
|
|
|
315
|
-
function compare(t,
|
|
316
|
-
return t ? t(
|
|
585
|
+
function compare(t, e, i) {
|
|
586
|
+
return t ? t(e) === t(i) : true;
|
|
317
587
|
}
|
|
318
588
|
|
|
319
589
|
export { mapArray, repeat };
|