Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Herb in Rails 8.2: Your ERB views, now HTML-awa...

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on. →

Herb in Rails 8.2: Your ERB views, now HTML-aware @ Deccan Queen on Rails 2026, Pune, India

With teams, companies, and open source projects adopting Herb, it’s proving itself at scale and is on track to become an opt-in view engine in Rails 8.2.

This talk explores what Herb brings to Rails, from its ActionView integration to the tooling and developer experience it unlocks. Then I’ll introduce the first production-ready version of ReActionView, bringing Phoenix LiveView-like fine-grained reactivity to standard HTML+ERB templates. Optional, gradual, no JavaScript framework, no new file format.

Avatar for Marco Roth

Marco Roth

October 08, 2026

More Decks by Marco Roth

Other Decks in Programming

Transcript

  1. Marco Roth Herb in Rails 8.2: Your ERB views, now

    HTML-aware Oct 08, 2026 - Deccan Queen on Rails, Pune, India
  2. 🌐 marcoroth.dev Marco Roth ! Full-Stack Developer & Open Source

    Contributor  @marcoroth  @[email protected]  @marcoroth_  @marcoroth.dev
  3. Marco Roth Herb in Rails 8.2: Your ERB views, now

    HTML-aware Oct 08, 2026 - Deccan Queen on Rails, Pune, India
  4. The View Layer in Rails doesn't scale the same way

    as the rest of the framework does.
  5. The design goal for Herb tooling was to be fully

    backwards compatible for existing HTML+ERB files
  6. I was curious if we can do the same for

    templating, reactivity, and interactivity.
  7. I wanted to explore if there is a way how

    I can revisit some of the old and untapped ideas from StimulusReflex
  8. Level 1 - Better Errors Messages Level 2 - HTML-aware

    Engine Level 3 - Action View Optimizations Level 4 - Reactive ERB Views Level 5 - Client-side Templates Level 6 - External Components
  9. <section> <h2><%= @title %></h2> <ul> <% @albums.each do |album| %>

    <li id="<%= album.id %>"> <%= album.name %> </li> <% end %> </ul> </section>
  10. <section> <h2><%= @title %></h2> <ul> <% @albums.each do |album| %>

    <li id="<%= album.id %>"> <%= album.name %> </li> <% end %> </ul> </section>
  11. <section> <h2><%= @title %></h2> <ul> <% @albums.each do |album| %>

    <li id="<%= album.id %>"> <%= album.name %> </li> <% end %> </ul> </section>
  12. <section> <h2><%= @title %></h2> <ul> <% @albums.each do |album| %>

    <li id="<%= album.id %>"> <%= album.name %> </li> <% end %> </ul> </section>
  13. Both the server and the client have a map of

    where the dynamic slot values go
  14. <%# herb:state (show: false) %> <button>Show Details</button> <% if show?

    %> <span>Here are the details!</span> <% end %>
  15. <%# herb:state (q: "") %> <input value="<%= q %>"> <%

    if q.present? %> <p><%= Topic.search(q).count %> results</p> <% end %>
  16. The compiler prepares the view in a way so the

    client knows on which state change it has to rerequest the data
  17. If you need to, there is a JavaScript API you

    can use to interact with the client runtime directly
  18. <style scoped> .example { color: red; } </style> <template> <div

    class="example"> Hello World </div> </template>
  19. <style scoped> .example { color: red; } </style> <template> <div

    class="example"> Hello World </div> </template>
  20. <style scoped> .example { color: red; } </style> <template> <div

    class="example"> Hello World </div> </template>
  21. <script scoped> let show = false function toggle(){ show =

    !show } </script> <div data-herb-action="toggle">Toggle</button> <% if show? %> Show it! <% end %>
  22. And, how we can go back to just keep writing

    ERB views and get fully reactive UIs
  23. And in case you'd want to use React or existing

    components, that you still have a way to use them alongside your ERB views
  24. I would love to talk to you if you have

    ideas or opinions about the things I have shown today.