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

Update to JupyterLab 2.0 #70

Merged
merged 10 commits into from Feb 29, 2020
Merged

Update to JupyterLab 2.0 #70

merged 10 commits into from Feb 29, 2020

Conversation

jtpio
Copy link
Member

@jtpio jtpio commented Feb 14, 2020

@jtpio
Copy link
Member Author

jtpio commented Feb 15, 2020

This builds, but it needs a manual pass to make sure everything behaves as expected.

For example, the Python icon in the launcher card doesn't show anymore:

image

Jupyterlab provides a class `ClientSession`
([see the documentation](https://jupyterlab.github.io/jupyterlab/apputils/classes/clientsession.html))
Jupyterlab provides a class `SessionContext`
([see the documentation](https://jupyterlab.github.io/jupyterlab/apputils/classes/sessioncontext.html))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This link doesn't work (yet). We should check whether it gets updated once 2.0 final is published.

@jtpio
Copy link
Member Author

jtpio commented Feb 15, 2020

Looks like b81943d fixes the icon issue.

image

A new LabIcon must be created to register a new icon with a name, and then be looked up here when rendered as a React element: https://github.com/jupyterlab/jupyterlab/blob/b66bb79116285ccbd0876a6263ac2c0d6de27c33/packages/ui-components/src/icon/labicon.tsx#L218

@echarles
Copy link
Member

Tested this branch and works well with latest jupyterlab master.

@jtpio
Copy link
Member Author

jtpio commented Feb 25, 2020

Thanks @echarles for trying it out.

We can check with the latest rc (that includes the icon fix from jupyterlab/jupyterlab#7864), which should make b81943d not necessary anymore.

@echarles
Copy link
Member

I have tried with jlab 2.rc2 with and without b81943d

The icons are not displayed. I will experiment a bit and see what is going on here...

Screenshot 2020-02-25 at 14 37 51

@jtpio
Copy link
Member Author

jtpio commented Feb 25, 2020

And that's from a clean install (rm yarn.lock node_modules)?

@echarles
Copy link
Member

This is the clean I have done before running the tests, but I should do it again as yesterday was a bit messy.

find . -name node_modules | xargs rm -fr {} || true
find . -name lib | xargs rm -fr {} || true
find . -name build | xargs rm -fr {} || true
find . -name yarn.lock | xargs rm {} || true
find . -name yarn-error.log | xargs rm {} || true
find . -name tsconfig.tsbuildinfo | xargs rm {} || true

@jtpio
Copy link
Member Author

jtpio commented Feb 27, 2020

Updated to the latest rc.2 packages. But now tslint seems to be giving errors: https://github.com/jtpio/jupyterlab-extension-examples/pull/70/checks?check_run_id=473012537

@jtpio
Copy link
Member Author

jtpio commented Feb 27, 2020

@echarles just tried locally in a fresh conda environment, and icons are also missing.

@echarles
Copy link
Member

Maybe we should @telamonian expert eyes here?

@jtpio
Copy link
Member Author

jtpio commented Feb 27, 2020

Now using the same pattern as in core JupyterLab:

image

See f0de1f9.

Also quickly tried the "legacy icon as css class" as mentioned in jupyterlab/jupyterlab#7887 (comment), but without success.

@jtpio
Copy link
Member Author

jtpio commented Feb 27, 2020

The lint issue mentioned above appears to be related to the latest TypeScript 3.8 version.

Changing it to ~3.7.5 fixes it now, but we should upgrade to 3.8 in a separate PR.

@telamonian
Copy link
Member

telamonian commented Feb 28, 2020

Also quickly tried the "legacy icon as css class" as mentioned in jupyterlab/jupyterlab#7887 (comment), but without success.

@jtpio Turns out that although iconClass was getting set up correctly on the DOM, there was no longer any CSS styling directives for how to display background images. That's fixed in jupyterlab/jupyterlab#7947

@jtpio
Copy link
Member Author

jtpio commented Feb 28, 2020

Thanks @telamonian, will check that out!

@jtpio jtpio marked this pull request as ready for review February 28, 2020 11:15
@jtpio
Copy link
Member Author

jtpio commented Feb 28, 2020

@echarles I think the examples should now work as before, marking it as ready for review.

cc @fcollonval if you also want to have a look.

@jtpio
Copy link
Member Author

jtpio commented Feb 28, 2020

We could consolidate the explanations for the LabIcon in a separate change, maybe after it has been added to the migration guide.

@jtpio
Copy link
Member Author

jtpio commented Feb 29, 2020

Updated to the 2.0 packages, since 2.0 final was released yesterday.

This should be good to go.

@echarles
Copy link
Member

echarles commented Feb 29, 2020

I think not all icons are migrated.

Screenshot 2020-02-29 at 15 38 28

@echarles
Copy link
Member

I will branch from this and make a pass on the extension to deal with:

  1. Having the menus under one menu - For now, we have plenty of 'Examples' and I would rather see them under a nice Extension examples menu.

Screenshot 2020-02-29 at 15 39 19

  1. We rely on console to show the result of the actions, but for the user, an alert would be easier.

@jtpio
Copy link
Member Author

jtpio commented Feb 29, 2020

@echarles I think the other examples just don't have any icon set:

https://github.com/jtpio/jupyterlab-extension-examples/blob/2f87d40d2c3ca09ae02a2653b6d11f7dc9935226/basics/signals/src/index.ts#L67-L71

But it would be nice if they had one (even if it's a placeholder).

@jtpio
Copy link
Member Author

jtpio commented Feb 29, 2020

I will branch from this and make a pass on the extension to deal with:

1. Having the menus under one menu - For now, we have plenty of 'Examples' and I would rather see them under a nice `Extension examples` menu.
Screenshot 2020-02-29 at 15 39 19
1. We rely on console to show the result of the actions, but for the user, an alert would be easier.

Sounds good 👍

How about merging this one first to make it easier to iterate and follow?

@echarles echarles merged commit c555052 into master Feb 29, 2020
@echarles
Copy link
Member

Merged. Thx a lot @jtpio for this great step. I will iterate on master and submit something tomorrow.

@jtpio jtpio deleted the jlab-2 branch February 29, 2020 16:48
@jtpio
Copy link
Member Author

jtpio commented Feb 29, 2020

Thanks!

@jtpio jtpio mentioned this pull request Mar 2, 2020
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 this pull request may close these issues.

Update to JupyterLab 2.0
3 participants