Skip to content
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

Add backward compatibility for ipywidgets 7 #1501

Merged
merged 26 commits into from
Oct 18, 2024

Conversation

martinRenou
Copy link
Member

@martinRenou martinRenou commented Oct 16, 2024

Closes #1487

Closes #1394 as this PR takes the approach of extracting the widget manager package out of the Voila one too.


How?

Voila now ships two new labextensions:

  • @voila-dashboards/widgets-manager7 for dealing with ipywidgets 7
  • @voila-dashboards/widgets-manager7 for dealing with ipywidgets 8+

The server will check which version of @jupyter-widgets/jupyterlab-manager is already installed there, and decide to inject either one or the other Voila widget manager in the page.


Copy link
Contributor

Binder 👈 Launch a Binder on branch martinRenou/voila/widgets_managers

@martinRenou martinRenou added the enhancement New feature or request label Oct 16, 2024
@martinRenou
Copy link
Member Author

Damn, I did not expect the UI-tests to pass 😆

packages/voila/src/app.ts Outdated Show resolved Hide resolved
@martinRenou martinRenou marked this pull request as ready for review October 17, 2024 13:40
@martinRenou martinRenou merged commit 5ad1b1d into voila-dashboards:main Oct 18, 2024
30 checks passed
@martinRenou martinRenou deleted the widgets_managers branch October 18, 2024 09:45
@@ -63,7 +62,7 @@ export function handleExecutionResult({
}: {
payload: IExecutionResultMessage['payload'];
rendermime: IRenderMimeRegistry;
widgetManager: VoilaWidgetManager;
widgetManager: any;
Copy link
Member

@jtpio jtpio Oct 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this have used the import type approach too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah indeed I missed that one

@dfguerrerom
Copy link
Contributor

my page_config_hook doesn't work anymore after this PR....

Screenshot from 2024-10-23 10-19-18

my previous logic was only adding the labextensions that were available in the virtual environment that I wanted to use... now I have refactored to also include the voila extensions... however, there's nothing rendered in my voila page.

my federated extensions are:

        "federated_extensions": [
            {
                "name": "jupyterlab-plotly",
                "load": "static/remoteEntry.41e12212782f05d7d17b.js",
                "extension": "./extension",
                "mimeExtension": "./mimeExtension",
                "entrypoints": None,
            },
            {
                "name": "jupyter-vue",
                "load": "static/remoteEntry.f993df579401788f32ef.js",
                "extension": "./extension",
                "entrypoints": None,
            },
            {
                "name": "jupyter-vuetify",
                "load": "static/remoteEntry.cba680c7ed013f0591de.js",
                "extension": "./extension",
                "entrypoints": None,
            },
            {
                "name": "jupyter-leaflet",
                "load": "static/remoteEntry.a83217134ba8dacb85fc.js",
                "extension": "./extension",
                "entrypoints": None,
            },
            {
                "name": "jupyterlab_pygments",
                "load": "static/remoteEntry.5cbb9d2323598fbda535.js",
                "extension": "./extension",
                "style": "./style",
                "entrypoints": None,
            },
            {
                "name": "@jupyter-widgets/jupyterlab-manager",
                "load": "static/remoteEntry.e4ff09401a2f575928c0.js",
                "extension": "./extension",
                "entrypoints": None,
            },
            {
                "name": "@jupyterhub/jupyter-server-proxy",
                "load": "static/remoteEntry.569b1096d01998b85e34.js",
                "extension": "./extension",
                "entrypoints": None,
            },
            {
                "name": "@voila-dashboards/widgets-manager8",
                "load": "static/remoteEntry.958dac8c7410b5fcc9ee.js",
                "extension": "./extension",
                "entrypoints": None,
            },
        ],

Is there anything else I've been missing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants