This repository is a temporary playground for implementing a new JupyterLab extension system that utilizes the Module Federation capabilities in WebPack 5.
We will be making PRs to jupyterlab_server
and jupyterlab
once this work is stable.
See https://github.com/jupyterlab/jupyterlab/issues/7468 for full background and discussion.
Prereqs: python 3.5+
and nodejs
To build:
bash install.sh
To run:
python main.py
node
or a build steppip install --user
workslabextensions build
Python script that is used to build bundles
pip
/conda
)remoteEntry.js
, generated bundles, and some other files that we use
package.orig.json
is the original package.json
file that we use to gather metadata about the packagebuild_log.json
has all of the webpack options used to build the extension, for debugging purposes@jupyterlab/buildutils -> build
to generate the imports.css
, schemas
and themes
file structurejupyterlab
metadata for an extension's package.json
describing the available optionslabextensions
handler in jupyterlab_server
that loads static assets from labextensions
paths, following a similar logic to how nbextensions
are discovered and loaded from disksettings
and themes
handlers in jupyterlab_server
to load from the new labextensions
locations, favoring the dynamic extension locations over the bundled oneslabextension develop
command used to install an in-development extension into JupyterLab. The default behavior is to create a symlink in the sys-prefix/share/jupyter/labextensions/package-name
to the static directory of the extensioncookiecutter
that handles all of the scaffolding for an extension author, including the shipping of data_files
so that when the user installs the package, the static assets end up in share/jupyter/labextensions
LabApp
class, so it can be set by admins and overridden by users. Extensions are automatically enabled when installed, and must be explicitly disabled. The disabled config can consist of a package name or a plugin regex patterndisabled
metadata that can be used to replace an entire extension or individual pluginspage_config
and overrides
are also handled with traits so that admins can provide defaults and users can provide overridesextension-manager
to target metadata on pypi
/conda
and consume those packages.jupyter labexension build
python command line tooljupyter labextension develop
python command line toolcookiecutter
for extension authorscookiecutter
to create the extensionjupyter labextension develop
to build and symlink the filesjupyter labextension watch
to start watchingjupyter lab
pypi
/conda