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.
livereload in latest version is a lot slower than in previous versions : one has to wait 1-4s when saving html or md file to see the result in the browser.
This PR aims to get back to instant refresh, as it was in previous versions of Reveal (as on 3.6, 3.9, 4.0).
The reason of the drop in performance is this commit : 8492b82#diff-25789e3ba4c2adf4a68996260eb693a441b4a834c38b76167a120f0b51b969f7R289
By passing
**/*.html
and**/*.md
it looks like (I'm no gulp expert) we force gulp to crawl recursively every folder in the project, searching for html or md files. And this makes a lot of files even in the base reveal.js project (node_modules is not excluded 😰).This crawling seems quite useless because this task is not responsible for the watch, all it does is telling the browser to refresh. Still, the
connect.reload()
API needs a stream of files to execute (I tried many ways to launch it withoutgulp.src(...)
before with no success).Since the src stream is irrelevant, I made
gulp.src
only crawl the originalindex.html
file, and everything works fine : when modifying a file, even if it's not the baseindex.html
file, the browser refreshes instantly, and shows every modifications made.Here is an approximative bench on my dev computer (macbook pro M1Pro, RAM 32Go), measuring time from file save, to modification shown in browser (may differ from timing showed in terminal) :