@solidjs/signals 2.0.0-rc.13 → 2.0.0-rc.15
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 +2059 -3768
- package/dist/dev.attribution.js +237 -101
- package/dist/dev.js +7466 -8497
- package/dist/observe/affects.js +128 -104
- package/dist/observe/boundaries.js +492 -665
- package/dist/observe/core/action.js +63 -66
- package/dist/observe/core/async.js +243 -379
- package/dist/observe/core/attribution-queries.js +1 -1
- package/dist/observe/core/attribution.js +394 -253
- package/dist/observe/core/constants.js +120 -187
- package/dist/observe/core/context.js +3 -3
- package/dist/observe/core/core.js +874 -1440
- package/dist/observe/core/dev.js +3 -3
- package/dist/observe/core/effect.js +73 -84
- package/dist/observe/core/external.js +5 -5
- package/dist/observe/core/graph.js +62 -71
- package/dist/observe/core/heap.js +75 -98
- package/dist/observe/core/invariants.js +1 -34
- package/dist/observe/core/lanes.js +750 -181
- package/dist/observe/core/owner.js +80 -101
- package/dist/observe/core/scheduler.js +719 -1356
- package/dist/observe/core/verdict.js +314 -621
- package/dist/observe/flatten.js +79 -0
- package/dist/observe/index.js +15 -13
- package/dist/observe/map.js +232 -235
- package/dist/observe/reveal.js +212 -0
- package/dist/observe/signals.js +144 -216
- package/dist/observe/store/affects.js +142 -0
- package/dist/observe/store/hooks.js +13 -0
- package/dist/observe/store/index.js +27 -24
- package/dist/observe/store/optimistic.js +571 -0
- package/dist/observe/store/projection.js +308 -0
- package/dist/observe/store/reconcile.js +259 -0
- package/dist/observe/store/store.js +1988 -277
- package/dist/observe/store/storePath.js +1 -1
- package/dist/{prod/store/next → observe/store}/target.js +17 -18
- package/dist/observe/store/types.js +73 -0
- package/dist/observe/store/utils.js +1 -13
- package/dist/prod/affects.js +130 -106
- package/dist/prod/boundaries.js +476 -654
- package/dist/prod/core/action.js +71 -74
- package/dist/prod/core/async.js +306 -444
- package/dist/prod/core/constants.js +117 -186
- package/dist/prod/core/context.js +3 -3
- package/dist/prod/core/core.js +888 -1462
- package/dist/prod/core/effect.js +88 -99
- package/dist/prod/core/external.js +5 -5
- package/dist/prod/core/graph.js +62 -71
- package/dist/prod/core/heap.js +75 -98
- package/dist/prod/core/invariants.js +1 -32
- package/dist/prod/core/lanes.js +712 -181
- package/dist/prod/core/owner.js +75 -96
- package/dist/prod/core/scheduler.js +686 -1335
- package/dist/prod/core/verdict.js +309 -621
- package/dist/prod/flatten.js +77 -0
- package/dist/prod/index.js +15 -13
- package/dist/prod/map.js +142 -145
- package/dist/prod/reveal.js +212 -0
- package/dist/prod/signals.js +155 -227
- package/dist/prod/store/affects.js +142 -0
- package/dist/prod/store/hooks.js +13 -0
- package/dist/prod/store/index.js +26 -19
- package/dist/prod/store/optimistic.js +566 -0
- package/dist/prod/store/projection.js +301 -0
- package/dist/prod/store/reconcile.js +259 -0
- package/dist/prod/store/store.js +1883 -272
- package/dist/prod/store/storePath.js +1 -1
- package/dist/{observe/store/next → prod/store}/target.js +13 -17
- package/dist/prod/store/types.js +73 -0
- package/dist/prod/store/utils.js +1 -11
- package/dist/types/affects.d.ts +11 -30
- package/dist/types/boundaries.d.ts +66 -176
- package/dist/types/carved.d.ts +1 -0
- package/dist/types/core/action.d.ts +5 -6
- package/dist/types/core/async.d.ts +10 -5
- package/dist/types/core/attribution-hooks.d.ts +20 -1
- package/dist/types/core/attribution.d.ts +26 -11
- package/dist/types/core/constants.d.ts +130 -180
- package/dist/types/core/core.d.ts +134 -264
- package/dist/types/core/dev.d.ts +2 -2
- package/dist/types/core/effect.d.ts +0 -7
- package/dist/types/core/graph.d.ts +7 -1
- package/dist/types/core/heap.d.ts +5 -7
- package/dist/types/core/index.d.ts +5 -5
- package/dist/types/core/invariants.d.ts +0 -29
- package/dist/types/core/lanes.d.ts +74 -86
- package/dist/types/core/owner.d.ts +3 -3
- package/dist/types/core/scheduler.d.ts +255 -331
- package/dist/types/core/types.d.ts +45 -85
- package/dist/types/core/verdict.d.ts +3 -0
- package/dist/types/flatten.d.ts +8 -0
- package/dist/types/index.d.ts +6 -4
- package/dist/types/reveal.d.ts +19 -0
- package/dist/types/signals.d.ts +35 -91
- package/dist/types/store/affects.d.ts +12 -0
- package/dist/types/store/hooks.d.ts +48 -0
- package/dist/types/store/index.d.ts +34 -15
- package/dist/types/store/optimistic.d.ts +23 -0
- package/dist/types/store/projection.d.ts +18 -0
- package/dist/types/store/reconcile.d.ts +3 -0
- package/dist/types/store/store.d.ts +132 -145
- package/dist/types/store/storePath.d.ts +1 -1
- package/dist/types/store/target.d.ts +151 -0
- package/dist/types/store/types.d.ts +84 -0
- package/package.json +1 -1
- package/dist/observe/core/optimistic.js +0 -669
- package/dist/observe/store/next/optimistic.js +0 -717
- package/dist/observe/store/next/projection.js +0 -266
- package/dist/observe/store/next/reconcile.js +0 -375
- package/dist/observe/store/next/store.js +0 -2608
- package/dist/prod/core/optimistic.js +0 -658
- package/dist/prod/store/next/optimistic.js +0 -710
- package/dist/prod/store/next/projection.js +0 -257
- package/dist/prod/store/next/reconcile.js +0 -373
- package/dist/prod/store/next/store.js +0 -2484
- package/dist/types/core/optimistic.d.ts +0 -6
- package/dist/types/store/next/optimistic.d.ts +0 -25
- package/dist/types/store/next/projection.d.ts +0 -27
- package/dist/types/store/next/reconcile.d.ts +0 -10
- package/dist/types/store/next/store.d.ts +0 -145
- package/dist/types/store/next/target.d.ts +0 -196
|
@@ -10,11 +10,18 @@ const REACTIVE_IN_HEAP = 1 << 3;
|
|
|
10
10
|
|
|
11
11
|
const REACTIVE_IN_HEAP_HEIGHT = 1 << 4;
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
/** L2 — the node sits on its owner's parked frame (`_x._pendingFirstChild`):
|
|
14
|
+
* it is the displayed frame until the owner's commit disposes it. Set by
|
|
15
|
+
* `markDisposal` over the parked subtree; carried through every per-pass
|
|
16
|
+
* flag wipe (#3543). Scheduling reads it once, at the heap pop: a zombie's
|
|
17
|
+
* recompute is deferred past the seam (`deferZombie`). */ const REACTIVE_ZOMBIE = 1 << 5;
|
|
14
18
|
|
|
15
19
|
const REACTIVE_DISPOSED = 1 << 6;
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
/** L2 — this pass read the future (a tracked read of a CONFIG_HELD node).
|
|
22
|
+
* Lives for the pass only: set by `read`, consumed by `recompute`'s publish
|
|
23
|
+
* (a first pass that read the future is born held, A29), wiped with the
|
|
24
|
+
* pass's other per-pass bits. */ const REACTIVE_JOINED = 1 << 7;
|
|
18
25
|
|
|
19
26
|
const REACTIVE_SNAPSHOT_STALE = 1 << 8;
|
|
20
27
|
|
|
@@ -22,13 +29,12 @@ const REACTIVE_LAZY = 1 << 9;
|
|
|
22
29
|
|
|
23
30
|
const REACTIVE_MANUAL_WRITE = 1 << 10;
|
|
24
31
|
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*/ const REACTIVE_REASK = 1 << 11;
|
|
32
|
+
/** L2, rule 3 — the node's LAST pass was a render effect's read of the
|
|
33
|
+
* future as committed (`frameRead`): the frame shows the committed world
|
|
34
|
+
* beside a future it also derives from, and re-derives at the landing.
|
|
35
|
+
* Survives its own pass's wipe; the next pass's wipe clears it (a pass that
|
|
36
|
+
* re-derived the frame — in the future, or without the held read — owes the
|
|
37
|
+
* landing nothing). The landing consumes it (the transaction's `_reruns`). */ const REACTIVE_FRAME_READ = 1 << 11;
|
|
32
38
|
|
|
33
39
|
/**
|
|
34
40
|
* A dependency write landed while this subscriber was mid-recompute — a
|
|
@@ -39,6 +45,39 @@ const REACTIVE_MANUAL_WRITE = 1 << 10;
|
|
|
39
45
|
* either re-read later in the pass (fresh) or trimmed with it (not a dep).
|
|
40
46
|
*/ const REACTIVE_MISSED_WAKE = 1 << 12;
|
|
41
47
|
|
|
48
|
+
/** A `refresh()` asked this node to re-ask its question (A19 exc. 2, A24):
|
|
49
|
+
* consumed by the next pass, which — going pending — classifies its flight
|
|
50
|
+
* quiet (`_x._reask`). */ const REACTIVE_REASK = 1 << 13;
|
|
51
|
+
|
|
52
|
+
/** The pass was served a node's ambient staging — written this flush, not
|
|
53
|
+
* held. If the flush parks, the pass is the frame's with it (the same sync
|
|
54
|
+
* frame as the async): a verdict read cannot break it out. Per pass. */ const REACTIVE_STAGED_READ = 1 << 14;
|
|
55
|
+
|
|
56
|
+
/** The pass entered a verdict window (`isPending`/`latest`). Per pass: a
|
|
57
|
+
* pass that did not keeps CONFIG_VERDICT no longer — the frame-reader
|
|
58
|
+
* posture lasts exactly as long as the probing does. */ const REACTIVE_PROBED = 1 << 15;
|
|
59
|
+
|
|
60
|
+
/** Lanes — the node (a lane's member) was dirtied by the lane's own
|
|
61
|
+
* re-staging (a re-guess, lane work re-derived): its next pass is the
|
|
62
|
+
* lane's from the start (`recompute`), not a stale reader's re-run by an
|
|
63
|
+
* unrelated write (#3460). Consumed by the pass. */ const REACTIVE_LANE_DIRTY = 1 << 16;
|
|
64
|
+
|
|
65
|
+
/** Lanes (plan sec. 28) — the pass read a lane's value as lane work (`enterLane`): a
|
|
66
|
+
* tracked derivation's read of displayed optimism, a verdict read routed
|
|
67
|
+
* into the holder's verdict lane. A pass in a lane's seat that read none of
|
|
68
|
+
* its world has left the lane (`recompute`'s tail). Per pass. */ const REACTIVE_LANE_READ = 1 << 17;
|
|
69
|
+
|
|
70
|
+
/** Lanes (plan sec. 28) — a render effect in the frame's seat was served the screen
|
|
71
|
+
* for a lane's node (`laneRead`: a stale reader of a lane that has not
|
|
72
|
+
* shown). Its pass computing exactly what it last applied has nothing to
|
|
73
|
+
* run — an effect has no comparator, and the guess's notification is not a
|
|
74
|
+
* change it can see. Per pass. */ const REACTIVE_SCREEN_READ = 1 << 18;
|
|
75
|
+
|
|
76
|
+
/** A verdict reader whose probe was answered before the flush had a
|
|
77
|
+
* transaction (verdict.ts `watchVerdict`): the seam re-runs it even if a
|
|
78
|
+
* later read of the same pass routed it into a verdict lane — that was not
|
|
79
|
+
* the probe's answer (lanes.ts). Per pass. */ const REACTIVE_PROBE_UNANSWERED = 1 << 19;
|
|
80
|
+
|
|
42
81
|
// Static configuration bits packed into Owner/Computed/Signal _config.
|
|
43
82
|
const CONFIG_OWNED_WRITE = 1 << 0;
|
|
44
83
|
|
|
@@ -54,6 +93,74 @@ const CONFIG_AUTO_DISPOSE = 1 << 5;
|
|
|
54
93
|
|
|
55
94
|
const CONFIG_SYNC = 1 << 6;
|
|
56
95
|
|
|
96
|
+
// CARVE 3: REACTIVE_ZOMBIE, CONFIG_AUTHORITATIVE_READ, CONFIG_DIRECT_COMMIT,
|
|
97
|
+
// CONFIG_HELD_CHILDREN, CONFIG_INPUTS_PUBLISHED and CONFIG_ADOPTED_UNFLUSHED
|
|
98
|
+
// (transaction holds, zombies, until()'s authoritative view) went with the
|
|
99
|
+
// transactions.
|
|
100
|
+
// L2 (step 2): four bits, all maintained by the node's commit.
|
|
101
|
+
/** The node has a pass awaiting commit: its live children (and `_disposal`)
|
|
102
|
+
* are that pass's and were never shown — a re-pass tears them down on the
|
|
103
|
+
* spot, while the frame parked on `_x._pendingFirstChild` keeps waiting for
|
|
104
|
+
* the commit. Set by `recompute` when it queues the node. */ const CONFIG_STAGED = 1 << 7;
|
|
105
|
+
|
|
106
|
+
/** The node's staged state is in the future: the flush that staged it
|
|
107
|
+
* parked. A write to it, a tracked read of it by a derivation, or a pass
|
|
108
|
+
* over a derivation holding it joins the future (the flush parks). Render
|
|
109
|
+
* effects are the frame, not derivations (rule 3): reading it outside a
|
|
110
|
+
* parking flush they see the committed value and hold nothing, and are
|
|
111
|
+
* re-derived at the landing. Set at the park seam on every staged node. */ const CONFIG_HELD = 1 << 8;
|
|
112
|
+
|
|
113
|
+
/** A member of the uncommitted frame a held pass built (ruling A): set at
|
|
114
|
+
* the park seam on every computed under a staged node (`holdFrame`). Never
|
|
115
|
+
* shown, it has no screen: its reads are its transaction's, whichever flush
|
|
116
|
+
* runs it (`bornInto`, #4010). Cleared by its commit. */ const CONFIG_HELD_FRAME = 1 << 20;
|
|
117
|
+
|
|
118
|
+
/** A15's reveal corollary (#3305): a commit published this flight's inputs
|
|
119
|
+
* beneath it — the node was pending, nothing staged, when it committed — so
|
|
120
|
+
* its committed value is torn against the visible frame. A render effect
|
|
121
|
+
* revealing it cannot be a stale reader: it observes the flight (pends,
|
|
122
|
+
* holds) instead of showing the pre-flight value. Outlives the flight that
|
|
123
|
+
* earned it for as long as the node stays pending, and no longer: the
|
|
124
|
+
* commit that lands a value clears it. */ const CONFIG_INPUTS_PUBLISHED = 1 << 10;
|
|
125
|
+
|
|
126
|
+
/** Lanes (plan sec. 28) — the node has a lane's value (`_x._lane`): a written guess
|
|
127
|
+
* (CONFIG_GUESS) or a lane pass's derivation of one. Its lane is
|
|
128
|
+
* `_x._transaction`. The gate to the lane arm of `read`; `_value` stays the
|
|
129
|
+
* committed truth and `_pendingValue` a transaction's staging throughout —
|
|
130
|
+
* a value's world is where it lives, never a bit. */ const CONFIG_OVERRIDE = 1 << 11;
|
|
131
|
+
|
|
132
|
+
/** A store slot node (`slotSignal`): a leaf, presence, container or deep
|
|
133
|
+
* witness of a store target. One literal, no `_x` at birth; the last-one-out
|
|
134
|
+
* sweep dispatches it to the store's shared release hook (graph.ts) instead
|
|
135
|
+
* of a per-node `_unobserved` closure. */ const CONFIG_SLOT_NODE = 1 << 12;
|
|
136
|
+
|
|
137
|
+
/** A store slot node whose staging is a USER setter's proposal, not its
|
|
138
|
+
* derive's derivation (A34 (3)'s discriminator for derived stores — the
|
|
139
|
+
* leaf twin of REACTIVE_MANUAL_WRITE). Set by the user setter, cleared by
|
|
140
|
+
* the derive's own write to the key. */ const CONFIG_MANUAL_WRITE = 1 << 18;
|
|
141
|
+
|
|
142
|
+
/** Lanes — the node carries a written guess (`optimisticWrite`): its own
|
|
143
|
+
* source recomputing it, or a plain write landing on it, is the truth
|
|
144
|
+
* (`supersede`). A lane's derived staging is not. */ const CONFIG_GUESS = 1 << 13;
|
|
145
|
+
|
|
146
|
+
/** The node's pass read a verdict (`isPending`/`latest`): a dependency going
|
|
147
|
+
* pending is a question for its next pass — the verdict changed — so the
|
|
148
|
+
* propagation re-derives it instead of marking it pending (as a kept-tail
|
|
149
|
+
* link does, A30). Set at the window, never cleared: a reader that stopped
|
|
150
|
+
* asking re-derives once and goes pending through its own read. */ const CONFIG_VERDICT = 1 << 14;
|
|
151
|
+
|
|
152
|
+
/** A dependency's status is a question for this node's pass, not a fact
|
|
153
|
+
* about its current one: the propagation re-derives it instead of marking
|
|
154
|
+
* it, for errors as for pending (as CONFIG_VERDICT). A boundary's output
|
|
155
|
+
* (show the content, or the fallback) and its `on` node (boundaries.ts); a
|
|
156
|
+
* promise over an expression (`resolve`/`until`, signals.ts: the pass reads
|
|
157
|
+
* the error and rejects, or re-asks a pending source). */ const CONFIG_REDERIVE = 1 << 15;
|
|
158
|
+
|
|
159
|
+
/** The reader wants the truth, not the lane's guess (`until`, signals.ts):
|
|
160
|
+
* a read of displayed optimism serves the base the guess covers, makes the
|
|
161
|
+
* pass no lane's, and the truth landing wakes it even when it confirms the
|
|
162
|
+
* guess (the one case ordinary subscribers are not told — A17's silence). */ const CONFIG_AUTHORITATIVE = 1 << 17;
|
|
163
|
+
|
|
57
164
|
// Presence bits (stage-3 hot-path monomorphism, DESIGN-PATCH-CHANNEL §11b):
|
|
58
165
|
// optional per-node slots (_overrideValue, _pendingSignal/_latestValueComputed,
|
|
59
166
|
// _snapshotValue, _optimisticLane) are NOT part of every node's hidden class —
|
|
@@ -62,55 +169,8 @@ const CONFIG_SYNC = 1 << 6;
|
|
|
62
169
|
// pay one monomorphic masked read and only touch the optional field when its
|
|
63
170
|
// installer flagged it. Bits are STICKY ("may be set") — the guarded field
|
|
64
171
|
// read remains authoritative.
|
|
65
|
-
const CONFIG_OPTIMISTIC = 1 << 7;
|
|
66
|
-
|
|
67
|
-
const CONFIG_HAS_COMPANIONS = 1 << 8;
|
|
68
|
-
|
|
69
172
|
const CONFIG_HAS_SNAPSHOT = 1 << 9;
|
|
70
173
|
|
|
71
|
-
const CONFIG_HAS_LANE = 1 << 10;
|
|
72
|
-
|
|
73
|
-
/** Set on a FIREWALL computed when any of its child signals creates an
|
|
74
|
-
* isPending()/latest() companion. Gates the post-recompute child-companion
|
|
75
|
-
* walk (#3038): a store computed's `_child` chain holds one node per
|
|
76
|
-
* materialized leaf, so walking it unconditionally makes every update cost
|
|
77
|
-
* O(all leaves ever read). Sticky — set at companion creation, never
|
|
78
|
-
* cleared; sync-only apps never set it and never pay the walk. */ const CONFIG_CHILD_COMPANIONS = 1 << 11;
|
|
79
|
-
|
|
80
|
-
/** Set on a computed when its first firewall child signal is installed
|
|
81
|
-
* (projection machinery). Gates markNode's firewall-children walk with one
|
|
82
|
-
* masked read of the always-present _config — the walk's old `_child` read
|
|
83
|
-
* moved into the cold extension (§12), and an unconditional `_x` deref per
|
|
84
|
-
* marked node measurably taxed the propagation hot path (diamond -22%). */ const CONFIG_FW_CHILDREN = 1 << 12;
|
|
85
|
-
|
|
86
|
-
/** Authoritative-view reader (`until()`): while this node computes, reads
|
|
87
|
-
* dodge active optimistic OVERRIDES only — the predicate must observe
|
|
88
|
-
* arriving truth, never the caller's own tentative writes (which would
|
|
89
|
-
* trivially satisfy it). Everything else reads normally, INCLUDING
|
|
90
|
-
* transition-staged `_pendingValue`: staged data is authoritative (optimism
|
|
91
|
-
* lives only in override slots), and a hold that refused staged reads would
|
|
92
|
-
* deadlock on data the open transaction itself is holding (a refresh the
|
|
93
|
-
* action issued lands staged and cannot commit until the hold releases).
|
|
94
|
-
* read() checks the bit on the reading computation (`context`) directly — no
|
|
95
|
-
* ambient flag — so a shared computed the predicate pulls recomputes as
|
|
96
|
-
* itself (no bit) under the normal view, and its cache never forks. */ const CONFIG_AUTHORITATIVE_READ = 1 << 13;
|
|
97
|
-
|
|
98
|
-
/** Sticky mark: an authoritative-view reader read this node PAST an active
|
|
99
|
-
* override. The ack shape — an authoritative arrival EQUAL to the override —
|
|
100
|
-
* rides paths that are deliberately silent under A17 (every ordinary reader
|
|
101
|
-
* sees the override, so an equal landing changes nothing for them). A marked
|
|
102
|
-
* node notifies those readers on such paths anyway, so the landed truth is
|
|
103
|
-
* seen without re-firing ordinary subscribers. Never cleared — only nodes an
|
|
104
|
-
* until() predicate observed mid-override pay. */ const CONFIG_AUTHORITATIVE_OBSERVED = 1 << 14;
|
|
105
|
-
|
|
106
|
-
/** Promise-delivery effect (resolve()/until()): commits its computed value
|
|
107
|
-
* directly even when recomputing under its own held transition. These
|
|
108
|
-
* effects deliver applies on a microtask (#2930) instead of the stashed
|
|
109
|
-
* effect queues, so the value must ride the same immediate schedule — a
|
|
110
|
-
* staged value with an immediate apply delivers stale state (resolve) or
|
|
111
|
-
* deadlocks the hold (until). Safe because the node is a private leaf: no
|
|
112
|
-
* subscriber reads an effect's value, only its own apply does. */ const CONFIG_DIRECT_COMMIT = 1 << 15;
|
|
113
|
-
|
|
114
174
|
/** Fresh-pull reader (awaitable `refresh()`'s waiter effect): a read of a
|
|
115
175
|
* dirty source recomputes it inline even when the height gate defers to the
|
|
116
176
|
* flush. Closes the same-flush ordering race where a waiter created
|
|
@@ -121,125 +181,17 @@ const CONFIG_HAS_LANE = 1 << 10;
|
|
|
121
181
|
* deliberately keeps that race — its contract is "first settled value"
|
|
122
182
|
* (#2930), not "next quiescent state". */ const CONFIG_FRESH_READ = 1 << 16;
|
|
123
183
|
|
|
124
|
-
/** HELD truth (#3164): this node's staged `_pendingValue` is confirming
|
|
125
|
-
* truth riding a transaction that retains optimism, revealed only at that
|
|
126
|
-
* transaction's settle. Two arming sites, one meaning: the store fold
|
|
127
|
-
* (a landing staged into the retaining transaction) and until()'s
|
|
128
|
-
* flip-entanglement (a foreign carrier's staged write, stolen when it
|
|
129
|
-
* flipped the awaited predicate truthy). Override-covered nodes never
|
|
130
|
-
* arm: the override is their display and its revert their notification
|
|
131
|
-
* (A17).
|
|
132
|
-
*
|
|
133
|
-
* To a DERIVING reader the truth is a staged value like any other: a memo
|
|
134
|
-
* or user effect served it enters the transaction and is held with it
|
|
135
|
-
* (A29), so a pass that composes it with a superseded override's truth
|
|
136
|
-
* composes ONE staged world — never staged truth beside committed
|
|
137
|
-
* neighbours (#3568: the mask served the retaining transaction's own pass
|
|
138
|
-
* the landed `length` through the override while the rows past it stayed
|
|
139
|
-
* committed, and `<For>` walked into a hole). Stale readers of a foreign
|
|
140
|
-
* transaction keep committed through the stale-of-foreign clause,
|
|
141
|
-
* untracked reads keep committed (Rule 1), and latest() and until()'s
|
|
142
|
-
* predicate tunnel through — the exemption that keeps holds deadlock-free.
|
|
143
|
-
*
|
|
144
|
-
* The one reader the mark gates is a LANE pass, owning transaction or not
|
|
145
|
-
* (ruled 2026-09-22, superseding #3589's owner exemption): a lane applies
|
|
146
|
-
* its frame display-ahead at the park, so a lane pass served the truth
|
|
147
|
-
* would paint the confirmation beside the optimism it confirms —
|
|
148
|
-
* `saving=true` beside the saved row, a frame no timeline contains
|
|
149
|
-
* (GabbeV's union tear). It keeps committed and is re-run by the reveal's
|
|
150
|
-
* post-revert wake. A lane under the retaining transaction owns its
|
|
151
|
-
* overrides and its lane cargo (`ownsLane`), not the transaction's
|
|
152
|
-
* confirming truth. Cleared at commit (the commit IS the reveal);
|
|
153
|
-
* subscribers masked during the hold are woken by finalizePureQueue's
|
|
154
|
-
* post-revert pass. */ const CONFIG_HELD_TRUTH = 1 << 17;
|
|
155
|
-
|
|
156
|
-
/** SLOT node (store leaf): created through `slotSignal` with `_host`/`_key`
|
|
157
|
-
* backrefs baked into the literal. The unobserved sweep dispatches these to
|
|
158
|
-
* the ONE shared hook (`setSlotUnobserved`) instead of a per-node closure
|
|
159
|
-
* held in a per-node extension — store mounts materialize one signal per
|
|
160
|
-
* touched leaf, so per-node allocations (options object, equals closure,
|
|
161
|
-
* unobserved closure, NodeExtension) were the measured create-floor bytes
|
|
162
|
-
* (warm dbmon profile: store node machinery ~36% + GC ~29%). */ const CONFIG_SLOT_NODE = 1 << 18;
|
|
163
|
-
|
|
164
|
-
/** Optimistic node whose own source arrived with a value DIFFERENT from its
|
|
165
|
-
* active override (A18 supersession, #3331). The override survives only as
|
|
166
|
-
* the displayed value — untracked reads and the applied frame keep it until
|
|
167
|
-
* the owning transaction commits — while the graph has already moved to the
|
|
168
|
-
* staged truth in `_pendingValue`: tracked readers see it and the corrected
|
|
169
|
-
* cascade is that transaction's held work. Set by the two own-source write
|
|
170
|
-
* paths (asyncWrite, transition-held recompute); cleared by a fresh optimistic
|
|
171
|
-
* write (a new override re-masks) and by the revert. */ const CONFIG_OVERRIDE_SUPERSEDED = 1 << 19;
|
|
172
|
-
|
|
173
|
-
/** HELD children (#3404): this node's `_firstChild` chain (and `_disposal`
|
|
174
|
-
* list) was built by a recompute whose result has not committed — a staged
|
|
175
|
-
* value, a pending window, or a run under a held transaction. A later
|
|
176
|
-
* recompute may tear those children down immediately: nothing observable
|
|
177
|
-
* was ever built on them. Unset, the children belong to the committed frame
|
|
178
|
-
* and a recompute defers them as zombies (`_pendingFirstChild`) until this
|
|
179
|
-
* node commits — regardless of whether the recompute runs under a
|
|
180
|
-
* transaction. A parked node (status propagation stamps `_transition`
|
|
181
|
-
* without recomputing) recomputed when its source lands otherwise disposed
|
|
182
|
-
* its committed children mid-hold, running their cleanups before the
|
|
183
|
-
* transaction's atomic reveal. Cleared by `commitPendingNode`. Transaction
|
|
184
|
-
* work only (A15 lane work and transaction work, #3698): zombies are parked
|
|
185
|
-
* by a pass under a held transaction; a pass over a lane parks a LANE frame
|
|
186
|
-
* instead (`CONFIG_LANE_FRAME`), whatever the node's kind. */ const CONFIG_HELD_CHILDREN = 1 << 20;
|
|
187
|
-
|
|
188
|
-
/** The frame parked in `_pendingFirstChild` / `_pendingDisposal` is a LANE
|
|
189
|
-
* frame (#3662, #3698; A15 lane work and transaction work): a lane pass —
|
|
190
|
-
* on an effect or a memo alike — publishes into the lane's frame (an
|
|
191
|
-
* effect's run; a memo's derived override, A17), so the frame it replaces
|
|
192
|
-
* leaves the screen when the lane applies (A30) — not at the action's
|
|
193
|
-
* commit like #3404's transaction zombies, and not at the pass (a held lane
|
|
194
|
-
* defers the apply with the frame still displayed). Drained by the lane's
|
|
195
|
-
* render entry the parking site pushed ahead of the new frame's effects
|
|
196
|
-
* (cleanups before side effects), by `commitPendingNode` if a hold commits
|
|
197
|
-
* the node first, or with the owner's death. While set the parked frame is
|
|
198
|
-
* not a hold (the node is not queued or stamped for it — lane work never
|
|
199
|
-
* makes its node transaction work), a superseding pass disposes the
|
|
200
|
-
* never-shown live children on the spot, and a lane-channel dirty on a
|
|
201
|
-
* member is cancelled (`laneZombie`). Ruled 2026-09-28 (#3698): a pass is
|
|
202
|
-
* lane work or transaction work by its owner, never by node kind. #3662
|
|
203
|
-
* flagged effects only, and a memo's lane pass parked a transaction zombie
|
|
204
|
-
* that queued and stamped the memo as the action's pending node, so its
|
|
205
|
-
* next mainline recompute re-entered the hold. */ const CONFIG_LANE_FRAME = 1 << 26;
|
|
206
|
-
|
|
207
|
-
/** In-flight async node whose inputs were PUBLISHED while it was pending: a
|
|
208
|
-
* batch or transaction committed with the node still `STATUS_PENDING` (an
|
|
209
|
-
* unobserved flight, #3305), so the inputs are on screen and the node's
|
|
210
|
-
* committed `_value` is stale against them. Governs read()'s reveal
|
|
211
|
-
* carve-out: a stale (render) reader in some OTHER transaction may show a
|
|
212
|
-
* foreign-held pending node's committed value — parallel transactions, no
|
|
213
|
-
* entanglement — only while that value is coherent with the visible frame,
|
|
214
|
-
* i.e. while the flight's inputs are themselves held (unpublished) and not
|
|
215
|
-
* lane-revealed. Set by `commitPendingNodes`; cleared when the node next
|
|
216
|
-
* enters pending fresh (a new flight from a settled state). */ const CONFIG_INPUTS_PUBLISHED = 1 << 21;
|
|
217
|
-
|
|
218
184
|
/** A28 (4): the node was written inside a recompute that ran OUTSIDE a flush
|
|
219
185
|
* (a creation-time compute — boundary machinery, a mapArray's first run). Such
|
|
220
186
|
* a write is promoted at that recompute's end: readers in the same block see
|
|
221
187
|
* it. Cleared when the next flush begins; set only on that rare path. */ const CONFIG_PROMOTED = 1 << 22;
|
|
222
188
|
|
|
223
|
-
/** A28 for same-tick adoption: the node was staged outside a flush and then
|
|
224
|
-
* adopted by a transaction (initTransition) before any flush carried the
|
|
225
|
-
* staging — the stamp says "held", but nothing flushed is staged for it, so
|
|
226
|
-
* on no channel is the write visible yet: `latest()` answers the committed
|
|
227
|
-
* value, the verdict sees nothing pending (as the store's leaves already did
|
|
228
|
-
* through their own selection). Cleared when the carrying flush re-stamps the
|
|
229
|
-
* transaction's pending nodes (reassignPendingTransition). */ const CONFIG_ADOPTED_UNFLUSHED = 1 << 24;
|
|
230
|
-
|
|
231
|
-
/** The node's active override is a DERIVED one: a lane pass published its
|
|
232
|
-
* speculative result into the override slot instead of `_value` (lanes
|
|
233
|
-
* stage — an optimistic derivation is an override, #3479). Its truth is not
|
|
234
|
-
* `_value` but a recompute from its inputs' truth, so the body-end
|
|
235
|
-
* supersession (`endOptimism`) and the authoritative-flight blockage
|
|
236
|
-
* (`transitionBlocked`) skip it; the revert drops the override and re-derives
|
|
237
|
-
* it (`resolveOptimisticNodes`). Cleared with the override. */ const CONFIG_DERIVED_OVERRIDE = 1 << 23;
|
|
238
|
-
|
|
239
189
|
/** Observe tiers only: the node is framework plumbing (the `solid-js/refresh`
|
|
240
190
|
* HMR memo between a component's root and its body) — it has no name, is no
|
|
241
191
|
* segment of any owner path, and the attribution engine records nothing about
|
|
242
|
-
* it (creation, re-runs, checks)
|
|
192
|
+
* it (creation, re-runs, checks) and does not count it toward another scope's
|
|
193
|
+
* WIDE_SCOPE_DEPS or a write's engine-side HUGE_FAN_OUT, while the nodes it
|
|
194
|
+
* owns stay fully observed.
|
|
243
195
|
* Set from the internal `_plumbing` option at creation; never set in prod. */ const CONFIG_PLUMBING = 1 << 25;
|
|
244
196
|
|
|
245
197
|
const STATUS_PENDING = 1 << 0;
|
|
@@ -254,29 +206,10 @@ const EFFECT_USER = 2;
|
|
|
254
206
|
|
|
255
207
|
const EFFECT_TRACKED = 3;
|
|
256
208
|
|
|
257
|
-
/** OR-ed into the `type` a lane passes to its effect runners: lane runs
|
|
258
|
-
* apply ahead of their transaction and are exempt from ownership parking. */ const LANE_RUN = 4;
|
|
259
|
-
|
|
260
209
|
const NOT_PENDING = {};
|
|
261
210
|
|
|
262
211
|
const NO_SNAPSHOT = {};
|
|
263
212
|
|
|
264
|
-
/**
|
|
265
|
-
* Stand-in stored in `_overrideValue` for an optimistic write of literal
|
|
266
|
-
* `undefined` (#2898). The slot doubles as the optimistic-node brand
|
|
267
|
-
* (`undefined` = not optimistic, `NOT_PENDING` = at rest), so the raw value
|
|
268
|
-
* would erase the node's optimistic identity: the write turns invisible and
|
|
269
|
-
* follow-up writes route off the optimistic path and commit permanently.
|
|
270
|
-
* Same shape as NO_SNAPSHOT. Sites that surface the override VALUE unwrap
|
|
271
|
-
* via `visibleOverrideValue`; slot identity tests stay raw.
|
|
272
|
-
*/ const OVERRIDE_UNDEFINED = {};
|
|
273
|
-
|
|
274
|
-
/** Unwrap an active override's stored value for surfacing to readers (#2898). */ function unwrapOverride(E) {
|
|
275
|
-
return E === OVERRIDE_UNDEFINED ? undefined : E;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
const STORE_SNAPSHOT_PROPS = "sp";
|
|
279
|
-
|
|
280
213
|
const SUPPORTS_PROXY = typeof Proxy === "function";
|
|
281
214
|
|
|
282
215
|
const defaultContext = {};
|
|
@@ -289,4 +222,4 @@ const defaultContext = {};
|
|
|
289
222
|
* @internal
|
|
290
223
|
*/ const $REFRESH = Symbol("refresh");
|
|
291
224
|
|
|
292
|
-
export { $REFRESH,
|
|
225
|
+
export { $REFRESH, CONFIG_AUTHORITATIVE, CONFIG_AUTO_DISPOSE, CONFIG_CHILDREN_FORBIDDEN, CONFIG_FRESH_READ, CONFIG_GUESS, CONFIG_HAS_SNAPSHOT, CONFIG_HELD, CONFIG_HELD_FRAME, CONFIG_INPUTS_PUBLISHED, CONFIG_IN_SNAPSHOT_SCOPE, CONFIG_MANUAL_WRITE, CONFIG_NO_SNAPSHOT, CONFIG_OVERRIDE, CONFIG_OWNED_WRITE, CONFIG_PLUMBING, CONFIG_PROMOTED, CONFIG_REDERIVE, CONFIG_SLOT_NODE, CONFIG_STAGED, CONFIG_SYNC, CONFIG_TRANSPARENT, CONFIG_VERDICT, EFFECT_RENDER, EFFECT_TRACKED, EFFECT_USER, NOT_PENDING, NO_SNAPSHOT, REACTIVE_CHECK, REACTIVE_DIRTY, REACTIVE_DISPOSED, REACTIVE_FRAME_READ, REACTIVE_IN_HEAP, REACTIVE_IN_HEAP_HEIGHT, REACTIVE_JOINED, REACTIVE_LANE_DIRTY, REACTIVE_LANE_READ, REACTIVE_LAZY, REACTIVE_MANUAL_WRITE, REACTIVE_MISSED_WAKE, REACTIVE_NONE, REACTIVE_PROBED, REACTIVE_PROBE_UNANSWERED, REACTIVE_REASK, REACTIVE_RECOMPUTING_DEPS, REACTIVE_SCREEN_READ, REACTIVE_SNAPSHOT_STALE, REACTIVE_STAGED_READ, REACTIVE_ZOMBIE, STATUS_ERROR, STATUS_PENDING, STATUS_UNINITIALIZED, SUPPORTS_PROXY, defaultContext };
|
|
@@ -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.D[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.D = {
|
|
56
|
+
...r.D,
|
|
57
57
|
[e.id]: t === undefined ? e.defaultValue : t
|
|
58
58
|
};
|
|
59
59
|
}
|