@ersbeth/picoflow 2.0.2 → 2.1.0
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/LICENSE +21 -0
- package/README.md +25 -0
- package/SKILL.md +106 -0
- package/dist/picoflow.js +204 -60
- package/dist/types/api/base/flowObservable.d.ts +3 -3
- package/dist/types/api/base/flowObservable.d.ts.map +1 -1
- package/dist/types/api/base/flowSubscribable.d.ts +2 -2
- package/dist/types/api/base/flowSubscribable.d.ts.map +1 -1
- package/dist/types/api/base/flowTracker.d.ts +1 -1
- package/dist/types/api/base/flowTracker.d.ts.map +1 -1
- package/dist/types/api/base/index.d.ts +4 -4
- package/dist/types/api/base/index.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +2 -2
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/nodes/async/flowConstantAsync.d.ts +1 -1
- package/dist/types/api/nodes/async/flowConstantAsync.d.ts.map +1 -1
- package/dist/types/api/nodes/async/flowDerivationAsync.d.ts +3 -3
- package/dist/types/api/nodes/async/flowDerivationAsync.d.ts.map +1 -1
- package/dist/types/api/nodes/async/flowStateAsync.d.ts +3 -3
- package/dist/types/api/nodes/async/flowStateAsync.d.ts.map +1 -1
- package/dist/types/api/nodes/async/flowWritableDerivationAsync.d.ts +2 -2
- package/dist/types/api/nodes/async/flowWritableDerivationAsync.d.ts.map +1 -1
- package/dist/types/api/nodes/async/index.d.ts +4 -4
- package/dist/types/api/nodes/async/index.d.ts.map +1 -1
- package/dist/types/api/nodes/collections/flowArray.d.ts +7 -4
- package/dist/types/api/nodes/collections/flowArray.d.ts.map +1 -1
- package/dist/types/api/nodes/collections/flowMap.d.ts +3 -2
- package/dist/types/api/nodes/collections/flowMap.d.ts.map +1 -1
- package/dist/types/api/nodes/collections/index.d.ts +2 -2
- package/dist/types/api/nodes/collections/index.d.ts.map +1 -1
- package/dist/types/api/nodes/flowEffect.d.ts +2 -2
- package/dist/types/api/nodes/flowEffect.d.ts.map +1 -1
- package/dist/types/api/nodes/flowSignal.d.ts +1 -1
- package/dist/types/api/nodes/flowSignal.d.ts.map +1 -1
- package/dist/types/api/nodes/flowValue.d.ts +2 -2
- package/dist/types/api/nodes/flowValue.d.ts.map +1 -1
- package/dist/types/api/nodes/index.d.ts +7 -7
- package/dist/types/api/nodes/index.d.ts.map +1 -1
- package/dist/types/api/nodes/sync/flowConstant.d.ts +2 -2
- package/dist/types/api/nodes/sync/flowConstant.d.ts.map +1 -1
- package/dist/types/api/nodes/sync/flowDerivation.d.ts +3 -3
- package/dist/types/api/nodes/sync/flowDerivation.d.ts.map +1 -1
- package/dist/types/api/nodes/sync/flowState.d.ts +3 -3
- package/dist/types/api/nodes/sync/flowState.d.ts.map +1 -1
- package/dist/types/api/nodes/sync/flowWritableDerivation.d.ts +2 -2
- package/dist/types/api/nodes/sync/flowWritableDerivation.d.ts.map +1 -1
- package/dist/types/api/nodes/sync/index.d.ts +4 -4
- package/dist/types/api/nodes/sync/index.d.ts.map +1 -1
- package/dist/types/api/nodes/utils.d.ts +1 -1
- package/dist/types/api/nodes/utils.d.ts.map +1 -1
- package/dist/types/base/disposable.d.ts +1 -1
- package/dist/types/base/disposable.d.ts.map +1 -1
- package/dist/types/base/executionStack.d.ts +22 -1
- package/dist/types/base/executionStack.d.ts.map +1 -1
- package/dist/types/base/index.d.ts +5 -5
- package/dist/types/base/index.d.ts.map +1 -1
- package/dist/types/base/node.d.ts +4 -4
- package/dist/types/base/node.d.ts.map +1 -1
- package/dist/types/base/observable.d.ts +3 -3
- package/dist/types/base/observable.d.ts.map +1 -1
- package/dist/types/base/observer.d.ts +2 -2
- package/dist/types/base/observer.d.ts.map +1 -1
- package/dist/types/converters/index.d.ts +1 -1
- package/dist/types/converters/index.d.ts.map +1 -1
- package/dist/types/converters/solid.d.ts +12 -8
- package/dist/types/converters/solid.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/nodes/actionNode.d.ts +23 -0
- package/dist/types/nodes/actionNode.d.ts.map +1 -0
- package/dist/types/nodes/arrayNode.d.ts +4 -3
- package/dist/types/nodes/arrayNode.d.ts.map +1 -1
- package/dist/types/nodes/effectNode.d.ts +18 -2
- package/dist/types/nodes/effectNode.d.ts.map +1 -1
- package/dist/types/nodes/index.d.ts +8 -7
- package/dist/types/nodes/index.d.ts.map +1 -1
- package/dist/types/nodes/mapNode.d.ts +4 -3
- package/dist/types/nodes/mapNode.d.ts.map +1 -1
- package/dist/types/nodes/signalNode.d.ts +2 -2
- package/dist/types/nodes/signalNode.d.ts.map +1 -1
- package/dist/types/nodes/valueAsyncNode.d.ts +3 -3
- package/dist/types/nodes/valueAsyncNode.d.ts.map +1 -1
- package/dist/types/nodes/valueNode.d.ts +3 -3
- package/dist/types/nodes/valueNode.d.ts.map +1 -1
- package/dist/types/nodes/valueSyncNode.d.ts +3 -3
- package/dist/types/nodes/valueSyncNode.d.ts.map +1 -1
- package/dist/types/schedulers/asyncScheduler.d.ts +2 -1
- package/dist/types/schedulers/asyncScheduler.d.ts.map +1 -1
- package/dist/types/schedulers/index.d.ts +4 -4
- package/dist/types/schedulers/index.d.ts.map +1 -1
- package/dist/types/schedulers/syncResolver.d.ts +1 -2
- package/dist/types/schedulers/syncResolver.d.ts.map +1 -1
- package/dist/types/schedulers/syncScheduler.d.ts +1 -1
- package/dist/types/schedulers/syncScheduler.d.ts.map +1 -1
- package/package.json +24 -1
- package/.gitlab-ci.yml +0 -24
- package/.vscode/settings.json +0 -5
- package/CHANGELOG.md +0 -94
- package/biome.json +0 -47
- package/docs/.vitepress/config.mts +0 -145
- package/docs/api/functions/array.md +0 -35
- package/docs/api/functions/constant.md +0 -33
- package/docs/api/functions/constantAsync.md +0 -69
- package/docs/api/functions/derivation.md +0 -34
- package/docs/api/functions/derivationAsync.md +0 -34
- package/docs/api/functions/from.md +0 -129
- package/docs/api/functions/isDisposable.md +0 -27
- package/docs/api/functions/map.md +0 -36
- package/docs/api/functions/signal.md +0 -21
- package/docs/api/functions/state.md +0 -67
- package/docs/api/functions/stateAsync.md +0 -69
- package/docs/api/functions/subscribe.md +0 -40
- package/docs/api/functions/writableDerivation.md +0 -33
- package/docs/api/functions/writableDerivationAsync.md +0 -34
- package/docs/api/index.md +0 -61
- package/docs/api/interfaces/FlowArray.md +0 -439
- package/docs/api/interfaces/FlowConstant.md +0 -220
- package/docs/api/interfaces/FlowConstantAsync.md +0 -221
- package/docs/api/interfaces/FlowDerivation.md +0 -241
- package/docs/api/interfaces/FlowDerivationAsync.md +0 -242
- package/docs/api/interfaces/FlowDisposable.md +0 -59
- package/docs/api/interfaces/FlowEffect.md +0 -64
- package/docs/api/interfaces/FlowMap.md +0 -374
- package/docs/api/interfaces/FlowObservable.md +0 -155
- package/docs/api/interfaces/FlowSignal.md +0 -156
- package/docs/api/interfaces/FlowState.md +0 -269
- package/docs/api/interfaces/FlowStateAsync.md +0 -268
- package/docs/api/interfaces/FlowSubscribable.md +0 -55
- package/docs/api/interfaces/FlowTracker.md +0 -61
- package/docs/api/interfaces/FlowValue.md +0 -222
- package/docs/api/interfaces/FlowWritableDerivation.md +0 -292
- package/docs/api/interfaces/FlowWritableDerivationAsync.md +0 -293
- package/docs/api/type-aliases/DerivationFunction.md +0 -28
- package/docs/api/type-aliases/DerivationFunctionAsync.md +0 -28
- package/docs/api/type-aliases/FlowArrayAction.md +0 -60
- package/docs/api/type-aliases/FlowDataTracker.md +0 -33
- package/docs/api/type-aliases/FlowMapAction.md +0 -48
- package/docs/api/type-aliases/FlowOnDataListener.md +0 -33
- package/docs/api/type-aliases/FlowOnErrorListener.md +0 -27
- package/docs/api/type-aliases/FlowOnPendingListener.md +0 -21
- package/docs/api/type-aliases/FlowReadonly.md +0 -22
- package/docs/api/type-aliases/InitFunction.md +0 -21
- package/docs/api/type-aliases/InitFunctionAsync.md +0 -21
- package/docs/api/type-aliases/NotPromise.md +0 -21
- package/docs/api/type-aliases/UpdateFunction.md +0 -27
- package/docs/api/type-aliases/UpdateFunctionAsync.md +0 -27
- package/docs/api/typedoc-sidebar.json +0 -65
- package/docs/examples/examples.md +0 -2311
- package/docs/examples/patterns.md +0 -649
- package/docs/guide/advanced/architecture.md +0 -1234
- package/docs/guide/advanced/disposal.md +0 -426
- package/docs/guide/advanced/migration-v1.md +0 -464
- package/docs/guide/advanced/migration-v2.md +0 -204
- package/docs/guide/advanced/solidjs.md +0 -135
- package/docs/guide/introduction/concepts.md +0 -57
- package/docs/guide/introduction/conventions.md +0 -30
- package/docs/guide/introduction/getting-started.md +0 -139
- package/docs/guide/introduction/lifecycle.md +0 -368
- package/docs/guide/primitives/array.md +0 -286
- package/docs/guide/primitives/constant.md +0 -207
- package/docs/guide/primitives/derivations.md +0 -281
- package/docs/guide/primitives/effects.md +0 -372
- package/docs/guide/primitives/map.md +0 -265
- package/docs/guide/primitives/overview.md +0 -92
- package/docs/guide/primitives/signal.md +0 -222
- package/docs/guide/primitives/state.md +0 -272
- package/docs/index.md +0 -47
- package/docs/public/logo.svg +0 -1
- package/src/api/base/flowDisposable.ts +0 -44
- package/src/api/base/flowObservable.ts +0 -28
- package/src/api/base/flowSubscribable.ts +0 -87
- package/src/api/base/flowTracker.ts +0 -7
- package/src/api/base/index.ts +0 -4
- package/src/api/index.ts +0 -2
- package/src/api/nodes/async/flowConstantAsync.ts +0 -36
- package/src/api/nodes/async/flowDerivationAsync.ts +0 -42
- package/src/api/nodes/async/flowStateAsync.ts +0 -47
- package/src/api/nodes/async/flowWritableDerivationAsync.ts +0 -33
- package/src/api/nodes/async/index.ts +0 -4
- package/src/api/nodes/collections/flowArray.ts +0 -155
- package/src/api/nodes/collections/flowMap.ts +0 -115
- package/src/api/nodes/collections/index.ts +0 -2
- package/src/api/nodes/flowEffect.ts +0 -42
- package/src/api/nodes/flowSignal.ts +0 -28
- package/src/api/nodes/flowValue.ts +0 -37
- package/src/api/nodes/index.ts +0 -7
- package/src/api/nodes/sync/flowConstant.ts +0 -33
- package/src/api/nodes/sync/flowDerivation.ts +0 -41
- package/src/api/nodes/sync/flowState.ts +0 -45
- package/src/api/nodes/sync/flowWritableDerivation.ts +0 -31
- package/src/api/nodes/sync/index.ts +0 -4
- package/src/api/nodes/utils.ts +0 -24
- package/src/base/disposable.ts +0 -18
- package/src/base/executionStack.ts +0 -42
- package/src/base/index.ts +0 -5
- package/src/base/node.ts +0 -98
- package/src/base/observable.ts +0 -92
- package/src/base/observer.ts +0 -51
- package/src/converters/index.ts +0 -1
- package/src/converters/solid.ts +0 -109
- package/src/index.ts +0 -2
- package/src/nodes/arrayNode.ts +0 -180
- package/src/nodes/effectNode.ts +0 -58
- package/src/nodes/index.ts +0 -7
- package/src/nodes/mapNode.ts +0 -125
- package/src/nodes/signalNode.ts +0 -19
- package/src/nodes/valueAsyncNode.ts +0 -85
- package/src/nodes/valueNode.ts +0 -148
- package/src/nodes/valueSyncNode.ts +0 -125
- package/src/schedulers/asyncResolver.ts +0 -78
- package/src/schedulers/asyncScheduler.ts +0 -66
- package/src/schedulers/index.ts +0 -4
- package/src/schedulers/pendingError.ts +0 -13
- package/src/schedulers/scheduler.ts +0 -9
- package/src/schedulers/syncResolver.ts +0 -69
- package/src/schedulers/syncScheduler.ts +0 -55
- package/test/base/pendingError.test.ts +0 -67
- package/test/converters/solid.derivation.browser.test.tsx +0 -69
- package/test/converters/solid.node.test.ts +0 -654
- package/test/converters/solid.state.browser.test.tsx +0 -1592
- package/test/reactivity/flowSignal.test.ts +0 -226
- package/test/reactivity/nodes/async/asyncScheduler/asyncResolver.test.ts +0 -593
- package/test/reactivity/nodes/async/asyncScheduler/asyncScheduler.test.ts +0 -317
- package/test/reactivity/nodes/async/flowConstantAsync.test.ts +0 -652
- package/test/reactivity/nodes/async/flowDerivation.test.ts +0 -898
- package/test/reactivity/nodes/async/flowDerivationAsync.test.ts +0 -1716
- package/test/reactivity/nodes/async/flowStateAsync.test.ts +0 -708
- package/test/reactivity/nodes/async/flowWritableDerivationAsync.test.ts +0 -614
- package/test/reactivity/nodes/collections/flowArray.asyncStates.test.ts +0 -1289
- package/test/reactivity/nodes/collections/flowArray.scalars.test.ts +0 -961
- package/test/reactivity/nodes/collections/flowArray.states.test.ts +0 -1035
- package/test/reactivity/nodes/collections/flowMap.asyncStates.test.ts +0 -960
- package/test/reactivity/nodes/collections/flowMap.scalars.test.ts +0 -775
- package/test/reactivity/nodes/collections/flowMap.states.test.ts +0 -958
- package/test/reactivity/nodes/sync/flowConstant.test.ts +0 -377
- package/test/reactivity/nodes/sync/flowDerivation.test.ts +0 -896
- package/test/reactivity/nodes/sync/flowState.test.ts +0 -341
- package/test/reactivity/nodes/sync/flowWritableDerivation.test.ts +0 -603
- package/test/vitest.d.ts +0 -10
- package/tsconfig.json +0 -37
- package/typedoc.json +0 -37
- package/vite.config.ts +0 -31
- package/vitest.browser.config.ts +0 -21
- package/vitest.config.ts +0 -17
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './api';
|
|
2
|
-
export * from './converters';
|
|
1
|
+
export * from './api/index.js';
|
|
2
|
+
export * from './converters/index.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FlowEffect, FlowOnDataListener, FlowOnErrorListener, FlowOnPendingListener, NotPromise, UpdateFunction } from '../api/index.js';
|
|
2
|
+
import { ValueSyncNode } from './valueSyncNode.js';
|
|
3
|
+
/**
|
|
4
|
+
* Reactive state that tracks the latest action while delivering every emitted action
|
|
5
|
+
* to `.subscribe()` callbacks, including multiple mutations within the same batch.
|
|
6
|
+
*
|
|
7
|
+
* Two read models:
|
|
8
|
+
* - get() / pick(): last-write-wins snapshot (current action value).
|
|
9
|
+
* - subscribe(): event stream — one onData call per emitted action, even when several
|
|
10
|
+
* mutations happen before the next flush. Each subscriber owns its own queue so
|
|
11
|
+
* delivery is not shared or stolen between subscribers.
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare class ActionNode<T extends NotPromise<unknown>> extends ValueSyncNode<T> {
|
|
16
|
+
private _slots;
|
|
17
|
+
private _enqueueForSubscribers;
|
|
18
|
+
set(value: NotPromise<T>): void;
|
|
19
|
+
set(updater: UpdateFunction<T>): void;
|
|
20
|
+
subscribe(onValue: FlowOnDataListener<T>, onError?: FlowOnErrorListener, onPending?: FlowOnPendingListener): FlowEffect;
|
|
21
|
+
dispose(): void;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=actionNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actionNode.d.ts","sourceRoot":"","sources":["../../../src/nodes/actionNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,UAAU,EACV,cAAc,EACjB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAOnD;;;;;;;;;;;GAWG;AACH,qBAAa,UAAU,CAAC,CAAC,SAAS,UAAU,CAAC,OAAO,CAAC,CAAE,SAAQ,aAAa,CAAC,CAAC,CAAC;IAC3E,OAAO,CAAC,MAAM,CAAsC;IAEpD,OAAO,CAAC,sBAAsB;IAMrB,GAAG,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI;IAC/B,GAAG,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI;IAoBrC,SAAS,CACd,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,EAC9B,OAAO,CAAC,EAAE,mBAAmB,EAC7B,SAAS,CAAC,EAAE,qBAAqB,GAClC,UAAU;IAoCJ,OAAO,IAAI,IAAI;CAI3B"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { FlowArray, FlowArrayAction, FlowTracker, NotPromise, UpdateFunction } from '../api';
|
|
2
|
-
import {
|
|
1
|
+
import { FlowArray, FlowArrayAction, FlowTracker, NotPromise, UpdateFunction } from '../api/index.js';
|
|
2
|
+
import { ActionNode } from './actionNode.js';
|
|
3
|
+
import { ValueSyncNode } from './valueSyncNode.js';
|
|
3
4
|
/**
|
|
4
5
|
* Internal implementation of reactive array with mutation tracking.
|
|
5
6
|
* @internal
|
|
6
7
|
*/
|
|
7
8
|
export declare class ArrayNode<T> extends ValueSyncNode<T[]> implements FlowArray<T> {
|
|
8
|
-
$lastAction:
|
|
9
|
+
$lastAction: ActionNode<FlowArrayAction<T>>;
|
|
9
10
|
protected _value: T[];
|
|
10
11
|
constructor(value?: T[]);
|
|
11
12
|
get(tracker: FlowTracker): T[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrayNode.d.ts","sourceRoot":"","sources":["../../../src/nodes/arrayNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"arrayNode.d.ts","sourceRoot":"","sources":["../../../src/nodes/arrayNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC3G,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;GAGG;AACH,qBAAa,SAAS,CAAC,CAAC,CAAE,SAAQ,aAAa,CAAC,CAAC,EAAE,CAAE,YAAW,SAAS,CAAC,CAAC,CAAC;IACxE,WAAW,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5C,UAAkB,MAAM,EAAE,CAAC,EAAE,CAAC;gBAElB,KAAK,GAAE,CAAC,EAAO;IASlB,GAAG,CAAC,OAAO,EAAE,WAAW,GAAG,CAAC,EAAE;IAKxB,IAAI,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC;IAKnC,IAAI,MAAM,IAAI,MAAM,CAGnB;IAEQ,GAAG,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE;IAChC,GAAG,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE;IAsB/C,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS;IA0B7C,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;IAWnB,GAAG,IAAI,CAAC,GAAG,SAAS;IAepB,OAAO,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;IAWtB,KAAK,IAAI,CAAC,GAAG,SAAS;IAetB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE;IAoBjE,KAAK,IAAI,CAAC,EAAE;IAiBH,OAAO,IAAI,IAAI;CAO3B"}
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
import { FlowDataTracker, FlowEffect, FlowOnDataListener, FlowOnErrorListener, FlowOnPendingListener } from '../api';
|
|
2
|
-
import { Observer } from '../base';
|
|
1
|
+
import { FlowDataTracker, FlowEffect, FlowOnDataListener, FlowOnErrorListener, FlowOnPendingListener } from '../api/index.js';
|
|
2
|
+
import { Observer } from '../base/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Reactive effect that automatically re-executes when its dependencies change.
|
|
5
|
+
*
|
|
6
|
+
* Scheduling uses epoch-based coalescing:
|
|
7
|
+
* - Multiple dependency changes in the same synchronous turn produce one queue entry
|
|
8
|
+
* but may still require multiple runs when notifications arrive in later microtasks
|
|
9
|
+
* (e.g. async pending → resolved).
|
|
10
|
+
* - Re-notifications during execute() (cascading effects) enqueue a fresh run because
|
|
11
|
+
* _queued is cleared at the start of execute().
|
|
12
|
+
*
|
|
5
13
|
* @internal
|
|
6
14
|
*/
|
|
7
15
|
export declare class EffectNode<T> extends Observer implements FlowEffect {
|
|
@@ -9,6 +17,14 @@ export declare class EffectNode<T> extends Observer implements FlowEffect {
|
|
|
9
17
|
private _onData;
|
|
10
18
|
private _onError?;
|
|
11
19
|
private _onPending?;
|
|
20
|
+
/** True while this effect is already waiting in the effect queue for the next flush. */
|
|
21
|
+
private _queued;
|
|
22
|
+
/** Guards the single coalesced bump of _notifyEpoch while _queued during one sync turn. */
|
|
23
|
+
private _coalescedWhileQueued;
|
|
24
|
+
/** Monotonic count of notifications that must eventually be executed. */
|
|
25
|
+
private _notifyEpoch;
|
|
26
|
+
/** How many notification epochs have been executed so far. */
|
|
27
|
+
private _executedEpoch;
|
|
12
28
|
constructor(data: FlowDataTracker<T>, onData: FlowOnDataListener<T>, onError?: FlowOnErrorListener, onPending?: FlowOnPendingListener);
|
|
13
29
|
notify(): void;
|
|
14
30
|
execute(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"effectNode.d.ts","sourceRoot":"","sources":["../../../src/nodes/effectNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,eAAe,EACf,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACxB,MAAM,
|
|
1
|
+
{"version":3,"file":"effectNode.d.ts","sourceRoot":"","sources":["../../../src/nodes/effectNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,eAAe,EACf,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAkB,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5D;;;;;;;;;;;GAWG;AACH,qBAAa,UAAU,CAAC,CAAC,CAAE,SAAQ,QAAS,YAAW,UAAU;IAC7D,OAAO,CAAC,KAAK,CAAqB;IAClC,OAAO,CAAC,OAAO,CAAwB;IACvC,OAAO,CAAC,QAAQ,CAAC,CAAsB;IACvC,OAAO,CAAC,UAAU,CAAC,CAAwB;IAC3C,wFAAwF;IACxF,OAAO,CAAC,OAAO,CAAS;IACxB,2FAA2F;IAC3F,OAAO,CAAC,qBAAqB,CAAS;IACtC,yEAAyE;IACzE,OAAO,CAAC,YAAY,CAAK;IACzB,8DAA8D;IAC9D,OAAO,CAAC,cAAc,CAAK;gBAGvB,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,EACxB,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAAC,EAC7B,OAAO,CAAC,EAAE,mBAAmB,EAC7B,SAAS,CAAC,EAAE,qBAAqB;IAYrC,MAAM,IAAI,IAAI;IAsBd,OAAO,IAAI,IAAI;CAgClB"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
1
|
+
export * from './actionNode.js';
|
|
2
|
+
export * from './arrayNode.js';
|
|
3
|
+
export * from './effectNode.js';
|
|
4
|
+
export * from './mapNode.js';
|
|
5
|
+
export * from './signalNode.js';
|
|
6
|
+
export * from './valueAsyncNode.js';
|
|
7
|
+
export * from './valueNode.js';
|
|
8
|
+
export * from './valueSyncNode.js';
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/nodes/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/nodes/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { FlowMap, FlowMapAction, NotPromise, UpdateFunction } from '../api';
|
|
2
|
-
import {
|
|
1
|
+
import { FlowMap, FlowMapAction, NotPromise, UpdateFunction } from '../api/index.js';
|
|
2
|
+
import { ActionNode } from './actionNode.js';
|
|
3
|
+
import { ValueSyncNode } from './valueSyncNode.js';
|
|
3
4
|
/**
|
|
4
5
|
* Internal implementation of reactive map with mutation tracking.
|
|
5
6
|
* @internal
|
|
6
7
|
*/
|
|
7
8
|
export declare class MapNode<K, V> extends ValueSyncNode<Map<K, V>> implements FlowMap<K, V> {
|
|
8
|
-
$lastAction:
|
|
9
|
+
$lastAction: ActionNode<FlowMapAction<K, V>>;
|
|
9
10
|
protected _value: Map<K, V>;
|
|
10
11
|
constructor(value?: Map<K, V>);
|
|
11
12
|
add(key: K, value: V): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapNode.d.ts","sourceRoot":"","sources":["../../../src/nodes/mapNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"mapNode.d.ts","sourceRoot":"","sources":["../../../src/nodes/mapNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;GAGG;AACH,qBAAa,OAAO,CAAC,CAAC,EAAE,CAAC,CAAE,SAAQ,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAE,YAAW,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;IACzE,WAAW,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACpD,UAAkB,MAAM,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;gBAExB,KAAK,GAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAa;IASxC,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC;IAepB,MAAM,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC;IAuB3B,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC;IAkBR,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;IAC1C,GAAG,CAAC,OAAO,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;IAoB3D,KAAK,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;IAiBT,OAAO,IAAI,IAAI;CAO3B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FlowEffect, FlowOnDataListener, FlowOnErrorListener, FlowOnPendingListener, FlowSignal } from '../api';
|
|
2
|
-
import { Observable } from '../base';
|
|
1
|
+
import { FlowEffect, FlowOnDataListener, FlowOnErrorListener, FlowOnPendingListener, FlowSignal } from '../api/index.js';
|
|
2
|
+
import { Observable } from '../base/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Manual trigger that notifies subscribers without carrying data.
|
|
5
5
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signalNode.d.ts","sourceRoot":"","sources":["../../../src/nodes/signalNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"signalNode.d.ts","sourceRoot":"","sources":["../../../src/nodes/signalNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,UAAU,EACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAiB,MAAM,kBAAkB,CAAC;AAG7D;;;GAGG;AACH,qBAAa,UAAW,SAAQ,UAAU,CAAC,IAAI,CAAE,YAAW,UAAU;IAClE,SAAS,CACL,SAAS,EAAE,kBAAkB,CAAC,IAAI,CAAC,EACnC,OAAO,CAAC,EAAE,mBAAmB,EAC7B,SAAS,CAAC,EAAE,qBAAqB,GAClC,UAAU;CAKhB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DerivationFunctionAsync, InitFunctionAsync, NotPromise, UpdateFunctionAsync } from '../api';
|
|
2
|
-
import { AsyncScheduler } from '../schedulers';
|
|
3
|
-
import { ValueNode } from './valueNode';
|
|
1
|
+
import { DerivationFunctionAsync, InitFunctionAsync, NotPromise, UpdateFunctionAsync } from '../api/index.js';
|
|
2
|
+
import { AsyncScheduler } from '../schedulers/index.js';
|
|
3
|
+
import { ValueNode } from './valueNode.js';
|
|
4
4
|
/**
|
|
5
5
|
* Function that computes a value asynchronously (either initialization or derivation).
|
|
6
6
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valueAsyncNode.d.ts","sourceRoot":"","sources":["../../../src/nodes/valueAsyncNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"valueAsyncNode.d.ts","sourceRoot":"","sources":["../../../src/nodes/valueAsyncNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACnH,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;;GAGG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,iBAAiB,CAAC,CAAC,CAAC,GAAG,uBAAuB,CAAC,CAAC,CAAC,CAAC;AACxF;;;GAGG;AACH,qBAAa,cAAc,CAAC,CAAC,SAAS,UAAU,CAAC,OAAO,CAAC,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IAC3E,SAAS,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;IACxC,OAAO,CAAC,QAAQ,CAAmB;gBAEvB,gBAAgB,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,oBAAoB,CAAC,CAAC,CAAC;IAiBlE,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,SAAS;IAOjB,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI;IAC9B,GAAG,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAAG,IAAI;IA+B1C,OAAO,IAAI,IAAI;CAIlB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FlowEffect, FlowOnDataListener, FlowOnErrorListener, FlowOnPendingListener, FlowTracker, NotPromise } from '../api';
|
|
2
|
-
import { Node } from '../base';
|
|
3
|
-
import { Scheduler } from '../schedulers';
|
|
1
|
+
import { FlowEffect, FlowOnDataListener, FlowOnErrorListener, FlowOnPendingListener, FlowTracker, NotPromise } from '../api/index.js';
|
|
2
|
+
import { Node } from '../base/index.js';
|
|
3
|
+
import { Scheduler } from '../schedulers/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* Base class for reactive values that compute, cache, and propagate changes through the dependency graph.
|
|
6
6
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valueNode.d.ts","sourceRoot":"","sources":["../../../src/nodes/valueNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,WAAW,EACX,UAAU,EACb,MAAM,
|
|
1
|
+
{"version":3,"file":"valueNode.d.ts","sourceRoot":"","sources":["../../../src/nodes/valueNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,WAAW,EACX,UAAU,EACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAkB,IAAI,EAAwC,MAAM,kBAAkB,CAAC;AAC9F,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGtE;;;GAGG;AACH,8BAAsB,SAAS,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,CAAC,CAAC;IAC9C,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC;IACzC,SAAS,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IACjC,SAAS,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAElB,KAAK,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IA6BjC,MAAM,IAAI,IAAI;IAUd,OAAO,IAAI,IAAI;IAKxB,GAAG,CAAC,OAAO,EAAE,WAAW,GAAG,CAAC;IA8BtB,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC;IAkCxB,OAAO,IAAI,IAAI;IAUf,SAAS,CACL,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,EAC9B,OAAO,CAAC,EAAE,mBAAmB,EAC7B,SAAS,CAAC,EAAE,qBAAqB,GAClC,UAAU;CAKhB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DerivationFunction, InitFunction, NotPromise, UpdateFunction } from '../api';
|
|
2
|
-
import { SyncScheduler } from '../schedulers';
|
|
3
|
-
import { ValueNode } from './valueNode';
|
|
1
|
+
import { DerivationFunction, InitFunction, NotPromise, UpdateFunction } from '../api/index.js';
|
|
2
|
+
import { SyncScheduler } from '../schedulers/index.js';
|
|
3
|
+
import { ValueNode } from './valueNode.js';
|
|
4
4
|
/**
|
|
5
5
|
* Function that computes a value (either initialization or derivation).
|
|
6
6
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valueSyncNode.d.ts","sourceRoot":"","sources":["../../../src/nodes/valueSyncNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"valueSyncNode.d.ts","sourceRoot":"","sources":["../../../src/nodes/valueSyncNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACpG,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;;GAGG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC;AAEzE;;;GAGG;AACH,qBAAa,aAAa,CAAC,CAAC,SAAS,UAAU,CAAC,OAAO,CAAC,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IAC1E,SAAS,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IACvC,OAAO,CAAC,QAAQ,CAAU;gBAEd,cAAc,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC;IAuB9D,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,SAAS;IAKjB,GAAG,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI;IAC/B,GAAG,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI;IAgDrC,OAAO,IAAI,IAAI;CAsBlB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Scheduler } from './scheduler';
|
|
1
|
+
import { Scheduler } from './scheduler.js';
|
|
2
2
|
/**
|
|
3
3
|
* Scheduler that manages asynchronous computation lifecycle with resolver instances.
|
|
4
4
|
* @internal
|
|
@@ -15,6 +15,7 @@ export declare class AsyncScheduler<T> implements Scheduler {
|
|
|
15
15
|
get disposed(): boolean;
|
|
16
16
|
overwrite(promise: Promise<T>): void;
|
|
17
17
|
compute(): void;
|
|
18
|
+
private _attachHandlers;
|
|
18
19
|
dispose(): void;
|
|
19
20
|
}
|
|
20
21
|
//# sourceMappingURL=asyncScheduler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asyncScheduler.d.ts","sourceRoot":"","sources":["../../../src/schedulers/asyncScheduler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"asyncScheduler.d.ts","sourceRoot":"","sources":["../../../src/schedulers/asyncScheduler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;;GAGG;AACH,qBAAa,cAAc,CAAC,CAAC,CAAE,YAAW,SAAS;IAC/C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmB;IAC5C,OAAO,CAAC,SAAS,CAAmB;IACpC,OAAO,CAAC,UAAU,CAAqB;IACvC,OAAO,CAAC,SAAS,CAA2B;IAC5C,OAAO,CAAC,QAAQ,CAAiC;IACjD,OAAO,CAAC,SAAS,CAAS;gBAEd,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI;IAQxG,IAAI,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAG3B;IAED,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI;IAUpC,OAAO,IAAI,IAAI;IAUf,OAAO,CAAC,eAAe;IAavB,OAAO,IAAI,IAAI;CAIlB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './asyncScheduler';
|
|
2
|
-
export * from './pendingError';
|
|
3
|
-
export * from './scheduler';
|
|
4
|
-
export * from './syncScheduler';
|
|
1
|
+
export * from './asyncScheduler.js';
|
|
2
|
+
export * from './pendingError.js';
|
|
3
|
+
export * from './scheduler.js';
|
|
4
|
+
export * from './syncScheduler.js';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schedulers/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schedulers/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Manages synchronous computation lifecycle with
|
|
2
|
+
* Manages synchronous computation lifecycle with abort and settled-state guards.
|
|
3
3
|
* @internal
|
|
4
4
|
*/
|
|
5
5
|
export declare class SyncResolver<T> {
|
|
6
6
|
private readonly _compute;
|
|
7
|
-
private _iteration;
|
|
8
7
|
private _aborted;
|
|
9
8
|
private _finished;
|
|
10
9
|
private _onValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"syncResolver.d.ts","sourceRoot":"","sources":["../../../src/schedulers/syncResolver.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,qBAAa,YAAY,CAAC,CAAC;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAU;IACnC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"syncResolver.d.ts","sourceRoot":"","sources":["../../../src/schedulers/syncResolver.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,qBAAa,YAAY,CAAC,CAAC;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAU;IACnC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,SAAS,CAAS;IAE1B,OAAO,CAAC,QAAQ,CAAqB;IACrC,OAAO,CAAC,QAAQ,CAA2B;gBAE/B,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI;IAM5F,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,OAAO,IAAI,IAAI;IAoBf,SAAS,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI;IAQzB,KAAK,IAAI,IAAI;CAGhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"syncScheduler.d.ts","sourceRoot":"","sources":["../../../src/schedulers/syncScheduler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"syncScheduler.d.ts","sourceRoot":"","sources":["../../../src/schedulers/syncScheduler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD;;;GAGG;AACH,qBAAa,aAAa,CAAC,CAAC,CAAE,YAAW,SAAS;IAC9C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAU;IACnC,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,UAAU,CAAqB;IACvC,OAAO,CAAC,SAAS,CAA2B;IAC5C,OAAO,CAAC,QAAQ,CAAiC;IACjD,OAAO,CAAC,SAAS,CAAS;gBAEd,OAAO,EAAE,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI;IAa/F,IAAI,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAE3B;IAED,SAAS,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI;IASzB,OAAO,IAAI,IAAI;IASf,OAAO,IAAI,IAAI;CAIlB"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ersbeth/picoflow",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Minimal Dataflow library for TypeScript",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"packageManager": "pnpm@11.9.0",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=22"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"SKILL.md"
|
|
13
|
+
],
|
|
6
14
|
"exports": {
|
|
7
15
|
"types": "./dist/types/index.d.ts",
|
|
8
16
|
"default": "./dist/picoflow.js"
|
|
@@ -12,7 +20,20 @@
|
|
|
12
20
|
"lint": "pnpm exec biome check --fix",
|
|
13
21
|
"build": "pnpm exec vite build --config vite.config.ts",
|
|
14
22
|
"test": "pnpm exec vitest",
|
|
23
|
+
"test:coverage": "pnpm exec vitest run --coverage",
|
|
15
24
|
"test:browser": "pnpm exec vitest --config=vitest.browser.config.ts",
|
|
25
|
+
"test:browser:coverage": "pnpm exec vitest run --config=vitest.browser.config.ts --coverage",
|
|
26
|
+
"ci:check": "pnpm exec tsc --noEmit",
|
|
27
|
+
"ci:lint": "pnpm exec biome check .",
|
|
28
|
+
"ci:test": "pnpm exec vitest run",
|
|
29
|
+
"ci:test:browser": "pnpm exec vitest run --config=vitest.browser.config.ts",
|
|
30
|
+
"ci:pack:smoke": "node tools/release/smoke-tarball.mjs",
|
|
31
|
+
"ci:release:check": "node tools/release/check-release.mjs",
|
|
32
|
+
"playwright:install": "playwright install --with-deps chromium",
|
|
33
|
+
"quality:diff": "node tools/quality/differential-graph.mjs 400",
|
|
34
|
+
"quality:bench": "node tools/quality/bench-core.mjs",
|
|
35
|
+
"quality:snippets": "node tools/quality/check-doc-snippets.mjs",
|
|
36
|
+
"quality:mutation": "bash tools/quality/mutation-test.sh",
|
|
16
37
|
"docs:dev": "pnpm exec vitepress dev docs",
|
|
17
38
|
"docs:build": "pnpm docs:generate && pnpm exec vitepress build docs",
|
|
18
39
|
"docs:preview": "pnpm exec vitepress preview docs",
|
|
@@ -26,12 +47,14 @@
|
|
|
26
47
|
"@braintree/sanitize-url": "^7.1.1",
|
|
27
48
|
"@solidjs/testing-library": "^0.8.10",
|
|
28
49
|
"@vitest/browser-playwright": "^4.0.16",
|
|
50
|
+
"@vitest/coverage-v8": "4.0.16",
|
|
29
51
|
"cytoscape": "^3.33.1",
|
|
30
52
|
"cytoscape-cose-bilkent": "^4.1.0",
|
|
31
53
|
"dayjs": "^1.11.19",
|
|
32
54
|
"dompurify": "^3.3.0",
|
|
33
55
|
"jsdom": "^27.3.0",
|
|
34
56
|
"mermaid": "^11.12.1",
|
|
57
|
+
"playwright": "1.57.0",
|
|
35
58
|
"typedoc": "^0.28.15",
|
|
36
59
|
"typedoc-plugin-markdown": "^4.9.0",
|
|
37
60
|
"typedoc-vitepress-theme": "^1.1.2",
|
package/.gitlab-ci.yml
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
image: node:20
|
|
2
|
-
|
|
3
|
-
cache:
|
|
4
|
-
paths:
|
|
5
|
-
- node_modules/
|
|
6
|
-
- .pnpm-store/
|
|
7
|
-
|
|
8
|
-
variables:
|
|
9
|
-
PNPM_VERSION: 8
|
|
10
|
-
|
|
11
|
-
before_script:
|
|
12
|
-
- npm install -g pnpm@${PNPM_VERSION}
|
|
13
|
-
- pnpm install
|
|
14
|
-
|
|
15
|
-
pages:
|
|
16
|
-
stage: deploy
|
|
17
|
-
script:
|
|
18
|
-
- pnpm docs:build
|
|
19
|
-
- cp -r docs/.vitepress/dist public
|
|
20
|
-
artifacts:
|
|
21
|
-
paths:
|
|
22
|
-
- public
|
|
23
|
-
rules:
|
|
24
|
-
- if: $CI_COMMIT_BRANCH == "main"
|
package/.vscode/settings.json
DELETED
package/CHANGELOG.md
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
|
|
5
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
-
|
|
8
|
-
## [Unreleased]
|
|
9
|
-
|
|
10
|
-
## [2.0.0] - 2026-01-11
|
|
11
|
-
|
|
12
|
-
### 🚨 BREAKING CHANGES
|
|
13
|
-
|
|
14
|
-
This is a major API refinement focusing on consistency, performance, and clarity. **This release is not backward compatible with v1.x.**
|
|
15
|
-
|
|
16
|
-
**Migration required:** Please see the [Migration Guide](docs/guide/advanced/migration-v2.md) for detailed migration instructions. Most projects can be migrated in 30-60 minutes.
|
|
17
|
-
|
|
18
|
-
### Changed
|
|
19
|
-
|
|
20
|
-
- **`effect()` API removed:** The global `effect()` function has been replaced with `subscribe()` and `.subscribe()` methods for better consistency and clarity
|
|
21
|
-
- Single primitive subscriptions: use `$primitive.subscribe((value) => { ... })`
|
|
22
|
-
- Multiple dependencies: use `subscribe((t) => ({ ... }), (data) => { ... })`
|
|
23
|
-
- **FlowMap fine-grained tracking simplified:** Replaced three separate signals (`$lastAdded`, `$lastUpdated`, `$lastDeleted`) with a single unified `$lastAction` signal
|
|
24
|
-
- Actions now use a discriminated union type with `type` field
|
|
25
|
-
- Action properties renamed for clarity: `value` → `addedValue`, `setValue`, `removedValue`
|
|
26
|
-
- Added `set` and `clear` action types
|
|
27
|
-
- **FlowArray method renamed:** `setItem()` → `update()` for consistency with FlowMap
|
|
28
|
-
- **Constant initialization:** Constants now always require a function initializer `constant(() => value)`, enforcing lazy evaluation
|
|
29
|
-
- **Improved type naming:** Internal `TrackingContext` is now properly exported as `FlowTracker` interface
|
|
30
|
-
|
|
31
|
-
### Added
|
|
32
|
-
|
|
33
|
-
- **`subscribe()` function:** New global function for creating side effects with multiple dependencies
|
|
34
|
-
- **`.subscribe()` method:** Convenient method on primitives for single-value subscriptions
|
|
35
|
-
- **`FlowEffect` interface:** Return type for all subscription operations, providing consistent disposal pattern
|
|
36
|
-
- **Enhanced FlowMap actions:** Added `set` and `clear` action types to `$lastAction` for complete operation tracking
|
|
37
|
-
|
|
38
|
-
### Removed
|
|
39
|
-
|
|
40
|
-
- **`effect()` function:** Replaced by `subscribe()` and `.subscribe()` methods
|
|
41
|
-
- **FlowMap separate signals:** `$lastAdded`, `$lastUpdated`, `$lastDeleted` replaced by unified `$lastAction`
|
|
42
|
-
- **FlowArray `setItem()` method:** Renamed to `update()`
|
|
43
|
-
|
|
44
|
-
### Benefits
|
|
45
|
-
|
|
46
|
-
- **Clearer API:** Distinction between primitives and side effects (subscriptions) is more explicit
|
|
47
|
-
- **Better performance:** Single `$lastAction` signal reduces overhead in collection tracking
|
|
48
|
-
- **More consistent:** Unified naming across FlowArray and FlowMap operations
|
|
49
|
-
- **Simpler mental model:** `subscribe()` clearly indicates side effects vs pure derivations
|
|
50
|
-
|
|
51
|
-
---
|
|
52
|
-
|
|
53
|
-
## [1.0.0] - 2025-11-29
|
|
54
|
-
|
|
55
|
-
### 🚨 BREAKING CHANGES
|
|
56
|
-
|
|
57
|
-
This is a major rewrite of PicoFlow's API. The library now uses an explicit tracking context instead of getter/watcher functions. **This release is not backward compatible with v0.x.**
|
|
58
|
-
|
|
59
|
-
**Migration required:** Please see [UPGRADING.md](UPGRADING.md) for detailed migration instructions. Most projects can be migrated in 15-30 minutes.
|
|
60
|
-
|
|
61
|
-
### Changed
|
|
62
|
-
|
|
63
|
-
- **Complete API overhaul:** Effects and derivations now receive a `TrackingContext` parameter (`t`) instead of separate `get` and `watch` functions
|
|
64
|
-
- **New method-based API:** Observables use `.get(t)` for reactive reads instead of `get(observable)`
|
|
65
|
-
- **Signals use `.watch(t)`:** Signal tracking now uses `$signal.watch(t)` instead of `watch($signal)`
|
|
66
|
-
- **Chained syntax:** Enable natural chaining like `$parent.get(t).child.get(t)` instead of nested `get(get($parent).child)`
|
|
67
|
-
- **Simpler architecture:** Removed internal methods (`_watch`, `_watchFrom`, `_getFrom`) in favor of direct method overrides
|
|
68
|
-
|
|
69
|
-
### Added
|
|
70
|
-
|
|
71
|
-
- **`TrackingContext` class:** New explicit tracking context for reactive computations
|
|
72
|
-
- **`pick()` method:** Read observable values without creating dependencies - `$state.pick()` is equivalent to `$state.get(null)`
|
|
73
|
-
- **Explicit control:** Granular control over what is tracked vs. untracked in the same reactive scope
|
|
74
|
-
- **Mixed reactive/non-reactive reads:** Use `.get(t)` for reactive dependencies and `.pick()` for snapshot reads in the same effect
|
|
75
|
-
|
|
76
|
-
### Removed
|
|
77
|
-
|
|
78
|
-
- **`FlowGetter` type:** Replaced by `TrackingContext` parameter
|
|
79
|
-
- **`FlowWatcher` type:** Replaced by `TrackingContext` parameter
|
|
80
|
-
- **Implicit getter/watcher functions:** No longer passed to effects and derivations
|
|
81
|
-
|
|
82
|
-
### Benefits
|
|
83
|
-
|
|
84
|
-
- **More readable:** Code is more explicit about what creates dependencies
|
|
85
|
-
- **Better chaining:** Natural fluent API for nested observables
|
|
86
|
-
- **Simpler codebase:** Cleaner internal architecture with fewer abstractions
|
|
87
|
-
- **More flexible:** Fine-grained control over reactive tracking per read operation
|
|
88
|
-
|
|
89
|
-
---
|
|
90
|
-
|
|
91
|
-
## [0.2.4] - Previous Release
|
|
92
|
-
|
|
93
|
-
(Version 0.x releases used the getter/watcher API)
|
|
94
|
-
|
package/biome.json
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://biomejs.dev/schemas/2.3.8/schema.json",
|
|
3
|
-
"vcs": {
|
|
4
|
-
"enabled": true,
|
|
5
|
-
"clientKind": "git",
|
|
6
|
-
"useIgnoreFile": true
|
|
7
|
-
},
|
|
8
|
-
"files": {
|
|
9
|
-
"includes": ["**", "!!**/dist"]
|
|
10
|
-
},
|
|
11
|
-
"formatter": {
|
|
12
|
-
"enabled": true,
|
|
13
|
-
"indentStyle": "space",
|
|
14
|
-
"indentWidth": 4,
|
|
15
|
-
"lineWidth": 120
|
|
16
|
-
},
|
|
17
|
-
"linter": {
|
|
18
|
-
"enabled": true,
|
|
19
|
-
"rules": {
|
|
20
|
-
"recommended": true,
|
|
21
|
-
"complexity": {
|
|
22
|
-
"noStaticOnlyClass": "off"
|
|
23
|
-
},
|
|
24
|
-
"nursery": {
|
|
25
|
-
"useExhaustiveSwitchCases": "error",
|
|
26
|
-
"noFloatingPromises": "error",
|
|
27
|
-
"noMisusedPromises": "error"
|
|
28
|
-
},
|
|
29
|
-
"suspicious": {
|
|
30
|
-
"useAwait": "error"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
"javascript": {
|
|
35
|
-
"formatter": {
|
|
36
|
-
"quoteStyle": "double"
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
"assist": {
|
|
40
|
-
"enabled": true,
|
|
41
|
-
"actions": {
|
|
42
|
-
"source": {
|
|
43
|
-
"organizeImports": "on"
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|