Skip to content

Rails main compat: render_in(**options); canary pairs rspec-rails main - #9

Merged
sebyx07 merged 1 commit into
mainfrom
fix/canary-rspec-rails-main
Oct 31, 2026
Merged

sebyx07 merged 1 commit into
mainfrom
fix/canary-rspec-rails-main

Conversation

@sebyx07

@sebyx07 sebyx07 commented Oct 31, 2026

Copy link
Copy Markdown
Owner

The first canary run (Ruby head ✅, Rails edge ❌) found three Rails-main incompatibilities:

  • Library: Rails main calls render_in(context, locals:) and deprecates render_in without options (it would break in Rails 9). Ruby2html::Component#render_in now accepts and ignores keyword options; components take data via #initialize. CHANGELOG entry added.
  • Canary gemfile: rspec-rails 8.0.x writes into default_url_options, which Rails main now freezes (already fixed on rspec-rails main). With RAILS_VERSION=edge, gemfiles/rails_common.rb uses rspec-rails main.
  • Specs: Rails main's render log calls renderable.class.name.sub, which is nil for anonymous classes, so the component specs give their classes names via stub_const.

Verified: Rails edge spec/features spec/gem/rails 78/0; default CI=1 bundle exec rspec 236/0; rubocop clean.

🤖 Generated with Claude Code

Found by the first canary run:
- Rails main calls render_in(context, locals:) and deprecates render_in
  without options; Component#render_in accepts and ignores them
- rspec-rails 8.0.x writes Rails main's now-frozen default_url_options
  (fixed on rspec-rails main): the edge leg uses rspec-rails main
- Rails main's render log calls renderable.class.name.sub, so anonymous
  component classes in specs get names (stub_const)

Rails edge: 78 examples, 0 failures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sebyx07
sebyx07 merged commit 95a8324 into main Oct 31, 2026
30 checks passed
@sebyx07
sebyx07 deleted the fix/canary-rspec-rails-main branch October 31, 2026 19:00
@github-actions

Copy link
Copy Markdown

Benchmarks: x86_64 (linux)

ruby 3.4.7 (2025-10-08 revision 7a5688e2a2) +PRISM [x86_64-linux] · commit 678c23dad7 · 2.0s per report
Δ is against main ad657baa96 (same runner type; expect a few % noise).

escape_bench (C ext) · peak RSS 118 MB

Benchmark i/s ms / call allocs / call vs fastest Δ vs main
escape_html short clean (10B) 592,478 ± 0.5% 0.0017 0.00 fastest -3.9%
escape_html medium clean (200B) 373,333 ± 0.3% 0.0027 0.00 1.59x slower -7.9%
append short clean (10B) 212,301 ± 0.5% 0.0047 0.02 2.79x slower -4.4%
append medium clean (200B) 165,257 ± 0.6% 0.0061 0.00 3.59x slower -1.0%
append short dirty (10B) 147,590 ± 0.9% 0.0068 0.00 4.01x slower +1.6%
append medium dirty (200B) 93,116 ± 0.4% 0.0107 0.00 6.36x slower -2.1%
escape_html medium dirty (200B) 62,985 ± 1.0% 0.0159 100 9.41x slower -0.5%
escape_html short dirty (10B) 45,231 ± 0.7% 0.0221 100 13.10x slower +7.9%
escape_html long clean (10KB) 16,089 ± 0.8% 0.0622 0.00 36.83x slower -1.2%
append long clean (10KB) 11,210 ± 0.5% 0.0892 0.00 52.85x slower -8.7%
append long dirty (10KB) 1,503 ± 0.4% 0.6654 0.00 394.24x slower +11.5%
escape_html long dirty (10KB) 1,315 ± 12.7% 0.7606 100 450.63x slower +16.3%

escape_bench (pure Ruby) · peak RSS 154 MB

Benchmark i/s ms / call allocs / call vs fastest Δ vs main
escape_html short clean (10B) 210,451 ± 0.4% 0.0048 0.00 fastest -6.7%
append short clean (10B) 144,533 ± 0.6% 0.0069 0.02 1.46x slower -12.3%
escape_html medium clean (200B) 86,782 ± 1.2% 0.0115 0.00 2.43x slower +8.4%
append medium clean (200B) 72,759 ± 0.8% 0.0137 0.00 2.89x slower +0.4%
escape_html short dirty (10B) 33,578 ± 2.1% 0.0298 100 6.27x slower +10.9%
append short dirty (10B) 30,600 ± 0.4% 0.0327 100 6.88x slower +8.1%
escape_html medium dirty (200B) 28,303 ± 1.3% 0.0353 200 7.44x slower +3.4%
append medium dirty (200B) 25,140 ± 1.2% 0.0398 200 8.37x slower +0.7%
escape_html long clean (10KB) 3,058 ± 0.6% 0.3270 0.00 68.81x slower +8.0%
append long clean (10KB) 2,783 ± 0.9% 0.3593 0.00 75.63x slower +5.1%
escape_html long dirty (10KB) 1,348 ± 1.3% 0.7418 200 156.11x slower +10.0%
append long dirty (10KB) 1,075 ± 9.3% 0.9305 200 195.82x slower +17.4%

