@barefootjs/jsx 0.33.4 → 0.34.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 +13 -0
- package/dist/adapters/child-scope.d.ts.map +1 -1
- package/dist/adapters/parsed-expr-emitter.d.ts +17 -0
- package/dist/adapters/parsed-expr-emitter.d.ts.map +1 -1
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/errors.d.ts +1 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/expression-parser.d.ts +17 -4
- package/dist/expression-parser.d.ts.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1399 -1173
- package/dist/ir-to-client-js/child-components.d.ts.map +1 -1
- package/dist/ir-to-client-js/collect-elements.d.ts.map +1 -1
- package/dist/ir-to-client-js/component-scope.d.ts +20 -0
- package/dist/ir-to-client-js/component-scope.d.ts.map +1 -1
- package/dist/ir-to-client-js/compute-inlinability.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/shared.d.ts +4 -3
- package/dist/ir-to-client-js/control-flow/shared.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/csr-substitute.d.ts +35 -9
- package/dist/ir-to-client-js/csr-substitute.d.ts.map +1 -1
- package/dist/ir-to-client-js/emit-reactive.d.ts +10 -0
- package/dist/ir-to-client-js/emit-reactive.d.ts.map +1 -1
- package/dist/ir-to-client-js/html-template.d.ts +49 -2
- package/dist/ir-to-client-js/html-template.d.ts.map +1 -1
- package/dist/ir-to-client-js/imports.d.ts +2 -2
- package/dist/ir-to-client-js/imports.d.ts.map +1 -1
- package/dist/ir-to-client-js/index.d.ts.map +1 -1
- package/dist/ir-to-client-js/rewrite-props-object.d.ts +12 -1
- package/dist/ir-to-client-js/rewrite-props-object.d.ts.map +1 -1
- package/dist/jsx-to-ir.d.ts.map +1 -1
- package/dist/lowering-registry.d.ts +12 -0
- package/dist/lowering-registry.d.ts.map +1 -1
- package/dist/prop-rewrite.d.ts +5 -2
- package/dist/prop-rewrite.d.ts.map +1 -1
- package/dist/props-binding.d.ts +49 -11
- package/dist/props-binding.d.ts.map +1 -1
- package/dist/types.d.ts +6 -5
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/__snapshots__/doc-examples.test.ts.snap +15 -15
- package/src/__tests__/aliased-import-child-registry-2777.test.ts +112 -0
- package/src/__tests__/date-lowering.test.ts +18 -4
- package/src/__tests__/inner-loop-mathml-namespace.test.ts +1 -1
- package/src/__tests__/inner-loop-svg-namespace.test.ts +4 -4
- package/src/__tests__/issue-2724-prop-alias-loop-not-static.test.ts +355 -0
- package/src/__tests__/issue-2737-props-object-alias-template.test.ts +86 -0
- package/src/__tests__/issue-2756-input-skeleton-bails.test.ts +123 -0
- package/src/__tests__/issue-2778-getter-alias-csr-template.test.ts +113 -0
- package/src/__tests__/issue-2806-rest-bag-template-rewrite.test.ts +136 -0
- package/src/__tests__/issue-2835-props-type-member-name-collision.test.ts +259 -0
- package/src/__tests__/loop-item-root-scope.test.ts +7 -3
- package/src/__tests__/lowering-value-position.test.ts +232 -0
- package/src/__tests__/markup-prop-brand.test.ts +165 -26
- package/src/__tests__/namespace-import-primitive.test.ts +244 -0
- package/src/__tests__/rewrite-destructured-props.test.ts +53 -0
- package/src/__tests__/static-loop-csr-materialize.test.ts +2 -2
- package/src/adapters/child-scope.ts +23 -0
- package/src/adapters/parsed-expr-emitter.ts +43 -0
- package/src/analyzer.ts +130 -0
- package/src/errors.ts +14 -1
- package/src/expression-parser.ts +63 -29
- package/src/index.ts +9 -1
- package/src/ir-to-client-js/child-components.ts +8 -1
- package/src/ir-to-client-js/collect-elements.ts +10 -38
- package/src/ir-to-client-js/component-scope.ts +60 -0
- package/src/ir-to-client-js/compute-inlinability.ts +46 -11
- package/src/ir-to-client-js/control-flow/shared.ts +12 -5
- package/src/ir-to-client-js/control-flow/stringify/loop.ts +8 -2
- package/src/ir-to-client-js/csr-substitute.ts +82 -16
- package/src/ir-to-client-js/emit-reactive.ts +29 -13
- package/src/ir-to-client-js/emit-registration.ts +1 -1
- package/src/ir-to-client-js/html-template.ts +141 -70
- package/src/ir-to-client-js/imports.ts +4 -0
- package/src/ir-to-client-js/index.ts +34 -23
- package/src/ir-to-client-js/plan/build-static-array-child-init.ts +7 -2
- package/src/ir-to-client-js/rewrite-props-object.ts +14 -0
- package/src/jsx-to-ir.ts +200 -42
- package/src/lowering-registry.ts +21 -0
- package/src/prop-rewrite.ts +23 -5
- package/src/props-binding.ts +74 -18
- package/src/types.ts +6 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"child-components.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/child-components.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,KAAK,EAAE,eAAe,EAAsB,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"child-components.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/child-components.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,KAAK,EAAE,eAAe,EAAsB,MAAM,YAAY,CAAA;AAGrE;kEACkE;AAClE,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,MAAM,EAAE,EACf,GAAG,EAAE,eAAe,EACpB,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,GAC9B,IAAI,CA+BN;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CA8BrF"}
|
|
@@ -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;AA4GvQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAwJd;
|
|
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;AA4GvQ;;;;;;;;;;;;;;;;;;;;;;;;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AgB,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,CA2ExB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ImportInfo } from '../types.ts';
|
|
1
2
|
/**
|
|
2
3
|
* File-scoped component name disambiguation for the runtime registry.
|
|
3
4
|
*
|
|
@@ -36,6 +37,25 @@ export declare function setActiveComponentScope(scope: {
|
|
|
36
37
|
fileScope: string;
|
|
37
38
|
nonExportedSiblings: Set<string>;
|
|
38
39
|
} | null): void;
|
|
40
|
+
/**
|
|
41
|
+
* Build a local-alias → exported-name map from a component's parsed
|
|
42
|
+
* imports. Only VALUE, non-default, non-namespace, ALIASED specifiers
|
|
43
|
+
* produce an entry — a bare `import { Foo }` needs no rewrite (`name`
|
|
44
|
+
* already equals what's registered), and default/namespace imports can't
|
|
45
|
+
* be resolved this way (a default's exported name isn't recorded here,
|
|
46
|
+
* and a namespace member reference isn't an aliased specifier at all).
|
|
47
|
+
*/
|
|
48
|
+
export declare function buildImportAliasMap(imports: readonly ImportInfo[]): Map<string, string>;
|
|
49
|
+
export declare function setActiveImportAliases(aliases: ReadonlyMap<string, string> | null): void;
|
|
50
|
+
/**
|
|
51
|
+
* Resolve a local JSX tag name to the name the referenced component's own
|
|
52
|
+
* module registers under (`hydrate(<name>, ...)`) — the caller-facing
|
|
53
|
+
* alias if imported under one, otherwise the name unchanged. Used
|
|
54
|
+
* anywhere a name needs to reach the runtime registry WITHOUT also going
|
|
55
|
+
* through the non-exported-sibling rewrite below (the `@bf-child:` marker
|
|
56
|
+
* comment, which must never carry a same-file sibling's hash).
|
|
57
|
+
*/
|
|
58
|
+
export declare function resolveImportedComponentName(name: string): string;
|
|
39
59
|
/** Resolve a component name to its registry key under the active file scope. */
|
|
40
60
|
export declare function nameForRegistryRef(name: string): string;
|
|
41
61
|
//# sourceMappingURL=component-scope.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-scope.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/component-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAY1D;AAeD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAAE,GAAG,IAAI,GAAG,IAAI,CAEnH;AAED,gFAAgF;AAChF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"component-scope.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/component-scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAY1D;AAeD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAAE,GAAG,IAAI,GAAG,IAAI,CAEnH;AAkBD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,GAAG,GAAG,CAAC,M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;;GAyBG;AACH,wBAAgB,sBAAsB,CACpC,CAAC,EAAE,YAAY,EACf,SAAS,EAAE,gBAAgB,EAAE,EAC7B,MAAM,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,EAAE,GACvC,IAAI,CAiBN;AAkFD;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,oBAAoB,EAC9B,cAAc,EAAE,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,KAAK,IAAI,EAC9F,GAAG,EAAE,eAAe,GACnB;IACD,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACvC,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAC9B,CA2EA"}
|
|
@@ -155,9 +155,10 @@ export declare function buildDepthLevels(innerLoops: NestedLoop[], nestedComps:
|
|
|
155
155
|
* e.g. `qsa(__el, ${buildCompSelector(c)})`.
|
|
156
156
|
*
|
|
157
157
|
* - With `slotId`: primary `(bf-h, bf-m)` against the enclosing scope's
|
|
158
|
-
* `__scopeId`, with a `[bf-s$="_<slot>"]` fallback for
|
|
159
|
-
*
|
|
160
|
-
*
|
|
158
|
+
* `__scopeId`, with a `[bf-s$="_<slot>"]` fallback for a DSL adapter's SSR
|
|
159
|
+
* output that doesn't stamp `(bf-h, bf-m)` on this shape (CSR's own
|
|
160
|
+
* `renderChild` stamps both, loop item root included, since #2833). See
|
|
161
|
+
* `spec/compiler.md` "Slot identity".
|
|
161
162
|
* - Without `slotId`: `bf-s^="<Name>_"` name-prefix for top-level lookup.
|
|
162
163
|
*/
|
|
163
164
|
export declare function buildCompSelector(comp: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/ir-to-client-js/control-flow/shared.ts"],"names":[],"mappings":"A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,EAC/C,eAAe,GAAE,OAAe,GAC/B,IAAI,CAuCN;AAED;;;;GAIG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loop.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/stringify/loop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAWH,OAAO,KAAK,EAAE,mBAAmB,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEpG;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,SAAS,mBAAmB,EAAE,EACpC,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,OAAO,CAAC;IAAC,kBAAkB,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GAClH,IAAI,CAaN;AAED;;;;;;;;;;GAUG;AAEH;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,CAoBnE;AAYD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,aAAa,EACnB,SAAS,GAAE,MAAa,GACvB,IAAI,CA+KN;AAoDD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,cAAc,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"loop.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/stringify/loop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAWH,OAAO,KAAK,EAAE,mBAAmB,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEpG;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,SAAS,mBAAmB,EAAE,EACpC,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,OAAO,CAAC;IAAC,kBAAkB,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GAClH,IAAI,CAaN;AAED;;;;;;;;;;GAUG;AAEH;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,CAoBnE;AAYD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,aAAa,EACnB,SAAS,GAAE,MAAa,GACvB,IAAI,CA+KN;AAoDD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,cAAc,GAAG,IAAI,CA4H/E"}
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* and is run once at IR-build time. Emit reads the precomputed values
|
|
24
24
|
* directly with no string transformation of its own.
|
|
25
25
|
*/
|
|
26
|
-
import type { MemoInfo, SignalInfo } from '../types.ts';
|
|
26
|
+
import type { ConstantInfo, MemoInfo, SignalInfo } from '../types.ts';
|
|
27
27
|
import type { BindingScope } from '../scope/binding-scope.ts';
|
|
28
28
|
/**
|
|
29
29
|
* CSR-substituted const value: the const's initializer with every
|
|
@@ -101,13 +101,6 @@ export declare function csrSubstitute(value: string, env: CsrEnv, enclosingScope
|
|
|
101
101
|
rewritten: string;
|
|
102
102
|
freeIdentifiers: ReadonlySet<string>;
|
|
103
103
|
};
|
|
104
|
-
/**
|
|
105
|
-
* Apply the source-level `propsObjectName.X → _p.X` rewrite. Runs as
|
|
106
|
-
* a separate step (not inside `csrSubstitute`) so the substitution
|
|
107
|
-
* output stays in raw form long enough for `isInlinableInTemplate`
|
|
108
|
-
* to detect bridged-arg calls (#1138).
|
|
109
|
-
*/
|
|
110
|
-
export declare function applyPropsRewrite(text: string, propsObjectName: string | null): string;
|
|
111
104
|
export declare function extractFreeIdentifiersFromText(text: string): Set<string>;
|
|
112
105
|
/**
|
|
113
106
|
* Free identifiers referenced by a block of JS *statements* — e.g. an inner
|
|
@@ -145,6 +138,33 @@ export declare function extractFreeIdentifiersFromTemplateText(template: string)
|
|
|
145
138
|
* bindings in scope; inlining the block bare would dangle them.
|
|
146
139
|
*/
|
|
147
140
|
export declare function extractMemoBodyExpr(computation: string): string;
|
|
141
|
+
/**
|
|
142
|
+
* Which local consts are bare alias-hop chains that ultimately name a
|
|
143
|
+
* substitutable signal/memo getter (`isGetter`) — e.g. `const
|
|
144
|
+
* items__alias = items` where `items` is a signal getter. Returns
|
|
145
|
+
* alias name → origin getter name (the alias itself is never a key of
|
|
146
|
+
* its own map, so `origin !== alias` always holds for entries returned).
|
|
147
|
+
*
|
|
148
|
+
* A bare identifier alias of a getter is NOT an "inlinable const" in the
|
|
149
|
+
* ordinary sense (#2778): `populateCsrInlinable`'s generic path resolves
|
|
150
|
+
* a const's initializer through `csrSubstitute`/relocate, and `items`
|
|
151
|
+
* used bare (not called) is a `signal-getter` there, which relocate can
|
|
152
|
+
* only answer with its own `undefined` FALLBACK (correct when `items`
|
|
153
|
+
* itself appears bare, wrong once frozen as `items__alias`'s permanent
|
|
154
|
+
* value — a wrong substitution, not a missing one, so the #2468 scope
|
|
155
|
+
* gate can't see it either since `undefined` is a real in-scope global).
|
|
156
|
+
* Resolving the alias to its origin BEFORE that generic path runs, and
|
|
157
|
+
* registering it as the origin's own call-kind entry, means
|
|
158
|
+
* `items__alias()` is substituted by the exact mechanism that already
|
|
159
|
+
* substitutes `items()` correctly — one call-kind entry, not a second
|
|
160
|
+
* "identifier that means undefined-unless-called" special case.
|
|
161
|
+
*
|
|
162
|
+
* Reuses `resolveAliasOrigin` (`props-binding.ts`) — the same hop-walker
|
|
163
|
+
* `resolveRestSpreadOriginCore` uses for the props/rest alias question —
|
|
164
|
+
* rather than a second alias-chain walker for this different terminal
|
|
165
|
+
* set (a signal/memo NAME here, `restPropsName`/`propsObjectName` there).
|
|
166
|
+
*/
|
|
167
|
+
export declare function resolveGetterAliases(localConstants: readonly ConstantInfo[], isGetter: (name: string) => boolean): Map<string, string>;
|
|
148
168
|
/**
|
|
149
169
|
* Build the CSR substitution env from the live `ClientJsContext`.
|
|
150
170
|
*
|
|
@@ -157,6 +177,12 @@ export declare function extractMemoBodyExpr(computation: string): string;
|
|
|
157
177
|
* in `compute-inlinability.ts`). Inlinable-const substitutions are
|
|
158
178
|
* layered into a copy of this env at `generateCsrTemplate`'s entry,
|
|
159
179
|
* reading from `ClientJsContext.csrInlinable`.
|
|
180
|
+
*
|
|
181
|
+
* `localConstants` is consulted ONLY to resolve bare getter aliases
|
|
182
|
+
* (`resolveGetterAliases`, #2778) — a name that is itself a signal/memo
|
|
183
|
+
* getter always wins the `substitutions.has` check there, so `signals`/
|
|
184
|
+
* `memos` stay the single source of truth for what a getter name means;
|
|
185
|
+
* this just extends which SOURCE NAMES reach that same meaning.
|
|
160
186
|
*/
|
|
161
|
-
export declare function buildSignalMemoEnv(signals: readonly SignalInfo[], memos: readonly MemoInfo[], propsObjectName: string | null): CsrEnv;
|
|
187
|
+
export declare function buildSignalMemoEnv(signals: readonly SignalInfo[], memos: readonly MemoInfo[], propsObjectName: string | null, localConstants?: readonly ConstantInfo[]): CsrEnv;
|
|
162
188
|
//# sourceMappingURL=csr-substitute.d.ts.map
|
|
@@ -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,CA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,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;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,oBAAoB,CAClC,cAAc,EAAE,SAAS,YAAY,EAAE,EACvC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAClC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAarB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,SAAS,UAAU,EAAE,EAC9B,KAAK,EAAE,SAAS,QAAQ,EAAE,EAC1B,eAAe,EAAE,MAAM,GAAG,IAAI,EAC9B,cAAc,GAAE,SAAS,YAAY,EAAO,GAC3C,MAAM,CA+BR"}
|
|
@@ -14,6 +14,16 @@ export declare function emitAttrUpdate(target: string, attrName: string, express
|
|
|
14
14
|
/**
|
|
15
15
|
* Rewrite destructured prop names in an expression to `(props.xxx ?? default)`.
|
|
16
16
|
* Only applies when the component uses destructured props (not props.xxx style).
|
|
17
|
+
*
|
|
18
|
+
* Delegates the actual walk to `rewriteBarePropRefs` (`prop-rewrite.ts`) — the
|
|
19
|
+
* one AST walk in the compiler that already distinguishes a VALUE reference
|
|
20
|
+
* from an object-literal key, a property-access name, a shorthand property,
|
|
21
|
+
* or a name shadowed by an inner binding (`items.map((tag) => tag.x)`).
|
|
22
|
+
* This function used to run its own `\btag\b`-style regex over the raw
|
|
23
|
+
* expression text with no such distinction, so `queryHref(base, { tag: tag })`
|
|
24
|
+
* rewrote the KEY too (`{ _p.tag: _p.tag }`, a syntax error) — #2741. Only
|
|
25
|
+
* the default-value `(_p.x ?? <default>)` wrapping is specific to this call
|
|
26
|
+
* site, supplied via `replacementFor` rather than a second copy of the walk.
|
|
17
27
|
*/
|
|
18
28
|
export declare function rewriteDestructuredPropsInExpr(expr: string, ctx: ClientJsContext): string;
|
|
19
29
|
/** Emit createEffect blocks that update text nodes for reactive expressions. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emit-reactive.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/emit-reactive.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAc,MAAM,aAAa,CAAA;AAEvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"emit-reactive.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/emit-reactive.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAc,MAAM,aAAa,CAAA;AAEvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAyEjD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,EAAE,CAsC7G;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,GAAG,MAAM,CA0BzF;AAwMD,gFAAgF;AAChF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI,CAkFlF;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI,CAiBrF;AAED,kGAAkG;AAClG,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI,CA8BxF;AAED,+FAA+F;AAC/F,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI,CA2DpF;AAED,2FAA2F;AAC3F,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI,CA8ClF"}
|
|
@@ -248,7 +248,39 @@ export declare function irToPlaceholderTemplate(node: IRNode, restSpreadNames?:
|
|
|
248
248
|
* - IRConditional → ternary expression
|
|
249
249
|
* - Single child → single expression; multiple → array literal
|
|
250
250
|
*/
|
|
251
|
-
export declare function irChildrenToJsExpr(children: IRNode[]): string;
|
|
251
|
+
export declare function irChildrenToJsExpr(children: IRNode[], brandMarkup?: boolean): string;
|
|
252
|
+
/**
|
|
253
|
+
* Build the getter-body expression for a `jsx-children` prop value —
|
|
254
|
+
* `collect-elements.ts`'s `buildComponentPropsExpr` and this file's
|
|
255
|
+
* `irNodeToJsExprs` 'component' case both hand a child component this exact
|
|
256
|
+
* value through `get <propName>() { return <expr> }`. The ONE place that
|
|
257
|
+
* decides whether (and how) to brand it with `bfMarkup()` (#2651, #2702).
|
|
258
|
+
*
|
|
259
|
+
* `children` itself is never branded — its consumer is a bare
|
|
260
|
+
* `{children}` passthrough interpolation with no unwrap call, so a branded
|
|
261
|
+
* object there would stringify to `[object Object]`.
|
|
262
|
+
*
|
|
263
|
+
* Otherwise, brand every `'element'` LEAF (`irNodeToJsExprs(..., true)`),
|
|
264
|
+
* not the whole assembled value: `escapeTextOrNode`/`escapeTextOrMarkup`
|
|
265
|
+
* (`@barefootjs/client/runtime`) unwrap a `bfMarkup()`-branded STRING, so a
|
|
266
|
+
* lone element (`header={<strong/>}`), a fragment wrapping one (`header={<>
|
|
267
|
+
* <strong/></>}`), and a conditional/nested-conditional between elements
|
|
268
|
+
* (`header={<>{cond ? <a/> : <b/>}</>}`, #2702) all reduce, after flattening,
|
|
269
|
+
* to exactly ONE branded expression — brand-at-the-leaf makes this sound
|
|
270
|
+
* even when a branch is plain text or an arbitrary expression
|
|
271
|
+
* (`cond ? <a/> : label()`): `irNodeToJsExprs`'s 'text'/'expression' cases
|
|
272
|
+
* never brand, so `label()` still reaches `escapeTextOrNode` unescaped-HTML-free
|
|
273
|
+
* and gets escaped normally, while the `<a/>` branch is trusted.
|
|
274
|
+
*
|
|
275
|
+
* A multi-child fragment (`header={<>text<strong/></>}`) flattens to MORE
|
|
276
|
+
* than one expression — an array, per `irChildrenToJsExpr`'s own contract —
|
|
277
|
+
* and neither runtime unwrapper has an array contract, so that shape stays
|
|
278
|
+
* exactly as it rendered before this function existed: unbranded, via the
|
|
279
|
+
* plain (unbranded) `irChildrenToJsExpr` call below. This is a pre-existing,
|
|
280
|
+
* separate gap (tracked apart from #2702), not something this function
|
|
281
|
+
* silently "fixes" by guessing at a new consumer contract.
|
|
282
|
+
*/
|
|
283
|
+
export declare function jsxChildrenPropGetterExpr(children: IRNode[], propName: string): string;
|
|
252
284
|
/**
|
|
253
285
|
* Add bf-c attribute to the first element in an HTML template string.
|
|
254
286
|
* This ensures cond() can find the element for subsequent swaps.
|
|
@@ -262,6 +294,21 @@ export interface TemplateOptions {
|
|
|
262
294
|
inlinableConstants?: Map<string, string>;
|
|
263
295
|
restSpreadNames?: ReadonlySet<string>;
|
|
264
296
|
propsObjectName?: string | null;
|
|
297
|
+
/**
|
|
298
|
+
* The rest-bag binding's source name (`ctx.restPropsName` — `'rest'` in
|
|
299
|
+
* `{ children, ...rest }`), threaded alongside `propsObjectName` into
|
|
300
|
+
* `rewritePropsObjectRef` so a component that reads the rest binding
|
|
301
|
+
* directly in its own body (`{rest.header}`, not just spread onto an
|
|
302
|
+
* element via `applyRestAttrs`) resolves to `_p` here too (#2806).
|
|
303
|
+
* Not folded into `restSpreadNames`: that set is spread-filter
|
|
304
|
+
* membership keyed by raw expression text (`isFilteredSpread`,
|
|
305
|
+
* `collect-elements.ts`'s exclude-key resolution) and must keep seeing
|
|
306
|
+
* the untouched name; this field is the separate "identifier to rewrite"
|
|
307
|
+
* input `rewritePropsObjectRef` already accepts for the init body
|
|
308
|
+
* (`generate-init.ts`) — the four template builders below were the only
|
|
309
|
+
* callers still passing `null` for it.
|
|
310
|
+
*/
|
|
311
|
+
restPropsName?: string | null;
|
|
265
312
|
/**
|
|
266
313
|
* Names that exist only in the init-body scope (or were demoted to unsafe
|
|
267
314
|
* during chained-ref resolution). The CSR template runs at module scope
|
|
@@ -347,7 +394,7 @@ export interface TemplateOptions {
|
|
|
347
394
|
* - Local constant references are inlined with their resolved values (#343)
|
|
348
395
|
* - bf markers ARE included so client code can find elements
|
|
349
396
|
*/
|
|
350
|
-
export declare function irToComponentTemplate(node: IRNode, inlinableConstants?: Map<string, string>, restSpreadNames?: ReadonlySet<string>, propsObjectName?: string | null, markupSlotIds?: ReadonlySet<string
|
|
397
|
+
export declare function irToComponentTemplate(node: IRNode, inlinableConstants?: Map<string, string>, restSpreadNames?: ReadonlySet<string>, propsObjectName?: string | null, markupSlotIds?: ReadonlySet<string>, restPropsName?: string | null): string;
|
|
351
398
|
/**
|
|
352
399
|
* Check if a component can have a simple static template generated.
|
|
353
400
|
* Returns false if the component has:
|
|
@@ -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,EAAwC,MAAM,EAAU,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAGxI,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAG/C,OAAO,
|
|
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,EAAwC,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pF"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Import detection and DOM import management.
|
|
3
3
|
*/
|
|
4
4
|
import type { ComponentIR } from '../types.ts';
|
|
5
|
-
export declare const RUNTIME_IMPORT_CANDIDATES: readonly ['createSignal', 'createMemo', 'createEffect', 'onCleanup', 'onMount', 'hydrate', 'insert', 'getLoopChildren', 'getLoopNodes', 'mapArray', 'mapArrayAnchored', 'mapArrayLazy', 'patchLeaf', 'createDisposableEffect', 'findCondContainer', 'createComponent', 'renderChild', 'registerComponent', 'registerTemplate', 'initChild', 'upsertChild', 'mountRowRoot', 'createPortal', 'provideContext', 'createContext', 'useContext', 'forwardProps', 'applyRestAttrs', 'splitProps', 'spreadAttrs', 'styleToCss', 'escapeAttr', 'escapeText', 'escapeTextOrNode', 'bfMarkup', 'escapeTextOrMarkup', 'markupOrEmpty', 'qsa', 'qsaItem', 'qsaChildScope', 'qsaChildScopes', 'upsertChildItem', '__slot', '__bfSlot', '__bfText', 'claimSlots', 'lazySlots', 'lazyClaimSlots', 'textOrNode', 'beginTurn', 'endTurn', 'date', 'formatDate'];
|
|
5
|
+
export declare const RUNTIME_IMPORT_CANDIDATES: readonly ['createSignal', 'createMemo', 'createEffect', 'onCleanup', 'onMount', 'hydrate', 'insert', 'getLoopChildren', 'getLoopNodes', 'mapArray', 'mapArrayAnchored', 'mapArrayLazy', 'patchLeaf', 'createDisposableEffect', 'findCondContainer', 'createComponent', 'renderChild', 'registerComponent', 'registerTemplate', 'initChild', 'upsertChild', 'mountRowRoot', 'withParentScope', 'createPortal', 'provideContext', 'createContext', 'useContext', 'forwardProps', 'applyRestAttrs', 'splitProps', 'spreadAttrs', 'styleToCss', 'escapeAttr', 'escapeText', 'escapeTextOrNode', 'bfMarkup', 'escapeTextOrMarkup', 'markupOrEmpty', 'qsa', 'qsaItem', 'qsaChildScope', 'qsaChildScopes', 'upsertChildItem', '__slot', '__bfSlot', '__bfText', 'claimSlots', 'lazySlots', 'lazyClaimSlots', 'textOrNode', 'beginTurn', 'endTurn', 'date', 'formatDate'];
|
|
6
6
|
/** @deprecated Use RUNTIME_IMPORT_CANDIDATES */
|
|
7
|
-
export declare const DOM_IMPORT_CANDIDATES: readonly ["createSignal", "createMemo", "createEffect", "onCleanup", "onMount", "hydrate", "insert", "getLoopChildren", "getLoopNodes", "mapArray", "mapArrayAnchored", "mapArrayLazy", "patchLeaf", "createDisposableEffect", "findCondContainer", "createComponent", "renderChild", "registerComponent", "registerTemplate", "initChild", "upsertChild", "mountRowRoot", "createPortal", "provideContext", "createContext", "useContext", "forwardProps", "applyRestAttrs", "splitProps", "spreadAttrs", "styleToCss", "escapeAttr", "escapeText", "escapeTextOrNode", "bfMarkup", "escapeTextOrMarkup", "markupOrEmpty", "qsa", "qsaItem", "qsaChildScope", "qsaChildScopes", "upsertChildItem", "__slot", "__bfSlot", "__bfText", "claimSlots", "lazySlots", "lazyClaimSlots", "textOrNode", "beginTurn", "endTurn", "date", "formatDate"];
|
|
7
|
+
export declare const DOM_IMPORT_CANDIDATES: readonly ["createSignal", "createMemo", "createEffect", "onCleanup", "onMount", "hydrate", "insert", "getLoopChildren", "getLoopNodes", "mapArray", "mapArrayAnchored", "mapArrayLazy", "patchLeaf", "createDisposableEffect", "findCondContainer", "createComponent", "renderChild", "registerComponent", "registerTemplate", "initChild", "upsertChild", "mountRowRoot", "withParentScope", "createPortal", "provideContext", "createContext", "useContext", "forwardProps", "applyRestAttrs", "splitProps", "spreadAttrs", "styleToCss", "escapeAttr", "escapeText", "escapeTextOrNode", "bfMarkup", "escapeTextOrMarkup", "markupOrEmpty", "qsa", "qsaItem", "qsaChildScope", "qsaChildScopes", "upsertChildItem", "__slot", "__bfSlot", "__bfText", "claimSlots", "lazySlots", "lazyClaimSlots", "textOrNode", "beginTurn", "endTurn", "date", "formatDate"];
|
|
8
8
|
export declare const RUNTIME_MODULE = "@barefootjs/client/runtime";
|
|
9
9
|
export declare const IMPORT_PLACEHOLDER = "/* __BAREFOOTJS_DOM_IMPORTS__ */";
|
|
10
10
|
export declare const MODULE_CONSTANTS_PLACEHOLDER = "/* __MODULE_LEVEL_CONSTANTS__ */";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/imports.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,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,EAK7I,mBAAmB,EACnB,iBAAiB,EAAE,aAAa,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,WAAW,EAAE,aAAa,EAKrG,cAAc,
|
|
1
|
+
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/imports.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,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,EAK7I,mBAAmB,EACnB,iBAAiB,EAAE,aAAa,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,WAAW,EAAE,aAAa,EAKrG,cAAc,EAId,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAAE,eAAe,EAAE,YAAY,EAC/C,cAAc,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAI3H,UAAU,EAAE,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AAC,EAAE,OAAO,GAChB,cAAc,CAsChB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,WAAW,GAAG;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE,CAiC/F"}
|
|
@@ -22,6 +22,17 @@
|
|
|
22
22
|
* fields) and introduce a `PropRewritten<T>` brand type so missing the
|
|
23
23
|
* rewrite becomes a compile-time error.
|
|
24
24
|
*/
|
|
25
|
+
import type { BindingScope } from '../scope/binding-scope.ts';
|
|
26
|
+
export interface PropsObjectRewriteOptions {
|
|
27
|
+
/**
|
|
28
|
+
* SHADOW GUARD (CLAUDE.md's `BindingScope` distinction — `isBound()`,
|
|
29
|
+
* not `valueBoundNames()`): a `.map(props => ...)` row whose callback
|
|
30
|
+
* PARAMETER happens to be named the same as the outer `propsObjectName`
|
|
31
|
+
* must not have that parameter rewritten to `_p` — it shadows the outer
|
|
32
|
+
* props object inside its own row, same as any other bound name would.
|
|
33
|
+
*/
|
|
34
|
+
enclosingScope?: BindingScope;
|
|
35
|
+
}
|
|
25
36
|
/**
|
|
26
37
|
* Rename every value-position reference to `propsObjectName` — and,
|
|
27
38
|
* independently, to `restPropsName` (#2723) — in `code` to `_p`.
|
|
@@ -55,5 +66,5 @@
|
|
|
55
66
|
* whose props param IS its own rest destructure target, if that shape
|
|
56
67
|
* ever arises, would otherwise walk the AST twice for the same name).
|
|
57
68
|
*/
|
|
58
|
-
export declare function rewritePropsObjectRef(code: string, propsObjectName: string | null, restPropsName?: string | null): string;
|
|
69
|
+
export declare function rewritePropsObjectRef(code: string, propsObjectName: string | null, restPropsName?: string | null, opts?: PropsObjectRewriteOptions): string;
|
|
59
70
|
//# sourceMappingURL=rewrite-props-object.d.ts.map
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;GAuBG;
|
|
1
|
+
{"version":3,"file":"rewrite-props-object.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/rewrite-props-object.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAE7D,MAAM,WAAW,yBAAyB;IACxC;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,YAAY,CAAA;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,MAAM,GAAG,IAAI,EAC9B,aAAa,GAAE,MAAM,GAAG,IAAW,EACnC,IAAI,CAAC,EAAE,yBAAyB,GAC/B,MAAM,CAUR"}
|
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;AAghCpI,wBAAgB,OAAO,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,GAAG,IAAI,CAOhE"}
|
|
@@ -112,6 +112,18 @@ export declare function prepareLoweringMatchers(metadata: IRMetadata): LoweringM
|
|
|
112
112
|
* call sites.
|
|
113
113
|
*/
|
|
114
114
|
export declare function matchLoweringCall(callee: ParsedExpr, args: readonly ParsedExpr[], metadata: IRMetadata): LoweringNode | null;
|
|
115
|
+
/**
|
|
116
|
+
* The child expressions a plugin took responsibility for inside a matched
|
|
117
|
+
* call (#2843) — the base + every triple's value/guard for a `guard-list`,
|
|
118
|
+
* or the args for a `helper-call`. Shared by the support gate
|
|
119
|
+
* (`checkSupport`'s `call` arm in `expression-parser.ts`, which recurses
|
|
120
|
+
* into these instead of refusing the call's raw argument shapes — a
|
|
121
|
+
* `guard-list`'s params object literal, for instance, would otherwise be
|
|
122
|
+
* refused before any adapter ever sees the recognised node) and any future
|
|
123
|
+
* walker that needs the same "what did this plugin actually consume"
|
|
124
|
+
* answer, so the two can't drift on what counts as consumed.
|
|
125
|
+
*/
|
|
126
|
+
export declare function loweringNodeChildren(node: LoweringNode): ParsedExpr[];
|
|
115
127
|
/**
|
|
116
128
|
* Whether a `LoweringNode.helper` id is safe to splice directly into an
|
|
117
129
|
* adapter's runtime-helper naming convention (`bf_${helper}` in Go,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lowering-registry.d.ts","sourceRoot":"","sources":["../src/lowering-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,UAAU,GAAG,IAAI,CAAA;IACxB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,UAAU,CAAA;CAClB;AAED;;;;GAIG;AACH,MAAM,MAAM,YAAY;AACtB;;;;;;;;;GASG;AACD;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,cAAc,EAAE,CAAA;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,IAAI,EAAE,YAAY,GAAG,UAAU,EAAE,CAQrE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,GAAE,SAAS,cAAc,EAAO,GAAG,IAAI,CAGxF"}
|
package/dist/prop-rewrite.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ export declare function collectAstPropRefs(node: ts.Node, propNames: Set<string>
|
|
|
38
38
|
* expression — it cannot see scopes, so `applyScopedPropRefRewrite`
|
|
39
39
|
* is always tried first.
|
|
40
40
|
*/
|
|
41
|
-
export declare function applyRegexPropRefRewrite(text: string, propRefs: Iterable<string>, propAliases?: ReadonlyMap<string, string
|
|
41
|
+
export declare function applyRegexPropRefRewrite(text: string, propRefs: Iterable<string>, propAliases?: ReadonlyMap<string, string>, replacementFor?: (localName: string, callerKey: string) => string): string;
|
|
42
42
|
/**
|
|
43
43
|
* Rewrite bare destructured prop references in expression text.
|
|
44
44
|
* Returns undefined if no rewriting was needed.
|
|
@@ -56,6 +56,9 @@ export declare function applyRegexPropRefRewrite(text: string, propRefs: Iterabl
|
|
|
56
56
|
* `_p` is always keyed by the caller-facing name (#2524 CSR half); a name
|
|
57
57
|
* absent from this map emits `_p.<name>` unchanged (the un-aliased case,
|
|
58
58
|
* where `sourceName ?? name` is an identity).
|
|
59
|
+
* @param replacementFor - Override the substitution text for a value
|
|
60
|
+
* reference (default `${PROPS_PARAM}.<callerKey>`) — see
|
|
61
|
+
* `applyScopedPropRefRewrite`'s docstring.
|
|
59
62
|
*/
|
|
60
|
-
export declare function rewriteBarePropRefs(text: string, node: ts.Node, propNames: Set<string>, extraPropRefs?: ReadonlySet<string>, propAliases?: ReadonlyMap<string, string
|
|
63
|
+
export declare function rewriteBarePropRefs(text: string, node: ts.Node, propNames: Set<string>, extraPropRefs?: ReadonlySet<string>, propAliases?: ReadonlyMap<string, string>, replacementFor?: (localName: string, callerKey: string) => string): string | undefined;
|
|
61
64
|
//# sourceMappingURL=prop-rewrite.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-rewrite.d.ts","sourceRoot":"","sources":["../src/prop-rewrite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAA;AAoF3B;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,EACtB,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,GACf,IAAI,CAON;
|
|
1
|
+
{"version":3,"file":"prop-rewrite.d.ts","sourceRoot":"","sources":["../src/prop-rewrite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAA;AAoF3B;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,EACtB,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,GACf,IAAI,CAON;AA8DD;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,EAC1B,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EACzC,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,GAChE,MAAM,CAqBR;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,EACtB,aAAa,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EACnC,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EACzC,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,GAChE,MAAM,GAAG,SAAS,CAcpB"}
|
package/dist/props-binding.d.ts
CHANGED
|
@@ -37,6 +37,24 @@ export declare function propsDestructureBinding(p: ParamInfo): string;
|
|
|
37
37
|
* short-circuit.
|
|
38
38
|
*/
|
|
39
39
|
export declare function buildPropAliasMap(params: readonly ParamInfo[]): Map<string, string> | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* The props-parameter shape needed to answer "is `name` an actual local
|
|
42
|
+
* binding introduced by the props parameter" — as opposed to
|
|
43
|
+
* `ctx.patterns.props`, which for a whole `(props: Props)` parameter holds
|
|
44
|
+
* every TYPE-MEMBER name (`extractPropsFromTypeMembers`) for regex prop-
|
|
45
|
+
* access matching, not real bindings.
|
|
46
|
+
*/
|
|
47
|
+
export interface PropsParamBindings {
|
|
48
|
+
propsParams: readonly ParamInfo[];
|
|
49
|
+
propsObjectName: string | null;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Local names actually bound by the props parameter. Empty for a whole
|
|
53
|
+
* `(props: Props)` parameter: `propsParams` there is type-member names
|
|
54
|
+
* (nothing local to shadow with), and `props` itself is `propsObjectName`,
|
|
55
|
+
* checked separately by callers.
|
|
56
|
+
*/
|
|
57
|
+
export declare function boundPropLocalNames(b: PropsParamBindings): ReadonlySet<string>;
|
|
40
58
|
/**
|
|
41
59
|
* The two component bindings that forward the caller's leftover props:
|
|
42
60
|
* the destructured `...rest` binding and a whole undestructured `(props)`
|
|
@@ -49,10 +67,37 @@ export interface RestSpreadBindings {
|
|
|
49
67
|
propsObjectName: string | null;
|
|
50
68
|
}
|
|
51
69
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
70
|
+
* Walks a bare `const x__alias = <name>` hop chain recorded in
|
|
71
|
+
* `constantValues` (name → initializer text) until `terminal` recognizes
|
|
72
|
+
* the current name, returning what it recognized. `null` when the chain
|
|
73
|
+
* runs out (a constant whose value isn't a bare identifier — a real
|
|
74
|
+
* computed object — stops the walk) or degenerates into a cycle.
|
|
75
|
+
*
|
|
76
|
+
* The one alias-hop walker in the compiler, shared by every caller that
|
|
77
|
+
* needs "does this name ultimately reach some fixed binding" rather than
|
|
78
|
+
* a bespoke copy per caller — `resolveRestSpreadOriginCore` below,
|
|
79
|
+
* `resolveGetterAliases` (`csr-substitute.ts`, #2778), and
|
|
80
|
+
* `isArrayExprDirectPropRef` (`jsx-to-ir.ts`, #2724, called directly rather
|
|
81
|
+
* than through a `*Core`-style wrapper) are its callers, differing only in
|
|
82
|
+
* what `terminal` recognizes as a hit — and, for `isArrayExprDirectPropRef`,
|
|
83
|
+
* in also narrowing `constantValues` itself (`propAliasHopCandidates`)
|
|
84
|
+
* before passing it in. `terminal` is checked BEFORE the constant-value
|
|
85
|
+
* lookup so a name that is itself a target take priority over any
|
|
86
|
+
* same-named local shadowing it (preserves `resolveRestSpreadOriginCore`'s
|
|
87
|
+
* original hop order) — a caller whose `terminal` can itself be fooled by a
|
|
88
|
+
* shadowed name (e.g. a scope-unaware lookup keyed only by name) must guard
|
|
89
|
+
* that inside `terminal`, since this walker has no scope/binding awareness
|
|
90
|
+
* of its own to do it centrally.
|
|
91
|
+
*
|
|
92
|
+
* `visited` guards a constant cycle (`const a = b; const b = a`); walking
|
|
93
|
+
* hop by hop (not a precomputed set) is what lets a multi-hop alias
|
|
94
|
+
* (`const p2 = props; const p3 = p2`) resolve through every link.
|
|
95
|
+
*/
|
|
96
|
+
export declare function resolveAliasOrigin<T>(constantValues: ReadonlyMap<string, string | undefined>, name: string, terminal: (name: string) => T | null): T | null;
|
|
97
|
+
/**
|
|
98
|
+
* Which of `bindings` the name `name` ultimately reaches. `'rest'` for the
|
|
99
|
+
* destructured rest binding, `'props'` for the whole props object, `null`
|
|
100
|
+
* for anything else.
|
|
56
101
|
*
|
|
57
102
|
* The single definition of "this `{...spread}` forwards the caller's
|
|
58
103
|
* leftover props", shared by the two phases that must agree on it: Phase 1
|
|
@@ -63,13 +108,6 @@ export interface RestSpreadBindings {
|
|
|
63
108
|
* `spreadAttrs({...})` merge. Two copies of the rule would let an element
|
|
64
109
|
* qualify for one and not the other, which is exactly the silent-drop
|
|
65
110
|
* shape #2754 reports.
|
|
66
|
-
*
|
|
67
|
-
* Walks hop by hop (not a precomputed set) so a multi-hop alias
|
|
68
|
-
* (`const p2 = props; const p3 = p2`) resolves through every link;
|
|
69
|
-
* `visited` guards a constant cycle (`const a = b; const b = a`). A
|
|
70
|
-
* constant whose value isn't a bare identifier on the chain (a real
|
|
71
|
-
* computed object) stops the walk, so a genuinely different spread
|
|
72
|
-
* expression is never mistaken for the rest object.
|
|
73
111
|
*/
|
|
74
112
|
export declare function resolveRestSpreadOriginCore(bindings: RestSpreadBindings, constantValues: ReadonlyMap<string, string | undefined>, name: string): 'rest' | 'props' | null;
|
|
75
113
|
//# sourceMappingURL=props-binding.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props-binding.d.ts","sourceRoot":"","sources":["../src/props-binding.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE3C;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAWrD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CAO5D;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAS/F;AAED;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,aAAa,EA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AE,kBAAkB,EAC5B,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EACvD,IAAI,EAAE,MAAM,GACX,MAAM,GAAG,OAAO,GAAG,IAAI,CAMzB"}
|
package/dist/types.d.ts
CHANGED
|
@@ -464,7 +464,9 @@ export interface IRLoop {
|
|
|
464
464
|
*/
|
|
465
465
|
isStaticArray: boolean;
|
|
466
466
|
/**
|
|
467
|
-
* True when the array is a direct prop reference promoted to mapArray
|
|
467
|
+
* True when the array is a direct prop reference promoted to mapArray
|
|
468
|
+
* (#1586) — including one reached only through a bare `const x = y`
|
|
469
|
+
* alias-hop chain (`isArrayExprDirectPropRef`, jsx-to-ir.ts, #2724).
|
|
468
470
|
* Adapters use this to include the array in JSON serialization (bf-p)
|
|
469
471
|
* even though isStaticArray is false — the client's mapArray needs the
|
|
470
472
|
* initial data for hydration, unlike signal-backed arrays.
|
|
@@ -1335,10 +1337,9 @@ export interface SignalInfo {
|
|
|
1335
1337
|
* `templateCondition` fields on other IR positions. Destructured mode
|
|
1336
1338
|
* only (`propsObjectName === null`); undefined when no rewrite was
|
|
1337
1339
|
* needed (no destructured prop referenced) or the component is in
|
|
1338
|
-
* object-props mode (there, `rewritePropsObjectRef
|
|
1339
|
-
*
|
|
1340
|
-
*
|
|
1341
|
-
* AST-level pre-rewrite).
|
|
1340
|
+
* object-props mode (there, `rewritePropsObjectRef` handles `props.x` →
|
|
1341
|
+
* `_p.x` on the final joined/substituted string instead, since a bare
|
|
1342
|
+
* `props.x` textual match works without an AST-level pre-rewrite).
|
|
1342
1343
|
*/
|
|
1343
1344
|
templateInitialValue?: string;
|
|
1344
1345
|
/**
|