Skip to content

Extended refactor - #43232

Closed
danieltre23 wants to merge 7 commits into
angular:masterfrom
danieltre23:extended-refactor
Closed

danieltre23 wants to merge 7 commits into
angular:masterfrom
danieltre23:extended-refactor

Conversation

@danieltre23

@danieltre23 danieltre23 commented Aug 23, 2021 •

Copy link
Copy Markdown
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

The extended package had some refactors pending which are addressed here.

Issue Number: #42966

What is the new behavior?

Refactored the extended package, added a TemplateCheckWithVisitor abstract class and added a new TemplateCheck for when the left side of a binary nullish coalescing operation is not nullable.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@google-cla google-cla Bot added the cla: yes label Aug 23, 2021
@danieltre23 danieltre23 added the target: patch This PR is targeted for the next patch release label Aug 23, 2021

@dgp1130 dgp1130 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Awesome work, thanks for putting this all together!

Mostly a bunch of nits and even the non-nits are fairly nitpicky.

@danieltre23
danieltre23 force-pushed the extended-refactor branch 2 times, most recently from 06d39ed to 270d445 Compare August 23, 2021 23:01
@danieltre23
danieltre23 requested a review from dgp1130 August 23, 2021 23:19

@dgp1130 dgp1130 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, just a few small improvements and a test to double check.

@atscott atscott left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks great! Only some small nits, but otherwise LGTM.

@danieltre23
danieltre23 force-pushed the extended-refactor branch 2 times, most recently from 405b9dc to 64fa077 Compare August 24, 2021 16:48
@danieltre23
danieltre23 requested a review from atscott August 24, 2021 16:55
@danieltre23
danieltre23 force-pushed the extended-refactor branch 3 times, most recently from 29f02ac to 4ee8e11 Compare August 24, 2021 19:14

@JoostK JoostK left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall LGTM, left a few nit comments

@atscott atscott left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

reviewed-for: public-api

@alxhub alxhub added the area: compiler Issues related to `ngc`, Angular's template compiler label Aug 25, 2021
jessicajaniuk pushed a commit that referenced this pull request Aug 26, 2021
…3232)

Move `component` out of the `TemplateContext` so the context can be
reused for multiple components.

Refs #42966

PR Close #43232
jessicajaniuk pushed a commit that referenced this pull request Aug 26, 2021
…#43232)

Add an abstract class that has a default implementation of the run
function and visits all nodes. Authors of template checks can extend
this class and override the `visitNode` method to return diagnostics.

Refs #42966

PR Close #43232
jessicajaniuk pushed a commit that referenced this pull request Aug 26, 2021
…anaInBoxCheck` (#43232)

Modify the existing template check to use the new abstract class. This
makes template checks easier to read and understand.

Refs #42966

PR Close #43232
jessicajaniuk pushed a commit that referenced this pull request Aug 26, 2021
Add a template check that returns diagnostics if the left side of a
nullish coalescing operation is not nullable.

Refs #42966

PR Close #43232
jessicajaniuk pushed a commit that referenced this pull request Aug 26, 2021
…#43232)

Add tests to make sure the nullish coalescing check is generating the
correct diagnostics.

Refs #42966

PR Close #43232
jessicajaniuk pushed a commit that referenced this pull request Aug 26, 2021
Remove extra whitespace introduced in a previous PR.

PR Close #43232
jessicajaniuk pushed a commit that referenced this pull request Aug 26, 2021
Change template checks into `extended/checks` instead of
`extended/src/template_checks`.

Refs #42966

PR Close #43232
jessicajaniuk pushed a commit that referenced this pull request Aug 26, 2021
…3232)

Move `component` out of the `TemplateContext` so the context can be
reused for multiple components.

Refs #42966

PR Close #43232
jessicajaniuk pushed a commit that referenced this pull request Aug 26, 2021
…#43232)

Add an abstract class that has a default implementation of the run
function and visits all nodes. Authors of template checks can extend
this class and override the `visitNode` method to return diagnostics.

Refs #42966

PR Close #43232
jessicajaniuk pushed a commit that referenced this pull request Aug 26, 2021
…anaInBoxCheck` (#43232)

Modify the existing template check to use the new abstract class. This
makes template checks easier to read and understand.

Refs #42966

PR Close #43232
jessicajaniuk pushed a commit that referenced this pull request Aug 26, 2021
Add a template check that returns diagnostics if the left side of a
nullish coalescing operation is not nullable.

Refs #42966

PR Close #43232
jessicajaniuk pushed a commit that referenced this pull request Aug 26, 2021
…#43232)

Add tests to make sure the nullish coalescing check is generating the
correct diagnostics.

Refs #42966

PR Close #43232
@dgp1130

dgp1130 commented Aug 26, 2021

Copy link
Copy Markdown
Contributor

😄

@angular-automatic-lock-bot

Copy link
Copy Markdown

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 Sep 26, 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 area: compiler Issues related to `ngc`, Angular's template compiler cla: yes compiler: template type-checking target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants