Skip to content

Commit dc3ab3e

Browse files
committed
Update docs on other extensions category
1 parent 6667d0e commit dc3ab3e

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

docs/other_extensions.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,37 @@ and, finally, add `patch-package` as a dependency:
147147
```
148148
jlpm add patch-package
149149
```
150+
151+
## Additional configurations
152+
153+
You will need to request the `jupyterlab-blockly` package as a dependency of your extension, in order to ensure it is installed and available to provide the token `IBlocklyRegistry`. To do this, you need to add the following line to your `setup.py` file.
154+
155+
```python
156+
// setup.py : 57
157+
158+
setup_args = dict(
159+
...
160+
install_requires=['jupyterlab-blockly>=0.1.1,<0.2']
161+
...
162+
)
163+
```
164+
165+
Moreover, as we are working with deduplication of dependencies and the extension you are creating requires a service identified by a token from `jupyterlab-blockly`, you need to add the following configuration to your `package.json` file.
166+
167+
```
168+
// package.json : 88-101
169+
170+
"jupyterlab": {
171+
"sharedPackages": {
172+
"jupyterlab-blockly": {
173+
"bundled": false,
174+
"singleton": true
175+
},
176+
"blockly": {
177+
"bundled": false,
178+
"singleton": true
179+
}
180+
}
181+
}
182+
```
183+
This ensures your extension will get the exact same token the provider is using to identify the service and exclud it from its bundle as the provider will give a copy of the token. You can read more about deduplication of dependencies [here](https://jupyterlab.readthedocs.io/en/stable/extension/extension_dev.html#deduplication-of-dependencies), in the official Extension Developer Guide for JupyterLab.

0 commit comments

Comments
 (0)