From 17d0ea31942c61a68d06be75f4d3bd0e6ce1eb5d Mon Sep 17 00:00:00 2001 From: Duc Trung Le Date: Fri, 15 Sep 2023 20:41:16 +0200 Subject: [PATCH] Embed all `jupyterlab-manager` plugins (#1396) * Embed jupyterlab-widgets plugins * Update node --- .github/workflows/ui-tests.yml | 2 +- packages/voila/src/main.ts | 12 +++++------- packages/voila/src/tree.ts | 12 ++---------- voila/utils.py | 3 ++- 4 files changed, 10 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ui-tests.yml b/.github/workflows/ui-tests.yml index 1a486575d..068c76898 100644 --- a/.github/workflows/ui-tests.yml +++ b/.github/workflows/ui-tests.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: python-version: [3.8] - node-version: [16.x] + node-version: [18.x] fail-fast: false steps: diff --git a/packages/voila/src/main.ts b/packages/voila/src/main.ts index bcf1089e3..625378d1f 100644 --- a/packages/voila/src/main.ts +++ b/packages/voila/src/main.ts @@ -25,11 +25,6 @@ import { //Inspired by: https://github.com/jupyterlab/jupyterlab/blob/master/dev_mode/index.js -const disabled = [ - '@jupyter-widgets/jupyterlab-manager:plugin', - '@jupyter-widgets/jupyterlab-manager:saveWidgetState' -]; - /** * The main function */ @@ -44,6 +39,9 @@ async function main() { require('@jupyterlab/rendermime-extension'), require('@jupyterlab/theme-light-extension'), require('@jupyterlab/theme-dark-extension'), + require('@jupyter-widgets/jupyterlab-manager/lib/plugin').default.filter( + (p: any) => p.id !== '@jupyter-widgets/jupyterlab-manager:plugin' + ), plugins ]; @@ -101,7 +99,7 @@ async function main() { ); federatedExtensions.forEach((p) => { if (p.status === 'fulfilled') { - for (const plugin of activePlugins(p.value, disabled)) { + for (const plugin of activePlugins(p.value, [])) { mods.push(plugin); } } else { @@ -115,7 +113,7 @@ async function main() { ); federatedMimeExtensions.forEach((p) => { if (p.status === 'fulfilled') { - for (const plugin of activePlugins(p.value, disabled)) { + for (const plugin of activePlugins(p.value, [])) { mimeExtensions.push(plugin); } } else { diff --git a/packages/voila/src/tree.ts b/packages/voila/src/tree.ts index 53cbc4cf1..5435802f4 100644 --- a/packages/voila/src/tree.ts +++ b/packages/voila/src/tree.ts @@ -26,14 +26,6 @@ import { widgetManager } from './voilaplugins'; -export const TREE_DISABLED_EXTENSIONS = [ - '@jupyter-widgets/jupyterlab-manager:plugin', - '@jupyter-widgets/jupyterlab-manager:saveWidgetState', - '@jupyter-widgets/jupyterlab-manager:base-2.0.0', - '@jupyter-widgets/jupyterlab-manager:controls-2.0.0', - '@jupyter-widgets/jupyterlab-manager:output-1.0.0' -]; - /** * The main function */ @@ -100,7 +92,7 @@ async function main() { ); federatedExtensions.forEach((p) => { if (p.status === 'fulfilled') { - for (const plugin of activePlugins(p.value, TREE_DISABLED_EXTENSIONS)) { + for (const plugin of activePlugins(p.value, [])) { mods.push(plugin); } } else { @@ -114,7 +106,7 @@ async function main() { ); federatedMimeExtensions.forEach((p) => { if (p.status === 'fulfilled') { - for (const plugin of activePlugins(p.value, TREE_DISABLED_EXTENSIONS)) { + for (const plugin of activePlugins(p.value, [])) { mimeExtensions.push(plugin); } } else { diff --git a/voila/utils.py b/voila/utils.py index 2473bd8e1..8ae7f006b 100644 --- a/voila/utils.py +++ b/voila/utils.py @@ -118,9 +118,10 @@ def get_page_config(base_url, settings, log, voila_configuration: VoilaConfigura disabled_extensions = [ "@voila-dashboards/jupyterlab-preview", "@jupyter/collaboration-extension", + "@jupyter-widgets/jupyterlab-manager", ] disabled_extensions.extend(page_config.get("disabledExtensions", [])) - required_extensions = ["@jupyter-widgets/jupyterlab-manager"] + required_extensions = [] federated_extensions = deepcopy(page_config["federated_extensions"]) page_config["federated_extensions"] = filter_extension(