-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[BUGFIX beta] Cleanup view teardown. #13775
Conversation
@@ -192,7 +192,9 @@ class Renderer { | |||
_renderResult.destroy(); | |||
} | |||
|
|||
view.destroy(); | |||
if (!view.isDestroying) { |
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.
should we guard against both isDestroying
and isDestroyed
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.
we don't unset isDestroying when we set isDestroyed but I can add that
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.
ah, then its not needed. Seems good
44e7ecd
to
08aaac7
Compare
OK, I added regression tests for the various scenarios that were tweaked here (including the specific issues linked in the description). |
@rwjblue thank you so much for doing these tests. |
* [Glimmer] Ensure `.parentView` is present at creation. * Add tests for `.parentView` and `.element` in each lifecycle hook. * Remove duplicated `parentView` manipulation (this is now done as part of `renderer.remove`). * Add test ensuring `willDestroyElement` is called for inverse. * Ensure element in DOM during willDestroyElement.
4026ff2
to
9228bb8
Compare
.parentView
is available in all hooks..element
is available in appropriate hooks.willDestroyElement
is called for components invoked from the{{else}}
hook of an{{#each
willDestroyElement not firing in {{each}} else #12716.this.parentView
is available inwillDestroyElement
parentView undefined during willDestroyElement #12080.willDestroyElement
is called before actual destruction for components rendered with{{component
helper.This should fix #12080 #12716 and #13028