Herb in Rails 8.2: Your ERB views, now HTML-aware @ Kaigi on Rails 2026, Tokyo, Japan
by
Marco Roth
×
Copy
Open
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Slide 1
Slide 1 text
Marco Roth Herb in Rails 8.2: Your ERB views, now HTML-aware Oct 16, 2026 - Kaigi on Rails, Shibuya, Tokyo, Japan
Slide 2
Slide 2 text
🌐 marcoroth.dev Marco Roth ! Full-Stack Developer & Open Source Contributor @marcoroth @
[email protected]
@marcoroth_ @marcoroth.dev
Slide 3
Slide 3 text
No content
Slide 4
Slide 4 text
Developer Tooling & Developer Experience
Slide 5
Slide 5 text
No content
Slide 6
Slide 6 text
Herb
Slide 7
Slide 7 text
No content
Slide 8
Slide 8 text
Marco Roth Herb in Rails 8.2: Your ERB views, now HTML-aware Oct 16, 2026 - Kaigi on Rails, Shibuya, Tokyo, Japan
Slide 9
Slide 9 text
What is Herb?
Slide 10
Slide 10 text
What is Herb? What ships in Rails 8.2?
Slide 11
Slide 11 text
What is Herb? What ships in Rails 8.2? What does this enable?
Slide 12
Slide 12 text
What is Herb?
Slide 13
Slide 13 text
A modern templating language for the HTML+ERB you already have.
Slide 14
Slide 14 text
One language and toolchain that understands your HTML and Ruby together.
Slide 15
Slide 15 text
Prism Parser
Slide 16
Slide 16 text
Herb has full semantic and structural understanding of your HTML views.
Slide 17
Slide 17 text
Linter Formatter Language Server Engine Dev Tools Dev Server
Slide 18
Slide 18 text
No content
Slide 19
Slide 19 text
No content
Slide 20
Slide 20 text
No content
Slide 21
Slide 21 text
herb dev
Slide 22
Slide 22 text
No content
Slide 23
Slide 23 text
No content
Slide 24
Slide 24 text
Herb helps you in development, in your editor, in CI, and when rendering your views.
Slide 25
Slide 25 text
What ships in Rails 8.2?
Slide 26
Slide 26 text
Action View
Slide 27
Slide 27 text
Herb? Action View
Slide 28
Slide 28 text
index.html.erb
Slide 29
Slide 29 text
index.html.erb action
Slide 30
Slide 30 text
index.html.erb action format
Slide 31
Slide 31 text
index.html.erb action format handler
Slide 32
Slide 32 text
Herb is the new default for the HTML format
Slide 33
Slide 33 text
format == :html && handler == :erb
Slide 34
Slide 34 text
*.html.erb → Herb
Slide 35
Slide 35 text
*.html.erb → Herb *.****.erb → Erubi
Slide 36
Slide 36 text
bin/rails herb:check
Slide 37
Slide 37 text
config.action_view .erb_implementation=
Slide 38
Slide 38 text
config/application.rb config.load_defaults 8.2
Slide 39
Slide 39 text
Rails 8.2 defaults .erb_implementation = :herb
Slide 40
Slide 40 text
Restore previous behavior .erb_implementation = :erubi
Slide 41
Slide 41 text
No content
Slide 42
Slide 42 text
LSP features
Slide 43
Slide 43 text
Find all references Workspaces Support Hover Previews Extract to Partial Cross File Diagnostics
Slide 44
Slide 44 text
Runtime Instrumentation
Slide 45
Slide 45 text
ActiveSupport::Notifications .subscribe("sql.active_record") do |*, payload| Herb::Engine::Report::Session.observe( :queries, payload ) end
Slide 46
Slide 46 text
Runtime Diagnostics
Slide 47
Slide 47 text
No content
Slide 48
Slide 48 text
No content
Slide 49
Slide 49 text
No content
Slide 50
Slide 50 text
LSP Runtime Inlay Hints
Slide 51
Slide 51 text
No content
Slide 52
Slide 52 text
No content
Slide 53
Slide 53 text
No content
Slide 54
Slide 54 text
68 new linter rules
Slide 55
Slide 55 text
No content
Slide 56
Slide 56 text
166 linter rules
Slide 57
Slide 57 text
No content
Slide 58
Slide 58 text
No content
Slide 59
Slide 59 text
https://herb-tools.dev/blog/whats-new-in-herb-v0-11
Slide 60
Slide 60 text
What does this enable?
Slide 61
Slide 61 text
The Herb foundation is available in all new apps
Slide 62
Slide 62 text
The Compiler as a Platform
Slide 63
Slide 63 text
One-Person Framework
Slide 64
Slide 64 text
Rails 7 brought a lot of simplification with Hotwire
Slide 65
Slide 65 text
HTML-over-the-wire
Slide 66
Slide 66 text
Rails 8 brought a lot of simplification with the Solid Trifecta
Slide 67
Slide 67 text
The View Layer in Rails doesn't scale the same way as the rest of the framework does.
Slide 68
Slide 68 text
What becomes possible when the engine and runtime also understand HTML?
Slide 69
Slide 69 text
How can we evolve Hotwire so you can build competitive, modern, and ambitious UIs?
Slide 70
Slide 70 text
What does it take to complete the Hotwire story?
Slide 71
Slide 71 text
Reactivity
Slide 72
Slide 72 text
Fine-grained reactivity
Slide 73
Slide 73 text
The design goal for Herb tooling was to be fully backwards compatible for existing HTML+ERB files
Slide 74
Slide 74 text
I was curious if we can do the same for templating, reactivity, and interactivity.
Slide 75
Slide 75 text
I wanted to explore if there is a way how I can revisit some of the old and untapped ideas from StimulusReflex
Slide 76
Slide 76 text
No content
Slide 77
Slide 77 text
No content
Slide 78
Slide 78 text
ActionView
Slide 79
Slide 79 text
ActionView Reimagined
Slide 80
Slide 80 text
ActionView Reimagined Reengineered
Slide 81
Slide 81 text
ActionView Reimagined Reengineered Reactive
Slide 82
Slide 82 text
No content
Slide 83
Slide 83 text
No content
Slide 84
Slide 84 text
ReActionView v0.6
Slide 85
Slide 85 text
Reactivity for the HTML+ERB you already have.
Slide 86
Slide 86 text
Everything a clientside framework gives you, without adopting one.
Slide 87
Slide 87 text
And the best thing?
Slide 88
Slide 88 text
You already wrote a ReActionView template.
Slide 89
Slide 89 text
Your existing HTML+ERB views are now reactive.
Slide 90
Slide 90 text
6 Adoption Levels of ReActionView
Slide 91
Slide 91 text
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
Slide 92
Slide 92 text
Slots
Slide 93
Slide 93 text
<%= @title %>
<% @albums.each do |album| %>
<%= album.name %>
<% end %>
Slide 94
Slide 94 text
<%= @title %>
<% @albums.each do |album| %>
<%= album.name %>
<% end %>
Slide 95
Slide 95 text
<%= @title %>
<% @albums.each do |album| %>
<%= album.name %>
<% end %>
Slide 96
Slide 96 text
<%= @title %>
<% @albums.each do |album| %>
<%= album.name %>
<% end %>
Slide 97
Slide 97 text
Herb fully understands what the view is doing
Slide 98
Slide 98 text
So we can compile the template into two formats to support reactivity.
Slide 99
Slide 99 text
One for the regular render, and one for this new slots format
Slide 100
Slide 100 text
Hello, <%= @title %>!
Slide 101
Slide 101 text
Hello, Kaigi on Rails!
Slide 102
Slide 102 text
Hello, Kaigi on Rails!
Slide 103
Slide 103 text
Hello, Kaigi on Rails!
Slide 104
Slide 104 text
Hello, Kaigi on Rails!
Slide 105
Slide 105 text
Hello, Kaigi on Rails!
Slide 106
Slide 106 text
Hello, Tokyo!
Slide 107
Slide 107 text
Both the server and the client have a map of where the dynamic slot values go
Slide 108
Slide 108 text
Wherever new values come from, the client knows how to update it.
Slide 109
Slide 109 text
ERB Output Collections/Loops Conditionals
Slide 110
Slide 110 text
No page reloads. No DOM-morphing.
Slide 111
Slide 111 text
<%= Time.current %>
Slide 112
Slide 112 text
<%= Time.current %> Refresh
Slide 113
Slide 113 text
<%= Time.current %> Refresh
Slide 114
Slide 114 text
GET /demo Accept: application/vnd.herb.slots+json
Slide 115
Slide 115 text
def show end
Slide 116
Slide 116 text
def show respond_to do |format| format.html end end
Slide 117
Slide 117 text
def show respond_to do |format| format.html format.slots end end
Slide 118
Slide 118 text
GET /demo Accept: application/vnd.herb.slots+json { "template": "app/views/demo/show.html.erb", "version": "ddfca612", "occurrence": 0, "slots": { "0": "2026-09-24 12:14:38 +0200" } }
Slide 119
Slide 119 text
GET /demo Accept: application/vnd.herb.slots+json { "template": "app/views/demo/show.html.erb", "version": "ddfca612", "occurrence": 0, "slots": { "0": "2026-09-24 12:14:38 +0200" } }
Slide 120
Slide 120 text
State
Slide 121
Slide 121 text
Not every UI interaction should require a serverroundtrip
Slide 122
Slide 122 text
Typically you would reach for Stimulus
Slide 123
Slide 123 text
But, what if you could just write this in ERB?
Slide 124
Slide 124 text
Show Details <% if show? %>
Here are the details!
<% end %>
Slide 125
Slide 125 text
<%# herb:state (show: false) %> Show Details <% if show? %>
Here are the details!
<% end %>
Slide 126
Slide 126 text
<%# herb:state (show: false) %> Show Details <% if show? %>
Here are the details!
<% end %>
Slide 127
Slide 127 text
<%# herb:state (show: false) %> Show Details <% if show? %>
Here are the details!
<% end %>
Slide 128
Slide 128 text
<%# herb:state (show: false) %> Show Details <% if show? %>
Here are the details!
<% end %>
Slide 129
Slide 129 text
<%# herb:state (show: false) %> Show Details <% if show? %>
Here are the details!
<% end %>
Slide 130
Slide 130 text
data-herb-set data-herb-action data-herb-toggle data-herb-increment data-herb-decrement
Slide 131
Slide 131 text
Two-way bindings
Slide 132
Slide 132 text
Slide 133
Slide 133 text
<%# herb:state (message: "") %>
Slide 134
Slide 134 text
You now got a twoway binding
Slide 135
Slide 135 text
<%# herb:state (message: "") %>
<%= message.length %> characters
Slide 136
Slide 136 text
No network request needed
Slide 137
Slide 137 text
No custom JavaScript needed
Slide 138
Slide 138 text
Just pure understanding and efficient updates
Slide 139
Slide 139 text
No Ruby to JavaScript transpilation
Slide 140
Slide 140 text
So we don't need to run Ruby in WebAssembly in the browser
Slide 141
Slide 141 text
ReActionView sees all the methods that are being called on a herb:state local variable
Slide 142
Slide 142 text
The compiler understands a subset of Ruby that it can wire into the reactivity model
Slide 143
Slide 143 text
That way, it can run fully client-side without a server round-trip
Slide 144
Slide 144 text
For everything the compiler doesn't support, we do a network request
Slide 145
Slide 145 text
<%# herb:state (q: "") %> <% if q.present? %>
<%= Topic.search(q).count %> results
<% end %>
Slide 146
Slide 146 text
The compiler prepares the view in a way so the client knows on which state change it has to rerequest the data
Slide 147
Slide 147 text
When the client has to request it, the server knows how to respond
Slide 148
Slide 148 text
and the client knows how to update and insert the new dynamic slot values
Slide 149
Slide 149 text
No Turbo Frames No Turbo Streams No new route
Slide 150
Slide 150 text
Just pure understanding of the view and finegrained reactivity.
Slide 151
Slide 151 text
Lazy Loading
Slide 152
Slide 152 text
<%= Stats.slow_query %>
Slide 153
Slide 153 text
<%= Stats.slow_query %>
Slide 154
Slide 154 text
<%= Stats.slow_query %>
Slide 155
Slide 155 text
<%= Stats.slow_query %>
Slide 156
Slide 156 text
No content
Slide 157
Slide 157 text
No content
Slide 158
Slide 158 text
Optimistic UI
Slide 159
Slide 159 text
No content
Slide 160
Slide 160 text
You can do a lot with pure ERB
Slide 161
Slide 161 text
If you need to, there is a JavaScript API you can use to interact with the client runtime directly
Slide 162
Slide 162 text
Which also allows to build even more ambitious UIs, or allows to wire up NPM packages
Slide 163
Slide 163 text
bundle add reactionview rails generate reactionview:install
Slide 164
Slide 164 text
reactionview.dev demo.reactionview.dev
Slide 165
Slide 165 text
Outlook/Vision
Slide 166
Slide 166 text
Slide 167
Slide 167 text
.example { color: red; }
Hello World
Slide 168
Slide 168 text
.example[data-v-f3f3eg9] color: red; }
Hello World
Slide 169
Slide 169 text
lightningcss-ruby
Slide 170
Slide 170 text
Slide 171
Slide 171 text
let show = false function toggle(){ show = !show }
Toggle <% if show? %> Show it! <% end %>
Slide 172
Slide 172 text
oxc-ruby
Slide 173
Slide 173 text
rolldown-ruby
Slide 174
Slide 174 text
Offline Mode React Components Herb Components for gems Client-side routing
Slide 175
Slide 175 text
Conclusion
Slide 176
Slide 176 text
I'm really happy with the direction Herb and ReActionView are taking and how they are shaping up
Slide 177
Slide 177 text
And, how we can go back to just keep writing ERB views and get fully reactive UIs
Slide 178
Slide 178 text
I believe that this offers a great foundation for the future of the Rails frontend
Slide 179
Slide 179 text
Expand what's possible with Hotwire today
Slide 180
Slide 180 text
The idea is to offer a spectrum for teams to adopt
Slide 181
Slide 181 text
Allow people to write more JavaScript if the application needs it
Slide 182
Slide 182 text
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
Slide 183
Slide 183 text
Without having to abandon the full-stack approach that makes Rails so special
Slide 184
Slide 184 text
No content
Slide 185
Slide 185 text
ReActionView has become what I always wanted StimulusReflex to be
Slide 186
Slide 186 text
But I'm sure there are more things we can do, improve, and iterate on.
Slide 187
Slide 187 text
But I can't do it all by myself, I need your input.
Slide 188
Slide 188 text
I would love to talk to you if you have ideas or opinions about the things I have shown today.
Slide 189
Slide 189 text
Or if you are still skeptical and have questions on where things are heading
Slide 190
Slide 190 text
I would love to hear your input
Slide 191
Slide 191 text
Acknowledgments
Slide 192
Slide 192 text
No content
Slide 193
Slide 193 text
No content
Slide 194
Slide 194 text
github.com/sponsors/marcoroth
Slide 195
Slide 195 text
Thank you for the continued support!
Slide 196
Slide 196 text
Please try the tools, report issues, and give feedback.
Slide 197
Slide 197 text
No content
Slide 198
Slide 198 text
No content
Slide 199
Slide 199 text
herb-tools.dev reactionview.dev
Slide 200
Slide 200 text
No content
Slide 201
Slide 201 text
No content
Slide 202
Slide 202 text
Thank you " @marcoroth 🌐 marcoroth.dev @marcoroth_ @marcoroth.dev @
[email protected]
/in/marco-roth