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
Don't delete _i18n in beforeDestroy #880
Merged
kazupon
merged 1 commit into
kazupon:v8.x
from
danimoh:dont-cleanup-_i18n-beforeDestroy
May 15, 2020
Merged
Don't delete _i18n in beforeDestroy #880
kazupon
merged 1 commit into
kazupon:v8.x
from
danimoh:dont-cleanup-_i18n-beforeDestroy
May 15, 2020
Conversation
This file contains 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
Avoid that attempts to call methods on _i18n after destroying a component fail. This is for example relevant for long running async methods that were called before the component got destroyed but terminate after the destruction and then try to call an i18n method. Note that _18n doesn't need to be cleared manually. It gets garbage collected when the destroyed component gets destroyed. Fixes #879
kazupon
approved these changes
May 15, 2020
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.
Thanks!
I hope you have verified that that's true because I could easily see i18n preventing component from being garbage collected. |
danimoh
added a commit
to nimiq/hub
that referenced
this pull request
May 15, 2020
Don't delete _i18n in beforeDestroy (kazupon/vue-i18n#880): Avoid that translations in long-running methods throw on translations after destruction. Allow component interpolation without root element (kazupon/vue-i18n#878): For fixed responsiveness of the mobile checkout cancel button.
danimoh
added a commit
to nimiq/hub
that referenced
this pull request
Jun 15, 2020
Don't delete _i18n in beforeDestroy (kazupon/vue-i18n#880): Avoid that translations in long-running methods throw on translations after destruction. Allow component interpolation without root element (kazupon/vue-i18n#878): For fixed responsiveness of the mobile checkout cancel button.
danimoh
added a commit
to nimiq/hub
that referenced
this pull request
Jun 17, 2020
Don't delete _i18n in beforeDestroy (kazupon/vue-i18n#880): Avoid that translations in long-running methods throw on translations after destruction. Allow component interpolation without root element (kazupon/vue-i18n#878): For fixed responsiveness of the mobile checkout cancel button.
mraveux
pushed a commit
to nimiq/hub
that referenced
this pull request
Jun 22, 2020
Don't delete _i18n in beforeDestroy (kazupon/vue-i18n#880): Avoid that translations in long-running methods throw on translations after destruction. Allow component interpolation without root element (kazupon/vue-i18n#878): For fixed responsiveness of the mobile checkout cancel button.
danimoh
added a commit
to nimiq/hub
that referenced
this pull request
Jul 2, 2020
Don't delete _i18n in beforeDestroy (kazupon/vue-i18n#880): Avoid that translations in long-running methods throw on translations after destruction. Allow component interpolation without root element (kazupon/vue-i18n#878): For fixed responsiveness of the mobile checkout cancel button.
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.
Avoid that attempts to call methods on _i18n after destroying a
component fail. This is for example relevant for long running
async methods that were called before the component got destroyed
but terminate after the destruction and then try to call an i18n
method.
Note that _18n doesn't need to be cleared manually. It gets
garbage collected when the destroyed component gets destroyed.
Fixes #879
Other than mentioned in the issue, no addition of a boolean flag was
necessary, as the
beforeDestroy
hook is not called more than once andthe cleanup is only necessary if
_i18n
exists. Therefore the check for_i18n
still suffices.