@raphy-js/raph 1.0.1-dev.25 → 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.
Files changed (127) hide show
  1. package/README.md +100 -0
  2. package/dist/api/Raph.d.ts +15 -15
  3. package/dist/api/RaphFacadeSession.d.ts +4 -4
  4. package/dist/api/RaphReactivityInstance.d.ts +4 -4
  5. package/dist/api/types.d.ts +11 -11
  6. package/dist/compact.cjs +1 -0
  7. package/dist/compact.js +4 -0
  8. package/dist/debug/reactivity/engine-core.cjs +1 -0
  9. package/dist/debug/reactivity/engine-core.js +1760 -0
  10. package/dist/debug/reactivity/engine.cjs +1 -1
  11. package/dist/debug/reactivity/engine.js +25 -1689
  12. package/dist/debug/reactivity/reactive-object.cjs +1 -1
  13. package/dist/debug/reactivity/reactive-object.js +604 -167
  14. package/dist/debug/runtime/RaphCompactExecutionRuntime.cjs +1 -0
  15. package/dist/debug/runtime/RaphCompactExecutionRuntime.js +9 -0
  16. package/dist/debug/runtime/RaphExecutionRuntime.cjs +1 -0
  17. package/dist/debug/runtime/RaphExecutionRuntime.js +11 -0
  18. package/dist/debug/runtime/RaphRuntime.cjs +1 -1
  19. package/dist/debug/runtime/RaphRuntime.js +115 -1176
  20. package/dist/debug/runtime/RaphRuntimeBase.cjs +1 -0
  21. package/dist/debug/runtime/RaphRuntimeBase.js +941 -0
  22. package/dist/debug/runtime/diagnostics/RaphDebug.cjs +1 -1
  23. package/dist/debug/runtime/diagnostics/RaphDebug.js +72 -66
  24. package/dist/debug/runtime/ownership/RaphNode.cjs +1 -1
  25. package/dist/debug/runtime/ownership/RaphNode.js +11 -0
  26. package/dist/debug/runtime/ownership/RaphScope.cjs +1 -1
  27. package/dist/debug/runtime/ownership/RaphScope.js +12 -12
  28. package/dist/debug/runtime/phases/RaphPhasePipeline.cjs +1 -1
  29. package/dist/debug/runtime/phases/RaphPhasePipeline.js +361 -242
  30. package/dist/debug/runtime/phases/RaphPhaseTaskRecord.cjs +1 -1
  31. package/dist/debug/runtime/phases/RaphPhaseTaskRecord.js +23 -22
  32. package/dist/debug/runtime/reactivity/RaphSelector.cjs +1 -1
  33. package/dist/debug/runtime/reactivity/RaphSelector.js +111 -90
  34. package/dist/debug/runtime/reactivity/RuntimeObjectSupport.cjs +1 -0
  35. package/dist/debug/runtime/reactivity/RuntimeObjectSupport.js +11 -0
  36. package/dist/debug/runtime/reactivity/RuntimeReactivity.cjs +1 -1
  37. package/dist/debug/runtime/reactivity/RuntimeReactivity.js +118 -103
  38. package/dist/debug/runtime/reactivity/RuntimeSelectorSupport.cjs +1 -0
  39. package/dist/debug/runtime/reactivity/RuntimeSelectorSupport.js +12 -0
  40. package/dist/entrypoints/compact.d.ts +2 -0
  41. package/dist/entrypoints/execution.d.ts +2 -0
  42. package/dist/entrypoints/machine-testing.d.ts +2 -2
  43. package/dist/entrypoints/machine.d.ts +5 -5
  44. package/dist/entrypoints/observable.d.ts +4 -0
  45. package/dist/entrypoints/path.d.ts +14 -14
  46. package/dist/entrypoints/reactivity.d.ts +1 -1
  47. package/dist/entrypoints/runtime.d.ts +19 -18
  48. package/dist/execution.cjs +1 -0
  49. package/dist/execution.js +4 -0
  50. package/dist/index.cjs +1 -1
  51. package/dist/index.js +23 -21
  52. package/dist/machine/compiler.d.ts +1 -1
  53. package/dist/machine/core.d.ts +2 -2
  54. package/dist/machine/persistence.d.ts +1 -1
  55. package/dist/machine/runtime.d.ts +3 -3
  56. package/dist/machine/testing.d.ts +1 -1
  57. package/dist/machine/types.d.ts +3 -3
  58. package/dist/main.d.ts +19 -19
  59. package/dist/observable/buffer.d.ts +6 -0
  60. package/dist/observable/class-admin.d.ts +63 -0
  61. package/dist/observable/class-plan.d.ts +46 -0
  62. package/dist/observable/classes.d.ts +10 -0
  63. package/dist/observable/context.d.ts +73 -0
  64. package/dist/observable/native.d.ts +2 -0
  65. package/dist/observable/observable.d.ts +13 -0
  66. package/dist/observable/types.d.ts +60 -0
  67. package/dist/observable.cjs +1 -0
  68. package/dist/observable.js +1187 -0
  69. package/dist/path/DataPath.d.ts +2 -2
  70. package/dist/path/PathRouter.d.ts +1 -1
  71. package/dist/path/RaphKernel.d.ts +6 -6
  72. package/dist/path/data-path.types.d.ts +1 -1
  73. package/dist/path/data-path.utils.d.ts +2 -2
  74. package/dist/path/derived/DerivedRegistry.d.ts +3 -3
  75. package/dist/path/derived/RaphDerivedHandle.d.ts +3 -3
  76. package/dist/path/derived/derived-collection.types.d.ts +1 -1
  77. package/dist/path/derived/derived-collection.utils.d.ts +3 -3
  78. package/dist/path/derived/derived-strategy.utils.d.ts +1 -1
  79. package/dist/path/meta/MetaController.d.ts +5 -5
  80. package/dist/path/meta/RaphMeta.d.ts +3 -3
  81. package/dist/path/meta/RaphMetaStore.d.ts +1 -1
  82. package/dist/path/meta/meta.types.d.ts +2 -2
  83. package/dist/path/path.types.d.ts +2 -2
  84. package/dist/path/pathSegmentKey.d.ts +1 -1
  85. package/dist/path/storage/AdapterPathStore.d.ts +2 -2
  86. package/dist/path/storage/DefaultDataAdapter.d.ts +2 -2
  87. package/dist/path/storage/PathEventHub.d.ts +1 -1
  88. package/dist/path/storage/PathStore.d.ts +2 -2
  89. package/dist/path/storage/data-adapter.types.d.ts +1 -1
  90. package/dist/raph.cjs +1 -1
  91. package/dist/raph.js +23 -21
  92. package/dist/reactivity/engine-core.d.ts +600 -0
  93. package/dist/reactivity/engine.d.ts +6 -550
  94. package/dist/reactivity/reactive-object.d.ts +143 -2
  95. package/dist/reactivity/scope.d.ts +7 -6
  96. package/dist/reactivity/types.d.ts +9 -12
  97. package/dist/reactivity/watch.d.ts +1 -1
  98. package/dist/runtime/RaphCompactExecutionRuntime.d.ts +7 -0
  99. package/dist/runtime/RaphExecutionRuntime.d.ts +6 -0
  100. package/dist/runtime/RaphRuntime.d.ts +19 -403
  101. package/dist/runtime/RaphRuntimeBase.d.ts +194 -0
  102. package/dist/runtime/diagnostics/RaphDebug.d.ts +8 -5
  103. package/dist/runtime/errors.d.ts +1 -1
  104. package/dist/runtime/ownership/RaphEffectScope.d.ts +13 -12
  105. package/dist/runtime/ownership/RaphNode.d.ts +28 -21
  106. package/dist/runtime/ownership/RaphScope.d.ts +32 -19
  107. package/dist/runtime/ownership/parent-graph.types.d.ts +1 -1
  108. package/dist/runtime/ownership/parentGraph.d.ts +2 -2
  109. package/dist/runtime/phases/RaphFrameLoop.d.ts +1 -1
  110. package/dist/runtime/phases/RaphPhasePipeline.d.ts +80 -29
  111. package/dist/runtime/phases/RaphPhaseTaskRecord.d.ts +21 -21
  112. package/dist/runtime/phases/RaphPhaseWatch.d.ts +3 -3
  113. package/dist/runtime/phases/orderPhaseTasks.d.ts +4 -2
  114. package/dist/runtime/phases/phase.types.d.ts +36 -35
  115. package/dist/runtime/reactivity/PathHandle.d.ts +5 -5
  116. package/dist/runtime/reactivity/RaphMetaSource.d.ts +7 -7
  117. package/dist/runtime/reactivity/RaphSelector.d.ts +27 -6
  118. package/dist/runtime/reactivity/RaphWorkGraph.d.ts +40 -39
  119. package/dist/runtime/reactivity/RuntimeObjectSupport.d.ts +9 -0
  120. package/dist/runtime/reactivity/RuntimeReactivity.d.ts +27 -19
  121. package/dist/runtime/reactivity/RuntimeSelectorSupport.d.ts +10 -0
  122. package/dist/runtime/reactivity/RuntimeWatch.d.ts +1 -1
  123. package/dist/runtime/reactivity/disposal-sweep.utils.d.ts +1 -1
  124. package/dist/runtime/reactivity/runtime-reactivity.types.d.ts +3 -3
  125. package/dist/runtime.cjs +1 -1
  126. package/dist/runtime.js +13 -11
  127. package/package.json +22 -62
