-
Notifications
You must be signed in to change notification settings - Fork 506
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
Update jupyter-widgets front-end packages #1393
Update jupyter-widgets front-end packages #1393
Conversation
we could mimic the |
Yeah I also thought we were already using the widgets prebuilt extension for 0.5.0. |
We are, but we also have our own jupyterlab-manager, which I guess means it can conflicts with what ipywidgets provides? |
Adding voila/packages/voila/webpack.config.js Lines 15 to 23 in b38b9b8
|
I'll have a try! |
It seems more complicated than that, we need something like this |
You can also have a look at the notebook 7 webpack config for inspiration. |
The issue is actually that the jupyterlab_widgets lab-extensions builds against its own version of So I think we're in a different situation than both JupyterLab and Notebook 7, because they don't mess up with widgets tokens like we do. We need to have I tried the following: ---
packages/voila/src/sharedscope.ts | 1 +
packages/voila/webpack.config.js | 20 +++++++++++++++++---
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/packages/voila/src/sharedscope.ts b/packages/voila/src/sharedscope.ts
index 26ac315..c428085 100644
--- a/packages/voila/src/sharedscope.ts
+++ b/packages/voila/src/sharedscope.ts
@@ -13,3 +13,4 @@ import '@lumino/signaling';
import '@lumino/virtualdom';
import '@lumino/widgets';
import 'react-dom';
+import '@jupyter-widgets/base';
diff --git a/packages/voila/webpack.config.js b/packages/voila/webpack.config.js
index 95e3701..b52cbf0 100644
--- a/packages/voila/webpack.config.js
+++ b/packages/voila/webpack.config.js
@@ -21,6 +21,22 @@ const names = Object.keys(data.dependencies).filter((name) => {
return packageData.jupyterlab !== undefined;
});
+const shared = {
+ ...data.dependencies
+};
+shared["@jupyter-widgets/base"] = {
+ requiredVersion: shared["@jupyter-widgets/base"],
+ singleton: true,
+ // import: false,
+};
+shared["@jupyter-widgets/jupyterlab-manager"] = {
+ requiredVersion: shared["@jupyter-widgets/jupyterlab-manager"],
+ singleton: true,
+ // import: false,
+};
+
+console.log('--- SHARED', shared);
+
// Ensure a clear build directory.
const buildDir = path.resolve(__dirname, 'build');
if (fs.existsSync(buildDir)) {
@@ -95,9 +111,7 @@ module.exports = [
name: ['_JUPYTERLAB', 'CORE_LIBRARY_FEDERATION']
},
name: 'CORE_FEDERATION',
- shared: {
- ...data.dependencies
- }
+ shared
})
]
}),
--
2.41.0 But it does not seem sufficient (setting I wonder if the jupyterlab_widgets lab-extension should not also set |
As shared but not |
Yeah I think it should bundle it, otherwise we would break jupyterlab_widgets support in JupyterLab and Notebook 7. But that's what confuses me in the case of Voila. Who should be responsible for bundling |
Aren't the federated extensions loaded before Voila startup? |
Would fix #1392 ?
I am very surprised this breaks. I wonder if we don't have a broken setup where we don't really use the @jupyter-widgets/base and controls ipywidgets provide, but we provide a copy of it in the page. (JupyterLab does not have this problem)
Would there be a way to properly use them as shared packages? probably a question for @jtpio ?