-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ref(replay): Update CLS web vitals to align with browserTracing #13058
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
Conversation
size-limit report 📦
|
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.
Does the frontend support node
being an array? We'll want to make sure it's compatible.
It would be better though if we sent it as a new property, e.g. nodes
. Otherwise it can break self-hosted since the UI is not expecting an array. With a different property, old UIs will not be able to highlight the nodes, but at least it shouldn't break the app.
const nodeIds: number[] = []; | ||
if (Array.isArray(node)) { |
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.
This might be easier to follow and less code:
const nodeIds: number[] = []; | |
if (Array.isArray(node)) { | |
const nodes = Array.isArray(node) ? node : []; | |
const nodeIds = nodes.map(node => record.mirror.getId(node); |
@@ -225,13 +229,24 @@ export function getInteractionToNextPaint(metric: Metric): ReplayPerformanceEntr | |||
export function getWebVital( | |||
metric: Metric, | |||
name: string, | |||
node: Node | undefined, | |||
node: Node | Node[] | undefined, |
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.
Is getWebVital
a public function? It might be better to change the parameters so that it accepts Node[] | undefined
.
const nodeIds = nodes ? nodes.map(node => record.mirror.getId(node)) : undefined; | ||
|
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.
Let's move this inline with L246
NodeId has been replaced with nodeIds which now accepts several nodes since CLS scores are cumulative. Also updated CLS metrics to match CLS captured from browserTracing.
Relates to getsentry/sentry#69881