fix(core): animation sometimes renderer not being destroyed during HMR#59574
Closed
crisbeto wants to merge 1 commit intoangular:mainfrom
Closed
fix(core): animation sometimes renderer not being destroyed during HMR#59574crisbeto wants to merge 1 commit intoangular:mainfrom
crisbeto wants to merge 1 commit intoangular:mainfrom
Conversation
These changes aim to resolve the issue that prompted angular#59514. The animations module is a bit tricky for HMR, because it schedules the destruction of its renderer after the currently-running animations are done. If there are no running animations, the renderer gets destroyed next time around. This is a problem, because it means that the styles can stay around for a long time. These changes resolve the issue by: 1. Moving the cleanup of the renderer to after the destruction of the old view. This ensures that the usual clean up flow has been kicked off. 2. Flushing the animations when a component is replaced to ensure that the renderer is cleaned up in a timely manner.
AndrewKushnir
approved these changes
Jan 16, 2025
Contributor
AndrewKushnir
left a comment
There was a problem hiding this comment.
The change looks great 👍 If we can also add a test to capture this behavior to prevent regressions in the future - that'd be awesome.
Contributor
|
This PR was merged into the repository by commit b76be83. The changes were merged into the following branches: main, 19.1.x |
AndrewKushnir
pushed a commit
that referenced
this pull request
Jan 16, 2025
#59574) These changes aim to resolve the issue that prompted #59514. The animations module is a bit tricky for HMR, because it schedules the destruction of its renderer after the currently-running animations are done. If there are no running animations, the renderer gets destroyed next time around. This is a problem, because it means that the styles can stay around for a long time. These changes resolve the issue by: 1. Moving the cleanup of the renderer to after the destruction of the old view. This ensures that the usual clean up flow has been kicked off. 2. Flushing the animations when a component is replaced to ensure that the renderer is cleaned up in a timely manner. PR Close #59574
PrajaktaB27
pushed a commit
to PrajaktaB27/angular
that referenced
this pull request
Feb 7, 2025
angular#59574) These changes aim to resolve the issue that prompted angular#59514. The animations module is a bit tricky for HMR, because it schedules the destruction of its renderer after the currently-running animations are done. If there are no running animations, the renderer gets destroyed next time around. This is a problem, because it means that the styles can stay around for a long time. These changes resolve the issue by: 1. Moving the cleanup of the renderer to after the destruction of the old view. This ensures that the usual clean up flow has been kicked off. 2. Flushing the animations when a component is replaced to ensure that the renderer is cleaned up in a timely manner. PR Close angular#59574
|
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. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
These changes aim to resolve the issue that prompted #59514. The animations module is a bit tricky for HMR, because it schedules the destruction of its renderer after the currently-running animations are done. If there are no running animations, the renderer gets destroyed next time around. This is a problem, because it means that the styles can stay around for a long time.
These changes resolve the issue by: