<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/let-s-make-the-worst-htmx-er3ovizzf" -->

---
title: Let's make the worst Htmx | daily.dev
description: A hands-on walkthrough of building a minimal htmx clone from scratch in ~40 lines of JavaScript. Covers the core 'scan + send + swap' loop, HTTP method...
canonical: https://daily.dev/posts/let-s-make-the-worst-htmx-er3ovizzf
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Let's make the worst Htmx | daily.dev
og:description: A hands-on walkthrough of building a minimal htmx clone from scratch in ~40 lines of JavaScript. Covers the core 'scan + send + swap' loop, HTTP method...
og:url: https://daily.dev/posts/let-s-make-the-worst-htmx-er3ovizzf
og:image: https://api.daily.dev/og/posts/Er3OvIZzF.png
og:image:alt: Let's make the worst Htmx
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Let's make the worst Htmx

**[Hacker News](https://daily.dev/sources/hn)** · 10 min read · 1 upvotes · 0 comments

## Summary

A hands-on walkthrough of building a minimal htmx clone from scratch in ~40 lines of JavaScript. Covers the core 'scan + send + swap' loop, HTTP method handling, custom trigger parsing, flexible target resolution, and a custom event system. Shows how features like boosting, indicators, SSE, and URL history can be added as small plugins without touching the core library, using MutationObserver for efficient DOM rescanning after swaps.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://zserge.com/posts/worst-htmx-ever>

## Community take

How the wider developer community reacted, aggregated from 3 discussions and 38 comments across hackernews, lobsters (as of 2026-08-01).

**TL;DR:** The community is broadly curious and cautiously positive about HTMX, with some enthusiastic real-world success stories, but also genuine skepticism about its latency model, limitations for complex UIs, and supply-chain security claims.

**Sentiment:** 45% positive · 35% mixed · 20% skeptical

**The case for**

- Commenters note that network round-trips are only needed when the interaction actually requires server data, not for every UI event.
- Real-world users report dramatic performance improvements (smaller bundles, faster load times, less code) when migrating from React/Next.js to HTMX or Datastar.
- Vendoring the script avoids npm/node_modules supply chain exposure, which some developers find reassuring.
- HTMX pairs well with Alpine.js for client-side interactivity that doesn't need a server round-trip.

**The pushback**

- HTMX is seen as a poor fit for highly interactive UIs where every event would require a network request.
- Using hyperscript for anything advanced is cited as a significant pain point.
- Supply-chain security claims are contested — any dependency carries risk, and HTMX itself is not immune to vulnerabilities.
- One commenter dismisses it as a regression to 1990s Dynamic HTML with no meaningful advantages.

**By community**

- hackernews (mixed): Discussion is lively and split between enthusiastic adopters citing massive real-world gains and skeptics questioning the latency model, security claims, and suitability for complex apps.
- lobsters (mixed): No comments were present to assess sentiment.

**Hottest debate:** Whether HTMX's reliance on server round-trips for interactions is a fundamental architectural flaw or a non-issue for its intended use cases.

**Open questions**

- How does HTMX handle genuinely complex, highly interactive UI components without resorting to heavy client-side scripting?
- Is Datastar a better evolution of the HTMX model, and when should one be chosen over the other?
- What are the practical security boundaries of vendoring HTMX vs. pulling in npm dependencies?

**Highlights**

> I highly recommend everyone to give htmx or datastar a try, especially if your main experience is react or nextjs. We recently rewrote a half-million LOC codebase from react to datastar, with a detour through htmx first, and the results are staggering. First page load is 20KB down from a 750KB js bundle. 1 network request vs 40+ to render the page. Total load time 0.1 seconds down from 2 seconds of spinners. Page refresh is so fast, the browser doesn’t even flash (compared to parsing the reactjs bundle for a second). But the most staggering result is that in-document navigation over SSE achieves up to 5000:1 compression ratio for network requests within the Brotli compression window. When changing server state we rerender the entire page, like an immediate-mode game engine, and push it to the client over an SSE “fat morph”, in about 100 bytes. It’s so fast and so much more stable, our users are having fun. With a medical device. And this is about 50% less code to maintain for a VASTLY superior UIX. You are really missing out if you don’t learn how this works. It can give you a significant competitive edge if you care enough to try.
> — [Aeolos on hackernews](https://news.ycombinator.com/item?id=49131724)

> Huh, so every interactive event has a network request in the loop, with perceptible latency? And you still end up obligating client-side JS for the plumbing? I'd been meaning to look into HTMX but based on the content of this post it seems like a worst-of-all-worlds technical solution. Is it at least pleasant to work with?
> — [wren6991 on hackernews · 6 comments](https://news.ycombinator.com/item?id=49123080)

> It’s only has a network request in the loop if the interaction requires a network request. Htmx is a replacement for network interactions, not every bit of UI interactivity.
> — [simonbarker87 on hackernews](https://news.ycombinator.com/item?id=49129162)

> The problem with HTMX is not network traffic but needing to use hyperscript for anything advanced.
> — [yyyk on hackernews](https://news.ycombinator.com/item?id=49131174)

> Have a pretty large application running HTMX + WebComponents + Hono + Cloud Functions to serve up frontends, happy with it for about 2 years now
> — [n4pw01f on hackernews · 1 comments](https://news.ycombinator.com/item?id=49130557)

**Source threads**

- [hackernews](https://news.ycombinator.com/item?id=49107882) · 3 points · 0 comments
- [hackernews](https://news.ycombinator.com/item?id=49119270) · 42 points · 38 comments
- [lobsters](https://lobste.rs/s/9yyxpk/let_s_make_worst_htmx_ever) · 1 points · 0 comments

## Similar posts on daily.dev

- [A deep dive into HTMX](https://daily.dev/posts/a-deep-dive-into-htmx-uuhadafnq) · Flavio Copes · 1 upvotes · 0 comments
- [HTMX and Signals: Modern Frontend Without JavaScript Frameworks](https://daily.dev/posts/htmx-and-signals-modern-frontend-without-javascript-frameworks-fotyevidi) · SitePoint · 1 upvotes · 0 comments
- [HTMX Is So Cool I Rolled My Own\!](https://daily.dev/posts/htmx-is-so-cool-i-rolled-my-own--ocvhcvgx1) · Lobsters · 28 upvotes · 4 comments
- [The htmx loophole](https://daily.dev/posts/the-htmx-loophole-ymjkruyu8) · Bytes by ui.dev · 13 upvotes · 1 comments

---

Tags: [#webdev](https://daily.dev/tags/webdev), [#javascript](https://daily.dev/tags/javascript), [#frontend](https://daily.dev/tags/frontend), [#htmx](https://daily.dev/tags/htmx)

[View this post on daily.dev](https://daily.dev/posts/let-s-make-the-worst-htmx-er3ovizzf)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Let's make the worst Htmx","url":"https://daily.dev/posts/let-s-make-the-worst-htmx-er3ovizzf","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/let-s-make-the-worst-htmx-er3ovizzf"},"datePublished":"2026-07-31T21:11:42.423Z","dateModified":"2026-08-01T06:40:27.150Z","description":"A hands-on walkthrough of building a minimal htmx clone from scratch in ~40 lines of JavaScript. Covers the core 'scan + send + swap' loop, HTTP method...","image":"https://media.daily.dev/image/upload/s--1KxV4ohY--/f_auto/v1722860400/public/Placeholder%2007","thumbnailUrl":"https://media.daily.dev/image/upload/s--1KxV4ohY--/f_auto/v1722860400/public/Placeholder%2007","isAccessibleForFree":true,"articleSection":"Hacker News","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Hacker News","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/hn","url":"https://daily.dev/sources/hn"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/let-s-make-the-worst-htmx-er3ovizzf","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"webdev,javascript,frontend,htmx","timeRequired":"PT10M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Hacker News","item":"https://daily.dev/sources/hn"},{"@type":"ListItem","position":3,"name":"Let's make the worst Htmx"}]}
```