render_bench (C ext) · peak RSS 131 MB

Benchmark i/s ms / call allocs / call vs fastest Δ vs main
erubi 6,583 ± 2.4% 0.1519 713 fastest -8.8%
ruby2html 5,301 ± 0.7% 0.1886 419 1.24x slower -7.2%
phlex 445 ± 2.7% 2.2459 6,375 14.79x slower -15.2%

render_bench (pure Ruby) · peak RSS 131 MB

Benchmark i/s ms / call allocs / call vs fastest Δ vs main
erubi 5,045 ± 0.7% 0.1982 713 fastest +4.0%
ruby2html 1,963 ± 1.1% 0.5095 1,029 2.57x slower -10.8%
phlex 431 ± 1.2% 2.3219 6,375 11.71x slower -10.2%

tag_bench (C ext) · peak RSS 43 MB

Benchmark i/s ms / call allocs / call vs fastest Δ vs main
br 244,254 ± 0.5% 0.0041 7.00 fastest -1.7%
li(text) 162,331 ± 0.8% 0.0062 7.02 1.50x slower +11.7%
li(dirty text) 126,026 ± 1.2% 0.0079 7.00 1.94x slower +13.8%
div { block } 124,065 ± 0.7% 0.0081 7.00 1.97x slower +1.3%
span(text, class:) 27,210 ± 0.6% 0.0368 207 8.98x slower -1.6%
div(class:) { block } 26,208 ± 0.4% 0.0382 207 9.32x slower -6.4%
a(text, href:, class:) 20,542 ± 1.2% 0.0487 207 11.89x slower -3.3%

tag_bench (pure Ruby) · peak RSS 27 MB

Benchmark i/s ms / call allocs / call vs fastest Δ vs main
br 85,794 ± 0.5% 0.0117 107 fastest -9.8%
div { block } 72,017 ± 0.3% 0.0139 107 1.19x slower -11.0%
li(text) 65,093 ± 1.3% 0.0154 107 1.32x slower -5.1%
li(dirty text) 46,655 ± 0.5% 0.0214 207 1.84x slower +7.4%
span(text, class:) 14,665 ± 0.6% 0.0682 207 5.85x slower -15.8%
div(class:) { block } 14,098 ± 0.6% 0.0709 207 6.09x slower -17.3%
a(text, href:, class:) 9,859 ± 0.6% 0.1014 207 8.70x slower -14.1%

Rails request (C ext) · peak RSS 220 MB

Benchmark i/s ms / call allocs / call vs fastest Δ vs main
Slim 503 ± 7.0% 1.9898 4,331 fastest +3.4%
ruby2html .html.rb templates 482 ± 1.7% 2.0764 4,826 1.04x slower +3.9%
Ruby2html::Component 474 ± 1.5% 2.1105 4,676 1.06x slower +2.5%
ViewComponent + ruby2html 458 ± 1.5% 2.1836 4,533 1.10x slower +2.1%
ERB 448 ± 11.4% 2.2325 3,100 1.12x slower +0.0%
Phlex 440 ± 2.3% 2.2706 6,105 1.14x slower +2.8%

@github-actions

Copy link
Copy Markdown

Benchmarks: aarch64 (linux)

ruby 3.4.7 (2025-10-08 revision 7a5688e2a2) +PRISM [aarch64-linux] · commit 678c23dad7 · 2.0s per report
Δ is against main ad657baa96 (same runner type; expect a few % noise).

escape_bench (C ext) · peak RSS 117 MB

Benchmark i/s ms / call allocs / call vs fastest Δ vs main
escape_html short clean (10B) 598,012 ± 0.7% 0.0017 0.00 fastest +0.4%
escape_html medium clean (200B) 326,158 ± 0.2% 0.0031 0.00 1.83x slower +0.5%
append short clean (10B) 186,101 ± 0.2% 0.0054 0.02 3.21x slower +0.5%
append medium clean (200B) 145,815 ± 0.2% 0.0069 0.00 4.10x slower -0.7%
append short dirty (10B) 143,810 ± 0.2% 0.0070 0.00 4.16x slower +0.6%
append medium dirty (200B) 73,459 ± 0.2% 0.0136 0.00 8.14x slower -0.4%
escape_html medium dirty (200B) 54,521 ± 1.0% 0.0183 100 10.97x slower -1.3%
escape_html short dirty (10B) 43,978 ± 0.6% 0.0227 100 13.60x slower -4.7%
escape_html long clean (10KB) 11,344 ± 0.2% 0.0882 0.00 52.72x slower -0.0%
append long clean (10KB) 9,182 ± 0.4% 0.1089 0.00 65.13x slower -1.4%
append long dirty (10KB) 1,167 ± 0.3% 0.8569 0.00 512.41x slower -0.2%
escape_html long dirty (10KB) 1,000 ± 7.2% 1.0004 100 598.22x slower -2.2%