@@ -1,21 +1,20 @@
1
- import { RaphReactivity as y } from "../../reactivity/engine.js";
2
- import { RaphCrossRuntimeError as k } from "../errors.js";
3
- import { TASK_TASKLESS as O } from "../phases/RaphPhaseTaskRecord.js";
4
- import { RuntimeSelector as m } from "./RaphSelector.js";
5
- import { RaphProducer as T } from "./RaphWorkGraph.js";
6
- let a, d;
7
- function A(n) {
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(n) {
12
- n.firstSub !== null && ++p;
10
+ function R(o) {
11
+ o.firstSub !== null && ++p;
13
12
  }
14
- function E(n, e, t) {
15
- n.firstSub === null && t.delete(e);
13
+ function A(o, e, t) {
14
+ o.firstSub === null && t.delete(e);
16
15
  }
17
- const f = Object.freeze({}), S = Object.freeze({ schedule: w, dispose: w }), N = 64;
18
- class C {
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 T {
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 < N; t = t._previousSource)
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
- h(t._lifecycle), e._assertAlive();
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 ? (h(s), t._assertAlive()) : (t._assertAlive(), i()), r._enterWrite();
104
+ i === void 0 ? (f(s), t._assertAlive()) : (t._assertAlive(), i()), r._enterWrite();
106
105
  try {
107
106
  this._write(e);
108
- } catch (o) {
109
- throw r._failWrite(o);
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
- h(t.runtime._getReactivity()._lifecycle), t._assertAlive(), this._write(e);
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 C(e);
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 o = 0; o < i.length; o++) {
193
- const c = i[o]._tapOwner;
194
- if (e(c, t))
195
- return c;
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, o = i._getReactivity(), c = o._visibleSignalValue(r);
243
- c !== e && i._getWorkGraph()._notifyValueWrite(this, c, e, r.firstSub !== null), o._writeSignalNode(r, e);
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 o = t.items;
262
+ const n = t.items;
264
263
  t.shared = !0;
265
- let c = r !== void 0 && s._signalNodeHasSubscribers(r);
266
- for (let u = 0; !c && u < o.length; u++)
267
- c = o[u]._observesWrites();
268
- this.onChange(i, e, c);
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 < o.length; u++)
277
+ for (let u = 0; u < n.length; u++)
279
278
  try {
280
- o[u]._afterSourceWrite(i, e);
281
- } catch (b) {
282
- (l ??= []).push(b);
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: A }
298
- }), this._lifecycle = e, this._phaseBody = () => {
299
- const r = this._activeEffectTask(), s = r.consumerOwner, i = a, o = d;
300
- a = e, d = s;
301
- let c;
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 l = r.effect;
304
- c = l(r.state & O ? r.group : r.task);
302
+ const u = s.effect;
303
+ l = u(s.state & k ? s.group : s.task);
305
304
  } finally {
306
- a = i, d = o;
305
+ c = n, a = d;
307
306
  }
308
- return typeof c == "function" ? D(this, c) : c;
309
- }, g._releasedShapeAnchor ??= W(this);
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 = a, r = d;
316
- a = void 0, d = void 0;
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
- a = t, d = r;
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 r = a, s = d;
333
- a = void 0, d = void 0;
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(...t)) : e(...t);
348
+ return this._isTracking() ? this.untracked(() => Reflect.apply(e, r, t)) : Reflect.apply(e, r, t);
336
349
  } finally {
337
- a = r, d = s;
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 = a, r = d;
349
- a = void 0, d = void 0;
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
- a = t, d = r;
366
+ c = t, a = r;
354
367
  }
