@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.
- package/ABIDE.md +4 -0
- package/CHANGELOG.md +17 -0
- package/docs/REGISTRY.md +15 -15
- package/docs/RULEBOOK.md +36 -14
- package/docs/abide.md +33 -33
- package/package.json +1 -1
- package/src/compiler/Lowering.ts +4 -2
- package/src/compiler/REACTIVE_MEMBERS.ts +2 -3
- package/src/compiler/SHARED_NAMES.ts +2 -0
- package/src/compiler/TypeSession.ts +1 -1
- package/src/compiler/classifyRead.ts +18 -4
- package/src/compiler/projectShadow.ts +1 -0
- package/src/compiler/reactiveTypes.ts +2 -2
- package/src/compiler/readsIn.ts +144 -49
- package/src/server/BRIDGE_VERSION.ts +1 -1
- package/src/server/answerFailure.ts +16 -0
- package/src/server/answerRequest.ts +16 -21
- package/src/server/answerRpc.ts +4 -3
- package/src/server/assistant.ts +25 -4
- package/src/server/createApp.ts +5 -1
- package/src/server/csp.ts +2 -2
- package/src/server/hooks.ts +39 -8
- package/src/shared/Middleware.ts +24 -4
- package/src/shared/csp.ts +2 -2
- package/src/shared/index.ts +2 -1
- package/src/shared/propCell.ts +18 -0
- package/src/shared/rpc.ts +2 -2
- package/src/shared/writePath.ts +1 -1
package/src/shared/index.ts
CHANGED
|
@@ -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,
|
package/src/shared/propCell.ts
CHANGED
|
@@ -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
|
|
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?:
|
|
195
|
+
middleware?: Rung<RpcContext<Args>, unknown>[]
|
|
196
196
|
timeout?: number
|
|
197
197
|
clients?: Clients
|
|
198
198
|
crossOrigin?: boolean | string[]
|
package/src/shared/writePath.ts
CHANGED
|
@@ -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.
|
|
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
|