@wardic/core 1.0.0-rc.4 → 1.0.0-rc.6

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 (45) hide show
  1. package/dist/Clock.d.ts.map +1 -1
  2. package/dist/Clock.js +20 -12
  3. package/dist/Clock.js.map +1 -1
  4. package/dist/FrameLoop.d.ts +12 -1
  5. package/dist/FrameLoop.d.ts.map +1 -1
  6. package/dist/FrameLoop.js +23 -1
  7. package/dist/FrameLoop.js.map +1 -1
  8. package/dist/LiveValue.d.ts +4 -3
  9. package/dist/LiveValue.d.ts.map +1 -1
  10. package/dist/LiveValue.js +7 -5
  11. package/dist/LiveValue.js.map +1 -1
  12. package/dist/Probe.d.ts +5 -47
  13. package/dist/Probe.d.ts.map +1 -1
  14. package/dist/Probe.js +5 -5
  15. package/dist/Probe.js.map +1 -1
  16. package/dist/ScrollSource.d.ts +62 -0
  17. package/dist/ScrollSource.d.ts.map +1 -0
  18. package/dist/ScrollSource.js +21 -0
  19. package/dist/ScrollSource.js.map +1 -0
  20. package/dist/SharedSource.d.ts +35 -15
  21. package/dist/SharedSource.d.ts.map +1 -1
  22. package/dist/SharedSource.js +84 -108
  23. package/dist/SharedSource.js.map +1 -1
  24. package/dist/index.d.ts +2 -1
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +2 -1
  27. package/dist/index.js.map +1 -1
  28. package/dist/internal/frameLoop.d.ts +17 -0
  29. package/dist/internal/frameLoop.d.ts.map +1 -1
  30. package/dist/internal/frameLoop.js +33 -20
  31. package/dist/internal/frameLoop.js.map +1 -1
  32. package/dist/internal/hearing.d.ts +13 -0
  33. package/dist/internal/hearing.d.ts.map +1 -0
  34. package/dist/internal/hearing.js +71 -0
  35. package/dist/internal/hearing.js.map +1 -0
  36. package/package.json +1 -1
  37. package/src/Clock.ts +29 -17
  38. package/src/FrameLoop.ts +24 -1
  39. package/src/LiveValue.ts +9 -7
  40. package/src/Probe.ts +8 -54
  41. package/src/ScrollSource.ts +68 -0
  42. package/src/SharedSource.ts +113 -146
  43. package/src/index.ts +2 -1
  44. package/src/internal/frameLoop.ts +41 -18
  45. package/src/internal/hearing.ts +76 -0
@@ -0,0 +1,21 @@
1
+ /**
2
+ * An Environment's scroll: a container's scroll, live, as an Atom the Environment sets as the container
3
+ * scrolls or resizes, as it happens, so a value derived from it is written in the frame that shows the
4
+ * scroll. Scroll-linked values read it (`LiveValue.scroll`).
5
+ *
6
+ * @example
7
+ * import * as ScrollSource from "@wardic/core/ScrollSource"
8
+ *
9
+ * const source = yield* ScrollSource.ScrollSource
10
+ * const scroll = yield* source.scroll({ container: list })
11
+ */
12
+ // #518, ADR-0067 *Amendment (#518)*, decision 5: the Probe's `scroll` until then (#234, ADR-0043
13
+ // *Amendment (#233, #234)*). A service of its own, so an app that reads no scroll ships none of an
14
+ // Environment's scroll code: the Solid binding's `scroll` Feature builds it, the Environment's when it
15
+ // gives one (`@wardic/test`'s), else the DOM's (`DomScrollSource`). Tier 2 (ADR-0008), for Environment
16
+ // authors.
17
+ import * as Context from "effect/Context";
18
+ /** An Environment's scroll. */
19
+ export class ScrollSource extends Context.Service()("@wardic/core/ScrollSource") {
20
+ }
21
+ //# sourceMappingURL=ScrollSource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScrollSource.js","sourceRoot":"","sources":["../src/ScrollSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,iGAAiG;AACjG,mGAAmG;AACnG,uGAAuG;AACvG,uGAAuG;AACvG,WAAW;AACX,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AA2CzC,+BAA+B;AAC/B,MAAM,OAAO,YAAa,SAAQ,OAAO,CAAC,OAAO,EAO7C,CAAC,2BAA2B,CAAC;CAAG"}
@@ -1,34 +1,54 @@
1
- import type * as Duration from "effect/Duration";
1
+ /**
2
+ * Shared sources, for the Streams an Environment hands out: each hot and counted, so however many
3
+ * subscribe, one underlying source runs, started by the first subscriber and stopped when the last one
4
+ * leaves. `byTarget` keeps one per target, one observer on each element, and `make` one for the whole
5
+ * Environment. An Environment builds its sources with these, as `@wardic/dom` does, and `counted` shares
6
+ * anything else it opens per target.
7
+ *
8
+ * @example
9
+ * import * as SharedSource from "@wardic/core/SharedSource"
10
+ *
11
+ * const resize = yield* SharedSource.byTarget((target) => Effect.succeed(resizesOf(target)))
12
+ * // Both share one observer on `card`:
13
+ * Stream.runForEach(resize(card), onLayout)
14
+ * Stream.runForEach(resize(card), onScroll)
15
+ */
2
16
  import * as Effect from "effect/Effect";
3
- import type * as Scope from "effect/Scope";
17
+ import * as Scope from "effect/Scope";
4
18
  import * as Stream from "effect/Stream";
5
- /** `byTarget`'s and `make`'s options. */
6
- export interface Options {
7
- /**
8
- * How long a source with no subscriber left keeps running before it stops, so a quick re-subscribe
9
- * reuses it. Default: none, stopped at once.
10
- */
11
- readonly idleTimeToLive?: Duration.Input | undefined;
12
- }
19
+ /**
20
+ * Values shared by key and counted: the first hold of a key opens its value with `open`, later holds
21
+ * share it, and the last one's release closes it with `close`. A key is held by identity and never
22
+ * hashed, so a DOM node is its own key. `open` runs inline, so it mustn't wait.
23
+ *
24
+ * @example
25
+ * // One listener set per container, however many readers hold it
26
+ * const containers = SharedSource.counted(
27
+ * (container: Element) => ({ remove: listenTo(container) }),
28
+ * (listening) => Effect.sync(listening.remove),
29
+ * )
30
+ * const listening = yield* containers(list) // held until the current Scope closes
31
+ */
32
+ export declare const counted: <K, V>(open: (key: K) => V, close: (value: V) => Effect.Effect<void>) => ((key: K) => Effect.Effect<V, never, Scope.Scope>);
13
33
  /**
14
34
  * A shared source per target: a function from a target to a Stream that's hot and counted for that
15
35
  * target. The first subscriber for a target starts `lookup(target)`'s source, later ones share it, and it
16
- * stops when the last one for that target leaves, after `idleTimeToLive` if it's given.
36
+ * stops when the last one for that target leaves.
17
37
  *
18
38
  * @example
19
39
  * // `resizesOf(target)`: an Environment's own Stream of a target's sizes
20
40
  * const resize = yield* SharedSource.byTarget((target) => Effect.succeed(resizesOf(target)))
21
41
  */
22
- export declare const byTarget: <A>(lookup: (target: unknown) => Effect.Effect<Stream.Stream<A>, never, Scope.Scope>, options?: Options) => Effect.Effect<(target: unknown) => Stream.Stream<A>, never, Scope.Scope>;
42
+ export declare const byTarget: <A>(lookup: (target: unknown) => Effect.Effect<Stream.Stream<A>, never, Scope.Scope>) => Effect.Effect<(target: unknown) => Stream.Stream<A>, never, Scope.Scope>;
23
43
  /**
24
44
  * One shared source for the whole Environment: a Stream that's hot and counted. The first subscriber
25
- * starts `acquire`'s source, later ones share it, and it stops when the last one leaves, after
26
- * `idleTimeToLive` if it's given. `byTarget`'s form without a target.
45
+ * starts `acquire`'s source, later ones share it, and it stops when the last one leaves. `byTarget`'s
46
+ * form without a target.
27
47
  *
28
48
  * @example
29
49
  * // `viewportChanges`: an Environment's own Stream of its viewport's size
30
50
  * const viewport = yield* SharedSource.make(Effect.succeed(viewportChanges))
31
51
  * Stream.runForEach(viewport, onResize) // one listener, however many subscribe
32
52
  */
