4 ms·
> 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 wou
by chrismorgan 2y ago
> 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.
- recursivedoubts 2y agoYeah I tend to agree this should have been in a minor rather than a patch release. The reality is that I tend to regard the JavaScript api as an afterthought (the html attributes are the main api) and the existing behavior seemed like a nonsensical bug, but on reflection I wouldn’t have changed the html api like that and should treat the JavaScript api the same way.
- _heimdall 2y agoThat'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.