Description
Since we haven't agreed on this yet, I'm opening an issue instead of writing an IPEP. If this is agreed on, I'll write an IPEP.
The week before last, @ellisonbg and I brainstormed about Jupyter packaging. As I remember it, the best solution we came up with requires a combination of Python packaging entry-points, a new message type, and static asset caching (in the web server). This is my understanding of how this solution would work (my notes from our meeting are at home, and my apartment is being fumigated, so I don't have access to them).
Jupyter level, kernel extensions
A new message, the first, (in blue) would be added, allowing the server to ask the kernel if the static assets it knows about, associated with that kernel, is correct. The message would be a dict of static asset path and contents hashes.
The same message in the opposite direction is the kernel's response. It would be some type of data structure, maybe a binary message, containing static asset paths and their contents, and a list of the static assets that can be deleted from the cache.
A second new message (in red), would be added that would allow the kernel to invoke a require.js call in the front-end. This is preferred over standard display(JS) calls, because the notebook contents will remain unaffected.
IPython level, kernel extensions
Python entry points will be used as a registry. Two entry points will be defined:
- an entry point for code to run when the kernel is started.
- an entry point for a method that returns static assets (paths).
Jupyter level, server extensions and notebook extensions
Python entry points will be used as a registry. Three entry points will be defined:
- an entry point for code to run when the server is started.
- an entry point for a method that returns static assets (paths).
- an entry point for a paths to be
require
ed when the notebook page loads.
EDIT
To help the discussion, issues and specific cases are listed here: https://jupyter.hackpad.com/Packaging-PbIgxnC71or