-
Notifications
You must be signed in to change notification settings - Fork 38
Conversation
Pretty sure this is what we did in dashboards server, then shimmed it for libs that wanted the old kernel UI.
If decl widgets starts creating a notebook object, it's going to also be aware that dashboards server creates a notebook object and not to mess with it.
Sounds like the shims both dashboard and notebook server puts in place for ipywidgets are now going into decl widgets? That seems wrong. Overall, I'm a bit worried that we're replicating all the gorp we had to put into dashboards server in decl widgets so that they carry a notebook-like environment with them wherever they go. If the goal is to allow any Python, R, Scala, etc. code to be used with any lib in the ecosystem, the shimming will continue. Do we want all of this in decl widgets? Can we scope what's supported vs what's not? |
window.Polymer.dom = 'shadow'; | ||
// NOTE: This breaks some code because it is expecting Polymer.dom to be a function | ||
// window.Polymer.dom = 'shadow'; | ||
window.Polymer.dom = window.Polymer.dom ? window.Polymer.dom : 'shadow'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deedubbu There many be a different way of setting shadow
dom since now Polymer moved the dom
api to the top of the Polymer
global.
|
I agree with @parente. We do not want the environment shimming here. I'm ok with evaluating how we are injecting the dependencies on init and open to suggestions. |
Spoke with @lbustelo and we decided to align on the API: var kernel = jupyter-js-services.startKernel();
// Config values needed for declarativewidgets
var config = {
base_url : '/bower_components',
components_url : '',
};
var declWidgets = DeclWidgets.init(kernel, config); This will require creating shim for just the notebook environment. This will be contained in the declwidgets notebook extension. As @parente mentioned, once we finalize this API I will create a PR in dashboards server to align with this new API. We are still missing the WidgetManager piece, but we will add that after this next pass is approved. |
Is there any way to keep backwards compat in the API? Can kernel just be passed as a property of config? |
Fixed minor bug with Polymer.dom not being a function. (c) Copyright IBM Corp. 2016
(c) Copyright IBM Corp. 2016
(c) Copyright IBM Corp. 2016
This PR is meant to allow declarative widgets to be installed as an npm module and be used in standalone applications.
So to fully integrate a config like this will need to be passed in as such:
Feedback Points
postinstall.js
- This file will run when afternpm install
. It requires bower to be installed and will runbower install
for all of the bower components defined in theelements
directory. This is the best solution I could find at the time, but am open to discussion for better solutions.init.js
- I needed a way to be able to configure theCOMPONENTS_DIR
variable for outside applications. I solved this through a config value hereEdit: Updated bullet point 3 to reflect this may be a breaking change