Comments (6)
Seems easy enough to take a stab, and honestly might be improved in a few other ways. Do you think this is something you would be interesting in submitting a PR for?
from web-vitals.
Do you think this is something you would be interesting in submitting a PR for?
Yeah, I'm happy to. I've noticed that the repo leans heavily into webdriver tests. You cool with unit tests for getSelector
, or should I alter/augment some webdriver assertions?
from web-vitals.
I'm not necessarily opposed to changing this, though I do want to point out that any change to the selector generation logic would mess up people's existing reports. E.g. the situation that @vanderhoop is describing in his screenshot would start happening to everyone using the attribution build of this library whose HTML classes are not already in alphabetical order.
So this is something we'd want to run by RUM providers using the library to make sure they'd be OK with, and it would also need to be released with a major version bump (since it's a breaking change, for the reason I just mentioned).
from web-vitals.
I do want to point out that any change to the selector generation logic would mess up people's existing reports. E.g. the situation that @vanderhoop is describing in his screenshot would start happening to everyone using the attribution build of this library whose HTML classes are not already in alphabetical order... ...so this is something we'd want to run by RUM providers using the library to make sure they'd be OK with
That's a great callout, and should be weighed against the existing selector inconsistency that library consumers are currently subject to. The optimistic view (that others might not share) is that this change in the selector data coming over the wire would end up causing a diff between the aggregated selectors in navigations ingested before/after upgrade, but that diff would be flushed within months for the common RUM use cases. Maybe @ErwinHofmanRV has thoughts, as I believe he's leveraging web-vitals under the hood?
it would also need to be released with a major version bump (since it's a breaking change, for the reason I just mentioned).
I don't see this change necessitating a new SEMVER major, as none of the APIs are changing, nor is the overall semantic structure of the returned result.
One option (which I don't love, but which scratches all the itches) is to make this sorting functionality opt-in. getSelector
already has an optional maxLen
(th) arg, though it doesn't actually appear to be leveraged in the current lib.
from web-vitals.
make this sorting functionality opt-in
Although adding flags for everything can be a sign of poor design, I think this is a reasonable path forward. Default disabled in current version, default enabled in next version.
The opt-out could be a perf benefit for any provider that prefers to do it server-side.
from web-vitals.
+1 for sorting/'uniqueifying' selectors
In general, the amount of distinct results/selectors would reduce. And the appearances/events-rate of selectors would improve, making it easier to grasp which with selector users should continue debugging in DevTools.
I do agree that sites that would be doing periodic comparisons (either manually or via alerts) might see a weird change in this number and might suddenly receive notifications if alerts were configured for the selector-dimension.
But that will be phased out over time and all for the benefit of RUM users I would say.
So based on the way we use this selector data (basically the same as shown in the screenshot as provided by @vanderhoop ), I don't see a risk in a sudden change.
from web-vitals.
Related Issues (20)
- can't find ReportCallback or ReportHandler type HOT 3
- Are there any updates for soft-navs? HOT 2
- LoAF missed for some INP events HOT 9
- Facing issue while exporting `web-vitals/attribution` using `browserify` HOT 2
- LoAF Performance entry script sourceFunctionName and sourceURL logged values HOT 4
- Using `performance.eventCounts` instead of `performance.interactionCount` HOT 2
- Heads Up on Changes to INP Measurement When Interfered with JS Modal Dialogs HOT 3
- TypeError: Cannot read properties of undefined (reading 'processingEnd') HOT 13
- TypeScript 5.5 compatibility
- Speculation rules can impact on increase values for INP ?
- Missing Cumulative Layout Shift (CLS) metric when batching multiple reports together in a single network request HOT 5
- Add clarification regarding event listener in event batching section
- LCP and CLS fired on interaction HOT 5
- Tgt
- Update LCP attribution to handle the first frames of animated content HOT 3
- INP attribution helper latestProcessingEnd never initialized HOT 1
- Missing LoAF attributions for INP due to violating internal invariants
- Any way to simulate clicks for INP testing? HOT 3
- onINP trigger always when browser tab change ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web-vitals.