Skip to content

Animations: consider dropping CssKeyframesDriver in favor of WebAnimationsDriver #44520

@AndrewKushnir

Description

@AndrewKushnir

Which @angular/* package(s) are relevant/releated to the feature request?

animations

Description

Currently we have 2 implementations of the animations driver:

  • CssKeyframesDriver
  • WebAnimationsDriver

We select which one to use in this code based on the presence of the animate function in an element's prototype (see here). Since IE is no longer supported, the animate function should be available in all supported browsers, so it looks like we can drop the CssKeyframesDriver in favor of WebAnimationsDriver.

The biggest benefit that we'd have is less code in app bundles, the way those classes are referenced is non-tree-shakable (see here): both classes would be retained in an app bundle when the BrowserAnimationsModule is used. That'd probably save a few KB.

If we decide to do that, it'd be great to implement and land the tooling to measure the bundle size and retained symbols first, see #44437. In this case we'd be able to measure the impact of this change.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions