To make an offline-ready version of voila today you need to overload every reference to cdn
, unpkg
, etc. , cache those files, and bring them along.
You may want to track (and or contribute to) the on-going effort to port voila to using the prebuilt extensions (ne “federated” extensions) which are handled entirely by the package manager you’d use to get your voila
package in the first place (e.g. pip
, conda
).
voila-dashboards:main
← jtpio:lab-based
opened 01:14PM - 26 Feb 21 UTC
Draft PR to switch to a lab-based app for the Voila frontend.
[](https://mybinder.org/v2/gh/jtpio/voila/lab-based?urlpath=voila/tree)
Closes #4.
Closes https://github.com/voila-dashboards/voila/pull/238
Might fix https://github.com/voila-dashboards/voila/issues/904
This replaces the current `requirejs` + `nbextensions` approach by a JupyterLab plugin based application.
### Current Status
Basic rendering of widgets, still a couple of issues to fix:

### TODO
- [x] Drop `requirejs`
- [x] Remove require based `main.js` file in the template
- [x] Expose the list of federated extensions (from `/share/jupyter/labextensions` for now)
- [x] Basic support for mimerenderer extensions
- [x] Add `beforeunload` logic in a plugin
- [x] Set `page_config`
- [ ] Produce a single bundle?
- [x] Check voila only serves what is needed
- [x] Fix services not provided by the host Voila application
- [x] ~Remove dependency on `jupyterlab_server` if it is not strictly needed~ -> for now `jupyterlab_server` is only used for building the list of federated extensions with `get_page_config()`
- [x] Disable the default kernel and session polling with a plugin
- [x] Document the setup: https://voila--846.org.readthedocs.build/en/846/contribute.html#about-the-voila-frontend
- [x] Use the next `@jupyter-widgets/jupyterlab-manager@4.0.0-alpha.1` packages, to switch to a `KernelWidgetManager`: https://github.com/jupyter-widgets/ipywidgets/blob/1a121620aea08b2df4bcf92e851bd961317dc1db/jupyterlab_widgets/src/manager.ts#L409
- [x] ~[SKIP] Check how to keep the rate limiting logic~ -> will not do in this PR as this might not be needed based on the comment in https://github.com/voila-dashboards/voila/pull/846#issuecomment-998033258
- [ ] Depend on https://github.com/jupyter-server/jupyter_server_mathjax (https://github.com/voila-dashboards/voila/pull/846#pullrequestreview-649094759)
### Next steps
- Load JupyterLab extensions from the CDN? Requires upstream feature for dynamic extensions?
- Support JupyterLab themes, as an alternative or in addition to the theme and light themes from `nbconvert`: https://github.com/jupyter/nbconvert/blob/957c2e2476e1106fd4976af7d104c01cd5bb7562/setup.py#L52-L56
2 Likes