@barefootjs/blade 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;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD,eAAO,MAAM,eAAe,EAAE,eAyE7B,CAAA"}
1
+ {"version":3,"file":"conformance-pins.d.ts","sourceRoot":"","sources":["../src/conformance-pins.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD,eAAO,MAAM,eAAe,EAAE,eAoF7B,CAAA"}
package/dist/index.d.ts CHANGED
@@ -6,4 +6,5 @@
6
6
  export { BladeAdapter, bladeAdapter } from './adapter/index.ts';
7
7
  export type { BladeAdapterOptions } 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,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC/D,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAC7D,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,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC/D,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA"}
package/dist/index.js CHANGED
@@ -189070,9 +189070,29 @@ var conformancePins = {
189070
189070
  "filter-nested-find-predicate": [
189071
189071
  { code: "BF101", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2038" }
189072
189072
  ],
189073
- "array-map-function-reference": [{ code: "BF101", severity: "error" }]
189073
+ "array-map-function-reference": [{ code: "BF101", severity: "error" }],
189074
+ "dangerous-inner-html": [{ code: "BF101", severity: "error" }],
189075
+ "string-replaceall": [{ code: "BF101", severity: "error" }]
189076
+ };
189077
+ // src/render-divergences.ts
189078
+ var renderDivergences = {
189079
+ "arithmetic-text": "`(count() + 2) * 3` renders 10 instead of 18 — the parenthesised sub-expression loses its grouping (silent wrong arithmetic)",
189080
+ "string-concat-plus": "`'Hello, ' + name` is emitted as PHP `+`, which fatals with \"Unsupported operand types: string + string\" — needs PHP's `.` concat",
189081
+ "falsy-text-values": '`{false}` renders "false" (Hono drops it); `{null}`/`{undefined}` render empty (Hono renders "null") — neither side matches JSX semantics',
189082
+ "html-entity-text": "`©` in JSX literal text: Hono decodes to `©`, this adapter re-emits the raw entity — same DOM, different bytes",
189083
+ "math-methods": "Math.min/max/abs over a signal render empty (only Math.floor is in the template-primitive registry)",
189084
+ "boolean-attr-literals": 'camelCase boolean alias `readOnly`: Hono SSRs `readOnly="true"`, this adapter emits bare presence',
189085
+ "camelcase-attributes": "`htmlFor` is not lowered to `for` (Hono maps it)",
189086
+ "static-attr-escape": 'static attribute values are not HTML-escaped (`title="Fish & Chips"` emitted raw; Hono escapes)',
189087
+ "svg-icon": "SVG camelCase presentation attrs (`strokeWidth`, `strokeLinecap`) pass through unmapped; Hono lowers to kebab-case",
189088
+ "object-entries-map": "`Object.entries(prop).map(([k, v]) => …)` renders an EMPTY list — the object-shaped prop silently produces zero iterations",
189089
+ "nested-loop-outer-binding": "nested-loop inner items carry `data-key` where the reference emits the depth-suffixed `data-key-1`",
189090
+ "jsx-element-prop": "a JSX element passed as a NON-children prop renders an empty slot — the element value is silently dropped",
189091
+ "string-slice": "`.slice()` on a STRING renders empty (array-slice helper misfires on strings)",
189092
+ "string-trim-sided": "`.trimStart()` / `.trimEnd()` render empty (no lowering)"
189074
189093
  };
189075
189094
  export {
189095
+ renderDivergences,
189076
189096
  conformancePins,
189077
189097
  bladeAdapter,
189078
189098
  BladeAdapter
@@ -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 PHP Blade (or fatals 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,iBA6B/B,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barefootjs/blade",
3
- "version": "0.18.0",
3
+ "version": "0.18.2",
4
4
  "description": "Laravel Blade (PHP) adapter for BarefootJS — compiles IR to .blade.php templates and ships the PHP BarefootJS rendering runtime on illuminate/view standalone",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -54,14 +54,14 @@
54
54
  "directory": "packages/adapter-blade"
55
55
  },
56
56
  "dependencies": {
57
- "@barefootjs/shared": "0.18.0"
57
+ "@barefootjs/shared": "0.18.2"
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.0",
64
+ "@barefootjs/jsx": "0.18.2",
65
65
  "typescript": "^5.0.0"
66
66
  }
67
67
  }
@@ -15,11 +15,19 @@ import { runAdapterConformanceTests } from '@barefootjs/adapter-tests'
15
15
  import { BladeAdapter } from '../adapter'
16
16
  import { renderBladeComponent, BladeNotAvailableError } from '../test-render'
17
17
  import { conformancePins } from '../conformance-pins'
18
+ import { renderDivergences } from '../render-divergences'
18
19
 
19
20
  runAdapterConformanceTests({
20
21
  name: 'blade',
21
22
  factory: () => new BladeAdapter(),
22
23
  render: renderBladeComponent,
24
+ // Priority-12 edge-case sweep (炙り出し, #2168): render-level
25
+ // divergences are declared in `../render-divergences` (exported from the
26
+ // package index and published to `ui/compat.lock.json` / the docs
27
+ // compatibility-matrix page by `packages/compat`). Deriving the skip
28
+ // list from that object keeps the public declaration and these test
29
+ // skips from drifting; each entry's rationale lives there.
30
+ skipJsx: Object.keys(renderDivergences),
23
31
  // Per-fixture build-time contracts for shapes the Blade adapter
24
32
  // intentionally refuses to lower. Lives in `../conformance-pins` —
25
33
  // mirrors Twig's set (the lowering gates are shared code paths in
@@ -83,4 +83,15 @@ export const conformancePins: ConformancePins = {
83
83
  // "Expression not supported" BF101 rather than emitting a broken
84
84
  // template.
85
85
  'array-map-function-reference': [{ code: 'BF101', severity: 'error' }],
86
+ // Edge-case sweep (Priority 12): `dangerouslySetInnerHTML` requires a
87
+ // deliberate raw-HTML (unescaped) output affordance in the target
88
+ // template language. No lowering exists yet, so the compiler refuses
89
+ // the shape loudly instead of emitting entity-escaped markup that
90
+ // silently renders tags as text.
91
+ 'dangerous-inner-html': [{ code: 'BF101', severity: 'error' }],
92
+ // Edge-case sweep (Priority 12): `.replaceAll` has no lowering yet —
93
+ // only first-occurrence `.replace` is wired to the runtime helpers.
94
+ // Refused with BF101 rather than reusing the first-only lowering,
95
+ // which would silently change semantics.
96
+ 'string-replaceall': [{ code: 'BF101', severity: 'error' }],
86
97
  }
package/src/index.ts CHANGED
@@ -7,3 +7,4 @@
7
7
  export { BladeAdapter, bladeAdapter } from './adapter/index.ts'
8
8
  export type { BladeAdapterOptions } from './adapter/index.ts'
9
9
  export { conformancePins } from './conformance-pins.ts'
10
+ export { renderDivergences } from './render-divergences.ts'
@@ -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 PHP Blade (or fatals 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
+ '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` is emitted as PHP `+`, which fatals with "Unsupported operand types: string + string" — needs PHP\'s `.` 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 renders empty (array-slice helper misfires on strings)',
44
+ 'string-trim-sided':
45
+ '`.trimStart()` / `.trimEnd()` render empty (no lowering)',
46
+ }