@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.
- package/ABIDE.md +8 -5
- package/CHANGELOG.md +38 -0
- package/docs/REGISTRY.md +45 -12
- package/docs/RULEBOOK.md +29 -16
- package/docs/abide.md +999 -459
- package/package.json +1 -1
- package/src/compiler/ARRAY_MUTATORS.ts +20 -0
- package/src/compiler/LoweredFile.ts +609 -0
- package/src/compiler/Lowering.ts +46 -4
- package/src/compiler/SHARED_NAMES.ts +2 -0
- package/src/compiler/ShadowHost.ts +670 -0
- package/src/compiler/ShadowMap.ts +1 -1
- package/src/compiler/TypeSession.ts +71 -1715
- package/src/compiler/appLints.ts +109 -0
- package/src/compiler/checkedShadow.ts +1 -1
- package/src/compiler/classifyRead.ts +16 -1
- package/src/compiler/compileApp.ts +2 -2
- package/src/compiler/declaredExports.ts +44 -17
- package/src/compiler/diagnoseSources.ts +232 -0
- package/src/compiler/formatAbide.ts +5 -6
- package/src/compiler/handlersUnder.ts +16 -35
- package/src/compiler/projectShadow.ts +1 -0
- package/src/compiler/reactiveReads.ts +235 -0
- package/src/compiler/reactiveTypes.ts +13 -0
- package/src/compiler/readsIn.ts +180 -81
- package/src/compiler/routesDeclaration.ts +46 -0
- package/src/compiler/scaffold.ts +7 -2
- package/src/compiler/serveLanguage.ts +26 -20
- package/src/compiler/splitImports.ts +2 -2
- package/src/server/BRIDGE_VERSION.ts +1 -1
- package/src/server/DesktopSession.ts +213 -0
- package/src/server/Followers.ts +399 -0
- package/src/server/MODULE_QUERIES.ts +6 -2
- package/src/server/PageRender.ts +201 -0
- package/src/server/abideModules.ts +7 -7
- package/src/server/answerFailure.ts +3 -2
- package/src/server/answerRequest.ts +6 -70
- package/src/server/answerRpc.ts +48 -260
- package/src/server/answerSocket.ts +41 -463
- package/src/server/appKit.ts +1 -1
- package/src/server/argsContract.ts +1 -1
- package/src/server/createApp.ts +8 -2
- package/src/server/csp.ts +1 -1
- package/src/server/deferredBuilds.ts +3 -16
- package/src/server/faceOf.ts +1 -1
- package/src/server/generatedSurfaces.ts +2 -1
- package/src/server/handlerFileMount.ts +1 -1
- package/src/server/index.ts +1 -1
- package/src/server/installServer.ts +5 -9
- package/src/server/invokeHandler.ts +230 -0
- package/src/server/mountHandlers.ts +184 -0
- package/src/server/openDesktopWindow.ts +308 -0
- package/src/server/preload.ts +18 -0
- package/src/server/principal.ts +1 -1
- package/src/server/remote.ts +1 -1
- package/src/server/render.ts +31 -59
- package/src/server/requestScope.ts +5 -36
- package/src/server/runDesktop.ts +19 -447
- package/src/server/seedBuffer.ts +11 -11
- package/src/server/servedApp.ts +1 -1
- package/src/server/shell.ts +1 -1
- package/src/server/surfaceOf.ts +1 -1
- package/src/server/versionOf.ts +1 -1
- package/src/shared/RPC_SERVER.ts +27 -31
- package/src/shared/Schema.ts +1 -2
- package/src/shared/index.ts +1 -1
- package/src/shared/{note.ts → issueReport.ts} +22 -0
- package/src/shared/loadCall.ts +66 -0
- package/src/shared/reactive/Keyed.ts +23 -15
- package/src/shared/reactive/Reactive.ts +46 -1002
- package/src/shared/reactive/byOf.ts +2 -5
- package/src/shared/reactive/callLoad.ts +8 -14
- package/src/shared/reactive/cellShape.ts +734 -0
- package/src/shared/reactive/index.ts +12 -24
- package/src/shared/reactive/pairReactive.ts +5 -3
- package/src/shared/reactive/producer.ts +121 -0
- package/src/shared/reactive/scoped.ts +3 -2
- package/src/shared/reactive/selections.ts +209 -0
- package/src/shared/reactive/watch.ts +3 -4
- package/src/shared/rpc.ts +8 -5
- package/src/shared/validateJson.ts +1 -2
- package/src/shared/writePath.ts +29 -0
- package/src/ui/Router.ts +53 -69
- package/src/ui/outboxQueue.ts +2 -8
- package/src/ui/outcomeOf.ts +120 -0
- package/src/ui/socketWire.ts +3 -3
- package/src/ui/wire.ts +9 -10
- package/src/shared/LOAD_OFFLINE.ts +0 -15
- package/src/shared/LOAD_SIGNAL.ts +0 -10
- package/src/shared/issuesOf.ts +0 -18
- package/src/shared/reactive/ENTRY_LIVES.ts +0 -7
package/src/compiler/Lowering.ts
CHANGED
|
@@ -371,7 +371,7 @@ export class Lowering {
|
|
|
371
371
|
*/
|
|
372
372
|
reference(holder: object): string {
|
|
373
373
|
const span = this.spanOf(holder)
|
|
374
|
-
return
|
|
374
|
+
return grouped(this.lowerChunk(span, true))
|
|
375
375
|
}
|
|
376
376
|
|
|
377
377
|
/**
|
|
@@ -383,9 +383,17 @@ export class Lowering {
|
|
|
383
383
|
* A COMPUTED STEP IS EMITTED SOURCE, as 31.8's is: `params[s.k]` writes through `s.k` lowered,
|
|
384
384
|
* so the key is read when the input writes and the get reads it too — the binding follows the
|
|
385
385
|
* key. A `!` is a type and no step. `undefined` for an operand that is not a name followed by
|
|
386
|
-
* steps, which `
|
|
386
|
+
* steps, which `lower` lowers as it stands — save 32.76's optional step, which is refused.
|
|
387
|
+
*
|
|
388
|
+
* IN `lower`, SO THE CHECKER READS THE PAIR THE BUILD EMITS. Taken only where the build asked
|
|
389
|
+
* (`reference`), the shadow lowered the same path as a read, and a component's `bind:` held
|
|
390
|
+
* `__bound` to the string it read — TS2769 on a binding the build compiles and runs.
|
|
387
391
|
*/
|
|
388
|
-
private boundPath(
|
|
392
|
+
private boundPath(
|
|
393
|
+
span: Span,
|
|
394
|
+
origins: Origin[] | undefined,
|
|
395
|
+
base: number,
|
|
396
|
+
): string | undefined {
|
|
389
397
|
const source = this.projection.text
|
|
390
398
|
const text = source.slice(span.start, span.end)
|
|
391
399
|
const from = span.start + (text.length - text.trimStart().length)
|
|
@@ -433,7 +441,20 @@ export class Lowering {
|
|
|
433
441
|
}
|
|
434
442
|
if (segments.length === 0) return undefined
|
|
435
443
|
const name = this.nameOf(read)
|
|
436
|
-
|
|
444
|
+
const open = '{ get: () => '
|
|
445
|
+
origins?.push({ at: base, source: from, length: 0 })
|
|
446
|
+
const got = this.lower(
|
|
447
|
+
{ start: from, end: to },
|
|
448
|
+
false,
|
|
449
|
+
origins,
|
|
450
|
+
base + open.length,
|
|
451
|
+
)
|
|
452
|
+
origins?.push({
|
|
453
|
+
at: base + open.length + got.length,
|
|
454
|
+
source: to,
|
|
455
|
+
length: 0,
|
|
456
|
+
})
|
|
457
|
+
return `${open}${got}, set: (${STORED}) => ${name}.set(${this.use('writePath')}(${name}(), [${segments.join(', ')}], ${STORED})) }`
|
|
437
458
|
}
|
|
438
459
|
|
|
439
460
|
/**
|
|
@@ -567,6 +588,10 @@ export class Lowering {
|
|
|
567
588
|
const text = source.slice(from, to)
|
|
568
589
|
const wholeFrom = from + (text.length - text.trimStart().length)
|
|
569
590
|
const wholeTo = from + text.trimEnd().length
|
|
591
|
+
if (holds) {
|
|
592
|
+
const path = this.boundPath(span, origins, base)
|
|
593
|
+
if (path !== undefined) return path
|
|
594
|
+
}
|
|
570
595
|
const reads = this.answer.reads
|
|
571
596
|
let read = this.answer.firstRead(from)
|
|
572
597
|
if (read === reads.length || (reads[read] as Read).start >= to) {
|
|
@@ -817,6 +842,21 @@ export class Lowering {
|
|
|
817
842
|
return this.checking && this.importsRaw
|
|
818
843
|
? undefined
|
|
819
844
|
: this.use('raw')
|
|
845
|
+
// 31.9 — an array mutator called through a path: run on a copy the name then holds.
|
|
846
|
+
// The checker reads it as the call on the value it is, so its result is typed as one.
|
|
847
|
+
case 'mutate': {
|
|
848
|
+
const call = this.lower(read.value as Span).trim()
|
|
849
|
+
if (this.checking)
|
|
850
|
+
return `${this.valueOf(spelled, read, name)}${this.lower({ start: read.end, end: (read.value as Span).start })}${call}`
|
|
851
|
+
const segments: string[] = []
|
|
852
|
+
for (const segment of read.path)
|
|
853
|
+
segments.push(
|
|
854
|
+
segment.name === undefined
|
|
855
|
+
? this.lower(segment)
|
|
856
|
+
: JSON.stringify(segment.name),
|
|
857
|
+
)
|
|
858
|
+
return `${this.use('mutatePath')}(${name}, [${segments.join(', ')}], (${MUTATED}) => ${MUTATED}${call})`
|
|
859
|
+
}
|
|
820
860
|
// 27.13 — the call bound to a name, for the checker to read the defaults' type off.
|
|
821
861
|
case 'config':
|
|
822
862
|
return this.checking
|
|
@@ -999,3 +1039,5 @@ function writeParts(
|
|
|
999
1039
|
// `__` for the reason every framework name in an emitted module is (`importClause`).
|
|
1000
1040
|
const STORED = '__stored'
|
|
1001
1041
|
const PREVIOUS = '__previous'
|
|
1042
|
+
// 31.9 — the copy a lifted mutator is called on.
|
|
1043
|
+
const MUTATED = '__mutated'
|
|
@@ -17,6 +17,8 @@ export const SHARED_NAMES: ReadonlySet<string> = new Set([
|
|
|
17
17
|
'markupRun',
|
|
18
18
|
'RAW_WRITES',
|
|
19
19
|
'writePath',
|
|
20
|
+
// 31.9 — an array mutator lifted to a write through its receiver's path.
|
|
21
|
+
'mutatePath',
|
|
20
22
|
'listOf',
|
|
21
23
|
// 32.23's abort, which only the server lane can need: a client binding is its own `watch`
|
|
22
24
|
// and gets one from 2.12. Emitted on both sides because `renderMarkup` is both sides.
|