Yes, the classic notebook is not really setup for multiple runtime
extensions to resolve their runtime dependencies. This dependency
resolution is independent of the code loading on the page through
require.js. We have solved these things with the new extension system
in JupyterLab, but doing it well takes a huge amount of work and would
break the classic notebook APIs. It is my opinion that we are better
off keeping the classic notebook as is in this respect and relying on
JupyterLab when these things are needed.

On Thu, May 18, 2017 at 7:26 AM, Zelphir Kaltstahl
<[email protected]> wrote:
> Hi,
>
> I am writing some extensions which I need. The extensions have different
> purposes, but I'd like to ensure, that one of them has run before the other
> ones are run.
>
> What is a good way to do this? (no busy wait if not necessary)
>
> In each of the extensions I am listening for the notebook to be loaded like
> this:
>
>
> /////////// BEGIN
> function load_ipython_extension() {
>             if (Jupyter.notebook !== undefined &&
> Jupyter.notebook._fully_loaded) {
>                 if (!initialized) {
>                     init();
>                 }
>             } else {
>                 if (!initialized) {
>                     events.on('notebook_loaded.Notebook', () => {
>                         init();
>                     });
>                 }
>             }
>         }
> /////////// END
>
> Then in init happens the actual work.
> This was a practice suggested in some issue on Github and I already adopted
> that, but how can I be sure that extension A runs before extensions B, C and
> D, regardless of the specifics of what they do? Is there some event I could
> listen to, which contains the name of the extension? Maybe something like:
>
> /////////// BEGIN
> events.on('extension_loaded.ExtensionName')
> /////////// END
>
> Or a simple way to introduce such an event myself, without changing the
> notebook source code itself, maybe some generic event sending, where I can
> put in any name I want for the event and then listen for that in the other
> extensions?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jupyter/926c0539-e9a1-43d2-aad7-b3128df2936d%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Brian E. Granger
Associate Professor of Physics and Data Science
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
[email protected] and [email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/CAH4pYpRoOqJxvJcFpZs0csnPKdfemv77L7EOS6ijStURzeuB_A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to