-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
fix(animations): Ensure elements are removed from the cache after leave animation. #50929
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,13 +113,20 @@ describe('TransitionAnimationEngine', () => { | |
registerTrigger(element, engine, trig); | ||
setProperty(element, engine, 'myTrigger', 'value'); | ||
engine.flush(); | ||
expect(engine.statesByElement.has(element)) | ||
.toBe(true, 'Expected element data to be defined.'); | ||
expect(engine.playersByElement.has(element)) | ||
.toBe(true, 'Expected element data to be defined.'); | ||
|
||
expect(engine.elementContainsData(DEFAULT_NAMESPACE_ID, element)).toBeTruthy(); | ||
|
||
engine.destroy(DEFAULT_NAMESPACE_ID, null); | ||
engine.removeNode(DEFAULT_NAMESPACE_ID, element, true); | ||
engine.flush(); | ||
engine.players[0].finish(); | ||
|
||
expect(engine.elementContainsData(DEFAULT_NAMESPACE_ID, element)).toBeTruthy(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test definitely looked broken before, with both these There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great suggestion ! I'll remove it ! |
||
expect(engine.statesByElement.has(element)) | ||
.toBe(false, 'Expected element data to be undefined.'); | ||
expect(engine.playersByElement.has(element)) | ||
.toBe(false, 'Expected element data to be undefined.'); | ||
}); | ||
|
||
it('should create and recreate a namespace for a host element with the same component source', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit unfortunate to me that cleanup logic is (still) spread across two phases, especially now that we've seen that first-phase cleanup can remove needed state too early. Apparently the destroyed namespace is still interacting with this engine, so arguably we should not be cleaning it up until those interactions can no longer occur entirely?
tldr; can all of the
afterFlush
work be pushed into this second phase, or would that result in issues?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like, we're good with moving everything into
afterFlushAnimationsDone
!