Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

History push on x-target event #33

Closed
adamkiss opened this issue Sep 14, 2023 · 3 comments · Fixed by #37
Closed

History push on x-target event #33

adamkiss opened this issue Sep 14, 2023 · 3 comments · Fixed by #37

Comments

@adamkiss
Copy link

Hi, I was playing with this today, and I like it so far, so thank you :)

If I enhance links (a la wire:navigate or htmx-boost) or use alpine ajax for filtering (involving get queries), is it on me to manually manage history / push/replace URLs, or do I have an error in the code? I haven't found anything about the history in the docs

@adamkiss
Copy link
Author

adamkiss commented Sep 14, 2023

I just realised that in #19 you cover the filtering use case (manage history yourself), so that part's answered. Is it the same for links enhanced with x-target?

@imacrayon
Copy link
Owner

imacrayon commented Sep 14, 2023

Yeah right now Alpine AJAX doesn't cover this use case. It's definitely something I'm interested in, but I'm waiting to see how things shake out over on the Alpine.js repo. The reason being that wire:navigate and the query string history stuff in Livewire are already powered by an Alpine plugin under the hood, and I think Caleb intends to make both of those plugins official first-party plugins eventually. If that ends up being the case I don't want to build an Alpine AJAX API that could be incompatible with the first-party plugins.

If you're wanting to implement SPA-like navigation right now with Alpine AJAX, Classic Turbolinks still works well, or I like to drop https://instant.page/ into my projects; I think preloaded links go a long way in making apps feel fast without having to mess with the history push state stuff.

@adamkiss
Copy link
Author

adamkiss commented Sep 14, 2023

Yeah right now Alpine AJAX doesn't cover this use case. It's definitely something I'm interested in, but I'm waiting to see how things shake out over on the Alpine.js repo. The reason being that wire:navigate and the query string history stuff in Livewire are already powered by an Alpine plugin under the hood, and I think Caleb intends to make both of those plugins official first-party plugins eventually. If that ends up being the case I don't want to build an Alpine AJAX API that could be incompatible with the first-party plugins.

Fair enough, that makes sense

If you're wanting to implement SPA-like navigation right now with Alpine AJAX, Classic Turbolinks still works well, or I like to drop https://instant.page/ into my projects; I think preloaded links go a long way in making apps feel fast without having to mess with the history push state stuff.

I'd just use htmx if that was the case, but I thought - I already have a thing doing ajax/merge thing (alpine-ajax) installed, I might as well speedup the browsing, you know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants