Skip to content

Commit

Permalink
Update to Voila 0.5.0a3 (#44)
Browse files Browse the repository at this point in the history
* Update to the latest Voila

* Fix TypeScript

* bump in environment.yml

* update the widget manager
  • Loading branch information
jtpio authored Mar 23, 2023
1 parent d91ebde commit d73c5c3
Show file tree
Hide file tree
Showing 8 changed files with 1,054 additions and 100 deletions.
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies:
- yarn=1
- flake8
- pip:
- voila>=0.5.0a2,<0.6.0
- voila>=0.5.0a3,<0.6.0
- voila-material>=0.4.3
- jupyterlite-core[lab]>=0.1.0b20,<0.2.0
- jupyterlite-xeus-python >= 0.7.0
2 changes: 1 addition & 1 deletion packages/voici/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@lumino/signaling": "^1.7.2",
"@lumino/virtualdom": "^1.11.2",
"@lumino/widgets": "^1.26.2",
"@voila-dashboards/voila": "^0.5.0-alpha.1",
"@voila-dashboards/voila": "^0.5.0-alpha.3",
"react": "^17.0.1"
},
"devDependencies": {
Expand Down
23 changes: 19 additions & 4 deletions packages/voici/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,19 @@ import {
standardRendererFactories,
} from '@jupyterlab/rendermime';
import { IShell, VoilaShell } from '@voila-dashboards/voila';
import { VoiciWidgetManager } from './manager';
import { IKernelConnection } from '@jupyterlab/services/lib/kernel/kernel';
import { IKernelSpecs } from '@jupyterlite/kernel';
import {
KernelWidgetManager,
WidgetRenderer,
} from '@jupyter-widgets/jupyterlab-manager';
import { PromiseDelegate } from '@lumino/coreutils';
import { Widget } from '@lumino/widgets';

const PACKAGE = require('../package.json');

const WIDGET_MIMETYPE = 'application/vnd.jupyter.widget-view+json';

/**
* App is the main application class. It is instantiated once and shared.
*/
Expand Down Expand Up @@ -64,7 +69,7 @@ export class VoiciApp extends JupyterFrontEnd<IShell> {
/**
* A promise that resolves when the Voici Widget Manager is created
*/
get widgetManagerPromise(): PromiseDelegate<VoiciWidgetManager> {
get widgetManagerPromise(): PromiseDelegate<KernelWidgetManager> {
return this._widgetManagerPromise;
}

Expand Down Expand Up @@ -207,7 +212,17 @@ export class VoiciApp extends JupyterFrontEnd<IShell> {
});

// Create Voila widget manager
const widgetManager = new VoiciWidgetManager(kernel, rendermime);
const widgetManager = new KernelWidgetManager(kernel, rendermime);
rendermime.removeMimeType(WIDGET_MIMETYPE);
rendermime.addFactory(
{
safe: false,
mimeTypes: [WIDGET_MIMETYPE],
createRenderer: (options) =>
new WidgetRenderer(options, widgetManager),
},
-10
);
this._widgetManagerPromise.resolve(widgetManager);
if (!connection.kernel) {
return;
Expand Down Expand Up @@ -238,7 +253,7 @@ export class VoiciApp extends JupyterFrontEnd<IShell> {

private _serviceManager?: ServiceManager;
private _kernelspecs?: IKernelSpecs;
private _widgetManagerPromise = new PromiseDelegate<VoiciWidgetManager>();
private _widgetManagerPromise = new PromiseDelegate<KernelWidgetManager>();
}

/**
Expand Down
5 changes: 4 additions & 1 deletion packages/voici/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ import { loadComponent, createModule, activePlugins } from './utils';

const serverExtensions = [import('@jupyterlite/server-extension')];

const disabled = ['@jupyter-widgets/jupyterlab-manager'];
const disabled = [
'@jupyter-widgets/jupyterlab-manager:plugin',
'@jupyter-widgets/jupyterlab-manager:saveWidgetState',
];

/**
* The main function
Expand Down
63 changes: 0 additions & 63 deletions packages/voici/src/manager.ts

This file was deleted.

5 changes: 4 additions & 1 deletion packages/voici/src/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ import { activePlugins, createModule, loadComponent } from './utils';

const serverExtensions = [import('@jupyterlite/server-extension')];

const disabled = ['@jupyter-widgets/jupyterlab-manager'];
const disabled = [
'@jupyter-widgets/jupyterlab-manager:plugin',
'@jupyter-widgets/jupyterlab-manager:saveWidgetState',
];

/**
* The main function
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
]
dependencies = [
"voila>=0.5.0a2,<0.6.0",
"voila>=0.5.0a3,<0.6.0",
"jupyterlite-core>=0.1.0b20,<0.2.0",
]
dynamic = [
Expand Down
Loading

0 comments on commit d73c5c3

Please sign in to comment.