-
Notifications
You must be signed in to change notification settings - Fork 18
feat: upgrade to rum v2 #81
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
nx/scripts/nexter.js
Outdated
| @@ -1,10 +1,10 @@ | |||
| import { sampleRUM } from '../deps/rum.js'; | |||
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 would make all of DA slower as it would put rum in the critical path of showing pixels.
Please find a way to use rum without getting in front of LCP (which is the previous behavior).
nx/scripts/nexter.js
Outdated
| el.autoBlocks = decorateLinks(el); | ||
| el.blocks = [...el.querySelectorAll(':scope > div[class]')]; | ||
| decorateDefaults(el); | ||
| if (i === 0 && sampleRUM.enhance) { |
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.
What does sampleRUM.enhance do? We should not have a dependency on rum for basic decorating. Rum does not provide value to the person trying to view the page and should be not be executing / required in the path to LCP.
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.
enhance is an optimization to load the enhancer only after the first section is loaded, i.e. load the enhancer post LCP.
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.
If we lazy load sampleRUM, this would not be necessary.
nx/scripts/postlcp.js
Outdated
| import { sampleRUM } from '../deps/rum.js'; | ||
|
|
||
| (async function loadPostLCP() { | ||
| window.hlx = window.hlx || {}; |
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.
These should be moved to rum.js as they are part of the rum feature. We want to keep these things encapsulated to their own area of concern.
auniverseaway
left a comment
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've always had a complicated relationship with RUM because it provides the site owner value, it provides Adobe value, but it does not provide any value to the visitor.
In simple Edge Delivery implementations with a lot of LCP headroom, it's totally fine to put RUM in front of LCP. That's the way boilerplate is. This is not something I'm willing to accept on DA.
If we cannot get the RUM data we need without putting bytes in front of LCP, I think we have an architectural problem with RUM. Historically, we have been able to defer without any noticeable impacts to reporting (at least to my knowledge), and I don't want to change this.
If you look at it differently: if AWS / Cloudflare / etc said we had to run their code before we can do our work, we would tell them to fly a kite. We should treat our customers (da.live in this case) with the same amount of respect.
|
ok... rethinking about all of this... da.live is more an app than a site anyway. Performance monitoring and tracking are slightly different. I revisited the PR. If we trigger
All the rest is computed based on Performance API which keeps track of the everything from the beginning anyway. |
Upgrade to RUM v2.
We'll be tracking clicks in webcomponents and many other good things like better source handling.
Not sure how to provide a URL for testing...