@barefootjs/go-template 0.31.9 → 0.31.10
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/adapter/go-template-adapter.d.ts +8 -0
- package/dist/adapter/go-template-adapter.d.ts.map +1 -1
- package/dist/adapter/index.js +21 -7
- package/dist/adapter/lib/compile-state.d.ts +28 -1
- package/dist/adapter/lib/compile-state.d.ts.map +1 -1
- package/dist/adapter/props/prop-types.d.ts.map +1 -1
- package/dist/index.js +25 -8
- package/dist/render-divergences.d.ts +3 -3
- package/dist/render-divergences.d.ts.map +1 -1
- package/dist/vite.js +56 -9
- package/package.json +5 -5
- package/src/__tests__/go-template-adapter.test.ts +100 -3
- package/src/adapter/go-template-adapter.ts +77 -9
- package/src/adapter/lib/compile-state.ts +34 -0
- package/src/adapter/props/prop-types.ts +7 -1
- package/src/render-divergences.ts +28 -4
- package/src/test-render.ts +18 -1
|
@@ -716,6 +716,14 @@ export declare class GoTemplateAdapter extends BaseAdapter implements ParsedExpr
|
|
|
716
716
|
* the type's Go zero value (no-op).
|
|
717
717
|
*/
|
|
718
718
|
private collectPropFallbackVars;
|
|
719
|
+
/**
|
|
720
|
+
* Resolve a signal's initializer through the SSR seed plan's const-hop
|
|
721
|
+
* inlining (#2685) before prop-fallback extraction — see
|
|
722
|
+
* {@link resolveSignalParsedThroughSeedPlan} (shared with
|
|
723
|
+
* `collectNullishConsumedPropNames`'s signal-seed loop, the single door
|
|
724
|
+
* both consumers of this resolution go through).
|
|
725
|
+
*/
|
|
726
|
+
private resolvedSignalParsed;
|
|
719
727
|
/**
|
|
720
728
|
* Parse a signal-time initial value of the form `props.X ?? <literal>` —
|
|
721
729
|
* or, for destructured components, `x ?? <literal>` — into the source prop
|
|
@@ -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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StB,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"}
|
package/dist/adapter/index.js
CHANGED
|
@@ -361,6 +361,10 @@ class CompileState {
|
|
|
361
361
|
synthObjectStructNames = new Map;
|
|
362
362
|
needsStringsImport = false;
|
|
363
363
|
}
|
|
364
|
+
function resolveSignalParsedThroughSeedPlan(state, signal) {
|
|
365
|
+
const step = state.ssrSeedPlan.steps.find((s) => s.kind === "derived" && s.origin === "signal" && s.name === signal.getter);
|
|
366
|
+
return step?.kind === "derived" ? step.parsed : signal.parsed;
|
|
367
|
+
}
|
|
364
368
|
|
|
365
369
|
// src/adapter/analysis/component-tree.ts
|
|
366
370
|
function hasClientInteractivity(ir) {
|
|
@@ -2673,7 +2677,7 @@ function collectNullishConsumedPropNames(ctx, ir) {
|
|
|
2673
2677
|
};
|
|
2674
2678
|
walk(ir.root);
|
|
2675
2679
|
for (const signal of ir.metadata.signals) {
|
|
2676
|
-
const match = ctx.extractPropFallback(signal.initialValue, signal
|
|
2680
|
+
const match = ctx.extractPropFallback(signal.initialValue, resolveSignalParsedThroughSeedPlan(ctx.state, signal));
|
|
2677
2681
|
if (!match || !optionalParams.has(match.propName))
|
|
2678
2682
|
continue;
|
|
2679
2683
|
const f = match.goFallback;
|
|
@@ -3691,7 +3695,7 @@ ${goFields.join(`
|
|
|
3691
3695
|
const fieldName = capitalizeFieldName(signal.getter);
|
|
3692
3696
|
if (propFieldNames.has(fieldName))
|
|
3693
3697
|
continue;
|
|
3694
|
-
const fallbackMatch = this.extractPropFallback(signal.initialValue, signal
|
|
3698
|
+
const fallbackMatch = this.extractPropFallback(signal.initialValue, this.resolvedSignalParsed(signal));
|
|
3695
3699
|
const hoisted = fallbackMatch ? propFallbackVars.get(fallbackMatch.propName) : undefined;
|
|
3696
3700
|
if (hoisted) {
|
|
3697
3701
|
lines.push(` ${fieldName}: ${hoisted.varName},`);
|
|
@@ -4219,7 +4223,7 @@ ${goFields.join(`
|
|
|
4219
4223
|
const fieldName = capitalizeFieldName(signal.getter);
|
|
4220
4224
|
if (propFieldNames.has(fieldName))
|
|
4221
4225
|
continue;
|
|
4222
|
-
const jsonTag =
|
|
4226
|
+
const jsonTag = "-";
|
|
4223
4227
|
const synthType = this.state.synthStructTypes.get(signal.getter);
|
|
4224
4228
|
if (synthType) {
|
|
4225
4229
|
lines.push(` ${fieldName} ${typeInfoToGo(this.emitCtx, synthType)} \`json:"${jsonTag}"\``);
|
|
@@ -4251,7 +4255,7 @@ ${goFields.join(`
|
|
|
4251
4255
|
const fieldName = capitalizeFieldName(memo.name);
|
|
4252
4256
|
if (propFieldNames.has(fieldName))
|
|
4253
4257
|
continue;
|
|
4254
|
-
const jsonTag =
|
|
4258
|
+
const jsonTag = "-";
|
|
4255
4259
|
const goType = this.inferMemoType(memo, ir.metadata.signals, propsParamMap);
|
|
4256
4260
|
lines.push(` ${fieldName} ${goType} \`json:"${jsonTag}"\``);
|
|
4257
4261
|
}
|
|
@@ -4271,15 +4275,22 @@ ${goFields.join(`
|
|
|
4271
4275
|
...ir.metadata.memos.map((m) => capitalizeFieldName(m.name))
|
|
4272
4276
|
]);
|
|
4273
4277
|
for (const c of this.nonCollidingContextConsumers(takenProps)) {
|
|
4274
|
-
const jsonTag =
|
|
4278
|
+
const jsonTag = "-";
|
|
4275
4279
|
lines.push(` ${this.contextFieldName(c)} ${this.contextConsumerGoType(c)} \`json:"${jsonTag}"\``);
|
|
4276
4280
|
}
|
|
4281
|
+
const propDrivingFieldNames = new Set;
|
|
4282
|
+
for (const p of ir.metadata.propsParams) {
|
|
4283
|
+
propDrivingFieldNames.add(capitalizeFieldName(p.name));
|
|
4284
|
+
propDrivingFieldNames.add(capitalizeFieldName(p.sourceName ?? p.name));
|
|
4285
|
+
}
|
|
4277
4286
|
for (const nested of nestedComponents) {
|
|
4278
4287
|
if (this.isOrphanedClientOnlyNested(nested))
|
|
4279
4288
|
continue;
|
|
4280
4289
|
const elemType = nested.bodyChildren?.length ? this.loopBodyWrapperName(componentName, nested) : `${nested.name}Props`;
|
|
4281
4290
|
if (nested.isDynamic && !nested.isPropDerived) {
|
|
4282
4291
|
lines.push(` ${nested.name}s []${elemType} \`json:"-"\``);
|
|
4292
|
+
} else if (nested.isDynamic && nested.isPropDerived && !propDrivingFieldNames.has(`${nested.name}s`)) {
|
|
4293
|
+
lines.push(` ${nested.name}s []${elemType} \`json:"-"\``);
|
|
4283
4294
|
} else {
|
|
4284
4295
|
const jsonTag = this.claimJsonTag(this.toJsonTag(`${nested.name.charAt(0).toLowerCase()}${nested.name.slice(1)}s`), takenJsonTags);
|
|
4285
4296
|
lines.push(` ${nested.name}s []${elemType} \`json:"${jsonTag}"\``);
|
|
@@ -4290,7 +4301,7 @@ ${goFields.join(`
|
|
|
4290
4301
|
lines.push(` ${child.fieldName} ${child.name}Props \`json:"-"\``);
|
|
4291
4302
|
}
|
|
4292
4303
|
for (const slot of spreadSlots) {
|
|
4293
|
-
const jsonTag =
|
|
4304
|
+
const jsonTag = "-";
|
|
4294
4305
|
lines.push(` ${slot.slotId} map[string]any \`json:"${jsonTag}"\``);
|
|
4295
4306
|
}
|
|
4296
4307
|
}
|
|
@@ -4603,7 +4614,7 @@ ${goFields.join(`
|
|
|
4603
4614
|
}
|
|
4604
4615
|
const propTypeOverrides = buildPropTypeOverrides(this.emitCtx, ir);
|
|
4605
4616
|
for (const signal of ir.metadata.signals) {
|
|
4606
|
-
const match = this.extractPropFallback(signal.initialValue, signal
|
|
4617
|
+
const match = this.extractPropFallback(signal.initialValue, this.resolvedSignalParsed(signal));
|
|
4607
4618
|
if (!match)
|
|
4608
4619
|
continue;
|
|
4609
4620
|
if (result.has(match.propName))
|
|
@@ -4647,6 +4658,9 @@ ${goFields.join(`
|
|
|
4647
4658
|
}
|
|
4648
4659
|
return result;
|
|
4649
4660
|
}
|
|
4661
|
+
resolvedSignalParsed(signal) {
|
|
4662
|
+
return resolveSignalParsedThroughSeedPlan(this.state, signal);
|
|
4663
|
+
}
|
|
4650
4664
|
extractPropFallback(initialValue, preParsed) {
|
|
4651
4665
|
const structural = preParsed ? this.extractPropFallbackFromParsed(preParsed) : null;
|
|
4652
4666
|
if (structural)
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* `GoTemplateAdapter` for the full migration story) — this file never held
|
|
14
14
|
* that stack itself, only described where it lived.
|
|
15
15
|
*/
|
|
16
|
-
import type { CompilerError, ContextConsumer, EnvSignalReader, IRMetadata, IRNode, LoweringMatcher, MemoInfo, SsrSeedPlan, TypeDefinition, TypeInfo } from '@barefootjs/jsx';
|
|
16
|
+
import type { CompilerError, ContextConsumer, EnvSignalReader, IRMetadata, IRNode, LoweringMatcher, MemoInfo, ParsedExpr, SsrSeedPlan, TypeDefinition, TypeInfo } from '@barefootjs/jsx';
|
|
17
17
|
export declare class CompileState {
|
|
18
18
|
componentName: string;
|
|
19
19
|
errors: CompilerError[];
|
|
@@ -214,4 +214,31 @@ export declare class CompileState {
|
|
|
214
214
|
* `strings` is added to the generated types file's import block. */
|
|
215
215
|
needsStringsImport: boolean;
|
|
216
216
|
}
|
|
217
|
+
/**
|
|
218
|
+
* Resolve a signal's initializer through the SSR seed plan's const-hop
|
|
219
|
+
* inlining (#2685, `resolveThroughLocalConsts` in
|
|
220
|
+
* `packages/jsx/src/ssr-seed-plan.ts`) before prop-fallback shape matching,
|
|
221
|
+
* so a component-scope `const` sitting between a `props.X` read and
|
|
222
|
+
* `createSignal` (`const mid = props.label; createSignal(mid ?? 'Default')`)
|
|
223
|
+
* doesn't hide the `props.X ?? <literal>` shape from
|
|
224
|
+
* `extractPropFallbackFromParsed` / `collectNullishConsumedPropNames`'s
|
|
225
|
+
* signal-seed loop — both need the SAME resolved tree (single door, not two
|
|
226
|
+
* divergent walks: a mismatch between them is exactly what let the field-type
|
|
227
|
+
* flip and the fallback-var construction disagree on nullish handling for
|
|
228
|
+
* the const-hop shape).
|
|
229
|
+
*
|
|
230
|
+
* Falls back to the signal's own `parsed` when the plan didn't classify this
|
|
231
|
+
* signal `derived` (opaque for an unrelated reason, e.g. a free identifier
|
|
232
|
+
* genuinely out of scope) — never invents a substitution the plan itself
|
|
233
|
+
* didn't make.
|
|
234
|
+
*
|
|
235
|
+
* `signal` takes the minimal structural shape (not the internal `SignalInfo`
|
|
236
|
+
* type, which `@barefootjs/jsx`'s public index doesn't export — the same
|
|
237
|
+
* inline-shape convention `memo-compute.ts`'s extracted helpers already use
|
|
238
|
+
* for signal params).
|
|
239
|
+
*/
|
|
240
|
+
export declare function resolveSignalParsedThroughSeedPlan(state: CompileState, signal: {
|
|
241
|
+
getter: string;
|
|
242
|
+
parsed?: ParsedExpr;
|
|
243
|
+
}): ParsedExpr | undefined;
|
|
217
244
|
//# sourceMappingURL=compile-state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile-state.d.ts","sourceRoot":"","sources":["../../../src/adapter/lib/compile-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EACf,eAAe,EACf,UAAU,EACV,MAAM,EACN,eAAe,EACf,QAAQ,EACR,WAAW,EACX,cAAc,EACd,QAAQ,EACT,MAAM,iBAAiB,CAAA;AAExB,qBAAa,YAAY;IAGvB,aAAa,EAAE,MAAM,CAAK;IAC1B,MAAM,EAAE,aAAa,EAAE,CAAK;IAE5B;;+CAE2C;IAC3C,uBAAuB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAY;IAEhD,kBAAkB,EAAE,MAAM,CAAI;IAE9B;;;OAGG;IACH,sBAAsB,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,C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GAAG,SAAS,CAKxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/adapter/props/prop-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAsB,MAAM,iBAAiB,CAAA;AAGlF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/adapter/props/prop-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAsB,MAAM,iBAAiB,CAAA;AAGlF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAIvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,aAAa,EAAE,EAAE,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAuC/F;AAkDD;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,EAAE,WAAW,CAAC,MAAM,CAAiD,CAAA;AAEzG;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,+BAA+B,CAAC,GAAG,EAAE,aAAa,EAAE,EAAE,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,CA0EhG;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qCAAqC,CAAC,GAAG,EAAE,aAAa,EAAE,EAAE,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,CAkCtG;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,aAAa,EAAE,EAAE,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,CA+B7F;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,+BAA+B,CAAC,GAAG,EAAE,aAAa,EAAE,EAAE,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,CAmChG;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,aAAa,EAClB,KAAK,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,EACxC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACrC,MAAM,CAoDR;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,aAAa,EAAE,EAAE,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,CASzF"}
|
package/dist/index.js
CHANGED
|
@@ -361,6 +361,10 @@ class CompileState {
|
|
|
361
361
|
synthObjectStructNames = new Map;
|
|
362
362
|
needsStringsImport = false;
|
|
363
363
|
}
|
|
364
|
+
function resolveSignalParsedThroughSeedPlan(state, signal) {
|
|
365
|
+
const step = state.ssrSeedPlan.steps.find((s) => s.kind === "derived" && s.origin === "signal" && s.name === signal.getter);
|
|
366
|
+
return step?.kind === "derived" ? step.parsed : signal.parsed;
|
|
367
|
+
}
|
|
364
368
|
|
|
365
369
|
// src/adapter/analysis/component-tree.ts
|
|
366
370
|
function hasClientInteractivity(ir) {
|
|
@@ -2673,7 +2677,7 @@ function collectNullishConsumedPropNames(ctx, ir) {
|
|
|
2673
2677
|
};
|
|
2674
2678
|
walk(ir.root);
|
|
2675
2679
|
for (const signal of ir.metadata.signals) {
|
|
2676
|
-
const match = ctx.extractPropFallback(signal.initialValue, signal
|
|
2680
|
+
const match = ctx.extractPropFallback(signal.initialValue, resolveSignalParsedThroughSeedPlan(ctx.state, signal));
|
|
2677
2681
|
if (!match || !optionalParams.has(match.propName))
|
|
2678
2682
|
continue;
|
|
2679
2683
|
const f = match.goFallback;
|
|
@@ -3691,7 +3695,7 @@ ${goFields.join(`
|
|
|
3691
3695
|
const fieldName = capitalizeFieldName(signal.getter);
|
|
3692
3696
|
if (propFieldNames.has(fieldName))
|
|
3693
3697
|
continue;
|
|
3694
|
-
const fallbackMatch = this.extractPropFallback(signal.initialValue, signal
|
|
3698
|
+
const fallbackMatch = this.extractPropFallback(signal.initialValue, this.resolvedSignalParsed(signal));
|
|
3695
3699
|
const hoisted = fallbackMatch ? propFallbackVars.get(fallbackMatch.propName) : undefined;
|
|
3696
3700
|
if (hoisted) {
|
|
3697
3701
|
lines.push(` ${fieldName}: ${hoisted.varName},`);
|
|
@@ -4219,7 +4223,7 @@ ${goFields.join(`
|
|
|
4219
4223
|
const fieldName = capitalizeFieldName(signal.getter);
|
|
4220
4224
|
if (propFieldNames.has(fieldName))
|
|
4221
4225
|
continue;
|
|
4222
|
-
const jsonTag =
|
|
4226
|
+
const jsonTag = "-";
|
|
4223
4227
|
const synthType = this.state.synthStructTypes.get(signal.getter);
|
|
4224
4228
|
if (synthType) {
|
|
4225
4229
|
lines.push(` ${fieldName} ${typeInfoToGo(this.emitCtx, synthType)} \`json:"${jsonTag}"\``);
|
|
@@ -4251,7 +4255,7 @@ ${goFields.join(`
|
|
|
4251
4255
|
const fieldName = capitalizeFieldName(memo.name);
|
|
4252
4256
|
if (propFieldNames.has(fieldName))
|
|
4253
4257
|
continue;
|
|
4254
|
-
const jsonTag =
|
|
4258
|
+
const jsonTag = "-";
|
|
4255
4259
|
const goType = this.inferMemoType(memo, ir.metadata.signals, propsParamMap);
|
|
4256
4260
|
lines.push(` ${fieldName} ${goType} \`json:"${jsonTag}"\``);
|
|
4257
4261
|
}
|
|
@@ -4271,15 +4275,22 @@ ${goFields.join(`
|
|
|
4271
4275
|
...ir.metadata.memos.map((m) => capitalizeFieldName(m.name))
|
|
4272
4276
|
]);
|
|
4273
4277
|
for (const c of this.nonCollidingContextConsumers(takenProps)) {
|
|
4274
|
-
const jsonTag =
|
|
4278
|
+
const jsonTag = "-";
|
|
4275
4279
|
lines.push(` ${this.contextFieldName(c)} ${this.contextConsumerGoType(c)} \`json:"${jsonTag}"\``);
|
|
4276
4280
|
}
|
|
4281
|
+
const propDrivingFieldNames = new Set;
|
|
4282
|
+
for (const p of ir.metadata.propsParams) {
|
|
4283
|
+
propDrivingFieldNames.add(capitalizeFieldName(p.name));
|
|
4284
|
+
propDrivingFieldNames.add(capitalizeFieldName(p.sourceName ?? p.name));
|
|
4285
|
+
}
|
|
4277
4286
|
for (const nested of nestedComponents) {
|
|
4278
4287
|
if (this.isOrphanedClientOnlyNested(nested))
|
|
4279
4288
|
continue;
|
|
4280
4289
|
const elemType = nested.bodyChildren?.length ? this.loopBodyWrapperName(componentName, nested) : `${nested.name}Props`;
|
|
4281
4290
|
if (nested.isDynamic && !nested.isPropDerived) {
|
|
4282
4291
|
lines.push(` ${nested.name}s []${elemType} \`json:"-"\``);
|
|
4292
|
+
} else if (nested.isDynamic && nested.isPropDerived && !propDrivingFieldNames.has(`${nested.name}s`)) {
|
|
4293
|
+
lines.push(` ${nested.name}s []${elemType} \`json:"-"\``);
|
|
4283
4294
|
} else {
|
|
4284
4295
|
const jsonTag = this.claimJsonTag(this.toJsonTag(`${nested.name.charAt(0).toLowerCase()}${nested.name.slice(1)}s`), takenJsonTags);
|
|
4285
4296
|
lines.push(` ${nested.name}s []${elemType} \`json:"${jsonTag}"\``);
|
|
@@ -4290,7 +4301,7 @@ ${goFields.join(`
|
|
|
4290
4301
|
lines.push(` ${child.fieldName} ${child.name}Props \`json:"-"\``);
|
|
4291
4302
|
}
|
|
4292
4303
|
for (const slot of spreadSlots) {
|
|
4293
|
-
const jsonTag =
|
|
4304
|
+
const jsonTag = "-";
|
|
4294
4305
|
lines.push(` ${slot.slotId} map[string]any \`json:"${jsonTag}"\``);
|
|
4295
4306
|
}
|
|
4296
4307
|
}
|
|
@@ -4603,7 +4614,7 @@ ${goFields.join(`
|
|
|
4603
4614
|
}
|
|
4604
4615
|
const propTypeOverrides = buildPropTypeOverrides(this.emitCtx, ir);
|
|
4605
4616
|
for (const signal of ir.metadata.signals) {
|
|
4606
|
-
const match = this.extractPropFallback(signal.initialValue, signal
|
|
4617
|
+
const match = this.extractPropFallback(signal.initialValue, this.resolvedSignalParsed(signal));
|
|
4607
4618
|
if (!match)
|
|
4608
4619
|
continue;
|
|
4609
4620
|
if (result.has(match.propName))
|
|
@@ -4647,6 +4658,9 @@ ${goFields.join(`
|
|
|
4647
4658
|
}
|
|
4648
4659
|
return result;
|
|
4649
4660
|
}
|
|
4661
|
+
resolvedSignalParsed(signal) {
|
|
4662
|
+
return resolveSignalParsedThroughSeedPlan(this.state, signal);
|
|
4663
|
+
}
|
|
4650
4664
|
extractPropFallback(initialValue, preParsed) {
|
|
4651
4665
|
const structural = preParsed ? this.extractPropFallbackFromParsed(preParsed) : null;
|
|
4652
4666
|
if (structural)
|
|
@@ -6743,7 +6757,10 @@ var conformancePins = {
|
|
|
6743
6757
|
"rich-prop-client-read": [{ code: "BF049", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2648" }]
|
|
6744
6758
|
};
|
|
6745
6759
|
// src/render-divergences.ts
|
|
6746
|
-
var renderDivergences = {
|
|
6760
|
+
var renderDivergences = {
|
|
6761
|
+
"signal-prop-same-name-derived": "self-derived signal collides with its prop field name in the generated Go props struct — the non-idempotent `* 2` derivation is dropped and the signal renders the raw prop value instead (https://github.com/piconic-ai/barefootjs/issues/2683)",
|
|
6762
|
+
"signal-prop-same-name-via-const-derived": "self-derived signal (reached through a component-scope const) collides with its prop field name in the generated Go props struct — the non-idempotent `* 2` derivation is dropped and the signal renders the raw prop value instead (https://github.com/piconic-ai/barefootjs/issues/2683)"
|
|
6763
|
+
};
|
|
6747
6764
|
export {
|
|
6748
6765
|
renderDivergences,
|
|
6749
6766
|
goTemplateAdapter,
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
* file even when the set is empty — the next divergence lands here, not in
|
|
7
7
|
* a re-created file.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* (#2630's `static-array-from-props-with-component-precomputed` divergence
|
|
10
|
+
* graduated once the harness (`test-render.ts`'s
|
|
11
11
|
* `buildDynamicChildLoopSeeding`, despite the name — see its doc comment)
|
|
12
12
|
* learned to seed a prop-backed static child-component loop's Props slice
|
|
13
13
|
* the same way it already seeded a signal-backed dynamic one: the adapter's
|
|
14
14
|
* own `emission` was never the bug, only this harness's route-handler
|
|
15
|
-
* stand-in was missing the prop-derived case.
|
|
15
|
+
* stand-in was missing the prop-derived case.)
|
|
16
16
|
*/
|
|
17
17
|
import type { RenderDivergences } from '@barefootjs/jsx';
|
|
18
18
|
export declare const renderDivergences: RenderDivergences;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-divergences.d.ts","sourceRoot":"","sources":["../src/render-divergences.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAExD,eAAO,MAAM,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"render-divergences.d.ts","sourceRoot":"","sources":["../src/render-divergences.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAExD,eAAO,MAAM,iBAAiB,EAAE,iBAwB/B,CAAA"}
|
package/dist/vite.js
CHANGED
|
@@ -3929,6 +3929,38 @@ function classify(name, origin, expr, parsed, available) {
|
|
|
3929
3929
|
}
|
|
3930
3930
|
return { kind: "derived", name, origin, expr, parsed, frees: [...frees] };
|
|
3931
3931
|
}
|
|
3932
|
+
function localConstExprsByName(metadata) {
|
|
3933
|
+
const out = new Map;
|
|
3934
|
+
for (const c of metadata.localConstants ?? []) {
|
|
3935
|
+
if (c.isModule || c.declarationKind !== "const" || c.value === undefined)
|
|
3936
|
+
continue;
|
|
3937
|
+
out.set(c.name, c.parsed ?? parseExpression(c.value.trim()));
|
|
3938
|
+
}
|
|
3939
|
+
return out;
|
|
3940
|
+
}
|
|
3941
|
+
function resolveThroughLocalConsts(parsed, localConsts) {
|
|
3942
|
+
let current = parsed;
|
|
3943
|
+
const maxIter = localConsts.size + 1;
|
|
3944
|
+
for (let i = 0;i < maxIter; i++) {
|
|
3945
|
+
const frees = freeIdentifiers(current);
|
|
3946
|
+
if (frees === null)
|
|
3947
|
+
break;
|
|
3948
|
+
let changed = false;
|
|
3949
|
+
for (const name of frees) {
|
|
3950
|
+
const value = localConsts.get(name);
|
|
3951
|
+
if (!value)
|
|
3952
|
+
continue;
|
|
3953
|
+
const inlined = inlineBinding(current, name, value);
|
|
3954
|
+
if (inlined === null)
|
|
3955
|
+
continue;
|
|
3956
|
+
current = inlined;
|
|
3957
|
+
changed = true;
|
|
3958
|
+
}
|
|
3959
|
+
if (!changed)
|
|
3960
|
+
break;
|
|
3961
|
+
}
|
|
3962
|
+
return current;
|
|
3963
|
+
}
|
|
3932
3964
|
function computeSsrSeedPlan(metadata) {
|
|
3933
3965
|
const baseScope = metadata.propsParams.map((p) => p.name);
|
|
3934
3966
|
if (metadata.propsObjectName)
|
|
@@ -3937,6 +3969,7 @@ function computeSsrSeedPlan(metadata) {
|
|
|
3937
3969
|
baseScope.push(name);
|
|
3938
3970
|
}
|
|
3939
3971
|
const available = new Set(baseScope);
|
|
3972
|
+
const localConsts = localConstExprsByName(metadata);
|
|
3940
3973
|
const steps = [];
|
|
3941
3974
|
for (const signal of metadata.signals) {
|
|
3942
3975
|
if (signal.envReader) {
|
|
@@ -3948,13 +3981,13 @@ function computeSsrSeedPlan(metadata) {
|
|
|
3948
3981
|
}
|
|
3949
3982
|
}
|
|
3950
3983
|
const expr = signal.initialValue.trim();
|
|
3951
|
-
steps.push(expr === "" ? { kind: "opaque", name: signal.getter, origin: "signal" } : classify(signal.getter, "signal", expr, parseExpression(expr), available));
|
|
3984
|
+
steps.push(expr === "" ? { kind: "opaque", name: signal.getter, origin: "signal" } : classify(signal.getter, "signal", expr, resolveThroughLocalConsts(parseExpression(expr), localConsts), available));
|
|
3952
3985
|
available.add(signal.getter);
|
|
3953
3986
|
}
|
|
3954
3987
|
for (const memo of metadata.memos) {
|
|
3955
3988
|
const body = extractArrowBodyExpression(memo.computation);
|
|
3956
3989
|
const expr = body?.trim() ?? "";
|
|
3957
|
-
steps.push(expr === "" ? { kind: "opaque", name: memo.name, origin: "memo" } : classify(memo.name, "memo", expr, memo.parsed ?? parseExpression(expr), available));
|
|
3990
|
+
steps.push(expr === "" ? { kind: "opaque", name: memo.name, origin: "memo" } : classify(memo.name, "memo", expr, resolveThroughLocalConsts(memo.parsed ?? parseExpression(expr), localConsts), available));
|
|
3958
3991
|
available.add(memo.name);
|
|
3959
3992
|
}
|
|
3960
3993
|
return { baseScope, steps };
|
|
@@ -5458,6 +5491,10 @@ class CompileState {
|
|
|
5458
5491
|
synthObjectStructNames = new Map;
|
|
5459
5492
|
needsStringsImport = false;
|
|
5460
5493
|
}
|
|
5494
|
+
function resolveSignalParsedThroughSeedPlan(state, signal) {
|
|
5495
|
+
const step = state.ssrSeedPlan.steps.find((s) => s.kind === "derived" && s.origin === "signal" && s.name === signal.getter);
|
|
5496
|
+
return step?.kind === "derived" ? step.parsed : signal.parsed;
|
|
5497
|
+
}
|
|
5461
5498
|
|
|
5462
5499
|
// src/adapter/analysis/component-tree.ts
|
|
5463
5500
|
function hasClientInteractivity(ir) {
|
|
@@ -7740,7 +7777,7 @@ function collectNullishConsumedPropNames(ctx, ir) {
|
|
|
7740
7777
|
};
|
|
7741
7778
|
walk(ir.root);
|
|
7742
7779
|
for (const signal of ir.metadata.signals) {
|
|
7743
|
-
const match = ctx.extractPropFallback(signal.initialValue, signal
|
|
7780
|
+
const match = ctx.extractPropFallback(signal.initialValue, resolveSignalParsedThroughSeedPlan(ctx.state, signal));
|
|
7744
7781
|
if (!match || !optionalParams.has(match.propName))
|
|
7745
7782
|
continue;
|
|
7746
7783
|
const f = match.goFallback;
|
|
@@ -8757,7 +8794,7 @@ ${goFields.join(`
|
|
|
8757
8794
|
const fieldName = capitalizeFieldName(signal.getter);
|
|
8758
8795
|
if (propFieldNames.has(fieldName))
|
|
8759
8796
|
continue;
|
|
8760
|
-
const fallbackMatch = this.extractPropFallback(signal.initialValue, signal
|
|
8797
|
+
const fallbackMatch = this.extractPropFallback(signal.initialValue, this.resolvedSignalParsed(signal));
|
|
8761
8798
|
const hoisted = fallbackMatch ? propFallbackVars.get(fallbackMatch.propName) : undefined;
|
|
8762
8799
|
if (hoisted) {
|
|
8763
8800
|
lines.push(` ${fieldName}: ${hoisted.varName},`);
|
|
@@ -9285,7 +9322,7 @@ ${goFields.join(`
|
|
|
9285
9322
|
const fieldName = capitalizeFieldName(signal.getter);
|
|
9286
9323
|
if (propFieldNames.has(fieldName))
|
|
9287
9324
|
continue;
|
|
9288
|
-
const jsonTag =
|
|
9325
|
+
const jsonTag = "-";
|
|
9289
9326
|
const synthType = this.state.synthStructTypes.get(signal.getter);
|
|
9290
9327
|
if (synthType) {
|
|
9291
9328
|
lines.push(` ${fieldName} ${typeInfoToGo(this.emitCtx, synthType)} \`json:"${jsonTag}"\``);
|
|
@@ -9317,7 +9354,7 @@ ${goFields.join(`
|
|
|
9317
9354
|
const fieldName = capitalizeFieldName(memo.name);
|
|
9318
9355
|
if (propFieldNames.has(fieldName))
|
|
9319
9356
|
continue;
|
|
9320
|
-
const jsonTag =
|
|
9357
|
+
const jsonTag = "-";
|
|
9321
9358
|
const goType = this.inferMemoType(memo, ir.metadata.signals, propsParamMap);
|
|
9322
9359
|
lines.push(` ${fieldName} ${goType} \`json:"${jsonTag}"\``);
|
|
9323
9360
|
}
|
|
@@ -9337,15 +9374,22 @@ ${goFields.join(`
|
|
|
9337
9374
|
...ir.metadata.memos.map((m) => capitalizeFieldName(m.name))
|
|
9338
9375
|
]);
|
|
9339
9376
|
for (const c of this.nonCollidingContextConsumers(takenProps)) {
|
|
9340
|
-
const jsonTag =
|
|
9377
|
+
const jsonTag = "-";
|
|
9341
9378
|
lines.push(` ${this.contextFieldName(c)} ${this.contextConsumerGoType(c)} \`json:"${jsonTag}"\``);
|
|
9342
9379
|
}
|
|
9380
|
+
const propDrivingFieldNames = new Set;
|
|
9381
|
+
for (const p of ir.metadata.propsParams) {
|
|
9382
|
+
propDrivingFieldNames.add(capitalizeFieldName(p.name));
|
|
9383
|
+
propDrivingFieldNames.add(capitalizeFieldName(p.sourceName ?? p.name));
|
|
9384
|
+
}
|
|
9343
9385
|
for (const nested of nestedComponents) {
|
|
9344
9386
|
if (this.isOrphanedClientOnlyNested(nested))
|
|
9345
9387
|
continue;
|
|
9346
9388
|
const elemType = nested.bodyChildren?.length ? this.loopBodyWrapperName(componentName, nested) : `${nested.name}Props`;
|
|
9347
9389
|
if (nested.isDynamic && !nested.isPropDerived) {
|
|
9348
9390
|
lines.push(` ${nested.name}s []${elemType} \`json:"-"\``);
|
|
9391
|
+
} else if (nested.isDynamic && nested.isPropDerived && !propDrivingFieldNames.has(`${nested.name}s`)) {
|
|
9392
|
+
lines.push(` ${nested.name}s []${elemType} \`json:"-"\``);
|
|
9349
9393
|
} else {
|
|
9350
9394
|
const jsonTag = this.claimJsonTag(this.toJsonTag(`${nested.name.charAt(0).toLowerCase()}${nested.name.slice(1)}s`), takenJsonTags);
|
|
9351
9395
|
lines.push(` ${nested.name}s []${elemType} \`json:"${jsonTag}"\``);
|
|
@@ -9356,7 +9400,7 @@ ${goFields.join(`
|
|
|
9356
9400
|
lines.push(` ${child.fieldName} ${child.name}Props \`json:"-"\``);
|
|
9357
9401
|
}
|
|
9358
9402
|
for (const slot of spreadSlots) {
|
|
9359
|
-
const jsonTag =
|
|
9403
|
+
const jsonTag = "-";
|
|
9360
9404
|
lines.push(` ${slot.slotId} map[string]any \`json:"${jsonTag}"\``);
|
|
9361
9405
|
}
|
|
9362
9406
|
}
|
|
@@ -9669,7 +9713,7 @@ ${goFields.join(`
|
|
|
9669
9713
|
}
|
|
9670
9714
|
const propTypeOverrides = buildPropTypeOverrides(this.emitCtx, ir);
|
|
9671
9715
|
for (const signal of ir.metadata.signals) {
|
|
9672
|
-
const match = this.extractPropFallback(signal.initialValue, signal
|
|
9716
|
+
const match = this.extractPropFallback(signal.initialValue, this.resolvedSignalParsed(signal));
|
|
9673
9717
|
if (!match)
|
|
9674
9718
|
continue;
|
|
9675
9719
|
if (result.has(match.propName))
|
|
@@ -9713,6 +9757,9 @@ ${goFields.join(`
|
|
|
9713
9757
|
}
|
|
9714
9758
|
return result;
|
|
9715
9759
|
}
|
|
9760
|
+
resolvedSignalParsed(signal) {
|
|
9761
|
+
return resolveSignalParsedThroughSeedPlan(this.state, signal);
|
|
9762
|
+
}
|
|
9716
9763
|
extractPropFallback(initialValue, preParsed) {
|
|
9717
9764
|
const structural = preParsed ? this.extractPropFallbackFromParsed(preParsed) : null;
|
|
9718
9765
|
if (structural)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barefootjs/go-template",
|
|
3
|
-
"version": "0.31.
|
|
3
|
+
"version": "0.31.10",
|
|
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.
|
|
52
|
+
"@barefootjs/shared": "0.31.10"
|
|
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.
|
|
71
|
-
"@barefootjs/jsx": "0.31.
|
|
72
|
-
"@barefootjs/vite": "0.31.
|
|
70
|
+
"@barefootjs/client": "0.31.10",
|
|
71
|
+
"@barefootjs/jsx": "0.31.10",
|
|
72
|
+
"@barefootjs/vite": "0.31.10",
|
|
73
73
|
"vite": "^6.0.0"
|
|
74
74
|
}
|
|
75
75
|
}
|
|
@@ -944,7 +944,8 @@ export function List() {
|
|
|
944
944
|
// A struct is synthesised with one field per inferred key + Go type.
|
|
945
945
|
expect(types).toMatch(/type \w+ struct \{[\s\S]*ID string[\s\S]*N int[\s\S]*Ok bool[\s\S]*\}/)
|
|
946
946
|
// The signal field is a slice of the synthesised struct, not []interface{}.
|
|
947
|
-
|
|
947
|
+
// Excluded from bf-p (json:"-") — component-internal signal state (#2672).
|
|
948
|
+
expect(types).toMatch(/Items \[\]\w+ `json:"-"`/)
|
|
948
949
|
expect(types).not.toContain('Items []interface{}')
|
|
949
950
|
// The initial items are baked, not nil.
|
|
950
951
|
expect(types).not.toContain('Items: nil,')
|
|
@@ -1698,6 +1699,56 @@ export function Box({ children }: { children: any }) {
|
|
|
1698
1699
|
const types = adapter.generateTypes(ir)!
|
|
1699
1700
|
expect(types).toMatch(/Children\s+\S+\s+`json:"-"`/)
|
|
1700
1701
|
})
|
|
1702
|
+
|
|
1703
|
+
test('signal and memo fields are excluded from bf-p serialization — user props only (#2672)', () => {
|
|
1704
|
+
// A signal-bearing component whose only DECLARED prop is `label`, plus
|
|
1705
|
+
// a signal (`count`, not itself a prop) and a memo derived from it
|
|
1706
|
+
// (`doubled`). Only `label` may carry a real json tag — `count` and
|
|
1707
|
+
// `doubled` are component-internal state/derivation the client
|
|
1708
|
+
// re-derives itself and never reads back off `_p`.
|
|
1709
|
+
const adapter = new GoTemplateAdapter()
|
|
1710
|
+
const ir = compileToIR(`
|
|
1711
|
+
'use client'
|
|
1712
|
+
import { createSignal, createMemo } from '@barefootjs/client'
|
|
1713
|
+
export function Counter(props: { label: string }) {
|
|
1714
|
+
const [count, setCount] = createSignal(0)
|
|
1715
|
+
const doubled = createMemo(() => count() * 2)
|
|
1716
|
+
return <button onClick={() => setCount(count() + 1)}>{props.label}: {count()} / {doubled()}</button>
|
|
1717
|
+
}
|
|
1718
|
+
`, adapter)
|
|
1719
|
+
const types = adapter.generateTypes(ir)!
|
|
1720
|
+
// The real prop keeps its real tag — hydration reads `_p.label`.
|
|
1721
|
+
expect(types).toMatch(/Label\s+\S+\s+`json:"label"`/)
|
|
1722
|
+
// The signal field is component-internal state, not caller input.
|
|
1723
|
+
expect(types).toMatch(/Count\s+\S+\s+`json:"-"`/)
|
|
1724
|
+
// The memo field is component-internal derivation, not caller input.
|
|
1725
|
+
expect(types).toMatch(/Doubled\s+\S+\s+`json:"-"`/)
|
|
1726
|
+
})
|
|
1727
|
+
|
|
1728
|
+
test('prop-backed signal default still keeps the PROP field a real tag (#2672)', () => {
|
|
1729
|
+
// Mirrors the `signal-default-from-jsx` adapter-tests fixture: `x` is a
|
|
1730
|
+
// declared PROP whose default happens to come from a signal initial
|
|
1731
|
+
// value (keeps a real tag, seeds client-side `createSignal(_p.x ?? 7)`),
|
|
1732
|
+
// while `incremented` is a pure memo derivation the client never reads
|
|
1733
|
+
// off `_p`. Flipping signal/memo fields to `json:"-"` must NOT touch
|
|
1734
|
+
// this prop field — it is the loop-guard case CLAUDE.md's "don't flip
|
|
1735
|
+
// prop-backed fields" warns against.
|
|
1736
|
+
const adapter = new GoTemplateAdapter()
|
|
1737
|
+
const ir = compileToIR(`
|
|
1738
|
+
'use client'
|
|
1739
|
+
import { createSignal, createMemo } from '@barefootjs/client'
|
|
1740
|
+
export function SignalDefaultFromJsx(props: { x?: number }) {
|
|
1741
|
+
const [x, setX] = createSignal(props.x ?? 7)
|
|
1742
|
+
const incremented = createMemo(() => x() + 1)
|
|
1743
|
+
return <div onClick={() => setX(x() + 1)}>{x()} / {incremented()}</div>
|
|
1744
|
+
}
|
|
1745
|
+
`, adapter)
|
|
1746
|
+
const types = adapter.generateTypes(ir)!
|
|
1747
|
+
// The prop-backed field keeps its real tag — hydration reads `_p.x`.
|
|
1748
|
+
expect(types).toMatch(/X\s+\S+\s+`json:"x"`/)
|
|
1749
|
+
// The memo field is component-internal derivation, not caller input.
|
|
1750
|
+
expect(types).toMatch(/Incremented\s+\S+\s+`json:"-"`/)
|
|
1751
|
+
})
|
|
1701
1752
|
})
|
|
1702
1753
|
|
|
1703
1754
|
describe('generateTypes', () => {
|
|
@@ -4860,6 +4911,39 @@ export function Counter({ count: initialCount }: { count: number }) {
|
|
|
4860
4911
|
expect((types.match(/json:"count"/g) ?? []).length).toBe(1)
|
|
4861
4912
|
})
|
|
4862
4913
|
|
|
4914
|
+
// #2672 near-miss: a prop-derived dynamic loop's nested-array field is
|
|
4915
|
+
// normally redundant (the client re-derives every row from the real prop
|
|
4916
|
+
// field, e.g. `_p.items`) and gets `json:"-"`. But when the array field's
|
|
4917
|
+
// Go name collides with its OWN driving prop's Go name — `toggleItems`
|
|
4918
|
+
// driving a `.map()` into `<ToggleItem>` both capitalize to `ToggleItems`
|
|
4919
|
+
// — `emitPropsDataFields` already shadows the prop's own field to avoid a
|
|
4920
|
+
// Go redeclaration, so the nested-array field is the ONLY struct field
|
|
4921
|
+
// carrying that prop's data. Flipping it to `-` there would silently drop
|
|
4922
|
+
// caller input from `bf-p` instead of trimming a redundant copy. Caught by
|
|
4923
|
+
// the `hydration-props-inventory` oracle against the `toggle-shared`
|
|
4924
|
+
// fixture (a real `integrations/shared/components/Toggle.tsx` shape)
|
|
4925
|
+
// before landing; this pins the same shape directly.
|
|
4926
|
+
test('a prop-derived nested-array field keeps a real tag when it shadows its own driving prop (#2672)', () => {
|
|
4927
|
+
const result = compileJSX(`
|
|
4928
|
+
type ToggleItemProps = { label: string; defaultOn?: boolean }
|
|
4929
|
+
function ToggleItem(props: ToggleItemProps) {
|
|
4930
|
+
return <div>{props.label}</div>
|
|
4931
|
+
}
|
|
4932
|
+
type ToggleProps = { toggleItems: ToggleItemProps[] }
|
|
4933
|
+
export function Toggle({ toggleItems }: ToggleProps) {
|
|
4934
|
+
return <div>{toggleItems.map((item) => <ToggleItem key={item.label} label={item.label} defaultOn={item.defaultOn} />)}</div>
|
|
4935
|
+
}
|
|
4936
|
+
`.trimStart(), 'test.tsx', { adapter: new GoTemplateAdapter(), outputIR: false })
|
|
4937
|
+
expect((result.errors ?? []).filter(e => e.code === 'BF101')).toHaveLength(0)
|
|
4938
|
+
const types = result.files.find(f => f.type === 'types')!.content
|
|
4939
|
+
const togglePropsAndAfter = types.slice(types.indexOf('type ToggleProps struct'))
|
|
4940
|
+
// The shadowed scalar prop field is absent...
|
|
4941
|
+
expect(togglePropsAndAfter.slice(0, togglePropsAndAfter.indexOf('}'))).not.toMatch(/\bItems\b/)
|
|
4942
|
+
// ...and the nested-array field is the sole carrier, with a REAL tag —
|
|
4943
|
+
// not `json:"-"`, which would drop `toggleItems` from `bf-p` entirely.
|
|
4944
|
+
expect((togglePropsAndAfter.match(/json:"toggleItems"/g) ?? []).length).toBe(1)
|
|
4945
|
+
})
|
|
4946
|
+
|
|
4863
4947
|
// The nested-array skip check must union both namings at all four sites
|
|
4864
4948
|
// (`isNestedArrayShadowed`) — a one-sided check lets Input and
|
|
4865
4949
|
// Props/NewProps disagree on whether an aliased prop's field exists.
|
|
@@ -6045,7 +6129,15 @@ export { TaggedList }
|
|
|
6045
6129
|
expect(payload).toEqual({ items: [{ title: 'Alpha', tags: ['a', 'b'] }] })
|
|
6046
6130
|
})
|
|
6047
6131
|
|
|
6048
|
-
test('real go-run render:
|
|
6132
|
+
test('real go-run render: a signal-backed nested anonymous object is baked into SSR HTML but excluded from bf-p (#2672)', async () => {
|
|
6133
|
+
// `rows` here is a SIGNAL, not a prop — `NestedNames` takes no props at
|
|
6134
|
+
// all. Its data still resolves the synthesized-struct-type branch of
|
|
6135
|
+
// `emitPropsDataFields` (the case ii struct-synthesis this describe
|
|
6136
|
+
// block exists to cover), so this doubles as a real-go-run confirmation
|
|
6137
|
+
// that branch's json tag is also `-` now, not just the general one.
|
|
6138
|
+
// `{{.Field}}` SSR access is unaffected by json tags — the rendered
|
|
6139
|
+
// `<li>Ada</li>` still bakes correctly; only `bf-p` (component-internal
|
|
6140
|
+
// signal state, not caller input) drops the redundant `rows` key.
|
|
6049
6141
|
const source = `
|
|
6050
6142
|
"use client"
|
|
6051
6143
|
import { createSignal } from "@barefootjs/client"
|
|
@@ -6063,12 +6155,17 @@ export function NestedNames() {
|
|
|
6063
6155
|
if (err instanceof GoNotAvailableError) return // Go toolchain not installed on this host
|
|
6064
6156
|
throw err
|
|
6065
6157
|
}
|
|
6158
|
+
// SSR HTML still bakes the signal's initial data — unaffected by the
|
|
6159
|
+
// json tag, since `{{.Field}}` template access doesn't consult it.
|
|
6160
|
+
expect(html).toContain('<li')
|
|
6161
|
+
expect(html).toContain('Ada')
|
|
6066
6162
|
const bfPMatch = html.match(/bf-p="([^"]*)"/)
|
|
6067
6163
|
expect(bfPMatch).not.toBeNull()
|
|
6068
6164
|
const decoded = bfPMatch![1]
|
|
6069
6165
|
.replace(/"/g, '"')
|
|
6070
6166
|
.replace(/"/g, '"')
|
|
6071
6167
|
const payload = JSON.parse(decoded)
|
|
6072
|
-
|
|
6168
|
+
// No props at all on this component — bf-p carries nothing.
|
|
6169
|
+
expect(payload).toEqual({})
|
|
6073
6170
|
})
|
|
6074
6171
|
})
|
|
@@ -119,7 +119,7 @@ import type {
|
|
|
119
119
|
} from "./lib/types.ts"
|
|
120
120
|
import { collectRootScopeNodes } from "./lib/ir-scope.ts"
|
|
121
121
|
import { GO_TEMPLATE_PRIMITIVES } from "./lib/constants.ts"
|
|
122
|
-
import { CompileState } from "./lib/compile-state.ts"
|
|
122
|
+
import { CompileState, resolveSignalParsedThroughSeedPlan } from "./lib/compile-state.ts"
|
|
123
123
|
import { hasClientInteractivity, findNestedComponents } from "./analysis/component-tree.ts"
|
|
124
124
|
import { analyzeBakeableStaticChildLoop, scalarToGoLiteral, type BakedStaticChildLoop } from "./analysis/static-child-loop-bake.ts"
|
|
125
125
|
import { analyzeBakeableStaticElementLoop } from "./analysis/static-element-loop-bake.ts"
|
|
@@ -1948,7 +1948,7 @@ export class GoTemplateAdapter extends BaseAdapter implements ParsedExprEmitter,
|
|
|
1948
1948
|
if (propFieldNames.has(fieldName)) continue
|
|
1949
1949
|
// `props.X ?? N` reuses the hoisted fallback var so signal and memo share
|
|
1950
1950
|
// one value.
|
|
1951
|
-
const fallbackMatch = this.extractPropFallback(signal.initialValue, signal
|
|
1951
|
+
const fallbackMatch = this.extractPropFallback(signal.initialValue, this.resolvedSignalParsed(signal))
|
|
1952
1952
|
const hoisted = fallbackMatch ? propFallbackVars.get(fallbackMatch.propName) : undefined
|
|
1953
1953
|
if (hoisted) {
|
|
1954
1954
|
lines.push(`\t\t${fieldName}: ${hoisted.varName},`)
|
|
@@ -2782,7 +2782,14 @@ export class GoTemplateAdapter extends BaseAdapter implements ParsedExprEmitter,
|
|
|
2782
2782
|
if (signal.envReader) continue
|
|
2783
2783
|
const fieldName = capitalizeFieldName(signal.getter)
|
|
2784
2784
|
if (propFieldNames.has(fieldName)) continue
|
|
2785
|
-
|
|
2785
|
+
// Signal fields are component-internal state, not caller input (#2672):
|
|
2786
|
+
// the client never reads `_p.<signalGetter>` — it re-derives the value
|
|
2787
|
+
// from `createSignal(...)`'s own initial expression (which itself reads
|
|
2788
|
+
// whatever PROP field seeded it, already emitted above with a real tag
|
|
2789
|
+
// by the propsParams loop). Excluding the signal field from JSON stops
|
|
2790
|
+
// it from co-boarding into `bf-p` while leaving `{{.Field}}` SSR access
|
|
2791
|
+
// untouched — Go template field access doesn't consult json tags.
|
|
2792
|
+
const jsonTag = '-'
|
|
2786
2793
|
// A synthesised struct type wins outright — the signal is an untyped
|
|
2787
2794
|
// object array we gave a concrete element type.
|
|
2788
2795
|
const synthType = this.state.synthStructTypes.get(signal.getter)
|
|
@@ -2832,7 +2839,10 @@ export class GoTemplateAdapter extends BaseAdapter implements ParsedExprEmitter,
|
|
|
2832
2839
|
for (const memo of ir.metadata.memos) {
|
|
2833
2840
|
const fieldName = capitalizeFieldName(memo.name)
|
|
2834
2841
|
if (propFieldNames.has(fieldName)) continue
|
|
2835
|
-
|
|
2842
|
+
// Memo fields are derived, re-computed client-side from the same prop
|
|
2843
|
+
// reads the memo body itself performs — never read as `_p.<memoName>`
|
|
2844
|
+
// (#2672). Same rationale as the signal fields above.
|
|
2845
|
+
const jsonTag = '-'
|
|
2836
2846
|
const goType = this.inferMemoType(memo, ir.metadata.signals, propsParamMap)
|
|
2837
2847
|
lines.push(`\t${fieldName} ${goType} \`json:"${jsonTag}"\``)
|
|
2838
2848
|
}
|
|
@@ -2868,10 +2878,27 @@ export class GoTemplateAdapter extends BaseAdapter implements ParsedExprEmitter,
|
|
|
2868
2878
|
...ir.metadata.memos.map(m => capitalizeFieldName(m.name)),
|
|
2869
2879
|
])
|
|
2870
2880
|
for (const c of this.nonCollidingContextConsumers(takenProps)) {
|
|
2871
|
-
|
|
2881
|
+
// Context-consumer fields are resolved server-side from the enclosing
|
|
2882
|
+
// `Provider` and read via `{{.Field}}` in SSR only — the client's own
|
|
2883
|
+
// `useContext` re-reads the DOM-scoped provider value at hydration
|
|
2884
|
+
// time, never `_p.<contextField>` (#2672).
|
|
2885
|
+
const jsonTag = '-'
|
|
2872
2886
|
lines.push(`\t${this.contextFieldName(c)} ${this.contextConsumerGoType(c)} \`json:"${jsonTag}"\``)
|
|
2873
2887
|
}
|
|
2874
2888
|
|
|
2889
|
+
// Capitalized Go field names of every declared prop — BOTH the LOCAL
|
|
2890
|
+
// binding and the caller-facing (`sourceName`) spelling, unioned the
|
|
2891
|
+
// same way `isNestedArrayShadowed` does for the propsParams loop above
|
|
2892
|
+
// (an aliased destructure like `{ rows: items }` can collide under
|
|
2893
|
+
// either naming depending on alias direction — see the #2525 collision
|
|
2894
|
+
// tests). Used below to detect when a nested-array field's name
|
|
2895
|
+
// collides with (and shadows) an actual prop field.
|
|
2896
|
+
const propDrivingFieldNames = new Set<string>()
|
|
2897
|
+
for (const p of ir.metadata.propsParams) {
|
|
2898
|
+
propDrivingFieldNames.add(capitalizeFieldName(p.name))
|
|
2899
|
+
propDrivingFieldNames.add(capitalizeFieldName(p.sourceName ?? p.name))
|
|
2900
|
+
}
|
|
2901
|
+
|
|
2875
2902
|
for (const nested of nestedComponents) {
|
|
2876
2903
|
// An orphaned clientOnly nested loop (#2627 — see
|
|
2877
2904
|
// `isOrphanedClientOnlyNested`) gets NO Props field at all, not even
|
|
@@ -2889,8 +2916,36 @@ export class GoTemplateAdapter extends BaseAdapter implements ParsedExprEmitter,
|
|
|
2889
2916
|
if (nested.isDynamic && !nested.isPropDerived) {
|
|
2890
2917
|
// Dynamic signal-array loops are template-only.
|
|
2891
2918
|
lines.push(`\t${nested.name}s []${elemType} \`json:"-"\``)
|
|
2919
|
+
} else if (
|
|
2920
|
+
nested.isDynamic &&
|
|
2921
|
+
nested.isPropDerived &&
|
|
2922
|
+
!propDrivingFieldNames.has(`${nested.name}s`)
|
|
2923
|
+
) {
|
|
2924
|
+
// Prop-derived dynamic loops (`props.items.map(item => <Child/>)`,
|
|
2925
|
+
// #2672): this field is USUALLY a RE-SHAPED COPY of the driving prop,
|
|
2926
|
+
// built for SSR's `{{range}}` — not the prop itself. The client's own
|
|
2927
|
+
// `mapArray` re-derives every row straight from the real prop field
|
|
2928
|
+
// (`_p.items`, emitted with a real tag by the propsParams loop
|
|
2929
|
+
// above), never from `_p.<Name>s`, so co-boarding this copy into
|
|
2930
|
+
// `bf-p` is redundant component-internal derivation, same as a memo.
|
|
2931
|
+
//
|
|
2932
|
+
// EXCEPT when the two Go field names collide (`propDrivingFieldNames`
|
|
2933
|
+
// — mirrors `isNestedArrayShadowed`'s check the propsParams loop
|
|
2934
|
+
// itself runs): a prop named `toggleItems` driving a `<ToggleItem>`
|
|
2935
|
+
// loop capitalizes to the SAME Go field name as the nested-array
|
|
2936
|
+
// field (`ToggleItems`), so `emitPropsDataFields` shadows the prop's
|
|
2937
|
+
// OWN field entirely and this array field is the ONLY carrier of
|
|
2938
|
+
// that prop's data. Flipping it there would silently drop caller
|
|
2939
|
+
// input from `bf-p` instead of merely trimming a redundant copy —
|
|
2940
|
+
// the `else` branch below keeps a real tag for exactly that case.
|
|
2941
|
+
lines.push(`\t${nested.name}s []${elemType} \`json:"-"\``)
|
|
2892
2942
|
} else {
|
|
2893
|
-
// Static
|
|
2943
|
+
// Static arrays go in JSON so the client can hydrate (that data can
|
|
2944
|
+
// be non-literal, request-time Input the caller supplies with no
|
|
2945
|
+
// prop-field twin to fall back on) — and so does a prop-derived
|
|
2946
|
+
// dynamic array whose field name shadows its own driving prop's
|
|
2947
|
+
// field (the `propDrivingFieldNames` case above): this field is
|
|
2948
|
+
// that prop's ONLY remaining carrier in the struct.
|
|
2894
2949
|
const jsonTag = this.claimJsonTag(
|
|
2895
2950
|
this.toJsonTag(`${nested.name.charAt(0).toLowerCase()}${nested.name.slice(1)}s`),
|
|
2896
2951
|
takenJsonTags,
|
|
@@ -2906,9 +2961,11 @@ export class GoTemplateAdapter extends BaseAdapter implements ParsedExprEmitter,
|
|
|
2906
2961
|
|
|
2907
2962
|
// Top-level intrinsic-element spreads: each gets a `Spread_<slotId>
|
|
2908
2963
|
// map[string]any` field the template reads via `{{bf_spread_attrs}}`.
|
|
2909
|
-
// Loop-internal spreads emit inline and don't appear here.
|
|
2964
|
+
// Loop-internal spreads emit inline and don't appear here. SSR-only —
|
|
2965
|
+
// the resolved attrs are already baked into the rendered HTML, and no
|
|
2966
|
+
// client runtime reads `_p.Spread_<slotId>` back out of `bf-p` (#2672).
|
|
2910
2967
|
for (const slot of spreadSlots) {
|
|
2911
|
-
const jsonTag =
|
|
2968
|
+
const jsonTag = '-'
|
|
2912
2969
|
lines.push(`\t${slot.slotId} map[string]any \`json:"${jsonTag}"\``)
|
|
2913
2970
|
}
|
|
2914
2971
|
}
|
|
@@ -3531,7 +3588,7 @@ export class GoTemplateAdapter extends BaseAdapter implements ParsedExprEmitter,
|
|
|
3531
3588
|
|
|
3532
3589
|
const propTypeOverrides = buildPropTypeOverrides(this.emitCtx, ir)
|
|
3533
3590
|
for (const signal of ir.metadata.signals) {
|
|
3534
|
-
const match = this.extractPropFallback(signal.initialValue, signal
|
|
3591
|
+
const match = this.extractPropFallback(signal.initialValue, this.resolvedSignalParsed(signal))
|
|
3535
3592
|
if (!match) continue
|
|
3536
3593
|
if (result.has(match.propName)) continue
|
|
3537
3594
|
const param = ir.metadata.propsParams.find(p => p.name === match.propName)
|
|
@@ -3596,6 +3653,17 @@ export class GoTemplateAdapter extends BaseAdapter implements ParsedExprEmitter,
|
|
|
3596
3653
|
return result
|
|
3597
3654
|
}
|
|
3598
3655
|
|
|
3656
|
+
/**
|
|
3657
|
+
* Resolve a signal's initializer through the SSR seed plan's const-hop
|
|
3658
|
+
* inlining (#2685) before prop-fallback extraction — see
|
|
3659
|
+
* {@link resolveSignalParsedThroughSeedPlan} (shared with
|
|
3660
|
+
* `collectNullishConsumedPropNames`'s signal-seed loop, the single door
|
|
3661
|
+
* both consumers of this resolution go through).
|
|
3662
|
+
*/
|
|
3663
|
+
private resolvedSignalParsed(signal: { getter: string; parsed?: ParsedExpr }): ParsedExpr | undefined {
|
|
3664
|
+
return resolveSignalParsedThroughSeedPlan(this.state, signal)
|
|
3665
|
+
}
|
|
3666
|
+
|
|
3599
3667
|
/**
|
|
3600
3668
|
* Parse a signal-time initial value of the form `props.X ?? <literal>` —
|
|
3601
3669
|
* or, for destructured components, `x ?? <literal>` — into the source prop
|
|
@@ -22,6 +22,7 @@ import type {
|
|
|
22
22
|
IRNode,
|
|
23
23
|
LoweringMatcher,
|
|
24
24
|
MemoInfo,
|
|
25
|
+
ParsedExpr,
|
|
25
26
|
SsrSeedPlan,
|
|
26
27
|
TypeDefinition,
|
|
27
28
|
TypeInfo,
|
|
@@ -262,3 +263,36 @@ export class CompileState {
|
|
|
262
263
|
* `strings` is added to the generated types file's import block. */
|
|
263
264
|
needsStringsImport = false
|
|
264
265
|
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Resolve a signal's initializer through the SSR seed plan's const-hop
|
|
269
|
+
* inlining (#2685, `resolveThroughLocalConsts` in
|
|
270
|
+
* `packages/jsx/src/ssr-seed-plan.ts`) before prop-fallback shape matching,
|
|
271
|
+
* so a component-scope `const` sitting between a `props.X` read and
|
|
272
|
+
* `createSignal` (`const mid = props.label; createSignal(mid ?? 'Default')`)
|
|
273
|
+
* doesn't hide the `props.X ?? <literal>` shape from
|
|
274
|
+
* `extractPropFallbackFromParsed` / `collectNullishConsumedPropNames`'s
|
|
275
|
+
* signal-seed loop — both need the SAME resolved tree (single door, not two
|
|
276
|
+
* divergent walks: a mismatch between them is exactly what let the field-type
|
|
277
|
+
* flip and the fallback-var construction disagree on nullish handling for
|
|
278
|
+
* the const-hop shape).
|
|
279
|
+
*
|
|
280
|
+
* Falls back to the signal's own `parsed` when the plan didn't classify this
|
|
281
|
+
* signal `derived` (opaque for an unrelated reason, e.g. a free identifier
|
|
282
|
+
* genuinely out of scope) — never invents a substitution the plan itself
|
|
283
|
+
* didn't make.
|
|
284
|
+
*
|
|
285
|
+
* `signal` takes the minimal structural shape (not the internal `SignalInfo`
|
|
286
|
+
* type, which `@barefootjs/jsx`'s public index doesn't export — the same
|
|
287
|
+
* inline-shape convention `memo-compute.ts`'s extracted helpers already use
|
|
288
|
+
* for signal params).
|
|
289
|
+
*/
|
|
290
|
+
export function resolveSignalParsedThroughSeedPlan(
|
|
291
|
+
state: CompileState,
|
|
292
|
+
signal: { getter: string; parsed?: ParsedExpr },
|
|
293
|
+
): ParsedExpr | undefined {
|
|
294
|
+
const step = state.ssrSeedPlan.steps.find(
|
|
295
|
+
s => s.kind === 'derived' && s.origin === 'signal' && s.name === signal.getter,
|
|
296
|
+
)
|
|
297
|
+
return step?.kind === 'derived' ? step.parsed : signal.parsed
|
|
298
|
+
}
|
|
@@ -9,6 +9,7 @@ import type { ComponentIR, IRMetadata, IRNode, ParsedExpr } from '@barefootjs/js
|
|
|
9
9
|
import { isBooleanAttr } from '@barefootjs/jsx'
|
|
10
10
|
|
|
11
11
|
import type { GoEmitContext } from '../emit-context.ts'
|
|
12
|
+
import { resolveSignalParsedThroughSeedPlan } from '../lib/compile-state.ts'
|
|
12
13
|
import { typeInfoToGo } from '../type/type-codegen.ts'
|
|
13
14
|
|
|
14
15
|
/**
|
|
@@ -218,7 +219,12 @@ export function collectNullishConsumedPropNames(ctx: GoEmitContext, ir: Componen
|
|
|
218
219
|
// tree — reuse the seam's existing `props.X ?? <literal>` recognizer. The
|
|
219
220
|
// zero-equivalent exclusion matches on the Go-formatted fallback literal.
|
|
220
221
|
for (const signal of ir.metadata.signals) {
|
|
221
|
-
const
|
|
222
|
+
// Resolved through the seed plan's const-hop inlining (#2685) — see
|
|
223
|
+
// `resolveSignalParsedThroughSeedPlan` — so a component-scope `const`
|
|
224
|
+
// between `props.X` and `createSignal` doesn't leave this loop and
|
|
225
|
+
// `collectPropFallbackVars`'s identical extraction disagreeing on
|
|
226
|
+
// whether the prop needs the nillable flip.
|
|
227
|
+
const match = ctx.extractPropFallback(signal.initialValue, resolveSignalParsedThroughSeedPlan(ctx.state, signal))
|
|
222
228
|
if (!match || !optionalParams.has(match.propName)) continue
|
|
223
229
|
const f = match.goFallback
|
|
224
230
|
if (f === '""' || f === 'false' || f === 'nil' || Number(f) === 0) continue
|
|
@@ -6,15 +6,39 @@
|
|
|
6
6
|
* file even when the set is empty — the next divergence lands here, not in
|
|
7
7
|
* a re-created file.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* (#2630's `static-array-from-props-with-component-precomputed` divergence
|
|
10
|
+
* graduated once the harness (`test-render.ts`'s
|
|
11
11
|
* `buildDynamicChildLoopSeeding`, despite the name — see its doc comment)
|
|
12
12
|
* learned to seed a prop-backed static child-component loop's Props slice
|
|
13
13
|
* the same way it already seeded a signal-backed dynamic one: the adapter's
|
|
14
14
|
* own `emission` was never the bug, only this harness's route-handler
|
|
15
|
-
* stand-in was missing the prop-derived case.
|
|
15
|
+
* stand-in was missing the prop-derived case.)
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import type { RenderDivergences } from '@barefootjs/jsx'
|
|
19
19
|
|
|
20
|
-
export const renderDivergences: RenderDivergences = {
|
|
20
|
+
export const renderDivergences: RenderDivergences = {
|
|
21
|
+
// #2683: the props-struct emitter (`go-template-adapter.ts`) skips a
|
|
22
|
+
// signal whose Go field name collides with a prop field, keyed purely on
|
|
23
|
+
// the NAME collision — never on whether `extractPropFallback` actually
|
|
24
|
+
// matched a supported `props.x ?? <default>` shape. For a non-idempotent
|
|
25
|
+
// derivation (`createSignal((props.count ?? 1) * 2)`) the fallback
|
|
26
|
+
// extractor correctly declines to fold `* 2` into the struct default, but
|
|
27
|
+
// the `continue` fires anyway on the name match alone, so the emitted
|
|
28
|
+
// struct field silently drops the `* 2` and the signal's initial value
|
|
29
|
+
// renders as the raw prop instead of its derived value. Not a one-liner:
|
|
30
|
+
// two Go struct fields can't share an identifier, so simply removing the
|
|
31
|
+
// skip emits a duplicate field — the real fix needs its own PR.
|
|
32
|
+
'signal-prop-same-name-derived':
|
|
33
|
+
'self-derived signal collides with its prop field name in the generated Go props struct — the non-idempotent `* 2` derivation is dropped and the signal renders the raw prop value instead (https://github.com/piconic-ai/barefootjs/issues/2683)',
|
|
34
|
+
// #2685 review: same #2683 bug, one hop of const indirection removed —
|
|
35
|
+
// the props-struct field-name collision is keyed on the SIGNAL's name,
|
|
36
|
+
// not on how its initializer reaches the prop, so
|
|
37
|
+
// `const mid = props.count; createSignal((mid ?? 1) * 2)` collides
|
|
38
|
+
// exactly like the direct-access form above. This is go's PRE-EXISTING
|
|
39
|
+
// #2683 defect surfacing through a new fixture, not a regression from
|
|
40
|
+
// the #2685 review fix (which lands correctly on every other
|
|
41
|
+
// template-stash adapter — see those adapters' conformance runs).
|
|
42
|
+
'signal-prop-same-name-via-const-derived':
|
|
43
|
+
'self-derived signal (reached through a component-scope const) collides with its prop field name in the generated Go props struct — the non-idempotent `* 2` derivation is dropped and the signal renders the raw prop value instead (https://github.com/piconic-ai/barefootjs/issues/2683)',
|
|
44
|
+
}
|
package/src/test-render.ts
CHANGED
|
@@ -914,11 +914,28 @@ function goSliceElemType(
|
|
|
914
914
|
* `[]any{…}`/`map[string]interface{}{…}` for that field no longer compiles
|
|
915
915
|
* against it the way it always did against the old `map[string]interface{}`
|
|
916
916
|
* element type.
|
|
917
|
+
*
|
|
918
|
+
* An ARRAY element (`elemType` itself starting with `[]`, i.e. the field is
|
|
919
|
+
* doubly-nested — `Rows [][]int`) recurses with the INNER element type
|
|
920
|
+
* (`int`) instead of falling to `goArrayLiteralFromArray`'s generic
|
|
921
|
+
* `[]any{…}` — #2677 widened the analyzer's destructured-parameter gate to
|
|
922
|
+
* resolve a nested-array prop (`{ rows }: { rows: number[][] }`) to a real
|
|
923
|
+
* `[][]int` field (previously `unknown` → `interface{}` → `[]any`, which
|
|
924
|
+
* `goArrayLiteralFromArray`'s untyped literal always compiled against fine).
|
|
925
|
+
* Without this, the harness's OWN convenience literal-builder — not the
|
|
926
|
+
* production adapter's `typeInfoToGo`, which already recurses correctly —
|
|
927
|
+
* bakes `[]any{1, 2}` for a `[1, 2]` row, and `[][]int{[]any{1, 2}, …}`
|
|
928
|
+
* fails to compile against the now-concrete field.
|
|
917
929
|
*/
|
|
918
930
|
function goTypedSliceLiteralFromArray(arr: unknown[], elemType: string, goTypes?: string): string {
|
|
919
931
|
const entries = arr.map(v => {
|
|
920
932
|
if (v instanceof Date) return goStringLit(v.toISOString())
|
|
921
|
-
if (
|
|
933
|
+
if (Array.isArray(v)) {
|
|
934
|
+
return elemType.startsWith('[]')
|
|
935
|
+
? goTypedSliceLiteralFromArray(v, elemType.slice(2), goTypes)
|
|
936
|
+
: goArrayLiteralFromArray(v)
|
|
937
|
+
}
|
|
938
|
+
if (v && typeof v === 'object') {
|
|
922
939
|
return goStructLiteral(v as Record<string, unknown>, elemType, goTypes)
|
|
923
940
|
}
|
|
924
941
|
if (typeof v === 'string') return `"${v.replace(/"/g, '\\"')}"`
|