From 54a9248ffd3a44c95e99a96297928b005ef2677d Mon Sep 17 00:00:00 2001 From: Brendan Kenny Date: Thu, 25 Oct 2018 16:12:22 -0700 Subject: [PATCH 1/8] core(config): add new PWA category groups delete manifest-short-name-length audit --- .../test/cli/__snapshots__/index-test.js.snap | 7 -- .../audits/manifest-short-name-length.js | 66 ------------- lighthouse-core/config/default-config.js | 46 +++++---- .../audits/manifest-short-name-length-test.js | 94 ------------------- lighthouse-core/test/results/sample_v2.json | 12 --- proto/sample_v2_round_trip.json | 11 --- 6 files changed, 29 insertions(+), 207 deletions(-) delete mode 100644 lighthouse-core/audits/manifest-short-name-length.js delete mode 100644 lighthouse-core/test/audits/manifest-short-name-length-test.js diff --git a/lighthouse-cli/test/cli/__snapshots__/index-test.js.snap b/lighthouse-cli/test/cli/__snapshots__/index-test.js.snap index 716e9943a9e3..9b243771f57c 100644 --- a/lighthouse-cli/test/cli/__snapshots__/index-test.js.snap +++ b/lighthouse-cli/test/cli/__snapshots__/index-test.js.snap @@ -72,9 +72,6 @@ Object { Object { "path": "themed-omnibox", }, - Object { - "path": "manifest-short-name-length", - }, Object { "path": "content-width", }, @@ -857,10 +854,6 @@ Object { "id": "content-width", "weight": 1, }, - Object { - "id": "manifest-short-name-length", - "weight": 0, - }, Object { "id": "pwa-cross-browser", "weight": 0, diff --git a/lighthouse-core/audits/manifest-short-name-length.js b/lighthouse-core/audits/manifest-short-name-length.js deleted file mode 100644 index 7a0041d20861..000000000000 --- a/lighthouse-core/audits/manifest-short-name-length.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @license Copyright 2016 Google Inc. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - */ -'use strict'; - -const Audit = require('./audit'); -const ManifestValues = require('../gather/computed/manifest-values'); - -class ManifestShortNameLength extends Audit { - /** - * @return {LH.Audit.Meta} - */ - static get meta() { - return { - id: 'manifest-short-name-length', - title: 'The `short_name` won\'t be truncated on the homescreen', - failureTitle: 'The `short_name` will be truncated on the homescreen', - description: 'Make your app\'s `short_name` fewer than 12 characters to ' + - 'ensure that it\'s not truncated on homescreens. [Learn ' + - 'more](https://developers.google.com/web/tools/lighthouse/audits/manifest-short_name-is-not-truncated).', - requiredArtifacts: ['Manifest'], - }; - } - - /** - * @param {LH.Artifacts} artifacts - * @param {LH.Audit.Context} context - * @return {Promise} - */ - static async audit(artifacts, context) { - const manifestValues = await ManifestValues.request(artifacts.Manifest, context); - // If there's no valid manifest, this audit is not applicable - if (manifestValues.isParseFailure) { - return { - rawValue: true, - notApplicable: true, - }; - } - - const shortNameCheck = manifestValues.allChecks.find(i => i.id === 'hasShortName'); - const shortNameLengthCheck = manifestValues.allChecks.find(i => i.id === 'shortNameLength'); - - // If there's no short_name present, this audit is not applicable - if (shortNameCheck && !shortNameCheck.passing) { - return { - rawValue: true, - notApplicable: true, - }; - } - // Shortname is present, but it's too long - if (shortNameLengthCheck && !shortNameLengthCheck.passing) { - return { - rawValue: false, - explanation: `Failure: ${shortNameLengthCheck.failureText}.`, - }; - } - // Has a shortname that's under the threshold - return { - rawValue: true, - }; - } -} - -module.exports = ManifestShortNameLength; diff --git a/lighthouse-core/config/default-config.js b/lighthouse-core/config/default-config.js index 547a1296ba05..ac2aeb6b26d2 100644 --- a/lighthouse-core/config/default-config.js +++ b/lighthouse-core/config/default-config.js @@ -116,7 +116,6 @@ const defaultConfig = { 'webapp-install-banner', 'splash-screen', 'themed-omnibox', - 'manifest-short-name-length', 'content-width', 'image-aspect-ratio', 'deprecations', @@ -225,6 +224,18 @@ const defaultConfig = { title: str_(UIStrings.diagnosticsGroupTitle), description: str_(UIStrings.diagnosticsGroupDescription), }, + 'pwa-fast-reliable': { + title: 'Fast and reliable', + description: 'These are measures of how quickly the page loads, regardless of the quality of the network.', + }, + 'pwa-installable': { + title: 'Installable', + description: 'Browsers can proactively prompt users to add your app to their homescreen, which can lead to higher engagement. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/install-prompt).', + }, + 'pwa-engaging': { + title: 'Engaging', + description: 'These are opportunities for the page to improve user experience.', + }, 'a11y-color-contrast': { title: 'Color Contrast Is Satisfactory', description: 'These are opportunities to improve the legibility of your content.', @@ -317,22 +328,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 + {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 + {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}, diff --git a/lighthouse-core/test/audits/manifest-short-name-length-test.js b/lighthouse-core/test/audits/manifest-short-name-length-test.js deleted file mode 100644 index 705e5b3349ec..000000000000 --- a/lighthouse-core/test/audits/manifest-short-name-length-test.js +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @license Copyright 2016 Google Inc. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - */ -'use strict'; - -const ManifestShortNameLengthAudit = require('../../audits/manifest-short-name-length.js'); -const assert = require('assert'); -const manifestParser = require('../../lib/manifest-parser'); - -const EXAMPLE_MANIFEST_URL = 'https://example.com/manifest.json'; -const EXAMPLE_DOC_URL = 'https://example.com/index.html'; - -function generateMockArtifacts() { - return { - Manifest: null, - }; -} -function generateMockAuditContext() { - return { - computedCache: new Map(), - }; -} - -/* eslint-env jest */ - -describe('Manifest: short_name_length audit', () => { - it('marked as notApplicable if page had no manifest', () => { - const artifacts = generateMockArtifacts(); - artifacts.Manifest = null; - const context = generateMockAuditContext(); - - return ManifestShortNameLengthAudit.audit(artifacts, context).then(result => { - assert.strictEqual(result.rawValue, true); - assert.strictEqual(result.notApplicable, true); - }); - }); - - it('marked as notApplicable if manifest is present but empty', () => { - const artifacts = generateMockArtifacts(); - artifacts.Manifest = manifestParser('{}', EXAMPLE_MANIFEST_URL, EXAMPLE_DOC_URL); - const context = generateMockAuditContext(); - return ManifestShortNameLengthAudit.audit(artifacts, context).then(result => { - assert.strictEqual(result.rawValue, true); - assert.strictEqual(result.notApplicable, true); - }); - }); - - it('marked as notApplicable when a manifest contains no short_name', () => { - const artifacts = generateMockArtifacts(); - const manifestSrc = JSON.stringify({ - name: 'i\'m much longer than the recommended size', - }); - artifacts.Manifest = manifestParser(manifestSrc, EXAMPLE_MANIFEST_URL, EXAMPLE_DOC_URL); - const context = generateMockAuditContext(); - return ManifestShortNameLengthAudit.audit(artifacts, context).then(result => { - assert.strictEqual(result.rawValue, true); - assert.strictEqual(result.notApplicable, true); - assert.equal(result.explanation, undefined); - }); - }); - - // Need to disable camelcase check for dealing with short_name. - /* eslint-disable camelcase */ - it('fails when a manifest contains a too long short_name', () => { - const artifacts = generateMockArtifacts(); - const manifestSrc = JSON.stringify({ - short_name: 'i\'m much longer than the recommended size', - }); - artifacts.Manifest = manifestParser(manifestSrc, EXAMPLE_MANIFEST_URL, EXAMPLE_DOC_URL); - const context = generateMockAuditContext(); - return ManifestShortNameLengthAudit.audit(artifacts, context).then(result => { - assert.equal(result.rawValue, false); - assert.ok(result.explanation.includes('without truncation'), result.explanation); - assert.equal(result.notApplicable, undefined); - }); - }); - - it('passes when a manifest contains a short_name', () => { - const artifacts = generateMockArtifacts(); - const manifestSrc = JSON.stringify({ - short_name: 'Lighthouse', - }); - artifacts.Manifest = manifestParser(manifestSrc, EXAMPLE_MANIFEST_URL, EXAMPLE_DOC_URL); - const context = generateMockAuditContext(); - return ManifestShortNameLengthAudit.audit(artifacts, context).then(result => { - assert.equal(result.rawValue, true); - assert.equal(result.explanation, undefined); - assert.equal(result.notApplicable, undefined); - }); - }); - /* eslint-enable camelcase */ -}); diff --git a/lighthouse-core/test/results/sample_v2.json b/lighthouse-core/test/results/sample_v2.json index fa7f08eb1b08..cf5b9af6f33d 100644 --- a/lighthouse-core/test/results/sample_v2.json +++ b/lighthouse-core/test/results/sample_v2.json @@ -523,14 +523,6 @@ ] } }, - "manifest-short-name-length": { - "id": "manifest-short-name-length", - "title": "The `short_name` won't be truncated on the homescreen", - "description": "Make your app's `short_name` fewer than 12 characters to ensure that it's not truncated on homescreens. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/manifest-short_name-is-not-truncated).", - "score": null, - "scoreDisplayMode": "not-applicable", - "rawValue": true - }, "content-width": { "id": "content-width", "title": "Content is sized correctly for the viewport", @@ -2969,10 +2961,6 @@ "id": "content-width", "weight": 1 }, - { - "id": "manifest-short-name-length", - "weight": 0 - }, { "id": "pwa-cross-browser", "weight": 0 diff --git a/proto/sample_v2_round_trip.json b/proto/sample_v2_round_trip.json index b451788703e7..97b452c2392b 100644 --- a/proto/sample_v2_round_trip.json +++ b/proto/sample_v2_round_trip.json @@ -1227,13 +1227,6 @@ "scoreDisplayMode": "manual", "title": "The user's focus is directed to new content added to the page" }, - "manifest-short-name-length": { - "description": "Make your app's `short_name` fewer than 12 characters to ensure that it's not truncated on homescreens. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/manifest-short_name-is-not-truncated).", - "id": "manifest-short-name-length", - "score": null, - "scoreDisplayMode": "not_applicable", - "title": "The `short_name` won't be truncated on the homescreen" - }, "meta-description": { "description": "Meta descriptions may be included in search results to concisely summarize page content. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/description).", "id": "meta-description", @@ -3082,10 +3075,6 @@ "id": "content-width", "weight": 1.0 }, - { - "id": "manifest-short-name-length", - "weight": 0.0 - }, { "id": "pwa-cross-browser", "weight": 0.0 From 2b65d5e2084fde9e63e6fdfd9224f78e35b27082 Mon Sep 17 00:00:00 2001 From: Brendan Kenny Date: Thu, 25 Oct 2018 16:31:32 -0700 Subject: [PATCH 2/8] delete descriptions --- lighthouse-core/config/default-config.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/lighthouse-core/config/default-config.js b/lighthouse-core/config/default-config.js index ac2aeb6b26d2..10f5da5d083c 100644 --- a/lighthouse-core/config/default-config.js +++ b/lighthouse-core/config/default-config.js @@ -226,15 +226,12 @@ const defaultConfig = { }, 'pwa-fast-reliable': { title: 'Fast and reliable', - description: 'These are measures of how quickly the page loads, regardless of the quality of the network.', }, 'pwa-installable': { title: 'Installable', - description: 'Browsers can proactively prompt users to add your app to their homescreen, which can lead to higher engagement. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/install-prompt).', }, 'pwa-engaging': { title: 'Engaging', - description: 'These are opportunities for the page to improve user experience.', }, 'a11y-color-contrast': { title: 'Color Contrast Is Satisfactory', From 5d42c2735e2841209ef645a075a1694cc43ad4b2 Mon Sep 17 00:00:00 2001 From: Brendan Kenny Date: Thu, 25 Oct 2018 16:46:58 -0700 Subject: [PATCH 3/8] sample and snapshot --- .../test/cli/__snapshots__/index-test.js.snap | 59 +++++++++++++----- lighthouse-core/test/results/sample_v2.json | 62 ++++++++++++------- 2 files changed, 85 insertions(+), 36 deletions(-) diff --git a/lighthouse-cli/test/cli/__snapshots__/index-test.js.snap b/lighthouse-cli/test/cli/__snapshots__/index-test.js.snap index 9b243771f57c..5ec95b21fb7f 100644 --- a/lighthouse-cli/test/cli/__snapshots__/index-test.js.snap +++ b/lighthouse-cli/test/cli/__snapshots__/index-test.js.snap @@ -811,47 +811,58 @@ 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, + "group": "pwa-installable", + "id": "service-worker", + "weight": 1, }, Object { - "id": "viewport", + "group": "pwa-installable", + "id": "webapp-install-banner", + "weight": 3, + }, + Object { + "group": "pwa-engaging", + "id": "redirects-http", "weight": 2, }, Object { - "id": "service-worker", + "group": "pwa-engaging", + "id": "splash-screen", "weight": 1, }, Object { - "id": "without-javascript", + "group": "pwa-engaging", + "id": "themed-omnibox", "weight": 1, }, Object { - "id": "splash-screen", - "weight": 1, + "group": "pwa-engaging", + "id": "viewport", + "weight": 2, }, Object { - "id": "themed-omnibox", + "group": "pwa-engaging", + "id": "content-width", "weight": 1, }, Object { - "id": "content-width", + "group": "pwa-engaging", + "id": "without-javascript", "weight": 1, }, Object { @@ -986,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", @@ -1238,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", diff --git a/lighthouse-core/test/results/sample_v2.json b/lighthouse-core/test/results/sample_v2.json index cf5b9af6f33d..4a03e2463398 100644 --- a/lighthouse-core/test/results/sample_v2.json +++ b/lighthouse-core/test/results/sample_v2.json @@ -2917,49 +2917,60 @@ "description": "These checks validate the aspects of a Progressive Web App, as specified by the baseline [PWA Checklist](https://developers.google.com/web/progressive-web-apps/checklist).", "manualDescription": "These checks are required by the baseline [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": [ - { - "id": "load-fast-enough-for-pwa", - "weight": 7 - }, { "id": "works-offline", - "weight": 5 + "weight": 5, + "group": "pwa-fast-reliable" }, { - "id": "webapp-install-banner", - "weight": 3 + "id": "load-fast-enough-for-pwa", + "weight": 7, + "group": "pwa-fast-reliable" }, { "id": "is-on-https", - "weight": 2 - }, - { - "id": "redirects-http", - "weight": 2 + "weight": 2, + "group": "pwa-installable" }, { - "id": "viewport", - "weight": 2 + "id": "service-worker", + "weight": 1, + "group": "pwa-installable" }, { - "id": "service-worker", - "weight": 1 + "id": "webapp-install-banner", + "weight": 3, + "group": "pwa-installable" }, { - "id": "without-javascript", - "weight": 1 + "id": "redirects-http", + "weight": 2, + "group": "pwa-engaging" }, { "id": "splash-screen", - "weight": 1 + "weight": 1, + "group": "pwa-engaging" }, { "id": "themed-omnibox", - "weight": 1 + "weight": 1, + "group": "pwa-engaging" + }, + { + "id": "viewport", + "weight": 2, + "group": "pwa-engaging" }, { "id": "content-width", - "weight": 1 + "weight": 1, + "group": "pwa-engaging" + }, + { + "id": "without-javascript", + "weight": 1, + "group": "pwa-engaging" }, { "id": "pwa-cross-browser", @@ -3357,6 +3368,15 @@ "title": "Diagnostics", "description": "More information about the performance of your application." }, + "pwa-fast-reliable": { + "title": "Fast and reliable" + }, + "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." From 0787f2cefe8be8e1c12d4dccd2857cae552b43f4 Mon Sep 17 00:00:00 2001 From: Brendan Kenny Date: Thu, 25 Oct 2018 20:28:52 -0700 Subject: [PATCH 4/8] proto and renderer test --- .../html/renderer/category-renderer-test.js | 4 +- proto/sample_v2_round_trip.json | 50 +++++++++++++------ 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/lighthouse-core/test/report/html/renderer/category-renderer-test.js b/lighthouse-core/test/report/html/renderer/category-renderer-test.js index 77e890be0125..0d4cb0751e2a 100644 --- a/lighthouse-core/test/report/html/renderer/category-renderer-test.js +++ b/lighthouse-core/test/report/html/renderer/category-renderer-test.js @@ -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); diff --git a/proto/sample_v2_round_trip.json b/proto/sample_v2_round_trip.json index 97b452c2392b..534e1de0f638 100644 --- a/proto/sample_v2_round_trip.json +++ b/proto/sample_v2_round_trip.json @@ -3032,47 +3032,58 @@ "pwa": { "auditRefs": [ { - "id": "load-fast-enough-for-pwa", - "weight": 7.0 - }, - { + "group": "pwa-fast-reliable", "id": "works-offline", "weight": 5.0 }, { - "id": "webapp-install-banner", - "weight": 3.0 + "group": "pwa-fast-reliable", + "id": "load-fast-enough-for-pwa", + "weight": 7.0 }, { + "group": "pwa-installable", "id": "is-on-https", "weight": 2.0 }, { - "id": "redirects-http", - "weight": 2.0 + "group": "pwa-installable", + "id": "service-worker", + "weight": 1.0 }, { - "id": "viewport", + "group": "pwa-installable", + "id": "webapp-install-banner", + "weight": 3.0 + }, + { + "group": "pwa-engaging", + "id": "redirects-http", "weight": 2.0 }, { - "id": "service-worker", + "group": "pwa-engaging", + "id": "splash-screen", "weight": 1.0 }, { - "id": "without-javascript", + "group": "pwa-engaging", + "id": "themed-omnibox", "weight": 1.0 }, { - "id": "splash-screen", - "weight": 1.0 + "group": "pwa-engaging", + "id": "viewport", + "weight": 2.0 }, { - "id": "themed-omnibox", + "group": "pwa-engaging", + "id": "content-width", "weight": 1.0 }, { - "id": "content-width", + "group": "pwa-engaging", + "id": "without-javascript", "weight": 1.0 }, { @@ -3211,6 +3222,15 @@ "metrics": { "title": "Metrics" }, + "pwa-engaging": { + "title": "Engaging" + }, + "pwa-fast-reliable": { + "title": "Fast and reliable" + }, + "pwa-installable": { + "title": "Installable" + }, "seo-content": { "description": "Format your HTML in a way that enables crawlers to better understand your app\u2019s content.", "title": "Content Best Practices" From ee999ca7679e3aa75a88ef5cca25102e880d55da Mon Sep 17 00:00:00 2001 From: Brendan Kenny Date: Fri, 26 Oct 2018 10:32:28 -0700 Subject: [PATCH 5/8] feedback --- lighthouse-core/config/default-config.js | 21 +++++++++-------- lighthouse-core/lib/i18n/en-US.json | 12 ++++++++++ lighthouse-core/test/results/sample_v2.json | 25 ++++++++++++++------- proto/sample_v2_round_trip.json | 16 ++++++------- 4 files changed, 49 insertions(+), 25 deletions(-) diff --git a/lighthouse-core/config/default-config.js b/lighthouse-core/config/default-config.js index 10f5da5d083c..828e5e34ae8d 100644 --- a/lighthouse-core/config/default-config.js +++ b/lighthouse-core/config/default-config.js @@ -31,6 +31,12 @@ const UIStrings = { diagnosticsGroupTitle: 'Diagnostics', /** Description of the diagnostics section of the Performance category. Within this section are audits with non-imperative titles that provide more detail on the page's page load performance characteristics. Whereas the 'Opportunities' suggest an action along with expected time savings, diagnostics do not. Within this section, the user may read the details and deduce additional actions they could take. */ diagnosticsGroupDescription: 'More information about the performance of your application.', + /** Title of the Fast and Reliable section of the web app category. Within this section are audits that check if the web site loaded quickly and can reliably load even if the internet connection is very slow or goes offline. */ + pwaFastReliableGroupTitle: 'Fast and reliable', + /** Title of the Installable section of the web app category. Within this section are audits that check if Chrome supports installing the web site as an app on their device. */ + pwaInstallableGroupTitle: 'Installable', + /** Title of the Engaging section of the web app category. Within this section are audits that check if the developer has taken advantage of features to make their web page more enjoyable and engaging for the user. */ + pwaEngagingGroupTitle: 'Engaging', }; const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); @@ -225,13 +231,13 @@ const defaultConfig = { description: str_(UIStrings.diagnosticsGroupDescription), }, 'pwa-fast-reliable': { - title: 'Fast and reliable', + title: str_(UIStrings.pwaFastReliableGroupTitle), }, 'pwa-installable': { - title: 'Installable', + title: str_(UIStrings.pwaInstallableGroupTitle), }, 'pwa-engaging': { - title: 'Engaging', + title: str_(UIStrings.pwaEngagingGroupTitle), }, 'a11y-color-contrast': { title: 'Color Contrast Is Satisfactory', @@ -326,22 +332,19 @@ const defaultConfig = { 'not automatically checked by Lighthouse. They do not affect your score but it\'s important that you verify them manually.', auditRefs: [ // Fast and Reliable - {id: 'works-offline', weight: 5, group: 'pwa-fast-reliable'}, {id: 'load-fast-enough-for-pwa', weight: 7, group: 'pwa-fast-reliable'}, - + {id: 'works-offline', weight: 5, 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 + {id: 'redirects-http', weight: 2, group: 'pwa-engaging'}, {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: 'viewport', weight: 2, 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}, diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index 6b3f5e728665..cb2b606f7ef9 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -383,6 +383,18 @@ "message": "Performance", "description": "Title of the Performance category of audits. Equivalent to 'Web performance', this term is inclusive of all web page speed and loading optimization topics. Also used as a label of a score gauge; try to limit to 20 characters." }, + "lighthouse-core/config/default-config.js | pwaEngagingGroupTitle": { + "message": "Engaging", + "description": "Title of the Engaging section of the web app category. Within this section are audits that check if the developer has taken advantage of features to make their web page more enjoyable and engaging for the user." + }, + "lighthouse-core/config/default-config.js | pwaFastReliableGroupTitle": { + "message": "Fast and reliable", + "description": "Title of the Fast and Reliable section of the web app category. Within this section are audits that check if the web site loaded quickly and can reliably load even if the internet connection is very slow or goes offline." + }, + "lighthouse-core/config/default-config.js | pwaInstallableGroupTitle": { + "message": "Installable", + "description": "Title of the Installable section of the web app category. Within this section are audits that check if Chrome supports installing the web site as an app on their device." + }, "lighthouse-core/lib/i18n/i18n.js | columnCacheTTL": { "message": "Cache TTL", "description": "Label for the TTL column in data tables, entries will be the time to live value of the cache header on a web resource" diff --git a/lighthouse-core/test/results/sample_v2.json b/lighthouse-core/test/results/sample_v2.json index 4a03e2463398..b05b3c5fd9c3 100644 --- a/lighthouse-core/test/results/sample_v2.json +++ b/lighthouse-core/test/results/sample_v2.json @@ -2918,13 +2918,13 @@ "manualDescription": "These checks are required by the baseline [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": [ { - "id": "works-offline", - "weight": 5, + "id": "load-fast-enough-for-pwa", + "weight": 7, "group": "pwa-fast-reliable" }, { - "id": "load-fast-enough-for-pwa", - "weight": 7, + "id": "works-offline", + "weight": 5, "group": "pwa-fast-reliable" }, { @@ -2958,13 +2958,13 @@ "group": "pwa-engaging" }, { - "id": "viewport", - "weight": 2, + "id": "content-width", + "weight": 1, "group": "pwa-engaging" }, { - "id": "content-width", - "weight": 1, + "id": "viewport", + "weight": 2, "group": "pwa-engaging" }, { @@ -3808,6 +3808,15 @@ ], "lighthouse-core/config/default-config.js | diagnosticsGroupDescription": [ "categoryGroups.diagnostics.description" + ], + "lighthouse-core/config/default-config.js | pwaFastReliableGroupTitle": [ + "categoryGroups[pwa-fast-reliable].title" + ], + "lighthouse-core/config/default-config.js | pwaInstallableGroupTitle": [ + "categoryGroups[pwa-installable].title" + ], + "lighthouse-core/config/default-config.js | pwaEngagingGroupTitle": [ + "categoryGroups[pwa-engaging].title" ] } } diff --git a/proto/sample_v2_round_trip.json b/proto/sample_v2_round_trip.json index 534e1de0f638..591eda401208 100644 --- a/proto/sample_v2_round_trip.json +++ b/proto/sample_v2_round_trip.json @@ -3033,13 +3033,13 @@ "auditRefs": [ { "group": "pwa-fast-reliable", - "id": "works-offline", - "weight": 5.0 + "id": "load-fast-enough-for-pwa", + "weight": 7.0 }, { "group": "pwa-fast-reliable", - "id": "load-fast-enough-for-pwa", - "weight": 7.0 + "id": "works-offline", + "weight": 5.0 }, { "group": "pwa-installable", @@ -3073,13 +3073,13 @@ }, { "group": "pwa-engaging", - "id": "viewport", - "weight": 2.0 + "id": "content-width", + "weight": 1.0 }, { "group": "pwa-engaging", - "id": "content-width", - "weight": 1.0 + "id": "viewport", + "weight": 2.0 }, { "group": "pwa-engaging", From a57facfcbd6aa66a6835a44a2f2eb347be37a04a Mon Sep 17 00:00:00 2001 From: Brendan Kenny Date: Fri, 26 Oct 2018 10:58:16 -0700 Subject: [PATCH 6/8] snapshot --- .../test/cli/__snapshots__/index-test.js.snap | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lighthouse-cli/test/cli/__snapshots__/index-test.js.snap b/lighthouse-cli/test/cli/__snapshots__/index-test.js.snap index 5ec95b21fb7f..c3108f2e1422 100644 --- a/lighthouse-cli/test/cli/__snapshots__/index-test.js.snap +++ b/lighthouse-cli/test/cli/__snapshots__/index-test.js.snap @@ -812,13 +812,13 @@ Object { "auditRefs": Array [ Object { "group": "pwa-fast-reliable", - "id": "works-offline", - "weight": 5, + "id": "load-fast-enough-for-pwa", + "weight": 7, }, Object { "group": "pwa-fast-reliable", - "id": "load-fast-enough-for-pwa", - "weight": 7, + "id": "works-offline", + "weight": 5, }, Object { "group": "pwa-installable", @@ -852,13 +852,13 @@ Object { }, Object { "group": "pwa-engaging", - "id": "viewport", - "weight": 2, + "id": "content-width", + "weight": 1, }, Object { "group": "pwa-engaging", - "id": "content-width", - "weight": 1, + "id": "viewport", + "weight": 2, }, Object { "group": "pwa-engaging", From 37ee91d3bcf95aa09059195fa8a00c5240296448 Mon Sep 17 00:00:00 2001 From: Brendan Kenny Date: Fri, 26 Oct 2018 11:19:12 -0700 Subject: [PATCH 7/8] desc --- lighthouse-core/config/default-config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lighthouse-core/config/default-config.js b/lighthouse-core/config/default-config.js index 828e5e34ae8d..d26faa2f7a18 100644 --- a/lighthouse-core/config/default-config.js +++ b/lighthouse-core/config/default-config.js @@ -326,7 +326,7 @@ const defaultConfig = { }, 'pwa': { title: 'Progressive Web App', - description: 'These checks validate the aspects of a Progressive Web App, as specified by the baseline [PWA Checklist](https://developers.google.com/web/progressive-web-apps/checklist).', + description: 'These checks validate the aspects of a Progressive Web App. [Learn more](https://developers.google.com/web/progressive-web-apps/checklist).', manualDescription: 'These checks are required by the baseline ' + '[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.', From e6efeed141314a646f6cd7b5df78940bf984768b Mon Sep 17 00:00:00 2001 From: Brendan Kenny Date: Fri, 26 Oct 2018 11:35:57 -0700 Subject: [PATCH 8/8] jsonprotosnap --- lighthouse-cli/test/cli/__snapshots__/index-test.js.snap | 2 +- lighthouse-core/test/results/sample_v2.json | 2 +- proto/sample_v2_round_trip.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lighthouse-cli/test/cli/__snapshots__/index-test.js.snap b/lighthouse-cli/test/cli/__snapshots__/index-test.js.snap index c3108f2e1422..2c64d0662fa0 100644 --- a/lighthouse-cli/test/cli/__snapshots__/index-test.js.snap +++ b/lighthouse-cli/test/cli/__snapshots__/index-test.js.snap @@ -878,7 +878,7 @@ Object { "weight": 0, }, ], - "description": "These checks validate the aspects of a Progressive Web App, as specified by the baseline [PWA Checklist](https://developers.google.com/web/progressive-web-apps/checklist).", + "description": "These checks validate the aspects of a Progressive Web App. [Learn more](https://developers.google.com/web/progressive-web-apps/checklist).", "manualDescription": "These checks are required by the baseline [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.", "title": "Progressive Web App", }, diff --git a/lighthouse-core/test/results/sample_v2.json b/lighthouse-core/test/results/sample_v2.json index b05b3c5fd9c3..2442879ba057 100644 --- a/lighthouse-core/test/results/sample_v2.json +++ b/lighthouse-core/test/results/sample_v2.json @@ -2914,7 +2914,7 @@ }, "pwa": { "title": "Progressive Web App", - "description": "These checks validate the aspects of a Progressive Web App, as specified by the baseline [PWA Checklist](https://developers.google.com/web/progressive-web-apps/checklist).", + "description": "These checks validate the aspects of a Progressive Web App. [Learn more](https://developers.google.com/web/progressive-web-apps/checklist).", "manualDescription": "These checks are required by the baseline [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": [ { diff --git a/proto/sample_v2_round_trip.json b/proto/sample_v2_round_trip.json index 591eda401208..f6c43f781f17 100644 --- a/proto/sample_v2_round_trip.json +++ b/proto/sample_v2_round_trip.json @@ -3099,7 +3099,7 @@ "weight": 0.0 } ], - "description": "These checks validate the aspects of a Progressive Web App, as specified by the baseline [PWA Checklist](https://developers.google.com/web/progressive-web-apps/checklist).", + "description": "These checks validate the aspects of a Progressive Web App. [Learn more](https://developers.google.com/web/progressive-web-apps/checklist).", "id": "pwa", "manualDescription": "These checks are required by the baseline [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.", "score": 0.42,