-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jupyverse Modularity - Workflow to add "server extension" ? #305
Comments
No, they can live in another repo.
I should write more documentation about that. A plugin is an Asphalt component. Actually, Jupyverse is just a collection of plugins. You can launch Jupyverse using the Asphalt CLI and config file(s): asphalt run config.yaml In that case, the components in the config file must have been registered in the "asphalt.components" entry point.
There is no tutorial for now, but you can have a look at Asphalt's documentation, or see e.g. the contents plugin. Basically, you need to require the resources you need, then add the resources provided by the plugin. If the plugin adds new endpoints (which it will probably do), you need to require the Regarding your mechanism to communicate between the browser and the kernel, what you are describing can work, but it also comes with drawbacks, for instance you will need to watch file changes, etc. Also, it's true that most of the time the server file system is the same as the kernel's, but they can also live on different machines. Regarding the |
Thx a ton for the fast and precise answers 👍
Is there an example of how to reference a plugin located in another repo or local folder ?
So I can already use jupyverse with a completely customized set of plugins without default ones, right ? My idea would be to use jupyverse as a base for a "proxy/cors" server in the context of corp & jupyterlite, but in that case without any of the jlab plugins.
This is a very good starting point 👍 I'll delve into it.
AFAIK ipywidgets are the prefered way to communicate between notebook frontend and kernel. But my use case is between labextension frontend (i.e. possibly full custom react component - hopefully vue too soon Cf. PR jupyterlab/extension-examples/pull/233) and kernel.
Indeed, it makes sense. Clear. General remark: |
It doesn't matter if a plugin is located in another repo or a local folder, it is just a package that registers components in entry points (the
Yes, you can do that. Just don't install any plugin shipped in plugins. Regarding kernel/frontend communication, you're right that ipywidgets work with a notebook. In your case, I would recommend using ypywidgets/yjs-widgets. JupyterCAD has a similar use case as the one you are describing: kernels communicate using ypywidgets with the frontend, which is well authenticated with the server. |
Indeed. ypywidgets & yjswidgets look like they offer the proper com channel. Is there a minimal jupyterlab extension example using ypywidgets & yjswidgets ? If so it would be super if it landed in https://github.com/jupyterlab/extension-examples, ideally with jupyverse. Currently the only server-extension is with jupyter_server, it seems. Btw JupyterCAD uses jupyter_server, not jupyverse, right ? Also I'm bit lost with the various Jupyterlab <3.6, 3.6, 4. Do ypywidgets & yjswidgets work with all ? some ? Combined with jupyter_server/verse that's many possibilities.. What is the recommendation re versions now ? I assume longer term it would simply be jupyverse + jlab 4. |
I'll try to write a minimal example using Jupyverse and ypywidgets/yjs-widgets. They should work with JupyterLab 3, but now that JupyterLab 4 is out it's better to use it. |
I understand from the doc and conversation that Jupyverse is modular by design 👍
So I understand it should be feasible to add endpoints, aka server extensions. aka asphalt plugins (?).
Do such plugins need be in the jupyverse repo ? Or is there a way to add one by config before lauching the server ?
More generally is there a short demo/tutorial on how to create such a custom plugin (hello world with maybe some use of shared resources) ?
I have the following generic idea in mind:
Similarly the data flow can go the other way if the plugin has a corresponding "GET" endpoint availalble to the labextension.
This would be a relatively generic way to pass data from frontend to kernel and back - which is a frequent use case - and it would be easy to customize.
NOTE: In the case of Jupyterlite, the facility to exchange data between frontend and kernel is the IndexedDB - accessible in read-write from both kernel and frontend 👍
Side question:
In the repo there is a lot of "fps" but there is mention (#277) that "fps" has been replaced by asphalt.
However there are still "fps-xyz" imports all over the place including after this mention.
Why ? migration on going? renaming not done ? Just to understand.
The text was updated successfully, but these errors were encountered: