@barefootjs/jsx 0.33.0 → 0.33.1
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/analyzer.d.ts.map +1 -1
- package/dist/errors.d.ts +1 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/index.js +145 -40
- package/dist/ir-to-client-js/collect-elements.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/build-inner-loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/build-loop-child-arm.d.ts +8 -0
- package/dist/ir-to-client-js/control-flow/plan/build-loop-child-arm.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/build-reactive-effects.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/inner-loop.d.ts +12 -0
- package/dist/ir-to-client-js/control-flow/plan/inner-loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/inner-loop.d.ts +1 -0
- package/dist/ir-to-client-js/control-flow/stringify/inner-loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/lazy-row.d.ts.map +1 -1
- package/dist/ir-to-client-js/element-refs.d.ts.map +1 -1
- package/dist/ir-to-client-js/emit-reactive.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/phases/provider-and-child-inits.d.ts.map +1 -1
- package/dist/ir-to-client-js/types.d.ts +21 -0
- package/dist/ir-to-client-js/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/__snapshots__/doc-examples.test.ts.snap +2 -4
- package/src/__tests__/child-components-in-map.test.ts +11 -3
- package/src/__tests__/client-js-generation.test.ts +37 -1
- package/src/__tests__/inline-jsx-callback.test.ts +55 -0
- package/src/__tests__/ir-jsx-props.test.ts +148 -0
- package/src/__tests__/issue-2705-branch-inner-loop-container.test.ts +91 -0
- package/src/__tests__/markup-prop-brand.test.ts +49 -0
- package/src/__tests__/nested-loop-conditional.test.ts +20 -11
- package/src/__tests__/return-through-local-var.test.ts +269 -0
- package/src/analyzer.ts +71 -0
- package/src/errors.ts +17 -1
- package/src/ir-to-client-js/collect-elements.ts +31 -20
- package/src/ir-to-client-js/control-flow/plan/build-inner-loop.ts +19 -0
- package/src/ir-to-client-js/control-flow/plan/build-loop-child-arm.ts +22 -3
- package/src/ir-to-client-js/control-flow/plan/build-reactive-effects.ts +5 -2
- package/src/ir-to-client-js/control-flow/plan/inner-loop.ts +12 -0
- package/src/ir-to-client-js/control-flow/stringify/inner-loop.ts +9 -0
- package/src/ir-to-client-js/control-flow/stringify/lazy-row.ts +7 -1
- package/src/ir-to-client-js/element-refs.ts +8 -0
- package/src/ir-to-client-js/emit-reactive.ts +91 -23
- package/src/ir-to-client-js/imports.ts +5 -0
- package/src/ir-to-client-js/index.ts +4 -0
- package/src/ir-to-client-js/phases/provider-and-child-inits.ts +5 -1
- package/src/ir-to-client-js/types.ts +21 -0
- package/src/jsx-to-ir.ts +157 -8
package/dist/analyzer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../src/analyzer.ts"],"names":[],"mappings":"AACA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAA;AAG3B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAInE,OAAO,EACL,KAAK,eAAe,EAUrB,MAAM,uBAAuB,CAAA;AAqB9B;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAU/D;AA8BD;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf;IAAE,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC;IAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC;IAAC,OAAO,EAAE,EA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I,CA4EvE;AAiID,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAA"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export declare const ErrorCodes: {
|
|
|
10
10
|
readonly MISSING_KEY_IN_LIST: 'BF023';
|
|
11
11
|
readonly MISSING_KEY_IN_NESTED_LIST: 'BF024';
|
|
12
12
|
readonly UNSUPPORTED_DESTRUCTURE_REST: 'BF025';
|
|
13
|
+
readonly RETURN_VALUE_NOT_JSX: 'BF027';
|
|
13
14
|
readonly PROPS_DESTRUCTURING: 'BF043';
|
|
14
15
|
readonly SIGNAL_GETTER_NOT_CALLED: 'BF044';
|
|
15
16
|
readonly JSX_IN_LOCAL_FUNCTION: 'BF045';
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,eAAe,EACf,cAAc,EACf,MAAM,YAAY,CAAA;AAMnB,eAAO,MAAM,UAAU;aAErB,kBAAkB,EAAE,OAAO;aAC3B,uBAAuB,EAAE,OAAO;aAGhC,wBAAwB,EAAE,OAAO;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,eAAe,EACf,cAAc,EACf,MAAM,YAAY,CAAA;AAMnB,eAAO,MAAM,UAAU;aAErB,kBAAkB,EAAE,OAAO;aAC3B,uBAAuB,EAAE,OAAO;aAGhC,wBAAwB,EAAE,OAAO;aAMjC,uBAAuB,EAAE,OAAO;aAChC,mBAAmB,EAAE,OAAO;aAC5B,0BAA0B,EAAE,OAAO;aACnC,4BAA4B,EAAE,OAAO;aAUrC,oBAAoB,EAAE,OAAO;aAG7B,mBAAmB,EAAE,OA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CAAC,EAAE,eAAe,CAAA;CAC7B,GACA,aAAa,CAEf;AAMD,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,cAAc,EACnB,YAAY,SAAI,GACf,MAAM,CA6BR;AAmBD,wBAAgB,WAAW,CACzB,KAAK,EAAE,aAAa,EACpB,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GAChC,MAAM,CA6CR;AAMD;;;;;;;GAOG;AACH,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,YAAY,OAAO,EAAE,MAAM,EAG1B;CACF;AAED,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAId;AAMD,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAChB,cAAc,CAMhB;AAED,wBAAgB,cAAc,CAC5B,KAAK,EAAE,cAAc,EACrB,GAAG,EAAE,cAAc,GAClB,cAAc,CAMhB"}
|
package/dist/index.js
CHANGED
|
@@ -5634,6 +5634,7 @@ var ErrorCodes = {
|
|
|
5634
5634
|
MISSING_KEY_IN_LIST: "BF023",
|
|
5635
5635
|
MISSING_KEY_IN_NESTED_LIST: "BF024",
|
|
5636
5636
|
UNSUPPORTED_DESTRUCTURE_REST: "BF025",
|
|
5637
|
+
RETURN_VALUE_NOT_JSX: "BF027",
|
|
5637
5638
|
PROPS_DESTRUCTURING: "BF043",
|
|
5638
5639
|
SIGNAL_GETTER_NOT_CALLED: "BF044",
|
|
5639
5640
|
JSX_IN_LOCAL_FUNCTION: "BF045",
|
|
@@ -5665,6 +5666,7 @@ var errorMessages = {
|
|
|
5665
5666
|
[ErrorCodes.MISSING_KEY_IN_LIST]: "Missing key attribute in list rendering. Add a key prop for efficient updates",
|
|
5666
5667
|
[ErrorCodes.MISSING_KEY_IN_NESTED_LIST]: "Nested .map() loop requires key attribute for event delegation. Add a key prop to elements in the inner loop",
|
|
5667
5668
|
[ErrorCodes.UNSUPPORTED_DESTRUCTURE_REST]: "Computed property key in .map() callback destructure is not supported. Rewrite the callback to destructure explicit bindings (e.g., `({ a, b }) => ...`) so the compiler can rewrite references to per-item signal accessors.",
|
|
5669
|
+
[ErrorCodes.RETURN_VALUE_NOT_JSX]: "Component's return value is not recognized as JSX — return the JSX expression directly instead of binding it to a local variable first.",
|
|
5668
5670
|
[ErrorCodes.PROPS_DESTRUCTURING]: "Props destructuring in function parameters breaks reactivity. Use props object directly.",
|
|
5669
5671
|
[ErrorCodes.SIGNAL_GETTER_NOT_CALLED]: "Signal/memo getter passed without calling it. Use getter() to read the value.",
|
|
5670
5672
|
[ErrorCodes.JSX_IN_LOCAL_FUNCTION]: "Local function returns JSX but cannot be inlined. Extract it as a top-level PascalCase component or use a single return statement.",
|
|
@@ -6306,6 +6308,14 @@ function visitComponentBody(node, ctx) {
|
|
|
6306
6308
|
}
|
|
6307
6309
|
}
|
|
6308
6310
|
if (isTopLevel && (ts9.isTryStatement(node) || ts9.isSwitchStatement(node) || ts9.isForStatement(node) || ts9.isForInStatement(node) || ts9.isForOfStatement(node) || ts9.isWhileStatement(node) || ts9.isDoStatement(node) || ts9.isThrowStatement(node) || ts9.isBlock(node) && node.parent === ctx.componentBodyBlock)) {
|
|
6311
|
+
if (ts9.isBlock(node)) {
|
|
6312
|
+
const returnedLocal = findBlockBodyReturnedJsxLocalName(node);
|
|
6313
|
+
if (returnedLocal) {
|
|
6314
|
+
ctx.errors.push(createError(ErrorCodes.RETURN_VALUE_NOT_JSX, getSourceLocation(node, ctx.sourceFile, ctx.filePath), {
|
|
6315
|
+
message: `Component '${ctx.componentName ?? "(unknown)"}' return value is not recognized ` + `as JSX — return the JSX expression directly instead of binding it to a local ` + `variable first (\`return ${returnedLocal}\` after \`const ${returnedLocal} = ` + `<jsx/>\` is not resolved at return position).`
|
|
6316
|
+
}));
|
|
6317
|
+
}
|
|
6318
|
+
}
|
|
6309
6319
|
collectInitStatement(node, ctx);
|
|
6310
6320
|
return;
|
|
6311
6321
|
}
|
|
@@ -6341,6 +6351,31 @@ function unwrapJsxTransparent(expr) {
|
|
|
6341
6351
|
}
|
|
6342
6352
|
return current;
|
|
6343
6353
|
}
|
|
6354
|
+
function findBlockBodyReturnedJsxLocalName(block) {
|
|
6355
|
+
const stmts = block.statements;
|
|
6356
|
+
const last = stmts[stmts.length - 1];
|
|
6357
|
+
if (!last || !ts9.isReturnStatement(last) || !last.expression)
|
|
6358
|
+
return null;
|
|
6359
|
+
const returned = unwrapJsxTransparent(last.expression);
|
|
6360
|
+
if (!ts9.isIdentifier(returned))
|
|
6361
|
+
return null;
|
|
6362
|
+
const name = returned.text;
|
|
6363
|
+
for (const stmt of stmts) {
|
|
6364
|
+
if (!ts9.isVariableStatement(stmt))
|
|
6365
|
+
continue;
|
|
6366
|
+
for (const decl of stmt.declarationList.declarations) {
|
|
6367
|
+
if (!ts9.isIdentifier(decl.name) || decl.name.text !== name || !decl.initializer)
|
|
6368
|
+
continue;
|
|
6369
|
+
let init = decl.initializer;
|
|
6370
|
+
while (ts9.isParenthesizedExpression(init))
|
|
6371
|
+
init = init.expression;
|
|
6372
|
+
if (ts9.isJsxElement(init) || ts9.isJsxSelfClosingElement(init) || ts9.isJsxFragment(init) || initializerShapeContainsJsx(init) || isMapLikeCallWithJsx(init)) {
|
|
6373
|
+
return name;
|
|
6374
|
+
}
|
|
6375
|
+
}
|
|
6376
|
+
}
|
|
6377
|
+
return null;
|
|
6378
|
+
}
|
|
6344
6379
|
function extractJsxFromExpression(expr) {
|
|
6345
6380
|
const inner = unwrapJsxTransparent(expr);
|
|
6346
6381
|
if (ts9.isJsxElement(inner) || ts9.isJsxFragment(inner) || ts9.isJsxSelfClosingElement(inner)) {
|
|
@@ -10710,8 +10745,14 @@ function buildIRRoot(analyzer) {
|
|
|
10710
10745
|
}
|
|
10711
10746
|
ctx.isRoot = false;
|
|
10712
10747
|
const ir = transformJsxExpression(jsxReturn, ctx);
|
|
10713
|
-
if (ir === null)
|
|
10748
|
+
if (ir === null) {
|
|
10749
|
+
if (ts13.isIdentifier(jsxReturn) && (analyzer.jsxConstants.has(jsxReturn.text) || analyzer.inlineableJsxConsts.has(jsxReturn.text))) {
|
|
10750
|
+
analyzer.errors.push(createError(ErrorCodes.RETURN_VALUE_NOT_JSX, getSourceLocation(jsxReturn, analyzer.sourceFile, analyzer.filePath), {
|
|
10751
|
+
message: `Component '${analyzer.componentName ?? "(unknown)"}' return value is not recognized ` + `as JSX — return the JSX expression directly instead of binding it to a local variable ` + `first (\`return ${jsxReturn.text}\` after \`const ${jsxReturn.text} = <jsx/>\` is not ` + `resolved at return position).`
|
|
10752
|
+
}));
|
|
10753
|
+
}
|
|
10714
10754
|
return null;
|
|
10755
|
+
}
|
|
10715
10756
|
return wrapInScopeElement(ir);
|
|
10716
10757
|
}
|
|
10717
10758
|
function needsScopeWrapper(ir) {
|
|
@@ -13826,6 +13867,35 @@ function getStringValue(node) {
|
|
|
13826
13867
|
}
|
|
13827
13868
|
return null;
|
|
13828
13869
|
}
|
|
13870
|
+
function unwrapTransparentTsWrappers(node) {
|
|
13871
|
+
let n = node;
|
|
13872
|
+
while (ts13.isParenthesizedExpression(n) || ts13.isAsExpression(n) || ts13.isSatisfiesExpression(n) || ts13.isNonNullExpression(n)) {
|
|
13873
|
+
n = n.expression;
|
|
13874
|
+
}
|
|
13875
|
+
return n;
|
|
13876
|
+
}
|
|
13877
|
+
function expressionWrapsJsx(node) {
|
|
13878
|
+
const n = unwrapTransparentTsWrappers(node);
|
|
13879
|
+
if (ts13.isJsxElement(n) || ts13.isJsxSelfClosingElement(n) || ts13.isJsxFragment(n))
|
|
13880
|
+
return true;
|
|
13881
|
+
if (ts13.isConditionalExpression(n)) {
|
|
13882
|
+
return expressionWrapsJsx(n.whenTrue) || expressionWrapsJsx(n.whenFalse);
|
|
13883
|
+
}
|
|
13884
|
+
if (ts13.isArrayLiteralExpression(n)) {
|
|
13885
|
+
return n.elements.some((el) => expressionWrapsJsx(ts13.isSpreadElement(el) ? el.expression : el));
|
|
13886
|
+
}
|
|
13887
|
+
return false;
|
|
13888
|
+
}
|
|
13889
|
+
function reportNakedJsxWrapperProp(ctx, attr, propName, jsxExpr) {
|
|
13890
|
+
const shape = ts13.isConditionalExpression(jsxExpr) ? "a ternary" : "an array literal";
|
|
13891
|
+
ctx.analyzer.errors.push(createError(ErrorCodes.UNSUPPORTED_JSX_PATTERN, getSourceLocation(attr, ctx.sourceFile, ctx.filePath), {
|
|
13892
|
+
message: `Prop '${propName}' is ${shape} wrapping JSX (${jsxExpr.getText(ctx.sourceFile)}). ` + `This shape is not compiled — only a JSX element/fragment given DIRECTLY as the prop value is.`,
|
|
13893
|
+
suggestion: {
|
|
13894
|
+
message: `Move the conditional/array out of the prop position: compute it in a local ` + `const and pass it as the component's children instead of a named prop ` + `(e.g. const ${propName} = ${jsxExpr.getText(ctx.sourceFile)}; <Comp>{${propName}}</Comp>). ` + `Wrapping the ternary/array in a fragment at the prop position ` + `(${propName}={<>{${jsxExpr.getText(ctx.sourceFile)}}</>}) is NOT a safe escape here: it compiles, ` + `but the child's own reactive prop getter receives the branch's HTML unbranded and re-escapes it as ` + `text on the child's very next reactive run, corrupting the DOM (a narrower gap #2651's door ` + `inventory left open — tracked separately).`,
|
|
13895
|
+
escape: [{ kind: "rewrite" }]
|
|
13896
|
+
}
|
|
13897
|
+
}));
|
|
13898
|
+
}
|
|
13829
13899
|
function processComponentProps(attributes, ctx) {
|
|
13830
13900
|
const props = [];
|
|
13831
13901
|
for (const attr of attributes.properties) {
|
|
@@ -13837,10 +13907,7 @@ function processComponentProps(attributes, ctx) {
|
|
|
13837
13907
|
continue;
|
|
13838
13908
|
const name = attr.name.getText(ctx.sourceFile);
|
|
13839
13909
|
if (attr.initializer && ts13.isJsxExpression(attr.initializer) && attr.initializer.expression) {
|
|
13840
|
-
|
|
13841
|
-
while (ts13.isParenthesizedExpression(jsxExpr)) {
|
|
13842
|
-
jsxExpr = jsxExpr.expression;
|
|
13843
|
-
}
|
|
13910
|
+
const jsxExpr = unwrapTransparentTsWrappers(attr.initializer.expression);
|
|
13844
13911
|
if (ts13.isJsxElement(jsxExpr) || ts13.isJsxSelfClosingElement(jsxExpr) || ts13.isJsxFragment(jsxExpr)) {
|
|
13845
13912
|
const prevInsideComponentChildren = ctx.insideComponentChildren;
|
|
13846
13913
|
ctx.insideComponentChildren = true;
|
|
@@ -13855,6 +13922,10 @@ function processComponentProps(attributes, ctx) {
|
|
|
13855
13922
|
continue;
|
|
13856
13923
|
}
|
|
13857
13924
|
}
|
|
13925
|
+
if ((ts13.isConditionalExpression(jsxExpr) || ts13.isArrayLiteralExpression(jsxExpr)) && expressionWrapsJsx(jsxExpr)) {
|
|
13926
|
+
reportNakedJsxWrapperProp(ctx, attr, name, jsxExpr);
|
|
13927
|
+
continue;
|
|
13928
|
+
}
|
|
13858
13929
|
}
|
|
13859
13930
|
let value = getAttributeValue(attr, ctx);
|
|
13860
13931
|
if (value.kind === "template") {
|
|
@@ -14936,10 +15007,11 @@ function collectInnerLoops(nodes, siblingOffsets, outerLoopParam, ctx, options)
|
|
|
14936
15007
|
const innerPreambleNames = preambleNamesOf(n);
|
|
14937
15008
|
if (ctx) {
|
|
14938
15009
|
for (const child of n.children) {
|
|
14939
|
-
bindings.reactiveTexts.push(...collectLoopChildReactiveTexts(child, ctx, n.param, n.paramBindings,
|
|
14940
|
-
bindings.reactiveAttrs.push(...collectLoopChildReactiveAttrs(child, ctx, n.param, n.paramBindings,
|
|
15010
|
+
bindings.reactiveTexts.push(...collectLoopChildReactiveTexts(child, ctx, n.param, n.paramBindings, true, innerPreambleNames, n.index));
|
|
15011
|
+
bindings.reactiveAttrs.push(...collectLoopChildReactiveAttrs(child, ctx, n.param, n.paramBindings, true, innerPreambleNames, n.index));
|
|
14941
15012
|
bindings.refs.push(...collectLoopChildRefs(child));
|
|
14942
15013
|
}
|
|
15014
|
+
bindings.conditionals.push(...collectLoopChildConditionals({ type: "fragment", children: n.children, loc: n.loc }, ctx, siblingOffsets, n.param, n.paramBindings, innerPreambleNames, n.index));
|
|
14943
15015
|
}
|
|
14944
15016
|
let childComponents;
|
|
14945
15017
|
if (collectBindings) {
|
|
@@ -14963,9 +15035,6 @@ function collectInnerLoops(nodes, siblingOffsets, outerLoopParam, ctx, options)
|
|
|
14963
15035
|
for (const child of n.children) {
|
|
14964
15036
|
bindings.events.push(...collectLoopChildEventsWithNesting(child));
|
|
14965
15037
|
}
|
|
14966
|
-
if (ctx) {
|
|
14967
|
-
bindings.conditionals.push(...collectLoopChildConditionals({ type: "fragment", children: n.children, loc: n.loc }, ctx, siblingOffsets, n.param, n.paramBindings, innerPreambleNames, n.index));
|
|
14968
|
-
}
|
|
14969
15038
|
}
|
|
14970
15039
|
result.push({
|
|
14971
15040
|
kind: "nested",
|
|
@@ -16101,6 +16170,7 @@ var RUNTIME_IMPORT_CANDIDATES = [
|
|
|
16101
16170
|
"mapArrayLazy",
|
|
16102
16171
|
"patchLeaf",
|
|
16103
16172
|
"createDisposableEffect",
|
|
16173
|
+
"findCondContainer",
|
|
16104
16174
|
"createComponent",
|
|
16105
16175
|
"renderChild",
|
|
16106
16176
|
"registerComponent",
|
|
@@ -18000,7 +18070,8 @@ function emitProviderAndChildInits(lines, ctx) {
|
|
|
18000
18070
|
lines.push(` upsertChild(__scope, '${registryName}', '${child.slotId}', ${child.propsExpr})`);
|
|
18001
18071
|
continue;
|
|
18002
18072
|
}
|
|
18003
|
-
const
|
|
18073
|
+
const isCommentRoot = child.slotId !== null && child.slotId === ctx.commentScopeRootSlotId;
|
|
18074
|
+
const scopeRef = !child.slotId || isCommentRoot ? "__scope" : `_${varSlotId(child.slotId)}`;
|
|
18004
18075
|
lines.push(` initChild('${registryName}', ${scopeRef}, ${child.propsExpr})`);
|
|
18005
18076
|
}
|
|
18006
18077
|
}
|
|
@@ -18652,6 +18723,7 @@ function buildBranchInnerLoopsPlan(args) {
|
|
|
18652
18723
|
const {
|
|
18653
18724
|
innerLoops,
|
|
18654
18725
|
scopeVar,
|
|
18726
|
+
condSlotId,
|
|
18655
18727
|
outerLoopParam,
|
|
18656
18728
|
outerLoopParamBindings,
|
|
18657
18729
|
wrapOuter
|
|
@@ -18666,7 +18738,7 @@ function buildBranchInnerLoopsPlan(args) {
|
|
|
18666
18738
|
const wrapInner = (expr) => wrapLoopParamAsAccessor(expr, inner.param, inner.paramBindings);
|
|
18667
18739
|
const wrapBoth = (expr) => wrapLoopParamAsAccessor(wrapOuter(expr), inner.param, inner.paramBindings);
|
|
18668
18740
|
const csl = inner.containerSlotId;
|
|
18669
|
-
const containerExpr = csl ? `(${scopeVar}.querySelector('[bf="${csl}"]') ?? ${scopeVar}.querySelector(\`[${BF_HOST2}="\${__scopeId}"][${BF_AT2}="${csl}"]\`) ?? ${scopeVar})` : scopeVar
|
|
18741
|
+
const containerExpr = csl ? `(${scopeVar}.querySelector('[bf="${csl}"]') ?? ${scopeVar}.querySelector(\`[${BF_HOST2}="\${__scopeId}"][${BF_AT2}="${csl}"]\`) ?? ${scopeVar})` : `findCondContainer(${scopeVar}, '${condSlotId}')`;
|
|
18670
18742
|
const { head: paramHead, unwrap: paramUnwrap } = destructureLoopParam(inner.param, inner.paramBindings);
|
|
18671
18743
|
const wrappedKey = inner.key ? wrapLoopParamAsAccessor(inner.key, inner.param, inner.paramBindings) : null;
|
|
18672
18744
|
const wrapIRNode = (node) => {
|
|
@@ -18750,13 +18822,15 @@ function buildLoopChildConditionalsPlan(args) {
|
|
|
18750
18822
|
branch: cond.whenTrue,
|
|
18751
18823
|
wrap,
|
|
18752
18824
|
loopParam,
|
|
18753
|
-
loopParamBindings
|
|
18825
|
+
loopParamBindings,
|
|
18826
|
+
condId: cond.slotId
|
|
18754
18827
|
}),
|
|
18755
18828
|
whenFalseArm: buildLoopChildArmPlan({
|
|
18756
18829
|
branch: cond.whenFalse,
|
|
18757
18830
|
wrap,
|
|
18758
18831
|
loopParam,
|
|
18759
|
-
loopParamBindings
|
|
18832
|
+
loopParamBindings,
|
|
18833
|
+
condId: cond.slotId
|
|
18760
18834
|
})
|
|
18761
18835
|
});
|
|
18762
18836
|
}
|
|
@@ -18796,7 +18870,7 @@ function buildArmTextsPlan(texts, wrap) {
|
|
|
18796
18870
|
}));
|
|
18797
18871
|
}
|
|
18798
18872
|
function buildLoopChildArmPlan(args) {
|
|
18799
|
-
const { branch, wrap, loopParam, loopParamBindings } = args;
|
|
18873
|
+
const { branch, wrap, loopParam, loopParamBindings, condId } = args;
|
|
18800
18874
|
return {
|
|
18801
18875
|
events: buildBranchEventBindingsPlan({
|
|
18802
18876
|
events: branch.events,
|
|
@@ -18809,6 +18883,7 @@ function buildLoopChildArmPlan(args) {
|
|
|
18809
18883
|
innerLoops: buildBranchInnerLoopsPlan({
|
|
18810
18884
|
innerLoops: branch.innerLoops,
|
|
18811
18885
|
scopeVar: "__branchScope",
|
|
18886
|
+
condSlotId: condId,
|
|
18812
18887
|
outerLoopParam: loopParam,
|
|
18813
18888
|
outerLoopParamBindings: loopParamBindings,
|
|
18814
18889
|
wrapOuter: wrap
|
|
@@ -18862,8 +18937,8 @@ function buildReactiveEffectsPlan(args) {
|
|
|
18862
18937
|
wrappedCondition: wrap(cond.condition),
|
|
18863
18938
|
whenTrueTemplateHtml: addCondAttrToTemplate(wrap(cond.whenTrueHtml), cond.slotId),
|
|
18864
18939
|
whenFalseTemplateHtml: addCondAttrToTemplate(wrap(cond.whenFalseHtml), cond.slotId),
|
|
18865
|
-
whenTrueArm: buildOuterArm(cond.whenTrue, wrap, loopParam, loopParamBindings, profileComponentName),
|
|
18866
|
-
whenFalseArm: buildOuterArm(cond.whenFalse, wrap, loopParam, loopParamBindings, profileComponentName),
|
|
18940
|
+
whenTrueArm: buildOuterArm(cond.whenTrue, wrap, loopParam, loopParamBindings, cond.slotId, profileComponentName),
|
|
18941
|
+
whenFalseArm: buildOuterArm(cond.whenFalse, wrap, loopParam, loopParamBindings, cond.slotId, profileComponentName),
|
|
18867
18942
|
...cond.readsPreamble && { readsPreamble: true }
|
|
18868
18943
|
});
|
|
18869
18944
|
}
|
|
@@ -18875,7 +18950,7 @@ function buildReactiveEffectsPlan(args) {
|
|
|
18875
18950
|
profileComponentName
|
|
18876
18951
|
};
|
|
18877
18952
|
}
|
|
18878
|
-
function buildOuterArm(branch, wrap, loopParam, loopParamBindings, profileComponentName) {
|
|
18953
|
+
function buildOuterArm(branch, wrap, loopParam, loopParamBindings, condSlotId, profileComponentName) {
|
|
18879
18954
|
return {
|
|
18880
18955
|
events: buildBranchEventBindingsPlan({
|
|
18881
18956
|
events: branch.events,
|
|
@@ -18889,6 +18964,7 @@ function buildOuterArm(branch, wrap, loopParam, loopParamBindings, profileCompon
|
|
|
18889
18964
|
innerLoops: buildBranchInnerLoopsPlan({
|
|
18890
18965
|
innerLoops: branch.innerLoops,
|
|
18891
18966
|
scopeVar: "__branchScope",
|
|
18967
|
+
condSlotId,
|
|
18892
18968
|
outerLoopParam: loopParam,
|
|
18893
18969
|
outerLoopParamBindings: loopParamBindings,
|
|
18894
18970
|
wrapOuter: wrap
|
|
@@ -18990,6 +19066,7 @@ function buildInnerLoopsPlan(args) {
|
|
|
18990
19066
|
}
|
|
18991
19067
|
function buildReactiveEmit(inner, level, wrapOuter, uidSuffix, outerLoopParam, outerLoopParamBindings) {
|
|
18992
19068
|
const wrapInner = (expr) => wrapLoopParamAsAccessor(expr, inner.param, inner.paramBindings);
|
|
19069
|
+
const wrapBoth = (expr) => wrapLoopParamAsAccessor(wrapOuter(expr), inner.param, inner.paramBindings);
|
|
18993
19070
|
const { head: paramHead, unwrap: paramUnwrap } = destructureLoopParam(inner.param, inner.paramBindings);
|
|
18994
19071
|
const wrappedKey = inner.key ? wrapLoopParamAsAccessor(inner.key, inner.param, inner.paramBindings) : null;
|
|
18995
19072
|
const wrapIRNode = (node) => {
|
|
@@ -19051,6 +19128,13 @@ function buildReactiveEmit(inner, level, wrapOuter, uidSuffix, outerLoopParam, o
|
|
|
19051
19128
|
}));
|
|
19052
19129
|
}
|
|
19053
19130
|
const childRefs = buildChildRefBindings(inner.bindings.refs, inner.param, inner.paramBindings);
|
|
19131
|
+
const conditionals = buildLoopChildConditionalsPlan({
|
|
19132
|
+
conditionals: inner.bindings.conditionals,
|
|
19133
|
+
scopeVar: `__innerEl${uidSuffix}`,
|
|
19134
|
+
wrap: wrapBoth,
|
|
19135
|
+
loopParam: inner.param,
|
|
19136
|
+
loopParamBindings: inner.paramBindings
|
|
19137
|
+
});
|
|
19054
19138
|
return {
|
|
19055
19139
|
mode: "reactive",
|
|
19056
19140
|
keyFn: loopKeyFn(inner),
|
|
@@ -19063,6 +19147,7 @@ function buildReactiveEmit(inner, level, wrapOuter, uidSuffix, outerLoopParam, o
|
|
|
19063
19147
|
events,
|
|
19064
19148
|
reactiveTexts,
|
|
19065
19149
|
reactiveAttrs,
|
|
19150
|
+
conditionals,
|
|
19066
19151
|
childRefs
|
|
19067
19152
|
};
|
|
19068
19153
|
}
|
|
@@ -20015,6 +20100,17 @@ function bindingIdArg(ctx, slotId) {
|
|
|
20015
20100
|
return "";
|
|
20016
20101
|
return `, ${JSON.stringify(`${ctx.componentName}#binding:${slotId}`)}`;
|
|
20017
20102
|
}
|
|
20103
|
+
function emitValueUpdateStatements(target, expression) {
|
|
20104
|
+
return [
|
|
20105
|
+
`const __val = String(${expression})`,
|
|
20106
|
+
`if ('value' in ${target}) { if (${target}.value !== __val) ${target}.value = __val } else { ${target}.setAttribute('value', __val) }`
|
|
20107
|
+
];
|
|
20108
|
+
}
|
|
20109
|
+
function emitChildValueMirrorStatements(target, expression) {
|
|
20110
|
+
return [
|
|
20111
|
+
`if ('value' in ${target}) { const __val = String(${expression}); if (${target}.value !== __val) ${target}.value = __val }`
|
|
20112
|
+
];
|
|
20113
|
+
}
|
|
20018
20114
|
function emitAttrUpdate(target, attrName, expression, meta) {
|
|
20019
20115
|
const htmlName = toHtmlAttrName(attrName);
|
|
20020
20116
|
if (attrName === "dangerouslySetInnerHTML" || htmlName === "dangerouslySetInnerHTML") {
|
|
@@ -20033,10 +20129,7 @@ function emitAttrUpdate(target, attrName, expression, meta) {
|
|
|
20033
20129
|
];
|
|
20034
20130
|
}
|
|
20035
20131
|
if (htmlName === "value") {
|
|
20036
|
-
return
|
|
20037
|
-
`const __val = String(${expression})`,
|
|
20038
|
-
`if (${target}.value !== __val) ${target}.value = __val`
|
|
20039
|
-
];
|
|
20132
|
+
return emitValueUpdateStatements(target, expression);
|
|
20040
20133
|
}
|
|
20041
20134
|
if (isBooleanAttr(htmlName)) {
|
|
20042
20135
|
return [`${target}.${htmlName} = !!(${expression})`];
|
|
@@ -20284,30 +20377,30 @@ function emitReactivePropBindings(lines, ctx) {
|
|
|
20284
20377
|
propsBySlot.get(prop.slotId).push(prop);
|
|
20285
20378
|
}
|
|
20286
20379
|
for (const [slotId, props] of propsBySlot) {
|
|
20287
|
-
const
|
|
20288
|
-
lines.push(` if (
|
|
20380
|
+
const ref = slotId === ctx.commentScopeRootSlotId ? "__scope" : `_${varSlotId(slotId)}`;
|
|
20381
|
+
lines.push(` if (${ref}) {`);
|
|
20289
20382
|
for (const prop of props) {
|
|
20290
20383
|
const value = `${prop.expression}()`;
|
|
20291
20384
|
if (prop.propName === "selected") {
|
|
20292
20385
|
if (prop.componentName === "TabsContent") {
|
|
20293
|
-
lines.push(`
|
|
20386
|
+
lines.push(` ${ref}.setAttribute('data-state', ${value} ? 'active' : 'inactive')`);
|
|
20294
20387
|
lines.push(` if (${value}) {`);
|
|
20295
|
-
lines.push(`
|
|
20388
|
+
lines.push(` ${ref}.classList.remove('hidden')`);
|
|
20296
20389
|
lines.push(` } else {`);
|
|
20297
|
-
lines.push(`
|
|
20390
|
+
lines.push(` ${ref}.classList.add('hidden')`);
|
|
20298
20391
|
lines.push(` }`);
|
|
20299
20392
|
} else {
|
|
20300
|
-
lines.push(`
|
|
20301
|
-
lines.push(`
|
|
20302
|
-
lines.push(`
|
|
20393
|
+
lines.push(` ${ref}.setAttribute('aria-selected', String(${value}))`);
|
|
20394
|
+
lines.push(` ${ref}.setAttribute('data-state', ${value} ? 'active' : 'inactive')`);
|
|
20395
|
+
lines.push(` ${ref}.setAttribute('tabindex', ${value} ? '0' : '-1')`);
|
|
20303
20396
|
}
|
|
20304
20397
|
} else if (prop.propName === "value") {
|
|
20305
|
-
|
|
20306
|
-
|
|
20398
|
+
for (const stmt of emitChildValueMirrorStatements(ref, value))
|
|
20399
|
+
lines.push(` ${stmt}`);
|
|
20307
20400
|
} else if (isBooleanAttr(prop.propName)) {
|
|
20308
|
-
lines.push(`
|
|
20401
|
+
lines.push(` ${ref}.${prop.propName} = !!(${value})`);
|
|
20309
20402
|
} else {
|
|
20310
|
-
lines.push(`
|
|
20403
|
+
lines.push(` ${ref}.setAttribute('${prop.propName}', String(${value}))`);
|
|
20311
20404
|
}
|
|
20312
20405
|
}
|
|
20313
20406
|
lines.push(` }`);
|
|
@@ -20330,13 +20423,17 @@ function emitReactiveChildProps(lines, ctx) {
|
|
|
20330
20423
|
}
|
|
20331
20424
|
for (const [, props] of propsByComponent) {
|
|
20332
20425
|
const first = props[0];
|
|
20426
|
+
const isCommentRoot = first.slotId !== null && first.slotId === ctx.commentScopeRootSlotId;
|
|
20333
20427
|
const varSuffix = first.slotId ? varSlotId(first.slotId).replace(/-/g, "_") : first.componentName;
|
|
20334
|
-
const varName = `__${first.componentName}_${varSuffix}El`;
|
|
20335
|
-
|
|
20336
|
-
|
|
20428
|
+
const varName = isCommentRoot ? "__scope" : `__${first.componentName}_${varSuffix}El`;
|
|
20429
|
+
if (!isCommentRoot) {
|
|
20430
|
+
const selectorArg = first.slotId ? first.slotId : first.componentName;
|
|
20431
|
+
lines.push(` const [${varName}] = $c(__scope, '${selectorArg}')`);
|
|
20432
|
+
}
|
|
20337
20433
|
lines.push(` if (${varName}) {`);
|
|
20338
20434
|
for (const prop of props) {
|
|
20339
|
-
|
|
20435
|
+
const stmts = toHtmlAttrName(prop.attrName) === "value" ? emitChildValueMirrorStatements(varName, prop.expression) : emitAttrUpdate(varName, prop.attrName, prop.expression, prop);
|
|
20436
|
+
for (const stmt of stmts) {
|
|
20340
20437
|
lines.push(` ${stmt}`);
|
|
20341
20438
|
}
|
|
20342
20439
|
}
|
|
@@ -20897,8 +20994,9 @@ function seedDiffersExpr(target, a) {
|
|
|
20897
20994
|
return `${target}.getAttribute('style') !== styleToCss(__x)`;
|
|
20898
20995
|
if (html === "class")
|
|
20899
20996
|
return `${target}.getAttribute('class') !== (__x != null ? String(__x) : null)`;
|
|
20900
|
-
if (html === "value")
|
|
20901
|
-
return
|
|
20997
|
+
if (html === "value") {
|
|
20998
|
+
return `('value' in ${target} ? ${target}.value !== String(__x) : ${target}.getAttribute('value') !== String(__x))`;
|
|
20999
|
+
}
|
|
20902
21000
|
if (isBooleanAttr(html))
|
|
20903
21001
|
return `${target}.${html} !== !!(__x)`;
|
|
20904
21002
|
if (a.meta.presenceOrUndefined) {
|
|
@@ -21256,6 +21354,9 @@ function emitReactive(lines, inner, indent, pc) {
|
|
|
21256
21354
|
}
|
|
21257
21355
|
lines.push(`${indent} }${profileBindingId(pc, attr.slotId)}) }`);
|
|
21258
21356
|
}
|
|
21357
|
+
if (emit.conditionals.length > 0) {
|
|
21358
|
+
stringifyLoopChildConditionals(lines, emit.conditionals, `${indent} `, pc);
|
|
21359
|
+
}
|
|
21259
21360
|
emitLoopChildRefs(lines, emit.childRefs, {
|
|
21260
21361
|
indent: `${indent} `,
|
|
21261
21362
|
elVar: `__innerEl${uid}`,
|
|
@@ -22019,6 +22120,9 @@ function generateElementRefs(ctx) {
|
|
|
22019
22120
|
for (const slotId of componentSlots) {
|
|
22020
22121
|
regularSlots.delete(slotId);
|
|
22021
22122
|
}
|
|
22123
|
+
if (ctx.commentScopeRootSlotId) {
|
|
22124
|
+
componentSlots.delete(ctx.commentScopeRootSlotId);
|
|
22125
|
+
}
|
|
22022
22126
|
if (regularSlots.size === 0 && componentSlots.size === 0)
|
|
22023
22127
|
return "";
|
|
22024
22128
|
const refLines = [];
|
|
@@ -22505,6 +22609,7 @@ function createContext(ir, scope, adapterCapabilities, profile) {
|
|
|
22505
22609
|
refElements: [],
|
|
22506
22610
|
childInits: [],
|
|
22507
22611
|
deferredChildSlots: new Set,
|
|
22612
|
+
commentScopeRootSlotId: ir.root.type === "component" ? ir.root.slotId : null,
|
|
22508
22613
|
reactiveProps: [],
|
|
22509
22614
|
reactiveChildProps: [],
|
|
22510
22615
|
reactiveAttrs: [],
|
|
@@ -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;AA2GvQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,E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E,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EACrC,iBAAiB,UAAQ,GACxB,IAAI,CAsSN;AAocD,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,GAAG,EAAE,eAAe,EACpB,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,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,CA2ExB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-inner-loop.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/build-inner-loop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,OAAO,KAAK,EAIV,gBAAgB,EACjB,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"build-inner-loop.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/build-inner-loop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,OAAO,KAAK,EAIV,gBAAgB,EACjB,MAAM,mBAAmB,CAAA;AAmC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAM9C,OAAO,KAAK,EAMV,cAAc,EACf,MAAM,iBAAiB,CAAA;AAExB,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,SAAS,UAAU,EAAE,CAAA;IAC7B,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,sBAAsB,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAA;CACrD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,mBAAmB,GAAG,cAAc,CAmE7E"}
|
|
@@ -46,6 +46,14 @@ export interface BuildBranchInnerLoopsArgs {
|
|
|
46
46
|
innerLoops: readonly NestedLoop[] | undefined;
|
|
47
47
|
/** The variable expression naming the parent scope element (e.g. `__branchScope`). */
|
|
48
48
|
scopeVar: string;
|
|
49
|
+
/**
|
|
50
|
+
* The enclosing conditional's own slot id — every call site of this
|
|
51
|
+
* builder originates from a conditional branch's arm, so this is always
|
|
52
|
+
* a real id. Used as the `containerExpr` fallback (`findCondContainer`,
|
|
53
|
+
* #2705) for an inner loop whose IR never got a `containerSlotId` of its
|
|
54
|
+
* own (its wrapper element sits outside the branch's IR subtree).
|
|
55
|
+
*/
|
|
56
|
+
condSlotId: string;
|
|
49
57
|
/** Outer loop param identifier (the conditional's enclosing loop). */
|
|
50
58
|
outerLoopParam: string;
|
|
51
59
|
/** Outer loop param destructuring metadata. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-loop-child-arm.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/build-loop-child-arm.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,sBAAsB,EAEtB,oBAAoB,EAEpB,qBAAqB,EACrB,qBAAqB,EACrB,UAAU,EACX,MAAM,gBAAgB,CAAA;AACvB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;IACpD;;;OAGG;IACH,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;CACpC;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,yBAAyB,GAC9B,oBAAoB,
|
|
1
|
+
{"version":3,"file":"build-loop-child-arm.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/build-loop-child-arm.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,sBAAsB,EAEtB,oBAAoB,EAEpB,qBAAqB,EACrB,qBAAqB,EACrB,UAAU,EACX,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAGV,MAAM,EACN,MAAM,EACN,gBAAgB,EACjB,MAAM,mBAAmB,CAAA;AAI1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAqC7D,OAAO,KAAK,EAEV,6BAA6B,EAC7B,uBAAuB,EAKvB,oBAAoB,EAEpB,wBAAwB,EACzB,MAAM,qBAAqB,CAAA;AAE5B,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,SAAS,sBAAsB,EAAE,GAAG,SAAS,CAAA;IACrD,+EAA+E;IAC/E,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;IAC9B,2EAA2E;IAC3E,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC9B;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,4BAA4B,GACjC,uBAAuB,CAyBzB;AAED,4EAA4E;AAC5E,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CACpB;AAED,MAAM,WAAW,kCAAkC;IACjD,UAAU,EAAE,SAAS,mBAAmB,EAAE,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uB7B;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,SAAS,qBAAqB,EAAE,GAAG,SAAS,EACnD,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAC7B,SAAS,OAAO,qBAAqB,EAAE,gBAAgB,EAAE,CAM3D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-reactive-effects.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/build-reactive-effects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EACV,YAAY,EAEZ,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAazD,OAAO,KAAK,EAGV,mBAAmB,EAEpB,MAAM,uBAAuB,CAAA;AAE9B,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,SAAS,qBAAqB,EAAE,CAAA;IACvC,KAAK,EAAE,SAAS,qBAAqB,EAAE,CAAA;IACvC,YAAY,EAAE,SAAS,oBAAoB,EAAE,GAAG,SAAS,CAAA;IACzD,SAAS,EAAE,MAAM,CAAA;IACjB,iBAAiB,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAA;IAC/C,2EAA2E;IAC3E,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC9B;AAED,sEAAsE;AACtE,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,wBAAwB,GAC7B,mBAAmB,CAgErB;
|
|
1
|
+
{"version":3,"file":"build-reactive-effects.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/build-reactive-effects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EACV,YAAY,EAEZ,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAazD,OAAO,KAAK,EAGV,mBAAmB,EAEpB,MAAM,uBAAuB,CAAA;AAE9B,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,SAAS,qBAAqB,EAAE,CAAA;IACvC,KAAK,EAAE,SAAS,qBAAqB,EAAE,CAAA;IACvC,YAAY,EAAE,SAAS,oBAAoB,EAAE,GAAG,SAAS,CAAA;IACzD,SAAS,EAAE,MAAM,CAAA;IACjB,iBAAiB,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAA;IAC/C,2EAA2E;IAC3E,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC9B;AAED,sEAAsE;AACtE,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,wBAAwB,GAC7B,mBAAmB,CAgErB;AAyCD;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,YAAY,EAAE,oBAAoB,CAAC,EAAE,MAAM,GAAG,mBAAmB,CASnH"}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
import type { LoopChildEvent } from '../../types.ts';
|
|
13
13
|
import type { AttrMeta, IRLoopChildComponent, LoopParamBinding } from '../../../types.ts';
|
|
14
14
|
import type { LoopChildRefBinding } from './loop.ts';
|
|
15
|
+
import type { LoopChildConditionalPlan } from './loop-child-arm.ts';
|
|
15
16
|
/**
|
|
16
17
|
* Body-entry statements emitted in order at the top of a `mapArray`
|
|
17
18
|
* renderItem or static `forEach` body. Used by every nested-loop emission
|
|
@@ -138,6 +139,17 @@ export interface InnerLoopReactiveEmit {
|
|
|
138
139
|
reactiveTexts: readonly InnerLoopText[];
|
|
139
140
|
/** Pre-wrapped reactive attribute effects for the inner-item body. */
|
|
140
141
|
reactiveAttrs: readonly InnerLoopReactiveAttr[];
|
|
142
|
+
/**
|
|
143
|
+
* Per-item conditionals inside THIS loop's own row (#2706) — each gets
|
|
144
|
+
* its own `insert()` call, the same insert()-parity the top-level loop's
|
|
145
|
+
* row conditionals already have (`ReactiveEffectsPlan.conditionals`).
|
|
146
|
+
* Before this field existed, a per-item conditional inside a nested
|
|
147
|
+
* loop's row was baked into the static row template ONCE at row
|
|
148
|
+
* creation and never revisited — silently frozen against later signal
|
|
149
|
+
* changes — while its reactive text still (unsoundly) assumed insert()
|
|
150
|
+
* kept the branch's marker around.
|
|
151
|
+
*/
|
|
152
|
+
conditionals: readonly LoopChildConditionalPlan[];
|
|
141
153
|
/** Pre-wrapped imperative ref callbacks for the inner-item body (#1244). */
|
|
142
154
|
childRefs: readonly LoopChildRefBinding[];
|
|
143
155
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inner-loop.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/inner-loop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EACV,QAAQ,EACR,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"inner-loop.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/inner-loop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EACV,QAAQ,EACR,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AACpD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;AAEnE;;;;;;;;;GASG;AACH,MAAM,MAAM,iBAAiB,GAAG,SAAS,MAAM,EAAE,CAAA;AAEjD,6EAA6E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ACpC,6DAA6D;IAC7D,eAAe,EAAE,MAAM,CAAA;IACvB;;;;OAIG;IACH,eAAe,EAAE,OAAO,CAAA;IACxB,wEAAwE;IACxE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,+DAA+D;IAC/D,UAAU,EAAE,SAAS,oBAAoB,EAAE,CAAA;IAC3C,2DAA2D;IAC3D,MAAM,EAAE,SAAS,cAAc,EAAE,CAAA;IACjC,iEAAiE;IACjE,aAAa,EAAE,SAAS,aAAa,EAAE,CAAA;IACvC,sEAAsE;IACtE,aAAa,EAAE,SAAS,qBAAqB,EAAE,CAAA;IAC/C;;;;;;;;;OASG;IACH,YAAY,EAAE,SAAS,wBAAwB,EAAE,CAAA;IACjD,4EAA4E;IAC5E,SAAS,EAAE,SAAS,mBAAmB,EAAE,CAAA;CAC1C;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,QAAQ,CAAA;IACd,0EAA0E;IAC1E,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB;;;;;;OAMG;IACH,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,8EAA8E;IAC9E,UAAU,EAAE,SAAS,oBAAoB,EAAE,CAAA;IAC3C,kCAAkC;IAClC,MAAM,EAAE,SAAS,cAAc,EAAE,CAAA;IACjC,iFAAiF;IACjF,SAAS,EAAE,SAAS,mBAAmB,EAAE,CAAA;CAC1C;AAED,MAAM,MAAM,cAAc,GAAG,SAAS,aAAa,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inner-loop.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/stringify/inner-loop.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"inner-loop.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/stringify/inner-loop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AASH,OAAO,KAAK,EAEV,c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E,kBAAkB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"lazy-row.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/stringify/lazy-row.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AAKH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAQ/D,OAAO,KAAK,EACV,kBAAkB,EAElB,eAAe,EAEhB,MAAM,2BAA2B,CAAA;AAElC,MAAM,WAAW,uBAAuB;IACtC,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;IACpB,yEAAyE;IACzE,cAAc,EAAE,OAAO,CAAA;IACvB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,oEAAoE;IACpE,QAAQ,EAAE,MAAM,CAAA;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,aAAa,CAAC,EAAE,iBAAiB,CAAA;IACjC,OAAO,EAAE,eAAe,CAAA;CACzB;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAmLtF;AA8KD;0EAC0E;AAC1E,iBAAS,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE3C;AAyFD;;;;;;GAMG;AACH,iBAAS,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,kBAAkB,GAAG,MAAM,CA4BtE;AAED,kDAAkD;AAClD,eAAO,MAAM,kBAAkB;;;CAAkC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element-refs.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/element-refs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAIjD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"element-refs.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/element-refs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAIjD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,CAwDhE"}
|
|
@@ -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;AAwEjD;;;;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;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,GAAG,MAAM,CAqBzF;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"}
|
|
@@ -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', 'createComponent', 'renderChild', 'registerComponent', 'registerTemplate', 'initChild', 'upsertChild', 'mountRowRoot', 'createPortal', 'provideContext', 'createContext', 'useContext', 'forwardProps', 'applyRestAttrs', 'splitProps', 'spreadAttrs', 'styleToCss', 'escapeAttr', 'escapeText', 'escapeTextOrNode', 'bfMarkup', 'escapeTextOrMarkup', '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', 'createPortal', 'provideContext', 'createContext', 'useContext', 'forwardProps', 'applyRestAttrs', 'splitProps', 'spreadAttrs', 'styleToCss', 'escapeAttr', 'escapeText', 'escapeTextOrNode', 'bfMarkup', 'escapeTextOrMarkup', '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", "createComponent", "renderChild", "registerComponent", "registerTemplate", "initChild", "upsertChild", "mountRowRoot", "createPortal", "provideContext", "createContext", "useContext", "forwardProps", "applyRestAttrs", "splitProps", "spreadAttrs", "styleToCss", "escapeAttr", "escapeText", "escapeTextOrNode", "bfMarkup", "escapeTextOrMarkup", "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", "createPortal", "provideContext", "createContext", "useContext", "forwardProps", "applyRestAttrs", "splitProps", "spreadAttrs", "styleToCss", "escapeAttr", "escapeText", "escapeTextOrNode", "bfMarkup", "escapeTextOrMarkup", "qsa", "qsaItem", "qsaChildScope", "qsaChildScopes", "upsertChildItem", "__slot", "__bfSlot", "__bfText", "claimSlots", "lazySlots", "lazyClaimSlots", "textOrNode", "beginTurn", "endTurn", "date", "formatDate"];
|
|
8
8
|
export declare const RUNTIME_MODULE = "@barefootjs/client/runtime";
|
|
9
9
|
export declare const IMPORT_PLACEHOLDER = "/* __BAREFOOTJS_DOM_IMPORTS__ */";
|
|
10
10
|
export declare const MODULE_CONSTANTS_PLACEHOLDER = "/* __MODULE_LEVEL_CONSTANTS__ */";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/imports.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAU,MAAM,aAAa,CAAA;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,
|
|
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,cAA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inits.d.ts","sourceRoot":"","sources":["../../../src/ir-to-client-js/phases/provider-and-child-inits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAIlD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"provider-and-child-inits.d.ts","sourceRoot":"","sources":["../../../src/ir-to-client-js/phases/provider-and-child-inits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAIlD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI,CAgCrF"}
|