@barefootjs/jsx 0.29.0 → 0.30.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/adapters/child-scope.d.ts +17 -0
- package/dist/adapters/child-scope.d.ts.map +1 -0
- package/dist/adapters/loop-bound-names.d.ts.map +1 -1
- package/dist/analyzer-context.d.ts.map +1 -1
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +876 -352
- package/dist/ir-to-client-js/collect-elements.d.ts +5 -25
- package/dist/ir-to-client-js/collect-elements.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/build-lazy-row.d.ts +66 -2
- package/dist/ir-to-client-js/control-flow/plan/build-lazy-row.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/build-reactive-effects.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/lazy-conditional.d.ts +92 -0
- package/dist/ir-to-client-js/control-flow/plan/lazy-conditional.d.ts.map +1 -0
- package/dist/ir-to-client-js/control-flow/plan/lazy-preamble.d.ts +134 -0
- package/dist/ir-to-client-js/control-flow/plan/lazy-preamble.d.ts.map +1 -0
- package/dist/ir-to-client-js/control-flow/plan/lazy-row-eligibility.d.ts +46 -11
- package/dist/ir-to-client-js/control-flow/plan/lazy-row-eligibility.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/reactive-effects.d.ts +7 -0
- package/dist/ir-to-client-js/control-flow/plan/reactive-effects.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/lazy-row.d.ts.map +1 -1
- package/dist/ir-to-client-js/csr-substitute.d.ts.map +1 -1
- package/dist/ir-to-client-js/html-template.d.ts +2 -3
- package/dist/ir-to-client-js/html-template.d.ts.map +1 -1
- package/dist/ir-to-client-js/plan/declaration-emit.d.ts +6 -0
- package/dist/ir-to-client-js/plan/declaration-emit.d.ts.map +1 -1
- package/dist/ir-to-client-js/reactivity.d.ts +1 -10
- package/dist/ir-to-client-js/reactivity.d.ts.map +1 -1
- package/dist/ir-to-client-js/types.d.ts +12 -0
- package/dist/ir-to-client-js/types.d.ts.map +1 -1
- package/dist/jsx-to-ir.d.ts.map +1 -1
- package/dist/rich-type-evidence.d.ts.map +1 -1
- package/dist/ssr-defaults.d.ts.map +1 -1
- package/dist/to-locale-date-lowering.d.ts.map +1 -1
- package/dist/types.d.ts +78 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/__snapshots__/doc-examples.test.ts.snap +6 -24
- package/src/__tests__/branch-loop-plain.test.ts +28 -45
- package/src/__tests__/csr-substitution-safety-divergence.test.ts +9 -3
- package/src/__tests__/csr-template-scope-soundness.test.ts +96 -0
- package/src/__tests__/early-return-branch-switch.test.ts +96 -0
- package/src/__tests__/form-control-value-ssr.test.ts +102 -0
- package/src/__tests__/lazy-conditional.test.ts +190 -0
- package/src/__tests__/lazy-preamble.test.ts +297 -0
- package/src/__tests__/lazy-row-eligibility.test.ts +97 -28
- package/src/__tests__/loop-item-root-scope.test.ts +213 -0
- package/src/__tests__/map-multi-return-body.test.ts +30 -3
- package/src/__tests__/nested-loop-conditional.test.ts +27 -6
- package/src/__tests__/preamble-attr-reactivity.test.ts +217 -0
- package/src/__tests__/preamble-declarations.test.ts +207 -0
- package/src/__tests__/ssr-defaults.test.ts +44 -0
- package/src/adapters/child-scope.ts +22 -0
- package/src/adapters/loop-bound-names.ts +6 -0
- package/src/analyzer-context.ts +43 -0
- package/src/analyzer.ts +33 -3
- package/src/index.ts +1 -0
- package/src/ir-to-client-js/collect-elements.ts +51 -10
- package/src/ir-to-client-js/control-flow/plan/build-branch-loop.ts +1 -1
- package/src/ir-to-client-js/control-flow/plan/build-composite-loop.ts +2 -2
- package/src/ir-to-client-js/control-flow/plan/build-event-delegation.ts +3 -3
- package/src/ir-to-client-js/control-flow/plan/build-inner-loop.ts +2 -2
- package/src/ir-to-client-js/control-flow/plan/build-lazy-row.ts +147 -5
- package/src/ir-to-client-js/control-flow/plan/build-loop.ts +2 -2
- package/src/ir-to-client-js/control-flow/plan/build-reactive-effects.ts +1 -0
- package/src/ir-to-client-js/control-flow/plan/lazy-conditional.ts +151 -0
- package/src/ir-to-client-js/control-flow/plan/lazy-preamble.ts +287 -0
- package/src/ir-to-client-js/control-flow/plan/lazy-row-eligibility.ts +85 -22
- package/src/ir-to-client-js/control-flow/plan/reactive-effects.ts +7 -0
- package/src/ir-to-client-js/control-flow/stringify/lazy-row.ts +133 -35
- package/src/ir-to-client-js/control-flow/stringify/reactive-effects.ts +24 -4
- package/src/ir-to-client-js/csr-substitute.ts +6 -1
- package/src/ir-to-client-js/emit-registration.ts +1 -1
- package/src/ir-to-client-js/html-template.ts +51 -40
- package/src/ir-to-client-js/index.ts +1 -1
- package/src/ir-to-client-js/plan/build-declaration-emit.ts +2 -0
- package/src/ir-to-client-js/plan/build-static-array-child-init.ts +1 -1
- package/src/ir-to-client-js/plan/declaration-emit.ts +6 -0
- package/src/ir-to-client-js/reactivity.ts +25 -0
- package/src/ir-to-client-js/stringify/declaration-emit.ts +9 -4
- package/src/ir-to-client-js/types.ts +12 -0
- package/src/jsx-to-ir.ts +400 -24
- package/src/rich-type-evidence.ts +6 -7
- package/src/ssr-defaults.ts +7 -2
- package/src/to-locale-date-lowering.ts +8 -2
- package/src/types.ts +80 -0
|
@@ -99,32 +99,12 @@ export declare function collectInnerLoops(nodes: IRNode[], siblingOffsets: Map<I
|
|
|
99
99
|
* so text effects and conditional pushes gate correctly).
|
|
100
100
|
*/
|
|
101
101
|
export declare function collectElements(node: IRNode, ctx: ClientJsContext, siblingOffsets: Map<IRLoop, IRNode[]>, insideConditional?: boolean): void;
|
|
102
|
+
export declare function collectLoopChildBindings(children: readonly IRNode[], ctx: ClientJsContext, siblingOffsets: Map<IRLoop, IRNode[]>, loopParam: string, loopParamBindings: readonly import('../types.ts').LoopParamBinding[] | undefined,
|
|
102
103
|
/**
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
* Lives in collect-elements.ts (not reactivity.ts) because it composes
|
|
108
|
-
* `collectInnerLoops` and `irToHtmlTemplate` to build per-branch metadata
|
|
109
|
-
* — a branch-summary concern rather than a reactivity-classification one.
|
|
110
|
-
* Placement here eliminates the former lazy-`require()` cycle between
|
|
111
|
-
* reactivity.ts and collect-elements.ts.
|
|
112
|
-
*/
|
|
113
|
-
/**
|
|
114
|
-
* Unified per-item bindings collector for a loop body (#1244 §B).
|
|
115
|
-
*
|
|
116
|
-
* Replaces the four pre-#1244 site-local collectors
|
|
117
|
-
* (`collectLoopChildEventsWithNesting` + `collectLoopChildReactiveAttrs`
|
|
118
|
-
* + `collectLoopChildReactiveTexts` + `collectLoopChildConditionals`)
|
|
119
|
-
* with one function that returns the full `LoopChildBindings` struct
|
|
120
|
-
* including refs. Every loop variant (`TopLevelLoop`, `BranchLoop`,
|
|
121
|
-
* `NestedLoop`) goes through this entry point so a new per-item concept
|
|
122
|
-
* is added in one place instead of replicated across three.
|
|
123
|
-
*
|
|
124
|
-
* Sibling offsets are required for `collectLoopChildConditionals` to
|
|
125
|
-
* resolve child slot ids inside nested loops; the rest of the per-item
|
|
126
|
-
* collectors don't read them but pass them through for symmetry.
|
|
104
|
+
* Names the loop's `.map()` callback preamble declares, so an attribute
|
|
105
|
+
* reading one is classified reactive (#2447 follow-up) — see
|
|
106
|
+
* `collectLoopChildReactiveAttrs`. Omitted for a loop with no preamble.
|
|
127
107
|
*/
|
|
128
|
-
|
|
108
|
+
preambleNames?: ReadonlySet<string>): LoopChildBindings;
|
|
129
109
|
export declare function collectLoopChildConditionals(node: IRNode, ctx: ClientJsContext, siblingOffsets: Map<IRLoop, IRNode[]>, loopParam?: string, loopParamBindings?: readonly import('../types.ts').LoopParamBinding[]): LoopChildConditional[];
|
|
130
110
|
//# sourceMappingURL=collect-elements.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collect-elements.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/collect-elements.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAoC,KAAK,MAAM,EAAmC,MAAM,aAAa,CAAA;AACzH,OAAO,KAAK,EAAE,eAAe,EAA+H,iBAAiB,EAA0B,oBAAoB,EAAc,UAAU,EAAE,MAAM,YAAY,CAAA;AAyGvQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CA0C7E;AAyBD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED,4DAA4D;AAC5D,eAAO,MAAM,sBAAsB,EAAE,wBAIpC,CAAA;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,EAAE,EACf,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EACrC,cAAc,CAAC,EAAE,MAAM,EACvB,GAAG,CAAC,EAAE,eAAe,EACrB,OAAO,CAAC,EAAE,wBAAwB,GACjC,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"collect-elements.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/collect-elements.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAoC,KAAK,MAAM,EAAmC,MAAM,aAAa,CAAA;AACzH,OAAO,KAAK,EAAE,eAAe,EAA+H,iBAAiB,EAA0B,oBAAoB,EAAc,UAAU,EAAE,MAAM,YAAY,CAAA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,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,eAAe,EACpB,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EACrC,SAAS,CAAC,EAAE,MAAM,EAClB,iBAAiB,CAAC,EAAE,SAAS,OAAO,aAAa,EAAE,gBAAgB,EAAE,GACpE,oBAAoB,EAAE,CA4DxB"}
|
|
@@ -32,6 +32,13 @@ export interface LazyRowAttrBinding {
|
|
|
32
32
|
ordinal: number;
|
|
33
33
|
readsItem: boolean;
|
|
34
34
|
readsOuter: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Reads a `.map()` preamble local, so every apply body this binding is
|
|
37
|
+
* emitted into must re-run the preamble first (#2447 follow-up). Per
|
|
38
|
+
* binding, not per loop, so `applyOuter` does not pay for a preamble only
|
|
39
|
+
* `applyItem`'s bindings read.
|
|
40
|
+
*/
|
|
41
|
+
readsPreamble: boolean;
|
|
35
42
|
}
|
|
36
43
|
/** One reactive text (content slot) of a lazy row. */
|
|
37
44
|
export interface LazyRowTextBinding {
|
|
@@ -45,6 +52,36 @@ export interface LazyRowTextBinding {
|
|
|
45
52
|
* (`LazyRowPlanData.textNeedsRead`).
|
|
46
53
|
*/
|
|
47
54
|
readsOuter: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Reads a `.map()` preamble local, so every apply body this binding is
|
|
57
|
+
* emitted into must re-run the preamble first (#2447 follow-up).
|
|
58
|
+
*/
|
|
59
|
+
readsPreamble: boolean;
|
|
60
|
+
}
|
|
61
|
+
/** One row conditional driven from the loop-level apply bodies (§9.5). */
|
|
62
|
+
export interface LazyRowConditionalBinding {
|
|
63
|
+
slotId: string;
|
|
64
|
+
/** Already wrapped via `wrapLoopParamAsAccessor` — reads `<param>()`. */
|
|
65
|
+
wrappedCondition: string;
|
|
66
|
+
whenTrueHtml: string;
|
|
67
|
+
whenFalseHtml: string;
|
|
68
|
+
/**
|
|
69
|
+
* Index into `entry.refs` holding the `[bf-c]` element. Always claimed ON
|
|
70
|
+
* DEMAND — `createRow` never seeds it, because the row it just cloned already
|
|
71
|
+
* rendered the correct arm and has no swap to perform.
|
|
72
|
+
*/
|
|
73
|
+
refIndex: number;
|
|
74
|
+
/** Index into `entry.last` holding this conditional's dedup boolean. */
|
|
75
|
+
ordinal: number;
|
|
76
|
+
readsItem: boolean;
|
|
77
|
+
readsOuter: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Reads a `.map()` preamble local, so every apply body this binding is
|
|
80
|
+
* emitted into must re-run the preamble first (#2447 follow-up). Per
|
|
81
|
+
* binding, not per loop, so `applyOuter` does not pay for a preamble only
|
|
82
|
+
* `applyItem`'s bindings read.
|
|
83
|
+
*/
|
|
84
|
+
readsPreamble: boolean;
|
|
48
85
|
}
|
|
49
86
|
export interface LazyRowPlanData {
|
|
50
87
|
/** Distinct attr slot ids, in declaration order — `entry.refs[0..n-1]`. */
|
|
@@ -72,8 +109,35 @@ export interface LazyRowPlanData {
|
|
|
72
109
|
* nothing per row).
|
|
73
110
|
*/
|
|
74
111
|
outerPrimeGetters: readonly string[];
|
|
75
|
-
/**
|
|
76
|
-
|
|
112
|
+
/**
|
|
113
|
+
* The row's `.map()` callback preamble as already-wrapped JS statements
|
|
114
|
+
* (`mapPreambleWrapped`), or `''` when the row has none — proven safe to run
|
|
115
|
+
* by `analyzeLazyPreamble` (§9.5 widening).
|
|
116
|
+
*
|
|
117
|
+
* `createRow` always runs it, and specifically before the clone: the
|
|
118
|
+
* non-hoisted per-row template can interpolate values the preamble declares.
|
|
119
|
+
*
|
|
120
|
+
* `applyItem` / `applyOuter` run it only when a binding they own reads a
|
|
121
|
+
* declared local (`itemNeedsPreamble` / `outerNeedsPreamble`) — which is
|
|
122
|
+
* possible as of the #2447 follow-up, where an attribute reading one became
|
|
123
|
+
* a reactive binding instead of frozen template text. Re-running is sound
|
|
124
|
+
* because `analyzeLazyPreamble` proved the statements are `const`
|
|
125
|
+
* declarations whose initializers only read the item and zero-arg signal
|
|
126
|
+
* getters, and the binding's DEPENDENCIES are the preamble's own free
|
|
127
|
+
* identifiers (substituted in `classifyLazyBinding`), so `applyOuter`
|
|
128
|
+
* primes what the preamble reads rather than the opaque local name.
|
|
129
|
+
*/
|
|
130
|
+
preambleStatements: string;
|
|
131
|
+
/** `applyItem` has a binding that reads a preamble local (#2447 follow-up). */
|
|
132
|
+
itemNeedsPreamble: boolean;
|
|
133
|
+
/** `applyOuter` has one. Separate from the above so neither body pays for the other's. */
|
|
134
|
+
outerNeedsPreamble: boolean;
|
|
135
|
+
/**
|
|
136
|
+
* Row conditionals driven from the apply bodies (§9.5, `lazy-conditional.ts`).
|
|
137
|
+
* Empty for most loops. Each arm is a static element, so the emitter hoists
|
|
138
|
+
* both parsed once per loop and clones on a flip.
|
|
139
|
+
*/
|
|
140
|
+
conditionals: readonly LazyRowConditionalBinding[];
|
|
77
141
|
}
|
|
78
142
|
export interface BuildLazyRowArgs {
|
|
79
143
|
loop: TopLevelLoop | BranchLoop;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-lazy-row.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/build-lazy-row.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"build-lazy-row.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/build-lazy-row.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAI/D,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAG/E,OAAO,EAIL,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EAEtB,MAAM,2BAA2B,CAAA;AAElC,4CAA4C;AAC5C,MAAM,WAAW,kBAA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AO,CAAA;IACtB,gCAAgC;IAChC,SAAS,EAAE,MAAM,CAAA;IACjB;;;;;OAKG;IACH,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAA;IACpC;;;;;;;;;;;;;;;;;OAiBG;IACH,kBAAkB,EAAE,MAAM,CAAA;IAC1B,+EAA+E;IAC/E,iBAAiB,EAAE,OAAO,CAAA;IAC1B,0FAA0F;IAC1F,kBAAkB,EAAE,OAAO,CAAA;IAC3B;;;;OAIG;IACH,YAAY,EAAE,SAAS,yBAAyB,EAAE,CAAA;CACnD;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,YAAY,GAAG,UAAU,CAAA;IAC/B,2EAA2E;IAC3E,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,mEAAmE;IACnE,WAAW,EAAE,MAAM,CAAA;IACnB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,mBAAmB,EAAE,MAAM,CAAA;IAC3B,QAAQ,EAAE,OAAO,GAAG,cAAc,CAAA;IAClC,eAAe,EAAE,OAAO,CAAA;IACxB,QAAQ,EAAE,OAAO,CAAA;IACjB,KAAK,EAAE,gBAAgB,GAAG,SAAS,CAAA;CACpC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,GAAG,eAAe,GAAG,IAAI,CAE/E;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,gBAAgB,GAAG;IACrD,IAAI,EAAE,eAAe,GAAG,IAAI,CAAA;IAC5B,QAAQ,EAAE,kBAAkB,CAAA;CAC7B,CAiMA;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,eAAe,GAAG,gBAAgB,CAyB5E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-reactive-effects.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/build-reactive-effects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EACV,YAAY,EAEZ,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAazD,OAAO,KAAK,EAGV,mBAAmB,EAEpB,MAAM,uBAAuB,CAAA;AAE9B,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,SAAS,qBAAqB,EAAE,CAAA;IACvC,KAAK,EAAE,SAAS,qBAAqB,EAAE,CAAA;IACvC,YAAY,EAAE,SAAS,oBAAoB,EAAE,GAAG,SAAS,CAAA;IACzD,SAAS,EAAE,MAAM,CAAA;IACjB,iBAAiB,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAA;IAC/C,2EAA2E;IAC3E,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC9B;AAED,sEAAsE;AACtE,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,wBAAwB,GAC7B,mBAAmB,
|
|
1
|
+
{"version":3,"file":"build-reactive-effects.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/build-reactive-effects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EACV,YAAY,EAEZ,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAazD,OAAO,KAAK,EAGV,mBAAmB,EAEpB,MAAM,uBAAuB,CAAA;AAE9B,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,SAAS,qBAAqB,EAAE,CAAA;IACvC,KAAK,EAAE,SAAS,qBAAqB,EAAE,CAAA;IACvC,YAAY,EAAE,SAAS,oBAAoB,EAAE,GAAG,SAAS,CAAA;IACzD,SAAS,EAAE,MAAM,CAAA;IACjB,iBAAiB,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAA;IAC/C,2EAA2E;IAC3E,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC9B;AAED,sEAAsE;AACtE,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,wBAAwB,GAC7B,mBAAmB,CA+DrB;AAsCD;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,YAAY,EAAE,oBAAoB,CAAC,EAAE,MAAM,GAAG,mBAAmB,CASnH"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Is a row's reactive conditional drivable from the LOOP-level apply bodies? —
|
|
3
|
+
* `spec/slot-unification.md` §9.5, the "row contains a reactive conditional"
|
|
4
|
+
* widening.
|
|
5
|
+
*
|
|
6
|
+
* ## Why it was refused wholesale
|
|
7
|
+
*
|
|
8
|
+
* The eager emission calls `insert(__el, 'sN', () => cond, trueArm, falseArm)`
|
|
9
|
+
* once per row. `insert` creates **one `createEffect` per call**, plus it probes
|
|
10
|
+
* both branch templates at runtime to decide element-vs-fragment form, resolves
|
|
11
|
+
* a search region, and manages per-branch `bindEvents` cleanup. Calling it from
|
|
12
|
+
* a lazy row would reinstate exactly the per-row reactive resource the lazy row
|
|
13
|
+
* graph exists to remove — so the gate refused any row with a conditional at
|
|
14
|
+
* all.
|
|
15
|
+
*
|
|
16
|
+
* ## What this accepts, and why that is the whole job
|
|
17
|
+
*
|
|
18
|
+
* For the narrow case where **both arms are wiring-free static elements**,
|
|
19
|
+
* everything `insert` does collapses to one operation: replace the
|
|
20
|
+
* `[bf-c="sN"]` element with the other arm's markup when the condition flips.
|
|
21
|
+
* No `bindEvents`, no branch cleanup, no auto-focus, no `__bfSlot` live-node
|
|
22
|
+
* splicing — those all exist for arms that own something, and these arms own
|
|
23
|
+
* nothing.
|
|
24
|
+
*
|
|
25
|
+
* That case needs no runtime helper. Both arms are compile-time constants, so
|
|
26
|
+
* each is parsed ONCE per loop into a hoisted `<template>` and cloned per swap,
|
|
27
|
+
* the same trick the row template already uses. What is left per row is a
|
|
28
|
+
* boolean, a dedup slot, and a `replaceWith` — which the existing
|
|
29
|
+
* `applyItem`/`applyOuter` bodies can carry directly.
|
|
30
|
+
*
|
|
31
|
+
* ## The four things that must be proven
|
|
32
|
+
*
|
|
33
|
+
* 1. **Both arms are wiring-free.** Every `LoopChildBranchSummary` collection
|
|
34
|
+
* must be empty. A single reactive text inside an arm means the arm's
|
|
35
|
+
* content has to track the item, which needs wiring this shape has no place
|
|
36
|
+
* for.
|
|
37
|
+
* 2. **Both arms are ELEMENT conditionals.** The caller passes each arm through
|
|
38
|
+
* `addCondAttrToTemplate` — the same door the eager emission uses — which
|
|
39
|
+
* injects `bf-c="<slotId>"` on a single root element and otherwise wraps the
|
|
40
|
+
* arm in `<!--bf-cond-start:id-->` markers. So the two forms are told apart
|
|
41
|
+
* by reading its output, not by re-deciding here. A FRAGMENT conditional
|
|
42
|
+
* spans a sibling range with no single node to replace, which is why
|
|
43
|
+
* `insert` carries a second code path for it.
|
|
44
|
+
* 3. **Both arms' HTML is static.** The arm strings are emitted inside a
|
|
45
|
+
* template literal, so an interpolation survives as `${…}`. Anything
|
|
46
|
+
* containing one is refused — it would have to be re-evaluated per row,
|
|
47
|
+
* defeating the hoist. (A literal `${` in authored TEXT would also refuse
|
|
48
|
+
* here; that is the safe direction — a false refusal costs the eager
|
|
49
|
+
* fallback, a false accept would ship a frozen arm.)
|
|
50
|
+
* 4. **The condition does not read the loop INDEX.** `applyItem` and
|
|
51
|
+
* `applyOuter` have no index parameter, the same reason
|
|
52
|
+
* `ClassifiedLazyBinding.referencesIndex` refuses a binding.
|
|
53
|
+
*
|
|
54
|
+
* Everything refused carries a specific reason, which `lazyRowEligibility`
|
|
55
|
+
* passes through unchanged.
|
|
56
|
+
*/
|
|
57
|
+
import type { LoopChildConditional } from '../../types.ts';
|
|
58
|
+
/** The prepared arm markup the caller hands in, and this module vets. */
|
|
59
|
+
export interface PreparedArms {
|
|
60
|
+
/**
|
|
61
|
+
* Loop-param wrapped and passed through `addCondAttrToTemplate`, i.e. exactly
|
|
62
|
+
* the strings the eager path would emit. Vetting the PREPARED form is the
|
|
63
|
+
* point: the raw `IRLoop` arm HTML carries no `bf-c` at all, so an
|
|
64
|
+
* element-vs-fragment decision made on it would be guesswork.
|
|
65
|
+
*/
|
|
66
|
+
whenTrueHtml: string;
|
|
67
|
+
whenFalseHtml: string;
|
|
68
|
+
}
|
|
69
|
+
/** A row conditional the loop-level apply bodies can drive. */
|
|
70
|
+
export interface LazyConditionalFacts {
|
|
71
|
+
slotId: string;
|
|
72
|
+
/** Condition expression, NOT yet loop-param wrapped (the caller wraps). */
|
|
73
|
+
condition: string;
|
|
74
|
+
/** Arm markup, static by construction — hoisted and cloned per swap. */
|
|
75
|
+
whenTrueHtml: string;
|
|
76
|
+
whenFalseHtml: string;
|
|
77
|
+
}
|
|
78
|
+
export type LazyConditionalAnalysis = {
|
|
79
|
+
lazySafe: true;
|
|
80
|
+
facts: LazyConditionalFacts;
|
|
81
|
+
} | {
|
|
82
|
+
lazySafe: false;
|
|
83
|
+
reason: string;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Decide whether `cond` can be driven from the loop-level apply bodies.
|
|
87
|
+
*
|
|
88
|
+
* `indexParam` is the loop's index parameter name as the emitter uses it
|
|
89
|
+
* (`elem.index || '__idx'`); a condition reading it is refused.
|
|
90
|
+
*/
|
|
91
|
+
export declare function analyzeLazyConditional(cond: LoopChildConditional, indexParam: string, arms: PreparedArms): LazyConditionalAnalysis;
|
|
92
|
+
//# sourceMappingURL=lazy-conditional.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazy-conditional.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/lazy-conditional.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AAEH,OAAO,KAAK,EAA0B,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAElF,yEAAyE;AACzE,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,+DAA+D;AAC/D,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAA;IACd,2EAA2E;IAC3E,SAAS,EAAE,MAAM,CAAA;IACjB,wEAAwE;IACxE,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,MAAM,uBAAuB,GAC/B;IAAE,QAAQ,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,oBAAoB,CAAA;CAAE,GAC/C;IAAE,QAAQ,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAgBvC;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,oBAAoB,EAC1B,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,YAAY,GACjB,uBAAuB,CAyCzB"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Is a `.map()` callback preamble safe to run inside a LAZY row's apply
|
|
3
|
+
* bodies? — `spec/slot-unification.md` §9.5, the "row has a map-callback
|
|
4
|
+
* preamble" widening.
|
|
5
|
+
*
|
|
6
|
+
* ## Why the old rule was "any preamble at all"
|
|
7
|
+
*
|
|
8
|
+
* The eager emission runs the preamble ONCE per row, inside `renderItem`.
|
|
9
|
+
* The lazy emission has no per-row body — a row's writes are split across
|
|
10
|
+
* `createRow` / `applyItem` / `applyOuter`, each a separate function called
|
|
11
|
+
* at a different time. To let a binding read a preamble-declared local, the
|
|
12
|
+
* preamble's statements have to be re-executed at the top of every body that
|
|
13
|
+
* needs them. Two things follow, and both have to be PROVEN, not assumed:
|
|
14
|
+
*
|
|
15
|
+
* 1. **Re-execution must be observationally free.** Running the statements
|
|
16
|
+
* three times instead of once is only sound if they have no effects and
|
|
17
|
+
* allocate nothing whose identity is load-bearing. A preamble declaring a
|
|
18
|
+
* signal (`const [x, setX] = createSignal(0)`) would mint a NEW signal on
|
|
19
|
+
* every apply — the row would silently lose its state.
|
|
20
|
+
* 2. **No reactive binding may read a preamble local.** A binding's
|
|
21
|
+
* dependency set is its own free identifiers; a preamble local hides
|
|
22
|
+
* whatever the preamble read (`const cls = selected() === row.id ? …`),
|
|
23
|
+
* so classifying `cls` on its own name would put the binding in
|
|
24
|
+
* `applyItem` only and the row would never react to `selected()`.
|
|
25
|
+
*
|
|
26
|
+
* That case is REFUSED rather than modelled, because it is currently
|
|
27
|
+
* unreachable and paying for unreachable machinery is how a gate rots: a
|
|
28
|
+
* preamble local read in CHILD position becomes a `preambleRegions` entry
|
|
29
|
+
* (`IRLoop.preambleRegions`, #2389) which the gate already refuses on its
|
|
30
|
+
* own, and one read in ATTRIBUTE position is not classified as reactive at
|
|
31
|
+
* all, so it is interpolated into the row template and never becomes a
|
|
32
|
+
* `reactiveAttrs` binding. `lazyRowEligibility` therefore refuses any
|
|
33
|
+
* binding whose free identifiers touch `declaredNames`, and that refusal
|
|
34
|
+
* is what keeps this sound if either of those two facts ever changes.
|
|
35
|
+
*
|
|
36
|
+
* ## The proof this module accepts
|
|
37
|
+
*
|
|
38
|
+
* Deliberately narrow, and structural — no regex, per the repo rule. A
|
|
39
|
+
* preamble qualifies only when it is a sequence of `const` declarations whose
|
|
40
|
+
* initializers cannot do anything:
|
|
41
|
+
*
|
|
42
|
+
* - Every statement is a `const` `VariableStatement`. A `let` can be
|
|
43
|
+
* reassigned by a later statement, a `function`/`class` declaration is a
|
|
44
|
+
* fresh object per run, and any other statement kind (an `if`, a bare
|
|
45
|
+
* call, a `for`) is either an effect or control flow this analysis does
|
|
46
|
+
* not model.
|
|
47
|
+
* - Every declaration has an initializer, and that initializer contains no
|
|
48
|
+
* `new`, tagged template, assignment, `++`/`--`, `await`, `yield`,
|
|
49
|
+
* `delete`, or function/arrow/class expression.
|
|
50
|
+
* - **Calls are refused with ONE exception: a zero-argument call to a
|
|
51
|
+
* component signal or memo getter.** That exception is the whole point —
|
|
52
|
+
* `const cls = selected() === row.id ? 'on' : 'off'` is the shape the
|
|
53
|
+
* krausest bench writes, and a signal read is pure, deterministic, and
|
|
54
|
+
* already the unit this design primes and subscribes to. Every other call
|
|
55
|
+
* stays refused: `createSignal` is a call, `arr.push(x)` is a call,
|
|
56
|
+
* `Math.random()` is a call whose value would differ between `createRow`
|
|
57
|
+
* and `applyItem`, and an ordinary-looking local can hide a reactive
|
|
58
|
+
* accessor behind one (`isSelected(row.id)` — see `classifyLazyBinding`'s
|
|
59
|
+
* note) which this emitter cannot prime.
|
|
60
|
+
*
|
|
61
|
+
* The signal read is sound in all three bodies because of where they run:
|
|
62
|
+
* `createRow` and `applyItem` are wrapped in `untrack()` by `mapArrayLazy`,
|
|
63
|
+
* so a read there subscribes nothing, and `applyOuter` IS the loop-level
|
|
64
|
+
* effect that is supposed to subscribe. A preamble-declared local therefore
|
|
65
|
+
* behaves exactly like a binding expression that read the same signal
|
|
66
|
+
* directly.
|
|
67
|
+
* - No `jsx` segment. A JSX leaf in the preamble means the row accumulates
|
|
68
|
+
* markup, which is `preambleRegions` territory (refused separately).
|
|
69
|
+
* - No `builderNames`. Same shape as above, pinned explicitly so the reason
|
|
70
|
+
* names it rather than surfacing as a confusing "contains a call".
|
|
71
|
+
* - The preamble does not read the loop's INDEX parameter. `applyItem` and
|
|
72
|
+
* `applyOuter` have no index to give it — the same reason
|
|
73
|
+
* `ClassifiedLazyBinding.referencesIndex` refuses a binding.
|
|
74
|
+
*
|
|
75
|
+
* Member access is deliberately NOT banned even though a getter could in
|
|
76
|
+
* principle run code: a binding expression like `class={row.cls}` is already
|
|
77
|
+
* re-evaluated on every apply by design, so a call-free preamble is exactly
|
|
78
|
+
* the same risk class as the emission this feature extends. Banning member
|
|
79
|
+
* access would reject every useful preamble and buy no real guarantee.
|
|
80
|
+
*
|
|
81
|
+
* Everything refused carries a specific reason — `lazyRowEligibility` passes
|
|
82
|
+
* it straight through, so a unit test naming the shape gets a diagnosable
|
|
83
|
+
* failure instead of a silent fallback to eager emission.
|
|
84
|
+
*/
|
|
85
|
+
import { type MapCallbackPreamble } from '../../../types.ts';
|
|
86
|
+
/** What the gate and the binding classifier need to know about a preamble. */
|
|
87
|
+
export interface LazyPreambleFacts {
|
|
88
|
+
/**
|
|
89
|
+
* Names the preamble declares. A binding naming one of these is reading a
|
|
90
|
+
* ROW-LOCAL value, not an outer one — and the name SHADOWS any
|
|
91
|
+
* component-scope signal/const of the same name, which is why
|
|
92
|
+
* `classifyLazyBinding` substitutes rather than falling through to the
|
|
93
|
+
* component scope.
|
|
94
|
+
*/
|
|
95
|
+
declaredNames: ReadonlySet<string>;
|
|
96
|
+
/**
|
|
97
|
+
* What the preamble itself reads — its free identifiers, minus the names it
|
|
98
|
+
* declares. This is the SUBSTITUTION set: a binding that names a preamble
|
|
99
|
+
* local inherits these as its own dependencies, because that is literally
|
|
100
|
+
* what the value depends on.
|
|
101
|
+
*
|
|
102
|
+
* Returned as raw names, unclassified, on purpose. Deciding which are row
|
|
103
|
+
* locals, which are primable getters, and which are opaque needs the loop's
|
|
104
|
+
* `rowLocalNames` / `indexParam` / `LazyRowScopeInfo`, none of which this
|
|
105
|
+
* module has — and re-deriving that judgement here would be a second copy
|
|
106
|
+
* of `classifyLazyBinding`'s rules, free to drift from the one the emitter
|
|
107
|
+
* actually primes against. So the names go back unjudged and run through
|
|
108
|
+
* the SAME loop a binding's own identifiers do.
|
|
109
|
+
*/
|
|
110
|
+
freeNames: ReadonlySet<string>;
|
|
111
|
+
}
|
|
112
|
+
export type LazyPreambleAnalysis = {
|
|
113
|
+
lazySafe: true;
|
|
114
|
+
facts: LazyPreambleFacts;
|
|
115
|
+
} | {
|
|
116
|
+
lazySafe: false;
|
|
117
|
+
reason: string;
|
|
118
|
+
};
|
|
119
|
+
/** No preamble at all — nothing to prove, nothing to substitute. */
|
|
120
|
+
export declare const NO_PREAMBLE: LazyPreambleAnalysis;
|
|
121
|
+
/**
|
|
122
|
+
* Decide whether `preamble` may be re-executed inside a lazy row's apply
|
|
123
|
+
* bodies, and if so what it declares and reads.
|
|
124
|
+
*
|
|
125
|
+
* `indexParam` is the loop's index parameter name as the emitter uses it
|
|
126
|
+
* (`elem.index || '__idx'`); a preamble reading it is refused.
|
|
127
|
+
*
|
|
128
|
+
* `primableNames` are the component's signal getters and memos — the only
|
|
129
|
+
* callees a preamble initializer may invoke (see the module docstring). Pass
|
|
130
|
+
* the same names `LazyRowScopeInfo` carries, so "primable here" and "primable
|
|
131
|
+
* in `classifyLazyBinding`" cannot drift.
|
|
132
|
+
*/
|
|
133
|
+
export declare function analyzeLazyPreamble(preamble: MapCallbackPreamble | undefined, indexParam: string, primableNames: ReadonlySet<string>): LazyPreambleAnalysis;
|
|
134
|
+
//# sourceMappingURL=lazy-preamble.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazy-preamble.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/lazy-preamble.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmFG;AAGH,OAAO,EAAwB,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAGlF,8EAA8E;AAC9E,MAAM,WAAW,iBAAiB;IAChC;;;;;;OAMG;IACH,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAClC;;;;;;;;;;;;;OAaG;IACH,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAC/B;AAED,MAAM,MAAM,oBAAoB,GAC5B;IAAE,QAAQ,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,iBAAiB,CAAA;CAAE,GAC5C;IAAE,QAAQ,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAEvC,oEAAoE;AACpE,eAAO,MAAM,WAAW,EAAE,oBAGzB,CAAA;AAID;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,mBAAmB,GAAG,SAAS,EACzC,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,GACjC,oBAAoB,CAkEtB"}
|
|
@@ -16,15 +16,21 @@
|
|
|
16
16
|
* "widen later" decision, never a correctness compromise:
|
|
17
17
|
*
|
|
18
18
|
* 1. **Shape** (§9.4 "plain loop-row shape"): non-anchored, non-flatMap,
|
|
19
|
-
* single-root, keyed,
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
19
|
+
* single-root, keyed, ref-free, no nested components or inner loops. A
|
|
20
|
+
* reactive CONDITIONAL is allowed when `analyzeLazyConditional`
|
|
21
|
+
* (`lazy-conditional.ts`) proves both arms are wiring-free static elements,
|
|
22
|
+
* which reduces the per-row `insert()` effect to a `replaceWith` the apply
|
|
23
|
+
* bodies can carry; anything else refuses with that analysis's reason.
|
|
24
|
+
* 2. **A preamble must be provably re-runnable.** The lazy emission has no
|
|
25
|
+
* single per-row body, so a preamble-declared local only exists if the
|
|
26
|
+
* preamble's statements are re-executed at the top of each apply body
|
|
27
|
+
* that reads one. `analyzeLazyPreamble` (`lazy-preamble.ts`) proves that
|
|
28
|
+
* structurally — `const` declarations whose initializers do nothing but
|
|
29
|
+
* read the item and zero-arg signal getters — and hands back the declared
|
|
30
|
+
* names. The gate consumes its verdict as a pre-computed
|
|
31
|
+
* `mapPreambleRefusal` string so this function stays pure data-in/data-out.
|
|
32
|
+
* A binding that READS a declared local still refuses (see the per-binding
|
|
33
|
+
* gate), and so does any `preambleRegions` entry (§9.5, a separate row).
|
|
28
34
|
* 3. **Every reactive outer dependency must be primable.** `mapArrayLazy`
|
|
29
35
|
* creates ONE loop-level effect for `applyOuter`; that effect subscribes
|
|
30
36
|
* only to what its body reads, and its body must read the outer signals
|
|
@@ -62,6 +68,7 @@
|
|
|
62
68
|
* loop-level effect would make every binding on every row share one
|
|
63
69
|
* `#binding:<slotId>` id.
|
|
64
70
|
*/
|
|
71
|
+
import type { LazyPreambleFacts } from './lazy-preamble.ts';
|
|
65
72
|
/** Facts about one component signal needed by the §9.3(2) source gate. */
|
|
66
73
|
export interface LazyRowSignalFacts {
|
|
67
74
|
/**
|
|
@@ -127,6 +134,13 @@ export interface ClassifiedLazyBinding {
|
|
|
127
134
|
opaqueOuterNames: readonly string[];
|
|
128
135
|
/** References the loop's index parameter — `applyItem`/`applyOuter` have no index. */
|
|
129
136
|
referencesIndex: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Names a preamble-declared local, so every apply body this binding is
|
|
139
|
+
* emitted into must re-run the preamble first. Tracked per binding rather
|
|
140
|
+
* than per loop so `applyOuter` does not pay for a preamble only
|
|
141
|
+
* `applyItem`'s bindings read (`stringify/lazy-row.ts`).
|
|
142
|
+
*/
|
|
143
|
+
readsPreamble: boolean;
|
|
130
144
|
}
|
|
131
145
|
/** §9.4 shape facts, read off the loop plan / IR by the caller. */
|
|
132
146
|
export interface LazyRowShapeFacts {
|
|
@@ -137,12 +151,24 @@ export interface LazyRowShapeFacts {
|
|
|
137
151
|
bodyIsMultiRoot: boolean;
|
|
138
152
|
/** `LoopCore.key != null` — index-keyed loops are ineligible in v1 (§9.4). */
|
|
139
153
|
hasExplicitKey: boolean;
|
|
140
|
-
|
|
154
|
+
/**
|
|
155
|
+
* `analyzeLazyConditional`'s refusal reason for the FIRST row conditional it
|
|
156
|
+
* rejects, or `null` when the row has none or all of them can be driven from
|
|
157
|
+
* the apply bodies (`lazy-conditional.ts`). A string here is emitted verbatim
|
|
158
|
+
* as the gate's reason.
|
|
159
|
+
*/
|
|
160
|
+
conditionalRefusal: string | null;
|
|
141
161
|
childRefCount: number;
|
|
142
162
|
nestedComponentCount: number;
|
|
143
163
|
innerLoopCount: number;
|
|
144
164
|
hasChildComponent: boolean;
|
|
145
|
-
|
|
165
|
+
/**
|
|
166
|
+
* `analyzeLazyPreamble`'s refusal reason, or `null` when the row has no
|
|
167
|
+
* preamble or has one that is provably safe to re-run in the apply bodies
|
|
168
|
+
* (`lazy-preamble.ts`). A string here is emitted verbatim as the gate's
|
|
169
|
+
* reason — the analysis, not this function, knows what was wrong.
|
|
170
|
+
*/
|
|
171
|
+
mapPreambleRefusal: string | null;
|
|
146
172
|
preambleRegionCount: number;
|
|
147
173
|
/** A destructured loop param with no `paramBindings` (snapshot unwrap). */
|
|
148
174
|
hasParamUnwrap: boolean;
|
|
@@ -190,6 +216,13 @@ export declare function lazyRowEligibility(args: LazyRowEligibilityArgs): LazyRo
|
|
|
190
216
|
* subscribe (see module docstring, restriction 3). So the fail-safe direction
|
|
191
217
|
* is preserved (maximally conservative classification) while the emission
|
|
192
218
|
* refuses loudly instead of shipping a dead effect.
|
|
219
|
+
*
|
|
220
|
+
* **Preamble locals are flagged, not resolved.** A name the preamble declares
|
|
221
|
+
* hides whatever the preamble read, so classifying it against the component
|
|
222
|
+
* scope would name the wrong dependency (and would silently treat a shadowed
|
|
223
|
+
* signal as the outer one). `readsPreamble` records the fact and
|
|
224
|
+
* `lazyRowEligibility` refuses the loop — see `lazy-preamble.ts` for why that
|
|
225
|
+
* case is currently unreachable and why the refusal is still the right shape.
|
|
193
226
|
*/
|
|
194
227
|
export declare function classifyLazyBinding(args: {
|
|
195
228
|
kind: 'attr' | 'text';
|
|
@@ -199,5 +232,7 @@ export declare function classifyLazyBinding(args: {
|
|
|
199
232
|
rowLocalNames: ReadonlySet<string>;
|
|
200
233
|
indexParam: string;
|
|
201
234
|
scope: LazyRowScopeInfo;
|
|
235
|
+
/** Proven-safe preamble facts, or the empty set pair when there is none. */
|
|
236
|
+
preamble?: LazyPreambleFacts;
|
|
202
237
|
}): ClassifiedLazyBinding;
|
|
203
238
|
//# sourceMappingURL=lazy-row-eligibility.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy-row-eligibility.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/lazy-row-eligibility.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"lazy-row-eligibility.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/lazy-row-eligibility.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAE3D,0EAA0E;AAC1E,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,0BAA0B,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,CAAA;CACvD;AAED,6DAA6D;AAC7D,MAAM,WAAW,gBAAgB;IAC/B,8CAA8C;IAC9C,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAA;IAChD,8DAA8D;IAC9D,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC1B,+FAA+F;IAC/F,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC1B;;;;;OAKG;IACH,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAA;IAC1D;;;;;OAKG;IACH,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC1B,yCAAyC;IACzC,OAAO,EAAE,OAAO,CAAA;CACjB;AA6BD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,cAAc,CAAA;AAE9C,yEAAyE;AACzE,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;IACrB,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,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAIvC;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,sBAAsB,GAAG,kBAAkB,CAoFnF;AAsDD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IACxC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;IACrB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,CAAA;IAChC,oEAAoE;IACpE,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAClC,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,gBAAgB,CAAA;IACvB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,iBAAiB,CAAA;CAC7B,GAAG,qBAAqB,CA8FxB"}
|
|
@@ -17,6 +17,13 @@ export interface ReactiveAttrEffect {
|
|
|
17
17
|
wrappedExpression: string;
|
|
18
18
|
/** Pre-copied attr metadata used by emitAttrUpdate. */
|
|
19
19
|
meta: AttrMeta;
|
|
20
|
+
/**
|
|
21
|
+
* `wrappedExpression` reads a `.map()` callback preamble local (#2447
|
|
22
|
+
* follow-up), so the emitter must run the preamble ahead of this write —
|
|
23
|
+
* the local is not otherwise in scope in the update body, and its value
|
|
24
|
+
* is what makes the attribute reactive at all.
|
|
25
|
+
*/
|
|
26
|
+
readsPreamble?: boolean;
|
|
20
27
|
}
|
|
21
28
|
/** Reactive attrs grouped by child slot (one qsa lookup per slot). */
|
|
22
29
|
export interface ReactiveAttrSlot {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactive-effects.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/reactive-effects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAE3D,mEAAmE;AACnE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAA;IAChB,iEAAiE;IACjE,iBAAiB,EAAE,MAAM,CAAA;IACzB,uDAAuD;IACvD,IAAI,EAAE,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"reactive-effects.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/reactive-effects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAE3D,mEAAmE;AACnE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAA;IAChB,iEAAiE;IACjE,iBAAiB,EAAE,MAAM,CAAA;IACzB,uDAAuD;IACvD,IAAI,EAAE,QAAQ,CAAA;IACd;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,sEAAsE;AACtE,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,SAAS,kBAAkB,EAAE,CAAA;CACrC;AAED,sEAAsE;AACtE,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAA;IACd,iEAAiE;IACjE,iBAAiB,EAAE,MAAM,CAAA;CAC1B;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAA;IACd,8EAA8E;IAC9E,gBAAgB,EAAE,MAAM,CAAA;IACxB,6EAA6E;IAC7E,oBAAoB,EAAE,MAAM,CAAA;IAC5B,wDAAwD;IACxD,qBAAqB,EAAE,MAAM,CAAA;IAC7B,WAAW,EAAE,gBAAgB,CAAA;IAC7B,YAAY,EAAE,gBAAgB,CAAA;CAC/B;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,SAAS,gBAAgB,EAAE,CAAA;IACtC,gFAAgF;IAChF,UAAU,EAAE,SAAS,kBAAkB,EAAE,CAAA;IACzC,YAAY,EAAE,SAAS,qBAAqB,EAAE,CAAA;IAC9C;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC9B"}
|
|
@@ -1 +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,
|
|
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,EACV,kBAAkB,EAElB,eAAe,EAEhB,MAAM,2BAA2B,CAAA;AAElC,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,E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S,QAAQ,EAAE,EAC1B,eAAe,EAAE,MAAM,GAAG,IAAI,GAC7B,MAAM,CA2BR"}
|
|
@@ -135,7 +135,7 @@ export declare function flatMapCallbackHasKeyedLeaf(cb: Pick<FlatMapCallback, 's
|
|
|
135
135
|
export declare function renderFlatMapProjectionClientBody(inner: Extract<IRNode, {
|
|
136
136
|
type: 'loop';
|
|
137
137
|
}>, restSpreadNames?: Set<string>): string;
|
|
138
|
-
export declare function irToHtmlTemplate(node: IRNode, restSpreadNames?: Set<string>, loopDepth?: number, loopParams?: ReadonlyArray<string | LoopParamSpec>, branchSlotsVar?: string,
|
|
138
|
+
export declare function irToHtmlTemplate(node: IRNode, restSpreadNames?: Set<string>, loopDepth?: number, loopParams?: ReadonlyArray<string | LoopParamSpec>, branchSlotsVar?: string, inHoistedChildren?: boolean): string;
|
|
139
139
|
/**
|
|
140
140
|
* Slots a top-level (`mapArray`-driven) loop body proves safe to hoist into a
|
|
141
141
|
* shared, once-per-loop template (perf: avoid per-row `document.createElement
|
|
@@ -284,7 +284,6 @@ export interface TemplateOptions {
|
|
|
284
284
|
* `compute-inlinability` (#1277).
|
|
285
285
|
*/
|
|
286
286
|
csrEnv?: CsrEnv;
|
|
287
|
-
insideLoop?: boolean;
|
|
288
287
|
loopDepth?: number;
|
|
289
288
|
/**
|
|
290
289
|
* Names bound by the ENCLOSING loops' callback params (item / index /
|
|
@@ -364,7 +363,7 @@ export declare function canGenerateStaticTemplate(node: IRNode, propNames: Set<s
|
|
|
364
363
|
* @param inlinableConstants - Map of constant names to their resolved CSR values
|
|
365
364
|
* @param ctx - ClientJsContext supplying signals/memos for `csrSubstitute`
|
|
366
365
|
*/
|
|
367
|
-
export declare function generateCsrTemplate(node: IRNode, inlinableConstants: Map<string, string> | undefined, ctx: ClientJsContext,
|
|
366
|
+
export declare function generateCsrTemplate(node: IRNode, inlinableConstants: Map<string, string> | undefined, ctx: ClientJsContext, restSpreadNames?: Set<string>, propsObjectName?: string | null, unsafeLocalNames?: Set<string>, deferredChildSlots?: ReadonlySet<string>): string;
|
|
368
367
|
/**
|
|
369
368
|
* Walk the component IR and collect the slot ids of DIRECT child
|
|
370
369
|
* components whose render must be deferred to init because at least one
|
|
@@ -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;
|
|
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;AAKjD;;;;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,GAAG,MAAM,EAAE,CAwBnE;AAED;;;;;GAKG;AACH,wBAAgB,kCAAkC,IAAI;IACpD,OAAO,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,M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AAC,GAAG,SAAS,EACjD,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,GAC9B,GAAG,CAAC,MAAM,CAAC,CAoDb;AA2VD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,OAAO,CAiBpF"}
|
|
@@ -25,6 +25,12 @@ export interface SignalEmitPlan {
|
|
|
25
25
|
getter: string;
|
|
26
26
|
/** Setter identifier — `null` for read-only signals. */
|
|
27
27
|
setter: string | null;
|
|
28
|
+
/**
|
|
29
|
+
* Source used the getter-elided form (`const [, setX] = ...`). `getter`
|
|
30
|
+
* holds the synthesized internal name (see `SignalInfo.getterElided`);
|
|
31
|
+
* stringify reproduces the source's hole instead of emitting it.
|
|
32
|
+
*/
|
|
33
|
+
getterElided?: boolean;
|
|
28
34
|
/**
|
|
29
35
|
* Fully-resolved initial value expression. Prop rewrites
|
|
30
36
|
* (`<propsName>.X` → `_p.X`) and `?? <default>` insertions for controlled
|