@barefootjs/mojolicious 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/mojo-adapter.d.ts.map +1 -1
- package/dist/conformance-pins.d.ts.map +1 -1
- package/dist/index.js +5 -8
- package/dist/render-divergences.d.ts.map +1 -1
- package/dist/vite.js +38 -30
- package/lib/BarefootJS/Backend/Mojo.pm +1 -1
- package/lib/Mojolicious/Plugin/BarefootJS/DevReload.pm +1 -1
- package/lib/Mojolicious/Plugin/BarefootJS.pm +1 -1
- package/package.json +5 -5
- package/src/adapter/mojo-adapter.ts +5 -1
- package/src/conformance-pins.ts +13 -7
- package/src/render-divergences.ts +1 -16
- package/src/test-render.ts +38 -0
package/dist/adapter/index.js
CHANGED
|
@@ -1446,7 +1446,7 @@ ${whenTrue}
|
|
|
1446
1446
|
const prevScope = this.scope;
|
|
1447
1447
|
this.scope = prevScope.enterLoopRow(loop);
|
|
1448
1448
|
const renderedChildren = this.renderChildren(loop.children);
|
|
1449
|
-
const children = loop.bodyIsItemConditional && loop.key ? `<%== bf->comment("loop-i:" . ${this.convertExpressionToPerl(loop.key)}) %>
|
|
1449
|
+
const children = loop.bodyIsItemConditional && loop.key ? `<%== bf->comment("loop-i:" . bf->escape_comment_key(${this.convertExpressionToPerl(loop.key)})) %>
|
|
1450
1450
|
${renderedChildren}` : renderedChildren;
|
|
1451
1451
|
const lines = [];
|
|
1452
1452
|
lines.push(`<%== bf->comment("loop:${loop.markerId}") %>`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mojo-adapter.d.ts","sourceRoot":"","sources":["../../src/adapter/mojo-adapter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EACV,WAAW,EAEX,MAAM,EACN,SAAS,EACT,MAAM,EACN,YAAY,EACZ,aAAa,EACb,MAAM,EACN,WAAW,EACX,UAAU,EAC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
|
-
{"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,eAgE7B,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1446,7 +1446,7 @@ ${whenTrue}
|
|
|
1446
1446
|
const prevScope = this.scope;
|
|
1447
1447
|
this.scope = prevScope.enterLoopRow(loop);
|
|
1448
1448
|
const renderedChildren = this.renderChildren(loop.children);
|
|
1449
|
-
const children = loop.bodyIsItemConditional && loop.key ? `<%== bf->comment("loop-i:" . ${this.convertExpressionToPerl(loop.key)}) %>
|
|
1449
|
+
const children = loop.bodyIsItemConditional && loop.key ? `<%== bf->comment("loop-i:" . bf->escape_comment_key(${this.convertExpressionToPerl(loop.key)})) %>
|
|
1450
1450
|
${renderedChildren}` : renderedChildren;
|
|
1451
1451
|
const lines = [];
|
|
1452
1452
|
lines.push(`<%== bf->comment("loop:${loop.markerId}") %>`);
|
|
@@ -1909,15 +1909,12 @@ var conformancePins = {
|
|
|
1909
1909
|
"filter-nested-find-predicate": [{ code: "BF101", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2320" }],
|
|
1910
1910
|
"date-method-uncatalogued": [{ code: "BF021", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2356" }],
|
|
1911
1911
|
"rich-prop-client-read": [{ code: "BF049", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2648" }],
|
|
1912
|
-
"jsx-element-prop-ternary": [{ code: "BF021", severity: "error"
|
|
1913
|
-
"jsx-element-prop-array": [{ code: "BF021", severity: "error"
|
|
1914
|
-
"namespace-import-primitive": [{ code: "BF013", severity: "error"
|
|
1912
|
+
"jsx-element-prop-ternary": [{ code: "BF021", severity: "error" }],
|
|
1913
|
+
"jsx-element-prop-array": [{ code: "BF021", severity: "error" }],
|
|
1914
|
+
"namespace-import-primitive": [{ code: "BF013", severity: "error" }]
|
|
1915
1915
|
};
|
|
1916
1916
|
// src/render-divergences.ts
|
|
1917
|
-
var renderDivergences = {
|
|
1918
|
-
"children-passthrough-renamed": "A renamed `children` destructure emits the local alias as a template variable; the stash defines only `children`, so the Perl render dies (#2788).",
|
|
1919
|
-
"aliased-loop-source": "A `.map()` loop whose source is a local const alias of a signal getter (`const items__alias = items`) dies inside `Mojo::Template::process` on real Mojolicious — 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."
|
|
1920
|
-
};
|
|
1917
|
+
var renderDivergences = {};
|
|
1921
1918
|
export {
|
|
1922
1919
|
renderDivergences,
|
|
1923
1920
|
mojoAdapter,
|
|
@@ -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;
|
|
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;AAQxD,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;
|
|
@@ -6673,7 +6681,7 @@ ${whenTrue}
|
|
|
6673
6681
|
const prevScope = this.scope;
|
|
6674
6682
|
this.scope = prevScope.enterLoopRow(loop);
|
|
6675
6683
|
const renderedChildren = this.renderChildren(loop.children);
|
|
6676
|
-
const children = loop.bodyIsItemConditional && loop.key ? `<%== bf->comment("loop-i:" . ${this.convertExpressionToPerl(loop.key)}) %>
|
|
6684
|
+
const children = loop.bodyIsItemConditional && loop.key ? `<%== bf->comment("loop-i:" . bf->escape_comment_key(${this.convertExpressionToPerl(loop.key)})) %>
|
|
6677
6685
|
${renderedChildren}` : renderedChildren;
|
|
6678
6686
|
const lines = [];
|
|
6679
6687
|
lines.push(`<%== bf->comment("loop:${loop.markerId}") %>`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barefootjs/mojolicious",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.1",
|
|
4
4
|
"description": "Mojolicious EP template adapter for BarefootJS - generates .html.ep files from IR",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"directory": "packages/adapter-mojolicious"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@barefootjs/shared": "0.
|
|
55
|
+
"@barefootjs/shared": "0.35.1"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"@barefootjs/jsx": ">=0.2.0",
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@barefootjs/adapter-tests": "0.1.0",
|
|
73
|
-
"@barefootjs/jsx": "0.
|
|
74
|
-
"@barefootjs/vite": "0.
|
|
75
|
-
"@barefootjs/client": "0.
|
|
73
|
+
"@barefootjs/jsx": "0.35.1",
|
|
74
|
+
"@barefootjs/vite": "0.35.1",
|
|
75
|
+
"@barefootjs/client": "0.35.1",
|
|
76
76
|
"vite": "^6.0.0"
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -995,9 +995,13 @@ export class MojoAdapter extends BaseAdapter implements IRNodeEmitter<MojoRender
|
|
|
995
995
|
// conditional content so the client's `mapArrayAnchored` can hydrate
|
|
996
996
|
// every SSR-rendered item by its anchor. `bf->comment` prepends `bf-`,
|
|
997
997
|
// so `"loop-i:" . KEY` yields `<!--bf-loop-i:KEY-->`.
|
|
998
|
+
// `bf->escape_comment_key` (#2795 follow-up) both stringifies the key
|
|
999
|
+
// (JS `String()` semantics, matching the other adapters) and neutralizes
|
|
1000
|
+
// `-` so it can't spell `-->` and close the comment early — see its doc
|
|
1001
|
+
// in `BarefootJS.pm`.
|
|
998
1002
|
const children =
|
|
999
1003
|
loop.bodyIsItemConditional && loop.key
|
|
1000
|
-
? `<%== bf->comment("loop-i:" . ${this.convertExpressionToPerl(loop.key)}) %>\n${renderedChildren}`
|
|
1004
|
+
? `<%== bf->comment("loop-i:" . bf->escape_comment_key(${this.convertExpressionToPerl(loop.key)})) %>\n${renderedChildren}`
|
|
1001
1005
|
: renderedChildren
|
|
1002
1006
|
|
|
1003
1007
|
const lines: string[] = []
|
package/src/conformance-pins.ts
CHANGED
|
@@ -53,18 +53,24 @@ export const conformancePins: ConformancePins = {
|
|
|
53
53
|
'filter-nested-find-predicate': [{ code: 'BF101', severity: 'error', issue: 'https://github.com/piconic-ai/barefootjs/issues/2320' }],
|
|
54
54
|
'date-method-uncatalogued': [{ code: 'BF021', severity: 'error', issue: 'https://github.com/piconic-ai/barefootjs/issues/2356' }],
|
|
55
55
|
'rich-prop-client-read': [{ code: 'BF049', severity: 'error', issue: 'https://github.com/piconic-ai/barefootjs/issues/2648' }],
|
|
56
|
-
//
|
|
56
|
+
// A ternary or array literal LITERALLY WRAPPING JSX at a non-children prop
|
|
57
57
|
// position (e.g. `header={cond ? <a/> : <b/>}`) is refused ahead of
|
|
58
58
|
// `adapter.generate()` in the shared jsx-to-ir.ts phase, so it is pinned
|
|
59
59
|
// identically on every adapter (including Hono) — same reasoning as
|
|
60
|
-
// `rich-prop-client-read` above.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
//
|
|
60
|
+
// `rich-prop-client-read` above. This is the permanent, intended behavior
|
|
61
|
+
// (formerly tracked as #2667, closed): the issue's own acceptance criteria
|
|
62
|
+
// treated a loud refusal as fully resolving the silent-divergence bug, so
|
|
63
|
+
// no open issue tracks further work here.
|
|
64
|
+
'jsx-element-prop-ternary': [{ code: 'BF021', severity: 'error' }],
|
|
65
|
+
'jsx-element-prop-array': [{ code: 'BF021', severity: 'error' }],
|
|
66
|
+
// A reactive primitive invoked through a namespace import
|
|
64
67
|
// (`import * as bf from '@barefootjs/client'`, `bf.createSignal(...)`)
|
|
65
68
|
// that the analyzer's checker-less fast path cannot recognize refuses
|
|
66
69
|
// loudly (BF013) instead of silently dropping the declaration — fired
|
|
67
70
|
// in the shared analyzer pass ahead of any adapter's `adapter.generate()`,
|
|
68
|
-
// so all nine adapters (including Hono) pin this identically.
|
|
69
|
-
|
|
71
|
+
// so all nine adapters (including Hono) pin this identically. A compile
|
|
72
|
+
// that supplies a shared `ts.Program` (e.g. via `@barefootjs/vite`)
|
|
73
|
+
// resolves the primitive normally and never reaches this refusal (formerly
|
|
74
|
+
// tracked as #2771, closed) — no open issue tracks further work.
|
|
75
|
+
'namespace-import-primitive': [{ code: 'BF013', severity: 'error' }],
|
|
70
76
|
}
|
|
@@ -15,19 +15,4 @@ import type { RenderDivergences } from '@barefootjs/jsx'
|
|
|
15
15
|
// at value position and the runtime evaluator's `object-literal` case
|
|
16
16
|
// now merges it, so the seed classifies `derived` and SSRs identically
|
|
17
17
|
// to Hono.
|
|
18
|
-
|
|
19
|
-
// `children` destructure (`const { children: kids } = props`) interpolates
|
|
20
|
-
// the LOCAL alias into the `.html.ep`, and the stash only carries the
|
|
21
|
-
// caller-facing `children`, so Perl dies inside `Mojo::Template::process`
|
|
22
|
-
// at render time rather than at build. Seven adapters resolve the alias;
|
|
23
|
-
// only Mojo does not. Same family as `aliased-destructured-prop`'s
|
|
24
|
-
// `{ n: count }` shape, one level in — the reserved children slot.
|
|
25
|
-
// Delete this entry when #2788 is fixed: `children-passthrough-renamed`
|
|
26
|
-
// already asserts the correct (Hono-generated) output, so it becomes the
|
|
27
|
-
// regression test the moment the skip comes off.
|
|
28
|
-
export const renderDivergences: RenderDivergences = {
|
|
29
|
-
'children-passthrough-renamed':
|
|
30
|
-
'A renamed `children` destructure emits the local alias as a template variable; the stash defines only `children`, so the Perl render dies (#2788).',
|
|
31
|
-
'aliased-loop-source':
|
|
32
|
-
'A `.map()` loop whose source is a local const alias of a signal getter (`const items__alias = items`) dies inside `Mojo::Template::process` on real Mojolicious — 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.',
|
|
33
|
-
}
|
|
18
|
+
export const renderDivergences: RenderDivergences = {}
|
package/src/test-render.ts
CHANGED
|
@@ -548,6 +548,21 @@ function buildChildDefaultsPerl(ir: ComponentIR): string {
|
|
|
548
548
|
`${memo.name} => ${value !== undefined && value !== null ? toPerlLiteral(value) : 'undef'}`,
|
|
549
549
|
)
|
|
550
550
|
}
|
|
551
|
+
// #2788: `extractSsrDefaults` can seed an entry under a name that is
|
|
552
|
+
// none of `propsParams` / `signals` / `memos` above — a bare-props-form
|
|
553
|
+
// component's body-level RENAMED destructure (`const { children: kids }
|
|
554
|
+
// = props`) seeds `kids` alongside the caller-facing `children`
|
|
555
|
+
// (`ssr-defaults.ts`). Real production hands `$entry->{ssrDefaults}`
|
|
556
|
+
// straight through to `_derive_stash_from_defaults`, which iterates
|
|
557
|
+
// every key it contains — so any leftover entry here must be added too,
|
|
558
|
+
// or this harness's hand-built stash literal would silently omit a key
|
|
559
|
+
// production's manifest-driven path already provides, mismeasuring
|
|
560
|
+
// this conformance case's real behavior.
|
|
561
|
+
for (const name of Object.keys(ssrDefaults)) {
|
|
562
|
+
if (declared.has(name)) continue
|
|
563
|
+
declared.add(name)
|
|
564
|
+
entries.push(`${name} => ${ssrDefaultEntryToPerl(ssrDefaults[name])}`)
|
|
565
|
+
}
|
|
551
566
|
return `{${entries.join(', ')}}`
|
|
552
567
|
}
|
|
553
568
|
|
|
@@ -758,6 +773,29 @@ function buildPerlProps(
|
|
|
758
773
|
}
|
|
759
774
|
}
|
|
760
775
|
|
|
776
|
+
// #2813: `extractSsrDefaults` can seed an entry under a name that is
|
|
777
|
+
// none of `propsParams` / the inherited-attribute scan / `signals` /
|
|
778
|
+
// `memos` above — a bare local-const alias of a signal/memo getter
|
|
779
|
+
// (`const items__alias = items`, `ssr-defaults.ts`) seeds `items__alias`
|
|
780
|
+
// alongside `items`. Production hands the whole manifest-derived stash
|
|
781
|
+
// straight through (`deriveStashFromDefaults` IS the production seeding
|
|
782
|
+
// mechanism here, not a harness stand-in), so any leftover
|
|
783
|
+
// `derivedProps` key must be pushed too, or this harness would silently
|
|
784
|
+
// omit what production actually provides, mismeasuring this
|
|
785
|
+
// conformance case — the same gap `buildChildDefaultsPerl` (above) was
|
|
786
|
+
// already fixed for child components.
|
|
787
|
+
const seededNames = new Set<string>([
|
|
788
|
+
...ir.metadata.propsParams.map(p => p.name),
|
|
789
|
+
...(ir.metadata.propsObjectName ? [...collectPropsObjectAccesses(ir, ir.metadata.propsObjectName)] : []),
|
|
790
|
+
...(restPropsName ? [restPropsName] : []),
|
|
791
|
+
...ir.metadata.signals.filter(s => !s.envReader).map(s => s.getter),
|
|
792
|
+
...ir.metadata.memos.map(m => m.name),
|
|
793
|
+
])
|
|
794
|
+
for (const [name, value] of Object.entries(derivedProps)) {
|
|
795
|
+
if (seededNames.has(name)) continue
|
|
796
|
+
entries.push(`${name} => ${toPerlLiteral(value)}`)
|
|
797
|
+
}
|
|
798
|
+
|
|
761
799
|
// (#1922) Request-scoped `searchParams()`: bind `$searchParams` to an
|
|
762
800
|
// empty-query reader via the lazy-loading factory (so the render script
|
|
763
801
|
// needn't `use BarefootJS::SearchParams`). The conformance harness issues no
|