Hacker News new | ask | show | jobs
by worldsayshi 803 days ago
But it only seems to make sense to me if you actually get any extra guarantees from it. HTML+CSS without JavaScript gives users a nice guarantee that the content you see is what you get. No extra delays waiting for data. No mutations at a later time. Etc.

But I don't see that using htmx instead of react gives you any such guarantees.

1 comments

That is right, so from a security perspective, as an end user, you can't "Disable JS, but enable HTMX only".

However a a developer or team, if you say "this page only includes the HTMX library and no other scripts" (something that is easy to verify) then you know a lot about what can and can't happen.

In a sense HTMX is a framework that provides a non-turing complete DSL with limited interactions.

Whereas React alone provides... well nothing, because it isn't a framework. You need JS to initiate it, and do anything with it at all! So a React app by extension must have a lot (or maybe a little, rarely) custom Turing-complete code with access to the entire operating system that is the Web API!

(I appreciate that people's definition of Framework vs. Library will differ, but the main point stands that React requires a decent chunk of turing complete code to do anything useful, whereas HTMX requires no turing complete code on the client but just markup.)

The founder of HTMX said many times that he hopes the ideas behind it evolve into web standard, such that you wouldn't need JS anymore. I think HTMX is a great showcase for how far "any element can send HTTP requests" can take you.