-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Refactor JupyterLab JS extensions and package as federated extension #3142
Refactor JupyterLab JS extensions and package as federated extension #3142
Conversation
I pushed this PR as draft to get feedback early. |
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 |
Ok I got a first version - but the remaining errors raise two questions:
|
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 :) |
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 :) |
Thinking a bit more about it; actually the CI is about testing python and not the JS. So we could implement a option like |
yes exactly. |
@fcollonval, thanks so much for working on this! A couple of general thoughts / questions:
|
Also: is this still compatible with how classic non-lab notebook gets access to the widget plugin/extension? |
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. |
Very cool, thanks for the explanation! I don't think |
Indeed you do I let you settle on the new name. Than I'm happy to update the PR with it. |
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. |
That will be safer indeed.
Yes the old installation mechanism is still supported in JupyterLab 3. So the new package will be compatible using
|
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? |
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 |
This is very exciting! Hopefully this lands soon :) Thanks for working on this! |
OK so I think we'd like to call the unified extension |
Also note: once #3160 lands you'll be able to merge master into this branch and have the CI go green again :) |
@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 |
@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
a6c6d99
Compare
I did indeed bump all versions to |
I'm lost. I created a fresh environment:
Then install your wheel => the plotly code worked |
And after installing |
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. |
(sorry, unintended close!) |
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 |
Hi 👋 |
I'm aiming for the end of the month, give or take. |
I've just pushed |
working for me! |
Works like a charm for me too, thanks! |
^ @nicolaskruchten feedback |
@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 |
@nicolaskruchten I confirm the issue with the tarball. Neither the jupyterlab js assets, nor the classical notebook ones are copied. |
This looks like the |
Xref: #3231 |
This is now released as part of v5.0. Thanks again @fcollonval :) |
This PR:
plotly.graph_objects
, my modifications concern thecodegen
files and not generated files.modified existing tests.
new tutorial notebook (please see the doc checklist as well).