@barefootjs/erb 0.18.1 → 0.18.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"conformance-pins.d.ts","sourceRoot":"","sources":["../src/conformance-pins.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD,eAAO,MAAM,eAAe,EAAE,eAsF7B,CAAA"}
1
+ {"version":3,"file":"conformance-pins.d.ts","sourceRoot":"","sources":["../src/conformance-pins.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD,eAAO,MAAM,eAAe,EAAE,eAiG7B,CAAA"}
package/dist/index.d.ts CHANGED
@@ -6,4 +6,5 @@
6
6
  export { ErbAdapter, erbAdapter } from './adapter/index.ts';
7
7
  export type { ErbAdapterOptions } 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
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC3D,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,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,UAAU,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC3D,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA"}
package/dist/index.js CHANGED
@@ -189163,9 +189163,27 @@ var conformancePins = {
189163
189163
  "filter-nested-find-predicate": [
189164
189164
  { code: "BF101", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2038" }
189165
189165
  ],
189166
- "array-map-function-reference": [{ code: "BF101", severity: "error" }]
189166
+ "array-map-function-reference": [{ code: "BF101", severity: "error" }],
189167
+ "dangerous-inner-html": [{ code: "BF101", severity: "error" }],
189168
+ "string-replaceall": [{ code: "BF101", severity: "error" }]
189169
+ };
189170
+ // src/render-divergences.ts
189171
+ var renderDivergences = {
189172
+ "html-entity-text": "`©` in JSX literal text: Hono decodes to `©`, this adapter re-emits the raw entity — same DOM, different bytes",
189173
+ "optional-chaining-prop": "`user?.name ?? …` on an object prop: the Ruby render exits 1 (optional chaining into a Hash prop has no lowering)",
189174
+ "math-methods": "Math.min/max/abs over a signal render empty (only Math.floor is in the template-primitive registry)",
189175
+ "boolean-attr-literals": 'camelCase boolean alias `readOnly`: Hono SSRs `readOnly="true"`, this adapter emits bare presence',
189176
+ "camelcase-attributes": "`htmlFor` is not lowered to `for` (Hono maps it)",
189177
+ "static-attr-escape": 'static attribute values are not HTML-escaped (`title="Fish & Chips"` emitted raw; Hono escapes)',
189178
+ "svg-icon": "SVG camelCase presentation attrs (`strokeWidth`, `strokeLinecap`) pass through unmapped; Hono lowers to kebab-case",
189179
+ "object-entries-map": "`Object.entries(prop).map(([k, v]) => …)` renders but its loop item keys diverge from the reference serialisation",
189180
+ "nested-loop-outer-binding": "nested-loop inner items carry `data-key` where the reference emits the depth-suffixed `data-key-1`",
189181
+ "jsx-element-prop": "a JSX element passed as a NON-children prop renders an empty slot — the element value is silently dropped",
189182
+ "string-slice": '`.slice()` on a STRING lowers through the array slice helper and renders "[]" instead of the substring',
189183
+ "string-trim-sided": "`.trimStart()` / `.trimEnd()` render empty (no lowering; only both-sides `.trim` is wired)"
189167
189184
  };
189168
189185
  export {
189186
+ renderDivergences,
189169
189187
  erbAdapter,
189170
189188
  conformancePins,
189171
189189
  ErbAdapter
@@ -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 Ruby erb (or fails at render time).
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,iBAyB/B,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barefootjs/erb",
3
- "version": "0.18.1",
3
+ "version": "0.18.3",
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,14 +54,14 @@
54
54
  "directory": "packages/adapter-erb"
55
55
  },
56
56
  "dependencies": {
57
- "@barefootjs/shared": "0.18.1"
57
+ "@barefootjs/shared": "0.18.3"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "@barefootjs/jsx": ">=0.2.0"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@barefootjs/adapter-tests": "0.1.0",
64
- "@barefootjs/jsx": "0.18.1",
64
+ "@barefootjs/jsx": "0.18.3",
65
65
  "typescript": "^5.0.0"
66
66
  }
67
67
  }
@@ -26,11 +26,19 @@ import { ErbAdapter } from '../adapter'
26
26
  import { renderErbComponent, ErbNotAvailableError } from '../test-render'
27
27
  import { compileJSX, type ComponentIR } from '@barefootjs/jsx'
28
28
  import { conformancePins } from '../conformance-pins'
29
+ import { renderDivergences } from '../render-divergences'
29
30
 
30
31
  runAdapterConformanceTests({
31
32
  name: 'erb',
32
33
  factory: () => new ErbAdapter(),
33
34
  render: renderErbComponent,
35
+ // Priority-12 edge-case sweep (炙り出し, #2168): render-level
36
+ // divergences are declared in `../render-divergences` (exported from the
37
+ // package index and published to `ui/compat.lock.json` / the docs
38
+ // compatibility-matrix page by `packages/compat`). Deriving the skip
39
+ // list from that object keeps the public declaration and these test
40
+ // skips from drifting; each entry's rationale lives there.
41
+ skipJsx: Object.keys(renderDivergences),
34
42
  // No JSX-render skips: every shared conformance fixture — including
35
43
  // the composed `site/ui` demo corpus (#1467 / #1897) — renders to
36
44
  // Hono parity on real Ruby `erb`. `data-table` came off via the
@@ -97,4 +97,15 @@ export const conformancePins: ConformancePins = {
97
97
  // with BF101 rather than emitting a broken template. Same pin as
98
98
  // mojo/xslate.
99
99
  'array-map-function-reference': [{ code: 'BF101', severity: 'error' }],
100
+ // Edge-case sweep (Priority 12): `dangerouslySetInnerHTML` requires a
101
+ // deliberate raw-HTML (unescaped) output affordance in the target
102
+ // template language. No lowering exists yet, so the compiler refuses
103
+ // the shape loudly instead of emitting entity-escaped markup that
104
+ // silently renders tags as text.
105
+ 'dangerous-inner-html': [{ code: 'BF101', severity: 'error' }],
106
+ // Edge-case sweep (Priority 12): `.replaceAll` has no lowering yet —
107
+ // only first-occurrence `.replace` is wired to the runtime helpers.
108
+ // Refused with BF101 rather than reusing the first-only lowering,
109
+ // which would silently change semantics.
110
+ 'string-replaceall': [{ code: 'BF101', severity: 'error' }],
100
111
  }
package/src/index.ts CHANGED
@@ -7,3 +7,4 @@
7
7
  export { ErbAdapter, erbAdapter } from './adapter/index.ts'
8
8
  export type { ErbAdapterOptions } from './adapter/index.ts'
9
9
  export { conformancePins } from './conformance-pins.ts'
10
+ export { renderDivergences } from './render-divergences.ts'
@@ -0,0 +1,42 @@
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 Ruby erb (or fails at render time).
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
+ 'html-entity-text':
19
+ '`©` in JSX literal text: Hono decodes to `©`, this adapter re-emits the raw entity — same DOM, different bytes',
20
+ 'optional-chaining-prop':
21
+ '`user?.name ?? …` on an object prop: the Ruby render exits 1 (optional chaining into a Hash prop has no lowering)',
22
+ 'math-methods':
23
+ 'Math.min/max/abs over a signal render empty (only Math.floor is in the template-primitive registry)',
24
+ 'boolean-attr-literals':
25
+ 'camelCase boolean alias `readOnly`: Hono SSRs `readOnly="true"`, this adapter emits bare presence',
26
+ 'camelcase-attributes':
27
+ '`htmlFor` is not lowered to `for` (Hono maps it)',
28
+ 'static-attr-escape':
29
+ 'static attribute values are not HTML-escaped (`title="Fish & Chips"` emitted raw; Hono escapes)',
30
+ 'svg-icon':
31
+ 'SVG camelCase presentation attrs (`strokeWidth`, `strokeLinecap`) pass through unmapped; Hono lowers to kebab-case',
32
+ 'object-entries-map':
33
+ '`Object.entries(prop).map(([k, v]) => …)` renders but its loop item keys diverge from the reference serialisation',
34
+ 'nested-loop-outer-binding':
35
+ 'nested-loop inner items carry `data-key` where the reference emits the depth-suffixed `data-key-1`',
36
+ 'jsx-element-prop':
37
+ 'a JSX element passed as a NON-children prop renders an empty slot — the element value is silently dropped',
38
+ 'string-slice':
39
+ '`.slice()` on a STRING lowers through the array slice helper and renders "[]" instead of the substring',
40
+ 'string-trim-sided':
41
+ '`.trimStart()` / `.trimEnd()` render empty (no lowering; only both-sides `.trim` is wired)',
42
+ }