@abide/abide 0.117.2 → 0.119.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/CHANGELOG.md +22 -0
- package/bin/abide.ts +74 -11
- package/docs/REGISTRY.md +18 -15
- package/docs/RULEBOOK.md +71 -10
- package/docs/abide.md +584 -274
- package/package.json +1 -1
- package/scaffold/AGENTS.md +1 -1
- package/scaffold/src/getGreeting.test.ts +2 -1
- package/scaffold/src/index.abide +5 -2
- package/scaffold/src/index.test.ts +2 -0
- package/scaffold/src/layout.abide +6 -6
- package/src/compiler/Lowering.ts +20 -2
- package/src/compiler/PositionTable.ts +1 -0
- package/src/compiler/Refusals.ts +1 -0
- package/src/compiler/TypeSession.ts +49 -13
- package/src/compiler/aliasedSymbol.ts +1 -1
- package/src/compiler/ambientReadsIn.ts +1 -0
- package/src/compiler/appLayout.ts +55 -3
- package/src/compiler/appMap.ts +15 -0
- package/src/compiler/argsDefaultsIn.ts +1 -0
- package/src/compiler/argsSchemaOf.ts +1 -0
- package/src/compiler/checkApp.ts +3 -1
- package/src/compiler/checkedShadow.ts +2 -1
- package/src/compiler/classifyRead.ts +1 -0
- package/src/compiler/classifyTemplate.ts +1 -0
- package/src/compiler/compileApp.ts +5 -3
- package/src/compiler/compiledEntry.ts +2 -1
- package/src/compiler/componentGraph.ts +1 -0
- package/src/compiler/declaredExports.ts +4 -2
- package/src/compiler/emitClient.ts +19 -14
- package/src/compiler/emitComponent.ts +1 -0
- package/src/compiler/emitSource.ts +2 -1
- package/src/compiler/formatAbide.ts +857 -0
- package/src/compiler/formatDiagnosis.ts +1 -0
- package/src/compiler/handlersUnder.ts +7 -3
- package/src/compiler/hookCalls.ts +1 -0
- package/src/compiler/lineOf.ts +17 -0
- package/src/compiler/matchersOf.ts +157 -0
- package/src/compiler/mountsOf.ts +5 -0
- package/src/compiler/paramFile.ts +125 -0
- package/src/compiler/parseAbide.ts +48 -28
- package/src/compiler/projectShadow.ts +11 -4
- package/src/compiler/reactiveOptions.ts +1 -0
- package/src/compiler/reactiveTypes.ts +2 -1
- package/src/compiler/readsIn.ts +3 -2
- package/src/compiler/renderMarkup.ts +3 -2
- package/src/compiler/resolverIn.ts +2 -0
- package/src/compiler/sameTemplate.ts +150 -0
- package/src/compiler/scaffold.ts +4 -11
- package/src/compiler/serveLanguage.ts +48 -21
- package/src/compiler/sharedModuleWrites.ts +2 -1
- package/src/compiler/sourceMapOf.ts +1 -0
- package/src/compiler/splitImports.ts +2 -0
- package/src/compiler/templateWarnings.ts +2 -2
- package/src/compiler/trackingWarnings.ts +1 -0
- package/src/compiler/writeDefaultProject.ts +5 -1
- package/src/server/BRIDGE_VERSION.ts +1 -1
- package/src/server/abideModules.ts +2 -0
- package/src/server/answerFailure.ts +1 -0
- package/src/server/answerRequest.ts +57 -19
- package/src/server/answerRpc.ts +6 -2
- package/src/server/answerSocket.ts +2 -1
- package/src/server/answerValue.ts +1 -0
- package/src/server/answerWorker.ts +1 -0
- package/src/server/appTree.ts +18 -9
- package/src/server/argsFor.ts +1 -0
- package/src/server/assistant.ts +2 -1
- package/src/server/banner.ts +2 -0
- package/src/server/bridgeRelay.ts +1 -0
- package/src/server/callerOf.ts +1 -0
- package/src/server/claudeApi.ts +1 -0
- package/src/server/claudeCode.ts +1 -0
- package/src/server/clientBundle.ts +1 -0
- package/src/server/coerceArgs.ts +1 -2
- package/src/server/commands.ts +9 -0
- package/src/server/compressAnswer.ts +2 -1
- package/src/server/config.ts +2 -0
- package/src/server/createApp.ts +4 -2
- package/src/server/crossingOrigin.ts +1 -0
- package/src/server/csp.ts +1 -0
- package/src/server/deferredBuilds.ts +1 -0
- package/src/server/derivedArgs.ts +1 -0
- package/src/server/devWorker.ts +2 -1
- package/src/server/faceOf.ts +2 -7
- package/src/server/generatedSurfaces.ts +79 -7
- package/src/server/hooks.ts +1 -0
- package/src/server/iconAccent.ts +1 -1
- package/src/server/installServer.ts +1 -0
- package/src/server/installSourceMaps.ts +1 -0
- package/src/server/launcherPage.ts +2 -2
- package/src/server/manifestOf.ts +1 -0
- package/src/server/muxUpgrade.ts +1 -0
- package/src/server/nativeMenu.ts +2 -0
- package/src/server/placement.ts +12 -2
- package/src/server/principal.ts +2 -1
- package/src/server/remote.ts +7 -2
- package/src/server/render.ts +3 -3
- package/src/server/renderComponent.ts +1 -0
- package/src/server/reportHealth.ts +1 -0
- package/src/server/requestScope.ts +3 -1
- package/src/server/runDesktop.ts +3 -2
- package/src/server/seedBuffer.ts +1 -0
- package/src/server/serveDev.ts +3 -2
- package/src/server/shell.ts +2 -0
- package/src/server/streamEvent.ts +1 -0
- package/src/server/surfaceOf.ts +6 -1
- package/src/server/testBuild.ts +1 -0
- package/src/server/testMount.ts +1 -0
- package/src/server/trace.ts +2 -0
- package/src/server/withAbideSources.ts +1 -0
- package/src/shared/Attributes.ts +12 -8
- package/src/shared/cookies.ts +1 -1
- package/src/shared/escapeText.ts +1 -1
- package/src/shared/filledPath.ts +16 -10
- package/src/shared/index.ts +1 -5
- package/src/shared/jsonSchema.ts +1 -3
- package/src/shared/matchRoute.ts +16 -4
- package/src/shared/menuBridge.ts +1 -2
- package/src/shared/outbox.ts +1 -1
- package/src/shared/reactive/Keyed.ts +2 -2
- package/src/shared/reactive/Reactive.ts +12 -16
- package/src/shared/reactive/index.ts +3 -4
- package/src/shared/reactive/isReactive.ts +1 -1
- package/src/shared/reactive/scoped.ts +2 -2
- package/src/shared/reactive/share.ts +1 -1
- package/src/shared/reactive/watch.ts +4 -4
- package/src/shared/refuse.ts +1 -1
- package/src/shared/routePattern.ts +66 -14
- package/src/shared/rpc.ts +8 -11
- package/src/shared/url.ts +24 -7
- package/src/shared/validateJson.ts +1 -1
- package/src/ui/ArmRegion.ts +1 -0
- package/src/ui/Level.ts +1 -0
- package/src/ui/List.ts +1 -0
- package/src/ui/RawRun.ts +1 -0
- package/src/ui/Router.ts +1 -0
- package/src/ui/TryRegion.ts +1 -0
- package/src/ui/adoptWalk.ts +2 -1
- package/src/ui/bindElement.ts +1 -0
- package/src/ui/bindFiles.ts +1 -0
- package/src/ui/bindGroup.ts +1 -0
- package/src/ui/bindProperty.ts +1 -0
- package/src/ui/bindSpread.ts +1 -0
- package/src/ui/index.ts +1 -6
- package/src/ui/outboxQueue.ts +1 -1
- package/src/ui/parseMarkup.ts +2 -1
- package/src/ui/reconcile.ts +2 -1
- package/src/ui/reconcileHead.ts +1 -0
- package/src/ui/regions.ts +2 -1
- package/src/ui/registerWorker.ts +1 -0
- package/src/ui/rows.ts +1 -0
- package/src/ui/setMarkup.ts +1 -0
- package/src/ui/setText.ts +1 -0
- package/src/ui/socketWire.ts +4 -3
- package/src/ui/wire.ts +2 -1
- /package/scaffold/src/{getGreeting.ts → getGreeting.handler.ts} +0 -0
|
@@ -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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
package/src/shared/refuse.ts
CHANGED
|
@@ -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'
|
|
@@ -17,29 +17,78 @@ export type Segment = {
|
|
|
17
17
|
kind: SegmentKind
|
|
18
18
|
/** The literal text for a static segment, the param name for the other three. */
|
|
19
19
|
name: string
|
|
20
|
+
/** 23.26 — the matcher a dynamic segment names after `=`, or `undefined` where it names none. */
|
|
21
|
+
matcher: string | undefined
|
|
22
|
+
/** 30.34, 30.35 — what a part must match to be taken: the matcher's, or the period default. */
|
|
23
|
+
accepts: RegExp
|
|
20
24
|
}
|
|
21
25
|
|
|
26
|
+
/** 30.34, 30.36 — what a segment naming no matcher takes: a part carrying no period. */
|
|
27
|
+
const PERIODLESS = /^[^.]+$/
|
|
28
|
+
|
|
29
|
+
// A segment naming a matcher, parsed with no table to resolve it in, takes nothing: only a route
|
|
30
|
+
// table's own rows say which regex a name stands for (23.26), and a reader that only builds an
|
|
31
|
+
// address or compares shapes never walks one.
|
|
32
|
+
const UNRESOLVED = /(?!)/
|
|
33
|
+
|
|
22
34
|
/**
|
|
23
35
|
* A route literal split into its segments, each classified by kind.
|
|
24
36
|
*
|
|
25
|
-
* `[...rest]`, `[[optional]]`, `[required]`, or a literal
|
|
26
|
-
* `
|
|
37
|
+
* `[...rest]`, `[[optional]]`, `[required]`, or a literal, each dynamic one optionally naming a
|
|
38
|
+
* matcher after `=`, compiled from `matchers` — each name's anchored source, as the build wrote it
|
|
39
|
+
* into the row (23.26) — where a route table hands its row's. Ordered
|
|
40
|
+
* longest-first: `[[a]]` is a `[a]` with another bracket round it, so testing the short form first
|
|
41
|
+
* matches both.
|
|
27
42
|
*/
|
|
28
|
-
export function parseRoutePattern(
|
|
43
|
+
export function parseRoutePattern(
|
|
44
|
+
pattern: string,
|
|
45
|
+
matchers?: Record<string, string>,
|
|
46
|
+
): Segment[] {
|
|
29
47
|
const out: Segment[] = []
|
|
30
48
|
for (const raw of pattern.split('/')) {
|
|
31
49
|
if (raw === '') continue
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
50
|
+
let kind: SegmentKind = 'static'
|
|
51
|
+
let body = raw
|
|
52
|
+
if (raw.startsWith('[[') && raw.endsWith(']]')) {
|
|
53
|
+
kind = 'optional'
|
|
54
|
+
body = raw.slice(2, -2)
|
|
55
|
+
} else if (raw.startsWith('[...') && raw.endsWith(']')) {
|
|
56
|
+
kind = 'rest'
|
|
57
|
+
body = raw.slice(4, -1)
|
|
58
|
+
} else if (raw.startsWith('[') && raw.endsWith(']')) {
|
|
59
|
+
kind = 'required'
|
|
60
|
+
body = raw.slice(1, -1)
|
|
61
|
+
}
|
|
62
|
+
const split = kind === 'static' ? -1 : body.indexOf('=')
|
|
63
|
+
const matcher = split === -1 ? undefined : body.slice(split + 1)
|
|
64
|
+
out.push({
|
|
65
|
+
kind,
|
|
66
|
+
name: split === -1 ? body : body.slice(0, split),
|
|
67
|
+
matcher,
|
|
68
|
+
accepts:
|
|
69
|
+
matcher === undefined
|
|
70
|
+
? PERIODLESS
|
|
71
|
+
: matchers === undefined
|
|
72
|
+
? UNRESOLVED
|
|
73
|
+
: resolvedIn(matchers, matcher, pattern),
|
|
74
|
+
})
|
|
39
75
|
}
|
|
40
76
|
return out
|
|
41
77
|
}
|
|
42
78
|
|
|
79
|
+
function resolvedIn(
|
|
80
|
+
matchers: Record<string, string>,
|
|
81
|
+
matcher: string,
|
|
82
|
+
pattern: string,
|
|
83
|
+
): RegExp {
|
|
84
|
+
const source = matchers[matcher]
|
|
85
|
+
if (source === undefined)
|
|
86
|
+
throw new Error(
|
|
87
|
+
`abide: the route table's row for ${pattern} carries no matcher ${matcher}, which the build writes beside every segment naming one. RULEBOOK 23.26.`,
|
|
88
|
+
)
|
|
89
|
+
return new RegExp(source)
|
|
90
|
+
}
|
|
91
|
+
|
|
43
92
|
/**
|
|
44
93
|
* A `sort` comparator over two parsed patterns: negative where `a` is the more specific.
|
|
45
94
|
*
|
|
@@ -99,12 +148,15 @@ export function coversRoute(outer: Segment[], route: Segment[]): boolean {
|
|
|
99
148
|
* which page an address resolves to, so it is here with `compareRoutes` rather than written out
|
|
100
149
|
* beside each table: the server's boot and the client router's start compile through one call.
|
|
101
150
|
*/
|
|
102
|
-
export function rankRoutes<
|
|
103
|
-
|
|
104
|
-
): (T & { segments: Segment[] })[] {
|
|
151
|
+
export function rankRoutes<
|
|
152
|
+
T extends { pattern: string; matchers?: Record<string, string> },
|
|
153
|
+
>(rows: T[]): (T & { segments: Segment[] })[] {
|
|
105
154
|
const ranked: (T & { segments: Segment[] })[] = []
|
|
106
155
|
for (const row of rows)
|
|
107
|
-
ranked.push({
|
|
156
|
+
ranked.push({
|
|
157
|
+
...row,
|
|
158
|
+
segments: parseRoutePattern(row.pattern, row.matchers ?? {}),
|
|
159
|
+
})
|
|
108
160
|
ranked.sort((a, b) => compareRoutes(a.segments, b.segments))
|
|
109
161
|
return ranked
|
|
110
162
|
}
|
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
|
-
|
|
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
|
-
|
|
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
|
@@ -12,26 +12,31 @@ type Parts<P extends string> = P extends `${infer Head}/${infer Tail}`
|
|
|
12
12
|
? Head | Parts<Tail>
|
|
13
13
|
: P
|
|
14
14
|
|
|
15
|
+
// 23.26 — a segment's param is named before any `=`: `[symbol=TICKER]` is `symbol`.
|
|
16
|
+
type ParamName<Body extends string> = Body extends `${infer Name}=${string}`
|
|
17
|
+
? Name
|
|
18
|
+
: Body
|
|
19
|
+
|
|
15
20
|
export type RequiredNames<P extends string> =
|
|
16
21
|
Parts<P> extends infer Part
|
|
17
22
|
? Part extends `[${infer Name}]`
|
|
18
23
|
? Name extends `[${string}` | `...${string}`
|
|
19
24
|
? never
|
|
20
|
-
: Name
|
|
25
|
+
: ParamName<Name>
|
|
21
26
|
: never
|
|
22
27
|
: never
|
|
23
28
|
|
|
24
29
|
export type OptionalNames<P extends string> =
|
|
25
30
|
Parts<P> extends infer Part
|
|
26
31
|
? Part extends `[[${infer Name}]]`
|
|
27
|
-
? Name
|
|
32
|
+
? ParamName<Name>
|
|
28
33
|
: never
|
|
29
34
|
: never
|
|
30
35
|
|
|
31
36
|
export type RestNames<P extends string> =
|
|
32
37
|
Parts<P> extends infer Part
|
|
33
38
|
? Part extends `[...${infer Name}]`
|
|
34
|
-
? Name
|
|
39
|
+
? ParamName<Name>
|
|
35
40
|
: never
|
|
36
41
|
: never
|
|
37
42
|
|
|
@@ -51,18 +56,28 @@ export type HasSegments<P extends string> = [
|
|
|
51
56
|
|
|
52
57
|
export type Query = Record<string, unknown> | URLSearchParams
|
|
53
58
|
|
|
54
|
-
/** The params a route literal takes, by segment kind. */
|
|
59
|
+
/** The params a route literal takes, by segment kind, and 30.3 — narrowed where `abide check` says. */
|
|
55
60
|
export type ParamsOf<P extends string> = {
|
|
56
61
|
[K in RequiredNames<P>]: string | number
|
|
57
62
|
} & { [K in OptionalNames<P>]?: string | number } & {
|
|
58
63
|
[K in RestNames<P>]?: string | number | (string | number)[]
|
|
59
|
-
}
|
|
64
|
+
} & Narrowed<P>
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* 23.9, 30.3 — the params `abide check` declared for `P` beside its key: each whose matcher is an
|
|
68
|
+
* alternation of literals, as their union. Nothing where it declared none, or nothing at all.
|
|
69
|
+
*/
|
|
70
|
+
type Narrowed<P extends string> = P extends keyof Routes
|
|
71
|
+
? Routes[P] extends true
|
|
72
|
+
? unknown
|
|
73
|
+
: Routes[P]
|
|
74
|
+
: unknown
|
|
60
75
|
|
|
61
76
|
/**
|
|
62
77
|
* 30.26 — the route literals an app files its pages under, which `abide check` declares for the app
|
|
63
78
|
* it checks. Where nothing declared them any literal is taken, so a plain `tsc` still compiles.
|
|
64
79
|
*/
|
|
65
|
-
//
|
|
80
|
+
// Filled by declaration merging, per app — each literal to `true`, or to the params it narrows (23.9)
|
|
66
81
|
export interface Routes {}
|
|
67
82
|
|
|
68
83
|
/** 30.26 — what `url` takes: one of the app's route literals, or any where none were declared. */
|
|
@@ -76,7 +91,9 @@ export type RouteLiteral = [keyof Routes] extends [never]
|
|
|
76
91
|
*/
|
|
77
92
|
export type RouteParams<P extends string> = {
|
|
78
93
|
[K in RequiredNames<P>]: string
|
|
79
|
-
} & { [K in OptionalNames<P>]?: string } & {
|
|
94
|
+
} & { [K in OptionalNames<P>]?: string } & {
|
|
95
|
+
[K in RestNames<P>]: string[]
|
|
96
|
+
} & Narrowed<P>
|
|
80
97
|
|
|
81
98
|
/**
|
|
82
99
|
* An address from a route literal and its params, resolved against the mount, with an optional
|
|
@@ -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'
|
package/src/ui/ArmRegion.ts
CHANGED
|
@@ -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
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'
|
package/src/ui/TryRegion.ts
CHANGED
|
@@ -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 {
|
package/src/ui/adoptWalk.ts
CHANGED
|
@@ -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,
|
|
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
|
package/src/ui/bindElement.ts
CHANGED
package/src/ui/bindFiles.ts
CHANGED
package/src/ui/bindGroup.ts
CHANGED
package/src/ui/bindProperty.ts
CHANGED
package/src/ui/bindSpread.ts
CHANGED
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'
|
package/src/ui/outboxQueue.ts
CHANGED
|
@@ -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,
|
|
20
|
+
import { showLine, type ShownCall, showSending } from '#shared/outbox.ts'
|
|
21
21
|
import { onPrincipalRotated } from '#shared/principalRotated.ts'
|
|
22
22
|
import {
|
|
23
23
|
isReactive,
|
package/src/ui/parseMarkup.ts
CHANGED
|
@@ -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 =
|
|
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
|
package/src/ui/reconcile.ts
CHANGED
|
@@ -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
|
|
package/src/ui/reconcileHead.ts
CHANGED
|
@@ -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
|
|
package/src/ui/registerWorker.ts
CHANGED
|
@@ -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'
|
package/src/ui/setMarkup.ts
CHANGED
package/src/ui/setText.ts
CHANGED
package/src/ui/socketWire.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
|
|
File without changes
|