@abide/abide 0.118.0 → 0.120.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.
Files changed (150) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/bin/abide.ts +74 -11
  3. package/docs/REGISTRY.md +5 -4
  4. package/docs/RULEBOOK.md +35 -0
  5. package/docs/abide.md +363 -127
  6. package/package.json +1 -1
  7. package/scaffold/src/getGreeting.test.ts +1 -0
  8. package/scaffold/src/index.abide +4 -1
  9. package/scaffold/src/index.test.ts +2 -0
  10. package/scaffold/src/layout.abide +6 -6
  11. package/src/compiler/Lowering.ts +20 -2
  12. package/src/compiler/PositionTable.ts +1 -0
  13. package/src/compiler/Refusals.ts +1 -0
  14. package/src/compiler/TypeSession.ts +11 -8
  15. package/src/compiler/aliasedSymbol.ts +1 -1
  16. package/src/compiler/ambientReadsIn.ts +1 -0
  17. package/src/compiler/appLayout.ts +4 -2
  18. package/src/compiler/argsDefaultsIn.ts +1 -0
  19. package/src/compiler/argsSchemaOf.ts +1 -0
  20. package/src/compiler/checkApp.ts +3 -1
  21. package/src/compiler/checkedShadow.ts +2 -1
  22. package/src/compiler/classifyRead.ts +1 -0
  23. package/src/compiler/classifyTemplate.ts +1 -0
  24. package/src/compiler/compileApp.ts +4 -2
  25. package/src/compiler/compiledEntry.ts +1 -0
  26. package/src/compiler/componentGraph.ts +1 -0
  27. package/src/compiler/declaredExports.ts +4 -2
  28. package/src/compiler/emitClient.ts +19 -14
  29. package/src/compiler/emitComponent.ts +1 -0
  30. package/src/compiler/emitSource.ts +2 -1
  31. package/src/compiler/formatAbide.ts +857 -0
  32. package/src/compiler/formatDiagnosis.ts +1 -0
  33. package/src/compiler/handlersUnder.ts +2 -1
  34. package/src/compiler/hookCalls.ts +1 -0
  35. package/src/compiler/lineOf.ts +17 -0
  36. package/src/compiler/matchersOf.ts +13 -3
  37. package/src/compiler/mountsOf.ts +2 -0
  38. package/src/compiler/paramFile.ts +1 -0
  39. package/src/compiler/parseAbide.ts +48 -28
  40. package/src/compiler/projectShadow.ts +10 -3
  41. package/src/compiler/reactiveOptions.ts +1 -0
  42. package/src/compiler/reactiveTypes.ts +2 -1
  43. package/src/compiler/readsIn.ts +3 -2
  44. package/src/compiler/renderMarkup.ts +3 -2
  45. package/src/compiler/resolverIn.ts +2 -0
  46. package/src/compiler/sameTemplate.ts +150 -0
  47. package/src/compiler/scaffold.ts +4 -11
  48. package/src/compiler/serveLanguage.ts +46 -19
  49. package/src/compiler/sharedModuleWrites.ts +2 -1
  50. package/src/compiler/sourceMapOf.ts +1 -0
  51. package/src/compiler/splitImports.ts +2 -0
  52. package/src/compiler/templateWarnings.ts +2 -2
  53. package/src/compiler/trackingWarnings.ts +1 -0
  54. package/src/compiler/writeDefaultProject.ts +5 -1
  55. package/src/server/BRIDGE_SCHEME.ts +3 -0
  56. package/src/server/BRIDGE_VERSION.ts +1 -1
  57. package/src/server/abideModules.ts +2 -0
  58. package/src/server/answerFailure.ts +1 -0
  59. package/src/server/answerRequest.ts +15 -14
  60. package/src/server/answerRpc.ts +3 -2
  61. package/src/server/answerSocket.ts +2 -1
  62. package/src/server/answerValue.ts +1 -0
  63. package/src/server/answerWorker.ts +1 -0
  64. package/src/server/appTree.ts +3 -1
  65. package/src/server/argsFor.ts +1 -0
  66. package/src/server/assistant.ts +2 -1
  67. package/src/server/banner.ts +2 -0
  68. package/src/server/bridgeRelay.ts +1 -0
  69. package/src/server/callerOf.ts +1 -0
  70. package/src/server/claudeApi.ts +1 -0
  71. package/src/server/claudeCode.ts +30 -14
  72. package/src/server/clientBundle.ts +1 -0
  73. package/src/server/coerceArgs.ts +1 -2
  74. package/src/server/commands.ts +9 -0
  75. package/src/server/compressAnswer.ts +2 -1
  76. package/src/server/config.ts +2 -0
  77. package/src/server/createApp.ts +4 -2
  78. package/src/server/crossingOrigin.ts +1 -0
  79. package/src/server/csp.ts +1 -0
  80. package/src/server/deferredBuilds.ts +1 -0
  81. package/src/server/derivedArgs.ts +1 -0
  82. package/src/server/devWorker.ts +2 -1
  83. package/src/server/faceOf.ts +2 -7
  84. package/src/server/generatedSurfaces.ts +5 -1
  85. package/src/server/hooks.ts +1 -0
  86. package/src/server/iconAccent.ts +1 -1
  87. package/src/server/installServer.ts +1 -0
  88. package/src/server/installSourceMaps.ts +1 -0
  89. package/src/server/launcherPage.ts +2 -2
  90. package/src/server/manifestOf.ts +1 -0
  91. package/src/server/muxUpgrade.ts +1 -0
  92. package/src/server/nativeMenu.ts +2 -0
  93. package/src/server/principal.ts +2 -1
  94. package/src/server/remote.ts +1 -0
  95. package/src/server/render.ts +3 -3
  96. package/src/server/renderComponent.ts +1 -0
  97. package/src/server/reportHealth.ts +1 -0
  98. package/src/server/requestScope.ts +3 -1
  99. package/src/server/runDesktop.ts +3 -2
  100. package/src/server/seedBuffer.ts +1 -0
  101. package/src/server/serveDev.ts +3 -2
  102. package/src/server/shell.ts +2 -0
  103. package/src/server/streamEvent.ts +1 -0
  104. package/src/server/surfaceOf.ts +1 -0
  105. package/src/server/testBuild.ts +1 -0
  106. package/src/server/testMount.ts +1 -0
  107. package/src/server/trace.ts +2 -0
  108. package/src/server/withAbideSources.ts +1 -0
  109. package/src/shared/Attributes.ts +12 -8
  110. package/src/shared/cookies.ts +1 -1
  111. package/src/shared/escapeText.ts +1 -1
  112. package/src/shared/index.ts +1 -5
  113. package/src/shared/jsonSchema.ts +1 -3
  114. package/src/shared/menuBridge.ts +1 -2
  115. package/src/shared/outbox.ts +1 -1
  116. package/src/shared/reactive/Keyed.ts +2 -2
  117. package/src/shared/reactive/Reactive.ts +12 -16
  118. package/src/shared/reactive/index.ts +3 -4
  119. package/src/shared/reactive/isReactive.ts +1 -1
  120. package/src/shared/reactive/scoped.ts +2 -2
  121. package/src/shared/reactive/share.ts +1 -1
  122. package/src/shared/reactive/watch.ts +4 -4
  123. package/src/shared/refuse.ts +1 -1
  124. package/src/shared/rpc.ts +8 -11
  125. package/src/shared/url.ts +1 -1
  126. package/src/shared/validateJson.ts +1 -1
  127. package/src/ui/ArmRegion.ts +1 -0
  128. package/src/ui/Level.ts +1 -0
  129. package/src/ui/List.ts +1 -0
  130. package/src/ui/RawRun.ts +1 -0
  131. package/src/ui/Router.ts +1 -0
  132. package/src/ui/TryRegion.ts +1 -0
  133. package/src/ui/adoptWalk.ts +2 -1
  134. package/src/ui/bindElement.ts +1 -0
  135. package/src/ui/bindFiles.ts +1 -0
  136. package/src/ui/bindGroup.ts +1 -0
  137. package/src/ui/bindProperty.ts +1 -0
  138. package/src/ui/bindSpread.ts +1 -0
  139. package/src/ui/index.ts +1 -6
  140. package/src/ui/outboxQueue.ts +1 -1
  141. package/src/ui/parseMarkup.ts +2 -1
  142. package/src/ui/reconcile.ts +2 -1
  143. package/src/ui/reconcileHead.ts +1 -0
  144. package/src/ui/regions.ts +2 -1
  145. package/src/ui/registerWorker.ts +1 -0
  146. package/src/ui/rows.ts +1 -0
  147. package/src/ui/setMarkup.ts +1 -0
  148. package/src/ui/setText.ts +1 -0
  149. package/src/ui/socketWire.ts +4 -3
  150. package/src/ui/wire.ts +2 -1
