Update vega packages, and do proper view finalization#1233
Merged
tconkling merged 3 commits intostreamlit:developfrom Mar 23, 2020
Merged
Update vega packages, and do proper view finalization#1233tconkling merged 3 commits intostreamlit:developfrom
tconkling merged 3 commits intostreamlit:developfrom
Conversation
Contributor
|
Looks good to me. |
Contributor
Author
Thanks Dominik! |
* develop: Bump acorn from 5.7.3 to 5.7.4 in /frontend (streamlit#1220)
jrhone
approved these changes
Mar 23, 2020
arraydude
approved these changes
Mar 23, 2020
jrhone
reviewed
Mar 23, 2020
| */ | ||
| private finalizeView = (): any => { | ||
| if (this.vegaFinalizer) { | ||
| this.vegaFinalizer() |
Contributor
There was a problem hiding this comment.
should we also call this.vegaView.finalize() here?
Contributor
Author
There was a problem hiding this comment.
No, the finalizer function calls vegaView.finalize
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.
This should fix #755, but I'd love to get @domoritz's opinion if he's available.
I'm looking at this issue now because there have been some reports of long-running Streamlit apps blowing up browser memory:
In @domoritz's original bug, he suggested that we were using
view.finalize()incorrectly, though in the version ofvega-embedwe were previously on, there was no separatefinalizereturned fromembed. Regardless, I've updated vega, vega-lite, and vega-embed to their latest, and we're now using that finalizer.This PR also performs finalization at
componentWillUnmounttime, which is consistent with whatreact-vegadoes: https://github.com/vega/react-vega/blob/778596cb9209d9ee48c43ceac699fcd4ca5ac30a/packages/react-vega/src/VegaEmbed.tsx#L89