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

Load declwidgets init code from bundled dashboard #133

Closed
2 tasks done
parente opened this issue Mar 4, 2016 · 5 comments
Closed
2 tasks done

Load declwidgets init code from bundled dashboard #133

parente opened this issue Mar 4, 2016 · 5 comments
Assignees
Milestone

Comments

@parente
Copy link
Member

parente commented Mar 4, 2016

Load all declwidgets resources from the bundle. See the first comment below for more information.

Tasks:

  • Load init.js and DeclWidgetsModel.js from bundle.
  • Don't build urth-widgets.js any more. Remove cloning of declwidgets repo.

Previous description:

In our Dockerfile.server we're currently relying on https://github.com/jhpedemonte/declarativewidgets.git@9f6423bbcc4e9e266a8c2594028caeabaebe9a8f in lieu of jupyter/declarativewidgets#196 getting fixed. This suggests to me that no deploys from a stable declarative widgets release should work. But they did/do when I test with make dev-with-dashboard-server in dashboards_bundlers.

However, when I use a simple docker-compose recipe that installs all stable versions of the jupyter Python packages, sure enough, the errors that @jhpedemonte 's branch is meant to fix shine through.

I'm missing something ...

At any rate, we need to first understand what's going on and then, over time, drive the decl widget changes to ensure they work both in the notebook and outside.

@jhpedemonte
Copy link
Collaborator

Paired with @parente and found out that some examples work fine with the non-shimmed declwidgets, while still showing many errors in the console.

But this led us to notice that we are pulling declwidgets resources from 2 areas: (1) the Polymer elements in urth_components are bundled with the notebook; (2) the initialization code (init.js and DeclWidgetsModel.js) are provided directly from the server. This is a problem because there may be slight mismatch in versions of the two.

Instead, the server should load the init code scripts from the bundle as well. It turns out that the bundler already provides these, in the urth_widgets directory (sibling of urth_components).

Re-purposing this issue to track the correct loading of declwidgets resources.

@jhpedemonte jhpedemonte changed the title Not sure how bundler make dev-with-dashboard-server works Load declwidgets init code from bundled dashboard Mar 4, 2016
@jhpedemonte jhpedemonte self-assigned this Mar 4, 2016
@jhpedemonte jhpedemonte added this to the 0.4.0 milestone Mar 4, 2016
jhpedemonte added a commit to jhpedemonte/dashboards_server that referenced this issue Mar 7, 2016
Redo our bundled dashboards examples

Ref jupyter#133

(c) Copyright IBM Corp. 2016
@jhpedemonte
Copy link
Collaborator

Uploaded PR which makes it so we load the DeclWidgets init scripts from the bundle, rather than supplying our own. Of course, this horribly breaks the use of declwidgets, since that code base needs to be updated as well.

@parente
Copy link
Member Author

parente commented Mar 8, 2016

Did you mean to open a PR?

jhpedemonte added a commit to jhpedemonte/dashboards_server that referenced this issue Mar 9, 2016
Move main Notebook shim function to dashboards.js

Ref jupyter#133

(c) Copyright IBM Corp. 2016
@jhpedemonte
Copy link
Collaborator

Updated to use newer DeclWidgets init API from jupyter/declarativewidgets#251.

jhpedemonte added a commit to jhpedemonte/dashboards_server that referenced this issue Mar 10, 2016
Redo our bundled dashboards examples

Ref jupyter#133

(c) Copyright IBM Corp. 2016
jhpedemonte added a commit to jhpedemonte/dashboards_server that referenced this issue Mar 10, 2016
Move main Notebook shim function to dashboards.js

Ref jupyter#133

(c) Copyright IBM Corp. 2016
jhpedemonte added a commit to jhpedemonte/dashboards_server that referenced this issue Mar 10, 2016
Remove refs to 'IPython' (except for single backwards
compat line).
Remove redundant shim code and clean up.

Ref jupyter#133

(c) Copyright IBM Corp. 2016
jhpedemonte added a commit to jhpedemonte/dashboards_server that referenced this issue Mar 10, 2016
Need to setup base shims before creating widget mgr.
Fix travis build

Ref jupyter#133

(c) Copyright IBM Corp. 2016
jhpedemonte added a commit to jhpedemonte/dashboards_server that referenced this issue Mar 14, 2016
Fixes issue where declwidgets python code would try to run
before declwidgets had finished initializing

Ref jupyter#133

(c) Copyright IBM Corp. 2016
@parente
Copy link
Member Author

parente commented Mar 15, 2016

Closed by #136.

@parente parente closed this as completed Mar 15, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants