> 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…
Htmx 2.0.4 Released
11–20 of 136 posts
Re: Htmx 2.0.4 Released
#12There'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
That isn't very common.
> sessionStorage wouldn't survive a tab close
When a tab is restored, the browser typically restores sessionStorage.
> i'm not opposed to making the latter an option though
That isn't what I was getting at. If I'm going to buy into htmx, I want to understand the design. I wondered why this was the default, and why I hadn't seen it mentioned as a security concern.
Re: Htmx 2.0.4 Released
#13Earlier quoted context omitted.
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
> memory wouldn't survive a page refresh That isn't very common. > sessionStorage wouldn't survive a tab close When a tab is restored, the browser typically restores sessionStorage. > i'm not opposed to making the latter an option though That isn't what I was getting at. If I'm going to buy into htmx, I want to understand the design. I wondered why this was the default, and why I hadn't seen it mentioned as a securit…
Is it guaranteed to do this? Otherwise, if it just sometimes does it, or different browsers handle it differently/may change in the future, it seems like a recipe for problems.
Re: Htmx 2.0.4 Released
#14Earlier quoted context omitted.
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
> memory wouldn't survive a page refresh That isn't very common. > sessionStorage wouldn't survive a tab close When a tab is restored, the browser typically restores sessionStorage. > i'm not opposed to making the latter an option though That isn't what I was getting at. If I'm going to buy into htmx, I want to understand the design. I wondered why this was the default, and why I hadn't seen it mentioned as a securit…
Re: Htmx 2.0.4 Released
#15Earlier quoted context omitted.
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
> memory wouldn't survive a page refresh That isn't very common. > sessionStorage wouldn't survive a tab close When a tab is restored, the browser typically restores sessionStorage. > i'm not opposed to making the latter an option though That isn't what I was getting at. If I'm going to buy into htmx, I want to understand the design. I wondered why this was the default, and why I hadn't seen it mentioned as a securit…
no strong opinions on session vs local storage, i was trying to make htmx act as much like the browser as possible and the browser caches across tabs
you can disable history on any page by using the hx-history attribute and you can force a server request on every history navigation by setting the htmx.config.historyCacheSize config option to 0:
Re: Htmx 2.0.4 Released
#16Earlier quoted context omitted.
> memory wouldn't survive a page refresh That isn't very common. > sessionStorage wouldn't survive a tab close When a tab is restored, the browser typically restores sessionStorage. > i'm not opposed to making the latter an option though That isn't what I was getting at. If I'm going to buy into htmx, I want to understand the design. I wondered why this was the default, and why I hadn't seen it mentioned as a securit…
A page refresh isn't common?
Re: Htmx 2.0.4 Released
#17I mean it's nice that it's a bit more modern but still.
Re: Htmx 2.0.4 Released
#18Nothing new under the sun. This is just a rip off of intercooler js. Only without jQuery. Times moved on and someone copied the idea (exactly) but with the aid of modern JavaScript didn't need jQuery. I mean it's nice that it's a bit more modern but still.
Re: Htmx 2.0.4 Released
#19Earlier quoted context omitted.
> memory wouldn't survive a page refresh That isn't very common. > sessionStorage wouldn't survive a tab close When a tab is restored, the browser typically restores sessionStorage. > i'm not opposed to making the latter an option though That isn't what I was getting at. If I'm going to buy into htmx, I want to understand the design. I wondered why this was the default, and why I hadn't seen it mentioned as a securit…
> When a tab is restored, the browser typically restores sessionStorage Is it guaranteed to do this? Otherwise, if it just sometimes does it, or different browsers handle it differently/may change in the future, it seems like a recipe for problems.
Chrome does, however, if the “resume where i left off” setting is enabled.
Re: Htmx 2.0.4 Released
#20Nothing new under the sun. This is just a rip off of intercooler js. Only without jQuery. Times moved on and someone copied the idea (exactly) but with the aid of modern JavaScript didn't need jQuery. I mean it's nice that it's a bit more modern but still.