escape_bench (pure Ruby) · peak RSS 150 MB

Benchmark i/s ms / call allocs / call vs fastest Δ vs main
escape_html short clean (10B) 154,062 ± 0.2% 0.0065 0.00 fastest +0.1%
append short clean (10B) 106,172 ± 0.4% 0.0094 0.02 1.45x slower -0.1%
escape_html medium clean (200B) 55,518 ± 0.2% 0.0180 0.00 2.77x slower -0.0%
append medium clean (200B) 47,002 ± 0.2% 0.0213 0.00 3.28x slower -0.7%
escape_html short dirty (10B) 31,258 ± 2.0% 0.0320 100 4.93x slower -2.2%
append short dirty (10B) 28,428 ± 1.6% 0.0352 100 5.42x slower -3.9%
escape_html medium dirty (200B) 21,557 ± 0.4% 0.0464 200 7.15x slower -1.9%
append medium dirty (200B) 19,655 ± 0.8% 0.0509 200 7.84x slower +0.2%
escape_html long clean (10KB) 1,632 ± 0.2% 0.6128 0.00 94.41x slower +0.0%
append long clean (10KB) 1,562 ± 0.3% 0.6402 0.00 98.63x slower +0.2%
escape_html long dirty (10KB) 1,066 ± 1.0% 0.9380 200 144.51x slower -1.0%
append long dirty (10KB) 866 ± 8.5% 1.1550 200 177.94x slower -1.6%

render_bench (C ext) · peak RSS 130 MB

Benchmark i/s ms / call allocs / call vs fastest Δ vs main
erubi 6,467 ± 1.8% 0.1546 713 fastest +2.2%
ruby2html 5,496 ± 1.0% 0.1819 419 1.18x slower -0.2%
phlex 463 ± 1.5% 2.1586 6,375 13.96x slower +4.3%

render_bench (pure Ruby) · peak RSS 131 MB

Benchmark i/s ms / call allocs / call vs fastest Δ vs main
erubi 6,444 ± 1.6% 0.1552 713 fastest +7.0%
ruby2html 2,262 ± 0.5% 0.4421 1,029 2.85x slower -0.2%
phlex 445 ± 1.3% 2.2478 6,375 14.48x slower +5.8%

tag_bench (C ext) · peak RSS 42 MB

Benchmark i/s ms / call allocs / call vs fastest Δ vs main
br 224,122 ± 0.4% 0.0045 7.00 fastest +1.6%
li(text) 150,387 ± 0.4% 0.0066 7.02 1.49x slower +0.1%
li(dirty text) 122,031 ± 0.4% 0.0082 7.00 1.84x slower +0.1%
div { block } 107,786 ± 0.4% 0.0093 7.00 2.08x slower +0.0%
span(text, class:) 29,174 ± 0.2% 0.0343 207 7.68x slower +3.4%
div(class:) { block } 26,935 ± 0.7% 0.0371 207 8.32x slower +1.4%
a(text, href:, class:) 22,064 ± 0.8% 0.0453 207 10.16x slower +1.5%

tag_bench (pure Ruby) · peak RSS 26 MB

Benchmark i/s ms / call allocs / call vs fastest Δ vs main
br 80,748 ± 0.5% 0.0124 107 fastest +0.3%
div { block } 62,379 ± 0.5% 0.0160 107 1.29x slower +2.4%
li(text) 53,533 ± 0.3% 0.0187 107 1.51x slower +2.3%
li(dirty text) 39,836 ± 0.9% 0.0251 207 2.03x slower +2.3%
div(class:) { block } 14,688 ± 0.4% 0.0681 207 5.50x slower +0.0%
span(text, class:) 14,396 ± 0.4% 0.0695 207 5.61x slower +0.2%
a(text, href:, class:) 9,361 ± 0.5% 0.1068 207 8.63x slower +0.5%

Rails request (C ext) · peak RSS 219 MB

Benchmark i/s ms / call allocs / call vs fastest Δ vs main
Ruby2html::Component 398 ± 2.0% 2.5100 4,862 fastest -0.2%
Slim 377 ± 6.9% 2.6533 4,517 1.06x slower -3.1%
ViewComponent + ruby2html 375 ± 3.2% 2.6636 4,719 1.06x slower -1.3%
ERB 367 ± 5.2% 2.7261 3,222 1.09x slower -2.1%
ruby2html .html.rb templates 351 ± 4.8% 2.8475 5,012 1.13x slower -10.7%
Phlex 321 ± 4.4% 3.1170 6,351 1.24x slower -9.5%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant