Fix pip package in colab with latest closure libraries #2312
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.
Update of TB to new closure rules broke the functioning of the witwidget pip package in colab.
Javascript published to colab when using witwidget (in colab/wit.py) was doing work in the global scope, unnecessarily creating global vars that now collide with other vars, leading to JS failures when loading WIT. This javascript should never have used the global scope. This fix moves the work into an anonymous function so as to avoid polluting the global scope.
N/A
Pip install local version with this change and verify that witwidget works again in colab.
Also test locally in Jupyter to ensure it still works there.