this post was submitted on 19 Dec 2023
25 points (100.0% liked)

Technology

37719 readers
340 users here now

A nice place to discuss rumors, happenings, innovations, and challenges in the technology sphere. We also welcome discussions on the intersections of technology and society. If it’s technological news or discussion of technology, it probably belongs here.

Remember the overriding ethos on Beehaw: Be(e) Nice. Each user you encounter here is a person, and should be treated with kindness (even if they’re wrong, or use a Linux distro you don’t like). Personal attacks will not be tolerated.

Subcommunities on Beehaw:


This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 3 points 11 months ago* (last edited 11 months ago) (1 children)

htmx extends and generalizes the core idea of HTML as a hypertext, opening up many more possibilities directly within the language:

Ok...

  • Now any element, not just anchors and forms, can issue an HTTP request
  • Now any event, not just clicks or form submissions, can trigger requests

That's AJAX.

  • Now any HTTP verb, not just GET and POST, can be used

Is that a good thing?

  • Now any element, not just the entire window, can be the target for update by the request

That one is interesting... but kind of flies in the face of any adblockers or client-side content modifiers. What happens when the target for a response got removed from the DOM by the client?

PostgREST

Direct database access with no input sanitization?

Using database functions for running application logic? Every backend developer now needs to be a DBA?

What about error handling? Doesn't it expose too much of the internal structure?

provides a natural way to do API versioning

Hm... it sounds to me like all versioning inherits the caveats of schema migrations, am I missing something?

[–] [email protected] 6 points 11 months ago (1 children)

That's AJAX

Yes, and that's what is shown in this article.

... return HTML content and use the htmx library to handle the AJAX requests

htmx is not meant to do anything fancy that you can’t do with Ember/Angular/React/Vue/etc.

htmx is simpler though and has a few benefits as I see it, compared to those frameworks:

  • No duplication of data models and routing, and all business logic stays on the server-side where it belongs.

  • No build step, no dependency hell, and no outrageous churn; just include one JS file that browsers should be able to run indefinitely.

[–] [email protected] 1 points 11 months ago

I feel like most of the things such as dependency hell and at least some amount of data models and routing can be resolved by using custom elements tho. I can agree to a certain point that HTMX could lead to a simple markup based approach, but it's still a matter of learning another library and all that junk. In a perfect world I feel like there should just be an equivalent to maybe the `` element that could on becoming visible makes an Http call to lazy load and plop in some inner HTML. I guess you'd still be missing the whole events driven by attributes part tho.

I don't know if I think this whole HTMX stuff is silly cause I'm jaded, or don't see a use case for it personally. So take my comment with a huge grain of salt.