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

Issue when loading settings from federated extensions #1213

Closed
jtpio opened this issue Oct 16, 2023 · 7 comments · Fixed by #1220
Closed

Issue when loading settings from federated extensions #1213

jtpio opened this issue Oct 16, 2023 · 7 comments · Fixed by #1220
Assignees
Labels
bug Something isn't working
Milestone

Comments

@jtpio
Copy link
Member

jtpio commented Oct 16, 2023

Description

Currently the JupyterLab app is missing a menu entry to open Notebook 7 in a new browser tab.

Reproduce

On https://jupyterlite.readthedocs.io/en/latest/_static/lab/index.html :

image

Expected behavior

It should be possible to open Notebook 7 from JupyterLab like with JupyterLite 0.1.x using RetroLab:

image

But using the existing Notebook 7 extension that adds the following menu entry:

image

Context

Follow-up to #1019.

@jtpio jtpio added the bug Something isn't working label Oct 16, 2023
@jtpio jtpio added this to the 0.2.0 milestone Oct 16, 2023
@jtpio
Copy link
Member Author

jtpio commented Oct 16, 2023

Installing the notebook package and running jupyter lite build correctly includes @jupyter-notebook/lab-extension in jupyter-lite.json:

{
  "extension": "./extension",
  "liteExtension": false,
  "load": "static/remoteEntry.749fd42299b69250a475.js",
  "name": "@jupyter-notebook/lab-extension",
  "style": "./style"
}

The commands are available in the command palette, but the menu and toolbar items are missing:

image

So there might be a more general issue of loading settings from a federated extension (to be confirmed).

@jtpio jtpio self-assigned this Oct 18, 2023
@jtpio
Copy link
Member Author

jtpio commented Oct 18, 2023

So there might be a more general issue of loading settings from a federated extension (to be confirmed).

Looking more into it, there does seem to be a more general issue with toolbar items and menu entries (defined via the settings). This is for example reproducible with https://github.com/jupyterlab/extension-examples/tree/main/toolbar-button.

For now not sure if it's related to a upstream change in JupyterLab 4 w.r.t how the settings are loaded. Next step would be confirm that settings based items and menu entries used to work fine in JupyterLite 0.1.0 built on JupyterLab 3.

@jtpio
Copy link
Member Author

jtpio commented Oct 18, 2023

Next step would be confirm that settings based items and menu entries used to work fine in JupyterLite 0.1.0 built on JupyterLab 3.

Yes it works fine in 0.1.3:

image

So this is likely due to a change in JupyterLab 4.0.

@jtpio
Copy link
Member Author

jtpio commented Oct 18, 2023

Maybe related to jupyterlab/jupyterlab#14195 ?

@jtpio jtpio changed the title Add back "Launch Jupyter Notebook file browser" menu entry Fix loading settings from federated settings Oct 19, 2023
@jtpio jtpio changed the title Fix loading settings from federated settings Issue when loading settings from federated settings Oct 19, 2023
@jtpio jtpio changed the title Issue when loading settings from federated settings Issue when loading settings from federated extensions Oct 19, 2023
@jtpio
Copy link
Member Author

jtpio commented Oct 19, 2023

JupyterLab 4 now seems to be expecting all settings to be returned in one call at application startup.

I guess we can work around that in JupyterLite by moving (or just copying) the schemas directories to the single all.json at jupyter lite build (via the federated extensions addon).

Another option would have been to aggregate all the settings from federated extensions at runtime via PageConfig.getOption('federated_extensions'). But there is no metadata that lists all the available settings for a federated extension (no all.json). So it looks we would need to add a build step anyway.

In the future this might be an issue for deployments setups that would like to load extensions from a CDN or other hosts, since these extensions and their settings would not be known by the application at startup.

@bollwyvl
Copy link
Collaborator

like to load extensions from a CDN

yeah, i wouldn't worry too much about that case until someone shows up with a concrete issue... there are so many cases of extension code constructing URLs from baseUrl instead of webpack assets/loaders that a large chunk of extensions wouldn't even work, or would fail in mysterious ways.

@jtpio
Copy link
Member Author

jtpio commented Oct 19, 2023

This is tracked upstream and would indeed likely require some other changes anyway: jupyterlab/jupyterlab#8866

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants