@abide/abide 0.121.1 → 0.123.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.
@@ -54,8 +54,9 @@ export { online } from './online.ts'
54
54
  export { outbox, type QueuedCall } from './outbox.ts'
55
55
  export { onMenu } from './onMenu.ts'
56
56
  export { type Principal, principal } from './principal.ts'
57
- // EMITTED CODE'S: a prop the child writes (33.6, 33.7).
57
+ // EMITTED CODE'S: a prop the child writes (33.6, 33.7), and one it hands where a `Reactive` is due (33.27).
58
58
  export {
59
+ heldProp,
59
60
  propCell,
60
61
  propCells,
61
62
  propOr,
@@ -21,6 +21,24 @@ export function propCell(read: Accessor): () => Reactive<unknown> {
21
21
  return () => cell
22
22
  }
23
23
 
24
+ // Each read prop's `heldProp`, built on the first ask and kept for as long as its accessor is.
25
+ const HELD = new WeakMap<Accessor, Reactive<unknown>>()
26
+
27
+ /**
28
+ * 33.27 — a prop the child only reads, where its position holds the `Reactive` (31.3, 31.13): the
29
+ * one cell `propCell` would have built, over the caller's accessor. So `busy(rows)` asks what the
30
+ * caller's expression read — the caller's own `Reactive` where it bound one — and a plain value's is
31
+ * a cell nothing loads. Built only where one is asked for, and once per accessor.
32
+ */
33
+ export function heldProp(read: Accessor): Reactive<unknown> {
34
+ let cell = HELD.get(read)
35
+ if (cell === undefined) {
36
+ cell = propCell(read)()
37
+ HELD.set(read, cell)
38
+ }
39
+ return cell
40
+ }
41
+
24
42
  /**
25
43
  * 33.20 — a defaulted prop's accessor: the caller's, answering the default wherever it reads
26
44
  * `undefined`, and the default alone where the caller passed nothing. A bound accessor asked to
package/src/shared/rpc.ts CHANGED
@@ -19,7 +19,7 @@ import { GLOBAL_GETS } from './GLOBAL_GETS.ts'
19
19
  import { HandlerRoute } from './HandlerRoute.ts'
20
20
  import { IN_PROCESS_ORIGIN } from './IN_PROCESS_ORIGIN.ts'
21
21
  import type { Issues } from './Issues.ts'
22
- import { compose, type Middleware } from './Middleware.ts'
22
+ import { compose, type Rung } from './Middleware.ts'
23
23
  import { outbox, type QueuedCall, sendingFor } from './outbox.ts'
24
24
  import { principalRotated } from './principalRotated.ts'
25
25
  import {
@@ -192,7 +192,7 @@ const SENT: unique symbol = Symbol('abide.sent')
192
192
 
193
193
  export type RpcOptions<Args = unknown> = {
194
194
  description?: string
195
- middleware?: Middleware<RpcContext<Args>, unknown>[]
195
+ middleware?: Rung<RpcContext<Args>, unknown>[]
196
196
  timeout?: number
197
197
  clients?: Clients
198
198
  crossOrigin?: boolean | string[]
@@ -14,7 +14,7 @@ import { putOwn } from './putOwn.ts'
14
14
  * object where an array was, and `length`, `map` and every later `{#for}` over it go with it. The
15
15
  * shape is decided here, where the value is.
16
16
  *
17
- * 31.15 — ONLY PLAIN DATA IS COPIED. An element, a class instance, a `Map`: anything whose prototype
17
+ * 31.14 — ONLY PLAIN DATA IS COPIED. An element, a class instance, a `Map`: anything whose prototype
18
18
  * is not `Object.prototype`, `null` or `Array.prototype` owns its own state, and its setters say
19
19
  * what a write means — `video.currentTime = t` seeks. A spread of one is a plain object holding a
20
20
  * few own fields, so the write reached nothing and the `Reactive` came to hold the husk. The write