@barefootjs/xslate 0.30.5 → 0.30.6
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 +4 -4
- package/dist/adapter/xslate-adapter.d.ts.map +1 -1
- package/dist/build.js +1 -1
- package/dist/index.js +3 -4
- package/dist/render-divergences.d.ts.map +1 -1
- package/lib/BarefootJS/Backend/Xslate.pm +1 -1
- package/package.json +3 -3
- package/src/adapter/xslate-adapter.ts +12 -5
- package/src/render-divergences.ts +13 -15
package/dist/adapter/index.js
CHANGED
|
@@ -188893,7 +188893,7 @@ ${name}="<: ${val} :>"
|
|
|
188893
188893
|
if (ternaryHashref !== null) {
|
|
188894
188894
|
return `<: $bf.spread_attrs(${ternaryHashref}) | mark_raw :>`;
|
|
188895
188895
|
}
|
|
188896
|
-
if (/^[A-Za-z_$][\w$]*$/.test(trimmed)) {
|
|
188896
|
+
if (/^[A-Za-z_$][\w$]*$/.test(trimmed) && !this.loopBoundNames.has(trimmed)) {
|
|
188897
188897
|
const localConst = (this.localConstants ?? []).find((c) => c.name === trimmed && !c.isModule);
|
|
188898
188898
|
if (localConst?.value !== undefined) {
|
|
188899
188899
|
const initTrimmed = localConst.value.trim();
|
|
@@ -122,10 +122,10 @@ export declare class XslateAdapter extends BaseAdapter implements IRNodeEmitter<
|
|
|
122
122
|
* `staticLoopSourceBoundNames` above: that set is a whole-component
|
|
123
123
|
* union used only to guard static-const inlining (safe to over-suppress
|
|
124
124
|
* there — the fallback is just "don't inline"), whereas the boolean-prop
|
|
125
|
-
* and nullable-optional classification sites
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
* the loop too
|
|
125
|
+
* and nullable-optional classification sites (#2488) and `emitSpread`'s
|
|
126
|
+
* local-const fallback (#2489) need to know whether a name is loop-bound
|
|
127
|
+
* AT THIS POSITION, because for those the coarse fallback would silently
|
|
128
|
+
* mis-render a genuine occurrence of the same name outside the loop too.
|
|
129
129
|
*/
|
|
130
130
|
private loopBoundNames;
|
|
131
131
|
/**
|
|
@@ -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,EACZ,aAAa,EACb,MAAM,EACN,WAAW,EACX,UAAU,EACV,MAAM,EACN,aAAa,EACb,UAAU,EACV,OAAO,EAKP,yBAAyB,EAG1B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAE3B,KAAK,aAAa,EAClB,KAAK,UAAU,EAgChB,MAAM,iBAAiB,CAAA;AAMxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AA6BrD,YAAY,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AA2C1D,qBAAa,aAAc,SAAQ,WAAY,YAAW,aAAa,CAAC,eAAe,CAAC;IACtF,IAAI,SAAW;IACf,SAAS,SAAQ;IACjB,qBAAqB,UAAO;IAG5B,kBAAkB,EAAG,cAAc,CAAS;IAE5C;;;;;OAKG;IACH,kBAAkB,EAAE,yBAAyB,CAA4B;IAEzE,OAAO,CAAC,aAAa,CAAa;IAClC;;;uCAGmC;IACnC,OAAO,CAAC,cAAc,CAAyB;IAC/C,OAAO,CAAC,OAAO,CAAgC;IAC/C,OAAO,CAAC,MAAM,CAAsB;IACpC,OAAO,CAAC,MAAM,CAAiB;IAC/B;;;;;;OAMG;IACH,OAAO,CAAC,mBAAmB,CAAI;IAC/B;;;;;OAKG;IACH,OAAO,CAAC,eAAe,CAAsB;IAC7C,OAAO,CAAC,WAAW,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;OAKG;IACH;;;;;OAKG;IACH;;;;OAIG;IACH,8BAA8B,CAC5B,IAAI,EAAE,MAAM,GACX;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAgBlD;IAED,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAW3C;IAED,kFAAkF;IAClF,OAAO,CAAC,eAAe;IAIvB;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,oBAAoB;IAW5B;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,2BAA2B;IASnC,OAAO,CAAC,yBAAyB;IASjC,OAAO,CAAC,gBAAgB;IAcxB,iFAAiF;IACjF,OAAO,CAAC,4BAA4B;CAGrC;AAED,eAAO,MAAM,aAAa,eAAsB,CAAA"}
|
package/dist/build.js
CHANGED
|
@@ -188893,7 +188893,7 @@ ${name}="<: ${val} :>"
|
|
|
188893
188893
|
if (ternaryHashref !== null) {
|
|
188894
188894
|
return `<: $bf.spread_attrs(${ternaryHashref}) | mark_raw :>`;
|
|
188895
188895
|
}
|
|
188896
|
-
if (/^[A-Za-z_$][\w$]*$/.test(trimmed)) {
|
|
188896
|
+
if (/^[A-Za-z_$][\w$]*$/.test(trimmed) && !this.loopBoundNames.has(trimmed)) {
|
|
188897
188897
|
const localConst = (this.localConstants ?? []).find((c) => c.name === trimmed && !c.isModule);
|
|
188898
188898
|
if (localConst?.value !== undefined) {
|
|
188899
188899
|
const initTrimmed = localConst.value.trim();
|
package/dist/index.js
CHANGED
|
@@ -188893,7 +188893,7 @@ ${name}="<: ${val} :>"
|
|
|
188893
188893
|
if (ternaryHashref !== null) {
|
|
188894
188894
|
return `<: $bf.spread_attrs(${ternaryHashref}) | mark_raw :>`;
|
|
188895
188895
|
}
|
|
188896
|
-
if (/^[A-Za-z_$][\w$]*$/.test(trimmed)) {
|
|
188896
|
+
if (/^[A-Za-z_$][\w$]*$/.test(trimmed) && !this.loopBoundNames.has(trimmed)) {
|
|
188897
188897
|
const localConst = (this.localConstants ?? []).find((c) => c.name === trimmed && !c.isModule);
|
|
188898
188898
|
if (localConst?.value !== undefined) {
|
|
188899
188899
|
const initTrimmed = localConst.value.trim();
|
|
@@ -189201,9 +189201,8 @@ var conformancePins = {
|
|
|
189201
189201
|
};
|
|
189202
189202
|
// src/render-divergences.ts
|
|
189203
189203
|
var renderDivergences = {
|
|
189204
|
-
"aliased-destructured-prop": "aliased destructured prop `{ n: count }` loses its rename — template vars, ssr-defaults, and the props bridge all key off the local name, so the prop is always undefined (https://github.com/piconic-ai/barefootjs/issues/
|
|
189205
|
-
"composite-row-child-aliased-prop": "same
|
|
189206
|
-
"loop-param-shadows-spread-const": "a .map() param shadowing an object const is resolved by `emitSpread` against `localConstants` with no loop-shadow check, so every row spreads the OUTER const instead of the row value (https://github.com/piconic-ai/barefootjs/issues/2489)"
|
|
189204
|
+
"aliased-destructured-prop": "aliased destructured prop `{ n: count }` loses its rename — template vars, ssr-defaults, and the props bridge all key off the local name, so the prop is always undefined (https://github.com/piconic-ai/barefootjs/issues/2524)",
|
|
189205
|
+
"composite-row-child-aliased-prop": "same defect as `aliased-destructured-prop` (#2524), inside a keyed `.map()` loop row: the nested child's renamed prop (`{ n: count }`) is always undefined, so both rows render an empty count (https://github.com/piconic-ai/barefootjs/issues/2524)"
|
|
189207
189206
|
};
|
|
189208
189207
|
export {
|
|
189209
189208
|
xslateAdapter,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-divergences.d.ts","sourceRoot":"","sources":["../src/render-divergences.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;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;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAExD,eAAO,MAAM,iBAAiB,EAAE,iBAsB/B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barefootjs/xslate",
|
|
3
|
-
"version": "0.30.
|
|
3
|
+
"version": "0.30.6",
|
|
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,14 +55,14 @@
|
|
|
55
55
|
"directory": "packages/adapter-xslate"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@barefootjs/shared": "0.30.
|
|
58
|
+
"@barefootjs/shared": "0.30.6"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"@barefootjs/jsx": ">=0.2.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@barefootjs/adapter-tests": "0.1.0",
|
|
65
|
-
"@barefootjs/jsx": "0.30.
|
|
65
|
+
"@barefootjs/jsx": "0.30.6",
|
|
66
66
|
"typescript": "^5.0.0"
|
|
67
67
|
}
|
|
68
68
|
}
|
|
@@ -267,10 +267,10 @@ export class XslateAdapter extends BaseAdapter implements IRNodeEmitter<XslateRe
|
|
|
267
267
|
* `staticLoopSourceBoundNames` above: that set is a whole-component
|
|
268
268
|
* union used only to guard static-const inlining (safe to over-suppress
|
|
269
269
|
* there — the fallback is just "don't inline"), whereas the boolean-prop
|
|
270
|
-
* and nullable-optional classification sites
|
|
271
|
-
*
|
|
272
|
-
*
|
|
273
|
-
* the loop too
|
|
270
|
+
* and nullable-optional classification sites (#2488) and `emitSpread`'s
|
|
271
|
+
* local-const fallback (#2489) need to know whether a name is loop-bound
|
|
272
|
+
* AT THIS POSITION, because for those the coarse fallback would silently
|
|
273
|
+
* mis-render a genuine occurrence of the same name outside the loop too.
|
|
274
274
|
*/
|
|
275
275
|
private loopBoundNames: Map<string, number> = new Map()
|
|
276
276
|
|
|
@@ -1412,7 +1412,14 @@ export class XslateAdapter extends BaseAdapter implements IRNodeEmitter<XslateRe
|
|
|
1412
1412
|
// and route through the same conditional-spread lowering. Only
|
|
1413
1413
|
// function-scope (`!isModule`) consts whose value is NOT itself a bare
|
|
1414
1414
|
// identifier (loop guard) are considered.
|
|
1415
|
-
|
|
1415
|
+
//
|
|
1416
|
+
// `loopBoundNames` guard (#2489): an enclosing `.map()` callback's own
|
|
1417
|
+
// param can shadow this outer const's name (`.map((attrs) => <p
|
|
1418
|
+
// {...attrs} />)`) — without the guard this forwarded the OUTER
|
|
1419
|
+
// const's value at every iteration instead of the per-item value.
|
|
1420
|
+
// Must be the LIVE map, not `staticLoopSourceBoundNames` — the same
|
|
1421
|
+
// name spread at ROOT must still resolve the const.
|
|
1422
|
+
if (/^[A-Za-z_$][\w$]*$/.test(trimmed) && !this.loopBoundNames.has(trimmed)) {
|
|
1416
1423
|
const localConst = (this.localConstants ?? []).find(
|
|
1417
1424
|
c => c.name === trimmed && !c.isModule,
|
|
1418
1425
|
)
|
|
@@ -20,22 +20,20 @@ export const renderDivergences: RenderDivergences = {
|
|
|
20
20
|
// instead of a fixed regex-shape catalogue) now correctly seeds `todos`
|
|
21
21
|
// from `(props.initialTodos ?? []).map(t => ({ ...t, editing: false }))`.
|
|
22
22
|
|
|
23
|
-
// Onboarding TSX-fidelity fixtures (PR #2461): `expectedHtml`
|
|
24
|
-
// hand-authored to the CORRECT output
|
|
23
|
+
// Onboarding TSX-fidelity fixtures (PR #2461): `expectedHtml` was
|
|
24
|
+
// hand-authored to the CORRECT output while the emission bug lived in
|
|
25
25
|
// the shared compiler layer — every adapter, including the Hono
|
|
26
|
-
// reference,
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
//
|
|
26
|
+
// reference, used to emit the broken form. That shared-layer defect
|
|
27
|
+
// (#2460) is now FIXED (b4f5075): `expectedHtml` is generated from the
|
|
28
|
+
// Hono reference like any other fixture. The remaining gap is
|
|
29
|
+
// per-template-adapter — this adapter still keys its template vars /
|
|
30
|
+
// ssr-defaults / props bridge off the local binding instead of
|
|
31
|
+
// `sourceName ?? name` — tracked by #2524 (the 7 silent template
|
|
32
|
+
// adapters). Graduate by applying the same `sourceName ?? name` fix to
|
|
33
|
+
// this adapter's emission path and deleting these lines (and the
|
|
34
|
+
// matching hono `skipJsx` entries, already gone).
|
|
31
35
|
'aliased-destructured-prop':
|
|
32
|
-
'aliased destructured prop `{ n: count }` loses its rename — template vars, ssr-defaults, and the props bridge all key off the local name, so the prop is always undefined (https://github.com/piconic-ai/barefootjs/issues/
|
|
36
|
+
'aliased destructured prop `{ n: count }` loses its rename — template vars, ssr-defaults, and the props bridge all key off the local name, so the prop is always undefined (https://github.com/piconic-ai/barefootjs/issues/2524)',
|
|
33
37
|
'composite-row-child-aliased-prop':
|
|
34
|
-
'same
|
|
35
|
-
|
|
36
|
-
// #2482 audit follow-ups: loop-scope holes in per-adapter name
|
|
37
|
-
// classification. Graduate by applying the loop-bound-name guards
|
|
38
|
-
// described in each issue and deleting the line.
|
|
39
|
-
'loop-param-shadows-spread-const':
|
|
40
|
-
'a .map() param shadowing an object const is resolved by `emitSpread` against `localConstants` with no loop-shadow check, so every row spreads the OUTER const instead of the row value (https://github.com/piconic-ai/barefootjs/issues/2489)',
|
|
38
|
+
'same defect as `aliased-destructured-prop` (#2524), inside a keyed `.map()` loop row: the nested child\'s renamed prop (`{ n: count }`) is always undefined, so both rows render an empty count (https://github.com/piconic-ai/barefootjs/issues/2524)',
|
|
41
39
|
}
|