@raphy-js/raph 1.0.0-dev.2 → 1.0.1-dev.20
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 +1096 -0
- package/dist/api/Raph.d.ts +59 -190
- package/dist/api/RaphFacadeSession.d.ts +90 -0
- package/dist/api/RaphReactivityInstance.d.ts +72 -0
- package/dist/api/errors.d.ts +9 -4
- package/dist/api/types.d.ts +162 -17
- package/dist/core-CyilRD7s.js +1055 -0
- package/dist/core-ugchZNqC.cjs +1 -0
- package/dist/debug/api/Raph.cjs +1 -1
- package/dist/debug/api/Raph.js +368 -366
- package/dist/debug/api/RaphFacadeSession.cjs +1 -0
- package/dist/debug/api/RaphFacadeSession.js +306 -0
- package/dist/debug/api/RaphReactivityInstance.cjs +1 -0
- package/dist/debug/api/RaphReactivityInstance.js +149 -0
- package/dist/debug/api/errors.cjs +1 -1
- package/dist/debug/api/errors.js +10 -7
- package/dist/debug/path/DataPath.cjs +1 -0
- package/dist/debug/path/{data-path.js → DataPath.js} +151 -180
- package/dist/debug/path/PathRouter.cjs +1 -0
- package/dist/debug/path/{path-router.js → PathRouter.js} +1 -1
- package/dist/debug/path/RaphKernel.cjs +1 -1
- package/dist/debug/path/RaphKernel.js +258 -207
- package/dist/debug/path/data-path.utils.cjs +1 -0
- package/dist/debug/path/data-path.utils.js +56 -0
- package/dist/debug/path/derived/DerivedRegistry.cjs +1 -0
- package/dist/debug/path/{DerivedRegistry.js → derived/DerivedRegistry.js} +5 -5
- package/dist/debug/path/derived/derived-collection.utils.cjs +1 -0
- package/dist/debug/path/{derived-collection.js → derived/derived-collection.utils.js} +1 -1
- package/dist/debug/path/derived/derived-strategy.types.cjs +1 -0
- package/dist/debug/path/derived/derived-strategy.types.js +1 -0
- package/dist/debug/path/{MetaController.cjs → meta/MetaController.cjs} +1 -1
- package/dist/debug/path/{MetaController.js → meta/MetaController.js} +3 -3
- package/dist/debug/path/meta/RaphMetaStore.cjs +1 -0
- package/dist/debug/path/{RaphMetaStore.js → meta/RaphMetaStore.js} +1 -1
- package/dist/debug/path/meta/meta.types.cjs +1 -0
- package/dist/debug/path/meta/meta.types.js +1 -0
- package/dist/debug/path/storage/AdapterPathStore.cjs +1 -0
- package/dist/debug/path/{AdapterPathStore.js → storage/AdapterPathStore.js} +9 -9
- package/dist/debug/path/storage/DefaultDataAdapter.cjs +1 -0
- package/dist/debug/path/{data-adapter.js → storage/DefaultDataAdapter.js} +2 -2
- package/dist/debug/path/storage/PathEventHub.cjs +1 -0
- package/dist/debug/path/{PathEventHub.js → storage/PathEventHub.js} +34 -34
- package/dist/debug/path/storage/PathStore.cjs +1 -0
- package/dist/debug/path/{PathStore.js → storage/PathStore.js} +28 -28
- package/dist/debug/path/storage/data-adapter.types.cjs +1 -0
- package/dist/debug/path/storage/data-adapter.types.js +1 -0
- package/dist/debug/reactivity/engine.cjs +1 -1
- package/dist/debug/reactivity/engine.js +478 -306
- package/dist/debug/reactivity/reactive-object.cjs +1 -0
- package/dist/debug/reactivity/reactive-object.js +280 -0
- package/dist/debug/runtime/RaphRuntime.cjs +1 -1
- package/dist/debug/runtime/RaphRuntime.js +798 -519
- package/dist/debug/runtime/diagnostics/RaphDebug.cjs +1 -0
- package/dist/debug/runtime/diagnostics/RaphDebug.js +297 -0
- package/dist/debug/runtime/errors.cjs +1 -1
- package/dist/debug/runtime/errors.js +6 -3
- package/dist/debug/runtime/ownership/RaphEffectScope.cjs +1 -0
- package/dist/debug/runtime/ownership/RaphEffectScope.js +171 -0
- package/dist/debug/runtime/ownership/RaphNode.cjs +1 -0
- package/dist/debug/runtime/ownership/RaphNode.js +206 -0
- package/dist/debug/runtime/ownership/RaphScope.cjs +1 -0
- package/dist/debug/runtime/ownership/RaphScope.js +101 -0
- package/dist/debug/runtime/ownership/parent-graph.types.cjs +1 -0
- package/dist/debug/runtime/ownership/parent-graph.types.js +1 -0
- package/dist/debug/runtime/phases/RaphPhasePipeline.cjs +1 -0
- package/dist/debug/runtime/phases/RaphPhasePipeline.js +587 -0
- package/dist/debug/runtime/phases/orderPhaseTasks.cjs +1 -0
- package/dist/debug/runtime/phases/orderPhaseTasks.js +59 -0
- package/dist/debug/runtime/reactivity/PathHandle.cjs +1 -0
- package/dist/debug/runtime/{PathHandle.js → reactivity/PathHandle.js} +75 -39
- package/dist/debug/runtime/reactivity/RaphMetaSource.cjs +1 -0
- package/dist/debug/runtime/reactivity/RaphMetaSource.js +112 -0
- package/dist/debug/runtime/reactivity/RaphWorkGraph.cjs +1 -0
- package/dist/debug/runtime/reactivity/RaphWorkGraph.js +995 -0
- package/dist/debug/runtime/reactivity/RuntimeReactivity.cjs +1 -0
- package/dist/debug/runtime/reactivity/RuntimeReactivity.js +156 -0
- package/dist/debug/runtime/reactivity/RuntimeWatch.cjs +1 -0
- package/dist/debug/runtime/reactivity/RuntimeWatch.js +88 -0
- package/dist/debug/runtime/reactivity/runtime-reactivity.types.cjs +1 -0
- package/dist/debug/runtime/reactivity/runtime-reactivity.types.js +1 -0
- package/dist/entrypoints/machine-testing.d.ts +2 -0
- package/dist/entrypoints/machine.d.ts +5 -0
- package/dist/entrypoints/path.d.ts +14 -0
- package/dist/entrypoints/reactivity.d.ts +1 -0
- package/dist/entrypoints/runtime.d.ts +17 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +46 -38
- package/dist/machine/compiler.d.ts +71 -0
- package/dist/machine/core.d.ts +50 -0
- package/dist/machine/persistence.d.ts +5 -0
- package/dist/machine/runtime.d.ts +4 -0
- package/dist/machine/testing.d.ts +43 -0
- package/dist/machine/types.d.ts +155 -0
- package/dist/machine-testing.cjs +1 -0
- package/dist/machine-testing.js +188 -0
- package/dist/machine.cjs +1 -0
- package/dist/machine.js +837 -0
- package/dist/main.d.ts +20 -0
- package/dist/path/{data-path.d.ts → DataPath.d.ts} +16 -40
- package/dist/path/{path-router.d.ts → PathRouter.d.ts} +1 -1
- package/dist/path/RaphKernel.d.ts +13 -10
- package/dist/path/data-path.types.d.ts +34 -0
- package/dist/path/data-path.utils.d.ts +9 -0
- package/dist/path/{DerivedRegistry.d.ts → derived/DerivedRegistry.d.ts} +2 -2
- package/dist/path/{RaphDerivedHandle.d.ts → derived/RaphDerivedHandle.d.ts} +3 -3
- package/dist/path/derived/derived-collection.types.d.ts +12 -0
- package/dist/path/{derived-collection.d.ts → derived/derived-collection.utils.d.ts} +3 -13
- package/dist/path/{derived-strategies.d.ts → derived/derived-strategy.types.d.ts} +0 -3
- package/dist/path/derived/derived-strategy.utils.d.ts +4 -0
- package/dist/path/{MetaController.d.ts → meta/MetaController.d.ts} +4 -4
- package/dist/path/{RaphMeta.d.ts → meta/RaphMeta.d.ts} +2 -2
- package/dist/path/{RaphMetaStore.d.ts → meta/RaphMetaStore.d.ts} +1 -1
- package/dist/path/{meta.types.d.ts → meta/meta.types.d.ts} +2 -4
- package/dist/path/path.types.d.ts +3 -2
- package/dist/path/{segment-key.d.ts → pathSegmentKey.d.ts} +1 -1
- package/dist/path/{AdapterPathStore.d.ts → storage/AdapterPathStore.d.ts} +4 -4
- package/dist/path/{data-adapter.d.ts → storage/DefaultDataAdapter.d.ts} +2 -17
- package/dist/path/{PathEventHub.d.ts → storage/PathEventHub.d.ts} +9 -9
- package/dist/path/{PathStore.d.ts → storage/PathStore.d.ts} +3 -3
- package/dist/path/storage/data-adapter.types.d.ts +17 -0
- package/dist/path.cjs +1 -1
- package/dist/path.js +16 -16
- package/dist/raph.cjs +1 -1
- package/dist/raph.js +46 -38
- package/dist/reactivity/engine.d.ts +17 -3
- package/dist/reactivity/reactive-object.d.ts +36 -0
- package/dist/reactivity/types.d.ts +25 -0
- package/dist/reactivity.cjs +1 -1
- package/dist/reactivity.js +12 -12
- package/dist/runtime/RaphRuntime.d.ts +132 -192
- package/dist/runtime/diagnostics/RaphDebug.d.ts +239 -0
- package/dist/runtime/errors.d.ts +5 -0
- package/dist/runtime/ownership/RaphEffectScope.d.ts +29 -0
- package/dist/runtime/ownership/RaphNode.d.ts +40 -0
- package/dist/runtime/ownership/RaphScope.d.ts +38 -0
- package/dist/runtime/{parent-graph.d.ts → ownership/parent-graph.types.d.ts} +0 -1
- package/dist/runtime/ownership/parentGraph.d.ts +3 -0
- package/dist/runtime/phases/RaphPhasePipeline.d.ts +79 -0
- package/dist/runtime/phases/orderPhaseTasks.d.ts +6 -0
- package/dist/runtime/phases/phase.types.d.ts +92 -0
- package/dist/runtime/{PathHandle.d.ts → reactivity/PathHandle.d.ts} +14 -6
- package/dist/runtime/reactivity/RaphMetaSource.d.ts +32 -0
- package/dist/runtime/reactivity/RaphWorkGraph.d.ts +171 -0
- package/dist/runtime/{RuntimeReactivity.d.ts → reactivity/RuntimeReactivity.d.ts} +14 -9
- package/dist/runtime/{RuntimeWatch.d.ts → reactivity/RuntimeWatch.d.ts} +9 -3
- package/dist/runtime/{runtime-reactivity.types.d.ts → reactivity/runtime-reactivity.types.d.ts} +3 -1
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.js +21 -16
- package/package.json +68 -35
- package/ReadMe.md +0 -153
- package/dist/api/public.d.ts +0 -22
- package/dist/debug/api/public.cjs +0 -1
- package/dist/debug/api/public.js +0 -40
- package/dist/debug/path/AdapterPathStore.cjs +0 -1
- package/dist/debug/path/DerivedRegistry.cjs +0 -1
- package/dist/debug/path/PathEventHub.cjs +0 -1
- package/dist/debug/path/PathStore.cjs +0 -1
- package/dist/debug/path/RaphMetaStore.cjs +0 -1
- package/dist/debug/path/data-adapter.cjs +0 -1
- package/dist/debug/path/data-path.cjs +0 -1
- package/dist/debug/path/derived-collection.cjs +0 -1
- package/dist/debug/path/path-router.cjs +0 -1
- package/dist/debug/path/public.cjs +0 -1
- package/dist/debug/path/public.js +0 -18
- package/dist/debug/runtime/PathHandle.cjs +0 -1
- package/dist/debug/runtime/RaphDebug.cjs +0 -1
- package/dist/debug/runtime/RaphDebug.js +0 -15
- package/dist/debug/runtime/RaphNode.cjs +0 -1
- package/dist/debug/runtime/RaphNode.js +0 -143
- package/dist/debug/runtime/RaphPhasePipeline.cjs +0 -1
- package/dist/debug/runtime/RaphPhasePipeline.js +0 -526
- package/dist/debug/runtime/RaphScope.cjs +0 -1
- package/dist/debug/runtime/RaphScope.js +0 -64
- package/dist/debug/runtime/RuntimeReactivity.cjs +0 -1
- package/dist/debug/runtime/RuntimeReactivity.js +0 -154
- package/dist/debug/runtime/RuntimeWatch.cjs +0 -1
- package/dist/debug/runtime/RuntimeWatch.js +0 -71
- package/dist/debug/runtime/public.cjs +0 -1
- package/dist/debug/runtime/public.js +0 -18
- package/dist/path/public.d.ts +0 -14
- package/dist/runtime/RaphDebug.d.ts +0 -32
- package/dist/runtime/RaphNode.d.ts +0 -68
- package/dist/runtime/RaphPhasePipeline.d.ts +0 -133
- package/dist/runtime/RaphScope.d.ts +0 -50
- package/dist/runtime/phase.types.d.ts +0 -49
- package/dist/runtime/public.d.ts +0 -13
- /package/dist/debug/path/{meta.types.cjs → data-path.types.cjs} +0 -0
- /package/dist/debug/path/{meta.types.js → data-path.types.js} +0 -0
- /package/dist/debug/path/{RaphDerivedHandle.cjs → derived/RaphDerivedHandle.cjs} +0 -0
- /package/dist/debug/path/{RaphDerivedHandle.js → derived/RaphDerivedHandle.js} +0 -0
- /package/dist/debug/{runtime/runtime-reactivity.types.cjs → path/derived/derived-collection.types.cjs} +0 -0
- /package/dist/debug/{runtime/runtime-reactivity.types.js → path/derived/derived-collection.types.js} +0 -0
- /package/dist/debug/path/{derived-strategies.cjs → derived/derived-strategy.utils.cjs} +0 -0
- /package/dist/debug/path/{derived-strategies.js → derived/derived-strategy.utils.js} +0 -0
- /package/dist/debug/path/{RaphMeta.cjs → meta/RaphMeta.cjs} +0 -0
- /package/dist/debug/path/{RaphMeta.js → meta/RaphMeta.js} +0 -0
- /package/dist/debug/path/{segment-key.cjs → pathSegmentKey.cjs} +0 -0
- /package/dist/debug/path/{segment-key.js → pathSegmentKey.js} +0 -0
- /package/dist/debug/path/{data-draft.cjs → storage/createDataDraft.cjs} +0 -0
- /package/dist/debug/path/{data-draft.js → storage/createDataDraft.js} +0 -0
- /package/dist/debug/runtime/{parent-graph.cjs → ownership/parentGraph.cjs} +0 -0
- /package/dist/debug/runtime/{parent-graph.js → ownership/parentGraph.js} +0 -0
- /package/dist/debug/runtime/{disposal.cjs → ownership/throwDisposalErrors.cjs} +0 -0
- /package/dist/debug/runtime/{disposal.js → ownership/throwDisposalErrors.js} +0 -0
- /package/dist/debug/runtime/{RaphFrameLoop.cjs → phases/RaphFrameLoop.cjs} +0 -0
- /package/dist/debug/runtime/{RaphFrameLoop.js → phases/RaphFrameLoop.js} +0 -0
- /package/dist/debug/runtime/{phase.types.cjs → phases/phase.types.cjs} +0 -0
- /package/dist/debug/runtime/{phase.types.js → phases/phase.types.js} +0 -0
- /package/dist/path/{data-draft.d.ts → storage/createDataDraft.d.ts} +0 -0
- /package/dist/runtime/{disposal.d.ts → ownership/throwDisposalErrors.d.ts} +0 -0
- /package/dist/runtime/{RaphFrameLoop.d.ts → phases/RaphFrameLoop.d.ts} +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Disposer } from '../../reactivity/types';
|
|
2
|
+
import { RaphEffectOptions, RaphOwnerWatchSource, RaphPhaseEffect, RaphWatchOptions } from '../phases/phase.types';
|
|
3
|
+
import { RaphScope } from './RaphScope';
|
|
4
|
+
/** Pauses phase deliveries without detaching dependencies or losing accumulated causes. */
|
|
5
|
+
export declare class RaphEffectScope {
|
|
6
|
+
private readonly _owner;
|
|
7
|
+
private _registrations;
|
|
8
|
+
private _children;
|
|
9
|
+
private _selfPaused;
|
|
10
|
+
private _ancestorPauses;
|
|
11
|
+
private _disposed;
|
|
12
|
+
private readonly _releaseOwner;
|
|
13
|
+
private readonly _parent;
|
|
14
|
+
constructor(_owner: RaphScope, parent?: RaphEffectScope | null);
|
|
15
|
+
get paused(): boolean;
|
|
16
|
+
get disposed(): boolean;
|
|
17
|
+
fork(owner: RaphScope): RaphEffectScope;
|
|
18
|
+
effect(phase: string, callback: RaphPhaseEffect, options?: RaphEffectOptions): Disposer;
|
|
19
|
+
watch(source: RaphOwnerWatchSource, phase: string, callback: RaphPhaseEffect, options?: RaphWatchOptions): Disposer;
|
|
20
|
+
pause(): void;
|
|
21
|
+
resume(): void;
|
|
22
|
+
private _pause;
|
|
23
|
+
private _resume;
|
|
24
|
+
dispose(): void;
|
|
25
|
+
private _add;
|
|
26
|
+
private _assertAlive;
|
|
27
|
+
private _addChild;
|
|
28
|
+
private _changeAncestorPause;
|
|
29
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { RaphRuntime } from '../RaphRuntime';
|
|
2
|
+
import { RaphScope } from './RaphScope';
|
|
3
|
+
export interface NodeOptions {
|
|
4
|
+
readonly id?: string;
|
|
5
|
+
readonly priority?: number;
|
|
6
|
+
readonly parent?: RaphNode;
|
|
7
|
+
readonly meta?: Readonly<Record<string, unknown>>;
|
|
8
|
+
readonly type?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Scope with an explicit parent/children ownership position. */
|
|
11
|
+
export declare class RaphNode<TApi = unknown> extends RaphScope {
|
|
12
|
+
priority: number;
|
|
13
|
+
private _parent;
|
|
14
|
+
private readonly _children;
|
|
15
|
+
private _published;
|
|
16
|
+
readonly api: Readonly<TApi>;
|
|
17
|
+
meta: Record<string, unknown>;
|
|
18
|
+
type: string;
|
|
19
|
+
/** Distinguishes a subtree granule from the node's self granule. @internal */
|
|
20
|
+
readonly _subtreeSourceIdentity: Readonly<{}>;
|
|
21
|
+
constructor(parent: RaphNode | RaphRuntime | null, options?: Omit<NodeOptions, 'parent'>, runtime?: RaphRuntime, publication?: never);
|
|
22
|
+
get node(): RaphNode<TApi>;
|
|
23
|
+
get parent(): RaphNode | null;
|
|
24
|
+
get children(): readonly RaphNode[];
|
|
25
|
+
addChild(node: RaphNode): boolean;
|
|
26
|
+
reorderChildren(nodes: readonly RaphNode[]): void;
|
|
27
|
+
options(options: Pick<NodeOptions, 'meta' | 'priority' | 'type'>): void;
|
|
28
|
+
/** Invalidates coarse self/subtree/runtime granules for non-reactive state. */
|
|
29
|
+
touch(metadata?: unknown): void;
|
|
30
|
+
remove(): void;
|
|
31
|
+
dispose(): void;
|
|
32
|
+
/** @internal */
|
|
33
|
+
_setApi(api: TApi): void;
|
|
34
|
+
/** Publishes a fully initialized provisional subtree. @internal */
|
|
35
|
+
_publishCreation(): void;
|
|
36
|
+
/** @internal */
|
|
37
|
+
_isPublished(): boolean;
|
|
38
|
+
}
|
|
39
|
+
/** Creates an unpublished node that Runtime.node() commits after setup. @internal */
|
|
40
|
+
export declare function createProvisionalNode<TApi>(parent: RaphNode, options: Omit<NodeOptions, 'parent'>, runtime: RaphRuntime): RaphNode<TApi>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Disposer, OwnedSource, ReadonlySignal, Signal, WritableComputedOptions } from '../../reactivity/types';
|
|
2
|
+
import { RaphAggregateSource, RaphEffectOptions, RaphPhaseEffect, RaphWatchOptions, RaphWatchSource } from '../phases/phase.types';
|
|
3
|
+
import { RaphRuntime } from '../RaphRuntime';
|
|
4
|
+
import { RaphAggregate } from '../reactivity/RaphWorkGraph';
|
|
5
|
+
import { RaphNode } from './RaphNode';
|
|
6
|
+
/** Runtime owner storage intentionally does not inherit standalone unphased effect/watch. */
|
|
7
|
+
export declare class RaphScope {
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly runtime: RaphRuntime;
|
|
10
|
+
private readonly _resources;
|
|
11
|
+
protected _disposed: boolean;
|
|
12
|
+
protected _disposing: boolean;
|
|
13
|
+
constructor(id: string, runtime: RaphRuntime);
|
|
14
|
+
get disposed(): boolean;
|
|
15
|
+
get active(): boolean;
|
|
16
|
+
/** Stable selector for process ordering; plain scopes are not tree nodes. */
|
|
17
|
+
get node(): RaphNode | undefined;
|
|
18
|
+
signal<T>(value: T): Signal<T>;
|
|
19
|
+
computed<T>(getter: () => T): ReadonlySignal<T>;
|
|
20
|
+
computed<T>(options: WritableComputedOptions<T>): Signal<T>;
|
|
21
|
+
effect(phase: string, callback: RaphPhaseEffect, options?: RaphEffectOptions): Disposer;
|
|
22
|
+
watch(source: RaphWatchSource, phase: string, callback: RaphPhaseEffect, options?: RaphWatchOptions): Disposer;
|
|
23
|
+
aggregate(sources: readonly RaphAggregateSource[]): RaphAggregate;
|
|
24
|
+
action<Args extends unknown[], Result>(operation: (...args: Args) => Result): (...args: Args) => Result;
|
|
25
|
+
action<Args extends unknown[], Result>(name: string, operation: (...args: Args) => Result): (...args: Args) => Result;
|
|
26
|
+
own(disposer: Disposer): Disposer;
|
|
27
|
+
dispose(): void;
|
|
28
|
+
/** @internal */
|
|
29
|
+
_adoptResource(disposer: Disposer): Disposer;
|
|
30
|
+
/** @internal */
|
|
31
|
+
_adoptSource<T>(source: OwnedSource<T>): T;
|
|
32
|
+
/** @internal */
|
|
33
|
+
_debugResourceCount(): number;
|
|
34
|
+
/** @internal */
|
|
35
|
+
_debugSourceCount(): number;
|
|
36
|
+
/** @internal */
|
|
37
|
+
_assertAlive(): void;
|
|
38
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Disposer, EffectTask } from '../../reactivity/types';
|
|
2
|
+
import { RaphScope } from '../ownership/RaphScope';
|
|
3
|
+
import { RaphFrameContext, RaphPhase, RaphPhaseEffect, RaphPhaseTask, RaphSchedulerMode, RaphWorkCause } from './phase.types';
|
|
4
|
+
export interface RaphPhaseBinding extends EffectTask {
|
|
5
|
+
readonly task: RaphPhaseTask;
|
|
6
|
+
/** Stops the owning implicit effect when a fatal discard cannot re-arm it. @internal */
|
|
7
|
+
abort?: Disposer;
|
|
8
|
+
enqueue: (cause: RaphWorkCause, key?: object, schedule?: boolean) => void;
|
|
9
|
+
pause: () => void;
|
|
10
|
+
resume: () => void;
|
|
11
|
+
}
|
|
12
|
+
/** Единая Runtime-owned очередь persistent phase bindings. */
|
|
13
|
+
export declare class RaphPhasePipeline {
|
|
14
|
+
private readonly _scheduler;
|
|
15
|
+
private readonly _runUntracked;
|
|
16
|
+
private readonly _resolveCause;
|
|
17
|
+
private readonly _deferSync;
|
|
18
|
+
private readonly _tracePhase?;
|
|
19
|
+
private _phases;
|
|
20
|
+
private _phaseByName;
|
|
21
|
+
private readonly _phaseBindings;
|
|
22
|
+
private readonly _queues;
|
|
23
|
+
private readonly _deferred;
|
|
24
|
+
private readonly _idleWaiters;
|
|
25
|
+
private _taskSequence;
|
|
26
|
+
private _scheduled;
|
|
27
|
+
private _scheduleToken;
|
|
28
|
+
private _frameHandle;
|
|
29
|
+
private _frameHandleKind;
|
|
30
|
+
private _configurationLocked;
|
|
31
|
+
private _running;
|
|
32
|
+
private _disposed;
|
|
33
|
+
private _firstFrameAt;
|
|
34
|
+
private _lastFrameAt;
|
|
35
|
+
private _frameNumber;
|
|
36
|
+
private _frame;
|
|
37
|
+
constructor(_scheduler: RaphSchedulerMode, _runUntracked: <T>(operation: () => T) => T, _resolveCause: (token: unknown) => RaphWorkCause | undefined, _deferSync?: () => boolean, _tracePhase?: ((phase: string, status: "end" | "error" | "start", error?: unknown) => void) | undefined);
|
|
38
|
+
get frame(): RaphFrameContext;
|
|
39
|
+
get phases(): readonly RaphPhase[];
|
|
40
|
+
definePhases(phases: readonly RaphPhase[]): void;
|
|
41
|
+
addPhase(phase: RaphPhase): void;
|
|
42
|
+
clearPhases(): void;
|
|
43
|
+
requirePhase(name: string): void;
|
|
44
|
+
bindTask(phaseInput: string, consumerOwner: RaphScope, effect: RaphPhaseEffect, priority: number, runner: () => void): RaphPhaseBinding;
|
|
45
|
+
request(): void;
|
|
46
|
+
afterFlush(): Promise<void>;
|
|
47
|
+
flush(): void;
|
|
48
|
+
dispose(): void;
|
|
49
|
+
_debugPending(): boolean;
|
|
50
|
+
private _describeQueued;
|
|
51
|
+
private _createTask;
|
|
52
|
+
private _beginDelivery;
|
|
53
|
+
private _runDelivery;
|
|
54
|
+
private _deferDelivery;
|
|
55
|
+
private _cancelDelivery;
|
|
56
|
+
private _finishDelivery;
|
|
57
|
+
private _appendCause;
|
|
58
|
+
private _queue;
|
|
59
|
+
private _disposeTask;
|
|
60
|
+
private _pauseTask;
|
|
61
|
+
private _resumeTask;
|
|
62
|
+
private _restoreDeliveryCausesBeforePending;
|
|
63
|
+
private _takePhase;
|
|
64
|
+
private _schedule;
|
|
65
|
+
private _scheduleDeferredTurn;
|
|
66
|
+
private _cancelScheduled;
|
|
67
|
+
private _activateDeferred;
|
|
68
|
+
private _nextFrame;
|
|
69
|
+
private _assertRetainedPhases;
|
|
70
|
+
private _assertDelivery;
|
|
71
|
+
private _hasQueued;
|
|
72
|
+
private _hasPending;
|
|
73
|
+
private _cancelAllQueued;
|
|
74
|
+
private _cancelAllDeferred;
|
|
75
|
+
private _acknowledgeDiscard;
|
|
76
|
+
private _clearPendingDelivery;
|
|
77
|
+
private _settleIdleWaiters;
|
|
78
|
+
private _assertAlive;
|
|
79
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RaphPhaseTask, RaphTaskOrderOptions } from './phase.types';
|
|
2
|
+
/**
|
|
3
|
+
* Возвращает новый массив задач в tree-order выбранной пользователем owner-плоскости.
|
|
4
|
+
* Исходный batch и persistent task identities не изменяются.
|
|
5
|
+
*/
|
|
6
|
+
export declare function orderPhaseTasks(tasks: readonly RaphPhaseTask[], options: RaphTaskOrderOptions): RaphPhaseTask[];
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { RaphMetaMutationEvent } from '../../path/meta/meta.types';
|
|
2
|
+
import { PathEvent } from '../../path/path.types';
|
|
3
|
+
import { Disposer, ReadonlySignal } from '../../reactivity/types';
|
|
4
|
+
import { RaphNode } from '../ownership/RaphNode';
|
|
5
|
+
import { RaphScope } from '../ownership/RaphScope';
|
|
6
|
+
import { RaphRuntime } from '../RaphRuntime';
|
|
7
|
+
import { RaphMetaSource } from '../reactivity/RaphMetaSource';
|
|
8
|
+
import { RaphAggregate } from '../reactivity/RaphWorkGraph';
|
|
9
|
+
export declare const RaphSchedulerType: Readonly<{
|
|
10
|
+
readonly AnimationFrame: "animationFrame";
|
|
11
|
+
readonly Microtask: "microtask";
|
|
12
|
+
readonly Sync: "sync";
|
|
13
|
+
}>;
|
|
14
|
+
export type RaphSchedulerMode = typeof RaphSchedulerType[keyof typeof RaphSchedulerType];
|
|
15
|
+
export type RaphEffectInitialMode = 'scheduled' | 'sync';
|
|
16
|
+
export type RaphWatchInitialMode = RaphEffectInitialMode | 'none';
|
|
17
|
+
export interface FrameLoopLease {
|
|
18
|
+
readonly owner: string;
|
|
19
|
+
release: () => void;
|
|
20
|
+
}
|
|
21
|
+
export interface RaphFrameContext {
|
|
22
|
+
readonly now: number;
|
|
23
|
+
readonly delta: number;
|
|
24
|
+
readonly elapsed: number;
|
|
25
|
+
readonly frame: number;
|
|
26
|
+
}
|
|
27
|
+
export interface RaphStructureCause {
|
|
28
|
+
readonly node: RaphNode;
|
|
29
|
+
readonly oldParent?: RaphNode;
|
|
30
|
+
readonly newParent?: RaphNode;
|
|
31
|
+
readonly oldIndex?: number;
|
|
32
|
+
readonly newIndex?: number;
|
|
33
|
+
}
|
|
34
|
+
export type RaphWorkCauseKind = 'producer' | 'structure' | 'path' | 'frame' | 'touch';
|
|
35
|
+
/** Одна logical причина phase delivery. Повторные причины одного source coalesce. */
|
|
36
|
+
export interface RaphWorkCause {
|
|
37
|
+
readonly kind: RaphWorkCauseKind;
|
|
38
|
+
readonly source: RaphWatchSource;
|
|
39
|
+
readonly sourceOwner?: RaphScope;
|
|
40
|
+
readonly revision: number;
|
|
41
|
+
readonly previous?: unknown;
|
|
42
|
+
readonly value?: unknown;
|
|
43
|
+
readonly structure?: RaphStructureCause;
|
|
44
|
+
readonly events?: readonly (PathEvent | RaphMetaMutationEvent)[];
|
|
45
|
+
readonly metadata?: unknown;
|
|
46
|
+
}
|
|
47
|
+
export type RaphPhaseEffect = (task: RaphPhaseTask) => void | Disposer;
|
|
48
|
+
/** Persistent task identity, передаваемая phase process и effect callback. */
|
|
49
|
+
export interface RaphPhaseTask {
|
|
50
|
+
readonly phase: string;
|
|
51
|
+
readonly consumerOwner: RaphScope;
|
|
52
|
+
readonly effect: RaphPhaseEffect;
|
|
53
|
+
readonly causes: readonly RaphWorkCause[];
|
|
54
|
+
readonly frame: RaphFrameContext;
|
|
55
|
+
readonly priority: number;
|
|
56
|
+
readonly sequence: number;
|
|
57
|
+
run: () => void;
|
|
58
|
+
defer: () => void;
|
|
59
|
+
cancel: () => void;
|
|
60
|
+
}
|
|
61
|
+
export interface RaphPhaseBatch {
|
|
62
|
+
readonly phase: string;
|
|
63
|
+
readonly frame: RaphFrameContext;
|
|
64
|
+
readonly tasks: readonly RaphPhaseTask[];
|
|
65
|
+
}
|
|
66
|
+
export interface RaphPhase {
|
|
67
|
+
readonly name: string;
|
|
68
|
+
readonly process?: (batch: RaphPhaseBatch) => void;
|
|
69
|
+
}
|
|
70
|
+
export interface RaphEffectOptions {
|
|
71
|
+
readonly initial?: RaphEffectInitialMode;
|
|
72
|
+
readonly priority?: number;
|
|
73
|
+
}
|
|
74
|
+
export type RaphWatchInclude = 'self' | 'subtree';
|
|
75
|
+
export interface RaphWatchOptions extends Omit<RaphEffectOptions, 'initial'> {
|
|
76
|
+
/** `none` creates a change-only binding without an initial delivery. */
|
|
77
|
+
readonly initial?: RaphWatchInitialMode;
|
|
78
|
+
/** Применяется только к RaphNode source; default — self. */
|
|
79
|
+
readonly include?: RaphWatchInclude;
|
|
80
|
+
}
|
|
81
|
+
export interface RaphNodeWatchSource {
|
|
82
|
+
readonly source: RaphNode;
|
|
83
|
+
readonly include: RaphWatchInclude;
|
|
84
|
+
}
|
|
85
|
+
export type RaphProducerSource = ReadonlySignal<unknown>;
|
|
86
|
+
export type RaphWatchSource = RaphProducerSource | RaphNode | RaphNodeWatchSource | RaphRuntime | RaphAggregate | RaphMetaSource;
|
|
87
|
+
export type RaphOwnerWatchSource = RaphWatchSource;
|
|
88
|
+
export type RaphAggregateSource = RaphOwnerWatchSource;
|
|
89
|
+
export interface RaphTaskOrderOptions {
|
|
90
|
+
readonly node: (task: RaphPhaseTask) => RaphNode | null | undefined;
|
|
91
|
+
readonly direction?: 'parents-first' | 'children-first';
|
|
92
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ParsedDataPath } from '
|
|
2
|
-
import { PathOptions } from '
|
|
3
|
-
import { RaphKernel } from '
|
|
4
|
-
import { RaphReactivity } from '
|
|
5
|
-
import { ReadonlySignal } from '
|
|
1
|
+
import { ParsedDataPath } from '../../path/data-path.types';
|
|
2
|
+
import { PathEvents, PathOptions } from '../../path/path.types';
|
|
3
|
+
import { RaphKernel } from '../../path/RaphKernel';
|
|
4
|
+
import { RaphReactivity } from '../../reactivity/engine';
|
|
5
|
+
import { Disposer, OwnedSourceHooks, ReadonlySignal } from '../../reactivity/types';
|
|
6
6
|
type PathSignalEngine = Pick<RaphReactivity, '_isTracking' | '_ownedSignal'>;
|
|
7
7
|
/**
|
|
8
8
|
* Реактивный handle одного canonical path в default E2 data-plane.
|
|
@@ -20,13 +20,17 @@ export declare class PathHandle<T> implements ReadonlySignal<T | undefined> {
|
|
|
20
20
|
private _assertTrackedRead;
|
|
21
21
|
private _assertWriteAllowed;
|
|
22
22
|
private _runWrite;
|
|
23
|
+
private _notifyEvents;
|
|
24
|
+
private _hasRevisionSubscribers;
|
|
23
25
|
private _stop;
|
|
26
|
+
private _activationLeases;
|
|
27
|
+
private _trackedActivation;
|
|
24
28
|
private _disposed;
|
|
25
29
|
/**
|
|
26
30
|
* Создаёт internal path handle и связывает его с runtime lifecycle.
|
|
27
31
|
* @internal
|
|
28
32
|
*/
|
|
29
|
-
constructor(store: RaphKernel, parsed: ParsedDataPath, options: PathOptions, release: (handle: PathHandle<unknown>) => void, signals: PathSignalEngine, assertOwnerAlive?: () => void, assertTrackedRead?: () => void, assertWriteAllowed?: () => void, runWrite?: <Result>(operation: () => Result) => Result);
|
|
33
|
+
constructor(store: RaphKernel, parsed: ParsedDataPath, options: PathOptions, release: (handle: PathHandle<unknown>) => void, signals: PathSignalEngine, assertOwnerAlive?: () => void, assertTrackedRead?: () => void, assertWriteAllowed?: () => void, runWrite?: <Result>(operation: () => Result) => Result, sourceHooks?: OwnedSourceHooks, notifyEvents?: (events: PathEvents, hasReactiveSubscribers: boolean) => void);
|
|
30
34
|
/**
|
|
31
35
|
* Показывает, освобождён ли path handle.
|
|
32
36
|
*/
|
|
@@ -59,13 +63,17 @@ export declare class PathHandle<T> implements ReadonlySignal<T | undefined> {
|
|
|
59
63
|
* Отсоединяет Kernel subscription и освобождает reactive revision handle.
|
|
60
64
|
*/
|
|
61
65
|
dispose(): void;
|
|
66
|
+
private _disposeNow;
|
|
62
67
|
/**
|
|
63
68
|
* Читает path с регистрацией runtime reactive dependency.
|
|
64
69
|
* @internal
|
|
65
70
|
*/
|
|
66
71
|
_getTracked(): T | undefined;
|
|
72
|
+
/** Activates the lazy Kernel observer for an explicit granular watch. @internal */
|
|
73
|
+
_activate(): Disposer;
|
|
67
74
|
private _readTracked;
|
|
68
75
|
private _observe;
|
|
76
|
+
private _releaseObserverIfIdle;
|
|
69
77
|
private _write;
|
|
70
78
|
private _assertAlive;
|
|
71
79
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { RaphMetaWatchOptions } from '../../path/meta/meta.types';
|
|
2
|
+
import { DataPathDef } from '../../path/path.types';
|
|
3
|
+
import { Disposer } from '../../reactivity/types';
|
|
4
|
+
import { RaphScope } from '../ownership/RaphScope';
|
|
5
|
+
export type RaphMetaSourceOptions = RaphMetaWatchOptions;
|
|
6
|
+
/** Immutable Runtime-owned metadata event source for explicit phase watches. */
|
|
7
|
+
export declare class RaphMetaSource {
|
|
8
|
+
readonly owner: RaphScope;
|
|
9
|
+
private _start;
|
|
10
|
+
private _release;
|
|
11
|
+
readonly masks: DataPathDef | readonly DataPathDef[];
|
|
12
|
+
readonly options: Readonly<RaphMetaSourceOptions>;
|
|
13
|
+
private _stop;
|
|
14
|
+
private _activationLeases;
|
|
15
|
+
private _disposed;
|
|
16
|
+
private _releaseOwner;
|
|
17
|
+
/** @internal */
|
|
18
|
+
private constructor();
|
|
19
|
+
/** @internal */
|
|
20
|
+
static _create(owner: RaphScope, masks: DataPathDef | readonly DataPathDef[], options: RaphMetaSourceOptions, start: () => Disposer, release: () => void): RaphMetaSource;
|
|
21
|
+
get runtime(): import('../RaphRuntime').RaphRuntime;
|
|
22
|
+
get disposed(): boolean;
|
|
23
|
+
dispose(): void;
|
|
24
|
+
/** @internal */
|
|
25
|
+
_bindOwner(release: Disposer): void;
|
|
26
|
+
/** @internal */
|
|
27
|
+
_disposeOwned(): void;
|
|
28
|
+
/** @internal */
|
|
29
|
+
_activate(): Disposer;
|
|
30
|
+
/** @internal */
|
|
31
|
+
_assertAlive(): void;
|
|
32
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { Disposer, OwnedSourceHooks } from '../../reactivity/types';
|
|
2
|
+
import { RaphNode } from '../ownership/RaphNode';
|
|
3
|
+
import { RaphScope } from '../ownership/RaphScope';
|
|
4
|
+
import { RaphAggregateSource, RaphStructureCause, RaphWatchInclude, RaphWatchSource, RaphWorkCause, RaphWorkCauseKind } from '../phases/phase.types';
|
|
5
|
+
import { RaphRuntime } from '../RaphRuntime';
|
|
6
|
+
type WorkSink = (cause: RaphWorkCause, key: object, schedule: boolean) => void;
|
|
7
|
+
type WorkEdgeSource = RaphProducerRecord | RaphNode | RaphRuntime;
|
|
8
|
+
interface WorkEdge {
|
|
9
|
+
readonly sink: WorkSink;
|
|
10
|
+
readonly kind: 'producer' | 'runtime' | 'self' | 'subtree';
|
|
11
|
+
source?: WorkEdgeSource;
|
|
12
|
+
activationRelease?: Disposer;
|
|
13
|
+
previous?: WorkEdge;
|
|
14
|
+
next?: WorkEdge;
|
|
15
|
+
}
|
|
16
|
+
interface WorkEdgeList {
|
|
17
|
+
first?: WorkEdge;
|
|
18
|
+
last?: WorkEdge;
|
|
19
|
+
}
|
|
20
|
+
type CleanupSource = RaphProducerRecord | RaphNode | RaphAggregate;
|
|
21
|
+
interface CleanupEdge {
|
|
22
|
+
cleanup?: () => void;
|
|
23
|
+
source?: CleanupSource;
|
|
24
|
+
previous?: CleanupEdge;
|
|
25
|
+
next?: CleanupEdge;
|
|
26
|
+
}
|
|
27
|
+
interface CleanupEdgeList {
|
|
28
|
+
first?: CleanupEdge;
|
|
29
|
+
last?: CleanupEdge;
|
|
30
|
+
}
|
|
31
|
+
interface AggregateSubscription {
|
|
32
|
+
dispose?: (finalCause?: RaphWorkCause) => void;
|
|
33
|
+
aggregate?: RaphAggregate;
|
|
34
|
+
previous?: AggregateSubscription;
|
|
35
|
+
next?: AggregateSubscription;
|
|
36
|
+
}
|
|
37
|
+
interface ProducerOptions {
|
|
38
|
+
readonly includeRuntime?: boolean;
|
|
39
|
+
}
|
|
40
|
+
declare const PRODUCER_RECORD: unique symbol;
|
|
41
|
+
/** @internal */
|
|
42
|
+
export interface RaphProducerRecord {
|
|
43
|
+
readonly [PRODUCER_RECORD]: true;
|
|
44
|
+
readonly runtime: RaphRuntime;
|
|
45
|
+
readonly owner: RaphScope;
|
|
46
|
+
readonly kind: Extract<RaphWorkCauseKind, 'frame' | 'path' | 'producer'>;
|
|
47
|
+
readonly includeRuntime: boolean;
|
|
48
|
+
subscribers?: WorkEdgeList;
|
|
49
|
+
memberships?: CleanupEdgeList;
|
|
50
|
+
implicitConsumers?: Map<RaphNode, number>;
|
|
51
|
+
alias?: object;
|
|
52
|
+
source?: RaphWatchSource;
|
|
53
|
+
activate?: () => void | Disposer;
|
|
54
|
+
runtimeActivation?: Disposer;
|
|
55
|
+
lastCause?: RaphWorkCause;
|
|
56
|
+
transientNext?: RaphProducerRecord;
|
|
57
|
+
revision: number;
|
|
58
|
+
disposed: boolean;
|
|
59
|
+
}
|
|
60
|
+
/** Immutable explicit group of granular sources owned by one Runtime scope. */
|
|
61
|
+
export declare class RaphAggregate {
|
|
62
|
+
readonly owner: RaphScope;
|
|
63
|
+
private _sources;
|
|
64
|
+
private _disposed;
|
|
65
|
+
private _releaseOwner;
|
|
66
|
+
private _memberReleases;
|
|
67
|
+
private _firstSubscription;
|
|
68
|
+
private _lastSubscription;
|
|
69
|
+
private _firstDependent;
|
|
70
|
+
private _lastDependent;
|
|
71
|
+
private _revision;
|
|
72
|
+
private _finalCause;
|
|
73
|
+
/** @internal */
|
|
74
|
+
private constructor();
|
|
75
|
+
/** @internal */
|
|
76
|
+
static _create(owner: RaphScope, sources: readonly RaphAggregateSource[]): RaphAggregate;
|
|
77
|
+
get runtime(): RaphRuntime;
|
|
78
|
+
get disposed(): boolean;
|
|
79
|
+
get sources(): readonly RaphAggregateSource[];
|
|
80
|
+
dispose(): void;
|
|
81
|
+
/** @internal */
|
|
82
|
+
_assertAlive(): void;
|
|
83
|
+
/** @internal */
|
|
84
|
+
_bindOwner(release: () => void): void;
|
|
85
|
+
/** @internal */
|
|
86
|
+
_bindMembers(releases: Array<() => void>): void;
|
|
87
|
+
/** @internal */
|
|
88
|
+
_removeMember(identity: object): void;
|
|
89
|
+
/** @internal */
|
|
90
|
+
_disposeOwned(): void;
|
|
91
|
+
/** @internal */
|
|
92
|
+
_linkSubscription(dispose: (finalCause?: RaphWorkCause) => void): () => void;
|
|
93
|
+
/** @internal */
|
|
94
|
+
_linkDependent(edge: CleanupEdge): void;
|
|
95
|
+
/** @internal */
|
|
96
|
+
_detachDependent(edge: CleanupEdge): void;
|
|
97
|
+
/** @internal */
|
|
98
|
+
_disposalCause(): RaphWorkCause;
|
|
99
|
+
/** @internal */
|
|
100
|
+
_detachSubscription(subscription: AggregateSubscription): void;
|
|
101
|
+
}
|
|
102
|
+
/** Runtime-only intrusive indexes for granular sources. */
|
|
103
|
+
export declare class RaphWorkGraph {
|
|
104
|
+
private readonly _runtime;
|
|
105
|
+
private _selfSubscribers;
|
|
106
|
+
private _subtreeSubscribers;
|
|
107
|
+
private _runtimeSubscribers;
|
|
108
|
+
private _runtimeSubscriberCount;
|
|
109
|
+
private _runtimeActivationProducers;
|
|
110
|
+
private _nodeMemberships;
|
|
111
|
+
private _nodeRevisions;
|
|
112
|
+
private _nodeTouchKeys;
|
|
113
|
+
private _implicitProducers;
|
|
114
|
+
private _transientProducers;
|
|
115
|
+
private _dispatchDepth;
|
|
116
|
+
private _detachedEdges;
|
|
117
|
+
private _disposed;
|
|
118
|
+
constructor(_runtime: RaphRuntime);
|
|
119
|
+
createProducer(owner: RaphScope, kind?: RaphProducerRecord['kind'], options?: ProducerOptions): RaphProducerRecord;
|
|
120
|
+
attachProducer<T extends object>(record: RaphProducerRecord, source: T): T;
|
|
121
|
+
setProducerActivation(record: RaphProducerRecord, activate: () => void | Disposer, activateForRuntime?: boolean): void;
|
|
122
|
+
producerHooks(record: RaphProducerRecord): OwnedSourceHooks;
|
|
123
|
+
causeForToken(token: unknown): RaphWorkCause | undefined;
|
|
124
|
+
/** Clears mutation-local payloads after engine propagation consumed them. */
|
|
125
|
+
clearTransientCauses(): void;
|
|
126
|
+
notifyProducer(record: RaphProducerRecord, previous?: unknown, value?: unknown, events?: RaphWorkCause['events'], schedule?: boolean, hasReactiveSubscribers?: boolean, includeValues?: boolean): void;
|
|
127
|
+
notifyProducerEvents(record: RaphProducerRecord, events: NonNullable<RaphWorkCause['events']>, schedule?: boolean, hasReactiveSubscribers?: boolean): void;
|
|
128
|
+
notifyNode(node: RaphNode, kind: Extract<RaphWorkCauseKind, 'structure' | 'touch'>, options?: {
|
|
129
|
+
readonly metadata?: unknown;
|
|
130
|
+
readonly structure?: RaphStructureCause;
|
|
131
|
+
readonly oldAncestors?: readonly RaphNode[];
|
|
132
|
+
readonly newAncestors?: readonly RaphNode[];
|
|
133
|
+
}): void;
|
|
134
|
+
createAggregate(owner: RaphScope, sources: readonly RaphAggregateSource[]): RaphAggregate;
|
|
135
|
+
subscribe(input: RaphWatchSource, include: RaphWatchInclude | undefined, sink: WorkSink): () => void;
|
|
136
|
+
assertSubscriptionAllowed(consumer: RaphScope, input: RaphWatchSource): void;
|
|
137
|
+
/** Rejects a move that would make an existing implicit reactive edge illegal. */
|
|
138
|
+
assertReparentAllowed(node: RaphNode, newParent: RaphNode): void;
|
|
139
|
+
releaseNode(node: RaphNode): void;
|
|
140
|
+
dispose(): void;
|
|
141
|
+
private _disposeProducer;
|
|
142
|
+
private _dispatchProducer;
|
|
143
|
+
private _dispatchProducerLazily;
|
|
144
|
+
private _createProducerCause;
|
|
145
|
+
private _retainRuntimeSubscriber;
|
|
146
|
+
private _releaseRuntimeSubscriber;
|
|
147
|
+
private _releaseRuntimeActivations;
|
|
148
|
+
private _linkImplicitDependency;
|
|
149
|
+
private _subscribeOne;
|
|
150
|
+
private _subscribeNode;
|
|
151
|
+
private _createNodeEdgeRelease;
|
|
152
|
+
private _linkSourceCleanup;
|
|
153
|
+
private _detachCleanupEdge;
|
|
154
|
+
private _releaseCleanupList;
|
|
155
|
+
private _validateAggregateSources;
|
|
156
|
+
private _assertSourceVisibleTo;
|
|
157
|
+
private _assertProvisionalOwnerAccess;
|
|
158
|
+
private _dispatch;
|
|
159
|
+
private _appendWorkEdge;
|
|
160
|
+
private _detachWorkEdge;
|
|
161
|
+
private _releaseWorkList;
|
|
162
|
+
private _releaseGranule;
|
|
163
|
+
private _setTransientCause;
|
|
164
|
+
private _producerHasDemand;
|
|
165
|
+
private _nodeTouchKey;
|
|
166
|
+
private _nodeHasDemand;
|
|
167
|
+
private _assertOwner;
|
|
168
|
+
private _assertRuntime;
|
|
169
|
+
private _assertAlive;
|
|
170
|
+
}
|
|
171
|
+
export {};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { RaphEffectInitialMode } from './phase.types';
|
|
1
|
+
import { OwnedSourceHooks, ReactivityOptions, ReadonlySignal, Signal } from '../../reactivity/types';
|
|
2
|
+
import { RaphScope } from '../ownership/RaphScope';
|
|
4
3
|
import { RuntimeEffectBinding, RuntimeSignalLifecycle } from './runtime-reactivity.types';
|
|
5
|
-
import { RaphReactivity } from '
|
|
4
|
+
import { RaphReactivity } from '../../reactivity/engine';
|
|
6
5
|
/**
|
|
7
6
|
* Внутренний policy adapter, наследующий реактивные алгоритмы без дублирования.
|
|
8
7
|
*/
|
|
@@ -12,11 +11,11 @@ export declare class RuntimeReactivity extends RaphReactivity {
|
|
|
12
11
|
/**
|
|
13
12
|
* Создаёт policy adapter реактивного графа для одного runtime.
|
|
14
13
|
*/
|
|
15
|
-
constructor(_lifecycle: RuntimeSignalLifecycle);
|
|
14
|
+
constructor(_lifecycle: RuntimeSignalLifecycle, options?: Pick<ReactivityOptions, 'adaptiveDependencyIndex'>);
|
|
16
15
|
/**
|
|
17
16
|
* Создаёт временную registration boundary для runtime effect.
|
|
18
17
|
*/
|
|
19
|
-
withEffectBinding<T>(binding: RuntimeEffectBinding | undefined,
|
|
18
|
+
withEffectBinding<T>(binding: RuntimeEffectBinding | undefined, operation: () => T): T;
|
|
20
19
|
/**
|
|
21
20
|
* Выполняет untracked-операцию, сохраняя runtime owner context.
|
|
22
21
|
*/
|
|
@@ -25,16 +24,22 @@ export declare class RuntimeReactivity extends RaphReactivity {
|
|
|
25
24
|
* Возвращает owner текущего синхронного реактивного контекста.
|
|
26
25
|
*/
|
|
27
26
|
getActiveOwner(): object | undefined;
|
|
27
|
+
/** Returns the Runtime resource owner whose implicit dependencies are being collected. */
|
|
28
|
+
getActiveConsumerOwner(): RaphScope | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Сообщает, должен ли untracked work очищать graph consumer или Runtime owner context.
|
|
31
|
+
*/
|
|
32
|
+
hasActiveContext(): boolean;
|
|
28
33
|
/**
|
|
29
34
|
* Выполняет операцию с указанным active owner.
|
|
30
35
|
*/
|
|
31
|
-
runWithOwner<T>(lifecycle: RuntimeSignalLifecycle | undefined, operation: () => T): T;
|
|
36
|
+
runWithOwner<T>(lifecycle: RuntimeSignalLifecycle | undefined, consumerOwner: RaphScope | undefined, operation: () => T): T;
|
|
32
37
|
/**
|
|
33
38
|
* Создаёт owned signal с runtime lifecycle policy.
|
|
34
39
|
*/
|
|
35
|
-
signalForOwner<T>(initialValue: T, owner?:
|
|
40
|
+
signalForOwner<T>(initialValue: T, owner: RaphScope, sourceHooks?: OwnedSourceHooks, captureWriteInBoundary?: (write: (value: T) => void) => void): Signal<T>;
|
|
36
41
|
/**
|
|
37
42
|
* Создаёт owned computed с runtime lifecycle policy.
|
|
38
43
|
*/
|
|
39
|
-
computedForOwner<T>(getter: () => T, owner?:
|
|
44
|
+
computedForOwner<T>(getter: () => T, owner: RaphScope, sourceHooks?: OwnedSourceHooks): ReadonlySignal<T>;
|
|
40
45
|
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { Disposer } from '
|
|
1
|
+
import { Disposer } from '../../reactivity/types';
|
|
2
2
|
/**
|
|
3
3
|
* Хранит общий callback/cleanup lifecycle Runtime-watch без знания источника
|
|
4
4
|
* событий. Регистрация в Kernel и фазовая доставка остаются у Runtime.
|
|
5
5
|
*/
|
|
6
6
|
export declare class RuntimeWatch {
|
|
7
7
|
private readonly _runUntracked;
|
|
8
|
+
private readonly _callback;
|
|
8
9
|
private _cleanup;
|
|
9
10
|
private _stopped;
|
|
10
11
|
/**
|
|
11
12
|
* Создаёт runtime-owned watch с явным lifecycle остановки.
|
|
12
13
|
*/
|
|
13
|
-
constructor(_runUntracked: <T>(operation: () => T) => T);
|
|
14
|
+
constructor(_runUntracked: <T>(operation: () => T) => T, _callback: () => void | Disposer);
|
|
14
15
|
/**
|
|
15
16
|
* Показывает, остановлен ли watch.
|
|
16
17
|
*/
|
|
@@ -19,7 +20,12 @@ export declare class RuntimeWatch {
|
|
|
19
20
|
* Освобождает предыдущий результат callback и выполняет новую доставку.
|
|
20
21
|
* Ошибка cleanup не лишает живой watcher текущего события.
|
|
21
22
|
*/
|
|
22
|
-
deliver
|
|
23
|
+
readonly deliver: () => void;
|
|
24
|
+
/**
|
|
25
|
+
* Preserves cleanup/callback error aggregation and reentrant stop semantics
|
|
26
|
+
* for the less common resource-returning callback path.
|
|
27
|
+
*/
|
|
28
|
+
private _deliverWithCleanup;
|
|
23
29
|
/**
|
|
24
30
|
* Останавливает внешнюю регистрацию и cleanup callback, сохраняя обе ошибки.
|
|
25
31
|
*/
|
package/dist/runtime/{runtime-reactivity.types.d.ts → reactivity/runtime-reactivity.types.d.ts}
RENAMED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { EffectTask } from '
|
|
1
|
+
import { EffectTask } from '../../reactivity/types';
|
|
2
|
+
import { RaphScope } from '../ownership/RaphScope';
|
|
2
3
|
export interface RuntimeSignalLifecycle {
|
|
3
4
|
owner: object | undefined;
|
|
4
5
|
assertWriteAllowed?: () => void;
|
|
5
6
|
runWrite?: <T>(operation: () => T) => T;
|
|
7
|
+
assertDependencyAllowed: (sourceOwner: RaphScope, consumerOwner: RaphScope) => void;
|
|
6
8
|
throwDisposed: () => never;
|
|
7
9
|
throwCrossRuntime: (owner: object) => never;
|
|
8
10
|
}
|
package/dist/runtime.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./debug/runtime/errors.cjs"),r=require("./debug/runtime/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./debug/runtime/errors.cjs"),r=require("./debug/runtime/ownership/parentGraph.cjs"),a=require("./debug/runtime/ownership/RaphEffectScope.cjs"),p=require("./debug/runtime/ownership/RaphNode.cjs"),o=require("./debug/runtime/ownership/RaphScope.cjs"),s=require("./debug/runtime/phases/orderPhaseTasks.cjs"),t=require("./debug/runtime/phases/phase.types.cjs"),h=require("./debug/runtime/RaphRuntime.cjs"),n=require("./debug/runtime/reactivity/PathHandle.cjs");exports.RaphActionError=e.RaphActionError;exports.RaphCrossRuntimeError=e.RaphCrossRuntimeError;exports.RaphDisposedError=e.RaphDisposedError;exports.RaphPhaseProcessError=e.RaphPhaseProcessError;exports.parentGraph=r.parentGraph;exports.RaphEffectScope=a.RaphEffectScope;exports.RaphNode=p.RaphNode;exports.RaphScope=o.RaphScope;exports.orderPhaseTasks=s.orderPhaseTasks;exports.RaphSchedulerType=t.RaphSchedulerType;exports.RaphRuntime=h.RaphRuntime;exports.PathHandle=n.PathHandle;
|