From 01fc2dca2a01673311abbaf970e0a80ee1368299 Mon Sep 17 00:00:00 2001 From: Andrii Ieroshenko Date: Mon, 12 Feb 2024 17:27:50 -0800 Subject: [PATCH] Fix translator usage, remove @jupyterlab/rendermime-interfaces dependency (#483) --- package.json | 1 - src/index.tsx | 8 +-- yarn.lock | 137 -------------------------------------------------- 3 files changed, 4 insertions(+), 142 deletions(-) diff --git a/package.json b/package.json index 017453a37..935de5a58 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,6 @@ "@jupyterlab/coreutils": "^6", "@jupyterlab/filebrowser": "^4", "@jupyterlab/launcher": "^4", - "@jupyterlab/rendermime-interfaces": "^3.8.0", "@jupyterlab/services": "^7", "@jupyterlab/translation": "^4", "@jupyterlab/ui-components": "^4", diff --git a/src/index.tsx b/src/index.tsx index 943fddf16..5ab16a57d 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -12,7 +12,6 @@ import { import { FileBrowser, IFileBrowserFactory } from '@jupyterlab/filebrowser'; import { ILauncher } from '@jupyterlab/launcher'; import { INotebookTracker } from '@jupyterlab/notebook'; -import { IRenderMime } from '@jupyterlab/rendermime-interfaces'; import { Contents, ServerConnection } from '@jupyterlab/services'; import { ITranslator } from '@jupyterlab/translation'; @@ -52,8 +51,9 @@ type EventLog = { */ async function verifyServerExtension(props: { api: SchedulerService; - trans: IRenderMime.TranslationBundle; + translator: ITranslator; }) { + const trans = props.translator.load('jupyterlab'); try { await props.api.getJobs({ max_items: 0 }); } catch (e: unknown) { @@ -63,7 +63,7 @@ async function verifyServerExtension(props: { e.response.status === 404 ) { showDialog({ - title: props.trans.__('Jupyter Scheduler server extension not found'), + title: trans.__('Jupyter Scheduler server extension not found'), body: SERVER_EXTENSION_404_JSX, buttons: [Dialog.okButton()] }).catch(console.warn); @@ -176,7 +176,7 @@ function activatePlugin( ): void { const trans = translator.load('jupyterlab'); const api = new SchedulerService({}); - verifyServerExtension({ api, trans }); + verifyServerExtension({ api, translator }); const { commands } = app; const fileBrowserTracker = browserFactory.tracker; diff --git a/yarn.lock b/yarn.lock index 97f675ad2..39a4dfb24 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3775,16 +3775,6 @@ __metadata: languageName: node linkType: hard -"@jupyterlab/rendermime-interfaces@npm:^3.8.0": - version: 3.9.0 - resolution: "@jupyterlab/rendermime-interfaces@npm:3.9.0" - dependencies: - "@lumino/coreutils": ^1.11.0 || ^2.1.2 - "@lumino/widgets": ^1.37.2 || ^2.3.1 - checksum: 462f5d034cd636caf9322245a50045ddaac55e05e056e7c6579e2db55088e724c8054a51a959aa284c44b108a9e0f0053707b50d6d8a9caed5825eeaf715b245 - languageName: node - linkType: hard - "@jupyterlab/rendermime-interfaces@npm:^3.8.3": version: 3.8.3 resolution: "@jupyterlab/rendermime-interfaces@npm:3.8.3" @@ -3829,7 +3819,6 @@ __metadata: "@jupyterlab/coreutils": ^6 "@jupyterlab/filebrowser": ^4 "@jupyterlab/launcher": ^4 - "@jupyterlab/rendermime-interfaces": ^3.8.0 "@jupyterlab/services": ^7 "@jupyterlab/testutils": ^4 "@jupyterlab/translation": ^4 @@ -4190,13 +4179,6 @@ __metadata: languageName: node linkType: hard -"@lumino/algorithm@npm:^2.0.1": - version: 2.0.1 - resolution: "@lumino/algorithm@npm:2.0.1" - checksum: cbf7fcf6ee6b785ea502cdfddc53d61f9d353dcb9659343511d5cd4b4030be2ff2ca4c08daec42f84417ab0318a3d9972a17319fa5231693e109ab112dcf8000 - languageName: node - linkType: hard - "@lumino/application@npm:^2.1.1": version: 2.2.0 resolution: "@lumino/application@npm:2.2.0" @@ -4217,15 +4199,6 @@ __metadata: languageName: node linkType: hard -"@lumino/collections@npm:^2.0.1": - version: 2.0.1 - resolution: "@lumino/collections@npm:2.0.1" - dependencies: - "@lumino/algorithm": ^2.0.1 - checksum: 8a29b7973a388a33c5beda0819dcd2dc2aad51a8406dcfd4581b055a9f77a39dc5800f7a8b4ae3c0bb97ae7b56a7a869e2560ffb7a920a28e93b477ba05907d6 - languageName: node - linkType: hard - "@lumino/commands@npm:^2.1.1, @lumino/commands@npm:^2.1.2": version: 2.1.2 resolution: "@lumino/commands@npm:2.1.2" @@ -4241,21 +4214,6 @@ __metadata: languageName: node linkType: hard -"@lumino/commands@npm:^2.2.0": - version: 2.2.0 - resolution: "@lumino/commands@npm:2.2.0" - dependencies: - "@lumino/algorithm": ^2.0.1 - "@lumino/coreutils": ^2.1.2 - "@lumino/disposable": ^2.1.2 - "@lumino/domutils": ^2.0.1 - "@lumino/keyboard": ^2.0.1 - "@lumino/signaling": ^2.1.2 - "@lumino/virtualdom": ^2.0.1 - checksum: 093e9715491e5cef24bc80665d64841417b400f2fa595f9b60832a3b6340c405c94a6aa276911944a2c46d79a6229f3cc087b73f50852bba25ece805abd0fae9 - languageName: node - linkType: hard - "@lumino/coreutils@npm:^1.11.0 || ^2.0.0, @lumino/coreutils@npm:^1.11.0 || ^2.1.1, @lumino/coreutils@npm:^2, @lumino/coreutils@npm:^2.1.1": version: 2.1.1 resolution: "@lumino/coreutils@npm:2.1.1" @@ -4263,13 +4221,6 @@ __metadata: languageName: node linkType: hard -"@lumino/coreutils@npm:^1.11.0 || ^2.1.2, @lumino/coreutils@npm:^2.1.2": - version: 2.1.2 - resolution: "@lumino/coreutils@npm:2.1.2" - checksum: 7865317ac0676b448d108eb57ab5d8b2a17c101995c0f7a7106662d9fe6c859570104525f83ee3cda12ae2e326803372206d6f4c1f415a5b59e4158a7b81066f - languageName: node - linkType: hard - "@lumino/disposable@npm:^1.10.0 || ^2.0.0, @lumino/disposable@npm:^2.1.1": version: 2.1.1 resolution: "@lumino/disposable@npm:2.1.1" @@ -4279,15 +4230,6 @@ __metadata: languageName: node linkType: hard -"@lumino/disposable@npm:^2.1.2": - version: 2.1.2 - resolution: "@lumino/disposable@npm:2.1.2" - dependencies: - "@lumino/signaling": ^2.1.2 - checksum: ac2fb2bf18d0b2939fda454f3db248a0ff6e8a77b401e586d1caa9293b3318f808b93a117c9c3ac27cd17aab545aea83b49108d099b9b2f5503ae2a012fbc6e2 - languageName: node - linkType: hard - "@lumino/domutils@npm:^2.0.0": version: 2.0.0 resolution: "@lumino/domutils@npm:2.0.0" @@ -4295,13 +4237,6 @@ __metadata: languageName: node linkType: hard -"@lumino/domutils@npm:^2.0.1": - version: 2.0.1 - resolution: "@lumino/domutils@npm:2.0.1" - checksum: 61fa0ab226869dfbb763fc426790cf5a43b7d6f4cea1364c6dd56d61c44bff05eea188d33ff847449608ef58ed343161bee15c19b96f35410e4ee35815dc611a - languageName: node - linkType: hard - "@lumino/dragdrop@npm:^2.1.1, @lumino/dragdrop@npm:^2.1.2": version: 2.1.2 resolution: "@lumino/dragdrop@npm:2.1.2" @@ -4312,16 +4247,6 @@ __metadata: languageName: node linkType: hard -"@lumino/dragdrop@npm:^2.1.4": - version: 2.1.4 - resolution: "@lumino/dragdrop@npm:2.1.4" - dependencies: - "@lumino/coreutils": ^2.1.2 - "@lumino/disposable": ^2.1.2 - checksum: 43d82484b13b38b612e7dfb424a840ed6a38d0db778af10655c4ba235c67b5b12db1683929b35a36ab2845f77466066dfd1ee25c1c273e8e175677eba9dc560d - languageName: node - linkType: hard - "@lumino/keyboard@npm:^2.0.0": version: 2.0.0 resolution: "@lumino/keyboard@npm:2.0.0" @@ -4329,13 +4254,6 @@ __metadata: languageName: node linkType: hard -"@lumino/keyboard@npm:^2.0.1": - version: 2.0.1 - resolution: "@lumino/keyboard@npm:2.0.1" - checksum: cf33f13427a418efd7cc91061233321e860d5404f3d86397781028309bef86c8ad2d88276ffe335c1db0fe619bd9d1e60641c81f881696957a58703ee4652c3e - languageName: node - linkType: hard - "@lumino/messaging@npm:^2.0.0": version: 2.0.0 resolution: "@lumino/messaging@npm:2.0.0" @@ -4346,16 +4264,6 @@ __metadata: languageName: node linkType: hard -"@lumino/messaging@npm:^2.0.1": - version: 2.0.1 - resolution: "@lumino/messaging@npm:2.0.1" - dependencies: - "@lumino/algorithm": ^2.0.1 - "@lumino/collections": ^2.0.1 - checksum: 964c4651c374b17452b4252b7d71500b32d2ecd87c192fc5bcf5d3bd1070661d78d07edcac8eca7d1d6fd50aa25992505485e1296d6dd995691b8e349b652045 - languageName: node - linkType: hard - "@lumino/polling@npm:^2, @lumino/polling@npm:^2.1.1": version: 2.1.1 resolution: "@lumino/polling@npm:2.1.1" @@ -4374,13 +4282,6 @@ __metadata: languageName: node linkType: hard -"@lumino/properties@npm:^2.0.1": - version: 2.0.1 - resolution: "@lumino/properties@npm:2.0.1" - checksum: c50173a935148cc4148fdaea119df1d323ee004ae16ab666800388d27e9730345629662d85f25591683329b39f0cdae60ee8c94e8943b4d0ef7d7370a38128d6 - languageName: node - linkType: hard - "@lumino/signaling@npm:^1.10.0 || ^2.0.0, @lumino/signaling@npm:^2, @lumino/signaling@npm:^2.1.1": version: 2.1.1 resolution: "@lumino/signaling@npm:2.1.1" @@ -4391,16 +4292,6 @@ __metadata: languageName: node linkType: hard -"@lumino/signaling@npm:^2.1.2": - version: 2.1.2 - resolution: "@lumino/signaling@npm:2.1.2" - dependencies: - "@lumino/algorithm": ^2.0.1 - "@lumino/coreutils": ^2.1.2 - checksum: ad7d7153db57980da899c43e412e6130316ef30b231a70250e7af49058db16cadb018c1417a2ea8083d83c48623cfe6b705fa82bf10216b1a8949aed9f4aca4e - languageName: node - linkType: hard - "@lumino/virtualdom@npm:^2.0.0": version: 2.0.0 resolution: "@lumino/virtualdom@npm:2.0.0" @@ -4410,15 +4301,6 @@ __metadata: languageName: node linkType: hard -"@lumino/virtualdom@npm:^2.0.1": - version: 2.0.1 - resolution: "@lumino/virtualdom@npm:2.0.1" - dependencies: - "@lumino/algorithm": ^2.0.1 - checksum: cf59b6f15b430e13e9e657b7a0619b9056cd9ea7b2a87f407391d071c501b77403c302b6a66dca510382045e75b2e3fe551630bb391f1c6b33678057d4bec164 - languageName: node - linkType: hard - "@lumino/widgets@npm:^1.37.2 || ^2.1.1, @lumino/widgets@npm:^2, @lumino/widgets@npm:^2.1.1, @lumino/widgets@npm:^2.2.0": version: 2.2.0 resolution: "@lumino/widgets@npm:2.2.0" @@ -4438,25 +4320,6 @@ __metadata: languageName: node linkType: hard -"@lumino/widgets@npm:^1.37.2 || ^2.3.1": - version: 2.3.1 - resolution: "@lumino/widgets@npm:2.3.1" - dependencies: - "@lumino/algorithm": ^2.0.1 - "@lumino/commands": ^2.2.0 - "@lumino/coreutils": ^2.1.2 - "@lumino/disposable": ^2.1.2 - "@lumino/domutils": ^2.0.1 - "@lumino/dragdrop": ^2.1.4 - "@lumino/keyboard": ^2.0.1 - "@lumino/messaging": ^2.0.1 - "@lumino/properties": ^2.0.1 - "@lumino/signaling": ^2.1.2 - "@lumino/virtualdom": ^2.0.1 - checksum: ba7b8f8839c1cd2a41dbda13281094eb6981a270cccf4f25a0cf83686dcc526a2d8044a20204317630bb7dd4a04d65361408c7623a921549c781afca84b91c67 - languageName: node - linkType: hard - "@mui/base@npm:5.0.0-alpha.98": version: 5.0.0-alpha.98 resolution: "@mui/base@npm:5.0.0-alpha.98"