voila-dashboards / voila

Voilà turns Jupyter notebooks into standalone web applications
https://voila.readthedocs.io
Other
5.32k stars 497 forks source link

Separate jupyter widgets manager extension #1394

Open martinRenou opened 9 months ago

martinRenou commented 9 months ago

References

A robust fix for https://github.com/voila-dashboards/voila/issues/1392

Code changes

github-actions[bot] commented 9 months ago

Binder :point_left: Launch a Binder on branch _martinRenou/voila/splitmanager

martinRenou commented 9 months ago

@trungleduc that works well!! Tested with jupyterlab_widgets 3.0.9 and 3.0.7.

trungleduc commented 9 months ago

Question about the releaser, we will bump both package versions on each release or they can be released separately?

martinRenou commented 9 months ago

By default the releaser will bump both but I guess we can configure that in our bump script if we need.

martinRenou commented 9 months ago

The test failure is legit. This new manager breaks jupyterlab because it says it provides the IJupyterWidgetRegistry token (so it overwrites the one from ipywidgets), but it fails saying we need a VoilaApp. This is all very weak.

martinRenou commented 9 months ago

This new manager breaks jupyterlab because it says it provides the IJupyterWidgetRegistry token (so it overwrites the one from ipywidgets), but it fails saying we need a VoilaApp

Because our extension needs a Voila app, I think we should separate the labextensions specific to Voila from the labextensions for other applications and lab-remixes in the path.

So Voila would look into /share/jupyter/labextensions for classic lab-extensions, and /share/jupyter/voila/labextensions for labextensions very specific to Voila. Opinions @jtpio @trungleduc ?

That way we're not breaking JupyterLab with our very specific extension.

trungleduc commented 9 months ago

how can JupyterLab activate Voila's widget manager? We checked for the app instance before doing anything

martinRenou commented 9 months ago

JupyterLab sees the Voila's widget manager provides the token IJupyterWidgetRegistry so it tries to activate it and that fails. And it does not fallback to the usual widget manager, the Voila one shadows it.

martinRenou commented 9 months ago

It seems depending on @voila-dashboards/voila in a labextension for Voila breaks the labextension with package @jupyterlab/filebrowser is not in the shared scope so we need to remove it.

I see @trungleduc did the same in https://github.com/voila-dashboards/voila-topbar and need to work with (app as any) instead of importing the type of VoilaApp.

Let's open an issue later for this.

martinRenou commented 9 months ago

Ready for review

martinRenou commented 9 months ago

As discussed with @trungleduc this will be too much of a change for a patch release. @trungleduc found a simpler fix and will come up with another PR.

Though I'd like that we consider these changes in a 0.6.x release, as scoping labextensions specific to Voila may make sense in some cases.