@barefootjs/client 0.26.4 → 0.28.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 (44) hide show
  1. package/dist/reactive.d.ts.map +1 -1
  2. package/dist/runtime/claim-slots.d.ts +222 -0
  3. package/dist/runtime/claim-slots.d.ts.map +1 -0
  4. package/dist/runtime/component.d.ts +40 -18
  5. package/dist/runtime/component.d.ts.map +1 -1
  6. package/dist/runtime/dynamic-text.d.ts +24 -1
  7. package/dist/runtime/dynamic-text.d.ts.map +1 -1
  8. package/dist/runtime/index.d.ts +4 -5
  9. package/dist/runtime/index.d.ts.map +1 -1
  10. package/dist/runtime/index.js +467 -259
  11. package/dist/runtime/loop-markers.d.ts +26 -0
  12. package/dist/runtime/loop-markers.d.ts.map +1 -0
  13. package/dist/runtime/map-array-lazy.d.ts +164 -0
  14. package/dist/runtime/map-array-lazy.d.ts.map +1 -0
  15. package/dist/runtime/map-array.d.ts +35 -0
  16. package/dist/runtime/map-array.d.ts.map +1 -1
  17. package/dist/runtime/qsa-item.d.ts +7 -0
  18. package/dist/runtime/qsa-item.d.ts.map +1 -1
  19. package/dist/runtime/registry.d.ts.map +1 -1
  20. package/dist/runtime/standalone.js +455 -248
  21. package/package.json +2 -2
  22. package/src/reactive.ts +2 -1
  23. package/src/runtime/claim-slots.ts +647 -0
  24. package/src/runtime/component.ts +153 -70
  25. package/src/runtime/dynamic-text.ts +24 -1
  26. package/src/runtime/index.ts +20 -7
  27. package/src/runtime/insert.ts +1 -1
  28. package/src/runtime/loop-markers.ts +100 -0
  29. package/src/runtime/map-array-lazy.ts +470 -0
  30. package/src/runtime/map-array.ts +68 -11
  31. package/src/runtime/qsa-item.ts +9 -3
  32. package/src/runtime/registry.ts +5 -3
  33. package/dist/runtime/client-marker.d.ts +0 -21
  34. package/dist/runtime/client-marker.d.ts.map +0 -1
  35. package/dist/runtime/list.d.ts +0 -21
  36. package/dist/runtime/list.d.ts.map +0 -1
  37. package/dist/runtime/patch-slot-range.d.ts +0 -47
  38. package/dist/runtime/patch-slot-range.d.ts.map +0 -1
  39. package/dist/runtime/reconcile-elements.d.ts +0 -44
  40. package/dist/runtime/reconcile-elements.d.ts.map +0 -1
  41. package/src/runtime/client-marker.ts +0 -46
  42. package/src/runtime/list.ts +0 -47
  43. package/src/runtime/patch-slot-range.ts +0 -105
  44. package/src/runtime/reconcile-elements.ts +0 -391
