News for hackers. Stuff that matters.
Re:PostgREST: Providing HTML Content Using Htmx by colordrops on Monday December 18, 2023 @06:15PM (#38689733)
Am I trippin or is htmx not a JS library?
Re:PostgREST: Providing HTML Content Using Htmx by arcanemachiner on Monday December 18, 2023 @06:46PM (#38689965)
Yes, it is. People often talk about how HTMX allows for interactive websites without any JS. Well, there is JS, it's just that it was written by the developer of HTMX, not the developer making their web app.
Re:PostgREST: Providing HTML Content Using Htmx by chii on Monday December 18, 2023 @07:46PM (#38690396)
presumably the implication of a "js library" is that your frontend is written by you using js, rather than declaratively via html(x).
Re:PostgREST: Providing HTML Content Using Htmx by jonahx on Monday December 18, 2023 @09:57PM (#38691245)
This is true, but htmx is targeting developer experience and simplicity, not solving <noscript> user case. For this perspective "interactive websites without any JS" is accurate.
Re:PostgREST: Providing HTML Content Using Htmx by threatofrain on Tuesday December 19, 2023 @12:05AM (#38692046)
I wouldn't say that's accurate because Astro is a better fit for that description.
Re:PostgREST: Providing HTML Content Using Htmx by intrasight on Monday December 18, 2023 @06:22PM (#38689784)
Not really. It just augments the hypermedia capabilities of HTML. Adds the missing semantics. You don't invoke library functions.
Re:PostgREST: Providing HTML Content Using Htmx by promiseofbeans on Monday December 18, 2023 @07:05PM (#38690112)
It still needs JS to work though
Re:PostgREST: Providing HTML Content Using Htmx by evilduck on Monday December 18, 2023 @10:51PM (#38691602)
Look up nontrivial examples on their own docs.

“Simple” form validation is a clusterfuck and that’s what they’re leading with.

Re:PostgREST: Providing HTML Content Using Htmx by sesm on Tuesday December 19, 2023 @07:35AM (#38694783)
Why HTMX advocates say 'augments the hypermedia capabilities of HTML' instead of 'another implementation of HTML-over-the-wire approach'? Placing hidden meaning into common words sounds very cult-ish.
Re:PostgREST: Providing HTML Content Using Htmx by recursivedoubts on Tuesday December 19, 2023 @01:53PM (#38699829)
we say this, because, more than other HTML-over-the-wire libraries, htmx focuses on generalizing the two core hypermedia controls, anchors and forms

i discuss this extensively in chapter 4 of our book:

https://hypermedia.systems/extending-html-as-hypermedia/

the tldr is that htmx generalizes:

- the event that triggers an HTTP request

- the element that triggers an HTTP request

- the type of the HTTP request

- the placement of the hypermedia response to that HTTP request

In this sense, htmx adds functionality to (or, more dramatically, "completes") HTML.

This is in contrast with, for example, https://unpoly.com, which also uses HTML-over-the-wire, but provides higher level concepts (e.g. layers) and isn't as focused on generalizing hypermedia controls. This has advantages, unpoly gives you more functionality out of the box, but puts it further way from being a pure conceptual HTML extension.

Re:PostgREST: Providing HTML Content Using Htmx by aragonite on Monday December 18, 2023 @06:38PM (#38689907)
It's more like a polyfill for a proposed/nonstandard version of HTML.
Re:PostgREST: Providing HTML Content Using Htmx by arcanemachiner on Monday December 18, 2023 @06:46PM (#38689969)
Written in JavaScript, if you can believe it.
Re:PostgREST: Providing HTML Content Using Htmx by aragonite on Monday December 18, 2023 @07:02PM (#38690087)
Yes but I'd argue that this is a case that shows the construction "JavaScript library" to be non-intersective :)

My colleague James is tall and he's a basketball player. But, in one pretty straightforward sense at least, he's not a tall basketball player.

Edit: I thought of a better analogy. Compare Lodash and uBlock. Lodash is clearly a "JavaScript library", uBlock is clearly not. Why not, given that like Lodash it's just so much JavaScript? Because uBlocks' intended users don't use it as a JavaScript library. They use it to modify the default behavior of the chrome browser to something more to their liking, not as a tool for more easily expressing themselves when writing JavaScript code. I'd argue the relation of htmx to HTML is very much like that of a Chrome/VSCode extension to Chrome/VSCode: its purpose is to change the built-in behavior of some tool (HTML) used by the user, whereas a library at bottom serves an expressive purpose.

Re:PostgREST: Providing HTML Content Using Htmx by kreetx on Tuesday December 19, 2023 @07:56AM (#38694941)
htmx's angle is that the developer don't interact with the javascript, so it's not a javascript library. Otherwise one could say that html is a C++ library because the markup is interpreted and run by the browser (written in C++).
Re:PostgREST: Providing HTML Content Using Htmx by quickthrower2 on Monday December 18, 2023 @11:28PM (#38691816)
The other option being… webassembly? convince WHATWG members to change their browsers?
Re:PostgREST: Providing HTML Content Using Htmx by yawaramin on Monday December 18, 2023 @11:50PM (#38691952)
It would be harder to believe something running dynamically in the browser is not written in JavaScript.
Re:PostgREST: Providing HTML Content Using Htmx by djbusby on Monday December 18, 2023 @06:21PM (#38689778)
It is a JavaScript library