@barefootjs/xslate 0.17.1 → 0.18.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.
@@ -69,5 +69,7 @@ export declare function renderMapEval(recv: string, body: ParsedExpr, param: str
69
69
  * returns a fresh array ref.
70
70
  */
71
71
  export declare function renderSortMethod(recv: string, c: SortComparator): string;
72
- export declare function renderFlatMethod(recv: string, depth: FlatDepth): string;
72
+ export declare function renderFlatMethod(recv: string, depth: FlatDepth | {
73
+ expr: ParsedExpr;
74
+ }, emit: (e: ParsedExpr) => string): string;
73
75
  //# sourceMappingURL=array-method.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"array-method.d.ts","sourceRoot":"","sources":["../../../src/adapter/expr/array-method.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,SAAS,EACV,MAAM,iBAAiB,CAAA;AAExB,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,UAAU,EAAE,EAClB,IAAI,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,MAAM,GAC9B,MAAM,CA4HR;AA6BD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,MAAM,EAAE,EAChB,IAAI,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,MAAM,GAC9B,MAAM,GAAG,IAAI,CAUf;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,MAAM,EAAE,EAChB,IAAI,EAAE,UAAU,EAChB,SAAS,EAAE,MAAM,GAAG,OAAO,EAC3B,IAAI,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,MAAM,GAC9B,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,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,SAAS,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,EACvC,IAAI,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,MAAM,GAC9B,MAAM,CAoBR"}
@@ -42,7 +42,9 @@ export declare class XslateFilterEmitter implements ParsedExprEmitter {
42
42
  }>, _restArgs: ParsedExpr[], emit: (e: ParsedExpr) => string): string;
43
43
  arrayLiteral(elements: ParsedExpr[], emit: (e: ParsedExpr) => string): string;
44
44
  arrayMethod(method: ArrayMethod, object: ParsedExpr, args: ParsedExpr[], emit: (e: ParsedExpr) => string): string;
45
- flatMethod(object: ParsedExpr, depth: FlatDepth, emit: (e: ParsedExpr) => string): string;
45
+ flatMethod(object: ParsedExpr, depth: FlatDepth | {
46
+ expr: ParsedExpr;
47
+ }, emit: (e: ParsedExpr) => string): string;
46
48
  conditional(_test: ParsedExpr, _consequent: ParsedExpr, _alternate: ParsedExpr): string;
47
49
  templateLiteral(_parts: TemplatePart[]): string;
48
50
  arrow(_params: string[], _body: ParsedExpr): string;
@@ -85,12 +87,14 @@ export declare class XslateTopLevelEmitter implements ParsedExprEmitter {
85
87
  private _emitPredicateCallback;
86
88
  arrayLiteral(elements: ParsedExpr[], emit: (e: ParsedExpr) => string): string;
87
89
  arrayMethod(method: ArrayMethod, object: ParsedExpr, args: ParsedExpr[], emit: (e: ParsedExpr) => string): string;
88
- flatMethod(object: ParsedExpr, depth: FlatDepth, emit: (e: ParsedExpr) => string): string;
90
+ flatMethod(object: ParsedExpr, depth: FlatDepth | {
91
+ expr: ParsedExpr;
92
+ }, emit: (e: ParsedExpr) => string): string;
89
93
  conditional(test: ParsedExpr, consequent: ParsedExpr, alternate: ParsedExpr, emit: (e: ParsedExpr) => string): string;
90
94
  templateLiteral(parts: TemplatePart[], emit: (e: ParsedExpr) => string): string;
91
95
  arrow(_params: string[], _body: ParsedExpr): string;
92
96
  regex(_raw: string): string;
93
97
  unsupported(_raw: string, _reason: string): string;
94
- objectLiteral(_properties: ObjectLiteralProperty[], _raw: string, _emit: (e: ParsedExpr) => string): string;
98
+ objectLiteral(properties: ObjectLiteralProperty[], _raw: string, _emit: (e: ParsedExpr) => string): string;
95
99
  }
96
100
  //# sourceMappingURL=emitters.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"emitters.d.ts","sourceRoot":"","sources":["../../../src/adapter/expr/emitters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,KAAK,iBAAiB,EAEtB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACd,KAAK,YAAY,EAIlB,MAAM,iBAAiB,CAAA;AAExB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAgC3D;;;;;;;;;;GAUG;AACH,qBAAa,mBAAoB,YAAW,iBAAiB;IAEzD,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAI7B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC;IAPjC,YACmB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAChC,YAAY,GAAE,CAAC,CAAC,EAAE,MAAM,KAAK,OAAqB,EAIlD,aAAa,CAAC,GAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,aAAA,EACzE;IAEJ,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK/B;IAED,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,EAAE,WAAW,EAAE,WAAW,GAAG,MAAM,CAKjF;IAED,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,E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M,CAoB9E;IAED,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,CAKlD;IAED,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG1B;IAED,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEjD;IAED,aAAa,CAAC,UAAU,EAAE,qBAAqB,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,MAAM,GAAG,MAAM,CAWzG;CACF"}
