Using dependencies installed in prebuilt extension

Hi. How do I enforce the use of the dependencies installed in my prebuilt extension so that updates made in the dependencies take effect in JupyterLab with the extension installed? This is for use in a closed environment. Thank you.

It’s hard (for me) to understand exactly what you are asking. Can you give a specific example of what you would like to do?

One of the goals is to expose items() from the LauncherModel class through ILauncher ( @ jupyterlab/launcher) to make use of the method from within the extension. The other is to add ‘allow-scripts’ in the iframe sandbox of the HTMLViewer class ( @ jupyterlab/htmlviewer) so that Javascript content is trusted by default. Is it possiblel to make these changes in the installed dependencies under node_modules from within the extension? Thank you.

You won’t be able to change the core extension from another extension, but you can:

  • discuss and contribute changes upstream that allow you to do what you want (maybe it won’t be default, but perhaps you can contribute an option in the htmlviewer that you can change, for example for the allow-scripts attribute)
  • copy the extension, rename it, and override the core extension with your tweaked copy

Thank you for the feedback.

Alternatively, is it also feasible to build JupyterLab from source and make those updates in the core extensions in jupyterlab/staging/node_modules/ @ jupyterlab/* after building the core mode assets (jlpm run build:core) and before packaging JupyterLab up into a .whl file (python bdist_wheel)? Can we expect those updates to take effect after installing the JupyterLab Python wheel? Thank you.

It’s of course possible, but I would recommend it as not feasible in the long term to fork JupyterLab. The long term maintenance costs of maintaining, updating, compiling, and packaging your fork will likely be far greater than first trying to work with upstream jlab to introduce options to suit your usecase.