4 ms·
I am still trying to get HTMX adopted in a ~ 800 employee software development company. And while we do not yet have a project using HTMX in production, I like
by xvinci 2y ago
I am still trying to get HTMX adopted in a ~ 800 employee software development company. And while we do not yet have a project using HTMX in production, I like to use it a lot in thought experiments with mentees: Could you do it with HTMX / Fragments? If yes, how would you design it? Do we REALLY need an SPA?
Kudos to the developers.
- graypegg 2y agoI do think "use HTMX" is a tough sell for a 800 employee company, just because it doesn't really solve issues on it's own. (Imagining the pitch is "add HTMX to an existing project") Going all-in on hypermedia definitely means the service that serves your application needs to be more than just a JSON parrot. Templating HTML and sending the right chunks back is hard to do if those services aren't built around being hypermedia services. I really like turbo-rails [0] (the ruby gem that Rails 7+ bundles in for turbo support, meaning helpers that make turbo frames/responses a native "thing" rails understands) because it's a complete solution. There's at least some obvious structure to build off of, and I'm not stuck trying to build up my own framework on the BE for my newly simpler FE. django-htmx [1] also fits in this case too. I feel like any honest pitch of HTMX should involve some BE solution as well. [0] https://github.com/hotwired/turbo-rails https://github.com/hotwired/turbo-rails [1] https://github.com/adamchainz/django-htmx https://github.com/adamchainz/django-htmx
- xvinci 2y agoI dont intend it to be an all-in, but I do believe it could do the job in 50% or more cases just as well as any SPA framework. A lot we do is "just crudl" with some sprinkles on top. A large chunk of our business comes from Spring Boot, so we are experimenting with JTE - looks decent so far (Thymeleaf feels just old nowadays). My sell is pretty simple: You have regulations coming up in europe which will require you to keep applications up-to date and secure. Extending your SBOM by 1k NPM libraries is a huge cost. I want to get rid of that.
- kgeist 2y agoI tried to get HTMX adopted for a new project but the unanimous response was "what is this? why not React? everyone knows React. period" and most of my arguments for HTMX were ignored, because to most people, HTMX looked like some obscure, yet another JS framework created last week, with questionable future.
- frde_me 2y agoTo be fair, it's not an unfair response. Being able to hire for a technology, and having a large community around the tech stack you use has tangible value. HTMX might not be something that will vanish in a week, but it's also nowhere close to a mainstream framework.
- wg0 2y agoVery anti React person went for Svelte but the kind of modularity React offers, HTMX can't hope to match especially on larger projects. Modern React is too simple. A component is just a pure function taking arguments and returning UI as JSX. The only other thing you need to know is few hooks.
- The_Colonel 2y ago> Modern React is too simple. A component is just a pure function React is simple only in some mathematical theoretical sense, but not for understanding by human minds which fundamentally operate imperatively ("if I click on this, load data X from the server and show them to the user..."). You can get some hello world example relatively easily, but you hit the complexity wall quite quickly (need to know "some hooks" - some, like useEffect() are very complex, yet often needed for basic things). The worst of all is debugging with stacktraces making no sense with it all being from the React itself, not your code, not tracking some logical pathway. (I'm saying that as someone who generally likes React and would choose it for a new project)
- wg0 2y agouseEffect is simple. If I recall correctly, with no arguments it is like onMount and with the dependent variables listed in array, it would be executed every time any of the listed variables change.
- jjk7 2y agoI built an HTMX fragment framework for Django. It allows you to render a fragment, and automatically serves the fragment separately for live-updates. I'll open source it tonight and post back. In my opinion, HTMX + custom elements does everything React does but better, and is a billion times cleaner.