@barefootjs/jsx 0.31.2 → 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/analyzer.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 +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +280 -119
- 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/prop-rewrite.d.ts +1 -1
- package/dist/relocate.d.ts.map +1 -1
- package/dist/scope/binding-scope.d.ts +179 -0
- package/dist/scope/binding-scope.d.ts.map +1 -0
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/binding-scope-preamble-shadowing.test.ts +115 -0
- package/src/__tests__/binding-scope-ratchet.test.ts +194 -0
- package/src/__tests__/binding-scope.test.ts +200 -0
- 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__/let-type-annotation.test.ts +208 -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 +34 -5
- package/src/adapters/template-imports.ts +93 -0
- package/src/analyzer.ts +20 -3
- package/src/debug.ts +4 -3
- package/src/identifier-pattern.ts +79 -0
- package/src/index.ts +5 -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 +187 -73
- package/src/module-exports.ts +3 -2
- package/src/prop-rewrite.ts +1 -1
- package/src/relocate.ts +2 -1
- package/src/scope/binding-scope.ts +238 -0
- package/src/types.ts +8 -0
|
@@ -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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,EACrC,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,SAAS,OAAO,aAAa,EAAE,gBAAgB,EAAE,GAAG,SAAS;AAChF;;;;GAIG;AACH,aAAa,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC;AACnC;;;;GAIG;AACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GACxB,iBAAiB,CAenB;AAED,wBAAgB,4BAA4B,CAC1C,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;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,IAA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AE,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,K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CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GACvC,MAAM,CAgBR;AAuHD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,eAAe,EACpB,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,EACnD,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,EACjD,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,GAC9B,GAAG,CAAC,MAAM,CAAC,CAoDb;AAyVD;;;;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,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,YAAY,EACZ,qBAAqB,EACrB,UAAU,EACX,MAAM,YAAY,CAAA;
|
|
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,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,YAAY,EACZ,qBAAqB,EACrB,UAAU,EACX,MAAM,YAAY,CAAA;AAKnB,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAGxD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,CAAC,EAAE,MAAM,EAClB,iBAAiB,CAAC,EAAE,SAAS,gBAAgB,EAAE,EAC/C,aAAa,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EACnC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GACxB,YAAY,GAAG,SAAS,CAQ1B;AAED;;;;;;;;;;;;GAYG;AACH;;;;;;GAMG;AACH,M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,MAAM,EAAE,CAAA;CAAE,CAAC,CAIrF;AA4BD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,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,CAkDzB;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,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;IACb,QAAQ,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAA;CACvC;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,aAAa,CAAC,GAAG,MAAM,CAQ/G"}
|
package/dist/jsx-to-ir.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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;
|
|
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/prop-rewrite.d.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* stack, so `items.map((title) => title.a)` never turns into the
|
|
15
15
|
* syntactically invalid `.map((_p.title) => _p.title.a)` when `title`
|
|
16
16
|
* is also a prop. (Names bound by loop callbacks that ENCLOSE the
|
|
17
|
-
* expression are the caller's job — see the `ctx.
|
|
17
|
+
* expression are the caller's job — see the `ctx.scope` filter in
|
|
18
18
|
* `jsx-to-ir.ts`'s `rewriteBarePropRefs` wrapper, #2222.)
|
|
19
19
|
*/
|
|
20
20
|
import ts from 'typescript';
|
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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AAA;CAC3C,GACA,WAAW,CAcb"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `BindingScope`: the one shared, immutable, stack-shaped model of "names
|
|
3
|
+
* bound by a loop callback" (#2482 Stage 0). Six independent ad-hoc
|
|
4
|
+
* mechanisms across the compiler currently answer this same question —
|
|
5
|
+
* `ctx.loopParams` (a mutated `Set<string>` in `jsx-to-ir.ts`),
|
|
6
|
+
* `collectLoopBoundNames` (`adapters/loop-bound-names.ts`),
|
|
7
|
+
* `resolveStaticLoopSource`'s `isNameShadowed` callback
|
|
8
|
+
* (`static-literal.ts`), and others — each reimplementing the same
|
|
9
|
+
* item/index/destructure/preamble-local bookkeeping with its own bugs and
|
|
10
|
+
* its own blind spots. This module is the single door those mechanisms
|
|
11
|
+
* migrate onto in later stages (Stage 0 only ships the service + tests;
|
|
12
|
+
* NO call site is migrated yet).
|
|
13
|
+
*
|
|
14
|
+
* Immutability is the point, not an incidental style choice:
|
|
15
|
+
* `ctx.loopParams` is `.add`/`.delete`-mutated as `jsx-to-ir.ts` walks in
|
|
16
|
+
* and back out of nested loops, so a caller that forgets (or races) a
|
|
17
|
+
* `.delete()` — or that holds a reference to the "current" set across a
|
|
18
|
+
* push/pop it didn't expect — silently observes the WRONG scope. A
|
|
19
|
+
* restore-bug of that shape is impossible by construction here:
|
|
20
|
+
* `enterLoopRow`/`enterCallback` never mutate `this`, they return a NEW
|
|
21
|
+
* `BindingScope` whose parent is untouched, so holding an old reference
|
|
22
|
+
* always sees the scope as it was, and there is no delete step to forget.
|
|
23
|
+
*
|
|
24
|
+
* Filter/sort callback params (`.filter(x => ...)`, `.sort((a, b) => ...)`,
|
|
25
|
+
* a nested arrow) are bound as `'callback'` frames via `enterCallback` —
|
|
26
|
+
* never folded into a `'loop-row'` frame's bindings. They are a distinct
|
|
27
|
+
* scope-introduction shape (an inner function's own parameter list, not a
|
|
28
|
+
* row's item/index/destructure/preamble names) even though both end up
|
|
29
|
+
* "just names you can't resolve against component-level state."
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* How a name inside a `ScopeFrame` came to be bound — the row shapes
|
|
33
|
+
* (`'item'`/`'index'`/`'destructure'`/`'preamble'`) for `'loop-row'` frames,
|
|
34
|
+
* `'param'` for `'callback'` frames. One shared type because both frame
|
|
35
|
+
* kinds carry the same binding metadata.
|
|
36
|
+
*/
|
|
37
|
+
export type ScopeBindingSource = 'item' | 'index' | 'destructure' | 'preamble' | 'param';
|
|
38
|
+
export interface ScopeBinding {
|
|
39
|
+
readonly source: ScopeBindingSource;
|
|
40
|
+
}
|
|
41
|
+
export interface ScopeFrame {
|
|
42
|
+
readonly kind: 'loop-row' | 'callback';
|
|
43
|
+
readonly bindings: ReadonlyMap<string, ScopeBinding>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Structural pick satisfied by BOTH `IRLoop` (`packages/jsx/src/types.ts`)
|
|
47
|
+
* and the client-JS `LoopCore` family (`packages/jsx/src/ir-to-client-js/types.ts`)
|
|
48
|
+
* without importing either — this module stays dependency-free and cannot
|
|
49
|
+
* form an import cycle with `types.ts` / `ir-to-client-js`.
|
|
50
|
+
*/
|
|
51
|
+
export interface LoopBindingSource {
|
|
52
|
+
readonly param: string;
|
|
53
|
+
readonly index?: string | null;
|
|
54
|
+
readonly paramBindings?: readonly {
|
|
55
|
+
readonly name: string;
|
|
56
|
+
}[];
|
|
57
|
+
readonly preamble?: {
|
|
58
|
+
readonly declaredNames: readonly string[];
|
|
59
|
+
} | null;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* A stack of `ScopeFrame`s, innermost frame at index 0 of the internal
|
|
63
|
+
* array (i.e. `frames[0]` is what `enterLoopRow`/`enterCallback` most
|
|
64
|
+
* recently pushed). `lookup`'s `depth` counts from `frames[0]`, so depth 0
|
|
65
|
+
* always means "the innermost frame," independent of how many ancestor
|
|
66
|
+
* frames exist.
|
|
67
|
+
*/
|
|
68
|
+
export declare class BindingScope {
|
|
69
|
+
private readonly frames;
|
|
70
|
+
static readonly EMPTY: BindingScope;
|
|
71
|
+
private constructor();
|
|
72
|
+
/**
|
|
73
|
+
* Child scope with a new `'loop-row'` frame for one loop's per-item
|
|
74
|
+
* bindings. Parent (`this`) is not mutated; the returned scope is a
|
|
75
|
+
* NEW object with `frames = [newFrame, ...this.frames]`.
|
|
76
|
+
*
|
|
77
|
+
* Binding semantics mirror `jsx-to-ir.ts`'s `ctx.loopParams` add site
|
|
78
|
+
* EXACTLY (verified against lines ~4320-4345 and the matching delete
|
|
79
|
+
* site ~4695-4710 of `packages/jsx/src/jsx-to-ir.ts`):
|
|
80
|
+
*
|
|
81
|
+
* - When `loop.paramBindings` is non-empty (a destructured callback
|
|
82
|
+
* param, e.g. `.map(({ id, name }) => ...)`), each `paramBindings[i].name`
|
|
83
|
+
* is bound with source `'destructure'` and the raw `param` text
|
|
84
|
+
* (which for a destructured callback holds the ORIGINAL pattern
|
|
85
|
+
* source, e.g. `"{ id, name }"`, not a usable identifier) is NOT
|
|
86
|
+
* bound. This matches `jsx-to-ir.ts`:
|
|
87
|
+
* `if (paramBindings) { for (const b of paramBindings) ctx.loopParams.add(b.name) }`
|
|
88
|
+
* — the `else` branch (`ctx.loopParams.add(param)`) is skipped
|
|
89
|
+
* entirely when `paramBindings` is present.
|
|
90
|
+
* - Otherwise (a plain identifier param, e.g. `.map(item => ...)`),
|
|
91
|
+
* `param` itself is bound with source `'item'`.
|
|
92
|
+
* - `index` (the second callback param, e.g. `.map((item, i) => ...)`)
|
|
93
|
+
* is bound with source `'index'` when non-null/non-undefined.
|
|
94
|
+
* - Every name in `preamble.declaredNames` (a `.map()` callback's
|
|
95
|
+
* pre-return `const`/`let`/`function` locals, #2447) is bound with
|
|
96
|
+
* source `'preamble'`.
|
|
97
|
+
*
|
|
98
|
+
* NOTE on a sibling mechanism this method does NOT mirror:
|
|
99
|
+
* `adapters/loop-bound-names.ts`'s `collectLoopBoundNames` adds BOTH
|
|
100
|
+
* `node.param` AND every `paramBindings[i].name` unconditionally
|
|
101
|
+
* (never skipping `param` in the destructured case) — a deliberately
|
|
102
|
+
* coarser, over-inclusive collection used only to subtract names from
|
|
103
|
+
* a flat string-typing Set (safe to over-exclude there). This method
|
|
104
|
+
* follows the precise `jsx-to-ir.ts` `ctx.loopParams` semantics, since
|
|
105
|
+
* that is the mechanism actually doing scope-shadowed name RESOLUTION
|
|
106
|
+
* (the behavior `BindingScope` replaces), not coarse exclusion.
|
|
107
|
+
*/
|
|
108
|
+
enterLoopRow(loop: LoopBindingSource): BindingScope;
|
|
109
|
+
/**
|
|
110
|
+
* Child scope with a new `'callback'` frame binding `params` (a filter
|
|
111
|
+
* predicate's `x`, a sort comparator's `(a, b)`, or a nested arrow's
|
|
112
|
+
* parameter list) with source `'param'`. Parent is not mutated.
|
|
113
|
+
*/
|
|
114
|
+
enterCallback(params: readonly string[]): BindingScope;
|
|
115
|
+
/** Innermost-first membership check across every frame in the stack. */
|
|
116
|
+
isBound(name: string): boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Resolves `name` against the frame stack innermost-first. `depth 0`
|
|
119
|
+
* means the innermost (most recently entered) frame; `null` when `name`
|
|
120
|
+
* is not bound in any frame.
|
|
121
|
+
*/
|
|
122
|
+
lookup(name: string): {
|
|
123
|
+
readonly depth: number;
|
|
124
|
+
readonly frame: ScopeFrame;
|
|
125
|
+
readonly binding: ScopeBinding;
|
|
126
|
+
} | null;
|
|
127
|
+
/**
|
|
128
|
+
* Union of every frame's bound names (every `ScopeBindingSource`), for
|
|
129
|
+
* migration interop with legacy `Set<string>`-shaped consumers (e.g.
|
|
130
|
+
* `collectLoopBoundNames`'s return type) as later stages migrate them
|
|
131
|
+
* onto `BindingScope`.
|
|
132
|
+
*
|
|
133
|
+
* This is the SHADOW-GUARD query — see {@link valueBoundNames} for the
|
|
134
|
+
* other consumer class and why the two must not be conflated.
|
|
135
|
+
*/
|
|
136
|
+
boundNames(): ReadonlySet<string>;
|
|
137
|
+
private boundNamesCache;
|
|
138
|
+
private valueBoundNamesCache;
|
|
139
|
+
/**
|
|
140
|
+
* Union of names bound via `'item'`/`'index'`/`'destructure'` sources
|
|
141
|
+
* only — the loop row's own per-item identity — excluding `'preamble'`
|
|
142
|
+
* (a `.map()` callback's pre-return `const`/`let`/`function` locals,
|
|
143
|
+
* #2447) and `'param'` (an `enterCallback` frame's filter/sort/nested-
|
|
144
|
+
* arrow parameters).
|
|
145
|
+
*
|
|
146
|
+
* `BindingScope` has exactly two consumer classes, and conflating them
|
|
147
|
+
* is the #2482 Stage 1a Commit 2 regression this split exists to
|
|
148
|
+
* prevent (a `ctx.scope`-wide preamble merge flipped `tag-cloud` and
|
|
149
|
+
* `preamble-cells` conformance fixtures before this method existed):
|
|
150
|
+
*
|
|
151
|
+
* - SHADOW GUARDS (`tryResolveTemplateSpanFromConst`,
|
|
152
|
+
* `tryResolveIdentifierAsTemplateLiteral`, `rewriteBarePropRefs`
|
|
153
|
+
* in `jsx-to-ir.ts`) ask "is this name resolved to SOMETHING in
|
|
154
|
+
* this scope, so an outer const/prop of the same name must not be
|
|
155
|
+
* substituted here at this transform position" — every source
|
|
156
|
+
* qualifies, including a preamble local shadowing a module const.
|
|
157
|
+
* These call `isBound` / `boundNames()`.
|
|
158
|
+
* - REACTIVITY / SLOT-ID CLASSIFIERS (`referencesLoopParam`,
|
|
159
|
+
* `hasReactiveAttributes`, and the `BindingEnvironment.loopParams`
|
|
160
|
+
* feed built from `makeBindingEnv`, all in `jsx-to-ir.ts`) ask
|
|
161
|
+
* "does this expression read a value that changes per row and so
|
|
162
|
+
* needs its own patchable slot" — a preamble local already gets
|
|
163
|
+
* ITS OWN dedicated slot/region-patch machinery
|
|
164
|
+
* (`preambleRegions` / `markPreambleAttrSlots`, #2447), so folding
|
|
165
|
+
* it into this classification double-counts it. Worse: widening a
|
|
166
|
+
* text child's `reactive` flag this way is read by
|
|
167
|
+
* `hasDynamicContent` to decide whether the loop ROW's own root
|
|
168
|
+
* element needs a slot — an unrelated, narrower decision that must
|
|
169
|
+
* not move just because a preamble local is now scope-visible.
|
|
170
|
+
* These call `valueBoundNames()`.
|
|
171
|
+
*/
|
|
172
|
+
valueBoundNames(): ReadonlySet<string>;
|
|
173
|
+
/**
|
|
174
|
+
* Drop-in for `resolveStaticLoopSource`'s `opts.isNameShadowed`
|
|
175
|
+
* (`packages/jsx/src/static-literal.ts:112-128`).
|
|
176
|
+
*/
|
|
177
|
+
asShadowPredicate(): (name: string) => boolean;
|
|
178
|
+
}
|
|
179
|
+
//# sourceMappingURL=binding-scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binding-scope.d.ts","sourceRoot":"","sources":["../../src/scope/binding-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,OAAO,GAAG,aAAa,GAAG,UAAU,GAAG,OAAO,CAAA;AAExF,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAA;CACpC;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CAAA;IACtC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;CACrD;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IAC7D,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAAE,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,GAAG,IAAI,CAAA;CACzE;AAED;;;;;;GAMG;AACH,qBAAa,YAAY;IAGH,OAAO,CAAC,QAAQ,CAAC,MAAM;IAF3C,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAuB;IAE1D,OAAO,eAA+D;IAEtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH,YAAY,CAAC,IAAI,EAAE,iBAAiB,GAAG,YAAY,CAYlD;IAED;;;;OAIG;IACH,aAAa,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,YAAY,CAKrD;IAED,wEAAwE;IACxE,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAK7B;IAED;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAA;KAAE,GAAG,IAAI,CAOlH;IAED;;;;;;;;OAQG;IACH,UAAU,IAAI,WAAW,CAAC,MAAM,CAAC,CAQhC;IAMD,OAAO,CAAC,eAAe,CAAiC;IACxD,OAAO,CAAC,oBAAoB,CAAiC;IAE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,eAAe,IAAI,WAAW,CAAC,MAAM,CAAC,CAYrC;IAED;;;OAGG;IACH,iBAAiB,IAAI,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAE7C;CACF"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1652,6 +1652,14 @@ export interface ConstantInfo {
|
|
|
1652
1652
|
parsed?: ParsedExpr;
|
|
1653
1653
|
/** Value with TypeScript type annotations preserved, for .tsx output */
|
|
1654
1654
|
typedValue?: string;
|
|
1655
|
+
/**
|
|
1656
|
+
* The declaration's explicit type annotation, verbatim from source
|
|
1657
|
+
* (`node.type.getText()`), when the author wrote one. Distinct from
|
|
1658
|
+
* `type`, which is also populated by inference from the initializer —
|
|
1659
|
+
* emitters must only print THIS field, never an inferred type, onto a
|
|
1660
|
+
* declaration (#2589).
|
|
1661
|
+
*/
|
|
1662
|
+
typeAnnotation?: string;
|
|
1655
1663
|
valueBranches?: string[];
|
|
1656
1664
|
declarationKind: 'const' | 'let';
|
|
1657
1665
|
isExported?: boolean;
|