

The buildExtension function is not sufficient to build the extension. Custom WebPack Configuration and JupyterLabPluginĪ completely custom WebPack configuration may be needed if there is a case where The loader in JupyterLab provides an ensureBundle()įunction to load a particular bundle or bundles prior to calling require() sharing of module-private state between different consumers, such as a list of client-side running kernels in client-side require() calls are synchronous, which means that the bundlesĬontaining the define() modules must be loaded prior to using any of theīundles' functions.being able to use instanceof() on an object to determine if it is the same class (a technique used by phosphor's drag-drop mechanism).The client-side lookup will still load the correct modules. Perform server-side deduplication of modules prior to serving the bundles, and The one returned by the require function call. Modules, where the registered module that maximally satisfies a semver range is Not listing an external dependency in the package metadata is a bad practiceīy using a semver range, JupyterLab can perform client-side deduplication of Otherwise the installed version of the dependency is used exactly.Then the semver range requested there is used. If the dependency is in the dependency list of the module's package.json,.The semver is the patch-level range ( ~) starting from the installed If the dependency is a local package (i.e., module given by file://.),.If the dependency is in the same package, the exact version of the dependency.GetModuleSemverPath function in plugin.ts: Semver range is determined by the following criteria (see the
GET JUPYTERLAB EXTENSIONS FULL
Module is referenced by package name, semver range, and the full path to the Name, version number, and the full path to the module.
GET JUPYTERLAB EXTENSIONS REGISTRATION
JupyterLab's custom module registration and loading mechanism uses a defineįunction that registers modules by name, where the name contains the package WebPack are modified to use JupyterLab's custom module registration and loading The extension bundles are created using WebPack, and the modules produced by Order to be added to the JupyterLab application. TheĮxtension must also be registered, using the command jupyter labextension, in The entry point file(s) and entry point module(s) for the extension. My-cool-extension.js.manifest, are used by the JupyterLab server to determine The two files above, my-cool-extension.js and

Other extensions may produce additional files in the build directory depending In this case the builder script will create the following files in the build Several optional arguments are also available see the options at the bottom of the builder.ts file. The outputDir is the directory in which the generated plugin bundle, manifest, and related files will be stored. The entry is the module that exports a plugin definition or array of plugin definitions.

The name is a string that will be used for the output filename. Plugins defined here const plugins: JupyterlabPlugin = īuild the above example using the following script: var buildExtension = require( 'my-cool-extension', TypeScript): import from 'jupyterlab/lib/application' Pattern for multiple exports (remove the type declaration if not using If writing in ES6 format use the defaultĮxport syntax export default myPlugin for a single plugin, and the following

The extension entry point must be a CommonJS module where the defaultĮxport is an array of plugin objects. Extension entry pointĪ simple extension entry point that exposes a single application plugin could register the extension using jupyter labextension.Then execute an extension build with devtool Insert a debugger statement in the source where you want the execution to More advanced extensions may require additionalĬonfiguration such as custom loaders or WebPack plugins.Ī video tutorial walkthrough for building JupyterLab extensions can be found on YouTube. Simple extensions can be created by using the buildExtension function Third party extension JavaScript bundles. To streamline third-partyĭevelopment of extensions, this library provides a build script for generating One or more plugins to the JupyterLab application. A JupyterLab extension provides additional, optional functionality to