33
- export declare const make: <A>(acquire: Effect.Effect<Stream.Stream<A>, never, Scope.Scope>, options?: Options) => Effect.Effect<Stream.Stream<A>, never, Scope.Scope>;
53
+ export declare const make: <A>(acquire: Effect.Effect<Stream.Stream<A>, never, Scope.Scope>) => Effect.Effect<Stream.Stream<A>, never, Scope.Scope>;
34
54
  //# sourceMappingURL=SharedSource.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SharedSource.d.ts","sourceRoot":"","sources":["../src/SharedSource.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,KAAK,QAAQ,MAAM,iBAAiB,CAAA;AAChD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAYvC,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAIvC,yCAAyC;AACzC,MAAM,WAAW,OAAO;IACtB;;;OAGG;IAEH,QAAQ,CAAC,cAAc,CA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KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAoBnD,CAAA;AAwDD;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ,EAAE,CAAC,CAAC,EACvB,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAC7E,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,OAAO,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAUxE,CAAA;AAEJ;;;;;;;;;GASG;AACH,eAAO,MAAM,IAAI,EAAE,CAAC,CAAC,EACnB,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KACzD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CASnD,CAAA"}
@@ -2,7 +2,8 @@
2
2
  * Shared sources, for the Streams an Environment hands out: each hot and counted, so however many
3
3
  * subscribe, one underlying source runs, started by the first subscriber and stopped when the last one
4
4
  * leaves. `byTarget` keeps one per target, one observer on each element, and `make` one for the whole
5
- * Environment. An Environment builds its sources with these, as `@wardic/dom` does.
5
+ * Environment. An Environment builds its sources with these, as `@wardic/dom` does, and `counted` shares
6
+ * anything else it opens per target.
6
7
  *
7
8
  * @example
8
9
  * import * as SharedSource from "@wardic/core/SharedSource"
@@ -13,146 +14,121 @@
13
14
  * Stream.runForEach(resize(card), onScroll)
14
15
  */
15
16
  // CONTEXT.md's **Shared source** contract (#37, ADR-0041 *Amendment (#37)*). An Environment's **Input
16
- // feeds** are shared by `InputFeed.byTarget` instead, with no `PubSub` or fiber (#318).
17
+ // feeds** are shared by `InputFeed.byTarget` instead, with no fiber (#318).
17
18
  //
18
- // Two constructors, both built on the same primitive (a `PubSub` fed by a `forkScoped` pump that drains
19
- // the cold source), wrapped in Effect's reference-counted resource caches: `byTarget` keys on the target
20
- // (`RcMap`), the cold `lookup` running once per target while a subscriber holds it (an Environment's
21
- // `Probe.observeResize`); `make` is the keyless case (`RcRef`). The cold source is acquired by the first
22
- // subscriber and released when the last subscriber's scope closes: `Stream.unwrap` holds the Rc reference
23
- // for the subscriber stream's lifetime, so when the last one ends the cache releases the entry, the pump
24
- // is interrupted, and the cold source's finalizers run (a listener is removed). The source's end ends
25
- // every subscriber, and its failure fails them (#618, decision 6). Effect's own `Stream.share` and
26
- // `Stream.broadcast` do this too, but put 2.2 KB gzip on every app (`bun run size`), so the pump stays.
19
+ // One shape under both constructors (#518, ADR-0067 *Amendment (#518)*, decision 3): a target's entry in
20
+ // a `counted` map holds its subscribers' hearings and, while any subscriber holds it, a pump that runs the
21
+ // cold source and hands each element to every hearing, which resumes a waiting subscriber inside the
22
+ // call, as the `PubSub` did. The first subscriber opens the entry and starts the pump; the
23
+ // last one's release interrupts it, and the cold source's finalizers run (a listener is removed). The
24
+ // source's end ends every subscriber, and its failure fails them (#618, decision 6). It replaced a
25
+ // `PubSub` per source in Effect's `RcMap` and `RcRef`, whose code every app shipped (4.1 KB gzipped with
26
+ // `Clock.ticks`' and the DOM's scroll containers'), and whose `idleTimeToLive` nothing passed.
27
27
  //
