Skip to content

feat(animations): provide warnings for non-animatable CSS properties - #45212

Closed
dario-piotrowicz wants to merge 11 commits into
angular:masterfrom
dario-piotrowicz:warn-for-non-animatable-props
Closed

dario-piotrowicz wants to merge 11 commits into
angular:masterfrom
dario-piotrowicz:warn-for-non-animatable-props

Conversation

@dario-piotrowicz

@dario-piotrowicz dario-piotrowicz commented Feb 27, 2022 •

Copy link
Copy Markdown
Contributor

warn developers when they are trying to animate non-animatable CSS
properties so that can more easily understand why something is not being
animated as they would expect it to

resolves #27577

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:

Issue

Issue Number: #27577

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

  • @jessicajaniuk 🙂
  • I believe this is a proper solution for issue Can't set display during animation #27577, but that's just my opinion, please check the issue out and let me know what you think 🙂
  • I could have included this functionality in the unsupported properties warnings, I just wanted to keep them separate to provide better information for the developer (as in, having different warnings for when they provide wrong CSS properties and for when they provide valid CSS properties which cannot be animated), I can of course change that if you believe it's not the right solution

@pullapprove
pullapprove Bot requested review from dylhunn and jelbourn February 27, 2022 18:02
@dario-piotrowicz
dario-piotrowicz force-pushed the warn-for-non-animatable-props branch from 041ef5c to f646f41 Compare February 27, 2022 18:19
@jessicajaniuk jessicajaniuk added the area: animations legacy animations package only. Otherwise use area: core. label Feb 28, 2022
@ngbot ngbot Bot added this to the Backlog milestone Feb 28, 2022
@jessicajaniuk
jessicajaniuk self-requested a review February 28, 2022 17:23
@dario-piotrowicz
dario-piotrowicz force-pushed the warn-for-non-animatable-props branch from f646f41 to 2376a29 Compare February 28, 2022 20:35

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.

We should consider (in a followup) whether we should make the validateStyleProperty a dev-mode-only check as well. Otherwise, there is an inconsistency between validateStyleProperty (which works in both prod and dev modes) and validateAnimatableStyleProperty (that actually works only in dev mode). I think dropping the validateStyleProperty in prod mode makes sense and would help remove some payload size (+ add some extra runtime perf benefits, since we'd need to execute less logic).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes sounds like a good idea 🙂👍

(I'd be happy to take that on! 😁)

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.

Cool, thanks @dario-piotrowicz 👍 That'd be a change in behavior that we should be able to land in the next major (v14).

@dario-piotrowicz
dario-piotrowicz force-pushed the warn-for-non-animatable-props branch from 2376a29 to 7d8053b Compare March 3, 2022 20:06
Comment thread goldens/size-tracking/aio-payloads.json Resolved
@dario-piotrowicz
dario-piotrowicz force-pushed the warn-for-non-animatable-props branch from fb4aac9 to bd04a93 Compare March 6, 2022 21:07
@jessicajaniuk jessicajaniuk added the target: major This PR is targeted for the next major release label Mar 9, 2022

@jessicajaniuk jessicajaniuk 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 🍪

Thanks for your work on this, Dario!

reviewed-for: public-api, fw-animations, fw-testing, size-tracking

@pullapprove
pullapprove Bot requested a review from jessicajaniuk March 9, 2022 18:02
@jessicajaniuk
jessicajaniuk removed their request for review March 9, 2022 18:03
@pullapprove
pullapprove Bot requested a review from atscott March 9, 2022 18:04

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

LGTM with a couple nits

reviewed-for: public-api, size-tracking

@pullapprove
pullapprove Bot requested a review from alxhub March 9, 2022 20:14
@dario-piotrowicz
dario-piotrowicz force-pushed the warn-for-non-animatable-props branch from 9ddaf66 to 2a14282 Compare March 9, 2022 21:26

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

@pullapprove
pullapprove Bot requested a review from jessicajaniuk March 9, 2022 21:33
@dario-piotrowicz
dario-piotrowicz force-pushed the warn-for-non-animatable-props branch from a33a36d to 2a14282 Compare March 9, 2022 21:45

@AndrewKushnir AndrewKushnir 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.

@dario-piotrowicz looks great, just left one comment to see if we can improve the error message. Thank you.

@pullapprove
pullapprove Bot requested a review from dylhunn March 10, 2022 00:14
warn developers when they are trying to animate non-animatable CSS
properties so that can more easily understand why something is not being
animated as they would expect it to

resolves angular#27577
@AndrewKushnir AndrewKushnir added the action: presubmit The PR is in need of a google3 presubmit label Mar 15, 2022
@AndrewKushnir

Copy link
Copy Markdown
Contributor

Presubmit.

@AndrewKushnir AndrewKushnir 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, size-tracking

@AndrewKushnir AndrewKushnir added action: merge The PR is ready for merge by the caretaker merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note and removed action: presubmit The PR is in need of a google3 presubmit labels Mar 18, 2022
@AndrewKushnir

Copy link
Copy Markdown
Contributor

Merge-assistance: I can't remove extra reviewers from the list, but the PR is approved and ready for merge.

@jessicajaniuk jessicajaniuk removed the merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note label Mar 18, 2022
@jessicajaniuk

Copy link
Copy Markdown
Contributor

@AndrewKushnir I was able to remove them. So I removed the merge-assistance label. Not sure why it let me and not you.

@alxhub

alxhub commented Mar 21, 2022

Copy link
Copy Markdown
Member

This PR was merged into the repository by commit 79d334b.

@alxhub alxhub closed this in 79d334b Mar 21, 2022
@dario-piotrowicz
dario-piotrowicz deleted the warn-for-non-animatable-props branch March 21, 2022 22:19
josmar-crwdstffng pushed a commit to josmar-crwdstffng/angular that referenced this pull request Apr 8, 2022
…ngular#45212)

warn developers when they are trying to animate non-animatable CSS
properties so that can more easily understand why something is not being
animated as they would expect it to

resolves angular#27577

PR Close angular#45212
dario-piotrowicz added a commit to dario-piotrowicz/angular that referenced this pull request Apr 9, 2022
make the validateStyleProperty check dev-mode only so that it is
consistent with the validateAnimatableStyleProperty check introduced in
PR angular#45212

besides consistency this change also reduces the payload size and
increases performance (since less logic is executed)

original conversation: angular#45212 (comment)
dario-piotrowicz added a commit to dario-piotrowicz/angular that referenced this pull request Apr 9, 2022
…idation

in the `validateAnimatableStyleProperty` function use the more complete
check for the ngDevMode as it seems to be the preferred version
(see: angular#45212 (comment))
jessicajaniuk pushed a commit that referenced this pull request Apr 11, 2022
)

make the validateStyleProperty check dev-mode only so that it is
consistent with the validateAnimatableStyleProperty check introduced in
PR #45212

besides consistency this change also reduces the payload size and
increases performance (since less logic is executed)

original conversation: #45212 (comment)

PR Close #45570
jessicajaniuk pushed a commit that referenced this pull request Apr 11, 2022
…idation (#45570)

in the `validateAnimatableStyleProperty` function use the more complete
check for the ngDevMode as it seems to be the preferred version
(see: #45212 (comment))

PR Close #45570
@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 Apr 21, 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: animations legacy animations package only. Otherwise use area: core. target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't set display during animation

6 participants