-
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
refactor(forms): eagerly initialize data members #44292
refactor(forms): eagerly initialize data members #44292
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Andrew left a couple comments that I agree with -- it's better to leave the !
assertions for members we know will be initialized. We can't add undefined to the types, since that's breaking.
29eae03
to
cba36de
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one comment on no longer needed type annotation.
@theruslanusmanov thanks for updating the PR! Could you please also merge all commits into one (into the first one)? |
@AndrewKushnir sure, thank you! |
0a99a59
to
1c3980d
Compare
Data members in AbstractControl should be eagerly initialized to address issue/24571. This eliminates the need to constantly check for truthiness and makes code much more readable. More PRs to follow to address issue/24571.
1c3980d
to
2414563
Compare
@theruslanusmanov thanks! I've also pushed a rebase, since the CI didn't start for some reasons previously. Once CI run is completed, we'll run tests in Google's codebase and let you know if there are any additional updates required. Thank you. |
FYI, I've started tests in Google's codebase (internal-only link). |
@theruslanusmanov tests in Google's codebase were successful and I'm adding this PR to the merge queue. Thanks for contributing to Angular 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewed-for: fw-forms
This PR was merged into the repository by commit ca5b9b5. |
Data members in AbstractControl should be eagerly initialized to address issue/24571. This eliminates the need to constantly check for truthiness and makes code much more readable. More PRs to follow to address issue/24571. PR Close #44292
Thank you for your contribution @theruslanusmanov! |
@dylhunn Thank you! |
Data members in AbstractControl should be eagerly initialized to address issue/24571. This eliminates the need to constantly check for truthiness and makes code much more readable. More PRs to follow to address issue/24571. PR Close angular#44292
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. |
Data members in AbstractControl should be eagerly
initialized to address #24571. This eliminates the need to
constantly check for truthiness and makes code much more readable.
More PRs to follow to address #24571.
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?
https://angular.io/api/forms/AbstractControl
Issue Number: 24571
What is the new behavior?
Removes '!' from AbstractControl data members
Does this PR introduce a breaking change?
Other information