@barefootjs/xslate 0.34.0 → 0.35.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapter/index.js +1 -1
- package/dist/adapter/xslate-adapter.d.ts.map +1 -1
- package/dist/conformance-pins.d.ts.map +1 -1
- package/dist/index.js +5 -7
- package/dist/render-divergences.d.ts.map +1 -1
- package/dist/vite.js +38 -30
- package/lib/BarefootJS/Backend/Xslate.pm +1 -1
- package/package.json +5 -5
- package/src/__tests__/xslate-adapter.test.ts +2 -2
- package/src/adapter/xslate-adapter.ts +5 -1
- package/src/conformance-pins.ts +13 -7
- package/src/render-divergences.ts +1 -4
- package/src/test-render.ts +20 -0
package/dist/adapter/index.js
CHANGED
|
@@ -188643,7 +188643,7 @@ ${whenTrue}
|
|
|
188643
188643
|
const preambleLines = (loop.preamble?.declarations ?? []).map((d) => `: my $${d.name} = ${this.convertExpressionToKolon(d.raw, d.valueParsed)};`);
|
|
188644
188644
|
const childrenUnderLoop = this.renderChildren(loop.children);
|
|
188645
188645
|
this.inLoop = prevInLoop;
|
|
188646
|
-
const bodyChildren = loop.bodyIsItemConditional && loop.key ? `<: $bf.comment("loop-i:" ~ ${this.convertExpressionToKolon(loop.key)}) | mark_raw :>
|
|
188646
|
+
const bodyChildren = loop.bodyIsItemConditional && loop.key ? `<: $bf.comment("loop-i:" ~ $bf.escape_comment_key(${this.convertExpressionToKolon(loop.key)})) | mark_raw :>
|
|
188647
188647
|
${childrenUnderLoop}` : childrenUnderLoop;
|
|
188648
188648
|
this.scope = prevScope;
|
|
188649
188649
|
const lines = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xslate-adapter.d.ts","sourceRoot":"","sources":["../../src/adapter/xslate-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,MAAM,EACN,SAAS,EACT,MAAM,EACN,YAAY,E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uBvC;;;;;;;OAOG;IACH,OAAO,KAAK,OAAO,GAWlB;IAED;;;;;OAKG;IACH,OAAO,KAAK,SAAS,GAQpB;IAED,sEAAsE;IACtE,OAAO,KAAK,OAAO,GAElB;IAED,OAAO,CAAC,wBAAwB;IAyDhC;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IAI/B;oEACgE;IAChE,OAAO,CAAC,kBAAkB;IAI1B;;;;;OAKG;IACH;;;;;OAKG;IACH;;;;;OAKG;IACH;;;;OAIG;IACH,8BAA8B,CAC5B,IAAI,EAAE,MAAM,GACX;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,UAAU,CAAC;QAAC,gBAAgB,EAAE,UAAU,CAAA;KAAE,GAAG,IAAI,CAmBxG;IAED,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAW3C;IAED,8EAA8E;IAC9E,OAAO,CAAC,eAAe;IAIvB;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,oBAAoB;IAW5B;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,2BAA2B;IAQnC,OAAO,CAAC,yBAAyB;IASjC,OAAO,CAAC,gBAAgB;IAcxB,iFAAiF;IACjF,OAAO,CAAC,4BAA4B;CAGrC;AAED,eAAO,MAAM,aAAa,eAAsB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,eAuE7B,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -188643,7 +188643,7 @@ ${whenTrue}
|
|
|
188643
188643
|
const preambleLines = (loop.preamble?.declarations ?? []).map((d) => `: my $${d.name} = ${this.convertExpressionToKolon(d.raw, d.valueParsed)};`);
|
|
188644
188644
|
const childrenUnderLoop = this.renderChildren(loop.children);
|
|
188645
188645
|
this.inLoop = prevInLoop;
|
|
188646
|
-
const bodyChildren = loop.bodyIsItemConditional && loop.key ? `<: $bf.comment("loop-i:" ~ ${this.convertExpressionToKolon(loop.key)}) | mark_raw :>
|
|
188646
|
+
const bodyChildren = loop.bodyIsItemConditional && loop.key ? `<: $bf.comment("loop-i:" ~ $bf.escape_comment_key(${this.convertExpressionToKolon(loop.key)})) | mark_raw :>
|
|
188647
188647
|
${childrenUnderLoop}` : childrenUnderLoop;
|
|
188648
188648
|
this.scope = prevScope;
|
|
188649
188649
|
const lines = [];
|
|
@@ -189172,14 +189172,12 @@ var conformancePins = {
|
|
|
189172
189172
|
"filter-nested-find-predicate": [{ code: "BF101", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2320" }],
|
|
189173
189173
|
"date-method-uncatalogued": [{ code: "BF021", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2356" }],
|
|
189174
189174
|
"rich-prop-client-read": [{ code: "BF049", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2648" }],
|
|
189175
|
-
"jsx-element-prop-ternary": [{ code: "BF021", severity: "error"
|
|
189176
|
-
"jsx-element-prop-array": [{ code: "BF021", severity: "error"
|
|
189177
|
-
"namespace-import-primitive": [{ code: "BF013", severity: "error"
|
|
189175
|
+
"jsx-element-prop-ternary": [{ code: "BF021", severity: "error" }],
|
|
189176
|
+
"jsx-element-prop-array": [{ code: "BF021", severity: "error" }],
|
|
189177
|
+
"namespace-import-primitive": [{ code: "BF013", severity: "error" }]
|
|
189178
189178
|
};
|
|
189179
189179
|
// src/render-divergences.ts
|
|
189180
|
-
var renderDivergences = {
|
|
189181
|
-
"aliased-loop-source": "A `.map()` loop whose source is a local const alias of a signal getter (`const items__alias = items`) SSRs an empty `<ul>` on real Text::Xslate — the seeded loop data is keyed by the signal's real name (`items`), and the alias hop is never resolved when deciding what to seed under `items__alias`. This is the SSR-side twin of #2778 (fixed for the CSR client-JS template in the same PR that added this fixture) — that fix only touches client-JS emission, not SSR data-seeding. Tracked at https://github.com/piconic-ai/barefootjs/issues/2813; graduate by resolving the alias hop at SSR-seeding time using the same `resolveAliasOrigin`/`resolveGetterAliases` mechanism #2778 introduced, rather than a third alias-hop walker."
|
|
189182
|
-
};
|
|
189180
|
+
var renderDivergences = {};
|
|
189183
189181
|
export {
|
|
189184
189182
|
xslateAdapter,
|
|
189185
189183
|
renderDivergences,
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,iBAAsB,CAAA"}
|
package/dist/vite.js
CHANGED
|
@@ -8,7 +8,7 @@ import { devModuleUrl, loadManifest, resolveDevOrigin, resolveScriptAssets, toPo
|
|
|
8
8
|
import ts25 from "typescript";
|
|
9
9
|
|
|
10
10
|
// ../jsx/src/analyzer.ts
|
|
11
|
-
import
|
|
11
|
+
import ts11 from "typescript";
|
|
12
12
|
|
|
13
13
|
// ../jsx/src/expression-parser.ts
|
|
14
14
|
import ts from "typescript";
|
|
@@ -2274,6 +2274,12 @@ class BindingScope {
|
|
|
2274
2274
|
}
|
|
2275
2275
|
}
|
|
2276
2276
|
|
|
2277
|
+
// ../jsx/src/ir-to-client-js/safe-html.ts
|
|
2278
|
+
function safeHtml(expr) {
|
|
2279
|
+
return expr;
|
|
2280
|
+
}
|
|
2281
|
+
var EMPTY_MARKUP = safeHtml("''");
|
|
2282
|
+
|
|
2277
2283
|
// ../jsx/src/ir-to-client-js/html-template.ts
|
|
2278
2284
|
var VOID_ELEMENTS = new Set([
|
|
2279
2285
|
"area",
|
|
@@ -2331,14 +2337,17 @@ function freshCounters() {
|
|
|
2331
2337
|
}
|
|
2332
2338
|
|
|
2333
2339
|
// ../jsx/src/analyzer-context.ts
|
|
2334
|
-
import
|
|
2340
|
+
import ts10 from "typescript";
|
|
2335
2341
|
|
|
2336
2342
|
// ../jsx/src/strip-types.ts
|
|
2337
2343
|
import ts8 from "typescript";
|
|
2338
2344
|
|
|
2345
|
+
// ../jsx/src/reactivity-checker.ts
|
|
2346
|
+
import ts9 from "typescript";
|
|
2347
|
+
|
|
2339
2348
|
// ../jsx/src/analyzer-context.ts
|
|
2340
|
-
var _typePrinter =
|
|
2341
|
-
var _blankTypeSourceFile =
|
|
2349
|
+
var _typePrinter = ts10.createPrinter({ removeComments: true, omitTrailingSemicolon: true });
|
|
2350
|
+
var _blankTypeSourceFile = ts10.createSourceFile("__bf_types__.ts", "", ts10.ScriptTarget.Latest);
|
|
2342
2351
|
|
|
2343
2352
|
// ../jsx/src/errors.ts
|
|
2344
2353
|
var ErrorCodes = {
|
|
@@ -2560,6 +2569,7 @@ var CLIENT_EXPORTS = new Set([
|
|
|
2560
2569
|
"isSSRPortal",
|
|
2561
2570
|
"findSiblingSlot",
|
|
2562
2571
|
"cleanupPortalPlaceholder",
|
|
2572
|
+
"trackPosition",
|
|
2563
2573
|
"createSearchParams",
|
|
2564
2574
|
"queryHref",
|
|
2565
2575
|
"formatDate",
|
|
@@ -2570,46 +2580,46 @@ function extractFreeIdentifiersFromNode(node) {
|
|
|
2570
2580
|
const ids = new Set;
|
|
2571
2581
|
const boundNames = new Set;
|
|
2572
2582
|
function addBindingNames(name, out) {
|
|
2573
|
-
if (
|
|
2583
|
+
if (ts11.isIdentifier(name))
|
|
2574
2584
|
out.push(name.text);
|
|
2575
|
-
else if (
|
|
2585
|
+
else if (ts11.isObjectBindingPattern(name))
|
|
2576
2586
|
name.elements.forEach((e) => addBindingNames(e.name, out));
|
|
2577
|
-
else if (
|
|
2587
|
+
else if (ts11.isArrayBindingPattern(name))
|
|
2578
2588
|
name.elements.forEach((e) => {
|
|
2579
|
-
if (!
|
|
2589
|
+
if (!ts11.isOmittedExpression(e))
|
|
2580
2590
|
addBindingNames(e.name, out);
|
|
2581
2591
|
});
|
|
2582
2592
|
}
|
|
2583
2593
|
function visit(n) {
|
|
2584
|
-
if (
|
|
2594
|
+
if (ts11.isTypeNode(n))
|
|
2585
2595
|
return;
|
|
2586
|
-
if (
|
|
2596
|
+
if (ts11.isIdentifier(n)) {
|
|
2587
2597
|
const parent = n.parent;
|
|
2588
|
-
if (parent &&
|
|
2598
|
+
if (parent && ts11.isPropertyAccessExpression(parent) && parent.name === n)
|
|
2589
2599
|
return;
|
|
2590
|
-
if (parent &&
|
|
2600
|
+
if (parent && ts11.isPropertyAssignment(parent) && parent.name === n)
|
|
2591
2601
|
return;
|
|
2592
|
-
if (parent &&
|
|
2602
|
+
if (parent && ts11.isParameter(parent) && parent.name === n)
|
|
2593
2603
|
return;
|
|
2594
|
-
if (parent &&
|
|
2604
|
+
if (parent && ts11.isVariableDeclaration(parent) && parent.name === n)
|
|
2595
2605
|
return;
|
|
2596
2606
|
if (boundNames.has(n.text))
|
|
2597
2607
|
return;
|
|
2598
2608
|
ids.add(n.text);
|
|
2599
2609
|
return;
|
|
2600
2610
|
}
|
|
2601
|
-
if (
|
|
2611
|
+
if (ts11.isArrowFunction(n)) {
|
|
2602
2612
|
const params = [];
|
|
2603
2613
|
for (const p of n.parameters)
|
|
2604
2614
|
addBindingNames(p.name, params);
|
|
2605
2615
|
for (const name of params)
|
|
2606
2616
|
boundNames.add(name);
|
|
2607
|
-
|
|
2617
|
+
ts11.forEachChild(n, visit);
|
|
2608
2618
|
for (const name of params)
|
|
2609
2619
|
boundNames.delete(name);
|
|
2610
2620
|
return;
|
|
2611
2621
|
}
|
|
2612
|
-
|
|
2622
|
+
ts11.forEachChild(n, visit);
|
|
2613
2623
|
}
|
|
2614
2624
|
visit(node);
|
|
2615
2625
|
return ids;
|
|
@@ -2620,7 +2630,8 @@ var BROWSER_ONLY_CLIENT_APIS = new Set([
|
|
|
2620
2630
|
"createPortal",
|
|
2621
2631
|
"isSSRPortal",
|
|
2622
2632
|
"findSiblingSlot",
|
|
2623
|
-
"cleanupPortalPlaceholder"
|
|
2633
|
+
"cleanupPortalPlaceholder",
|
|
2634
|
+
"trackPosition"
|
|
2624
2635
|
]);
|
|
2625
2636
|
var REACTIVE_PRIMITIVES = new Set([
|
|
2626
2637
|
"createSignal",
|
|
@@ -2682,7 +2693,7 @@ function preambleAnalysisTemplateText(p) {
|
|
|
2682
2693
|
}
|
|
2683
2694
|
|
|
2684
2695
|
// ../jsx/src/module-exports.ts
|
|
2685
|
-
import
|
|
2696
|
+
import ts12 from "typescript";
|
|
2686
2697
|
function formatParamWithType(p) {
|
|
2687
2698
|
const rest = p.isRest ? "..." : "";
|
|
2688
2699
|
const optional = p.optional ? "?" : "";
|
|
@@ -2717,21 +2728,21 @@ function findAssignedNames(bodyText, candidates) {
|
|
|
2717
2728
|
const assigned = new Set;
|
|
2718
2729
|
if (candidates.size === 0)
|
|
2719
2730
|
return assigned;
|
|
2720
|
-
const sf =
|
|
2731
|
+
const sf = ts12.createSourceFile("bf-assignment-scan.tsx", bodyText, ts12.ScriptTarget.Latest, false, ts12.ScriptKind.TSX);
|
|
2721
2732
|
const record = (target) => {
|
|
2722
|
-
if (
|
|
2733
|
+
if (ts12.isIdentifier(target) && candidates.has(target.text)) {
|
|
2723
2734
|
assigned.add(target.text);
|
|
2724
2735
|
}
|
|
2725
2736
|
};
|
|
2726
2737
|
const visit = (node) => {
|
|
2727
|
-
if (
|
|
2738
|
+
if (ts12.isBinaryExpression(node) && isAssignmentOperator(node.operatorToken.kind)) {
|
|
2728
2739
|
record(node.left);
|
|
2729
|
-
} else if ((
|
|
2740
|
+
} else if ((ts12.isPrefixUnaryExpression(node) || ts12.isPostfixUnaryExpression(node)) && (node.operator === ts12.SyntaxKind.PlusPlusToken || node.operator === ts12.SyntaxKind.MinusMinusToken)) {
|
|
2730
2741
|
record(node.operand);
|
|
2731
2742
|
}
|
|
2732
|
-
|
|
2743
|
+
ts12.forEachChild(node, visit);
|
|
2733
2744
|
};
|
|
2734
|
-
|
|
2745
|
+
ts12.forEachChild(sf, visit);
|
|
2735
2746
|
return assigned;
|
|
2736
2747
|
}
|
|
2737
2748
|
function closeOverWritersOfMutableBindings(primaryRefs, declarations, mutableNames) {
|
|
@@ -2754,12 +2765,9 @@ function closeOverWritersOfMutableBindings(primaryRefs, declarations, mutableNam
|
|
|
2754
2765
|
return reachable;
|
|
2755
2766
|
}
|
|
2756
2767
|
function isAssignmentOperator(kind) {
|
|
2757
|
-
return kind >=
|
|
2768
|
+
return kind >= ts12.SyntaxKind.FirstAssignment && kind <= ts12.SyntaxKind.LastAssignment;
|
|
2758
2769
|
}
|
|
2759
2770
|
|
|
2760
|
-
// ../jsx/src/reactivity-checker.ts
|
|
2761
|
-
import ts12 from "typescript";
|
|
2762
|
-
|
|
2763
2771
|
// ../jsx/src/free-refs.ts
|
|
2764
2772
|
import ts13 from "typescript";
|
|
2765
2773
|
var _bindingMapCache = new WeakMap;
|
|
@@ -6604,7 +6612,7 @@ ${whenTrue}
|
|
|
6604
6612
|
const preambleLines = (loop.preamble?.declarations ?? []).map((d) => `: my $${d.name} = ${this.convertExpressionToKolon(d.raw, d.valueParsed)};`);
|
|
6605
6613
|
const childrenUnderLoop = this.renderChildren(loop.children);
|
|
6606
6614
|
this.inLoop = prevInLoop;
|
|
6607
|
-
const bodyChildren = loop.bodyIsItemConditional && loop.key ? `<: $bf.comment("loop-i:" ~ ${this.convertExpressionToKolon(loop.key)}) | mark_raw :>
|
|
6615
|
+
const bodyChildren = loop.bodyIsItemConditional && loop.key ? `<: $bf.comment("loop-i:" ~ $bf.escape_comment_key(${this.convertExpressionToKolon(loop.key)})) | mark_raw :>
|
|
6608
6616
|
${childrenUnderLoop}` : childrenUnderLoop;
|
|
6609
6617
|
this.scope = prevScope;
|
|
6610
6618
|
const lines = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barefootjs/xslate",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.1",
|
|
4
4
|
"description": "Text::Xslate (Kolon) adapter for BarefootJS — compiles IR to .tx templates and ships the Xslate rendering backend; runs under any PSGI/Plack app",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"directory": "packages/adapter-xslate"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@barefootjs/shared": "0.
|
|
58
|
+
"@barefootjs/shared": "0.35.1"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"@barefootjs/jsx": ">=0.2.0",
|
|
@@ -72,9 +72,9 @@
|
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@barefootjs/adapter-tests": "0.1.0",
|
|
75
|
-
"@barefootjs/jsx": "0.
|
|
76
|
-
"@barefootjs/vite": "0.
|
|
77
|
-
"@barefootjs/client": "0.
|
|
75
|
+
"@barefootjs/jsx": "0.35.1",
|
|
76
|
+
"@barefootjs/vite": "0.35.1",
|
|
77
|
+
"@barefootjs/client": "0.35.1",
|
|
78
78
|
"typescript": "^5.0.0",
|
|
79
79
|
"vite": "^6.0.0"
|
|
80
80
|
}
|
|
@@ -595,8 +595,8 @@ function Widget({ values }: { values: number[] }) {
|
|
|
595
595
|
return <ul>{values.map((label) => (label > 0 ? <li key={label}>{label}</li> : null))}</ul>
|
|
596
596
|
}
|
|
597
597
|
`)
|
|
598
|
-
expect(template).toContain('$bf.comment("loop-i:" ~ $label)')
|
|
599
|
-
expect(template).not.toContain('$bf.comment("loop-i:" ~ \'x\')')
|
|
598
|
+
expect(template).toContain('$bf.comment("loop-i:" ~ $bf.escape_comment_key($label))')
|
|
599
|
+
expect(template).not.toContain('$bf.comment("loop-i:" ~ $bf.escape_comment_key(\'x\'))')
|
|
600
600
|
})
|
|
601
601
|
|
|
602
602
|
test('a loop param shadowing an outer const resolves to the row value inside a .map() preamble local initializer', () => {
|
|
@@ -979,9 +979,13 @@ export class XslateAdapter extends BaseAdapter implements IRNodeEmitter<XslateRe
|
|
|
979
979
|
// client's `mapArrayAnchored` can hydrate every SSR-rendered item by its
|
|
980
980
|
// anchor. Still under the row scope (see above) — `loop.key` is a
|
|
981
981
|
// per-row expression.
|
|
982
|
+
// `$bf.escape_comment_key` (#2795 follow-up) both stringifies the key
|
|
983
|
+
// (JS `String()` semantics, matching the other adapters) and neutralizes
|
|
984
|
+
// `-` so it can't spell `-->` and close the comment early — see its doc
|
|
985
|
+
// in `BarefootJS.pm`.
|
|
982
986
|
const bodyChildren =
|
|
983
987
|
loop.bodyIsItemConditional && loop.key
|
|
984
|
-
? `<: $bf.comment("loop-i:" ~ ${this.convertExpressionToKolon(loop.key)}) | mark_raw :>\n${childrenUnderLoop}`
|
|
988
|
+
? `<: $bf.comment("loop-i:" ~ $bf.escape_comment_key(${this.convertExpressionToKolon(loop.key)})) | mark_raw :>\n${childrenUnderLoop}`
|
|
985
989
|
: childrenUnderLoop
|
|
986
990
|
this.scope = prevScope
|
|
987
991
|
|
package/src/conformance-pins.ts
CHANGED
|
@@ -60,18 +60,24 @@ export const conformancePins: ConformancePins = {
|
|
|
60
60
|
// above is refused.
|
|
61
61
|
'date-method-uncatalogued': [{ code: 'BF021', severity: 'error', issue: 'https://github.com/piconic-ai/barefootjs/issues/2356' }],
|
|
62
62
|
'rich-prop-client-read': [{ code: 'BF049', severity: 'error', issue: 'https://github.com/piconic-ai/barefootjs/issues/2648' }],
|
|
63
|
-
//
|
|
63
|
+
// A ternary or array literal LITERALLY WRAPPING JSX at a non-children prop
|
|
64
64
|
// position (e.g. `header={cond ? <a/> : <b/>}`) is refused ahead of
|
|
65
65
|
// `adapter.generate()` in the shared jsx-to-ir.ts phase, so it is pinned
|
|
66
66
|
// identically on every adapter (including Hono) — same reasoning as
|
|
67
|
-
// `rich-prop-client-read` above.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
//
|
|
67
|
+
// `rich-prop-client-read` above. This is the permanent, intended behavior
|
|
68
|
+
// (formerly tracked as #2667, closed): the issue's own acceptance criteria
|
|
69
|
+
// treated a loud refusal as fully resolving the silent-divergence bug, so
|
|
70
|
+
// no open issue tracks further work here.
|
|
71
|
+
'jsx-element-prop-ternary': [{ code: 'BF021', severity: 'error' }],
|
|
72
|
+
'jsx-element-prop-array': [{ code: 'BF021', severity: 'error' }],
|
|
73
|
+
// A reactive primitive invoked through a namespace import
|
|
71
74
|
// (`import * as bf from '@barefootjs/client'`, `bf.createSignal(...)`)
|
|
72
75
|
// that the analyzer's checker-less fast path cannot recognize refuses
|
|
73
76
|
// loudly (BF013) instead of silently dropping the declaration — fired
|
|
74
77
|
// in the shared analyzer pass ahead of any adapter's `adapter.generate()`,
|
|
75
|
-
// so all nine adapters (including Hono) pin this identically.
|
|
76
|
-
|
|
78
|
+
// so all nine adapters (including Hono) pin this identically. A compile
|
|
79
|
+
// that supplies a shared `ts.Program` (e.g. via `@barefootjs/vite`)
|
|
80
|
+
// resolves the primitive normally and never reaches this refusal (formerly
|
|
81
|
+
// tracked as #2771, closed) — no open issue tracks further work.
|
|
82
|
+
'namespace-import-primitive': [{ code: 'BF013', severity: 'error' }],
|
|
77
83
|
}
|
|
@@ -22,7 +22,4 @@ import type { RenderDivergences } from '@barefootjs/jsx'
|
|
|
22
22
|
// the real name off that capture — the same in-template recompute the other
|
|
23
23
|
// six template-stash backends already had. Keep the file even when the set
|
|
24
24
|
// is empty — the next divergence lands here, not in a re-created file.
|
|
25
|
-
export const renderDivergences: RenderDivergences = {
|
|
26
|
-
'aliased-loop-source':
|
|
27
|
-
'A `.map()` loop whose source is a local const alias of a signal getter (`const items__alias = items`) SSRs an empty `<ul>` on real Text::Xslate — the seeded loop data is keyed by the signal\'s real name (`items`), and the alias hop is never resolved when deciding what to seed under `items__alias`. This is the SSR-side twin of #2778 (fixed for the CSR client-JS template in the same PR that added this fixture) — that fix only touches client-JS emission, not SSR data-seeding. Tracked at https://github.com/piconic-ai/barefootjs/issues/2813; graduate by resolving the alias hop at SSR-seeding time using the same `resolveAliasOrigin`/`resolveGetterAliases` mechanism #2778 introduced, rather than a third alias-hop walker.',
|
|
28
|
-
}
|
|
25
|
+
export const renderDivergences: RenderDivergences = {}
|
package/src/test-render.ts
CHANGED
|
@@ -581,6 +581,26 @@ function buildPerlProps(
|
|
|
581
581
|
}
|
|
582
582
|
}
|
|
583
583
|
|
|
584
|
+
// #2813: `extractSsrDefaults` can seed an entry under a name that is
|
|
585
|
+
// none of `propsParams` / `signals` / `memos` above — a bare local-const
|
|
586
|
+
// alias of a signal/memo getter (`const items__alias = items`,
|
|
587
|
+
// `ssr-defaults.ts`) seeds `items__alias` alongside `items`. Production
|
|
588
|
+
// hands the whole manifest-derived stash straight through
|
|
589
|
+
// (`deriveStashFromDefaults` IS the production seeding mechanism here,
|
|
590
|
+
// not a harness stand-in), so any leftover `derivedProps` key must be
|
|
591
|
+
// pushed too, or this harness would silently omit what production
|
|
592
|
+
// actually provides, mismeasuring this conformance case.
|
|
593
|
+
const seededNames = new Set<string>([
|
|
594
|
+
...ir.metadata.propsParams.filter(p => !p.isRest).map(p => p.name),
|
|
595
|
+
...(restPropsName ? [restPropsName] : []),
|
|
596
|
+
...ir.metadata.signals.filter(s => !s.envReader).map(s => s.getter),
|
|
597
|
+
...ir.metadata.memos.map(m => m.name),
|
|
598
|
+
])
|
|
599
|
+
for (const [name, value] of Object.entries(derivedProps)) {
|
|
600
|
+
if (seededNames.has(name)) continue
|
|
601
|
+
entries.push(`${name} => ${toPerlLiteral(value)}`)
|
|
602
|
+
}
|
|
603
|
+
|
|
584
604
|
// (#1922) Request-scoped `searchParams()`: bind `$searchParams` to an
|
|
585
605
|
// empty-query reader via the lazy-loading factory (so the render script
|
|
586
606
|
// needn't `use BarefootJS::SearchParams`). The conformance harness issues no
|