reactronic 0.95.25046 → 0.95.25047
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 +1 -1
- package/build/dist/source/OperationEx.d.ts +2 -2
- package/build/dist/source/OperationEx.js +2 -2
- package/build/dist/source/Pipe.d.ts +2 -2
- package/build/dist/source/Pipe.js +2 -2
- package/build/dist/source/api.d.ts +3 -3
- package/build/dist/source/api.js +3 -3
- package/build/dist/source/core/Indicator.d.ts +2 -2
- package/build/dist/source/core/Indicator.js +2 -2
- package/build/dist/source/core/Journal.d.ts +2 -2
- package/build/dist/source/core/Journal.js +2 -2
- package/build/dist/source/core/Mvcc.d.ts +2 -2
- package/build/dist/source/core/Mvcc.js +6 -6
- package/build/dist/source/core/MvccArray.d.ts +1 -1
- package/build/dist/source/core/MvccArray.js +1 -1
- package/build/dist/source/core/MvccMap.d.ts +1 -1
- package/build/dist/source/core/MvccMap.js +1 -1
- package/build/dist/source/core/MvccReconciliationList.d.ts +2 -2
- package/build/dist/source/core/MvccReconciliationList.js +2 -2
- package/build/dist/source/core/Operation.js +1 -1
- package/build/dist/source/core/TreeNode.d.ts +2 -2
- package/build/dist/source/core/TreeNode.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { F } from "./util/Utils.js";
|
|
2
|
-
import {
|
|
3
|
-
export declare class ReactionEx<T> extends
|
|
2
|
+
import { RxObject } from "./core/Mvcc.js";
|
|
3
|
+
export declare class ReactionEx<T> extends RxObject {
|
|
4
4
|
protected operation: F<T>;
|
|
5
5
|
constructor(operation: F<T>);
|
|
6
6
|
protected launch(): T;
|
|
@@ -7,9 +7,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import {
|
|
10
|
+
import { RxObject } from "./core/Mvcc.js";
|
|
11
11
|
import { reaction } from "./System.js";
|
|
12
|
-
export class ReactionEx extends
|
|
12
|
+
export class ReactionEx extends RxObject {
|
|
13
13
|
constructor(operation) {
|
|
14
14
|
super();
|
|
15
15
|
this.operation = operation;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare abstract class Pipe<T> extends
|
|
1
|
+
import { RxObject } from "./core/Mvcc.js";
|
|
2
|
+
export declare abstract class Pipe<T> extends RxObject {
|
|
3
3
|
abstract readonly capacity: number;
|
|
4
4
|
abstract readonly count: number;
|
|
5
5
|
abstract put(...items: T[]): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { misuse } from "./util/Dbg.js";
|
|
2
|
-
import {
|
|
3
|
-
export class Pipe extends
|
|
2
|
+
import { RxObject } from "./core/Mvcc.js";
|
|
3
|
+
export class Pipe extends RxObject {
|
|
4
4
|
static create(hint, capacity) { throw misuse("not implemented"); }
|
|
5
5
|
}
|
|
@@ -11,9 +11,9 @@ export type { Reaction, ReactivityOptions, SnapshotOptions, LoggingOptions, Prof
|
|
|
11
11
|
export type { Worker } from "./Worker.js";
|
|
12
12
|
export { Ref, ToggleRef, refs, toggleRefs, customToggleRefs } from "./Ref.js";
|
|
13
13
|
export type { BoolOnly, GivenTypeOnly } from "./Ref.js";
|
|
14
|
-
export { TxObject,
|
|
15
|
-
export { TxArray,
|
|
16
|
-
export { TxMap,
|
|
14
|
+
export { TxObject, RxObject } from "./core/Mvcc.js";
|
|
15
|
+
export { TxArray, RxArray } from "./core/MvccArray.js";
|
|
16
|
+
export { TxMap, RxMap } from "./core/MvccMap.js";
|
|
17
17
|
export { Changeset } from "./core/Changeset.js";
|
|
18
18
|
export { Transaction } from "./core/Transaction.js";
|
|
19
19
|
export { Indicator } from "./core/Indicator.js";
|
package/build/dist/source/api.js
CHANGED
|
@@ -7,9 +7,9 @@ export { SealedSet } from "./util/SealedSet.js";
|
|
|
7
7
|
export { LoggingLevel } from "./Options.js";
|
|
8
8
|
export { Mode, Priority, Kind, Reentrance, Isolation } from "./Enums.js";
|
|
9
9
|
export { Ref, ToggleRef, refs, toggleRefs, customToggleRefs } from "./Ref.js";
|
|
10
|
-
export { TxObject,
|
|
11
|
-
export { TxArray,
|
|
12
|
-
export { TxMap,
|
|
10
|
+
export { TxObject, RxObject } from "./core/Mvcc.js";
|
|
11
|
+
export { TxArray, RxArray } from "./core/MvccArray.js";
|
|
12
|
+
export { TxMap, RxMap } from "./core/MvccMap.js";
|
|
13
13
|
export { Changeset } from "./core/Changeset.js";
|
|
14
14
|
export { Transaction } from "./core/Transaction.js";
|
|
15
15
|
export { Indicator } from "./core/Indicator.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Worker } from "../Worker.js";
|
|
2
|
-
import {
|
|
3
|
-
export declare abstract class Indicator extends
|
|
2
|
+
import { RxObject } from "./Mvcc.js";
|
|
3
|
+
export declare abstract class Indicator extends RxObject {
|
|
4
4
|
abstract readonly isBusy: boolean;
|
|
5
5
|
abstract readonly counter: number;
|
|
6
6
|
abstract readonly workers: ReadonlySet<Worker>;
|
|
@@ -8,9 +8,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { Isolation } from "../Enums.js";
|
|
11
|
-
import {
|
|
11
|
+
import { RxObject, Mvcc } from "./Mvcc.js";
|
|
12
12
|
import { Transaction } from "./Transaction.js";
|
|
13
|
-
export class Indicator extends
|
|
13
|
+
export class Indicator extends RxObject {
|
|
14
14
|
static create(hint, activationDelay, deactivationDelay, durationResolution) {
|
|
15
15
|
return IndicatorImpl.createImpl(hint, activationDelay, deactivationDelay, durationResolution);
|
|
16
16
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RxObject } from "./Mvcc.js";
|
|
2
2
|
import { ObjectHandle, ObjectVersion, PatchSet } from "./Data.js";
|
|
3
3
|
export type Saver = (patch: PatchSet) => Promise<void>;
|
|
4
|
-
export declare abstract class Journal extends
|
|
4
|
+
export declare abstract class Journal extends RxObject {
|
|
5
5
|
abstract capacity: number;
|
|
6
6
|
abstract readonly edits: ReadonlyArray<PatchSet>;
|
|
7
7
|
abstract readonly unsaved: PatchSet;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { misuse } from "../util/Dbg.js";
|
|
2
2
|
import { Isolation } from "../Enums.js";
|
|
3
|
-
import {
|
|
3
|
+
import { RxObject } from "./Mvcc.js";
|
|
4
4
|
import { Meta, ContentFootprint } from "./Data.js";
|
|
5
5
|
import { Changeset, EMPTY_OBJECT_VERSION } from "./Changeset.js";
|
|
6
6
|
import { Transaction } from "./Transaction.js";
|
|
7
7
|
import { Sealant } from "../util/Sealant.js";
|
|
8
|
-
export class Journal extends
|
|
8
|
+
export class Journal extends RxObject {
|
|
9
9
|
static create() { return new JournalImpl(); }
|
|
10
10
|
}
|
|
11
11
|
export class JournalImpl extends Journal {
|
|
@@ -12,7 +12,7 @@ export declare abstract class MvccObject {
|
|
|
12
12
|
export declare abstract class TxObject extends MvccObject {
|
|
13
13
|
constructor();
|
|
14
14
|
}
|
|
15
|
-
export declare abstract class
|
|
15
|
+
export declare abstract class RxObject extends MvccObject {
|
|
16
16
|
constructor();
|
|
17
17
|
}
|
|
18
18
|
export declare class OptionsImpl implements ReactivityOptions {
|
|
@@ -39,7 +39,7 @@ export declare class Mvcc implements ProxyHandler<ObjectHandle> {
|
|
|
39
39
|
static asyncActionDurationWarningThreshold: number;
|
|
40
40
|
static sensitivity: boolean;
|
|
41
41
|
static readonly tx: Mvcc;
|
|
42
|
-
static readonly
|
|
42
|
+
static readonly rx: Mvcc;
|
|
43
43
|
readonly isSignal: boolean;
|
|
44
44
|
constructor(isSignal: boolean);
|
|
45
45
|
getPrototypeOf(h: ObjectHandle): object | null;
|
|
@@ -20,7 +20,7 @@ export class TxObject extends MvccObject {
|
|
|
20
20
|
super(false);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
export class
|
|
23
|
+
export class RxObject extends MvccObject {
|
|
24
24
|
constructor() {
|
|
25
25
|
super(true);
|
|
26
26
|
}
|
|
@@ -125,11 +125,11 @@ export class Mvcc {
|
|
|
125
125
|
Meta.acquire(proto, Meta.Initial)[fk] = new ContentFootprint(undefined, 0);
|
|
126
126
|
const get = function () {
|
|
127
127
|
const h = Mvcc.acquireHandle(this);
|
|
128
|
-
return Mvcc.
|
|
128
|
+
return Mvcc.rx.get(h, fk, this);
|
|
129
129
|
};
|
|
130
130
|
const set = function (value) {
|
|
131
131
|
const h = Mvcc.acquireHandle(this);
|
|
132
|
-
return Mvcc.
|
|
132
|
+
return Mvcc.rx.set(h, fk, value, this);
|
|
133
133
|
};
|
|
134
134
|
const enumerable = true;
|
|
135
135
|
const configurable = false;
|
|
@@ -178,7 +178,7 @@ export class Mvcc {
|
|
|
178
178
|
throw misuse("only objects can be signalling");
|
|
179
179
|
const initial = Meta.getFrom(Object.getPrototypeOf(obj), Meta.Initial);
|
|
180
180
|
const ov = new ObjectVersion(EMPTY_OBJECT_VERSION.changeset, EMPTY_OBJECT_VERSION, Object.assign({}, initial));
|
|
181
|
-
h = new ObjectHandle(obj, obj, Mvcc.
|
|
181
|
+
h = new ObjectHandle(obj, obj, Mvcc.rx, ov, obj.constructor.name);
|
|
182
182
|
Meta.set(ov.data, Meta.Handle, h);
|
|
183
183
|
Meta.set(obj, Meta.Handle, h);
|
|
184
184
|
Meta.set(ov.data, Meta.Revision, new ContentFootprint(1, 0));
|
|
@@ -187,7 +187,7 @@ export class Mvcc {
|
|
|
187
187
|
}
|
|
188
188
|
static createHandleForMvccObject(proto, data, blank, hint, isSignal) {
|
|
189
189
|
const ctx = Changeset.edit();
|
|
190
|
-
const mvcc = isSignal ? Mvcc.
|
|
190
|
+
const mvcc = isSignal ? Mvcc.rx : Mvcc.tx;
|
|
191
191
|
const h = new ObjectHandle(data, undefined, mvcc, EMPTY_OBJECT_VERSION, hint);
|
|
192
192
|
ctx.getEditableObjectVersion(h, Meta.Handle, blank);
|
|
193
193
|
if (!Mvcc.reactivityAutoStartDisabled)
|
|
@@ -237,7 +237,7 @@ Mvcc.mainThreadBlockingWarningThreshold = Number.MAX_SAFE_INTEGER;
|
|
|
237
237
|
Mvcc.asyncActionDurationWarningThreshold = Number.MAX_SAFE_INTEGER;
|
|
238
238
|
Mvcc.sensitivity = false;
|
|
239
239
|
Mvcc.tx = new Mvcc(false);
|
|
240
|
-
Mvcc.
|
|
240
|
+
Mvcc.rx = new Mvcc(true);
|
|
241
241
|
Mvcc.createOperationDescriptor = function (h, fk, options) {
|
|
242
242
|
throw misuse("this implementation of createOperationDescriptor should never be called");
|
|
243
243
|
};
|
|
@@ -53,7 +53,7 @@ export declare class TxArray<T> extends MvccArray<T> {
|
|
|
53
53
|
constructor(arrayLength?: number);
|
|
54
54
|
constructor(...items: T[]);
|
|
55
55
|
}
|
|
56
|
-
export declare class
|
|
56
|
+
export declare class RxArray<T> extends MvccArray<T> {
|
|
57
57
|
constructor();
|
|
58
58
|
constructor(arrayLength: number);
|
|
59
59
|
constructor(arrayLength?: number);
|
|
@@ -19,7 +19,7 @@ export declare class TxMap<K, V> extends MvccMap<K, V> {
|
|
|
19
19
|
constructor();
|
|
20
20
|
constructor(iterable?: Iterable<readonly [K, V]> | null);
|
|
21
21
|
}
|
|
22
|
-
export declare class
|
|
22
|
+
export declare class RxMap<K, V> extends MvccMap<K, V> {
|
|
23
23
|
constructor();
|
|
24
24
|
constructor(iterable?: Iterable<readonly [K, V]> | null);
|
|
25
25
|
}
|
|
@@ -28,7 +28,7 @@ export class TxMap extends MvccMap {
|
|
|
28
28
|
super(false, args !== undefined ? new Map(args) : new Map());
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
export class
|
|
31
|
+
export class RxMap extends MvccMap {
|
|
32
32
|
constructor(args) {
|
|
33
33
|
super(true, args !== undefined ? new Map(args) : new Map());
|
|
34
34
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReconciliationList, LinkedItem, ReconciliationListReader } from "../util/ReconciliationList.js";
|
|
2
|
-
import {
|
|
3
|
-
export declare abstract class
|
|
2
|
+
import { RxObject } from "./Mvcc.js";
|
|
3
|
+
export declare abstract class RxReconciliationList<T> extends RxObject implements ReconciliationListReader<T> {
|
|
4
4
|
protected abstract impl: ReconciliationList<T>;
|
|
5
5
|
get isStrict(): boolean;
|
|
6
6
|
get count(): number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export class
|
|
1
|
+
import { RxObject } from "./Mvcc.js";
|
|
2
|
+
export class RxReconciliationList extends RxObject {
|
|
3
3
|
get isStrict() { return this.impl.isStrict; }
|
|
4
4
|
get count() { return this.impl.count; }
|
|
5
5
|
get countOfAdded() { return this.impl.countOfAdded; }
|
|
@@ -8,7 +8,7 @@ import { Mvcc, OptionsImpl } from "./Mvcc.js";
|
|
|
8
8
|
import { JournalImpl } from "./Journal.js";
|
|
9
9
|
const BOOT_ARGS = [];
|
|
10
10
|
const BOOT_CAUSE = "<boot>";
|
|
11
|
-
const EMPTY_HANDLE = new ObjectHandle(undefined, undefined, Mvcc.
|
|
11
|
+
const EMPTY_HANDLE = new ObjectHandle(undefined, undefined, Mvcc.rx, EMPTY_OBJECT_VERSION, "<boot>");
|
|
12
12
|
export class ReactionImpl {
|
|
13
13
|
configure(options) { return ReactionImpl.configureImpl(this, options); }
|
|
14
14
|
get options() { return this.peek(undefined).footprint.options; }
|
|
@@ -2,7 +2,7 @@ import { LoggingOptions } from "../Logging.js";
|
|
|
2
2
|
import { ReconciliationList, ReconciliationListReader, LinkedItem } from "../util/ReconciliationList.js";
|
|
3
3
|
import { Priority, Mode } from "../Enums.js";
|
|
4
4
|
import { ReactivityOptions } from "../Options.js";
|
|
5
|
-
import {
|
|
5
|
+
import { RxObject } from "../core/Mvcc.js";
|
|
6
6
|
export type Script<E> = (this: E, o: E, basis: () => void) => void;
|
|
7
7
|
export type ScriptAsync<E> = (this: E, o: E, basis: () => Promise<void>) => Promise<void>;
|
|
8
8
|
export type Handler<E = unknown, R = void> = (o: E) => R;
|
|
@@ -95,7 +95,7 @@ export declare class ReactiveTreeVariable<T extends Object = Object> {
|
|
|
95
95
|
}
|
|
96
96
|
export declare function generateKey(owner?: ReactiveTreeNode$): string;
|
|
97
97
|
export declare function getModeUsingBasisChain(declaration?: ReactiveTreeNodeDecl<any>): Mode;
|
|
98
|
-
declare class ReactiveTreeNodeContext$<T extends Object = Object> extends
|
|
98
|
+
declare class ReactiveTreeNodeContext$<T extends Object = Object> extends RxObject implements ReactiveTreeNodeContext<T> {
|
|
99
99
|
next: ReactiveTreeNodeContext$<object> | undefined;
|
|
100
100
|
variable: ReactiveTreeVariable<T>;
|
|
101
101
|
value: T;
|
|
@@ -21,7 +21,7 @@ import { Uri } from "../util/Uri.js";
|
|
|
21
21
|
import { ReconciliationList } from "../util/ReconciliationList.js";
|
|
22
22
|
import { emitLetters, flags, getCallerInfo, proceedSyncOrAsync } from "../util/Utils.js";
|
|
23
23
|
import { Priority, Mode, Isolation, Reentrance } from "../Enums.js";
|
|
24
|
-
import {
|
|
24
|
+
import { RxObject } from "../core/Mvcc.js";
|
|
25
25
|
import { Transaction } from "../core/Transaction.js";
|
|
26
26
|
import { ReactiveSystem, options, signal, reaction, runTransactional, runNonReactive, manageReaction, disposeSignallingObject } from "../System.js";
|
|
27
27
|
export function declare(driver, scriptOrDeclaration, scriptAsync, key, mode, preparation, preparationAsync, finalization, triggers, basis) {
|
|
@@ -234,7 +234,7 @@ function invokeFinalizationUsingBasisChain(element, declaration) {
|
|
|
234
234
|
else if (basis)
|
|
235
235
|
invokeFinalizationUsingBasisChain(element, basis);
|
|
236
236
|
}
|
|
237
|
-
class ReactiveTreeNodeContext$ extends
|
|
237
|
+
class ReactiveTreeNodeContext$ extends RxObject {
|
|
238
238
|
constructor(variable, value) {
|
|
239
239
|
super();
|
|
240
240
|
this.next = undefined;
|