HTMX + Alpine.js vs. Unpoly?

I am currently debating between using Unpoly or using HTMX + Alpine.js as a replacement for my currently just sprinkles of vanilla.js.

Both options are great but just wondering what other people in the Django community think about these libraries? And which option they are going with?

As a quick summary:
Unpoly is the more batteries-included option, older project born out of a rails shop I believe. I like many things about the project especially that it better handles progressive enhancement / graceful degradation than htmx + alpine.js. But it’s an older project with seemingly much less developer resources and mindshare behind it now.

Htmx + alpine are more or less the new kids on the block. Htmx is basically the successor to intercooler.js so not radically new, but the important part is htmx + alpine seems to have much more developer resources and mindshare behind it now.

As such, it seems like the htmx + alpine combo is going to develop faster, for better or worse. and likely have a more thriving ecosystem around it. For that reason I’m inclined to go with htmx + alpine. I do really like many aspects of Unpoly though like their better support for no-js options, but that’s probably just the dinosaur in me.

So yeah, is anyone else playing with these libraries? What do you think?

1 Like

I have used both Unpoly and HTMX for projects that are now in production. I think they are both great libraries, but they have different strengths.

I think that Unpoly is fantastic if you already have a site that works and you just want to add that ajax-y “magic” that cuts down on all the full page loads and yields a more modern feel. I also think it’s a safe choice: the 2.0 release earlier this year was a big deal and provides some really great improvements, and the dev team is very responsive on github.

If I were building something from the ground up on the other hand, I’d probably go with HTMX and either its cousin Hyperscript or Alpine.js to handle state and other things that HTMX doesn’t handle itself. HTMX definitely has incredible buzz behind it at the moment. I think this has a lot to due with its developer being willing to make the rounds on various podcasts and such. He’s done a great job at evangelizing not only his library, but a “new” (old, really!) way of thinking about web development in general that is getting a lot of people excited.

2 Likes

I’ve never used unpoly, but I’m a big fan of the Alpine + HTMX stack!

I think it’s worth noting that at DjangoCon EU there was 1 HTMX talk, and a few months later at DjangoCon US there were 3 (I’m not aware of any on unpoly). I’m also seeing a lot more buzz around HTMX specifically in the Django community on reddit, Twitter, etc. (and I hardly ever hear unpoly mentioned). So if your primary goal is community adoption and mindshare then I agree that HTMX appears to be the direction the community is moving in and I only see that growing over time.

In case you missed it, this guide (mine) might be a good place to get started if you do go the HTMX/Alpine route: Django, HTMX and Alpine.js: Modern websites, JavaScript optional

2 Likes