@barefootjs/go-template 0.31.5 → 0.31.6

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.
@@ -334,8 +334,65 @@ export declare class GoTemplateAdapter extends BaseAdapter implements ParsedExpr
334
334
  * caller-facing while Props/NewProps key local, so a one-sided check lets
335
335
  * the structs disagree on whether the field exists (a duplicate json tag,
336
336
  * or a dead Input field whose caller writes are silently ignored).
337
+ *
338
+ * `nestedArrayFields` (built by each call site) is ALREADY restricted to
339
+ * prop-derived loops (#2627) — a same-name coincidence with a loop that
340
+ * merely transforms a differently-shaped prop (`Object.entries(props.tags)
341
+ * .filter(...)` feeding a `<Tag>` loop, whose plural `Tags` happens to
342
+ * match a `tags: Record<...>` prop) must NOT shadow the prop's own field;
343
+ * the two are different Go types and the prop has no other field to land
344
+ * in. See the call sites' `nestedArrayFields` construction.
337
345
  */
338
346
  private isNestedArrayShadowed;
347
+ /**
348
+ * True when `nested` is a `/* @client *\/` child-component loop (#2627)
349
+ * whose array is neither a real signal/memo (`isDynamic`) nor a direct
350
+ * prop reference (`isPropDerived`) — e.g. `Object.entries(props.tags)
351
+ * .filter(...)` feeding a `<Tag>` loop. `renderLoop`'s clientOnly branch
352
+ * (its very first check) renders such a loop as bare start/end comment
353
+ * markers on every backend — the SSR template NEVER references this
354
+ * nested component's Go field — and for a non-clientOnly loop with this
355
+ * same array shape, `renderLoop`'s own later BF101 gate (`arrayName` /
356
+ * `isBound` check) refuses to bind a function-scope computed local as a
357
+ * template variable at all. So there is no Go value anywhere to seed an
358
+ * Input field from or range over in `NewXxxProps` — treating `nested` as
359
+ * a normal static/prop-derived child loop emits a field/range/wrapper var
360
+ * for data nothing ever populates, and when its plural name happens to
361
+ * collide with the ACTUAL driving prop (`tags` -> `Tags`, `Tag` ->
362
+ * `Tags`), that dead field is worse than dead: either a duplicate Go
363
+ * field name (compile error) or — via `isNestedArrayShadowed` — silent
364
+ * loss of the prop's own field, the one channel the client actually
365
+ * reads hydration data from.
366
+ *
367
+ * `nested.isDynamic` is excluded from this check on purpose: a genuinely
368
+ * signal-backed clientOnly loop keeps its existing (tested, harmless)
369
+ * `json:"-"` Props field — only the "looks static but is actually an
370
+ * unbindable local" shape needs full exclusion.
371
+ */
372
+ private isOrphanedClientOnlyNested;
373
+ /**
374
+ * The auto-pluralized Go field names (`Row` -> `Rows`) that genuinely
375
+ * SUBSUME a same-named props param, so that param must not also get its
376
+ * own field. Four sites consume this — `generateInputStruct`,
377
+ * `generatePropsStruct`, `emitPropsAuxFields` and `recordRepropsSpec` —
378
+ * and they must agree exactly: a one-sided answer lets Input and
379
+ * Props/NewProps disagree about whether a field exists, producing a
380
+ * duplicate json tag or a dead Input field whose caller writes are
381
+ * silently ignored. Extracted to one function so that agreement is
382
+ * structural rather than four copies kept in step by hand (#2628 review).
383
+ *
384
+ * Only `isPropDerived` loops qualify (#2627). Such a loop ranges directly
385
+ * over `props.X` (or a destructured binding of it), so the array field and
386
+ * the prop are the same data, merely re-shaped into typed rows. A mere
387
+ * NAME coincidence is not subsumption: `Object.entries(props.tags)
388
+ * .filter(...)` feeding a `<Tag>` loop pluralizes to `Tags` and collides
389
+ * with a `tags` prop, but the prop is a `Record` while the loop array is a
390
+ * derived slice of tuples — dropping the prop's field there leaves it with
391
+ * no Go field at all to receive the caller's value. Note the check is
392
+ * purely name-based, so this is not specific to `Record`: any prop whose
393
+ * capitalized name matches a child's plural hits the same path.
394
+ */
395
+ private propDerivedNestedArrayFields;
339
396
  /**
340
397
  * Every Go field name these props params could claim — LOCAL and
341
398
  * caller-facing. A context-consumer field must exist in ALL of
@@ -1 +1 @@
1
- {"version":3,"file":"go-template-adapter.d.ts","sourceRoot":"","sources":["../../src/adapter/go-template-adapter.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAIpE,OAAO,KAAK,EACV,WAAW,EACX,MAAM,EACN,SAAS,EACT,MAAM,EACN,YAAY,EACZ,aAAa,EACb,MAAM,EAEN,WAAW,EACX,UA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AM,CAmU/B;IAED;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,+BAA+B;IA+CvC;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAWtB;;;;;;;;OAQG;IACH,OAAO,CAAC,0BAA0B;IAkBlC;;;;;;;;OAQG;IACH,OAAO,CAAC,2BAA2B;IAmBnC,eAAe,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,CAAC,EAAE;QAAE,uBAAuB,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,MAAM,CA2FtF;IAED;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;IAiB7B,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,UAAU;IAMT,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAM1C;IAED;;;;;;;;OAQG;IACH,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAoKlC;IAED;;;;;;;OAOG;IACH,OAAO,CAAC,mBAAmB;IA0B3B,OAAO,CAAC,gBAAgB;IAqCxB;;;;;;OAMG;IACH,OAAO,CAAC,0BAA0B;IAqDlC;;;;;;OAMG;IACH,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,0BAA0B;IAyClC,iBAAiB,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAKjD;IAED,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEvC;IAED,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEvC;IAED,OAAO,CAAC,kBAAkB;CAmB3B;AAED,eAAO,MAAM,iBAAiB,mBAA0B,CAAA"}
@@ -464,6 +464,7 @@ function collectNestedComponents(node, result) {
464
464
  ...loop.childComponent,
465
465
  isDynamic: !loop.isStaticArray,
466
466
  isPropDerived: !!loop.isPropDerivedArray,
467
+ clientOnly: loop.clientOnly,
467
468
  loopKey: loop.key ?? undefined,
468
469
  loopParam: loop.param ?? undefined,
469
470
  bodyChildren: hasBodyChildren ? loop.childComponent.children : undefined,
@@ -3156,6 +3157,12 @@ ${scriptRegistrations}${templateBody}
3156
3157
  isNestedArrayShadowed(param, nestedArrayFields) {
3157
3158
  return nestedArrayFields.has(capitalizeFieldName(param.name)) || nestedArrayFields.has(capitalizeFieldName(param.sourceName ?? param.name));
3158
3159
  }
3160
+ isOrphanedClientOnlyNested(nested) {
3161
+ return !!nested.clientOnly && !nested.isDynamic && !nested.isPropDerived;
3162
+ }
3163
+ propDerivedNestedArrayFields(nestedComponents) {
3164
+ return new Set(nestedComponents.filter((n) => n.isPropDerived).map((n) => `${n.name}s`));
3165
+ }
3159
3166
  propParamFieldNamesUnion(params) {
3160
3167
  return params.flatMap((p) => [capitalizeFieldName(p.name), capitalizeFieldName(p.sourceName ?? p.name)]);
3161
3168
  }
@@ -3194,7 +3201,7 @@ ${scriptRegistrations}${templateBody}
3194
3201
  recordRepropsSpec(ir, componentName, nestedComponents, spreadSlots) {
3195
3202
  if (!this.childDerivedFieldDeps.has(componentName))
3196
3203
  return;
3197
- const nestedArrayFields = new Set(nestedComponents.map((n) => `${n.name}s`));
3204
+ const nestedArrayFields = this.propDerivedNestedArrayFields(nestedComponents);
3198
3205
  const params = (ir.metadata.propsParams ?? []).filter((p) => !this.isNestedArrayShadowed(p, nestedArrayFields));
3199
3206
  const takenInput = new Set(this.propParamFieldNamesUnion(ir.metadata.propsParams ?? []));
3200
3207
  const eligible = nestedComponents.every((n) => n.isDynamic && !n.isPropDerived) && spreadSlots.length === 0 && !ir.metadata.restPropsName && this.nonCollidingContextConsumers(takenInput).length === 0;
@@ -3408,8 +3415,8 @@ ${goFields.join(`
3408
3415
  if (this.usesSearchParams(ir)) {
3409
3416
  lines.push("\tSearchParams bf.SearchParams // Optional: request query for searchParams()");
3410
3417
  }
3411
- const inputNested = nestedComponents.filter((n) => !n.isDynamic || n.isPropDerived);
3412
- const nestedArrayFields = new Set(nestedComponents.map((n) => `${n.name}s`));
3418
+ const inputNested = nestedComponents.filter((n) => (!n.isDynamic || n.isPropDerived) && !this.isOrphanedClientOnlyNested(n));
3419
+ const nestedArrayFields = this.propDerivedNestedArrayFields(nestedComponents);
3413
3420
  for (const param of ir.metadata.propsParams) {
3414
3421
  const fieldName = capitalizeFieldName(param.sourceName ?? param.name);
3415
3422
  if (this.isNestedArrayShadowed(param, nestedArrayFields))
@@ -3546,7 +3553,7 @@ ${goFields.join(`
3546
3553
  lines.push(` scopeID = "${componentName}_" + randomID(6)`);
3547
3554
  lines.push("\t}");
3548
3555
  lines.push("");
3549
- const staticNested = nestedComponents.filter((n) => !n.isDynamic || n.isPropDerived);
3556
+ const staticNested = nestedComponents.filter((n) => (!n.isDynamic || n.isPropDerived) && !this.isOrphanedClientOnlyNested(n));
3550
3557
  const emittedWrapperVars = new Set;
3551
3558
  const staticWithBody = staticNested.filter((n) => n.bodyChildren && n.bodyChildren.length > 0);
3552
3559
  const staticWithoutBody = staticNested.filter((n) => !n.bodyChildren || n.bodyChildren.length === 0);
@@ -3628,7 +3635,7 @@ ${goFields.join(`
3628
3635
  if (this.usesSearchParams(ir)) {
3629
3636
  lines.push("\t\tSearchParams: in.SearchParams,");
3630
3637
  }
3631
- const nestedArrayFields = new Set(nestedComponents.map((n) => `${n.name}s`));
3638
+ const nestedArrayFields = this.propDerivedNestedArrayFields(nestedComponents);
3632
3639
  const memoFallbacks = new Map;
3633
3640
  for (const memo of ir.metadata.memos) {
3634
3641
  const stripped = memo.computation.replace(/^\(\)\s*=>\s*/, "");
