Live data from Hacker News

Htmx 4.0

four.htmx.org

231–239 of 239 posts

Re: Htmx 4.0

#231

And by the looks of it, the Author is starting to understand the reason React and the likes exists and has start to build them over again: https://fixiproject.org/ LOL. Frontend dev never changes.

What part of the Fixi project is building something like React?

Not react yet, but it is approaching the early 2010 jQuery and Backbone vibes, so give it another 5 years and it will converge to React.

Re: Htmx 4.0

#232
post #160

Most sites/apps I work on are progressively enhanced ( https://www.gov.uk/service-manual/technology/using-progressi... ) So far I've used a little bit of htmx (2) for one of them, and I really love it. Just a few attributes and we get some very reasonable progressively enhanced client/server interactive elements without full page loads. Not sure I would choose if I had to make a SPA - it's partially from ignorance, b…

TIL! One more reason to like gov.uk. I had no idea this was a standard but in hindsight it's quite obvious that's the case. I wonder how much of a burden it is at times, and how one can enforce this with automation?

I would say it's only really a burden if you fight it, or don't expect to have to do it and right at the end someone asks "er... does this work without JavaScript?". My attitude is that it's a combination of freeing and a challenge: "we can and should make it simple, even boring"

Automatic enforcement for all services is tricky, because you _can_ depend on JavaScript if the user needs justify it.

Re: Htmx 4.0

#233

Earlier quoted context omitted.

I haven't used sessions in over a decade and haven't regretted that decision once. It opens up a whole new class of problems you don't have when using client-side frameworks.

So what do you use instead?

It depends on the specific data. Do you have anything that you store in session in mind?

Having the client/server split has made this a lot easier to reason about. I store client state on the client and server state stays on the server.

Re: Htmx 4.0

#234

Earlier quoted context omitted.

Are you not familiar with building web apps? So, when building for the web you'll essentially have 2 different categories of state: server and client. Server state is obviously what's pulled fromt the db, but that's 100% not where something like form state should be stored. Or button toggle state. Or whether a modal is open, etc.

I have written web apps and about 80% of the sorts of things you are talking about can be handled with just html/css and I just use javascript for the other 20%. It's not like when you use htmx it disables all other javascript APIs.

We are talking about how state is stored, not about CSS.

And it makes me think you haven't had as much experience as you think.

How do you deal with form state using CSS? Where does it get stored? In the html as elements? So not on the server?

Re: Htmx 4.0

#235

Maybe I’m missing something, but why would you want HTMX server side rendering, rather than a restful API that can return platform-agnostic data structures that you could render in various contexts, like a SPA, or a mobile app, or a terminal app, etc?

Because serialisation and deserialisation have a price and you almost never need what you describe

Who pays it?

And I disagree, we definitely use the same API for other contexts.

Re: Htmx 4.0

#236
post #186
post #7

Congrats and thanks! htmx brings me joy. Pretty much every experiment I build now starts with Go, htmx, and SQLite to keep things simple and fast but still responsive. I put a few more thoughts about this here: https://housecat.com/blog/the-hugs-stack-hypermedia-unix-go-...

How are you using dbos with SQLite? The docs say its a Postgres library

Hello, I'm from DBOS.

Our Golang and Python SDKs support SQLite as well as Postgres.

Re: Htmx 4.0

#237
post #186

Earlier quoted context omitted.

How are you using dbos with SQLite? The docs say its a Postgres library

Hello, I'm from DBOS. Our Golang and Python SDKs support SQLite as well as Postgres.

Interesting, it's not mentioned anywhere in the https://github.com/dbos-inc/dbos-transact-golang README. By contrast, Postgres is mentioned right at the top.

I recommend updating the README to mention SQLite somewhere, with maybe a link to https://docs.dbos.dev/golang/reference/configuration#using-s... ?

Re: Htmx 4.0

#238

Earlier quoted context omitted.

I have written web apps and about 80% of the sorts of things you are talking about can be handled with just html/css and I just use javascript for the other 20%. It's not like when you use htmx it disables all other javascript APIs.

We are talking about how state is stored, not about CSS. And it makes me think you haven't had as much experience as you think. How do you deal with form state using CSS? Where does it get stored? In the html as elements? So not on the server?

> How do you deal with form state using CSS? Where does it get stored? In the html as elements? So not on the server?

For really simple stuff you can use CSS sibling selectors: https://jsfiddle.net/Kqscu/4/

For more complicated stuff, it is in the html as elements. With htmx you can often do this by making a request to the server to update a subtree; the server doesn't need to know the state that the user is seeing, just what is happening in the specific request.

Sometimes just updating html subtrees isn't quite enough, and then I use javascript. Transient state that is only concerned with what is presented to the user is probably not best done on the server.

Re: Htmx 4.0

#239

Earlier quoted context omitted.

So what do you use instead?

It depends on the specific data. Do you have anything that you store in session in mind? Having the client/server split has made this a lot easier to reason about. I store client state on the client and server state stays on the server.

I’m talking about auth, like a session cookie. What do you use for auth?
Post reply on HN