From 5c5eb9a94ec4a94ad434c469bfecaeb6382127a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Palmeiro?= Date: Thu, 19 Dec 2024 11:11:20 +0000 Subject: [PATCH 1/2] Document the command to launch JupyterLab and watch for changes to the backend code for server extensions --- server-extension/README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/server-extension/README.md b/server-extension/README.md index 19fca889..e936de88 100644 --- a/server-extension/README.md +++ b/server-extension/README.md @@ -565,7 +565,7 @@ done using [hatch](https://hatch.pypa.io/) builder with some additional plugins: - [hatch-jupyter-builder](https://github.com/jupyterlab/hatch-jupyter-builder/): Builder plugin to build Jupyter JavaScript assets as part of the Python package. Its configuration is done in `pyproject.toml`: -``` +```toml # pyproject.toml [build-system] @@ -758,6 +758,18 @@ And that server extension is available through `pip`: For more information on the `discovery` metadata, please refer to the [documentation](https://jupyterlab.readthedocs.io/en/stable/extension/extension_dev.html#ext-author-companion-packages). +## Development + +While developing your server extension, you can run JupyterLab and enable server reloading using the following command: + +```bash +jupyter lab --autoreload --no-browser +``` + +This way, every time there is a change to the backend (server) code, JupyterLab is automatically relaunched, picking up the most recent changes. + +The `--no-browser` flag is optional, but it helps prevent a new browser tab from opening each time JupyterLab is launched. + ## Installing the Package With the packaging described above, installing the extension is done in one command once the package is published on pypi.org: From 280037c4ddeb7f4a3efb64691a2a1d3b03de3a6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Palmeiro?= Date: Thu, 19 Dec 2024 11:14:55 +0000 Subject: [PATCH 2/2] Add missing ToC entry --- server-extension/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/server-extension/README.md b/server-extension/README.md index e936de88..75a8da48 100644 --- a/server-extension/README.md +++ b/server-extension/README.md @@ -14,6 +14,7 @@ example before diving into this one. - [Packaging the Extension](#packaging-the-extension) - [Python Package Manager](#python-package-manager) - [JupyterLab Extension Manager](#jupyterlab-extension-manager) + - [Development](#development) - [Installing the Package](#installing-the-package) ## The template folder structure