HTML-Aware ERB: The Path to Reactive Rendering

ERB templates in Ruby are traditionally rendered by engines that treat templates as string generators, which makes it difficult to reason about HTML structure, state changes, or incremental updates. These limitations become especially visible in modern HTML-over-the-wire workflows.

In this talk, we explore what it would take to build a reactive ERB rendering engine. We begin by revisiting how existing ERB engines compile templates into Ruby code and look at how recent advances in HTML-aware parsing and tooling make new approaches possible.

Using Herb::Engine as a concrete example, we examine how structural understanding enables state-aware rendering, diff-based updates, and a more responsive development experience, including instant updates without full page reloads, rich in-browser developer tools. Such as template outlines, partial and ERB structure views, jump-to-source navigation, and many other innovations.

  • Marco Roth
    Marco Roth

    Marco is a passionate full-stack developer and a dedicated open-source contributor. He is the creator of Herb, an HTML-aware ERB parser and tooling foundation, and ReActionView, an experimental initiative exploring structured and reactive view rendering in Ruby. He has open-sourced, maintained, and contributed to numerous libraries in the Ruby ecosystem and was awarded the Rails Luminary Award in 2025.