@abide/abide 0.123.3 → 0.124.1

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 (91) hide show
  1. package/ABIDE.md +8 -5
  2. package/CHANGELOG.md +38 -0
  3. package/docs/REGISTRY.md +45 -12
  4. package/docs/RULEBOOK.md +29 -16
  5. package/docs/abide.md +999 -459
  6. package/package.json +1 -1
  7. package/src/compiler/ARRAY_MUTATORS.ts +20 -0
  8. package/src/compiler/LoweredFile.ts +609 -0
  9. package/src/compiler/Lowering.ts +46 -4
  10. package/src/compiler/SHARED_NAMES.ts +2 -0
  11. package/src/compiler/ShadowHost.ts +670 -0
  12. package/src/compiler/ShadowMap.ts +1 -1
  13. package/src/compiler/TypeSession.ts +71 -1715
  14. package/src/compiler/appLints.ts +109 -0
  15. package/src/compiler/checkedShadow.ts +1 -1
  16. package/src/compiler/classifyRead.ts +16 -1
  17. package/src/compiler/compileApp.ts +2 -2
  18. package/src/compiler/declaredExports.ts +44 -17
  19. package/src/compiler/diagnoseSources.ts +232 -0
  20. package/src/compiler/formatAbide.ts +5 -6
  21. package/src/compiler/handlersUnder.ts +16 -35
  22. package/src/compiler/projectShadow.ts +1 -0
  23. package/src/compiler/reactiveReads.ts +235 -0
  24. package/src/compiler/reactiveTypes.ts +13 -0
  25. package/src/compiler/readsIn.ts +180 -81
  26. package/src/compiler/routesDeclaration.ts +46 -0
  27. package/src/compiler/scaffold.ts +7 -2
  28. package/src/compiler/serveLanguage.ts +26 -20
  29. package/src/compiler/splitImports.ts +2 -2
  30. package/src/server/BRIDGE_VERSION.ts +1 -1
  31. package/src/server/DesktopSession.ts +213 -0
  32. package/src/server/Followers.ts +399 -0
  33. package/src/server/MODULE_QUERIES.ts +6 -2
  34. package/src/server/PageRender.ts +201 -0
  35. package/src/server/abideModules.ts +7 -7
  36. package/src/server/answerFailure.ts +3 -2
  37. package/src/server/answerRequest.ts +6 -70
  38. package/src/server/answerRpc.ts +48 -260
  39. package/src/server/answerSocket.ts +41 -463
  40. package/src/server/appKit.ts +1 -1
  41. package/src/server/argsContract.ts +1 -1
  42. package/src/server/createApp.ts +8 -2
  43. package/src/server/csp.ts +1 -1
  44. package/src/server/deferredBuilds.ts +3 -16
  45. package/src/server/faceOf.ts +1 -1
  46. package/src/server/generatedSurfaces.ts +2 -1
  47. package/src/server/handlerFileMount.ts +1 -1
  48. package/src/server/index.ts +1 -1
  49. package/src/server/installServer.ts +5 -9
  50. package/src/server/invokeHandler.ts +230 -0
  51. package/src/server/mountHandlers.ts +184 -0
  52. package/src/server/openDesktopWindow.ts +308 -0
  53. package/src/server/preload.ts +18 -0
  54. package/src/server/principal.ts +1 -1
  55. package/src/server/remote.ts +1 -1
  56. package/src/server/render.ts +31 -59
  57. package/src/server/requestScope.ts +5 -36
  58. package/src/server/runDesktop.ts +19 -447
  59. package/src/server/seedBuffer.ts +11 -11
  60. package/src/server/servedApp.ts +1 -1
  61. package/src/server/shell.ts +1 -1
  62. package/src/server/surfaceOf.ts +1 -1
  63. package/src/server/versionOf.ts +1 -1
  64. package/src/shared/RPC_SERVER.ts +27 -31
  65. package/src/shared/Schema.ts +1 -2
  66. package/src/shared/index.ts +1 -1
  67. package/src/shared/{note.ts → issueReport.ts} +22 -0
  68. package/src/shared/loadCall.ts +66 -0
  69. package/src/shared/reactive/Keyed.ts +23 -15
  70. package/src/shared/reactive/Reactive.ts +46 -1002
  71. package/src/shared/reactive/byOf.ts +2 -5
  72. package/src/shared/reactive/callLoad.ts +8 -14
  73. package/src/shared/reactive/cellShape.ts +734 -0
  74. package/src/shared/reactive/index.ts +12 -24
  75. package/src/shared/reactive/pairReactive.ts +5 -3
  76. package/src/shared/reactive/producer.ts +121 -0
  77. package/src/shared/reactive/scoped.ts +3 -2
  78. package/src/shared/reactive/selections.ts +209 -0
  79. package/src/shared/reactive/watch.ts +3 -4
  80. package/src/shared/rpc.ts +8 -5
  81. package/src/shared/validateJson.ts +1 -2
  82. package/src/shared/writePath.ts +29 -0
  83. package/src/ui/Router.ts +53 -69
  84. package/src/ui/outboxQueue.ts +2 -8
  85. package/src/ui/outcomeOf.ts +120 -0
  86. package/src/ui/socketWire.ts +3 -3
  87. package/src/ui/wire.ts +9 -10
  88. package/src/shared/LOAD_OFFLINE.ts +0 -15
  89. package/src/shared/LOAD_SIGNAL.ts +0 -10
  90. package/src/shared/issuesOf.ts +0 -18
  91. package/src/shared/reactive/ENTRY_LIVES.ts +0 -7