@@ -187302,12 +187302,13 @@ import {
187302
187302
  emitAttrValue,
187303
187303
  augmentInheritedPropAccesses,
187304
187304
  collectModuleStringConsts,
187305
- isLowerableObjectRestDestructure,
187306
187305
  lookupStaticRecordLiteral,
187307
187306
  searchParamsLocalNames,
187308
187307
  prepareLoweringMatchers,
187309
187308
  queryHrefArgs,
187310
- sortComparatorFromArrow as sortComparatorFromArrow2
187309
+ isValidHelperId,
187310
+ sortComparatorFromArrow as sortComparatorFromArrow2,
187311
+ isLowerableLoopDestructure
187311
187312
  } from "@barefootjs/jsx";
187312
187313
 
187313
187314
  // src/adapter/boolean-result.ts
@@ -187600,7 +187601,10 @@ function renderSortMethod(recv, c) {
187600
187601
  });
187601
187602
  return `$bf.sort(${recv}, { keys => [${keyHashes.join(", ")}] })`;
187602
187603
  }
187603
- function renderFlatMethod(recv, depth) {
187604
+ function renderFlatMethod(recv, depth, emit) {
187605
+ if (typeof depth === "object") {
187606
+ return `$bf.flat_dynamic(${recv}, ${emit(depth.expr)})`;
187607
+ }
187604
187608
  const d = depth === "infinity" ? -1 : depth;
187605
187609
  return `$bf.flat(${recv}, ${d})`;
187606
187610
  }
@@ -187711,7 +187715,7 @@ class XslateFilterEmitter {
187711
187715
  return renderArrayMethod(method, object, args, emit);
187712
187716
  }
187713
187717
  flatMethod(object, depth, emit) {
187714
- return renderFlatMethod(emit(object), depth);
187718
+ return renderFlatMethod(emit(object), depth, emit);
187715
187719
  }
187716
187720
  conditional(_test, _consequent, _alternate) {
187717
187721
  return "1";
@@ -187911,7 +187915,7 @@ class XslateTopLevelEmitter {
187911
187915
  return renderArrayMethod(method, object, args, emit);
187912
187916
  }
187913
187917
  flatMethod(object, depth, emit) {
187914
- return renderFlatMethod(emit(object), depth);
187918
+ return renderFlatMethod(emit(object), depth, emit);
187915
187919
  }
187916
187920
  conditional(test, consequent, alternate, emit) {
187917
187921
  return `(${emit(test)} ? ${emit(consequent)} : ${emit(alternate)})`;
@@ -187942,8 +187946,8 @@ class XslateTopLevelEmitter {
187942
187946
  unsupported(_raw, _reason) {
187943
187947
  return "''";
187944
187948
  }
187945
- objectLiteral(_properties, _raw, _emit) {
187946
- return "''";
187949
+ objectLiteral(properties, _raw, _emit) {
187950
+ return properties.length === 0 ? "{}" : "''";
187947
187951
  }
187948
187952
  }
187949
187953
 
@@ -188174,6 +188178,17 @@ function collectStringValueNames(ir) {
188174
188178
  }
188175
188179
 
188176
188180
  // src/adapter/xslate-adapter.ts
188181
+ function kolonSegmentAccessor(base, segments) {
188182
+ let expr = base;
188183
+ for (const seg of segments) {
188184
+ expr += seg.kind === "field" ? seg.isIdent ? `.${seg.key}` : `[${kolonHashKey(seg.key)}]` : `[${seg.index}]`;
188185
+ }
188186
+ return expr;
188187
+ }
188188
+ function kolonStringLiteral(s) {
188189
+ return `'${escapeKolonSingleQuoted(s)}'`;
188190
+ }
188191
+
188177
188192
  class XslateAdapter extends BaseAdapter {
188178
188193
  name = "xslate";
188179
188194
  extension = ".tx";
@@ -188442,21 +188457,37 @@ ${whenTrue}
188442
188457
  return `<: $bf.comment("loop:${loop.markerId}") | mark_raw :><: $bf.comment("/loop:${loop.markerId}") | mark_raw :>`;
188443
188458
  }
188444
188459
  const destructure = !!(loop.paramBindings && loop.paramBindings.length > 0);
188445
- const supportableDestructure = destructure && isLowerableObjectRestDestructure(loop);
188460
+ const supportableDestructure = destructure && isLowerableLoopDestructure(loop);
188446
188461
  if (destructure && !supportableDestructure) {
188447
188462
  this.errors.push({
188448
188463
  code: "BF104",
188449
188464
  severity: "error",
188450
- message: `Loop callback uses an array/object destructure pattern (\`${loop.param}\`) that the Xslate adapter cannot lower — Kolon \`for LIST -> $item\` binds a single scalar and can't unpack a tuple.`,
188465
+ message: `Loop callback uses a destructure pattern (\`${loop.param}\`) that the Xslate adapter cannot lower — see the diagnostic detail for the specific shape.`,
188451
188466
  loc: loop.loc ?? { file: this.componentName + ".tsx", start: { line: 1, column: 0 }, end: { line: 1, column: 0 } },
188452
188467
  suggestion: {
188453
188468
  message: `Options:
188454
- ` + ` 1. Rename the parameter to a single name and access tuple elements with index syntax in the body (e.g. \`entry => entry[0]\` instead of \`([k, v]) => ...\`).
188455
- ` + ` 2. Mark the loop position as @client-only so the destructure runs in JS on the client.
188456
- ` + ` 3. Move the loop into a primitive that the adapter registers explicitly.`
188469
+ ` + ` 1. If this is an object-rest binding (\`{ ...rest }\`), only reading \`rest.field\` or spreading \`{...rest}\` onto an intrinsic element lowers — other uses (passing \`rest\` to a function, rendering it as text) need the client runtime.
188470
+ ` + ` 2. If this is chained \`.filter().map(({ ... }) => ...)\`, hoist the destructure into a variable inside the callback body instead.
188471
+ ` + ` 3. Mark the loop position as @client-only so the destructure runs in JS on the client.
188472
+ ` + ` 4. Move the loop into a primitive that the adapter registers explicitly.`
188457
188473
  }
188458
188474
  });
188459
188475
  }
188476
+ const arrayName = loop.array.trim();
188477
+ if (/^[A-Za-z_$][\w$]*$/.test(arrayName)) {
188478
+ const arrayConst = (this.localConstants ?? []).find((c) => c.name === arrayName);
188479
+ if (arrayConst && !arrayConst.isModule && this._resolveLiteralConst(arrayName) === null) {
188480
+ this.errors.push({
188481
+ code: "BF101",
188482
+ severity: "error",
188483
+ message: `Loop array \`${arrayName}\` is a local computed value (\`${arrayConst.value}\`) that the Xslate adapter cannot bind as a template variable — only numeric/string-literal locals inline at their use site.`,
188484
+ loc: loop.loc ?? { file: this.componentName + ".tsx", start: { line: 1, column: 0 }, end: { line: 1, column: 0 } },
188485
+ suggestion: {
188486
+ message: "Pre-compute the array server-side and pass it as a prop, or mark the loop position as @client-only so it runs in JS on the client."
188487
+ }
188488
+ });
188489
+ }
188490
+ }
188460
188491
  const rawArray = this.convertExpressionToKolon(loop.array);
188461
188492
  let array = rawArray;
188462
188493
  if (loop.sortComparator) {
@@ -188478,7 +188509,15 @@ ${whenTrue}
188478
188509
  }
188479
188510
  if (supportableDestructure) {
188480
188511
  for (const b of loop.paramBindings ?? []) {
188481
- indexLocalLines.push(b.rest ? `: my $${b.name} = $${loopVar};` : `: my $${b.name} = $${loopVar}${b.path};`);
188512
+ const parent = kolonSegmentAccessor(`$${loopVar}`, b.segments ?? []);
188513
+ if (b.rest?.kind === "object") {
188514
+ const exclude = b.rest.exclude.map((k) => kolonStringLiteral(k.key)).join(", ");
188515
+ indexLocalLines.push(`: my $${b.name} = $bf.omit(${parent}, [${exclude}]);`);
188516
+ } else if (b.rest?.kind === "array") {
188517
+ indexLocalLines.push(`: my $${b.name} = $bf.slice(${parent}, ${b.rest.from}, nil);`);
188518
+ } else {
188519
+ indexLocalLines.push(`: my $${b.name} = ${kolonSegmentAccessor(`$${loopVar}`, b.segments ?? [])};`);
188520
+ }
188482
188521
  }
188483
188522
  }
188484
188523
  const prevInLoop = this.inLoop;
@@ -188534,8 +188573,32 @@ ${childrenUnderLoop}` : childrenUnderLoop;
188534
188573
  emitBooleanShorthand: (_value, name) => `${kolonHashKey(name)} => 1`,
188535
188574
  emitJsxChildren: () => ""
188536
188575
  };
188576
+ componentPropSegmentEntries(segments) {
188577
+ const last = segments[segments.length - 1];
188578
+ if (last && last.kind === "entries")
188579
+ return last.parts;
188580
+ const seg = { kind: "entries", parts: [] };
188581
+ segments.push(seg);
188582
+ return seg.parts;
188583
+ }
188584
+ combineComponentPropSegments(segments) {
188585
+ let acc = null;
188586
+ for (const seg of segments) {
188587
+ if (seg.kind === "entries") {
188588
+ if (seg.parts.length === 0)
188589
+ continue;
188590
+ const text = `{ ${seg.parts.join(", ")} }`;
188591
+ acc = acc === null ? text : `${acc}.merge(${text})`;
188592
+ } else {
188593
+ const text = `(${seg.expr} // {})`;
188594
+ acc = acc === null ? text : `${acc}.merge(${text})`;
188595
+ }
188596
+ }
188597
+ return acc ?? "{}";
188598
+ }
188537
188599
  renderComponent(comp) {
188538
- const propParts = [];
188600
+ const segments = [{ kind: "entries", parts: [] }];
188601
+ const currentEntries = () => this.componentPropSegmentEntries(segments);
188539
188602
  for (const p of comp.props) {
188540
188603
  if ((p.name.match(/^on[A-Z]/) || p.name === "ref") && p.value.kind === "expression")
188541
188604
  continue;
@@ -188543,27 +188606,19 @@ ${childrenUnderLoop}` : childrenUnderLoop;
188543
188606
  const trimmed = p.value.expr.trim();
188544
188607
  if (this.propsObjectName && this.propsObjectName === trimmed) {
188545
188608
  for (const pp of this.propsParams) {
188546
- propParts.push(`${pp.name} => $${pp.name}`);
188609
+ currentEntries().push(`${pp.name} => $${pp.name}`);
188547
188610
  }
188548
188611
  continue;
188549
188612
  }
188550
- this.errors.push({
188551
- code: "BF101",
188552
- severity: "error",
188553
- message: `Spread props (\`{...${trimmed}}\`) on a child component cannot be lowered to Kolon — Kolon hashref method args can't splat a runtime hash into named entries.`,
188554
- loc: comp.loc ?? { file: this.componentName + ".tsx", start: { line: 1, column: 0 }, end: { line: 1, column: 0 } },
188555
- suggestion: {
188556
- message: "Pass the child component its props explicitly rather than spreading a runtime object."
188557
- }
188558
- });
188613
+ segments.push({ kind: "spread", expr: this.convertExpressionToKolon(p.value.expr) });
188559
188614
  continue;
188560
188615
  }
188561
188616
  const lowered = emitAttrValue(p.value, this.componentPropEmitter, p.name);
188562
188617
  if (lowered)
188563
- propParts.push(lowered);
188618
+ currentEntries().push(lowered);
188564
188619
  }
188565
188620
  if (comp.slotId && !this.inLoop) {
188566
- propParts.push(`_bf_slot => '${comp.slotId}'`);
188621
+ currentEntries().push(`_bf_slot => '${comp.slotId}'`);
188567
188622
  }
188568
188623
  const tplName = this.toTemplateName(comp.name);
188569
188624
  const effectiveChildren = comp.children.length > 0 ? comp.children : resolveJsxChildrenProp(comp.props);
@@ -188573,11 +188628,12 @@ ${childrenUnderLoop}` : childrenUnderLoop;
188573
188628
  const childrenBody = this.renderChildren(effectiveChildren);
188574
188629
  this.inLoop = prevInLoop;
188575
188630
  const macroName = `bf_children_${comp.slotId ?? "c" + this.childrenCaptureCounter++}`;
188576
- const childrenEntry = `children => ${macroName}()`;
188577
- const allParts = [...propParts, childrenEntry];
188578
- return `<: macro ${macroName} -> () { :>${childrenBody}<: } :><: $bf.render_child('${tplName}', { ${allParts.join(", ")} }) | mark_raw :>`;
188631
+ currentEntries().push(`children => ${macroName}()`);
188632
+ const dict = this.combineComponentPropSegments(segments);
188633
+ return `<: macro ${macroName} -> () { :>${childrenBody}<: } :><: $bf.render_child('${tplName}', ${dict}) | mark_raw :>`;
188579
188634
  }
188580
- const hashEntries = propParts.length > 0 ? `, { ${propParts.join(", ")} }` : "";
188635
+ const isEmpty = segments.every((s) => s.kind === "entries" && s.parts.length === 0);
188636
+ const hashEntries = isEmpty ? "" : `, ${this.combineComponentPropSegments(segments)}`;
188581
188637
  return `<: $bf.render_child('${tplName}'${hashEntries}) | mark_raw :>`;
188582
188638
  }
188583
188639
  childrenCaptureCounter = 0;
@@ -188852,6 +188908,10 @@ ${reason}` : "";
188852
188908
  const qArgs = queryHrefArgs(node, (n) => this.renderParsedExprToKolon(n));
188853
188909
  return `$bf.query(${qArgs.join(", ")})`;
188854
188910
  }
188911
+ if (node?.kind === "helper-call" && isValidHelperId(node.helper)) {
188912
+ const argsX = node.args.map((a) => this.renderParsedExprToKolon(a));
188913
+ return `$bf.${node.helper}(${argsX.join(", ")})`;
188914
+ }
188855
188915
  }
