@solidjs/signals 2.0.0-beta.30 → 2.0.0-beta.32
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.js +47 -9
- package/dist/node.cjs +136 -97
- package/dist/prod/core/async.js +49 -34
- package/dist/prod/core/core.js +22 -22
- package/dist/prod/core/effect.js +3 -3
- package/dist/prod/core/lanes.js +1 -1
- package/dist/prod/core/optimistic.js +23 -11
- package/dist/prod/core/owner.js +1 -1
- package/dist/prod/core/scheduler.js +25 -13
- package/dist/prod/core/verdict.js +21 -21
- package/dist/prod/store/optimistic.js +4 -4
- package/dist/prod/store/store.js +1 -1
- package/package.json +1 -1
|
@@ -32,15 +32,15 @@ let pendingProbe = null;
|
|
|
32
32
|
* Get or create the pending signal for a node (lazy).
|
|
33
33
|
* Used by isPending() to track pending state reactively.
|
|
34
34
|
*/ function getPendingSignal(e) {
|
|
35
|
-
if (!e.
|
|
35
|
+
if (!e.Re) {
|
|
36
36
|
// Start false, write true if pending - ensures reversion returns to false
|
|
37
|
-
e.
|
|
37
|
+
e.Re = optimisticSignal(false, {
|
|
38
38
|
ownedWrite: true
|
|
39
39
|
});
|
|
40
|
-
e.
|
|
41
|
-
if (computePendingState(e)) setSignal(e.
|
|
40
|
+
e.Re.nn = e;
|
|
41
|
+
if (computePendingState(e)) setSignal(e.Re, true);
|
|
42
42
|
}
|
|
43
|
-
return e.
|
|
43
|
+
return e.Re;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
function collectPendingSources(e) {
|
|
@@ -102,10 +102,10 @@ function collectPendingSources(e) {
|
|
|
102
102
|
|
|
103
103
|
function quietPending(e) {
|
|
104
104
|
if (e.oe) {
|
|
105
|
-
for (const t of e.oe) if (!t.
|
|
105
|
+
for (const t of e.oe) if (!t.Ue) return false;
|
|
106
106
|
return true;
|
|
107
107
|
}
|
|
108
|
-
return e.
|
|
108
|
+
return e.Ue;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
function newQuestionInFlight(e) {
|
|
@@ -129,27 +129,27 @@ function computePendingState(e) {
|
|
|
129
129
|
return !!(n.se & REACTIVE_MANUAL_WRITE) || !n.Te && !(n.S & STATUS_PENDING) || !!(n.S & STATUS_PENDING) && quietPending(n);
|
|
130
130
|
}
|
|
131
131
|
if (e.De !== NOT_PENDING && !(t.S & STATUS_UNINITIALIZED)) {
|
|
132
|
-
if (hasActiveOverride(e)) return !e.
|
|
132
|
+
if (hasActiveOverride(e)) return !e.he || !e.he(e.De, unwrapOverride(e.Ae));
|
|
133
133
|
return true;
|
|
134
134
|
}
|
|
135
135
|
return newQuestionInFlight(t);
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
function syncCompanions(e, t) {
|
|
139
|
-
if (e.
|
|
139
|
+
if (e.Re) updatePendingSignal(e);
|
|
140
140
|
if (e.pe) setSignal(e.pe, t);
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
function updatePendingSignal(e) {
|
|
144
|
-
if (e.
|
|
145
|
-
setSignal(e.
|
|
144
|
+
if (e.Re) {
|
|
145
|
+
setSignal(e.Re, computePendingState(e));
|
|
146
146
|
}
|
|
147
147
|
if (e.pe) updatePendingSignal(e.pe);
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
function updateChildCompanions(e) {
|
|
151
151
|
for (let t = e.u; t !== null; t = t.fe) {
|
|
152
|
-
if (t.
|
|
152
|
+
if (t.Re || t.pe) updatePendingSignal(t);
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
|
|
@@ -167,7 +167,7 @@ function updateChildCompanions(e) {
|
|
|
167
167
|
const visit = e => {
|
|
168
168
|
if (i.has(e)) return;
|
|
169
169
|
i.add(e);
|
|
170
|
-
if (e.
|
|
170
|
+
if (e.Re || e.pe) n(e);
|
|
171
171
|
for (let t = e.o; t !== null; t = t.ue) visit(t.le);
|
|
172
172
|
for (let t = e.u ?? null; t !== null; t = t.fe) {
|
|
173
173
|
visit(t);
|
|
@@ -177,11 +177,11 @@ function updateChildCompanions(e) {
|
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
function snapCompanionsToState(e) {
|
|
180
|
-
const t = e.
|
|
180
|
+
const t = e.Re;
|
|
181
181
|
if (t && (t.Ae === undefined || t.Ae === NOT_PENDING)) {
|
|
182
182
|
const n = computePendingState(e);
|
|
183
|
-
if (t.
|
|
184
|
-
t.
|
|
183
|
+
if (t.be !== n || t.De !== NOT_PENDING) {
|
|
184
|
+
t.be = n;
|
|
185
185
|
t.De = NOT_PENDING;
|
|
186
186
|
t.Se = clock;
|
|
187
187
|
insertSubs(t);
|
|
@@ -190,7 +190,7 @@ function snapCompanionsToState(e) {
|
|
|
190
190
|
}
|
|
191
191
|
const n = e.pe;
|
|
192
192
|
if (n && !(n.se & REACTIVE_DISPOSED)) {
|
|
193
|
-
if ((n.Ae === undefined || n.Ae === NOT_PENDING) && n.De === NOT_PENDING && !Object.is(n.
|
|
193
|
+
if ((n.Ae === undefined || n.Ae === NOT_PENDING) && n.De === NOT_PENDING && !Object.is(n.be, e.be) && !(n.se & (REACTIVE_DIRTY | REACTIVE_CHECK))) {
|
|
194
194
|
n.se |= REACTIVE_DIRTY;
|
|
195
195
|
insertIntoHeap(n, queueFor(n));
|
|
196
196
|
insertSubs(n);
|
|
@@ -223,7 +223,7 @@ function getLatestValueComputed(e) {
|
|
|
223
223
|
const t = getLatestValueComputed(e);
|
|
224
224
|
const n = latestReadActive;
|
|
225
225
|
setLatestReadActive(false);
|
|
226
|
-
const i = e.Ae !== undefined && e.Ae !== NOT_PENDING ? unwrapOverride(e.Ae) : e.
|
|
226
|
+
const i = e.Ae !== undefined && e.Ae !== NOT_PENDING ? unwrapOverride(e.Ae) : e.be;
|
|
227
227
|
let r;
|
|
228
228
|
try {
|
|
229
229
|
// An untracked latest() read has no reading context, so read() never
|
|
@@ -279,9 +279,9 @@ function recordFreshRead(e, t) {
|
|
|
279
279
|
|
|
280
280
|
function applyReask(e, t) {
|
|
281
281
|
const n = !!(e.S & STATUS_PENDING);
|
|
282
|
-
const i = t && !(n && !e.
|
|
283
|
-
const r = n && e.
|
|
284
|
-
e.
|
|
282
|
+
const i = t && !(n && !e.Ue);
|
|
283
|
+
const r = n && e.Ue !== i;
|
|
284
|
+
e.Ue = i;
|
|
285
285
|
return r;
|
|
286
286
|
}
|
|
287
287
|
|
|
@@ -33,8 +33,8 @@ function createOptimisticStore(e, t, r) {
|
|
|
33
33
|
// clobbering instead of composing). Optimistic state clears when truth
|
|
34
34
|
// lands or its transaction ends — never mid-refetch. Wrapped here (engine
|
|
35
35
|
// is already installed above) so store-free apps never carry the check.
|
|
36
|
-
const e = GlobalQueue.
|
|
37
|
-
GlobalQueue.
|
|
36
|
+
const e = GlobalQueue.Tn;
|
|
37
|
+
GlobalQueue.Tn = t => {
|
|
38
38
|
for (const e of t.cn) {
|
|
39
39
|
if ((e[$TARGET]?.[STORE_FIREWALL]?.S ?? 0) & STATUS_PENDING) return true;
|
|
40
40
|
}
|
|
@@ -121,8 +121,8 @@ function clearOptimisticStores(e, t) {
|
|
|
121
121
|
T.Ae = NOT_PENDING;
|
|
122
122
|
T.sn = null;
|
|
123
123
|
T.De = NOT_PENDING;
|
|
124
|
-
T.
|
|
125
|
-
if (!T.
|
|
124
|
+
T.be = o;
|
|
125
|
+
if (!T.he || !T.he(n, o)) {
|
|
126
126
|
insertSubs(T, true);
|
|
127
127
|
schedule();
|
|
128
128
|
}
|
package/dist/prod/store/store.js
CHANGED
|
@@ -291,7 +291,7 @@ function ownEnumerableKeysPlain(e) {
|
|
|
291
291
|
* The value a store leaf's backing signal currently shows to readers: active
|
|
292
292
|
* override, else held pending value, else committed value.
|
|
293
293
|
*/ function visibleNodeValue(e) {
|
|
294
|
-
return e.Ae !== undefined && e.Ae !== NOT_PENDING ? unwrapOverride(e.Ae) : e.De !== NOT_PENDING ? e.De : e.
|
|
294
|
+
return e.Ae !== undefined && e.Ae !== NOT_PENDING ? unwrapOverride(e.Ae) : e.De !== NOT_PENDING ? e.De : e.be;
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
function hasOwnStoreProperty(e, t) {
|
package/package.json
CHANGED