Before jumping in one of the approaches listed in the wxyz-lab doc, I would like to find a way to do an apples-to-apples comparison; for example:
How do the widgets fit in the JupyterLab UI and what are the dependencies, if any, on JupyterLab extensions?
I like that the ipylab examples have an explicit JupyterFrontEnd class, though it is unclear to me how this approach handles JupyterLab extensions.
For wxyz-lab, it is unclear to me whether there is a corresponding mechanism as ipylab’s JupyterFrontEnd and, if not, whether it is needed at all for some reason.
For a given frontend widget (e.g. Lumino or Lumino-based extension), how do we find what needs to be done on the Python side to use that widget and what options are available for customizing its behavior?
Related to that question is clarifying the relationship between the JupyterLab Ui widgets (i.e Lumino) and other widgets (e.g. ipywidgets)
In the wxyz-lab examples, I see several references to the ipywidgets whereas in the source I see references to Lumino widgets. I confess that I am a bit confused about this: are they two different libraries of UI widgets or is there some kind of dependency between them?
If we need to do some debugging (e.g. like opening the developer view in a browser), is there a way to trace the UI-side JS calls to the kernel-side Python callbacks?
What do we need to do to handle frontend/backend synchronization? e.g., there could be two different UI buttons, one for incrementing a counter, one for decrementing it. How do we avoid race conditions in the callbacks to the Python code and in the rendering of the counter state in the UI?
For simplifying onboarding with new developers unfamiliar with this ecosystem, are there examples showing how individual widgets work (frontend/backend) where it is clear what belongs to the frontend vs. backend?
they complement each other, more than anything, and have similar approaches:
wxyz.lab.DockPanel and wxyz.lab.DockPop are “abuses” of the customized lumino widgets lab uses.
ipylab wraps the CommandRegistry hanging off a FrontEnd
They put these things on the evented widgets bus, backed by kernel comms: lumino has no prescribed common data model that one would sync (though wxyz.datagrid.StyleGrid is a wrapper around lumino/datagrid which does have a model).
a given frontend widget
Yeah… you go read the source of the core, extensions, and API docs.
ipywidgets whereas in the source I see references to Lumino widgets
Yes. Jupyter Widgets antedate lumino by a half decade, and use a backbone model and view system, and historically used a lot of jquery.
As of some point, all the core @jupyter-widgets/controls are implemented in JupyterLab as lumino widgets, which makes… exactly nothing clearer.
using a new-enough ipykernel will let you throw breakpoints inside declared callbacks
using even newer lab and ipykernel will let you navigate files more generally
handle frontend/backend synchronization
This is pretty much the point of the widgets model system: direct manipulation (of, say, an HTML5 number widget or slider) would immediately change the frotnend, then propagate the value to the backend. backend observer code could then react to it.
there actually aren’t incrementer primitives in the core jupyter widget implementation… directly modeling transfer functions is actually one of the purposes of wxyz (though I never sat down and built the math stuff).