@barefootjs/erb 0.24.1 → 0.26.0

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":"erb-adapter.d.ts","sourceRoot":"","sources":["../../src/adapter/erb-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,KAAK,EACV,WAAW,EAEX,MAAM,EACN,SAAS,EACT,MAAM,EACN,YAAY,EACZ,aAAa,EACb,MAAM,EACN,WAAW,EACX,UAAU,EACV,MAAM,EACN,aAAa,EACb,UAAU,EACV,OAAO,EAMP,yBAAyB,EAC1B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAE3B,KAAK,aAAa,EAClB,KAAK,UAAU,EA8BhB,MAAM,iBAAiB,CAAA;AAKxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAoClD,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAoBvD,qBAAa,UAAW,SAAQ,WAAY,YAAW,aAAa,CAAC,YAAY,CAAC;IAChF,IAAI,SAAQ;IACZ,SAAS,SAAS;IAClB,qBAAqB,UAAO;IAI5B,kBAAkB,EAAG,cAAc,CAAS;IAE5C;;;;;;OAMG;IACH,kBAAkB,EAAE,yBAAyB,CAAyB;IAEtE,OAAO,CAAC,aAAa,CAAa;IAClC;;;;oDAIgD;IAChD,OAAO,CAAC,cAAc,CAAyB;IAC/C,OAAO,CAAC,OAAO,CAA6B;IAC5C,OAAO,CAAC,MAAM,CAAsB;IACpC,OAAO,CAAC,MAAM,CAAiB;IAC/B;;;;;;OAMG;IACH,OAAO,CAAC,mBAAmB,CAAI;IAC/B;;;;;OAKG;IACH,OAAO,CA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MAAM,EAAE,MAAM,GAAG,MAAM,CAEvC;IAED,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEvC;IAMD;;;;;OAKG;IACH,OAAO,CAAC,oBAAoB;IA8B5B,OAAO,CAAC,iCAAiC;IAkCzC;;;;;;;OAOG;IACH,OAAO,CAAC,gCAAgC;IAmBxC;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,+BAA+B;IAuBvC;;;;;;;OAOG;IACH,OAAO,KAAK,OAAO,GAWlB;IAED;;;;OAIG;IACH,OAAO,KAAK,SAAS,GAQpB;IAED,sEAAsE;IACtE,OAAO,KAAK,OAAO,GAElB;IAED,OAAO,CAAC,uBAAuB;IA+E/B;;;;OAIG;IACH,OAAO,CAAC,sBAAsB;IAI9B;uEACmE;IACnE,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,gBAAgB;IAcxB,iFAAiF;IACjF,OAAO,CAAC,2BAA2B;CAGpC;AAED,eAAO,MAAM,UAAU,YAAmB,CAAA"}
@@ -188627,10 +188627,13 @@ class ErbAdapter extends BaseAdapter {
188627
188627
  const resolution = resolveDangerousInnerHtml(element);
188628
188628
  if (!resolution)
188629
188629
  return null;
188630
- if (resolution.kind === "dynamic") {
188630
+ if (resolution.kind === "unlowerable") {
188631
188631
  this.errors.push(dangerousInnerHtmlDiagnostic(resolution.expr, resolution.loc));
188632
188632
  return "";
188633
188633
  }
188634
+ if (resolution.kind === "dynamic") {
188635
+ return `<%= ${this.convertExpressionToRuby(resolution.valueExpr, resolution.valueParsed)} %>`;
188636
+ }
188634
188637
  const violation = dangerousInnerHtmlMetacharViolation(resolution.html, this.name);
188635
188638
  if (violation) {
188636
188639
  const attr = element.attrs.find(isDangerousInnerHtmlAttr);
package/dist/build.js CHANGED
@@ -188627,10 +188627,13 @@ class ErbAdapter extends BaseAdapter {
188627
188627
  const resolution = resolveDangerousInnerHtml(element);
188628
188628
  if (!resolution)
188629
188629
  return null;
188630
- if (resolution.kind === "dynamic") {
188630
+ if (resolution.kind === "unlowerable") {
188631
188631
  this.errors.push(dangerousInnerHtmlDiagnostic(resolution.expr, resolution.loc));
188632
188632
  return "";
188633
188633
  }
188634
+ if (resolution.kind === "dynamic") {
188635
+ return `<%= ${this.convertExpressionToRuby(resolution.valueExpr, resolution.valueParsed)} %>`;
188636
+ }
188634
188637
  const violation = dangerousInnerHtmlMetacharViolation(resolution.html, this.name);
188635
188638
  if (violation) {
188636
188639
  const attr = element.attrs.find(isDangerousInnerHtmlAttr);
@@ -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,eAkG7B,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,eAmG7B,CAAA"}
package/dist/index.js CHANGED
@@ -188627,10 +188627,13 @@ class ErbAdapter extends BaseAdapter {
188627
188627
  const resolution = resolveDangerousInnerHtml(element);
188628
188628
  if (!resolution)
188629
188629
  return null;
188630
- if (resolution.kind === "dynamic") {
188630
+ if (resolution.kind === "unlowerable") {
188631
188631
  this.errors.push(dangerousInnerHtmlDiagnostic(resolution.expr, resolution.loc));
188632
188632
  return "";
188633
188633
  }
188634
+ if (resolution.kind === "dynamic") {
188635
+ return `<%= ${this.convertExpressionToRuby(resolution.valueExpr, resolution.valueParsed)} %>`;
188636
+ }
188634
188637
  const violation = dangerousInnerHtmlMetacharViolation(resolution.html, this.name);
188635
188638
  if (violation) {
188636
188639
  const attr = element.attrs.find(isDangerousInnerHtmlAttr);
@@ -189269,7 +189272,6 @@ var conformancePins = {
189269
189272
  "filter-nested-find-predicate": [
189270
189273
  { code: "BF101", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2320" }
189271
189274
  ],
189272
- "dangerous-inner-html-dynamic": [{ code: "BF101", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2319" }],
189273
189275
  "date-method-uncatalogued": [{ code: "BF021", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2274" }]
189274
189276
  };
189275
189277
  // src/render-divergences.ts
@@ -530,9 +530,12 @@ module BarefootJS
530
530
  end
531
531
 
532
532
  # `tz` shapes FORMAT_DATE_OFFSET_RE matches: a fixed UTC offset `±HH:MM`
533
- # (`'+09:00'`, `'-05:30'`) -- the ONLY non-UTC shape `format_date`
534
- # recognizes (mirrors OFFSET_RE in packages/client/src/format-date.ts).
535
- FORMAT_DATE_OFFSET_RE = /\A([+-])(\d{2}):(\d{2})\z/
533
+ # within ECMA-402's valid range -- hours 00-23, minutes 00-59
534
+ # (`'+09:00'`, `'-05:30'`) -- one of the three `tz` shapes `format_date`
535
+ # accepts (mirrors OFFSET_RE in packages/client/src/format-date.ts). An
536
+ # out-of-range shape (`'+25:00'`) falls through to the tzdata lookup,
537
+ # fails it, and raises -- matching the JS reference's RangeError (#2344).
538
+ FORMAT_DATE_OFFSET_RE = /\A([+-])([01]\d|2[0-3]):([0-5]\d)\z/
536
539
 
537
540
  # Longest-match pattern-token alternation (mirrors TOKEN_RE in
538
541
  # packages/client/src/format-date.ts). Order matters: Onigmo, like JS's
@@ -562,13 +565,20 @@ module BarefootJS
562
565
  # an ISO-8601 string, normalized identically. A nil / unparseable
563
566
  # receiver renders '' (never raises mid-render).
564
567
  #
565
- # tz: a fixed UTC offset `±HH:MM` shifts the instant by
566
- # sign*(HH*60+MM) minutes; ANY other value -- 'UTC', an IANA zone name
567
- # ('Asia/Tokyo'), or a malformed offset ('+9:00') -- normalizes to a
568
- # zero-minute shift (UTC), so every backend degrades identically instead
569
- # of dragging in host tzdata. The shifted instant's UTC calendar fields
570
- # (not the original instant's) are what pattern tokens read -- the
571
- # shifted UTC clock face IS the local clock face at that offset. `Time`
568
+ # tz (#2344): 'UTC', a range-valid fixed offset `±HH:MM` (shifts the
569
+ # instant by sign*(HH*60+MM) minutes), or a canonical IANA zone name
570
+ # ('Asia/Tokyo') resolved through tzdata via the tzinfo gem -- the
571
+ # zone's UTC offset AT THE INSTANT being formatted (DST-aware,
572
+ # historical-transition-aware, seconds precision: pre-standard LMT
573
+ # offsets like Tokyo's +09:18:59 count). ANY other value -- an unknown
574
+ # zone, a non-canonical spelling, a malformed or out-of-range offset
575
+ # ('+9:00', '+25:00') -- raises ArgumentError, aborting the render
576
+ # loudly: the JS reference throws a RangeError there, and a silently
577
+ # substituted timezone is the one failure mode this helper must not
578
+ # have (the pre-#2344 normalize-to-UTC total function is gone). The
579
+ # shifted instant's UTC calendar fields (not the original instant's)
580
+ # are what pattern tokens read -- the shifted UTC clock face IS the
581
+ # local clock face in that zone. `Time`
572
582
  # arithmetic here is exact (Ruby represents the instant as a Rational,
573
583
  # not a floor-divided epoch-millis integer), so there's no pre-1970
574
584
  # negative-epoch floor-division trap to dodge the way a naive
@@ -602,10 +612,19 @@ module BarefootJS
602
612
  end
603
613
  return '' if t.nil?
604
614
 
605
- m = FORMAT_DATE_OFFSET_RE.match(tz.to_s)
606
- offset_minutes = m ? (m[1] == '-' ? -1 : 1) * ((m[2].to_i * 60) + m[3].to_i) : 0
615
+ tz_s = tz.to_s
616
+ offset_seconds = 0
617
+ if tz_s != 'UTC'
618
+ m = FORMAT_DATE_OFFSET_RE.match(tz_s)
619
+ offset_seconds =
620
+ if m
621
+ (m[1] == '-' ? -1 : 1) * ((m[2].to_i * 60) + m[3].to_i) * 60
622
+ else
623
+ format_date_zone_offset(tz_s, t)
624
+ end
625
+ end
607
626
 
608
- shifted = (t.utc + (offset_minutes * 60)).utc
627
+ shifted = (t.utc + offset_seconds).utc
609
628
  year = shifted.year
610
629
  month = shifted.mon
611
630
  day = shifted.mday
@@ -628,6 +647,29 @@ module BarefootJS
628
647
  end
629
648
  end
630
649
 
650
+ # Resolve a canonical IANA zone ID's UTC offset (whole seconds) at
651
+ # instant `t` through the tzinfo gem (#2344) -- TZInfo resolves the
652
+ # exact-case canonical ID set every backend shares, with full
653
+ # historical transitions (LMT seconds included). The gem is required
654
+ # lazily so the fixed-offset/'UTC' paths -- and every other helper --
655
+ # keep working on a gem-less stdlib install; reaching a named zone
656
+ # without the gem raises the same loud ArgumentError as an unknown
657
+ # zone (never a silent UTC fallback).
658
+ def format_date_zone_offset(tz, t)
659
+ begin
660
+ require 'tzinfo'
661
+ rescue LoadError
662
+ raise ArgumentError,
663
+ "format_date: IANA timeZone #{tz.inspect} requires the tzinfo gem (~> 2.0)"
664
+ end
665
+ begin
666
+ zone = TZInfo::Timezone.get(tz)
667
+ rescue TZInfo::InvalidTimezoneIdentifier
668
+ raise ArgumentError, "format_date: unresolvable timeZone #{tz.inspect}"
669
+ end
670
+ zone.period_for_utc(t.utc).observed_utc_offset
671
+ end
672
+
631
673
  # -----------------------------------------------------------------
632
674
  # Array / String method helpers
633
675
  # -----------------------------------------------------------------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barefootjs/erb",
3
- "version": "0.24.1",
3
+ "version": "0.26.0",
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.24.1"
57
+ "@barefootjs/shared": "0.26.0"
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.24.1",
64
+ "@barefootjs/jsx": "0.26.0",
65
65
  "typescript": "^5.0.0"
66
66
  }
67
67
  }
@@ -689,10 +689,20 @@ export class ErbAdapter extends BaseAdapter implements IRNodeEmitter<ErbRenderCt
689
689
  private renderDangerousInnerHtml(element: IRElement): string | null {
690
690
  const resolution = resolveDangerousInnerHtml(element)
691
691
  if (!resolution) return null
692
- if (resolution.kind === 'dynamic') {
692
+ if (resolution.kind === 'unlowerable') {
693
693
  this.errors.push(dangerousInnerHtmlDiagnostic(resolution.expr, resolution.loc))
694
694
  return ''
695
695
  }
696
+ if (resolution.kind === 'dynamic') {
697
+ // Lower the `__html` expression and emit it through ERB's raw sink.
698
+ // Stdlib ERB's `<%= %>` does not auto-escape (every escaped text
699
+ // position wraps the value in `bf.h(...)` — see `renderExpression`),
700
+ // so dropping that wrap renders the value verbatim. The runtime
701
+ // evaluates the expression, so no template-metachar guard applies. The
702
+ // element already carries its own hydration slot marker (`element.slotId`,
703
+ // stamped in `renderElement`) for the client's `el.innerHTML = …`. #2319.
704
+ return `<%= ${this.convertExpressionToRuby(resolution.valueExpr, resolution.valueParsed)} %>`
705
+ }
696
706
  const violation = dangerousInnerHtmlMetacharViolation(resolution.html, this.name)
697
707
  if (violation) {
698
708
  const attr = element.attrs.find(isDangerousInnerHtmlAttr)!
@@ -100,9 +100,10 @@ export const conformancePins: ConformancePins = {
100
100
  // `dangerous-inner-html` no longer pinned — a compile-time string-literal
101
101
  // `dangerouslySetInnerHTML={{ __html: '...' }}` is spliced directly into
102
102
  // the template as trusted raw text (`resolveDangerousInnerHtml`, #2207).
103
- // A dynamic/signal-derived value still refuses with BF101 — see the
104
- // `dangerous-inner-html-dynamic` fixture/pin below (tracked: #2319, successor to #2215).
105
- 'dangerous-inner-html-dynamic': [{ code: 'BF101', severity: 'error', issue: 'https://github.com/piconic-ai/barefootjs/issues/2319' }],
103
+ // A dynamic/signal-derived value now lowers through ERB's unescaped
104
+ // `<%= %>` (dropping the `bf.h(...)` escape wrap, #2319) `dangerous-inner-
105
+ // html-dynamic` is no longer pinned and renders to Hono parity, same as the
106
+ // static case.
106
107
  // #2273: a method call on a prop typed as a built-in host rich type
107
108
  // (Date, Map, …) has no catalogued lowering in any adapter — this is a
108
109
  // compiler-level refusal (`checkRichTypeMethodCalls`, wired ahead of