Skip to content

Commit

Permalink
Bump jupyterlite (#96)
Browse files Browse the repository at this point in the history
* Bump jupyterlite

* Remove mathjax config

* Update to MathJax 3

* Update env

* Relax playwright test
  • Loading branch information
trungleduc authored Oct 31, 2023
1 parent 76d4993 commit c512c49
Show file tree
Hide file tree
Showing 10 changed files with 15,323 additions and 11,505 deletions.
1 change: 1 addition & 0 deletions demo/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ dependencies:
- pandas
- bqplot
- ipycanvas
- ipywidgets
6 changes: 3 additions & 3 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies:
- nodejs=18
- pip:
- ruff==0.0.258
- voila==0.5.4
- voila>=0.5.5
- voila-material>=0.4.3
- jupyterlite-core[lab]>=0.2.0a1,<0.3.0
- jupyterlite-xeus-python >= 1.0.0a0
- jupyterlite-core[lab]>=0.2.0,<0.3.0
- jupyterlite-xeus-python >= 1.0.0a3
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"build:test": "lerna run build:test",
"bump:js:version": "lerna version --no-push --force-publish --no-git-tag-version --yes",
"clean": "lerna run clean",
"eslint": "eslint . --ext .ts,.tsx,.js,.jsx --fix",
"eslint:check": "eslint . --ext .ts,.tsx,.js,.jsx",
"eslint": "eslint . --ext .ts,.tsx --fix",
"eslint:check": "eslint . --ext .ts,.tsx",
"prettier": "prettier --write \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"",
"prettier:check": "prettier --list-different \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"",
"test": "lerna run test"
Expand Down
60 changes: 30 additions & 30 deletions packages/voici/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,35 @@
"main": "lib/main.js",
"browserslist": ">0.8%, not ie 11, not op_mini all, not dead",
"dependencies": {
"@jupyter-widgets/base": "^6.0.5",
"@jupyter-widgets/jupyterlab-manager": "^5.0.8",
"@jupyterlab/application": "^4.0.0",
"@jupyterlab/apputils": "^4.0.0",
"@jupyterlab/apputils-extension": "^4.0.0",
"@jupyter-widgets/base": "^6.0.6",
"@jupyter-widgets/jupyterlab-manager": "^5.0.9",
"@jupyterlab/application": "^4.0.7",
"@jupyterlab/apputils": "^4.1.7",
"@jupyterlab/apputils-extension": "^4.0.7",
"@jupyterlab/coreutils": "^6.0.0",
"@jupyterlab/docregistry": "^4.0.0",
"@jupyterlab/json-extension": "^4.0.0",
"@jupyterlab/logconsole": "^4.0.0",
"@jupyterlab/mainmenu": "^4.0.0",
"@jupyterlab/markdownviewer-extension": "^4.0.0",
"@jupyterlab/mathjax2-extension": "^4.0.0",
"@jupyterlab/nbconvert-css": "^4.0.0",
"@jupyterlab/nbformat": "^4.0.0",
"@jupyterlab/notebook": "^4.0.0",
"@jupyterlab/outputarea": "^4.0.0",
"@jupyterlab/rendermime": "^4.0.0",
"@jupyterlab/rendermime-extension": "^4.0.0",
"@jupyterlab/services": "^7.0.0",
"@jupyterlab/settingregistry": "^4.0.0",
"@jupyterlab/theme-dark-extension": "^4.0.0",
"@jupyterlab/theme-light-extension": "^4.0.0",
"@jupyterlab/translation": "^4.0.0",
"@jupyterlab/ui-components": "^4.0.0",
"@jupyterlite/contents": "^0.2.0-alpha.1",
"@jupyterlite/iframe-extension": "^0.2.0-alpha.1",
"@jupyterlite/kernel": "^0.2.0-alpha.1",
"@jupyterlite/server": "^0.2.0-alpha.1",
"@jupyterlite/server-extension": "^0.2.0-alpha.1",
"@jupyterlab/docregistry": "^4.0.7",
"@jupyterlab/json-extension": "^4.0.7",
"@jupyterlab/logconsole": "^4.0.7",
"@jupyterlab/mainmenu": "^4.0.7",
"@jupyterlab/markdownviewer-extension": "^4.0.7",
"@jupyterlab/mathjax-extension": "^4.0.7",
"@jupyterlab/nbconvert-css": "^4.0.7",
"@jupyterlab/nbformat": "^4.0.7",
"@jupyterlab/notebook": "^4.0.7",
"@jupyterlab/outputarea": "^4.0.7",
"@jupyterlab/rendermime": "^4.0.7",
"@jupyterlab/rendermime-extension": "^4.0.7",
"@jupyterlab/services": "^7.0.7",
"@jupyterlab/settingregistry": "^4.0.7",
"@jupyterlab/theme-dark-extension": "^4.0.7",
"@jupyterlab/theme-light-extension": "^4.0.7",
"@jupyterlab/translation": "^4.0.7",
"@jupyterlab/ui-components": "^4.0.7",
"@jupyterlite/contents": "^0.2.0",
"@jupyterlite/iframe-extension": "^0.2.0",
"@jupyterlite/kernel": "^0.2.0",
"@jupyterlite/server": "^0.2.0",
"@jupyterlite/server-extension": "^0.2.0",
"@lumino/algorithm": "^2.0.0",
"@lumino/application": "^2.0.0",
"@lumino/commands": "^2.0.0",
Expand All @@ -51,14 +51,14 @@
"@lumino/signaling": "^2.0.0",
"@lumino/virtualdom": "^2.0.0",
"@lumino/widgets": "^2.0.0",
"@voila-dashboards/voila": "^0.5.3",
"@voila-dashboards/voila": "^0.5.5",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@babel/core": "^7.2.2",
"@babel/preset-env": "^7.3.1",
"@jupyterlab/builder": "^4.0.0",
"@jupyterlab/builder": "^4.0.7",
"@types/node": "~18.8.3",
"babel-loader": "^8.0.5",
"css-loader": "^6.7.2",
Expand Down
27 changes: 19 additions & 8 deletions packages/voici/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ import { ServiceManager } from '@jupyterlab/services';
import { IKernelConnection } from '@jupyterlab/services/lib/kernel/kernel';
import { IKernelSpecs } from '@jupyterlite/kernel';
import { Widget } from '@lumino/widgets';
import { App as VoilaAppNameSpace, VoilaApp } from '@voila-dashboards/voila';
import {
App as VoilaAppNameSpace,
RenderedCells,
VoilaApp,
} from '@voila-dashboards/voila';

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

Expand Down Expand Up @@ -52,6 +56,10 @@ export class VoiciApp extends VoilaApp {
console.error('Missing service manager');
return;
}

const rendermime = await this.resolveRequiredService(IRenderMimeRegistry);
App.typesetMarkdown(rendermime);

await serviceManager.ready;
const sessionManager = serviceManager.sessions;
await sessionManager.ready;
Expand Down Expand Up @@ -86,9 +94,7 @@ export class VoiciApp extends VoilaApp {
for (const name in specs) {
if (requestedKernelspec.language === specs[name]?.language) {
console.log(
`${
requestedKernelspec.name
} kernel is not available, fallback to using ${specs[name]!.name}`
`${requestedKernelspec.name} kernel is not available, fallback to using ${specs[name]?.name}`
);
spec = specs[name];
break;
Expand Down Expand Up @@ -117,9 +123,6 @@ export class VoiciApp extends VoilaApp {
kernel.connectionStatusChanged.connect(async (_, status) => {
if (status === 'connected') {
window.update_loading_text(0, 0, 'Starting up kernel...');
const rendermime = await this.resolveRequiredService(
IRenderMimeRegistry
);
// Create Voila widget manager
const widgetManager = new KernelWidgetManager(kernel, rendermime);
rendermime.removeMimeType(WIDGET_MIMETYPE);
Expand Down Expand Up @@ -149,7 +152,7 @@ export class VoiciApp extends VoilaApp {
});
const node = document.getElementById('rendered_cells');
if (node) {
const cells = new Widget({ node });
const cells = new RenderedCells({ node });
this.shell.add(cells, 'main');
}
}
Expand All @@ -174,6 +177,14 @@ export namespace App {
serviceManager?: ServiceManager;
}

export function typesetMarkdown(rendermime: IRenderMimeRegistry): void {
// Render latex in markdown cells
const mdOutput = document.body.querySelectorAll('div.jp-MarkdownOutput');
mdOutput.forEach((md) => {
rendermime.latexTypesetter?.typeset(md as HTMLElement);
});
}

export async function executeCells(options: {
source: NotebookModel;
rendermime: IRenderMimeRegistry;
Expand Down
2 changes: 1 addition & 1 deletion packages/voici/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async function main() {
),
require('@jupyterlab/markedparser-extension'),
require('@jupyterlab/markdownviewer-extension'),
require('@jupyterlab/mathjax2-extension'),
require('@jupyterlab/mathjax-extension'),
require('@jupyterlab/rendermime-extension'),
require('@jupyterlab/theme-light-extension'),
require('@jupyterlab/theme-dark-extension'),
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ classifiers = [
"Programming Language :: Python :: 3.11",
]
dependencies = [
"voila>=0.5,<0.6",
"jupyterlite-core>=0.2.0a1,<0.3.0",
"voila>=0.5.5,<0.6",
"jupyterlite-core>=0.2.0,<0.3.0",
]
dynamic = [
"version",
Expand Down
5 changes: 5 additions & 0 deletions ui-tests/playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ module.exports = {
video: 'retain-on-failure',
},
retries: 2,
expect: {
toMatchSnapshot: {
maxDiffPixelRatio: 0.05,
},
},
webServer: [
{
command: 'yarn start',
Expand Down
5 changes: 0 additions & 5 deletions voici/tree_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ def patch_page_config(
themeName = config.theme
page_config_copy["jpThemeName"] = themeName
page_config_copy["extensionConfig"] = config.extension_config

page_config_copy[
"fullMathjaxUrl"
] = f'{page_config_copy["baseUrl"]}{page_config_copy["fullMathjaxUrl"]}'

federated_extensions = page_config_copy["federated_extensions"]
disabled_extensions = [
"@voila-dashboards/jupyterlab-preview",
Expand Down
Loading

0 comments on commit c512c49

Please sign in to comment.