Skip to content

perf(animations): made errors in the animations package tree shakeable#45004

Closed
jessicajaniuk wants to merge 1 commit intoangular:masterfrom
jessicajaniuk:error-tree-shake
Closed

perf(animations): made errors in the animations package tree shakeable#45004
jessicajaniuk wants to merge 1 commit intoangular:masterfrom
jessicajaniuk:error-tree-shake

Conversation

@jessicajaniuk
Copy link
Contributor

This moves all the error strings into exported functions that can be tree shaken away.

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?

Errors in the animations code base are just defined all inline and affect bundle size.

Issue Number: N/A

What is the new behavior?

Errors are centralized in one file and should be tree shakeable.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@ngbot ngbot bot added this to the Backlog milestone Feb 8, 2022
@jessicajaniuk jessicajaniuk force-pushed the error-tree-shake branch 5 times, most recently from d497cfc to 4ccac76 Compare February 8, 2022 01:50
@jessicajaniuk jessicajaniuk force-pushed the error-tree-shake branch 4 times, most recently from ae1e194 to 56faf8a Compare February 8, 2022 19:29
@jessicajaniuk jessicajaniuk added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Feb 8, 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.

LGTM, just some minor comments.

I think we'd need to add golden files for the error codes as well, see #44677, so that they are a part of the public API.

Copy link
Contributor

Choose a reason for hiding this comment

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

🎉

@pullapprove pullapprove bot requested a review from alxhub February 8, 2022 20:37
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: size-tracking

@pullapprove pullapprove bot requested a review from AndrewKushnir February 8, 2022 21:38
@jessicajaniuk jessicajaniuk force-pushed the error-tree-shake branch 3 times, most recently from ff21856 to d34b088 Compare February 8, 2022 22:32
Copy link
Member

Choose a reason for hiding this comment

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

Is there value in tracking these signatures from a public API perspective?

In other "error" API tests that we have, we only really care about the error codes, not the helper functions that create those errors.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I could move the helper functions and only have the codes exposed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are now moved.

This moves all the error strings into exported functions that can be tree shaken away.
Copy link
Member

@alxhub alxhub 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

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

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

@pullapprove pullapprove bot requested review from AndrewKushnir and alxhub February 9, 2022 01:32
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: size-tracking

@jessicajaniuk jessicajaniuk added action: merge The PR is ready for merge by the caretaker 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 labels Feb 9, 2022
@alxhub alxhub added target: minor This PR is targeted for the next minor release and removed target: patch This PR is targeted for the next patch release labels Feb 9, 2022
@alxhub
Copy link
Member

alxhub commented Feb 9, 2022

This PR doesn't apply cleanly to 13.2.x. Marking it as master-only - please open a separate PR against the patch branch if desired.

@alxhub
Copy link
Member

alxhub commented Feb 9, 2022

This PR was merged into the repository by commit 4c778cd.

@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 Mar 12, 2022
josmar-crwdstffng pushed a commit to josmar-crwdstffng/angular that referenced this pull request Apr 8, 2022
angular#45004)

This moves all the error strings into exported functions that can be tree shaken away.

PR Close angular#45004
@jessicajaniuk jessicajaniuk deleted the error-tree-shake branch January 27, 2023 16:41
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: animations target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants