Skip to content

[DISCUSS] Goals and architecture of jupyter-ui-toolkit #5

Open
@echarles

Description

@echarles

@fcollonval thx for working on this.

I am linking here the work I am doing to create high level React.js components backed by the JupyterLab widgets: with jupyter-react https://github.com/datalayer/jupyter-react, you can add live notebooks, cells, terminals... in any React.js application. This can be used in existing solutions like e.g. Docusaurus or rich text editors like Slate or any custom user application. I have gathered an example repository to showcase such usages https://github.com/datalayer/jupyter-examples. If you want to know more on that, I am giving a talk at FOSDEM next Saturday (5th Feb 2022) https://fosdem.org/2022/schedule/event/lt_jupyter (online broadcasting).

It would be good to further discuss about the goals of this repository as well as the current technical choice. I dump here a few questions and reflexions and would love to further articulate and formalise in a document based on brainstorming with interested people:

  • jupyter-ui-toolkit ships for now some low-level widget (like buttons, slider, select...) but does not provide any guidance on how to build on top of those. On one side, this is good as it allows supporting various technologies (react.js, vue...) but on the other side, there is a risk that developers create disparate and incompatible usage, resulting in frustration and fragmentation.
  • To add behaviour, should a layer on top (react.js, vue.js...) or a layer below (core fast api a bit like https://lit.dev) be used? Anything would theorically work, but may practically not be ideal (see previous point).
  • If the strategy to fork the vscode webview toolkit is kept, I wonder how to catch-up with the evolution (looking at https://github.com/microsoft/vscode-webview-ui-toolkit it looks to me they have already added a few widgets). Maybe a "composition" strategy could be discussed.
  • At first sight, vscode-webview-ui-toolkit ships today a subset of other toolkits and is rather sparse. The advantage is that you can use it with react.js, vue.js... (strangely svelte is not listed, I guess it may be available one day). It has also some natural integration with VS-Code.
  • About the adoption and approval of React.js in the broader Jupyter ecosystem, I can see arguments in favour, like jupyterlab already shipping a lot of widgets backed by react and JupyterHub shipping a react management ui (https://github.com/jupyterhub/jupyterhub/tree/main/jsx). Should this be discussed in some team governance levels to make it more official and further push in that direction?
  • If we start building higher level components on top of any toolkit, another discussion could be started regarding a state management system to let those components communicate (RxJS is mentioned in Lumino v2 Plan jupyterlab/lumino#233, but that does not cover all the needs to reuse those components efficiently).

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions