Skip to content

Remove @angular/animations dependency#432

Open
jtotht wants to merge 5 commits into
flauc:masterfrom
jtotht:css-animations
Open

Remove @angular/animations dependency#432
jtotht wants to merge 5 commits into
flauc:masterfrom
jtotht:css-animations

Conversation

@jtotht

@jtotht jtotht commented Jun 27, 2026

Copy link
Copy Markdown

The animations module is deprecated since Angular 20, for removal in Angular 23 (November 2026). The requirement to include the responsible module in consumer applications was confusing anyway. Use native CSS animations instead.

Backward compatibility considerations:

  • Don’t use animate.enter and animate.leave. While they could avoid having to add another setTimeout(), they have only been available since Angular 20.2. That tiny extra code keeps the library compatible with Angular 16, bringing the performance benefits of native CSS animations to also those who are stuck on older Angular versions.
  • Don’t touch the value of Notification.state. While it would be more convenient to make it three-state, excluding the animation type from its value, it’s part of a public interface, and I don’t want to make breaking changes to it.

Also fix a number of build errors in separate commits (please don’t squash commits upon merge).

jtotht added 5 commits June 26, 2026 10:09
Many dependency URLs used to point to
https://jfrog.devstack.vwgroup.com/, which is an internal,
password-protected service for Volkswagen Group employees. Replace the
URLs with https://registry.npmjs.org/ ones, which do not require login.

I used

 sed -i 's~https://jfrog.devstack.vwgroup.com/artifactory/api/npm/npm/~https://registry.npmjs.org/~' package-lock.json

for the replacement. I didn’t manually check the result, but `npm ci`
did succeed afterwards.
To match the version of other Angular packages. Otherwise the demo app
won’t build.
So that `import ... from 'angular2-notifications'` statements work. Also
add Angular `CommonModule` to the module of the demo app, so that
`*ngFor`s in the example component template work. (Alternatively, we
could use the Angular 17+ control flow syntax, but since the library
itself is currently Angular 16+, this may be too early.)

Amend `.gitignore` to ignore the `node_modules/` directory of the
library as well, which is now populated by an `npm i` in the root
directory.
`fade`, `fromTop` and `fromBottom` used to be missing from the dropdown.
Fortunately, TypeScript enums exist at run time, so we can just extract
the values from that, ensuring that any eventual future animation types
automatically appear.
The animations module is deprecated since Angular 20, for removal in
Angular 23 (November 2026). The requirement to include the responsible
module in consumer applications was confusing anyway. Use native CSS
animations instead.

Backward compatibility considerations:

- Don’t use `animate.enter` and `animate.leave`. While they could avoid
  having to add another `setTimeout()`, they have only been available
  since Angular 20.2. That tiny extra code keeps the library compatible
  with Angular 16, bringing the performance benefits of native CSS
  animations to also those who are stuck on older Angular versions.
- Don’t touch the value of `Notification.state`. While it would be more
  convenient to make it three-state, excluding the animation type from
  its value, it’s part of a public interface, and I don’t want to make
  breaking changes to it.
@jtotht jtotht mentioned this pull request Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant