Two auto_refresh extensions#73
Open
stephan-buckmaster wants to merge 5 commits intotrvsdnn:masterfrom
Open
Conversation
Owner
|
Still thinking on this one. I like the idea of configuring the refresh directories... do think it would be better in setup.rb. I like the addition of stopping the reload if one is pending, don't know if I like the loading indicator though... Haven't had a chance to see it in action yet though. |
Author
|
The loading indicator is not graphical, as it may sound. Kind of nice to include a time stamp. I realized it may be better to have it controlled by an option (enable, disable, how-does-it-work), with disabled by default. |
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.
Hey, I use frank for turning results of my computations into HTML which I look at in my browser.
I put computation code in the lib directory, and place display in dynamic templates. I work by making small changes to the inputs, or extend the computation code. The auto_refresh feature makes it so that a file-save becomes similar to a "return" in a terminal: the results of the computation, from new code or display-changes, show up in my browser immediately.
This works all very nice. I ran into two issues though, and am submitting the changes that fix them:
For (1) I allowed configuration by reading an environment variable "FRANK_REFRESH_DIRS" the contents of which are appended to the "watch_dirs" variable
For (2) I added a javascript variable "loading" which is set when the page is reloaded, and prevents any further reloads. While the new page is loading, a more-or-less fancy loading indicator section is displayed on the page. Automatic refresh can be disabled through simple javascript "window.stop_refresh_check = true"
Spec changes cover (2). Couldn't find a way to add specs for (1). Might be better to provide for a hook to use in setup.rb (Frank::Middleware::Refresh.add_watch_directory 'lib') anyway
Cheers!