Skip to content
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(multiple): add non-null assertions first and last #23958

Merged
merged 1 commit into from
Nov 15, 2021

Conversation

dario-piotrowicz
Copy link
Contributor

@dario-piotrowicz dario-piotrowicz commented Nov 11, 2021

Angular's QueryList first and last can actually be undefined,
although this is not reflected by their type
(this is a current bug in Angular: angular/angular#42563)
this commit adds non-null assertions to first and last references within the codebase
in preparation for solving the Angular bug without causing too many breaking changes

For more information see: angular/angular#43604

@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 11, 2021
@dario-piotrowicz
Copy link
Contributor Author

I just wanted to add:

  • I just added non-null assertions because by reading the code it seemed clear to me that the problematic firsts and lasts are always going to be defined
  • this is really not making any real change in the components' codebase, as far as typescript is concerned those elements were not going to going to be undefined anyways, this is just a change to hopefully ease the resolution of the Angular's QueryList first and last bug

@dario-piotrowicz dario-piotrowicz changed the title refactor(multiple): add non-null assertion operator to first and last refactor(multiple): add non-null assertions first and last Nov 11, 2021
Angular's QueryList first and last can actually be `undefined`,
although this is not reflected by their type
(this is a current bug in Angular: angular/angular#42563)
this commit adds non-null assertions to first and last references within the codebase
in preparation for solving the Angular bug without causing too many breaking changes

For more information see: angular/angular#43604
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker merge safe target: patch This PR is targeted for the next patch release labels Nov 12, 2021
@mmalerba mmalerba merged commit 5138328 into angular:master Nov 15, 2021
mmalerba pushed a commit that referenced this pull request Nov 15, 2021
Angular's QueryList first and last can actually be `undefined`,
although this is not reflected by their type
(this is a current bug in Angular: angular/angular#42563)
this commit adds non-null assertions to first and last references within the codebase
in preparation for solving the Angular bug without causing too many breaking changes

For more information see: angular/angular#43604

(cherry picked from commit 5138328)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 16, 2021
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 cla: yes PR author has agreed to Google's Contributor License Agreement target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants