@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
package/dist/raph.js
CHANGED
|
@@ -1,40 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { RaphSchedulerType as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
1
|
+
import { RaphCapabilityError as e, RaphConfigurationError as p, RaphDefaultInstanceError as a, RaphError as t, RaphFacadeDisposedError as h } from "./debug/api/errors.js";
|
|
2
|
+
import { Raph as R } from "./debug/api/Raph.js";
|
|
3
|
+
import { RaphReactivityInstance as x } from "./debug/api/RaphReactivityInstance.js";
|
|
4
|
+
import { RaphActionError as n, RaphCrossRuntimeError as s, RaphDisposedError as c, RaphPhaseProcessError as l } from "./debug/runtime/errors.js";
|
|
5
|
+
import { parentGraph as E } from "./debug/runtime/ownership/parentGraph.js";
|
|
6
|
+
import { RaphEffectScope as u } from "./debug/runtime/ownership/RaphEffectScope.js";
|
|
7
|
+
import { RaphNode as P } from "./debug/runtime/ownership/RaphNode.js";
|
|
8
|
+
import { RaphScope as C } from "./debug/runtime/ownership/RaphScope.js";
|
|
9
|
+
import { orderPhaseTasks as S } from "./debug/runtime/phases/orderPhaseTasks.js";
|
|
10
|
+
import { RaphSchedulerType as g } from "./debug/runtime/phases/phase.types.js";
|
|
11
|
+
import { RaphRuntime as B } from "./debug/runtime/RaphRuntime.js";
|
|
12
|
+
import { PathHandle as I } from "./debug/runtime/reactivity/PathHandle.js";
|
|
13
|
+
import { DataPath as k } from "./debug/path/DataPath.js";
|
|
14
|
+
import { collectionByKey as G, filterByKey as M, full as N } from "./debug/path/derived/derived-strategy.utils.js";
|
|
15
|
+
import { RaphDerivedHandle as j, RaphDerivedTargetWriteError as q } from "./debug/path/derived/RaphDerivedHandle.js";
|
|
16
|
+
import { RaphMeta as z } from "./debug/path/meta/RaphMeta.js";
|
|
17
|
+
import { RaphKernel as L } from "./debug/path/RaphKernel.js";
|
|
18
|
+
import { DefaultDataAdapter as Q } from "./debug/path/storage/DefaultDataAdapter.js";
|
|
16
19
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
20
|
+
k as DataPath,
|
|
21
|
+
Q as DefaultDataAdapter,
|
|
22
|
+
I as PathHandle,
|
|
23
|
+
R as Raph,
|
|
24
|
+
n as RaphActionError,
|
|
25
|
+
e as RaphCapabilityError,
|
|
26
|
+
p as RaphConfigurationError,
|
|
27
|
+
s as RaphCrossRuntimeError,
|
|
28
|
+
a as RaphDefaultInstanceError,
|
|
29
|
+
j as RaphDerivedHandle,
|
|
30
|
+
q as RaphDerivedTargetWriteError,
|
|
31
|
+
c as RaphDisposedError,
|
|
32
|
+
u as RaphEffectScope,
|
|
33
|
+
t as RaphError,
|
|
34
|
+
h as RaphFacadeDisposedError,
|
|
35
|
+
L as RaphKernel,
|
|
36
|
+
z as RaphMeta,
|
|
37
|
+
P as RaphNode,
|
|
38
|
+
l as RaphPhaseProcessError,
|
|
39
|
+
x as RaphReactivityInstance,
|
|
40
|
+
B as RaphRuntime,
|
|
41
|
+
g as RaphSchedulerType,
|
|
42
|
+
C as RaphScope,
|
|
43
|
+
G as collectionByKey,
|
|
44
|
+
M as filterByKey,
|
|
45
|
+
N as full,
|
|
46
|
+
S as orderPhaseTasks,
|
|
47
|
+
E as parentGraph
|
|
40
48
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComputedAccessHandle, Disposer, EffectCallback, EffectFactory, OwnedSource, ReactivityOptions, ReadonlySignal, Signal, SignalAccess, WatchCallback, WatchOptions, WatchSource, WritableComputedOptions } from './types';
|
|
1
|
+
import { ComputedAccessHandle, Disposer, EffectCallback, EffectFactory, OwnedSource, OwnedSourceHooks, ReactivityOptions, ReadonlySignal, Signal, SignalAccess, WatchCallback, WatchOptions, WatchSource, WritableComputedOptions } from './types';
|
|
2
2
|
import { ScopeNode } from './scope';
|
|
3
3
|
export { ScopeNode } from './scope';
|
|
4
4
|
export type { Disposer, EffectCallback, EffectScheduler, EffectTask, ReactivityOptions, ReadonlySignal, Signal, WatchCallback, WatchOptions, WatchSource, WatchValue, WritableComputedOptions, } from './types';
|
|
@@ -9,6 +9,7 @@ export type { Disposer, EffectCallback, EffectScheduler, EffectTask, ReactivityO
|
|
|
9
9
|
* синхронного движка не проверяет внешнюю политику на каждом эффекте.
|
|
10
10
|
*/
|
|
11
11
|
export declare class RaphReactivity {
|
|
12
|
+
private readonly adaptiveDependencyIndex;
|
|
12
13
|
private activeSub;
|
|
13
14
|
private batchDepth;
|
|
14
15
|
private effectReadIndex;
|
|
@@ -41,6 +42,11 @@ export declare class RaphReactivity {
|
|
|
41
42
|
* а peek() выполняет чтение с временно отключённым отслеживанием.
|
|
42
43
|
*/
|
|
43
44
|
signal<T>(initialValue: T): Signal<T>;
|
|
45
|
+
/**
|
|
46
|
+
* Возвращает стабильный глубокий Proxy для plain object или array.
|
|
47
|
+
* Object context и per-property sources создаются лениво внутри этого engine.
|
|
48
|
+
*/
|
|
49
|
+
reactive<T extends object>(value: T): T;
|
|
44
50
|
/**
|
|
45
51
|
* - `(1)` Создаёт ленивое вычисляемое значение только для чтения;
|
|
46
52
|
* - `(2)` Создаёт writable computed, сохраняя исходную функцию setter;
|
|
@@ -85,6 +91,8 @@ export declare class RaphReactivity {
|
|
|
85
91
|
* Поля внешней задачи и окончательной очистки добавляются только при необходимости.
|
|
86
92
|
*/
|
|
87
93
|
private allocateGraphRecord;
|
|
94
|
+
/** Creates a narrow Proxy adapter over the existing intrusive graph. */
|
|
95
|
+
private createReactivePropertySourceBridge;
|
|
88
96
|
/**
|
|
89
97
|
* Материализует signal в графе при первом отслеживаемом чтении
|
|
90
98
|
* и связывает его с активным потребителем.
|
|
@@ -184,6 +192,8 @@ export declare class RaphReactivity {
|
|
|
184
192
|
* Также исправляет курсор поиска, если он указывал на удаляемую связь.
|
|
185
193
|
*/
|
|
186
194
|
private detachSubLink;
|
|
195
|
+
/** Connects Runtime ownership metadata only for edges whose producer opted in. */
|
|
196
|
+
private attachDependencyCleanup;
|
|
187
197
|
/**
|
|
188
198
|
* Отсоединяет owned-источник сразу с обеих сторон каждой связи.
|
|
189
199
|
* Вызывается на границе lifetime, а не при обычных чтениях и записях.
|
|
@@ -240,6 +250,8 @@ export declare class RaphReactivity {
|
|
|
240
250
|
* узлов текущего прохода; порядок успешного обхода не меняется.
|
|
241
251
|
*/
|
|
242
252
|
private refreshDependencies;
|
|
253
|
+
/** Settles every direct dependency so a cancelled external delivery can be re-armed. */
|
|
254
|
+
private settleCancelledDependencies;
|
|
243
255
|
/**
|
|
244
256
|
* Выполняет исходный итеративный обход зависимостей без обработки ошибок внутри цикла.
|
|
245
257
|
* Перед пользовательским вычислением публикует активную высоту стека; оболочка
|
|
@@ -290,6 +302,7 @@ export declare class RaphReactivity {
|
|
|
290
302
|
* чтобы последующая запись могла снова запросить выполнение.
|
|
291
303
|
*/
|
|
292
304
|
private requestEffectTask;
|
|
305
|
+
private scheduleEffectTask;
|
|
293
306
|
/**
|
|
294
307
|
* Окончательно останавливает эффект и освобождает все принадлежащие ему ресурсы.
|
|
295
308
|
* Сначала делает узел неактивным и отсоединяет связи, затем отменяет задачу,
|
|
@@ -339,13 +352,13 @@ export declare class RaphReactivity {
|
|
|
339
352
|
*
|
|
340
353
|
* @internal
|
|
341
354
|
*/
|
|
342
|
-
_ownedSignal<T>(initialValue: T): OwnedSource<Signal<T>>;
|
|
355
|
+
_ownedSignal<T>(initialValue: T, sourceHooks?: OwnedSourceHooks): OwnedSource<Signal<T>>;
|
|
343
356
|
/**
|
|
344
357
|
* Создаёт ленивый computed с финализатором исходящих и входящих связей.
|
|
345
358
|
* Финализатор работает и до первого вычисления, не материализуя узел ради очистки.
|
|
346
359
|
* @internal
|
|
347
360
|
*/
|
|
348
|
-
_ownedComputed<T>(fn: () => T): OwnedSource<ReadonlySignal<T>>;
|
|
361
|
+
_ownedComputed<T>(fn: () => T, sourceHooks?: OwnedSourceHooks): OwnedSource<ReadonlySignal<T>>;
|
|
349
362
|
/**
|
|
350
363
|
* Открывает вложенную синхронную границу группировки.
|
|
351
364
|
* Внутренний вызывающий код обязан выполнить соответствующий endBatch().
|
|
@@ -370,6 +383,7 @@ export declare class RaphReactivity {
|
|
|
370
383
|
_isFlushingEffects(): boolean;
|
|
371
384
|
}
|
|
372
385
|
export declare const signal: RaphReactivity['signal'];
|
|
386
|
+
export declare const reactive: RaphReactivity['reactive'];
|
|
373
387
|
export declare function computed<T>(getter: () => T): ReadonlySignal<T>;
|
|
374
388
|
export declare function computed<T>(options: WritableComputedOptions<T>): Signal<T>;
|
|
375
389
|
export declare const effect: RaphReactivity['effect'];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Opaque per-property producer used by the reactive-object adapter.
|
|
3
|
+
* The concrete record belongs to RaphReactivity's existing intrusive graph.
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export type ReactivePropertySource = object;
|
|
7
|
+
/**
|
|
8
|
+
* The only bridge between Proxy bookkeeping and the reactive graph internals.
|
|
9
|
+
* It deliberately exposes operations instead of graph fields or subclass hooks.
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export interface ReactivePropertySourceBridge {
|
|
13
|
+
readonly batch: <T>(operation: () => T) => T;
|
|
14
|
+
readonly create: () => ReactivePropertySource;
|
|
15
|
+
readonly isTracking: () => boolean;
|
|
16
|
+
readonly track: (source: ReactivePropertySource) => void;
|
|
17
|
+
readonly trigger: (source: ReactivePropertySource) => void;
|
|
18
|
+
}
|
|
19
|
+
/** Runtime policy installed for one RuntimeReactivity instance. @internal */
|
|
20
|
+
export interface ReactiveObjectPolicy {
|
|
21
|
+
readonly owner?: object;
|
|
22
|
+
readonly assertRead?: () => void;
|
|
23
|
+
readonly assertWrite?: () => void;
|
|
24
|
+
readonly runWrite?: <T>(operation: () => T) => T;
|
|
25
|
+
readonly throwForeign?: (owner: object | undefined) => never;
|
|
26
|
+
}
|
|
27
|
+
/** Associates Runtime lifecycle policy with an engine without widening its public class API. @internal */
|
|
28
|
+
export declare function configureReactiveObjectPolicy(engine: object, policy: ReactiveObjectPolicy): void;
|
|
29
|
+
/** Releases a Runtime-owned context while retained proxies become inert handles. @internal */
|
|
30
|
+
export declare function disposeReactiveObjectContext(engine: object, disposedPolicy?: ReactiveObjectPolicy): void;
|
|
31
|
+
/**
|
|
32
|
+
* Returns one stable Proxy per raw object inside one RaphReactivity instance.
|
|
33
|
+
* The context and both WeakMaps are allocated only after the first call.
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
export declare function reactiveObject<T extends object>(engine: object, value: T, createBridge: () => ReactivePropertySourceBridge): T;
|
|
@@ -12,6 +12,11 @@ export interface WritableComputedOptions<T> {
|
|
|
12
12
|
}
|
|
13
13
|
export type EffectCallback = () => void | Disposer;
|
|
14
14
|
export interface EffectTask {
|
|
15
|
+
dependencyOwner?: object;
|
|
16
|
+
allowScheduleDuringRun?: boolean;
|
|
17
|
+
notify?: (source: unknown) => void;
|
|
18
|
+
cancelPending?: () => boolean;
|
|
19
|
+
rearmPending?: () => void;
|
|
15
20
|
schedule: () => void;
|
|
16
21
|
dispose: Disposer;
|
|
17
22
|
}
|
|
@@ -19,6 +24,7 @@ export interface EffectScheduler {
|
|
|
19
24
|
bind: (run: () => void) => EffectTask;
|
|
20
25
|
}
|
|
21
26
|
export interface ReactivityOptions {
|
|
27
|
+
readonly adaptiveDependencyIndex?: boolean;
|
|
22
28
|
readonly effectScheduler?: EffectScheduler;
|
|
23
29
|
}
|
|
24
30
|
export type WatchSource<T = unknown> = ReadonlySignal<T> | (() => T);
|
|
@@ -76,6 +82,7 @@ export interface ReactiveEdge {
|
|
|
76
82
|
nextSub: ReactiveEdge | null;
|
|
77
83
|
prevDep: ReactiveEdge | null;
|
|
78
84
|
nextDep: ReactiveEdge | null;
|
|
85
|
+
dependencyCleanup?: Disposer;
|
|
79
86
|
}
|
|
80
87
|
/**
|
|
81
88
|
* Материализованная запись графа: signal, computed либо effect.
|
|
@@ -91,12 +98,16 @@ export interface ReactiveNode<T = any> extends ScopeChildren<ReactiveNode>, Scop
|
|
|
91
98
|
tailDep: ReactiveEdge | null;
|
|
92
99
|
depCount: number;
|
|
93
100
|
subSearchCursor?: ReactiveEdge;
|
|
101
|
+
dependencyIndex?: Map<ReactiveNode, ReactiveEdge>;
|
|
102
|
+
dependencyLookupDebt?: number;
|
|
103
|
+
dependencyLookupSearches?: number;
|
|
94
104
|
evaluate: (() => any) | undefined;
|
|
95
105
|
cachedValue: T;
|
|
96
106
|
pendingValue?: T;
|
|
97
107
|
pendingAuthor?: ReactiveNode | null;
|
|
98
108
|
effectTask?: EffectTask;
|
|
99
109
|
onStop?: Disposer;
|
|
110
|
+
sourceHooks?: OwnedSourceHooks;
|
|
100
111
|
}
|
|
101
112
|
/**
|
|
102
113
|
* Низкоуровневые read/write для raw-дорожки Bench Lab.
|
|
@@ -136,8 +147,22 @@ export interface ComputedSourceAccessHandle<T> extends Partial<ReactiveNode<T>>,
|
|
|
136
147
|
*/
|
|
137
148
|
export interface OwnedSource<T> {
|
|
138
149
|
source: T;
|
|
150
|
+
hasSubscribers?: () => boolean;
|
|
139
151
|
dispose: SourceFinalizer;
|
|
140
152
|
}
|
|
153
|
+
/**
|
|
154
|
+
* Необязательные Runtime hooks owned-источника. Standalone sources не передают
|
|
155
|
+
* этот объект и сохраняют прежний hot path без ownership metadata.
|
|
156
|
+
* @internal
|
|
157
|
+
*/
|
|
158
|
+
export interface OwnedSourceHooks {
|
|
159
|
+
readonly token?: unknown;
|
|
160
|
+
readonly dependencyOwner?: object;
|
|
161
|
+
readonly onDependency?: (consumerOwner: object) => Disposer | undefined;
|
|
162
|
+
readonly onChange?: (previous: unknown, value: unknown, hasReactiveSubscribers: boolean) => void;
|
|
163
|
+
readonly onInvalidate?: (hasReactiveSubscribers: boolean) => void;
|
|
164
|
+
readonly onDispose?: (hasReactiveSubscribers: boolean) => void;
|
|
165
|
+
}
|
|
141
166
|
/**
|
|
142
167
|
* Общие для одного графа адаптеры receiver его handles.
|
|
143
168
|
* Не хранят состояние алгоритмов: передают исходный handle методам движка.
|
package/dist/reactivity.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./debug/reactivity/engine.cjs"),t=require("./debug/reactivity/scope.cjs");exports.RaphReactivity=e.RaphReactivity;exports.batch=e.batch;exports.computed=e.computed;exports.effect=e.effect;exports.reactive=e.reactive;exports.scope=e.scope;exports.signal=e.signal;exports.untracked=e.untracked;exports.watch=e.watch;exports.ScopeNode=t.ScopeNode;
|
package/dist/reactivity.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./debug/reactivity/
|
|
3
|
-
import { RaphReactivity as a, batch as r, computed as f, effect as i, scope as m, signal as d, untracked as h, watch as n } from "./debug/reactivity/engine.js";
|
|
1
|
+
import { RaphReactivity as c, batch as o, computed as a, effect as p, reactive as r, scope as f, signal as i, untracked as d, watch as h } from "./debug/reactivity/engine.js";
|
|
2
|
+
import { ScopeNode as n } from "./debug/reactivity/scope.js";
|
|
4
3
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
c as RaphReactivity,
|
|
5
|
+
n as ScopeNode,
|
|
6
|
+
o as batch,
|
|
7
|
+
a as computed,
|
|
8
|
+
p as effect,
|
|
9
|
+
r as reactive,
|
|
10
|
+
f as scope,
|
|
11
|
+
i as signal,
|
|
12
|
+
d as untracked,
|
|
13
|
+
h as watch
|
|
14
14
|
};
|