fix(router): fragment can be null#37336
fix(router): fragment can be null#37336MatthiasKunnen wants to merge 1 commit intoangular:masterfrom
Conversation
2c7b47f to
deb0a53
Compare
|
@atscott, this is the superseding PR. |
deb0a53 to
69c309d
Compare
|
I just updated the golden file, forgot that yesterday. |
atscott
left a comment
There was a problem hiding this comment.
Thanks for fixing this and putting the breaking change footer in! LGTM with some small change requests.
As this is a breaking change, we'll need to wait until v11
|
Made changes as requested |
|
Ah, looks like your second commit doesn't have a commit message body that satisfies the 100 character requirement. Maybe squash your commits into one and just use the first? |
|
Adding |
532e76c to
799ba4a
Compare
jelbourn
left a comment
There was a problem hiding this comment.
LGTM
Reviewed-for: public-api
|
Is there a reason this was not part of the Angular 11 release? |
|
Resolved conflicts |
|
Migration PR: #41092. |
Adds a migration that casts the value of `ActivatedRouteSnapshot.fragment` to be non-nullable. Also moves some code from the `AbstractControl.parent` migration so that it can be reused. Relates to angular#37336.
|
|
|
caretaker note: please merge and sync this one on its own. g3 cleanup has been performed but things may have changed since then. |
atscott
left a comment
There was a problem hiding this comment.
reviewed-for: public-api
|
If you need me to do anything; rebase, ... let me know |
ActivatedRoute.fragment was typed as Observable<string> but could emit both null and undefined due to incorrect non-null assertion. These non-null assertions have been removed and fragment has been retyped to string | null. BREAKING CHANGE: Strict null checks will report on fragment potentially being null. Migration path: add null check. Fixes angular#23894, fixes angular#34197. PR Close angular#37336
…lar#41092) Adds a migration that casts the value of `ActivatedRouteSnapshot.fragment` to be non-nullable. Also moves some code from the `AbstractControl.parent` migration so that it can be reused. Relates to angular#37336. PR Close angular#41092
|
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. |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
ActivatedRoute.fragmentis typed asObservable<string>but can emit bothnullandundefineddue to incorrect non-null assertions.Issue Number: #23894, #34197.
What is the new behavior?
The non-null assertions have been removed and fragment has been retyped to
string | null.undefinedfragments will no longer occur.Does this PR introduce a breaking change?
BREAKING CHANGE:
Strict null checks will report on fragment potentially being null.
Migration path: add null check.
Other information
Fixes #23894, fixes #34197, fixes #29391.
Supersedes #37334, #29819.