Live data from Hacker News

Htmx 2.0.4 Released

github.com

1–10 of 136 posts

Re: Htmx 2.0.4 Released

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

Re: Htmx 2.0.4 Released

#3

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

why would you call it expecting it to do nothing?

Re: Htmx 2.0.4 Released

#4

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

thatsthebeautyofit.com in shambles

Re: Htmx 2.0.4 Released

#5
post #3

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

why would you call it expecting it to do nothing?

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

Re: Htmx 2.0.4 Released

#6
There's a question I've had about htmx for some time, might as well ask it here. Why does it keep the history cache in localStorage and not sessionStorage or memory? Some kind of a microoptimization? sessionStorage seems like it would be better to me if it's really a good default. I also think it should be publicized more, because it unexpectedly keeps stuff in a location that can be accessed more easily and beyond where the browser's back button cache can.

Re: Htmx 2.0.4 Released

#7
post #6

There's a question I've had about htmx for some time, might as well ask it here. Why does it keep the history cache in localStorage and not sessionStorage or memory? Some kind of a microoptimization? sessionStorage seems like it would be better to me if it's really a good default. I also think it should be publicized more, because it unexpectedly keeps stuff in a location that can be accessed more easily and beyond w…

memory wouldn't survive a page refresh

sessionStorage wouldn't survive a tab close

i'm not opposed to making the latter an option though

Re: Htmx 2.0.4 Released

#8

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

yeah, the htmx JavaScript API is not widely used, but I agree it's right on the edge of what's acceptable in a patch release

Re: Htmx 2.0.4 Released

#9

> 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 response or some such thing. Seriously.

Should such a person have used fetch() instead? I dunno, probably; I don’t use htmx.

This is an extremely breaking change.

Post reply on HN