@barefootjs/go-template 0.31.5 → 0.31.7
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 +57 -0
- package/dist/adapter/go-template-adapter.d.ts.map +1 -1
- package/dist/adapter/index.js +17 -7
- package/dist/adapter/lib/types.d.ts +15 -0
- package/dist/adapter/lib/types.d.ts.map +1 -1
- package/dist/conformance-pins.d.ts +6 -7
- package/dist/conformance-pins.d.ts.map +1 -1
- package/dist/index.js +33 -14
- package/dist/render-divergences.d.ts +6 -19
- package/dist/render-divergences.d.ts.map +1 -1
- package/dist/vite.js +21 -7
- package/package.json +5 -5
- package/src/adapter/analysis/component-tree.ts +1 -0
- package/src/adapter/go-template-adapter.ts +90 -13
- package/src/adapter/lib/types.ts +15 -0
- package/src/conformance-pins.ts +28 -162
- package/src/render-divergences.ts +11 -31
|
@@ -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,UAAU,EACV,MAAM,EAKN,aAAa,EAEb,UAAU,EACV,qBAAqB,EAGrB,SAAS,EACT,YAAY,EACZ,aAAa,EACb,UAAU,EACV,OAAO,EAEP,yBAAyB,EAG1B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAE3B,KAAK,iBAAiB,EAEtB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB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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"}
|
|
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,UAAU,EACV,MAAM,EAKN,aAAa,EAEb,UAAU,EACV,qBAAqB,EAGrB,SAAS,EACT,YAAY,EACZ,aAAa,EACb,UAAU,EACV,OAAO,EAEP,yBAAyB,EAG1B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAE3B,KAAK,iBAAiB,EAEtB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,UAAU,EAgChB,MAAM,iBAAiB,CAAA;AA8BxB,OAAO,KAAK,EACV,WAAW,EAOX,wBA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AAE,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"}
|
package/dist/adapter/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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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,YA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6DAA6D;IAC7D,WAAW,EAAE,MAAM,CAAA;IACnB;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,2EAA2E;IAC3E,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC7B,yEAAyE;IACzE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC3B,yEAAyE;IACzE,MAAM,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CACrB;AAED,MAAM,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,11 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Per-fixture build-time contracts for shapes
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* attribution).
|
|
2
|
+
* Per-fixture build-time contracts for shapes this adapter intentionally
|
|
3
|
+
* refuses to lower. Declared per adapter, not on the shared fixtures, so
|
|
4
|
+
* adding a new adapter never touches a cross-adapter file. Per-fixture
|
|
5
|
+
* rationale lives on each fixture's docstring
|
|
6
|
+
* (`packages/adapter-tests/fixtures/<id>.ts`) and spec/callback-fidelity.md;
|
|
7
|
+
* comments below only mark where this adapter's set diverges from siblings.
|
|
9
8
|
*/
|
|
10
9
|
import type { ConformancePins } from '@barefootjs/jsx';
|
|
11
10
|
export declare const conformancePins: ConformancePins;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conformance-pins.d.ts","sourceRoot":"","sources":["../src/conformance-pins.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"conformance-pins.d.ts","sourceRoot":"","sources":["../src/conformance-pins.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD,eAAO,MAAM,eAAe,EAAE,eA2C7B,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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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,30 @@ 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
|
-
{
|
|
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
|
-
{
|
|
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
|
-
|
|
6657
|
-
]
|
|
6658
|
-
"date-method-uncatalogued": [{ code: "BF021", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2356" }]
|
|
6673
|
+
"filter-nested-find-predicate": [{ code: "BF101", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2320" }],
|
|
6674
|
+
"date-method-uncatalogued": [{ code: "BF021", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2356" }],
|
|
6675
|
+
"rich-prop-client-read": [{ code: "BF049", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2648" }]
|
|
6659
6676
|
};
|
|
6660
6677
|
// src/render-divergences.ts
|
|
6661
|
-
var renderDivergences = {
|
|
6678
|
+
var renderDivergences = {
|
|
6679
|
+
"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)"
|
|
6680
|
+
};
|
|
6662
6681
|
export {
|
|
6663
6682
|
renderDivergences,
|
|
6664
6683
|
goTemplateAdapter,
|
|
@@ -1,23 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* Consumed by this package's conformance test (its `skipJsx` set is
|
|
10
|
-
* derived from these keys, so the skip list and this declaration can't
|
|
11
|
-
* drift) and by `packages/compat`, which publishes the entries in the
|
|
12
|
-
* fixture-divergences section of `ui/compat.lock.json` — surfaced on
|
|
13
|
-
* the docs compatibility-matrix page. Graduating an entry means fixing
|
|
14
|
-
* the adapter (or the shared compiler layer) and deleting the line.
|
|
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.
|
|
19
|
-
* Keep the file (and this header) when the set is empty — the next
|
|
20
|
-
* divergence lands here, not in a re-created file.
|
|
2
|
+
* Fixtures that compile clean on this adapter but render divergent from the
|
|
3
|
+
* Hono reference on real Go. The conformance `skipJsx` set and
|
|
4
|
+
* `packages/compat`'s published fixture-divergences both derive from this
|
|
5
|
+
* one object, so the skip list and the declaration can't drift. Keep the
|
|
6
|
+
* file even when the set is empty — the next divergence lands here, not in
|
|
7
|
+
* a re-created file.
|
|
21
8
|
*/
|
|
22
9
|
import type { RenderDivergences } from '@barefootjs/jsx';
|
|
23
10
|
export declare const renderDivergences: RenderDivergences;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-divergences.d.ts","sourceRoot":"","sources":["../src/render-divergences.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"render-divergences.d.ts","sourceRoot":"","sources":["../src/render-divergences.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAExD,eAAO,MAAM,iBAAiB,EAAE,iBAM/B,CAAA"}
|
package/dist/vite.js
CHANGED
|
@@ -2328,6 +2328,7 @@ var ErrorCodes = {
|
|
|
2328
2328
|
COMPONENT_REQUIRED_PROP_MISSING: "BF046",
|
|
2329
2329
|
JSX_BRANCH_LOCAL_IN_CALLBACK: "BF047",
|
|
2330
2330
|
SIBLING_COMPONENT_NOT_COMPILED: "BF048",
|
|
2331
|
+
RICH_TYPE_PROP_NOT_HYDRATABLE: "BF049",
|
|
2331
2332
|
SHARED_PROGRAM_REQUIRED: "BF050",
|
|
2332
2333
|
WRONG_PACKAGE_IMPORT: "BF051",
|
|
2333
2334
|
BUILTIN_REQUIRES_IMPORT: "BF054",
|
|
@@ -2358,6 +2359,7 @@ var errorMessages = {
|
|
|
2358
2359
|
[ErrorCodes.COMPONENT_REQUIRED_PROP_MISSING]: "Built-in component is missing a required prop.",
|
|
2359
2360
|
[ErrorCodes.JSX_BRANCH_LOCAL_IN_CALLBACK]: "JSX-typed local declared inside an `if`-block cannot be referenced from a callback body (ref / event handler). " + "Render it as a child instead: `<div ref={...}>{local}</div>`.",
|
|
2360
2361
|
[ErrorCodes.SIBLING_COMPONENT_NOT_COMPILED]: "Referenced component did not compile to a template, so this reference would throw " + "`ReferenceError` at render time. Multi-return JSX dispatch (a `switch` or `if`/`else` " + "chain across multiple JSX-returning branches) cannot compile as a component in a " + `'use client' file. Extract it to a separate non-"use client" file (where it is preserved ` + "verbatim, see #932), or rewrite it as a single-return ternary/conditional chain so the " + "component pipeline can compile it.",
|
|
2362
|
+
[ErrorCodes.RICH_TYPE_PROP_NOT_HYDRATABLE]: "Rich-typed prop cannot cross the bf-p hydration boundary as JSON.",
|
|
2361
2363
|
[ErrorCodes.SHARED_PROGRAM_REQUIRED]: "Shared ts.Program required for type-based reactivity classification. This source imports a Reactive<T>-branded library (e.g. @barefootjs/form) whose getters cannot be classified by regex alone. Pass `options.program` (built via `createProgramForCorpus`) so the analyzer can resolve the brand through the TypeChecker.",
|
|
2362
2364
|
[ErrorCodes.WRONG_PACKAGE_IMPORT]: "Import from wrong package.",
|
|
2363
2365
|
[ErrorCodes.BUILTIN_REQUIRES_IMPORT]: "Built-in <Async> / <Region> must be imported from '@barefootjs/client'. " + "The compiler recognises these tags by their import (not by tag name), " + "so an unimported tag with this name is treated as an undeclared component.",
|
|
@@ -2391,6 +2393,8 @@ var HOST_RICH_TYPE_NAMES = new Set([
|
|
|
2391
2393
|
"BigInt",
|
|
2392
2394
|
"Function"
|
|
2393
2395
|
]);
|
|
2396
|
+
var JSON_REVIVABLE_RICH_TYPE_NAMES = new Set(["Date", "URL"]);
|
|
2397
|
+
var JSON_UNSAFE_RICH_TYPE_NAMES = new Set([...HOST_RICH_TYPE_NAMES].filter((n) => !JSON_REVIVABLE_RICH_TYPE_NAMES.has(n)));
|
|
2394
2398
|
function baseTypeName(raw) {
|
|
2395
2399
|
const idx = raw.indexOf("<");
|
|
2396
2400
|
return (idx === -1 ? raw : raw.slice(0, idx)).trim();
|
|
@@ -5529,6 +5533,7 @@ function collectNestedComponents(node, result) {
|
|
|
5529
5533
|
...loop.childComponent,
|
|
5530
5534
|
isDynamic: !loop.isStaticArray,
|
|
5531
5535
|
isPropDerived: !!loop.isPropDerivedArray,
|
|
5536
|
+
clientOnly: loop.clientOnly,
|
|
5532
5537
|
loopKey: loop.key ?? undefined,
|
|
5533
5538
|
loopParam: loop.param ?? undefined,
|
|
5534
5539
|
bodyChildren: hasBodyChildren ? loop.childComponent.children : undefined,
|
|
@@ -8190,6 +8195,12 @@ ${scriptRegistrations}${templateBody}
|
|
|
8190
8195
|
isNestedArrayShadowed(param, nestedArrayFields) {
|
|
8191
8196
|
return nestedArrayFields.has(capitalizeFieldName(param.name)) || nestedArrayFields.has(capitalizeFieldName(param.sourceName ?? param.name));
|
|
8192
8197
|
}
|
|
8198
|
+
isOrphanedClientOnlyNested(nested) {
|
|
8199
|
+
return !!nested.clientOnly && !nested.isDynamic && !nested.isPropDerived;
|
|
8200
|
+
}
|
|
8201
|
+
propDerivedNestedArrayFields(nestedComponents) {
|
|
8202
|
+
return new Set(nestedComponents.filter((n) => n.isPropDerived).map((n) => `${n.name}s`));
|
|
8203
|
+
}
|
|
8193
8204
|
propParamFieldNamesUnion(params) {
|
|
8194
8205
|
return params.flatMap((p) => [capitalizeFieldName(p.name), capitalizeFieldName(p.sourceName ?? p.name)]);
|
|
8195
8206
|
}
|
|
@@ -8228,7 +8239,7 @@ ${scriptRegistrations}${templateBody}
|
|
|
8228
8239
|
recordRepropsSpec(ir, componentName, nestedComponents, spreadSlots) {
|
|
8229
8240
|
if (!this.childDerivedFieldDeps.has(componentName))
|
|
8230
8241
|
return;
|
|
8231
|
-
const nestedArrayFields =
|
|
8242
|
+
const nestedArrayFields = this.propDerivedNestedArrayFields(nestedComponents);
|
|
8232
8243
|
const params = (ir.metadata.propsParams ?? []).filter((p) => !this.isNestedArrayShadowed(p, nestedArrayFields));
|
|
8233
8244
|
const takenInput = new Set(this.propParamFieldNamesUnion(ir.metadata.propsParams ?? []));
|
|
8234
8245
|
const eligible = nestedComponents.every((n) => n.isDynamic && !n.isPropDerived) && spreadSlots.length === 0 && !ir.metadata.restPropsName && this.nonCollidingContextConsumers(takenInput).length === 0;
|
|
@@ -8442,8 +8453,8 @@ ${goFields.join(`
|
|
|
8442
8453
|
if (this.usesSearchParams(ir)) {
|
|
8443
8454
|
lines.push("\tSearchParams bf.SearchParams // Optional: request query for searchParams()");
|
|
8444
8455
|
}
|
|
8445
|
-
const inputNested = nestedComponents.filter((n) => !n.isDynamic || n.isPropDerived);
|
|
8446
|
-
const nestedArrayFields =
|
|
8456
|
+
const inputNested = nestedComponents.filter((n) => (!n.isDynamic || n.isPropDerived) && !this.isOrphanedClientOnlyNested(n));
|
|
8457
|
+
const nestedArrayFields = this.propDerivedNestedArrayFields(nestedComponents);
|
|
8447
8458
|
for (const param of ir.metadata.propsParams) {
|
|
8448
8459
|
const fieldName = capitalizeFieldName(param.sourceName ?? param.name);
|
|
8449
8460
|
if (this.isNestedArrayShadowed(param, nestedArrayFields))
|
|
@@ -8580,7 +8591,7 @@ ${goFields.join(`
|
|
|
8580
8591
|
lines.push(` scopeID = "${componentName}_" + randomID(6)`);
|
|
8581
8592
|
lines.push("\t}");
|
|
8582
8593
|
lines.push("");
|
|
8583
|
-
const staticNested = nestedComponents.filter((n) => !n.isDynamic || n.isPropDerived);
|
|
8594
|
+
const staticNested = nestedComponents.filter((n) => (!n.isDynamic || n.isPropDerived) && !this.isOrphanedClientOnlyNested(n));
|
|
8584
8595
|
const emittedWrapperVars = new Set;
|
|
8585
8596
|
const staticWithBody = staticNested.filter((n) => n.bodyChildren && n.bodyChildren.length > 0);
|
|
8586
8597
|
const staticWithoutBody = staticNested.filter((n) => !n.bodyChildren || n.bodyChildren.length === 0);
|
|
@@ -8662,7 +8673,7 @@ ${goFields.join(`
|
|
|
8662
8673
|
if (this.usesSearchParams(ir)) {
|
|
8663
8674
|
lines.push("\t\tSearchParams: in.SearchParams,");
|
|
8664
8675
|
}
|
|
8665
|
-
const nestedArrayFields =
|
|
8676
|
+
const nestedArrayFields = this.propDerivedNestedArrayFields(nestedComponents);
|
|
8666
8677
|
const memoFallbacks = new Map;
|
|
8667
8678
|
for (const memo of ir.metadata.memos) {
|
|
8668
8679
|
const stripped = memo.computation.replace(/^\(\)\s*=>\s*/, "");
|
|
@@ -9160,7 +9171,7 @@ ${goFields.join(`
|
|
|
9160
9171
|
}
|
|
9161
9172
|
}
|
|
9162
9173
|
emitPropsDataFields(lines, ir, nestedComponents, propTypeOverrides, takenJsonTags) {
|
|
9163
|
-
const nestedArrayFields =
|
|
9174
|
+
const nestedArrayFields = this.propDerivedNestedArrayFields(nestedComponents);
|
|
9164
9175
|
const propFieldNames = new Set;
|
|
9165
9176
|
for (const param of ir.metadata.propsParams) {
|
|
9166
9177
|
const fieldName = capitalizeFieldName(param.name);
|
|
@@ -9234,6 +9245,8 @@ ${goFields.join(`
|
|
|
9234
9245
|
lines.push(` ${this.contextFieldName(c)} ${this.contextConsumerGoType(c)} \`json:"${jsonTag}"\``);
|
|
9235
9246
|
}
|
|
9236
9247
|
for (const nested of nestedComponents) {
|
|
9248
|
+
if (this.isOrphanedClientOnlyNested(nested))
|
|
9249
|
+
continue;
|
|
9237
9250
|
const elemType = nested.bodyChildren?.length ? this.loopBodyWrapperName(componentName, nested) : `${nested.name}Props`;
|
|
9238
9251
|
if (nested.isDynamic && !nested.isPropDerived) {
|
|
9239
9252
|
lines.push(` ${nested.name}s []${elemType} \`json:"-"\``);
|
|
@@ -11236,7 +11249,8 @@ ${goFields.join(`
|
|
|
11236
11249
|
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
11250
|
loc: loop.loc ?? this.makeLoc(),
|
|
11238
11251
|
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."
|
|
11252
|
+
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.",
|
|
11253
|
+
escape: [{ kind: "prop-precompute" }, { kind: "client-directive" }]
|
|
11240
11254
|
}
|
|
11241
11255
|
});
|
|
11242
11256
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barefootjs/go-template",
|
|
3
|
-
"version": "0.31.
|
|
3
|
+
"version": "0.31.7",
|
|
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.7"
|
|
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.7",
|
|
71
|
+
"@barefootjs/jsx": "0.31.7",
|
|
72
|
+
"@barefootjs/vite": "0.31.7",
|
|
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
|
-
|
|
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
|
-
|
|
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 =
|
|
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
|
-
|
|
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 =
|
|
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
|
-
|
|
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
|
}
|
package/src/adapter/lib/types.ts
CHANGED
|
@@ -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
|
package/src/conformance-pins.ts
CHANGED
|
@@ -1,189 +1,55 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Per-fixture build-time contracts for shapes
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* attribution).
|
|
2
|
+
* Per-fixture build-time contracts for shapes this adapter intentionally
|
|
3
|
+
* refuses to lower. Declared per adapter, not on the shared fixtures, so
|
|
4
|
+
* adding a new adapter never touches a cross-adapter file. Per-fixture
|
|
5
|
+
* rationale lives on each fixture's docstring
|
|
6
|
+
* (`packages/adapter-tests/fixtures/<id>.ts`) and spec/callback-fidelity.md;
|
|
7
|
+
* comments below only mark where this adapter's set diverges from siblings.
|
|
9
8
|
*/
|
|
10
9
|
|
|
11
10
|
import type { ConformancePins } from '@barefootjs/jsx'
|
|
12
11
|
|
|
13
12
|
export const conformancePins: ConformancePins = {
|
|
14
|
-
// Off-subset filter predicate (`typeof`) the compiler can't lower; a
|
|
15
|
-
// JS-runtime target runs it, a DSL adapter surfaces BF021 + `/* @client */`.
|
|
16
|
-
// See spec/callback-fidelity.md.
|
|
17
13
|
'filter-typeof-predicate': [{ code: 'BF021', severity: 'error' }],
|
|
18
14
|
'map-array-builder-body': [{ code: 'BF021', severity: 'error' }],
|
|
19
15
|
'map-array-builder-escaping': [{ code: 'BF021', severity: 'error' }],
|
|
20
|
-
// `.fill(value)` mutates the receiver in place — no template lowering
|
|
21
|
-
// on any DSL adapter; a JS-runtime target runs it, a DSL adapter
|
|
22
|
-
// surfaces BF101 + `/* @client */`. See spec/callback-fidelity.md.
|
|
23
16
|
'fill-unsupported': [{ code: 'BF101', severity: 'error' }],
|
|
24
|
-
// Off-subset `.find()` / `.some()` / `.every()` predicate (`typeof`) the
|
|
25
|
-
// compiler can't lower; a JS-runtime target runs it, a DSL adapter
|
|
26
|
-
// surfaces BF101 + `/* @client */`. See spec/callback-fidelity.md.
|
|
27
17
|
'find-typeof-predicate': [{ code: 'BF101', severity: 'error' }],
|
|
28
18
|
'some-typeof-predicate': [{ code: 'BF101', severity: 'error' }],
|
|
29
19
|
'every-typeof-predicate': [{ code: 'BF101', severity: 'error' }],
|
|
30
|
-
// Off-subset `.reduce()` / `.reduceRight()` body / `.flatMap()`
|
|
31
|
-
// projection (`typeof`) the compiler can't lower; a JS-runtime target
|
|
32
|
-
// runs it, a DSL adapter surfaces BF101 + `/* @client */`.
|
|
33
|
-
// See spec/callback-fidelity.md.
|
|
34
20
|
'reduce-typeof-body': [{ code: 'BF101', severity: 'error' }],
|
|
35
21
|
'reduce-right-typeof-body': [{ code: 'BF101', severity: 'error' }],
|
|
36
22
|
'flatmap-typeof-projection': [{ code: 'BF101', severity: 'error' }],
|
|
37
|
-
//
|
|
38
|
-
//
|
|
39
|
-
//
|
|
40
|
-
// `/* @client */` (pre-gate this emitted an empty loop body — silent
|
|
41
|
-
// divergence). A pure PROJECTION body (`flatMap(it => it.tags.map(...))`,
|
|
42
|
-
// e.g. the `flatmap-expression-body` fixture) is NOT pinned: it lowers to
|
|
43
|
-
// neutral nested-loop IR this adapter templatizes natively.
|
|
44
|
-
// See spec/callback-fidelity.md.
|
|
23
|
+
// A pure PROJECTION flatMap body (`flatmap-expression-body`) is NOT pinned —
|
|
24
|
+
// it lowers to neutral nested-loop IR this adapter templatizes natively;
|
|
25
|
+
// only the statement-carrying body refuses.
|
|
45
26
|
'tag-cloud': [{ code: 'BF021', severity: 'error' }],
|
|
46
|
-
// A keyed `.map()` row body whose preamble builds a JSX leaf from item
|
|
47
|
-
// state (`cells.push(<td>{stateLabel}</td>)`) embedded as `{cells}` — the
|
|
48
|
-
// Stage 3 array-builder carrier, jsRuntime-only: a JS runtime runs it
|
|
49
|
-
// verbatim (and patches the region on same-key updates, #2389), a DSL
|
|
50
|
-
// adapter refuses with BF021 + `/* @client */`. See spec/callback-fidelity.md.
|
|
51
27
|
'preamble-cells': [{ code: 'BF021', severity: 'error' }],
|
|
52
|
-
//
|
|
53
|
-
// `
|
|
54
|
-
//
|
|
55
|
-
// `tryLowerStyleObject` (#1322).
|
|
56
|
-
// `todo-app` / `todo-app-ssr` no longer pinned (#2205) — the conformance
|
|
57
|
-
// harness now passes `siblingTemplatesRegistered: true` for fixtures with
|
|
58
|
-
// sibling `components`, matching `bf build`'s real semantics, so the
|
|
59
|
-
// BF103 loop-body cross-template check no longer fires spuriously.
|
|
60
|
-
// (`todo-app-ssr` is still skipped on this adapter via
|
|
61
|
-
// `render-divergences.ts` — #2209 — for an unrelated signal-seeding gap;
|
|
62
|
-
// `todo-app`'s pre-hydration empty render is unaffected.)
|
|
63
|
-
// `static-array-children` no longer pinned (#2208) — `items`'s
|
|
64
|
-
// array-literal initializer is now recognized as fully-static and its
|
|
65
|
-
// per-item ListItem props/data-key are baked directly into
|
|
66
|
-
// `NewStaticListProps`'s constructor (`analyzeBakeableStaticChildLoop`),
|
|
67
|
-
// since the loop body is a single child component with a plain-value
|
|
68
|
-
// prop set. See #2224 for the narrower remaining gap (a plain-ELEMENT
|
|
69
|
-
// loop body over a static array, or an inline/unnamed array literal —
|
|
70
|
-
// still refused).
|
|
71
|
-
// `([emoji, users]) => ...` is an array-index tuple destructure — #2087
|
|
72
|
-
// Phase B's widened gate now admits this shape (`destructure-array-index-in-map`
|
|
73
|
-
// exercises the same `segments`-based lowering). The remaining refusal here
|
|
74
|
-
// is orthogonal: `entries` is a function-scope local const with a computed
|
|
75
|
-
// initializer (`Object.entries(props.reactions ?? {}).filter(...)`) that
|
|
76
|
-
// the Go adapter has no binding for (only a STRING-derived local resolves
|
|
77
|
-
// to a generated struct field, via `computeDerivedConstFields`/`isStringExpr`)
|
|
78
|
-
// — left unchecked this would silently execute-time-fail instead of
|
|
79
|
-
// building loud, so `renderLoop` raises BF101 for a bare-identifier loop
|
|
80
|
-
// array bound to such a const. See the `renderLoop` comment at the check
|
|
81
|
-
// site; Jinja / ERB apply the same narrow check for the same reason.
|
|
28
|
+
// Refused for the COMPUTED loop array (`const entries = Object.entries(...)
|
|
29
|
+
// .filter(...)`), not the destructure param (that lowers, #2087) — loud
|
|
30
|
+
// BF101 instead of silently iterating an unbound name zero times.
|
|
82
31
|
'static-array-from-props': [
|
|
83
|
-
{
|
|
32
|
+
{
|
|
33
|
+
code: 'BF101',
|
|
34
|
+
severity: 'error',
|
|
35
|
+
issue: 'https://github.com/piconic-ai/barefootjs/issues/2321',
|
|
36
|
+
},
|
|
84
37
|
],
|
|
85
|
-
//
|
|
86
|
-
// longer contributes a diagnostic, and BF103 (sibling-imported child
|
|
87
|
-
// component in the loop body) no longer fires either now that the
|
|
88
|
-
// conformance harness passes `siblingTemplatesRegistered: true` (#2205).
|
|
38
|
+
// No BF103 pin: the harness registers sibling templates (#2205).
|
|
89
39
|
'static-array-from-props-with-component': [
|
|
90
|
-
{
|
|
40
|
+
{
|
|
41
|
+
code: 'BF101',
|
|
42
|
+
severity: 'error',
|
|
43
|
+
issue: 'https://github.com/piconic-ai/barefootjs/issues/2321',
|
|
44
|
+
},
|
|
91
45
|
],
|
|
92
|
-
//
|
|
93
|
-
//
|
|
94
|
-
//
|
|
95
|
-
// through the interleave-tag catalogue and desugars to an untagged
|
|
96
|
-
// template literal, so it lowers like any other className template.)
|
|
97
|
-
// #2038: a filter predicate whose body contains a NESTED callback call
|
|
98
|
-
// (`t => !picked().some(p => …)` / `t => picked().find(p => …)`). The
|
|
99
|
-
// evaluator refuses nested arrows and `renderFilterExpr` has no faithful
|
|
100
|
-
// Go form for the inner call (its `call` arm used to silently drop the
|
|
101
|
-
// arrow argument and render only the callee) — the compiler is loud
|
|
102
|
-
// instead of lossy. The `/* @client */` twin
|
|
103
|
-
// (`filter-nested-callback-predicate-client`) has no pin here: it must
|
|
104
|
-
// render clean on every adapter, which asserts the suppression contract.
|
|
105
|
-
// Faithful lowering tracked: https://github.com/piconic-ai/barefootjs/issues/2320 (successor to #2038)
|
|
46
|
+
// #2038: `renderFilterExpr`'s `call` arm has no faithful Go form for a
|
|
47
|
+
// nested arrow — loud BF101 instead of the old silent drop of the arrow
|
|
48
|
+
// argument.
|
|
106
49
|
'filter-nested-callback-predicate': [
|
|
107
50
|
{ code: 'BF101', severity: 'error', issue: 'https://github.com/piconic-ai/barefootjs/issues/2320' },
|
|
108
51
|
],
|
|
109
|
-
'filter-nested-find-predicate': [
|
|
110
|
-
{ code: 'BF101', severity: 'error', issue: 'https://github.com/piconic-ai/barefootjs/issues/2320' },
|
|
111
|
-
],
|
|
112
|
-
// #1310 / #2087: rest destructure in .map() callback. `isLowerableLoopDestructure`
|
|
113
|
-
// now admits every shape this fixture family exercises — each fixed/rest
|
|
114
|
-
// binding resolves via `buildSegmentAccessor`/`buildDestructureBindingMap`
|
|
115
|
-
// against a synthetic `$__bf_item0` range var (the reserved `__bf_item`
|
|
116
|
-
// name, depth-suffixed): a plain field → `$__bf_item0.Id`, an array-index
|
|
117
|
-
// step → `(index $__bf_item0 0)`, an array-rest → `(bf_slice $__bf_item0
|
|
118
|
-
// 1)` (composes under `.length` via `member()`'s generic `len <obj>` arm),
|
|
119
|
-
// and an object-rest member read (`rest.flag`) → `$__bf_item0.Flag`. A
|
|
120
|
-
// `{...rest}` SPREAD (`rest-destructure-object-spread-in-map`) routes
|
|
121
|
-
// through the new `bf_omit` runtime helper instead, so the residual omits
|
|
122
|
-
// exactly the sibling keys the pattern destructured out. No fixture in
|
|
123
|
-
// this family is pinned anymore — all six render to real Go / byte-exact
|
|
124
|
-
// HTML (`rest-destructure-object-in-map`, `rest-destructure-object-spread-in-map`,
|
|
125
|
-
// `rest-destructure-array-in-map`, `rest-destructure-nested-in-map`,
|
|
126
|
-
// `destructure-array-index-in-map`, `destructure-nested-object-in-map`).
|
|
127
|
-
// #1443: `[a, b].filter(Boolean).join(' ')` (registry Slot) now
|
|
128
|
-
// lowers to `bf_join (bf_filter_truthy (bf_arr ...)) " "`. No
|
|
129
|
-
// BF101 expected — pinned positively by the
|
|
130
|
-
// `branch-local-filter-join-go` template-output test below.
|
|
131
|
-
//
|
|
132
|
-
// #1448 Tier A — JS Array / String methods that the Go template
|
|
133
|
-
// adapter hasn't lowered yet. Each row drops once the
|
|
134
|
-
// corresponding method PR lands. Hono / CSR pass these out of
|
|
135
|
-
// the box (they evaluate JS at runtime) so the pin only applies
|
|
136
|
-
// here.
|
|
137
|
-
//
|
|
138
|
-
// `array-includes` / `string-includes` no longer pinned — both
|
|
139
|
-
// shapes lower via the shared `array-method` IR + the polymorphic
|
|
140
|
-
// `bf_includes` runtime helper that dispatches on
|
|
141
|
-
// `reflect.Kind()` (slice/array → element search, string →
|
|
142
|
-
// substring search). The condition-position lowering picks up
|
|
143
|
-
// the same emit through the `array-method` arm of
|
|
144
|
-
// `renderConditionExpr` (#1448 Tier A first PR).
|
|
145
|
-
//
|
|
146
|
-
// Remaining fixtures land at expression position and surface BF101
|
|
147
|
-
// via `convertExpressionToGo`. Distinct codes for the two paths is
|
|
148
|
-
// pre-existing adapter behaviour, not something this catalog
|
|
149
|
-
// should paper over — pinned literally here.
|
|
150
|
-
// `array-indexOf` / `array-lastIndexOf` no longer pinned —
|
|
151
|
-
// value-equality `bf_index_of` / `bf_last_index_of` Go runtime
|
|
152
|
-
// helpers handle the shape (#1448 Tier A second PR).
|
|
153
|
-
// `array-at` no longer pinned — the pre-existing `bf_at` runtime
|
|
154
|
-
// helper now lowers `.at(i)` (#1448 Tier A third PR).
|
|
155
|
-
// `array-concat` no longer pinned — the new `bf_concat` runtime
|
|
156
|
-
// helper merges two arrays into a single `[]any` (#1448 Tier A
|
|
157
|
-
// fourth PR).
|
|
158
|
-
// `array-slice` no longer pinned — the new `bf_slice` runtime
|
|
159
|
-
// helper carves out a sub-range with JS-compat clamping
|
|
160
|
-
// (#1448 Tier A fifth PR).
|
|
161
|
-
// `array-reverse` / `array-toReversed` no longer pinned —
|
|
162
|
-
// both share the `bf_reverse` helper since SSR templates
|
|
163
|
-
// render a snapshot and the JS mutate-vs-new distinction has
|
|
164
|
-
// no template-level meaning (#1448 Tier A sixth PR).
|
|
165
|
-
// `string-toLowerCase` / `string-toUpperCase` no longer pinned —
|
|
166
|
-
// pre-existing `bf_lower` / `bf_upper` runtime helpers wire to
|
|
167
|
-
// the JS method names at the adapter layer (#1448 Tier A
|
|
168
|
-
// seventh + eighth PRs).
|
|
169
|
-
// `string-trim` no longer pinned — pre-existing `bf_trim`
|
|
170
|
-
// (wraps `strings.TrimSpace`) handles the strip (#1448 Tier A
|
|
171
|
-
// ninth PR, closing out Tier A).
|
|
172
|
-
// `array-map-function-reference` no longer pinned — a bare-identifier
|
|
173
|
-
// `.map(format)` callback now resolves one hop to its declaration
|
|
174
|
-
// (`resolveCallbackMethodFunctionReferences`, #2206), the same mechanism
|
|
175
|
-
// #2090 established for `.sort(fnref)`.
|
|
176
|
-
// `dangerous-inner-html` no longer pinned — a compile-time string-literal
|
|
177
|
-
// `dangerouslySetInnerHTML={{ __html: '...' }}` is spliced directly into
|
|
178
|
-
// the template as trusted raw text (`resolveDangerousInnerHtml`, #2207).
|
|
179
|
-
// A dynamic/signal-derived value now lowers through the `bf_raw_html`
|
|
180
|
-
// runtime helper (a `template.HTML`-typed escape bypass, #2319) —
|
|
181
|
-
// `dangerous-inner-html-dynamic` is no longer pinned and renders to Hono
|
|
182
|
-
// parity, same as the static case.
|
|
183
|
-
// #2273: a method call on a prop typed as a built-in host rich type
|
|
184
|
-
// (Date, Map, …) has no catalogued lowering in any adapter — this is a
|
|
185
|
-
// compiler-level refusal (`checkRichTypeMethodCalls`, wired ahead of
|
|
186
|
-
// `adapter.generate()`), not an adapter-specific gap, so it is pinned
|
|
187
|
-
// identically across every adapter package including Hono.
|
|
52
|
+
'filter-nested-find-predicate': [{ code: 'BF101', severity: 'error', issue: 'https://github.com/piconic-ai/barefootjs/issues/2320' }],
|
|
188
53
|
'date-method-uncatalogued': [{ code: 'BF021', severity: 'error', issue: 'https://github.com/piconic-ai/barefootjs/issues/2356' }],
|
|
54
|
+
'rich-prop-client-read': [{ code: 'BF049', severity: 'error', issue: 'https://github.com/piconic-ai/barefootjs/issues/2648' }],
|
|
189
55
|
}
|
|
@@ -1,38 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* Consumed by this package's conformance test (its `skipJsx` set is
|
|
10
|
-
* derived from these keys, so the skip list and this declaration can't
|
|
11
|
-
* drift) and by `packages/compat`, which publishes the entries in the
|
|
12
|
-
* fixture-divergences section of `ui/compat.lock.json` — surfaced on
|
|
13
|
-
* the docs compatibility-matrix page. Graduating an entry means fixing
|
|
14
|
-
* the adapter (or the shared compiler layer) and deleting the line.
|
|
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.
|
|
19
|
-
* Keep the file (and this header) when the set is empty — the next
|
|
20
|
-
* divergence lands here, not in a re-created file.
|
|
2
|
+
* Fixtures that compile clean on this adapter but render divergent from the
|
|
3
|
+
* Hono reference on real Go. The conformance `skipJsx` set and
|
|
4
|
+
* `packages/compat`'s published fixture-divergences both derive from this
|
|
5
|
+
* one object, so the skip list and the declaration can't drift. Keep the
|
|
6
|
+
* file even when the set is empty — the next divergence lands here, not in
|
|
7
|
+
* a re-created file.
|
|
21
8
|
*/
|
|
22
9
|
|
|
23
10
|
import type { RenderDivergences } from '@barefootjs/jsx'
|
|
24
11
|
|
|
25
12
|
export const renderDivergences: RenderDivergences = {
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
// gap on Go, unlike the 7 template-string adapters. (2) The real gap was
|
|
32
|
-
// `.TodoItems []TodoItemProps` — the loop-body CHILD COMPONENT slice the
|
|
33
|
-
// template actually ranges over — which has no server-side population
|
|
34
|
-
// path in this harness (documented as route-handler-populated in
|
|
35
|
-
// production). `buildDynamicChildLoopSeeding` (this package's
|
|
36
|
-
// `test-render.ts`) now replicates that documented contract for a
|
|
37
|
-
// signal-backed dynamic child-component loop.
|
|
13
|
+
// #2630: the exact shape BF101's pass-as-prop suggestion (#2321) steers
|
|
14
|
+
// go-template users into — compiles clean, runs clean, silently renders the
|
|
15
|
+
// loop host empty. Full analysis in the issue.
|
|
16
|
+
'static-array-from-props-with-component-precomputed':
|
|
17
|
+
'prop-backed child-component loop renders the loop host empty at SSR (https://github.com/piconic-ai/barefootjs/issues/2630)',
|
|
38
18
|
}
|