@@ -3,6 +3,7 @@
3
3
  // the chunk every page loads. The cell is read here, in the core's folder, so its layout stays the
4
4
  // core's.
5
5
  import { CELL } from './CELL.ts'
6
+ import type { Callable } from './cellShape.ts'
6
7
  import { isReactive } from './isReactive.ts'
7
8
 
8
9
  /** The `by` a `Reactive` declared (32.32), or `null` where it declared none or `value` is not one. */
@@ -10,9 +11,5 @@ export function byOf(
10
11
  value: unknown,
11
12
  ): string | ((element: unknown) => unknown) | null {
12
13
  if (!isReactive(value)) return null
13
- return (
14
- value as unknown as {
15
- [CELL]: { by: string | ((element: unknown) => unknown) | null }
16
- }
17
- )[CELL].by
14
+ return (value as unknown as Callable)[CELL].by
18
15
  }
@@ -7,18 +7,16 @@
7
7
  // ONE RECORD PER VALUE, IN A SIDE TABLE, not a field on the cell. Every value would carry the field
8
8
  // and only a called one ever fills it, so the table is what keeps a plain `reactive` paying nothing.
9
9
 
10
- import { LOAD_OFFLINE } from '../LOAD_OFFLINE.ts'
11
- import { LOAD_SIGNAL } from '../LOAD_SIGNAL.ts'
10
+ import { beginLoadCall, endLoadCall, reachedInLoadCall } from '../loadCall.ts'
12
11
  import { aborted, refuse } from '../refuse.ts'
13
- // Through the barrel, for the cycle it names: rpc reaches this module ahead of the barrel.
12
+ // Through the barrel first, for the cycle it names: rpc reaches this module ahead of the barrel.
13
+ import { isReactive, STREAMING } from './index.ts'
14
14
  import {
15
15
  abandonLoad,
16
16
  failedTransiently,
17
- isReactive,
18
17
  loadOf,
19
- STREAMING,
20
18
  streamingOrSettled,
21
- } from './index.ts'
19
+ } from './producer.ts'
22
20
 
23
21
  /**
24
22
  * Who is waiting on one value's load, and what the last one came to.
@@ -75,7 +73,7 @@ const ATTENDED = new WeakMap<object, Attended>()
75
73
  * Reaches `args` through `reach` as a call does, under that call's `signal` and `timeout`.
76
74
  *
77
75
  * 16.49 — a load this call starts may be ended by it, so its transport is handed a signal of the
78
- * load's own (`LOAD_SIGNAL`, read by the body as it starts) — the caller's is only one vote.
76
+ * load's own (`startingLoadCall`, read by the body as it starts) — the caller's is only one vote.
79
77
  */
80
78
  export function callLoad(
81
79
  reach: (args: unknown) => unknown,
@@ -86,14 +84,12 @@ export function callLoad(
86
84
  offline?: (args: unknown) => unknown,
87
85
  ): unknown {
88
86
  const ending = signal === undefined ? undefined : new AbortController()
89
- LOAD_SIGNAL.current = ending?.signal
90
- LOAD_OFFLINE.current = offline
87
+ beginLoadCall(ending?.signal, offline)
91
88
  let reached: unknown
92
89
  let attended: Attended | undefined
93
90
  try {
94
91
  reached = reach(args)
95
- const standing = LOAD_OFFLINE.standing
96
- if (standing !== undefined) standing.value = reached
92
+ reachedInLoadCall(reached)
97
93
  attended = ATTENDED.get(reached as object)
98
94
  // 16.62 — the callers of an aborted load stopped waiting, and this one has not.
99
95
  // 15.19 — and of one whose last answer failed transiently, which runs again here where an
@@ -106,9 +102,7 @@ export function callLoad(
106
102
  if (again || failedTransiently(reached))
107
103
  (reached as { refresh(): void }).refresh()
108
104
  } finally {
109
- LOAD_SIGNAL.current = undefined
110
- LOAD_OFFLINE.current = undefined
111
- LOAD_OFFLINE.standing = undefined
105
+ endLoadCall()
112
106
  }
113
107
  if (!isReactive(reached)) return reached
114
108
  const load = loadOf(reached)