Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.