@@ -1 +1 @@
1
- {"version":3,"file":"reactive.d.ts","sourceRoot":"","sources":["../src/reactive.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;;GAIG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAA;CAAE,CAAA;AAE3D,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI;IACtB,yEAAyE;IACzE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjB,uDAAuD;IACvD,CAAC,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI;CAC1C,CAAA;AAED,MAAM,MAAM,SAAS,GAAG,MAAM,IAAI,CAAA;AAClC,MAAM,MAAM,QAAQ,GAAG,MAAM,IAAI,GAAG,SAAS,CAAA;AAC7C,MAAM,MAAM,IAAI,CAAC,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAA;AAavC,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAA;AAEvD;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC,sFAAsF;IACtF,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;IACnD,mEAAmE;IACnE,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1D,gFAAgF;IAChF,eAAe,CAA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AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EACrC,MAAM,EAAE,MAAM,CAAC,EACf,EAAE,GAAE,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,OAA0G,GACnI,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC,CAuD/B;AAmCD;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC,GAAG,IAAI,GACnD,IAAI,CAEN;AAsFD;;4DAE4D;AAC5D,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN,eAAe,GACf,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC,CAAA;AAgE9C,wBAAgB,kBAAkB,IAAI,SAAS;IAC7C,QAAQ,CAAC,MAAM,eAAe,CAAC;IAC/B,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI;CACjC,CAEA"}
@@ -0,0 +1,222 @@
1
+ /**
2
+ * Claim-plan interpreter and claimed-slot primitives (slot unification
3
+ * Steps A2/A3, `spec/slot-unification.md` §4/§5).
4
+ *
5
+ * This module is the ONE claim mechanism the spec's §4 target architecture
6
+ * describes: a compile-time `ClaimPlan` (per-slot child-index paths from a
7
+ * claim root down to the slot's anchor comment) is resolved ONCE — either
8
+ * eagerly (`claimSlots`) or lazily on first write (`lazySlots`) — and every
9
+ * later write goes through the held reference, never re-scanning the DOM.
10
+ * As of A3 the compiler emits claim plans for every content slot; the
11
+ * `patchSlotRange` and `updateClientMarker` mechanisms it superseded are
12
+ * deleted. `$t`/text-effect writes and `__bfText` are ALSO superseded for
13
+ * every emission site but one — see `dynamic-text.ts`'s docstring for the
14
+ * one deliberately-deferred case (`emitDynamicTextUpdates`'s
15
+ * `conditionalElems` path).
16
+ *
17
+ * Anchors are still the existing `<!--bf:sN-->…<!--/-->` marker pairs — SSR
18
+ * bytes are unchanged in Step A (§5, §6) so the new client claims against
19
+ * known-good SSR output. A path is only required to be valid AT THE MOMENT
20
+ * OF CLAIM (§2): once a 'text' Text node or a 'markup' boundary pair is
21
+ * held, subsequent writes never consult the path or the marker again, so a
22
+ * sibling slot's later variable-length change cannot invalidate anything
23
+ * already claimed.
24
+ *
25
+ * Kind contracts (mirroring the mechanisms being superseded — this is the
26
+ * "one slot concept with an identity contract" of §4):
27
+ * - 'text': held ref is the Text node immediately after the anchor
28
+ * comment. The CLAIM is non-mutating: it adopts that node when SSR
29
+ * rendered the slot non-empty and otherwise holds the ANCHOR COMMENT
30
+ * itself as a stand-in for the not-yet-created node, deferring
31
+ * `document.createTextNode` to the first write that actually needs it
32
+ * (`materializeText` reads the insertion point off that comment). That
33
+ * one-field representation is deliberate — see `ClaimedTextSlot`. What
34
+ * lets
35
+ * `read` exist — a seed that only compares must be able to inspect a
36
+ * slot without leaving an empty Text node behind on every row
37
+ * (§9.3(1)). Writes are a `nodeValue` assignment, and once materialized
38
+ * the node's identity never changes — the guarantee effect closures and
39
+ * `mapArray`'s same-key path rely on.
40
+ * - 'markup': held ref is BOTH boundary comments (start = anchor, end =
41
+ * the matching `<!--/-->` found by a nesting-depth walk (any further
42
+ * `bf:`-prefixed comment along the way opens a nested region). A string
43
+ * write clears everything strictly between the boundaries and inserts
44
+ * freshly `<template>`-parsed HTML before the end comment; a `Node`
45
+ * write clears the range and splices the node in by identity (the
46
+ * `__bfText` live-Node case). The boundaries themselves are never
47
+ * removed, so the range stays writeable on every later write. Because
48
+ * the end ref is already held, a write never needs to re-walk for
49
+ * nesting depth — only the CLAIM does.
50
+ *
51
+ * Warn-don't-guess (§4, "one ownership rule"): a path that fails to resolve
52
+ * to its slot's own `bf:sN` comment — out of range, or shape drift where
53
+ * the path now lands on some other node — falls back to a marker scan
54
+ * within the claim root, using the same ownership rule as `query.ts`'s `$t`:
55
+ * a `bf:sN` comment owned by a nested `bf-s` scope (a child component's own
56
+ * same-numbered slot — ids are
57
+ * assigned per component, so collisions are expected) is never a candidate
58
+ * — UNLESS the id is `^`-prefixed (`BF_PARENT_OWNED_PREFIX`), meaning the
59
+ * marker is content the claiming component itself authored and merely
60
+ * forwarded through one or more descendants' `children` (see
61
+ * `findOwnedMarker`'s docstring); for those the ownership walk is skipped
62
+ * outright, matching `query.ts`'s `$()`. If neither the path nor the
63
+ * fallback scan finds an owned marker, that one slot is dropped with a
64
+ * `console.warn` and the rest of the plan still claims — never guess a
65
+ * boundary, and never let one bad slot sink its siblings. An EMPTY path
66
+ * (`[]`) skips straight to the scan without that first warning — the
67
+ * compiler emits `path: []` deliberately when a slot's position can't be
68
+ * statically pathed (slot unification A3), so a miss there is expected, not
69
+ * drift; only a non-empty path that fails to resolve signals a real shape
70
+ * mismatch worth warning about.
71
+ *
72
+ * Row-pristine lazy claim (§3(a)): `lazySlots` touches NOTHING until the
73
+ * first write, and that first write claims the WHOLE plan at once (not just
74
+ * the slot being written) — so no earlier write into one slot can shift a
75
+ * sibling slot's still-unclaimed path out from under it. A row that never
76
+ * updates never pays for a claim at all. `claimSlots` is the eager escape
77
+ * hatch for callers that cannot honor that invariant (streaming/portal
78
+ * paths that mutate row content before any write would occur, per §6's
79
+ * risk note) — it claims every slot in the plan immediately.
80
+ *
81
+ * Dedup, no trust-first-run (slot unification A3 follow-up): a 'markup'
82
+ * slot's write door holds a `last` value alongside its boundary refs. Every
83
+ * write — INCLUDING THE FIRST — clears-and-inserts unless the new string
84
+ * equals `last`, in which case the DOM touch is skipped. `last` starts
85
+ * `undefined`, which never equals a `String(...)`-coerced value, so the
86
+ * first write can never dedup away; it always patches. A `Node` write is
87
+ * deduped by identity (mirrors `__bfText`'s `value === current` check) and,
88
+ * like the string case, is never skipped on the first write — a freshly
89
+ * `createComponent`-built element is a distinct object from whatever the
90
+ * SSR markup rendered, so it always splices. 'text' writes stay a plain
91
+ * `nodeValue` assignment (already idempotent, per §5's design note) — no
92
+ * dedup state needed.
93
+ *
94
+ * The first write is never skipped on the assumption that the claimed
95
+ * range already matches SSR/CSR content ("trust-first-run") — that
96
+ * assumption only holds for a preamble-region row whose SSR content and
97
+ * the effect's mount-time recomputation are both derived from the exact
98
+ * same source data, so they cannot disagree. It is false in general: any
99
+ * markup slot whose value comes from client-only state that the server
100
+ * cannot see — `createSignal(readFromLocalStorage())`, a client-side region
101
+ * swap adopting HTML the server rendered from a different default — can
102
+ * genuinely differ from the SSR/CSR content on the very first write, and
103
+ * skipping that first write would silently leave the stale SSR default on
104
+ * screen until the NEXT change (regression pin: site/ui's
105
+ * `admin-gallery.spec.ts` cross-page time-range persistence test). So every
106
+ * write unconditionally applies unless deduped by value/identity — never
107
+ * because it happens to be the first one — for every 'markup' caller,
108
+ * including the preamble-region case (which only loses a same-value
109
+ * redundant-patch skip on mount, not correctness).
110
+ */
111
+ /**
112
+ * A slot's compile-time descriptor. `path` is the list of child indices
113
+ * from the claim root to the slot's ANCHOR NODE — in Step A that anchor is
114
+ * always the existing `<!--bf:sN-->` start comment (markers are still
115
+ * emitted; Step B may point paths at other node kinds), so resolution
116
+ * walks `childNodes` by index with no assumption about the target's
117
+ * `nodeType` until the kind-specific claim inspects it. `id` is kept for
118
+ * diagnostics and as the marker-scan fallback's search key.
119
+ */
120
+ export interface SlotSpec {
121
+ id: string;
122
+ kind: 'text' | 'markup';
123
+ path: readonly number[];
124
+ /**
125
+ * Slot unification Step B (`spec/slot-unification.md` §3(b), §5 Step B):
126
+ * true when NO `<!--bf:id-->…<!--/-->` marker was emitted for this slot at
127
+ * all — `path` is then a path to the slot's POSITION itself (the LAST
128
+ * index is this slot's own index within its parent's `childNodes`, not an
129
+ * anchor comment to search from). Only ever set for `kind: 'text'` — a
130
+ * `'markup'` slot always keeps its markers (an empty-able range needs a
131
+ * physical anchor to splice into; see `spec/slot-unification.md` §3(b)
132
+ * case (ii)). Resolution CREATES a Text node at that position if SSR
133
+ * rendered the slot empty (nothing to adopt there yet) — see `claimOne`.
134
+ * The compiler emits this only when it has already proven the position
135
+ * safe (`client-only-elision.ts`); the runtime never re-derives it.
136
+ */
137
+ markerless?: boolean;
138
+ }
139
+ export type ClaimPlan = readonly SlotSpec[];
140
+ /**
141
+ * The result of claiming a plan: a write door keyed by slot id. Writing an
142
+ * id that failed to claim (or was never in the plan) warns and no-ops —
143
+ * one bad/missing slot never breaks any other slot's writes.
144
+ */
145
+ export interface ClaimedSlots {
146
+ write(id: string, value: unknown): void;
147
+ }
148
+ /**
149
+ * A claimed plan that can be read as well as written. Separate from
150
+ * {@link ClaimedSlots} because a door is allocated PER ROW: giving every
151
+ * claim a reader costs an extra closure on every row of a list, read or not
152
+ * (measured: ~40KB/1k rows). Only the loops that need read-compare-write
153
+ * seeding (`spec/slot-unification.md` §9.3(1)) ask for this shape. Both
154
+ * shapes sit on the SAME claim (`claimRefs`) — this is a second accessor
155
+ * bundle, never a second way to resolve a position (§2's claim-once rule).
156
+ */
157
+ export interface ClaimedSlotsRW extends ClaimedSlots {
158
+ /**
159
+ * Current DOM text of a 'text' slot. `''` when the slot rendered empty,
160
+ * `null` when the slot cannot answer (not a 'text' slot, or it failed to
161
+ * claim); `null` MUST be treated by the caller as "differs, write it".
162
+ */
163
+ read(id: string): string | null;
164
+ }
165
+ /** `lazySlots`'s per-write function — the same shape `ClaimedSlots.write` has. */
166
+ export type SlotWriter = (id: string, value: unknown) => void;
167
+ /**
168
+ * Pass a live Node through untouched; coerce anything else with `String`.
169
+ *
170
+ * The 'text' door's counterpart to {@link escapeTextOrNode}. A 'text' slot
171
+ * writes through `nodeValue`, which needs no escaping — routing it through
172
+ * `escapeText` would double-escape — but it DOES need the Node case
173
+ * separated out, because a Text node cannot host an element and
174
+ * `String(node)` destroys it: `[object HTMLDivElement]` in a browser, the
175
+ * serialized markup rendered as visible text under some DOM shims. Wrong
176
+ * either way, and silently so, which is why the split lives here rather
177
+ * than at each call site.
178
+ *
179
+ * A Node reaches a content slot whenever a child-position interpolation
180
+ * calls something that builds one — `props.renderRow(item)` handed an
181
+ * inline-JSX arrow, which the compiler lifts into a component whose call
182
+ * returns a real element. Whether such a call returns a string or a Node is
183
+ * not decidable from the expression's syntax (both are `CallExpression`), so
184
+ * the decision belongs at runtime, on the value.
185
+ *
186
+ * `String(value)`, not `String(value ?? '')`: a non-Node value must coerce
187
+ * exactly as the previous inline `String(...)` emission did. The nullish
188
+ * collapse stays where it already was, in {@link writeText}.
189
+ */
190
+ export declare function textOrNode(value: unknown): string | Node;
191
+ /**
192
+ * Claim every slot in `plan` against `root` NOW. Escape hatch for callers
193
+ * that cannot honor the row-pristine invariant `lazySlots` relies on
194
+ * (streaming/portal paths that may mutate row content before any write
195
+ * would naturally occur, per §6) — claim eagerly there instead.
196
+ */
197
+ export declare function claimSlots(root: Element, plan: ClaimPlan): ClaimedSlots;
198
+ /**
199
+ * Lazy wrapper honoring the row-pristine invariant (§3(a)): nothing touches
200
+ * `root`'s DOM until the first write, and that first write claims the
201
+ * WHOLE plan at once — so no earlier write into a sibling slot can shift
202
+ * this row's still-unclaimed paths first. A row that never updates never
203
+ * pays for a claim at all.
204
+ */
205
+ export declare function lazySlots(root: Element, plan: ClaimPlan): SlotWriter;
206
+ /**
207
+ * The read-capable twin of `lazySlots`: the same deferred claim, exposed as
208
+ * the full `{ write, read }` door instead of a bare write function.
209
+ *
210
+ * Two entry points rather than one door with a `.read` property because the
211
+ * door is allocated PER ROW: attaching a reader to every writer costs the
212
+ * extra closures on every row in the list, whether or not it ever reads
213
+ * (measured: +84KB/1k rows). Loops that need read-compare-write seeding
214
+ * (`spec/slot-unification.md` §9.3(1)) pay for the reader; every other loop
215
+ * keeps the single-closure writer. There is still exactly ONE claim
216
+ * mechanism underneath — every entry point resolves through `claimRefs`,
217
+ * and the first access of either kind resolves the whole plan while the row
218
+ * is pristine (§2's claim-once rule; reads never open a second resolution
219
+ * path).
220
+ */
221
+ export declare function lazyClaimSlots(root: Element, plan: ClaimPlan): ClaimedSlotsRW;
222
+ //# sourceMappingURL=claim-slots.d.ts.map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;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,GAAG,cAAc,CAO7E"}
@@ -2,10 +2,16 @@
2
2
  * BarefootJS - Component Creation
3
3
  *
4
4
  * Functions for dynamically creating component instances at runtime.
5
- * Used by reconcileList() when rendering components in loops.
5
+ * Used by mapArray()/mapArrayAnchored() when rendering components in loops.
6
6
  */
7
7
  import type { ComponentDef } from './types.ts';
8
8
  export declare function setParentScopeId(id: string | null): void;
9
+ /** Where `mapArray` wants a fresh loop row connected before its `init` runs. */
10
+ export type RowMountPoint = {
11
+ container: Node;
12
+ anchor: Node | null;
13
+ };
14
+ export declare function setRowMountPoint(p: RowMountPoint | null): RowMountPoint | null;
9
15
  /**
10
16
  * Create a component instance with DOM element and initialized state.
11
17
  *
@@ -19,6 +25,10 @@ export declare function setParentScopeId(id: string | null): void;
19
25
  * @param name - Component name (e.g., 'TodoItem')
20
26
  * @param props - Props to pass to the component
21
27
  * @param key - Optional key for list reconciliation
28
+ * @param slot - Slot-relationship markers stamped as `bf-h` / `bf-m`
29
+ * @param mountAt - Placeholder this component replaces. When given, the
30
+ * element is connected to the document *before* `init` runs — see
31
+ * "Connect before init" below.
22
32
  * @returns Created DOM element
23
33
  *
24
34
  * @example
@@ -43,17 +53,7 @@ export interface CreateComponentSlotInfo {
43
53
  /** Slot id in the host (this child's `bf-m` value). */
44
54
  mount: string;
45
55
  }
