Skip to content
This repository was archived by the owner on Oct 26, 2019. It is now read-only.

Support new requirejs path for declarativewidgets 0.5.0 #193

Closed
parente opened this issue Apr 19, 2016 · 4 comments
Closed

Support new requirejs path for declarativewidgets 0.5.0 #193

parente opened this issue Apr 19, 2016 · 4 comments
Assignees
Labels
Milestone

Comments

@parente
Copy link
Member

parente commented Apr 19, 2016

See jupyter/declarativewidgets#313.

@parente parente added the bug label Apr 19, 2016
@parente parente added this to the 0.5.0 milestone Apr 19, 2016
@parente
Copy link
Member Author

parente commented Apr 20, 2016

Should be able to just add the path. Can probably even leave the old one in there if desired for compat with older versions. But I think master/0.5 of dashboard_server is compatible with 0.5.0 of declarative widgets and up only already: dashboard.js invokes the widget system init function using the new API, not the one from 0.4.x.

#194 covers moving to ipywidgets 5.0.

@parente
Copy link
Member Author

parente commented Apr 26, 2016

We still need to get this one done for 0.5. I moved the other issues to 0.6 to separate them out.

@parente
Copy link
Member Author

parente commented Apr 28, 2016

This seems to be the right stuff, though the map is a bit superfluous.

        // setup module paths used by plugins
        window.require.config({
            map: {
                '*': {
                    'nbextensions/widgets/widgets/js/widget': 'jupyter-js-widgets',
                    'jupyter-decl-widgets': 'urth_widgets/js/widgets'
                }
            }
        });

        window.define('jupyter-js-widgets', function() {
            return Widgets;
        });

@lbustelo: After adding this, hit a new incompatibility introduced by jupyter/declarativewidgets#322

if(!model.comm.kernel.comm_manager.comms[model.comm.comm_id]){
    this._handleCommDisconnect();
    return;
}

In dashboard server, model.comm does not have a kernel so it throws an exception and nothing loads. That model and comm are setup by the widgets services-shim.js which is what bridges jupyter-js-services into the notebook-like structure.

@jhpedemonte not sure if we can shim.

@parente
Copy link
Member Author

parente commented Apr 28, 2016

Removing this fixes everything:

if(!model.comm.kernel.comm_manager.comms[model.comm.comm_id]){
  this._handleCommDisconnect();
  return;
}

@lbustelo since this is a hack to protect against a timing bug in ipywidgets, would it be possible to guard it with if(model.comm.kernel && (!model.comm.kernel.comm_manager.comms[model.comm.comm_id])).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants