@abide/abide 0.48.0 → 0.49.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/AGENTS.md +15 -7
- package/CHANGELOG.md +39 -0
- package/README.md +9 -3
- package/package.json +3 -1
- package/src/buildCli.ts +3 -5
- package/src/buildDisconnected.ts +2 -3
- package/src/bundleApp.ts +2 -3
- package/src/compile.ts +2 -4
- package/src/lib/bundle/installDownloads.ts +13 -3
- package/src/lib/bundle/installMacMenu.ts +13 -3
- package/src/lib/cli/parseArgvForRpc.ts +36 -9
- package/src/lib/cli/tokenizeArgvFlags.ts +4 -2
- package/src/lib/mcp/createMcpResourceServer.ts +13 -2
- package/src/lib/mcp/toolResultFromResponse.ts +40 -12
- package/src/lib/server/rpc/parseArgs.ts +15 -1
- package/src/lib/server/rpc/runWithRpcTimeout.ts +12 -1
- package/src/lib/server/runtime/finalizeResponse.ts +11 -1
- package/src/lib/server/runtime/snapshotEntryFromCache.ts +10 -2
- package/src/lib/shared/buildArtifact.ts +17 -0
- package/src/lib/shared/buildRpcRequest.ts +6 -2
- package/src/lib/shared/canonicalJson.ts +24 -1
- package/src/lib/shared/createChannelLog.ts +24 -0
- package/src/lib/shared/exitOnBuildFailure.ts +4 -3
- package/src/lib/shared/parseEnv.ts +17 -6
- package/src/lib/shared/serializeEnv.ts +18 -6
- package/src/lib/shared/snippet.ts +11 -6
- package/src/lib/shared/url.ts +5 -0
- package/src/lib/ui/compile/UI_RUNTIME_IMPORTS.ts +1 -0
- package/src/lib/ui/compile/bindListenEvent.ts +5 -6
- package/src/lib/ui/compile/compileSSR.ts +1 -1
- package/src/lib/ui/compile/compileShadow.ts +121 -25
- package/src/lib/ui/compile/composeProps.ts +3 -2
- package/src/lib/ui/compile/desugarSignals.ts +1 -1
- package/src/lib/ui/compile/generateBuild.ts +23 -9
- package/src/lib/ui/compile/generateSSR.ts +49 -37
- package/src/lib/ui/compile/isWhitespaceText.ts +10 -2
- package/src/lib/ui/compile/lowerDocAccess.ts +39 -1
- package/src/lib/ui/compile/parseTemplate.ts +3 -1
- package/src/lib/ui/compile/renameSignalRefs.ts +5 -18
- package/src/lib/ui/compile/resolveReactiveExport.ts +4 -7
- package/src/lib/ui/compile/scopeCss.ts +27 -4
- package/src/lib/ui/dom/awaitBlock.ts +67 -29
- package/src/lib/ui/dom/discardBoundary.ts +24 -6
- package/src/lib/ui/dom/each.ts +15 -8
- package/src/lib/ui/dom/fillBefore.ts +6 -7
- package/src/lib/ui/dom/mergeProps.ts +1 -1
- package/src/lib/ui/dom/mountSlot.ts +1 -1
- package/src/lib/ui/dom/mutateDocArray.ts +38 -0
- package/src/lib/ui/dom/restProps.ts +2 -2
- package/src/lib/ui/dom/spreadProps.ts +3 -4
- package/src/lib/ui/dom/tryBlock.ts +10 -11
- package/src/lib/ui/dom/withScope.ts +7 -0
- package/src/lib/ui/history.ts +14 -7
- package/src/lib/ui/installHotBridge.ts +2 -0
- package/src/lib/ui/props.ts +17 -0
- package/src/lib/ui/renderChain.ts +7 -3
- package/src/lib/ui/router.ts +23 -17
- package/src/lib/ui/runtime/CHILD_PRESENT.ts +2 -2
- package/src/lib/ui/runtime/applyPatchToTree.ts +16 -3
- package/src/lib/ui/runtime/captureModelDoc.ts +22 -7
- package/src/lib/ui/runtime/createDoc.ts +28 -12
- package/src/lib/ui/runtime/flushEffects.ts +23 -1
- package/src/lib/ui/runtime/scope.ts +11 -0
- package/src/lib/ui/runtime/toTeardown.ts +10 -3
- package/src/lib/ui/runtime/types/UiProps.ts +6 -5
- package/src/lib/ui/runtime/withoutHydration.ts +22 -0
- package/src/lib/ui/state.ts +9 -3
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { RENDER } from './RENDER.ts'
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
Runs `build` with the hydration claim cursor cleared, restoring it after. The
|
|
5
|
+
control-flow blocks route FRESH builds through here — a pending/resolved await
|
|
6
|
+
branch, a try's catch branch, a fillBefore insert — so their build helpers
|
|
7
|
+
create nodes instead of trying to claim server DOM that isn't there. A rebuild
|
|
8
|
+
that fires while an outer hydrate pass is still active (e.g. a synchronous write
|
|
9
|
+
that flips a `when`/`switch` mid-hydrate) would otherwise make `cloneStatic` /
|
|
10
|
+
text claim discarded or nonexistent nodes and silently render nothing. The
|
|
11
|
+
`finally` restore lets a fresh build sit inside an ongoing hydrate pass without
|
|
12
|
+
ending it early.
|
|
13
|
+
*/
|
|
14
|
+
export function withoutHydration<T>(build: () => T): T {
|
|
15
|
+
const previous = RENDER.hydration
|
|
16
|
+
RENDER.hydration = undefined
|
|
17
|
+
try {
|
|
18
|
+
return build()
|
|
19
|
+
} finally {
|
|
20
|
+
RENDER.hydration = previous
|
|
21
|
+
}
|
|
22
|
+
}
|
package/src/lib/ui/state.ts
CHANGED
|
@@ -14,11 +14,17 @@ import { scope } from './scope.ts'
|
|
|
14
14
|
reached ambiently so a component can pass a named value down its subtree. */
|
|
15
15
|
type StateFn = {
|
|
16
16
|
/* No-arg form for an undefined initial with a declared type: `state<Foo>()` is
|
|
17
|
-
`State<Foo | undefined>`. Without it `state
|
|
18
|
-
|
|
19
|
-
narrows to `never`). */
|
|
17
|
+
`State<Foo | undefined>`. Without it `state(undefined)` infers `T = undefined`
|
|
18
|
+
(every `.value` access then narrows to `never`). */
|
|
20
19
|
<T>(): State<T | undefined>
|
|
21
20
|
<T>(initial: T, transform?: (next: T, previous: T) => T): State<T>
|
|
21
|
+
/* The no-arg form spelled out: `state<Foo>(undefined)` is `State<Foo | undefined>`
|
|
22
|
+
too. Kept a distinct overload (not `initial?: T`) BELOW the general form — a real
|
|
23
|
+
initial still binds `T` from the value; only an explicit `undefined` (which the
|
|
24
|
+
general form rejects as "not assignable to T") falls through to here. A bare
|
|
25
|
+
`state(undefined)` still resolves against the general form (`T = undefined`), so
|
|
26
|
+
this overload changes nothing for it. */
|
|
27
|
+
<T>(initial: undefined): State<T | undefined>
|
|
22
28
|
/* A writable cell reseeded from a reactive thunk (`state.linked(() => src())`). */
|
|
23
29
|
linked: typeof linked
|
|
24
30
|
/* A read-only cell computed from other cells (`state.computed(() => a() + b())`). */
|