But, I’m going to get into this later: that ship might have sailed…
Rich Harris - Have SPA’s Ruined The Web?
A concept we like to talk about is “The HOWL Stack”. HOWL stands for Hypermedia On Whatever you’d Like.
The TLDR of The HOWL Stack is this: when you use a hypermedia-driven approach for your web application, you free yourself up to choose whatever server-side technology best fits your problem and your own technical tastes.
Given that, the following question inevitably will come up:
This is a reasonable question to ask and there are a lot of advantages to adopting the same programming language on both sides of the wire:
Browsers offer excellent HTML support (and the related Document Object Model, or DOM). In fact, even if you are using an SPA framework, you will be working with that hypermedia infrastructure in some form (via JSX templates, for example) if only to create UIs that a browser can understand.
So you are going to be using HTML or the related DOM APIs in some manner in your web application.
Well, what if we made HTML a more powerful hypermedia?
That’s the idea of htmx, which makes it possible to implement common modern web application patterns using the hypermedia approach. This closes the UX gap between traditional MPAs and SPAs, making taking the hypermedia route feasible for a much larger set of web applications.
Once you adopt this hypermedia approach (and remember, you are going to be using hypermedia infrastructure anyway, so why not leverage it as much as possible?) a surprising side effect occurs:
Suddenly, the advantage of server-side language choice that Harris attributed to MPAs is back on the table.
You can now make your server-side language (and framework) choice based on other considerations: technical, aesthetic or otherwise:
These are all perfectly reasonable technical, philosophical and aesthetic perspectives.
And, by adopting hypermedia as your primary front-end technology, you pursue any of these goals without a bicameral code-base. Hypermedia doesn’t care what you use to produce it: you can use hypermedia on whatever you’d like.
And when we say “whatever”, we really mean it.
Here is a screenshot of the htmx discord’s HOWL subsection recently. Note that these are just the channels that happen to have active traffic, there are many more.
You can see we have ongoing conversations in a bunch of different programming languages and frameworks: Java, Go, .NET, Rust, Clojure, PHP, Ruby, Python, Ocaml. We even have some folks talking about using htmx with Bash and Cobol!
This is exactly the future that we want to see: a rich and vibrant Web in which every back-end language and framework can play as an equal & interesting alternative. Each language and framework has their own unique strengths & cultures and each can contribute to the magical hypermedia system that is The Web.
It might be the best option for you and your team, and there is no reason not to use it in that case.
Hypermedia On Whatever you’d Like means just that: whatever you’d like.
With the resurgence of interest in (and improvements of) hypermedia, an open and diverse future for The Web is now a real possibility, if not an emerging reality.
The Web was designed to be an open, polyglot & participative hypermedia system.
And the ship hasn’t sailed on that dream, at least not yet!
We can keep that dream alive by re-learning and re-embracing the foundational technology of the web: hypermedia.
I hate that the htmx community has devolved into builders helping each other without regard for likes, engaging those who don’t follow the hype, expanding sound bytes into nuance. It may not score cheap social media points, but it’s healthy. The web used to be worse than this.