4 ms·
This is such a great project, thank you for sharing! It seems like you're getting the usual dump of negativity around HTMX... but as usual, not much coming from
by neilyio 3y ago
This is such a great project, thank you for sharing! It seems like you're getting the usual dump of negativity around HTMX... but as usual, not much coming from anyone who's actually tried to build something small/medium-sized. I keep hearing that this stack "would" fall apart in a bigger project, but I never hear any concrete, empirical descriptions of issues that actually do arise.
I'll offer one here... using HTMX usually means you're going to be writing HTML templates, and HTML templating languages don't have much IDE support. I really miss goto-definition etc. when I'm writing Jinja templates.
That being said, I've personally found Rust/HTMX to be a magnificent combo. I personally find writing backend endpoints in Rust to be no more cumbersome than any other language (after becoming comfortable with Rust)... and there's massive gains from the incredible tooling and type system.
I wonder if you've considered using Askama for your templates? It has a Axum integration that cleans up some of the boilerplate around template rendering. There's also an open PR for block fragments [1], which will make componentization of HTML fragments much easier, as discussed in this essay on the HTMX site [2].
We need more projects like this to demonstrate how useful, highly-interactive apps are made with HTMX. I'd encourage skeptics to try the same before writing it off.
[1] https://github.com/djc/askama/pull/824 https://github.com/djc/askama/pull/824
[2] https://htmx.org/essays/template-fragments/ https://htmx.org/essays/template-fragments/
- jadbox 3y ago> HTML templating languages don't have much IDE support However JSX has amazing IDE support, but you need to use JS/TS with it. This is where I think the ergonomics of JSX defined Htmx endpoint rendering has been a very natural DX transition moving away from SPAs. Now with CSS View Transitions and htmx element replacements, the user experience is largely just as seamless as developing a spa app.
- neilyio 3y agoI think a lot of us reach for Jinja-style templates so it feels a little more like we're writing bare HTML. But they're of course still just templates, and they need a build step before they become valid HTML. So it's true, if you're willing to use a DSL embedded in your server language (like JSX), then you'll have the full language tooling available to you. And this probably isn't giving up much over language-specific templates. A JSX-equivalent for the Rust server-side rendering world would probably be maud [1] or leptos [2]. [1] https://github.com/lambda-fairy/maud https://github.com/lambda-fairy/maud [2] https://github.com/leptos-rs/leptos https://github.com/leptos-rs/leptos
- jadbox 3y agoI appreciate the insight. I looked into Maud, but it's very different from being a drop in html template engine like JSX, where most of the time vanilla html is a drop-in. I'll have to look more into leptos and understand its DX approach to Rust web apps and how it would mesh with Htmx.