-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Transition only between pages where both have ViewTransitions enabled #8441
Conversation
🦋 Changeset detectedLatest commit: 0fedb9a The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Looks great! Should note that we checked |
Changes
Before:
The history could contain states which are not handled by the client-side router when it dies during a visit to pages without
<ViewTransitions>
. The client-side router dies when a page w/o<ViewTransitions>
is (re)loaded (no swap). The load deletes the router's modules. This is not a problem if the user navigates back to a page with<ViewTransitions>
and this is reloaded. But if the browser history contains an entry for that page that was originally created by the router, the browser expects the now-deceased router to force the reload for that history entry. This results in a broken backward navigation.Change:
With this change, new history entries and (view transitions) will only be created if the target page also defines
<ViewTransitions>
. This way the browser's backward navigation will always restore the router in time, even if lost on pages without<ViewTransitions>
.Testing
Added e2e test to prove that a killed router is revived correctly.
Adjusted existing tests because navigation to pages without
<ViewTransition>
leads to reloads.Docs
n/a. bug fix