CermakM / jupyter-require

Jupyter nbextension for JavaScript execution and AMD dependency management.
MIT License
21 stars 7 forks source link

[TASK] Learn how Jupyter Lab handles Javascript execution and module dependencies #9

Open CermakM opened 5 years ago

CermakM commented 5 years ago

User story As the assignee of the epic to create the Jupyter Lab extension I want to find out about the way Jupyter Lab handles Javascript execution and module dependencies so that I could proceed further with the implementation.

Linked epics / issues

7

0xHericles commented 5 years ago

When using local extensions and linked packages, you can run the command

jupyter lab --watch

This will cause the application to incrementally rebuild when one of the linked packages changes. Note that only compiled JavaScript files (and the CSS files) are watched by the WebPack process.

Source: https://jupyterlab.readthedocs.io/en/stable/developer/extension_dev.html#extension-authoring

0xHericles commented 5 years ago

@CermakM jupyter lab extensions are npm packages that have a jupyterlab key in its package.json which has "extension" metadata. The value can be true to use the main module of the package, or a string path to a specific module (e.g. "lib/foo").

CermakM commented 5 years ago

@hericlesme A short note ... First, we should check whether the goal of executing custom JS scripts and linking custom JS libraries is actually feasible in Jupyter Lab. For that, the extension itself might not be needed (maybe it can be done directly from the notebook) --- if you want to start with the extension right ahead, however, it works as well of course :)

0xHericles commented 5 years ago

@CermakM Is possible to execute custom JS scripts. I am still confirming how to import libraries.

CermakM commented 5 years ago

@hericlesme This is certainly NOT what we wanna use. This is nothing but an eval wrapper around the JS code -- way too dangerous.

We want to dig a bit deeper and allow Python-JS communication via comms, in the same way, as we do it in Jupyter Notebooks.

0xHericles commented 5 years ago

@CermakM So, apart from that, can we go to the extension?

CermakM commented 5 years ago

I think that's a reasonable strategy. Let's create the Jupyter Lab extension for jupyter-require, load it, and see what works and what doesn't. :grimacing:

EDIT: Don't know if you were talking about the javascript-extension that you mentioned above, but we're certainly not gonna use it