46
- export declare function createComponent(nameOrDef: string | ComponentDef, props?: Record<string, unknown>, key?: string | number, slot?: CreateComponentSlotInfo): HTMLElement;
47
- /**
48
- * Get the props stored for a component element.
49
- * Used by reconcileList to pass props to an existing element.
50
- */
51
- export declare function getComponentProps(element: HTMLElement): Record<string, unknown> | undefined;
52
- /**
53
- * Get the props update function for an element.
54
- * Used by reconcileList to update props when reusing an element.
55
- */
56
- export declare function getPropsUpdateFn(element: HTMLElement): ((props: Record<string, unknown>) => void) | undefined;
56
+ export declare function createComponent(nameOrDef: string | ComponentDef, props?: Record<string, unknown>, key?: string | number, slot?: CreateComponentSlotInfo, mountAt?: Element | null): HTMLElement;
57
57
  /**
58
58
  * Render a child component's template to an HTML string.
59
59
  * Used by compiler-generated template functions when a stateless component
@@ -105,14 +105,36 @@ export declare function escapeAttr(value: unknown): string;
105
105
  *
106
106
  * A nullish value renders as empty text — the JSX/Solid semantics the Hono
107
107
  * SSR reference follows (`{undefined}` / `{null}` produce no text), and
108
- * what the reactive text-update path already does (`dynamic-text.ts` and
109
- * `client-marker.ts` both `String(value ?? '')`). Only this initial-render
110
- * escape site used to stringify `undefined` / `null` into literal
111
- * "undefined" / "null" text, so a bare `{props.x}` on an absent prop
112
- * diverged from SSR at first paint (#2137). Non-nullish values (including
113
- * `0` and `false`) keep their `String()` form, matching the reactive path.
108
+ * what the reactive text-update path already does (`claim-slots.ts`'s
109
+ * `writeText`/`writeMarkup` and `dynamic-text.ts` all `String(value ?? '')`).
110
+ * Only this initial-render escape site used to stringify `undefined` /
111
+ * `null` into literal "undefined" / "null" text, so a bare `{props.x}` on
112
+ * an absent prop diverged from SSR at first paint (#2137). Non-nullish
113
+ * values (including `0` and `false`) keep their `String()` form, matching
114
+ * the reactive path.
114
115
  */
