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

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

Avatar for Marco Roth Marco Roth
September 29, 2026

Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rocky Mountain Ruby 2026, Boulder, Colorado

With teams, companies, and open source projects adopting Herb in their daily workflows, the foundation is 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: how it integrates with ActionView and the tooling and developer experience every Rails developer gains as a result.

But that's only the beginning. To complete the Hotwire story, Rails needs reactivity.

Herb's understanding of HTML and ERB makes this possible. I'll introduce the first production-ready version of ReActionView, bringing Phoenix LiveView-like fine-grained reactivity to standard Rails templates. Fully optional. Gradual to adopt. No JavaScript framework. No new file format.

Your HTML+ERB templates, now reactive.

Avatar for Marco Roth

Marco Roth

September 29, 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 Sep 29, 2026 - Rocky Mountain Ruby, Boulder, Colorado
  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 Sep 29, 2026 - Rocky Mountain Ruby, Boulder, Colorado
  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. And, how we can go back to just keep writing

    ERB views and get fully reactive UIs
  19. 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
  20. I would love to talk to you if you have

    ideas or opinions about the things I have shown today.