"Run all" doesn't work when external resources are requested by a cell #135
Description
Sometimes a notebook cell execution result may end up adding an element (such as a <script>
) to the DOM in order to load an external resource. Bokeh is one example of this as it wants to load some JS files from a CDN.
Subsequent notebook cells may depend on these resources being loaded, so "run all" doesn't work. Sometimes workarounds can be recommended, such as forcing "inline" mode for Bokeh so that the JS is sent in a Websocket message.
One solution was proposed in #108 (comment) :
@jhpedemonte: So here's my new proposal: we execute all code cells in a loop, then wait for result to come back and pass that to
jupyter-js-output-area
to handle. The latter is what adds HTML/JS to the DOM. When handling results, we can add a check to see if any<script>
were added to the DOM. If so, we add onLoad handlers and queue up any remaining results until those scripts have loaded.