News for hackers. Stuff that matters.
Re:HTMx by listenallyall on Friday May 26, 2023 @01:30AM (#36080348)
React isn't the only way, of course, but it's likely the most popular. Why do you consider Vue or Svelte to be valid alternatives but not HTMX, despite plenty of people endorsing it and openly proclaiming how successful it's been in their projects?
Re:HTMx by creatable on Friday May 26, 2023 @01:41AM (#36080423)
I personally do consider HTMX to be a valid alternative to React, but I also think that a lot of usage / promotion of it comes from people who are misinformed and think that the entirety of the JavaScript ecosystem is React. I consistently see a lot of people use HTMX over React alternatives purely because of a "distaste for JavaScript" or an understanding that everything is or has to be as complex as React unless you're using HTMX.
Re:HTMx by listenallyall on Friday May 26, 2023 @02:18AM (#36080694)
If people are "misinformed", that's a marketing fail by those other frameworks, despite many years of headstart. How are people even finding HTMX (with a single developer and until very recently, no corporate support) in a marketplace which includes Angular, backed by Google?

Or maybe people are kinda informed, and simply drawn to HTMX because it's easier to learn than Vue, Svelte, Mithril, Cycle, whatever (or they just don't want to try a zillion frameworks) and it works really well and developers seem to love it and recommend it a lot?

Re:HTMx by creatable on Friday May 26, 2023 @02:23AM (#36080716)
> or they just don't want to try a zillion frameworks

But isn't HTMX one of said zillion frameworks? What makes it any different?

Re:HTMx by listenallyall on Friday May 26, 2023 @03:19AM (#36081068)
It's easy? It works? It feels like HTML? No build steps? No JSON? The primary documentation fits is a single page? Most common patterns (i.e. polling, and then stopping if necessary) are built-in? The entire dev experience is focused on a single application (backend) as opposed to writing a backend and a separate frontend project? Simply replacing HTML fragments is conceptually simpler than maintaining a shadow DOM? It embraces web standards/APIs (see client validation discussion above)?

Here's polling in Svelte: https://stackoverflow.com/questions/61391174/how-to-do-polli...

and in HTMX:

  hx-trigger="every 2s"
https://htmx.org/docs/#polling

Maybe Svelte has an easier way, but Google isn't directing me straight to it, which is all part of the "easy to learn" aspect.