Repository navigation
refactor(animations): refactor non-animatable check to be timeline based - #46666
dario-piotrowicz wants to merge 6 commits into
Conversation
a663ec9 to
0a93a5e
Compare
There was a problem hiding this comment.
I like this solution to the problem. I have a couple of non-blocking questions / comments, but I'm otherwise ok with this. Thanks, @dario-piotrowicz!
reviewed-for: fw-animations, fw-core
There was a problem hiding this comment.
@dario-piotrowicz FYI I've left a couple comments as well.
From PR description:
before the warning was being applied only when the animation's data
was being parsed, so it happed only once but now since it is applied
when the animation is actually being prepared to be played, it happens
each time the animation runs
If the number of warnings becomes a problem, we can update the logic (in a followup PR) to keep track of the warnings that we've already produced, similar to what we do for Forms here:
https://github.com/angular/angular/blob/main/packages/forms/src/directives/shared.ts#L372
Yes!!! I was thinking the exact same thing as I was coding the solution! 🙂 The biggest issue I think is we'd warn every possible issue once (for example, trigger myAnimation can have an initial/:enter transition which tries to animate So yeah I would totally give it a shot but I'd imagine only if need be as it would add some overhead and complexity I think 🙂 (Unless you were thinking of a different sort of implementation?) |
AndrewKushnir
left a comment
There was a problem hiding this comment.
@dario-piotrowicz looks good, just left some minor comments.
move the check for non-animatable properties from the animation building phase to the application of the animation's transition instead, in such a way we can check it against the keyframes of the transition's timeline in order to only provide warnings for properties which are being animated, thus not providing any warning for non-animatable properties being applied to elements via the style function this change has the benfit just mentioned above but it comes with two drawbacks: - the warning handling is not done in the building time so it is a bit inconsistent with other type of validations (such as the unsupported css properties one for example) - before the warning was being applied only when the animation's data was being parsed, so it happed only once but now since it is applied when the animation is actually being prepared to be played, it happens each time the animation runs resolves angular#46602
…line based remove explanatory variables
…line based use has instead of get
…line based improve check logic
14d7054 to
2c231a5
Compare
…line based remove unused pushNonAnimatablePropertiesWarning
|
This PR was merged into the repository by commit a4ec109. |
…sed (#46666) move the check for non-animatable properties from the animation building phase to the application of the animation's transition instead, in such a way we can check it against the keyframes of the transition's timeline in order to only provide warnings for properties which are being animated, thus not providing any warning for non-animatable properties being applied to elements via the style function this change has the benfit just mentioned above but it comes with two drawbacks: - the warning handling is not done in the building time so it is a bit inconsistent with other type of validations (such as the unsupported css properties one for example) - before the warning was being applied only when the animation's data was being parsed, so it happed only once but now since it is applied when the animation is actually being prepared to be played, it happens each time the animation runs resolves #46602 PR Close #46666
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
move the check for non-animatable properties from the animation building
phase to the application of the animation's transition instead, in such
a way we can check it against the keyframes of the transition's timeline
in order to only provide warnings for properties which are being
animated, thus not providing any warning for non-animatable properties
being applied to elements via the style function
this change has the benfit just mentioned above but it comes with two
drawbacks:
inconsistent with other type of validations (such as the unsupported css
properties one for example)
was being parsed, so it happed only once but now since it is applied
when the animation is actually being prepared to be played, it happens
each time the animation runs
resolves #46602
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #46602
Using the
stylefunction on non-animatable properties produces a warning in the console, even thought those properties are only being applied to the elements but not animatedFor example:

What is the new behavior?
The warning is presented only if the animation tries to animate the non-animatable properties
For example:

Does this PR introduce a breaking change?
Other information