Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

thebe-lite

executablebooks377MIT0.5.0TypeScript support: included

Thebe extension library for WASM kernels via JupyterLite

executablebooks, thebe, jupyter, interactivity, jupyter-book, jupyterlite, pyodide, WASM

readme

thebe-lite

Connect to a pyodide kernel via jupyterlite in thebe-core & thebe.

Usage

in thebe

To use JupyterLite with thebe, load this module on your page using a script tag before loading thebe itself.

<script src="thebe-lite.min.js"></script>
<script src="https://unpkg.com/thebe@latest/dist/lib/index.js"></script>

thebe will then feature detect the library and use the module when appropriate option is set.

Note: at the moment, in order for thebe-lite to work, the entire package must be available at at the root of the host domain as pyolite currently requires wheels to be available at /build/pypi.

with npm

First install the package:

npm i thebe-core thebe-lite

Thebe is loaded asynchronously so you need to copy the build artifacts into your project static directory (e.g. public in react) you can do that using: npx copy-thebe-assets <output_dir>

e.g: npx copy-thebe-assets public/thebe

Interface

thebe-lite will extend the global thebe namespace, making the following available on window:

 window.thebe = {
    ...,
    thebeLite: {
        startJupyterLiteServer: () => Promise<ServiceManager>
    }
 }

In order to connect to a jupyterlite kernel with thebe use set the following options:

{
    useBinder: false,
    useJupyterLite: true
}

When loading in typescript this interface is available as ThebeLiteBundle and a connection can be established by:

import { makeConfiguration, ThebeServer } from 'thebe-core';
import { setupThebeLite } from 'thebe-lite';

setupThebeLite();

const config = makeConfiguration({});
const server = new ThebeServer(config);

await server.connectToJupyterLiteServer();

Read More

For more examples of thebe-lite in use, see apps/simple and apps/demo-core.

changelog

Changelog

0.8.3 - To be confirmed

Deprecations

  • thebe has been added as an alias for thebelab and all css classes beginning with thebelab- duplicated as thebe-. The thebelab global object, exposed functions and user code reliant on css classes thebelab-*, will continue to work and any DOM elements created during operation will be decorated with thebelab- classes as expected, until removed in version 0.9.0. #230

0.8.2 - 2021-10-26

Fixed

  • Fixed broken distribution on npm/unpkg.com for last release. #509

0.8.1 - 2021-10-25

Fixed

  • Fixed import of jupyterlab css which was clobbering on page css in downstream usage. #464

Added

  • Added a built in status indicator and activate button that can be enabled via configuration options. #470

Improved

  • Latest version of Thebe is built and used in the documentation and in local development builds. #285
  • Improved and updated examples in the documentation
  • yarn install no longer builds the library automatically, yarn build or yarn build:prod should be called explicitly.

0.8.0 - 2021-08-16

Added

  • Added a busy indicator to provide feedback about computation. #424
  • Added convenience commands for testing with local kernels. #425

Documented

  • Added a pythreejs example. #262
  • Added an ipywidgets example. #418

Improved

  • Switched to the jupyterlab manager to control output display, fixes issues with ipywidgets. #418
  • Switched package managers from npm to yarn. #428

0.7.1 - 2021-04-09

Fixed

  • Pressing "Restart and Run All" now starts a kernel if none has been started already. #345
  • Fixed kernel communication connection in ThebeManager. #330

0.6.0 - 2020-12-23

Added

Improved

  • Adds more user options for persisting saved Binder sessions #280
  • Updated the development HTML page for more test code cells and configs #267
  • Fail linter on diffs #258
  • Restores full jQuery to ensure compatiblity with jQuery UI #189
  • Changes to test layout (when Thebe was still using Karma, as of writing, Thebe now uses Jest) #257
  • Update Thebe to use the latest JupyterLab 3.0 APIs #268

Fixed

  • Fix Python mode in CodeMirror configuration #172
  • Use merged options in CodeMirror configuration #171

Documented

  • Moved example pages into their own subdirectory #281
  • Added example pages for using Thebe with other Jupyter widgets
  • Documented read-only code-blocks #287, #286
  • Updated repository links and other references due to migrating the repository to executablebooks #275, #273, #232
  • Contribution information
    • Instructions on how to build the docs #260
    • Commits, architecture, etc. #248
    • Releases #236
    • Contributing guide #232
  • Event hooks #222
  • Security concerns on XXS (Cross-Site Scripting) #263
  • Use JSDoc to build JS API docs #248
  • Configuration information, getting started, CircleCI jobs, Sphinx book theme #218
  • Clarify kernelName in README #180
  • CodeMirror configuration page #174
  • Use the latest Thebe version #173