New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix embed resolution issues #1428
Fix embed resolution issues #1428
Conversation
@@ -45,7 +49,7 @@ class HTMLManager extends widgets.ManagerBase<HTMLElement> { | |||
*/ | |||
protected loadClass(className: string, moduleName: string, moduleVersion: string) { | |||
return new Promise(function(resolve, reject) { | |||
if (moduleName === '@jupyter-widgets/controls') { | |||
if (coreWidgetModules.indexOf(moduleName) >= 0) { |
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.
We should provide the widgets in separate cases, as in https://github.com/jupyter-widgets/ipywidgets/blob/master/widgetsnbextension/src/manager.js#L97 (and import the base widgets as a separate namespace).
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.
That makes sense. Thanks.
@@ -30,7 +30,7 @@ | |||
"dependencies": { | |||
"@phosphor/widgets": "^1.2.0", | |||
"font-awesome": "^4.7.0", | |||
"@jupyter-widgets/controls": "^0.1.0", | |||
"@jupyter-widgets/controls": "file:../jupyter-widgets-controls", |
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.
This should refer to a published version.
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.
(I just published 0.3.0...)
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.
Great! I was just waiting for a version that worked with the embed bundle.
I was planning on making changes here and rebasing #1410. |
We need this until a new release of `/controls`.
38e3d1d
to
ed50f46
Compare
This is ready for another look. The example ( For testing purposes, this HTML works with this PR and not off master. <html>
<head>
<script src="./embed.js"></script> <!-- This needs the path to the bundled htmlmanager -->
<script type="application/vnd.jupyter.widget-state+json">
{
"version_major": 2,
"version_minor": 0,
"state": {
"3d57873d0d8740c099cb3035321f0b8e": {
"model_name": "SliderStyleModel",
"model_module": "@jupyter-widgets/controls",
"model_module_version": "3.0.0",
"state": {
"description_width": "",
"_view_module": "@jupyter-widgets/controls",
"_model_module": "@jupyter-widgets/controls"
}
},
"cbc3ce11a183401394efe43239c55b26": {
"model_name": "LayoutModel",
"model_module": "@jupyter-widgets/base",
"model_module_version": "3.0.0",
"state": {}
},
"fef054da11f347d4b3414b64ac96eff8": {
"model_name": "IntSliderModel",
"model_module": "@jupyter-widgets/controls",
"model_module_version": "3.0.0",
"state": {
"style": "IPY_MODEL_3d57873d0d8740c099cb3035321f0b8e",
"_view_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_cbc3ce11a183401394efe43239c55b26",
"_model_module": "@jupyter-widgets/controls"
}
}
}
}
</script>
</head>
<body>
<h1>hello</h1>
<script type="application/vnd.jupyter.widget-view+json">
{
"model_id": "fef054da11f347d4b3414b64ac96eff8"
}
</script>
</body>
</html> |
This looks fine to me. Thanks! |
Awesome, thanks! |
As noted in issue #1427 , the htmlmanager on master suffers from the following issues:
@jupyter-widgets/base
. Since it already depends on@jupyter-widgets/base
, it might as well just provide the widgets directly (like it does with widgets in@jupyter-widgets/controls
.This PR tries to address these issues, but:
@jupyter-widgets/controls
master, not the released version. The fix for this is to cut a new release of/controls
.embed_widgets.js
?