Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(material/core): drop dependency on animations module #30459

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Feb 8, 2025

All Material components have been moved away from requiring the @angular/animations module. These changes update the docs and peerDependencies not to require it.

This means that users can remove the BrowserAnimationsModule from their apps, if they weren't using Angular's animations system in their own code or in other dependencies. This has a few advantages:

  1. It removes ~16kb of minified JS from production bundle.
  2. It resolves a bunch of bugs and memory leaks that were caused by the animations. E.g. previously if there was an expansion panel inside a tab, it would be open while the animations are running and then snap into place.
  3. It reduces some runtime overhead for Angular.
  4. It causes fewer change detections.

Notes

This change does not imply that the @angular/animations module is deprecated, it is still supported. We decided to move our library away from it, because it resolved a lot of bugs that our users were seeing and we felt that it wasn't fair to force another dependency upon them.

Furthermore, disabling animations using the NoopAnimationsModule (e.g. for tests) is still supported by Material.

Verified

This commit was signed with the committer’s verified signature.
blink1073 Steven Silvester
All Material components have been moved away from requiring the `@angular/animations` module. These changes update the docs and `peerDependencies` not to require it.

This means that users can remove the BrowserAnimationsModule from their apps, if they weren't using Angular's animations system in their own code or in other dependencies. This has a few advantages:
1. It removes ~16kb of minified JS from production bundle.
2. It resolves a bunch of bugs and memory leaks that were caused by the animations. E.g. previously if there was an expansion panel inside a tab, it would be open while the animations are running and then snap into place.
3. It reduces some runtime overhead for Angular.
4. It causes fewer change detections.

### Notes
This change **does not** imply that the `@angular/animations` module is deprecated, it is **still supported**. We decided to move our library away from it, because it resolved a lot of bugs that our users were seeing and we felt that it wasn't fair to force another dependency upon them.

Furthermore, disabling animations using the `NoopAnimationsModule` (e.g. for tests) is still supported by Material.
@crisbeto crisbeto added the target: minor This PR is targeted for the next minor release label Feb 8, 2025
@crisbeto crisbeto requested a review from andrewseguin February 8, 2025 12:26
@crisbeto crisbeto requested a review from a team as a code owner February 8, 2025 12:26
@crisbeto crisbeto requested review from mmalerba and removed request for a team February 8, 2025 12:26
@angular-robot angular-robot bot added detected: feature PR contains a feature commit area: material/core labels Feb 8, 2025
@crisbeto crisbeto removed the request for review from mmalerba February 10, 2025 20:19
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Feb 10, 2025
@crisbeto crisbeto merged commit 3d91f61 into angular:main Feb 10, 2025
27 checks passed
@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 13, 2025
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: material/core detected: feature PR contains a feature commit target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants