Remove animation package#6812
Open
DerekLiang wants to merge 10 commits into
Open
Conversation
* 20.0.2 * Upgrade angular 21 (valor-software#6788) * chore: upgrade package * chore(ngx-bootstrap-docs): updates Angular to v21 * refactor: migrate common-docs HTML templates to Angular control flow * chore: update common-docs TypeScript configuration * fix: add type guard for event target in ExamplesComponent * chore(tsconfig): update compiler options for new build setup * refactor(accordion): migrate HTML templates to new control flow syntax * refactor(alerts): migrate HTML templates to new control flow syntax * refactor(buttons): migrate HTML templates to new control flow syntax * refactor(carousel): migrate HTML templates to new control flow syntax * refactor(datepicker): migrate HTML templates to new control flow syntax * refactor: update Angular template control flow syntax to `@for` and `@if` * chore(tsconfig): update TypeScript configuration for modern Angular * build: update root tsconfig for doc pages to support new module resolution * build: standardize and update tsconfig.lib.json for doc pages libraries * build: standardize and update tsconfig.spec.json for doc pages tests * refactor: migrate doc page templates to Angular control flow syntax * refactor(build): update TypeScript and Jest configurations * refactor(buttons): widen HostListener event types to generic Event * chore: migrate templates to built-in control flow * refactor: remove redundant @angular/common imports * chore: migrate component templates to new Angular control flow syntax * chore: modernize TypeScript and Jest configurations across libraries * test: update jest-preset-angular serializer paths * test: standardize Jest Zone.js test environment setup * refactor(jest): update configuration for Nx and jest-preset-angular * test(typeahead): update Jest 'toThrowError' to 'toThrow' matcher * fix(typeahead): correct test file formatting and syntax * chore: update package-lock.json dependencies and properties * refactor: standardize TypeScript and Jest configurations across libraries * refactor: improve event handling type safety and robustness * chore: migrate Angular templates to new control flow syntax * test(carousel): add CommonModule to carousel test component * chore: bump version to 21.0.0 * chore(release): bump project version to 21.0.0 * fix(typeahead): prevents potential null reference * fix(dependencies): fixed package.lock * fix(dependencies): fixed app.component * Update package.json * Update package-lock.json --------- Co-authored-by: Amine CHERGUI <chergui.amine@gmail.com>
…ropdown and collapse components - Removed Angular animation imports and definitions from collapse and dropdown components. - Implemented CSS transitions for collapse and dropdown animations using `requestAnimationFrame` and `setTimeout` for fallback handling. - Updated tests to remove dependencies on `BrowserAnimationsModule`. - Refactored datepicker and typeahead components to use similar CSS transition logic. - Improved performance and reduced complexity by eliminating the need for Angular's animation builder.
…smoother transitions
…cessary requestAnimationFrame calls
Contributor
Author
|
@lexasq could you please provide feedback again. rAF is removed as much as possible. thx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@angular/animationsis deprecated.@angular/animations(andBrowserAnimationsModule) as a peer dependency entirely, eliminating the requirement to provideBrowserAnimationsModulein zoneless Angular applicationscollapse,dropdown,datepicker, andtypeaheadwith native CSSheighttransitions driven byrequestAnimationFrame+transitionend— the same pattern Angular's own migration guide recommendstransitionendhandlers guard against bubbled child events (e.target+e.propertyNamechecks) and are properly cleaned up inngOnDestroyBrowserAnimationsModuleonng addMotivation
@angular/animationsis deprecated as of Angular v20.2 and is incompatible with zoneless change detection — components usingAnimationBuildertrigger zone re-entry via internalsetTimeout/requestAnimationFramecalls, breaking zoneless apps. This was reported in issues #6784 and #6808.What changed (high level)
All Angular @angular/animations usage (AnimationBuilder, AnimationFactory, AnimationPlayer, trigger, state, transition, animate) has been removed. Every component now drives animation via the browser's native
CSS transition engine, set imperatively with Renderer2.
Component-by-component
CSS transition on height.
checkpoint across all browsers.
CSS transition on height. No rAF.
from there.
CSS transition on max-height. No rAF.
Angular animations removed from the animations metadata array — these components did not have a custom expand/collapse animation to replace, so no CSS transition logic was added.
rAF usage status
offsetHeightreflow is sufficientoffsetHeightreflow is sufficientrAF is not driving any animation — in all cases the CSS transition engine owns the interpolation. rAF is purely a scheduling tool to ensure the browser has committed a concrete "before" paint state before the
target value is written.