From dc6c1d041083215e429ab0853d6e5d07b76756fa Mon Sep 17 00:00:00 2001 From: Duc Trung Le Date: Tue, 31 Oct 2023 17:31:48 +0100 Subject: [PATCH] Wait for service worker on start up (#97) * Update service worker on start up * Update changelog --- CHANGELOG.md | 15 ++++++++++++++- README.md | 2 -- packages/voici/src/main.ts | 10 +++++++++- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 995a536..963f0e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,17 @@ -# Changelog +# Voici Changelog + +## 0.5.0 - Highlights + +Below are the major highlights in Voici 0.5.0 + +- Voici frontend is updated to JupyterLab 4, Voila 0.5.0 components. +- Tree page is now a Lab remix app. +- New argument `--classic-tree` to use the jinja2-based tree page instead of the Lab-based one. +- Voici CLI can be used in the same way as Voila, e.g: + - `voici .` + - `voici notebook.ipynb` +- Voici now supports the [`files` directory](https://jupyterlite.readthedocs.io/en/latest/howto/content/files.html#content-with-the-cli) to copy additional files to the Voici deployment. +- Latex expressions are rendered by `@jupyterlab/mathjax-extension` instead of relying on MathJax 2 coming from CDN. diff --git a/README.md b/README.md index 154813b..a7a0fb3 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,6 @@ [![JupyterLite](https://jupyterlite.rtfd.io/en/latest/_static/badge-launch.svg)](https://voici.readthedocs.io/en/latest/_static/lite) [![Documentation Status](https://readthedocs.org/projects/voici/badge/?version=latest)](https://voici.readthedocs.io/en/latest/?badge=latest) -🚧 **WARNING: Voici is in early preview** 🚧 - Voici is a tool for generating static dashboards from Jupyter Notebooks. It can be used as a drop-in replacement for [Voilà](https://github.com/voila-dashboards/voila) and it has the same commands and supports most of Voila's configuration options. Unlike Voila, which renders interactive dashboards using server-side execution, Voici uses [WebAssembly](https://developer.mozilla.org/en-US/docs/WebAssembly) (Wasm) kernels to render notebooks in the browser, making the resulting dashboard entirely self-contained and distributable. diff --git a/packages/voici/src/main.ts b/packages/voici/src/main.ts index 54788d5..05aab54 100644 --- a/packages/voici/src/main.ts +++ b/packages/voici/src/main.ts @@ -11,7 +11,7 @@ import '@voila-dashboards/voila/style/index.js'; import '@voila-dashboards/voila/lib/sharedscope'; import { PageConfig, URLExt } from '@jupyterlab/coreutils'; import { IKernelSpecs } from '@jupyterlite/kernel'; -import { JupyterLiteServer } from '@jupyterlite/server'; +import { IServiceWorkerManager, JupyterLiteServer } from '@jupyterlite/server'; import { activePlugins, createModule, @@ -181,6 +181,14 @@ async function main() { app.registerPluginModules(mods); await app.start(); + + const serviceWorkerManager = await jupyterLiteServer.resolveOptionalService( + IServiceWorkerManager + ); + if (serviceWorkerManager) { + await serviceWorkerManager.ready; + } + await app.renderWidgets(); window.jupyterapp = app; }