Uh oh!
There was an error while loading. Please reload this page.
Refactor JupyterLab JS extensions and package as federated extension - #3142
Conversation
fcollonval
commented
Apr 9, 2021
I pushed this PR as draft to get feedback early. |
nicolaskruchten
commented
Apr 9, 2021
Thanks for this PR, it seems very exciting! I'll try to review it and give you some feedback next week :) |
This is working locally Reference: Exit code 137 => out of memory - https://discuss.circleci.com/t/every-build-fails-with-received-killed-signal-during-apk-build/25627/6 |
fcollonval
commented
Apr 9, 2021
Ok I got a first version - but the remaining errors raise two questions:
|
nicolaskruchten
commented
Apr 9, 2021
Thanks again! I think we might be dropping 2.7/3.5 support very soon (i.e. in the next version, which will be 5.0) so this problem might just go away :) |
nicolaskruchten
commented
Apr 9, 2021
And even if we choose to keep 2.7/3.5 support in 5.0, we can probably just not run these bits in those CI jobs :) |
fcollonval
commented
Apr 9, 2021
Thinking a bit more about it; actually the CI is about testing python and not the JS. So we could implement a option like |
nicolaskruchten
commented
Apr 9, 2021
yes exactly. |
jonmmease
commented
Apr 14, 2021
@fcollonval, thanks so much for working on this! A couple of general thoughts / questions:
|
nicolaskruchten
commented
Apr 14, 2021
Also: is this still compatible with how classic non-lab notebook gets access to the widget plugin/extension? |
fcollonval
commented
Apr 14, 2021
Thanks for looking into this. I'll try to describe as clearly as possible the logic behind a typical Jupyter widget repository. Then your questions should be easy to answer. Most Jupyter widget package are wrappers of existing JS library inside a Backbone model and views to allow communication with the Python model. This package is defining that wrapper in
So the code proposed in this PR will generate the entrypoints for those 3 frontends (once the python and npm packages are published) - I checked it worked in the classical notebook and JupyterLab. About the render mime extension, JupyterLab extension can provide multiple plugins that can be packaged within the same node package. For the render mime extension, the situation is singular as it needs its own entrypoint -
As the widget code is not tied to a specific frontend, I kept plotlywidget rather than jupyterlab-plotly.
Yes
Yes A final comment - webpack has the nice feature to drop code unneeded depending on the entrypoint. This means in particular that the JupyterLab code is not part of the classical notebook extension bundle. |
nicolaskruchten
commented
Apr 14, 2021
Very cool, thanks for the explanation! I don't think |
fcollonval
commented
Apr 15, 2021
Indeed you do I let you settle on the new name. Than I'm happy to update the PR with it. |
nicolaskruchten
commented
Apr 15, 2021
Thanks! Assuming we come up with a new name that's not Also, for JupyterLab 1 and 2, the old-style installation is meant to still work, right? We'll push the new extension to NPM under its new name, and |
Since yesterday, we're currently testing this for a graduate level class of 20 students. Everything has been smooth so far. We're using Anaconda's Python 3.8.8 with Jupyter Lab 3 and Dash. |
fcollonval
commented
Apr 15, 2021
That will be safer indeed.
Yes the old installation mechanism is still supported in JupyterLab 3. So the new package will be compatible using |
nicolaskruchten
commented
Apr 15, 2021
OK, thanks for the confirmation. Do you have a sense of what the behaviour would be if you had both the old extensions and the new one installed? Is there anything we can do to the new one to have it have priority or otherwise complain if the older ones are installed as well? |
fcollonval
commented
Apr 17, 2021
For the widget, we should be fine as it checks the JS module and version constrains from the Python package. So end users will need to execute old notebook to see the plotly graphs; like for any update. For the renderer, their is a
I never look into the plugin code in details - but it may be possible to use |
koenlek
commented
Apr 21, 2021
This is very exciting! Hopefully this lands soon :) Thanks for working on this! |
nicolaskruchten
commented
Apr 21, 2021
OK so I think we'd like to call the unified extension |
nicolaskruchten
commented
Apr 21, 2021
Also note: once #3160 lands you'll be able to merge master into this branch and have the CI go green again :) |
jonmmease
commented
Apr 23, 2021
@fcollonval, we've done a bunch of CI cleanup that's causing conflicts here. I'm going to work on resolving those and to see if I can get the tests passing. I'll also port #2771 into the updated version of |
jonmmease
commented
Apr 23, 2021
@fcollonval, I got the tests fixed up in #3169. When you have a chance, could you take a look at that branch and the squash merge it into this one? I think that, along with the name change back to |
191a548 to
a6c6d99Comparefcollonval
commented
May 5, 2021
I'm lost. I created a fresh environment: Then install your wheel => the plotly code worked |
nicolaskruchten
commented
May 5, 2021
And after installing |
nicolaskruchten
commented
May 5, 2021
OK, so in a totally clean environment, I can't replicate this either. I'm trying to figure out what's different about my big/complex environment vs a totally clean one. |
nicolaskruchten
commented
May 5, 2021
(sorry, unintended close!) |
nicolaskruchten
commented
May 5, 2021
OK, I think this is good to merge! I'll keep trying to get to the bottom of why I'm seeing this I've checked things out in both JupyterLab 2 and 3, with and without the older version of the |
dhirschfeld
commented
May 5, 2021
Hi 👋 |
nicolaskruchten
commented
May 5, 2021
I'm aiming for the end of the month, give or take. |
nicolaskruchten
commented
May 31, 2021
I've just pushed |
jabbera
commented
Jun 1, 2021
working for me! |
koenlek
commented
Jun 2, 2021
Works like a charm for me too, thanks! |
^ @nicolaskruchten feedback |
nicolaskruchten
commented
Jun 7, 2021
@aiqc this package is known to sometimes take a long time to install but not mostly because of this extension as far as I know (it's because it has so many files I think, and is usually reported on Windows). @fcollonval question: I tried to |
fcollonval
commented
Jun 8, 2021
@nicolaskruchten I confirm the issue with the tarball. Neither the jupyterlab js assets, nor the classical notebook ones are copied. |
fcollonval
commented
Jun 8, 2021
This looks like the |
fcollonval
commented
Jun 8, 2021
Xref: #3231 |
nicolaskruchten
commented
Jun 21, 2021
This is now released as part of v5.0. Thanks again @fcollonval :) |
This PR:
plotly.graph_objects, my modifications concern thecodegenfiles and not generated files.modified existing tests.
new tutorial notebook (please see the doc checklist as well).