@solidjs/signals 2.0.0-rc.8 → 2.0.0-rc.9
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 +1399 -285
- package/dist/dev.attribution.js +459 -307
- package/dist/dev.js +1864 -435
- package/dist/observe/affects.js +3 -1
- package/dist/observe/attribution.js +7 -1
- package/dist/observe/boundaries.js +209 -154
- package/dist/observe/core/action.js +18 -8
- package/dist/observe/core/async.js +220 -110
- package/dist/observe/core/attribution-costs.js +66 -0
- package/dist/observe/core/attribution-feedback.js +282 -0
- package/dist/observe/core/attribution-hooks.js +23 -1
- package/dist/observe/core/attribution-queries.js +28 -0
- package/dist/observe/core/attribution.js +262 -485
- package/dist/observe/core/constants.js +34 -1
- package/dist/observe/core/context.js +3 -3
- package/dist/observe/core/core.js +867 -367
- package/dist/observe/core/dev.js +78 -17
- package/dist/observe/core/effect.js +67 -51
- package/dist/observe/core/error-hooks.js +71 -0
- package/dist/observe/core/external.js +4 -4
- package/dist/observe/core/graph.js +37 -37
- package/dist/observe/core/heap.js +45 -45
- package/dist/observe/core/invariants.js +2 -0
- package/dist/observe/core/lanes.js +86 -49
- package/dist/observe/core/optimistic.js +242 -95
- package/dist/observe/core/owner.js +98 -84
- package/dist/observe/core/scheduler.js +543 -305
- package/dist/observe/core/verdict.js +247 -129
- package/dist/observe/index.js +7 -3
- package/dist/observe/map.js +126 -124
- package/dist/observe/signals.js +33 -17
- package/dist/observe/store/index.js +2 -0
- package/dist/observe/store/next/optimistic.js +141 -132
- package/dist/observe/store/next/projection.js +34 -21
- package/dist/observe/store/next/reconcile.js +58 -56
- package/dist/observe/store/next/store.js +260 -146
- package/dist/observe/store/store.js +5 -3
- package/dist/observe/store/utils.js +948 -135
- package/dist/prod/attribution.js +26 -17
- package/dist/prod/boundaries.js +128 -76
- package/dist/prod/core/action.js +16 -8
- package/dist/prod/core/async.js +251 -143
- package/dist/prod/core/constants.js +34 -1
- package/dist/prod/core/context.js +3 -3
- package/dist/prod/core/core.js +843 -347
- package/dist/prod/core/dev.js +17 -1
- package/dist/prod/core/effect.js +48 -34
- package/dist/prod/core/error-hooks.js +71 -0
- package/dist/prod/core/external.js +4 -4
- package/dist/prod/core/graph.js +37 -37
- package/dist/prod/core/heap.js +45 -45
- package/dist/prod/core/lanes.js +90 -53
- package/dist/prod/core/optimistic.js +247 -100
- package/dist/prod/core/owner.js +57 -45
- package/dist/prod/core/scheduler.js +543 -305
- package/dist/prod/core/verdict.js +245 -127
- package/dist/prod/index.js +7 -3
- package/dist/prod/map.js +112 -112
- package/dist/prod/signals.js +28 -12
- package/dist/prod/store/next/optimistic.js +135 -128
- package/dist/prod/store/next/projection.js +31 -20
- package/dist/prod/store/next/store.js +325 -252
- package/dist/prod/store/store.js +2 -2
- package/dist/prod/store/utils.js +946 -135
- package/dist/types/attribution.d.ts +7 -2
- package/dist/types/attribution.prod.d.ts +10 -1
- package/dist/types/boundaries.d.ts +10 -1
- package/dist/types/core/action.d.ts +12 -5
- 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 +28 -3
- package/dist/types/core/attribution-queries.d.ts +10 -0
- package/dist/types/core/attribution.d.ts +51 -172
- package/dist/types/core/constants.d.ts +33 -0
- package/dist/types/core/core.d.ts +186 -5
- package/dist/types/core/dev.d.ts +129 -9
- package/dist/types/core/error-hooks.d.ts +71 -0
- package/dist/types/core/index.d.ts +3 -1
- package/dist/types/core/invariants.d.ts +4 -0
- package/dist/types/core/lanes.d.ts +31 -4
- package/dist/types/core/scheduler.d.ts +95 -2
- package/dist/types/core/types.d.ts +3 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/signals.d.ts +8 -0
- package/dist/types/store/index.d.ts +2 -1
- package/dist/types/store/next/optimistic.d.ts +1 -1
- package/dist/types/store/next/store.d.ts +6 -5
- package/dist/types/store/next/target.d.ts +1 -1
- package/dist/types/store/utils.d.ts +177 -6
- package/package.json +1 -1
|
@@ -154,6 +154,18 @@ const CONFIG_HAS_LANE = 1 << 10;
|
|
|
154
154
|
* paths (asyncWrite, transition-held recompute); cleared by a fresh optimistic
|
|
155
155
|
* write (a new override re-masks) and by the revert. */ const CONFIG_OVERRIDE_SUPERSEDED = 1 << 19;
|
|
156
156
|
|
|
157
|
+
/** HELD children (#3404): this node's `_firstChild` chain (and `_disposal`
|
|
158
|
+
* list) was built by a recompute whose result has not committed — a staged
|
|
159
|
+
* value, a pending window, or a run under a held transaction. A later
|
|
160
|
+
* recompute may tear those children down immediately: nothing observable
|
|
161
|
+
* was ever built on them. Unset, the children belong to the committed frame
|
|
162
|
+
* and a recompute defers them as zombies (`_pendingFirstChild`) until this
|
|
163
|
+
* node commits — regardless of whether the recompute runs under a
|
|
164
|
+
* transaction. A parked node (status propagation stamps `_transition`
|
|
165
|
+
* without recomputing) recomputed when its source lands otherwise disposed
|
|
166
|
+
* its committed children mid-hold, running their cleanups before the
|
|
167
|
+
* transaction's atomic reveal. Cleared by `commitPendingNode`. */ const CONFIG_HELD_CHILDREN = 1 << 20;
|
|
168
|
+
|
|
157
169
|
/** In-flight async node whose inputs were PUBLISHED while it was pending: a
|
|
158
170
|
* batch or transaction committed with the node still `STATUS_PENDING` (an
|
|
159
171
|
* unobserved flight, #3305), so the inputs are on screen and the node's
|
|
@@ -165,6 +177,27 @@ const CONFIG_HAS_LANE = 1 << 10;
|
|
|
165
177
|
* lane-revealed. Set by `commitPendingNodes`; cleared when the node next
|
|
166
178
|
* enters pending fresh (a new flight from a settled state). */ const CONFIG_INPUTS_PUBLISHED = 1 << 21;
|
|
167
179
|
|
|
180
|
+
/** A28 (4): the node was written inside a recompute that ran OUTSIDE a flush
|
|
181
|
+
* (a creation-time compute — boundary machinery, a mapArray's first run). Such
|
|
182
|
+
* a write is promoted at that recompute's end: readers in the same block see
|
|
183
|
+
* it. Cleared when the next flush begins; set only on that rare path. */ const CONFIG_PROMOTED = 1 << 22;
|
|
184
|
+
|
|
185
|
+
/** A28 for same-tick adoption: the node was staged outside a flush and then
|
|
186
|
+
* adopted by a transaction (initTransition) before any flush carried the
|
|
187
|
+
* staging — the stamp says "held", but nothing flushed is staged for it, so
|
|
188
|
+
* on no channel is the write visible yet: `latest()` answers the committed
|
|
189
|
+
* value, the verdict sees nothing pending (as the store's leaves already did
|
|
190
|
+
* through their own selection). Cleared when the carrying flush re-stamps the
|
|
191
|
+
* transaction's pending nodes (reassignPendingTransition). */ const CONFIG_ADOPTED_UNFLUSHED = 1 << 24;
|
|
192
|
+
|
|
193
|
+
/** The node's active override is a DERIVED one: a lane pass published its
|
|
194
|
+
* speculative result into the override slot instead of `_value` (lanes
|
|
195
|
+
* stage — an optimistic derivation is an override, #3479). Its truth is not
|
|
196
|
+
* `_value` but a recompute from its inputs' truth, so the body-end
|
|
197
|
+
* supersession (`endOptimism`) and the authoritative-flight blockage
|
|
198
|
+
* (`transitionBlocked`) skip it; the revert drops the override and re-derives
|
|
199
|
+
* it (`resolveOptimisticNodes`). Cleared with the override. */ const CONFIG_DERIVED_OVERRIDE = 1 << 23;
|
|
200
|
+
|
|
168
201
|
const STATUS_PENDING = 1 << 0;
|
|
169
202
|
|
|
170
203
|
const STATUS_ERROR = 1 << 1;
|
|
@@ -212,4 +245,4 @@ const defaultContext = {};
|
|
|
212
245
|
* @internal
|
|
213
246
|
*/ const $REFRESH = Symbol("refresh");
|
|
214
247
|
|
|
215
|
-
export { $REFRESH, CONFIG_AUTHORITATIVE_OBSERVED, CONFIG_AUTHORITATIVE_READ, CONFIG_AUTO_DISPOSE, CONFIG_CHILDREN_FORBIDDEN, CONFIG_CHILD_COMPANIONS, CONFIG_DIRECT_COMMIT, CONFIG_FRESH_READ, CONFIG_FW_CHILDREN, CONFIG_HAS_COMPANIONS, CONFIG_HAS_LANE, CONFIG_HAS_SNAPSHOT, CONFIG_HELD_TRUTH, CONFIG_INPUTS_PUBLISHED, CONFIG_IN_SNAPSHOT_SCOPE, CONFIG_NO_SNAPSHOT, CONFIG_OPTIMISTIC, CONFIG_OVERRIDE_SUPERSEDED, CONFIG_OWNED_WRITE, CONFIG_SLOT_NODE, CONFIG_SYNC, CONFIG_TRANSPARENT, EFFECT_RENDER, EFFECT_TRACKED, EFFECT_USER, LANE_RUN, NOT_PENDING, NO_SNAPSHOT, OVERRIDE_UNDEFINED, REACTIVE_CHECK, REACTIVE_DIRTY, REACTIVE_DISPOSED, REACTIVE_IN_HEAP, REACTIVE_IN_HEAP_HEIGHT, REACTIVE_LAZY, REACTIVE_MANUAL_WRITE, REACTIVE_MISSED_WAKE, REACTIVE_NONE, REACTIVE_OPTIMISTIC_DIRTY, REACTIVE_REASK, REACTIVE_RECOMPUTING_DEPS, REACTIVE_SNAPSHOT_STALE, REACTIVE_ZOMBIE, STATUS_ERROR, STATUS_PENDING, STATUS_UNINITIALIZED, STORE_SNAPSHOT_PROPS, SUPPORTS_PROXY, defaultContext, unwrapOverride };
|
|
248
|
+
export { $REFRESH, CONFIG_ADOPTED_UNFLUSHED, CONFIG_AUTHORITATIVE_OBSERVED, CONFIG_AUTHORITATIVE_READ, CONFIG_AUTO_DISPOSE, CONFIG_CHILDREN_FORBIDDEN, CONFIG_CHILD_COMPANIONS, CONFIG_DERIVED_OVERRIDE, CONFIG_DIRECT_COMMIT, CONFIG_FRESH_READ, CONFIG_FW_CHILDREN, CONFIG_HAS_COMPANIONS, CONFIG_HAS_LANE, CONFIG_HAS_SNAPSHOT, CONFIG_HELD_CHILDREN, CONFIG_HELD_TRUTH, CONFIG_INPUTS_PUBLISHED, CONFIG_IN_SNAPSHOT_SCOPE, CONFIG_NO_SNAPSHOT, CONFIG_OPTIMISTIC, CONFIG_OVERRIDE_SUPERSEDED, CONFIG_OWNED_WRITE, CONFIG_PROMOTED, CONFIG_SLOT_NODE, CONFIG_SYNC, CONFIG_TRANSPARENT, EFFECT_RENDER, EFFECT_TRACKED, EFFECT_USER, LANE_RUN, NOT_PENDING, NO_SNAPSHOT, OVERRIDE_UNDEFINED, REACTIVE_CHECK, REACTIVE_DIRTY, REACTIVE_DISPOSED, REACTIVE_IN_HEAP, REACTIVE_IN_HEAP_HEIGHT, REACTIVE_LAZY, REACTIVE_MANUAL_WRITE, REACTIVE_MISSED_WAKE, REACTIVE_NONE, REACTIVE_OPTIMISTIC_DIRTY, REACTIVE_REASK, REACTIVE_RECOMPUTING_DEPS, REACTIVE_SNAPSHOT_STALE, REACTIVE_ZOMBIE, STATUS_ERROR, STATUS_PENDING, STATUS_UNINITIALIZED, STORE_SNAPSHOT_PROPS, SUPPORTS_PROXY, defaultContext, unwrapOverride };
|
|
@@ -30,7 +30,7 @@ import { getOwner } from "./owner.js";
|
|
|
30
30
|
throw new NoOwnerError;
|
|
31
31
|
}
|
|
32
32
|
// `undefined` alone means unset — a provided `null` is a value (no `??`).
|
|
33
|
-
let r = t.
|
|
33
|
+
let r = t.ze[e.id];
|
|
34
34
|
if (r === undefined) r = e.defaultValue;
|
|
35
35
|
if (r === undefined) {
|
|
36
36
|
throw new ContextNotFoundError;
|
|
@@ -52,8 +52,8 @@ import { getOwner } from "./owner.js";
|
|
|
52
52
|
}
|
|
53
53
|
// We're creating a new object to avoid child context values being exposed to parent owners. If
|
|
54
54
|
// we don't do this, everything will be a singleton and all hell will break lose.
|
|
55
|
-
r.
|
|
56
|
-
...r.
|
|
55
|
+
r.ze = {
|
|
56
|
+
...r.ze,
|
|
57
57
|
[e.id]: t === undefined ? e.defaultValue : t
|
|
58
58
|
};
|
|
59
59
|
}
|