@@ -231,7 +231,7 @@ export function reactive<
231
231
  */
232
232
  export function reactive<
233
233
  Body extends (args?: never) => unknown,
234
- Optional extends OptionalParameter<Body>,
234
+ _Optional extends OptionalParameter<Body>,
235
235
  Shaped = ChunkOf<Body>[],
236
236
  Gate = Schema<ChunkOf<Body>[]>,
237
237
  ArgsGate = Schema<Parameters<Body>[0]>,
@@ -291,7 +291,7 @@ export function reactive<
291
291
  */
292
292
  export function reactive<
293
293
  Body extends (args?: never) => unknown,
294
- Optional extends OptionalParameter<Body>,
294
+ _Optional extends OptionalParameter<Body>,
295
295
  Shaped = Awaited<ReturnType<Body>>,
296
296
  Gate = Schema<Awaited<ReturnType<Body>>>,
297
297
  ArgsGate = Schema<Parameters<Body>[0]>,
@@ -388,8 +388,7 @@ export function reactive(
388
388
  // `store`, built where it is first reached (11.71). `global` is what keeps a value process-wide
389
389
  // (11.34).
390
390
  const options = given[1] as
391
- | { global?: boolean; store?: unknown }
392
- | undefined
391
+ { global?: boolean; store?: unknown } | undefined
393
392
  if (outsideScope(options?.global === true))
394
393
  return scoped(
395
394
  () => build(given, keyed),
@@ -1,3 +1,4 @@
1
+ import type { Reactive } from './Reactive.ts'
1
2
  // 1.6 — THE BRAND, READ ON ITS OWN. A `Reactive` is callable AND thenable, so every guard that
2
3
  // can meet one reads this before `typeof value === 'function'` or an `isThenable` probe.
3
4
  //
@@ -9,7 +10,6 @@
9
10
  // 2,348 bytes without it. The `Reactive` import is TYPE-ONLY and erased, which is what lets the
10
11
  // predicate keep its exact shape at no cost.
11
12
  import { REACTIVE_BRAND } from './REACTIVE_BRAND.ts'
12
- import type { Reactive } from './Reactive.ts'
13
13
 
14
14
  export function isReactive(value: unknown): value is Reactive<unknown> {
15
15
  return (
@@ -16,9 +16,9 @@ import { contractOf, type Gated } from './argsContract.ts'
16
16
  import { CELL } from './CELL.ts'
17
17
  import { KEYED_BRAND } from './KEYED_BRAND.ts'
18
18
  import { brandedPrototype, MEMBER_KEYS, signalMoved } from './Reactive.ts'
19
- import { SELECTION_MEMBERS } from './SELECTION_MEMBERS.ts'
20
19
  import { currentScope, runInScope, SCOPING } from './scoping.ts'
21
- import { newTracked, TRACKING, type Tracked, trackProbe } from './tracking.ts'
20
+ import { SELECTION_MEMBERS } from './SELECTION_MEMBERS.ts'
21
+ import { newTracked, type Tracked, TRACKING, trackProbe } from './tracking.ts'
22
22
 
23
23
  const UNBUILT: unique symbol = Symbol('abide.unbuilt')
24
24
 
@@ -35,7 +35,7 @@ let CURRENT: ShareScope | null = null
35
35
  * Empty here: an app widens it, and a key it declares is checked against it where a key it does
36
36
  * not is inferred from the thunk.
37
37
  */
38
- // biome-ignore lint/suspicious/noEmptyInterface: 10.3 — an app merges its own keys into this.
38
+ // 10.3 — an app merges its own keys into this.
39
39
  export interface Shared {}
40
40
 
41
41
  /** The value held under `key` by this component or its nearest ancestor, or one created here. */
@@ -22,15 +22,15 @@ import {
22
22
  detach,
23
23
  newSubscriber,
24
24
  type Subscriber,
25
- TRACKING,
26
25
  type Tracked,
26
+ TRACKING,
27
27
  truncate,
28
28
  truncateProbes,
29
29
  untracked,
30
30
  } from './tracking.ts'
31
31
 
32
32
  export type Disposer = () => void
33
- // biome-ignore lint/suspicious/noConfusingVoidType: `void` is an EFFECT'S RETURN POSITION and is load-bearing. `undefined` there refuses the ordinary effect — a block body that returns nothing infers `void`, which is not assignable to `undefined` — so the rule's own fix would reject every caller that does not return a disposer.
33
+ // `void` is an EFFECT'S RETURN POSITION and is load-bearing. `undefined` there refuses the ordinary effect — a block body that returns nothing infers `void`, which is not assignable to `undefined` — so every caller that does not return a disposer would be rejected.
34
34
  export type Effect = () => void | Disposer
35
35
 
36
36
  const WATCH_LOG = namedLogger('abide:watch')
@@ -186,7 +186,7 @@ export function watchOver(
186
186
  adopter: Tracked | null,
187
187
  effect: Effect,
188
188
  ): Disposer {
189
- // biome-ignore lint/suspicious/noConfusingVoidType: `void` is an EFFECT'S RETURN POSITION and is load-bearing. `undefined` there refuses the ordinary effect — a block body that returns nothing infers `void`, which is not assignable to `undefined` — so the rule's own fix would reject every caller that does not return a disposer.
189
+ // `void`, not `undefined`: see `Effect`.
190
190
  let dispose: Disposer | void
191
191
  // The sources are declared rather than tracked. `detach` still tears this down: it truncates
192
192
  // from the cursor, and the cursor of a body that never tracked is zero.
@@ -259,7 +259,7 @@ export function watchOver(
259
259
  * adoption mirror's too. Two literals keep that call site to the effects a template makes.
260
260
  */
261
261
  export function watchTracked(effect: Effect): Disposer {
262
- // biome-ignore lint/suspicious/noConfusingVoidType: `void` is an EFFECT'S RETURN POSITION and is load-bearing. `undefined` there refuses the ordinary effect — a block body that returns nothing infers `void`, which is not assignable to `undefined` — so the rule's own fix would reject every caller that does not return a disposer.
262
+ // `void`, not `undefined`: see `Effect`.
263
263
  let dispose: Disposer | void
264
264
  const reader: Subscriber = newSubscriber([], null)
265
265
  // 11.32 — A RERUN READS THROUGH THE SCOPE THE WATCH WAS OPENED IN, not the ambient one. The
@@ -8,8 +8,8 @@
8
8
  // cannot narrow against a name it never wrote. `Aborted` is the one the app asks for itself: it
9
9
  // comes back only from a call the app handed a signal and then aborted (16.49).
10
10
 
11
- import { FAILURE_STATUS_TEXT } from './FAILURE_STATUS_TEXT.ts'
12
11
  import { type Failed, failed, isFailed } from './Failed.ts'
12
+ import { FAILURE_STATUS_TEXT } from './FAILURE_STATUS_TEXT.ts'
13
13
  import type { Issues } from './Issues.ts'
14
14
  import type { JsonValue } from './JsonValue.ts'
15
15
  import { namedLogger } from './log.ts'
package/src/shared/rpc.ts CHANGED
@@ -17,12 +17,11 @@ import { DERIVED_ARGS } from './DERIVED_ARGS.ts'
17
17
  import { type Failed, isFailedNamed } from './Failed.ts'
18
18
  import { GLOBAL_GETS } from './GLOBAL_GETS.ts'
19
19
  import { HandlerRoute } from './HandlerRoute.ts'
20
- import type { Issues } from './Issues.ts'
21
20
  import { IN_PROCESS_ORIGIN } from './IN_PROCESS_ORIGIN.ts'
21
+ import type { Issues } from './Issues.ts'
22
22
  import { compose, type Middleware } from './Middleware.ts'
23
23
  import { outbox, type QueuedCall, sendingFor } from './outbox.ts'
24
24
  import { principalRotated } from './principalRotated.ts'
25
- import { RPC_SERVER } from './RPC_SERVER.ts'
26
25
  import {
27
26
  contractOf,
28
27
  type Gated,
@@ -42,18 +41,19 @@ import {
42
41
  type Keyed,
43
42
  type OptionalParameter,
44
43
  type Reactive,
45
- type Refusals,
46
44
  reactive,
45
+ type Refusals,
47
46
  type Shaping,
48
47
  STREAMING,
49
- type Streams,
50
48
  streamingOrSettled,
49
+ type Streams,
51
50
  } from './reactive/index.ts'
52
51
  import { MUTATION } from './reactive/MUTATION.ts'
53
52
  import { dropAnswered } from './reactive/Reactive.ts'
54
- import { SELECTION_MEMBERS } from './reactive/SELECTION_MEMBERS.ts'
55
53
  import { builtHere, isForwarder } from './reactive/scoped.ts'
54
+ import { SELECTION_MEMBERS } from './reactive/SELECTION_MEMBERS.ts'
56
55
  import { checkArgs, validationError } from './refuse.ts'
56
+ import { RPC_SERVER } from './RPC_SERVER.ts'
57
57
  import { rpcRequest } from './rpcRequest.ts'
58
58
  import type { Schema } from './Schema.ts'
59
59
 
@@ -150,8 +150,7 @@ type Annotated<Args> = 0 extends 1 & Args
150
150
  : Derived<Exclude<Args, undefined>>
151
151
  // `Member` is distributed over and `Whole` is not: a member that is not the whole is one arm of a union.
152
152
  type Derived<Member, Whole = Member> = Member extends
153
- | readonly unknown[]
154
- | ((...given: never[]) => unknown)
153
+ readonly unknown[] | ((...given: never[]) => unknown)
155
154
  ? never
156
155
  : Member extends object
157
156
  ? [Whole] extends [Member]
@@ -215,8 +214,7 @@ export type Plain = { invalidate?: never }
215
214
  // every function arm, whose `& Plain` only passes assignability. The guard is the whole parameter
216
215
  // because `& Plain` kept `GET(0)` the literal `0`, and a bound of `Plain` refuses every primitive.
217
216
  type Held<Accepted> = Accepted extends
218
- | ((...given: never[]) => unknown)
219
- | { invalidate: unknown }
217
+ ((...given: never[]) => unknown) | { invalidate: unknown }
220
218
  ? never
221
219
  : Accepted | PromiseLike<Accepted>
222
220
 
@@ -262,8 +260,7 @@ type Declare = {
262
260
  >
263
261
  <Chunk, Shaped = Chunk[], Gate = Schema<Chunk[]>>(
264
262
  handler: (() =>
265
- | AsyncGenerator<Chunk>
266
- | Promise<AsyncGenerator<Chunk>>) &
263
+ AsyncGenerator<Chunk> | Promise<AsyncGenerator<Chunk>>) &
267
264
  Plain,
268
265
  options?: Shaping<Chunk[], Shaped, never, Gate> & RpcOptions<undefined>,
269
266
  ): Rpc<Kept<Shaped>, undefined, Refusals<Shaped, Gate, Chunk[]>, Chunk>
package/src/shared/url.ts CHANGED
@@ -77,7 +77,7 @@ type Narrowed<P extends string> = P extends keyof Routes
77
77
  * 30.26 — the route literals an app files its pages under, which `abide check` declares for the app
78
78
  * it checks. Where nothing declared them any literal is taken, so a plain `tsc` still compiles.
79
79
  */
80
- // biome-ignore lint/suspicious/noEmptyInterface: filled by declaration merging, per app — each literal to `true`, or to the params it narrows (23.9)
80
+ // Filled by declaration merging, per app — each literal to `true`, or to the params it narrows (23.9)
81
81
  export interface Routes {}
82
82
 
83
83
  /** 30.26 — what `url` takes: one of the app's route literals, or any where none were declared. */
@@ -13,8 +13,8 @@
13
13
  // `description`, `default` and the rest say nothing about whether a value is valid, and a
14
14
  // generated document carries them.
15
15
 
16
- import type { Issues } from './Issues.ts'
17
16
  import { isRecord } from './isRecord.ts'
17
+ import type { Issues } from './Issues.ts'
18
18
  import { issuesOf } from './issuesOf.ts'
19
19
  import type { JsonValue } from './JsonValue.ts'
20
20
  import { note } from './note.ts'
@@ -11,6 +11,7 @@ import {
11
11
  type ShareScope,
12
12
  } from '#shared/reactive/share.ts'
13
13
  import { untracked } from '#shared/reactive/tracking.ts'
14
+
14
15
  import { HYDRATE_LOG } from './Mismatch.ts'
15
16
  import { fillRegion, isEmptyRegion, type Region } from './regions.ts'
16
17
  import { Scope, type Stoppable } from './Scope.ts'
package/src/ui/Level.ts CHANGED
@@ -6,6 +6,7 @@ import {
6
6
  } from '#shared/reactive/share.ts'
7
7
  import { untracked } from '#shared/reactive/tracking.ts'
8
8
  import { type Disposer, watchTracked } from '#shared/reactive/watch.ts'
9
+
9
10
  import { reconciled, reconcileHead } from './reconcileHead.ts'
10
11
  import { isEmptyRegion, type Region } from './regions.ts'
11
12
  import type { Scope } from './Scope.ts'
package/src/ui/List.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { listOf } from '#shared/listOf.ts'
2
2
  import { untracked } from '#shared/reactive/tracking.ts'
3
+
3
4
  import { HYDRATE_LOG, Mismatch, warnMismatch } from './Mismatch.ts'
4
5
  import { reconcile } from './reconcile.ts'
5
6
  import { isEmptyRegion, type Region, removeUntil } from './regions.ts'
package/src/ui/RawRun.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { RAW_CLOSE, RAW_OPEN } from '#shared/ANCHORS.ts'
2
+
2
3
  import { Mismatch } from './Mismatch.ts'
3
4
  import { parseMarkup } from './parseMarkup.ts'
4
5
  import { removeUntil } from './regions.ts'
package/src/ui/Router.ts CHANGED
@@ -11,6 +11,7 @@ import { arrive, route } from '#shared/route.ts'
11
11
  import { rankRoutes, type Segment } from '#shared/routePattern.ts'
12
12
  import { setUpLevels } from '#shared/setUpLevels.ts'
13
13
  import { paintedCallsLanded } from '#shared/takeEarlyCall.ts'
14
+
14
15
  import { LAYER_MOUNT, LAYER_NAVIGATE } from './LAYER_NAMES.ts'
15
16
  import { Level } from './Level.ts'
16
17
  import { beginLayer, endLayer } from './measureLayer.ts'
@@ -16,6 +16,7 @@ import { type Reactive, reactive } from '#shared/reactive/index.ts'
16
16
  import { NotLanded } from '#shared/reactive/NotLanded.ts'
17
17
  import { untracked } from '#shared/reactive/tracking.ts'
18
18
  import { type Disposer, watchTracked } from '#shared/reactive/watch.ts'
19
+
19
20
  import { type Arm, type ArmMakers, ArmRegion } from './ArmRegion.ts'
20
21
  import { Mismatch } from './Mismatch.ts'
21
22
  import {
@@ -1,6 +1,7 @@
1
1
  import { RAW_CLOSE, RAW_OPEN } from '#shared/ANCHORS.ts'
2
+
2
3
  import { Mismatch } from './Mismatch.ts'
3
- import { type RawRun, rawCloseOf, rawRunEndingAt } from './RawRun.ts'
4
+ import { rawCloseOf, type RawRun, rawRunEndingAt } from './RawRun.ts'
4
5
  import { closeOf, opensRegion, type Region } from './regions.ts'
5
6
 
6
7
  // WHERE A NODE IS WHEN THE SERVER ALREADY WROTE IT — the adopt half of every region's mount: the
@@ -1,6 +1,7 @@
1
1
  import { isReactive } from '#shared/reactive/isReactive.ts'
2
2
  import { isThenable } from '#shared/reactive/isThenable.ts'
3
3
  import type { Disposer } from '#shared/reactive/watch.ts'
4
+
4
5
  import { holdWhileLeaving } from './leave.ts'
5
6
 
6
7
  /**
@@ -1,4 +1,5 @@
1
1
  import { boundValue, writeBound } from '#shared/boundValue.ts'
2
+
2
3
  import type { Scope } from './Scope.ts'
3
4
 
4
5
  /**
@@ -4,6 +4,7 @@ import {
4
4
  heldValue,
5
5
  writeBound,
6
6
  } from '#shared/boundValue.ts'
7
+
7
8
  import type { Scope } from './Scope.ts'
8
9
 
9
10
  /**
@@ -13,6 +13,7 @@ import {
13
13
  writeBound,
14
14
  } from '#shared/boundValue.ts'
15
15
  import { numberFromText } from '#shared/numberFromText.ts'
16
+
16
17
  import type { Scope } from './Scope.ts'
17
18
 
18
19
  type Bound = HTMLInputElement & HTMLDetailsElement
@@ -3,6 +3,7 @@
3
3
  // function becomes the element's listener, replaced when the value hands over another.
4
4
 
5
5
  import { spreadEntries } from '#shared/spread.ts'
6
+
6
7
  import type { Scope } from './Scope.ts'
7
8
  import { addAttribute } from './setAttribute.ts'
8
9
 
package/src/ui/index.ts CHANGED
@@ -50,12 +50,7 @@ export { contributeHead } from './Level.ts'
50
50
  export { listAt, updateList } from './List.ts'
51
51
  export { warnMismatch } from './Mismatch.ts'
52
52
  export { markupNodes, namespaceUnder } from './parseMarkup.ts'
53
- export {
54
- fillEmpty,
55
- fillRegion,
56
- isEmptyRegion,
57
- type Region,
58
- } from './regions.ts'
53
+ export { fillEmpty, fillRegion, isEmptyRegion, type Region } from './regions.ts'
59
54
  export { rowKeyOf } from './rowKeyOf.ts'
60
55
  export { itemOf, noUpdate, replaceRow, rowCell } from './rows.ts'
61
56
  export { EMPTY_SCOPE, Scope } from './Scope.ts'
@@ -17,7 +17,7 @@ import {
17
17
  } from '#shared/answerOf.ts'
18
18
  import { failedFrom, isFailed, problemOf } from '#shared/Failed.ts'
19
19
  import type { Problem } from '#shared/Failed.ts'
20
- import { type ShownCall, showLine, showSending } from '#shared/outbox.ts'
20
+ import { showLine, type ShownCall, showSending } from '#shared/outbox.ts'
21
21
  import { onPrincipalRotated } from '#shared/principalRotated.ts'
22
22
  import {
23
23
  isReactive,
@@ -50,7 +50,8 @@ export function parseMarkup(parent: Node, markup: string): DocumentFragment {
50
50
  TEMPLATES.set(document, template)
51
51
  }
52
52
  const space = namespaceUnder(parent)
53
- const wrapper = space === HTML_NAMESPACE ? undefined : space === SVG ? 'svg' : 'math'
53
+ const wrapper =
54
+ space === HTML_NAMESPACE ? undefined : space === SVG ? 'svg' : 'math'
54
55
  if (wrapper === undefined) {
55
56
  template.innerHTML = markup
56
57
  return template.content
@@ -1,8 +1,9 @@
1
1
  import { PATCHES } from '#shared/reactive/PATCHES.ts'
2
+
2
3
  import { LAYER_RECONCILE } from './LAYER_NAMES.ts'
3
4
  import type { List } from './List.ts'
4
- import { HYDRATE_LOG } from './Mismatch.ts'
5
5
  import { beginLayer, endLayer } from './measureLayer.ts'
6
+ import { HYDRATE_LOG } from './Mismatch.ts'
6
7
  import { emptyRegion } from './regions.ts'
7
8
  import { dropRow, makeRow, moveRow, type Row, updateRow } from './rows.ts'
8
9
 
@@ -13,6 +13,7 @@
13
13
  // server painted is ADOPTED the first time its contributor is reconciled, matched in chain order.
14
14
 
15
15
  import { headKeyOf } from '#shared/headKeyOf.ts'
16
+
16
17
  import { markupNodes } from './parseMarkup.ts'
17
18
 
18
19
  /** One contributor's head, parsed once per text it reads. */
package/src/ui/regions.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import { REGION_CLOSE, REGION_OPEN } from '#shared/ANCHORS.ts'
2
+
2
3
  import { LAYER_FILL } from './LAYER_NAMES.ts'
3
4
  import { anyLeaving, leave } from './leave.ts'
4
- import { Mismatch } from './Mismatch.ts'
5
5
  import { beginLayer, endLayer } from './measureLayer.ts'
6
+ import { Mismatch } from './Mismatch.ts'
6
7
 
7
8
  export type Region = { open: Comment; close: Comment }
8
9
 
@@ -5,6 +5,7 @@ import { WORKER_ADDRESS } from '#shared/ADDRESSES.ts'
5
5
  import { MOUNT, mounted } from '#shared/mount.ts'
6
6
  import { OFFLINE_META } from '#shared/OFFLINE_META.ts'
7
7
  import { onPrincipalRotated } from '#shared/principalRotated.ts'
8
+
8
9
  import { HYDRATE_LOG } from './Mismatch.ts'
9
10
 
10
11
  /** Registers the app's service worker once the page has loaded, over the mount's whole scope. */
package/src/ui/rows.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { REGION_CLOSE, ROW_OPEN } from '#shared/ANCHORS.ts'
2
2
  import { moveItem, rowItem } from '#shared/reactive/index.ts'
3
3
  import { PATCHES } from '#shared/reactive/PATCHES.ts'
4
+
4
5
  import { leave } from './leave.ts'
5
6
  import { moveNode } from './moveNode.ts'
6
7
  import { closeOf, opensRegion, type Region, removeUntil } from './regions.ts'
@@ -1,4 +1,5 @@
1
1
  import { WORK } from '#shared/WORK.ts'
2
+
2
3
  import { RawRun, refillRun, textToMarkup } from './RawRun.ts'
3
4
 
4
5
  /**
package/src/ui/setText.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { WORK } from '#shared/WORK.ts'
2
+
2
3
  import { markupToText, RawRun } from './RawRun.ts'
3
4
 
4
5
  /**
@@ -3,7 +3,10 @@
3
3
  // where the version it holds is not the server's, and the writes of each patch over it (18.6, 18.11).
4
4
 
5
5
  import { SOCKET_ADDRESS } from '#shared/ADDRESSES.ts'
6
+ import { applyPatch } from '#shared/applyPatch.ts'
6
7
  import { mounted } from '#shared/mount.ts'
8
+ import type { BrowserFrame, ServerFrame } from '#shared/muxFrames.ts'
9
+ import { onPrincipalRotated } from '#shared/principalRotated.ts'
7
10
  import { canonicalKey } from '#shared/reactive/canonicalKey.ts'
8
11
  import {
9
12
  heldGenerationOf,
@@ -14,9 +17,7 @@ import {
14
17
  writtenLocally,
15
18
  } from '#shared/reactive/index.ts'
16
19
  import { PATCHES } from '#shared/reactive/PATCHES.ts'
17
- import type { BrowserFrame, ServerFrame } from '#shared/muxFrames.ts'
18
- import { applyPatch } from '#shared/applyPatch.ts'
19
- import { onPrincipalRotated } from '#shared/principalRotated.ts'
20
+
20
21
  import { HYDRATE_LOG } from './Mismatch.ts'
21
22
  import { undelivered, whenDelivered } from './outboxQueue.ts'
22
23
 
package/src/ui/wire.ts CHANGED
@@ -33,11 +33,12 @@ import { LOAD_OFFLINE } from '#shared/LOAD_OFFLINE.ts'
33
33
  import { LOAD_SIGNAL } from '#shared/LOAD_SIGNAL.ts'
34
34
  import { reactive, standIn, structural } from '#shared/reactive/index.ts'
35
35
  import {
36
- type Defaults,
37
36
  declareDefaults,
37
+ type Defaults,
38
38
  } from '#shared/reactive/parameterDefaults.ts'
39
39
  import { declare, type Method } from '#shared/rpc.ts'
40
40
  import { type RpcRequest, rpcRequest } from '#shared/rpcRequest.ts'
41
+
41
42
  import { enqueue, undelivered } from './outboxQueue.ts'
42
43
  import { followRpc } from './socketWire.ts'
43
44