Skip to content

Commit

Permalink
Iterate
Browse files Browse the repository at this point in the history
  • Loading branch information
martinRenou committed Oct 15, 2024
1 parent b072450 commit 23fed69
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions packages/voila/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ async function main() {
),
1
)[0];
// Load @jupyter-widgets/jupyterlab-manager if it's there, and spot if it's widgets 7 or 8
if (
officialWidgetsManagerExtension &&
officialWidgetsManagerExtension.status === 'fulfilled'
Expand All @@ -111,10 +112,15 @@ async function main() {

if (ext.extension) {
const module = await createModule(ext.name, ext.extension);
console.log('loaded jupyter widgets module', module);
if (isIpywidgets7extension(module)) {
extensions.push(widgetsManager7Extension);
} else {
extensions.push(widgetsManager8Extension);
// Also bring back the official extension which registers the widgets
extensions.push(officialWidgetsManagerExtension);
}
}
}
console.log(widgetsManager7Extension, widgetsManager8Extension);

extensions.forEach((p) => {
if (p.status === 'rejected') {
Expand Down Expand Up @@ -143,7 +149,9 @@ async function main() {
);
federatedExtensions.forEach((p) => {
if (p.status === 'fulfilled') {
for (const plugin of activePlugins(p.value, [])) {
for (const plugin of activePlugins(p.value, [
'@jupyter-widgets/jupyterlab-manager:plugin'
])) {
mods.push(plugin);
}
} else {
Expand Down

0 comments on commit 23fed69

Please sign in to comment.