Live data from Hacker News

Htmx 2.0.0 has been released

htmx.org

81–90 of 146 posts

Re: Htmx 2.0.0 has been released

#81

hey folks, i'm the creator of htmx this isn't much of a feature upgrade, but we took the opportunity to clean up a few things and drop IE support, which will help us slim down the library over time hopefully it's an easy upgrade for most htmx users, upgrade guide is here: https://htmx.org/migration-guide-htmx-1/ happy to answer any questions

Not a question, but I just wanted to say that HTMX is a joy to work. I’m using it in production to slowly replace VueJS wherever full SPA interactions aren’t needed, and it has made development so much simpler. HTMX is such a breath of fresh air from the over-engineered jenga tower that web dev has evolved into over the past decade.

Thank you!

Re: Htmx 2.0.0 has been released

#82
post #54

Htmx users, can you please share your backend stacks and approaches? Me specifically interested in templaters for node (+ts) and your thoughts on endpoint management, but all ideas are welcome I guess.

rust and ryde (my own framework on top of axum and rusqlite)

Re: Htmx 2.0.0 has been released

#83
post #54

Htmx users, can you please share your backend stacks and approaches? Me specifically interested in templaters for node (+ts) and your thoughts on endpoint management, but all ideas are welcome I guess.

Flask+SQLite+TailwindCSS.

It's basically cheating. The setup is dead-simple to operate.

Re: Htmx 2.0.0 has been released

#84
post #54

Htmx users, can you please share your backend stacks and approaches? Me specifically interested in templaters for node (+ts) and your thoughts on endpoint management, but all ideas are welcome I guess.

Well, as I expected, templating is the hardest part of migrating to htmx on nodejs.

After reviewing few templaters/etc (handlebars, ejs, lit-html, virtual-dom) and few abstractions (html``, just ``, h()), barely anything seems too easy and too freedom-y. Arcane syntaxes, high character noise (ejs, lit, js), lack of typing (all non-`` based), trivial screw ups (virtual-dom, handlebars), experimental status (lit ssr). Sigh.

Re: Htmx 2.0.0 has been released

#85
post #54

Htmx users, can you please share your backend stacks and approaches? Me specifically interested in templaters for node (+ts) and your thoughts on endpoint management, but all ideas are welcome I guess.

Go with fasttemplate.

Most people prefer templ but I don't like logic in templates, I just want to parse values. I keep different states in different template files.

Each template file is a portion of a full page which makes it easy to create an endpoint that pulls the partial with the latest values. HTMX can then hit that endpoint to load or refresh values.

Endpoints are usually

    domain/page/partial
so if I'm on a configuration page at

    example.com/config
then the endpoint for the privacy settings partial would be

    example.com/config/privacy
Going directly there in a browser would get a 404 because I check for the HX-Request header.

Endpoint handlers return a processed template with the current state. I use those functions to both compose the full page on the backend, and to build the output for the partial endpoint.

I don't automatically expose all partials. I add endpoints as I need them. This is probably more idiomatically Go than anything to do with htmx.

Re: Htmx 2.0.0 has been released

#86
I knew about Htmx and that HN loves it. But this post is what I actually got to take a good look, and oh my god it felt like such a fresh breath!

We have a few jQuery-era websites (that still work today because why not), and Htmx could be where we trim hundreds of lines.

Re: Htmx 2.0.0 has been released

#87
post #28
post #16

HTMX is like a glimpse into the road not taken, where HTML is the main language of the web instead of JS. Sometimes the grass really is greener on the other side, and I hope as an industry we make the switch.

My cynical take: this is by design. Those web committees are staffed by companies that each have their non-web platform they're pushing (or were, until it died, see Microsoft), so even the most well meaning members are somehow contorted into compromises that make the web as a platform a bad technical choice in terms of actual design, but the best one in terms of flexibility and of course ubiquity. It's completely stu…

It is possible for normal everyday people to make contributions to the standards. I'm sure if you created a patch that showed these things working in firefox/webkit/chrome and wrote up a proposal and sent it to the correct listserv, you would at least have something more than baseless conspiracy to be mad about

Re: Htmx 2.0.0 has been released

#89
post #54

Htmx users, can you please share your backend stacks and approaches? Me specifically interested in templaters for node (+ts) and your thoughts on endpoint management, but all ideas are welcome I guess.

My backend for a simple web application I'm working on is entirely in Rust. Highlights: - axum: web application framework - https://github.com/tokio-rs/axum - axum-htmx: axum extractors, responders, guards for htmx - https://github.com/robertwayne/axum-htmx - rusqlite: SQLite bindings - https://github.com/rusqlite/rusqlite - maud: HTML templating as a macro - https://maud.lambda.xyz The way maud lets you compose mark…

Do you use something like cargo-watch for "hot reload"?

Re: Htmx 2.0.0 has been released

#90
post #54

Htmx users, can you please share your backend stacks and approaches? Me specifically interested in templaters for node (+ts) and your thoughts on endpoint management, but all ideas are welcome I guess.

Django user here. HTMX fits in perfectly with the Django templating system. A fairly common approach is to use the same view but check for the HTMX header and then return a template file with the specific bit of HTML being swapped. There's also work in the Django space to be able to return parts of a template based on the request, which will suit HTMX perfectly too.
Post reply on HN