-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
fix(router): correctly deactivate children with componentless parent #40196
Closed
Conversation
This file contains 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
atscott
added
action: review
The PR is still awaiting reviews from at least one requested reviewer
area: router
target: patch
This PR is targeted for the next patch release
labels
Dec 18, 2020
3 tasks
During route activation, a componentless route will not have a context created for it, but the logic continues to recurse so that children are still activated. This can be seen here: https://github.com/angular/angular/blob/362f45c4bf1bb49a90b014d2053f4c4474d132c0/packages/router/src/operators/activate_routes.ts#L151-L158 The current deactivation logic does not currently account for componentless routes. This commit adjusts the deactivation logic so that if a context cannot be retrieved for a given route (because it is componentless), we continue to recurse and deactivate the children using the same `parentContexts` in the same way that activation does. Fixes angular#20694
atscott
force-pushed
the
deactivateemptychildren
branch
from
January 4, 2021 23:46
26a3edc
to
cb31513
Compare
mhevery
approved these changes
Jan 6, 2021
atscott
added
action: merge
The PR is ready for merge by the caretaker
and removed
action: review
The PR is still awaiting reviews from at least one requested reviewer
labels
Jan 6, 2021
atscott
added a commit
that referenced
this pull request
Jan 6, 2021
…40196) During route activation, a componentless route will not have a context created for it, but the logic continues to recurse so that children are still activated. This can be seen here: https://github.com/angular/angular/blob/362f45c4bf1bb49a90b014d2053f4c4474d132c0/packages/router/src/operators/activate_routes.ts#L151-L158 The current deactivation logic does not currently account for componentless routes. This commit adjusts the deactivation logic so that if a context cannot be retrieved for a given route (because it is componentless), we continue to recurse and deactivate the children using the same `parentContexts` in the same way that activation does. Fixes #20694 PR Close #40196
3 tasks
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
action: merge
The PR is ready for merge by the caretaker
area: router
cla: yes
target: patch
This PR is targeted for the next patch release
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.
During route activation, a componentless route will not have a context created
for it, but the logic continues to recurse so that children are still
activated. This can be seen here:
angular/packages/router/src/operators/activate_routes.ts
Lines 151 to 158 in 362f45c
The current deactivation logic does not currently account for componentless routes.
This commit adjusts the deactivation logic so that if a context cannot
be retrieved for a given route (because it is componentless), we
continue to recurse and deactivate the children using the same
parentContexts
in the same way that activation does.Fixes #20694
Fixes #40196
regular presubmit and global
additional integration tests. Compared with results from clean client and a second run from this PR, they have the same number of failures so these are likely pre-existing and/or flakes. Pending code approval, all g3 signs seem to indicate that this should be okay to merge.