-
Notifications
You must be signed in to change notification settings - Fork 16
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
add desktop support, refactor scoring data #10
Conversation
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 left some ideas on what metrics.js looks like...
I got to the point where I realized we need to support the new scoring curve definition.
as for p10 scoring, there's two approaches we can take 1) support both p10-style & podr style and have the data determine. or 2) we only support p10 style and fix the data to match.
i'm good with whatever
|
||
// TODO need to support defining curves with p10 and podr. | ||
|
||
const scoringGuides_WIP_mobile = { | ||
v6: { |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
script/main.js
Outdated
@@ -220,7 +222,10 @@ class App extends Component { | |||
// debounce just a tad, as its noisy | |||
debounce(_ => { | |||
const url = new URL(location.href); | |||
const auditIdValuePairs = Object.entries(this.state).map(([id, value]) => [scoring[id].auditId,value]); | |||
const auditIdValuePairs = Object.entries(this.state).map(([id, value]) => { | |||
const auditId = (scoringGuides.v5[id] || scoringGuides.v6[id]).auditId; |
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 is a bit awkward.
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.
yeaeh, let's make a metrics object that is just the metric name, audit id.... exactly what you named audits
. 👍
I'd prefer this |
scoring curves now derive podr from p10. verify it's all cool with:
|
ruhroh. GoogleChrome/lighthouse#10836 has a WPT report where "device" is 'none' as it's not using desktop emulation. (But it is a desktop run) We'll have to figure out how we handle that case. |
Shouldn't we just use the desktop curves for emulation none? Is that what LH does? |
Yeah for sure
|
Problem: when you run WPT on an actual phone it also uses Example test https://webpagetest.org/result/200524_3N_9f238902d8910c6a5dd67ad3a05ab1eb/ |
Honestly maybe the better message is to say "warning: this test didn't match the two lighthouse presets" and just have a toggle for mobile v. desktop? |
As a user, I would prefer this^...In general, having a toggle for that would be nice. Though in the context of wpt, they are already separating mobile tests from desktop tests, thus already separating LH runs. I think on the wpt channel it would be could to keep them separated as they do; and not have a toggle there, so as to avoid potential confusion. However on web.dev, the toggle would be nice to have for sure...currently right now it is an Emulated Nexus 5X when running in desktop view, which is a big no no. |
Let's just add a toggle to the scoring calculator. if it's none, just default to something (it'd be wrong in some cases for whatever we pick, so let's just pick mobile?) we determine the scoring guide in LH w/ in any case, let's land this PR and follow up with a device toggle. |
@connorjclark Isn't |
exactly :) see wpt: this code runs for both mobile or desktop host device. it doesn't configure what type it is–we derive that in LH via |
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.
Double-checked some v6 and v5 scores and they're all looking great.
Agree with following up this PR with a device toggle.
This is deployed |
I started work on getting different scoring curve based on devices to work, but first had to refactor much of the scoring data.
I got to the point where I realized we need to support the new scoring curve definition. Need to pick this up another time.