-
-
Notifications
You must be signed in to change notification settings - Fork 194
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
Location getter + abortable check #904
Conversation
Size Change: +175 B (+0.76%) Total Size: 23.1 kB
|
Playwright test resultsDetails
Skipped testswebkit → animation-timing.spec.ts → animation timing → detects animation timing |
It should read "allowing", not "Not allowing", right? :) Also: this only holds true for |
@hirasso No, I think that's what I actually meant to write. In the following sense: by not allowing history visits to be aborted, we now make it impossible to supersede history visits. That would be the case when clicking the back button a few times in quick succession. If the cache is disabled or history visits are animated, every one of these history visits will have to finish completely before queueing the next one. Hence, we should allow aborting history visits if there's a new visit. I need to remove that part from this PR. The really not allowing to abort them was only necessary in the previous PR where one could abort a visit from anywhere at any point. But even there we should have added a special condition for quick history visits in succession. This is all very confusing :/ I really wish we had a nice state machine 🤖 |
It's indeed pretty confusing... thank you for clarifying what exactly you meant. |
Addressed the open points and fixed the tests. Ready for review :) |
visit.state = VisitState.STARTED; | ||
|
||
// Create/update history record if this is not a popstate call or leads to the same URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving the bit where the URL updates feels pretty scary to me. I can recall various situations where we discovered quite late in the process that the exact moment where the URL was updated had a lot of implications.
Why did you move it?
This is doing a bit too much — slimmed down PR incoming :) |
Description
visit:abort
branch that make senseLocation object
Location
object atswup.location
swup.currentPageUrl
in favor ofswup.location.url
Location update
Aborting visits
visit.abortable
getter that defines when a visit can be abortedHistory visits cannot be aborted(wrong assumption, needs to be abortable)swup.navigate()
Note to self
Checks
master
branchnpm run lint
)npm run test
)