Top
Best
New

Posted by leephillips 19 hours ago

</> Htmx – The Fetch()ening(htmx.org)
306 points | 113 commentspage 2
andersmurphy 17 hours ago|
Looking forward to porting my demos [1] from Datastar to HTMX once V4 is stable enough. Exciting stuff. Nice to see HTMX innovating again.

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

adamzwasserman 16 hours ago||
Interesting timing - I'm building genx.software which leans hard into implicit inheritance for the exact reason he is abandoning it. In my finance app, when the product owner changes their mind about decimal places for the 47th time (and it's always 47), the last thing I want is to hunt down every cell and add :inherited modifiers.

We treat everything as integers server-side (because floating point is the devil) and defer all formatting to the client. Implicit cascade means I can change fmt-x="currency:USD:decimals:2" in one place and watch it ripple down the entire table. It's 'maddening' the way CSS is maddening - which is to say, it becomes second nature after you stop fighting it.

That said, I fully understand the support ticket burden. Maybe the real lesson is: implicit inheritance is great when you control the domain (like 'format all money the same way'), but terrible when people want to do arbitrary things at arbitrary levels. I will bear that in mind as I complete genx.software

amanzi 17 hours ago||
This looks great, although the version 4 alpha doesn't appear to be available at the suggested URL: https://cdn.jsdelivr.net/npm/htmx.org@4.0.0-alpha/dist/htmx....

"Couldn't find the requested release version 4.0.0-alpha."

ian-g 17 hours ago|
It's named 4.0.0-alpha1. Just add the 1 and the link works
amanzi 16 hours ago||
Thanks. The docs need to be updated at https://four.htmx.org/
prokopton 14 hours ago||
htmx hasn’t had the piss taken out of it enough.
recursivedoubts 14 hours ago|
100%
causal 16 hours ago||
Neato. Sensible updates, no loss of support for previous versions? The software dream.
epolanski 15 hours ago||
The image breaks the website on mobile for me.
fud101 14 hours ago||
I was just about to use this for a feature but i won't bother now, it won't pass the stability test. Thanks I guess.
ranger_danger 18 hours ago|
The only big gripe I have about htmx is that the hx-on::after-request response it provides to your callback function does not automatically parse JSON content types like with e.g. jQuery.ajax(). Last time I brought that up, people simply questioned why I would ever want to do that in the first place.
edoceo 18 hours ago||
That sounds like use-case exploration? Did you answer?
ranger_danger 17 hours ago||
One of the actual responses was "Htmx isn’t designed to work with JSON APIs at all. It needs HTML back from the server."

It sounds like they are referring to hx-swap and not arbitrary javascript callbacks though, and in that case, I don't see why calling JSON.parse() inside htmx (when the content-type is json) is that big of a deal.

isleyaardvark 15 hours ago|||
It's a pretty core part of their design philosophy, possible the core.

https://htmx.org/essays/rest-explained/

johannes1234321 16 hours ago||||
They don't want to become a general purpose dynamic web library, but focus on swapping server generated HTML blocks. It's a conscious decision in what they are and what not.
bananapub 13 hours ago|||
> One of the actual responses was "Htmx isn’t designed to work with JSON APIs at all. It needs HTML back from the server."

Uh, yes? They wrote a literal book about why they think this is important: https://hypermedia.systems/

recursivedoubts 16 hours ago||
in 4.0 we are opening up the entire request/response/swap mechanism so you can replace any component of it per-trigger

you can replace the fetch() function used w/ an event callback, etc

should allow you to do pretty much anything w/o any hacks