@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.
Files changed (67) hide show
  1. package/AGENTS.md +15 -7
  2. package/CHANGELOG.md +39 -0
  3. package/README.md +9 -3
  4. package/package.json +3 -1
  5. package/src/buildCli.ts +3 -5
  6. package/src/buildDisconnected.ts +2 -3
  7. package/src/bundleApp.ts +2 -3
  8. package/src/compile.ts +2 -4
  9. package/src/lib/bundle/installDownloads.ts +13 -3
  10. package/src/lib/bundle/installMacMenu.ts +13 -3
  11. package/src/lib/cli/parseArgvForRpc.ts +36 -9
  12. package/src/lib/cli/tokenizeArgvFlags.ts +4 -2
  13. package/src/lib/mcp/createMcpResourceServer.ts +13 -2
  14. package/src/lib/mcp/toolResultFromResponse.ts +40 -12
  15. package/src/lib/server/rpc/parseArgs.ts +15 -1
  16. package/src/lib/server/rpc/runWithRpcTimeout.ts +12 -1
  17. package/src/lib/server/runtime/finalizeResponse.ts +11 -1
  18. package/src/lib/server/runtime/snapshotEntryFromCache.ts +10 -2
  19. package/src/lib/shared/buildArtifact.ts +17 -0
  20. package/src/lib/shared/buildRpcRequest.ts +6 -2
  21. package/src/lib/shared/canonicalJson.ts +24 -1
  22. package/src/lib/shared/createChannelLog.ts +24 -0
  23. package/src/lib/shared/exitOnBuildFailure.ts +4 -3
  24. package/src/lib/shared/parseEnv.ts +17 -6
  25. package/src/lib/shared/serializeEnv.ts +18 -6
  26. package/src/lib/shared/snippet.ts +11 -6
  27. package/src/lib/shared/url.ts +5 -0
  28. package/src/lib/ui/compile/UI_RUNTIME_IMPORTS.ts +1 -0
  29. package/src/lib/ui/compile/bindListenEvent.ts +5 -6
  30. package/src/lib/ui/compile/compileSSR.ts +1 -1
  31. package/src/lib/ui/compile/compileShadow.ts +121 -25
  32. package/src/lib/ui/compile/composeProps.ts +3 -2
  33. package/src/lib/ui/compile/desugarSignals.ts +1 -1
  34. package/src/lib/ui/compile/generateBuild.ts +23 -9
  35. package/src/lib/ui/compile/generateSSR.ts +49 -37
  36. package/src/lib/ui/compile/isWhitespaceText.ts +10 -2
  37. package/src/lib/ui/compile/lowerDocAccess.ts +39 -1
  38. package/src/lib/ui/compile/parseTemplate.ts +3 -1
  39. package/src/lib/ui/compile/renameSignalRefs.ts +5 -18
  40. package/src/lib/ui/compile/resolveReactiveExport.ts +4 -7
  41. package/src/lib/ui/compile/scopeCss.ts +27 -4
  42. package/src/lib/ui/dom/awaitBlock.ts +67 -29
  43. package/src/lib/ui/dom/discardBoundary.ts +24 -6
  44. package/src/lib/ui/dom/each.ts +15 -8
  45. package/src/lib/ui/dom/fillBefore.ts +6 -7
  46. package/src/lib/ui/dom/mergeProps.ts +1 -1
  47. package/src/lib/ui/dom/mountSlot.ts +1 -1
  48. package/src/lib/ui/dom/mutateDocArray.ts +38 -0
  49. package/src/lib/ui/dom/restProps.ts +2 -2
  50. package/src/lib/ui/dom/spreadProps.ts +3 -4
  51. package/src/lib/ui/dom/tryBlock.ts +10 -11
  52. package/src/lib/ui/dom/withScope.ts +7 -0
  53. package/src/lib/ui/history.ts +14 -7
  54. package/src/lib/ui/installHotBridge.ts +2 -0
  55. package/src/lib/ui/props.ts +17 -0
  56. package/src/lib/ui/renderChain.ts +7 -3
  57. package/src/lib/ui/router.ts +23 -17
  58. package/src/lib/ui/runtime/CHILD_PRESENT.ts +2 -2
  59. package/src/lib/ui/runtime/applyPatchToTree.ts +16 -3
  60. package/src/lib/ui/runtime/captureModelDoc.ts +22 -7
  61. package/src/lib/ui/runtime/createDoc.ts +28 -12
  62. package/src/lib/ui/runtime/flushEffects.ts +23 -1
  63. package/src/lib/ui/runtime/scope.ts +11 -0
  64. package/src/lib/ui/runtime/toTeardown.ts +10 -3
  65. package/src/lib/ui/runtime/types/UiProps.ts +6 -5
  66. package/src/lib/ui/runtime/withoutHydration.ts +22 -0
  67. 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
+ }
@@ -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<Foo>(undefined)` is an arity/assign
18
- error and `state(undefined)` infers `T = undefined` (every `.value` access then
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())`). */