-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[REPLAY-164] track Focus records #707
Conversation
This makes things less confusing by removing `Event` and `EventTypes` types altogether, replacing them with proper `Record` and `RecordTypes`. This will help adding new record types.
We'll want to emit records without adding more code to RRWeb. Thus, move the wraping utility to our code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that we're formalizing the "Record" name instead of "Event".
I see we're sending an event when focus is gained, but not lost. Is this a limitation brought by the browser APIs?
We are sending an event when the focus is lost too (blur). Did you experience this yourself? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
incrementalSnapshotCount += 1 | ||
const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth | ||
const exceedTime = checkoutEveryNms && e.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms | ||
const exceedTime = checkoutEveryNms && Date.now() - lastFullSnapshotRecordTimestamp > checkoutEveryNms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you changed from e.timestamp
to Date.now()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because rrweb/record
uses RawRecords
instead of Records
now, so records don't have the timestamp
property anymore. They are "wraped" later in the recorder code. See the whole commit for context 995f863
mb, I misunderstood. all good :) |
Motivation
Add focus information to always show the currently focused view during replay
Changes
Testing
Unit tests, manual tests
I have gone over the contributing documentation.