TGViewer
samdark blog ☕️ (Alexander Makarov) samdark blog ☕️ (Alexander Makarov) @samdark_blog · 1.62K subscribers
Post #116 2.38K
Client-side apps and htmx

There's a certain amount of hype about htmx now.

⭐️ The idea is that some websites are not meant to be SPA (single page apps) but there are some nice things SPAs do such as making content load asynchronously without page reload. To achieve it, the JS library uses content negotiation and backend, depending on what's requested, either answers with full page HTML or just the block of HTML that is meant to be replaced.

📕 The approach isn't new. I've implemented Stay project web like that in 2012 and it worked quite well back then (except that there was a mobile app with offline capabilities and we needed API anyway). Two years later, pjax, created by GitHub founder in 2011, was included into Yii2. Then came Turbolinks from DHH, creator of RoR and Basecamp that eventually superseded by Hotwire used in Hey email service. The same idea lies within livewire that repeated the path in 2019 and other alternatives.

The htmx itself isn't new as well. It was named intercooler.js and first version came up about 2013.

💭 The approach itself works but not for everything. It won't work well if:

1. You need a native mobile app and API for it. You'll have to support both serverside HTML generation and API at the backend + rendering on the mobile app which is more similar to SPA than to serverside rendering.
2. You have a really complex UI. That's the valid case for SPA.


⭐️ If you do something for 10 years, it usually takes a complete shape so I recommend to at least read its docs and think about the approach overall.
  • 👍 17
  • 🔥 2
More from @samdark_blog
  1. Oct 1, 2026🔶 Стратоплан - Технический директор. Управление технологиями и людьми - №1 Давно хотел уп…
  2. Sep 29, 2026⚖️ Cost of failure The cost of failure is very different in different projects. Many thing…
  3. Sep 28, 2026🚀 Benchmarking YiiPress vs Hugo I love Hugo, ran a blog on it for some time and it was wh…
  4. Sep 28, 2026Компилируемый PHP: перспективы и возможности 👤 Дмитрий Dantes Первый доклад Пыхник’26 — о…
  5. Sep 27, 2026💡 Feedback loop on quality gate LLM outputs can be wrong both randomly and consistently.…
  6. Sep 27, 2026Fear is the mind-killer “I must not fear. Fear is the mind-killer. Fear is the little-deat…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →