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

JupyterLab 3 compatibility #442

Closed
urlicht opened this issue Feb 17, 2021 · 9 comments · Fixed by #457
Closed

JupyterLab 3 compatibility #442

urlicht opened this issue Feb 17, 2021 · 9 comments · Fixed by #457

Comments

@urlicht
Copy link

urlicht commented Feb 17, 2021

The bug

A few months ago, jupyter released a new major version of jupyterlab. Is WebIO.jl compatible with the latest jupyterlab?
When trying to install using install_jupyter_labextension(), the following happens:

@webio/[email protected]" is not compatible with the current JupyterLab

Context

Error running install_jupyter_labextension():

"@webio/[email protected]" is not compatible with the current JupyterLab
Conflicting Dependencies:
JupyterLab              Extension      Package
>=3.0.3 <3.1.0          >=2.0.0 <3.0.0 @jupyterlab/application
>=3.0.3 <3.1.0          >=2.0.0 <3.0.0 @jupyterlab/docmanager
>=3.0.3 <3.1.0          >=2.0.0 <3.0.0 @jupyterlab/notebook
>=3.0.3 <3.1.0          >=2.0.0 <3.0.0 @jupyterlab/rendermime
>=6.0.2 <6.1.0          >=5.0.0 <6.0.0 @jupyterlab/services
See the log file for details:  /tmp/jupyterlab-debug-5rkyagx9.log

WebIO status:

(@v1.5) pkg> status WebIO
Status `~/.julia/environments/v1.5/Project.toml`
  [0f1e0344] WebIO v0.8.15

versioninfo():

Julia Version 1.5.3
Commit 788b2c77c1 (2020-11-09 13:37 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, skylake)

jupyter nbextension list:

Known nbextensions:
  config dir: /home/.../.jupyter/nbconfig
    notebook section
      nbresuse  enabled 
      - Validating: problems found:
        - require?  X nbresuse

jupyter labextension list:
JupyterLab v3.0.5

@bollwyvl
Copy link

Echoing #397 (comment) for those watching:

Happy to help get any stuff up on jupyter lab 3, if my complete lack of julia knowledge isn't too big a hindrance. It's hopefully a small json change, and cutting a new release, but then will not require a julia user to run (or even need) nodejs stuff after installing the extension, much like classic notebook extensions.

If there are other extensions that depend on this one through the jupyterlab side, it's slightly more complicated, but again hopefully just json changes.

I'll add: we've gotten initial support for the Julia language server into jupyterlab-lsp, which will primarily be supporting JupyterLab 3 going forward... it would be great to include webio in the demo environment.

@twavv
Copy link
Member

twavv commented Feb 17, 2021

PRs welcome. Not sure how much change will be required from 1 -> 3.

@pfarndt
Copy link

pfarndt commented Feb 19, 2021

WebIO as it is right now works for JL 2.2.9 already - at least for me (on a Mac using a conda installation) - therefore I guess it is only the step from 2 -> 3 which needs to be taken care of.

@cfhowes
Copy link

cfhowes commented Feb 26, 2021

is there developer documentation that could help someone like me start a PR? I don't know how library setup and install works with julia (i'm new to julia and taking the UM Continuum course, but would like to use Jupyter Lab 3)

@bollwyvl
Copy link

bollwyvl commented Mar 2, 2021

step from 2 -> 3 which needs to be taken care of.

The big delta is that lab 3 doesn't need to be rebuilt every time a user adds an extension (though it can be). Much like the notebook classic approach, (aside from needing to be "built" with webpack), the extension distribution folder (which will have at least a package.json and a remoteEntry*.js) needs to be delivered, unpacked, to the appropriate location in $PREFIX/share/jupyter/labextensions/<npm name maybe with an org>. The rest is discovered at runtime.

To build that folder, extensions need to add:

# package.json (ain't yaml)
"dependencies": {
   "@jupyterlab/whatever": "^2 || ^3",
   # ...
},
"devDependencies": {
  "@jupyterlab/builder": "^3.0.1",
  # ...
},
"jupyterlab": {
    "outputDir": "./some/relative/path",
    # "sharedPackages": { "@jupyter-widgets/base": {"bundled": false, "singleton": true} }
    # "webpackConfig": "./some.webpack.config.js"
}

and then run:

jupyter labextension builld .

To do the necessary webpack junk to make it resolve itself at runtime. All extensions are singletons, while there are some further options for depending on transient dependencies of other extensions with sharedPackages. Finally, if the build needs webpack area really crazy (e.g. needing to patch upstreams, load fonts, etc), one can roll this into the labextension build by specifying a custom webpackConfig, which will get merged with the "baseline" configuration.

Unfortunately, I've never successfully gotten this repo's dev setup working properly, but more than happy to help!

@jlumpe
Copy link
Contributor

jlumpe commented Mar 2, 2021

Developer documentation for jupyterlab 3 extensions here, see the Extension Migration Guide section. Jupyterlab 3 has a command that is supposed to automatically upgrade an extension from v2 to v3, I tried that but could not get it to build.

@bollwyvl
Copy link

bollwyvl commented Mar 2, 2021

automatically upgrade

this assumes a fairly opinionated existing structure based on the cookiecutter and python, and likely won't work for this case.

@jlumpe
Copy link
Contributor

jlumpe commented Mar 2, 2021

Yeah it seems to just infer some settings from from package.json, create an empty project using the cookiecutter template and try to merge those in. Luckily I think the "opinionated" part mostly just adds a bunch of unneeded stuff (like adding linting scripts) that can be easily removed afterwards. At the very least you can use it to update all the dependencies to the correct versions.

@paulnakroshis
Copy link

Is there a fix to allow WebIO to work with jupyterlab=3.0? Would love to have sliders working!

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

Successfully merging a pull request may close this issue.

7 participants