@barefootjs/mojolicious 0.18.0 → 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.
@@ -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,eA+H7B,CAAA"}
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,eA0I7B,CAAA"}
package/dist/index.d.ts CHANGED
@@ -6,4 +6,5 @@
6
6
  export { MojoAdapter, mojoAdapter } from './adapter/index.ts';
7
7
  export type { MojoAdapterOptions } 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,WAAW,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAC7D,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAC5D,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,WAAW,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAC7D,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA"}
package/dist/index.js CHANGED
@@ -1800,9 +1800,31 @@ var conformancePins = {
1800
1800
  "filter-nested-find-predicate": [
1801
1801
  { code: "BF101", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2038" }
1802
1802
  ],
1803
- "array-map-function-reference": [{ code: "BF101", severity: "error" }]
1803
+ "array-map-function-reference": [{ code: "BF101", severity: "error" }],
1804
+ "dangerous-inner-html": [{ code: "BF101", severity: "error" }],
1805
+ "string-replaceall": [{ code: "BF101", severity: "error" }]
1806
+ };
1807
+ // src/render-divergences.ts
1808
+ var renderDivergences = {
1809
+ "arithmetic-text": "`(count() + 2) * 3` renders 10 instead of 18 — the parenthesised sub-expression loses its grouping (silent wrong arithmetic)",
1810
+ "string-concat-plus": "`'Hello, ' + name` renders \"0\" — Perl's numeric `+` coerces the strings; JS string-concat `+` needs Perl's `.`",
1811
+ "string-length-text": "`.length` on a STRING prop diverges (array-length lowering misapplied to a scalar)",
1812
+ "number-tofixed": "the literal `¥` in template text reaches the output as U+FFFD — a UTF-8 encoding gap for non-ASCII literal text adjacent to a dynamic slot",
1813
+ "falsy-text-values": '`{false}` renders "false" (Hono drops it); `{null}`/`{undefined}` render empty (Hono renders "null") — neither side matches JSX semantics',
1814
+ "html-entity-text": "`©` in JSX literal text: Hono decodes to `©`, this adapter re-emits the raw entity — same DOM, different bytes",
1815
+ "math-methods": "Math.min/max/abs over a signal render empty (only Math.floor is in the template-primitive registry)",
1816
+ "boolean-attr-literals": 'camelCase boolean alias `readOnly`: Hono SSRs `readOnly="true"`, this adapter emits bare presence',
1817
+ "camelcase-attributes": "`htmlFor` is not lowered to `for` (Hono maps it)",
1818
+ "static-attr-escape": 'static attribute values are not HTML-escaped (`title="Fish & Chips"` emitted raw; Hono escapes)',
1819
+ "svg-icon": "SVG camelCase presentation attrs (`strokeWidth`, `strokeLinecap`) pass through unmapped; Hono lowers to kebab-case",
1820
+ "object-entries-map": "`Object.entries(prop).map(([k, v]) => …)` renders an EMPTY list — the object-shaped prop silently produces zero iterations",
1821
+ "nested-loop-outer-binding": "nested-loop inner items carry `data-key` where the reference emits the depth-suffixed `data-key-1`",
1822
+ "jsx-element-prop": "a JSX element passed as a NON-children prop renders an empty slot — the element value is silently dropped",
1823
+ "string-slice": "`.slice()` on a STRING misfires through the array slice helper",
1824
+ "string-trim-sided": "`.trimStart()` / `.trimEnd()` render empty (no lowering)"
1804
1825
  };
1805
1826
  export {
1827
+ renderDivergences,
1806
1828
  mojoAdapter,
1807
1829
  conformancePins,
1808
1830
  MojoAdapter
@@ -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 Mojolicious.
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,iBAiC/B,CAAA"}
@@ -1,5 +1,5 @@
1
1
  package BarefootJS::Backend::Mojo;
2
- our $VERSION = "0.17.1";
2
+ our $VERSION = "0.18.1";
3
3
  use Mojo::Base -base, -signatures;
4
4
 
5
5
  use Mojo::ByteStream qw(b);
@@ -1,5 +1,5 @@
1
1
  package Mojolicious::Plugin::BarefootJS::DevReload;
2
- our $VERSION = "0.17.1";
2
+ our $VERSION = "0.18.1";
3
3
  use Mojo::Base 'Mojolicious::Plugin', -signatures;
4
4
 
5
5
  =head1 NAME
@@ -1,5 +1,5 @@
1
1
  package Mojolicious::Plugin::BarefootJS;
2
- our $VERSION = "0.17.1";
2
+ our $VERSION = "0.18.1";
3
3
  use Mojo::Base 'Mojolicious::Plugin', -signatures;
4
4
 
5
5
  use Mojo::File qw(path);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barefootjs/mojolicious",
3
- "version": "0.18.0",
3
+ "version": "0.18.2",
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.18.0"
55
+ "@barefootjs/shared": "0.18.2"
56
56
  },
57
57
  "peerDependencies": {
58
58
  "@barefootjs/jsx": ">=0.2.0",
@@ -60,6 +60,6 @@
60
60
  },
61
61
  "devDependencies": {
62
62
  "@barefootjs/adapter-tests": "0.1.0",
63
- "@barefootjs/jsx": "0.18.0"
63
+ "@barefootjs/jsx": "0.18.2"
64
64
  }
65
65
  }
