JuliaGizmos / WebIO.jl

A bridge between Julia and the Web.
https://juliagizmos.github.io/WebIO.jl/latest/
Other
226 stars 64 forks source link

webio-jupyterlab-provider broken with JupyterLab v4 #514

Open baumgold opened 5 months ago

baumgold commented 5 months ago

The bug

It appears that the webio-jupyterlab-provider extension is incompatible with JupyterLab v4.0.8

Context

When I upgraded to JupyterLab v4.0.8 the webio-jupyterlab-provider stopped working (notice the "X"):

$ jupyter labextension list
JupyterLab v4.0.8
~/miniconda3/share/jupyter/labextensions
        webio-jupyterlab-provider v0.1.0 enabled  X (python, webio_jupyter_extension)
        @jupyter-widgets/jupyterlab-manager v5.0.9 enabled OK (python, jupyterlab_widgets)
        @jupyter-notebook/lab-extension v7.0.6 enabled OK

   The following extensions are outdated:
        webio-jupyterlab-provider

   Consider checking if an update is available for these packages.

After I downgraded back to JupyterLab v3.6.7 the extension started working again (notice the "OK"):

JupyterLab v3.6.7
~/miniconda3/share/jupyter/labextensions
        webio-jupyterlab-provider v0.1.0 enabled OK (python, webio_jupyter_extension)
        @jupyter-widgets/jupyterlab-manager v5.0.9 enabled OK (python, jupyterlab_widgets)

Julia info:

julia> Pkg.status("WebIO")
Status `~/.julia/environments/v1.10/Project.toml`
  [0f1e0344] WebIO v0.8.21

julia> versioninfo()
Julia Version 1.10.0
Commit 3120989f39b (2023-12-25 18:01 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 48 × Intel(R) Xeon(R) Gold 6136 CPU @ 3.00GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, skylake-avx512)
  Threads: 5 on 48 virtual cores
Environment:
  JULIA_NUM_THREADS = 4
andrew-at-rotor commented 5 months ago

I experienced the same thing with jupyterlab v4 and julia 1.9.3. After downgrading to jupyterlab 3.6.7, I see that the extension is "OK" but see

The WebIO Jupyter extension was not detected

when using PlotlyJS in the REPL.

Do you see this error with using julia 1.10?

baumgold commented 5 months ago

@andrew-at-rotor - I somehow managed to get my system into the same state as you. Julia v1.10 with WebIO v0.8.21 and JupyterLab v3.6.7. jupyter labextension list says the webio-jupyterlab-provider is 'enabled OK' but when I try to use it from Jupyterlab notebook I get:

WebIO not detected.

Please read [the troubleshooting guide](https://juliagizmos.github.io/WebIO.jl/latest/troubleshooting/not-detected/) for more information on how to resolve this issue.

https://juliagizmos.github.io/WebIO.jl/latest/troubleshooting/not-detected/

It's unclear to me what part of my system is problematic.

archisman-panigrahi commented 4 months ago

I came across this issue in Arch Linux. As workaround is to use the package jupyter-nbclassic, with which this package is compatible.

kdheepak commented 4 months ago

There's a number of breaking changes in Jupyter Lab 4.

https://jupyterlab.readthedocs.io/en/latest/extension/extension_migration.html#api-breaking-changes

When I open the console I get these errors:

image image

This particular error might be easy to fix (based on https://discourse.jupyter.org/t/model-metadata-get-is-not-a-function/19758):

the API has changed in this respect between jlab 3 and 4

you should now use model.getMetadata() as well as similarly setMetadata() and deleteMetadata()

But I'm not sure how many more breaking changes are there.

I naively tried to run the upgrade extension to start working on a PR but got different errors in every folder.

https://jupyterlab.readthedocs.io/en/latest/extension/extension_migration.html#upgrading-extension-using-the-upgrade-script

I can try to help with this change to get it working, but I don't have any experience in jupyter lab extensions. Can anyone offer some direction on how to go about this?

kdheepak commented 3 months ago

I wanted to give a friendly bump on this thread. Currently no widgets work in jupyter v4 e.g. https://github.com/JuliaGizmos/Interact.jl/issues/421

I have some time I can put toward looking into this this week, but I'm coming in with no knowledge of jupyter widgets or even observables. If someone can offer some insight that'd be great!

paulnakroshis commented 2 months ago

This is my biggest issue with Jupyterlab --- no working widgets. I am using the jupyterlab-desktop app and If I try to make a plot with a slider, the plot displays but without a slider. This is why I end up using Pluto notebooks when I need this capability. Does ANYONE know if a fix is in the works? This is a hugely useful feature to have....