Skip to content

Widgets 7.x release plan for JupyterLab 2.0 #2798

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
jasongrout opened this issue Feb 26, 2020 · 11 comments
Closed

Widgets 7.x release plan for JupyterLab 2.0 #2798

jasongrout opened this issue Feb 26, 2020 · 11 comments
Labels
resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Milestone

Comments

@jasongrout
Copy link
Member

My current thinking is that we:

  1. Release major versions of the js packages to support JLab 2.0. This involves a major upgrade to jupyterlab services, etc., as merged into the 7.x branch already. I've released several RC versions of the js packages, and tested upgrading custom widgets, and things seem to work well.
  2. Release a patch release of widgetsnbextension, since it contains fixes for the font awesome upgrade in the notebook Change fontawesome support to work for fontawesome 4 and 5. #2793
@vidartf
Copy link
Member

vidartf commented Feb 27, 2020

I think this code needs to change to import from phosphor?

import {
Token
} from '@lumino/coreutils';

@vidartf
Copy link
Member

vidartf commented Feb 27, 2020

(possibly also in master for 8.0?)

@jasongrout
Copy link
Member Author

I think this code needs to change to import from phosphor?

Yes, good catch. I'm not sure how that made it into the 7.x branch. Do you want to make a PR?

(We should test the 7.x RC out there now to make sure it works on jlab 1) - it will probably fail from this, so we should test after cutting another RC with this change.

(possibly also in master for 8.0?)

I'm thinking that 8.0 will effect the switch to Lumino. Custom widget authors and users I think will understand that pythreejs is a major upgrade to switch to ipywidgets 8, and that way ipywidgets 8 will support JLab 2 and JLab 3 (but not JLab 1).

So the story to users/developers is:

  • ipywidgets 7 fully supports jlab 1 and jlab 2. Custom widgets will need a patch release to add support for jlab 2 (just like they did for jlab 1)
  • ipywidgets 8 supports jlab 2 (but not jlab 1). Custom widgets will need a major release to support ipywidgets 8
  • Both ipywidgets 7 and 8 support classic notebook

@jasongrout
Copy link
Member Author

Yes, good catch. I'm not sure how that made it into the 7.x branch. Do you want to make a PR?

Looks like it came in in a30e7dd. Not sure how I missed that. So we need to revert the phosphor->Lumino change basically everywhere.

@jasongrout
Copy link
Member Author

jasongrout commented Feb 28, 2020

Wait, never mind. The whole point here is that we have a major release of the base package and the jupyterlab manager, which is only for jlab 2. All those changes were intentional to get the widget manager to work in jlab 2. Custom widgets will be able to support jlab 1 and 2, though.

So to be clear:

  • ipywidgets 7 supports jlab 1 (@jupyter-widgets/jupyterlab-manager@1), jlab 2 (@jupyter-widgets/jupyterlab-manager@2), and classic notebook (widgetsnbextension). Custom widgets will need a patch release to add support for jlab 2 (just like they did for jlab 1) by adding a new dependency version for the base package (^1 || ^2 || ^3)
  • ipywidgets 8 supports jlab 2 (through another major release of @jupyter-widgets/jupyterlab-manager) and classic notebook (another major version of widgetsnbextension)

@vidartf
Copy link
Member

vidartf commented Feb 28, 2020

Custom widgets will need a patch release to add support for jlab 2 (just like they did for jlab 1) by adding a new dependency version for the base package (^1 || ^2 || ^3)

So currently, the Token gets defined in @jupyterlab/base, and this is the one that causes the TypeScript compile error if lumino/phosphor gets mixed.

@vidartf
Copy link
Member

vidartf commented Feb 28, 2020

To clarify, strongly typed plugin code fails to compile:

const plugin: IPlugin<Application<Widget>, void> = {
  id: 'myplugin',
  requires: [IJupyterWidgetRegistry],
  activate: () => {},
  autoStart: true
};

export default plugin;

Weakly typed plugins succeed:

module.exports = {
  id: 'myplugin',
  requires: [IJupyterWidgetRegistry],
  activate: () => {},
  autoStart: true
};

Examples in the wild for both types:

@jasongrout
Copy link
Member Author

There may need to be some as any typecasts in plugins wanting to support both jlab 1 and jlab 2, I think.

@vidartf
Copy link
Member

vidartf commented Feb 28, 2020

Sure. As long as we can offer that as an out for those that need to support both, that sounds ok. Most of my extensions are stable enough at this point, that I'll probably just release a new version tied to newest widgets, and newest lab only.

@jasongrout
Copy link
Member Author

jasongrout commented Mar 3, 2020

I released final versions of the npm packages to enable JupyterLab 2.0 support for ipywidgets.

For JupyterLab 2.0, to install ipywidgets, simply do jupyter labextension install @jupyter-widgets/jupyterlab-manager, just like usual.

For custom widget authors, I anticipate that all you need to do to add support for JupyterLab 2.0 is to publish a patch release of your npm package where you've updated your @jupyter-widgets/base dependency version requirement to include || ^3 (i.e., if you followed the instructions at https://ipywidgets.readthedocs.io/en/stable/changelog.html#updates-for-widget-maintainers, your dependency could look like:

"dependencies": {
  "@jupyter-widgets/base": "^1 || ^2 || ^3"
}

@jasongrout
Copy link
Member Author

Closing as resolved at this point.

zerline pushed a commit to sagemath/sage-combinat-widgets that referenced this issue Mar 13, 2020
@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

2 participants