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

Reactive Rails Views, No Rewrite Required @ Sa...

Marco Roth
November 11, 2026

Reactive Rails Views, No Rewrite Required @ San Francisco Ruby Conference 2026

What if your existing Rails views could become reactive without rewriting them? In this talk, we'll explore how ReActionView brings fine-grained reactivity to HTML+ERB while staying compatible with Action View. We'll look at how existing templates can become reactive, how updates are tracked and rendered, and what this could mean for the future of the Rails view layer.

https://sfruby.com/?speaker=marco-roth

Marco Roth

November 11, 2026

Transcript

170 slides
  1. Reactive Rails Views, No Rewrite Required Marco Roth November 11,

    2026 - San Francisco Ruby Conference 2026
  2. 🌐 marcoroth.dev Marco Roth ! Full-Stack Developer & Open Source

    Contributor  @marcoroth  @[email protected]  @marcoroth_  @marcoroth.dev
  3. 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
  4. <section> <h2><%= @title %></h2> <ul> <% @albums.each do |album| %>

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

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

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

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

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

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

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

    client knows on which state change it has to rerequest the data
  12. # app/views/home/show.html.erb <%# herb:state (progress: @import.progress) shared: @import %> <progress

    value="<%= progress %>" max="100"></progress> # app/models/import.rb import.update!(progress: 50)
  13. If you need to, there is a JavaScript API you

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

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

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

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

    !show } </script> <div data-herb-action="toggle">Toggle</button> <% if show? %> Show it! <% end %>
  18. // show.scoped.js let show = false function toggle(){ show =

    !show } <!-- show.html.erb --> <div data-herb-action="toggle">Toggle</button> <% if show? %> Show it! <% end %>
  19. Gems can export Herb Components and the engine takes care

    of the assets, styles, javascript and bundling.
  20. app/views/home/show.html.erb <script scoped> import { Chart } from "chart-library" </script>

    <Chart points="<%= @points %>"> <p>Loading chart…</p> </Chart>

More Decks by Marco Roth

Other Decks in Technology