Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue number: resolves #25013
What is the current behavior?
A
beforeRouteEnter(to, from, next)guard that callsnext((vm) => vm.member = 5)never runs the callback. Vue Router's<router-view>invokes whatever ends up inmatchedRoute.enterCallbacks[name]from a post-flush watcher once the view's instance is set, butIonRouterOutletdoes its own rendering and skips that step.matchedRoute.instances.defaultgets populated inregisterIonPage, so internal guards still fire, but the queued enter callbacks sit there unusedWhat is the new behavior?
createViewStacks'sregisterIonPagenow readsmatchedRoute.enterCallbacks.default, resets it, and runs each callback with the resolved instance. The reset happens before invocation so a callback that triggers a synchronous navigation can push fresh entries onto the next matched record without getting wiped. There's a new Vitest case inrouting.spec.tsthat navigates into a page whosebeforeRouteEnterdoesnext((vm) => { vm.member = 5 })and asserts both the callback ran with the instance and the mutation reached the DOMDoes this introduce a breaking change?
Other information