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 4 and Notebook 7 #1019

Merged
merged 102 commits into from Sep 13, 2023

Conversation

jtpio
Copy link
Member

@jtpio jtpio commented Mar 22, 2023

References

Fixes #826
Fixes #925
Fixes #262
Closes #457

Code changes

/**
* A plugin to open document in a new browser tab.
*
* TODO: remove and use a custom doc manager?
*/
const docmanager: JupyterFrontEndPlugin<void> = {
id: '@jupyterlite/retro-application-extension:docmanager',
requires: [IDocumentManager],
autoStart: true,
activate: (app: JupyterFrontEnd, docManager: IDocumentManager) => {
const baseUrl = PageConfig.getBaseUrl();
// patch the `docManager.open` option to prevent the default behavior
const docOpen = docManager.open;
docManager.open = (
path: string,
widgetName = 'default',
kernel?: Partial<Kernel.IModel>,
options?: DocumentRegistry.IOpenOptions
): IDocumentWidget | undefined => {
const ref = options?.ref;
if (ref === '_noref') {
docOpen.call(docManager, path, widgetName, kernel, options);
return;
}
const ext = PathExt.extname(path);
const route = ext === '.ipynb' ? 'notebooks' : 'edit';
window.open(`${baseUrl}retro/${route}?path=${path}`);
return undefined;
};
},
};

image

JupyterLab extensions to update to JupyterLab 4

User-facing changes

Maybe user facing changes are similar to the JupyterLab 4 and Notebook 7 changes:

Backwards-incompatible changes

Same as JupyterLab 4 for extension authors.

Follow-ups

@github-actions
Copy link
Contributor

lite-badge 👈 Try it on ReadTheDocs

@jtpio
Copy link
Member Author

jtpio commented Mar 22, 2023

Opening early mostly to find potential issues with the lab 4 and notebook 7 pre-releases before they enter beta and rc phases.

Still planning to cut a 0.1.0 out soon, based on JupyterLab 3.5.x and RetroLab packages (#383).

@jtpio jtpio added this to the 0.2.0 milestone Mar 22, 2023
@jtpio jtpio added the enhancement New feature or request label Mar 22, 2023
@jtpio jtpio force-pushed the jupyterlab-4-notebook-7 branch 4 times, most recently from f3a5d4e to 6a15c8b Compare August 2, 2023 17:12
@jtpio jtpio force-pushed the jupyterlab-4-notebook-7 branch 6 times, most recently from d425fcb to 1d1bf40 Compare August 4, 2023 16:42
@jtpio jtpio force-pushed the jupyterlab-4-notebook-7 branch 3 times, most recently from 6a4be60 to b1df3e0 Compare August 21, 2023 09:10
@jtpio
Copy link
Member Author

jtpio commented Sep 12, 2023

Made a couple of edits based on the suggestions above.

Some remaining suggestions are not strictly related to the update to the lab 4 and notebook 7 packages and could be addressed as follow-ups.

I would like to proceed with the merge of this PR and release a first 0.2.0a0 to unblock @trungleduc, @martinRenou and @hbcarlos who are waiting for packages to be published so they can update downstreams like Voici and RTC.

@bollwyvl
Copy link
Collaborator

unblock

Welp, we did set it up so they can already get started with a manual download of the wheels:

https://jupyterlite--1019.org.readthedocs.build/en/1019/_static/jupyterlite_core-0.1.2-py3-none-any.whl
https://jupyterlite--1019.org.readthedocs.build/en/1019/_static/jupyterlite-0.1.2-py3-none-any.whl

But of course all the npm .tgz are not available. Guess we could hoist those to RTD, too.

Will take a look at some more of the code changes, but from test driving on RTD:

Hard blockers:

  • running kernels sidebar don't update
    • meaning there's no UI way to kill one
    • but probably indicative of something deeper
    • after opening a bunch of notebooks, the service worker basically dies
      • Uncaught (in promise) DOMException: Failed to execute 'put' on 'Cache': Quota exceeded.
      • at that point, you can't open/save anything anymore, even after reloading the page
        • requires a new (private) browser
  • all notebooks are rendering with extra newlines
    • this actually breaks notebooks like ipycanvas, where there are long multiline strings
  • sometimes saving (maybe just opening?) notebooks creates duplicates in the file browser

Core stuff:

  • 404 for at least one config
_static/api/config/jupyterlabapputilsextensionannouncements
  • mathjax missing fonts for rendered outputs (js notebook)
_static/lab/js/output/chtml/fonts/tex-woff-v2/MathJax_Zero.woff
  • still appears to draw, but might have extra FLoUC
  • cell toolbar appears to be throwing more errors than before
celltoolbartracker.js:239 Uncaught TypeError: Cannot read properties of undefined (reading 'node'
  • toc is throwing errors
toc.js:486 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'type')

Extension stuff:

  • jupyterlab-kernelspy can probably be bumped to a compatible version
    • current one is broken in a deep lumino vdom spot, gets blank sidebar
    • if not working, i guess pull for now...
  • altair notebook throws a bunch of deprecation warnings
  • the ipyvue widgets don't have matching kernel/extension packages and appear about 50% broken
    • but still cost a few mb of downloads on page load, plus the 11mb of donwload at kernel start
  • leaflet can't find mathjax
    • this appears to fire pretty early, so breaks more than just mathjax

@jtpio
Copy link
Member Author

jtpio commented Sep 12, 2023

But of course all the npm .tgz are not available. Guess we could hoist those to RTD, too.

This is not going to help if the downstreams also want to make pre-releases.

Hard blockers:

Not sure they are all hard blockers for a first alpha release...

all notebooks are rendering with extra newlines

Yeah also noticed that one, which might look similar to jupyter/notebook#7002.

@jtpio
Copy link
Member Author

jtpio commented Sep 12, 2023

Some of the Mathjax / ipywidgets issues might be related to jupyter-widgets/ipywidgets#3829

@jtpio
Copy link
Member Author

jtpio commented Sep 12, 2023

running kernels sidebar don't update

That one might be related to jupyterlab/jupyterlab#14962, or jupyterlab/jupyterlab#13792 / jupyterlab/jupyterlab#13851.

@bollwyvl
Copy link
Collaborator

Some quick findings on RTD:

/tree/:

  • opening/creating any file breaks on RTD (no trailing slash)

/notebook/:

  • broken busy favicon
    • https://jupyterlite--1019.org.readthedocs.build/static/favicons/favicon-busy-1.ico

@jtpio jtpio mentioned this pull request Sep 13, 2023
14 tasks
@jtpio
Copy link
Member Author

jtpio commented Sep 13, 2023

Opened #1141 to track follow-ups and remaining issues.

I'll look into these issues right after. And also planning to make a first 0.2.0a0 release today to unblock other streams of work.

Thanks all for the reviews!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
4 participants