@barefootjs/erb 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/erb-adapter.d.ts.map +1 -1
- package/dist/adapter/index.js +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/barefoot_js.rb +16 -0
- package/package.json +5 -5
- package/src/adapter/erb-adapter.ts +4 -3
- package/src/conformance-pins.ts +13 -7
- package/src/render-divergences.ts +1 -4
- package/src/test-render.ts +14 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"erb-adapter.d.ts","sourceRoot":"","sources":["../../src/adapter/erb-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,KAAK,EACV,WAAW,EAEX,MAAM,EACN,SAAS,EACT,MAAM,EACN,YAAY,EACZ,aAAa,EACb,MAAM,EACN,WAAW,EACX,UAAU,EACV,MAAM,EACN,aAAa,EACb,UAAU,EACV,OAAO,EAMP,yBAAyB,EAC1B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAE3B,KAAK,aAAa,EAClB,KAAK,UAAU,EAgChB,MAAM,iBAAiB,CAAA;AAExB,OAAO,KAAK,EAAE,UAAU,EAAuD,MAAM,iBAAiB,CAAA;AAGtG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAgClD,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAoBvD,qBAAa,UAAW,SAAQ,WAAY,YAAW,aAAa,CAAC,YAAY,CAAC;IAChF,IAAI,SAAQ;IACZ,SAAS,SAAS;IAClB,q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MAAM,CAgB1C;IAMD;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAyKlC;IAED;;;OAGG;IACH,OAAO,CAAC,kBAAkB,CAAI;IAE9B;;;;;;OAMG;IACH,OAAO,CAAC,mBAAmB;IA0B3B,8EAA8E;IAC9E,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,gBAAgB;IAqCxB,iBAAiB,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAMjD;IAED,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEvC;IAED,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEvC;IAMD;;;;;OAKG;IACH,OAAO,CAAC,oBAAoB;IA8B5B,OAAO,CAAC,iCAAiC;IAkCzC;;;;;;;OAOG;IACH,OAAO,CAAC,gCAAgC;IAmBxC;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,+BAA+B;IAuBvC;;;;;;;OAOG;IACH,OAAO,KAAK,OAAO,GAYlB;IAED;;;;OAIG;IACH,OAAO,KAAK,SAAS,GAQpB;IAED,sEAAsE;IACtE,OAAO,KAAK,OAAO,GAElB;IAED,OAAO,CAAC,uBAAuB;IAyD/B;;;;OAIG;IACH,OAAO,CAAC,sBAAsB;IAI9B;uEACmE;IACnE,OAAO,CAAC,kBAAkB;IAI1B;;;;;;;;OAQG;IACH,OAAO,CAAC,gBAAgB;IAexB,iFAAiF;IACjF,OAAO,CAAC,2BAA2B;CAGpC;AAED,eAAO,MAAM,UAAU,YAAmB,CAAA"}
|
package/dist/adapter/index.js
CHANGED
|
@@ -188788,7 +188788,7 @@ ${whenTrue}
|
|
|
188788
188788
|
const prevScope = this.scope;
|
|
188789
188789
|
this.scope = prevScope.enterLoopRow(loop);
|
|
188790
188790
|
const renderedChildren = this.renderChildren(loop.children);
|
|
188791
|
-
const children = loop.bodyIsItemConditional && loop.key ? `<%= bf.comment("loop-i:" + bf.
|
|
188791
|
+
const children = loop.bodyIsItemConditional && loop.key ? `<%= bf.comment("loop-i:" + bf.escape_comment_key(${this.convertExpressionToRuby(loop.key)})) %>
|
|
188792
188792
|
${renderedChildren}` : renderedChildren;
|
|
188793
188793
|
const lines = [];
|
|
188794
188794
|
lines.push(`<%= bf.comment("loop:${loop.markerId}") %>`);
|
|
@@ -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,eAgE7B,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -188788,7 +188788,7 @@ ${whenTrue}
|
|
|
188788
188788
|
const prevScope = this.scope;
|
|
188789
188789
|
this.scope = prevScope.enterLoopRow(loop);
|
|
188790
188790
|
const renderedChildren = this.renderChildren(loop.children);
|
|
188791
|
-
const children = loop.bodyIsItemConditional && loop.key ? `<%= bf.comment("loop-i:" + bf.
|
|
188791
|
+
const children = loop.bodyIsItemConditional && loop.key ? `<%= bf.comment("loop-i:" + bf.escape_comment_key(${this.convertExpressionToRuby(loop.key)})) %>
|
|
188792
188792
|
${renderedChildren}` : renderedChildren;
|
|
188793
188793
|
const lines = [];
|
|
188794
188794
|
lines.push(`<%= bf.comment("loop:${loop.markerId}") %>`);
|
|
@@ -189257,14 +189257,12 @@ var conformancePins = {
|
|
|
189257
189257
|
"filter-nested-find-predicate": [{ code: "BF101", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2320" }],
|
|
189258
189258
|
"date-method-uncatalogued": [{ code: "BF021", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2356" }],
|
|
189259
189259
|
"rich-prop-client-read": [{ code: "BF049", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2648" }],
|
|
189260
|
-
"jsx-element-prop-ternary": [{ code: "BF021", severity: "error"
|
|
189261
|
-
"jsx-element-prop-array": [{ code: "BF021", severity: "error"
|
|
189262
|
-
"namespace-import-primitive": [{ code: "BF013", severity: "error"
|
|
189260
|
+
"jsx-element-prop-ternary": [{ code: "BF021", severity: "error" }],
|
|
189261
|
+
"jsx-element-prop-array": [{ code: "BF021", severity: "error" }],
|
|
189262
|
+
"namespace-import-primitive": [{ code: "BF013", severity: "error" }]
|
|
189263
189263
|
};
|
|
189264
189264
|
// src/render-divergences.ts
|
|
189265
|
-
var renderDivergences = {
|
|
189266
|
-
"aliased-loop-source": "A `.map()` loop whose source is a local const alias of a signal getter (`const items__alias = items`) throws `undefined method 'length' for nil (NoMethodError)` on real Ruby ERB — 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."
|
|
189267
|
-
};
|
|
189265
|
+
var renderDivergences = {};
|
|
189268
189266
|
export {
|
|
189269
189267
|
renderDivergences,
|
|
189270
189268
|
erbAdapter,
|
|
@@ -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;AAQxD,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;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;
|
|
@@ -6662,7 +6670,7 @@ ${whenTrue}
|
|
|
6662
6670
|
const prevScope = this.scope;
|
|
6663
6671
|
this.scope = prevScope.enterLoopRow(loop);
|
|
6664
6672
|
const renderedChildren = this.renderChildren(loop.children);
|
|
6665
|
-
const children = loop.bodyIsItemConditional && loop.key ? `<%= bf.comment("loop-i:" + bf.
|
|
6673
|
+
const children = loop.bodyIsItemConditional && loop.key ? `<%= bf.comment("loop-i:" + bf.escape_comment_key(${this.convertExpressionToRuby(loop.key)})) %>
|
|
6666
6674
|
${renderedChildren}` : renderedChildren;
|
|
6667
6675
|
const lines = [];
|
|
6668
6676
|
lines.push(`<%= bf.comment("loop:${loop.markerId}") %>`);
|
package/lib/barefoot_js.rb
CHANGED
|
@@ -184,6 +184,22 @@ module BarefootJS
|
|
|
184
184
|
"<!--bf-#{text}-->"
|
|
185
185
|
end
|
|
186
186
|
|
|
187
|
+
# Neutralize a value for splicing into `comment`'s HTML comment content
|
|
188
|
+
# (#2795 follow-up). `comment` itself does no escaping -- fine for every
|
|
189
|
+
# other caller (marker IDs like "cond-start:s0", "loop:l0", ...), which
|
|
190
|
+
# are entirely compiler-generated, but the whole-item-conditional loop's
|
|
191
|
+
# "loop-i:<key>" anchor carries a user-controlled key. Standard HTML
|
|
192
|
+
# escaping doesn't help inside a comment -- only the literal sequence
|
|
193
|
+
# "-->" terminates it early, and &/</>/"/' are not special there. The
|
|
194
|
+
# key's exact text doesn't need to round-trip (the client's
|
|
195
|
+
# mapArrayAnchored matches items positionally and by its own
|
|
196
|
+
# JS-computed key, never by re-parsing the anchor Comment.nodeValue), so
|
|
197
|
+
# replacing every "-" with the visually-similar U+2010 is sufficient and
|
|
198
|
+
# needs no decoding.
|
|
199
|
+
def escape_comment_key(value)
|
|
200
|
+
string(value).gsub('-', '‐')
|
|
201
|
+
end
|
|
202
|
+
|
|
187
203
|
# Map a JS-boolean-shaped value to the JS `String(bool)` form. See
|
|
188
204
|
# BarefootJS.pm's `bool_str` docstring for the boolean-only contract --
|
|
189
205
|
# callers must have already classified the expression as boolean-
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barefootjs/erb",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.1",
|
|
4
4
|
"description": "ERB (Embedded Ruby) adapter for BarefootJS — compiles IR to .erb templates and ships the Ruby rendering backend; runs under any Rack app (Sinatra, Rails)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"directory": "packages/adapter-erb"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@barefootjs/shared": "0.
|
|
57
|
+
"@barefootjs/shared": "0.35.1"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"@barefootjs/jsx": ">=0.2.0",
|
|
@@ -71,9 +71,9 @@
|
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@barefootjs/adapter-tests": "0.1.0",
|
|
74
|
-
"@barefootjs/jsx": "0.
|
|
75
|
-
"@barefootjs/vite": "0.
|
|
76
|
-
"@barefootjs/client": "0.
|
|
74
|
+
"@barefootjs/jsx": "0.35.1",
|
|
75
|
+
"@barefootjs/vite": "0.35.1",
|
|
76
|
+
"@barefootjs/client": "0.35.1",
|
|
77
77
|
"typescript": "^5.0.0",
|
|
78
78
|
"vite": "^6.0.0"
|
|
79
79
|
}
|
|
@@ -1037,11 +1037,12 @@ export class ErbAdapter extends BaseAdapter implements IRNodeEmitter<ErbRenderCt
|
|
|
1037
1037
|
// `<!--bf-loop-i:KEY-->` anchor before each item's (possibly empty)
|
|
1038
1038
|
// conditional content so the client's `mapArrayAnchored` can hydrate
|
|
1039
1039
|
// every SSR-rendered item by its anchor. `bf.comment` prepends `bf-`,
|
|
1040
|
-
// so `"loop-i:" + KEY` yields `<!--bf-loop-i:KEY-->`. `bf.
|
|
1041
|
-
//
|
|
1040
|
+
// so `"loop-i:" + KEY` yields `<!--bf-loop-i:KEY-->`. `bf.escape_comment_key`
|
|
1041
|
+
// (#2795 follow-up) both stringifies KEY and neutralizes `-` so it can't
|
|
1042
|
+
// spell `-->` and close the comment early — see its doc in `barefoot_js.rb`.
|
|
1042
1043
|
const children =
|
|
1043
1044
|
loop.bodyIsItemConditional && loop.key
|
|
1044
|
-
? `<%= bf.comment("loop-i:" + bf.
|
|
1045
|
+
? `<%= bf.comment("loop-i:" + bf.escape_comment_key(${this.convertExpressionToRuby(loop.key)})) %>\n${renderedChildren}`
|
|
1045
1046
|
: renderedChildren
|
|
1046
1047
|
|
|
1047
1048
|
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,7 +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
|
-
export const renderDivergences: RenderDivergences = {
|
|
19
|
-
'aliased-loop-source':
|
|
20
|
-
'A `.map()` loop whose source is a local const alias of a signal getter (`const items__alias = items`) throws `undefined method \'length\' for nil (NoMethodError)` on real Ruby ERB — 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.',
|
|
21
|
-
}
|
|
18
|
+
export const renderDivergences: RenderDivergences = {}
|
package/src/test-render.ts
CHANGED
|
@@ -618,6 +618,20 @@ function buildRubyProps(
|
|
|
618
618
|
}
|
|
619
619
|
}
|
|
620
620
|
|
|
621
|
+
// #2813: `extractSsrDefaults` can seed an entry under a name that is
|
|
622
|
+
// none of `propsParams` / `signals` / `memos` above — a bare local-const
|
|
623
|
+
// alias of a signal/memo getter (`const items__alias = items`,
|
|
624
|
+
// `ssr-defaults.ts`) seeds `items__alias` alongside `items`. Production
|
|
625
|
+
// hands the whole manifest-derived stash straight through
|
|
626
|
+
// (`deriveStashFromDefaults` IS the production seeding mechanism here,
|
|
627
|
+
// not a harness stand-in), so any leftover `derivedProps` key must be
|
|
628
|
+
// copied into `obj` too, or this harness would silently omit what
|
|
629
|
+
// production actually provides, mismeasuring this conformance case.
|
|
630
|
+
for (const [name, value] of Object.entries(derivedProps)) {
|
|
631
|
+
if (Object.prototype.hasOwnProperty.call(obj, name)) continue
|
|
632
|
+
obj[name] = value
|
|
633
|
+
}
|
|
634
|
+
|
|
621
635
|
const needsSearchParams = importsSearchParams(ir.metadata)
|
|
622
636
|
|
|
623
637
|
return { obj, needsSearchParams, userProps }
|