@barefootjs/jsx 0.31.3 → 0.31.4
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/jsx-adapter.d.ts.map +1 -1
- package/dist/adapters/template-imports.d.ts +27 -15
- package/dist/adapters/template-imports.d.ts.map +1 -1
- package/dist/debug.d.ts.map +1 -1
- package/dist/identifier-pattern.d.ts +62 -0
- package/dist/identifier-pattern.d.ts.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +226 -163
- package/dist/ir-to-client-js/collect-elements.d.ts +23 -2
- package/dist/ir-to-client-js/collect-elements.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/build-event-delegation.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/event-delegation.d.ts.map +1 -1
- package/dist/ir-to-client-js/csr-substitute.d.ts +12 -1
- package/dist/ir-to-client-js/csr-substitute.d.ts.map +1 -1
- package/dist/ir-to-client-js/html-template.d.ts +20 -12
- package/dist/ir-to-client-js/html-template.d.ts.map +1 -1
- package/dist/ir-to-client-js/imports.d.ts.map +1 -1
- package/dist/ir-to-client-js/prop-handling.d.ts +25 -2
- package/dist/ir-to-client-js/prop-handling.d.ts.map +1 -1
- package/dist/ir-to-client-js/reactivity.d.ts +30 -2
- package/dist/ir-to-client-js/reactivity.d.ts.map +1 -1
- package/dist/ir-to-client-js/rewrite-props-object.d.ts.map +1 -1
- package/dist/ir-to-client-js/utils.d.ts.map +1 -1
- package/dist/jsx-to-ir.d.ts.map +1 -1
- package/dist/module-exports.d.ts.map +1 -1
- package/dist/relocate.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/binding-scope-ratchet.test.ts +1 -1
- package/src/__tests__/csr-materialize-loop-preamble-shadow.test.ts +76 -0
- package/src/__tests__/csr-substitute-enclosing-scope.test.ts +77 -0
- package/src/__tests__/identifier-pattern.test.ts +170 -0
- package/src/__tests__/loop-child-reactive-attr-const-shadow.test.ts +107 -0
- package/src/__tests__/rewrite-dynamic-imports.test.ts +98 -0
- package/src/adapters/jsx-adapter.ts +2 -1
- package/src/adapters/template-imports.ts +93 -0
- package/src/debug.ts +4 -3
- package/src/identifier-pattern.ts +79 -0
- package/src/index.ts +1 -1
- package/src/ir-to-client-js/collect-elements.ts +44 -15
- package/src/ir-to-client-js/control-flow/plan/build-event-delegation.ts +2 -1
- package/src/ir-to-client-js/control-flow/stringify/event-delegation.ts +2 -1
- package/src/ir-to-client-js/csr-substitute.ts +19 -2
- package/src/ir-to-client-js/html-template.ts +37 -31
- package/src/ir-to-client-js/imports.ts +2 -1
- package/src/ir-to-client-js/prop-handling.ts +28 -1
- package/src/ir-to-client-js/reactivity.ts +54 -4
- package/src/ir-to-client-js/rewrite-props-object.ts +2 -1
- package/src/ir-to-client-js/utils.ts +9 -8
- package/src/jsx-to-ir.ts +18 -9
- package/src/module-exports.ts +3 -2
- package/src/relocate.ts +2 -1
|
@@ -105,6 +105,27 @@ export declare function collectLoopChildBindings(children: readonly IRNode[], ct
|
|
|
105
105
|
* reading one is classified reactive (#2447 follow-up) — see
|
|
106
106
|
* `collectLoopChildReactiveAttrs`. Omitted for a loop with no preamble.
|
|
107
107
|
*/
|
|
108
|
-
preambleNames?: ReadonlySet<string
|
|
109
|
-
|
|
108
|
+
preambleNames?: ReadonlySet<string>,
|
|
109
|
+
/**
|
|
110
|
+
* The loop's index param name (`.map((item, i) => ...)`'s `i`), when
|
|
111
|
+
* present — folded into the shadow guard (Copilot review on #2595) so
|
|
112
|
+
* an index-shadowing const doesn't get const-folded either.
|
|
113
|
+
*/
|
|
114
|
+
loopIndex?: string | null): LoopChildBindings;
|
|
115
|
+
export declare function collectLoopChildConditionals(node: IRNode, ctx: ClientJsContext, siblingOffsets: Map<IRLoop, IRNode[]>, loopParam?: string, loopParamBindings?: readonly import('../types.ts').LoopParamBinding[],
|
|
116
|
+
/**
|
|
117
|
+
* The enclosing loop's `.map()` callback preamble locals (#2447), when
|
|
118
|
+
* known — folded into the `expandConstantForReactivity` shadow guard
|
|
119
|
+
* (#2482 Stage 1b) so a preamble local shadowing a component/module
|
|
120
|
+
* const doesn't get const-folded into the condition, which would
|
|
121
|
+
* corrupt `classifyReactivity`'s verdict below (a substituted literal
|
|
122
|
+
* reads as "not reactive," silently freezing the branch at its initial
|
|
123
|
+
* value instead of wiring an `insert()`).
|
|
124
|
+
*/
|
|
125
|
+
preambleNames?: ReadonlySet<string>,
|
|
126
|
+
/**
|
|
127
|
+
* The loop's index param name, when present — see
|
|
128
|
+
* `collectLoopChildBindings`'s doc comment (Copilot review on #2595).
|
|
129
|
+
*/
|
|
130
|
+
loopIndex?: string | null): LoopChildConditional[];
|
|
110
131
|
//# 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;
|
|
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;AA0GvQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CA0C7E;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AC,EACrC,SAAS,CAAC,EAAE,MAAM,EAClB,iBAAiB,CAAC,EAAE,SAAS,OAAO,aAAa,EAAE,gBAAgB,EAAE;AACrE;;;;;;;;GAQG;AACH,aAAa,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC;AACnC;;;GAGG;AACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GACxB,oBAAoB,EAAE,CA6DxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-event-delegation.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/build-event-delegation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"build-event-delegation.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/build-event-delegation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAI9E,OAAO,KAAK,EACV,mBAAmB,EAEpB,MAAM,YAAY,CAAA;AAEnB,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,YAAY,EAClB,oBAAoB,CAAC,EAAE,MAAM,GAC5B,mBAAmB,CA8BrB;AAKD,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,UAAU,EAChB,EAAE,EAAE,MAAM,EACV,oBAAoB,CAAC,EAAE,MAAM,GAC5B,mBAAmB,CAuBrB;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,YAAY,EAClB,oBAAoB,CAAC,EAAE,MAAM,GAC5B,mBAAmB,CAyBrB;AA6CD,YAAY,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-delegation.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/stringify/event-delegation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;
|
|
1
|
+
{"version":3,"file":"event-delegation.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/stringify/event-delegation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAKH,OAAO,KAAK,EACV,mBAAmB,EAKpB,MAAM,kBAAkB,CAAA;AAsDzB,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,mBAAmB,GAAG,IAAI,CAmDzF"}
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
* directly with no string transformation of its own.
|
|
25
25
|
*/
|
|
26
26
|
import type { MemoInfo, SignalInfo } from '../types.ts';
|
|
27
|
+
import type { BindingScope } from '../scope/binding-scope.ts';
|
|
27
28
|
/**
|
|
28
29
|
* CSR-substituted const value: the const's initializer with every
|
|
29
30
|
* signal getter call, memo call, and reference to another CSR-inlinable
|
|
@@ -85,8 +86,18 @@ export interface CsrEnv {
|
|
|
85
86
|
* so chained inline expansions (const A inlines to a form that mentions
|
|
86
87
|
* const B's already-rewritten value) stay accurate without analytical
|
|
87
88
|
* bookkeeping.
|
|
89
|
+
*
|
|
90
|
+
* `enclosingScope` (#2482 Stage 1b): an optional `BindingScope` for loop
|
|
91
|
+
* bindings ENCLOSING this expression — names bound outside the
|
|
92
|
+
* expression's own AST, which the internal `boundStack` (built purely
|
|
93
|
+
* from arrow/function scopes found while walking `value` itself) can
|
|
94
|
+
* never see on its own. Every current call site already pre-filters
|
|
95
|
+
* `env.substitutions` for loop-shadowed names before calling in (see
|
|
96
|
+
* `html-template.ts`'s `loop` case), so this is defense-in-depth, not a
|
|
97
|
+
* currently-observable behavior change: the two mechanisms should agree
|
|
98
|
+
* on what's shadowed regardless of which one runs first.
|
|
88
99
|
*/
|
|
89
|
-
export declare function csrSubstitute(value: string, env: CsrEnv): {
|
|
100
|
+
export declare function csrSubstitute(value: string, env: CsrEnv, enclosingScope?: BindingScope): {
|
|
90
101
|
rewritten: string;
|
|
91
102
|
freeIdentifiers: ReadonlySet<string>;
|
|
92
103
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"csr-substitute.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/csr-substitute.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"csr-substitute.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/csr-substitute.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAE7D;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,iBAAiB;IAChC,cAAc,EAAE,MAAM,CAAA;IACtB,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CACrC;AAED;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,GAAG,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC,CAAA;AAEtE;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,GAAG,YAAY,CAAA;IAC3B,sEAAsE;IACtE,WAAW,EAAE,MAAM,CAAA;IACnB,qFAAqF;IACrF,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CACrC;AAED,MAAM,WAAW,MAAM;IACrB;;;;;OAKG;IACH,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;IAC3C,4EAA4E;IAC5E,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,cAAc,CAAC,EAAE,YAAY,GAC5B;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAAE,CAmB7D;AAwMD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAGtF;AAED,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAaxE;AAED;;;;;;;;GAQG;AACH,wBAAgB,uCAAuC,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAUjF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,sCAAsC,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAkBpF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAQ/D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,SAAS,UAAU,EAAE,EAC9B,KAAK,EAAE,SAAS,QAAQ,EAAE,EAC1B,eAAe,EAAE,MAAM,GAAG,IAAI,GAC7B,MAAM,CA2BR"}
|
|
@@ -5,6 +5,7 @@ import type { AttrValue, FlatMapCallback, IRNode, MapCallbackPreamble } from '..
|
|
|
5
5
|
import type { LoopParamSpec } from './utils.ts';
|
|
6
6
|
import { type CsrEnv } from './csr-substitute.ts';
|
|
7
7
|
import type { ClientJsContext } from './types.ts';
|
|
8
|
+
import { BindingScope } from '../scope/binding-scope.ts';
|
|
8
9
|
/**
|
|
9
10
|
* Protect string literals from regex-based replacements.
|
|
10
11
|
* Returns protect/restore functions that extract string literals before
|
|
@@ -286,19 +287,26 @@ export interface TemplateOptions {
|
|
|
286
287
|
csrEnv?: CsrEnv;
|
|
287
288
|
loopDepth?: number;
|
|
288
289
|
/**
|
|
289
|
-
*
|
|
290
|
-
* destructured
|
|
291
|
-
* recursion
|
|
292
|
-
*
|
|
293
|
-
*
|
|
294
|
-
*
|
|
295
|
-
*
|
|
296
|
-
*
|
|
297
|
-
*
|
|
298
|
-
*
|
|
299
|
-
*
|
|
290
|
+
* `BindingScope` for the ENCLOSING loops' callback bindings (item /
|
|
291
|
+
* index / destructured names / preamble locals), threaded through the
|
|
292
|
+
* recursion one `enterLoopRow` per nesting level (#2482 Stage 1b —
|
|
293
|
+
* migrated from the ad-hoc flat loop-bound-names `ReadonlySet<string>`
|
|
294
|
+
* this field replaces). Inside a loop body, `csrSubstitute` receives each
|
|
295
|
+
* expression in isolation — no enclosing arrow text — so its own
|
|
296
|
+
* bound-name tracking can't see the loop binding; the `loop` case
|
|
297
|
+
* instead filters these names out of the child recursion's `csrEnv`
|
|
298
|
+
* (via `scope.boundNames()`, the SHADOW-GUARD query — see
|
|
299
|
+
* `BindingScope.valueBoundNames`'s doc comment for why this must stay
|
|
300
|
+
* the all-sources query, not the value-only one), so an inlinable
|
|
301
|
+
* const / signal / memo whose name is shadowed by a loop-row binding —
|
|
302
|
+
* including a `.map()` callback preamble local (#2447) — never
|
|
303
|
+
* substitutes at the shadowed occurrence. Scope-accurate per nesting
|
|
304
|
+
* level (the CURRENT level's own `transformExpr` — e.g. the loop's
|
|
305
|
+
* array-source expression — keeps the unfiltered env). `undefined` at
|
|
306
|
+
* the top of the recursion means "no enclosing loop" (treated as
|
|
307
|
+
* `BindingScope.EMPTY`).
|
|
300
308
|
*/
|
|
301
|
-
|
|
309
|
+
scope?: BindingScope;
|
|
302
310
|
/** Emit `bf-s` placeholder on scoped elements inside a jsx-children prop (#1320). */
|
|
303
311
|
inHoistedChildren?: boolean;
|
|
304
312
|
/**
|
|
@@ -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;AAIjD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAExD;;;;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,MAAM,CAAA;IAC9B,OAAO,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;IAC9B,oBAAoB,EAAE,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D;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,OAAO,CAiBpF"}
|
|
@@ -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;
|
|
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;AAMtD,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,EAKrG,cAAc,EACd,cAAc,EACd,gBAAgB,EAAE,eAAe,EAAE,YAAY,EAC/C,cAAc,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAC3H,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAUxG,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,YAAY,EAEzD,WAAW,EAAE,SAAS,EAItB,MAAM,EAIN,YAAY,CACJ,CAAA;AAEV,gDAAgD;AAChD,eAAO,MAAM,qBAAqB,wuBAA4B,CAAA;AAE9D,eAAO,MAAM,cAAc,+BAA+B,CAAA;AAE1D,eAAO,MAAM,kBAAkB,qCAAqC,CAAA;AACpE,eAAO,MAAM,4BAA4B,qCAAqC,CAAA;AAE9E;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAqB3D;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,WAAW,GAAG,MAAM,EAAE,CAoB/D;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAWxF;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,mBAAmB,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAsCvH"}
|
|
@@ -3,14 +3,27 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { ParamInfo, SignalInfo } from '../types.ts';
|
|
5
5
|
import type { ClientJsContext } from './types.ts';
|
|
6
|
+
import type { BindingScope } from '../scope/binding-scope.ts';
|
|
6
7
|
/**
|
|
7
8
|
* Expand dynamic prop value by resolving local constants.
|
|
8
9
|
*
|
|
9
10
|
* Per spec/compiler.md, no prop reference transformation is needed:
|
|
10
11
|
* - Destructured props are captured once at hydration, used as-is
|
|
11
12
|
* - Props object already uses props.xxx syntax
|
|
13
|
+
*
|
|
14
|
+
* `scope` (#2482 Stage 1b): the enclosing loop row's `BindingScope`, when
|
|
15
|
+
* `value` is being expanded from inside a `.map()` row. `ClientJsContext`
|
|
16
|
+
* itself carries no loop-scope field — it's a per-component object, built
|
|
17
|
+
* once and shared across the whole tree — so without this guard a loop
|
|
18
|
+
* row binding (item / index / destructured / preamble local) that shares
|
|
19
|
+
* a name with a component/module-level const resolves to the OUTER
|
|
20
|
+
* const's value instead of staying an unresolved reference to the row's
|
|
21
|
+
* own binding. `isBound` (not `valueBoundNames`) is the correct query —
|
|
22
|
+
* this is a SHADOW GUARD (every binding source hides an outer same-named
|
|
23
|
+
* const), not a reactivity classifier — see `BindingScope.valueBoundNames`'s
|
|
24
|
+
* doc comment.
|
|
12
25
|
*/
|
|
13
|
-
export declare function expandDynamicPropValue(value: string, ctx: ClientJsContext): string;
|
|
26
|
+
export declare function expandDynamicPropValue(value: string, ctx: ClientJsContext, scope?: BindingScope): string;
|
|
14
27
|
/**
|
|
15
28
|
* Expand a local constant for reactivity detection in stateless components.
|
|
16
29
|
* Stateful components use props.xxx directly, so expansion is unnecessary.
|
|
@@ -23,8 +36,18 @@ export declare function expandDynamicPropValue(value: string, ctx: ClientJsConte
|
|
|
23
36
|
* Otherwise it is `originalFreeIds` passed by the caller (typically derived
|
|
24
37
|
* from the IR node's `origin.freeRefs`) — `undefined` when the caller has
|
|
25
38
|
* no precomputed set.
|
|
39
|
+
*
|
|
40
|
+
* `scope` (#2482 Stage 1b): see `expandDynamicPropValue` — same guard, same
|
|
41
|
+
* reasoning. Without it, a loop row's own binding (bare identifier, e.g. a
|
|
42
|
+
* `.map()` callback preamble local or the item param itself) that shares a
|
|
43
|
+
* name with a component/module-level const gets const-folded into the
|
|
44
|
+
* OUTER value here, which then corrupts BOTH the emitted expression AND
|
|
45
|
+
* downstream reactivity classification (`classifyReactivity` sees a
|
|
46
|
+
* literal instead of a live reference and concludes "not reactive" — the
|
|
47
|
+
* observable failure mode is a reactive attribute/conditional that
|
|
48
|
+
* silently freezes at its initial value instead of updating).
|
|
26
49
|
*/
|
|
27
|
-
export declare function expandConstantForReactivity(expr: string, ctx: ClientJsContext, originalFreeIds?: ReadonlySet<string
|
|
50
|
+
export declare function expandConstantForReactivity(expr: string, ctx: ClientJsContext, originalFreeIds?: ReadonlySet<string>, scope?: BindingScope): {
|
|
28
51
|
expr: string;
|
|
29
52
|
freeIds: ReadonlySet<string> | undefined;
|
|
30
53
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-handling.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/prop-handling.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"prop-handling.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/prop-handling.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAE7D;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,EAAE,KAAK,CAAC,EAAE,YAAY,GAAG,MAAM,CAUxG;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,eAAe,EACpB,eAAe,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EACrC,KAAK,CAAC,EAAE,YAAY,GACnB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;CAAE,CAY5D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,UAAU,EAClB,WAAW,EAAE,SAAS,EAAE,EACxB,eAAe,GAAE,MAAM,GAAG,IAAW,GACpC,MAAM,GAAG,IAAI,CAoCf"}
|
|
@@ -3,6 +3,26 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { type IRNode, type IRProp, type LoopParamBinding, type OriginInfo } from '../types.ts';
|
|
5
5
|
import type { ClientJsContext, ConditionalBranchEvent, ConditionalBranchRef, LoopChildBindings, LoopChildEvent, LoopChildReactiveAttr, LoopChildRef, LoopChildReactiveText, NestedLoop } from './types.ts';
|
|
6
|
+
import { BindingScope } from '../scope/binding-scope.ts';
|
|
7
|
+
/**
|
|
8
|
+
* Build the `BindingScope` for one loop row's own bindings — item /
|
|
9
|
+
* destructured param / index names plus (when supplied) the `.map()`
|
|
10
|
+
* callback's preamble locals (#2447) — for the `expandConstantForReactivity`
|
|
11
|
+
* shadow guard (#2482 Stage 1b). `undefined` when there's no enclosing loop
|
|
12
|
+
* (`loopParam` unset), matching every caller's existing "no loop" shape.
|
|
13
|
+
*
|
|
14
|
+
* `loopIndex` (Copilot review on #2595): a `.map((item, i) => ...)`
|
|
15
|
+
* callback's second param is a real row-scoped binding exactly like
|
|
16
|
+
* `item` — an `i`-shadows-a-module-const attr/text (e.g.
|
|
17
|
+
* `data-idx={/* @client *\/ i}`) const-folds to the outer value exactly
|
|
18
|
+
* like an item-param shadow does when the index name isn't in scope.
|
|
19
|
+
* Only guarded when the CALLER passes it in, though — none of the
|
|
20
|
+
* `collectLoopChild*` collectors' own callers threaded the IR loop's
|
|
21
|
+
* `index` field through before this fix (see each call site's own
|
|
22
|
+
* `undefined`/omitted-arg default), so `undefined` here still means "not
|
|
23
|
+
* guarded," not "no index param."
|
|
24
|
+
*/
|
|
25
|
+
export declare function buildLoopRowScope(loopParam?: string, loopParamBindings?: readonly LoopParamBinding[], preambleNames?: ReadonlySet<string>, loopIndex?: string | null): BindingScope | undefined;
|
|
6
26
|
/**
|
|
7
27
|
* Phase 2 reactivity detection: determines if a code expression needs `createEffect`
|
|
8
28
|
* wrapping during IR → Client JS generation.
|
|
@@ -226,7 +246,15 @@ export declare function collectConditionalBranchChildComponents(node: IRNode, sk
|
|
|
226
246
|
* Defaults to false: some callers (e.g. a plain nested `.map()`'s own
|
|
227
247
|
* per-item bindings) have no sibling conditional collector, so a slotId'd
|
|
228
248
|
* conditional's inlined content is only ever reachable by descending here.
|
|
249
|
+
*
|
|
250
|
+
* `preambleNames` (#2482 Stage 1b): the enclosing loop's `.map()` callback
|
|
251
|
+
* preamble locals (#2447), when known — folded into the `expandConstantForReactivity`
|
|
252
|
+
* shadow guard via `buildLoopRowScope` so a preamble local shadowing a
|
|
253
|
+
* component/module const doesn't get const-folded here.
|
|
254
|
+
*
|
|
255
|
+
* `loopIndex` (Copilot review on #2595): the loop's index param name
|
|
256
|
+
* (`.map((item, i) => ...)`'s `i`), when known — see `buildLoopRowScope`.
|
|
229
257
|
*/
|
|
230
|
-
export declare function collectLoopChildReactiveTexts(node: IRNode, ctx: ClientJsContext, loopParam?: string, loopParamBindings?: readonly LoopParamBinding[], stopAtReactiveConditionals?: boolean): LoopChildReactiveText[];
|
|
231
|
-
export declare function collectLoopChildReactiveAttrs(node: IRNode, ctx: ClientJsContext, loopParam?: string, loopParamBindings?: readonly LoopParamBinding[], stopAtReactiveConditionals?: boolean, preambleNames?: ReadonlySet<string
|
|
258
|
+
export declare function collectLoopChildReactiveTexts(node: IRNode, ctx: ClientJsContext, loopParam?: string, loopParamBindings?: readonly LoopParamBinding[], stopAtReactiveConditionals?: boolean, preambleNames?: ReadonlySet<string>, loopIndex?: string | null): LoopChildReactiveText[];
|
|
259
|
+
export declare function collectLoopChildReactiveAttrs(node: IRNode, ctx: ClientJsContext, loopParam?: string, loopParamBindings?: readonly LoopParamBinding[], stopAtReactiveConditionals?: boolean, preambleNames?: ReadonlySet<string>, loopIndex?: string | null): LoopChildReactiveAttr[];
|
|
232
260
|
//# sourceMappingURL=reactivity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactivity.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/reactivity.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAkB,KAAK,MAAM,EAAE,KAAK,gBAAgB,EAAE,KAAK,UAAU,EAAwC,MAAM,aAAa,CAAA;AACpJ,OAAO,KAAK,EACV,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zB;AAoBD,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,eAAe,EACpB,SAAS,CAAC,EAAE,MAAM,EAClB,iBAAiB,CAAC,EAAE,SAAS,gBAAgB,EAAE,EAC/C,0BAA0B,UAAQ,EAClC,aAAa,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EACnC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GACxB,qBAAqB,EAAE,CAsEzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rewrite-props-object.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/rewrite-props-object.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;
|
|
1
|
+
{"version":3,"file":"rewrite-props-object.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/rewrite-props-object.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAMH;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAsC1F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAkB,gBAAgB,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACrG,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAkB,gBAAgB,EAAE,aAAa,E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AGH,OAAO,EACL,KAAK,MAAM,EA+BZ,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,KAAK,eAAe,EAA0E,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"jsx-to-ir.d.ts","sourceRoot":"","sources":["../src/jsx-to-ir.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,KAAK,MAAM,EA+BZ,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,KAAK,eAAe,EAA0E,MAAM,uBAAuB,CAAA;AAg7BpI,wBAAgB,OAAO,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,GAAG,IAAI,CAIhE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-exports.d.ts","sourceRoot":"","sources":["../src/module-exports.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"module-exports.d.ts","sourceRoot":"","sources":["../src/module-exports.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAGxD;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,EAAE,EAAE,WAAW,EACf,mBAAmB,GAAE,WAAW,CAAC,MAAM,CAAa,EACpD,qBAAqB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,EACtD,OAAO,CAAC,EAAE;IACR;;;;;OAKG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC,GACA,MAAM,GAAG,IAAI,CAgEf;AAED,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,CAavE;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CAMxD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,GAC7C,GAAG,CAAC,MAAM,CAAC,CAyBb;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAyB3D"}
|
package/dist/relocate.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relocate.d.ts","sourceRoot":"","sources":["../src/relocate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAG5D,OAAO,KAAK,EACV,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"relocate.d.ts","sourceRoot":"","sources":["../src/relocate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAG5D,OAAO,KAAK,EACV,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAGtF,MAAM,WAAW,WAAW;IAC1B;;;;;OAKG;IACH,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;IAClC;;;;OAIG;IAC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,GACf,cAAc,CAmChB;AAMD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,WAAW,GACf;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,cAAc,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,gBAAgB,EAAE,CAAA;CAAE,CA2BxE;AAmVD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,eAAe,GAAG,WAAW,CAUlE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,UAAU,EACpB,OAAO,CAAC,EAAE;IACR,kBAAkB,CAAC,EAAE,yBAAyB,CAAA;IAC9C,mBAAmB,CAAC,EAAE,oBAAoB,CAAA;CAC3C,GACA,WAAW,CAcb"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barefootjs/jsx",
|
|
3
|
-
"version": "0.31.
|
|
3
|
+
"version": "0.31.4",
|
|
4
4
|
"description": "JSX compiler for BarefootJS - transforms JSX to server HTML + client JS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"directory": "packages/jsx"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@barefootjs/shared": "0.31.
|
|
52
|
+
"@barefootjs/shared": "0.31.4"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@barefootjs/client": ">=0.2.0",
|
|
@@ -92,7 +92,7 @@ const ALLOWLIST: Record<string, Partial<Record<Pattern, number>>> = {
|
|
|
92
92
|
'packages/jsx/src/ir-to-client-js/collect-elements.ts': { loopParams: 9 },
|
|
93
93
|
'packages/jsx/src/ir-to-client-js/compute-inlinability.ts': { 'localConstants.find(': 1 },
|
|
94
94
|
'packages/jsx/src/ir-to-client-js/control-flow/plan/build-event-delegation.ts': { loopParams: 4 },
|
|
95
|
-
'packages/jsx/src/ir-to-client-js/html-template.ts': {
|
|
95
|
+
'packages/jsx/src/ir-to-client-js/html-template.ts': { loopParams: 16 },
|
|
96
96
|
'packages/jsx/src/ir-to-client-js/prop-handling.ts': { 'localConstants.find(': 2 },
|
|
97
97
|
'packages/jsx/src/ir-to-client-js/utils.ts': { loopParams: 3 },
|
|
98
98
|
'packages/jsx/src/jsx-to-ir.ts': { loopParams: 1 },
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #2482 Stage 1b — `generateCsrTemplateWithOpts`'s (`html-template.ts`)
|
|
3
|
+
* CSR "materialize" template lambda (the `hydrate(..., { template })`
|
|
4
|
+
* function used to render a loop's rows client-side with no SSR markup to
|
|
5
|
+
* hydrate against) const-folded a `.map()` callback preamble local (#2447)
|
|
6
|
+
* into an outer, same-named module-level const, instead of leaving the
|
|
7
|
+
* row-local binding unresolved.
|
|
8
|
+
*
|
|
9
|
+
* Root cause: the `loop` case's `opts.loopBoundNames` — a flat
|
|
10
|
+
* `Set<string>` re-unioned per recursion level — only ever accumulated
|
|
11
|
+
* the loop's item / index / destructured-binding names, never the
|
|
12
|
+
* callback's preamble-declared locals (#2447 postdates the original
|
|
13
|
+
* `loopBoundNames` shadow fix, #2222). Migrating onto `BindingScope`'s
|
|
14
|
+
* `enterLoopRow` (which binds item ∪ index ∪ destructure ∪ preamble
|
|
15
|
+
* `declaredNames` uniformly) closes the gap.
|
|
16
|
+
*
|
|
17
|
+
* Observable failure mode before the fix: every row's branch condition
|
|
18
|
+
* evaluated the constant's fixed truthiness instead of the row's own
|
|
19
|
+
* preamble-computed value — e.g. every `<li>` rendered its "true" branch
|
|
20
|
+
* regardless of the actual per-item condition.
|
|
21
|
+
*
|
|
22
|
+
* Modeled on `csr-template-loop-shadowing.test.ts` (the pre-#2447
|
|
23
|
+
* item/index/destructured-param shadowing pins for this same template
|
|
24
|
+
* lambda) and `binding-scope-preamble-shadowing.test.ts` (the IR-level
|
|
25
|
+
* preamble-shadowing analogue this test is the CSR-codegen-level sibling
|
|
26
|
+
* of).
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
import { describe, test, expect } from 'bun:test'
|
|
30
|
+
import { compileJSX } from '../compiler'
|
|
31
|
+
import { TestAdapter } from '../adapters/test-adapter'
|
|
32
|
+
|
|
33
|
+
const adapter = new TestAdapter()
|
|
34
|
+
|
|
35
|
+
function clientJsFor(source: string): string {
|
|
36
|
+
const result = compileJSX(source, 'Repro.tsx', { adapter })
|
|
37
|
+
expect(result.errors.filter(e => e.severity === 'error')).toHaveLength(0)
|
|
38
|
+
const clientJs = result.files.find(f => f.type === 'clientJs')
|
|
39
|
+
expect(clientJs).toBeDefined()
|
|
40
|
+
return clientJs!.content
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function templateLambda(content: string): string {
|
|
44
|
+
const line = content.split('\n').find(l => l.includes('hydrate('))
|
|
45
|
+
expect(line).toBeDefined()
|
|
46
|
+
return line!
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
describe('CSR materialize template vs .map() preamble-local shadowing a module const (#2482)', () => {
|
|
50
|
+
test('a preamble local shadowing a module const stays row-local in the hydrate template lambda', () => {
|
|
51
|
+
const tpl = templateLambda(clientJsFor(`
|
|
52
|
+
'use client'
|
|
53
|
+
import { createSignal } from '@barefootjs/client'
|
|
54
|
+
export function Widget({ items }: { items: { name: string; active: boolean }[] }) {
|
|
55
|
+
const label = 'MODULE_CONST'
|
|
56
|
+
const [on, setOn] = createSignal(true)
|
|
57
|
+
return (
|
|
58
|
+
<div onClick={() => setOn(false)}>
|
|
59
|
+
<ul>
|
|
60
|
+
{items.map((item) => {
|
|
61
|
+
const label = item.active && on()
|
|
62
|
+
return <li key={item.name}>{label ? <span>yes</span> : <span>no</span>}</li>
|
|
63
|
+
})}
|
|
64
|
+
</ul>
|
|
65
|
+
</div>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
`))
|
|
69
|
+
|
|
70
|
+
// The row-local `label` (the preamble's OWN computed value) must
|
|
71
|
+
// drive the branch — never the outer module const's literal.
|
|
72
|
+
expect(tpl).toContain('label ? `<span>yes</span>`')
|
|
73
|
+
expect(tpl).not.toContain("('MODULE_CONST')")
|
|
74
|
+
expect(tpl).not.toContain('MODULE_CONST')
|
|
75
|
+
})
|
|
76
|
+
})
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #2482 Stage 1b — `csrSubstitute`'s `enclosingScope` parameter.
|
|
3
|
+
*
|
|
4
|
+
* `csrSubstitute`'s `boundStack` only ever learns about bindings found
|
|
5
|
+
* while walking the substituted expression's OWN AST (nested arrow/
|
|
6
|
+
* function parameters and block-scoped locals inside `value` itself) — it
|
|
7
|
+
* has no way to see a binding introduced OUTSIDE that expression, e.g. an
|
|
8
|
+
* enclosing `.map()` row's item/index/destructured/preamble binding.
|
|
9
|
+
* `enclosingScope` (a `BindingScope`) seeds those outer frames so
|
|
10
|
+
* `isBound` treats them identically to an in-expression arrow param.
|
|
11
|
+
*
|
|
12
|
+
* Direct unit coverage, not a full-pipeline conformance fixture: every
|
|
13
|
+
* current call site (`html-template.ts`'s `generateCsrTemplateWithOpts`)
|
|
14
|
+
* already pre-filters `env.substitutions` to remove loop-shadowed names
|
|
15
|
+
* BEFORE calling in (see the `loop` case's `childEnv` construction, itself
|
|
16
|
+
* migrated onto `BindingScope.enterLoopRow` in this same stage) — so by
|
|
17
|
+
* the time `csrSubstitute` runs inside a loop body today, the shadowed
|
|
18
|
+
* name is already absent from `env.substitutions` and `enclosingScope`
|
|
19
|
+
* never gets a chance to matter. This test exercises the module function
|
|
20
|
+
* directly, bypassing that pre-filtering, to pin the parameter's own
|
|
21
|
+
* contract in isolation: SHOULD a future call site ever hand `csrSubstitute`
|
|
22
|
+
* an unfiltered env alongside a loop's `BindingScope` (e.g. a caller that
|
|
23
|
+
* wants substitution and shadow-guarding as one step instead of two), the
|
|
24
|
+
* shadow guard already works correctly.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
import { describe, test, expect } from 'bun:test'
|
|
28
|
+
import { csrSubstitute, type CsrEnv } from '../ir-to-client-js/csr-substitute.ts'
|
|
29
|
+
import { BindingScope } from '../scope/binding-scope.ts'
|
|
30
|
+
|
|
31
|
+
describe('csrSubstitute enclosingScope (#2482)', () => {
|
|
32
|
+
test('a name bound by the enclosing loop scope is left unsubstituted, even though the env still has an entry for it', () => {
|
|
33
|
+
// Deliberately UNFILTERED env — in real call sites this would already
|
|
34
|
+
// have `label` removed by the caller's own loop-scope filtering; here
|
|
35
|
+
// we keep it to isolate what `enclosingScope` alone contributes.
|
|
36
|
+
const env: CsrEnv = {
|
|
37
|
+
substitutions: new Map([
|
|
38
|
+
['label', { kind: 'identifier', replacement: "'MODULE_CONST'", freeIdentifiers: new Set() }],
|
|
39
|
+
]),
|
|
40
|
+
propsObjectName: null,
|
|
41
|
+
}
|
|
42
|
+
const scope = BindingScope.EMPTY.enterLoopRow({ param: 'label' })
|
|
43
|
+
|
|
44
|
+
const withoutScope = csrSubstitute('label', env)
|
|
45
|
+
const withScope = csrSubstitute('label', env, scope)
|
|
46
|
+
|
|
47
|
+
expect(withoutScope.rewritten).toBe("('MODULE_CONST')")
|
|
48
|
+
expect(withScope.rewritten).toBe('label')
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
test('a name NOT bound by the enclosing scope still substitutes normally', () => {
|
|
52
|
+
const env: CsrEnv = {
|
|
53
|
+
substitutions: new Map([
|
|
54
|
+
['label', { kind: 'identifier', replacement: "'MODULE_CONST'", freeIdentifiers: new Set() }],
|
|
55
|
+
]),
|
|
56
|
+
propsObjectName: null,
|
|
57
|
+
}
|
|
58
|
+
// Scope binds a DIFFERENT name (`item`) — `label` stays substitutable.
|
|
59
|
+
const scope = BindingScope.EMPTY.enterLoopRow({ param: 'item' })
|
|
60
|
+
|
|
61
|
+
const { rewritten } = csrSubstitute('label', env, scope)
|
|
62
|
+
expect(rewritten).toBe("('MODULE_CONST')")
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
test('a preamble-bound name (not item/index/destructure) is also guarded', () => {
|
|
66
|
+
const env: CsrEnv = {
|
|
67
|
+
substitutions: new Map([
|
|
68
|
+
['label', { kind: 'identifier', replacement: "'MODULE_CONST'", freeIdentifiers: new Set() }],
|
|
69
|
+
]),
|
|
70
|
+
propsObjectName: null,
|
|
71
|
+
}
|
|
72
|
+
const scope = BindingScope.EMPTY.enterLoopRow({ param: 'item', preamble: { declaredNames: ['label'] } })
|
|
73
|
+
|
|
74
|
+
const { rewritten } = csrSubstitute('label', env, scope)
|
|
75
|
+
expect(rewritten).toBe('label')
|
|
76
|
+
})
|
|
77
|
+
})
|