News for hackers. Stuff that matters.
Re:HTMx by candiddevmike on Thursday May 25, 2023 @10:49PM (#36079177)
That makes no sense, HTML is by design not supposed to be dynamic, that's the point of JS. There's a nice, clean, separation of concerns with HTML, CSS, and JS.

As an aside, htmx uses JS under the covers to make HTML dynamic.

Re:HTMx by recursivedoubts on Thursday May 25, 2023 @11:30PM (#36079480)
HTML is designed to be dynamic via hypermedia controls, that is, elements embedded in documents that communicate some sort of hypermedia interaction to a user agent. The two common hypermedia controls are anchors and forms.

htmx simply generalizes this concept, allowing any element to be a hypermedia control, issuing any sort of HTTP request, in response to any sort of event and replacing any element in the DOM.

I have written an essay on an alternative software design principle to the traditional separation of concerns that we see in web development here:

https://htmx.org/essays/locality-of-behaviour/

Re:HTMx by pphysch on Thursday May 25, 2023 @10:55PM (#36079222)
> HTML is by design not supposed to be dynamic, that's the point of JS.

You are putting far too much faith in the design of web standards.

Anyways, here's a counterexample to your claim:

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/di...

Re:HTMx by ipaddr on Thursday May 25, 2023 @11:11PM (#36079347)
A dialogue doesn't need javascript. You can render in html and can use server side logic to decide to display it
Re:HTMx by sodapopcan on Friday May 26, 2023 @12:16AM (#36079829)
<audio> and <video> are older examples.

And of course <button type="submit">, <button type="reset">, annnnnd cough <a>.

There was <blink> and for some reason still <marquee> if you wanna consider animations dynamic.

Re:HTMx by pphysch on Friday May 26, 2023 @12:35AM (#36079984)
Thanks, yeah, there are lots of examples of standard HTML features that wouldn't make any sense in a true static document DSL like LaTeX, or a paper document.

HTML is interactive and dynamic.

Re:HTMx by sodapopcan on Friday May 26, 2023 @12:42AM (#36080029)
I was just augmenting your answer as I liked it! It was also sort of a response to my sibling responder as they didn't seem to get what you were saying.

EDIT: Oh wait, maybe they did now that I re-read it... maybe? I think it's time for bed.

Re:HTMx by flagrant_taco on Thursday May 25, 2023 @11:59PM (#36079689)
Where in the spec for html did it specify that it's isn't meant to be dynamic?

HTMX effectively used js for a polyfill of potential html standards, very similar to using babel or postcss to prototype a proposed spec.

Re:HTMx by roywiggins on Friday May 26, 2023 @12:02AM (#36079720)
A lot of htmx is just a smoother version of what people used to do with forms and iframes.