gorgeous-airport-54386
01/06/2023, 7:39 PMgorgeous-airport-54386
01/06/2023, 7:39 PMhtml
<a href="...">
tall-dinner-62086
01/06/2023, 7:39 PMechoing-lion-55988
01/06/2023, 7:39 PMgorgeous-airport-54386
01/06/2023, 7:40 PMechoing-lion-55988
01/06/2023, 7:40 PMgorgeous-airport-54386
01/06/2023, 7:40 PMechoing-lion-55988
01/06/2023, 7:40 PMechoing-lion-55988
01/06/2023, 7:40 PMechoing-lion-55988
01/06/2023, 7:40 PMechoing-lion-55988
01/06/2023, 7:40 PMrich-television-50179
01/06/2023, 7:40 PMa
element look like a button.gorgeous-airport-54386
01/06/2023, 7:40 PMechoing-lion-55988
01/06/2023, 7:41 PMechoing-lion-55988
01/06/2023, 7:41 PMtall-dinner-62086
01/06/2023, 7:41 PMhx-get
and return an HX-Redirect
header, or you could just wrap the button in a get formtall-dinner-62086
01/06/2023, 7:42 PMechoing-lion-55988
01/06/2023, 7:42 PMtall-dinner-62086
01/06/2023, 7:43 PMechoing-lion-55988
01/06/2023, 7:43 PMgorgeous-airport-54386
01/06/2023, 8:07 PMlimited-potato-46306
01/06/2023, 8:24 PMajaxHelper
was public is because of the comment here (https://github.com/croxton/htmx/blob/03c3e871313dcc73132d8a69de07ab6cbbe021be/src/htmx.js#L16). If indeed this function is public, then the variable path
that we are using as the hxLocationHeaderPath
will not always be tied to Hx-Location
. Some extension using this function would probably break. This leads me to advocate for either changing the parameters that ajaxHelper
takes OR, preferably, to not use that function when handling the Hx-Location
header. @mysterious-toddler-20573 should this function be treated as public?
2. In terms of the main change from my code to yours where you pass the swap spec source element (https://github.com/croxton/htmx/blob/refactor/hx-location/src/htmx.js#L3058), I think the reason to do this is as you mentioned to "act like following a hx-boost link" by respecting other attributes on the element. While I believe you are correct that this would bring Hx-Location
in line with the documentation, this is a bigger change that means making Hx-Location
play nice with all the other attributes on the element. It is a good sign that existing tests pass, and I wonder, do we need any new tests? If new tests are required, could we make a PR with my changes and then a future PR with your change + new tests?
3. @hundreds-camera-24900 @mysterious-toddler-20573 In general, I wonder if the scope of Hx-Location
is too big. Does it really need to have a callback that could be passed in via a header?
I really appreciate you all looking into this - I love HTMX+Alpine as an alternative to Vue/React, and supporting use cases for the hx-history-preserve
extension is vital to be able to ditch those frameworks.echoing-lion-55988
01/06/2023, 9:06 PMechoing-lion-55988
01/06/2023, 9:06 PMmysterious-toddler-20573
01/06/2023, 9:19 PMmysterious-toddler-20573
01/06/2023, 9:19 PMhundreds-cartoon-20446
01/06/2023, 9:21 PMmysterious-toddler-20573
01/06/2023, 9:22 PMajaxHelper
is exposed at just htmx.ajax
mysterious-toddler-20573
01/06/2023, 9:22 PMHX-Location
here? I have to admit I'm not really up to speed yet.