Open patrickhulce opened 4 years ago
alternatively: Could LHCI use the score
of the audit to know ~now~ not to surface anything?
Could LHCI use the score of the audit to know now to surface anything?
Even though the audit passes due to the opportunity graph calculations recognizing this doesn't matter, programmatic uses such as the LHCI that rely on the presence of items in .details.items as a signal of something to fix fail this case (because relying on graph ms savings can be flaky).
This was intended to address that question :) The score is based on whether there is savings on the performance metrics. Because the performance metrics are variable, the score of opportunities is also variable. We only include audits in the recommended assertions preset if they will not be flaky. Otherwise you end up with situations where assertions pass the bad PR and then fail later on a good one.
It's also a very common pattern across most (every one?) of the other opportunities that items with trivial savings aren't reported.
I guess I'm asking, if there were many more files that had large savings such that the score isn't 1, is there a reason a user should be told about the 0.1 KB of legacy javascript in this file?
got it. I'm good with a (configurable) threshold, probably acting on the item (not subitems). sg?
If the default is in line with our other threshold defaults in this area, sounds great :)
I just noticed that duplicated javascript threshold shipped with 1KiB threshold, would you be open to increasing that too? (at the item level of course) :D
Provide the steps to reproduce
What is the current behavior?
Even 0.1KB of legacy javascript shows up in the table
What is the expected behavior?
Items with less than some threshold of savings do not show up in the table.
Even though the audit passes due to the opportunity graph calculations recognizing this doesn't matter, programmatic uses such as the LHCI that rely on the presence of items in
.details.items
as a signal of something to fix fail this case (because relying on graph ms savings can be flaky). I'm hesitant to include thelegacy-javascript
audit in therecommended
preset while this is the case.