-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
core: allow any audit details type to be used in an opportunity #14903
Conversation
I like the idea of expanding opportunities beyond just tables! A few additional considerations:
|
Thanks for taking a look!
I think yes if we develop the unified theory of opportunities everyone kind of wants but hasn't been able to define so far, and it fits in there. If we're very sure a recommendation will improve a metric, then we should be able to make some level of estimate of how much it will help, which so far has meant time savings since that's what (almost all) the metrics are measured in. The most likely next kind of opportunity seems like it will be for the unitless CLS. If we develop an opportunity there, it won't fit into the LH4-10 framework and will have to be shoehorned in. Bytes saved is tricky. Definitely measurable, but the first question should be which bytes and when during load would they be saved (early bytes usually being much more impactful than very late bytes, for instance). And if we can answer that, we're usually most of the way to making a time-saved estimate...
Because of things like CLS opportunities and the fact that details But for LH11+, I think we should consider anything and everything,
Personally for LH11, I would like to
The backwards compatibility story would be straightforward for any of these ideas, the main constraint possibly overriding any of them is designing to reduce churn on consumers of the LHR and having any churn that is required be as straightforward a migration as possible, with purity of LHR design a priority somewhere below that. |
Upcoming opportunities need to include different audit details than just tables, but the existing
'opportunity'
Details type is tied to just the table format. This PR proposes separating opportunities from details types so that any type of details can be included in an opportunity.I have a followup PR that actually uses this functionality, but I wanted to get this PR posted so anyone can take a look and start thinking about other options in the solution space.
tl;dr:
details.overallSavingsMs
property will be rendered as an opportunitytype: 'opportunity'
kept for now to not break anyone using LHRsOriginally I wanted something more invasive (e.g. still have an
opportunity
details, but it could have any kind of details nested in it, or just get rid ofopportunity
details altogether), but of all the audits, opportunities are the ones most relied on by downstream tools (performance sites, lighthouse-ci, BQ queries, etc), so this feels like the maximum viable change that can occur without being disruptive.For Lighthouse 11, I'd like to attempt retiring
type: 'opportunity'
in favor of this solution, which will get rid of the dual table type, taking care of @alexnj's goals in #14771 and make things clearer than they are after this change.