-
Notifications
You must be signed in to change notification settings - Fork 38
Refactor out reference to IPython.* reference away from behaviors and replace them with Urth.* #141
Comments
Here's the code we currently use on dashboards server to shim declwidgets: https://github.com/jupyter-incubator/dashboards_server/blob/c7909c79ae21930334d78a39dac21d71b192fa52/public/js/widget-manager.js#L177-L208. There are two sections: the first is only called once, on initialization; the latter is called per cell, on execution of code. The first section ( The second sections ( To start off with, I think the declwidgets init code could do a simple check to see if it's running in the notebook or not: if (!window.IPython || !window.IPython.notebook) {
// not in Notebook, setup shims
}
My branch with declwidgets changes is here: master...jhpedemonte:StandaloneExperiment and contains some necessary changes to work with latest code (hopefully also backwards compatible):
cc @deedubbu @parente |
Should allow us to use init.js/DeclWidgetModel.js outside of Notebook env. Ref jupyter#141 Ref jupyter#196 (c) Copyright IBM Corp. 2016
Ref jupyter#141 (c) Copyright IBM Corp. 2016
Ref jupyter#141 Ref jupyter#196 (c) Copyright IBM Corp. 2016
Ref jupyter#141 (c) Copyright IBM Corp. 2016
... and move into init(). Fix issue with widget manager instance reference. Ref jupyter#141 (c) Copyright IBM Corp. 2016
Should allow us to use init.js/DeclWidgetModel.js outside of Notebook env. Ref jupyter#141 Ref jupyter#196 (c) Copyright IBM Corp. 2016
Ref jupyter#141 (c) Copyright IBM Corp. 2016
Ref jupyter#141 Ref jupyter#196 (c) Copyright IBM Corp. 2016
Ref jupyter#141 (c) Copyright IBM Corp. 2016
... and move into init(). Fix issue with widget manager instance reference. Ref jupyter#141 (c) Copyright IBM Corp. 2016
Ref jupyter#141 (c) Copyright IBM Corp. 2016
Helps with case where kernel is restarted and a new kernel instance used. Ref jupyter#141 Ref jupyter#196 (c) Copyright IBM Corp. 2016
Change other 'IPython' references to 'Jupyter' Ref jupyter#141 (c) Copyright IBM Corp. 2016
Should allow us to use init.js/DeclWidgetModel.js outside of Notebook env. Fix `IPython` object references. Newer `new_widget` API takes 3rd param. `init()` should be backwards compat with older API. Use getter for kernel instance -- helps with case where kernel is restarted and a new kernel instance used. Fix tests which weren't properly testing server state. Ref jupyter#141 Ref jupyter#196 (c) Copyright IBM Corp. 2016
I think so. |
In various behaviors we got references to
IPython
global. Due to potential inconsistencies based on the environment that the notebook code is running (i.e. dashboards), we need a more reliable (injectable) way to set these dependencies.I suggest that we isolate that into our
nb-extension/js/init/init.js
and allow it to be injected by the app code.Most of the code that reference
IPython
should be underelements/urth-core-behaviors
The text was updated successfully, but these errors were encountered: