Skip to content
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(config): add new PWA category groups #6396

Merged
merged 8 commits into from
Oct 26, 2018
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 43 additions & 21 deletions lighthouse-cli/test/cli/__snapshots__/index-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ Object {
Object {
"path": "themed-omnibox",
},
Object {
"path": "manifest-short-name-length",
},
Object {
"path": "content-width",
},
Expand Down Expand Up @@ -814,52 +811,59 @@ Object {
"pwa": Object {
"auditRefs": Array [
Object {
"id": "load-fast-enough-for-pwa",
"weight": 7,
},
Object {
"group": "pwa-fast-reliable",
"id": "works-offline",
"weight": 5,
},
Object {
"id": "webapp-install-banner",
"weight": 3,
"group": "pwa-fast-reliable",
"id": "load-fast-enough-for-pwa",
"weight": 7,
},
Object {
"group": "pwa-installable",
"id": "is-on-https",
"weight": 2,
},
Object {
"id": "redirects-http",
"weight": 2,
},
Object {
"id": "viewport",
"weight": 2,
},
Object {
"group": "pwa-installable",
"id": "service-worker",
"weight": 1,
},
Object {
"id": "without-javascript",
"weight": 1,
"group": "pwa-installable",
"id": "webapp-install-banner",
"weight": 3,
},
Object {
"group": "pwa-engaging",
"id": "redirects-http",
"weight": 2,
},
Object {
"group": "pwa-engaging",
"id": "splash-screen",
"weight": 1,
},
Object {
"group": "pwa-engaging",
"id": "themed-omnibox",
"weight": 1,
},
Object {
"group": "pwa-engaging",
"id": "viewport",
"weight": 2,
},
Object {
"group": "pwa-engaging",
"id": "content-width",
"weight": 1,
},
Object {
"id": "manifest-short-name-length",
"weight": 0,
"group": "pwa-engaging",
"id": "without-javascript",
"weight": 1,
},
Object {
"id": "pwa-cross-browser",
Expand Down Expand Up @@ -993,6 +997,15 @@ Object {
"metrics": Object {
"title": "Metrics",
},
"pwa-engaging": Object {
"title": "Engaging",
},
"pwa-fast-reliable": Object {
"title": "Fast and reliable",
},
"pwa-installable": Object {
"title": "Installable",
},
"seo-content": Object {
"description": "Format your HTML in a way that enables crawlers to better understand your app’s content.",
"title": "Content Best Practices",
Expand Down Expand Up @@ -1245,6 +1258,15 @@ Object {
"metrics": Object {
"title": "Metrics",
},
"pwa-engaging": Object {
"title": "Engaging",
},
"pwa-fast-reliable": Object {
"title": "Fast and reliable",
},
"pwa-installable": Object {
"title": "Installable",
},
"seo-content": Object {
"description": "Format your HTML in a way that enables crawlers to better understand your app’s content.",
"title": "Content Best Practices",
Expand Down
66 changes: 0 additions & 66 deletions lighthouse-core/audits/manifest-short-name-length.js

This file was deleted.

43 changes: 26 additions & 17 deletions lighthouse-core/config/default-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ const defaultConfig = {
'webapp-install-banner',
'splash-screen',
'themed-omnibox',
'manifest-short-name-length',
'content-width',
'image-aspect-ratio',
'deprecations',
Expand Down Expand Up @@ -225,6 +224,15 @@ const defaultConfig = {
title: str_(UIStrings.diagnosticsGroupTitle),
description: str_(UIStrings.diagnosticsGroupDescription),
},
'pwa-fast-reliable': {
title: 'Fast and reliable',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we start with these being str_ ? :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we start with these being str_ ?

good call, done

},
'pwa-installable': {
title: 'Installable',
},
'pwa-engaging': {
title: 'Engaging',
},
'a11y-color-contrast': {
title: 'Color Contrast Is Satisfactory',
description: 'These are opportunities to improve the legibility of your content.',
Expand Down Expand Up @@ -317,22 +325,23 @@ const defaultConfig = {
'[PWA Checklist](https://developers.google.com/web/progressive-web-apps/checklist) but are ' +
'not automatically checked by Lighthouse. They do not affect your score but it\'s important that you verify them manually.',
auditRefs: [
// Most difficult and critical for good UX
{id: 'load-fast-enough-for-pwa', weight: 7}, // can't be green in the category without being fast
{id: 'works-offline', weight: 5},
// Encompasses most of the other checks
{id: 'webapp-install-banner', weight: 3},
// Important but not too difficult
{id: 'is-on-https', weight: 2},
{id: 'redirects-http', weight: 2},
{id: 'viewport', weight: 2},
// Relatively easy checkboxes to tick with minimal value on their own
{id: 'service-worker', weight: 1},
{id: 'without-javascript', weight: 1},
{id: 'splash-screen', weight: 1},
{id: 'themed-omnibox', weight: 1},
{id: 'content-width', weight: 1},
{id: 'manifest-short-name-length', weight: 0},
// Fast and Reliable
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey this lines up exactly with "most difficult and critical for good UX" :D

do we need to re-order the lines? it lined up with "fast" and then "reliable" already ;)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to re-order the lines?

We don't need to, but since this will end up being a pretty big change in the html report, it seems better to have them in the same order

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, ha, nm, I see what you mean. SGTM :)

{id: 'works-offline', weight: 5, group: 'pwa-fast-reliable'},
{id: 'load-fast-enough-for-pwa', weight: 7, group: 'pwa-fast-reliable'},

// Installable
{id: 'is-on-https', weight: 2, group: 'pwa-installable'},
{id: 'service-worker', weight: 1, group: 'pwa-installable'},
{id: 'webapp-install-banner', weight: 3, group: 'pwa-installable'},

// Engaging
{id: 'redirects-http', weight: 2, group: 'pwa-engaging'}, // Arguably not engaging
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with the new in-yo-face red X insecure I think it works, I'm always a bit taken aback on surge.sh URLs these days on mobile canary!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with the new in-yo-face red X insecure I think it works

ha, fair point. I've removed the comment and anyone who objects can bring it up in the tracking bug :)

{id: 'splash-screen', weight: 1, group: 'pwa-engaging'},
{id: 'themed-omnibox', weight: 1, group: 'pwa-engaging'},
{id: 'viewport', weight: 2, group: 'pwa-engaging'},
{id: 'content-width', weight: 1, group: 'pwa-engaging'},
{id: 'without-javascript', weight: 1, group: 'pwa-engaging'},

// Manual audits
{id: 'pwa-cross-browser', weight: 0},
{id: 'pwa-page-transitions', weight: 0},
Expand Down
94 changes: 0 additions & 94 deletions lighthouse-core/test/audits/manifest-short-name-length-test.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ describe('CategoryRenderer', () => {
const category = JSON.parse(JSON.stringify(origCategory));
category.auditRefs.forEach(audit => audit.result.score = 0);
const elem = renderer.render(category, sampleResults.categoryGroups);
const passedAudits = elem.querySelectorAll('.lh-passed-audits > .lh-audit');
const failedAudits = elem.querySelectorAll('.lh-failed-audits > .lh-audit');
const passedAudits = elem.querySelectorAll('.lh-passed-audits .lh-audit');
const failedAudits = elem.querySelectorAll('.lh-failed-audits .lh-audit');

assert.equal(passedAudits.length, 0);
assert.equal(failedAudits.length, 11);
Expand Down
Loading