Comment by diggan

2 years ago

You can also use the web platform straight up without transpilation, build tools, post-css compilation and all that jazz.

Just vanilla JavaScript, CSS, HTML, some sprinkles of WebComponents. And you can be pretty sure that you won't have to update that for a decade or more, as compatibility won't be broken in browsers.

Heck, I have vanilla JS projects I wrote 15 years ago that still render and work exactly like how they rendered/worked when I wrote them.

Indeed, that baggage is all that I avoid by using HTMX.

  • You do you. It's worth knowing though that using HTMX is not vanilla JS/HTML/CSS, it's literally the opposite of that.

    • Have you ever worked with just raw js?

      Anything more than a todo list becomes unwieldy almost instantly.

      Taking a small dependency to avoid that is well worth it.

      Taking a whole “virtual dom” may be overkill though (looking at you, react)

      1 reply →

    • It's one small dependency. Worst case, you write the library yourself.

      You send a request to the backend, it then sends you HTML back (all rendered in the backend using a templating language such as Django templating engine, Twig or Liquid), you insert it into a div or so.

      Htmx was Intercooler, worst case you create your own. But no additional scripts needed.

      I've been able to kick out Vue out because Htmx covers my use case.

      2 replies →