News for hackers. Stuff that matters.
Re:Mesh: I tried Htmx, then ditched it by recursivedoubts on Tuesday September 23, 2025 @09:21AM (#45346654)
Sounds like this app wasn't a good fit for htmx. I have added it to the "On The Other Hand" section on the htmx website:

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/

Re:Mesh: I tried Htmx, then ditched it by alex-moon on Tuesday September 23, 2025 @10:23AM (#45347463)
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).
Re:Mesh: I tried Htmx, then ditched it by recursivedoubts on Tuesday September 23, 2025 @11:10AM (#45348186)
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.
Re:Mesh: I tried Htmx, then ditched it by stronglikedan on Tuesday September 23, 2025 @01:49PM (#45350479)
I can't help but to think "lol HTMX is shit" may have beat out "htmx sucks" for first place on that list!
Re:Mesh: I tried Htmx, then ditched it by bccdee on Tuesday September 23, 2025 @11:36AM (#45348559)
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.

Re:Mesh: I tried Htmx, then ditched it by all2 on Tuesday September 23, 2025 @01:42PM (#45350386)
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.

Re:Mesh: I tried Htmx, then ditched it by bccdee on Tuesday September 23, 2025 @05:30PM (#45353007)
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.
Re:Mesh: I tried Htmx, then ditched it by Atotalnoob on Tuesday September 23, 2025 @10:47PM (#45355721)
You could consider using web components
Re:Mesh: I tried Htmx, then ditched it by pabe on Tuesday September 23, 2025 @10:16AM (#45347352)
If only more people were like you <3
Re:Mesh: I tried Htmx, then ditched it by imiric on Tuesday September 23, 2025 @01:43PM (#45350389)
I find your honesty and pragmatism refreshing.

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.

Re:Mesh: I tried Htmx, then ditched it by nawgz on Tuesday September 23, 2025 @03:20PM (#45351526)
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!
Re:Mesh: I tried Htmx, then ditched it by gloryjulio on Tuesday September 23, 2025 @03:29PM (#45351621)
Tbf, app vs server side website are distinct use cases. React is for apps. It's overkill for htmx use cases.

Just like what the htmx author did, react can also have an on the other hand section

Re:Mesh: I tried Htmx, then ditched it by andersmurphy on Tuesday September 23, 2025 @01:49PM (#45350474)
+1 for datastar. It lets you do really dumb push based streaming html stuff where HTMX isnt quite fast enough (great for multiplayer apps).[1]

Super excited about triptych too! Thanks for pushing that.

- [1] https://checkboxes.andersmurphy.com

Re:Mesh: I tried Htmx, then ditched it by stepbeek on Tuesday September 23, 2025 @03:01PM (#45351313)
Your recent post on using datastar with SSE to power game of life [1] was excellent. Thanks for writing it!

[1] https://andersmurphy.com/2025/04/07/clojure-realtime-collabo...

Re:Mesh: I tried Htmx, then ditched it by andersmurphy on Tuesday September 23, 2025 @03:08PM (#45351402)
Thank you! I've been meaning to write one on the nitty gritty of virtual scroll, hopefully I'll find some time next month.
Re:Mesh: I tried Htmx, then ditched it by nchmy on Tuesday September 23, 2025 @03:10PM (#45351418)
That would be great to see. Likewise more details about your custom compression settings.
Re:Mesh: I tried Htmx, then ditched it by HiPhish on Tuesday September 23, 2025 @06:26PM (#45353596)
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.

[1] https://data-star.dev/reference/datastar_pro

Re:Mesh: I tried Htmx, then ditched it by andersmurphy on Wednesday September 24, 2025 @03:03AM (#45357214)
A "good chunk of functionality" is a mischaracterisation. I don't use anything from pro and I use datastar at work. I do believe in making open source maintainable though so bought the license.

The pro stuff is mostly a collection of foot guns you shouldn't use and are a support burden for the core team. In some niche corporate context they are useful. You can also implement your own plugins with the same functionality if you want it's just going to cost you time in instead of money.

I find devs complaining about paying for things never gets old. A one off life time license? How scandalous! Sustainable open source? Disgusting. Oh a proprietary AI model that is built on others work without their concent and steals my data? Only 100$ a month? Take my money!

Re:Mesh: I tried Htmx, then ditched it by HiPhish on Thursday September 25, 2025 @02:49PM (#45377138)
It's not about the money, it's about the fact that I would depend on vendor-locked functionality. I cannot maintain my own fork of it if for whatever reason I had to. I don't want to fork datastar if I don't have to, but I want to be able to do so if I have to.

Alpine does have a "pro" version as well, but it's just copy&paste code examples. I am not complaining about Alpine, and I even got my employer to pay the maintainer more than what the datastart guys are charging for their pro version. So again, this is not about money.

Re:Mesh: I tried Htmx, then ditched it by andersmurphy on Friday September 26, 2025 @06:41AM (#45384954)
You get the entire source with pro. Nothing is stopping you maintaining your own private fork for use in your commercial product. If datastar the non profit disappear tomorrow you would still have the source. So where is the problem?
Re:Mesh: I tried Htmx, then ditched it by HiPhish on Saturday September 27, 2025 @04:13AM (#45394011)
> your own private fork

That right there is the problem, it's maintainer lock-in, I cannot share my improvements with anyone else or benefit from other people's improvements.

Re:Mesh: I tried Htmx, then ditched it by andersmurphy on Saturday September 27, 2025 @01:27PM (#45397718)
So you'd prefer if it was free and GPL?
Re:Mesh: I tried Htmx, then ditched it by icedchai on Tuesday September 23, 2025 @09:29PM (#45355157)
HTMX does have web socket support! I've been experimenting with it...
Re:Mesh: I tried Htmx, then ditched it by andersmurphy on Wednesday September 24, 2025 @02:49AM (#45357107)
Datastar uses SSE. In practice you almost always want SSE rather than websockets or your own UDP protocol. Websockets are an operational nightmare once you get off the happy path.
Re:Mesh: I tried Htmx, then ditched it by icedchai on Wednesday September 24, 2025 @06:41AM (#45358553)
HTMX also has a SSE extension. I’m working on a multiplayer game as a hobby project and am not too far along.
Re:Mesh: I tried Htmx, then ditched it by the_arun on Wednesday September 24, 2025 @02:24AM (#45356945)
Datastar folks have some cool videos - https://data-star.dev/videos
Re:Mesh: I tried Htmx, then ditched it by stanfordkid on Tuesday September 23, 2025 @05:12PM (#45352820)
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.

Re:Mesh: I tried Htmx, then ditched it by FartinMowler on Tuesday September 23, 2025 @06:57PM (#45353888)
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.
Re:Mesh: I tried Htmx, then ditched it by stanfordkid on Wednesday October 01, 2025 @10:21AM (#45438066)
Maybe it’s for a use case I don’t understand… but I don’t see why anyone would use this for a modern, complex, richly interactive web-app. I also don’t really see any examples of a high quality major production site using htmx.
Re:Mesh: I tried Htmx, then ditched it by recursivedoubts on Tuesday September 23, 2025 @06:56PM (#45353879)
idk sometimes it turns out to be a pretty good approach for some problems:

https://htmx.org/essays/a-real-world-react-to-htmx-port/

Re:Mesh: I tried Htmx, then ditched it by crackrook on Tuesday September 23, 2025 @08:31PM (#45354680)
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?
Re:Mesh: I tried Htmx, then ditched it by recursivedoubts on Tuesday September 23, 2025 @08:44PM (#45354791)
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
Re:Mesh: I tried Htmx, then ditched it by joshmanders on Tuesday September 23, 2025 @07:18PM (#45354081)
I'm already a fan of htmx, you don't have to sell me anymore.
Re:Mesh: I tried Htmx, then ditched it by mikestorrent on Wednesday September 24, 2025 @01:29AM (#45356649)
Right? Someone show this kid how we used to make web apps back in the day, using hardware 1/100th as powerful. Turns out you don't need to send megabytes of JS to the client to have it render a table
Re:Mesh: I tried Htmx, then ditched it by imiric on Tuesday September 23, 2025 @06:23PM (#45353563)
Re:Mesh: I tried Htmx, then ditched it by endofreach on Tuesday September 23, 2025 @06:13PM (#45353458)
> Sounds like this app wasn't a good fit for htmx

Might be beneficial to think the other way around, and rather think htmx was not a good fit for the app.

Re:Mesh: I tried Htmx, then ditched it by cookiengineer on Tuesday September 23, 2025 @11:02PM (#45355819)
Regarding your proposal:

I would love to see cross browser support for forms encoded as application/json instead of url encoded. Additionally making name attributes in forms a query path selector to be able to nest JSON data structures would go a very long way.

Regarding web components and htmx: I kind of disagree with the server sided rendering approach there because I believe in local first web apps that use JSON or other data formats to communicate, but I'm pretty stubborn like that.

Don't have much to prove it yet, but I'm working on gooey, my bindings and components library for WebASM. Hopefully I'll get there in the next months, though Go has a couple of limitations due to how the type system works.

[1] https://github.com/cookiengineer/gooey

Re:Mesh: I tried Htmx, then ditched it by jcgl on Wednesday September 24, 2025 @04:06AM (#45357600)
> I would love to see cross browser support for forms encoded as application/json instead of url encoded. Additionally making name attributes in forms a query path selector to be able to nest JSON data structures would go a very long way.

This would be simply amazing. Would so drastically reduce the JavaScript truly needed for basic CRUD stuff. Could even eliminate it if you don’t need variable-length arrays. Just the simplicity of POSTing forms…

Re:Mesh: I tried Htmx, then ditched it by scuff3d on Wednesday September 24, 2025 @12:38AM (#45356355)
Stupid question, why have innerHTML as the default for HTMX but outerHTML for the spec merge?
Re:Mesh: I tried Htmx, then ditched it by recursivedoubts on Thursday September 25, 2025 @12:45PM (#45375224)
innerHTML was the default of htmx for historical reasons, Alex pointed out that anything that can be achieved with innerHTML (or the other swap styles) can also be achieved with outerHTML (albeit with more violence to the DOM) so we felt that was the simplest option for a more general proposal.
Re:Mesh: I tried Htmx, then ditched it by throwaway7783 on Wednesday September 24, 2025 @01:15AM (#45356547)
Do you think apps like this are not a good fit for HTMX? Drag drop interactivity?
Re:Mesh: I tried Htmx, then ditched it by recursivedoubts on Wednesday September 24, 2025 @10:54PM (#45368792)
Well, I don't know. Reorder-style drag and drop works OK:

https://htmx.org/examples/sortable/

But if you really want a component-based system then htmx can be a battle.

I outline when I think htmx is a good fit here:

https://htmx.org/essays/when-to-use-hypermedia/