@solidjs/signals 2.0.0-rc.15 → 2.0.0-rc.17
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 +2268 -1734
- package/dist/dev.attribution.js +75 -52
- package/dist/dev.js +1348 -658
- package/dist/observe/affects-marks.js +86 -0
- package/dist/observe/affects.js +22 -73
- package/dist/observe/boundaries.js +192 -190
- package/dist/observe/core/async.js +177 -131
- package/dist/observe/core/attribution-queries.js +1 -1
- package/dist/observe/core/attribution.js +176 -159
- package/dist/observe/core/constants.js +17 -3
- package/dist/observe/core/context.js +5 -3
- package/dist/observe/core/core.js +520 -364
- package/dist/observe/core/dev.js +66 -38
- package/dist/observe/core/effect.js +50 -48
- package/dist/observe/core/error.js +5 -3
- package/dist/observe/core/external.js +5 -6
- package/dist/observe/core/graph.js +60 -44
- package/dist/observe/core/heap.js +33 -33
- package/dist/observe/core/identities.js +62 -0
- package/dist/observe/core/lanes.js +238 -260
- package/dist/observe/core/owner.js +117 -79
- package/dist/observe/core/scheduler.js +381 -217
- package/dist/observe/core/truth.js +45 -0
- package/dist/observe/core/verdict.js +91 -50
- package/dist/observe/deferred.js +184 -0
- package/dist/observe/index.js +7 -1
- package/dist/observe/map.js +345 -260
- package/dist/observe/reveal.js +76 -76
- package/dist/observe/signals.js +47 -31
- package/dist/observe/store/affects.js +18 -18
- package/dist/observe/store/edges.js +39 -0
- package/dist/observe/store/optimistic.js +146 -100
- package/dist/observe/store/projection.js +68 -55
- package/dist/observe/store/store.js +180 -118
- package/dist/prod/affects-marks.js +86 -0
- package/dist/prod/affects.js +23 -72
- package/dist/prod/boundaries.js +156 -154
- package/dist/prod/core/async.js +173 -127
- package/dist/prod/core/constants.js +17 -3
- package/dist/prod/core/context.js +5 -3
- package/dist/prod/core/core.js +495 -343
- package/dist/prod/core/effect.js +70 -68
- package/dist/prod/core/error.js +5 -3
- package/dist/prod/core/external.js +5 -6
- package/dist/prod/core/graph.js +60 -44
- package/dist/prod/core/heap.js +38 -38
- package/dist/prod/core/identities.js +62 -0
- package/dist/prod/core/lanes.js +230 -252
- package/dist/prod/core/owner.js +114 -77
- package/dist/prod/core/scheduler.js +327 -163
- package/dist/prod/core/truth.js +45 -0
- package/dist/prod/core/verdict.js +90 -49
- package/dist/prod/deferred.js +182 -0
- package/dist/prod/index.js +7 -1
- package/dist/prod/map.js +360 -275
- package/dist/prod/reveal.js +76 -76
- package/dist/prod/signals.js +42 -26
- package/dist/prod/store/affects.js +6 -6
- package/dist/prod/store/edges.js +39 -0
- package/dist/prod/store/optimistic.js +143 -98
- package/dist/prod/store/projection.js +25 -19
- package/dist/prod/store/store.js +157 -100
- package/dist/types/affects-marks.d.ts +14 -0
- package/dist/types/boundaries.d.ts +1 -1
- package/dist/types/core/async.d.ts +10 -0
- package/dist/types/core/constants.d.ts +13 -1
- package/dist/types/core/core.d.ts +54 -5
- package/dist/types/core/dev.d.ts +51 -13
- package/dist/types/core/error.d.ts +9 -1
- package/dist/types/core/graph.d.ts +11 -0
- package/dist/types/core/identities.d.ts +17 -0
- package/dist/types/core/index.d.ts +2 -1
- package/dist/types/core/lanes.d.ts +2 -14
- package/dist/types/core/owner.d.ts +9 -3
- package/dist/types/core/scheduler.d.ts +70 -32
- package/dist/types/core/truth.d.ts +16 -0
- package/dist/types/core/types.d.ts +21 -0
- package/dist/types/core/verdict.d.ts +32 -0
- package/dist/types/deferred.d.ts +28 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/map.d.ts +2 -2
- package/dist/types/signals.d.ts +28 -7
- package/dist/types/store/edges.d.ts +9 -0
- package/dist/types/store/index.d.ts +10 -3
- package/dist/types/store/optimistic.d.ts +3 -2
- package/dist/types/store/projection.d.ts +4 -3
- package/dist/types/store/store.d.ts +1 -1
- package/dist/types/store/target.d.ts +16 -8
- package/dist/types/store/types.d.ts +14 -0
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Computed, Signal } from "./core/types.js";
|
|
2
|
+
export type Marked = Signal<any> | Computed<any>;
|
|
3
|
+
/** The verdict readers downstream of `node` — through derivations, stopping
|
|
4
|
+
* at effects — re-derive: the mark's one notification (a probe's answer
|
|
5
|
+
* changed with no value notifying anyone). Truth readers (`until`, the
|
|
6
|
+
* `refresh` waiter) too, which a lagging flight parked (deferred.ts) — but
|
|
7
|
+
* not through a derived store, whose leaves change only once its derive
|
|
8
|
+
* re-runs: they re-derive at that write. */
|
|
9
|
+
export declare function repoll(node: Marked, seen?: Set<Computed<any>>, readers?: number): void;
|
|
10
|
+
/** One mark on `node`. The declarer repolls once its bookkeeping is done. */
|
|
11
|
+
export declare function mark(node: Marked): void;
|
|
12
|
+
/** Drops one mark from `node`: true when it was the last — the node's
|
|
13
|
+
* verdict readers have re-derived. */
|
|
14
|
+
export declare function unmark(node: Marked): boolean;
|
|
@@ -27,7 +27,7 @@ interface Boundary {
|
|
|
27
27
|
* whatever holds the frame; no LOADING_ON_OUTSIDE_HOLD report. */
|
|
28
28
|
_ahead?: boolean;
|
|
29
29
|
/** The output's last pass chose the fallback: readers under it are off
|
|
30
|
-
* screen (`
|
|
30
|
+
* screen (`hiddenBy`). */
|
|
31
31
|
_fallback: boolean;
|
|
32
32
|
/** User effects whose run came due behind the fallback: re-queued at the
|
|
33
33
|
* reveal (`heldRun`). */
|
|
@@ -11,7 +11,17 @@ export declare function addPendingSource(el: Computed<any>, source: Computed<any
|
|
|
11
11
|
export declare function parkLoadingWindow(el: Computed<any>, e: NotReadyError): void;
|
|
12
12
|
export declare function setPendingError(el: Computed<any>, source?: Computed<any>, error?: any): void;
|
|
13
13
|
export declare function forEachDependent(el: Computed<any>, fn: (node: Computed<any>, link: Link) => void): void;
|
|
14
|
+
export declare function releaseIfSettledUnobserved(node: Computed<any>): void;
|
|
14
15
|
export declare function releaseSettledDependents(el: Computed<any>): void;
|
|
16
|
+
/** D-41: an error a pass of a held node found is an answer of
|
|
17
|
+
* that frame — it ends the wait like a value and shows when a value would.
|
|
18
|
+
* Staged like one: `_pendingValue` carries it (CONFIG_STAGED_ERROR), readers
|
|
19
|
+
* in the hold derive from it (`serve` throws it), and the commit publishes
|
|
20
|
+
* it through the ordinary error path (`commitPendingNode` → `notifyStatus`),
|
|
21
|
+
* dependents included. Not for a lane pass, nor a node with no shown value
|
|
22
|
+
* (born held — its error has no frame to wait behind): those publish now,
|
|
23
|
+
* as before. Returns whether the error was staged. */
|
|
24
|
+
export declare function stageError(el: Computed<any>, error: any, inPass?: boolean): boolean;
|
|
15
25
|
export declare function settleErroredDependents(el: Computed<any>, error: any): void;
|
|
16
26
|
export declare function settlePendingSource(el: Computed<any>, source?: Computed<any>): void;
|
|
17
27
|
export declare function isThenable<T>(value: T | PromiseLike<T>): value is PromiseLike<T>;
|
|
@@ -116,6 +116,9 @@ export declare const CONFIG_SLOT_NODE: number;
|
|
|
116
116
|
* leaf twin of REACTIVE_MANUAL_WRITE). Set by the user setter, cleared by
|
|
117
117
|
* the derive's own write to the key. */
|
|
118
118
|
export declare const CONFIG_MANUAL_WRITE: number;
|
|
119
|
+
/** D-41: the staged value in `_pendingValue` is an error — an
|
|
120
|
+
* answer of the held frame, published at its landing like a value. */
|
|
121
|
+
export declare const CONFIG_STAGED_ERROR: number;
|
|
119
122
|
/** Lanes — the node carries a written guess (`optimisticWrite`): its own
|
|
120
123
|
* source recomputing it, or a plain write landing on it, is the truth
|
|
121
124
|
* (`supersede`). A lane's derived staging is not. */
|
|
@@ -124,7 +127,9 @@ export declare const CONFIG_GUESS: number;
|
|
|
124
127
|
* pending is a question for its next pass — the verdict changed — so the
|
|
125
128
|
* propagation re-derives it instead of marking it pending (as a kept-tail
|
|
126
129
|
* link does, A30). Set at the window, never cleared: a reader that stopped
|
|
127
|
-
* asking re-derives once and goes pending through its own read.
|
|
130
|
+
* asking re-derives once and goes pending through its own read. The same
|
|
131
|
+
* bit as REACTIVE_PROBED: a pass's probe (or a read of a verdict memo,
|
|
132
|
+
* core.ts `read`) carries into the config at its end without a shift. */
|
|
128
133
|
export declare const CONFIG_VERDICT: number;
|
|
129
134
|
/** A dependency's status is a question for this node's pass, not a fact
|
|
130
135
|
* about its current one: the propagation re-derives it instead of marking
|
|
@@ -133,6 +138,10 @@ export declare const CONFIG_VERDICT: number;
|
|
|
133
138
|
* promise over an expression (`resolve`/`until`, signals.ts: the pass reads
|
|
134
139
|
* the error and rejects, or re-asks a pending source). */
|
|
135
140
|
export declare const CONFIG_REDERIVE: number;
|
|
141
|
+
/** An answered `createDeferred` node (deferred.ts): held because a
|
|
142
|
+
* downstream hold staged its landing, its re-pass is a lagging question,
|
|
143
|
+
* not an answer, and joins no transaction (D-40). */
|
|
144
|
+
export declare const CONFIG_LAGS: number;
|
|
136
145
|
/** The reader wants the truth, not the lane's guess (`until`, signals.ts):
|
|
137
146
|
* a read of displayed optimism serves the base the guess covers, makes the
|
|
138
147
|
* pass no lane's, and the truth landing wakes it even when it confirms the
|
|
@@ -180,6 +189,9 @@ export declare const STATUS_NONE = 0;
|
|
|
180
189
|
export declare const STATUS_PENDING: number;
|
|
181
190
|
export declare const STATUS_ERROR: number;
|
|
182
191
|
export declare const STATUS_UNINITIALIZED: number;
|
|
192
|
+
/** `catchHook`'s answer when the catcher is a boundary re-armed by
|
|
193
|
+
* `on` (truthy, as any catch): what it collects is its own, not the hold's. */
|
|
194
|
+
export declare const CAUGHT_REARMED = 2;
|
|
183
195
|
export declare const EFFECT_PURE = 0;
|
|
184
196
|
export declare const EFFECT_RENDER = 1;
|
|
185
197
|
export declare const EFFECT_USER = 2;
|
|
@@ -45,6 +45,9 @@ export declare function ext(el: {
|
|
|
45
45
|
* the boundary collects it and shows its fallback, and the pass is the
|
|
46
46
|
* boundary's, not the tick's (A29's boundary exemption, #3540). */
|
|
47
47
|
export declare function joinPass(c: Computed<any>, el: Signal<any> | Computed<any>): void;
|
|
48
|
+
/** `joinPass` into the hold `t` (a folded guess's: store/optimistic.ts
|
|
49
|
+
* `foldedRead`, D-34) — a reader is never a render effect there. */
|
|
50
|
+
export declare function joinPassAt(c: Computed<any>, t: Transaction): void;
|
|
48
51
|
/** A node born into transaction `t`: held by it and never committed (A29,
|
|
49
52
|
* ruling A) — uninitialized (born held), or a member of the frame one of its
|
|
50
53
|
* held passes built (CONFIG_HELD_FRAME). Its branch exists only in `t`: it
|
|
@@ -83,7 +86,8 @@ export declare function isEqual<T>(a: T, b: T): boolean;
|
|
|
83
86
|
* object, no NodeExtension, no post-construction expandos. `ownedWrite` is
|
|
84
87
|
* baked in: the setter carries the owned-scope guard; node-level writes are
|
|
85
88
|
* the store's notification machinery. The observe literal adds the label
|
|
86
|
-
*
|
|
89
|
+
* and location slots (the store relabels `store.<key>` and stamps the
|
|
90
|
+
* store's `loc` when the engine is installed). */
|
|
87
91
|
export declare function slotSignal<T>(v: T, equals: (a: T, b: T) => boolean, host: object, key: PropertyKey, acc: boolean): Signal<T>;
|
|
88
92
|
/**
|
|
89
93
|
* When set to a component name string, any reactive read that is not inside a nested tracking
|
|
@@ -110,10 +114,15 @@ export declare function enterCallback(): void;
|
|
|
110
114
|
export declare function exitCallback(): void;
|
|
111
115
|
/**
|
|
112
116
|
* Dev-only: > 0 while owner teardown runs cleanups (`_disposal` entries and
|
|
113
|
-
* effect-returned cleanups — owner.ts), for the same reason.
|
|
117
|
+
* effect-returned cleanups — owner.ts), for the same reason. The owned-scope
|
|
118
|
+
* write guard (setSignal, markRefresh, the store setter) stands down here
|
|
119
|
+
* too: a cleanup is teardown, not part of whichever computation is disposing
|
|
120
|
+
* its owner (a list pass removing a row, a branch switching away), so its
|
|
121
|
+
* writes are imperative like an effect callback's (#4165). Kept apart from
|
|
114
122
|
* `callbackDepth` because its sites cannot use try/finally (the frame would
|
|
115
|
-
* survive into prod)
|
|
116
|
-
*
|
|
123
|
+
* survive into prod). A throwing cleanup is caught (owner.ts `runCleanup`);
|
|
124
|
+
* anything else escaping a teardown leaves it raised, and dev.ts resets it on
|
|
125
|
+
* the next microtask, which teardown — synchronous — never spans.
|
|
117
126
|
*/
|
|
118
127
|
export declare let disposalDepth: number;
|
|
119
128
|
export declare function enterDisposal(): void;
|
|
@@ -127,6 +136,16 @@ export declare function setStrictRead(v: string | false): string | false;
|
|
|
127
136
|
* Use `untrack` inside a memo or effect when you need to read a signal once
|
|
128
137
|
* without making the surrounding computation depend on its future changes.
|
|
129
138
|
*
|
|
139
|
+
* `untrack` stops dependency tracking, not async settlement. Reading an
|
|
140
|
+
* uninitialized async source still suspends the owning computation; it runs
|
|
141
|
+
* again when that source first resolves. Afterward, the untracked read is a
|
|
142
|
+
* snapshot and does not subscribe the computation to later changes.
|
|
143
|
+
*
|
|
144
|
+
* If the first read must return immediately, give the async source a
|
|
145
|
+
* `loadingValue` before reading it with `untrack`. `isPending` and `latest`
|
|
146
|
+
* inspect updates to an existing value; neither supplies a missing initial
|
|
147
|
+
* value.
|
|
148
|
+
*
|
|
130
149
|
* Pass a `strictReadLabel` string to enable a dev-mode warning: any reactive
|
|
131
150
|
* read inside `fn` that isn't inside a nested tracking scope will log a
|
|
132
151
|
* warning naming the label.
|
|
@@ -140,6 +159,9 @@ export declare function setStrictRead(v: string | false): string | false;
|
|
|
140
159
|
* log(snapshot);
|
|
141
160
|
* }
|
|
142
161
|
* );
|
|
162
|
+
*
|
|
163
|
+
* const color = createMemo<string>(() => fetchColor(), { loadingValue: "gray" });
|
|
164
|
+
* const initialColor = untrack(color); // "gray" while the fetch is unresolved
|
|
143
165
|
* ```
|
|
144
166
|
*/
|
|
145
167
|
export declare function untrack<T>(fn: () => T, strictReadLabel?: string | false): T;
|
|
@@ -221,7 +243,10 @@ export declare function read<T>(el: Signal<T> | Computed<T>): T;
|
|
|
221
243
|
export declare function serve(el: Signal<any> | Computed<any>, c: Computed<any> | null): unknown;
|
|
222
244
|
/** A pass read a staging of this flush: it derives from what the flush may
|
|
223
245
|
* yet hold (REACTIVE_STAGED_READ — the seam decides). Lane work too (plan sec. 28, a
|
|
224
|
-
* lane sees the screen plus its own guesses)
|
|
246
|
+
* lane sees the screen plus its own guesses) — a folded lane's only before
|
|
247
|
+
* the frame has a transaction (after, it reads the screen like a verdict
|
|
248
|
+
* reader, `stagedScreen` — a list pass never pairs a held length with the
|
|
249
|
+
* guess's rows, D-34): the staging is the screen if
|
|
225
250
|
* the frame commits — one pass, the common case — and a held write if it
|
|
226
251
|
* parks, which the seam repairs (`stagedReaders`): the pass re-derives on
|
|
227
252
|
* the committed world and its lane's runs wait that round, so the held
|
|
@@ -256,6 +281,30 @@ export declare function notePromotedWrite(el: Signal<any> | Computed<any>): void
|
|
|
256
281
|
* reason. Firewall leaves belong to a projection whose compute is the tree's
|
|
257
282
|
* own work, captured (or deliberately not) at creation. */
|
|
258
283
|
export declare function captureWriteSnapshot<T>(el: Signal<T> | Computed<T>, current: T): void;
|
|
284
|
+
/**
|
|
285
|
+
* A callback run before every signal or store write lands, while set, with
|
|
286
|
+
* the written signal or the store proxy whose setter runs. The
|
|
287
|
+
* server-components client sets it while slot occurrences are left
|
|
288
|
+
* unmounted after hydration (deferred hydration): a write may be one an
|
|
289
|
+
* unmounted component would have observed, so the client mounts what is
|
|
290
|
+
* left before the write applies, and clears the hook. `null` otherwise.
|
|
291
|
+
*/
|
|
292
|
+
export declare let writeHook: ((node?: object) => void) | null;
|
|
293
|
+
/** @internal */
|
|
294
|
+
export declare function setWriteHook(hook: ((node?: object) => void) | null): void;
|
|
295
|
+
/**
|
|
296
|
+
* `el`'s comparator verdict (`_equals`), the one guarded call for recompute,
|
|
297
|
+
* setSignal (user setters and async landings) and the seam's
|
|
298
|
+
* staged-equals-committed check.
|
|
299
|
+
* - A comparator that read an unresolved async source has not shown the
|
|
300
|
+
* values equal (#4111): falsy, a change, whose readers suspend in their own
|
|
301
|
+
* tracked context.
|
|
302
|
+
* - Any other throw is an error of `el`'s computation (A3, #2837): routed
|
|
303
|
+
* through the status path so error boundaries contain it, instead of
|
|
304
|
+
* unwinding a flush or a setter; answered "same" so nothing commits.
|
|
305
|
+
* @internal
|
|
306
|
+
*/
|
|
307
|
+
export declare function isSame(el: Signal<any>, a: unknown, b: unknown): unknown;
|
|
259
308
|
export declare function setSignal<T>(el: Signal<T> | Computed<T>, v: T | ((prev: T) => T)): T;
|
|
260
309
|
/**
|
|
261
310
|
* User-facing setter for the memo form of `createSignal(fn)`. A write applies
|
package/dist/types/core/dev.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export interface DevHooks {
|
|
|
6
6
|
onGraph?: (value: any, owner: Owner | null) => void;
|
|
7
7
|
onUpdate?: () => void;
|
|
8
8
|
onStoreNodeUpdate?: (state: any, property: PropertyKey, value: any, prev: any) => void;
|
|
9
|
+
/** @internal Every node read (the frames client's identity-drift check; `setReadWatch`). */
|
|
10
|
+
onRead?: (node: object) => void;
|
|
9
11
|
}
|
|
10
12
|
/**
|
|
11
13
|
* `info` is the advisory tier: a structural fact worth surfacing that is not
|
|
@@ -14,7 +16,7 @@ export interface DevHooks {
|
|
|
14
16
|
* `warn`/`error` as failures unless they opt in to `info`.
|
|
15
17
|
*/
|
|
16
18
|
export type DiagnosticSeverity = "info" | "warn" | "error";
|
|
17
|
-
export type DiagnosticCode = "STRICT_READ_UNTRACKED" | "PENDING_ASYNC_UNTRACKED_READ" | "PENDING_ASYNC_FORBIDDEN_SCOPE" | "REACTIVE_WRITE_IN_OWNED_SCOPE" | "ASYNC_STORE_SETTER" | "ACTION_CALLED_IN_OWNED_SCOPE" | "RUN_WITH_DISPOSED_OWNER" | "NO_OWNER_CLEANUP" | "CLEANUP_IN_FORBIDDEN_SCOPE" | "SETTLED_CLEANUP_UNOWNED" | "SETTLE_WALK_UNINITIALIZED_SOURCE" | "FLUSH_IN_EFFECT_CALLBACK" | "PRIMITIVE_IN_FORBIDDEN_SCOPE" | "PRIMITIVE_IN_EFFECT_CALLBACK" | "NO_OWNER_EFFECT" | "NO_OWNER_BOUNDARY" | "ASYNC_OUTSIDE_LOADING_BOUNDARY" | "LOADING_ON_OUTSIDE_HOLD" | "INVALID_REFRESH_TARGET" | "INVALID_AFFECTS_TARGET" | "MISSING_EFFECT_FN" | "SYNC_NODE_RECEIVED_ASYNC" | "UNTRACKED_READ_AFTER_AWAIT" | "REACTIVITY_HALTED" | "INVARIANT_VIOLATION" | "HUGE_FAN_OUT" | "HUGE_FAN_IN" | "GRAPH_GROWTH" | "HOT_SCOPE_RERUNS" | "HOT_SCOPE_TIME" | "WIDE_SCOPE_DEPS" | "UNSTABLE_MEMO_OUTPUT" | "WASTED_RECOMPUTE" | "ASYNC_WATERFALL" | "HOT_SCOPE_FANOUT" | "SILENT_HOLD" | "LONG_HOLD" | "UNTRACKED_ASYNC_HANDLER" | "ABANDONED_FLIGHTS" | "FALLBACK_FLASH" | "STACKED_HOLDS" | "OPTIMISTIC_REVERTED" | "EFFECT_WRITES_OWN_SOURCE" | "EFFECT_RELAY_TEAR" | "IMMUTABLE_UPDATE_IN_STORE" | "UNSTABLE_LIST_IDENTITY" | "SSR_RENDER_ERROR_CONTAINED" | "SSR_SUBTREE_ABANDONED" | "SSR_STREAM_ABANDONED" | "SSR_CLIENT_CONTENT_MASKED" | "LATE_HEADER_WRITE" | "SERVER_ERROR_SANITIZED" | "SSR_BOUNDARY_WATERFALL" | "SSR_UNDECLARED_LIVE_SOURCE" | "SERVER_WRITE" | "REVEAL_IN_RENDER_TO_STRING" | "LAZY_ASSET_UNMAPPED" | "PRELOAD_DESCRIPTOR_INVALID" | "HEAD_TAG_INVALID" | "UNRECOGNIZED_INSERT_VALUE" | "UNSCOPED_HOLE_ALLOCATED_IDS" | "LOWERCASE_EVENT_ATTRIBUTE" | "
|
|
19
|
+
export type DiagnosticCode = "STRICT_READ_UNTRACKED" | "PENDING_ASYNC_UNTRACKED_READ" | "PENDING_ASYNC_FORBIDDEN_SCOPE" | "REACTIVE_WRITE_IN_OWNED_SCOPE" | "ASYNC_STORE_SETTER" | "STORE_WRITE_OUTSIDE_SETTER" | "ACTION_CALLED_IN_OWNED_SCOPE" | "RUN_WITH_DISPOSED_OWNER" | "NO_OWNER_CLEANUP" | "CLEANUP_IN_FORBIDDEN_SCOPE" | "SETTLED_CLEANUP_UNOWNED" | "SETTLE_WALK_UNINITIALIZED_SOURCE" | "FLUSH_IN_EFFECT_CALLBACK" | "PRIMITIVE_IN_FORBIDDEN_SCOPE" | "PRIMITIVE_IN_EFFECT_CALLBACK" | "NO_OWNER_EFFECT" | "NO_OWNER_BOUNDARY" | "ASYNC_OUTSIDE_LOADING_BOUNDARY" | "LOADING_ON_OUTSIDE_HOLD" | "INVALID_REFRESH_TARGET" | "INVALID_AFFECTS_TARGET" | "MISSING_EFFECT_FN" | "SYNC_NODE_RECEIVED_ASYNC" | "UNTRACKED_READ_AFTER_AWAIT" | "REACTIVITY_HALTED" | "INVARIANT_VIOLATION" | "HUGE_FAN_OUT" | "HUGE_FAN_IN" | "GRAPH_GROWTH" | "HOT_SCOPE_RERUNS" | "HOT_SCOPE_TIME" | "WIDE_SCOPE_DEPS" | "UNSTABLE_MEMO_OUTPUT" | "WASTED_RECOMPUTE" | "ASYNC_WATERFALL" | "HOT_SCOPE_FANOUT" | "SILENT_HOLD" | "LONG_HOLD" | "UNTRACKED_ASYNC_HANDLER" | "ABANDONED_FLIGHTS" | "FALLBACK_FLASH" | "STACKED_HOLDS" | "OPTIMISTIC_REVERTED" | "EFFECT_WRITES_OWN_SOURCE" | "EFFECT_RELAY_TEAR" | "IMMUTABLE_UPDATE_IN_STORE" | "UNSTABLE_LIST_IDENTITY" | "SSR_RENDER_ERROR_CONTAINED" | "SSR_SUBTREE_ABANDONED" | "SSR_STREAM_ABANDONED" | "SSR_CLIENT_CONTENT_MASKED" | "LATE_HEADER_WRITE" | "SERVER_ERROR_SANITIZED" | "SSR_BOUNDARY_WATERFALL" | "SSR_UNDECLARED_LIVE_SOURCE" | "SSR_LIVE_HOLE_LATCHED" | "SERVER_WRITE" | "REVEAL_IN_RENDER_TO_STRING" | "LAZY_ASSET_UNMAPPED" | "PRELOAD_DESCRIPTOR_INVALID" | "HEAD_TAG_INVALID" | "UNRECOGNIZED_INSERT_VALUE" | "UNSCOPED_HOLE_ALLOCATED_IDS" | "LOWERCASE_EVENT_ATTRIBUTE" | "UNCOMMITTED_INPUT_OVERWRITTEN" | "FRAME_MARKER_CORRUPTED" | "DYNAMIC_ASYNC_COMPONENT";
|
|
18
20
|
export type DiagnosticKind = "strict-read" | "async" | "write" | "lifecycle" | "owner" | "error" | "perf" | "graph"
|
|
19
21
|
/** Perceived responsiveness: the runtime behaved correctly but the user saw no feedback. */
|
|
20
22
|
| "responsiveness"
|
|
@@ -46,6 +48,15 @@ export interface DiagnosticEvent {
|
|
|
46
48
|
* is usually the finding itself).
|
|
47
49
|
*/
|
|
48
50
|
ownerPath?: string[];
|
|
51
|
+
/**
|
|
52
|
+
* Source location of the innermost located node enclosing the subject
|
|
53
|
+
* (`file:line:col`, root-relative — the compiler's `sourceNames`
|
|
54
|
+
* `locations` kind): the subject's own `loc`, else the nearest owner's up
|
|
55
|
+
* the chain (a component root carries its JSX site). Absent when nothing
|
|
56
|
+
* on the chain was compiled with locations. A host event that sets it
|
|
57
|
+
* keeps it.
|
|
58
|
+
*/
|
|
59
|
+
loc?: string;
|
|
49
60
|
data?: Record<string, unknown>;
|
|
50
61
|
}
|
|
51
62
|
/**
|
|
@@ -117,6 +128,21 @@ export interface AttributionSlot {
|
|
|
117
128
|
* navigation it ran for by the identity of the object, not by time.
|
|
118
129
|
*/
|
|
119
130
|
currentOrigin(): ChangeOrigin | undefined;
|
|
131
|
+
/**
|
|
132
|
+
* Stamps a flight (a promise or async iterable a computation will await)
|
|
133
|
+
* with when its work really started, before anything reads it. A route
|
|
134
|
+
* preloader, query cache or `lazy()` calls this on what it hands out (on
|
|
135
|
+
* the wrapper it mints, with the original kickoff time), so a reader that
|
|
136
|
+
* meets it later is judged against the real start: work already running
|
|
137
|
+
* when the previous wait landed is parallel, not a waterfall link. The
|
|
138
|
+
* client engine's `ASYNC_WATERFALL` and the server's
|
|
139
|
+
* `SSR_BOUNDARY_WATERFALL` both read these stamps. Earliest wins. Works
|
|
140
|
+
* with no engine installed. `startedAt` is on the `performance.now()`
|
|
141
|
+
* clock and defaults to now.
|
|
142
|
+
*/
|
|
143
|
+
markFlight(flight: object, startedAt?: number): void;
|
|
144
|
+
/** The earliest start `markFlight` declared for `flight`, if any. */
|
|
145
|
+
flightOrigin(flight: object): number | undefined;
|
|
120
146
|
}
|
|
121
147
|
/**
|
|
122
148
|
* The records delivered on `OBSERVE.records`, by type — each entry
|
|
@@ -386,12 +412,14 @@ export interface Dev {
|
|
|
386
412
|
/** Console face of an emitted event — see `reportDiagnostic`. */
|
|
387
413
|
report(entry: DiagnosticEvent): void;
|
|
388
414
|
/**
|
|
389
|
-
* The
|
|
390
|
-
*
|
|
391
|
-
*
|
|
392
|
-
* the
|
|
393
|
-
*
|
|
394
|
-
*
|
|
415
|
+
* The URL of `code`'s page in the docs — what the finding means and how
|
|
416
|
+
* to fix it, one page per code
|
|
417
|
+
* (`https://v2.solidjs.com/reference/solid-js/diagnostics/<slug>`, slug =
|
|
418
|
+
* the code lowercased with `-` for `_`). The one place the URL is built:
|
|
419
|
+
* the console footer prints it and the performance tracks' Insights link
|
|
420
|
+
* (`learnMoreUrl`) reads it, so both name the same page. Dev-tier: it is
|
|
421
|
+
* guidance for a developer, and a URL string on a retained object is a
|
|
422
|
+
* cost every observe build would pay.
|
|
395
423
|
*/
|
|
396
424
|
guideUrl(code: DiagnosticCode): string;
|
|
397
425
|
}
|
|
@@ -439,17 +467,27 @@ export declare function ownerPath(subject: DiagnosticSubject | null | undefined)
|
|
|
439
467
|
* default (right for the synchronous rule checks — they fire inside the
|
|
440
468
|
* scope that misbehaved); pass the node for scheduler-time findings whose
|
|
441
469
|
* ambient context is the flush, or `null` for events that have no location
|
|
442
|
-
* by nature. An `ownerPath` already on the event wins over the
|
|
443
|
-
* (hosts whose owners are not signals' owners compute their
|
|
444
|
-
* output is a separate, dev-tier step — see `reportDiagnostic`.
|
|
470
|
+
* by nature. An `ownerPath` (or `loc`) already on the event wins over the
|
|
471
|
+
* subject walk (hosts whose owners are not signals' owners compute their
|
|
472
|
+
* own). Console output is a separate, dev-tier step — see `reportDiagnostic`.
|
|
445
473
|
*/
|
|
446
474
|
export declare function emitDiagnostic(event: Omit<DiagnosticEvent, "sequence">, subject?: DiagnosticSubject | null | undefined): DiagnosticEvent;
|
|
475
|
+
/**
|
|
476
|
+
* The locating lines of a console report: `\n in <App> › <TodoRow> › effect`
|
|
477
|
+
* (the owner path) and `\n at src/App.tsx:18:3` (see `locationLine`), each
|
|
478
|
+
* when the entry carries it; `""` when it carries neither. Shared by
|
|
479
|
+
* `reportDiagnostic` and the sites that print their own console entry (the
|
|
480
|
+
* halt, which logs its cause beside the message).
|
|
481
|
+
*/
|
|
482
|
+
export declare function locationLines(entry: DiagnosticEvent): string;
|
|
447
483
|
/**
|
|
448
484
|
* The console face of a diagnostic — ONE entry per finding: the message, the
|
|
449
485
|
* owner path (`in <App> › <TodoRow> › effect`) so a human can locate it, the
|
|
450
|
-
*
|
|
451
|
-
*
|
|
452
|
-
*
|
|
486
|
+
* source location (`at src/App.tsx:18:3` — see `locationLine`) when a node on
|
|
487
|
+
* the chain was compiled with one, the once-per-code footer as trailing
|
|
488
|
+
* lines, and — when the subject is a binding effect the rendering runtime
|
|
489
|
+
* tagged — the element it writes, as a second console argument (hover
|
|
490
|
+
* highlights it, click jumps to Elements).
|
|
453
491
|
* Severity picks the console method. Call sites report the entry
|
|
454
492
|
* `emitDiagnostic` returned so the structured and console channels never
|
|
455
493
|
* disagree. Dev-tier: in an observe build this is a no-op, so wiring paths
|
|
@@ -52,5 +52,13 @@ export declare class NoOwnerError extends Error {
|
|
|
52
52
|
constructor();
|
|
53
53
|
}
|
|
54
54
|
export declare class ContextNotFoundError extends Error {
|
|
55
|
-
|
|
55
|
+
/**
|
|
56
|
+
* In dev, a read site passes the context (and whether a provider above set
|
|
57
|
+
* it to `undefined`) so the message can name it and say why it has no
|
|
58
|
+
* value (#4181). Read through `arguments` so production — where the message
|
|
59
|
+
* is empty — keeps the zero-parameter constructor byte for byte.
|
|
60
|
+
*/
|
|
61
|
+
constructor(context?: {
|
|
62
|
+
id: symbol;
|
|
63
|
+
}, providedUndefined?: boolean);
|
|
56
64
|
}
|
|
@@ -8,6 +8,17 @@ export declare function setSlotUnobserved(fn: (node: Signal<any>) => void): void
|
|
|
8
8
|
export declare function unlinkSubs(link: Link): Link | null;
|
|
9
9
|
export declare function trimStaleDeps(el: Computed<any>): void;
|
|
10
10
|
export declare function clearDeps(el: Computed<unknown>): void;
|
|
11
|
+
/**
|
|
12
|
+
* Last-one-out releases held back while a pass tears down the frame of an
|
|
13
|
+
* earlier pass that never committed (#4142). The pass is about to rebuild
|
|
14
|
+
* the same children, which read the same lazy nodes again. Released on the
|
|
15
|
+
* spot, a lazy async memo whose only reader was the old frame's child memo
|
|
16
|
+
* was torn down, re-ran on the new child's read, went pending, and the cycle
|
|
17
|
+
* repeated forever. `recompute` collects them around that teardown and
|
|
18
|
+
* releases what is still unobserved when the pass ends.
|
|
19
|
+
*/
|
|
20
|
+
export declare let deferredReleases: Computed<any>[] | null;
|
|
21
|
+
export declare const deferReleases: (list: Computed<any>[] | null) => Computed<any>[] | null;
|
|
11
22
|
export declare function unobserved(el: Computed<unknown>): void;
|
|
12
23
|
/**
|
|
13
24
|
* Deferred dormancy for never-observed auto-dispose computeds (#3078).
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** @internal The identity of a plain signal named while identities were on. */
|
|
2
|
+
export declare function signalName(node: object | undefined): string | undefined;
|
|
3
|
+
/** @internal Name plain signals from now on (`on`), or stop. */
|
|
4
|
+
export declare function setSignalIdentities(on: boolean): void;
|
|
5
|
+
/**
|
|
6
|
+
* @internal Called with every plain signal `createSignal` makes, and every
|
|
7
|
+
* plain store root `createStore` makes, while set (the namer above). Never
|
|
8
|
+
* set unless `setSignalIdentities` is imported, so a bundle without it keeps
|
|
9
|
+
* only a null check.
|
|
10
|
+
*/
|
|
11
|
+
export declare let signalHook: ((node: object) => void) | null;
|
|
12
|
+
/**
|
|
13
|
+
* @internal Dev only: `watch` is called with every node read while set (the
|
|
14
|
+
* dev hook `onRead`) — the frames client's identity-drift check watches the
|
|
15
|
+
* named signals a deferred occurrence reads as it mounts. A no-op in prod.
|
|
16
|
+
*/
|
|
17
|
+
export declare function setReadWatch(watch: ((node: object) => void) | null): void;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export { ContextNotFoundError, NoOwnerError, NotReadyError, TimeoutError } from "./error.js";
|
|
2
2
|
export { isPending, latest } from "./verdict.js";
|
|
3
3
|
export { action } from "./action.js";
|
|
4
|
-
export { isEqual, untrack, runWithOwner, computed, signal, read, setSignal, setMemo, markRefresh, staleValues, setSnapshotCapture, markSnapshotScope, releaseSnapshotScope, clearSnapshots } from "./core.js";
|
|
4
|
+
export { isEqual, untrack, runWithOwner, computed, signal, read, setSignal, setWriteHook, setMemo, markRefresh, staleValues, setSnapshotCapture, markSnapshotScope, releaseSnapshotScope, clearSnapshots } from "./core.js";
|
|
5
5
|
export { enableExternalSource, _resetExternalSourceConfig, type ExternalSourceFactory, type ExternalSource, type ExternalSourceConfig } from "./external.js";
|
|
6
6
|
export { createOwner, createRoot, dispose, getNextChildId, getObserver, getOwner, isDisposed, cleanup, peekNextChildId } from "./owner.js";
|
|
7
|
+
export { setSignalIdentities, signalName, signalHook, setReadWatch } from "./identities.js";
|
|
7
8
|
export { createContext, getContext, setContext, type Context, type ContextRecord } from "./context.js";
|
|
8
9
|
export { handleAsync } from "./async.js";
|
|
9
10
|
export type { Computed, Disposable, Link, Owner, Root, Signal, NodeOptions } from "./types.js";
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
+
import { laneValueOf } from "./truth.js";
|
|
1
2
|
import { type Transaction } from "./scheduler.js";
|
|
2
3
|
import type { Computed, Signal } from "./types.js";
|
|
3
|
-
|
|
4
|
-
* staging a shown lane holds for its next reveal, else its slot; the
|
|
5
|
-
* committed value while it has none (its first lane pass in flight). */
|
|
6
|
-
export declare function laneValueOf(el: Signal<any> | Computed<any>): unknown;
|
|
4
|
+
export { laneValueOf };
|
|
7
5
|
/** What the screen shows for a lane's node: the lane's value once the lane
|
|
8
6
|
* has revealed, the committed truth before. */
|
|
9
7
|
export declare function display(el: Signal<any> | Computed<any>): unknown;
|
|
@@ -48,16 +46,6 @@ export declare function verdictLane(t: Transaction): Transaction;
|
|
|
48
46
|
* propagation (async.ts `propagateStatus`), the node gone pending. */
|
|
49
47
|
export declare function laneStage(el: Computed<any>, l: Transaction, create: boolean, errored: boolean | Computed<any>): boolean;
|
|
50
48
|
export declare function supersede(n: Signal<any> | Computed<any>, value: unknown, changed: boolean): void;
|
|
51
|
-
/** Truth readers (`until`, `refresh`; CONFIG_AUTHORITATIVE) — pay-for-use:
|
|
52
|
-
* the first one installs these on GlobalQueue (signals.ts `watch`).
|
|
53
|
-
*
|
|
54
|
-
* A truth reader's read of a lane node: the lane's value when it is the
|
|
55
|
-
* truth (#3943), else the truth staged beneath a guess, else the committed
|
|
56
|
-
* value. */
|
|
57
|
-
export declare function truthRead(el: Signal<any> | Computed<any>): unknown;
|
|
58
|
-
/** A guess confirmed: its lane's truth readers re-read — of the lane's
|
|
59
|
-
* derivations too, which may be the truth now (#3943). */
|
|
60
|
-
export declare function truthConfirmed(l: Transaction): void;
|
|
61
49
|
/** Lanes. A lane's node is read by its reader's kind: an authoritative
|
|
62
50
|
* reader (`until`) sees the truth — staged beneath a guess, else committed
|
|
63
51
|
* — and is no lane's; an untracked read sees the lane's latest value (A17:
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { Computed, Disposable, Owner, Root } from "./types.js";
|
|
2
2
|
export declare function markDisposal(el: Owner): void;
|
|
3
3
|
export declare function dispose(node: Computed<unknown>): void;
|
|
4
|
+
/** Runs a cleanup or `unobserved` hook; a throw is collected, not raised. @internal */
|
|
5
|
+
export declare function runCleanup(fn: () => void): void;
|
|
6
|
+
/** Rethrows the error `runCleanup` collected, once; `drop` discards it. @internal */
|
|
7
|
+
export declare function rethrowCleanupError(drop?: boolean): void;
|
|
4
8
|
export declare function disposeChildren(node: Owner, self?: boolean, zombie?: boolean): void;
|
|
5
9
|
export declare function linkChild(parent: Owner, node: Owner): void;
|
|
6
10
|
/**
|
|
@@ -63,9 +67,11 @@ export declare function getOwner(): Owner | null;
|
|
|
63
67
|
/**
|
|
64
68
|
* Low-level: registers `fn` as a disposal callback on the current owner.
|
|
65
69
|
* Most code should use `onCleanup()` from `solid-js`, which adds dev-mode
|
|
66
|
-
* checks. `cleanup()` is the unchecked primitive used by internals
|
|
70
|
+
* checks. `cleanup()` is the unchecked primitive used by internals; `owner`
|
|
71
|
+
* (internal) targets a specific owner's disposal list instead of the ambient
|
|
72
|
+
* one.
|
|
67
73
|
*/
|
|
68
|
-
export declare function cleanup(fn: Disposable): Disposable;
|
|
74
|
+
export declare function cleanup(fn: Disposable, owner?: Owner | null): Disposable;
|
|
69
75
|
/**
|
|
70
76
|
* Returns `true` if the owner has been disposed. Pair with a captured owner
|
|
71
77
|
* to bail out of late callbacks whose surrounding component already
|
|
@@ -128,7 +134,7 @@ export declare function createOwner(options?: {
|
|
|
128
134
|
* const detached = runWithOwner(null, () => createRoot(d => d));
|
|
129
135
|
* ```
|
|
130
136
|
*
|
|
131
|
-
* @description https://
|
|
137
|
+
* @description https://v2.solidjs.com/reference/solid-js/advanced/owner-introspection/create-root
|
|
132
138
|
*/
|
|
133
139
|
export declare function createRoot<T>(init: ((dispose: () => void) => T) | (() => T), options?: {
|
|
134
140
|
id?: string;
|
|
@@ -1,5 +1,44 @@
|
|
|
1
|
+
import { type DiagnosticSubject } from "./dev.js";
|
|
1
2
|
import { type Heap } from "./heap.js";
|
|
2
|
-
import type { Computed, Signal } from "./types.js";
|
|
3
|
+
import type { Computed, Owner, Signal } from "./types.js";
|
|
4
|
+
export declare let laneReadHook: ((c: Computed<any> | null, el: Signal<any> | Computed<any>) => unknown) | null;
|
|
5
|
+
export declare let laneStageHook: ((el: Computed<any>, l: Transaction, create: boolean, errored: boolean | Computed<any>) => boolean) | null;
|
|
6
|
+
export declare let laneOutcomeHook: ((el: Computed<any>, value: unknown, errored: boolean) => boolean) | null;
|
|
7
|
+
export declare let laneWriteHook: (<T>(el: Signal<T> | Computed<T>, v: T) => T) | null;
|
|
8
|
+
export declare let applyGuessesHook: ((parent: Transaction | null) => void) | null;
|
|
9
|
+
export declare let laneSeamsHook: ((leaks: Computed<any>[] | null) => void) | null;
|
|
10
|
+
export declare let laneCorrectionsHook: (() => boolean) | null;
|
|
11
|
+
export declare let endLanesHook: ((u: Transaction) => void) | null;
|
|
12
|
+
export declare let lanesBlockedHook: ((t: Transaction) => boolean) | null;
|
|
13
|
+
export declare function installLaneHooks(read: NonNullable<typeof laneReadHook>, stage: NonNullable<typeof laneStageHook>, outcome: NonNullable<typeof laneOutcomeHook>, write: NonNullable<typeof laneWriteHook>, applyGuesses: NonNullable<typeof applyGuessesHook>, seams: NonNullable<typeof laneSeamsHook>, corrections: NonNullable<typeof laneCorrectionsHook>, end: NonNullable<typeof endLanesHook>, blocked: NonNullable<typeof lanesBlockedHook>): void;
|
|
14
|
+
export declare let catchHook: ((node: Computed<any>, flags: number, error: unknown) => unknown) | null;
|
|
15
|
+
export declare let freshHook: ((node: Computed<any>, held?: unknown) => unknown) | null;
|
|
16
|
+
export declare let hiddenHook: ((r: Computed<any>) => unknown) | null;
|
|
17
|
+
export declare let boundarySeamHook: (() => void) | null;
|
|
18
|
+
export declare let heldRunHook: ((node: Computed<any>) => boolean) | null;
|
|
19
|
+
export declare function installBoundaryHooks(caught: NonNullable<typeof catchHook>, fresh: NonNullable<typeof freshHook>, hidden: NonNullable<typeof hiddenHook>, seam: NonNullable<typeof boundarySeamHook>, heldRun: NonNullable<typeof heldRunHook>): void;
|
|
20
|
+
/** Store (store/store.ts): `park` — the flush parked into `t`: the store
|
|
21
|
+
* materializes and holds the container node of every staging that had none
|
|
22
|
+
* (a staging needs the node as its home only when something can read the
|
|
23
|
+
* frame through it; a hold can); `commit` — fold the pending backings whose
|
|
24
|
+
* container nodes this flush committed (the owned-raw model's one mutation
|
|
25
|
+
* point). */
|
|
26
|
+
export declare let storeParkHook: ((t: Transaction) => void) | null;
|
|
27
|
+
export declare let storeCommitHook: (() => void) | null;
|
|
28
|
+
export declare function installStoreHooks(park: NonNullable<typeof storeParkHook>, commit: NonNullable<typeof storeCommitHook>): void;
|
|
29
|
+
/** `affects()` marks (affects.ts): the releases at a landing and at the seam
|
|
30
|
+
* (ambient marks). */
|
|
31
|
+
export declare let releaseMarksHook: ((nodes: Signal<any>[]) => void) | null;
|
|
32
|
+
export declare let releaseAmbientMarksHook: ((parked: Transaction | null) => void) | null;
|
|
33
|
+
export declare function installMarkHooks(release: NonNullable<typeof releaseMarksHook>, releaseAmbient: NonNullable<typeof releaseAmbientMarksHook>): void;
|
|
34
|
+
/** Verdicts (verdict.ts). */
|
|
35
|
+
export declare let observeFlightHook: ((c: Computed<any>, el: Computed<any>) => boolean) | null;
|
|
36
|
+
export declare function installVerdictHooks(observeFlight: NonNullable<typeof observeFlightHook>): void;
|
|
37
|
+
/** External-source bridge (wired by enableExternalSource(); undefined while
|
|
38
|
+
* no config is active — including after _resetExternalSourceConfig()). */
|
|
39
|
+
export declare let wireExternalSourceHook: ((self: Computed<any>) => void) | undefined;
|
|
40
|
+
export declare let externalUntrackHook: (<T>(fn: () => T) => T) | undefined;
|
|
41
|
+
export declare function setExternalHooks(wire: typeof wireExternalSourceHook, untrack: typeof externalUntrackHook): void;
|
|
3
42
|
export interface Transaction {
|
|
4
43
|
/** Held staged nodes: committed at the landing. For a lane: its guesses
|
|
5
44
|
* and its work (their lane values in `_x._lane`), revealed at the seam. */
|
|
@@ -41,6 +80,15 @@ export interface Transaction {
|
|
|
41
80
|
* leaf reading a held lane that has not shown is a stale reader of it
|
|
42
81
|
* (#3460); one reading a lane the seam has not judged yet is its work. */
|
|
43
82
|
_held: boolean;
|
|
83
|
+
/** Lane: a current truth that differs folded beneath one of its keyed
|
|
84
|
+
* guesses (lanes.ts `laneWrite`, D-34) — the store's reader of it: a
|
|
85
|
+
* deriving pass outside the lane, or `latest()` (`c` null), is served
|
|
86
|
+
* the hold's world from its guesses; NOT_PENDING otherwise
|
|
87
|
+
* (store/optimistic.ts `foldedRead`). Unset until then; not
|
|
88
|
+
* `_`-prefixed: a new mangled name shifts every later one
|
|
89
|
+
* (scripts/mangle-props.mjs), which costs the floors bytes for a path
|
|
90
|
+
* only optimistic stores reach. */
|
|
91
|
+
folded?: (c: Computed<any> | null, el: Signal<any> | Computed<any>) => unknown;
|
|
44
92
|
/** `affects()` marks declared in it (affects.ts): released at the landing.
|
|
45
93
|
* Not nodes — a mark holds nothing (`blocked` never sees one). */
|
|
46
94
|
_marks: Signal<any>[] | null;
|
|
@@ -123,6 +171,11 @@ export declare function holdNode(n: Signal<any>, t: Transaction): void;
|
|
|
123
171
|
* transaction whose `_nodes` it is on (every site that sets one does the
|
|
124
172
|
* other), so a re-pass, a re-landing or a re-staging adds nothing. */
|
|
125
173
|
export declare function list(n: Signal<any>, t: Transaction): void;
|
|
174
|
+
/** The nodes under `owner` a transaction other than `t` holds (boundaries.ts:
|
|
175
|
+
* what an earlier hold staged under a re-armed boundary). */
|
|
176
|
+
export declare function heldUnder(owner: Owner, t: Transaction | null, fn: (n: Computed<any>) => void): void;
|
|
177
|
+
/** `n` leaves the hold it was staged in: its next pass publishes mainline. */
|
|
178
|
+
export declare function unhold(n: Signal<any>): void;
|
|
126
179
|
export declare const dirtyQueue: Heap;
|
|
127
180
|
export declare let clock: number;
|
|
128
181
|
export declare let _hitUnhandledAsync: boolean;
|
|
@@ -176,6 +229,13 @@ export declare function schedule(): void;
|
|
|
176
229
|
*/
|
|
177
230
|
export declare const ROOT_ERROR_HOOK: unique symbol;
|
|
178
231
|
export declare function haltReactivity(cause?: unknown): void;
|
|
232
|
+
/**
|
|
233
|
+
* Dev: `haltReactivity`, located at `subject` — the computation the uncaught
|
|
234
|
+
* error escaped from — for the REACTIVITY_HALTED message's owner path. Call
|
|
235
|
+
* sites pick it in dev builds only (`haltReactivity(e)` in production), so
|
|
236
|
+
* production keeps the one-argument halt and its bytes unchanged.
|
|
237
|
+
*/
|
|
238
|
+
export declare function haltReactivityAt(cause: unknown, subject: DiagnosticSubject): void;
|
|
179
239
|
/** @internal Test/dev-reload hook. Revives scheduling after a halt. */
|
|
180
240
|
export declare function resetErrorHalt(): void;
|
|
181
241
|
export interface IQueue {
|
|
@@ -189,13 +249,6 @@ export declare class GlobalQueue implements IQueue {
|
|
|
189
249
|
static _update: (el: Computed<unknown>) => void;
|
|
190
250
|
static _dispose: (el: Computed<unknown>, self: boolean, zombie?: boolean) => void;
|
|
191
251
|
static _runEffect: (el: Computed<unknown>) => void;
|
|
192
|
-
static _wireExternalSource: ((self: Computed<any>) => void) | undefined;
|
|
193
|
-
static _externalUntrack: (<T>(fn: () => T) => T) | undefined;
|
|
194
|
-
static _laneRead: ((c: Computed<any> | null, el: Signal<any> | Computed<any>) => unknown) | undefined;
|
|
195
|
-
static _laneStage: ((el: Computed<any>, l: Transaction, create: boolean, errored: boolean | Computed<any>) => boolean) | undefined;
|
|
196
|
-
static _laneOutcome: ((el: Computed<any>, value: unknown, errored: boolean) => boolean) | undefined;
|
|
197
|
-
static _laneWrite: (<T>(el: Signal<T> | Computed<T>, v: T) => T) | undefined;
|
|
198
|
-
static _applyGuesses: ((parent: Transaction | null) => void) | undefined;
|
|
199
252
|
/** A slot node's truth is in flight (its family's derive — store/store.ts). */
|
|
200
253
|
static _slotFlight: ((n: Signal<any>) => boolean) | undefined;
|
|
201
254
|
/** The value a slot node's guess covered: its committed value — a chained
|
|
@@ -216,33 +269,18 @@ export declare class GlobalQueue implements IQueue {
|
|
|
216
269
|
static _storeWrappable: ((v: unknown) => boolean) | undefined;
|
|
217
270
|
static _mark: ((node: Signal<any> | Computed<any>) => void) | undefined;
|
|
218
271
|
static _witnessMark: (() => void) | undefined;
|
|
219
|
-
/**
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
static
|
|
225
|
-
static _endLanes: ((u: Transaction) => void) | undefined;
|
|
226
|
-
static _lanesBlocked: ((t: Transaction) => boolean) | undefined;
|
|
272
|
+
/** A truth landing on a guess (lanes.ts `laneWrite`), `older` when it
|
|
273
|
+
* answers an older question: the store re-bases an arrangement guess over
|
|
274
|
+
* it; a current one differing from a shown keyed arrangement guess folds
|
|
275
|
+
* beneath it instead of voiding it (D-34) — true: the lane stages it
|
|
276
|
+
* beneath (store/optimistic.ts). */
|
|
277
|
+
static _laneRebase: ((el: Signal<any>, truth: unknown, older: boolean) => boolean | void) | undefined;
|
|
227
278
|
static _verdictLane: ((t: Transaction) => Transaction) | undefined;
|
|
228
|
-
static _observeFlight: ((c: Computed<any>, el: Computed<any>) => boolean) | undefined;
|
|
229
279
|
static _laneGuesses: ((t: Transaction) => Signal<any>[]) | undefined;
|
|
230
|
-
/**
|
|
231
|
-
*
|
|
232
|
-
static
|
|
233
|
-
/** The flush parked into `t`: the store materializes and holds the
|
|
234
|
-
* container node of every staging that had none (store/store.ts — a
|
|
235
|
-
* staging needs the node as its home only when something can read the
|
|
236
|
-
* frame through it; a hold can). */
|
|
237
|
-
static _storePark: ((t: Transaction) => void) | undefined;
|
|
280
|
+
/** `createDeferred` (deferred.ts): a deferred node with a flight up that
|
|
281
|
+
* `c` derives from, if any — a truth reader waits on it. */
|
|
282
|
+
static _lagging: ((c: Computed<any>) => Computed<any> | undefined) | undefined;
|
|
238
283
|
static _marked: ((el: Signal<any> | Computed<any>) => boolean) | undefined;
|
|
239
|
-
static _releaseMarks: ((nodes: Signal<any>[]) => void) | undefined;
|
|
240
|
-
static _releaseAmbientMarks: ((parked: Transaction | null) => void) | undefined;
|
|
241
|
-
static _catch: ((node: Computed<any>, flags: number, error: unknown) => boolean) | undefined;
|
|
242
|
-
static _fresh: ((node: Computed<any>) => unknown) | undefined;
|
|
243
|
-
static _hidden: ((r: Computed<any>) => boolean) | undefined;
|
|
244
|
-
static _boundarySeam: (() => void) | undefined;
|
|
245
|
-
static _heldRun: ((node: Computed<any>) => boolean) | undefined;
|
|
246
284
|
flush(): void;
|
|
247
285
|
/** L2 — the seam: end of the pure phase. Commit this flush's staged nodes,
|
|
248
286
|
* or park them with the transaction the flush joined; then land every
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Transaction } from "./scheduler.js";
|
|
2
|
+
import type { Computed, Signal } from "./types.js";
|
|
3
|
+
/** A lane node's current value: its guess, or the latest it derived — the
|
|
4
|
+
* staging a shown lane holds for its next reveal, else its slot; the
|
|
5
|
+
* committed value while it has none (its first lane pass in flight). */
|
|
6
|
+
export declare function laneValueOf(el: Signal<any> | Computed<any>): unknown;
|
|
7
|
+
/** Truth readers (`until`, `refresh`; CONFIG_AUTHORITATIVE) — pay-for-use:
|
|
8
|
+
* the first one installs these on GlobalQueue (signals.ts `watch`).
|
|
9
|
+
*
|
|
10
|
+
* A truth reader's read of a lane node: the lane's value when it is the
|
|
11
|
+
* truth (#3943), else the truth staged beneath a guess, else the committed
|
|
12
|
+
* value. */
|
|
13
|
+
export declare function truthRead(el: Signal<any> | Computed<any>): unknown;
|
|
14
|
+
/** A guess confirmed: its lane's truth readers re-read — of the lane's
|
|
15
|
+
* derivations too, which may be the truth now (#3943). */
|
|
16
|
+
export declare function truthConfirmed(l: Transaction): void;
|