Repository navigation
Fix event lag never finishing when options change after load - #559
Merged
Merged
Conversation
The event-lag collector read its settings from the global options on
every tick. When those options changed after it was created, for
example with Pace.start({ eventLag: false }) after loading pace with a
bundler, it read them from `false` and never finished, so the bar
never finished either.
It now uses the settings it was created with, like the elements
collector. Changing individual settings at runtime
(Pace.options.eventLag.lagThreshold = 30) still applies.
The example passed `document: false` to Pace.start(), but pace builds its collectors when it loads, so the option didn't apply to the page load. Show setting window.paceOptions in a module imported before pace instead, or with RequireJS, in a script before require().
This was referenced Nov 5, 2026
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.
The event-lag collector read its settings from the global options on every tick, so
Pace.start({ eventLag: false })after loading pace with a bundler left the bar running forever. It now keeps the settings it was created with. The README's bundler example, which passed options toPace.start()that don't apply to the page load, now shows settingwindow.paceOptionsin a module imported first (or, with RequireJS, in a script beforerequire()).How to verify:
npm test. The new test "finishes when Pace.start() turns off eventLag" fails onmasterand passes here.