@barefootjs/jsx 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.
- package/dist/compiler.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +941 -130
- package/dist/ir-to-client-js/client-only-elision.d.ts +103 -0
- package/dist/ir-to-client-js/client-only-elision.d.ts.map +1 -0
- package/dist/ir-to-client-js/collect-elements.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/branch-loop.d.ts +6 -0
- package/dist/ir-to-client-js/control-flow/plan/branch-loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/build-branch-loop.d.ts +2 -1
- package/dist/ir-to-client-js/control-flow/plan/build-branch-loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/build-insert.d.ts +7 -0
- package/dist/ir-to-client-js/control-flow/plan/build-insert.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/build-lazy-row.d.ts +107 -0
- package/dist/ir-to-client-js/control-flow/plan/build-lazy-row.d.ts.map +1 -0
- package/dist/ir-to-client-js/control-flow/plan/build-loop.d.ts +9 -1
- package/dist/ir-to-client-js/control-flow/plan/build-loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/lazy-row-eligibility.d.ts +203 -0
- package/dist/ir-to-client-js/control-flow/plan/lazy-row-eligibility.d.ts.map +1 -0
- package/dist/ir-to-client-js/control-flow/plan/loop.d.ts +10 -0
- package/dist/ir-to-client-js/control-flow/plan/loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/shared.d.ts +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/branch-loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/claim-plan.d.ts +54 -0
- package/dist/ir-to-client-js/control-flow/stringify/claim-plan.d.ts.map +1 -0
- package/dist/ir-to-client-js/control-flow/stringify/inner-loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/insert.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/lazy-row.d.ts +98 -0
- package/dist/ir-to-client-js/control-flow/stringify/lazy-row.d.ts.map +1 -0
- package/dist/ir-to-client-js/control-flow/stringify/loop-child-arm.d.ts +5 -0
- package/dist/ir-to-client-js/control-flow/stringify/loop-child-arm.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/loop.d.ts +17 -20
- package/dist/ir-to-client-js/control-flow/stringify/loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/reactive-effects.d.ts +63 -4
- package/dist/ir-to-client-js/control-flow/stringify/reactive-effects.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow.d.ts +1 -1
- package/dist/ir-to-client-js/control-flow.d.ts.map +1 -1
- package/dist/ir-to-client-js/element-refs.d.ts +8 -3
- package/dist/ir-to-client-js/element-refs.d.ts.map +1 -1
- package/dist/ir-to-client-js/emit-reactive.d.ts +8 -1
- package/dist/ir-to-client-js/emit-reactive.d.ts.map +1 -1
- package/dist/ir-to-client-js/html-template.d.ts +24 -0
- package/dist/ir-to-client-js/html-template.d.ts.map +1 -1
- package/dist/ir-to-client-js/imports.d.ts +2 -2
- package/dist/ir-to-client-js/imports.d.ts.map +1 -1
- package/dist/ir-to-client-js/reactivity.d.ts.map +1 -1
- package/dist/ir-to-client-js/types.d.ts +9 -1
- package/dist/ir-to-client-js/types.d.ts.map +1 -1
- package/dist/ir-to-client-js/utils.d.ts +1 -1
- package/dist/types.d.ts +25 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/__snapshots__/doc-examples.test.ts.snap +542 -689
- package/src/__tests__/child-components-in-map.test.ts +4 -4
- package/src/__tests__/client-js-generation.test.ts +23 -12
- package/src/__tests__/composite-branch-loop.test.ts +14 -5
- package/src/__tests__/conditional-mapArray-key.test.ts +7 -1
- package/src/__tests__/create-selector.test.ts +21 -7
- package/src/__tests__/cross-file-client-signal.test.ts +5 -1
- package/src/__tests__/early-return-scope-var-ref.test.ts +10 -11
- package/src/__tests__/inline-jsx-callback.test.ts +6 -4
- package/src/__tests__/ir-jsx-props.test.ts +6 -5
- package/src/__tests__/lazy-row-eligibility.test.ts +692 -0
- package/src/__tests__/loop-branch-bare-expression-reactive-text.test.ts +98 -0
- package/src/__tests__/loop-fallback-wrap.test.ts +34 -16
- package/src/__tests__/loop-hoisted-template.test.ts +10 -6
- package/src/__tests__/module-level-signal.audit.test.ts +7 -2
- package/src/__tests__/nested-loop-conditional.test.ts +9 -7
- package/src/__tests__/nested-loop-reactive-attrs.test.ts +2 -2
- package/src/__tests__/preamble-region-patch.test.ts +18 -12
- package/src/__tests__/profile-cond-binding-ids.test.ts +3 -2
- package/src/__tests__/profile-loop-binding-ids.test.ts +4 -3
- package/src/__tests__/profile-nested-binding-ids.test.ts +11 -6
- package/src/__tests__/reactive-attrs-in-map.test.ts +6 -4
- package/src/__tests__/static-loop-csr-materialize.test.ts +6 -1
- package/src/__tests__/template-closure.test.ts +1 -1
- package/src/compiler.ts +11 -0
- package/src/index.ts +1 -0
- package/src/ir-to-client-js/client-only-elision.ts +273 -0
- package/src/ir-to-client-js/collect-elements.ts +56 -17
- package/src/ir-to-client-js/control-flow/plan/branch-loop.ts +6 -0
- package/src/ir-to-client-js/control-flow/plan/build-branch-loop.ts +35 -12
- package/src/ir-to-client-js/control-flow/plan/build-insert.ts +9 -2
- package/src/ir-to-client-js/control-flow/plan/build-lazy-row.ts +305 -0
- package/src/ir-to-client-js/control-flow/plan/build-loop.ts +44 -12
- package/src/ir-to-client-js/control-flow/plan/lazy-row-eligibility.ts +440 -0
- package/src/ir-to-client-js/control-flow/plan/loop.ts +10 -0
- package/src/ir-to-client-js/control-flow/shared.ts +1 -1
- package/src/ir-to-client-js/control-flow/stringify/branch-loop.ts +34 -4
- package/src/ir-to-client-js/control-flow/stringify/claim-plan.ts +68 -0
- package/src/ir-to-client-js/control-flow/stringify/inner-loop.ts +18 -9
- package/src/ir-to-client-js/control-flow/stringify/insert.ts +17 -11
- package/src/ir-to-client-js/control-flow/stringify/lazy-row.ts +478 -0
- package/src/ir-to-client-js/control-flow/stringify/loop-child-arm.ts +41 -17
- package/src/ir-to-client-js/control-flow/stringify/loop.ts +71 -46
- package/src/ir-to-client-js/control-flow/stringify/reactive-effects.ts +241 -31
- package/src/ir-to-client-js/control-flow.ts +8 -3
- package/src/ir-to-client-js/element-refs.ts +9 -11
- package/src/ir-to-client-js/emit-reactive.ts +50 -14
- package/src/ir-to-client-js/html-template.ts +29 -9
- package/src/ir-to-client-js/imports.ts +13 -4
- package/src/ir-to-client-js/reactivity.ts +3 -2
- package/src/ir-to-client-js/types.ts +10 -2
- package/src/ir-to-client-js/utils.ts +1 -1
- package/src/jsx-to-ir.ts +26 -8
- package/src/types.ts +25 -2
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claim-plan literal rendering — the compiler-side half of slot unification
|
|
3
|
+
* A3 (`spec/slot-unification.md` §4/§5-A3). The runtime's `SlotSpec`/
|
|
4
|
+
* `ClaimPlan` (`@barefootjs/client/runtime/claim-slots.ts`, A2) are pure
|
|
5
|
+
* data: `{ id, kind, path }` triples. This module is the single place that
|
|
6
|
+
* turns compile-time slot descriptors into that data's source-text form —
|
|
7
|
+
* every content-slot emission site (loop rows, preamble regions, dynamic
|
|
8
|
+
* text/JSX slots, `@client` expressions) renders its plan through
|
|
9
|
+
* `claimPlanLiteral`, never by hand-splicing strings, so the literal shape
|
|
10
|
+
* can only ever match `SlotSpec`.
|
|
11
|
+
*
|
|
12
|
+
* Paths are real root-relative child-index arrays wherever the caller
|
|
13
|
+
* already has them (the hoisted single-root loop skeleton, #2143's
|
|
14
|
+
* `SkeletonSlotPaths`); everywhere else a slot gets `path: []` and A2's
|
|
15
|
+
* `lazySlots`/`claimSlots` marker-scan fallback resolves it — sound, just a
|
|
16
|
+
* per-claim scan instead of an O(depth) walk. This is the explicit
|
|
17
|
+
* "cannot be statically pathed" escape valve `spec/slot-unification.md`
|
|
18
|
+
* §5-A3 sanctions, not a shortcut invented here.
|
|
19
|
+
*/
|
|
20
|
+
export interface ClaimSlotSpec {
|
|
21
|
+
readonly id: string;
|
|
22
|
+
readonly kind: 'text' | 'markup';
|
|
23
|
+
/** Root-relative child-index path, used when the path is unconditionally
|
|
24
|
+
* valid at claim time. Ignored when `pathExpr` is set. */
|
|
25
|
+
readonly path: readonly number[];
|
|
26
|
+
/**
|
|
27
|
+
* Raw JS expression (already rendered source text) evaluating to a
|
|
28
|
+
* `number[]` at runtime, for the one case a plain literal can't express:
|
|
29
|
+
* a hoisted-skeleton path that's valid ONLY on the fresh-CSR-clone branch,
|
|
30
|
+
* never on the hydration-adopts-SSR branch (#2143 precedent — `__p` is
|
|
31
|
+
* nulled when `__existing` is truthy because the skeleton's simplified
|
|
32
|
+
* markup doesn't describe the real SSR-rendered tree). Typically
|
|
33
|
+
* `__existing ? [] : [1, 0]`. Overrides `path` when present.
|
|
34
|
+
*/
|
|
35
|
+
readonly pathExpr?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Slot unification Step B (`spec/slot-unification.md` §3(b), §5 Step B):
|
|
38
|
+
* true when NO marker was emitted for this slot — `path`'s last index is
|
|
39
|
+
* the slot's own position, not an anchor comment. Only ever set by
|
|
40
|
+
* `client-only-elision.ts`-derived callers; every other emission site
|
|
41
|
+
* omits it (falsy = today's marker-based behavior, unchanged).
|
|
42
|
+
*/
|
|
43
|
+
readonly markerless?: boolean;
|
|
44
|
+
}
|
|
45
|
+
/** Render a `ClaimPlan` (an array of `SlotSpec`) as a source-text array literal. */
|
|
46
|
+
export declare function claimPlanLiteral(slots: readonly ClaimSlotSpec[]): string;
|
|
47
|
+
/**
|
|
48
|
+
* A stable JS identifier for the claimed-slot writer covering `slots`,
|
|
49
|
+
* derived from the first slot's id. Slot ids are unique per component (the
|
|
50
|
+
* `bf="sN"` marker namespace), so this can never collide across two
|
|
51
|
+
* distinct claim-plan call sites within the same emitted component.
|
|
52
|
+
*/
|
|
53
|
+
export declare function claimWriterVarName(slots: readonly ClaimSlotSpec[], sanitize: (id: string) => string): string;
|
|
54
|
+
//# sourceMappingURL=claim-plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claim-plan.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/stringify/claim-plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAA;IAChC;+DAC2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;IAChC;;;;;;;;OAQG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAC9B;AASD,oFAAoF;AACpF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,GAAG,MAAM,CAExE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,CAG5G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inner-loop.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/stringify/inner-loop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;
|
|
1
|
+
{"version":3,"file":"inner-loop.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/stringify/inner-loop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAQH,OAAO,KAAK,EAEV,cAAc,EACf,MAAM,uBAAuB,CAAA;AAE9B,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,MAAM,EACd,EAAE,CAAC,EAAE,MAAM,GACV,IAAI,CAQN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insert.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/stringify/insert.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAgC,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"insert.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/stringify/insert.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAgC,MAAM,kBAAkB,CAAA;AAMhF,MAAM,WAAW,sBAAsB;IACrC,2CAA2C;IAC3C,aAAa,EAAE,MAAM,CAAA;IACrB,yEAAyE;IACzE,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,sBAAsB,GAC3B,IAAI,CAgBN"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Emit a lazy row graph loop — `mapArrayLazy(...)` + a compiler-built
|
|
3
|
+
* `LazyRowPlan` object literal (`spec/slot-unification.md` §9, L3).
|
|
4
|
+
*
|
|
5
|
+
* This is the alternative to `stringifyPlainLoop`'s `mapArray` + renderItem
|
|
6
|
+
* emission, taken only when `lazyRowEligibility` said yes (see
|
|
7
|
+
* `plan/lazy-row-eligibility.ts`). Every ineligible loop keeps today's
|
|
8
|
+
* emission byte-for-byte — sound-or-loud, no silent third path.
|
|
9
|
+
*
|
|
10
|
+
* Output shape:
|
|
11
|
+
*
|
|
12
|
+
* const __tpl_<mid> = document.createElement('template') // hoisted skeleton, when usable
|
|
13
|
+
* __tpl_<mid>.innerHTML = `…`
|
|
14
|
+
* const __lzp_<mid> = [...] // hoisted fresh-clone text paths, when usable
|
|
15
|
+
* const __lzs_<mid> = [{ id, kind: 'text', path: [] }, …] // hoisted claim plan, ADOPTED-row form
|
|
16
|
+
* const __lzsc_<mid> = [{ id, kind: 'text', path: __lzp_<mid>[i] }, …] // FRESH-CLONE form, only when it differs
|
|
17
|
+
* const __lzc_<mid> = (__e) => { … } // lazy ref claim for ADOPTED rows (door slot empty)
|
|
18
|
+
* mapArrayLazy(() => <arr>, <container>, <keyFn>, {
|
|
19
|
+
* createRow: (__e, <idx>) => { … writes every binding, seeds refs+last … },
|
|
20
|
+
* applyItem: (__e) => { … item-driven bindings, dedup against __e.last … },
|
|
21
|
+
* applyOuter: (__es, __seed) => { … one loop-level effect body … },
|
|
22
|
+
* }, '<markerId>')
|
|
23
|
+
*
|
|
24
|
+
* Three shapes carry the plan's obligations (runtime docstring,
|
|
25
|
+
* `packages/client/src/runtime/map-array-lazy.ts`):
|
|
26
|
+
*
|
|
27
|
+
* **`createRow`** — CSR creation. Clones the row, resolves refs from KNOWN
|
|
28
|
+
* clone paths (the hoisted skeleton's `__p`-style child-index chains, reused
|
|
29
|
+
* verbatim from #2143 via `pathExpr`) with no scan, writes ALL bindings
|
|
30
|
+
* (item-driven and outer-involving alike) and seeds `entry.last` so the
|
|
31
|
+
* loop-level outer effect's dedup is correct from the row's first tick.
|
|
32
|
+
*
|
|
33
|
+
* **`applyItem`** — called by the reconciler after `entry.item` changed.
|
|
34
|
+
* Claims refs lazily through `__lzc_<mid>` (a `qsa` scan inside that ONE row)
|
|
35
|
+
* when `entry.refs` is null, materializes the content door on demand
|
|
36
|
+
* (`doorAccess`), then writes each item-driven binding behind a per-binding
|
|
37
|
+
* dedup on `entry.last`.
|
|
38
|
+
*
|
|
39
|
+
* **`applyOuter`** — the ONE loop-level effect body, emitted only when some
|
|
40
|
+
* binding is outer-involving. Two details matter:
|
|
41
|
+
*
|
|
42
|
+
* - **Prime reads first.** The effect subscribes to whatever its body reads.
|
|
43
|
+
* With an empty entry list the per-row loop reads nothing, so the effect
|
|
44
|
+
* would never subscribe and the loop would go permanently dead. The plan
|
|
45
|
+
* therefore emits a bare `getter()` statement per reactive outer name
|
|
46
|
+
* BEFORE the row loop. The eligibility gate guarantees every reactive
|
|
47
|
+
* outer name is a primable zero-arg signal/memo getter.
|
|
48
|
+
* - **Read-compare-write seeding (§9.3(1)).** On the first run (`__seed`)
|
|
49
|
+
* each binding computes its value, READS the current DOM, and writes only
|
|
50
|
+
* on difference — sound even when the outer state is client-only and
|
|
51
|
+
* diverges from SSR, with no writes on the consistent path. The DOM read
|
|
52
|
+
* is per attribute KIND and pairs with `emitAttrUpdate`'s dispatch
|
|
53
|
+
* (`emit-reactive.ts`); any kind this module does not recognise falls back
|
|
54
|
+
* to `true` (always write on seed), which is conservative, never wrong.
|
|
55
|
+
* CONTENT slots seed the same way through the claim's `read(id)` door
|
|
56
|
+
* (§9.5, lifted) — see `refParts` for the per-loop door choice.
|
|
57
|
+
*
|
|
58
|
+
* A loop with NO outer binding emits no `applyOuter` at all — its rows do
|
|
59
|
+
* literally nothing at hydration.
|
|
60
|
+
*/
|
|
61
|
+
import type { SkeletonSlotPaths } from '../../html-template.ts';
|
|
62
|
+
import type { LazyRowAttrBinding, LazyRowPlanData } from '../plan/build-lazy-row.ts';
|
|
63
|
+
export interface StringifyLazyRowOptions {
|
|
64
|
+
/** Indent of the `mapArrayLazy(` line itself. */
|
|
65
|
+
indent: string;
|
|
66
|
+
containerVar: string;
|
|
67
|
+
/** Wrap the call in `if (<containerVar>) …` — branch-scoped loops do. */
|
|
68
|
+
guardContainer: boolean;
|
|
69
|
+
markerId: string;
|
|
70
|
+
arrayExpr: string;
|
|
71
|
+
keyFn: string;
|
|
72
|
+
paramHead: string;
|
|
73
|
+
indexParam: string;
|
|
74
|
+
/** Per-row interpolated template (the non-hoisted clone source). */
|
|
75
|
+
template: string;
|
|
76
|
+
skeletonTemplate?: string;
|
|
77
|
+
skeletonPaths?: SkeletonSlotPaths;
|
|
78
|
+
lazyRow: LazyRowPlanData;
|
|
79
|
+
}
|
|
80
|
+
export declare function stringifyLazyRowLoop(lines: string[], o: StringifyLazyRowOptions): void;
|
|
81
|
+
/** `entry.last`-backed dedup test. `in` (not a truthiness check) so a
|
|
82
|
+
* legitimately `undefined` value still records and still writes once. */
|
|
83
|
+
declare function dedupGuard(ordinal: number): string;
|
|
84
|
+
/**
|
|
85
|
+
* Read-compare-write seeding predicate (§9.3(1)): does the CURRENT DOM
|
|
86
|
+
* differ from the value `__x` this binding would write? Mirrors
|
|
87
|
+
* `emitAttrUpdate`'s per-kind dispatch (`emit-reactive.ts`) — the two must
|
|
88
|
+
* be read together. An unrecognised kind returns `true`, i.e. write on the
|
|
89
|
+
* seed run unconditionally: conservative, never unsound.
|
|
90
|
+
*/
|
|
91
|
+
declare function seedDiffersExpr(target: string, a: LazyRowAttrBinding): string;
|
|
92
|
+
/** Exported for the emission-shape unit tests. */
|
|
93
|
+
export declare const __lazyRowInternals: {
|
|
94
|
+
seedDiffersExpr: typeof seedDiffersExpr;
|
|
95
|
+
dedupGuard: typeof dedupGuard;
|
|
96
|
+
};
|
|
97
|
+
export {};
|
|
98
|
+
//# sourceMappingURL=lazy-row.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazy-row.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/stringify/lazy-row.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AAKH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAQ/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAsB,MAAM,2BAA2B,CAAA;AAExG,MAAM,WAAW,uBAAuB;IACtC,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;IACpB,yEAAyE;IACzE,cAAc,EAAE,OAAO,CAAA;IACvB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,oEAAoE;IACpE,QAAQ,EAAE,MAAM,CAAA;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,aAAa,CAAC,EAAE,iBAAiB,CAAA;IACjC,OAAO,EAAE,eAAe,CAAA;CACzB;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAuKtF;AAiGD;0EAC0E;AAC1E,iBAAS,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE3C;AAqFD;;;;;;GAMG;AACH,iBAAS,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,kBAAkB,GAAG,MAAM,CAsBtE;AAED,kDAAkD;AAClD,eAAO,MAAM,kBAAkB;;;CAAkC,CAAA"}
|
|
@@ -45,6 +45,11 @@ export declare function stringifyBranchEventBindings(lines: string[], plan: Bran
|
|
|
45
45
|
* SSR side: element has `bf-s` → qsa() finds it, initChild wires events.
|
|
46
46
|
* CSR side: element is a `data-bf-ph` placeholder → createComponent
|
|
47
47
|
* replaces it, then initChild runs against the new element.
|
|
48
|
+
*
|
|
49
|
+
* The placeholder is passed to `createComponent` as its `mountAt`
|
|
50
|
+
* argument so the component's own init runs connected — context resolves
|
|
51
|
+
* by DOM position, and a detached init falls back to the global,
|
|
52
|
+
* last-writer-wins context store.
|
|
48
53
|
*/
|
|
49
54
|
export declare function stringifyBranchChildComponentInits(lines: string[], plan: BranchChildComponentInitsPlan, indent: string): void;
|
|
50
55
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loop-child-arm.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/stringify/loop-child-arm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"loop-child-arm.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/stringify/loop-child-arm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AASH,OAAO,KAAK,EACV,6BAA6B,EAC7B,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,EACzB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEnE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,SAAS,gBAAgB,EAAE,EACjC,MAAM,EAAE,MAAM,EACd,EAAE,CAAC,EAAE,MAAM,GACV,IAAI,CAcN;AAED;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,uBAAuB,EAC7B,MAAM,EAAE,MAAM,GACb,IAAI,CAYN;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,6BAA6B,EACnC,MAAM,EAAE,MAAM,GACb,IAAI,CAIN;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,oBAAoB,EAC1B,MAAM,EAAE,MAAM,EACd,EAAE,CAAC,EAAE,MAAM,GACV,IAAI,CA0DN;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,MAAM,EAAE,EACf,YAAY,EAAE,SAAS,wBAAwB,EAAE,EACjD,MAAM,EAAE,MAAM,EACd,EAAE,CAAC,EAAE,MAAM,GACV,IAAI,CAIN;AA0BD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,EAAE,EACf,GAAG,EAAE,gBAAgB,EACrB,SAAS,EAAE,MAAM,EACjB,EAAE,EAAE,MAAM,GAAG,SAAS,GACrB,IAAI,CAiDN"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Stringify LoopPlan variants to source lines.
|
|
3
3
|
*
|
|
4
|
-
* Output shapes
|
|
4
|
+
* Output shapes:
|
|
5
5
|
*
|
|
6
6
|
* PlainLoopPlan, no reactive effects (single-line renderItem):
|
|
7
7
|
* <indent>mapArray(() => <arr>, <container>, <keyFn>, (<head>, <idx>, __existing) =>
|
|
@@ -12,19 +12,23 @@
|
|
|
12
12
|
* <indent> <unwrap?>
|
|
13
13
|
* <indent> <preamble?>
|
|
14
14
|
* <indent> const __el = __existing ?? (() => { ... })()
|
|
15
|
-
* <indent> <reactive effects via stringifyReactiveEffects
|
|
15
|
+
* <indent> <reactive effects + preamble regions via stringifyReactiveEffects —
|
|
16
|
+
* <indent> row-granularity (spec/slot-unification.md §3(c)): attrs, outer
|
|
17
|
+
* <indent> texts, and preamble regions merge into ONE createEffect per row
|
|
18
|
+
* <indent> in normal builds; profile-mode builds keep the legacy
|
|
19
|
+
* <indent> one-effect-per-slot shape (see that module's docstring)>
|
|
16
20
|
* <indent> return __el
|
|
17
21
|
* <indent>})
|
|
18
22
|
*
|
|
19
23
|
* StaticLoopPlan: two parallel forEach blocks (attrs / texts) — see
|
|
20
24
|
* emitStaticLoop. The forEach-duplication noted in observation O-4 is
|
|
21
|
-
* preserved bug-for-bug; PR 5+ collapses them.
|
|
25
|
+
* preserved bug-for-bug; PR 5+ collapses them. Left untouched by the
|
|
26
|
+
* row-granularity pass above — a different (forEach, not mapArray) shape.
|
|
22
27
|
*
|
|
23
28
|
* Indent convention for plain loops: top-level emission uses `' '` (2 sp);
|
|
24
29
|
* passed in via `topIndent`.
|
|
25
30
|
*/
|
|
26
31
|
import type { LoopChildRefBinding, LoopPlan, PlainLoopPlan, StaticLoopPlan } from '../plan/types.ts';
|
|
27
|
-
import type { PreambleRegionPlan } from '../plan/loop.ts';
|
|
28
32
|
/**
|
|
29
33
|
* Emit `(callback)(__rf)` for each ref on a per-item slot, looking up the
|
|
30
34
|
* target element via `qsa(__el, '[bf="<slot>"]')` (or `qsaItem` for
|
|
@@ -44,23 +48,16 @@ export declare function emitLoopChildRefs(lines: string[], refs: readonly LoopCh
|
|
|
44
48
|
elementIndexBySlot?: ReadonlyMap<string, number>;
|
|
45
49
|
}): void;
|
|
46
50
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* Non-empty `regions` forces the caller's multi-line renderItem layout (the
|
|
58
|
-
* effect needs `__el` as a query root), mirroring `emitLoopChildRefs`.
|
|
51
|
+
* Preamble-patched regions (#2389 — `arr.map(t => { const cells = []; ...;
|
|
52
|
+
* return <tr>{cells}<td>{t.name}</td></tr> })`) used to get their own
|
|
53
|
+
* per-region `createEffect` here. Row-granularity effects (perf,
|
|
54
|
+
* spec/slot-unification.md §3(c)/§8) merged that into the SAME single row
|
|
55
|
+
* effect `stringifyReactiveEffects` now emits for attrs/outer texts — see
|
|
56
|
+
* that module's docstring. Both plain-loop-row call sites
|
|
57
|
+
* (`stringifyPlainLoop` below, `stringify/branch-loop.ts`'s `emitPlain`) pass
|
|
58
|
+
* `preambleRegions`/`mapPreambleWrapped` straight into
|
|
59
|
+
* `stringifyReactiveEffects` instead of calling a separate emitter.
|
|
59
60
|
*/
|
|
60
|
-
export declare function emitPreambleRegionEffects(lines: string[], regions: readonly PreambleRegionPlan[], mapPreambleWrapped: string, opts: {
|
|
61
|
-
indent: string;
|
|
62
|
-
elVar: string;
|
|
63
|
-
}): void;
|
|
64
61
|
/**
|
|
65
62
|
* Single dispatch over `LoopPlan` (#1253). Narrows on `plan.kind` and
|
|
66
63
|
* delegates to the per-variant stringifier. Callers should consume this
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loop.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/stringify/loop.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"loop.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/stringify/loop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAWH,OAAO,KAAK,EAAE,mBAAmB,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEpG;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,SAAS,mBAAmB,EAAE,EACpC,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,OAAO,CAAC;IAAC,kBAAkB,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GAClH,IAAI,CAaN;AAED;;;;;;;;;;GAUG;AAEH;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,CAoBnE;AAYD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,aAAa,EACnB,SAAS,GAAE,MAAa,GACvB,IAAI,CA+KN;AAoDD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,cAAc,GAAG,IAAI,CAkH/E"}
|
|
@@ -6,15 +6,46 @@
|
|
|
6
6
|
* bodies (events, child component inits, inner loops, nested conditionals,
|
|
7
7
|
* branch-scoped texts) flow through the per-arm stringifiers in
|
|
8
8
|
* `loop-child-arm.ts` — no legacy passthrough remains.
|
|
9
|
+
*
|
|
10
|
+
* Row-granularity effects (perf, spec/slot-unification.md §3(c)/§8, the
|
|
11
|
+
* deferred A3b): for the "plain loop row, top-level or branch-scoped" shape
|
|
12
|
+
* — the only shape where `stringifyReactiveEffects` is called alongside
|
|
13
|
+
* `PreambleRegionPlan`s from the SAME renderItem scope (`stringify/loop.ts`'s
|
|
14
|
+
* `stringifyPlainLoop`, `stringify/branch-loop.ts`'s `emitPlain`) — reactive
|
|
15
|
+
* attrs, outer texts, and preamble regions all read the SAME per-item signal
|
|
16
|
+
* dependency, so consolidating them into ONE `createEffect` per row removes
|
|
17
|
+
* N-1 effect objects and subscription-list entries per row without changing
|
|
18
|
+
* the firing profile. Composite loops, component loops, and the anchored
|
|
19
|
+
* (whole-item-conditional) loop shape keep the legacy one-effect-per-slot
|
|
20
|
+
* emission — their reactiveEffects never carry preamble regions, and
|
|
21
|
+
* consolidating them wasn't part of this pass's mechanically-verified scope
|
|
22
|
+
* (see the call sites' docstrings).
|
|
23
|
+
*
|
|
24
|
+
* Profile mode (#1690) carries a `<Component>#binding:<slotId>` id per
|
|
25
|
+
* effect so the profiler attributes a re-run to its source binding — merging
|
|
26
|
+
* bindings into one effect would make every binding on the row share one id.
|
|
27
|
+
* Resolution: profile mode (`plan.profileComponentName` set) keeps the
|
|
28
|
+
* granular per-slot/per-attr effect emission (`emitAttrSlotsGranular` /
|
|
29
|
+
* `emitOuterTexts` below); normal builds get the consolidated row effect.
|
|
30
|
+
* Preamble regions never carried a per-region bfId even before this pass, so
|
|
31
|
+
* they always consolidate into one effect regardless of profile mode.
|
|
9
32
|
*/
|
|
10
33
|
import type { ReactiveEffectsPlan } from '../plan/reactive-effects.ts';
|
|
34
|
+
/** A resolved preamble-patched region (#2389) ready to merge into the row
|
|
35
|
+
* effect — same shape as `plan/loop.ts`'s `PreambleRegionPlan`, restated
|
|
36
|
+
* here so this module doesn't need a cross-import into the loop plan file
|
|
37
|
+
* for one two-field shape. */
|
|
38
|
+
export interface RowPreambleRegion {
|
|
39
|
+
slotId: string;
|
|
40
|
+
valueExpr: string;
|
|
41
|
+
}
|
|
11
42
|
export interface StringifyReactiveEffectsOptions {
|
|
12
43
|
/** Indent prefix for every emitted line. */
|
|
13
44
|
indent: string;
|
|
14
45
|
/**
|
|
15
46
|
* Element variable to attach effects to (e.g., `__el`, `__existing`,
|
|
16
47
|
* `__csrEl`). The stringifier never inspects it — it is simply substituted
|
|
17
|
-
* into the qsa() /
|
|
48
|
+
* into the qsa() / lazySlots() / insert() call shapes.
|
|
18
49
|
*/
|
|
19
50
|
elVar: string;
|
|
20
51
|
/**
|
|
@@ -33,8 +64,36 @@ export interface StringifyReactiveEffectsOptions {
|
|
|
33
64
|
* still resolves through the battle-tested runtime lookup.
|
|
34
65
|
*/
|
|
35
66
|
elementIndexBySlot?: ReadonlyMap<string, number>;
|
|
36
|
-
/**
|
|
37
|
-
|
|
67
|
+
/**
|
|
68
|
+
* Rendered path EXPRESSION source (not a plain array — see
|
|
69
|
+
* `ClaimSlotSpec.pathExpr`) for outer text slots, keyed by slotId: perf,
|
|
70
|
+
* #2143's hoisted single-root loop skeleton
|
|
71
|
+
* (`SkeletonSlotPaths.textMarkerPaths`), guarded by `__existing` the same
|
|
72
|
+
* way `__p` is nulled on the hydration branch (the skeleton's simplified
|
|
73
|
+
* markup doesn't describe the real SSR-rendered tree). Only
|
|
74
|
+
* `stringifyPlainLoop`'s hoisted-skeleton path supplies these; every other
|
|
75
|
+
* caller omits it and each text slot's claim-plan entry gets `path: []`
|
|
76
|
+
* — A2's marker-scan fallback resolves it at claim time (sound, just
|
|
77
|
+
* slower), per `spec/slot-unification.md` §5-A3's explicit "cannot be
|
|
78
|
+
* statically pathed" allowance.
|
|
79
|
+
*/
|
|
80
|
+
textClaimPathExprs?: ReadonlyMap<string, string>;
|
|
81
|
+
/**
|
|
82
|
+
* Preamble-patched regions (#2389) to merge into the SAME row effect as
|
|
83
|
+
* this scope's reactive attrs/outer texts (row-granularity effects,
|
|
84
|
+
* §3(c)) — only supplied by the plain-loop-row call sites
|
|
85
|
+
* (`stringify/loop.ts`, `stringify/branch-loop.ts`) where
|
|
86
|
+
* `PlainLoopVariant.preambleRegions` exists on the plan. Every other
|
|
87
|
+
* caller omits this and gets the legacy per-slot emission untouched.
|
|
88
|
+
*/
|
|
89
|
+
preambleRegions?: readonly RowPreambleRegion[];
|
|
90
|
+
/**
|
|
91
|
+
* The loop callback's pre-return preamble (already wrapped with the loop
|
|
92
|
+
* param accessor), re-run once per row-effect tick — BEFORE any preamble
|
|
93
|
+
* region read — so `preambleRegions`' `valueExpr`s see freshly recomputed
|
|
94
|
+
* locals. Only meaningful alongside `preambleRegions`.
|
|
95
|
+
*/
|
|
96
|
+
mapPreambleWrapped?: string;
|
|
38
97
|
}
|
|
39
|
-
export declare function stringifyReactiveEffects(lines: string[], plan: ReactiveEffectsPlan, opts: StringifyReactiveEffectsOptions): void;
|
|
98
|
+
export declare function stringifyReactiveEffects(lines: string[], plan: ReactiveEffectsPlan | null, opts: StringifyReactiveEffectsOptions): void;
|
|
40
99
|
//# sourceMappingURL=reactive-effects.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactive-effects.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/stringify/reactive-effects.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"reactive-effects.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/stringify/reactive-effects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAMH,OAAO,KAAK,EAGV,mBAAmB,EAEpB,MAAM,6BAA6B,CAAA;AAEpC;;;+BAG+B;AAC/B,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,+BAA+B;IAC9C,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAChD;;;;;;;;;;;;OAYG;IACH,kBAAkB,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAChD;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,SAAS,iBAAiB,EAAE,CAAA;IAC9C;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,mBAAmB,GAAG,IAAI,EAChC,IAAI,EAAE,+BAA+B,GACpC,IAAI,CA8BN"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* These three functions are called from `generate-init.ts` to emit the
|
|
5
5
|
* client-side runtime calls that drive reactive conditionals
|
|
6
6
|
* (`insert(...)`) and reactive loops (`mapArray(...)` /
|
|
7
|
-
* `
|
|
7
|
+
* `mapArrayAnchored(...)`) for a single component.
|
|
8
8
|
*
|
|
9
9
|
* Each entry point thinly wraps the Plan layer:
|
|
10
10
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-flow.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/control-flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"control-flow.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/control-flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,YAAY,CAAA;AAa/D,yFAAyF;AACzF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI,CAOlF;AAED,8EAA8E;AAC9E,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI,CAQtF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,eAAe,EAAE,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAuB1G"}
|
|
@@ -2,13 +2,18 @@
|
|
|
2
2
|
* Element ref declarations — `const [_s0, _s1] = $(…, 's0', 's1')`.
|
|
3
3
|
*
|
|
4
4
|
* Every element the init body needs to find at hydration time (events,
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* loops, refs, reactive attrs, reactive props, rest-attr elements, child
|
|
6
|
+
* component slots) is emitted via one of two finders:
|
|
7
7
|
*
|
|
8
8
|
* `$(…)` — regular DOM elements (bf-*)
|
|
9
|
-
* `$t(…)` — text comment markers for dynamic text (`<!--bf:sN-->`)
|
|
10
9
|
* `$c(…)` — component slots (bf-s, component-rooted)
|
|
11
10
|
*
|
|
11
|
+
* Dynamic text/JSX content slots (`<!--bf:sN-->` markers) don't need a ref
|
|
12
|
+
* here at all — they resolve through a claimed-slot writer built where
|
|
13
|
+
* they're used (`emitDynamicTextUpdates`/`emitClientOnlyExpressions` in
|
|
14
|
+
* `ir-to-client-js/emit-reactive.ts`, slot unification A3), not a
|
|
15
|
+
* pre-resolved `_sN` var.
|
|
16
|
+
*
|
|
12
17
|
* Slots inside conditional branches are excluded here because
|
|
13
18
|
* `insert()` bindEvents re-queries them when the branch activates.
|
|
14
19
|
* Component slots take precedence over regular slots (#360): when a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element-refs.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/element-refs.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"element-refs.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/element-refs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAIjD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,CAgDhE"}
|
|
@@ -18,7 +18,14 @@ export declare function emitAttrUpdate(target: string, attrName: string, express
|
|
|
18
18
|
export declare function rewriteDestructuredPropsInExpr(expr: string, ctx: ClientJsContext): string;
|
|
19
19
|
/** Emit createEffect blocks that update text nodes for reactive expressions. */
|
|
20
20
|
export declare function emitDynamicTextUpdates(lines: string[], ctx: ClientJsContext): void;
|
|
21
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Emit createEffect blocks for `@client` expressions. Slot unification A3:
|
|
23
|
+
* these are ordinary claimed 'text' slots now (never Node-valued — `@client`
|
|
24
|
+
* only ever evaluates a plain expression), one writer per slot at `__scope`,
|
|
25
|
+
* replacing `updateClientMarker`'s full-tree rescan + zero-width-space
|
|
26
|
+
* managed-node marker (no longer needed: a claimed Text node's identity is
|
|
27
|
+
* already known, so there's nothing to disambiguate from other content).
|
|
28
|
+
*/
|
|
22
29
|
export declare function emitClientOnlyExpressions(lines: string[], ctx: ClientJsContext): void;
|
|
23
30
|
/** Emit createEffect blocks that sync reactive attribute values (class, value, checked, etc.). */
|
|
24
31
|
export declare function emitReactiveAttributeUpdates(lines: string[], ctx: ClientJsContext): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emit-reactive.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/emit-reactive.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAc,MAAM,aAAa,CAAA;AAEvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"emit-reactive.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/emit-reactive.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAc,MAAM,aAAa,CAAA;AAEvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAqBjD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,EAAE,CAyC7G;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,GAAG,MAAM,CAmBzF;AAqLD,gFAAgF;AAChF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI,CAsFlF;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI,CAgBrF;AAED,kGAAkG;AAClG,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI,CAyBxF;AAED,+FAA+F;AAC/F,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI,CAqDpF;AAED,2FAA2F;AAC3F,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI,CAgClF"}
|
|
@@ -30,6 +30,7 @@ export declare function createTemplateAwareStringProtector(): {
|
|
|
30
30
|
restore: (s: string) => string;
|
|
31
31
|
replaceProtectedCall: (haystack: string, needle: string, replacement: () => string) => string;
|
|
32
32
|
};
|
|
33
|
+
export declare const VOID_ELEMENTS: Set<string>;
|
|
33
34
|
/**
|
|
34
35
|
* Source-of-truth predicates for the collision-safe spread-attrs merge
|
|
35
36
|
* shared by all three CSR-side emit paths (`irToHtmlTemplate`,
|
|
@@ -194,6 +195,25 @@ export interface SkeletonSlotPaths {
|
|
|
194
195
|
/** slotId -> path to the first Comment of the `<!--bf:slotId--><!--/-->` marker pair. */
|
|
195
196
|
textMarkerPaths: ReadonlyMap<string, readonly number[]>;
|
|
196
197
|
}
|
|
198
|
+
/**
|
|
199
|
+
* Tags whose HTML-parser behavior can silently restructure or drop children
|
|
200
|
+
* relative to the naive IR-tree model (implied table sections, `<select>`/
|
|
201
|
+
* `<optgroup>` child-dropping, `<p>` auto-close, leading-newline drop in
|
|
202
|
+
* `<pre>`/`<textarea>`, `<template>` content relocating into `.content`). A
|
|
203
|
+
* skeleton containing any of these bails on path computation entirely —
|
|
204
|
+
* the loop keeps its hoisted-clone fast path, but every slot lookup falls
|
|
205
|
+
* back to `qsa`/`$t`.
|
|
206
|
+
*/
|
|
207
|
+
export declare const SKELETON_PATH_HAZARD_TAGS: Set<string>;
|
|
208
|
+
/**
|
|
209
|
+
* Tag groups the HTML parser force-closes when a tag from the group is
|
|
210
|
+
* nested inside ANY other open tag from the SAME group — not just an
|
|
211
|
+
* identical tag (e.g. `<h2>` inside `<h1>` closes the `<h1>`, `<dd>` inside
|
|
212
|
+
* `<dt>` closes the `<dt>`). A skeleton hitting this bails on path
|
|
213
|
+
* computation entirely (see `SKELETON_PATH_HAZARD_TAGS` doc).
|
|
214
|
+
*/
|
|
215
|
+
export declare const SKELETON_PATH_FORCE_CLOSE_GROUPS: ReadonlyArray<ReadonlySet<string>>;
|
|
216
|
+
export declare function skeletonForceCloseGroup(tag: string): number;
|
|
197
217
|
/**
|
|
198
218
|
* Compute per-slot child-index paths for a loop skeleton already proven
|
|
199
219
|
* safe by `buildLoopSkeletonTemplate` — call this ONLY after that returned
|
|
@@ -204,6 +224,10 @@ export interface SkeletonSlotPaths {
|
|
|
204
224
|
* diverge from the browser's actual parsed structure.
|
|
205
225
|
*/
|
|
206
226
|
export declare function computeSkeletonSlotPaths(node: IRNode, safe: LoopSkeletonSafeSlots): SkeletonSlotPaths | null;
|
|
227
|
+
/** True if `children` (already flattened) contains anything the HTML parser would foster-parent out of a `<tr>`. */
|
|
228
|
+
export declare function hasForeignTableRowContent(children: readonly IRNode[]): boolean;
|
|
229
|
+
/** Splice fragment children inline — a fragment contributes no DOM node of its own. */
|
|
230
|
+
export declare function flattenSkeletonChildren(children: readonly IRNode[]): IRNode[];
|
|
207
231
|
/**
|
|
208
232
|
* Generate an HTML template for composite element reconciliation.
|
|
209
233
|
* Identical to irToHtmlTemplate except component nodes become placeholder
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-template.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/html-template.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAe,MAAM,EAAU,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAG/G,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAG/C,OAAO,EAAwD,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACvG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAIjD;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI;IACvC,OAAO,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;IAC9B,OAAO,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;CAC/B,CAaA;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,GA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D;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,OAAO,CAiBpF"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Import detection and DOM import management.
|
|
3
3
|
*/
|
|
4
4
|
import type { ComponentIR } from '../types.ts';
|
|
5
|
-
export declare const RUNTIME_IMPORT_CANDIDATES: readonly ['createSignal', 'createMemo', 'createEffect', 'onCleanup', 'onMount', 'hydrate', 'insert', '
|
|
5
|
+
export declare const RUNTIME_IMPORT_CANDIDATES: readonly ['createSignal', 'createMemo', 'createEffect', 'onCleanup', 'onMount', 'hydrate', 'insert', 'getLoopChildren', 'getLoopNodes', 'mapArray', 'mapArrayAnchored', 'mapArrayLazy', 'patchLeaf', 'createDisposableEffect', 'createComponent', 'renderChild', 'registerComponent', 'registerTemplate', 'initChild', 'upsertChild', 'createPortal', 'provideContext', 'createContext', 'useContext', 'forwardProps', 'applyRestAttrs', 'splitProps', 'spreadAttrs', 'styleToCss', 'escapeAttr', 'escapeText', 'escapeTextOrNode', 'qsa', 'qsaItem', 'qsaChildScope', 'qsaChildScopes', 'upsertChildItem', '__slot', '__bfSlot', '__bfText', 'claimSlots', 'lazySlots', 'lazyClaimSlots', 'textOrNode', 'beginTurn', 'endTurn', 'date', 'formatDate'];
|
|
6
6
|
/** @deprecated Use RUNTIME_IMPORT_CANDIDATES */
|
|
7
|
-
export declare const DOM_IMPORT_CANDIDATES: readonly ["createSignal", "createMemo", "createEffect", "onCleanup", "onMount", "hydrate", "insert", "
|
|
7
|
+
export declare const DOM_IMPORT_CANDIDATES: readonly ["createSignal", "createMemo", "createEffect", "onCleanup", "onMount", "hydrate", "insert", "getLoopChildren", "getLoopNodes", "mapArray", "mapArrayAnchored", "mapArrayLazy", "patchLeaf", "createDisposableEffect", "createComponent", "renderChild", "registerComponent", "registerTemplate", "initChild", "upsertChild", "createPortal", "provideContext", "createContext", "useContext", "forwardProps", "applyRestAttrs", "splitProps", "spreadAttrs", "styleToCss", "escapeAttr", "escapeText", "escapeTextOrNode", "qsa", "qsaItem", "qsaChildScope", "qsaChildScopes", "upsertChildItem", "__slot", "__bfSlot", "__bfText", "claimSlots", "lazySlots", "lazyClaimSlots", "textOrNode", "beginTurn", "endTurn", "date", "formatDate"];
|
|
8
8
|
export declare const RUNTIME_MODULE = "@barefootjs/client/runtime";
|
|
9
9
|
export declare const IMPORT_PLACEHOLDER = "/* __BAREFOOTJS_DOM_IMPORTS__ */";
|
|
10
10
|
export declare const MODULE_CONSTANTS_PLACEHOLDER = "/* __MODULE_LEVEL_CONSTANTS__ */";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/imports.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAU,MAAM,aAAa,CAAA;AAItD,eAAO,MAAM,yBAAyB,YACpC,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EACpE,SAAS,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/imports.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAU,MAAM,aAAa,CAAA;AAItD,eAAO,MAAM,yBAAyB,YACpC,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EACpE,SAAS,EAAE,QAAQ,EAAE,iBAAiB,EAAE,cAAc,EAAE,UAAU,EAAE,kBAAkB,EAAE,cAAc,EAAE,WAAW,EAAE,wBAAwB,EAC7I,iBAAiB,EAAE,aAAa,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,WAAW,EAAE,aAAa,EACrG,cAAc,EACd,gBAAgB,EAAE,eAAe,EAAE,YAAY,EAC/C,cAAc,EAAE,gBAAgB,EAAE,YAAY,E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**
|
|
223
223
|
* Unique id for this loop's `<!--bf-loop:<id>--> ... <!--bf-/loop:<id>-->`
|
|
224
224
|
* marker pair, threaded from `IRLoop.markerId`. Each `mapArray()` /
|
|
225
|
-
* `
|
|
225
|
+
* `mapArrayAnchored()` call passes this id so sibling loops under the
|
|
226
226
|
* same parent reconcile their own range (#1087).
|
|
227
227
|
*/
|
|
228
228
|
markerId: string;
|
|
@@ -598,6 +598,14 @@ export interface ReactiveAttribute extends AttrMeta {
|
|
|
598
598
|
export interface ClientOnlyElement {
|
|
599
599
|
slotId: string;
|
|
600
600
|
expression: string;
|
|
601
|
+
/**
|
|
602
|
+
* Slot unification Step B (`spec/slot-unification.md` §3(b), §5 Step B):
|
|
603
|
+
* copied from `IRExpression.elidedPath` (`client-only-elision.ts`) when
|
|
604
|
+
* the compiler proved this slot's marker pair can be elided. Absent
|
|
605
|
+
* (`undefined`) is always safe — the claim plan falls back to `path: []`
|
|
606
|
+
* / marker-based resolution exactly as before Step B.
|
|
607
|
+
*/
|
|
608
|
+
elidedPath?: readonly number[];
|
|
601
609
|
}
|
|
602
610
|
export interface RestAttrElement {
|
|
603
611
|
slotId: string;
|