355
368
  }
356
369
  /**
357
370
  * Возвращает owner текущего синхронного реактивного контекста.
358
371
  */
359
372
  getActiveOwner() {
360
- return a === void 0 ? void 0 : a.owner;
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 d;
377
+ return a;
365
378
  }
366
379
  /**
367
380
  * Сообщает, должен ли untracked work очищать graph consumer или Runtime owner context.
368
381
  */
369
382
  hasActiveContext() {
370
- return a !== void 0 || this._isTracking();
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 = a, i = d;
377
- a = e, d = e === void 0 ? void 0 : t;
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
- a = s, d = i;
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 instanceof m))
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(E), r;
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 k("[Raph] selector() source belongs to another runtime.");
486
+ throw new b("[Raph] selector() source belongs to another runtime.");
472
487
  i._assertAlive(), this._lifecycle.assertDependencyAllowed(i, t);
473
- const o = new m(t, this, e, s);
488
+ const n = this._selectors.create(t, this, e, s);
474
489
  try {
475
- t._adoptSourceEntry(o);
476
- } catch (c) {
477
- throw o._finalizeSource(), c;
490
+ t._adoptSourceEntry(n);
491
+ } catch (d) {
492
+ throw n._finalizeSource(), d;
478
493
  }
479
- return o;
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 o = i.get();
498
- return t._assertAlive(), o;
512
+ const n = i.get();
513
+ return t._assertAlive(), n;
499
514
  },
