Conversation
|
short and sweet I like it, any thoughts on exposing this at the toplevel object vs. in the category? I kinda like it contained within the category but that does mean every consumer has to do |
|
Yea, it might be easy for consumers to check a top level prop rather than a buried obj. Either is fine with me. |
|
|
paulirish
left a comment
There was a problem hiding this comment.
Everything in here is looking on point. V nice.
| const element = this._populateScore( | ||
| tmpl, score, 'numeric', category.name, category.description); | ||
| if (category.isPWA) { | ||
| const titleEl = element.querySelector('.lh-score__title'); |
There was a problem hiding this comment.
extract this block into a separate method?
|
I want to discuss how we represent the PWA score + passing threshold. My take is we want to reward only the best best apps with a score of 100, to incentivize performance improvements. So we should set the bar for isPWA passing a bit lower. A wild strawman proposal appears!Passing isPWA ✓
Failing isPWA ✘
TTI Scoring✜ TTI scoring has come up a lot, but one solution is: 70/100 is the score for whatever the "fast enough" definition of the baseline checklist says. (Currently its 10s, discussions around it moving to 5s). For example, that scoring curve could look like this: https://www.desmos.com/calculator/whus3whb2i (median at 15.7s, podr at 2s). 70% score at 10s. 80% score at 7.5s. 90% at 5.1s. (All the disclaimers about TTI changing apply here) what do ya'll think? |
|
Lots to parse in there @paulirish :) but I like the idea of basically saying your final PWA score is |
|
@brendankenny is gonna iterate on this. we discussed a solution and with some slight changes this will be goooooooood. |
|
@brendankenny are you going add to this PR? Not sure what was discussed :) |
|
yeah, I'm going to adapt it. Plan is basically just a new thing in config to make the check more detailed but also separate from category score. Should hit most of what we want and give us flexibility if we decide to use a different approach later |
|
@brendankenny do you think we'll land this for IO? |
|
added "certifications" to the config, allowing scoring of a category to be independent of the certification of it. e.g. a site can be ✔PWA but we still give them a bad score cause they're really slow or whatever. Uses the same styling as before (just a green check). Wanted to get implementation feedback before adding tests. |
lighthouse-core/config/config.js
Outdated
| }); | ||
|
|
||
| // Validate certification (if any). | ||
| if (category.certification) { |
There was a problem hiding this comment.
do we want to validate any certification in the config, even if a category doesn't call it out?
There was a problem hiding this comment.
do we want to validate any certification in the config
like just check that the audits a certification is requesting will be run? We could do that, but I'm already running into issues with filtering the config with onlyAudits. For this version of validation, I was going to drop the certification property if onlyAudits filtered out a required audit rather than show an error. If we want to validate any certification in the config, I'm not sure what to do in that case...strip out the certification altogether?
There was a problem hiding this comment.
i see.
okay then. this works for me.
| pwaCategory.isPWA = isPWA; | ||
| } | ||
| // Check certification (if any). | ||
| let certified; |
|
I had envisioned a slight tweak on this, but lmk wyt:
but no strong feelings. And this approach may be not in-line with how we do report* in the LHR now. |
patrickhulce
left a comment
There was a problem hiding this comment.
It seems like the only connection certifications have with categories is we want a particular certification to be displayed in the report as a checkmark on a particular category header, is there a different way to model this so certifications appear more as a standalone thing?
For example it feels weird that we'll be returning a reportCertifications object that does not have a isCertified/passed property and you have to comb through the categories to match it up and find out if it passed.
lighthouse-core/config/config.js
Outdated
| return this._groups; | ||
| } | ||
|
|
||
| /** @type {Object<string, {title: string, description: string}>|undefined} */ |
There was a problem hiding this comment.
this type doesn't look right?
There was a problem hiding this comment.
no, that's a c/p mistake
| "name": "Progressive Web App", | ||
| "weight": 1, | ||
| "description": "These audits validate the aspects of a Progressive Web App, as specified by the baseline [PWA Checklist](https://developers.google.com/web/progressive-web-apps/checklist).", | ||
| "certification": "is-pwa", |
There was a problem hiding this comment.
why is it a property of a category? there seems to be no relationship at all to the category shouldn't certifications just be evaluated and returned as their own thing?
There was a problem hiding this comment.
why is it a property of a category?
does Paul's idea sound good to you? Top level evaluated certifications, and a category can say, "hey, put a checkmark next to me based on if the certification with this name passed"?
| const element = this._populateScore( | ||
| tmpl, score, 'numeric', category.name, category.description); | ||
|
|
||
| if (certDefinitions && category.certification && category.isCertified) { |
There was a problem hiding this comment.
someone once told me we should trust our closure types and not be defensive beyond them... ;)
There was a problem hiding this comment.
haha I agree @paulirish! just wanted to point it out to those who were down on it to give me some slack :P
There was a problem hiding this comment.
backwards compat
hehe, no :P
In this case certDefinitions is an optional argument (though arguably perf and a11y categories should get it too), a category might not have a certification, and we only add a check mark if the category is certified...there's no red x for failing certification
There was a problem hiding this comment.
perf and a11y categories should get it too
er, perf and a11y category renderers should get it too
| if (category.certification) { | ||
| // Certification and required audits existence checked by Config. | ||
| const certification = config.certifications[category.certification]; | ||
| isCertified = certification.audits.reduce((result, certAudit) => { |
There was a problem hiding this comment.
nit: I think Paul is not a reduce fan, could just use .every instead
There was a problem hiding this comment.
i'm okay with it here. (as it is reducing down to a single value, rather than pushing items onto an array).
but now that you mention it, every() seems better. :)
|
ok, so I think I like the idea of structural certifications, where certifications exist independent of categories, and they pass if the audits in question meet a threshold. Questions:
|
I'd say we just filter out certifications that can't be met by the result of
IMO we should just provide them in the results JSON for now and special case the Later on certifications could each appear as nav items to click and visit an overview page for that certification that shows the failures/what comprises the audit/whatever we want |
|
updated to top level certifications. Like 15 extending corner cases to still test, tho |
patrickhulce
left a comment
There was a problem hiding this comment.
I like this a lot, feels much more extensible in the exemplary/distinguished/baller designations to come :)
| if (certification.isCertified) { | ||
| const titleEl = element.querySelector('.lh-score__title'); | ||
| const link = /** @type {!Element} */ (titleEl.appendChild(this._dom.createSpanFromMarkdown( | ||
| `[✔](${certification.url})`))); |
There was a problem hiding this comment.
should we put an x if it didn't meet the requirements?
| const titleEl = element.querySelector('.lh-score__title'); | ||
| const link = /** @type {!Element} */ (titleEl.appendChild(this._dom.createSpanFromMarkdown( | ||
| `[✔](${certification.url})`))); | ||
| link.classList.add('lh-score__isCertified'); |
There was a problem hiding this comment.
nit: __certification or maybe --certified on lh-score? at the very least __is-certified :)
| } | ||
|
|
||
| function validateCategories(categories, audits, auditResults, groups) { | ||
| function validateCategories(categories, audits, auditResults, groups, certifications) { |
| }); | ||
| } | ||
|
|
||
| function validateCertifications(certifications, audits, auditResults) { |
| * @return {!Element} | ||
| */ | ||
| render(category, groups) { | ||
| render(category, groups, certifications) { |
There was a problem hiding this comment.
I've been thinking that we should be passing the report object around instead of adding additional params to all of the render methods + piping it throughout. Each method can pull the properties it cares about. WDYT?
|
Once this boolean (via whitelisting) is in place, then we can move manifest-name-short-enough from Best Practices into PWA |
|
No more demand for this fella it seems. As of May, a 100 PWA score === this checkmark. We don't see that changing in the short term. |
|
🎉 🎂 |
Part of #1937.
Took at stab at this. Right now, it's based off of the pwa category score being 100. Nothing more.
Also added a small UI check if you're "certified". We don't have to do that but I figured people might want to see that in a report.