188856
188916
  }
188857
188917
  const support = isSupported(parsed);
@@ -165,6 +165,36 @@ export declare class XslateAdapter extends BaseAdapter implements IRNodeEmitter<
165
165
  * below, not threaded through the hashref entry list.
166
166
  */
167
167
  private readonly componentPropEmitter;
168
+ /**
169
+ * A `renderComponent` props hashref, built as an ORDERED sequence of
170
+ * segments so `{...before, ...spread, after: 1}` JSX spread semantics
171
+ * (later entries win) survive the trip through Kolon, which has no
172
+ * hash-splat syntax (no `%$h`-into-hashref-literal form — verified: parse
173
+ * error). Each `'entries'` segment is a literal Kolon hashref
174
+ * `{ k => v, ... }`; each `'spread'` segment is an arbitrary expression
175
+ * lowered from a `{...expr}` prop. `combineComponentPropSegments` folds
176
+ * the sequence into ONE expression via chained `.merge(...)` calls
177
+ * (Kolon's builtin hash method, later argument wins on key conflict,
178
+ * matching `Object.assign`/JSX order).
179
+ */
180
+ private componentPropSegmentEntries;
181
+ /**
182
+ * Fold ordered prop segments into a single Kolon expression via chained
183
+ * `.merge(...)` calls — Kolon's builtin hash method, later argument wins
184
+ * on key conflict, exactly like `{...a, ...b}`. A spread segment's
185
+ * expression is wrapped `(EXPR // {})` before merging: `.merge(undef)`
186
+ * warns "Merging value is not a HASH reference" (verified against real
187
+ * Text::Xslate 3.5.9), so the defined-or guard normalises a missing bag
188
+ * (e.g. `$children.props` when `children` was never passed — Kolon
189
+ * tolerates the chained dot-access on an undefined value itself,
190
+ * verified empirically) to an empty hashref first. If the fold starts
191
+ * with a spread segment, the base is just `($SPREAD // {})`; a
192
+ * following segment chains `.merge({...})` onto it. Empty `'entries'`
193
+ * segments are dropped so a leading/trailing spread doesn't drag in a
194
+ * needless `{}.merge(...)`. Returns `'{}'` when every segment is empty
195
+ * (no props at all).
196
+ */
197
+ private combineComponentPropSegments;
168
198
  renderComponent(comp: IRComponent): string;