500
515
  peek() {
501
- h(s), t._assertAlive();
502
- const o = i.peek();
503
- return t._assertAlive(), o;
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 W(n) {
524
+ function C(o) {
510
525
  let e, t;
511
- const r = n._allocateTaskEffect(() => {
512
- e = n._trackSignalNode(void 0, f), t = n._trackSignalNode(void 0, f);
513
- }, S);
514
- n._requestTaskEffect(r, !1), n._beginTaskEffectRun(r), n._finishTaskEffectRun(r);
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
- n._disposeTaskEffect(r), n.batch(() => n._writeSignalNode(t, 0)), n._releaseSignalNode(e), n._releaseSignalNode(t);
517
- let i, o;
518
- const c = n._allocateTaskEffect(() => {
519
- i = n._trackCounterNode(f), o = n._trackCounterNode(f);
520
- }, S);
521
- return n._requestTaskEffect(c, !1), n._beginTaskEffectRun(c), n._finishTaskEffectRun(c), n.batch(() => {
522
- n._bumpSignalNode(o);
523
- }), n._disposeTaskEffect(c), n._releaseSignalNode(i), n._releaseSignalNode(o), { source: e, written: t, edge: s, consumer: r, counter: i, bumped: o };
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 D(n, e) {
526
- return () => n.untrackedWithOwner(e);
540
+ function W(o, e) {
541
+ return () => o.untrackedWithOwner(e);
527
542
  }
528
- function h(n) {
529
- n.owner === void 0 && n.throwDisposed();
543
+ function f(o) {
544
+ o.owner === void 0 && o.throwDisposed();
530
545
  }
531
- function v(n, e) {
532
- const t = n._lifecycle;
533
- h(t);
534
- const r = a;
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 = d;
552
+ const i = a;
538
553
  i !== void 0 && i !== e && t.assertDependencyAllowed(e, i);
539
554
  return;
540
555
  }
541
- const s = n._activeSubscriberOwner();
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
- N as SIGNAL_INDEX_LIMIT
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;
@@ -0,0 +1,12 @@
1
+ import { RuntimeSelector as r } from "./RaphSelector.js";
2
+ const i = /* @__PURE__ */ Object.freeze({
3
+ create(e, t, n, o) {
4
+ return new r(e, t, n, o);
5
+ },
6
+ is(e) {
7
+ return e instanceof r;
8
+ }
9
+ });
10
+ export {
11
+ i as RUNTIME_SELECTOR_SUPPORT
12
+ };
@@ -0,0 +1,2 @@
1
+ export { RaphCompactExecutionRuntime } from '../runtime/RaphCompactExecutionRuntime.js';
2
+ export type { RaphRuntimeBase as RaphExecution, RaphExecutionRuntimeConfiguration, RaphExecutionRuntimeOptions } from '../runtime/RaphRuntimeBase.js';
@@ -0,0 +1,2 @@
1
+ export { RaphExecutionRuntime } from '../runtime/RaphExecutionRuntime.js';
2
+ export type { RaphRuntimeBase as RaphExecution, RaphExecutionRuntimeConfiguration, RaphExecutionRuntimeOptions } from '../runtime/RaphRuntimeBase.js';
@@ -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 type { RaphAggregate } from '../runtime/reactivity/RaphWorkGraph';
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;
@@ -0,0 +1,4 @@
1
+ import { RaphExecutionRuntime as t } from "./debug/runtime/RaphExecutionRuntime.js";
2
+ export {
3
+ t as RaphExecutionRuntime
4
+ };
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"),d=require("./debug/runtime/RaphRuntime.cjs"),c=require("./debug/runtime/reactivity/PathHandle.cjs"),_=require("./debug/path/DataPath.cjs"),a=require("./debug/path/derived/derived-strategy.utils.cjs"),t=require("./debug/path/derived/RaphDerivedHandle.cjs"),l=require("./debug/path/meta/RaphMeta.cjs"),g=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=d.RaphRuntime;exports.PathHandle=c.PathHandle;exports.DataPath=_.DataPath;exports.collectionByKey=a.collectionByKey;exports.filterByKey=a.filterByKey;exports.full=a.full;exports.RaphDerivedHandle=t.RaphDerivedHandle;exports.RaphDerivedTargetWriteError=t.RaphDerivedTargetWriteError;exports.RaphMeta=l.RaphMeta;exports.RaphKernel=g.RaphKernel;exports.DefaultDataAdapter=E.DefaultDataAdapter;
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;