@@ -4126,7 +4133,7 @@ ${goFields.join(`
4126
4133
  }
4127
4134
  }
4128
4135
  emitPropsDataFields(lines, ir, nestedComponents, propTypeOverrides, takenJsonTags) {
4129
- const nestedArrayFields = new Set(nestedComponents.map((n) => `${n.name}s`));
4136
+ const nestedArrayFields = this.propDerivedNestedArrayFields(nestedComponents);
4130
4137
  const propFieldNames = new Set;
4131
4138
  for (const param of ir.metadata.propsParams) {
4132
4139
  const fieldName = capitalizeFieldName(param.name);
@@ -4200,6 +4207,8 @@ ${goFields.join(`
4200
4207
  lines.push(` ${this.contextFieldName(c)} ${this.contextConsumerGoType(c)} \`json:"${jsonTag}"\``);
4201
4208
  }
4202
4209
  for (const nested of nestedComponents) {
4210
+ if (this.isOrphanedClientOnlyNested(nested))
4211
+ continue;
4203
4212
  const elemType = nested.bodyChildren?.length ? this.loopBodyWrapperName(componentName, nested) : `${nested.name}Props`;
4204
4213
  if (nested.isDynamic && !nested.isPropDerived) {
4205
4214
  lines.push(` ${nested.name}s []${elemType} \`json:"-"\``);
@@ -6202,7 +6211,8 @@ ${goFields.join(`
6202
6211
  message: `Loop array \`${arrayName}\` is a local computed value (\`${arrayConst.value}\`) that the Go template adapter cannot bind as a template variable — only a string-derived local resolves to a generated struct field.`,
6203
6212
  loc: loop.loc ?? this.makeLoc(),
6204
6213
  suggestion: {
6205
- 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."
6214
+ 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.",
6215
+ escape: [{ kind: "prop-precompute" }, { kind: "client-directive" }]
6206
6216
  }
6207
6217
  });
6208
6218
  }
@@ -21,6 +21,21 @@ export type GoRenderCtx = {
21
21
  export interface NestedComponentInfo extends IRLoopChildComponent {
22
22
  isDynamic: boolean;
23
23
  isPropDerived: boolean;
24
+ /**
25
+ * True when the enclosing loop carries a `/* @client *\/` directive
26
+ * (`loop.clientOnly`, #2627). `renderLoop`'s FIRST branch short-circuits a
27
+ * clientOnly loop to bare start/end comment markers — the SSR template
28
+ * never references this nested component's Go field, no matter how
29
+ * `isDynamic`/`isPropDerived` classify its array. Combined with
30
+ * `!isDynamic && !isPropDerived` (a clientOnly loop whose array is
31
+ * neither a real signal/memo NOR a direct prop reference — e.g.
32
+ * `Object.entries(props.tags).filter(...)`), there is no Go value to
33
+ * seed an Input/Props field FROM at all: the array is a function-scope
34
+ * computed local that `renderLoop`'s own BF101 gate refuses to bind as a
35
+ * template variable for a non-clientOnly loop. See
36
+ * `GoTemplateAdapter.isOrphanedClientOnlyNested`.
37
+ */
38
+ clientOnly?: boolean;
24
39
  /** The enclosing loop's `key` expression (e.g. `item.label`) and map param
25
40
  * name (`item`), so the loop-child init can stamp `data-key` per item. */
26
41
  loopKey?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/adapter/lib/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,oBAAoB,EACpB,MAAM,EACN,MAAM,EACN,UAAU,EACV,QAAQ,EACT,MAAM,iBAAiB,CAAA;AAExB;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,uBAAuB,CAAC,EAAE,OAAO,CAAA;CAClC,CAAA;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAoB,SAAQ,oBAAoB;IAC/D,SAAS,EAAE,OAAO,CAAA;IAClB,aAAa,EAAE,OAAO,CAAA;IACtB;+EAC2E;IAC3E,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;0EACsE;IACtE,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;2EACuE;IACvE,eAAe,CAAC,EAAE,UAAU,CAAA;IAC5B,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;8EAC0E;IAC1E,YAAY,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAA;CAC/B;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB;;kFAE8E;IAC9E,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B;;;;;0BAKsB;IACtB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B;;;;;0EAKsE;IACtE,sBAAsB,E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AM,WAAW,wBAAwB;IACvC,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAEzB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,MAAM,CAAA;CACjC"}
@@ -1 +1 @@
1
- {"version":3,"file":"conformance-pins.d.ts","sourceRoot":"","sources":["../src/conformance-pins.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD,eAAO,MAAM,eAAe,EAAE,eAgL7B,CAAA"}
1
+ {"version":3,"file":"conformance-pins.d.ts","sourceRoot":"","sources":["../src/conformance-pins.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD,eAAO,MAAM,eAAe,EAAE,eAgM7B,CAAA"}
package/dist/index.js CHANGED
@@ -464,6 +464,7 @@ function collectNestedComponents(node, result) {
464
464
  ...loop.childComponent,
465
465
  isDynamic: !loop.isStaticArray,
466
466
  isPropDerived: !!loop.isPropDerivedArray,
467
+ clientOnly: loop.clientOnly,
467
468
  loopKey: loop.key ?? undefined,
468
469
  loopParam: loop.param ?? undefined,
469
470
  bodyChildren: hasBodyChildren ? loop.childComponent.children : undefined,
@@ -3156,6 +3157,12 @@ ${scriptRegistrations}${templateBody}
3156
3157
  isNestedArrayShadowed(param, nestedArrayFields) {
3157
3158
  return nestedArrayFields.has(capitalizeFieldName(param.name)) || nestedArrayFields.has(capitalizeFieldName(param.sourceName ?? param.name));
3158
3159
  }
3160
+ isOrphanedClientOnlyNested(nested) {
3161
+ return !!nested.clientOnly && !nested.isDynamic && !nested.isPropDerived;
3162
+ }
3163
+ propDerivedNestedArrayFields(nestedComponents) {
3164
+ return new Set(nestedComponents.filter((n) => n.isPropDerived).map((n) => `${n.name}s`));
3165
+ }
3159
3166
  propParamFieldNamesUnion(params) {
3160
3167
  return params.flatMap((p) => [capitalizeFieldName(p.name), capitalizeFieldName(p.sourceName ?? p.name)]);
3161
3168
  }
@@ -3194,7 +3201,7 @@ ${scriptRegistrations}${templateBody}
3194
3201
  recordRepropsSpec(ir, componentName, nestedComponents, spreadSlots) {
3195
3202
  if (!this.childDerivedFieldDeps.has(componentName))
3196
3203
  return;
3197
- const nestedArrayFields = new Set(nestedComponents.map((n) => `${n.name}s`));
3204
+ const nestedArrayFields = this.propDerivedNestedArrayFields(nestedComponents);
3198
3205
  const params = (ir.metadata.propsParams ?? []).filter((p) => !this.isNestedArrayShadowed(p, nestedArrayFields));
3199
3206
  const takenInput = new Set(this.propParamFieldNamesUnion(ir.metadata.propsParams ?? []));
3200
3207
  const eligible = nestedComponents.every((n) => n.isDynamic && !n.isPropDerived) && spreadSlots.length === 0 && !ir.metadata.restPropsName && this.nonCollidingContextConsumers(takenInput).length === 0;
@@ -3408,8 +3415,8 @@ ${goFields.join(`
3408
3415
  if (this.usesSearchParams(ir)) {
3409
3416
  lines.push("\tSearchParams bf.SearchParams // Optional: request query for searchParams()");
3410
3417
  }
3411
- const inputNested = nestedComponents.filter((n) => !n.isDynamic || n.isPropDerived);
3412
- const nestedArrayFields = new Set(nestedComponents.map((n) => `${n.name}s`));
3418
+ const inputNested = nestedComponents.filter((n) => (!n.isDynamic || n.isPropDerived) && !this.isOrphanedClientOnlyNested(n));
3419
+ const nestedArrayFields = this.propDerivedNestedArrayFields(nestedComponents);
3413
3420
  for (const param of ir.metadata.propsParams) {
3414
3421
  const fieldName = capitalizeFieldName(param.sourceName ?? param.name);
3415
3422
  if (this.isNestedArrayShadowed(param, nestedArrayFields))
@@ -3546,7 +3553,7 @@ ${goFields.join(`
3546
3553
  lines.push(` scopeID = "${componentName}_" + randomID(6)`);
3547
3554
  lines.push("\t}");
3548
3555
  lines.push("");
3549
- const staticNested = nestedComponents.filter((n) => !n.isDynamic || n.isPropDerived);
3556
+ const staticNested = nestedComponents.filter((n) => (!n.isDynamic || n.isPropDerived) && !this.isOrphanedClientOnlyNested(n));
3550
3557
  const emittedWrapperVars = new Set;
3551
3558
  const staticWithBody = staticNested.filter((n) => n.bodyChildren && n.bodyChildren.length > 0);
3552
3559
  const staticWithoutBody = staticNested.filter((n) => !n.bodyChildren || n.bodyChildren.length === 0);
@@ -3628,7 +3635,7 @@ ${goFields.join(`
3628
3635
  if (this.usesSearchParams(ir)) {
3629
3636
  lines.push("\t\tSearchParams: in.SearchParams,");
3630
3637
  }
3631
- const nestedArrayFields = new Set(nestedComponents.map((n) => `${n.name}s`));
3638
+ const nestedArrayFields = this.propDerivedNestedArrayFields(nestedComponents);
3632
3639
  const memoFallbacks = new Map;
3633
3640
  for (const memo of ir.metadata.memos) {
3634
3641
  const stripped = memo.computation.replace(/^\(\)\s*=>\s*/, "");
@@ -4126,7 +4133,7 @@ ${goFields.join(`
4126
4133
  }
4127
4134
  }
4128
4135
  emitPropsDataFields(lines, ir, nestedComponents, propTypeOverrides, takenJsonTags) {
4129
- const nestedArrayFields = new Set(nestedComponents.map((n) => `${n.name}s`));
4136
+ const nestedArrayFields = this.propDerivedNestedArrayFields(nestedComponents);
4130
4137
  const propFieldNames = new Set;
4131
4138
  for (const param of ir.metadata.propsParams) {
4132
4139
  const fieldName = capitalizeFieldName(param.name);
@@ -4200,6 +4207,8 @@ ${goFields.join(`
4200
4207
  lines.push(` ${this.contextFieldName(c)} ${this.contextConsumerGoType(c)} \`json:"${jsonTag}"\``);
4201
4208
  }
4202
4209
  for (const nested of nestedComponents) {
4210
+ if (this.isOrphanedClientOnlyNested(nested))
4211
+ continue;
4203
4212
  const elemType = nested.bodyChildren?.length ? this.loopBodyWrapperName(componentName, nested) : `${nested.name}Props`;
4204
4213
  if (nested.isDynamic && !nested.isPropDerived) {
4205
4214
  lines.push(` ${nested.name}s []${elemType} \`json:"-"\``);
@@ -6202,7 +6211,8 @@ ${goFields.join(`
6202
6211
  message: `Loop array \`${arrayName}\` is a local computed value (\`${arrayConst.value}\`) that the Go template adapter cannot bind as a template variable — only a string-derived local resolves to a generated struct field.`,
6203
6212
  loc: loop.loc ?? this.makeLoc(),
6204
6213
  suggestion: {
6205
- 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."
6214
+ 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.",
6215
+ escape: [{ kind: "prop-precompute" }, { kind: "client-directive" }]
6206
6216
  }
6207
6217
  });
6208
6218
  }
@@ -6644,21 +6654,29 @@ var conformancePins = {
6644
6654
  "tag-cloud": [{ code: "BF021", severity: "error" }],
6645
6655
  "preamble-cells": [{ code: "BF021", severity: "error" }],
6646
6656
  "static-array-from-props": [
6647
- { code: "BF101", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2321" }
6657
+ {
6658
+ code: "BF101",
6659
+ severity: "error",
6660
+ issue: "https://github.com/piconic-ai/barefootjs/issues/2321"
6661
+ }
6648
6662
  ],
6649
6663
  "static-array-from-props-with-component": [
6650
- { code: "BF101", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2321" }
6664
+ {
6665
+ code: "BF101",
6666
+ severity: "error",
6667
+ issue: "https://github.com/piconic-ai/barefootjs/issues/2321"
6668
+ }
6651
6669
  ],
6652
6670
  "filter-nested-callback-predicate": [
6653
6671
  { code: "BF101", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2320" }
6654
6672
  ],
6655
- "filter-nested-find-predicate": [
6656
- { code: "BF101", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2320" }
6657
- ],
6673
+ "filter-nested-find-predicate": [{ code: "BF101", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2320" }],
6658
6674
  "date-method-uncatalogued": [{ code: "BF021", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2356" }]
6659
6675
  };
6660
6676
  // src/render-divergences.ts
6661
- var renderDivergences = {};
6677
+ var renderDivergences = {
6678
+ "static-array-from-props-with-component-precomputed": "prop-backed child-component loop renders the loop host empty at SSR (https://github.com/piconic-ai/barefootjs/issues/2630)"
6679
+ };
6662
6680
  export {
6663
6681
  renderDivergences,
6664
6682
  goTemplateAdapter,
@@ -13,9 +13,15 @@
13
13
  * the docs compatibility-matrix page. Graduating an entry means fixing
14
14
  * the adapter (or the shared compiler layer) and deleting the line.
15
15
  *
16
- * Empty — the file's last live entry (`aliased-destructured-prop`, #2525)
17
- * graduated: the Input struct field is now keyed by `sourceName ?? name`
18
- * (caller-facing), so the caller-side composite literal `go run`s clean.
16
+ * Empty — the file's last live entry (`static-array-from-props-with-
17
+ * component-client`, #2627) graduated: a clientOnly child-component loop
18
+ * whose array is neither a signal/memo nor a direct prop reference (e.g.
19
+ * `Object.entries(props.tags).filter(...)` feeding a `<Tag>` loop) is now
20
+ * excluded entirely from the Input/Props/NewProps codegen instead of
21
+ * colliding with the driving prop's own field — see
22
+ * `GoTemplateAdapter.isOrphanedClientOnlyNested`. The caller-side composite
23
+ * literal for the `tags` prop now type-checks against its own `interface{}`
24
+ * field and `go run`s clean.
19
25
  * Keep the file (and this header) when the set is empty — the next
20
26
  * divergence lands here, not in a re-created file.
21
27
  */
@@ -1 +1 @@
1
- {"version":3,"file":"render-divergences.d.ts","sourceRoot":"","sources":["../src/render-divergences.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAExD,eAAO,MAAM,iBAAiB,EAAE,iBAa/B,CAAA"}
1
+ {"version":3,"file":"render-divergences.d.ts","sourceRoot":"","sources":["../src/render-divergences.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAExD,eAAO,MAAM,iBAAiB,EAAE,iBAiC/B,CAAA"}
package/dist/vite.js CHANGED
@@ -5529,6 +5529,7 @@ function collectNestedComponents(node, result) {
5529
5529
  ...loop.childComponent,
5530
5530
  isDynamic: !loop.isStaticArray,
5531
5531
  isPropDerived: !!loop.isPropDerivedArray,
5532
+ clientOnly: loop.clientOnly,
5532
5533
  loopKey: loop.key ?? undefined,
5533
5534
  loopParam: loop.param ?? undefined,
5534
5535
  bodyChildren: hasBodyChildren ? loop.childComponent.children : undefined,
@@ -8190,6 +8191,12 @@ ${scriptRegistrations}${templateBody}
8190
8191
  isNestedArrayShadowed(param, nestedArrayFields) {
8191
8192
  return nestedArrayFields.has(capitalizeFieldName(param.name)) || nestedArrayFields.has(capitalizeFieldName(param.sourceName ?? param.name));
8192
8193
  }
8194
+ isOrphanedClientOnlyNested(nested) {
8195
+ return !!nested.clientOnly && !nested.isDynamic && !nested.isPropDerived;
8196
+ }
8197
+ propDerivedNestedArrayFields(nestedComponents) {
8198
+ return new Set(nestedComponents.filter((n) => n.isPropDerived).map((n) => `${n.name}s`));
8199
+ }
8193
8200
  propParamFieldNamesUnion(params) {
8194
8201
  return params.flatMap((p) => [capitalizeFieldName(p.name), capitalizeFieldName(p.sourceName ?? p.name)]);
8195
8202
  }
@@ -8228,7 +8235,7 @@ ${scriptRegistrations}${templateBody}
8228
8235
  recordRepropsSpec(ir, componentName, nestedComponents, spreadSlots) {
8229
8236
  if (!this.childDerivedFieldDeps.has(componentName))
8230
8237
  return;
8231
- const nestedArrayFields = new Set(nestedComponents.map((n) => `${n.name}s`));
8238
+ const nestedArrayFields = this.propDerivedNestedArrayFields(nestedComponents);
8232
8239
  const params = (ir.metadata.propsParams ?? []).filter((p) => !this.isNestedArrayShadowed(p, nestedArrayFields));
8233
8240
  const takenInput = new Set(this.propParamFieldNamesUnion(ir.metadata.propsParams ?? []));
8234
8241
  const eligible = nestedComponents.every((n) => n.isDynamic && !n.isPropDerived) && spreadSlots.length === 0 && !ir.metadata.restPropsName && this.nonCollidingContextConsumers(takenInput).length === 0;
@@ -8442,8 +8449,8 @@ ${goFields.join(`
8442
8449
  if (this.usesSearchParams(ir)) {
8443
8450
  lines.push("\tSearchParams bf.SearchParams // Optional: request query for searchParams()");
8444
8451
  }
8445
- const inputNested = nestedComponents.filter((n) => !n.isDynamic || n.isPropDerived);
8446
- const nestedArrayFields = new Set(nestedComponents.map((n) => `${n.name}s`));
8452
+ const inputNested = nestedComponents.filter((n) => (!n.isDynamic || n.isPropDerived) && !this.isOrphanedClientOnlyNested(n));
8453
+ const nestedArrayFields = this.propDerivedNestedArrayFields(nestedComponents);
8447
8454
  for (const param of ir.metadata.propsParams) {
8448
8455
  const fieldName = capitalizeFieldName(param.sourceName ?? param.name);
8449
8456
  if (this.isNestedArrayShadowed(param, nestedArrayFields))
@@ -8580,7 +8587,7 @@ ${goFields.join(`
8580
8587
  lines.push(` scopeID = "${componentName}_" + randomID(6)`);
8581
8588
  lines.push("\t}");
8582
8589
  lines.push("");
8583
- const staticNested = nestedComponents.filter((n) => !n.isDynamic || n.isPropDerived);
8590
+ const staticNested = nestedComponents.filter((n) => (!n.isDynamic || n.isPropDerived) && !this.isOrphanedClientOnlyNested(n));
8584
8591
  const emittedWrapperVars = new Set;
8585
8592
  const staticWithBody = staticNested.filter((n) => n.bodyChildren && n.bodyChildren.length > 0);
8586
8593
  const staticWithoutBody = staticNested.filter((n) => !n.bodyChildren || n.bodyChildren.length === 0);
@@ -8662,7 +8669,7 @@ ${goFields.join(`
8662
8669
  if (this.usesSearchParams(ir)) {
8663
8670
  lines.push("\t\tSearchParams: in.SearchParams,");
8664
8671
  }
8665
- const nestedArrayFields = new Set(nestedComponents.map((n) => `${n.name}s`));
8672
+ const nestedArrayFields = this.propDerivedNestedArrayFields(nestedComponents);
8666
8673
  const memoFallbacks = new Map;
8667
8674
  for (const memo of ir.metadata.memos) {
8668
8675
  const stripped = memo.computation.replace(/^\(\)\s*=>\s*/, "");
@@ -9160,7 +9167,7 @@ ${goFields.join(`
9160
9167
  }
9161
9168
  }
9162
9169
  emitPropsDataFields(lines, ir, nestedComponents, propTypeOverrides, takenJsonTags) {
9163
- const nestedArrayFields = new Set(nestedComponents.map((n) => `${n.name}s`));
9170
+ const nestedArrayFields = this.propDerivedNestedArrayFields(nestedComponents);
9164
9171
  const propFieldNames = new Set;
9165
9172
  for (const param of ir.metadata.propsParams) {
9166
9173
  const fieldName = capitalizeFieldName(param.name);
@@ -9234,6 +9241,8 @@ ${goFields.join(`
9234
9241
  lines.push(` ${this.contextFieldName(c)} ${this.contextConsumerGoType(c)} \`json:"${jsonTag}"\``);
9235
9242
  }
9236
9243
  for (const nested of nestedComponents) {
9244
+ if (this.isOrphanedClientOnlyNested(nested))
9245
+ continue;
9237
9246
  const elemType = nested.bodyChildren?.length ? this.loopBodyWrapperName(componentName, nested) : `${nested.name}Props`;
9238
9247
  if (nested.isDynamic && !nested.isPropDerived) {
9239
9248
  lines.push(` ${nested.name}s []${elemType} \`json:"-"\``);
@@ -11236,7 +11245,8 @@ ${goFields.join(`
11236
11245
  message: `Loop array \`${arrayName}\` is a local computed value (\`${arrayConst.value}\`) that the Go template adapter cannot bind as a template variable — only a string-derived local resolves to a generated struct field.`,
11237
11246
  loc: loop.loc ?? this.makeLoc(),
11238
11247
  suggestion: {
11239
- 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."
11248
+ 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.",
11249
+ escape: [{ kind: "prop-precompute" }, { kind: "client-directive" }]
11240
11250
  }
11241
11251
  });
11242
11252
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barefootjs/go-template",
3
- "version": "0.31.5",
3
+ "version": "0.31.6",
4
4
  "description": "Go html/template adapter for BarefootJS - generates Go template files from IR",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -49,7 +49,7 @@
49
49
  "directory": "packages/adapter-go-template"
50
50
  },
51
51
  "dependencies": {
52
- "@barefootjs/shared": "0.31.5"
52
+ "@barefootjs/shared": "0.31.6"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "@barefootjs/jsx": ">=0.2.0",
@@ -67,9 +67,9 @@
67
67
  },
68
68
  "devDependencies": {
69
69
  "@barefootjs/adapter-tests": "0.1.0",
70
- "@barefootjs/client": "0.31.5",
71
- "@barefootjs/jsx": "0.31.5",
72
- "@barefootjs/vite": "0.31.5",
70
+ "@barefootjs/client": "0.31.6",
71
+ "@barefootjs/jsx": "0.31.6",
72
+ "@barefootjs/vite": "0.31.6",
73
73
  "vite": "^6.0.0"
74
74
  }
75
75
  }
@@ -127,6 +127,7 @@ function collectNestedComponents(node: IRNode, result: NestedComponentInfo[]): v
127
127
  ...loop.childComponent,
128
128
  isDynamic: !loop.isStaticArray,
129
129
  isPropDerived: !!loop.isPropDerivedArray,
130
+ clientOnly: loop.clientOnly,
130
131
  loopKey: loop.key ?? undefined,
131
132
  loopParam: loop.param ?? undefined,
132
133
  bodyChildren: hasBodyChildren ? loop.childComponent.children : undefined,
@@ -961,6 +961,14 @@ export class GoTemplateAdapter extends BaseAdapter implements ParsedExprEmitter,
961
961
  * caller-facing while Props/NewProps key local, so a one-sided check lets
962
962
  * the structs disagree on whether the field exists (a duplicate json tag,
963
963
  * or a dead Input field whose caller writes are silently ignored).
964
+ *
965
+ * `nestedArrayFields` (built by each call site) is ALREADY restricted to
966
+ * prop-derived loops (#2627) — a same-name coincidence with a loop that
967
+ * merely transforms a differently-shaped prop (`Object.entries(props.tags)
968
+ * .filter(...)` feeding a `<Tag>` loop, whose plural `Tags` happens to
969
+ * match a `tags: Record<...>` prop) must NOT shadow the prop's own field;
970
+ * the two are different Go types and the prop has no other field to land
971
+ * in. See the call sites' `nestedArrayFields` construction.
964
972
  */
965
973
  private isNestedArrayShadowed(
966
974
  param: { name: string; sourceName?: string },
@@ -972,6 +980,61 @@ export class GoTemplateAdapter extends BaseAdapter implements ParsedExprEmitter,
972
980
  )
973
981
  }
974
982
 
983
+ /**
984
+ * True when `nested` is a `/* @client *\/` child-component loop (#2627)
985
+ * whose array is neither a real signal/memo (`isDynamic`) nor a direct
986
+ * prop reference (`isPropDerived`) — e.g. `Object.entries(props.tags)
987
+ * .filter(...)` feeding a `<Tag>` loop. `renderLoop`'s clientOnly branch
988
+ * (its very first check) renders such a loop as bare start/end comment
989
+ * markers on every backend — the SSR template NEVER references this
990
+ * nested component's Go field — and for a non-clientOnly loop with this
991
+ * same array shape, `renderLoop`'s own later BF101 gate (`arrayName` /
992
+ * `isBound` check) refuses to bind a function-scope computed local as a
993
+ * template variable at all. So there is no Go value anywhere to seed an
994
+ * Input field from or range over in `NewXxxProps` — treating `nested` as
995
+ * a normal static/prop-derived child loop emits a field/range/wrapper var
996
+ * for data nothing ever populates, and when its plural name happens to
997
+ * collide with the ACTUAL driving prop (`tags` -> `Tags`, `Tag` ->
998
+ * `Tags`), that dead field is worse than dead: either a duplicate Go
999
+ * field name (compile error) or — via `isNestedArrayShadowed` — silent
1000
+ * loss of the prop's own field, the one channel the client actually
1001
+ * reads hydration data from.
1002
+ *
1003
+ * `nested.isDynamic` is excluded from this check on purpose: a genuinely
1004
+ * signal-backed clientOnly loop keeps its existing (tested, harmless)
1005
+ * `json:"-"` Props field — only the "looks static but is actually an
1006
+ * unbindable local" shape needs full exclusion.
1007
+ */
1008
+ private isOrphanedClientOnlyNested(nested: NestedComponentInfo): boolean {
1009
+ return !!nested.clientOnly && !nested.isDynamic && !nested.isPropDerived
1010
+ }
1011
+
1012
+ /**
1013
+ * The auto-pluralized Go field names (`Row` -> `Rows`) that genuinely
1014
+ * SUBSUME a same-named props param, so that param must not also get its
1015
+ * own field. Four sites consume this — `generateInputStruct`,
1016
+ * `generatePropsStruct`, `emitPropsAuxFields` and `recordRepropsSpec` —
1017
+ * and they must agree exactly: a one-sided answer lets Input and
1018
+ * Props/NewProps disagree about whether a field exists, producing a
1019
+ * duplicate json tag or a dead Input field whose caller writes are
1020
+ * silently ignored. Extracted to one function so that agreement is
1021
+ * structural rather than four copies kept in step by hand (#2628 review).
1022
+ *
1023
+ * Only `isPropDerived` loops qualify (#2627). Such a loop ranges directly
1024
+ * over `props.X` (or a destructured binding of it), so the array field and
1025
+ * the prop are the same data, merely re-shaped into typed rows. A mere
1026
+ * NAME coincidence is not subsumption: `Object.entries(props.tags)
1027
+ * .filter(...)` feeding a `<Tag>` loop pluralizes to `Tags` and collides
1028
+ * with a `tags` prop, but the prop is a `Record` while the loop array is a
1029
+ * derived slice of tuples — dropping the prop's field there leaves it with
1030
+ * no Go field at all to receive the caller's value. Note the check is
1031
+ * purely name-based, so this is not specific to `Record`: any prop whose
1032
+ * capitalized name matches a child's plural hits the same path.
1033
+ */
1034
+ private propDerivedNestedArrayFields(nestedComponents: readonly NestedComponentInfo[]): Set<string> {
1035
+ return new Set(nestedComponents.filter(n => n.isPropDerived).map(n => `${n.name}s`))
1036
+ }
1037
+
975
1038
  /**
976
1039
  * Every Go field name these props params could claim — LOCAL and
977
1040
  * caller-facing. A context-consumer field must exist in ALL of
@@ -1088,10 +1151,7 @@ export class GoTemplateAdapter extends BaseAdapter implements ParsedExprEmitter,
1088
1151
  ): void {
1089
1152
  if (!this.childDerivedFieldDeps.has(componentName)) return
1090
1153
 
1091
- // Must mirror `generateInputStruct`'s exclusion/collision checks exactly —
1092
- // both walk the Input struct's actual (caller-keyed) field names, or the
1093
- // reprops switch references fields the struct doesn't have.
1094
- const nestedArrayFields = new Set(nestedComponents.map(n => `${n.name}s`))
1154
+ const nestedArrayFields = this.propDerivedNestedArrayFields(nestedComponents)
1095
1155
  const params = (ir.metadata.propsParams ?? []).filter(
1096
1156
  p => !this.isNestedArrayShadowed(p, nestedArrayFields),
1097
1157
  )
@@ -1407,10 +1467,14 @@ export class GoTemplateAdapter extends BaseAdapter implements ParsedExprEmitter,
1407
1467
  }
1408
1468
 
1409
1469
  // Static + prop-derived nested components are in Input; signal-backed
1410
- // dynamic ones are template-only.
1411
- const inputNested = nestedComponents.filter(n => !n.isDynamic || n.isPropDerived)
1470
+ // dynamic ones are template-only. An orphaned clientOnly nested loop
1471
+ // (#2627 see `isOrphanedClientOnlyNested`) has no Go value to seed an
1472
+ // Input field from at all, so it's excluded from both buckets.
1473
+ const inputNested = nestedComponents.filter(
1474
+ n => (!n.isDynamic || n.isPropDerived) && !this.isOrphanedClientOnlyNested(n),
1475
+ )
1412
1476
 
1413
- const nestedArrayFields = new Set(nestedComponents.map(n => `${n.name}s`))
1477
+ const nestedArrayFields = this.propDerivedNestedArrayFields(nestedComponents)
1414
1478
 
1415
1479
  for (const param of ir.metadata.propsParams) {
1416
1480
  // #2525: caller-facing name, not the local destructure binding — a
@@ -1648,8 +1712,13 @@ export class GoTemplateAdapter extends BaseAdapter implements ParsedExprEmitter,
1648
1712
  lines.push('\t}')
1649
1713
  lines.push('')
1650
1714
 
1651
- // Static + prop-derived nested components auto-populate from input.
1652
- const staticNested = nestedComponents.filter(n => !n.isDynamic || n.isPropDerived)
1715
+ // Static + prop-derived nested components auto-populate from input. An
1716
+ // orphaned clientOnly nested loop (#2627 see `isOrphanedClientOnlyNested`)
1717
+ // has no Input field to range over (excluded above in `generateInputStruct`),
1718
+ // so it's excluded here too.
1719
+ const staticNested = nestedComponents.filter(
1720
+ n => (!n.isDynamic || n.isPropDerived) && !this.isOrphanedClientOnlyNested(n),
1721
+ )
1653
1722
 
1654
1723
  // Wrapper vars emitted (by either the static-with-body or dynamic-with-body
1655
1724
  // path), so the return struct only includes the ones that were built.
@@ -1786,7 +1855,7 @@ export class GoTemplateAdapter extends BaseAdapter implements ParsedExprEmitter,
1786
1855
  lines.push('\t\tSearchParams: in.SearchParams,')
1787
1856
  }
1788
1857
 
1789
- const nestedArrayFields = new Set(nestedComponents.map(n => `${n.name}s`))
1858
+ const nestedArrayFields = this.propDerivedNestedArrayFields(nestedComponents)
1790
1859
 
1791
1860
  // Props params (field names tracked to skip duplicate signal assignments).
1792
1861
  // A JSX-declared default (`variant = 'default'`) or signal-side fallback
@@ -2511,9 +2580,7 @@ export class GoTemplateAdapter extends BaseAdapter implements ParsedExprEmitter,
2511
2580
  propTypeOverrides: Map<string, string>,
2512
2581
  takenJsonTags: Set<string>,
2513
2582
  ): void {
2514
- // Nested-component array fields are emitted as typed arrays below, not as
2515
- // their raw prop; track them (and emitted names) to skip duplicates.
2516
- const nestedArrayFields = new Set(nestedComponents.map(n => `${n.name}s`))
2583
+ const nestedArrayFields = this.propDerivedNestedArrayFields(nestedComponents)
2517
2584
  const propFieldNames = new Set<string>()
2518
2585
 
2519
2586
  for (const param of ir.metadata.propsParams) {
@@ -2636,6 +2703,15 @@ export class GoTemplateAdapter extends BaseAdapter implements ParsedExprEmitter,
2636
2703
  }
2637
2704
 
2638
2705
  for (const nested of nestedComponents) {
2706
+ // An orphaned clientOnly nested loop (#2627 — see
2707
+ // `isOrphanedClientOnlyNested`) gets NO Props field at all, not even
2708
+ // the dead `json:"-"` one the signal-backed dynamic branch below gets:
2709
+ // its Go field name (`${nested.name}s`) can collide with the ACTUAL
2710
+ // driving prop's own field (e.g. `tags` -> `Tags` colliding with
2711
+ // `Tag` -> `Tags`), which `emitPropsDataFields` already emitted for
2712
+ // real — a second same-named field here is a Go compile error
2713
+ // ("redeclared"), not just dead code.
2714
+ if (this.isOrphanedClientOnlyNested(nested)) continue
2639
2715
  // Loop body with JSX children → use the wrapper struct type.
2640
2716
  const elemType = nested.bodyChildren?.length
2641
2717
  ? this.loopBodyWrapperName(componentName, nested)
@@ -6414,6 +6490,7 @@ export class GoTemplateAdapter extends BaseAdapter implements ParsedExprEmitter,
6414
6490
  suggestion: {
6415
6491
  message:
6416
6492
  '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.',
6493
+ escape: [{ kind: 'prop-precompute' }, { kind: 'client-directive' }],
6417
6494
  },
6418
6495
  })
6419
6496
  }
@@ -30,6 +30,21 @@ export type GoRenderCtx = {
30
30
  export interface NestedComponentInfo extends IRLoopChildComponent {
31
31
  isDynamic: boolean
32
32
  isPropDerived: boolean
33
+ /**
34
+ * True when the enclosing loop carries a `/* @client *\/` directive
35
+ * (`loop.clientOnly`, #2627). `renderLoop`'s FIRST branch short-circuits a
36
+ * clientOnly loop to bare start/end comment markers — the SSR template
37
+ * never references this nested component's Go field, no matter how
38
+ * `isDynamic`/`isPropDerived` classify its array. Combined with
39
+ * `!isDynamic && !isPropDerived` (a clientOnly loop whose array is
40
+ * neither a real signal/memo NOR a direct prop reference — e.g.
41
+ * `Object.entries(props.tags).filter(...)`), there is no Go value to
42
+ * seed an Input/Props field FROM at all: the array is a function-scope
43
+ * computed local that `renderLoop`'s own BF101 gate refuses to bind as a
44
+ * template variable for a non-clientOnly loop. See
45
+ * `GoTemplateAdapter.isOrphanedClientOnlyNested`.
46
+ */
47
+ clientOnly?: boolean
33
48
  /** The enclosing loop's `key` expression (e.g. `item.label`) and map param
34
49
  * name (`item`), so the loop-child init can stamp `data-key` per item. */
35
50
  loopKey?: string
@@ -15,6 +15,9 @@ export const conformancePins: ConformancePins = {
15
15
  // JS-runtime target runs it, a DSL adapter surfaces BF021 + `/* @client */`.
16
16
  // See spec/callback-fidelity.md.
17
17
  'filter-typeof-predicate': [{ code: 'BF021', severity: 'error' }],
18
+ // Array-builder `.map()` body (imperative `push`-into-array preamble):
19
+ // BF021, with a verified `/* @client */` escape — `map-array-builder-
20
+ // body-client` (#2613). See that fixture's docstring.
18
21
  'map-array-builder-body': [{ code: 'BF021', severity: 'error' }],
19
22
  'map-array-builder-escaping': [{ code: 'BF021', severity: 'error' }],
20
23
  // `.fill(value)` mutates the receiver in place — no template lowering
@@ -80,14 +83,29 @@ export const conformancePins: ConformancePins = {
80
83
  // array bound to such a const. See the `renderLoop` comment at the check
81
84
  // site; Jinja / ERB apply the same narrow check for the same reason.
82
85
  'static-array-from-props': [
83
- { code: 'BF101', severity: 'error', issue: 'https://github.com/piconic-ai/barefootjs/issues/2321' },
86
+ {
87
+ code: 'BF101',
88
+ severity: 'error',
89
+ issue: 'https://github.com/piconic-ai/barefootjs/issues/2321',
90
+ },
84
91
  ],
85
92
  // Same computed-const array as above — the destructure param itself no
86
93
  // longer contributes a diagnostic, and BF103 (sibling-imported child
87
94
  // component in the loop body) no longer fires either now that the
88
95
  // conformance harness passes `siblingTemplatesRegistered: true` (#2205).
96
+ // #2627 graduated: the `/* @client */` twin
97
+ // (`static-array-from-props-with-component-client`) now renders clean on
98
+ // real Go (its clientOnly nested `<Tag>` loop is excluded from the
99
+ // Input/Props/NewProps codegen instead of colliding with the `tags` prop's
100
+ // own field — see `GoTemplateAdapter.isOrphanedClientOnlyNested`), so this
101
+ // adapter has a verified escape for this fixture like every other one —
102
+ // no more `unescapable` line.
89
103
  'static-array-from-props-with-component': [
90
- { code: 'BF101', severity: 'error', issue: 'https://github.com/piconic-ai/barefootjs/issues/2321' },
104
+ {
105
+ code: 'BF101',
106
+ severity: 'error',
107
+ issue: 'https://github.com/piconic-ai/barefootjs/issues/2321',
108
+ },
91
109
  ],
92
110
  // (`style-3-signals` graduated alongside `style-object-dynamic` — see note
93
111
  // above; the `style={{ … }}` object now lowers to a CSS string.)
@@ -106,9 +124,7 @@ export const conformancePins: ConformancePins = {
106
124
  'filter-nested-callback-predicate': [
107
125
  { code: 'BF101', severity: 'error', issue: 'https://github.com/piconic-ai/barefootjs/issues/2320' },
108
126
  ],
109
- 'filter-nested-find-predicate': [
110
- { code: 'BF101', severity: 'error', issue: 'https://github.com/piconic-ai/barefootjs/issues/2320' },
111
- ],
127
+ 'filter-nested-find-predicate': [{ code: 'BF101', severity: 'error', issue: 'https://github.com/piconic-ai/barefootjs/issues/2320' }],
112
128
  // #1310 / #2087: rest destructure in .map() callback. `isLowerableLoopDestructure`
113
129
  // now admits every shape this fixture family exercises — each fixed/rest
114
130
  // binding resolves via `buildSegmentAccessor`/`buildDestructureBindingMap`
@@ -13,9 +13,15 @@
13
13
  * the docs compatibility-matrix page. Graduating an entry means fixing
14
14
  * the adapter (or the shared compiler layer) and deleting the line.
15
15
  *
16
- * Empty — the file's last live entry (`aliased-destructured-prop`, #2525)
17
- * graduated: the Input struct field is now keyed by `sourceName ?? name`
18
- * (caller-facing), so the caller-side composite literal `go run`s clean.
16
+ * Empty — the file's last live entry (`static-array-from-props-with-
17
+ * component-client`, #2627) graduated: a clientOnly child-component loop
18
+ * whose array is neither a signal/memo nor a direct prop reference (e.g.
19
+ * `Object.entries(props.tags).filter(...)` feeding a `<Tag>` loop) is now
20
+ * excluded entirely from the Input/Props/NewProps codegen instead of
21
+ * colliding with the driving prop's own field — see
22
+ * `GoTemplateAdapter.isOrphanedClientOnlyNested`. The caller-side composite
23
+ * literal for the `tags` prop now type-checks against its own `interface{}`
24
+ * field and `go run`s clean.
19
25
  * Keep the file (and this header) when the set is empty — the next
20
26
  * divergence lands here, not in a re-created file.
21
27
  */
@@ -23,6 +29,26 @@
23
29
  import type { RenderDivergences } from '@barefootjs/jsx'
24
30
 
25
31
  export const renderDivergences: RenderDivergences = {
32
+ // #2630: a prop-backed loop whose BODY is a child component renders the
33
+ // loop host empty — compiles clean, `go run`s clean, emits no children.
34
+ // Its sibling `static-array-from-props-precomputed` (same fixture,
35
+ // inline element body instead of a `<Tag>` child) renders correctly on
36
+ // every adapter, so this is specific to child-component bodies over a
37
+ // prop-backed array — plausibly the same missing server-side population
38
+ // path the `todo-app-ssr` note below describes, where
39
+ // `buildDynamicChildLoopSeeding` covers only the SIGNAL-backed dynamic
40
+ // case and a prop-backed static child loop has no analogue.
41
+ //
42
+ // This one costs a user something concrete: the BF101 diagnostic for
43
+ // #2321 lists pass-as-prop FIRST because it is the escape that keeps
44
+ // full server output, so a go-template user following that advice for a
45
+ // child-component loop gets an empty container at SSR with nothing
46
+ // reporting it. The fixture asserts the CORRECT (reference) output, so
47
+ // deleting this entry once the gap is fixed turns it into the
48
+ // regression test.
49
+ 'static-array-from-props-with-component-precomputed':
50
+ 'prop-backed child-component loop renders the loop host empty at SSR (https://github.com/piconic-ai/barefootjs/issues/2630)',
51
+
26
52
  // `todo-app-ssr` no longer diverges (#2209). Two parts: (1) `.Todos`
27
53
  // (the loop's DATUM slice) is already seeded straight from the caller's
28
54
  // Input — the constructor derives it from `initialTodos`, and `[]Todo`