Live data from Hacker News

Htmx 2.0.4 Released

github.com

101–110 of 136 posts

Re: Htmx 2.0.4 Released

#101

Do some people have examples of interactivity they were able to replace with Htmx? For me, I've been able to get turbo style links with the boost to get nice page transitions. I can also see how I could use the class-tools extension to enable buttons to open dialogs etc. I'm curious to see when people say they needed an SPA for interactivity, what interactive features Htmx can already do and when do we need to break…

I tried HTMX but found it too restricting. It's great if you just want to load a portion of the page. Maybe if you have an up-vote, just send the request and replace the icon with a gold icon. But I want things like an on-site calculator. I load in products and prices, users can adjust sliders to change the quantity and relevant number is calculated. I don't want to use HTMX for this to call the server each time, I w…

Because HTMX is declarative and the declaration is in HTML, people have weirdly extended the "no need for js+json+rendering for ajax" to "don't use js".

This is making your life needlessly difficult.

HTMX is just a fancy ajax layer with a little event handling sprinkled on top. You can and should script to your heart content even if you use it, when you need so.

I use js in all most of my HTMX powered pages. Sometimes just a few lines. Sometimes a whole lot. Sometimes vanilla, sometimes alpine. I even have one where I load react for one single page because I want a community widget while the rest of the site is pure HTMX.

You can do whatever you want.

Re: Htmx 2.0.4 Released

#102

> Calling htmx.ajax with no target or source now defaults to body (previously did nothing) This one jumped out to me as an interesting one for a patch release. Changing the default behavior feels like a breaking change, though hopefully there weren't sites expecting an ajax call to not do anything.

> though hopefully there weren't sites expecting an ajax call to not do anything It didn’t need to do nothing , it just needed to have no visible effect. I would be absolutely astonished if this affected no one. It’s very easy to imagine someone having written htmx.ajax("GET", "/some-tracker-that-returns-nothing-or-json-or-something") And now your body is clobbered, leaving either nothing behind or a raw JSON respons…

That's fair, I guess someone could be doing that. Not quite sure why you would though, if you're already in JS and aren't updating the DOM, fetch() would make more sense.

Either way it sounds like this was a fix to a bug introduced in the last patch so the semver makes more sense here.

Re: Htmx 2.0.4 Released

#103

what is the selling point of htmx? why use it versus ...?

You team knows Python/Ruby/PHP/Elixir/C# and uses Django/Rails/Laravel/Phoenix/ASP and doesn’t have a need to hire dedicated frontend people. You can leverage your existing talent to drive the frontend from the backend.

It has limitations (not going to use HTMX to build Google Maps) but handles the 80% of use cases well for little added skillset required.

Re: Htmx 2.0.4 Released

#104
post #96

I tried to use HTMX to fix some of the plumbing in our bathroom and I’m very disappointed … it just isn’t fit for purpose. I’m sticking with React

Same. Tried to write a boot loader in HTMX. Wish I’d used React instead.

Re: Htmx 2.0.4 Released

#106

Earlier quoted context omitted.

Imagine being this delusional

Go ahead and tell me how cacheable your SSR page is. If it was a static file? Oh yeah it never changes! How convenient! Maybe that's the point! People who promote SSR are simply trying to rope frontend devs into their P2 or P1 incident responses and use them as whipping boys. This shit has to stop. If you don't suspect your web devs are doing all kinds of cache-busting dog shit on your backend ruining your performanc…

Who hurt you?

Re: Htmx 2.0.4 Released

#107

Earlier quoted context omitted.

The correct function comes down to what the browser APIs say is valid in navigation. Both loading cached data and making the request again are valid. In the case of soft page navigation (onpushstate/onreplacestate) it's very clear that both are valid, as SPAs aren't expected to cache nothing, nor are they expected to cache everything.

If I’m currently filtering some search data and hit refresh (or the browser tab went to sleep and wakes up, or restored after a reboot) I expect it to be in the same place without having to search and filter again.

https://en.m.wikipedia.org/wiki/Query_string

Re: Htmx 2.0.4 Released

#108

Do some people have examples of interactivity they were able to replace with Htmx? For me, I've been able to get turbo style links with the boost to get nice page transitions. I can also see how I could use the class-tools extension to enable buttons to open dialogs etc. I'm curious to see when people say they needed an SPA for interactivity, what interactive features Htmx can already do and when do we need to break…

I recently tried out htmx for rendering a web clone of the terminal UI for https://github.com/bjackman/limmat It's a simple usecase but nonetheless I was blown away by how trivial HTMX made it! Very cool.

Interesting, I'm working on a similar project myself. Is your web clone open source?

Re: Htmx 2.0.4 Released

#109

Do some people have examples of interactivity they were able to replace with Htmx? For me, I've been able to get turbo style links with the boost to get nice page transitions. I can also see how I could use the class-tools extension to enable buttons to open dialogs etc. I'm curious to see when people say they needed an SPA for interactivity, what interactive features Htmx can already do and when do we need to break…

> An example that I think needs JS is a copy paste button.

Evidently you can use Hyperscript for this. Its website https://hyperscript.org/> demonstrates it with a similar "copy" button.

Re: Htmx 2.0.4 Released

#110
post #3

Earlier quoted context omitted.

why would you call it expecting it to do nothing?

why is the wrong question, because it doesn't matter

of course it matters. not all workflows are worth preserving at all costs. there could be a really important trade off lurking, I'm not familiar, which is why I asked!

https://xkcd.com/1172/

Post reply on HN