4 ms·
htmx looks very useful! Can you share your personal experience in using it? Pros and cons?
by fi_investor 2y ago
htmx looks very useful! Can you share your personal experience in using it? Pros and cons?
- 1GZ0 2y agoI haven't used it much. (don't use it for work) But I'll say its different. Very "backend first", so there's a bit of setup required server-side, setting up end-points and such. But not having to manage state or unpack json in the frontend is probably the best thing about HTMX. You send a request to a server from frontend, the backend responds with html and places it on the page where specified. Its much more intuitive and lower mental load than something like react or vue.
- wruza 2y agoI had this thread https://news.ycombinator.com/item?id=40710782 https://news.ycombinator.com/item?id=40710782 But the thing gp suggested looks much better, at least here: https://github.com/danawoodman/bun-htmx https://github.com/danawoodman/bun-htmx (see src/components, they use react-dom/server renderer to template-render tsx (also note that “tsx” I’m using is not a file format, but `npm i -d tsx`)). I guess I can try that in node too. That said, I don’t see the “quicker” part here tbh, imagining my mithril code in htmx templating code doesn’t make a big difference, unless I am missing something. It’s the same parametrized html but on server. Not even a glimpse of RAD-like paradigm shift. I guess htmx looks better if you’re using react but never allowed yourself a thought that it’s a useless esoteric bullshit everyone agrees to out of fear of being ostracized, which htmx removes silently (and it’s server-side). Mithril is just a vdom-based templater with simple autoredraw and doesn’t implement esoteric bs already. I somewhat agree with gp’s “unpack json” part, although it’s not a big deal with types shared across ends. I just re-new Date’s after fetch and that’s it.