Repository navigation
Replay recorder starts when the page is idle, not during load - #216
Merged
Merged
Conversation
Automatic replay starts (at init and from config) wait for an idle moment, at most 2 s; without requestIdleCallback (Safari) they wait for page load. If replays are off and the config arrives first, rrweb never runs. New GleapIdle.js. On a 7.8K-node page with 4x CPU throttle, main-thread blocking before the button appears: 149 → 4 ms; replays off: 134 → 14 ms. From G2 reviews (Elias K., Oct 2026; Sam S., Apr 2026). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
Automatic replay starts (init and config) wait for idle (≤2 s); without
requestIdleCallback(Safari) they wait for page load. If replays are off and the config arrives first, rrweb never runs. NewGleapIdle.js.Why
G2 reviews (Elias K., Oct 2026; Sam S., Apr 2026): slow widget load on content-heavy sites. rrweb's full snapshot was ~80% of the SDK's main-thread time on a 7.8K-node page. Before the button appears: 149 → 4 ms blocking; replays off: 134 → 14 ms. With replays on the same work runs, just later.
Checks
npx jest749/749 ✅. Build only used to benchmark (build/ and published/ restored).Risk
A feedback report opened within ~2 s of page load can have a shorter replay. Not tested on real devices or slow networks.
🤖 Generated with Claude Code