-
Notifications
You must be signed in to change notification settings - Fork 140
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
✨ [RUMF-1288] Collect viewport size #1584
Conversation
7b1335a
to
824f9fd
Compare
824f9fd
to
3adb44b
Compare
Codecov Report
@@ Coverage Diff @@
## main #1584 +/- ##
==========================================
+ Coverage 90.74% 90.84% +0.09%
==========================================
Files 121 123 +2
Lines 4540 4554 +14
Branches 1018 1021 +3
==========================================
+ Hits 4120 4137 +17
+ Misses 420 417 -3
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
@@ -121,6 +122,7 @@ export function startRumAssembly( | |||
}, | |||
synthetics: syntheticsContext, | |||
ci_test: ciTestContext, | |||
display: getDisplayContext(), |
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.
Getting the display context at the assembly stage is the more straightforward way to implement it.
However, for pre-init calls, it means we won't get the display info of the time the event happens, but at the init time. I think it's good enough though
width: window.innerWidth, | ||
height: window.innerHeight, |
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.
💬 suggestion: Apparently getting the window dimension might force the browser to recompute the layout (cf list here). Maybe listen for resize
event and cache its value?
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.
Indeed, good. Do you think we should do the same here
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.
that's already what we do :) (but also we throttle the listener)
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.
Nice!
Mutualize recorder and rum code to avoid reflow as much a possible
4dc6529
to
40f03ee
Compare
0f3bd97
to
2e4144d
Compare
I've checked the documentation here. What configuration of |
Motivation
When looking at clickmaps users need to be able to filter events by viewport size.
I also took to chance to clean a bit RUM domain folder by moving context files in a dedicated folder.
Changes
Testing
I have gone over the contributing documentation.