From ec2be2df73fae55996dfb187e577f59e03020593 Mon Sep 17 00:00:00 2001 From: Michael Blasingame Date: Wed, 22 Apr 2020 17:08:33 -0700 Subject: [PATCH 01/12] Add T&S subcategory under Best Practices --- lighthouse-core/config/default-config.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lighthouse-core/config/default-config.js b/lighthouse-core/config/default-config.js index b1f282c1c36e..2b30474daee3 100644 --- a/lighthouse-core/config/default-config.js +++ b/lighthouse-core/config/default-config.js @@ -105,6 +105,8 @@ const UIStrings = { 'not automatically checked by Lighthouse. They do not affect your score but it\'s important that you verify them manually.', /** Title of the Best Practices category of audits. This is displayed at the top of a list of audits focused on topics related to following web development best practices and accepted guidelines. Also used as a label of a score gauge; try to limit to 20 characters. */ bestPracticesCategoryTitle: 'Best Practices', + /** Title of the Trust & Safety group of the Best Practices category. Within this section are the audits related to trust and safety. */ + safetyGroupTitle: 'Trust & Safety', /** 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. */ @@ -384,6 +386,9 @@ const defaultConfig = { title: str_(UIStrings.seoCrawlingGroupTitle), description: str_(UIStrings.seoCrawlingGroupDescription), }, + 'trust-and-safety': { + title: str_(UIStrings.safetyGroupTitle), + }, }, categories: { 'performance': { @@ -505,18 +510,20 @@ const defaultConfig = { 'best-practices': { title: str_(UIStrings.bestPracticesCategoryTitle), auditRefs: [ + // Trust & Safety + {id: 'is-on-https', weight: 1, group: 'trust-and-safety'}, + {id: 'external-anchors-use-rel-noopener', weight: 1, group: 'trust-and-safety'}, + {id: 'geolocation-on-start', weight: 1, group: 'trust-and-safety'}, + {id: 'notification-on-start', weight: 1, group: 'trust-and-safety'}, + {id: 'no-vulnerable-libraries', weight: 1, group: 'trust-and-safety'}, + // No Group {id: 'appcache-manifest', weight: 1}, - {id: 'is-on-https', weight: 1}, {id: 'uses-http2', weight: 1}, {id: 'uses-passive-event-listeners', weight: 1}, {id: 'no-document-write', weight: 1}, - {id: 'external-anchors-use-rel-noopener', weight: 1}, - {id: 'geolocation-on-start', weight: 1}, {id: 'doctype', weight: 1}, {id: 'charset', weight: 1}, - {id: 'no-vulnerable-libraries', weight: 1}, {id: 'js-libraries', weight: 0}, - {id: 'notification-on-start', weight: 1}, {id: 'deprecations', weight: 1}, {id: 'password-inputs-can-be-pasted-into', weight: 1}, {id: 'errors-in-console', weight: 1}, From 2b3d5f0a652887677d5370d2aab903838a254625 Mon Sep 17 00:00:00 2001 From: Michael Blasingame Date: Wed, 22 Apr 2020 17:27:50 -0700 Subject: [PATCH 02/12] Updating sample_v2.json --- lighthouse-core/config/default-config.js | 31 +++++--- lighthouse-core/lib/i18n/locales/en-US.json | 6 ++ lighthouse-core/lib/i18n/locales/en-XL.json | 6 ++ lighthouse-core/test/results/sample_v2.json | 87 ++++++++++++++------- 4 files changed, 88 insertions(+), 42 deletions(-) diff --git a/lighthouse-core/config/default-config.js b/lighthouse-core/config/default-config.js index 2b30474daee3..013f32b3b4b6 100644 --- a/lighthouse-core/config/default-config.js +++ b/lighthouse-core/config/default-config.js @@ -107,6 +107,8 @@ const UIStrings = { bestPracticesCategoryTitle: 'Best Practices', /** Title of the Trust & Safety group of the Best Practices category. Within this section are the audits related to trust and safety. */ safetyGroupTitle: 'Trust & Safety', + /** Title of the General group of the Best Practices category. Within this section are the audits that don't belong to a specific group. */ + generalGroupTitle: 'General', /** 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. */ @@ -389,6 +391,9 @@ const defaultConfig = { 'trust-and-safety': { title: str_(UIStrings.safetyGroupTitle), }, + 'best-practices-general': { + title: str_(UIStrings.generalGroupTitle), + } }, categories: { 'performance': { @@ -516,19 +521,19 @@ const defaultConfig = { {id: 'geolocation-on-start', weight: 1, group: 'trust-and-safety'}, {id: 'notification-on-start', weight: 1, group: 'trust-and-safety'}, {id: 'no-vulnerable-libraries', weight: 1, group: 'trust-and-safety'}, - // No Group - {id: 'appcache-manifest', weight: 1}, - {id: 'uses-http2', weight: 1}, - {id: 'uses-passive-event-listeners', weight: 1}, - {id: 'no-document-write', weight: 1}, - {id: 'doctype', weight: 1}, - {id: 'charset', weight: 1}, - {id: 'js-libraries', weight: 0}, - {id: 'deprecations', weight: 1}, - {id: 'password-inputs-can-be-pasted-into', weight: 1}, - {id: 'errors-in-console', weight: 1}, - {id: 'image-aspect-ratio', weight: 1}, - {id: 'image-size-responsive', weight: 1}, + // General Group + {id: 'appcache-manifest', weight: 1, group: 'best-practices-general'}, + {id: 'uses-http2', weight: 1, group: 'best-practices-general'}, + {id: 'uses-passive-event-listeners', weight: 1, group: 'best-practices-general'}, + {id: 'no-document-write', weight: 1, group: 'best-practices-general'}, + {id: 'doctype', weight: 1, group: 'best-practices-general'}, + {id: 'charset', weight: 1, group: 'best-practices-general'}, + {id: 'js-libraries', weight: 0, group: 'best-practices-general'}, + {id: 'deprecations', weight: 1, group: 'best-practices-general'}, + {id: 'password-inputs-can-be-pasted-into', weight: 1, group: 'best-practices-general'}, + {id: 'errors-in-console', weight: 1, group: 'best-practices-general'}, + {id: 'image-aspect-ratio', weight: 1, group: 'best-practices-general'}, + {id: 'image-size-responsive', weight: 1, group: 'best-practices-general'}, ], }, 'seo': { diff --git a/lighthouse-core/lib/i18n/locales/en-US.json b/lighthouse-core/lib/i18n/locales/en-US.json index 8e64a615ca7f..7a6c490551be 100644 --- a/lighthouse-core/lib/i18n/locales/en-US.json +++ b/lighthouse-core/lib/i18n/locales/en-US.json @@ -1352,6 +1352,9 @@ "lighthouse-core/config/default-config.js | firstPaintImprovementsGroupTitle": { "message": "First Paint Improvements" }, + "lighthouse-core/config/default-config.js | generalGroupTitle": { + "message": "General" + }, "lighthouse-core/config/default-config.js | loadOpportunitiesGroupDescription": { "message": "These suggestions can help your page load faster. They don't [directly affect](https://github.com/GoogleChrome/lighthouse/blob/d2ec9ffbb21de9ad1a0f86ed24575eda32c796f0/docs/scoring.md#how-are-the-scores-weighted) the Performance score." }, @@ -1388,6 +1391,9 @@ "lighthouse-core/config/default-config.js | pwaOptimizedGroupTitle": { "message": "PWA Optimized" }, + "lighthouse-core/config/default-config.js | safetyGroupTitle": { + "message": "Trust & Safety" + }, "lighthouse-core/config/default-config.js | seoCategoryDescription": { "message": "These checks ensure that your page is optimized for search engine results ranking. There are additional factors Lighthouse does not check that may affect your search ranking. [Learn more](https://support.google.com/webmasters/answer/35769)." }, diff --git a/lighthouse-core/lib/i18n/locales/en-XL.json b/lighthouse-core/lib/i18n/locales/en-XL.json index 3e07156bdc72..94e461faf116 100644 --- a/lighthouse-core/lib/i18n/locales/en-XL.json +++ b/lighthouse-core/lib/i18n/locales/en-XL.json @@ -1352,6 +1352,9 @@ "lighthouse-core/config/default-config.js | firstPaintImprovementsGroupTitle": { "message": "F̂ír̂śt̂ Ṕâín̂t́ Îḿp̂ŕôv́êḿêńt̂ś" }, + "lighthouse-core/config/default-config.js | generalGroupTitle": { + "message": "Ĝén̂ér̂ál̂" + }, "lighthouse-core/config/default-config.js | loadOpportunitiesGroupDescription": { "message": "T̂h́êśê śûǵĝéŝt́îón̂ś ĉán̂ h́êĺp̂ ýôúr̂ ṕâǵê ĺôád̂ f́âśt̂ér̂. T́ĥéŷ d́ôń't̂ [d́îŕêćt̂ĺŷ áf̂f́êćt̂](https://github.com/GoogleChrome/lighthouse/blob/d2ec9ffbb21de9ad1a0f86ed24575eda32c796f0/docs/scoring.md#how-are-the-scores-weighted) t́ĥé P̂ér̂f́ôŕm̂án̂ćê śĉór̂é." }, @@ -1388,6 +1391,9 @@ "lighthouse-core/config/default-config.js | pwaOptimizedGroupTitle": { "message": "P̂ẂÂ Óp̂t́îḿîźêd́" }, + "lighthouse-core/config/default-config.js | safetyGroupTitle": { + "message": "T̂ŕûśt̂ & Śâf́êt́ŷ" + }, "lighthouse-core/config/default-config.js | seoCategoryDescription": { "message": "T̂h́êśê ćĥéĉḱŝ én̂śûŕê t́ĥát̂ ýôúr̂ ṕâǵê íŝ óp̂t́îḿîźêd́ f̂ór̂ śêár̂ćĥ én̂ǵîńê ŕêśûĺt̂ś r̂án̂ḱîńĝ. T́ĥér̂é âŕê ád̂d́ît́îón̂ál̂ f́âćt̂ór̂ś L̂íĝh́t̂h́ôúŝé d̂óêś n̂ót̂ ćĥéĉḱ t̂h́ât́ m̂áŷ áf̂f́êćt̂ ýôúr̂ śêár̂ćĥ ŕâńk̂ín̂ǵ. [L̂éâŕn̂ ḿôŕê](https://support.google.com/webmasters/answer/35769)." }, diff --git a/lighthouse-core/test/results/sample_v2.json b/lighthouse-core/test/results/sample_v2.json index 32a0de28d4c7..02f73ba48b9c 100644 --- a/lighthouse-core/test/results/sample_v2.json +++ b/lighthouse-core/test/results/sample_v2.json @@ -4171,72 +4171,89 @@ "title": "Best Practices", "auditRefs": [ { - "id": "appcache-manifest", - "weight": 1 + "id": "is-on-https", + "weight": 1, + "group": "trust-and-safety" }, { - "id": "is-on-https", - "weight": 1 + "id": "external-anchors-use-rel-noopener", + "weight": 1, + "group": "trust-and-safety" }, { - "id": "uses-http2", - "weight": 1 + "id": "geolocation-on-start", + "weight": 1, + "group": "trust-and-safety" }, { - "id": "uses-passive-event-listeners", - "weight": 1 + "id": "notification-on-start", + "weight": 1, + "group": "trust-and-safety" }, { - "id": "no-document-write", - "weight": 1 + "id": "no-vulnerable-libraries", + "weight": 1, + "group": "trust-and-safety" }, { - "id": "external-anchors-use-rel-noopener", - "weight": 1 + "id": "appcache-manifest", + "weight": 1, + "group": "best-practices-general" }, { - "id": "geolocation-on-start", - "weight": 1 + "id": "uses-http2", + "weight": 1, + "group": "best-practices-general" }, { - "id": "doctype", - "weight": 1 + "id": "uses-passive-event-listeners", + "weight": 1, + "group": "best-practices-general" }, { - "id": "charset", - "weight": 1 + "id": "no-document-write", + "weight": 1, + "group": "best-practices-general" }, { - "id": "no-vulnerable-libraries", - "weight": 1 + "id": "doctype", + "weight": 1, + "group": "best-practices-general" }, { - "id": "js-libraries", - "weight": 0 + "id": "charset", + "weight": 1, + "group": "best-practices-general" }, { - "id": "notification-on-start", - "weight": 1 + "id": "js-libraries", + "weight": 0, + "group": "best-practices-general" }, { "id": "deprecations", - "weight": 1 + "weight": 1, + "group": "best-practices-general" }, { "id": "password-inputs-can-be-pasted-into", - "weight": 1 + "weight": 1, + "group": "best-practices-general" }, { "id": "errors-in-console", - "weight": 1 + "weight": 1, + "group": "best-practices-general" }, { "id": "image-aspect-ratio", - "weight": 1 + "weight": 1, + "group": "best-practices-general" }, { "id": "image-size-responsive", - "weight": 1 + "weight": 1, + "group": "best-practices-general" } ], "id": "best-practices", @@ -4480,6 +4497,12 @@ "seo-crawl": { "title": "Crawling and Indexing", "description": "To appear in search results, crawlers need access to your app." + }, + "trust-and-safety": { + "title": "Trust & Safety" + }, + "best-practices-general": { + "title": "General" } }, "timing": { @@ -6972,6 +6995,12 @@ "lighthouse-core/config/default-config.js | seoCrawlingGroupDescription": [ "categoryGroups[seo-crawl].description" ], + "lighthouse-core/config/default-config.js | safetyGroupTitle": [ + "categoryGroups[trust-and-safety].title" + ], + "lighthouse-core/config/default-config.js | generalGroupTitle": [ + "categoryGroups[best-practices-general].title" + ], "stack-packs/packs/wordpress.js | unused_css_rules": [ "stackPacks[0].descriptions[unused-css-rules]" ], From 7494909435fb90a71ee1add2139a36265fd54fe0 Mon Sep 17 00:00:00 2001 From: Michael Blasingame Date: Thu, 23 Apr 2020 12:13:35 -0700 Subject: [PATCH 03/12] Missing comma :/ --- 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 013f32b3b4b6..2e0d347cce60 100644 --- a/lighthouse-core/config/default-config.js +++ b/lighthouse-core/config/default-config.js @@ -393,7 +393,7 @@ const defaultConfig = { }, 'best-practices-general': { title: str_(UIStrings.generalGroupTitle), - } + }, }, categories: { 'performance': { From e304ec819a47579e243c4b2ca23c8c33de75e56f Mon Sep 17 00:00:00 2001 From: Michael Blasingame Date: Thu, 23 Apr 2020 15:56:38 -0700 Subject: [PATCH 04/12] Adding more sub categories --- lighthouse-core/config/default-config.js | 48 +++++++----- lighthouse-core/lib/i18n/locales/en-US.json | 18 +++-- lighthouse-core/lib/i18n/locales/en-XL.json | 18 +++-- lighthouse-core/test/results/sample_v2.json | 84 ++++++++++++--------- 4 files changed, 102 insertions(+), 66 deletions(-) diff --git a/lighthouse-core/config/default-config.js b/lighthouse-core/config/default-config.js index 2e0d347cce60..3cb4bac6ee1e 100644 --- a/lighthouse-core/config/default-config.js +++ b/lighthouse-core/config/default-config.js @@ -106,9 +106,13 @@ const UIStrings = { /** Title of the Best Practices category of audits. This is displayed at the top of a list of audits focused on topics related to following web development best practices and accepted guidelines. Also used as a label of a score gauge; try to limit to 20 characters. */ bestPracticesCategoryTitle: 'Best Practices', /** Title of the Trust & Safety group of the Best Practices category. Within this section are the audits related to trust and safety. */ - safetyGroupTitle: 'Trust & Safety', + bestPracticesSafetyGroupTitle: 'Trust & Safety', + /** Title of the User Experience group of the Best Practices category. Within this section are the audits related to trust and safety. */ + bestPracticesUXGroupTitle: 'User Experience', + /** Title of the Browser Compatibility group of the Best Practices category. Within this section are the audits related to trust and safety. */ + bestPracticesBrowserGroupTitle: 'Browser Compatibility', /** Title of the General group of the Best Practices category. Within this section are the audits that don't belong to a specific group. */ - generalGroupTitle: 'General', + bestPracticesGeneralGroupTitle: 'General', /** 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. */ @@ -388,11 +392,17 @@ const defaultConfig = { title: str_(UIStrings.seoCrawlingGroupTitle), description: str_(UIStrings.seoCrawlingGroupDescription), }, - 'trust-and-safety': { - title: str_(UIStrings.safetyGroupTitle), + 'best-practices-safety': { + title: str_(UIStrings.bestPracticesSafetyGroupTitle), + }, + 'best-practices-ux': { + title: str_(UIStrings.bestPracticesUXGroupTitle), + }, + 'best-practices-browser': { + title: str_(UIStrings.bestPracticesBrowserGroupTitle), }, 'best-practices-general': { - title: str_(UIStrings.generalGroupTitle), + title: str_(UIStrings.bestPracticesGeneralGroupTitle), }, }, categories: { @@ -438,6 +448,9 @@ const defaultConfig = { {id: 'timing-budget', weight: 0, group: 'budgets'}, {id: 'resource-summary', weight: 0, group: 'diagnostics'}, {id: 'third-party-summary', weight: 0, group: 'diagnostics'}, + {id: 'uses-http2', weight: 0, group: 'diagnostics'}, + {id: 'uses-passive-event-listeners', weight: 0, group: 'diagnostics'}, + {id: 'no-document-write', weight: 0, group: 'diagnostics'}, // Audits past this point don't belong to a group and will not be shown automatically {id: 'network-requests', weight: 0}, {id: 'network-rtt', weight: 0}, @@ -516,24 +529,23 @@ const defaultConfig = { title: str_(UIStrings.bestPracticesCategoryTitle), auditRefs: [ // Trust & Safety - {id: 'is-on-https', weight: 1, group: 'trust-and-safety'}, - {id: 'external-anchors-use-rel-noopener', weight: 1, group: 'trust-and-safety'}, - {id: 'geolocation-on-start', weight: 1, group: 'trust-and-safety'}, - {id: 'notification-on-start', weight: 1, group: 'trust-and-safety'}, - {id: 'no-vulnerable-libraries', weight: 1, group: 'trust-and-safety'}, + {id: 'is-on-https', weight: 1, group: 'best-practices-safety'}, + {id: 'external-anchors-use-rel-noopener', weight: 1, group: 'best-practices-safety'}, + {id: 'geolocation-on-start', weight: 1, group: 'best-practices-safety'}, + {id: 'notification-on-start', weight: 1, group: 'best-practices-safety'}, + {id: 'no-vulnerable-libraries', weight: 1, group: 'best-practices-safety'}, + // User Experience + {id: 'password-inputs-can-be-pasted-into', weight: 1, group: 'best-practices-ux'}, + {id: 'image-aspect-ratio', weight: 1, group: 'best-practices-ux'}, + {id: 'image-size-responsive', weight: 1, group: 'best-practices-ux'}, + // Browser Compatibility + {id: 'doctype', weight: 1, group: 'best-practices-browser'}, + {id: 'charset', weight: 1, group: 'best-practices-browser'}, // General Group {id: 'appcache-manifest', weight: 1, group: 'best-practices-general'}, - {id: 'uses-http2', weight: 1, group: 'best-practices-general'}, - {id: 'uses-passive-event-listeners', weight: 1, group: 'best-practices-general'}, - {id: 'no-document-write', weight: 1, group: 'best-practices-general'}, - {id: 'doctype', weight: 1, group: 'best-practices-general'}, - {id: 'charset', weight: 1, group: 'best-practices-general'}, {id: 'js-libraries', weight: 0, group: 'best-practices-general'}, {id: 'deprecations', weight: 1, group: 'best-practices-general'}, - {id: 'password-inputs-can-be-pasted-into', weight: 1, group: 'best-practices-general'}, {id: 'errors-in-console', weight: 1, group: 'best-practices-general'}, - {id: 'image-aspect-ratio', weight: 1, group: 'best-practices-general'}, - {id: 'image-size-responsive', weight: 1, group: 'best-practices-general'}, ], }, 'seo': { diff --git a/lighthouse-core/lib/i18n/locales/en-US.json b/lighthouse-core/lib/i18n/locales/en-US.json index 7a6c490551be..0d612a8ddbf6 100644 --- a/lighthouse-core/lib/i18n/locales/en-US.json +++ b/lighthouse-core/lib/i18n/locales/en-US.json @@ -1331,9 +1331,21 @@ "lighthouse-core/config/default-config.js | a11yTablesListsVideoGroupTitle": { "message": "Tables and lists" }, + "lighthouse-core/config/default-config.js | bestPracticesBrowserGroupTitle": { + "message": "Browser Compatibility" + }, "lighthouse-core/config/default-config.js | bestPracticesCategoryTitle": { "message": "Best Practices" }, + "lighthouse-core/config/default-config.js | bestPracticesGeneralGroupTitle": { + "message": "General" + }, + "lighthouse-core/config/default-config.js | bestPracticesSafetyGroupTitle": { + "message": "Trust & Safety" + }, + "lighthouse-core/config/default-config.js | bestPracticesUXGroupTitle": { + "message": "User Experience" + }, "lighthouse-core/config/default-config.js | budgetsGroupDescription": { "message": "Performance budgets set standards for the performance of your site." }, @@ -1352,9 +1364,6 @@ "lighthouse-core/config/default-config.js | firstPaintImprovementsGroupTitle": { "message": "First Paint Improvements" }, - "lighthouse-core/config/default-config.js | generalGroupTitle": { - "message": "General" - }, "lighthouse-core/config/default-config.js | loadOpportunitiesGroupDescription": { "message": "These suggestions can help your page load faster. They don't [directly affect](https://github.com/GoogleChrome/lighthouse/blob/d2ec9ffbb21de9ad1a0f86ed24575eda32c796f0/docs/scoring.md#how-are-the-scores-weighted) the Performance score." }, @@ -1391,9 +1400,6 @@ "lighthouse-core/config/default-config.js | pwaOptimizedGroupTitle": { "message": "PWA Optimized" }, - "lighthouse-core/config/default-config.js | safetyGroupTitle": { - "message": "Trust & Safety" - }, "lighthouse-core/config/default-config.js | seoCategoryDescription": { "message": "These checks ensure that your page is optimized for search engine results ranking. There are additional factors Lighthouse does not check that may affect your search ranking. [Learn more](https://support.google.com/webmasters/answer/35769)." }, diff --git a/lighthouse-core/lib/i18n/locales/en-XL.json b/lighthouse-core/lib/i18n/locales/en-XL.json index 94e461faf116..67e504ad684a 100644 --- a/lighthouse-core/lib/i18n/locales/en-XL.json +++ b/lighthouse-core/lib/i18n/locales/en-XL.json @@ -1331,9 +1331,21 @@ "lighthouse-core/config/default-config.js | a11yTablesListsVideoGroupTitle": { "message": "T̂áb̂ĺêś âńd̂ ĺîśt̂ś" }, + "lighthouse-core/config/default-config.js | bestPracticesBrowserGroupTitle": { + "message": "B̂ŕôẃŝér̂ Ćôḿp̂át̂íb̂íl̂ít̂ý" + }, "lighthouse-core/config/default-config.js | bestPracticesCategoryTitle": { "message": "B̂éŝt́ P̂ŕâćt̂íĉéŝ" }, + "lighthouse-core/config/default-config.js | bestPracticesGeneralGroupTitle": { + "message": "Ĝén̂ér̂ál̂" + }, + "lighthouse-core/config/default-config.js | bestPracticesSafetyGroupTitle": { + "message": "T̂ŕûśt̂ & Śâf́êt́ŷ" + }, + "lighthouse-core/config/default-config.js | bestPracticesUXGroupTitle": { + "message": "Ûśêŕ Êx́p̂ér̂íêńĉé" + }, "lighthouse-core/config/default-config.js | budgetsGroupDescription": { "message": "P̂ér̂f́ôŕm̂án̂ćê b́ûd́ĝét̂ś ŝét̂ śt̂án̂d́âŕd̂ś f̂ór̂ t́ĥé p̂ér̂f́ôŕm̂án̂ćê óf̂ ýôúr̂ śît́ê." }, @@ -1352,9 +1364,6 @@ "lighthouse-core/config/default-config.js | firstPaintImprovementsGroupTitle": { "message": "F̂ír̂śt̂ Ṕâín̂t́ Îḿp̂ŕôv́êḿêńt̂ś" }, - "lighthouse-core/config/default-config.js | generalGroupTitle": { - "message": "Ĝén̂ér̂ál̂" - }, "lighthouse-core/config/default-config.js | loadOpportunitiesGroupDescription": { "message": "T̂h́êśê śûǵĝéŝt́îón̂ś ĉán̂ h́êĺp̂ ýôúr̂ ṕâǵê ĺôád̂ f́âśt̂ér̂. T́ĥéŷ d́ôń't̂ [d́îŕêćt̂ĺŷ áf̂f́êćt̂](https://github.com/GoogleChrome/lighthouse/blob/d2ec9ffbb21de9ad1a0f86ed24575eda32c796f0/docs/scoring.md#how-are-the-scores-weighted) t́ĥé P̂ér̂f́ôŕm̂án̂ćê śĉór̂é." }, @@ -1391,9 +1400,6 @@ "lighthouse-core/config/default-config.js | pwaOptimizedGroupTitle": { "message": "P̂ẂÂ Óp̂t́îḿîźêd́" }, - "lighthouse-core/config/default-config.js | safetyGroupTitle": { - "message": "T̂ŕûśt̂ & Śâf́êt́ŷ" - }, "lighthouse-core/config/default-config.js | seoCategoryDescription": { "message": "T̂h́êśê ćĥéĉḱŝ én̂śûŕê t́ĥát̂ ýôúr̂ ṕâǵê íŝ óp̂t́îḿîźêd́ f̂ór̂ śêár̂ćĥ én̂ǵîńê ŕêśûĺt̂ś r̂án̂ḱîńĝ. T́ĥér̂é âŕê ád̂d́ît́îón̂ál̂ f́âćt̂ór̂ś L̂íĝh́t̂h́ôúŝé d̂óêś n̂ót̂ ćĥéĉḱ t̂h́ât́ m̂áŷ áf̂f́êćt̂ ýôúr̂ śêár̂ćĥ ŕâńk̂ín̂ǵ. [L̂éâŕn̂ ḿôŕê](https://support.google.com/webmasters/answer/35769)." }, diff --git a/lighthouse-core/test/results/sample_v2.json b/lighthouse-core/test/results/sample_v2.json index 02f73ba48b9c..49634a33a1d0 100644 --- a/lighthouse-core/test/results/sample_v2.json +++ b/lighthouse-core/test/results/sample_v2.json @@ -3877,6 +3877,21 @@ "weight": 0, "group": "diagnostics" }, + { + "id": "uses-http2", + "weight": 0, + "group": "diagnostics" + }, + { + "id": "uses-passive-event-listeners", + "weight": 0, + "group": "diagnostics" + }, + { + "id": "no-document-write", + "weight": 0, + "group": "diagnostics" + }, { "id": "network-requests", "weight": 0 @@ -4173,55 +4188,55 @@ { "id": "is-on-https", "weight": 1, - "group": "trust-and-safety" + "group": "best-practices-safety" }, { "id": "external-anchors-use-rel-noopener", "weight": 1, - "group": "trust-and-safety" + "group": "best-practices-safety" }, { "id": "geolocation-on-start", "weight": 1, - "group": "trust-and-safety" + "group": "best-practices-safety" }, { "id": "notification-on-start", "weight": 1, - "group": "trust-and-safety" + "group": "best-practices-safety" }, { "id": "no-vulnerable-libraries", "weight": 1, - "group": "trust-and-safety" + "group": "best-practices-safety" }, { - "id": "appcache-manifest", + "id": "password-inputs-can-be-pasted-into", "weight": 1, - "group": "best-practices-general" + "group": "best-practices-ux" }, { - "id": "uses-http2", + "id": "image-aspect-ratio", "weight": 1, - "group": "best-practices-general" + "group": "best-practices-ux" }, { - "id": "uses-passive-event-listeners", + "id": "image-size-responsive", "weight": 1, - "group": "best-practices-general" + "group": "best-practices-ux" }, { - "id": "no-document-write", + "id": "doctype", "weight": 1, - "group": "best-practices-general" + "group": "best-practices-browser" }, { - "id": "doctype", + "id": "charset", "weight": 1, - "group": "best-practices-general" + "group": "best-practices-browser" }, { - "id": "charset", + "id": "appcache-manifest", "weight": 1, "group": "best-practices-general" }, @@ -4235,29 +4250,14 @@ "weight": 1, "group": "best-practices-general" }, - { - "id": "password-inputs-can-be-pasted-into", - "weight": 1, - "group": "best-practices-general" - }, { "id": "errors-in-console", "weight": 1, "group": "best-practices-general" - }, - { - "id": "image-aspect-ratio", - "weight": 1, - "group": "best-practices-general" - }, - { - "id": "image-size-responsive", - "weight": 1, - "group": "best-practices-general" } ], "id": "best-practices", - "score": 0.06 + "score": 0.08 }, "seo": { "title": "SEO", @@ -4498,9 +4498,15 @@ "title": "Crawling and Indexing", "description": "To appear in search results, crawlers need access to your app." }, - "trust-and-safety": { + "best-practices-safety": { "title": "Trust & Safety" }, + "best-practices-ux": { + "title": "User Experience" + }, + "best-practices-browser": { + "title": "Browser Compatibility" + }, "best-practices-general": { "title": "General" } @@ -6995,10 +7001,16 @@ "lighthouse-core/config/default-config.js | seoCrawlingGroupDescription": [ "categoryGroups[seo-crawl].description" ], - "lighthouse-core/config/default-config.js | safetyGroupTitle": [ - "categoryGroups[trust-and-safety].title" + "lighthouse-core/config/default-config.js | bestPracticesSafetyGroupTitle": [ + "categoryGroups[best-practices-safety].title" + ], + "lighthouse-core/config/default-config.js | bestPracticesUXGroupTitle": [ + "categoryGroups[best-practices-ux].title" + ], + "lighthouse-core/config/default-config.js | bestPracticesBrowserGroupTitle": [ + "categoryGroups[best-practices-browser].title" ], - "lighthouse-core/config/default-config.js | generalGroupTitle": [ + "lighthouse-core/config/default-config.js | bestPracticesGeneralGroupTitle": [ "categoryGroups[best-practices-general].title" ], "stack-packs/packs/wordpress.js | unused_css_rules": [ From ffedbc065367b12ff8e3efda0cb3d1ad77755015 Mon Sep 17 00:00:00 2001 From: Michael Blasingame Date: Fri, 24 Apr 2020 13:00:56 -0700 Subject: [PATCH 05/12] Add fix for bug in config test where deepcopy of Config was broken for gatherers w/ properties that have a .bind() function --- lighthouse-core/test/config/config-test.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lighthouse-core/test/config/config-test.js b/lighthouse-core/test/config/config-test.js index ebf0351ad88b..29b01532e9e7 100644 --- a/lighthouse-core/test/config/config-test.js +++ b/lighthouse-core/test/config/config-test.js @@ -1161,8 +1161,21 @@ describe('Config', () => { }; const extendedConfig = new Config(extended); + // When gatherers have instance properties that are bind()'d, they'll not match. + // We'll still continue to diff the constructor via .implementation + // https://github.com/GoogleChrome/lighthouse/pull/10090#discussion_r382864319 + function deleteInstancesForTest(config) { + for (const pass of config.passes) { + for (const gatherer of pass.gatherers) { + delete gatherer.instance; + } + } + } + deleteInstancesForTest(extendedConfig); + deleteInstancesForTest(config); + assert.equal(config.passes.length, 1, 'did not filter config'); - assert.deepStrictEqual(config, extendedConfig, 'had mutations'); + expect(config).toMatchObject(extendedConfig, 'had mutations'); }); it('should filter out other passes if passed Performance', () => { From 084467f3d278d0464d91ee1126a24badf72b0c4c Mon Sep 17 00:00:00 2001 From: Michael Blasingame Date: Fri, 24 Apr 2020 14:14:28 -0700 Subject: [PATCH 06/12] Update snapshot --- .../test/cli/__snapshots__/index-test.js.snap | 89 ++++++++++++++----- 1 file changed, 65 insertions(+), 24 deletions(-) diff --git a/lighthouse-cli/test/cli/__snapshots__/index-test.js.snap b/lighthouse-cli/test/cli/__snapshots__/index-test.js.snap index e106723d1b59..fd40f1e76811 100644 --- a/lighthouse-cli/test/cli/__snapshots__/index-test.js.snap +++ b/lighthouse-cli/test/cli/__snapshots__/index-test.js.snap @@ -680,73 +680,75 @@ Object { "best-practices": Object { "auditRefs": Array [ Object { - "id": "appcache-manifest", + "group": "best-practices-safety", + "id": "is-on-https", "weight": 1, }, Object { - "id": "is-on-https", + "group": "best-practices-safety", + "id": "external-anchors-use-rel-noopener", "weight": 1, }, Object { - "id": "uses-http2", + "group": "best-practices-safety", + "id": "geolocation-on-start", "weight": 1, }, Object { - "id": "uses-passive-event-listeners", + "group": "best-practices-safety", + "id": "notification-on-start", "weight": 1, }, Object { - "id": "no-document-write", + "group": "best-practices-safety", + "id": "no-vulnerable-libraries", "weight": 1, }, Object { - "id": "external-anchors-use-rel-noopener", + "group": "best-practices-ux", + "id": "password-inputs-can-be-pasted-into", "weight": 1, }, Object { - "id": "geolocation-on-start", + "group": "best-practices-ux", + "id": "image-aspect-ratio", + "weight": 1, + }, + Object { + "group": "best-practices-ux", + "id": "image-size-responsive", "weight": 1, }, Object { + "group": "best-practices-browser", "id": "doctype", "weight": 1, }, Object { + "group": "best-practices-browser", "id": "charset", "weight": 1, }, Object { - "id": "no-vulnerable-libraries", + "group": "best-practices-general", + "id": "appcache-manifest", "weight": 1, }, Object { + "group": "best-practices-general", "id": "js-libraries", "weight": 0, }, Object { - "id": "notification-on-start", - "weight": 1, - }, - Object { + "group": "best-practices-general", "id": "deprecations", "weight": 1, }, Object { - "id": "password-inputs-can-be-pasted-into", - "weight": 1, - }, - Object { + "group": "best-practices-general", "id": "errors-in-console", "weight": 1, }, - Object { - "id": "image-aspect-ratio", - "weight": 1, - }, - Object { - "id": "image-size-responsive", - "weight": 1, - }, ], "title": "Best Practices", }, @@ -933,6 +935,21 @@ Object { "id": "third-party-summary", "weight": 0, }, + Object { + "group": "diagnostics", + "id": "uses-http2", + "weight": 0, + }, + Object { + "group": "diagnostics", + "id": "uses-passive-event-listeners", + "weight": 0, + }, + Object { + "group": "diagnostics", + "id": "no-document-write", + "weight": 0, + }, Object { "id": "network-requests", "weight": 0, @@ -1167,6 +1184,18 @@ Object { "description": "These are opportunities to to improve the experience of reading tabular or list data using assistive technology, like a screen reader.", "title": "Tables and lists", }, + "best-practices-browser": Object { + "title": "Browser Compatibility", + }, + "best-practices-general": Object { + "title": "General", + }, + "best-practices-safety": Object { + "title": "Trust & Safety", + }, + "best-practices-ux": Object { + "title": "User Experience", + }, "budgets": Object { "description": "Performance budgets set standards for the performance of your site.", "title": "Budgets", @@ -1430,6 +1459,18 @@ Object { "description": "These are opportunities to to improve the experience of reading tabular or list data using assistive technology, like a screen reader.", "title": "Tables and lists", }, + "best-practices-browser": Object { + "title": "Browser Compatibility", + }, + "best-practices-general": Object { + "title": "General", + }, + "best-practices-safety": Object { + "title": "Trust & Safety", + }, + "best-practices-ux": Object { + "title": "User Experience", + }, "budgets": Object { "description": "Performance budgets set standards for the performance of your site.", "title": "Budgets", From 723352aa9aca8ffc8187e36ef9032143d96cc043 Mon Sep 17 00:00:00 2001 From: Michael Blasingame Date: Fri, 24 Apr 2020 15:42:38 -0700 Subject: [PATCH 07/12] Update offline smoke test to reflect audits being migrated out --- .../offline-local/offline-expectations.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lighthouse-cli/test/smokehouse/test-definitions/offline-local/offline-expectations.js b/lighthouse-cli/test/smokehouse/test-definitions/offline-local/offline-expectations.js index 9c580da2ff27..d4ae8e07790e 100644 --- a/lighthouse-cli/test/smokehouse/test-definitions/offline-local/offline-expectations.js +++ b/lighthouse-cli/test/smokehouse/test-definitions/offline-local/offline-expectations.js @@ -20,9 +20,6 @@ module.exports = [ 'is-on-https': { score: 1, }, - 'uses-http2': { - score: 0, - }, 'external-anchors-use-rel-noopener': { score: 1, }, @@ -35,12 +32,6 @@ module.exports = [ 'render-blocking-resources': { score: 1, }, - 'no-document-write': { - score: 1, - }, - 'uses-passive-event-listeners': { - score: 1, - }, 'password-inputs-can-be-pasted-into': { score: 1, }, From 593fd599ca0c276a7328e72e74dba6a64cde28e2 Mon Sep 17 00:00:00 2001 From: Michael Blasingame Date: Tue, 28 Apr 2020 17:45:42 -0700 Subject: [PATCH 08/12] Apply wording suggestions from Patrick and Brendan Co-Authored-By: Brendan Kenny Co-Authored-By: Patrick Hulce --- lighthouse-core/config/default-config.js | 10 +++++----- lighthouse-core/test/config/config-test.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lighthouse-core/config/default-config.js b/lighthouse-core/config/default-config.js index 3cb4bac6ee1e..3ae33b4f34cc 100644 --- a/lighthouse-core/config/default-config.js +++ b/lighthouse-core/config/default-config.js @@ -105,13 +105,13 @@ const UIStrings = { 'not automatically checked by Lighthouse. They do not affect your score but it\'s important that you verify them manually.', /** Title of the Best Practices category of audits. This is displayed at the top of a list of audits focused on topics related to following web development best practices and accepted guidelines. Also used as a label of a score gauge; try to limit to 20 characters. */ bestPracticesCategoryTitle: 'Best Practices', - /** Title of the Trust & Safety group of the Best Practices category. Within this section are the audits related to trust and safety. */ - bestPracticesSafetyGroupTitle: 'Trust & Safety', - /** Title of the User Experience group of the Best Practices category. Within this section are the audits related to trust and safety. */ + /** Title of the Trust & Safety group of audits. This is displayed at the top of a list of audits focused on maintaining user trust and protecting security in web development. */ + bestPracticesSafetyGroupTitle: 'Trust and Safety', + /** Title of the User Experience group of the Best Practices category. Within this section are the audits related to the end user's experience of the webpage. */ bestPracticesUXGroupTitle: 'User Experience', - /** Title of the Browser Compatibility group of the Best Practices category. Within this section are the audits related to trust and safety. */ + /** Title of the Browser Compatibility group of the Best Practices category. Within this section are the audits related to whether the page is interpreted consistently by browsers. */ bestPracticesBrowserGroupTitle: 'Browser Compatibility', - /** Title of the General group of the Best Practices category. Within this section are the audits that don't belong to a specific group. */ + /** Title of the General group of the Best Practices category. Within this section are the audits that don't belong to a specific group but are of general interest. */ bestPracticesGeneralGroupTitle: 'General', /** 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', diff --git a/lighthouse-core/test/config/config-test.js b/lighthouse-core/test/config/config-test.js index 29b01532e9e7..0754c9d815cf 100644 --- a/lighthouse-core/test/config/config-test.js +++ b/lighthouse-core/test/config/config-test.js @@ -1162,7 +1162,7 @@ describe('Config', () => { const extendedConfig = new Config(extended); // When gatherers have instance properties that are bind()'d, they'll not match. - // We'll still continue to diff the constructor via .implementation + // Gatherers in each config will still be compared via the constructor on .implementation. // https://github.com/GoogleChrome/lighthouse/pull/10090#discussion_r382864319 function deleteInstancesForTest(config) { for (const pass of config.passes) { From 9d6106525268a0b70de4d20f7eb1e78e328bfa65 Mon Sep 17 00:00:00 2001 From: Michael Blasingame Date: Tue, 28 Apr 2020 18:33:13 -0700 Subject: [PATCH 09/12] More renaming and improve config unit test --- lighthouse-core/config/default-config.js | 26 +++++++++++----------- lighthouse-core/test/config/config-test.js | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lighthouse-core/config/default-config.js b/lighthouse-core/config/default-config.js index 3ae33b4f34cc..b0db2269544a 100644 --- a/lighthouse-core/config/default-config.js +++ b/lighthouse-core/config/default-config.js @@ -106,11 +106,11 @@ const UIStrings = { /** Title of the Best Practices category of audits. This is displayed at the top of a list of audits focused on topics related to following web development best practices and accepted guidelines. Also used as a label of a score gauge; try to limit to 20 characters. */ bestPracticesCategoryTitle: 'Best Practices', /** Title of the Trust & Safety group of audits. This is displayed at the top of a list of audits focused on maintaining user trust and protecting security in web development. */ - bestPracticesSafetyGroupTitle: 'Trust and Safety', + bestPracticesTrustSafetyGroupTitle: 'Trust and Safety', /** Title of the User Experience group of the Best Practices category. Within this section are the audits related to the end user's experience of the webpage. */ bestPracticesUXGroupTitle: 'User Experience', /** Title of the Browser Compatibility group of the Best Practices category. Within this section are the audits related to whether the page is interpreted consistently by browsers. */ - bestPracticesBrowserGroupTitle: 'Browser Compatibility', + bestPracticesBrowserCompatGroupTitle: 'Browser Compatibility', /** Title of the General group of the Best Practices category. Within this section are the audits that don't belong to a specific group but are of general interest. */ bestPracticesGeneralGroupTitle: 'General', /** 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. */ @@ -392,14 +392,14 @@ const defaultConfig = { title: str_(UIStrings.seoCrawlingGroupTitle), description: str_(UIStrings.seoCrawlingGroupDescription), }, - 'best-practices-safety': { - title: str_(UIStrings.bestPracticesSafetyGroupTitle), + 'best-practices-trust-safety': { + title: str_(UIStrings.bestPracticesTrustSafetyGroupTitle), }, 'best-practices-ux': { title: str_(UIStrings.bestPracticesUXGroupTitle), }, - 'best-practices-browser': { - title: str_(UIStrings.bestPracticesBrowserGroupTitle), + 'best-practices-browser-compat': { + title: str_(UIStrings.bestPracticesBrowserCompatGroupTitle), }, 'best-practices-general': { title: str_(UIStrings.bestPracticesGeneralGroupTitle), @@ -529,18 +529,18 @@ const defaultConfig = { title: str_(UIStrings.bestPracticesCategoryTitle), auditRefs: [ // Trust & Safety - {id: 'is-on-https', weight: 1, group: 'best-practices-safety'}, - {id: 'external-anchors-use-rel-noopener', weight: 1, group: 'best-practices-safety'}, - {id: 'geolocation-on-start', weight: 1, group: 'best-practices-safety'}, - {id: 'notification-on-start', weight: 1, group: 'best-practices-safety'}, - {id: 'no-vulnerable-libraries', weight: 1, group: 'best-practices-safety'}, + {id: 'is-on-https', weight: 1, group: 'best-practices-trust-safety'}, + {id: 'external-anchors-use-rel-noopener', weight: 1, group: 'best-practices-trust-safety'}, + {id: 'geolocation-on-start', weight: 1, group: 'best-practices-trust-safety'}, + {id: 'notification-on-start', weight: 1, group: 'best-practices-trust-safety'}, + {id: 'no-vulnerable-libraries', weight: 1, group: 'best-practices-trust-safety'}, // User Experience {id: 'password-inputs-can-be-pasted-into', weight: 1, group: 'best-practices-ux'}, {id: 'image-aspect-ratio', weight: 1, group: 'best-practices-ux'}, {id: 'image-size-responsive', weight: 1, group: 'best-practices-ux'}, // Browser Compatibility - {id: 'doctype', weight: 1, group: 'best-practices-browser'}, - {id: 'charset', weight: 1, group: 'best-practices-browser'}, + {id: 'doctype', weight: 1, group: 'best-practices-browser-compat'}, + {id: 'charset', weight: 1, group: 'best-practices-browser-compat'}, // General Group {id: 'appcache-manifest', weight: 1, group: 'best-practices-general'}, {id: 'js-libraries', weight: 0, group: 'best-practices-general'}, diff --git a/lighthouse-core/test/config/config-test.js b/lighthouse-core/test/config/config-test.js index 0754c9d815cf..af87a8ceac26 100644 --- a/lighthouse-core/test/config/config-test.js +++ b/lighthouse-core/test/config/config-test.js @@ -1175,7 +1175,7 @@ describe('Config', () => { deleteInstancesForTest(config); assert.equal(config.passes.length, 1, 'did not filter config'); - expect(config).toMatchObject(extendedConfig, 'had mutations'); + expect(config).toEqual(extendedConfig, 'had mutations'); }); it('should filter out other passes if passed Performance', () => { From acbb6e44ba228d99869c96401976a072012c2d8a Mon Sep 17 00:00:00 2001 From: Michael Blasingame Date: Wed, 29 Apr 2020 15:39:17 -0700 Subject: [PATCH 10/12] Reword failure title for no-document-write audit --- .../audits/dobetterweb/no-document-write.js | 2 +- lighthouse-core/lib/i18n/locales/en-US.json | 8 ++--- lighthouse-core/lib/i18n/locales/en-XL.json | 8 ++--- lighthouse-core/test/results/sample_v2.json | 30 +++++++++---------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lighthouse-core/audits/dobetterweb/no-document-write.js b/lighthouse-core/audits/dobetterweb/no-document-write.js index 1aff3d12c481..5c5532e9b796 100644 --- a/lighthouse-core/audits/dobetterweb/no-document-write.js +++ b/lighthouse-core/audits/dobetterweb/no-document-write.js @@ -35,7 +35,7 @@ const UIStrings = { /** Title of a Lighthouse audit that provides detail on the page's use of the `document.write` API. This descriptive title is shown to users when the page does not use `document.write`. */ title: 'Avoids `document.write()`', /** Title of a Lighthouse audit that provides detail on the page's use of the `document.write` API. This descriptive title is shown to users when the page does use `document.write`. */ - failureTitle: 'Uses `document.write()`', + failureTitle: 'Avoid `document.write()`', /** Description of a Lighthouse audit that tells the user why they should avoid `document.write`. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'For users on slow connections, external scripts dynamically injected via ' + '`document.write()` can delay page load by tens of seconds. ' + diff --git a/lighthouse-core/lib/i18n/locales/en-US.json b/lighthouse-core/lib/i18n/locales/en-US.json index 0d612a8ddbf6..8a909e77a952 100644 --- a/lighthouse-core/lib/i18n/locales/en-US.json +++ b/lighthouse-core/lib/i18n/locales/en-US.json @@ -648,7 +648,7 @@ "message": "For users on slow connections, external scripts dynamically injected via `document.write()` can delay page load by tens of seconds. [Learn more](https://web.dev/no-document-write)." }, "lighthouse-core/audits/dobetterweb/no-document-write.js | failureTitle": { - "message": "Uses `document.write()`" + "message": "Avoid `document.write()`" }, "lighthouse-core/audits/dobetterweb/no-document-write.js | title": { "message": "Avoids `document.write()`" @@ -1331,7 +1331,7 @@ "lighthouse-core/config/default-config.js | a11yTablesListsVideoGroupTitle": { "message": "Tables and lists" }, - "lighthouse-core/config/default-config.js | bestPracticesBrowserGroupTitle": { + "lighthouse-core/config/default-config.js | bestPracticesBrowserCompatGroupTitle": { "message": "Browser Compatibility" }, "lighthouse-core/config/default-config.js | bestPracticesCategoryTitle": { @@ -1340,8 +1340,8 @@ "lighthouse-core/config/default-config.js | bestPracticesGeneralGroupTitle": { "message": "General" }, - "lighthouse-core/config/default-config.js | bestPracticesSafetyGroupTitle": { - "message": "Trust & Safety" + "lighthouse-core/config/default-config.js | bestPracticesTrustSafetyGroupTitle": { + "message": "Trust and Safety" }, "lighthouse-core/config/default-config.js | bestPracticesUXGroupTitle": { "message": "User Experience" diff --git a/lighthouse-core/lib/i18n/locales/en-XL.json b/lighthouse-core/lib/i18n/locales/en-XL.json index 67e504ad684a..3f67cdb5daa8 100644 --- a/lighthouse-core/lib/i18n/locales/en-XL.json +++ b/lighthouse-core/lib/i18n/locales/en-XL.json @@ -648,7 +648,7 @@ "message": "F̂ór̂ úŝér̂ś ôń ŝĺôẃ ĉón̂ńêćt̂íôńŝ, éx̂t́êŕn̂ál̂ śĉŕîṕt̂ś d̂ýn̂ám̂íĉál̂ĺŷ ín̂j́êćt̂éd̂ v́îá `document.write()` ĉán̂ d́êĺâý p̂áĝé l̂óâd́ b̂ý t̂én̂ś ôf́ ŝéĉón̂d́ŝ. [Ĺêár̂ń m̂ór̂é](https://web.dev/no-document-write)." }, "lighthouse-core/audits/dobetterweb/no-document-write.js | failureTitle": { - "message": "Ûśêś `document.write()`" + "message": "Âv́ôíd̂ `document.write()`" }, "lighthouse-core/audits/dobetterweb/no-document-write.js | title": { "message": "Âv́ôíd̂ś `document.write()`" @@ -1331,7 +1331,7 @@ "lighthouse-core/config/default-config.js | a11yTablesListsVideoGroupTitle": { "message": "T̂áb̂ĺêś âńd̂ ĺîśt̂ś" }, - "lighthouse-core/config/default-config.js | bestPracticesBrowserGroupTitle": { + "lighthouse-core/config/default-config.js | bestPracticesBrowserCompatGroupTitle": { "message": "B̂ŕôẃŝér̂ Ćôḿp̂át̂íb̂íl̂ít̂ý" }, "lighthouse-core/config/default-config.js | bestPracticesCategoryTitle": { @@ -1340,8 +1340,8 @@ "lighthouse-core/config/default-config.js | bestPracticesGeneralGroupTitle": { "message": "Ĝén̂ér̂ál̂" }, - "lighthouse-core/config/default-config.js | bestPracticesSafetyGroupTitle": { - "message": "T̂ŕûśt̂ & Śâf́êt́ŷ" + "lighthouse-core/config/default-config.js | bestPracticesTrustSafetyGroupTitle": { + "message": "T̂ŕûśt̂ án̂d́ Ŝáf̂ét̂ý" }, "lighthouse-core/config/default-config.js | bestPracticesUXGroupTitle": { "message": "Ûśêŕ Êx́p̂ér̂íêńĉé" diff --git a/lighthouse-core/test/results/sample_v2.json b/lighthouse-core/test/results/sample_v2.json index 49634a33a1d0..d21610c6ea3c 100644 --- a/lighthouse-core/test/results/sample_v2.json +++ b/lighthouse-core/test/results/sample_v2.json @@ -3076,7 +3076,7 @@ }, "no-document-write": { "id": "no-document-write", - "title": "Uses `document.write()`", + "title": "Avoid `document.write()`", "description": "For users on slow connections, external scripts dynamically injected via `document.write()` can delay page load by tens of seconds. [Learn more](https://web.dev/no-document-write).", "score": 0, "scoreDisplayMode": "binary", @@ -4188,27 +4188,27 @@ { "id": "is-on-https", "weight": 1, - "group": "best-practices-safety" + "group": "best-practices-trust-safety" }, { "id": "external-anchors-use-rel-noopener", "weight": 1, - "group": "best-practices-safety" + "group": "best-practices-trust-safety" }, { "id": "geolocation-on-start", "weight": 1, - "group": "best-practices-safety" + "group": "best-practices-trust-safety" }, { "id": "notification-on-start", "weight": 1, - "group": "best-practices-safety" + "group": "best-practices-trust-safety" }, { "id": "no-vulnerable-libraries", "weight": 1, - "group": "best-practices-safety" + "group": "best-practices-trust-safety" }, { "id": "password-inputs-can-be-pasted-into", @@ -4228,12 +4228,12 @@ { "id": "doctype", "weight": 1, - "group": "best-practices-browser" + "group": "best-practices-browser-compat" }, { "id": "charset", "weight": 1, - "group": "best-practices-browser" + "group": "best-practices-browser-compat" }, { "id": "appcache-manifest", @@ -4498,13 +4498,13 @@ "title": "Crawling and Indexing", "description": "To appear in search results, crawlers need access to your app." }, - "best-practices-safety": { - "title": "Trust & Safety" + "best-practices-trust-safety": { + "title": "Trust and Safety" }, "best-practices-ux": { "title": "User Experience" }, - "best-practices-browser": { + "best-practices-browser-compat": { "title": "Browser Compatibility" }, "best-practices-general": { @@ -7001,14 +7001,14 @@ "lighthouse-core/config/default-config.js | seoCrawlingGroupDescription": [ "categoryGroups[seo-crawl].description" ], - "lighthouse-core/config/default-config.js | bestPracticesSafetyGroupTitle": [ - "categoryGroups[best-practices-safety].title" + "lighthouse-core/config/default-config.js | bestPracticesTrustSafetyGroupTitle": [ + "categoryGroups[best-practices-trust-safety].title" ], "lighthouse-core/config/default-config.js | bestPracticesUXGroupTitle": [ "categoryGroups[best-practices-ux].title" ], - "lighthouse-core/config/default-config.js | bestPracticesBrowserGroupTitle": [ - "categoryGroups[best-practices-browser].title" + "lighthouse-core/config/default-config.js | bestPracticesBrowserCompatGroupTitle": [ + "categoryGroups[best-practices-browser-compat].title" ], "lighthouse-core/config/default-config.js | bestPracticesGeneralGroupTitle": [ "categoryGroups[best-practices-general].title" From 2237f99cf85e9ef2b0be8e64f11f5ee22f6ec9dd Mon Sep 17 00:00:00 2001 From: Michael Blasingame Date: Wed, 29 Apr 2020 15:58:11 -0700 Subject: [PATCH 11/12] Update snapshots --- .../test/cli/__snapshots__/index-test.js.snap | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lighthouse-cli/test/cli/__snapshots__/index-test.js.snap b/lighthouse-cli/test/cli/__snapshots__/index-test.js.snap index fd40f1e76811..86441b7a2f06 100644 --- a/lighthouse-cli/test/cli/__snapshots__/index-test.js.snap +++ b/lighthouse-cli/test/cli/__snapshots__/index-test.js.snap @@ -680,27 +680,27 @@ Object { "best-practices": Object { "auditRefs": Array [ Object { - "group": "best-practices-safety", + "group": "best-practices-trust-safety", "id": "is-on-https", "weight": 1, }, Object { - "group": "best-practices-safety", + "group": "best-practices-trust-safety", "id": "external-anchors-use-rel-noopener", "weight": 1, }, Object { - "group": "best-practices-safety", + "group": "best-practices-trust-safety", "id": "geolocation-on-start", "weight": 1, }, Object { - "group": "best-practices-safety", + "group": "best-practices-trust-safety", "id": "notification-on-start", "weight": 1, }, Object { - "group": "best-practices-safety", + "group": "best-practices-trust-safety", "id": "no-vulnerable-libraries", "weight": 1, }, @@ -720,12 +720,12 @@ Object { "weight": 1, }, Object { - "group": "best-practices-browser", + "group": "best-practices-browser-compat", "id": "doctype", "weight": 1, }, Object { - "group": "best-practices-browser", + "group": "best-practices-browser-compat", "id": "charset", "weight": 1, }, @@ -1184,14 +1184,14 @@ Object { "description": "These are opportunities to to improve the experience of reading tabular or list data using assistive technology, like a screen reader.", "title": "Tables and lists", }, - "best-practices-browser": Object { + "best-practices-browser-compat": Object { "title": "Browser Compatibility", }, "best-practices-general": Object { "title": "General", }, - "best-practices-safety": Object { - "title": "Trust & Safety", + "best-practices-trust-safety": Object { + "title": "Trust and Safety", }, "best-practices-ux": Object { "title": "User Experience", @@ -1459,14 +1459,14 @@ Object { "description": "These are opportunities to to improve the experience of reading tabular or list data using assistive technology, like a screen reader.", "title": "Tables and lists", }, - "best-practices-browser": Object { + "best-practices-browser-compat": Object { "title": "Browser Compatibility", }, "best-practices-general": Object { "title": "General", }, - "best-practices-safety": Object { - "title": "Trust & Safety", + "best-practices-trust-safety": Object { + "title": "Trust and Safety", }, "best-practices-ux": Object { "title": "User Experience", From 722ff75c42d5a8e77acae9bf7f0e3908d94b1cc4 Mon Sep 17 00:00:00 2001 From: Michael Blasingame Date: Wed, 29 Apr 2020 16:30:42 -0700 Subject: [PATCH 12/12] Apply Patrick's suggestions from code review Co-Authored-By: Patrick Hulce --- lighthouse-core/audits/dobetterweb/no-document-write.js | 2 +- lighthouse-core/test/config/config-test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lighthouse-core/audits/dobetterweb/no-document-write.js b/lighthouse-core/audits/dobetterweb/no-document-write.js index 5c5532e9b796..3144371bc36a 100644 --- a/lighthouse-core/audits/dobetterweb/no-document-write.js +++ b/lighthouse-core/audits/dobetterweb/no-document-write.js @@ -34,7 +34,7 @@ const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { /** Title of a Lighthouse audit that provides detail on the page's use of the `document.write` API. This descriptive title is shown to users when the page does not use `document.write`. */ title: 'Avoids `document.write()`', - /** Title of a Lighthouse audit that provides detail on the page's use of the `document.write` API. This descriptive title is shown to users when the page does use `document.write`. */ + /** Title of a Lighthouse audit that provides detail on the page's use of the `document.write` API. This imperative title is shown to users when the page does use `document.write`. */ failureTitle: 'Avoid `document.write()`', /** Description of a Lighthouse audit that tells the user why they should avoid `document.write`. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'For users on slow connections, external scripts dynamically injected via ' + diff --git a/lighthouse-core/test/config/config-test.js b/lighthouse-core/test/config/config-test.js index af87a8ceac26..44bf4f125a68 100644 --- a/lighthouse-core/test/config/config-test.js +++ b/lighthouse-core/test/config/config-test.js @@ -1175,7 +1175,7 @@ describe('Config', () => { deleteInstancesForTest(config); assert.equal(config.passes.length, 1, 'did not filter config'); - expect(config).toEqual(extendedConfig, 'had mutations'); + expect(config).toEqual(extendedConfig); // ensure we didn't have mutations }); it('should filter out other passes if passed Performance', () => {