Live data from Hacker News

Htmx 2.0.0 has been released

htmx.org

131–140 of 146 posts

Re: Htmx 2.0.0 has been released

#132
post #128

Earlier quoted context omitted.

Most likely that code already existed server-side and was duplicated client-side. It's what usually happens since frontend code can't enforce invariants.

Could you elaborate on what you mean by "frontend code can't enforce invariants" ?

Frontend code can be easily bypassed or changed so you can't trust it to keep the state of your application in good condition. Nothing prevents me from picking the same username as someone else if there is no server-side code stopping it. Nothing prevents me from replying to a deleted comment if I don't check with the server.

That means that any validation that you do client-side you need to repeat server-side. Any business logic that you have client-side you also need to repeat server-side.

Re: Htmx 2.0.0 has been released

#133
post #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.

What do you use for templating/HTML generation?

Re: Htmx 2.0.0 has been released

#136

Earlier quoted context omitted.

What do you use for templating/HTML generation?

The default Flask Jinja2 templating engine. It can get you very far.

True, it works just fine. But doing non trivial things in a templating language never quite sat well with me. So I am trying out dominate as a way of just doing everything in Python. Jury is still out though.

Re: Htmx 2.0.0 has been released

#137
post #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!

aren't mixing vuejs and htmx making things more complicated?

Re: Htmx 2.0.0 has been released

#138
post #109

Earlier quoted context omitted.

Would love to hear more about how you’re using it

We are building an enterprise application that manages (create, update data) and interacts with (read, display, enable user to browse via linked entities) a large-scale knowledge graph. In some views we have live updates from the server with SSEs (alerts, logs, etc.). Everything is rendered server side with Go + stdlib templates, Material Design Bootstrap for CSS, and HTMX for all the in interactive bits like fetchin…

do you use alpinejs for better client side reactivity?

Re: Htmx 2.0.0 has been released

#139
post #81

Earlier quoted context omitted.

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!

aren't mixing vuejs and htmx making things more complicated?

Not really. We were lucky that we used a hybrid multi-page architecture that makes the transition easy to manage. HTMX and VueJS are being used on different views with different routes/endpoints, so we can re-write any VueJS-based views one at a time.

This architecture was chosen partly because I am a boomer who remembers when websites were HTML files uploaded via FTP and couldn't understand why we shouldn't just return HTML for pages that didn't need app-style functionality, partly because we wanted something easy to manage with a small number of devs (HTML+vanilla js shines here), and partly because SPAs were new-ish when we first began development and the ecosystem was very immature and a long way from coalescing around a single winner (as it has now with React).

So in this case, HTMX is used with HTML templates and ordinary routing, while VueJS is isolated to single purpose SPA-style views with their own endpoints (for example, WebRTC video). And I suspect that we will even be able to eliminate the Vue-based pages altogether with a combination of HTMX and vanilla js if we want to, with how good vanilla js has gotten.

Re: Htmx 2.0.0 has been released

#140
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.

perl + Template Toolkit (using the underdocumented support for the fragment pattern with EXPOSE_BLOCKS), before finding htmx we used Jemplate, which let you compile Template Toolkit templates into Javascript functions
Post reply on HN