logoalt Hacker News

recursivedoubtslast Thursday at 7:27 PM1 replyview on HN

Yep. And that’s a good thing:

https://htmx.org/essays/splitting-your-apis/


Replies

lbreakjailast Thursday at 9:36 PM

Splitting application API and generic data API is orthogonal to HTMX. You still have issues compared to plain JSON, don't you?

Imagine you need firstName/email in once place, firstName/email in another, and firstName/D.O.B in another.

In a plain JSON world, I'd craft a single "user" endpoint, returning those three datapoints, and I would let the frontend handle it. My understanding is with HTMX, I'd have to craft (and maintain/test) three different endpoints, one per component.

I feel like you would quickly end up in a combinatorial explosion for anything but the simplest page. I really don't get the appeal at all. Of course everything can be very simple and lightweight if you hide the complexity under the bed!

show 3 replies