
· rails · 2 min read
Unpoly outclasses Hotwire
Unpoly vs Hotwire... both are pushing the frontend in the same direction, but Unpoly made it with more simplicity. Here is why.
What Unpoly and Hotwire share
Here is what do they have in common :
- Both are frontend web tools
- Both aim to “make web UI snappy like React”, without using any React-like framework
- Both tries to respect the web “as it is”, avoiding un-necessary JS layer
- Both play with plain old HTML render (like Laravel, Rails or Django)
- Both are born inside a Ruby-on-Rails based company
Now here is how Unpoly and Hotwire complexity compares, and why I think Unpoly is so far the best front-end tool, at least in terms of low-tech and low-complexity.
Lowering front end complexity
I’m not a good drawer I know, but here is the idea :
Hotwire is far simpler than React.
But Unpoly is even simpler.
However, if you try to go back to plain old vanillaJS/jQuery, you end up with a complexity that is even worse than React.
Why is that?
React seems to be go-to front end tools nowadays.
But if you use Hotwire, you will reduce the complexity, just by cutting off the quantity of LOC in the frontend.
Remember that a huge quantity of LOC is harder to maintain than a smaller one, even if the code is clean or IA-generated.
I’ve seen a Reddit comment saying that using Hotwire reduce by 70% the code required to get things done.
So is Hotwire a move in the correct direction ? I think so.
However…
Unpoly is simpler than Hotwire
Hotwire means a lot of convention to remember.
Hotwire means a fair effort of training before using it - BTW there is an incredibly good Hotwire tutorial.
Unpoly is the opposite.
Less code, less convention, almost no need of training, once you grab the Unpoly demo.
There is no tutorial about Unpoly because it’s incredibly easy.
Also no need for the server to know about Unpoly. You just render plain old HTML.
One last thing is that I can chirurgically target what element to replace, whereas Turbo swaps the whole body of HTML.
Summary
For personal project, you don’t need a React-like framework - it’s probably another story inside big companies.
Just use plain old HTML, and augment it with JS with the tool that creates the smallest amount of friction(s).
For me, it’s Unpoly.