@barefootjs/xslate 0.18.1 → 0.18.2
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/conformance-pins.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -1
- package/dist/render-divergences.d.ts +16 -0
- package/dist/render-divergences.d.ts.map +1 -0
- package/lib/BarefootJS/Backend/Xslate.pm +1 -1
- package/package.json +3 -3
- package/src/__tests__/xslate-adapter.test.ts +9 -1
- package/src/conformance-pins.ts +11 -0
- package/src/index.ts +1 -0
- package/src/render-divergences.ts +46 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conformance-pins.d.ts","sourceRoot":"","sources":["../src/conformance-pins.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;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;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD,eAAO,MAAM,eAAe,EAAE,eAgH7B,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,4 +6,5 @@
|
|
|
6
6
|
export { XslateAdapter, xslateAdapter } from './adapter/index.ts';
|
|
7
7
|
export type { XslateAdapterOptions } from './adapter/index.ts';
|
|
8
8
|
export { conformancePins } from './conformance-pins.ts';
|
|
9
|
+
export { renderDivergences } from './render-divergences.ts';
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACjE,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACjE,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -189027,10 +189027,30 @@ var conformancePins = {
|
|
|
189027
189027
|
"filter-nested-find-predicate": [
|
|
189028
189028
|
{ code: "BF101", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2038" }
|
|
189029
189029
|
],
|
|
189030
|
-
"array-map-function-reference": [{ code: "BF101", severity: "error" }]
|
|
189030
|
+
"array-map-function-reference": [{ code: "BF101", severity: "error" }],
|
|
189031
|
+
"dangerous-inner-html": [{ code: "BF101", severity: "error" }],
|
|
189032
|
+
"string-replaceall": [{ code: "BF101", severity: "error" }]
|
|
189033
|
+
};
|
|
189034
|
+
// src/render-divergences.ts
|
|
189035
|
+
var renderDivergences = {
|
|
189036
|
+
"arithmetic-text": "`(count() + 2) * 3` renders 10 instead of 18 — the parenthesised sub-expression loses its grouping (silent wrong arithmetic)",
|
|
189037
|
+
"string-concat-plus": "`'Hello, ' + name` numeric-coerces through Perl's `+` (needs `.`/`~` concat)",
|
|
189038
|
+
"falsy-text-values": '`{false}` renders "false" (Hono drops it); `{null}`/`{undefined}` render empty (Hono renders "null") — neither side matches JSX semantics',
|
|
189039
|
+
"html-entity-text": "`©` in JSX literal text: Hono decodes to `©`, this adapter re-emits the raw entity — same DOM, different bytes",
|
|
189040
|
+
"math-methods": "Math.min/max/abs over a signal render empty (only Math.floor is in the template-primitive registry)",
|
|
189041
|
+
"boolean-attr-literals": 'camelCase boolean alias `readOnly`: Hono SSRs `readOnly="true"`, this adapter emits bare presence',
|
|
189042
|
+
"camelcase-attributes": "`htmlFor` is not lowered to `for` (Hono maps it)",
|
|
189043
|
+
"static-attr-escape": 'static attribute values are not HTML-escaped (`title="Fish & Chips"` emitted raw; Hono escapes)',
|
|
189044
|
+
"svg-icon": "SVG camelCase presentation attrs (`strokeWidth`, `strokeLinecap`) pass through unmapped; Hono lowers to kebab-case",
|
|
189045
|
+
"object-entries-map": "`Object.entries(prop).map(([k, v]) => …)` renders an EMPTY list — the object-shaped prop silently produces zero iterations",
|
|
189046
|
+
"nested-loop-outer-binding": "nested-loop inner items carry `data-key` where the reference emits the depth-suffixed `data-key-1`",
|
|
189047
|
+
"jsx-element-prop": "a JSX element passed as a NON-children prop renders an empty slot — the element value is silently dropped",
|
|
189048
|
+
"string-slice": "`.slice()` on a STRING misfires through the array slice helper",
|
|
189049
|
+
"string-trim-sided": "`.trimStart()` / `.trimEnd()` render empty (no lowering)"
|
|
189031
189050
|
};
|
|
189032
189051
|
export {
|
|
189033
189052
|
xslateAdapter,
|
|
189053
|
+
renderDivergences,
|
|
189034
189054
|
conformancePins,
|
|
189035
189055
|
XslateAdapter
|
|
189036
189056
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Render-level divergences against the shared conformance corpus
|
|
3
|
+
* (Priority-12 edge-case sweep, #2168): fixtures that COMPILE clean on
|
|
4
|
+
* this adapter but whose rendered output diverges from the Hono
|
|
5
|
+
* reference on real Text::Xslate.
|
|
6
|
+
*
|
|
7
|
+
* Consumed by this package's conformance test (its `skipJsx` set is
|
|
8
|
+
* derived from these keys, so the skip list and this declaration can't
|
|
9
|
+
* drift) and by `packages/compat`, which publishes the entries in the
|
|
10
|
+
* fixture-divergences section of `ui/compat.lock.json` — surfaced on
|
|
11
|
+
* the docs compatibility-matrix page. Graduating an entry means fixing
|
|
12
|
+
* the adapter (or the shared compiler layer) and deleting the line.
|
|
13
|
+
*/
|
|
14
|
+
import type { RenderDivergences } from '@barefootjs/jsx';
|
|
15
|
+
export declare const renderDivergences: RenderDivergences;
|
|
16
|
+
//# sourceMappingURL=render-divergences.d.ts.map
|
|
@@ -0,0 +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,iBA6B/B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barefootjs/xslate",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.2",
|
|
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.18.
|
|
58
|
+
"@barefootjs/shared": "0.18.2"
|
|
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.18.
|
|
65
|
+
"@barefootjs/jsx": "0.18.2",
|
|
66
66
|
"typescript": "^5.0.0"
|
|
67
67
|
}
|
|
68
68
|
}
|
|
@@ -18,12 +18,20 @@ import { XslateAdapter } from '../adapter'
|
|
|
18
18
|
import { renderXslateComponent, XslateNotAvailableError } from '../test-render'
|
|
19
19
|
import { compileJSX, type ComponentIR } from '@barefootjs/jsx'
|
|
20
20
|
import { conformancePins } from '../conformance-pins'
|
|
21
|
+
import { renderDivergences } from '../render-divergences'
|
|
21
22
|
|
|
22
23
|
runAdapterConformanceTests({
|
|
23
24
|
name: 'xslate',
|
|
24
25
|
factory: () => new XslateAdapter(),
|
|
25
26
|
render: renderXslateComponent,
|
|
26
|
-
//
|
|
27
|
+
// Priority-12 edge-case sweep (炙り出し, #2168): render-level
|
|
28
|
+
// divergences are declared in `../render-divergences` (exported from the
|
|
29
|
+
// package index and published to `ui/compat.lock.json` / the docs
|
|
30
|
+
// compatibility-matrix page by `packages/compat`). Deriving the skip
|
|
31
|
+
// list from that object keeps the public declaration and these test
|
|
32
|
+
// skips from drifting; each entry's rationale lives there.
|
|
33
|
+
skipJsx: Object.keys(renderDivergences),
|
|
34
|
+
// (Pre-sweep note) Otherwise no JSX-render skips: every shared conformance fixture — including
|
|
27
35
|
// the composed `site/ui` demo corpus (#1467 / #1897) — renders to
|
|
28
36
|
// Hono parity on real Text::Xslate. `data-table` came off via the
|
|
29
37
|
// body-children `inLoop` reset (#1896): the loop-item component
|
package/src/conformance-pins.ts
CHANGED
|
@@ -109,4 +109,15 @@ export const conformancePins: ConformancePins = {
|
|
|
109
109
|
// UNSUPPORTED_METHODS gate refuses it with BF101 rather than emitting
|
|
110
110
|
// a broken template.
|
|
111
111
|
'array-map-function-reference': [{ code: 'BF101', severity: 'error' }],
|
|
112
|
+
// Edge-case sweep (Priority 12): `dangerouslySetInnerHTML` requires a
|
|
113
|
+
// deliberate raw-HTML (unescaped) output affordance in the target
|
|
114
|
+
// template language. No lowering exists yet, so the compiler refuses
|
|
115
|
+
// the shape loudly instead of emitting entity-escaped markup that
|
|
116
|
+
// silently renders tags as text.
|
|
117
|
+
'dangerous-inner-html': [{ code: 'BF101', severity: 'error' }],
|
|
118
|
+
// Edge-case sweep (Priority 12): `.replaceAll` has no lowering yet —
|
|
119
|
+
// only first-occurrence `.replace` is wired to the runtime helpers.
|
|
120
|
+
// Refused with BF101 rather than reusing the first-only lowering,
|
|
121
|
+
// which would silently change semantics.
|
|
122
|
+
'string-replaceall': [{ code: 'BF101', severity: 'error' }],
|
|
112
123
|
}
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Render-level divergences against the shared conformance corpus
|
|
3
|
+
* (Priority-12 edge-case sweep, #2168): fixtures that COMPILE clean on
|
|
4
|
+
* this adapter but whose rendered output diverges from the Hono
|
|
5
|
+
* reference on real Text::Xslate.
|
|
6
|
+
*
|
|
7
|
+
* Consumed by this package's conformance test (its `skipJsx` set is
|
|
8
|
+
* derived from these keys, so the skip list and this declaration can't
|
|
9
|
+
* drift) and by `packages/compat`, which publishes the entries in the
|
|
10
|
+
* fixture-divergences section of `ui/compat.lock.json` — surfaced on
|
|
11
|
+
* the docs compatibility-matrix page. Graduating an entry means fixing
|
|
12
|
+
* the adapter (or the shared compiler layer) and deleting the line.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import type { RenderDivergences } from '@barefootjs/jsx'
|
|
16
|
+
|
|
17
|
+
export const renderDivergences: RenderDivergences = {
|
|
18
|
+
'arithmetic-text':
|
|
19
|
+
'`(count() + 2) * 3` renders 10 instead of 18 — the parenthesised sub-expression loses its grouping (silent wrong arithmetic)',
|
|
20
|
+
'string-concat-plus':
|
|
21
|
+
"`'Hello, ' + name` numeric-coerces through Perl's `+` (needs `.`/`~` concat)",
|
|
22
|
+
'falsy-text-values':
|
|
23
|
+
'`{false}` renders "false" (Hono drops it); `{null}`/`{undefined}` render empty (Hono renders "null") — neither side matches JSX semantics',
|
|
24
|
+
'html-entity-text':
|
|
25
|
+
'`©` in JSX literal text: Hono decodes to `©`, this adapter re-emits the raw entity — same DOM, different bytes',
|
|
26
|
+
'math-methods':
|
|
27
|
+
'Math.min/max/abs over a signal render empty (only Math.floor is in the template-primitive registry)',
|
|
28
|
+
'boolean-attr-literals':
|
|
29
|
+
'camelCase boolean alias `readOnly`: Hono SSRs `readOnly="true"`, this adapter emits bare presence',
|
|
30
|
+
'camelcase-attributes':
|
|
31
|
+
'`htmlFor` is not lowered to `for` (Hono maps it)',
|
|
32
|
+
'static-attr-escape':
|
|
33
|
+
'static attribute values are not HTML-escaped (`title="Fish & Chips"` emitted raw; Hono escapes)',
|
|
34
|
+
'svg-icon':
|
|
35
|
+
'SVG camelCase presentation attrs (`strokeWidth`, `strokeLinecap`) pass through unmapped; Hono lowers to kebab-case',
|
|
36
|
+
'object-entries-map':
|
|
37
|
+
'`Object.entries(prop).map(([k, v]) => …)` renders an EMPTY list — the object-shaped prop silently produces zero iterations',
|
|
38
|
+
'nested-loop-outer-binding':
|
|
39
|
+
'nested-loop inner items carry `data-key` where the reference emits the depth-suffixed `data-key-1`',
|
|
40
|
+
'jsx-element-prop':
|
|
41
|
+
'a JSX element passed as a NON-children prop renders an empty slot — the element value is silently dropped',
|
|
42
|
+
'string-slice':
|
|
43
|
+
'`.slice()` on a STRING misfires through the array slice helper',
|
|
44
|
+
'string-trim-sided':
|
|
45
|
+
'`.trimStart()` / `.trimEnd()` render empty (no lowering)',
|
|
46
|
+
}
|