Oh wow! This is a huge honour, thank you so much! I definitely started writing a "lol HTMX is shit" post, but it just wasn't honest. HTMX is incredibly powerful - I am a fan of what you all have done with it. This attempt on my part to try and write something server-side rendered wouldn't have happened without the kick up the butt HTMX gives me (and all of us).
No problem at all. There are aspects of htmx that are good and bad depending on context and experience, and I like having different perspectives on it available for people to read, so thank you for taking the time to put together an in depth essay on it.
I was quite excited for Datastart until I saw that they keep a good chunk of the functionality behind a proprietary license [1]. It's not even about the price (it is a bit steep though, but I guess if you use it in a commercial project it will pay for itself), it's the proprietary part.
Yeah, in my (limited) experience, htmx works best to grease the wheels of an oldschool multi-page app.
I tried building something with SPAish drag-and-drop interactivity using htmx, and my ultimate conclusion was that functionality like that should either be totally encapsulated as one big htmx swap unit or be written as js "islands" outside htmx.
For my projects that require a distinct unit of functionality, I typically reach for a JS library that I can include as a payload (no npm, no deps, just a JS file). SortableJS is a good example, so is MarkdownJS if I want the browser to handle MD rendering.
This only goes so far, though. At some point, an app developer might want to integrate these distinct units of functionality, and I'm not sure how I would go about that. I haven't gotten to that point.
I think I'd try a lightweight framework like preact or vue that I can use without a build step. Keep components as separate & stateless as possible; let them live as little islands of javascript, notifying other parts of the frontend of updates through custom DOM events and talking to the server directly with fetches.
The first principles thinking of projects like htmx and Datastar is sorely needed in web development. The field has been led astray far too long by blindly following trends that were poorly designed to begin with.
You're so right - React is overwhelmingly popular despite its horrid design of running things on the client. No one should ever do that. Make the server do all the work!
How does anyone take HTMX seriously, this is seriously confusing to me? What is the point of it? To put half your HTML rendering logic on the server side and completely couple frontend and backend.
I looked at the examples and things that would take 3 lines of conditionals in JSX are shown being implemented using 2 different backend endpoints that are completely indecipherable and decoupled. All the documentation is pompously opinionated, but the opinions are all utterly stupid and ill informed. Not only is the code bad, but the implementations and examples just look like well intentioned intern code.
I've been doing IT for decades. Many times I've come across something that seems stupid yet also has a non-trivial number of supporters. When this happens (and it will many times), don't just continue to think it's stupid. Question if you are stuck on some paradigm or mindset that makes the thing seem stupid to you. That might call for a good head shake, a walk in the park, or a weekend-long bender to open your mind to new ideas. You don't have to jump on their bandwagon, but at least you'll increase your understanding and strengthen your position.
Just reacting to the executive summary: where are the tradeoffs? The port decreased memory usage on the client significantly, by how much did the server's burden increase? How have their hosting costs changed now that less work is being offloaded to the clients?
idk they didn’t say, but the server side delta of JSON generation vs HTML generation is small in the overall scheme of things and HTML-style apps tend to be less chatty because they push you towards the one-request-per-view ideal
> MESH is based on a simple principle: one component = one endpoint. This is a powerful idea - it allows us to write a HTML-first back-end in such a way that it feels like writing an SPA.
Gotta admit, I'm still not completely grasping the hype around HTMX, but I thought one of the core ideas was that it decidedly should not feel like writing an SPA, but more like old-style PHP or ASP scripts again. (In the sense that the front end is driven by the back end instead of the other way around)
So wouldn't this give you sort of the worst of both worlds? The modeling overhead of SPAs + the tight coupling of HTMX?
> MESH is based on a simple principle: one component = one endpoint. This is a powerful idea - it allows us to write a HTML-first back-end in such a way that it feels like writing an SPA.
Yeah, I immediately could tell this is where the idea and HTMX collided.
In the worldview where HTMX shines, every page is just a document. HTMX is just a small library to add some capabilities for better interactivity. The goal is precisely to avoid what the author wanted.
> Gotta admit, I'm still not completely grasping the hype around HTMX
Right place, right time.
React, the darling of web dev, has become huge and unwieldy and complex. The newcomers haven't been able to unseat it due to sheer ecosystem advantage. And then comes HTMX with quirky marketing hitting all the right notes (and having some actual good ideas underneath all that).
Huge as in the library ecosystem? - yes it is huge.
Huge as in its a massive dependency? - yes it is huge.
I couldn't understand why React was so popular till I read a comment where someone explained that Tailwind and React in a large company allows the 1000s of devs to work in tiny little components without conflicting with others, and all of a sudden it makes sense why people make themselves suffer using React. Then everyone else is just following the large companies because "well X/Y/Z use it so we should too!!!"
> With this little helper, I can now start building out a very simple Trello clone to prove the concept.
It's probably worth reading hypermedia.systems before using htmx. The book itself says that for more interactive components, you should go ahead and use JavaScript and whatever interactive framework you want to use on top of that.
I use htmx with Django when:
- I want to have some assurance that I will only have to minimally upgrade dependencies over the next few years
I'm conflicted about this post. On the one hand, it's encouraging and cheerful. On the other hand, it pretends to evaluate HTMX by insisting on conventions which... have nothing to do with HTMX.
Spoiler: HTMX does not deliver under artificial constraints.
Alpinejs is my go-to for small stuff. Probably wouldn’t want to write something gigantic with it, but it can be broken into components pretty nicely so maybe that hesitation is wrong.
From "framework fatigue" to "new framework" in five paragraphs.
Personally, I find all these minimalist, back-to-the-basics frameworks a bit misguided. It's always reeks a bit of "well my farts don't smell" – other developers' frameworks are bloated, dependency-overloaded and too complex. My new framework is simple, based on a powerful idea, and just right.
Imo, the best way to build a truly good web app in 2025 is to embrace both server-side rendering and client-side rendering, by sharing the same rendering logic between client and server, like e.g. SvelteKit, Next.js and others do.
I feel like this would have been a bit better with some sort of "recap" at the end, to summarize where he got to. The README on the MESH page is a good summary:
> MESH is a fun project intending to demonstrate the kinds of concepts embodied by HTMX - without using HTMX. Specifically, we're rendering modular elements on the server, and hydrating them on the client, swapping them out as needed instead of reloading the whole page. Component updates are swapped in place. Out-of-band updates are sent to all connected clients via SSE (server-side events), meaning all users see updates in real time.
(To expand that for people not familiar with HTMX's out-of-band updates: Basically, in MESH, on the client you hook up something listening to updates sent from the server via SSE. What the server sends are basically snippets of HTML with an ID in them; the listener on the client replaces the HTML in the DOM with that ID with the HTML sent over the wire. This allows the server to arbitrarily update the client's UI.)
So it shares one of the mechanisms of HTMX, which is to do SSR with the ability to replace individual elements.
The hot one for me right now is C#'s Blazor, which is not too young, bout 8 years now? Basically you can either have it do all the back-end dynamic rendering with C# for your front-end (Server Blazor) or you can compile it to Web Assembly. I have not written any JS in over a year, and the UI is very similar to how Razor pages are made.
I'm of the opinion that this is the future of web development for numerous web frameworks should they invest in tech similar to Blazor. Phoenix's LiveView also comes to mind. I am hoping a brave soul builds something for Django (I've been meaning to try, but I have too many side projects going on atm) that is similar to Blazor.
At one company we had a contractor come in say I can totally build a simple IoT dashboard with a few buttons and wanted to use Blazor. I used Phoenix LiveView, on rpi3’s and later rpi4’s just fine. So Blazor sounded similar and figured it’d be fine.
However Blazor just totally tanked the RPi that had 4gb of ram. It took minutes to load a web page when it did load.
Of course that was years ago. Hopefully Blazor got better. Given that starting point I’d doubt it’ll ever match Elixir LiveView in efficiency.
IMHO, other systems will to struggle to replicate Elixir’s LiveView due to BEAMs design using preemptive actors. It’s not impossible, just that’d it’d take a lot of work to match the responsiveness and resource usage.
Currently I’m using Nim on backend and front end using a Karax SPA. It’s pretty nice sharing the same code on front end and backend!
> However Blazor just totally tanked the RPi that had 4gb of ram. It took minutes to load a web page when it did load.
Sounds like Blazor Server, if WASM was used, that shouldn't have been the case. I'm not very surprised considering how insanely efficient the BEAM is with memory.
> I'm of the opinion that this is the future of web development
Maybe but not with C#. Rust is a much better language for compiling to WASM. Leptos achieves something similar to Blazor with a fraction of the CPU and bytes.
I would love to be able to handle all my web stack with C# but unfortunately the WASM bundles are too heavy for most use cases. Plus the DX for frontend is not even as good as it was with JS and Webpack like a decade ago. And these days the bar is much higher with Vite.
Rust is unnecessarily low-level for the vast majority of things that a web app would be doing. There's no reason to struggle with the borrow checker in that kind of code when tracing GC is available and makes things so much easier.
Because rust actually compiles the code to native binaries. C# kind of started doing it some time ago, but AOT still has various limitations and edge cases. Blazor doesn't even compile your code into wasm - it ships the whole dotnet runtime as wasm and runs your app as bytecode. This means massive downloads regardless how simple your code is.
There's relatively recent AOT for Blazor, but even that has to ship all the managed DLLs and part of runtime for the runtime reflection / metadata support.
> Most use cases? I'm interested if you have any examples.
Basically anything isn't an in-house tool. Captive users don't have much of an alternative.
Blazor is specially bad for anything that is public and/or needs to run on mobile.
> This strikes me as a premature optimization
Avoiding shipping 10-20MB of WASM code is not premature optimization... it's just common sense.
I can agree that for C# teams it might be better to use Blazor but objectively JS/TS solutions are just better. Again, look at the objective hard data:
I don't use Blazor, but your point is still about solving a "problem" that might not exist.
> Avoiding shipping 10-20MB of WASM code
Do you have examples of this? I'm seeing more like 1-2 MB, and most of that is the runtime, which will be cached. This is very comparable to any other framework.
> Blazor uses 45x the memory compared to vanilla JS and up to 3000x the KBs.
Which doesn't matter unless it actually affects outcomes.
> I don't use Blazor, but your point is still about solving a "problem" that might not exist.
So you think a priori it's fine to shove MBs of code to a mobile user?
And, if you get into that situation with Blazor, what's the plan for solving the problem? Other than moving features to JS.
> Do you have examples of this?
I don't have any links at hand but the JS benchmarks I linked uses 4MB of uncompressed code (12MB with the AOT version) just for displaying a table and changing the data.
Here's a demo that's sending like 2MB of Blazor code for a button that updates some text:
Why anyone would choose to use the Razor syntax at any time is beyond me, let alone for the web. There is no need to make it so complicated, HTML is interpreted.
As the article says :
> HTMX leaves it up to the developer to impose discipline on their code, however they see fit.
He said that like it's a bad thing. I really dislike those frameworks like Angular for example who simply say "You need to do it the Angular way". That just slows down innovation or clever ideas that solve little problems. Instead if there is a slow framework (looking at some peoples react implementations, Cloudflare recently [0]) Well you probably wont consider it or just see it as a "quirk" of the framework.
There is no "blazor" way as far as I can tell, we've been rewriting our logic and structure since when everyone started on this project nobody knew how to structure Blazor, moving forward we are following best practices from React projects to an extent in order to better organize and keep components tidier.
Blazor and Phoenix both seem the most intuitive for me also, especially when building complex frontends that require a lot of business logic. Being able to ditch the JS for that kind of work is amazing.
Definitely - I think what's really interesting is that there is clearly a kind of "attractor" which all of these frameworks are pulled toward. That's kind of mainly what I was trying to aim at with the blog post - MESH isn't a solution at all, it's more I built it to show why it would go that way, i.e. the same way LiveView etc. and of course Blazor went. My question is: is there a form of this that could be merged back into the HTML spec itself and supported by the browsers? My gut says there isn't, by the way.
There are definitely some parts that are common between these that it could be nice to propagate to the standard. https://alexanderpetros.com/triptych/ lists some of them but I'm not certain how specific to htmx it is or how much it apply to the different variants.
Yeah I wasn't trying to take away from what you wrote, just sharing my experience with a different framework. :) Please, use and work with what keeps you productive!
Which is kind of return to WebForms, GWT and JSF ways of working, only the implementation is a bit different than on the 2000's.
We moved into MVC approach, because of the headaches that it used to be having to debug all the generated stuff from what the browser actually supports as built-in technology.
I don't see that bright future for Blazor, other than a few .NET shops that don't want to learn native browser technology.
The debugging experience and the lack of context shift when going from thinking about how C# works to JavaScript (and all its zillion quirks!) is insanely better. I can put a breakpoint for the front-end and debug it just fine withing VS. I do wish Microsoft would finally open source their debugger, since I've heard loads of complaints about it being proprietary still.
With VS, and it still doesn't do anything when it is something broken at the browser level, CSS, HTML, JavaScript, that the VS debugger provides zero information, just like with WebForms.
I'm not sure I've run into such a state yet, are you using Blazor without any UI component libraries? I am using MUDBlazor, genuinely curious what you're running into.
I used it enough to understand how it works, compare it with my WebForms, GWT and JSF experience since their early days in 2001 onwards, and decide to stick with MVC, and browser native stack.
Additionally, our agency is polyglot, and in no way frontend teams are going to start doing Blazor instead of their favourite framework of the month.
At a previous job they were moving away from Blazor (which bummed me out, I love the philosophy) because every time they deployed it broke sessions/disconnected all active users.
Yeah, I'm very wary about putting all my eggs in Microsoft's basket after what I've seen.
They have a pretty extensive history of encouraging everyone to get on the wagon only to drive it straight into the nearest ditch. You can't trust a company that competes with its own customers.
I know all three, and I'm not seeing it dying any time soon. WebAssembly is not going anywhere, neither are dynamic back-end systems. I have drastically less issues with my front-end while using Blazor compared to just doing raw JavaScript. I've built everything from a PWA from scratch using Vanilla JS, to an iFrame Frenzy web app a client paid us top dollar to build.
Silverlight was proprietary, Blazor is MIT licensed and using open web technologies that are NOT going anywhere any time soon. We just had another major upgrade to Web Assembly's spec not that long ago.
I've made some toys with Blazor; my teams are using Vaadin at a Java shop, now. Not exactly the same implementation, but a similar idea: express front end code using the backend language.
Blazor is fucking terrible. In principle it works in some use cases, the the library is designed horribly and it's very difficult to implement well behaved components. It's like a half-baked react 10 implementation.
Blazor suffers from needing to lift the entire .net runtime into wasm. So first you download a gazillion resources that reimplement .net core/runtime/memory/garbage collector/whatever into the page. An eternity later your hello world can finally run.
Though they did manage to really shave the runtime off somehow. It used to load megabytes and megabytes of data.
> numerous web frameworks should they invest in tech similar to Blazor. Phoenix's LiveView also comes to mind.
Phoenix live view sends minimal diffs that get applied to the DOM. It doesn't have "components that run in the client and on the server". Everything is done on the server, with very specific extension points into JS
I am torn about SSR. I see the advantages but I hate the workflow so so much... Also tightly coupling the views to your backend is something I really hate.
I want to stay flexible, a completely independent frontend and a completely independent backend.
I tried Phoenix for about 7 months this year and ultimately quit due to it feeling clunky and unintuitive, same with Livewire or any other SSR templating solution I've found.
If there's SSR templating that is actually enjoyable to work with (from a DX perspective), I'd happily try it. Sadly nothing feels as good as just building web components.
We write only front-end logic on our Blazor components now, and use services to glue the front-end to the back-end which is the recommended way is my understanding. It's really nice, especially when you pull in something similar to MudBlazor.
I like that people are experimenting with HTMX, so please keep it up. But I don't think MESH is one I would pick up for my projects:
- For complex apps, I love JSX for its ability to distill complexity into simple, discrete components.
- For simple apps, I love HTMX ability to make plain the relationship between raw HTML and API response.
In the MESH examples I see a lot of verbose code that doesn't seem to achieve the simplicity of JSX nor the transparency of HTMX. That said, I certainly don't grok MESH yet so perhaps in a project it would click for me.
One other comment, if you want to experiment w/different behaviors and defaults around the general concept of htmx (generalized hypemedia controls in HTML) you can fork fixi.js which is 89 lines of code (and uses `outerHTML` as the default swap strategy):
While these technologies are interesting, React has built a moat with its component ecosystem. It doesn't matter how intuitive or simple your new frontend solution is when I can `bunx add` a component from shadcn/ui and be instantly productive. Not to mention most companies with frontend integrations are shipping their own React components. You get composability and familiarity.
And while there are decent component libraries in plain JS, the top talent is building in React.
If you're interested in this space it's worth looking at data-star.dev. who takes hypermedia in the opposite direction - one endpoint per page, then push updates to components over SSE.
My worry with MESH is that many endpoints might become a (sorry) mess...
I remember seeing this on the HN front page a while back! I subsequently forgot all about it, of course. Helps to see it again a second time, especially with the new context - I might give it a try next, see how I go. Thanks for the reminder!
It does require a mind shift as generally you have one connection morphing in all your updates and do CQRS.
The connection per component model that mesh uses is fine until you have concerns that cross across components (this was an issue hotwire also ran into before they introduced morph/refresh).
Instead you have one endpoint per page re-render the whole page via morph on every change. You still have backend components they just send requests up and get their updates via the sse connection for that page. Kinda like view = f (state) just over the network.
As someone that dabbles in stuff, I found htmx to be amazing up to the point where I need to find out why a specific logic loop isn't working, or need to do something that's slightly off-piste.
Which is to say it's incredibly useful for simpler websites but difficult for anything past 1000 lines. but i may just be using it wrong!
I had a similar experience. There was a point where my expectations became greater than my skill. Whatever simplicity I started with, I kept wanting more interactivity. I kept having to ask myself, "ok, now am I going to implement THAT in HTMX?" and I'd figure out some clever solution that worked... but only just.
I also could never quickly refactor or move things around without a headache. Skill issue, possibly...
So I ended up rewriting in React, which overall has been just better to meet the ever increasing interactivity requirements of my site and also my preferred workflow.
Hey alex-moon one feature you had issues was that HTMX does not process server generated shadow DOM content because it uses the standard old DOM parser. Next point release should have https://github.com/bigskysoftware/htmx/pull/3185 merged hopefully which will allow the use of Document.parseHTMLUnsafe() which is the modern browser replacement that does support this use case but it might go behind a new config flag.
I have been using the Umbraco CMS since 2013, and they moved from AngularJS 1.x to Lit for the backend technology. While it was frustrating at first, due to a lack of documentation around the specific CMS APIs, I can see that it was a great choice to move towards a more "standard" technology that is somewhat agnostic of a full library. Working with web components makes so much more sense to me than the way AngularJS works, as well as the React and Vue tutorials I've followed. If I found a killer feature implemented in React or Vue, I could still make use of my Lit web components without having to toss out everything and rebuild.
In a similar vein, I consumed some content from DHH talking about how 37Signals went no-build for Hey or something, then figured I'd play with that idea for a bit and see what its like developing a no-build site.
The immediate problem I hit was that tailwind essentially requires a build; at the most basic level because you don't want to bundle properties that your app isn't using, but at a more sophisticated level, because properties like `md:flex` or `max-w-[100px]` intrinsically demand some amount of dynamism in their generation. I played around with re-creating a functional no-build subset of tailwind, but it quickly hit many-many dozens of kilobytes while being unable to cover even a small subset of Tailwind's capability.
So, no tailwind, which I feel is a major loss in productivity. I didn't end up pursuing the dream further; a hyper-minimal vite app, even just using basic HTML & CSS, feels to me a very small price to pay given all the benefits it carries.
> The immediate problem I hit was that tailwind essentially requires a build;
1. If you don't want to build something, you don't need Tailwind. https://every-layout.dev/ will get you very far (well, it will get you very far regardless of what you use for CSS)
2. "No build" is a mantra and a cult. There's nothing bad about building your final app. The problem is that the web made it extremely complex.
Ah, possibly - the way I think about Show HN is it's for links to a codebase or demo app. There is a demo app linked in this article but it's not the link posted to HN. The Guidelines explicitly mention "blog posts" as not Show HN - https://news.ycombinator.com/showhn.html - but they also say that's because they "can't be tried out". Grey area? Happy to do whatever precedent suggests.
Cool! I'm also not 100% sure, have only done a handful of posts. I would definitely put "Show HN" on a link to the demo app or the Github repo - and wait for the mods to correct me :D
Why is it that people critizing HTMX always end up slapping abstractions on top of it. It always feels like they are missing the point why htmx is endearing for some of us.
This has been my experience, the reality is HTMX doesn't scale well in terms of complex ideas / code. Great if you have something simple to achieve, not so great for a massive ongoing project.
In other words: It has a steeper complexity gradient, albeit with a lower complexity floor.
99% of websites are, or should be, just a simple document(s) with a couple of forms, and the goal of HTMX is to help achieving low to medium complexity interactivity, and better UX on such sites easy. These are not the flashiest and most sexy demos, but the staple of the Internet.
If you really need to make a web _application_ with lots of reactive interdependent elements, HTMX is not the tool for the job.
Though, for me, that begs the question: why not just use vanilla Javascript's .fetch()? One gets more flexibility than HTMX could ever provide, and the same logic is really not that many more lines to type.
I feel like part of the mess of modern web development is the idea that most people actually need to "do something more complex than the basics". So much rehashing and effort spent trying to force MPAs into a SPA shape just because it's trendy.
https://htmx.org/essays/#on-the-other-hand
Regarding the default swap behavior of "innerHTML":
https://htmx.org/quirks/#the-default-swap-strategy-is-innerh...
Our proposal to merge htmx functionality into the HTML spec uses outerHTML:
https://alexanderpetros.com/triptych/
Also consider datastar, it was written from an SSE-first perspective by a go engineer:
https://data-star.dev/
Super excited about triptych too! Thanks for pushing that.
- [1] https://checkboxes.andersmurphy.com
[1] https://andersmurphy.com/2025/04/07/clojure-realtime-collabo...
[1] https://data-star.dev/reference/datastar_pro
I tried building something with SPAish drag-and-drop interactivity using htmx, and my ultimate conclusion was that functionality like that should either be totally encapsulated as one big htmx swap unit or be written as js "islands" outside htmx.
This only goes so far, though. At some point, an app developer might want to integrate these distinct units of functionality, and I'm not sure how I would go about that. I haven't gotten to that point.
The first principles thinking of projects like htmx and Datastar is sorely needed in web development. The field has been led astray far too long by blindly following trends that were poorly designed to begin with.
Just like what the htmx author did, react can also have an on the other hand section
Might be beneficial to think the other way around, and rather think htmx was not a good fit for the app.
I looked at the examples and things that would take 3 lines of conditionals in JSX are shown being implemented using 2 different backend endpoints that are completely indecipherable and decoupled. All the documentation is pompously opinionated, but the opinions are all utterly stupid and ill informed. Not only is the code bad, but the implementations and examples just look like well intentioned intern code.
https://htmx.org/essays/a-real-world-react-to-htmx-port/
Gotta admit, I'm still not completely grasping the hype around HTMX, but I thought one of the core ideas was that it decidedly should not feel like writing an SPA, but more like old-style PHP or ASP scripts again. (In the sense that the front end is driven by the back end instead of the other way around)
So wouldn't this give you sort of the worst of both worlds? The modeling overhead of SPAs + the tight coupling of HTMX?
Yeah, I immediately could tell this is where the idea and HTMX collided.
In the worldview where HTMX shines, every page is just a document. HTMX is just a small library to add some capabilities for better interactivity. The goal is precisely to avoid what the author wanted.
Somewhere between "React components" and "Microfrontends."
They can still be small, but often you will want many fewer than React components.
Now? No one knows or can tell you what they are for (except leaf components and HTML Web Components maybe)
Right place, right time.
React, the darling of web dev, has become huge and unwieldy and complex. The newcomers haven't been able to unseat it due to sheer ecosystem advantage. And then comes HTMX with quirky marketing hitting all the right notes (and having some actual good ideas underneath all that).
Huge as in the library ecosystem? - yes it is huge.
Huge as in its a massive dependency? - yes it is huge.
I couldn't understand why React was so popular till I read a comment where someone explained that Tailwind and React in a large company allows the 1000s of devs to work in tiny little components without conflicting with others, and all of a sudden it makes sense why people make themselves suffer using React. Then everyone else is just following the large companies because "well X/Y/Z use it so we should too!!!"
Htmx is 59.9kb minified.
So it’s not huge in at least one dimension: file size.
https://bundlephobia.com/package/[email protected]
https://bundlephobia.com/package/[email protected]
https://bundlephobia.com/package/[email protected]
It's probably worth reading hypermedia.systems before using htmx. The book itself says that for more interactive components, you should go ahead and use JavaScript and whatever interactive framework you want to use on top of that.
I use htmx with Django when:
- I want to have some assurance that I will only have to minimally upgrade dependencies over the next few years
- I'm doing something bog-standard (dashboard / admin UI)
Spoiler: HTMX does not deliver under artificial constraints.
Personally, I find all these minimalist, back-to-the-basics frameworks a bit misguided. It's always reeks a bit of "well my farts don't smell" – other developers' frameworks are bloated, dependency-overloaded and too complex. My new framework is simple, based on a powerful idea, and just right.
Imo, the best way to build a truly good web app in 2025 is to embrace both server-side rendering and client-side rendering, by sharing the same rendering logic between client and server, like e.g. SvelteKit, Next.js and others do.
> MESH is a fun project intending to demonstrate the kinds of concepts embodied by HTMX - without using HTMX. Specifically, we're rendering modular elements on the server, and hydrating them on the client, swapping them out as needed instead of reloading the whole page. Component updates are swapped in place. Out-of-band updates are sent to all connected clients via SSE (server-side events), meaning all users see updates in real time.
(To expand that for people not familiar with HTMX's out-of-band updates: Basically, in MESH, on the client you hook up something listening to updates sent from the server via SSE. What the server sends are basically snippets of HTML with an ID in them; the listener on the client replaces the HTML in the DOM with that ID with the HTML sent over the wire. This allows the server to arbitrarily update the client's UI.)
So it shares one of the mechanisms of HTMX, which is to do SSR with the ability to replace individual elements.
I'm of the opinion that this is the future of web development for numerous web frameworks should they invest in tech similar to Blazor. Phoenix's LiveView also comes to mind. I am hoping a brave soul builds something for Django (I've been meaning to try, but I have too many side projects going on atm) that is similar to Blazor.
However Blazor just totally tanked the RPi that had 4gb of ram. It took minutes to load a web page when it did load.
Of course that was years ago. Hopefully Blazor got better. Given that starting point I’d doubt it’ll ever match Elixir LiveView in efficiency.
IMHO, other systems will to struggle to replicate Elixir’s LiveView due to BEAMs design using preemptive actors. It’s not impossible, just that’d it’d take a lot of work to match the responsiveness and resource usage.
Currently I’m using Nim on backend and front end using a Karax SPA. It’s pretty nice sharing the same code on front end and backend!
Sounds like Blazor Server, if WASM was used, that shouldn't have been the case. I'm not very surprised considering how insanely efficient the BEAM is with memory.
Maybe but not with C#. Rust is a much better language for compiling to WASM. Leptos achieves something similar to Blazor with a fraction of the CPU and bytes.
https://leptos.dev/
Blazor is much slower client-side than even the worse JS solution. Scroll to the right to see it compares:
https://krausest.github.io/js-framework-benchmark/current.ht...
I would love to be able to handle all my web stack with C# but unfortunately the WASM bundles are too heavy for most use cases. Plus the DX for frontend is not even as good as it was with JS and Webpack like a decade ago. And these days the bar is much higher with Vite.
Same for on every WASM solution out there. I don't want to rewrite for the 1000th time a date picker, accordion, card, tab bar...
I just want to throw new Accordion() on my code and, optionally, override some CSS to make it match the customer palette and go solve hard problems.
This strikes me as a premature optimization. Most use cases? I'm interested if you have any examples.
> Rust is a much better language for compiling to WASM.
Why's that?
There's relatively recent AOT for Blazor, but even that has to ship all the managed DLLs and part of runtime for the runtime reflection / metadata support.
Basically anything isn't an in-house tool. Captive users don't have much of an alternative.
Blazor is specially bad for anything that is public and/or needs to run on mobile.
> This strikes me as a premature optimization
Avoiding shipping 10-20MB of WASM code is not premature optimization... it's just common sense.
I can agree that for C# teams it might be better to use Blazor but objectively JS/TS solutions are just better. Again, look at the objective hard data:
https://krausest.github.io/js-framework-benchmark/current.ht...
Blazor uses 45x the memory compared to vanilla JS and up to 3000x the KBs.
> Avoiding shipping 10-20MB of WASM code
Do you have examples of this? I'm seeing more like 1-2 MB, and most of that is the runtime, which will be cached. This is very comparable to any other framework.
> Blazor uses 45x the memory compared to vanilla JS and up to 3000x the KBs.
Which doesn't matter unless it actually affects outcomes.
So you think a priori it's fine to shove MBs of code to a mobile user?
And, if you get into that situation with Blazor, what's the plan for solving the problem? Other than moving features to JS.
> Do you have examples of this?
I don't have any links at hand but the JS benchmarks I linked uses 4MB of uncompressed code (12MB with the AOT version) just for displaying a table and changing the data.
Here's a demo that's sending like 2MB of Blazor code for a button that updates some text:
https://blazor-demo.github.io/Counter
Here's someone using dotnet 9 reporting a 17MB download and 67MB with AOT:
https://www.reddit.com/r/Blazor/comments/1kse00c/blazor_wasm...
As the article says :
> HTMX leaves it up to the developer to impose discipline on their code, however they see fit.
He said that like it's a bad thing. I really dislike those frameworks like Angular for example who simply say "You need to do it the Angular way". That just slows down innovation or clever ideas that solve little problems. Instead if there is a slow framework (looking at some peoples react implementations, Cloudflare recently [0]) Well you probably wont consider it or just see it as a "quirk" of the framework.
[0] https://blog.cloudflare.com/deep-dive-into-cloudflares-sept-...
I've had more success with Phoenix/LiveView.
We moved into MVC approach, because of the headaches that it used to be having to debug all the generated stuff from what the browser actually supports as built-in technology.
I don't see that bright future for Blazor, other than a few .NET shops that don't want to learn native browser technology.
A bit hyperbolic, if you use a modern linter like biome or eslint it can warn you of the few that may cause issues.
Additionally, our agency is polyglot, and in no way frontend teams are going to start doing Blazor instead of their favourite framework of the month.
They have a pretty extensive history of encouraging everyone to get on the wagon only to drive it straight into the nearest ditch. You can't trust a company that competes with its own customers.
Silverlight was proprietary, Blazor is MIT licensed and using open web technologies that are NOT going anywhere any time soon. We just had another major upgrade to Web Assembly's spec not that long ago.
Though they did manage to really shave the runtime off somehow. It used to load megabytes and megabytes of data.
> numerous web frameworks should they invest in tech similar to Blazor. Phoenix's LiveView also comes to mind.
Phoenix live view sends minimal diffs that get applied to the DOM. It doesn't have "components that run in the client and on the server". Everything is done on the server, with very specific extension points into JS
I want to stay flexible, a completely independent frontend and a completely independent backend.
I tried Phoenix for about 7 months this year and ultimately quit due to it feeling clunky and unintuitive, same with Livewire or any other SSR templating solution I've found.
If there's SSR templating that is actually enjoyable to work with (from a DX perspective), I'd happily try it. Sadly nothing feels as good as just building web components.
- For complex apps, I love JSX for its ability to distill complexity into simple, discrete components.
- For simple apps, I love HTMX ability to make plain the relationship between raw HTML and API response.
In the MESH examples I see a lot of verbose code that doesn't seem to achieve the simplicity of JSX nor the transparency of HTMX. That said, I certainly don't grok MESH yet so perhaps in a project it would click for me.
https://github.com/bigskysoftware/fixi/blob/master/fixi.js
i created it as an experiment in minimalism:
https://github.com/bigskysoftware/fixi#-fixijs---it-aint-muc...
I think you’ll find that most people who love HTMX don’t ever want something that feels like writing an SPA.
There's no integration with routers, state stores, or rpc handlers. There are no DTOs shared between the frontend and backend. It has low coupling.
High cohesion and low coupling bring benefits in engineering productivity.
And while there are decent component libraries in plain JS, the top talent is building in React.
If you're interested in this space it's worth looking at data-star.dev. who takes hypermedia in the opposite direction - one endpoint per page, then push updates to components over SSE.
My worry with MESH is that many endpoints might become a (sorry) mess...
The connection per component model that mesh uses is fine until you have concerns that cross across components (this was an issue hotwire also ran into before they introduced morph/refresh).
Instead you have one endpoint per page re-render the whole page via morph on every change. You still have backend components they just send requests up and get their updates via the sse connection for that page. Kinda like view = f (state) just over the network.
Which is to say it's incredibly useful for simpler websites but difficult for anything past 1000 lines. but i may just be using it wrong!
I also could never quickly refactor or move things around without a headache. Skill issue, possibly...
So I ended up rewriting in React, which overall has been just better to meet the ever increasing interactivity requirements of my site and also my preferred workflow.
I tried to go pure JavaScript but ended up with web components with lit and really could not be happier.
[1]:https://developer.mozilla.org/en-US/docs/Web/API/Server-sent...
https://e-html.org/
The immediate problem I hit was that tailwind essentially requires a build; at the most basic level because you don't want to bundle properties that your app isn't using, but at a more sophisticated level, because properties like `md:flex` or `max-w-[100px]` intrinsically demand some amount of dynamism in their generation. I played around with re-creating a functional no-build subset of tailwind, but it quickly hit many-many dozens of kilobytes while being unable to cover even a small subset of Tailwind's capability.
So, no tailwind, which I feel is a major loss in productivity. I didn't end up pursuing the dream further; a hyper-minimal vite app, even just using basic HTML & CSS, feels to me a very small price to pay given all the benefits it carries.
1. If you don't want to build something, you don't need Tailwind. https://every-layout.dev/ will get you very far (well, it will get you very far regardless of what you use for CSS)
2. "No build" is a mantra and a cult. There's nothing bad about building your final app. The problem is that the web made it extremely complex.
but looking at your blog post i just thought "oh, they're showing us mesh", probably you're correct here though
In other words: It has a steeper complexity gradient, albeit with a lower complexity floor.
If you really need to make a web _application_ with lots of reactive interdependent elements, HTMX is not the tool for the job.
Also, i don't see much htmx in the post, but what do I know.