28
28
  // Tier 2 (ADR-0008), for Environment authors, as `InputSource.heldPointer` is (#31's rule: Wardic ships
29
29
  // what makes a new Environment little work). Observability: each constructor emits a
30
- // `wardic.sharedSource.*` span and a debug log on subscribe; the per-event publish path stays quiet.
31
- import * as Cause from "effect/Cause";
30
+ // `wardic.sharedSource.*` span and a debug log on subscribe; the per-event path stays quiet.
32
31
  import * as Effect from "effect/Effect";
33
- import * as Equal from "effect/Equal";
34
32
  import * as Exit from "effect/Exit";
35
- import { identity } from "effect/Function";
36
- import * as Hash from "effect/Hash";
37
- import * as Match from "effect/Match";
38
- import * as MutableRef from "effect/MutableRef";
33
+ import * as Fiber from "effect/Fiber";
34
+ import * as Iter from "effect/Iterable";
39
35
  import * as Option from "effect/Option";
40
- import * as Predicate from "effect/Predicate";
41
- import * as PubSub from "effect/PubSub";
42
- import * as RcMap from "effect/RcMap";
43
- import * as RcRef from "effect/RcRef";
36
+ import * as Scope from "effect/Scope";
44
37
  import * as Stream from "effect/Stream";
45
- import * as UndefinedOr from "effect/UndefinedOr";
38
+ import * as Hearing from "./internal/hearing.js";
46
39
  import { tracedStream } from "./internal/tracing.js";
47
40
  /**
48
- * The hot `PubSub` that fronts a cold source: acquire the source via `acquire`, fork a scoped pump
49
- * that republishes every element into the PubSub, and hand back the PubSub. The pump is bound to
50
- * the Rc cache entry's scope, so when the cache releases the entry the pump is interrupted and the
51
- * cold source's finalizers run. When the source ends, how it ended is kept and the PubSub shut down,
52
- * which ends every subscription. Per-element publishing is un-logged: it's the hot path.
41
+ * Values shared by key and counted: the first hold of a key opens its value with `open`, later holds
42
+ * share it, and the last one's release closes it with `close`. A key is held by identity and never
43
+ * hashed, so a DOM node is its own key. `open` runs inline, so it mustn't wait.
44
+ *
45
+ * @example
46
+ * // One listener set per container, however many readers hold it
47
+ * const containers = SharedSource.counted(
48
+ * (container: Element) => ({ remove: listenTo(container) }),
49
+ * (listening) => Effect.sync(listening.remove),
50
+ * )
51
+ * const listening = yield* containers(list) // held until the current Scope closes
53
52
  */
