@raphy-js/raph 1.0.1-dev.26 → 1.0.1-dev.54
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 +100 -0
- package/dist/api/Raph.d.ts +15 -15
- package/dist/api/RaphFacadeSession.d.ts +4 -4
- package/dist/api/RaphReactivityInstance.d.ts +4 -4
- package/dist/api/types.d.ts +11 -11
- package/dist/compact.cjs +1 -0
- package/dist/compact.js +4 -0
- package/dist/debug/reactivity/engine-core.cjs +1 -0
- package/dist/debug/reactivity/engine-core.js +1760 -0
- package/dist/debug/reactivity/engine.cjs +1 -1
- package/dist/debug/reactivity/engine.js +25 -1689
- package/dist/debug/reactivity/reactive-object.cjs +1 -1
- package/dist/debug/reactivity/reactive-object.js +604 -167
- package/dist/debug/runtime/RaphCompactExecutionRuntime.cjs +1 -0
- package/dist/debug/runtime/RaphCompactExecutionRuntime.js +9 -0
- package/dist/debug/runtime/RaphExecutionRuntime.cjs +1 -0
- package/dist/debug/runtime/RaphExecutionRuntime.js +11 -0
- package/dist/debug/runtime/RaphRuntime.cjs +1 -1
- package/dist/debug/runtime/RaphRuntime.js +115 -1176
- package/dist/debug/runtime/RaphRuntimeBase.cjs +1 -0
- package/dist/debug/runtime/RaphRuntimeBase.js +941 -0
- package/dist/debug/runtime/diagnostics/RaphDebug.cjs +1 -1
- package/dist/debug/runtime/diagnostics/RaphDebug.js +72 -66
- package/dist/debug/runtime/ownership/RaphNode.cjs +1 -1
- package/dist/debug/runtime/ownership/RaphNode.js +11 -0
- package/dist/debug/runtime/ownership/RaphScope.cjs +1 -1
- package/dist/debug/runtime/ownership/RaphScope.js +12 -12
- package/dist/debug/runtime/phases/RaphPhasePipeline.cjs +1 -1
- package/dist/debug/runtime/phases/RaphPhasePipeline.js +361 -242
- package/dist/debug/runtime/phases/RaphPhaseTaskRecord.cjs +1 -1
- package/dist/debug/runtime/phases/RaphPhaseTaskRecord.js +23 -22
- package/dist/debug/runtime/reactivity/RaphSelector.cjs +1 -1
- package/dist/debug/runtime/reactivity/RaphSelector.js +111 -90
- package/dist/debug/runtime/reactivity/RuntimeObjectSupport.cjs +1 -0
- package/dist/debug/runtime/reactivity/RuntimeObjectSupport.js +11 -0
- package/dist/debug/runtime/reactivity/RuntimeReactivity.cjs +1 -1
- package/dist/debug/runtime/reactivity/RuntimeReactivity.js +118 -103
- package/dist/debug/runtime/reactivity/RuntimeSelectorSupport.cjs +1 -0
- package/dist/debug/runtime/reactivity/RuntimeSelectorSupport.js +12 -0
- package/dist/entrypoints/compact.d.ts +2 -0
- package/dist/entrypoints/execution.d.ts +2 -0
- package/dist/entrypoints/machine-testing.d.ts +2 -2
- package/dist/entrypoints/machine.d.ts +5 -5
- package/dist/entrypoints/observable.d.ts +4 -0
- package/dist/entrypoints/path.d.ts +14 -14
- package/dist/entrypoints/reactivity.d.ts +1 -1
- package/dist/entrypoints/runtime.d.ts +19 -18
- package/dist/execution.cjs +1 -0
- package/dist/execution.js +4 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +23 -21
- package/dist/machine/compiler.d.ts +1 -1
- package/dist/machine/core.d.ts +2 -2
- package/dist/machine/persistence.d.ts +1 -1
- package/dist/machine/runtime.d.ts +3 -3
- package/dist/machine/testing.d.ts +1 -1
- package/dist/machine/types.d.ts +3 -3
- package/dist/main.d.ts +19 -19
- package/dist/observable/buffer.d.ts +6 -0
- package/dist/observable/class-admin.d.ts +63 -0
- package/dist/observable/class-plan.d.ts +46 -0
- package/dist/observable/classes.d.ts +10 -0
- package/dist/observable/context.d.ts +73 -0
- package/dist/observable/native.d.ts +2 -0
- package/dist/observable/observable.d.ts +13 -0
- package/dist/observable/types.d.ts +60 -0
- package/dist/observable.cjs +1 -0
- package/dist/observable.js +1187 -0
- package/dist/path/DataPath.d.ts +2 -2
- package/dist/path/PathRouter.d.ts +1 -1
- package/dist/path/RaphKernel.d.ts +6 -6
- package/dist/path/data-path.types.d.ts +1 -1
- package/dist/path/data-path.utils.d.ts +2 -2
- package/dist/path/derived/DerivedRegistry.d.ts +3 -3
- package/dist/path/derived/RaphDerivedHandle.d.ts +3 -3
- package/dist/path/derived/derived-collection.types.d.ts +1 -1
- package/dist/path/derived/derived-collection.utils.d.ts +3 -3
- package/dist/path/derived/derived-strategy.utils.d.ts +1 -1
- package/dist/path/meta/MetaController.d.ts +5 -5
- package/dist/path/meta/RaphMeta.d.ts +3 -3
- package/dist/path/meta/RaphMetaStore.d.ts +1 -1
- package/dist/path/meta/meta.types.d.ts +2 -2
- package/dist/path/path.types.d.ts +2 -2
- package/dist/path/pathSegmentKey.d.ts +1 -1
- package/dist/path/storage/AdapterPathStore.d.ts +2 -2
- package/dist/path/storage/DefaultDataAdapter.d.ts +2 -2
- package/dist/path/storage/PathEventHub.d.ts +1 -1
- package/dist/path/storage/PathStore.d.ts +2 -2
- package/dist/path/storage/data-adapter.types.d.ts +1 -1
- package/dist/raph.cjs +1 -1
- package/dist/raph.js +23 -21
- package/dist/reactivity/engine-core.d.ts +600 -0
- package/dist/reactivity/engine.d.ts +6 -550
- package/dist/reactivity/reactive-object.d.ts +143 -2
- package/dist/reactivity/scope.d.ts +7 -6
- package/dist/reactivity/types.d.ts +9 -12
- package/dist/reactivity/watch.d.ts +1 -1
- package/dist/runtime/RaphCompactExecutionRuntime.d.ts +7 -0
- package/dist/runtime/RaphExecutionRuntime.d.ts +6 -0
- package/dist/runtime/RaphRuntime.d.ts +19 -403
- package/dist/runtime/RaphRuntimeBase.d.ts +194 -0
- package/dist/runtime/diagnostics/RaphDebug.d.ts +8 -5
- package/dist/runtime/errors.d.ts +1 -1
- package/dist/runtime/ownership/RaphEffectScope.d.ts +13 -12
- package/dist/runtime/ownership/RaphNode.d.ts +28 -21
- package/dist/runtime/ownership/RaphScope.d.ts +32 -19
- package/dist/runtime/ownership/parent-graph.types.d.ts +1 -1
- package/dist/runtime/ownership/parentGraph.d.ts +2 -2
- package/dist/runtime/phases/RaphFrameLoop.d.ts +1 -1
- package/dist/runtime/phases/RaphPhasePipeline.d.ts +80 -29
- package/dist/runtime/phases/RaphPhaseTaskRecord.d.ts +21 -21
- package/dist/runtime/phases/RaphPhaseWatch.d.ts +3 -3
- package/dist/runtime/phases/orderPhaseTasks.d.ts +4 -2
- package/dist/runtime/phases/phase.types.d.ts +36 -35
- package/dist/runtime/reactivity/PathHandle.d.ts +5 -5
- package/dist/runtime/reactivity/RaphMetaSource.d.ts +7 -7
- package/dist/runtime/reactivity/RaphSelector.d.ts +27 -6
- package/dist/runtime/reactivity/RaphWorkGraph.d.ts +40 -39
- package/dist/runtime/reactivity/RuntimeObjectSupport.d.ts +9 -0
- package/dist/runtime/reactivity/RuntimeReactivity.d.ts +27 -19
- package/dist/runtime/reactivity/RuntimeSelectorSupport.d.ts +10 -0
- package/dist/runtime/reactivity/RuntimeWatch.d.ts +1 -1
- package/dist/runtime/reactivity/disposal-sweep.utils.d.ts +1 -1
- package/dist/runtime/reactivity/runtime-reactivity.types.d.ts +3 -3
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.js +13 -11
- package/package.json +22 -62
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { RaphCrossRuntimeError as
|
|
3
|
-
import { TASK_TASKLESS as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return { schedule: n, dispose: w };
|
|
1
|
+
import { ReactivityEngine as y } from "../../reactivity/engine-core.js";
|
|
2
|
+
import { RaphCrossRuntimeError as b } from "../errors.js";
|
|
3
|
+
import { TASK_TASKLESS as k } from "../phases/RaphPhaseTaskRecord.js";
|
|
4
|
+
import { RaphProducer as O } from "./RaphWorkGraph.js";
|
|
5
|
+
let c, a;
|
|
6
|
+
function T(o) {
|
|
7
|
+
return { schedule: o, dispose: w };
|
|
9
8
|
}
|
|
10
9
|
let p = 0;
|
|
11
|
-
function R(
|
|
12
|
-
|
|
10
|
+
function R(o) {
|
|
11
|
+
o.firstSub !== null && ++p;
|
|
13
12
|
}
|
|
14
|
-
function
|
|
15
|
-
|
|
13
|
+
function A(o, e, t) {
|
|
14
|
+
o.firstSub === null && t.delete(e);
|
|
16
15
|
}
|
|
17
|
-
const
|
|
18
|
-
class
|
|
16
|
+
const h = Object.freeze({}), m = Object.freeze({ schedule: w, dispose: w }), E = 64;
|
|
17
|
+
class N {
|
|
19
18
|
constructor(e) {
|
|
20
19
|
this.items = [e], this.shared = !1;
|
|
21
20
|
}
|
|
@@ -28,7 +27,7 @@ class C {
|
|
|
28
27
|
return this.items = e, this.shared = !1, e;
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
|
-
class _ extends
|
|
30
|
+
class _ extends O {
|
|
32
31
|
/**
|
|
33
32
|
* Создаёт signal своим собственным handle. Регистрацию у владельца
|
|
34
33
|
* выполняет вызывающий код.
|
|
@@ -65,7 +64,7 @@ class _ extends T {
|
|
|
65
64
|
*/
|
|
66
65
|
toJSON() {
|
|
67
66
|
let e = 0;
|
|
68
|
-
for (let t = this._previousSource; t !== void 0 && e <
|
|
67
|
+
for (let t = this._previousSource; t !== void 0 && e < E; t = t._previousSource)
|
|
69
68
|
++e;
|
|
70
69
|
return {
|
|
71
70
|
kind: this.kind,
|
|
@@ -80,7 +79,7 @@ class _ extends T {
|
|
|
80
79
|
*/
|
|
81
80
|
get() {
|
|
82
81
|
const e = this.owner, t = e.runtime._getReactivity();
|
|
83
|
-
v(t, e), e._assertAlive();
|
|
82
|
+
v(t, e), (e._disposed || e._disposing) && e._assertAlive();
|
|
84
83
|
const r = this._node;
|
|
85
84
|
if (r !== void 0)
|
|
86
85
|
return t._readSignalNode(r);
|
|
@@ -92,7 +91,7 @@ class _ extends T {
|
|
|
92
91
|
*/
|
|
93
92
|
peek() {
|
|
94
93
|
const e = this.owner, t = e.runtime._getReactivity();
|
|
95
|
-
|
|
94
|
+
f(t._lifecycle), e._assertAlive();
|
|
96
95
|
const r = this._node;
|
|
97
96
|
return r === void 0 ? this._value : t._peekSignalNode(r);
|
|
98
97
|
}
|
|
@@ -102,11 +101,11 @@ class _ extends T {
|
|
|
102
101
|
*/
|
|
103
102
|
set(e) {
|
|
104
103
|
const t = this.owner, r = t.runtime, s = r._getReactivity()._lifecycle, i = s.assertWriteAllowed;
|
|
105
|
-
i === void 0 ? (
|
|
104
|
+
i === void 0 ? (f(s), t._assertAlive()) : (t._assertAlive(), i()), r._enterWrite();
|
|
106
105
|
try {
|
|
107
106
|
this._write(e);
|
|
108
|
-
} catch (
|
|
109
|
-
throw r._failWrite(
|
|
107
|
+
} catch (n) {
|
|
108
|
+
throw r._failWrite(n);
|
|
110
109
|
}
|
|
111
110
|
r._exitWrite();
|
|
112
111
|
}
|
|
@@ -117,7 +116,7 @@ class _ extends T {
|
|
|
117
116
|
*/
|
|
118
117
|
_writeInBoundary(e) {
|
|
119
118
|
const t = this.owner;
|
|
120
|
-
|
|
119
|
+
f(t.runtime._getReactivity()._lifecycle), t._assertAlive(), this._write(e);
|
|
121
120
|
}
|
|
122
121
|
/**
|
|
123
122
|
* Подключает наблюдателя фактических записей этого signal. Наблюдатель
|
|
@@ -130,7 +129,7 @@ class _ extends T {
|
|
|
130
129
|
_addWriteTap(e) {
|
|
131
130
|
const t = this._writeTaps;
|
|
132
131
|
if (t === void 0) {
|
|
133
|
-
e._tapSlot = 0, this._writeTaps = new
|
|
132
|
+
e._tapSlot = 0, this._writeTaps = new N(e);
|
|
134
133
|
return;
|
|
135
134
|
}
|
|
136
135
|
const r = t.shared ? t.detach() : t.items;
|
|
@@ -189,10 +188,10 @@ class _ extends T {
|
|
|
189
188
|
const r = this._writeTaps;
|
|
190
189
|
if (r !== void 0) {
|
|
191
190
|
const i = r.items;
|
|
192
|
-
for (let
|
|
193
|
-
const
|
|
194
|
-
if (e(
|
|
195
|
-
return
|
|
191
|
+
for (let n = 0; n < i.length; n++) {
|
|
192
|
+
const d = i[n]._tapOwner;
|
|
193
|
+
if (e(d, t))
|
|
194
|
+
return d;
|
|
196
195
|
}
|
|
197
196
|
}
|
|
198
197
|
const s = this._node;
|
|
@@ -239,8 +238,8 @@ class _ extends T {
|
|
|
239
238
|
}
|
|
240
239
|
const r = this._node;
|
|
241
240
|
if (r !== void 0) {
|
|
242
|
-
const i = this.owner.runtime,
|
|
243
|
-
|
|
241
|
+
const i = this.owner.runtime, n = i._getReactivity(), d = n._visibleSignalValue(r);
|
|
242
|
+
d !== e && i._getWorkGraph()._notifyValueWrite(this, d, e, r.firstSub !== null), n._writeSignalNode(r, e);
|
|
244
243
|
return;
|
|
245
244
|
}
|
|
246
245
|
const s = this._value;
|
|
@@ -260,12 +259,12 @@ class _ extends T {
|
|
|
260
259
|
const r = this._node, s = this.owner.runtime._getReactivity(), i = r === void 0 ? this._value : s._visibleSignalValue(r);
|
|
261
260
|
if (i === e)
|
|
262
261
|
return;
|
|
263
|
-
const
|
|
262
|
+
const n = t.items;
|
|
264
263
|
t.shared = !0;
|
|
265
|
-
let
|
|
266
|
-
for (let u = 0; !
|
|
267
|
-
|
|
268
|
-
this.onChange(i, e,
|
|
264
|
+
let d = r !== void 0 && s._signalNodeHasSubscribers(r);
|
|
265
|
+
for (let u = 0; !d && u < n.length; u++)
|
|
266
|
+
d = n[u]._observesWrites();
|
|
267
|
+
this.onChange(i, e, d);
|
|
269
268
|
let l;
|
|
270
269
|
if (r === void 0)
|
|
271
270
|
this._value = e;
|
|
@@ -275,11 +274,11 @@ class _ extends T {
|
|
|
275
274
|
} catch (u) {
|
|
276
275
|
l = [u];
|
|
277
276
|
}
|
|
278
|
-
for (let u = 0; u <
|
|
277
|
+
for (let u = 0; u < n.length; u++)
|
|
279
278
|
try {
|
|
280
|
-
|
|
281
|
-
} catch (
|
|
282
|
-
(l ??= []).push(
|
|
279
|
+
n[u]._afterSourceWrite(i, e);
|
|
280
|
+
} catch (S) {
|
|
281
|
+
(l ??= []).push(S);
|
|
283
282
|
}
|
|
284
283
|
if (l !== void 0)
|
|
285
284
|
throw l.length === 1 ? l[0] : new AggregateError(l, "[Raph] Signal write and its observers failed.");
|
|
@@ -291,33 +290,47 @@ class g extends y {
|
|
|
291
290
|
* @param _lifecycle Политика lifetime и записи Runtime; её читают handles
|
|
292
291
|
* этого графа, поэтому поле доступно внутри пакета.
|
|
293
292
|
*/
|
|
294
|
-
constructor(e, t = {}) {
|
|
293
|
+
constructor(e, t = {}, r) {
|
|
295
294
|
super({
|
|
296
295
|
...t.adaptiveDependencyIndex === void 0 ? {} : { adaptiveDependencyIndex: t.adaptiveDependencyIndex },
|
|
297
|
-
effectScheduler: { bind:
|
|
298
|
-
}), this._lifecycle = e, this._phaseBody = () => {
|
|
299
|
-
const
|
|
300
|
-
|
|
301
|
-
let
|
|
296
|
+
effectScheduler: { bind: T }
|
|
297
|
+
}), this._lifecycle = e, this._selectors = r, this._phaseBody = () => {
|
|
298
|
+
const s = this._activeEffectTask(), i = s.consumerOwner, n = c, d = a;
|
|
299
|
+
c = e, a = i;
|
|
300
|
+
let l;
|
|
302
301
|
try {
|
|
303
|
-
const
|
|
304
|
-
|
|
302
|
+
const u = s.effect;
|
|
303
|
+
l = u(s.state & k ? s.group : s.task);
|
|
305
304
|
} finally {
|
|
306
|
-
|
|
305
|
+
c = n, a = d;
|
|
307
306
|
}
|
|
308
|
-
return typeof
|
|
309
|
-
}, g._releasedShapeAnchor ??=
|
|
307
|
+
return typeof l == "function" ? W(this, l) : l;
|
|
308
|
+
}, g._releasedShapeAnchor ??= C(this);
|
|
310
309
|
}
|
|
311
310
|
/**
|
|
312
311
|
* Выполняет untracked-операцию, сохраняя runtime owner context.
|
|
313
312
|
*/
|
|
314
313
|
untrackedWithOwner(e) {
|
|
315
|
-
const t =
|
|
316
|
-
|
|
314
|
+
const t = c, r = a;
|
|
315
|
+
c = void 0, a = void 0;
|
|
317
316
|
try {
|
|
318
317
|
return this.untracked(e);
|
|
319
318
|
} finally {
|
|
320
|
-
|
|
319
|
+
c = t, a = r;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* `_probeReads` вне Runtime owner context: проба не наследует контекст
|
|
324
|
+
* потребителя, внутри которого её вызвали.
|
|
325
|
+
* @internal
|
|
326
|
+
*/
|
|
327
|
+
_probeReadsWithOwner(e) {
|
|
328
|
+
const t = c, r = a;
|
|
329
|
+
c = void 0, a = void 0;
|
|
330
|
+
try {
|
|
331
|
+
return this._probeReads(e);
|
|
332
|
+
} finally {
|
|
333
|
+
c = t, a = r;
|
|
321
334
|
}
|
|
322
335
|
}
|
|
323
336
|
/**
|
|
@@ -328,13 +341,13 @@ class g extends y {
|
|
|
328
341
|
*
|
|
329
342
|
* @internal
|
|
330
343
|
*/
|
|
331
|
-
_applyUntrackedWithOwner(e, t) {
|
|
332
|
-
const
|
|
333
|
-
|
|
344
|
+
_applyUntrackedWithOwner(e, t, r) {
|
|
345
|
+
const s = c, i = a;
|
|
346
|
+
c = void 0, a = void 0;
|
|
334
347
|
try {
|
|
335
|
-
return this._isTracking() ? this.untracked(() => e
|
|
348
|
+
return this._isTracking() ? this.untracked(() => Reflect.apply(e, r, t)) : Reflect.apply(e, r, t);
|
|
336
349
|
} finally {
|
|
337
|
-
|
|
350
|
+
c = s, a = i;
|
|
338
351
|
}
|
|
339
352
|
}
|
|
340
353
|
/**
|
|
@@ -345,40 +358,40 @@ class g extends y {
|
|
|
345
358
|
* @internal
|
|
346
359
|
*/
|
|
347
360
|
_runTaskEffectUntracked(e) {
|
|
348
|
-
const t =
|
|
349
|
-
|
|
361
|
+
const t = c, r = a;
|
|
362
|
+
c = void 0, a = void 0;
|
|
350
363
|
try {
|
|
351
364
|
this._finishTaskEffectRun(e);
|
|
352
365
|
} finally {
|
|
353
|
-
|
|
366
|
+
c = t, a = r;
|
|
354
367
|
}
|
|
355
368
|
}
|
|
356
369
|
/**
|
|
357
370
|
* Возвращает owner текущего синхронного реактивного контекста.
|
|
358
371
|
*/
|
|
359
372
|
getActiveOwner() {
|
|
360
|
-
return
|
|
373
|
+
return c === void 0 ? void 0 : c.owner;
|
|
361
374
|
}
|
|
362
375
|
/** Returns the Runtime resource owner whose implicit dependencies are being collected. */
|
|
363
376
|
getActiveConsumerOwner() {
|
|
364
|
-
return
|
|
377
|
+
return a;
|
|
365
378
|
}
|
|
366
379
|
/**
|
|
367
380
|
* Сообщает, должен ли untracked work очищать graph consumer или Runtime owner context.
|
|
368
381
|
*/
|
|
369
382
|
hasActiveContext() {
|
|
370
|
-
return
|
|
383
|
+
return c !== void 0 || this._isTracking();
|
|
371
384
|
}
|
|
372
385
|
/**
|
|
373
386
|
* Выполняет операцию с указанным active owner.
|
|
374
387
|
*/
|
|
375
388
|
runWithOwner(e, t, r) {
|
|
376
|
-
const s =
|
|
377
|
-
|
|
389
|
+
const s = c, i = a;
|
|
390
|
+
c = e, a = e === void 0 ? void 0 : t;
|
|
378
391
|
try {
|
|
379
392
|
return r();
|
|
380
393
|
} finally {
|
|
381
|
-
|
|
394
|
+
c = s, a = i;
|
|
382
395
|
}
|
|
383
396
|
}
|
|
384
397
|
/**
|
|
@@ -393,7 +406,7 @@ class g extends y {
|
|
|
393
406
|
*/
|
|
394
407
|
_findSignalConsumerOwner(e, t, r) {
|
|
395
408
|
for (let s = e._lastOwnedSource(); s !== void 0; s = s._previousSource) {
|
|
396
|
-
if (!(s instanceof _) && !(s
|
|
409
|
+
if (!(s instanceof _) && !this._selectors?.is(s))
|
|
397
410
|
continue;
|
|
398
411
|
const i = s._findConsumerOwner(t, r);
|
|
399
412
|
if (i !== void 0)
|
|
@@ -452,7 +465,7 @@ class g extends y {
|
|
|
452
465
|
const i = e[s];
|
|
453
466
|
i !== void 0 && (i.firstSub === null ? e[s] = void 0 : ++r);
|
|
454
467
|
}
|
|
455
|
-
return t !== void 0 && t.size !== 0 && t.forEach(
|
|
468
|
+
return t !== void 0 && t.size !== 0 && t.forEach(A), r;
|
|
456
469
|
}
|
|
457
470
|
/**
|
|
458
471
|
* Создаёт selector над записываемым Runtime signal и ставит его в список
|
|
@@ -461,6 +474,8 @@ class g extends y {
|
|
|
461
474
|
* переживает selector, а потребители selector могли бы читать source сами.
|
|
462
475
|
*/
|
|
463
476
|
selectorForOwner(e, t, r) {
|
|
477
|
+
if (this._selectors === void 0)
|
|
478
|
+
throw new TypeError("[Raph] Selectors require the full execution profile.");
|
|
464
479
|
if (!(e instanceof _))
|
|
465
480
|
throw new TypeError("[Raph] selector() source must be a writable Runtime signal.");
|
|
466
481
|
const s = r?.equals;
|
|
@@ -468,15 +483,15 @@ class g extends y {
|
|
|
468
483
|
throw new TypeError("[Raph] selector() equals must be a function.");
|
|
469
484
|
const i = e.owner;
|
|
470
485
|
if (i.runtime !== t.runtime)
|
|
471
|
-
throw new
|
|
486
|
+
throw new b("[Raph] selector() source belongs to another runtime.");
|
|
472
487
|
i._assertAlive(), this._lifecycle.assertDependencyAllowed(i, t);
|
|
473
|
-
const
|
|
488
|
+
const n = this._selectors.create(t, this, e, s);
|
|
474
489
|
try {
|
|
475
|
-
t._adoptSourceEntry(
|
|
476
|
-
} catch (
|
|
477
|
-
throw
|
|
490
|
+
t._adoptSourceEntry(n);
|
|
491
|
+
} catch (d) {
|
|
492
|
+
throw n._finalizeSource(), d;
|
|
478
493
|
}
|
|
479
|
-
return
|
|
494
|
+
return n;
|
|
480
495
|
}
|
|
481
496
|
/**
|
|
482
497
|
* Создаёт Runtime signal и ставит его в список источников владельца. Signal
|
|
@@ -494,51 +509,51 @@ class g extends y {
|
|
|
494
509
|
return {
|
|
495
510
|
get: () => {
|
|
496
511
|
v(this, t), t._assertAlive();
|
|
497
|
-
const
|
|
498
|
-
return t._assertAlive(),
|
|
512
|
+
const n = i.get();
|
|
513
|
+
return t._assertAlive(), n;
|
|
499
514
|
},
|
|
500
515
|
peek() {
|
|
501
|
-
|
|
502
|
-
const
|
|
503
|
-
return t._assertAlive(),
|
|
516
|
+
f(s), t._assertAlive();
|
|
517
|
+
const n = i.peek();
|
|
518
|
+
return t._assertAlive(), n;
|
|
504
519
|
}
|
|
505
520
|
};
|
|
506
521
|
}
|
|
507
522
|
}
|
|
508
523
|
g._releasedShapeAnchor = void 0;
|
|
509
|
-
function
|
|
524
|
+
function C(o) {
|
|
510
525
|
let e, t;
|
|
511
|
-
const r =
|
|
512
|
-
e =
|
|
513
|
-
},
|
|
514
|
-
|
|
526
|
+
const r = o._allocateTaskEffect(() => {
|
|
527
|
+
e = o._trackSignalNode(void 0, h), t = o._trackSignalNode(void 0, h);
|
|
528
|
+
}, m);
|
|
529
|
+
o._requestTaskEffect(r, !1), o._beginTaskEffectRun(r), o._finishTaskEffectRun(r);
|
|
515
530
|
const s = e.firstSub;
|
|
516
|
-
|
|
517
|
-
let i,
|
|
518
|
-
const
|
|
519
|
-
i =
|
|
520
|
-
},
|
|
521
|
-
return
|
|
522
|
-
|
|
523
|
-
}),
|
|
531
|
+
o._disposeTaskEffect(r), o.batch(() => o._writeSignalNode(t, 0)), o._releaseSignalNode(e), o._releaseSignalNode(t);
|
|
532
|
+
let i, n;
|
|
533
|
+
const d = o._allocateTaskEffect(() => {
|
|
534
|
+
i = o._trackCounterNode(h), n = o._trackCounterNode(h);
|
|
535
|
+
}, m);
|
|
536
|
+
return o._requestTaskEffect(d, !1), o._beginTaskEffectRun(d), o._finishTaskEffectRun(d), o.batch(() => {
|
|
537
|
+
o._bumpSignalNode(n);
|
|
538
|
+
}), o._disposeTaskEffect(d), o._releaseSignalNode(i), o._releaseSignalNode(n), { source: e, written: t, edge: s, consumer: r, counter: i, bumped: n };
|
|
524
539
|
}
|
|
525
|
-
function
|
|
526
|
-
return () =>
|
|
540
|
+
function W(o, e) {
|
|
541
|
+
return () => o.untrackedWithOwner(e);
|
|
527
542
|
}
|
|
528
|
-
function
|
|
529
|
-
|
|
543
|
+
function f(o) {
|
|
544
|
+
o.owner === void 0 && o.throwDisposed();
|
|
530
545
|
}
|
|
531
|
-
function v(
|
|
532
|
-
const t =
|
|
533
|
-
|
|
534
|
-
const r =
|
|
546
|
+
function v(o, e) {
|
|
547
|
+
const t = o._lifecycle;
|
|
548
|
+
t.owner === void 0 && t.throwDisposed();
|
|
549
|
+
const r = c;
|
|
535
550
|
if (r !== void 0) {
|
|
536
551
|
r !== t && t.throwCrossRuntime(r.owner);
|
|
537
|
-
const i =
|
|
552
|
+
const i = a;
|
|
538
553
|
i !== void 0 && i !== e && t.assertDependencyAllowed(e, i);
|
|
539
554
|
return;
|
|
540
555
|
}
|
|
541
|
-
const s =
|
|
556
|
+
const s = o._activeSubscriberOwner();
|
|
542
557
|
s !== void 0 && t.assertDependencyAllowed(e, s);
|
|
543
558
|
}
|
|
544
559
|
function w() {
|
|
@@ -546,5 +561,5 @@ function w() {
|
|
|
546
561
|
export {
|
|
547
562
|
g as RuntimeReactivity,
|
|
548
563
|
_ as RuntimeSignal,
|
|
549
|
-
|
|
564
|
+
E as SIGNAL_INDEX_LIMIT
|
|
550
565
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./RaphSelector.cjs"),i=Object.freeze({create(e,r,n,c){return new t.RuntimeSelector(e,r,n,c)},is(e){return e instanceof t.RuntimeSelector}});exports.RUNTIME_SELECTOR_SUPPORT=i;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { createMachineCoverage, createManualMachineClock, enumerateMachinePaths, inspectMachine, } from '../machine/testing';
|
|
2
|
-
export type { EnumeratedMachinePath, EnumerateMachinePathOptions, MachineCoverage, MachineCoverageReport, MachineInspection, ManualMachineClock, } from '../machine/testing';
|
|
1
|
+
export { createMachineCoverage, createManualMachineClock, enumerateMachinePaths, inspectMachine, } from '../machine/testing.js';
|
|
2
|
+
export type { EnumeratedMachinePath, EnumerateMachinePathOptions, MachineCoverage, MachineCoverageReport, MachineInspection, ManualMachineClock, } from '../machine/testing.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { defineMachine } from '../machine/compiler';
|
|
2
|
-
export { getInitialSnapshot, transition } from '../machine/core';
|
|
3
|
-
export { MachinePersistenceError, persistMachineSnapshot, restoreMachineSnapshot, } from '../machine/persistence';
|
|
4
|
-
export { createMachine } from '../machine/runtime';
|
|
5
|
-
export type { CreateMachineOptions, MachineActorRef, MachineBindings, MachineClock, MachineConfig, MachineEvent, MachineEventStatus, MachineGuard, MachineGuardArgs, MachineInstance, MachineInvokeConfig, MachineMigration, MachineModel, MachineOutput, MachineOutputArgs, MachineReducer, MachineReducerArgs, MachineResource, MachineResourceArgs, MachineSendResult, MachineSnapshot, MachineStateConfig, MachineStatus, MachineTask, MachineTaskArgs, MachineTransitionConfig, MachineTransitionDefinition, PersistedMachineSnapshot, } from '../machine/types';
|
|
1
|
+
export { defineMachine } from '../machine/compiler.js';
|
|
2
|
+
export { getInitialSnapshot, transition } from '../machine/core.js';
|
|
3
|
+
export { MachinePersistenceError, persistMachineSnapshot, restoreMachineSnapshot, } from '../machine/persistence.js';
|
|
4
|
+
export { createMachine } from '../machine/runtime.js';
|
|
5
|
+
export type { CreateMachineOptions, MachineActorRef, MachineBindings, MachineClock, MachineConfig, MachineEvent, MachineEventStatus, MachineGuard, MachineGuardArgs, MachineInstance, MachineInvokeConfig, MachineMigration, MachineModel, MachineOutput, MachineOutputArgs, MachineReducer, MachineReducerArgs, MachineResource, MachineResourceArgs, MachineSendResult, MachineSnapshot, MachineStateConfig, MachineStatus, MachineTask, MachineTaskArgs, MachineTransitionConfig, MachineTransitionDefinition, PersistedMachineSnapshot, } from '../machine/types.js';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { observableBuffer } from '../observable/buffer.js';
|
|
2
|
+
export { makeAutoObservable, makeObservable } from '../observable/classes.js';
|
|
3
|
+
export { defineObservableAdapter, observable } from '../observable/observable.js';
|
|
4
|
+
export type { ObservableAdapter, ObservableAdapterContext, ObservableAnnotation, ObservableAnnotations, ObservableBuffer, ObservableBufferRange, ObservableBufferValue, ObservableClassOptions, ObservableOptions, } from '../observable/types.js';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export type { DataPathParseOptions, PathScalar, PathSegment, PlainDataPath, } from '../path/data-path.types';
|
|
2
|
-
export { DataPath } from '../path/DataPath';
|
|
3
|
-
export type { DerivedCollectionByKeyStrategy, DerivedFilterByKeyStrategy, DerivedFullStrategy, DerivedStrategy, } from '../path/derived/derived-strategy.types';
|
|
4
|
-
export { collectionByKey, filterByKey, full } from '../path/derived/derived-strategy.utils';
|
|
5
|
-
export { RaphDerivedHandle } from '../path/derived/RaphDerivedHandle';
|
|
6
|
-
export type { DerivedOptions } from '../path/derived/RaphDerivedHandle';
|
|
7
|
-
export type { RaphMetaApi, RaphMetaEvents, RaphMetaMutationCause, RaphMetaMutationEvent, RaphMetaMutationKind, RaphMetaReadOptions, RaphMetaWatchCallback, RaphMetaWatchOptions, RaphMetaWriteOptions, } from '../path/meta/meta.types';
|
|
8
|
-
export { RaphMeta } from '../path/meta/RaphMeta';
|
|
9
|
-
export type { DataPathDef, PathApi, PathEvent, PathEvents, PathMutationKind, PathOptions, PathWatchCallback, } from '../path/path.types';
|
|
10
|
-
export { RaphKernel } from '../path/RaphKernel';
|
|
11
|
-
export type { RaphKernelOptions, RaphKernelRoot, RaphKernelRuntime, } from '../path/RaphKernel';
|
|
12
|
-
export type { DataAdapter, DataObject, DefaultAdapterOptions, } from '../path/storage/data-adapter.types';
|
|
13
|
-
export { DefaultDataAdapter } from '../path/storage/DefaultDataAdapter';
|
|
14
|
-
export { PathStore } from '../path/storage/PathStore';
|
|
1
|
+
export type { DataPathParseOptions, PathScalar, PathSegment, PlainDataPath, } from '../path/data-path.types.js';
|
|
2
|
+
export { DataPath } from '../path/DataPath.js';
|
|
3
|
+
export type { DerivedCollectionByKeyStrategy, DerivedFilterByKeyStrategy, DerivedFullStrategy, DerivedStrategy, } from '../path/derived/derived-strategy.types.js';
|
|
4
|
+
export { collectionByKey, filterByKey, full } from '../path/derived/derived-strategy.utils.js';
|
|
5
|
+
export { RaphDerivedHandle } from '../path/derived/RaphDerivedHandle.js';
|
|
6
|
+
export type { DerivedOptions } from '../path/derived/RaphDerivedHandle.js';
|
|
7
|
+
export type { RaphMetaApi, RaphMetaEvents, RaphMetaMutationCause, RaphMetaMutationEvent, RaphMetaMutationKind, RaphMetaReadOptions, RaphMetaWatchCallback, RaphMetaWatchOptions, RaphMetaWriteOptions, } from '../path/meta/meta.types.js';
|
|
8
|
+
export { RaphMeta } from '../path/meta/RaphMeta.js';
|
|
9
|
+
export type { DataPathDef, PathApi, PathEvent, PathEvents, PathMutationKind, PathOptions, PathWatchCallback, } from '../path/path.types.js';
|
|
10
|
+
export { RaphKernel } from '../path/RaphKernel.js';
|
|
11
|
+
export type { RaphKernelOptions, RaphKernelRoot, RaphKernelRuntime, } from '../path/RaphKernel.js';
|
|
12
|
+
export type { DataAdapter, DataObject, DefaultAdapterOptions, } from '../path/storage/data-adapter.types.js';
|
|
13
|
+
export { DefaultDataAdapter } from '../path/storage/DefaultDataAdapter.js';
|
|
14
|
+
export { PathStore } from '../path/storage/PathStore.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '../reactivity/engine';
|
|
1
|
+
export * from '../reactivity/engine.js';
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
export type { RaphDebugFrameLoopSnapshot, RaphDebugMachinesApi, RaphDebugOptions, RaphDebugOwnerSnapshot, RaphDebugSnapshot, RaphDebugStats, RaphDebugTraceApi, RaphDebugTreeNode, RaphMachineDebugSnapshot, RaphMachineDebugSummary, RaphRuntimeDebug, RaphTraceContextMode, RaphTraceEvent, RaphTraceGuardMode, RaphTraceKind, RaphTraceOptions, RaphTraceReadOptions, RaphTraceStatus, } from '../runtime/diagnostics/RaphDebug';
|
|
2
|
-
export { RaphActionError, RaphCrossRuntimeError, RaphDisposedError, RaphPhaseProcessError, } from '../runtime/errors';
|
|
3
|
-
export type { DepGraph } from '../runtime/ownership/parent-graph.types';
|
|
4
|
-
export { parentGraph } from '../runtime/ownership/parentGraph';
|
|
5
|
-
export { RaphEffectScope } from '../runtime/ownership/RaphEffectScope';
|
|
6
|
-
export { RaphNode } from '../runtime/ownership/RaphNode';
|
|
7
|
-
export type { NodeOptions } from '../runtime/ownership/RaphNode';
|
|
8
|
-
export { RaphScope } from '../runtime/ownership/RaphScope';
|
|
9
|
-
export { orderPhaseTasks } from '../runtime/phases/orderPhaseTasks';
|
|
10
|
-
export { RaphSchedulerType } from '../runtime/phases/phase.types';
|
|
11
|
-
export type { FrameLoopLease, RaphAggregateSource, RaphEffectGroup, RaphEffectGroupOptions, RaphEffectGroupRun, RaphEffectGroupSlot, RaphEffectInitialMode, RaphEffectOptions, RaphFrameContext, RaphPhase, RaphPhaseBatch, RaphPhaseBody, RaphPhaseEffect, RaphPhaseTask, RaphSchedulerMode, RaphStructureCause, RaphTaskOrderOptions, RaphWatchInclude, RaphWatchInitialMode, RaphWatchOptions, RaphWatchSource, RaphWorkCause, RaphWorkCauseKind, } from '../runtime/phases/phase.types';
|
|
12
|
-
export { RaphRuntime } from '../runtime/RaphRuntime';
|
|
13
|
-
export type { RaphRuntimeConfiguration, RaphRuntimeMeta, RaphRuntimeOptions, } from '../runtime/RaphRuntime';
|
|
14
|
-
export { PathHandle } from '../runtime/reactivity/PathHandle';
|
|
15
|
-
export type { RaphMetaSource } from '../runtime/reactivity/RaphMetaSource';
|
|
16
|
-
export type { RaphMetaSourceOptions } from '../runtime/reactivity/RaphMetaSource';
|
|
17
|
-
export type { RaphSelector, RaphSelectorOptions } from '../runtime/reactivity/RaphSelector';
|
|
18
|
-
export
|
|
1
|
+
export type { RaphDebugFrameLoopSnapshot, RaphDebugMachinesApi, RaphDebugOptions, RaphDebugOwnerSnapshot, RaphDebugSnapshot, RaphDebugStats, RaphDebugTraceApi, RaphDebugTreeNode, RaphMachineDebugSnapshot, RaphMachineDebugSummary, RaphRuntimeDebug, RaphTraceContextMode, RaphTraceEvent, RaphTraceGuardMode, RaphTraceKind, RaphTraceOptions, RaphTraceReadOptions, RaphTraceStatus, } from '../runtime/diagnostics/RaphDebug.js';
|
|
2
|
+
export { RaphActionError, RaphCrossRuntimeError, RaphDisposedError, RaphPhaseProcessError, } from '../runtime/errors.js';
|
|
3
|
+
export type { DepGraph } from '../runtime/ownership/parent-graph.types.js';
|
|
4
|
+
export { parentGraph } from '../runtime/ownership/parentGraph.js';
|
|
5
|
+
export { RaphEffectScope } from '../runtime/ownership/RaphEffectScope.js';
|
|
6
|
+
export { RaphNode } from '../runtime/ownership/RaphNode.js';
|
|
7
|
+
export type { NodeOptions } from '../runtime/ownership/RaphNode.js';
|
|
8
|
+
export { RaphScope } from '../runtime/ownership/RaphScope.js';
|
|
9
|
+
export { orderPhaseTasks } from '../runtime/phases/orderPhaseTasks.js';
|
|
10
|
+
export { RaphSchedulerType } from '../runtime/phases/phase.types.js';
|
|
11
|
+
export type { FrameLoopLease, RaphAggregateSource, RaphEffectGroup, RaphEffectGroupOptions, RaphEffectGroupRun, RaphEffectGroupSlot, RaphEffectInitialMode, RaphEffectOptions, RaphFrameContext, RaphPhase, RaphPhaseBatch, RaphPhaseBody, RaphPhaseEffect, RaphPhaseTask, RaphSchedulerMode, RaphStructureCause, RaphTaskOrderOptions, RaphWatchInclude, RaphWatchInitialMode, RaphWatchOptions, RaphWatchSource, RaphWorkCause, RaphWorkCauseKind, } from '../runtime/phases/phase.types.js';
|
|
12
|
+
export { RaphRuntime } from '../runtime/RaphRuntime.js';
|
|
13
|
+
export type { RaphRuntimeConfiguration, RaphRuntimeMeta, RaphRuntimeOptions, } from '../runtime/RaphRuntime.js';
|
|
14
|
+
export { PathHandle } from '../runtime/reactivity/PathHandle.js';
|
|
15
|
+
export type { RaphMetaSource } from '../runtime/reactivity/RaphMetaSource.js';
|
|
16
|
+
export type { RaphMetaSourceOptions } from '../runtime/reactivity/RaphMetaSource.js';
|
|
17
|
+
export type { RaphSelector, RaphSelectorInspection, RaphSelectorOptions } from '../runtime/reactivity/RaphSelector.js';
|
|
18
|
+
export { inspectSelector } from '../runtime/reactivity/RaphSelector.js';
|
|
19
|
+
export type { RaphAggregate } from '../runtime/reactivity/RaphWorkGraph.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./debug/runtime/RaphExecutionRuntime.cjs");exports.RaphExecutionRuntime=e.RaphExecutionRuntime;
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./debug/api/errors.cjs"),p=require("./debug/api/Raph.cjs"),i=require("./debug/api/RaphReactivityInstance.cjs"),r=require("./debug/runtime/errors.cjs"),o=require("./debug/runtime/ownership/parentGraph.cjs"),h=require("./debug/runtime/ownership/RaphEffectScope.cjs"),n=require("./debug/runtime/ownership/RaphNode.cjs"),s=require("./debug/runtime/ownership/RaphScope.cjs"),u=require("./debug/runtime/phases/orderPhaseTasks.cjs"),R=require("./debug/runtime/phases/phase.types.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./debug/api/errors.cjs"),p=require("./debug/api/Raph.cjs"),i=require("./debug/api/RaphReactivityInstance.cjs"),r=require("./debug/runtime/errors.cjs"),o=require("./debug/runtime/ownership/parentGraph.cjs"),h=require("./debug/runtime/ownership/RaphEffectScope.cjs"),n=require("./debug/runtime/ownership/RaphNode.cjs"),s=require("./debug/runtime/ownership/RaphScope.cjs"),u=require("./debug/runtime/phases/orderPhaseTasks.cjs"),R=require("./debug/runtime/phases/phase.types.cjs"),c=require("./debug/runtime/RaphRuntime.cjs"),d=require("./debug/runtime/reactivity/PathHandle.cjs"),_=require("./debug/runtime/reactivity/RaphSelector.cjs"),l=require("./debug/path/DataPath.cjs"),a=require("./debug/path/derived/derived-strategy.utils.cjs"),t=require("./debug/path/derived/RaphDerivedHandle.cjs"),g=require("./debug/path/meta/RaphMeta.cjs"),b=require("./debug/path/RaphKernel.cjs"),E=require("./debug/path/storage/DefaultDataAdapter.cjs");exports.RaphCapabilityError=e.RaphCapabilityError;exports.RaphConfigurationError=e.RaphConfigurationError;exports.RaphDefaultInstanceError=e.RaphDefaultInstanceError;exports.RaphError=e.RaphError;exports.RaphFacadeDisposedError=e.RaphFacadeDisposedError;exports.Raph=p.Raph;exports.RaphReactivityInstance=i.RaphReactivityInstance;exports.RaphActionError=r.RaphActionError;exports.RaphCrossRuntimeError=r.RaphCrossRuntimeError;exports.RaphDisposedError=r.RaphDisposedError;exports.RaphPhaseProcessError=r.RaphPhaseProcessError;exports.parentGraph=o.parentGraph;exports.RaphEffectScope=h.RaphEffectScope;exports.RaphNode=n.RaphNode;exports.RaphScope=s.RaphScope;exports.orderPhaseTasks=u.orderPhaseTasks;exports.RaphSchedulerType=R.RaphSchedulerType;exports.RaphRuntime=c.RaphRuntime;exports.PathHandle=d.PathHandle;exports.inspectSelector=_.inspectSelector;exports.DataPath=l.DataPath;exports.collectionByKey=a.collectionByKey;exports.filterByKey=a.filterByKey;exports.full=a.full;exports.RaphDerivedHandle=t.RaphDerivedHandle;exports.RaphDerivedTargetWriteError=t.RaphDerivedTargetWriteError;exports.RaphMeta=g.RaphMeta;exports.RaphKernel=b.RaphKernel;exports.DefaultDataAdapter=E.DefaultDataAdapter;
|