-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
PWA Audits: add placeholders for rest of baseline checks. #2248
Conversation
category: 'PWA', | ||
name: 'pwa-each-page-has-url', | ||
helpText: 'Ensure individual pages are deep linkable via the URLs and that URLs are ' + | ||
'unique for the purpose of shareability on social media.', |
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.
[Learn more](https://developers.google.com/web/progressive-web-apps/checklist#each-page-has-a-url)
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.
done
category: 'PWA', | ||
name: 'pwa-page-transitions', | ||
helpText: 'Transitions should feel snappy as you tap around, even on a slow network, a key ' + | ||
'to perceived performance.', |
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.
[Learn more](https://developers.google.com/web/progressive-web-apps/checklist#page-transitions-dont-feel-like-they-block-on-the-network)
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.
done
return Object.assign({ | ||
category: 'PWA', | ||
name: 'pwa-cross-browser', | ||
helpText: 'To reach the most number of users, sites should work across every major browser.', |
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.
[Learn more](https://developers.google.com/web/progressive-web-apps/checklist#site-works-cross-browser)
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.
done
const passedElem = this._renderPassedAuditsSection(passedElements); | ||
element.appendChild(passedElem); | ||
// Render manual audits after passing. | ||
const auditsGroupedByGroup = /** @type {!Object<string, |
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.
cc @patrickhulce on this bit
lighthouse-core/config/default.js
Outdated
}, | ||
}, | ||
"categories": { | ||
"pwa": { | ||
"name": "Progressive Web App", | ||
"weight": 1, | ||
"description": "These audits validate the aspects of a Progressive Web App. They are a subset of the [PWA Checklist](https://developers.google.com/web/progressive-web-apps/checklist).", | ||
"description": "These audits validate the aspects of a Progressive Web App. They are a subset¹ of the baseline [PWA Checklist](https://developers.google.com/web/progressive-web-apps/checklist).", |
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.
with the placeholders, we're no longer a subset.
wdyt about
These audits validate the aspects of a Progressive Web App, as specified by the baseline [PWA Checklist].
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.
Good call
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 also gets rid of the strange looking 1 that doesn't really look like a footnote at the beginning of the group :)
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.
done
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.
looking good, but what do you think about flattening and removing the base class? It doesn't end up reducing much code and makes writing/reading the manual audits more complicated than copying/pasting informative: true, manual: true
and rawValue: false
would be
I'm not opposed to removing it. What I like about it is that we set some default meta flags for extenders (we have a lot now) so they don't have to think about it. It'll also be easier to modify all manual audits in the future. Only 3 now. |
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.
are we ok with manual
audits being only supported (for now) in _renderDefaultCategory
(not a11y or perf?)? If so, should the changes to _renderDefaultCategory
be forked into _renderPwaCategory
to make that explicit? Or can we make a method for manual
audits analogous to _renderPassedAuditsSection
?
@@ -26,6 +26,7 @@ | |||
--fail-color: #df332f; | |||
--pass-color: #2b882f; | |||
--informative-color: #0c50c7; | |||
--unknown-color: #757575; |
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.
--manual-color
?
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.
done
It's only the three meta properties now, so my preference is add the code to deal with that when/if it gets more complex. It also helps that (AFAIK) these are the only planned manual audits...don't want a return of 'Coming Soon' :) |
👍. at least, this. yeah |
lighthouse-core/config/default.js
Outdated
}, | ||
}, | ||
"categories": { | ||
"pwa": { | ||
"name": "Progressive Web App", | ||
"weight": 1, | ||
"description": "These audits validate the aspects of a Progressive Web App. They are a subset of the [PWA Checklist](https://developers.google.com/web/progressive-web-apps/checklist).", | ||
"description": "These audits validate the aspects of a Progressive Web App. They are a subset¹ of the baseline [PWA Checklist](https://developers.google.com/web/progressive-web-apps/checklist).", |
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 also gets rid of the strange looking 1 that doesn't really look like a footnote at the beginning of the group :)
}, | ||
"a11y-aria": { | ||
"title": "ARIA Attributes Follow Best Practices", | ||
"description": "Screen readers and other assitive technologies require annotations to understand otherwise ambiguous content." | ||
"description": "Screen readers and other assistive technologies require annotations to understand otherwise ambiguous content." |
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.
nice I was wondering if this was going to sit around until we changed all the group descriptions haha
// Render manual audits after passing. | ||
const auditsGroupedByGroup = /** @type {!Object<string, | ||
!Array<!ReportRenderer.AuditJSON>>} */ ({}); | ||
manualAudits.forEach(audit => { |
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 feels a bit like overkill right now, do we think we have any need for manual audits to be broken up in the same category?
PTA. Kept the class but added |
Do you really feel strongly about the base class? It saves three or four total lines of code, and the |
Seemed cool to me. I tried it out:
eh. not a huge deal to me either way. |
Explicit code/class hierarchy is not a bad thing, even if it just saves a few lines. We can revisit later. |
I was wrong, it was actually the other way, +13 lines |
Fixes #2059
This PR adds the notion of a "manual" audit, an audit which does not require any artifacts but renders in the report like a normal audit. We're using @patrickhulce's awesome report grouping to group the manual audits together (below passing audits).
I chose the grey "-" instead of the blue information "i" because we need some way to distinguish these audits from normal (automated) audits run by LH. But LMK what ya'll think.
Also modernizes samples_v2.json