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(common): make the error messages tree shakable #44663

Closed
wants to merge 1 commit into from
Closed

refactor(common): make the error messages tree shakable #44663

wants to merge 1 commit into from

Conversation

ramthir
Copy link
Contributor

@ramthir ramthir commented Jan 8, 2022

Make Long error messages tree-shakable in the production build with error codes.

fixes #40096

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?

Invalid argument errors in the pipes are not tree-shakable in the production build.

Issue Number: 40096

What is the new behavior?

Make the invalid argument errors in the pipes tree-shakable in the production build.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@pullapprove pullapprove bot requested a review from dylhunn January 8, 2022 09:23
@AndrewKushnir AndrewKushnir self-requested a review January 10, 2022 05:29
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

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

@ramthir thanks for creating this PR 👍 Just left a couple comments.

packages/common/src/pipes/case_conversion_pipes.ts Outdated Show resolved Hide resolved
packages/common/src/pipes/case_conversion_pipes.ts Outdated Show resolved Hide resolved
@AndrewKushnir AndrewKushnir removed the request for review from dylhunn January 10, 2022 05:41
@AndrewKushnir AndrewKushnir added action: review The PR is still awaiting reviews from at least one requested reviewer area: common Issues related to APIs in the @angular/common package hotlist: error messages target: patch This PR is targeted for the next patch release labels Jan 10, 2022
@ngbot ngbot bot modified the milestone: Backlog Jan 10, 2022
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

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

@ramthir thanks for additional updates, please see a couple comments below.

packages/common/src/pipes/invalid_pipe_argument_error.ts Outdated Show resolved Hide resolved
packages/common/src/errors.ts Outdated Show resolved Hide resolved
packages/common/src/pipes/invalid_pipe_argument_error.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

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

@ramthir the changes look good, thanks 👍

It looks like there are few places in tests that require some updates (see CI job output here) due to an error code being present in the error message. Could you please take a look when you get a chance?

Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

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

@ramthir thanks for additional updates, the changes look good 👍

Note: this PR would require a rebase once PR #44677 lands. PR #44677 adds golden files for error message codes (for extra protection from accidental changes) and one of the golden files would require an update to include a new error code. I will let you know once PR #44677 lands.

Thank you.

@AndrewKushnir AndrewKushnir added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews action: review The PR is still awaiting reviews from at least one requested reviewer and removed action: review The PR is still awaiting reviews from at least one requested reviewer action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Jan 11, 2022
@AndrewKushnir
Copy link
Contributor

@ramthir thanks for rebasing this PR. Could you please also run the following command (as suggested by the CI output):

yarn bazel run //packages/common:common_errors.accept

and include the changes into the commit? That should make the CI "green".

Thank you.

Make Long error messages tree-shakable in the production build with error codes.

fixes #40096
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

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

@ramthir thanks for applying additional changes! 👍

Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

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

Reviewed-for: public-api

@AndrewKushnir
Copy link
Contributor

Presubmit.

@AndrewKushnir AndrewKushnir added action: presubmit The PR is in need of a google3 presubmit and removed action: presubmit The PR is in need of a google3 presubmit labels Jan 14, 2022
Copy link
Contributor

@atscott atscott left a comment

Choose a reason for hiding this comment

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

reviewed-for: public-api

@pullapprove pullapprove bot requested a review from dylhunn January 18, 2022 17:39
Copy link
Contributor

@dylhunn dylhunn left a comment

Choose a reason for hiding this comment

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

reviewed-for: public-api

@AndrewKushnir AndrewKushnir added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jan 18, 2022
@dylhunn
Copy link
Contributor

dylhunn commented Jan 18, 2022

This PR was merged into the repository by commit 4307b82.

dylhunn pushed a commit that referenced this pull request Jan 18, 2022
Make Long error messages tree-shakable in the production build with error codes.

fixes #40096

PR Close #44663
@dylhunn dylhunn closed this in 4307b82 Jan 18, 2022
@ramthir ramthir deleted the pipe-invalid-argument-tree-shaking branch January 19, 2022 04:34
@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 Feb 19, 2022
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: common Issues related to APIs in the @angular/common package cross-cutting: tree-shaking hotlist: error messages target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use ngDevMode to tree shake error messages in pipes
4 participants