stocky-school-57923
12/28/2022, 9:06 PMadventurous-ocean-93733
12/28/2022, 9:42 PMstocky-school-57923
12/28/2022, 9:46 PMlimited-potato-46306
12/28/2022, 10:13 PMmysterious-toddler-20573
12/28/2022, 10:44 PMlate-king-98305
12/28/2022, 10:45 PMmysterious-toddler-20573
12/28/2022, 10:53 PMlimited-potato-46306
12/28/2022, 10:54 PMmysterious-toddler-20573
12/28/2022, 10:55 PMhtmx:historyRestore
event from the body: https://htmx.org/events/#htmx:historyRestoremysterious-toddler-20573
12/28/2022, 10:56 PMmysterious-toddler-20573
12/28/2022, 10:56 PMlimited-potato-46306
12/28/2022, 11:04 PMmysterious-toddler-20573
12/28/2022, 11:14 PMhtml
<div hx-get="/view-count"
hx-trigger="load, htmx:historyRestore">
Count is ...
</div>
mysterious-toddler-20573
12/28/2022, 11:15 PMmysterious-toddler-20573
12/28/2022, 11:15 PMhundreds-camera-24900
12/29/2022, 1:18 AMhundreds-camera-24900
12/29/2022, 1:20 AMjinja
<form action="{{ url('account_signup') }}"
method="post"
hx-target="#account-box"
hx-swap="outerHTML"
@htmx:after-settle.window="$dispatch('progress', 20)"
class="flex flex-col space-y-10">
....
<button type="submit" x-data="" x-on:click="$dispatch('submit', 'normal primary rounded md')">
Create Account
</button>
</form>
hundreds-camera-24900
12/29/2022, 1:21 AMhundreds-camera-24900
12/29/2022, 1:21 AMhundreds-camera-24900
12/29/2022, 1:21 AMvictorious-thailand-80225
12/29/2022, 5:01 AMhx-*
are not great. Instead, data-hx-*
would be ideal. What do you think about this?limited-potato-46306
12/29/2022, 5:15 AMadventurous-ocean-93733
12/29/2022, 6:54 AMlate-king-98305
12/29/2022, 2:01 PMdata-hx-*
instead of hx-*
. The former would pass validation (do people still do that?), while the latter saves 5 bytes every time it's used. I don't think the difference is worth the complexity to do either, based on a flag, and I guess it's OK to be opinionated. I haven't gotten any complaints either way.adventurous-ocean-93733
12/29/2022, 2:26 PMdata-hx-*
tags. Y’know, for the big brains.mysterious-toddler-20573
12/29/2022, 3:05 PMmysterious-toddler-20573
12/29/2022, 3:06 PMmonitorEvents()
to see what's up? https://htmx.org/docs/#debugginglimited-potato-46306
12/29/2022, 3:27 PM<div
hx-get="/somedata"
hx-trigger="load"
x-init="$el.innerHTML = ''">
</div>
Here, alpine will clear the data that would otherwise load stale in a snapshot when a user navigates back. If alpine did not clear it when restoring from a snapshot, before the element loaded, there would be a flash as the old snapshot data was replaced with the new data from on load.
Is there any appetite for having an hx-ignore-history
or something like that which could be put on an element? I think an extension could be written, but it feels to me like it would fit the core and really enable SPAs without having to use Alpine.limited-potato-46306
12/29/2022, 3:29 PM