115
116
  export declare function escapeText(value: unknown): string;
117
+ /**
118
+ * `escapeText`'s counterpart for a claimed 'markup' slot's REACTIVE write
119
+ * (slot unification A3 follow-up), where the value is a plain-JS expression
120
+ * that may resolve to either a string or a live `Node` (e.g. `{cond &&
121
+ * logo(id)}`, a hoisted `renderNode` callback, #1213). `writeMarkup`
122
+ * (`claim-slots.ts`) inserts a string via `<template>.innerHTML =`, which —
123
+ * unlike the old `__bfText`'s plain `Text.nodeValue =` assignment — DOES
124
+ * interpret HTML, so a raw un-escaped string is an injection/corruption
125
+ * risk exactly where the initial SSR/CSR TEMPLATE already calls
126
+ * `escapeText` on the same expression (`html-template.ts`'s
127
+ * `escapeTextSlotExpr`). A live `Node`, by contrast, must pass through
128
+ * untouched — `escapeText(node)` would stringify it to garbage, and
129
+ * `writeMarkup`'s own `instanceof Node` check needs the real object to
130
+ * splice in by identity. This is the single call every "dynamic JSX/text
131
+ * slot, value may be a Node" emission site (`emit-reactive.ts`,
132
+ * `stringify/loop-child-arm.ts`, `stringify/insert.ts`) wraps the value in
133
+ * before handing it to a 'markup' writer — NOT the preamble-region case
134
+ * (`stringify/loop.ts`), whose value is already-built HTML from a nested
135
+ * compiled render and must stay unescaped.
136
+ */
137
+ export declare function escapeTextOrNode(value: unknown): string | Node;
116
138
  /**
117
139
  * Parse an HTML string into a DocumentFragment, safely escaping ">" in
118
140
  * attribute values. All code that sets innerHTML on dynamic HTML should
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/runtime/component.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAS9C,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAExD;AAWD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;;;GAGG;AACH;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACtC,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAA;IACd,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAA;CACd;AAED,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,GAAG,YAAY,EAChC,KAAK,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EACnC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EACrB,IAAI,CAAC,EAAE,uBAAuB,GAC7B,WAAW,CAgLb;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAE3F;AAuBD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,CAAC,CAAC,KAAK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uBAAuB;IACtC,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAA;IACd,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAA;CACd;AAED,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,GAAG,YAAY,EAChC,KAAK,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EACnC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EACrB,IAAI,CAAC,EAAE,uBAAuB,EAC9B,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,GACvB,WAAW,CAcb;AA2ND;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EACrB,UAAU,CAAC,EAAE,MAAM,GAClB,MAAM,CAiDR;AA+DD;;;;;GAKG;AACH;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAOjD;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAGjD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAG9D;AAID;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI,GAAG,gBAAgB,CAcjF"}
@@ -1,7 +1,30 @@
1
1
  /**
2
2
  * Dynamic text/JSX slot updater (#1663).
3
3
  *
4
- * The compiler wraps reactive child expressions (`<div>{expr}</div>`) in a
4
+ * Slot unification A3 (`spec/slot-unification.md` §5-A3) replaced every
5
+ * OTHER `__bfText` call site with a claimed 'markup' slot writer
6
+ * (`claim-slots.ts`'s `writeMarkup` provides the identical Node/text
7
+ * contract). ONE emission site still calls `__bfText` directly and is
8
+ * deliberately deferred: `emitDynamicTextUpdates`'s `conditionalElems`
9
+ * path (`ir-to-client-js/emit-reactive.ts`) — a dynamic text/JSX
10
+ * expression nested inside a top-level (non-loop) conditional, tracked by
11
+ * an effect OUTSIDE the conditional's own `insert()` `bindEvents`. That
12
+ * effect re-resolves its anchor via `$t(__scope, slotId)` on EVERY run
13
+ * because `insert()` may swap the branch independently of this effect's own
14
+ * reruns — a cached `lazySlots` claim would go stale across such a swap, and
15
+ * a 'markup' slot's dedup `last` state can't safely survive being re-claimed
16
+ * fresh every run either: a fresh claim's `last` always starts `undefined`,
17
+ * so re-claiming per-run would throw away the dedup skip on every single
18
+ * run (every write would re-clear-and-reparse even when the value hasn't
19
+ * changed) — unlike the 'text'-kind conditional cases elsewhere in the
20
+ * compiler, which have no such state to go stale and so DO re-claim fresh
21
+ * each run safely. Moving this one case onto the claim-plan model needs the
22
+ * slot's claim door tied to the branch's OWN activation lifecycle instead of
23
+ * this separate effect's — real architectural work, not a mechanical swap —
24
+ * so it stays on `$t`/`__bfText` for now.
25
+ *
26
+ * The mechanism itself, for the reader who lands here from that one site:
27
+ * the compiler wraps reactive child expressions (`<div>{expr}</div>`) in a
5
28
  * `createEffect` that writes the value into the text node sitting between
6
29
  * the slot's `<!--bf:sX-->` / `<!--/-->` comment markers. That was a pure
7
30
  * `nodeValue = String(value)` assignment, which is correct for primitives
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic-text.d.ts","sourceRoot":"","sources":["../../src/runtime/dynamic-text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAsCH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,IAAI,GAAG,IAAI,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CAoD1E"}
1
+ {"version":3,"file":"dynamic-text.d.ts","sourceRoot":"","sources":["../../src/runtime/dynamic-text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAsCH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,IAAI,GAAG,IAAI,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CAoD1E"}
@@ -8,14 +8,14 @@ export { queryHref, type QueryParams, type QueryParamValue } from '../query-href
8
8
  export { formatDate } from '../format-date.ts';
9
9
  export { createContext, useContext, provideContext, setCurrentScope, type Context, } from './context.ts';
10
10
  export { createPortal, isSSRPortal, findSiblingSlot, cleanupPortalPlaceholder, type Portal, type PortalOptions, type Renderable, type PortalChildren, } from './portal.ts';
11
- export { reconcileList, type RenderItemFn } from './list.ts';
12
- export { reconcileElements, getLoopChildren, getLoopNodes } from './reconcile-elements.ts';
11
+ export { getLoopChildren, getLoopNodes } from './loop-markers.ts';
13
12
  export { qsaItem, upsertChildItem } from './qsa-item.ts';
14
13
  export { mapArray, mapArrayAnchored } from './map-array.ts';
14
+ export { mapArrayLazy, type LazyRowEntry, type LazyRowPlan } from './map-array-lazy.ts';
15
15
  export { patchLeaf } from './patch-leaf.ts';
16
- export { patchSlotRange } from './patch-slot-range.ts';
16
+ export { claimSlots, lazySlots, lazyClaimSlots, textOrNode, type SlotSpec, type ClaimPlan, type ClaimedSlots, type ClaimedSlotsRW, type SlotWriter } from './claim-slots.ts';
17
17
  export { registerTemplate, getTemplate, hasTemplate, type TemplateFn } from './template.ts';
18
- export { createComponent, renderChild, getPropsUpdateFn, getComponentProps, parseHTML, escapeAttr, escapeText, } from './component.ts';
18
+ export { createComponent, renderChild, parseHTML, escapeAttr, escapeText, escapeTextOrNode, } from './component.ts';
19
19
  export { applyRestAttrs } from './apply-rest-attrs.ts';
20
20
  export { spreadAttrs } from './spread-attrs.ts';
21
21
  export { styleToCss } from './style.ts';
@@ -26,7 +26,6 @@ export { registerComponent, getComponentInit, initChild, upsertChild } from './r
26
26
  export { insert, type BranchConfig, type BranchTemplateResult } from './insert.ts';
27
27
  export { __bfSlot } from './branch-slot.ts';
28
28
  export { __bfText } from './dynamic-text.ts';
29
- export { updateClientMarker } from './client-marker.ts';
30
29
  export { hydratedScopes } from './hydration-state.ts';
31
30
  export { render } from './render.ts';
32
31
  export { __bf_swap, setupStreaming } from './streaming.ts';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,sBAAsB,EACtB,UAAU,EACV,cAAc,EACd,UAAU,EACV,SAAS,EACT,OAAO,EACP,OAAO,EACP,KAAK,EACL,eAAe,EACf,SAAS,EACT,OAAO,EACP,gBAAgB,EAOhB,kBAAkB,EAClB,KAAK,gBAAgB,EACrB,sBAAsB,EACtB,KAAK,QAAQ,EACb,KAAK,MAAM,EACX,KAAK,IAAI,EACT,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,iBAAiB,EACtB,KAAK,cAAc,GACpB,MAAM,6BAA6B,CAAA;AAEpC,OAAO,EACL,mBAAmB,EACnB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,aAAa,GACnB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,SAAS,EAAE,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACpF,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAI9C,OAAO,EACL,aAAa,EACb,UAAU,EACV,cA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