dev-mode but these changes are not reflected when running without dev-mode. How can I build jupyterlab with my code changes so I can use it in production?
I am using following commands to build as mentioned in the docs.
git clone https://github.com/jupyterlab/jupyterlab.git
pip install -e .
jlpm run build:packages
You’ll need to emulate enough of the machinery to generate your own installable package, as your custom packages would be clobbered by the “real” ones. See this thread for some more discussion.
Another, far lighter-weight approach, would be to fork/extend the extensions in question, and build renamed packages which replace the core ones in the dependency injection stage at startup by specifying the
package.json#/jupyterlab/disabledExtensions keyword. This will allow you to install the upstream, and maintain (hopefully) a much smaller set of changes/workflows.
thanks @bollwyvl for the reply. I am pretty new to jupyerlab so please pardon my ignorance. Please correct if my understanding is wrong. Here are the steps I would follow to build JL with my custom JS patch.
- disable notebook-extension
- copy notebook-extension code and rename it to my-custom-extension, apply required code changes.
- build the code using usual process
Is that what I should do ?
If you’re dead-set on building from source, the initially linked-discussion is the thing to follow.
In the patching approach, the idea is not to build a new
jupyterlab 3.1.9.post1235 package pip package, but rather a
npm-compatible package, which implements the same API as
@jupyterlab/notebook, and then a
pip package, e.g.
I’d recommend following the whole cookiecutter, getting out a “dumb” hello world extension as a
pip installable package, then, as described in the link to the docs/schema, you’ll see where you can add
disabledExtensions to your
Eventually, then, you’d do something like
pip install jupyterlab jupyterlab-my-custom-notebook, and would be able to upgrade your
jupyterlab independently of your
jupyterlab… otherwise, you run the risk of users upgrading your jupyterlab and losing your changes.