Live data from Hacker News

Htmx 2.0.0 has been released

htmx.org

101–110 of 146 posts

Re: Htmx 2.0.0 has been released

#101

Earlier quoted context omitted.

can you comment on what those 500 lines actually were? react+redux?

It was all normal JS code to handle a complicated form we have on a customer facing portal page. By moving to htmx I was able to rely on the server side to handle basically everything with only a small addition of code to what it was already doing.

Isn’t that moving code around, not deleting it?

Re: Htmx 2.0.0 has been released

#102

Earlier quoted context omitted.

It was all normal JS code to handle a complicated form we have on a customer facing portal page. By moving to htmx I was able to rely on the server side to handle basically everything with only a small addition of code to what it was already doing.

Isn’t that moving code around, not deleting it?

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.

Re: Htmx 2.0.0 has been released

#103
post #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).…

This was my experience as well. No great template generator on the node side.

I use PUG. I don’t like to close HTML tags. This cuts 30% of the visual bloat out of my templates.

Re: Htmx 2.0.0 has been released

#104

Earlier quoted context omitted.

can you comment on what those 500 lines actually were? react+redux?

It was all normal JS code to handle a complicated form we have on a customer facing portal page. By moving to htmx I was able to rely on the server side to handle basically everything with only a small addition of code to what it was already doing.

I'm qurious what that code was doing that could be just moved to the backend. Usually forms have some validation for a better experience with the final validation on the server. Did you get rid of that and just show an error if the submission failed?

Re: Htmx 2.0.0 has been released

#105
post #84

Earlier quoted context omitted.

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).…

This was my experience as well. No great template generator on the node side. I use PUG. I don’t like to close HTML tags. This cuts 30% of the visual bloat out of my templates.

removingspacesgotridofalotofmybloatonregulartexttoo.

One man's structure is another man's "bloat", I guess.

Re: Htmx 2.0.0 has been released

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

I usually use Clojure, Huff for html templating, and whatever DB libs. Pretty much whatever is in Biff[1] is what I want to use.

[1] https://biffweb.com/

Re: Htmx 2.0.0 has been released

#107

Earlier quoted context omitted.

Isn’t that moving code around, not deleting it?

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.

Near enough exactly this

Re: Htmx 2.0.0 has been released

#108
post #104

Earlier quoted context omitted.

It was all normal JS code to handle a complicated form we have on a customer facing portal page. By moving to htmx I was able to rely on the server side to handle basically everything with only a small addition of code to what it was already doing.

I'm qurious what that code was doing that could be just moved to the backend. Usually forms have some validation for a better experience with the final validation on the server. Did you get rid of that and just show an error if the submission failed?

Near enough yes but it was a nice helpful error message with the form fully populated as they left it - as far as it looks the user it’s client side validation as the service responds with just the correct html for the form and htmx swaps out the chunk of html.

Its like old school for validation back in the CodeIgniter days.

Re: Htmx 2.0.0 has been released

#109
post #4

Earlier quoted context omitted.

Huge congrats on the major number release. HTMX is simply wonderful. Using it for a major project as we speak!

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 fetching and rendering an entity's properties panel, enabling add/edit for entity or edge properties, and so on. Search updates results with HTMX. Entity/property edits are done with HTMX "panels".

The entire experience using Go + Fiber (gofiber.io) + templates + HTMX (htmx.org) is fantastic. This approach has allowed us to create a beautiful modern application that's highly performant, interactive in all the places you'd expect, and simple code, deps, devops, etc.

Re: Htmx 2.0.0 has been released

#110

Earlier quoted context omitted.

This was my experience as well. No great template generator on the node side. I use PUG. I don’t like to close HTML tags. This cuts 30% of the visual bloat out of my templates.

removingspacesgotridofalotofmybloatonregulartexttoo. One man's structure is another man's "bloat", I guess.

PUG actually adds spaces: it's indentation based.

What it removes is the visual bloat of closing html tags.

So instead of:

    
         

Some content

More content

Another paragraph

In PUG you do:

    #foo.bar.baz
        p Some content
    #foo2.bar2.baz2
        p More content
        p Another Paragraph
Even without syntax highlighting, it's plain at a glance where markup stops and content starts in PUG.

And it's easier to visually parse element IDs and chained classes this way too.

Post reply on HN