@@ -10,12 +10,20 @@ import { runAdapterConformanceTests } from '@barefootjs/adapter-tests'
10
10
  import { renderMojoComponent, PerlNotAvailableError } from '../test-render'
11
11
  import { compileJSX, type ComponentIR } from '@barefootjs/jsx'
12
12
  import { conformancePins } from '../conformance-pins'
13
+ import { renderDivergences } from '../render-divergences'
13
14
 
14
15
  runAdapterConformanceTests({
15
16
  name: 'mojo',
16
17
  factory: () => new MojoAdapter(),
17
18
  render: renderMojoComponent,
18
- // No JSX-render skips: every shared conformance fixture — including
19
+ // Priority-12 edge-case sweep (炙り出し, #2168): render-level
20
+ // divergences are declared in `../render-divergences` (exported from the
21
+ // package index and published to `ui/compat.lock.json` / the docs
22
+ // compatibility-matrix page by `packages/compat`). Deriving the skip
23
+ // list from that object keeps the public declaration and these test
24
+ // skips from drifting; each entry's rationale lives there.
25
+ skipJsx: Object.keys(renderDivergences),
26
+ // (Pre-sweep note) Otherwise no JSX-render skips: every shared conformance fixture — including
19
27
  // the composed `site/ui` demo corpus (#1467 / #1897) — renders to
20
28
  // Hono parity on real Mojolicious. `data-table` came off via the
21
29
  // body-children `inLoop` reset (#1896): the loop-item component
@@ -135,4 +135,15 @@ export const conformancePins: ConformancePins = {
135
135
  // UNSUPPORTED_METHODS gate refuses it with BF101 rather than emitting
136
136
  // a broken template.
137
137
  'array-map-function-reference': [{ code: 'BF101', severity: 'error' }],
138
+ // Edge-case sweep (Priority 12): `dangerouslySetInnerHTML` requires a
139
+ // deliberate raw-HTML (unescaped) output affordance in the target
140
+ // template language. No lowering exists yet, so the compiler refuses
141
+ // the shape loudly instead of emitting entity-escaped markup that
142
+ // silently renders tags as text.
143
+ 'dangerous-inner-html': [{ code: 'BF101', severity: 'error' }],
144
+ // Edge-case sweep (Priority 12): `.replaceAll` has no lowering yet —
145
+ // only first-occurrence `.replace` is wired to the runtime helpers.
146
+ // Refused with BF101 rather than reusing the first-only lowering,
147
+ // which would silently change semantics.
148
+ 'string-replaceall': [{ code: 'BF101', severity: 'error' }],
138
149
  }
package/src/index.ts CHANGED
@@ -7,3 +7,4 @@
7
7
  export { MojoAdapter, mojoAdapter } from './adapter/index.ts'
8
8
  export type { MojoAdapterOptions } from './adapter/index.ts'
9
9
  export { conformancePins } from './conformance-pins.ts'
10
+ export { renderDivergences } from './render-divergences.ts'
@@ -0,0 +1,50 @@
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 Mojolicious.
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` renders \"0\" — Perl's numeric `+` coerces the strings; JS string-concat `+` needs Perl's `.`",
22
+ 'string-length-text':
23
+ '`.length` on a STRING prop diverges (array-length lowering misapplied to a scalar)',
24
+ 'number-tofixed':
25
+ 'the literal `¥` in template text reaches the output as U+FFFD — a UTF-8 encoding gap for non-ASCII literal text adjacent to a dynamic slot',
26
+ 'falsy-text-values':
27
+ '`{false}` renders "false" (Hono drops it); `{null}`/`{undefined}` render empty (Hono renders "null") — neither side matches JSX semantics',
28
+ 'html-entity-text':
29
+ '`©` in JSX literal text: Hono decodes to `©`, this adapter re-emits the raw entity — same DOM, different bytes',
30
+ 'math-methods':
31
+ 'Math.min/max/abs over a signal render empty (only Math.floor is in the template-primitive registry)',
32
+ 'boolean-attr-literals':
33
+ 'camelCase boolean alias `readOnly`: Hono SSRs `readOnly="true"`, this adapter emits bare presence',
34
+ 'camelcase-attributes':
35
+ '`htmlFor` is not lowered to `for` (Hono maps it)',
36
+ 'static-attr-escape':
37
+ 'static attribute values are not HTML-escaped (`title="Fish & Chips"` emitted raw; Hono escapes)',
38
+ 'svg-icon':
39
+ 'SVG camelCase presentation attrs (`strokeWidth`, `strokeLinecap`) pass through unmapped; Hono lowers to kebab-case',
40
+ 'object-entries-map':
41
+ '`Object.entries(prop).map(([k, v]) => …)` renders an EMPTY list — the object-shaped prop silently produces zero iterations',
42
+ 'nested-loop-outer-binding':
43
+ 'nested-loop inner items carry `data-key` where the reference emits the depth-suffixed `data-key-1`',
44
+ 'jsx-element-prop':
45
+ 'a JSX element passed as a NON-children prop renders an empty slot — the element value is silently dropped',
46
+ 'string-slice':
47
+ '`.slice()` on a STRING misfires through the array slice helper',
48
+ 'string-trim-sided':
49
+ '`.trimStart()` / `.trimEnd()` render empty (no lowering)',
50
+ }