-
Notifications
You must be signed in to change notification settings - Fork 15
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
[v0.6] Queues & Caches #65
base: main
Are you sure you want to change the base?
Conversation
Alright, all tests except for the redirect tests are passing now. Redirects will need to be handled a little differently now because full page reloads no longer exist. I still have a few bigger concerns to work through before I feel good about adding this features:
|
Hey, that all sounds good and it's something I felt I missed from this library compared to others indeed. |
I just want to mention that I am incredibly impressed by how everything just beautifully falls out of the basic rules of this library! |
This PR introduces a new request queuing and caching system that will support client-side routing features similar to
hx-boost
and Hotwire's Turbo.The queue will handle concurrency issues in situations where multiple requests could cause race conditions, like when a user is clicking faster than the server can respond, or multiple AJAX requests target the same element on the page.
The cache will store AJAX responses in memory and reuse the response on subsequent requests before requesting fresh data. The user will experience instant UI changes as they navigate between pages that have been cached.
I'd also like to introduce support for pre-fetching requests to make page navigation feel even faster.
I also rewrote Alpine AJAX using a class-based architecture, concepts are better organized now, and the code base is a few kBs smaller when compressed.The project ended up growing considerably in size, so I reverted a lot of these changes.So far I don't see any new APIs required to make this all work. My plan is that it will all just be automatically available after installing Alpine AJAX.
Fixes #40