Changes to jupyterlab source code are not getting reflected

I need to make some javascript changes to jupyterlab source code. I am modifying notebook-extension and couple other javascript packages. I am able to see the code changes while running jupyterlab with 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
cd jupyterlab
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.

  1. disable notebook-extension
  2. copy notebook-extension code and rename it to my-custom-extension, apply required code changes.
  3. 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 @my-company/my-custom-notebook npm-compatible package, which implements the same API as @jupyterlab/notebook, and then a pip package, e.g. jupyterlab-my-custom-notebook

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 package.json.

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.