@markless/runtime 0.4.0 → 0.6.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/dist/{graph-Duhosz6u.js → graph-B3y0SeX_.js} +90 -16
- package/dist/{graph-async-Db6SqB5x.js → graph-async-BOuUUffx.js} +2 -2
- package/dist/{graph-reconcile-DoBBfYsT.d.ts → graph-reconcile-lpU0ZJNo.d.ts} +70 -12
- package/dist/graph-reconcile.d.ts +1 -1
- package/dist/graph-reconcile.js +2 -2
- package/dist/graph.d.ts +2 -2
- package/dist/graph.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as readAsyncComputedNode, c as findLastSharedReturnProperty, d as writePath, i as invalidateAsyncComputed, l as pathsIntersect, n as createRuntimeAsyncComputedNodes, o as deletePath, r as demandAsyncComputed, s as dirtyPathForGraphWrite, u as readPath } from "./graph-async-
|
|
1
|
+
import { a as readAsyncComputedNode, c as findLastSharedReturnProperty, d as writePath, i as invalidateAsyncComputed, l as pathsIntersect, n as createRuntimeAsyncComputedNodes, o as deletePath, r as demandAsyncComputed, s as dirtyPathForGraphWrite, u as readPath } from "./graph-async-BOuUUffx.js";
|
|
2
2
|
//#region src/graph-collections.ts
|
|
3
3
|
function applyCollectionCall(target, method, args) {
|
|
4
4
|
if (!isSupportedCollectionTarget(target)) throw new TypeError(`Cannot call collection method "${method}" because the graph path is not an Array, Map, Set, or Date.`);
|
|
@@ -110,18 +110,24 @@ function markComputedDirty(input) {
|
|
|
110
110
|
graphNodeId: input.graphNodeId,
|
|
111
111
|
path: []
|
|
112
112
|
});
|
|
113
|
-
for (const dependent of input.computedNodes.values())
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
for (const dependent of input.computedNodes.values()) {
|
|
114
|
+
if (!dependent.compute) continue;
|
|
115
|
+
if (dependent.dependencies.some((dependency) => dependency.graphNodeId === input.graphNodeId)) markComputedDirty({
|
|
116
|
+
...input,
|
|
117
|
+
graphNodeId: dependent.graphNodeId
|
|
118
|
+
});
|
|
119
|
+
}
|
|
117
120
|
for (const dependent of input.asyncComputedNodes.values()) if (dependent.dependencies.some((dependency) => dependency.graphNodeId === input.graphNodeId)) input.invalidateAsyncComputed(dependent);
|
|
118
121
|
}
|
|
119
122
|
function markDirtyComputedDependencies(input) {
|
|
120
|
-
for (const computed of input.computedNodes.values())
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
for (const computed of input.computedNodes.values()) {
|
|
124
|
+
if (!computed.compute) continue;
|
|
125
|
+
if (computed.dependencies.some((dependency) => dependency.graphNodeId === input.graphNodeId && pathsIntersect(input.path, dependency.path ?? []))) markComputedDirty({
|
|
126
|
+
...input,
|
|
127
|
+
graphNodeId: computed.graphNodeId,
|
|
128
|
+
visited: /* @__PURE__ */ new Set()
|
|
129
|
+
});
|
|
130
|
+
}
|
|
125
131
|
for (const asyncComputed of input.asyncComputedNodes.values()) if (asyncComputed.dependencies.some((dependency) => dependency.graphNodeId === input.graphNodeId && pathsIntersect(input.path, dependency.path ?? []))) input.invalidateAsyncComputed(asyncComputed);
|
|
126
132
|
}
|
|
127
133
|
//#endregion
|
|
@@ -245,12 +251,15 @@ function createRuntimeGraph(input) {
|
|
|
245
251
|
const computedNodes = createRuntimeComputedNodes(input.computed);
|
|
246
252
|
const asyncComputedNodes = createRuntimeAsyncComputedNodes(input.asyncComputed);
|
|
247
253
|
const subscriptions = [];
|
|
254
|
+
const writeObservers = [];
|
|
248
255
|
const journalListeners = [];
|
|
249
256
|
const dirtyPaths = [];
|
|
250
257
|
const journal = [];
|
|
251
258
|
let flushScheduled = false;
|
|
252
259
|
let flushing = false;
|
|
260
|
+
let notifyingWrite = false;
|
|
253
261
|
let activeFlush;
|
|
262
|
+
let flushHolds = 0;
|
|
254
263
|
for (const cell of input.cells) {
|
|
255
264
|
cells.set(cell.graphNodeId, cell.value);
|
|
256
265
|
if (cell.readInitializer) readInitializers.set(cell.graphNodeId, cell.readInitializer);
|
|
@@ -290,13 +299,47 @@ function createRuntimeGraph(input) {
|
|
|
290
299
|
reconcile: plane,
|
|
291
300
|
invalidateAsyncComputed: invalidateAsyncComputed$1
|
|
292
301
|
});
|
|
302
|
+
notifyWriteObservers(graphNodeId, path);
|
|
303
|
+
};
|
|
304
|
+
/**
|
|
305
|
+
* Whether `graphNodeId` is derived, however deeply, from the written path.
|
|
306
|
+
*
|
|
307
|
+
* A computed collection carries no dependency of its own on the state a
|
|
308
|
+
* handler writes; the chain of `dependencies` is the only thing that says so,
|
|
309
|
+
* and with a reconcile plane installed the write dirties no path under the
|
|
310
|
+
* computed for a path test to find.
|
|
311
|
+
*/
|
|
312
|
+
const derivesFromWrite = (graphNodeId, write, seen) => {
|
|
313
|
+
if (seen.has(graphNodeId)) return false;
|
|
314
|
+
seen.add(graphNodeId);
|
|
315
|
+
const computed = computedNodes.get(graphNodeId);
|
|
316
|
+
if (!computed) return false;
|
|
317
|
+
for (const dependency of computed.dependencies) {
|
|
318
|
+
if (dependency.graphNodeId === write.graphNodeId && pathsIntersect(write.path, dependency.path ?? [])) return true;
|
|
319
|
+
if (derivesFromWrite(dependency.graphNodeId, write, seen)) return true;
|
|
320
|
+
}
|
|
321
|
+
return false;
|
|
322
|
+
};
|
|
323
|
+
const notifyWriteObservers = (graphNodeId, path) => {
|
|
324
|
+
if (writeObservers.length === 0 || flushing || notifyingWrite) return;
|
|
325
|
+
const write = {
|
|
326
|
+
graphNodeId,
|
|
327
|
+
path
|
|
328
|
+
};
|
|
329
|
+
notifyingWrite = true;
|
|
330
|
+
try {
|
|
331
|
+
for (const observer of writeObservers.slice()) if (observer.graphNodeId === graphNodeId ? pathsIntersect(path, observer.path ?? []) : derivesFromWrite(observer.graphNodeId, write, /* @__PURE__ */ new Set())) observer.run();
|
|
332
|
+
} finally {
|
|
333
|
+
notifyingWrite = false;
|
|
334
|
+
}
|
|
293
335
|
};
|
|
294
336
|
const scheduleFlush = () => {
|
|
295
337
|
if (flushScheduled || flushing) return;
|
|
296
338
|
flushScheduled = true;
|
|
297
|
-
scheduleMicrotask(
|
|
298
|
-
|
|
299
|
-
|
|
339
|
+
scheduleMicrotask(runScheduledFlush);
|
|
340
|
+
};
|
|
341
|
+
const runScheduledFlush = () => {
|
|
342
|
+
if (!flushHolds) flush();
|
|
300
343
|
};
|
|
301
344
|
const plane = input.reconcile?.({
|
|
302
345
|
cells,
|
|
@@ -345,11 +388,19 @@ function createRuntimeGraph(input) {
|
|
|
345
388
|
plane?.recomputeSubscribed();
|
|
346
389
|
const pending = dirtyPaths.splice(0);
|
|
347
390
|
const ranSubscriptions = /* @__PURE__ */ new Set();
|
|
391
|
+
const commits = [];
|
|
348
392
|
for (const subscription of subscriptions) {
|
|
349
393
|
const subscriptionPath = subscription.path ?? [];
|
|
350
394
|
if (!pending.some((path) => path.graphNodeId === subscription.graphNodeId && pathsIntersect(path.path, subscriptionPath)) || ranSubscriptions.has(subscription.id)) continue;
|
|
351
395
|
ranSubscriptions.add(subscription.id);
|
|
352
|
-
|
|
396
|
+
const entries = await subscription.run(readGraph(subscription.graphNodeId, subscriptionPath));
|
|
397
|
+
if (typeof entries === "function") commits.push(entries);
|
|
398
|
+
else appendJournalResult(journal, entries);
|
|
399
|
+
}
|
|
400
|
+
if (commits.length > 0) {
|
|
401
|
+
const landing = commits.map((commit) => commit());
|
|
402
|
+
await notifyJournalListeners();
|
|
403
|
+
await Promise.all(landing);
|
|
353
404
|
}
|
|
354
405
|
}
|
|
355
406
|
} finally {
|
|
@@ -380,8 +431,9 @@ function createRuntimeGraph(input) {
|
|
|
380
431
|
write(write) {
|
|
381
432
|
const path = write.path ?? [];
|
|
382
433
|
const current = cells.get(write.graphNodeId);
|
|
383
|
-
|
|
384
|
-
if (
|
|
434
|
+
const seeded = cells.has(write.graphNodeId);
|
|
435
|
+
if (seeded && plane?.commitDerived(write, path)) return;
|
|
436
|
+
if (seeded && Object.is(readPath(current, path), write.value)) return;
|
|
385
437
|
cells.set(write.graphNodeId, writePath(current, path, write.value));
|
|
386
438
|
markDirtyPath(write.graphNodeId, dirtyPathForGraphWrite(current, path));
|
|
387
439
|
scheduleFlush();
|
|
@@ -425,6 +477,28 @@ function createRuntimeGraph(input) {
|
|
|
425
477
|
if (index >= 0) subscriptions.splice(index, 1);
|
|
426
478
|
};
|
|
427
479
|
},
|
|
480
|
+
subscribeWrite(observer) {
|
|
481
|
+
writeObservers.push(observer);
|
|
482
|
+
return () => {
|
|
483
|
+
const index = writeObservers.indexOf(observer);
|
|
484
|
+
if (index >= 0) writeObservers.splice(index, 1);
|
|
485
|
+
};
|
|
486
|
+
},
|
|
487
|
+
hasPendingFlush: () => flushScheduled || dirtyPaths.length > 0 || activeFlush !== void 0,
|
|
488
|
+
holdFlush() {
|
|
489
|
+
flushHolds++;
|
|
490
|
+
return () => {
|
|
491
|
+
if (!--flushHolds && flushScheduled) scheduleMicrotask(runScheduledFlush);
|
|
492
|
+
};
|
|
493
|
+
},
|
|
494
|
+
settleWriteObservers() {
|
|
495
|
+
let pending;
|
|
496
|
+
for (const observer of writeObservers) {
|
|
497
|
+
const settling = observer.settle?.();
|
|
498
|
+
if (settling) (pending ??= []).push(settling.catch(() => void 0));
|
|
499
|
+
}
|
|
500
|
+
return pending && Promise.all(pending).then(() => void 0);
|
|
501
|
+
},
|
|
428
502
|
subscribeJournal(listener) {
|
|
429
503
|
journalListeners.push(listener);
|
|
430
504
|
return () => {
|
|
@@ -65,7 +65,7 @@ function isObject(value) {
|
|
|
65
65
|
}
|
|
66
66
|
//#endregion
|
|
67
67
|
//#region src/graph-async.ts
|
|
68
|
-
const ASYNC_SNAPSHOT_META_KEYS = new Set([
|
|
68
|
+
const ASYNC_SNAPSHOT_META_KEYS = /* @__PURE__ */ new Set([
|
|
69
69
|
"status",
|
|
70
70
|
"version",
|
|
71
71
|
"key",
|
|
@@ -103,7 +103,7 @@ function invalidateAsyncComputed(input) {
|
|
|
103
103
|
advanceAsyncComputed(input);
|
|
104
104
|
}
|
|
105
105
|
function advanceAsyncComputed(input) {
|
|
106
|
-
const visited = new Set([input.node.graphNodeId]);
|
|
106
|
+
const visited = /* @__PURE__ */ new Set([input.node.graphNodeId]);
|
|
107
107
|
let blocked;
|
|
108
108
|
const visit = (graphNodeId) => {
|
|
109
109
|
if (visited.has(graphNodeId)) return;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ProtocolStatePayload } from "@markless/serializer";
|
|
2
|
-
|
|
3
2
|
//#region src/graph.d.ts
|
|
4
3
|
type RuntimeGraphCell = {
|
|
5
4
|
readonly graphNodeId: string;
|
|
@@ -14,7 +13,8 @@ type RuntimeGraphComputedDependency = {
|
|
|
14
13
|
type RuntimeGraphComputed = {
|
|
15
14
|
readonly graphNodeId: string;
|
|
16
15
|
readonly dependencies: ReadonlyArray<RuntimeGraphComputedDependency>;
|
|
17
|
-
readonly compute: (read: RuntimeGraphRead) => unknown;
|
|
16
|
+
readonly compute: (read: RuntimeGraphRead) => unknown;
|
|
17
|
+
/** How re-derived values reconcile against the node's previous value. */
|
|
18
18
|
readonly reconcile?: RuntimeGraphReconcileOptions;
|
|
19
19
|
};
|
|
20
20
|
type RuntimeGraphComputedDependencyNode = Omit<RuntimeGraphComputed, 'compute'> & {
|
|
@@ -43,7 +43,8 @@ type RuntimeGraphAsyncComputed = {
|
|
|
43
43
|
readonly graphNodeId: string;
|
|
44
44
|
readonly dependencies: ReadonlyArray<RuntimeGraphComputedDependency>;
|
|
45
45
|
readonly initialSnapshot?: RuntimeGraphAsyncSnapshot;
|
|
46
|
-
readonly key: (read: RuntimeGraphRead) => unknown;
|
|
46
|
+
readonly key: (read: RuntimeGraphRead) => unknown;
|
|
47
|
+
/** How a fulfilled value reconciles against the previously published one. */
|
|
47
48
|
readonly reconcile?: RuntimeGraphReconcileOptions;
|
|
48
49
|
readonly run: (input: {
|
|
49
50
|
readonly key: unknown;
|
|
@@ -55,6 +56,8 @@ type DomJournalEntry = {
|
|
|
55
56
|
readonly type: 'setText';
|
|
56
57
|
readonly locator: string;
|
|
57
58
|
readonly value: unknown;
|
|
59
|
+
/** The one child text node this write owns, when its element holds other children too. */
|
|
60
|
+
readonly node?: (host: unknown) => unknown;
|
|
58
61
|
} | {
|
|
59
62
|
readonly type: 'setAttr' | 'setProp';
|
|
60
63
|
readonly locator: string;
|
|
@@ -123,14 +126,48 @@ type RuntimeGraphDelete = {
|
|
|
123
126
|
readonly graphNodeId: string;
|
|
124
127
|
readonly path: ReadonlyArray<string>;
|
|
125
128
|
};
|
|
129
|
+
/** DOM work a subscription holds back until its whole pass has run, so it lands in one task with that pass's journal. */
|
|
130
|
+
type RuntimeGraphCommit = () => void | Promise<void>;
|
|
126
131
|
type RuntimeGraphSubscription = {
|
|
127
132
|
readonly id: string;
|
|
128
133
|
readonly graphNodeId: string;
|
|
129
134
|
readonly path?: ReadonlyArray<string>;
|
|
130
|
-
readonly run: (value: unknown) => DomJournalResult | void | Promise<DomJournalResult | void>;
|
|
135
|
+
readonly run: (value: unknown) => DomJournalResult | RuntimeGraphCommit | void | Promise<DomJournalResult | RuntimeGraphCommit | void>;
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* Told about a write the moment it lands, before the flush that write schedules.
|
|
139
|
+
*
|
|
140
|
+
* The flush is a microtask behind the statement that wrote, so a handler reading
|
|
141
|
+
* back what its own write produced - a keyed repeat's rows most of all - reads
|
|
142
|
+
* the pre-write answer. An observer runs synchronously inside the write instead,
|
|
143
|
+
* so the next statement of the same handler sees the result.
|
|
144
|
+
*
|
|
145
|
+
* It runs for a write to `graphNodeId` under an intersecting path, and for a
|
|
146
|
+
* write to anything `graphNodeId` derives from, so a computed-backed collection
|
|
147
|
+
* is reached through the state write behind it. It never runs during a flush -
|
|
148
|
+
* the flush's own subscription pass is the single answer there - and never
|
|
149
|
+
* re-enters: a write made from inside an observer notifies nobody.
|
|
150
|
+
*
|
|
151
|
+
* `run` is handed no value and answers with none: it is a place to react, not a
|
|
152
|
+
* second subscription channel, and reads whatever it needs off the graph. The
|
|
153
|
+
* graph does not catch what it throws.
|
|
154
|
+
*/
|
|
155
|
+
type RuntimeGraphWriteObserver = {
|
|
156
|
+
readonly graphNodeId: string;
|
|
157
|
+
readonly path?: ReadonlyArray<string>;
|
|
158
|
+
/**
|
|
159
|
+
* Work ALREADY in flight that this observer needs settled before it can
|
|
160
|
+
* answer a write synchronously - a demand-loaded module, above all. It starts
|
|
161
|
+
* nothing, so a caller awaiting it adds no fetch to the gesture; it only
|
|
162
|
+
* stops the gesture racing a load its own wiring began. `undefined` is
|
|
163
|
+
* nothing to wait for, and costs no microtask.
|
|
164
|
+
*/
|
|
165
|
+
readonly settle?: () => Promise<void> | undefined;
|
|
166
|
+
readonly run: () => void;
|
|
131
167
|
};
|
|
132
168
|
type RuntimeGraph = {
|
|
133
|
-
readonly read: (graphNodeId: string, path?: ReadonlyArray<string>) => unknown;
|
|
169
|
+
readonly read: (graphNodeId: string, path?: ReadonlyArray<string>) => unknown;
|
|
170
|
+
/** Available only in debug-enabled builds (`__MARKLESS_DEBUG_ENABLED__`). */
|
|
134
171
|
readonly peekAsyncSnapshot?: (graphNodeId: string) => RuntimeGraphAsyncSnapshot | undefined;
|
|
135
172
|
readonly readShared: (definitionId: string, propertyName: string, path?: ReadonlyArray<string>) => unknown;
|
|
136
173
|
readonly writeShared: (write: RuntimeGraphSharedWrite) => boolean;
|
|
@@ -143,6 +180,20 @@ type RuntimeGraph = {
|
|
|
143
180
|
readonly call: (call: RuntimeGraphCall) => unknown;
|
|
144
181
|
readonly delete: (deletion: RuntimeGraphDelete) => boolean;
|
|
145
182
|
readonly subscribe: (subscription: RuntimeGraphSubscription) => () => void;
|
|
183
|
+
/**
|
|
184
|
+
* Optional so a facade over a subset of this contract stays a `RuntimeGraph`;
|
|
185
|
+
* a caller without it gets the flush-time answer it always had.
|
|
186
|
+
*/
|
|
187
|
+
readonly subscribeWrite?: (observer: RuntimeGraphWriteObserver) => () => void;
|
|
188
|
+
/**
|
|
189
|
+
* Settles what the write observers are already loading, so a write made after
|
|
190
|
+
* it is answered synchronously. `undefined` when nothing is in flight.
|
|
191
|
+
*/
|
|
192
|
+
readonly settleWriteObservers?: () => Promise<void> | undefined;
|
|
193
|
+
/** Whether a write is waiting on a flush that has not yet reached the journal. */
|
|
194
|
+
readonly hasPendingFlush?: () => boolean;
|
|
195
|
+
/** Keeps the scheduled flush back until each returned release has run once; `flush()` itself still runs. */
|
|
196
|
+
readonly holdFlush?: () => () => void;
|
|
146
197
|
readonly subscribeJournal: (listener: DomJournalListener) => () => void;
|
|
147
198
|
readonly flush: () => Promise<void>;
|
|
148
199
|
readonly takeJournal: () => DomJournalEntry[];
|
|
@@ -260,15 +311,22 @@ type DerivedReconcileInternals = {
|
|
|
260
311
|
* they did before reconciliation existed.
|
|
261
312
|
*/
|
|
262
313
|
type DerivedReconcilePlane = {
|
|
263
|
-
/** Records the objects a state write mutated in place during this flush. */
|
|
264
|
-
readonly
|
|
265
|
-
|
|
266
|
-
readonly
|
|
267
|
-
|
|
268
|
-
readonly
|
|
314
|
+
/** Records the objects a state write mutated in place during this flush. */
|
|
315
|
+
readonly recordWrite: (graphNodeId: string, path: ReadonlyArray<string>) => void;
|
|
316
|
+
/** A dependency write invalidated this computed; its paths are not known yet. */
|
|
317
|
+
readonly invalidateComputed: (computed: RuntimeComputedNode) => void;
|
|
318
|
+
/** Reports the paths a just-recomputed value moved, and wakes their subscribers. */
|
|
319
|
+
readonly reconcileComputed: (computed: RuntimeComputedNode, previous: unknown) => void;
|
|
320
|
+
/** Commits a whole derived value onto a cell-backed computed node. */
|
|
321
|
+
readonly commitDerived: (write: RuntimeGraphWrite, path: ReadonlyArray<string>) => boolean;
|
|
322
|
+
/** Dirties the paths an async snapshot commit changed. */
|
|
323
|
+
readonly publishAsync: (node: RuntimeAsyncComputedNode, previous: RuntimeGraphAsyncSnapshot) => void;
|
|
324
|
+
/** Flush-pass start: recompute the dirty computeds something is subscribed to. */
|
|
325
|
+
readonly recomputeSubscribed: () => void;
|
|
326
|
+
/** Flush end: drop the per-flush record and mark the baselines it leaves stale. */
|
|
269
327
|
readonly settleBaselines: () => void;
|
|
270
328
|
};
|
|
271
329
|
type DerivedReconcilePlaneFactory = (internals: DerivedReconcileInternals) => DerivedReconcilePlane;
|
|
272
330
|
declare const createDerivedReconcilePlane: DerivedReconcilePlaneFactory;
|
|
273
331
|
//#endregion
|
|
274
|
-
export {
|
|
332
|
+
export { RuntimeGraphSubscription as A, RuntimeGraphComputedDependencyNode as C, RuntimeGraphSharedPatch as D, RuntimeGraphRead as E, RuntimeGraphWrite as M, RuntimeGraphWriteObserver as N, RuntimeGraphSharedPatchOperation as O, createRuntimeGraph as P, RuntimeGraphComputedDependency as S, RuntimeGraphInput as T, RuntimeGraphAsyncSnapshot as _, RuntimeGraphReconcileKey as a, RuntimeGraphCommit as b, createDerivedReconcilePlane as c, samePath as d, DomJournalEntry as f, RuntimeGraphAsyncComputed as g, RuntimeGraph as h, DiffDerivedValueInput as i, RuntimeGraphUpdate as j, RuntimeGraphSharedWrite as k, diffDerivedValue as l, DomJournalResult as m, DerivedReconcilePlane as n, RuntimeGraphReconcileOptions as o, DomJournalListener as p, DerivedReconcilePlaneFactory as r, WriteTouchedRecord as s, DerivedReconcileInternals as t, isDiffableContainer as u, RuntimeGraphCall as v, RuntimeGraphDelete as w, RuntimeGraphComputed as x, RuntimeGraphCell as y };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as RuntimeGraphReconcileKey, c as createDerivedReconcilePlane, d as samePath, i as DiffDerivedValueInput, l as diffDerivedValue, n as DerivedReconcilePlane, o as RuntimeGraphReconcileOptions, r as DerivedReconcilePlaneFactory, s as WriteTouchedRecord, t as DerivedReconcileInternals, u as isDiffableContainer } from "./graph-reconcile-
|
|
1
|
+
import { a as RuntimeGraphReconcileKey, c as createDerivedReconcilePlane, d as samePath, i as DiffDerivedValueInput, l as diffDerivedValue, n as DerivedReconcilePlane, o as RuntimeGraphReconcileOptions, r as DerivedReconcilePlaneFactory, s as WriteTouchedRecord, t as DerivedReconcileInternals, u as isDiffableContainer } from "./graph-reconcile-lpU0ZJNo.js";
|
|
2
2
|
export { DerivedReconcileInternals, DerivedReconcilePlane, DerivedReconcilePlaneFactory, DiffDerivedValueInput, RuntimeGraphReconcileKey, RuntimeGraphReconcileOptions, WriteTouchedRecord, createDerivedReconcilePlane, diffDerivedValue, isDiffableContainer, samePath };
|
package/dist/graph-reconcile.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ASYNC_SNAPSHOT_META_KEYS, u as readPath } from "./graph-async-
|
|
1
|
+
import { t as ASYNC_SNAPSHOT_META_KEYS, u as readPath } from "./graph-async-BOuUUffx.js";
|
|
2
2
|
//#region src/graph-reconcile.ts
|
|
3
3
|
const WHOLE_NODE = Object.freeze([Object.freeze([])]);
|
|
4
4
|
/**
|
|
@@ -102,7 +102,7 @@ function diffDerivedValue(input) {
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
function walkObject(previous, next, path) {
|
|
105
|
-
for (const key of new Set([...Object.keys(previous), ...Object.keys(next)])) {
|
|
105
|
+
for (const key of /* @__PURE__ */ new Set([...Object.keys(previous), ...Object.keys(next)])) {
|
|
106
106
|
const keyPath = [...path, key];
|
|
107
107
|
const inPrevious = Object.prototype.hasOwnProperty.call(previous, key);
|
|
108
108
|
const inNext = Object.prototype.hasOwnProperty.call(next, key);
|
package/dist/graph.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { DerivedReconcileInternals, DerivedReconcilePlane, DerivedReconcilePlaneFactory, DiffDerivedValueInput, DomJournalEntry, DomJournalListener, DomJournalResult, RuntimeGraph, RuntimeGraphAsyncComputed, RuntimeGraphAsyncSnapshot, RuntimeGraphCall, RuntimeGraphCell, RuntimeGraphComputed, RuntimeGraphComputedDependency, RuntimeGraphComputedDependencyNode, RuntimeGraphDelete, RuntimeGraphInput, RuntimeGraphRead, RuntimeGraphReconcileKey, RuntimeGraphReconcileOptions, RuntimeGraphSharedPatch, RuntimeGraphSharedPatchOperation, RuntimeGraphSharedWrite, RuntimeGraphSubscription, RuntimeGraphUpdate, RuntimeGraphWrite, WriteTouchedRecord, createRuntimeGraph };
|
|
1
|
+
import { A as RuntimeGraphSubscription, C as RuntimeGraphComputedDependencyNode, D as RuntimeGraphSharedPatch, E as RuntimeGraphRead, M as RuntimeGraphWrite, N as RuntimeGraphWriteObserver, O as RuntimeGraphSharedPatchOperation, P as createRuntimeGraph, S as RuntimeGraphComputedDependency, T as RuntimeGraphInput, _ as RuntimeGraphAsyncSnapshot, a as RuntimeGraphReconcileKey, b as RuntimeGraphCommit, f as DomJournalEntry, g as RuntimeGraphAsyncComputed, h as RuntimeGraph, i as DiffDerivedValueInput, j as RuntimeGraphUpdate, k as RuntimeGraphSharedWrite, m as DomJournalResult, n as DerivedReconcilePlane, o as RuntimeGraphReconcileOptions, p as DomJournalListener, r as DerivedReconcilePlaneFactory, s as WriteTouchedRecord, t as DerivedReconcileInternals, v as RuntimeGraphCall, w as RuntimeGraphDelete, x as RuntimeGraphComputed, y as RuntimeGraphCell } from "./graph-reconcile-lpU0ZJNo.js";
|
|
2
|
+
export { type DerivedReconcileInternals, type DerivedReconcilePlane, type DerivedReconcilePlaneFactory, type DiffDerivedValueInput, DomJournalEntry, DomJournalListener, DomJournalResult, RuntimeGraph, RuntimeGraphAsyncComputed, RuntimeGraphAsyncSnapshot, RuntimeGraphCall, RuntimeGraphCell, RuntimeGraphCommit, RuntimeGraphComputed, RuntimeGraphComputedDependency, RuntimeGraphComputedDependencyNode, RuntimeGraphDelete, RuntimeGraphInput, RuntimeGraphRead, type RuntimeGraphReconcileKey, type RuntimeGraphReconcileOptions, RuntimeGraphSharedPatch, RuntimeGraphSharedPatchOperation, RuntimeGraphSharedWrite, RuntimeGraphSubscription, RuntimeGraphUpdate, RuntimeGraphWrite, RuntimeGraphWriteObserver, type WriteTouchedRecord, createRuntimeGraph };
|
package/dist/graph.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createRuntimeGraph } from "./graph-
|
|
1
|
+
import { t as createRuntimeGraph } from "./graph-B3y0SeX_.js";
|
|
2
2
|
export { createRuntimeGraph };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { DerivedReconcileInternals, DerivedReconcilePlane, DerivedReconcilePlaneFactory, DiffDerivedValueInput, DomJournalEntry, DomJournalListener, DomJournalResult, RuntimeGraph, RuntimeGraphAsyncComputed, RuntimeGraphAsyncSnapshot, RuntimeGraphCall, RuntimeGraphCell, RuntimeGraphComputed, RuntimeGraphComputedDependency, RuntimeGraphComputedDependencyNode, RuntimeGraphDelete, RuntimeGraphInput, RuntimeGraphRead, RuntimeGraphReconcileKey, RuntimeGraphReconcileOptions, RuntimeGraphSharedPatch, RuntimeGraphSharedPatchOperation, RuntimeGraphSharedWrite, RuntimeGraphSubscription, RuntimeGraphUpdate, RuntimeGraphWrite, WriteTouchedRecord, createRuntimeGraph };
|
|
1
|
+
import { A as RuntimeGraphSubscription, C as RuntimeGraphComputedDependencyNode, D as RuntimeGraphSharedPatch, E as RuntimeGraphRead, M as RuntimeGraphWrite, N as RuntimeGraphWriteObserver, O as RuntimeGraphSharedPatchOperation, P as createRuntimeGraph, S as RuntimeGraphComputedDependency, T as RuntimeGraphInput, _ as RuntimeGraphAsyncSnapshot, a as RuntimeGraphReconcileKey, b as RuntimeGraphCommit, f as DomJournalEntry, g as RuntimeGraphAsyncComputed, h as RuntimeGraph, i as DiffDerivedValueInput, j as RuntimeGraphUpdate, k as RuntimeGraphSharedWrite, m as DomJournalResult, n as DerivedReconcilePlane, o as RuntimeGraphReconcileOptions, p as DomJournalListener, r as DerivedReconcilePlaneFactory, s as WriteTouchedRecord, t as DerivedReconcileInternals, v as RuntimeGraphCall, w as RuntimeGraphDelete, x as RuntimeGraphComputed, y as RuntimeGraphCell } from "./graph-reconcile-lpU0ZJNo.js";
|
|
2
|
+
export { type DerivedReconcileInternals, type DerivedReconcilePlane, type DerivedReconcilePlaneFactory, type DiffDerivedValueInput, DomJournalEntry, DomJournalListener, DomJournalResult, RuntimeGraph, RuntimeGraphAsyncComputed, RuntimeGraphAsyncSnapshot, RuntimeGraphCall, RuntimeGraphCell, RuntimeGraphCommit, RuntimeGraphComputed, RuntimeGraphComputedDependency, RuntimeGraphComputedDependencyNode, RuntimeGraphDelete, RuntimeGraphInput, RuntimeGraphRead, type RuntimeGraphReconcileKey, type RuntimeGraphReconcileOptions, RuntimeGraphSharedPatch, RuntimeGraphSharedPatchOperation, RuntimeGraphSharedWrite, RuntimeGraphSubscription, RuntimeGraphUpdate, RuntimeGraphWrite, RuntimeGraphWriteObserver, type WriteTouchedRecord, createRuntimeGraph };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createRuntimeGraph } from "./graph-
|
|
1
|
+
import { t as createRuntimeGraph } from "./graph-B3y0SeX_.js";
|
|
2
2
|
export { createRuntimeGraph };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markless/runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Markless state graph runtime: reads, writes, computed invalidation, flush journal.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@markless/serializer": "0.
|
|
32
|
+
"@markless/serializer": "0.6.0"
|
|
33
33
|
},
|
|
34
34
|
"files": [
|
|
35
35
|
"dist"
|