@solidjs/signals 2.0.0-beta.14 → 2.0.0-beta.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/README.md +2 -3
- package/dist/dev.js +295 -194
- package/dist/node.cjs +1419 -1360
- package/dist/prod.js +1152 -1098
- package/dist/types/core/core.d.ts +2 -14
- package/dist/types/core/dev.d.ts +1 -1
- package/dist/types/core/index.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/store/projection.d.ts +2 -2
- package/dist/types/store/store.d.ts +1 -0
- package/dist/types-cjs/core/core.d.cts +2 -14
- package/dist/types-cjs/core/dev.d.cts +1 -1
- package/dist/types-cjs/core/index.d.cts +1 -1
- package/dist/types-cjs/index.d.cts +1 -1
- package/dist/types-cjs/store/projection.d.cts +2 -2
- package/dist/types-cjs/store/store.d.cts +1 -0
- package/package.json +1 -1
|
@@ -2,9 +2,10 @@ import { type Refreshable } from "./constants.js";
|
|
|
2
2
|
import { type OptimisticLane } from "./lanes.js";
|
|
3
3
|
import type { Computed, FirewallSignal, NodeOptions, Owner, Signal } from "./types.js";
|
|
4
4
|
export declare const PRIMITIVE_IN_FORBIDDEN_SCOPE_MESSAGE = "[PRIMITIVE_IN_FORBIDDEN_SCOPE] Cannot create reactive primitives inside createTrackedEffect or owner-backed onSettled";
|
|
5
|
+
export declare const REACTIVE_WRITE_IN_OWNED_SCOPE_SIGNAL_MESSAGE: string;
|
|
6
|
+
export declare const REACTIVE_WRITE_IN_OWNED_SCOPE_REFRESH_MESSAGE: string;
|
|
5
7
|
export declare let tracking: boolean;
|
|
6
8
|
export declare let stale: boolean;
|
|
7
|
-
export declare let refreshing: boolean;
|
|
8
9
|
export declare let pendingCheckActive: boolean;
|
|
9
10
|
export declare let foundPending: boolean;
|
|
10
11
|
export declare let latestReadActive: boolean;
|
|
@@ -163,16 +164,3 @@ export declare function isPending(fn: () => any): boolean;
|
|
|
163
164
|
* ```
|
|
164
165
|
*/
|
|
165
166
|
export declare function refresh<T>(target: Refreshable<T>): void;
|
|
166
|
-
/**
|
|
167
|
-
* Returns `true` while a `refresh()` call is in progress. Useful for showing
|
|
168
|
-
* a "refreshing" indicator distinct from the initial-load `<Loading>`
|
|
169
|
-
* fallback.
|
|
170
|
-
*
|
|
171
|
-
* @example
|
|
172
|
-
* ```tsx
|
|
173
|
-
* <Show when={isRefreshing()}>
|
|
174
|
-
* <span class="badge">refreshing…</span>
|
|
175
|
-
* </Show>
|
|
176
|
-
* ```
|
|
177
|
-
*/
|
|
178
|
-
export declare function isRefreshing(): boolean;
|
package/dist/types/core/dev.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export interface DevHooks {
|
|
|
6
6
|
onStoreNodeUpdate?: (state: any, property: PropertyKey, value: any, prev: any) => void;
|
|
7
7
|
}
|
|
8
8
|
export type DiagnosticSeverity = "warn" | "error";
|
|
9
|
-
export type DiagnosticCode = "STRICT_READ_UNTRACKED" | "PENDING_ASYNC_UNTRACKED_READ" | "PENDING_ASYNC_FORBIDDEN_SCOPE" | "
|
|
9
|
+
export type DiagnosticCode = "STRICT_READ_UNTRACKED" | "PENDING_ASYNC_UNTRACKED_READ" | "PENDING_ASYNC_FORBIDDEN_SCOPE" | "REACTIVE_WRITE_IN_OWNED_SCOPE" | "RUN_WITH_DISPOSED_OWNER" | "NO_OWNER_CLEANUP" | "CLEANUP_IN_FORBIDDEN_SCOPE" | "PRIMITIVE_IN_FORBIDDEN_SCOPE" | "NO_OWNER_EFFECT" | "NO_OWNER_BOUNDARY" | "ASYNC_OUTSIDE_LOADING_BOUNDARY" | "INVALID_REFRESH_TARGET" | "MISSING_EFFECT_FN" | "SYNC_NODE_RECEIVED_ASYNC";
|
|
10
10
|
export type DiagnosticKind = "strict-read" | "async" | "write" | "lifecycle" | "owner";
|
|
11
11
|
export interface DiagnosticEvent {
|
|
12
12
|
sequence: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ContextNotFoundError, NoOwnerError, NotReadyError } from "./error.js";
|
|
2
|
-
export { isEqual, untrack, runWithOwner, computed, signal, read, setSignal, setMemo, suppressComputedRecompute, optimisticSignal, optimisticComputed, isPending, latest, refresh,
|
|
2
|
+
export { isEqual, untrack, runWithOwner, computed, signal, read, setSignal, setMemo, suppressComputedRecompute, optimisticSignal, optimisticComputed, isPending, latest, refresh, staleValues, setSnapshotCapture, markSnapshotScope, releaseSnapshotScope, clearSnapshots } from "./core.js";
|
|
3
3
|
export { enableExternalSource, _resetExternalSourceConfig, type ExternalSourceFactory, type ExternalSource, type ExternalSourceConfig } from "./external.js";
|
|
4
4
|
export { createOwner, createRoot, dispose, getNextChildId, getObserver, getOwner, isDisposed, cleanup, peekNextChildId } from "./owner.js";
|
|
5
5
|
export { createContext, getContext, setContext, type Context, type ContextRecord } from "./context.js";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { $REFRESH, ContextNotFoundError, NoOwnerError, NotReadyError, action, createContext, createOwner, createRoot, runWithOwner, flush, getNextChildId, peekNextChildId, getContext, setContext, getOwner, isDisposed, getObserver, isEqual, untrack, isPending, latest,
|
|
1
|
+
export { $REFRESH, ContextNotFoundError, NoOwnerError, NotReadyError, action, createContext, createOwner, createRoot, runWithOwner, flush, getNextChildId, peekNextChildId, getContext, setContext, getOwner, isDisposed, getObserver, isEqual, untrack, isPending, latest, refresh, SUPPORTS_PROXY, setSnapshotCapture, markSnapshotScope, releaseSnapshotScope, clearSnapshots, enforceLoadingBoundary, enableExternalSource } from "./core/index.js";
|
|
2
2
|
import { type Dev } from "./core/index.js";
|
|
3
3
|
export declare const DEV: Dev | undefined;
|
|
4
4
|
export type { Owner, Context, ContextRecord, IQueue, ExternalSourceFactory, ExternalSource, ExternalSourceConfig, Refreshable, Dev, DevHooks, DiagnosticCapture, DiagnosticCode, DiagnosticEvent, DiagnosticKind, Diagnostics, DiagnosticSeverity } from "./core/index.js";
|
|
@@ -61,6 +61,6 @@ export declare function createProjection<T extends object = {}>(fn: (draft: T) =
|
|
|
61
61
|
* instead of `STORE_OPTIMISTIC_OVERRIDE` even when an async yield fires outside
|
|
62
62
|
* the outer `setProjectionWriteActive` scope.
|
|
63
63
|
*/
|
|
64
|
-
export declare function runProjectionComputed<T extends object>(wrappedStore: Store<T>, fn: (draft: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, key: string | ((item: NonNullable<any>) => any), wrapCommit?: (write: () => void) => void): Computed<void | T>;
|
|
65
|
-
export declare function createWriteTraps(isActive?: () => boolean): ProxyHandler<any>;
|
|
64
|
+
export declare function runProjectionComputed<T extends object>(wrappedStore: Store<T>, fn: (draft: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, key: string | ((item: NonNullable<any>) => any), wrapCommit?: (write: () => void) => void, onDraftWrite?: () => void): Computed<void | T>;
|
|
65
|
+
export declare function createWriteTraps(isActive?: () => boolean, onDraftWrite?: () => void): ProxyHandler<any>;
|
|
66
66
|
export declare const writeTraps: ProxyHandler<any>;
|
|
@@ -67,6 +67,7 @@ export declare function wrap<T extends Record<PropertyKey, any>>(value: T, targe
|
|
|
67
67
|
export declare function isWrappable<T>(obj: T | NotWrappable): obj is T;
|
|
68
68
|
export declare function setWriteOverride(value: boolean): void;
|
|
69
69
|
export declare function trackSelf(target: StoreNode, symbol?: symbol): void;
|
|
70
|
+
export declare function notifySelf(target: StoreNode): void;
|
|
70
71
|
export declare function getKeys(source: Record<PropertyKey, any>, override: Record<PropertyKey, any> | undefined, enumerable?: boolean): PropertyKey[];
|
|
71
72
|
export declare function getPropertyDescriptor(source: Record<PropertyKey, any>, override: Record<PropertyKey, any> | undefined, property: PropertyKey): PropertyDescriptor | undefined;
|
|
72
73
|
export declare const storeTraps: ProxyHandler<StoreNode>;
|
|
@@ -2,9 +2,10 @@ import { type Refreshable } from "./constants.cjs";
|
|
|
2
2
|
import { type OptimisticLane } from "./lanes.cjs";
|
|
3
3
|
import type { Computed, FirewallSignal, NodeOptions, Owner, Signal } from "./types.cjs";
|
|
4
4
|
export declare const PRIMITIVE_IN_FORBIDDEN_SCOPE_MESSAGE = "[PRIMITIVE_IN_FORBIDDEN_SCOPE] Cannot create reactive primitives inside createTrackedEffect or owner-backed onSettled";
|
|
5
|
+
export declare const REACTIVE_WRITE_IN_OWNED_SCOPE_SIGNAL_MESSAGE: string;
|
|
6
|
+
export declare const REACTIVE_WRITE_IN_OWNED_SCOPE_REFRESH_MESSAGE: string;
|
|
5
7
|
export declare let tracking: boolean;
|
|
6
8
|
export declare let stale: boolean;
|
|
7
|
-
export declare let refreshing: boolean;
|
|
8
9
|
export declare let pendingCheckActive: boolean;
|
|
9
10
|
export declare let foundPending: boolean;
|
|
10
11
|
export declare let latestReadActive: boolean;
|
|
@@ -163,16 +164,3 @@ export declare function isPending(fn: () => any): boolean;
|
|
|
163
164
|
* ```
|
|
164
165
|
*/
|
|
165
166
|
export declare function refresh<T>(target: Refreshable<T>): void;
|
|
166
|
-
/**
|
|
167
|
-
* Returns `true` while a `refresh()` call is in progress. Useful for showing
|
|
168
|
-
* a "refreshing" indicator distinct from the initial-load `<Loading>`
|
|
169
|
-
* fallback.
|
|
170
|
-
*
|
|
171
|
-
* @example
|
|
172
|
-
* ```tsx
|
|
173
|
-
* <Show when={isRefreshing()}>
|
|
174
|
-
* <span class="badge">refreshing…</span>
|
|
175
|
-
* </Show>
|
|
176
|
-
* ```
|
|
177
|
-
*/
|
|
178
|
-
export declare function isRefreshing(): boolean;
|
|
@@ -6,7 +6,7 @@ export interface DevHooks {
|
|
|
6
6
|
onStoreNodeUpdate?: (state: any, property: PropertyKey, value: any, prev: any) => void;
|
|
7
7
|
}
|
|
8
8
|
export type DiagnosticSeverity = "warn" | "error";
|
|
9
|
-
export type DiagnosticCode = "STRICT_READ_UNTRACKED" | "PENDING_ASYNC_UNTRACKED_READ" | "PENDING_ASYNC_FORBIDDEN_SCOPE" | "
|
|
9
|
+
export type DiagnosticCode = "STRICT_READ_UNTRACKED" | "PENDING_ASYNC_UNTRACKED_READ" | "PENDING_ASYNC_FORBIDDEN_SCOPE" | "REACTIVE_WRITE_IN_OWNED_SCOPE" | "RUN_WITH_DISPOSED_OWNER" | "NO_OWNER_CLEANUP" | "CLEANUP_IN_FORBIDDEN_SCOPE" | "PRIMITIVE_IN_FORBIDDEN_SCOPE" | "NO_OWNER_EFFECT" | "NO_OWNER_BOUNDARY" | "ASYNC_OUTSIDE_LOADING_BOUNDARY" | "INVALID_REFRESH_TARGET" | "MISSING_EFFECT_FN" | "SYNC_NODE_RECEIVED_ASYNC";
|
|
10
10
|
export type DiagnosticKind = "strict-read" | "async" | "write" | "lifecycle" | "owner";
|
|
11
11
|
export interface DiagnosticEvent {
|
|
12
12
|
sequence: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ContextNotFoundError, NoOwnerError, NotReadyError } from "./error.cjs";
|
|
2
|
-
export { isEqual, untrack, runWithOwner, computed, signal, read, setSignal, setMemo, suppressComputedRecompute, optimisticSignal, optimisticComputed, isPending, latest, refresh,
|
|
2
|
+
export { isEqual, untrack, runWithOwner, computed, signal, read, setSignal, setMemo, suppressComputedRecompute, optimisticSignal, optimisticComputed, isPending, latest, refresh, staleValues, setSnapshotCapture, markSnapshotScope, releaseSnapshotScope, clearSnapshots } from "./core.cjs";
|
|
3
3
|
export { enableExternalSource, _resetExternalSourceConfig, type ExternalSourceFactory, type ExternalSource, type ExternalSourceConfig } from "./external.cjs";
|
|
4
4
|
export { createOwner, createRoot, dispose, getNextChildId, getObserver, getOwner, isDisposed, cleanup, peekNextChildId } from "./owner.cjs";
|
|
5
5
|
export { createContext, getContext, setContext, type Context, type ContextRecord } from "./context.cjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { $REFRESH, ContextNotFoundError, NoOwnerError, NotReadyError, action, createContext, createOwner, createRoot, runWithOwner, flush, getNextChildId, peekNextChildId, getContext, setContext, getOwner, isDisposed, getObserver, isEqual, untrack, isPending, latest,
|
|
1
|
+
export { $REFRESH, ContextNotFoundError, NoOwnerError, NotReadyError, action, createContext, createOwner, createRoot, runWithOwner, flush, getNextChildId, peekNextChildId, getContext, setContext, getOwner, isDisposed, getObserver, isEqual, untrack, isPending, latest, refresh, SUPPORTS_PROXY, setSnapshotCapture, markSnapshotScope, releaseSnapshotScope, clearSnapshots, enforceLoadingBoundary, enableExternalSource } from "./core/index.cjs";
|
|
2
2
|
import { type Dev } from "./core/index.cjs";
|
|
3
3
|
export declare const DEV: Dev | undefined;
|
|
4
4
|
export type { Owner, Context, ContextRecord, IQueue, ExternalSourceFactory, ExternalSource, ExternalSourceConfig, Refreshable, Dev, DevHooks, DiagnosticCapture, DiagnosticCode, DiagnosticEvent, DiagnosticKind, Diagnostics, DiagnosticSeverity } from "./core/index.cjs";
|
|
@@ -61,6 +61,6 @@ export declare function createProjection<T extends object = {}>(fn: (draft: T) =
|
|
|
61
61
|
* instead of `STORE_OPTIMISTIC_OVERRIDE` even when an async yield fires outside
|
|
62
62
|
* the outer `setProjectionWriteActive` scope.
|
|
63
63
|
*/
|
|
64
|
-
export declare function runProjectionComputed<T extends object>(wrappedStore: Store<T>, fn: (draft: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, key: string | ((item: NonNullable<any>) => any), wrapCommit?: (write: () => void) => void): Computed<void | T>;
|
|
65
|
-
export declare function createWriteTraps(isActive?: () => boolean): ProxyHandler<any>;
|
|
64
|
+
export declare function runProjectionComputed<T extends object>(wrappedStore: Store<T>, fn: (draft: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, key: string | ((item: NonNullable<any>) => any), wrapCommit?: (write: () => void) => void, onDraftWrite?: () => void): Computed<void | T>;
|
|
65
|
+
export declare function createWriteTraps(isActive?: () => boolean, onDraftWrite?: () => void): ProxyHandler<any>;
|
|
66
66
|
export declare const writeTraps: ProxyHandler<any>;
|
|
@@ -67,6 +67,7 @@ export declare function wrap<T extends Record<PropertyKey, any>>(value: T, targe
|
|
|
67
67
|
export declare function isWrappable<T>(obj: T | NotWrappable): obj is T;
|
|
68
68
|
export declare function setWriteOverride(value: boolean): void;
|
|
69
69
|
export declare function trackSelf(target: StoreNode, symbol?: symbol): void;
|
|
70
|
+
export declare function notifySelf(target: StoreNode): void;
|
|
70
71
|
export declare function getKeys(source: Record<PropertyKey, any>, override: Record<PropertyKey, any> | undefined, enumerable?: boolean): PropertyKey[];
|
|
71
72
|
export declare function getPropertyDescriptor(source: Record<PropertyKey, any>, override: Record<PropertyKey, any> | undefined, property: PropertyKey): PropertyDescriptor | undefined;
|
|
72
73
|
export declare const storeTraps: ProxyHandler<StoreNode>;
|
package/package.json
CHANGED