WIP: allow progressive and ajax/SPA templates - #60
Closed
maartenbreddels wants to merge 1 commit into
Closed
Conversation
maartenbreddels
force-pushed
the
progressive
branch
from
January 30, 2019 13:21
caa6c4f to
85765ec
Compare
This was referenced Feb 27, 2019
This was referenced Mar 13, 2019
Closed
Member
|
As discussed in person, closing in favor of #133. (Will reconsider later). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR allows the template system to load progressively, or use ajax to dynamically load the notebook output.
The idea (which I feel is not 100% solid yet, since it feels not that easy to explain / not super intuitive) is to have 2 phase, phase 0 and 1.
By default, voila executes both phases (and if voila.html is not present, phase 0 will be effectively skipped).
Progressive loading works the following:
<html>...<body>....<script that removes spinner> .... </body></html>A SPA (single page app) that would like to use ajax, could use the following strategy.
phase=1An example of how it looks using the 'progressive' template:
(using ajax kind looks the same)
There is quite some duplication of template snippets, although I am not sure we can nicely fix this without creating confusion. Also, I don't like the phase=0/1 naming; we can think about a different name, or have different tornado handlers for each phase.
I do like that it is becoming quite flexible. I can see, with this PR, that one could create a single page dashboard that could load different notebooks without a page reload for instance.