Skip to content

Commit 40891bd

Browse files
authored
Support ServiceManagerPlugin (#7616)
1 parent ab63d5c commit 40891bd

File tree

3 files changed

+30
-3
lines changed

3 files changed

+30
-3
lines changed

app/index.template.js

+14-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
import { PageConfig, URLExt } from '@jupyterlab/coreutils';
77

8+
import { PluginRegistry } from '@lumino/coreutils';
9+
810
require('./style.js');
911
require('./extraStyle.js');
1012

@@ -213,10 +215,20 @@ async function main() {
213215
// plugin even if the debugger is only loaded on the notebook page.
214216
PageConfig.setOption('allPlugins', '{{{ json notebook_plugins }}}');
215217

218+
219+
const pluginRegistry = new PluginRegistry();
216220
const NotebookApp = require('@jupyter-notebook/application').NotebookApp;
217-
const app = new NotebookApp({ mimeExtensions, availablePlugins });
218221

219-
app.registerPluginModules(mods);
222+
pluginRegistry.registerPlugins(mods);
223+
const IServiceManager = require('@jupyterlab/services').IServiceManager;
224+
const serviceManager = await pluginRegistry.resolveRequiredService(IServiceManager);
225+
226+
const app = new NotebookApp({
227+
pluginRegistry,
228+
serviceManager,
229+
mimeExtensions,
230+
availablePlugins
231+
});
220232

221233
// Expose global app instance when in dev mode or when toggled explicitly.
222234
const exposeAppInBrowser =

app/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@
169169
"@jupyterlab/pdf-extension": "~4.4.0-beta.2",
170170
"@jupyterlab/pluginmanager-extension": "~4.4.0-beta.2",
171171
"@jupyterlab/running-extension": "~4.4.0-beta.2",
172+
"@jupyterlab/services-extension": "~4.4.0-beta.2",
172173
"@jupyterlab/settingeditor": "~4.4.0-beta.2",
173174
"@jupyterlab/settingeditor-extension": "~4.4.0-beta.2",
174175
"@jupyterlab/shortcuts-extension": "~5.2.0-beta.2",
@@ -181,6 +182,7 @@
181182
"@jupyterlab/translation-extension": "~4.4.0-beta.2",
182183
"@jupyterlab/ui-components-extension": "~4.4.0-beta.2",
183184
"@jupyterlab/vega5-extension": "~4.4.0-beta.2",
185+
"@lumino/coreutils": "~2.2.0",
184186
"react": "^18.2.0",
185187
"react-dom": "^18.2.0",
186188
"yjs": "^13.5.40"
@@ -296,6 +298,7 @@
296298
"@jupyterlab/notebook-extension:widget-factory"
297299
],
298300
"@jupyterlab/pluginmanager-extension": true,
301+
"@jupyterlab/services-extension": true,
299302
"@jupyterlab/shortcuts-extension": true,
300303
"@jupyterlab/terminal-extension": true,
301304
"@jupyterlab/theme-light-extension": true,

yarn.lock

+13-1
Original file line numberDiff line numberDiff line change
@@ -2179,6 +2179,7 @@ __metadata:
21792179
"@jupyterlab/pdf-extension": ~4.4.0-beta.2
21802180
"@jupyterlab/pluginmanager-extension": ~4.4.0-beta.2
21812181
"@jupyterlab/running-extension": ~4.4.0-beta.2
2182+
"@jupyterlab/services-extension": ~4.4.0-beta.2
21822183
"@jupyterlab/settingeditor": ~4.4.0-beta.2
21832184
"@jupyterlab/settingeditor-extension": ~4.4.0-beta.2
21842185
"@jupyterlab/shortcuts-extension": ~5.2.0-beta.2
@@ -2191,6 +2192,7 @@ __metadata:
21912192
"@jupyterlab/translation-extension": ~4.4.0-beta.2
21922193
"@jupyterlab/ui-components-extension": ~4.4.0-beta.2
21932194
"@jupyterlab/vega5-extension": ~4.4.0-beta.2
2195+
"@lumino/coreutils": ~2.2.0
21942196
"@types/rimraf": ^3.0.2
21952197
css-loader: ~5.0.1
21962198
extra-watch-webpack-plugin: ^1.0.3
@@ -4454,6 +4456,16 @@ __metadata:
44544456
languageName: node
44554457
linkType: hard
44564458

4459+
"@jupyterlab/services-extension@npm:~4.4.0-beta.2":
4460+
version: 4.4.0-beta.2
4461+
resolution: "@jupyterlab/services-extension@npm:4.4.0-beta.2"
4462+
dependencies:
4463+
"@jupyterlab/services": ^7.4.0-beta.2
4464+
"@lumino/coreutils": ^2.2.0
4465+
checksum: bdc141b91af525ec33cfa6f767a93e3cd6c0663afc65314e262779501a66e4cbba56a523e168916d5aab39daa6c92b406e773a68a91f9c451d4aedc954172084
4466+
languageName: node
4467+
linkType: hard
4468+
44574469
"@jupyterlab/services@npm:^7.3.4":
44584470
version: 7.3.4
44594471
resolution: "@jupyterlab/services@npm:7.3.4"
@@ -5281,7 +5293,7 @@ __metadata:
52815293
languageName: node
52825294
linkType: hard
52835295

5284-
"@lumino/coreutils@npm:^1.11.0 || ^2.0.0, @lumino/coreutils@npm:^1.11.0 || ^2.2.0, @lumino/coreutils@npm:^2.2.0":
5296+
"@lumino/coreutils@npm:^1.11.0 || ^2.0.0, @lumino/coreutils@npm:^1.11.0 || ^2.2.0, @lumino/coreutils@npm:^2.2.0, @lumino/coreutils@npm:~2.2.0":
52855297
version: 2.2.0
52865298
resolution: "@lumino/coreutils@npm:2.2.0"
52875299
dependencies:

0 commit comments

Comments
 (0)