169
199
  private childrenCaptureCounter;
170
200
  /** Uniquifies the `presenceOrUndefined` temp binding (`$bf_puN`) so two
@@ -1 +1 @@
1
- {"version":3,"file":"xslate-adapter.d.ts","sourceRoot":"","sources":["../../src/adapter/xslate-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EACV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OAKG;IACH,OAAO,CAAC,qBAAqB;IAuB7B,OAAO,CAAC,kCAAkC;IAwB1C;;;;OAIG;IACH,OAAO,CAAC,iCAAiC;IAmBzC;;;;;OAKG;IACH,OAAO,CAAC,+BAA+B;IAuBvC;;;;;;;OAOG;IACH,OAAO,KAAK,OAAO,GASlB;IAED;;;;;OAKG;IACH,OAAO,KAAK,SAAS,GAQpB;IAED,sEAAsE;IACtE,OAAO,KAAK,OAAO,GAElB;IAED,OAAO,CAAC,wBAAwB;IAyEhC;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IAI/B;oEACgE;IAChE,OAAO,CAAC,kBAAkB;IAI1B;;;;;OAKG;IACH;;;;;OAKG;IACH;;;;;OAKG;IACH;;;;OAIG;IACH,8BAA8B,CAC5B,IAAI,EAAE,MAAM,GACX;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAgBlD;IAED,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAO3C;IAED;;;;;OAKG;IACH,OAAO,CAAC,oBAAoB;IAU5B,OAAO,CAAC,2BAA2B;IAQnC,OAAO,CAAC,yBAAyB;IASjC,OAAO,CAAC,gBAAgB;IAcxB,iFAAiF;IACjF,OAAO,CAAC,4BAA4B;CAGrC;AAED,eAAO,MAAM,aAAa,eAAsB,CAAA"}
package/dist/build.js CHANGED
@@ -187302,12 +187302,13 @@ import {
187302
187302
  emitAttrValue,
187303
187303
  augmentInheritedPropAccesses,
187304
187304
  collectModuleStringConsts,
187305
- isLowerableObjectRestDestructure,
187306
187305
  lookupStaticRecordLiteral,
187307
187306
  searchParamsLocalNames,
187308
187307
  prepareLoweringMatchers,
187309
187308
  queryHrefArgs,
187310
- sortComparatorFromArrow as sortComparatorFromArrow2
187309
+ isValidHelperId,
187310
+ sortComparatorFromArrow as sortComparatorFromArrow2,
187311
+ isLowerableLoopDestructure
187311
187312
  } from "@barefootjs/jsx";
187312
187313
 
187313
187314
  // src/adapter/boolean-result.ts
@@ -187600,7 +187601,10 @@ function renderSortMethod(recv, c) {
187600
187601
  });
187601
187602
  return `$bf.sort(${recv}, { keys => [${keyHashes.join(", ")}] })`;
187602
187603
  }
187603
- function renderFlatMethod(recv, depth) {
187604
+ function renderFlatMethod(recv, depth, emit) {
187605
+ if (typeof depth === "object") {
187606
+ return `$bf.flat_dynamic(${recv}, ${emit(depth.expr)})`;
187607
+ }
187604
187608
  const d = depth === "infinity" ? -1 : depth;
187605
187609
  return `$bf.flat(${recv}, ${d})`;
187606
187610
  }
@@ -187711,7 +187715,7 @@ class XslateFilterEmitter {
187711
187715
  return renderArrayMethod(method, object, args, emit);
187712
187716
  }
187713
187717
  flatMethod(object, depth, emit) {
187714
- return renderFlatMethod(emit(object), depth);
187718
+ return renderFlatMethod(emit(object), depth, emit);
187715
187719
  }
187716
187720
  conditional(_test, _consequent, _alternate) {
187717
187721
  return "1";
@@ -187911,7 +187915,7 @@ class XslateTopLevelEmitter {
187911
187915
  return renderArrayMethod(method, object, args, emit);
187912
187916
  }
187913
187917
  flatMethod(object, depth, emit) {
187914
- return renderFlatMethod(emit(object), depth);
187918
+ return renderFlatMethod(emit(object), depth, emit);
187915
187919
  }
187916
187920
  conditional(test, consequent, alternate, emit) {
187917
187921
  return `(${emit(test)} ? ${emit(consequent)} : ${emit(alternate)})`;
@@ -187942,8 +187946,8 @@ class XslateTopLevelEmitter {
187942
187946
  unsupported(_raw, _reason) {
187943
187947
  return "''";
187944
187948
  }
187945
- objectLiteral(_properties, _raw, _emit) {
187946
- return "''";
187949
+ objectLiteral(properties, _raw, _emit) {
187950
+ return properties.length === 0 ? "{}" : "''";
187947
187951
  }
187948
187952
  }
187949
187953
 
@@ -188174,6 +188178,17 @@ function collectStringValueNames(ir) {
188174
188178
  }
188175
188179
 
188176
188180
  // src/adapter/xslate-adapter.ts
188181
+ function kolonSegmentAccessor(base, segments) {
188182
+ let expr = base;
188183
+ for (const seg of segments) {
188184
+ expr += seg.kind === "field" ? seg.isIdent ? `.${seg.key}` : `[${kolonHashKey(seg.key)}]` : `[${seg.index}]`;
188185
+ }
188186
+ return expr;
188187
+ }
188188
+ function kolonStringLiteral(s) {
188189
+ return `'${escapeKolonSingleQuoted(s)}'`;
188190
+ }
188191
+
188177
188192
  class XslateAdapter extends BaseAdapter {
188178
188193
  name = "xslate";
188179
188194
  extension = ".tx";
@@ -188442,21 +188457,37 @@ ${whenTrue}
188442
188457
  return `<: $bf.comment("loop:${loop.markerId}") | mark_raw :><: $bf.comment("/loop:${loop.markerId}") | mark_raw :>`;
188443
188458
  }
188444
188459
  const destructure = !!(loop.paramBindings && loop.paramBindings.length > 0);
188445
- const supportableDestructure = destructure && isLowerableObjectRestDestructure(loop);
188460
+ const supportableDestructure = destructure && isLowerableLoopDestructure(loop);
188446
188461
  if (destructure && !supportableDestructure) {
188447
188462
  this.errors.push({
188448
188463
  code: "BF104",
188449
188464
  severity: "error",
188450
- message: `Loop callback uses an array/object destructure pattern (\`${loop.param}\`) that the Xslate adapter cannot lower — Kolon \`for LIST -> $item\` binds a single scalar and can't unpack a tuple.`,
188465
+ message: `Loop callback uses a destructure pattern (\`${loop.param}\`) that the Xslate adapter cannot lower — see the diagnostic detail for the specific shape.`,
188451
188466
  loc: loop.loc ?? { file: this.componentName + ".tsx", start: { line: 1, column: 0 }, end: { line: 1, column: 0 } },
188452
188467
  suggestion: {
188453
188468
  message: `Options:
188454
- ` + ` 1. Rename the parameter to a single name and access tuple elements with index syntax in the body (e.g. \`entry => entry[0]\` instead of \`([k, v]) => ...\`).
188455
- ` + ` 2. Mark the loop position as @client-only so the destructure runs in JS on the client.
188456
- ` + ` 3. Move the loop into a primitive that the adapter registers explicitly.`
188469
+ ` + ` 1. If this is an object-rest binding (\`{ ...rest }\`), only reading \`rest.field\` or spreading \`{...rest}\` onto an intrinsic element lowers — other uses (passing \`rest\` to a function, rendering it as text) need the client runtime.
188470
+ ` + ` 2. If this is chained \`.filter().map(({ ... }) => ...)\`, hoist the destructure into a variable inside the callback body instead.
188471
+ ` + ` 3. Mark the loop position as @client-only so the destructure runs in JS on the client.
188472
+ ` + ` 4. Move the loop into a primitive that the adapter registers explicitly.`
188457
188473
  }
188458
188474
  });
188459
188475
  }
188476
+ const arrayName = loop.array.trim();
188477
+ if (/^[A-Za-z_$][\w$]*$/.test(arrayName)) {
188478
+ const arrayConst = (this.localConstants ?? []).find((c) => c.name === arrayName);
188479
+ if (arrayConst && !arrayConst.isModule && this._resolveLiteralConst(arrayName) === null) {
188480
+ this.errors.push({
188481
+ code: "BF101",
188482
+ severity: "error",
188483
+ message: `Loop array \`${arrayName}\` is a local computed value (\`${arrayConst.value}\`) that the Xslate adapter cannot bind as a template variable — only numeric/string-literal locals inline at their use site.`,
188484
+ loc: loop.loc ?? { file: this.componentName + ".tsx", start: { line: 1, column: 0 }, end: { line: 1, column: 0 } },
188485
+ suggestion: {
188486
+ message: "Pre-compute the array server-side and pass it as a prop, or mark the loop position as @client-only so it runs in JS on the client."
188487
+ }
188488
+ });
188489
+ }
188490
+ }
188460
188491
  const rawArray = this.convertExpressionToKolon(loop.array);
188461
188492
  let array = rawArray;
188462
188493
  if (loop.sortComparator) {
@@ -188478,7 +188509,15 @@ ${whenTrue}
188478
188509
  }
188479
188510
  if (supportableDestructure) {
188480
188511
  for (const b of loop.paramBindings ?? []) {
188481
- indexLocalLines.push(b.rest ? `: my $${b.name} = $${loopVar};` : `: my $${b.name} = $${loopVar}${b.path};`);
188512
+ const parent = kolonSegmentAccessor(`$${loopVar}`, b.segments ?? []);
188513
+ if (b.rest?.kind === "object") {
188514
+ const exclude = b.rest.exclude.map((k) => kolonStringLiteral(k.key)).join(", ");
188515
+ indexLocalLines.push(`: my $${b.name} = $bf.omit(${parent}, [${exclude}]);`);
188516
+ } else if (b.rest?.kind === "array") {
188517
+ indexLocalLines.push(`: my $${b.name} = $bf.slice(${parent}, ${b.rest.from}, nil);`);
188518
+ } else {
188519
+ indexLocalLines.push(`: my $${b.name} = ${kolonSegmentAccessor(`$${loopVar}`, b.segments ?? [])};`);
188520
+ }
188482
188521
  }
188483
188522
  }
188484
188523
  const prevInLoop = this.inLoop;
@@ -188534,8 +188573,32 @@ ${childrenUnderLoop}` : childrenUnderLoop;
188534
188573
  emitBooleanShorthand: (_value, name) => `${kolonHashKey(name)} => 1`,
188535
188574
  emitJsxChildren: () => ""
188536
188575
  };
188576
+ componentPropSegmentEntries(segments) {
188577
+ const last = segments[segments.length - 1];
188578
+ if (last && last.kind === "entries")
188579
+ return last.parts;
188580
+ const seg = { kind: "entries", parts: [] };
188581
+ segments.push(seg);
188582
+ return seg.parts;
188583
+ }
188584
+ combineComponentPropSegments(segments) {
188585
+ let acc = null;
188586
+ for (const seg of segments) {
188587
+ if (seg.kind === "entries") {
188588
+ if (seg.parts.length === 0)
188589
+ continue;
188590
+ const text = `{ ${seg.parts.join(", ")} }`;
188591
+ acc = acc === null ? text : `${acc}.merge(${text})`;
188592
+ } else {
188593
+ const text = `(${seg.expr} // {})`;
188594
+ acc = acc === null ? text : `${acc}.merge(${text})`;
188595
+ }
188596
+ }
188597
+ return acc ?? "{}";
188598
+ }
188537
188599
  renderComponent(comp) {
188538
- const propParts = [];
188600
+ const segments = [{ kind: "entries", parts: [] }];
188601
+ const currentEntries = () => this.componentPropSegmentEntries(segments);
188539
188602
  for (const p of comp.props) {
188540
188603
  if ((p.name.match(/^on[A-Z]/) || p.name === "ref") && p.value.kind === "expression")
188541
188604
  continue;
@@ -188543,27 +188606,19 @@ ${childrenUnderLoop}` : childrenUnderLoop;
188543
188606
  const trimmed = p.value.expr.trim();
188544
188607
  if (this.propsObjectName && this.propsObjectName === trimmed) {
188545
188608
  for (const pp of this.propsParams) {
188546
- propParts.push(`${pp.name} => $${pp.name}`);
188609
+ currentEntries().push(`${pp.name} => $${pp.name}`);
188547
188610
  }
188548
188611
  continue;
188549
188612
  }
188550
- this.errors.push({
188551
- code: "BF101",
188552
- severity: "error",
188553
- message: `Spread props (\`{...${trimmed}}\`) on a child component cannot be lowered to Kolon — Kolon hashref method args can't splat a runtime hash into named entries.`,
188554
- loc: comp.loc ?? { file: this.componentName + ".tsx", start: { line: 1, column: 0 }, end: { line: 1, column: 0 } },
188555
- suggestion: {
188556
- message: "Pass the child component its props explicitly rather than spreading a runtime object."
188557
- }
188558
- });
188613
+ segments.push({ kind: "spread", expr: this.convertExpressionToKolon(p.value.expr) });
188559
188614
  continue;
188560
188615
  }
188561
188616
  const lowered = emitAttrValue(p.value, this.componentPropEmitter, p.name);
188562
188617
  if (lowered)
188563
- propParts.push(lowered);
188618
+ currentEntries().push(lowered);
188564
188619
  }
188565
188620
  if (comp.slotId && !this.inLoop) {
188566
- propParts.push(`_bf_slot => '${comp.slotId}'`);
188621
+ currentEntries().push(`_bf_slot => '${comp.slotId}'`);
188567
188622
  }
188568
188623
  const tplName = this.toTemplateName(comp.name);
188569
188624
  const effectiveChildren = comp.children.length > 0 ? comp.children : resolveJsxChildrenProp(comp.props);
@@ -188573,11 +188628,12 @@ ${childrenUnderLoop}` : childrenUnderLoop;
188573
188628
  const childrenBody = this.renderChildren(effectiveChildren);
188574
188629
  this.inLoop = prevInLoop;
188575
188630
  const macroName = `bf_children_${comp.slotId ?? "c" + this.childrenCaptureCounter++}`;
188576
- const childrenEntry = `children => ${macroName}()`;
188577
- const allParts = [...propParts, childrenEntry];
188578
- return `<: macro ${macroName} -> () { :>${childrenBody}<: } :><: $bf.render_child('${tplName}', { ${allParts.join(", ")} }) | mark_raw :>`;
188631
+ currentEntries().push(`children => ${macroName}()`);
188632
+ const dict = this.combineComponentPropSegments(segments);
188633
+ return `<: macro ${macroName} -> () { :>${childrenBody}<: } :><: $bf.render_child('${tplName}', ${dict}) | mark_raw :>`;
188579
188634
  }
188580
- const hashEntries = propParts.length > 0 ? `, { ${propParts.join(", ")} }` : "";
188635
+ const isEmpty = segments.every((s) => s.kind === "entries" && s.parts.length === 0);
188636
+ const hashEntries = isEmpty ? "" : `, ${this.combineComponentPropSegments(segments)}`;
188581
188637
  return `<: $bf.render_child('${tplName}'${hashEntries}) | mark_raw :>`;
188582
188638
  }
188583
188639
  childrenCaptureCounter = 0;
@@ -188852,6 +188908,10 @@ ${reason}` : "";
188852
188908
  const qArgs = queryHrefArgs(node, (n) => this.renderParsedExprToKolon(n));
188853
188909
  return `$bf.query(${qArgs.join(", ")})`;
188854
188910
  }
188911
+ if (node?.kind === "helper-call" && isValidHelperId(node.helper)) {
188912
+ const argsX = node.args.map((a) => this.renderParsedExprToKolon(a));
188913
+ return `$bf.${node.helper}(${argsX.join(", ")})`;
188914
+ }
188855
188915
  }
188856
188916
  }
188857
188917
  const support = isSupported(parsed);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Per-fixture build-time contracts for shapes the Xslate adapter
3
+ * intentionally refuses to lower. Mirrors mojo's set — the lowering
4
+ * gates are shared code paths in the ported adapter. Consumed by this
5
+ * package's own conformance test (as `expectedDiagnostics`) and by
6
+ * `bf compat` (issue-URL attribution).
7
+ */
8
+ import type { ConformancePins } from '@barefootjs/jsx';
9
+ export declare const conformancePins: ConformancePins;
10
+ //# sourceMappingURL=conformance-pins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conformance-pins.d.ts","sourceRoot":"","sources":["../src/conformance-pins.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD,eAAO,MAAM,eAAe,EAAE,eAqG7B,CAAA"}
package/dist/index.d.ts CHANGED
@@ -5,4 +5,5 @@
5
5
  */
6
6
  export { XslateAdapter, xslateAdapter } from './adapter/index.ts';
7
7
  export type { XslateAdapterOptions } from './adapter/index.ts';
8
+ export { conformancePins } from './conformance-pins.ts';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACjE,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACjE,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA"}