Skip to content

Compatibility of jupyter-widgets/base with JupyterLab 1.2 and 2.0 #2809

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

Closed
emmanuelle opened this issue Mar 6, 2020 · 10 comments
Closed

Compatibility of jupyter-widgets/base with JupyterLab 1.2 and 2.0 #2809

emmanuelle opened this issue Mar 6, 2020 · 10 comments
Labels
resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Milestone

Comments

@emmanuelle
Copy link

Hello! I hope this is the right place to open this issue.

With @nicolaskruchten we're trying to upgrade the plotlywidget JS package to work with JupyterLab 2.0 and running into a problem related to @jupyter-widgets/base ... Version 1.5.3 of our package depends on version 2.0.0 of @jupyter-widgets/base and works in JupyterLab 1.2, which is great. When we try to upgrade to version 3.0.0 we gain JupyterLab 2.0 support, but it no longer works with JupyterLab 1.2. Is this a known limitation? Is it intended that JS packages depending on @jupyter-widgets/base can work both with JupyterLab 1.2 and 2? Thank you :-).

@jasongrout
Copy link
Member

See #2798 (comment)

Short answer: make the dependency ^2 || ^3

@jasongrout jasongrout added this to the Reference milestone Mar 6, 2020
@nicolaskruchten
Copy link

Thanks @jasongrout! Unfortunately this doesn't appear to resolve our issue in JupyterLab 1.2... I still get the following output, which doesn't appear when depending on ^2.0.0:

image

@jasongrout
Copy link
Member

Where is your PR?

@nicolaskruchten
Copy link

These are the changes I'm trying: plotly/plotly.py#2256

Note that package-lock.json bakes in the dependency on version 3, so I'm not sure how this ^2 || ^3 change makes things work when folks try to install... Maybe I'm just seeing this error because I'm running jupyter labextension install . from the plotlywidget directory?

@jasongrout
Copy link
Member

Note that package-lock.json bakes in the dependency on version 3, so I'm not sure how this ^2 || ^3 change makes things work when folks try to install...

The package-lock.json is not used in JupyterLab. JLab will build its own dependency tree straight from the package.json, in consideration with other packages in the jlab build.

@jasongrout
Copy link
Member

I tried making a dev installation of the plotly PR in jlab 1.2.7 to see if I could reproduce this, but ran into troubles when trying to create a plot: js error of "ReferenceError: require is not defined" from a line:

                require(["plotly"], function(Plotly) {
                    window.PLOTLYENV=window.PLOTLYENV || {};

Is that expected? Are there instructions for making a dev installation that cover installing the jlab plugin? I tried to follow https://github.com/plotly/plotly.py/blob/master/contributing.md

@nicolaskruchten
Copy link

That is... not expected, although it's been reported from time to time and not easily reproduced on our end :)

The way I install the dev version is what I had assumed is the standard way, which is to cd packages/javascript/plotlywidget && npm install && npm run build && jupyter labextension install . but I always have a nagging feeling that I'm doing it wrong :)

@nicolaskruchten
Copy link

Looks like the way I was testing things until now was not correct, and that the path @jasongrout suggested above does work if you install into a clean JLab 1.2 instance, see plotly/plotly.py#2261. I was downgrading from 2 to 1 using pip but I guess that leaves little bits hanging around somehow?

@jasongrout
Copy link
Member

but I guess that leaves little bits hanging around somehow?

I think it can. I'd want to delete the jlab application directory if you downgraded to be sure - that's where jlab is built when you have extensions installed.

@jasongrout
Copy link
Member

Sounds like this is resolved over in plotly/plotly.py#2261. Thanks!

@lock lock bot added the resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label May 20, 2020
@lock lock bot locked as resolved and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

No branches or pull requests

3 participants