feat(router): helper functions to convert class guards to functional#48709
Closed
atscott wants to merge 3 commits intoangular:mainfrom
Closed
feat(router): helper functions to convert class guards to functional#48709atscott wants to merge 3 commits intoangular:mainfrom
atscott wants to merge 3 commits intoangular:mainfrom
Conversation
2f3f1b3 to
687d916
Compare
8ab452c to
9dd2717
Compare
josephperrott
approved these changes
Feb 14, 2023
Member
josephperrott
left a comment
There was a problem hiding this comment.
LGTM
Reviewed-for: dev-infra
dylhunn
approved these changes
Feb 15, 2023
jessicajaniuk
approved these changes
Feb 15, 2023
Contributor
jessicajaniuk
left a comment
There was a problem hiding this comment.
reviewed-for: public-api
This commit introduces helper functions to easily convert `Injectable`s with functions compatible with `Route` guards to the corresponding guard functions. These functions will serve to aid in migrating off of the now deprecated class-based guards, but also provide an easy avenue to still defining guards as `Injectable` classes if that is desired.
3575388 to
d101d04
Compare
d101d04 to
85a5856
Compare
Contributor
|
This PR was merged into the repository by commit 455c728. |
Contributor
|
@atscott |
Contributor
Author
|
@destus90 there will be a migration |
|
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. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 commit introduces helper functions to easily convert
Injectables with functions compatible withRouteguards to the corresponding guard functions. These functions will serve to aid in migrating off of the now deprecated class-based guards, but also provide an easy avenue to still defining guards asInjectableclasses if that is desired.Reviewer notes: Open to bikeshedding the API here. We could just have separate functions for each type of guard. I thought grouping them would help in discovery but maybe it's more confusing than the alternative.