Coder Social home page Coder Social logo

jupyterlite / jupyterlab-webrtc-docprovider Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 5.0 465 KB

Document collaboration for JupyterLab and JupyterLite, powered by y-webrtc

License: BSD 3-Clause "New" or "Revised" License

JavaScript 7.85% Python 18.21% TypeScript 71.42% CSS 2.52%

jupyterlab-webrtc-docprovider's Introduction

JupyterLite

ci-badge lite-badge binder-badge docs-badge

JupyterLite is a JupyterLab distribution that runs entirely in the browser built from the ground-up using JupyterLab components and extensions.

⚡ Status ⚡

Although JupyterLite is currently being developed by core Jupyter developers, the project is still unofficial.

Not all the usual features available in JupyterLab and the Classic Notebook will work with JupyterLite, but many already do!

Don't hesitate to check out the documentation for more information and project updates.

✨ Try it in your browser ✨

JupyterLite works with both JupyterLab and Jupyter Notebook.

Try it with JupyterLab! Try it with Jupyter Notebook!
lab-screenshot notebook-screenshot

🏗️ Build your own JupyterLite 🏗️

You can build your own JupyterLite website in a couple of minutes, with custom extensions and packages.

See the documentation for more details.

Browser-based Interactive Computing

JupyterLite is all about accessible browser-based interactive computing:

  • Python kernel backed by Pyodide running in a Web Worker
    • Initial support for interactive visualization libraries such as altair, bqplot, ipywidgets, matplotlib, and plotly
  • JavaScript kernel running in a Web Worker
  • View hosted example Notebooks and other files, then edit, save, and download from the browser's IndexDB (or localStorage)
  • Support for saving settings for JupyterLab/Lite core and federated extensions
  • Basic session and kernel management to have multiple kernels running at the same time
  • Support for Code Consoles

Ease of Deployment

  • Served via well-cacheable, static HTTP(S), locally or on most static web hosts
  • Embeddable within larger applications
  • Requires no dedicated application server much less a container orchestrator
  • Fine-grained configurability of page settings, including reuse of federated extensions

Showcase

Jupyter Interactive Widgets

widgets

JupyterLab Mimerender Extensions

image

Matplotlib Figures

image

Altair

altair

Plotly

plotly

Development install

See the contributing guide for a development installation.

Related

JupyterLite is a reboot of several attempts at making a full static Jupyter distribution that runs in the browser, without having to start the Python Jupyter Server on the host machine.

The goal is to provide a lightweight computing environment accessible in a matter of seconds with a single click, in a web browser and without having to install anything.

This project is a collection of packages that can be remixed together in variety of ways to create new applications and distributions. Most of the packages in this repo focus on providing server-like components that run in the browser (to manage kernels, files and settings), so existing JupyterLab extensions and plugins can be reused out of the box.

See also:

  • p5-notebook: A minimal Jupyter Notebook UI for p5.js kernels running in the browser
  • jyve: Jupyter Kernels, right inside JupyterLab
  • Starboard Notebook: In-browser literal notebooks
  • Basthon: A Jupyter notebook implementation using Pyodide

👥 Contributors

Join our community and become a contributor today! 🚀

jupyterlab-webrtc-docprovider's People

Contributors

bollwyvl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

jupyterlab-webrtc-docprovider's Issues

RTC: File Changed dialog

Description

The second user opening a document with RTC enabled might get this popup when opening a file:

image

Reproduce

Testing locally with http://localhost:5000/lab/?room=1234

  • In the first window, open Untitled.ipynb
  • In a private window or other browser, open Untitled.ipynb

Expected behavior

Opening the file should be smooth without requiring the user to "Overwrite" the document.

Context

Follow-up to jupyterlite/jupyterlite#109

Make room prefix (and other aspects) configurable in settings

Problem

The behavior inherited from jupyterlite/jupyterlite#600 still requires fairly intentional configuration of URLs, and relies on the host as a tie-breaker in the shared namespace.

Proposed Solution

  • start a schema
  • add roomPrefix
    • defaults to window.location.origin
      • except on localhost/127.0.0.1, where it defaults to a uuid4
    • final room name retrieved from the SHA256 of {prefix}-{roomName}
  • add disabled for a global "off" switch"
  • add existing configurables to schema
    • fullWebRtcUrls
    • usercolor
    • username
    • room

Additional context

Support JupyterLab>=4.0

Problem

One of the larger breaking changes from JupyterLab 4.x will apparently be landing on the 3.6 line, namely the frontend expecting a jupyter_server_ydoc-compatible WebSocket server.

This should provide missing identity features, and fixes for total-data-loss bugs when working with many users in RTC.

Proposed Solution

NB: I really don't know what I don't know about everything happening here, and would greatly appreciate any help from others more knowledgable 😍.

Ideally, implementing this change should still result in a lightweight, low-config labextension (and likely liteserverextension) that only requires a public or self-hostable (#4), signaling-only server process.

LiteServerExtension

Provide the same features as the https://github.com/jupyter-server/jupyter_server_ydoc/blob/v0.1.12/jupyter_server_ydoc/ydoc.py#L86.

For a full JS solution, it would be a relatively deep stack including

Ultimately, it may still require a source of truth, a leader election process, or something, which may not be provided by a "naive" public yjs signaling server. Keeping this property may require an even more exotic implementation when it's all clients.

JupyterFrontEndPlugin

Update the provider (and related features) to match jupyterlab/jupyterlab#13222 (or whatever ends up being the final state).

Alternatives

LiteServerExtension

  • use the absolute lightest-weight python jupyter_server_ydoc-compatible implementation
    • if this didn't require replacing the entire jupyterlite server (contents, etc) a la jupyterlite/jupyterlite#779
      • this could be feasible if even viewing a file isn't blocked by the (much larger than ywasm) emscripten machine starting up

Additional context

Find one or more recommendable self-hosted WebRTC signaling servers

Problem

Anyhow, what I haven't explored yet is a simple, self-hosted signaling server to recommend, e.g. as a jupyterhub service: relying on unmirrorable, public/free services at runtime is always shady, I think it would be a good solution for many use cases, already, over a user sharing the jupyter_server instance 😱.

from jupyterlite/jupyterlite#598 (comment)

Suggested Improvement

  • find a simple, recommendable signaling server
    • at best, a pure python server
    • at worst, packaged on conda-forge
  • add docs
  • add to binder
  • use in tests

Re-enable link check

Problem

Link checking is disabled.

Proposed Solution

Re-enable link checking in pyproject.toml

Additional context

Disabled to handle badges before initial upload to pypi on #5.

Release 0.1.0

Checklist

could use releaser, but meh

  • start a release issue with a checklist (maybe like this one)
  • merge all outstanding PRs
  • ensure the versions have been bumped
  • ensure the CHANGELOG is up-to-date
    • move the new release to the top of the stack
  • validate on binder
  • wait for a successful build of main
  • download the dist archive and unpack somewhere (maybe a fresh dist)
  • create a new release through the GitHub UI
    • paste in the relevant CHANGELOG entries
    • upload the artifacts
  • actually upload to npm.com, pypi.org
  • postmortem

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.