54
- const fanIn = /*#__PURE__*/ Effect.fnUntraced(function* (acquire) {
55
- const pubsub = yield* PubSub.unbounded();
56
- const source = yield* acquire;
57
- const ended = MutableRef.make(Option.none());
58
- yield* Effect.forkScoped(Stream.runForEach(source, (a) => PubSub.publish(pubsub, a)).pipe(Effect.onExit((exit) => Effect.andThen(Effect.sync(() => MutableRef.set(ended, Option.some(exit))), PubSub.shutdown(pubsub)))));
59
- return { pubsub, ended };
60
- });
61
- /** A source's failure, if it failed: an interruption is how its cache ends it, not a failure. */
62
- const failureOf = (exit) => {
63
- if (Exit.isSuccess(exit))
64
- return Option.none();
65
- if (Cause.hasInterruptsOnly(exit.cause))
66
- return Option.none();
67
- return Option.some(exit.cause);
53
+ // #518: what `RcMap` gave the DOM's scroll containers (#618, M7), with no Scope per entry and no `Hash`.
54
+ export const counted = (open, close) => {
55
+ const held = new Map();
56
+ const acquire = (key) => Effect.sync(() => {
57
+ const entry = Option.getOrElse(Option.fromUndefinedOr(held.get(key)), () => {
58
+ const opened = { value: open(key), count: 0 };
59
+ held.set(key, opened);
60
+ return opened;
61
+ });
62
+ entry.count++;
63
+ return entry;
64
+ });
65
+ const release = (key, entry) => Effect.suspend(() => {
66
+ entry.count--;
67
+ if (entry.count > 0)
68
+ return Effect.void;
69
+ if (held.get(key) === entry)
70
+ held.delete(key);
71
+ return close(entry.value);
72
+ });
73
+ return (key) => Effect.map(Effect.acquireRelease(acquire(key), (entry) => release(key, entry)), (entry) => entry.value);
68
74
  };
69
- /** How a subscriber ends after its source has: failed with the source's failure, else at once. */
70
- const endOf = (ended) => Option.match(Option.flatMap(ended, failureOf), { onNone: () => Effect.void, onSome: (cause) => Effect.failCause(cause) });
71
- /**
72
- * A subscriber to a fanned-out source, made as it subscribes: its events, then the source's end. One that
73
- * subscribes after the end gets the end alone.
74
- */
75
- const subscriberOf = ({ pubsub, ended }) => Stream.onEnd(Option.match(MutableRef.get(ended), { onNone: () => Stream.fromPubSub(pubsub), onSome: () => Stream.empty }), Effect.suspend(() => endOf(MutableRef.get(ended))));
75
+ /** A fresh source's entry, with no subscriber, no pump and no end. */
76
+ const fanned = () => ({ hearings: new Set(), pump: Option.none(), ended: Option.none() });
77
+ /** The pump: `acquire`'s source, each element to every subscriber; its end, kept and handed to each. */
78
+ const pumpOf = (entry, acquire) => Effect.scoped(Effect.flatMap(acquire, (source) => Stream.runForEach(source, (a) => Effect.sync(() => Iter.forEach(entry.hearings, (hearing) => hearing.hear(a)))))).pipe(Effect.onExit((exit) => Effect.sync(() => {
79
+ entry.ended = Option.some(exit);
80
+ Iter.forEach(entry.hearings, (hearing) => hearing.end(exit));
81
+ })));
82
+ /** An entry's pump stopped, its last subscriber gone. */
83
+ const stop = (entry) => Option.match(entry.pump, { onNone: () => Effect.void, onSome: (pump) => Effect.asVoid(Fiber.interrupt(pump)) });
76
84
  /**
77
- * An identity key for `RcMap`. `RcMap` hashes its keys with Effect's structural `Hash`, which
78
- * walks a target's properties: on a platform object that can throw (a DOM node's function
79
- * properties touch `.caller` in strict mode), and it would conflate two structurally equal but
80
- * distinct targets. This wrapper is equal by reference, with a stable per-instance hash, so `RcMap`
81
- * never inspects the target and each distinct target is its own entry. One wrapper is cached per
82
- * target (the `WeakMap` in {@link byTarget}).
85
+ * A subscriber to `key`'s shared source: its hearing on the entry while its Stream runs, the pump started
86
+ * for the first, in `scope`, the shared source's. One that subscribes after the source ended gets the end
87
+ * alone.
83
88
  */
84
- // Module state (#460, Q7): an id counter, only ever compared for distinctness, so every runtime may share it.
85
- let nextTargetHash = 1;
86
- class TargetKey {
87
- target;
88
- hash;
89
- constructor(target) {
90
- this.target = target;
91
- this.hash = nextTargetHash++;
92
- }
93
- [Hash.symbol]() {
94
- return this.hash;
95
- }
96
- [Equal.symbol](that) {
97
- return this === that;
89
+ const subscriberOf = (hold, key, acquire, scope) => Stream.unwrap(Effect.gen(function* () {
90
+ const entry = yield* hold(key);
91
+ const hearing = Hearing.make();
92
+ if (Option.isSome(entry.ended)) {
93
+ hearing.end(entry.ended.value);
94
+ return hearing.stream;
98
95
  }
99
- }
100
- /** The target a key addresses: a {@link TargetKey}'s own, else the key itself (a non-object target). */
101
- const targetOf = /*#__PURE__*/ Match.type().pipe(Match.when(Match.instanceOf(TargetKey), (key) => key.target), Match.orElse(identity));
102
- /** The cache's `idleTimeToLive`, when the options give one. */
103
- const idleOf = (options = {}) => UndefinedOr.match(options.idleTimeToLive, { onUndefined: () => ({}), onDefined: (idleTimeToLive) => ({ idleTimeToLive }) });
96
+ // Its hearing first, so what the pump hands on as it starts reaches it.
97
+ entry.hearings.add(hearing);
98
+ yield* Effect.addFinalizer(() => Effect.sync(() => entry.hearings.delete(hearing)));
99
+ if (Option.isNone(entry.pump))
100
+ entry.pump = Option.some(yield* Effect.forkIn(pumpOf(entry, acquire()), scope, { startImmediately: true }));
101
+ return hearing.stream;
102
+ }));
104
103
  /**
105
104
  * A shared source per target: a function from a target to a Stream that's hot and counted for that
106
105
  * target. The first subscriber for a target starts `lookup(target)`'s source, later ones share it, and it
107
- * stops when the last one for that target leaves, after `idleTimeToLive` if it's given.
106
+ * stops when the last one for that target leaves.
108
107
  *
109
108
  * @example
110
109
  * // `resizesOf(target)`: an Environment's own Stream of a target's sizes
111
110
  * const resize = yield* SharedSource.byTarget((target) => Effect.succeed(resizesOf(target)))
112
111
  */
113
- export const byTarget = /*#__PURE__*/ Effect.fnUntraced(function* (lookup, options) {
112
+ export const byTarget = /*#__PURE__*/ Effect.fnUntraced(function* (lookup) {
114
113
  yield* Effect.logDebug("wardic.sharedSource.byTarget: create");
115
- // One stable identity key per target (see TargetKey). Object targets are cached weakly, so the
116
- // key, and the RcMap entry it addresses, share the target's lifetime; a non-object target hashes
117
- // safely on its own.
118
- const keys = new WeakMap();
119
- const keyFor = (target) => Option.match(Option.liftPredicate(target, Predicate.isObjectOrArray), {
120
- onNone: () => target,
121
- onSome: (object) => Option.getOrElse(Option.fromUndefinedOr(keys.get(object)), () => {
122
- const key = new TargetKey(object);
123
- keys.set(object, key);
124
- return key;
125
- }),
126
- });
127
- const map = yield* RcMap.make({
128
- lookup: (key) => fanIn(lookup(targetOf(key))),
129
- ...idleOf(options),
130
- });
131
- return (target) => tracedStream(Stream.unwrap(Effect.gen(function* () {
132
- yield* Effect.logDebug("wardic.sharedSource.byTarget: subscribe");
133
- return subscriberOf(yield* RcMap.get(map, keyFor(target)));
134
- })), "wardic.sharedSource.byTarget");
114
+ const scope = yield* Scope.Scope;
115
+ const hold = counted(fanned, stop);
116
+ return (target) => tracedStream(Stream.unwrap(Effect.as(Effect.logDebug("wardic.sharedSource.byTarget: subscribe"), subscriberOf(hold, target, () => lookup(target), scope))), "wardic.sharedSource.byTarget");
135
117
  });
136
118
  /**
137
119
  * One shared source for the whole Environment: a Stream that's hot and counted. The first subscriber
138
- * starts `acquire`'s source, later ones share it, and it stops when the last one leaves, after
139
- * `idleTimeToLive` if it's given. `byTarget`'s form without a target.
120
+ * starts `acquire`'s source, later ones share it, and it stops when the last one leaves. `byTarget`'s
121
+ * form without a target.
140
122
  *
141
123
  * @example
142
124
  * // `viewportChanges`: an Environment's own Stream of its viewport's size
143
125
  * const viewport = yield* SharedSource.make(Effect.succeed(viewportChanges))
144
126
  * Stream.runForEach(viewport, onResize) // one listener, however many subscribe
145
127
  */
146
- // As `RcRef.make` is `RcMap.make`'s.
147
- export const make = /*#__PURE__*/ Effect.fnUntraced(function* (acquire, options) {
128
+ export const make = /*#__PURE__*/ Effect.fnUntraced(function* (acquire) {
148
129
  yield* Effect.logDebug("wardic.sharedSource.make: create");
149
- const ref = yield* RcRef.make({
150
- acquire: fanIn(acquire),
151
- ...idleOf(options),
152
- });
153
- return tracedStream(Stream.unwrap(Effect.gen(function* () {
154
- yield* Effect.logDebug("wardic.sharedSource.make: subscribe");
155
- return subscriberOf(yield* RcRef.get(ref));
156
- })), "wardic.sharedSource.make");
130
+ const scope = yield* Scope.Scope;
131
+ const hold = counted(fanned, stop);
132
+ return tracedStream(Stream.unwrap(Effect.as(Effect.logDebug("wardic.sharedSource.make: subscribe"), subscriberOf(hold, undefined, () => acquire, scope))), "wardic.sharedSource.make");
157
133
  });
158
134
  //# sourceMappingURL=SharedSource.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SharedSource.js","sourceRoot":"","sources":["../src/SharedSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,sGAAsG;AACtG,wFAAwF;AACxF,EAAE;AACF,wGAAwG;AACxG,yGAAyG;A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;IACxE,KAAK,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,kCAAkC,CAAC,CAAA;IAC1D,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAA;IAChC,MAAM,IAAI,GAAG,OAAO,CAAqB,MAAM,EAAE,IAAI,CAAC,CAAA;IACtD,OAAO,YAAY,CACjB,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,qCAAqC,CAAC,EAAE,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,EACrI,0BAA0B,CAC3B,CAAA;AACH,CAAC,CAAC,CAAA"}
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * Each Primitive is a machine (`Machine`), run as a `Stream` over the Clock's ticks
8
8
  * (`Machine.toStream`) or on the Frame loop (`Machine.run`). The services (`Clock`,
9
- * `RefreshFrameSource`, `Renderer`, `InputSource`, `Probe`, `InterpolatorRegistry`, `FrameLoop`,
9
+ * `RefreshFrameSource`, `Renderer`, `InputSource`, `Probe`, `ScrollSource`, `InterpolatorRegistry`, `FrameLoop`,
10
10
  * `DefaultTransition`) are each `X.X`, with the shared constructors the Environments build on
11
11
  * (`Clock.layer`, `Clock.fromRefreshFrames`, `InputSource.heldPointer`, `InputFeed.byTarget`,
12
12
  * `InterpolatorRegistry.layer`, `FrameLoop.layer`, `DefaultTransition.layerOneSpring`). Each module's
@@ -45,6 +45,7 @@ export * as RefreshFrameSource from "./RefreshFrameSource.ts";
45
45
  export * as Renderer from "./Renderer.ts";
46
46
  export * as Reorder from "./Reorder.ts";
47
47
  export * as Scalar from "./Scalar.ts";
48
+ export * as ScrollSource from "./ScrollSource.ts";
48
49
  export * as Sequence from "./Sequence.ts";
49
50
  export * as SharedSource from "./SharedSource.ts";
50
51
  export * as Spring from "./Spring.ts";
@@ -1 +1 @@
1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M,gBAAgB,CAAA;AAC3C,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA"}
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * Each Primitive is a machine (`Machine`), run as a `Stream` over the Clock's ticks
8
8
  * (`Machine.toStream`) or on the Frame loop (`Machine.run`). The services (`Clock`,
9
- * `RefreshFrameSource`, `Renderer`, `InputSource`, `Probe`, `InterpolatorRegistry`, `FrameLoop`,
9
+ * `RefreshFrameSource`, `Renderer`, `InputSource`, `Probe`, `ScrollSource`, `InterpolatorRegistry`, `FrameLoop`,
10
10
  * `DefaultTransition`) are each `X.X`, with the shared constructors the Environments build on
11
11
  * (`Clock.layer`, `Clock.fromRefreshFrames`, `InputSource.heldPointer`, `InputFeed.byTarget`,
12
12
  * `InterpolatorRegistry.layer`, `FrameLoop.layer`, `DefaultTransition.layerOneSpring`). Each module's
@@ -47,6 +47,7 @@ export * as RefreshFrameSource from "./RefreshFrameSource.js";
47
47
  export * as Renderer from "./Renderer.js";
48
48
  export * as Reorder from "./Reorder.js";
49
49
  export * as Scalar from "./Scalar.js";
50
+ export * as ScrollSource from "./ScrollSource.js";
50
51
  export * as Sequence from "./Sequence.js";
51
52
  export * as SharedSource from "./SharedSource.js";
52
53
  export * as Spring from "./Spring.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,oGAAoG;AACpG,uGAAuG;AACvG,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,G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mBAAmB,CAAA;AACjD,OAAO,KAAK,oBAAoB,MAAM,2BAA2B,CAAA;AACjE,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAC/C,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AACnD,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAA;AAC7D,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA"}
@@ -1,6 +1,7 @@
1
1
  import * as Cause from "effect/Cause";
2
2
  import * as Context from "effect/Context";
3
3
  import * as Effect from "effect/Effect";
4
+ import type * as Metric from "effect/Metric";
4
5
  import * as Option from "effect/Option";
5
6
  import type * as Scope from "effect/Scope";
6
7
  import * as Clock from "../Clock.ts";
@@ -43,6 +44,22 @@ export interface Shape {
43
44
  */
44
45
  readonly afterTick: (hook: () => undefined) => Effect.Effect<void, never, Scope.Scope>;
45
46
  }
47
+ /**
48
+ * The Frame loop's metrics: the running animations, the runs that settled and failed, and each tick's
49
+ * ms. None unless an app gives them (`FrameLoop.layerMetrics`, #518), so an app that reads none ships and
50
+ * updates none.
51
+ */
52
+ export interface Metrics {
53
+ readonly animations: Metric.Gauge<number>;
54
+ readonly settled: Metric.Counter<number>;
55
+ readonly failed: Metric.Counter<number>;
56
+ readonly tickMs: Metric.Histogram<number>;
57
+ }
58
+ /**
59
+ * Where a run's fiber finds the metrics. The loop takes them from the first run that has them: an app
60
+ * gives them beside its Environment, which the loop's own build doesn't see, as `CheckFrames` is read.
61
+ */
62
+ export declare const MetricsGiven: Context.Reference<Metrics | undefined>;
46
63
  /**
47
64
  * A check for development, off by default: on, every run started where it's on checks each Frame before
48
65
  * its sink gets it, and fails with `NonFiniteFrame` on a NaN or an Infinity. Read once a run, from the
@@ -1 +1 @@
1
- {"version":3,"file":"frameLoop.d.ts","sourceRoot":"","sources":["../../src/internal/frameLoop.ts"],"names":[],"mappings":"AAkDA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AAGzC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAMvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAGvC,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAA;AAG1C,OAAO,KAAK,KAAK,MAAM,aAAa,CAAA;AACpC,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAA;AACzC,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAA;AAC5C,OAAO,KAAK,KAAK,SAAS,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,KAAK,OAAO,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