David Heinemeier Hansson

December 7, 2021

The time is right for Hotwire

It's not exactly been a big secret that I've harbored a fair skepticism towards single-page applications over the years. Not because of some innate animosity with JavaScript, at least not the modern variety, which we first tasted in the form of CoffeeScript, then as transpiled ES Next. But because writing and updating HTML like that never felt like an appropriate solution for the kind of apps I was interested in writing.

Such resistance to the proliferation of JavaScripting Everything turned into a minority position in years past. It seemed for a while that everyone were simultaneously obsessed with React, GraphQL, and the endless variations on the theme. This was The New Thing, and the wave of exuberance washed over all objections. For a while.

That might sound bitter, but I say it with a smile, and with fondness. No, really. New approaches must be overused before we can identify the borders of fitness. I had a front row seat when the same show played out with Ruby on Rails in the mid-to-late 2000s.

Infatuation is what this industry does. And while that has its drawbacks with the constant churn, the tribalism, and the amnesia of solutions past, it's also a tremendous source of energy and experimentation. You can't have one without the other.

But equally so, I now smile because the infatuation with single-page applications is ending. We've long since seen the peak. That doesn't mean the decline is in any way terminal. I'm sure we'll see many more applications done in this mold in time to come. But the monopolization of attention within the web development community is over, and has been for a while. Good.

Better still, this new mind space and openness created by a shrinking focus on single-page applications is enriched by the scars collected during its exclusivity. Much like the energy for Rails in 2004 was drawn from frustrated Java and curious PHP programmers working the XML sit-ups and tangling with the spaghetti. The seeds of interest are sown with the discontent of the immediate past.

That process just takes time. Years, even. A countermelody to the hegemony of single-page application techniques just couldn't resonate in 2015. But now, five-plus years later, there are enough people who gave this approach an earnest shot and concluded "this just isn't for me". Or at least, "this just isn't for me, given the type of problems I'm solving". These people are open to a change. You might be one of them.

Such a change is Hotwire. HTML Over The Wire. I've already written at length about what inspired and propelled this vision for web development, so let's focus into on the resonance. I've had a whole host of conversations with organizations big and small lately who've all seem to come to the same realization at the same time that the single-page application approach just wasn't serving them well, and now they either have or plan to replace it with Hotwire.

It's funny how the mood of the moment seems to magically appear for so many people at exactly the same time. Just like it did with Rails in the mid 2000s. Just like it did with SPAs in the mid 2010s. The butterfly of an idea flaps its wings years prior, and suddenly a hurricane of interest emerges in the present.

It's within this hurricane that I'm thrilled we'll insert Hotwire as the default front-end answer in Rails 7, which is due this month. All these compounding factors coming together to accelerate a new direction. Years and years of code, advocacy, and refinement meeting its moment. It's a delight to see.

If you've been beyond-the-SPA curious, now is a great time to checkout the alternative answers offered by Hotwire. And if you want to taste it as part of a fully-integrated omakase menu, Rails 7 offers it. Enjoy!