{"action":"created","issue":{"url":"https://api.github.com/repos/jupyter/notebook/issues/116","labels_url":"https://api.github.com/repos/jupyter/notebook/issues/116/labels{/name}","comments_url":"https://api.github.com/repos/jupyter/notebook/issues/116/comments","events_url":"https://api.github.com/repos/jupyter/notebook/issues/116/events","html_url":"https://github.com/jupyter/notebook/issues/116","id":81137080,"number":116,"title":"Packaging - the custom msg, entry points, and cached static assets solution.","user":{"login":"jdfreder","id":3292874,"avatar_url":"https://avatars.githubusercontent.com/u/3292874?v=3","gravatar_id":"","url":"https://api.github.com/users/jdfreder","html_url":"https://github.com/jdfreder","followers_url":"https://api.github.com/users/jdfreder/followers","following_url":"https://api.github.com/users/jdfreder/following{/other_user}","gists_url":"https://api.github.com/users/jdfreder/gists{/gist_id}","starred_url":"https://api.github.com/users/jdfreder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdfreder/subscriptions","organizations_url":"https://api.github.com/users/jdfreder/orgs","repos_url":"https://api.github.com/users/jdfreder/repos","events_url":"https://api.github.com/users/jdfreder/events{/privacy}","received_events_url":"https://api.github.com/users/jdfreder/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":35,"created_at":"2015-05-26T21:07:56Z","updated_at":"2015-05-26T22:47:38Z","closed_at":null,"body":"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.\r\n\r\nThe 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).\r\n\r\n## Jupyter level, kernel extensions\r\n![screen shot 2015-05-26 at 1 47 13 pm](https://cloud.githubusercontent.com/assets/3292874/7822986/f5dba636-03ad-11e5-8de4-8d559bd46acb.png)\r\nA 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.\r\n\r\nThe 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.\r\n\r\nA 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.\r\n\r\n## IPython level, kernel extensions\r\nPython entry points will be used as a registry.  Two entry points will be defined:  \r\n\r\n 1. an entry point for code to run when the kernel is started.\r\n 2. an entry point for a method that returns static assets (paths).\r\n\r\n## Jupyter level, server extensions and notebook extensions\r\nPython entry points will be used as a registry.  Three entry points will be defined:  \r\n\r\n 1. an entry point for code to run when the server is started.\r\n 2. an entry point for a method that returns static assets (paths).\r\n 3. an entry point for a paths to be `require`ed when the notebook page loads."},"comment":{"url":"https://api.github.com/repos/jupyter/notebook/issues/comments/105690533","html_url":"https://github.com/jupyter/notebook/issues/116#issuecomment-105690533","issue_url":"https://api.github.com/repos/jupyter/notebook/issues/116","id":105690533,"user":{"login":"minrk","id":151929,"avatar_url":"https://avatars.githubusercontent.com/u/151929?v=3","gravatar_id":"","url":"https://api.github.com/users/minrk","html_url":"https://github.com/minrk","followers_url":"https://api.github.com/users/minrk/followers","following_url":"https://api.github.com/users/minrk/following{/other_user}","gists_url":"https://api.github.com/users/minrk/gists{/gist_id}","starred_url":"https://api.github.com/users/minrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minrk/subscriptions","organizations_url":"https://api.github.com/users/minrk/orgs","repos_url":"https://api.github.com/users/minrk/repos","events_url":"https://api.github.com/users/minrk/events{/privacy}","received_events_url":"https://api.github.com/users/minrk/received_events","type":"User","site_admin":false},"created_at":"2015-05-26T22:47:38Z","updated_at":"2015-05-26T22:47:38Z","body":"@jdfreder I'm not sure what the initial kernel->server publish accomplishes. Why not load on first request for a given resource from the server, and cache that? It wouldn't have the unbounded cost at startup. It would be possible for the kernel to be slow on the first request of a particular resource if the kernel is busy, but I'm not sure that's worse than being slow on every startup."}}