Skip to content

Commit

Permalink
Merge branch 'main' into hide-layout-shift-elements
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed Jan 11, 2024
2 parents ffbc26b + 004c0c5 commit 851525e
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 16 deletions.
2 changes: 1 addition & 1 deletion core/audits/bf-cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class BFCache extends Audit {
failureTitle: str_(UIStrings.failureTitle),
description: str_(UIStrings.description),
supportedModes: ['navigation', 'timespan'],
guidanceLevel: 2,
guidanceLevel: 4,
requiredArtifacts: ['BFCacheFailures', 'HostProduct'],
scoreDisplayMode: Audit.SCORING_MODES.BINARY,
};
Expand Down
2 changes: 1 addition & 1 deletion core/audits/prioritize-lcp-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class PrioritizeLcpImage extends Audit {
title: str_(UIStrings.title),
description: str_(UIStrings.description),
supportedModes: ['navigation'],
guidanceLevel: 3,
guidanceLevel: 4,
requiredArtifacts: ['traces', 'devtoolsLogs', 'GatherContext', 'URL', 'TraceElements'],
scoreDisplayMode: Audit.SCORING_MODES.METRIC_SAVINGS,
};
Expand Down
2 changes: 1 addition & 1 deletion core/audits/unsized-images.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class UnsizedImages extends Audit {
title: str_(UIStrings.title),
failureTitle: str_(UIStrings.failureTitle),
description: str_(UIStrings.description),
guidanceLevel: 3,
guidanceLevel: 4,
requiredArtifacts: ['ImageElements'],
scoreDisplayMode: Audit.SCORING_MODES.METRIC_SAVINGS,
};
Expand Down
22 changes: 13 additions & 9 deletions core/test/fixtures/user-flows/reports/sample-flow-result.json
Original file line number Diff line number Diff line change
Expand Up @@ -1989,7 +1989,7 @@
}
]
},
"guidanceLevel": 3
"guidanceLevel": 4
},
"valid-source-maps": {
"id": "valid-source-maps",
Expand Down Expand Up @@ -2038,7 +2038,7 @@
"pathLength": 2
}
},
"guidanceLevel": 3
"guidanceLevel": 4
},
"csp-xss": {
"id": "csp-xss",
Expand Down Expand Up @@ -3790,7 +3790,7 @@
"description": "Many navigations are performed by going back to a previous page, or forwards again. The back/forward cache (bfcache) can speed up these return navigations. [Learn more about the bfcache](https://developer.chrome.com/docs/lighthouse/performance/bf-cache/)",
"score": 1,
"scoreDisplayMode": "binary",
"guidanceLevel": 2
"guidanceLevel": 4
}
},
"configSettings": {
Expand Down Expand Up @@ -7118,6 +7118,7 @@
"opportunityResourceColumnLabel": "Opportunity",
"opportunitySavingsColumnLabel": "Estimated Savings",
"passedAuditsGroupTitle": "Passed audits",
"pwaRemovalMessage": "Alongside [Chrome’s updated Installability Criteria](https://developer.chrome.com/blog/update-install-criteria), Lighthouse will be deprecating the PWA category in a future release. Please refer to the [updated PWA documentation](https://developer.chrome.com/docs/devtools/progressive-web-apps/) for future PWA testing.",
"runtimeAnalysisWindow": "Initial page load",
"runtimeAnalysisWindowSnapshot": "Point-in-time snapshot",
"runtimeAnalysisWindowTimespan": "User interactions timespan",
Expand Down Expand Up @@ -10100,7 +10101,7 @@
}
]
},
"guidanceLevel": 3
"guidanceLevel": 4
},
"valid-source-maps": {
"id": "valid-source-maps",
Expand Down Expand Up @@ -10958,7 +10959,7 @@
"description": "Many navigations are performed by going back to a previous page, or forwards again. The back/forward cache (bfcache) can speed up these return navigations. [Learn more about the bfcache](https://developer.chrome.com/docs/lighthouse/performance/bf-cache/)",
"score": 1,
"scoreDisplayMode": "binary",
"guidanceLevel": 2
"guidanceLevel": 4
}
},
"configSettings": {
Expand Down Expand Up @@ -12199,6 +12200,7 @@
"opportunityResourceColumnLabel": "Opportunity",
"opportunitySavingsColumnLabel": "Estimated Savings",
"passedAuditsGroupTitle": "Passed audits",
"pwaRemovalMessage": "Alongside [Chrome’s updated Installability Criteria](https://developer.chrome.com/blog/update-install-criteria), Lighthouse will be deprecating the PWA category in a future release. Please refer to the [updated PWA documentation](https://developer.chrome.com/docs/devtools/progressive-web-apps/) for future PWA testing.",
"runtimeAnalysisWindow": "Initial page load",
"runtimeAnalysisWindowSnapshot": "Point-in-time snapshot",
"runtimeAnalysisWindowTimespan": "User interactions timespan",
Expand Down Expand Up @@ -13045,7 +13047,7 @@
}
]
},
"guidanceLevel": 3
"guidanceLevel": 4
},
"accesskeys": {
"id": "accesskeys",
Expand Down Expand Up @@ -17258,6 +17260,7 @@
"opportunityResourceColumnLabel": "Opportunity",
"opportunitySavingsColumnLabel": "Estimated Savings",
"passedAuditsGroupTitle": "Passed audits",
"pwaRemovalMessage": "Alongside [Chrome’s updated Installability Criteria](https://developer.chrome.com/blog/update-install-criteria), Lighthouse will be deprecating the PWA category in a future release. Please refer to the [updated PWA documentation](https://developer.chrome.com/docs/devtools/progressive-web-apps/) for future PWA testing.",
"runtimeAnalysisWindow": "Initial page load",
"runtimeAnalysisWindowSnapshot": "Point-in-time snapshot",
"runtimeAnalysisWindowTimespan": "User interactions timespan",
Expand Down Expand Up @@ -19944,7 +19947,7 @@
}
]
},
"guidanceLevel": 3
"guidanceLevel": 4
},
"valid-source-maps": {
"id": "valid-source-maps",
Expand Down Expand Up @@ -19993,7 +19996,7 @@
"pathLength": 2
}
},
"guidanceLevel": 3
"guidanceLevel": 4
},
"csp-xss": {
"id": "csp-xss",
Expand Down Expand Up @@ -21909,7 +21912,7 @@
"description": "Many navigations are performed by going back to a previous page, or forwards again. The back/forward cache (bfcache) can speed up these return navigations. [Learn more about the bfcache](https://developer.chrome.com/docs/lighthouse/performance/bf-cache/)",
"score": 1,
"scoreDisplayMode": "binary",
"guidanceLevel": 2
"guidanceLevel": 4
}
},
"configSettings": {
Expand Down Expand Up @@ -25211,6 +25214,7 @@
"opportunityResourceColumnLabel": "Opportunity",
"opportunitySavingsColumnLabel": "Estimated Savings",
"passedAuditsGroupTitle": "Passed audits",
"pwaRemovalMessage": "Alongside [Chrome’s updated Installability Criteria](https://developer.chrome.com/blog/update-install-criteria), Lighthouse will be deprecating the PWA category in a future release. Please refer to the [updated PWA documentation](https://developer.chrome.com/docs/devtools/progressive-web-apps/) for future PWA testing.",
"runtimeAnalysisWindow": "Initial page load",
"runtimeAnalysisWindowSnapshot": "Point-in-time snapshot",
"runtimeAnalysisWindowTimespan": "User interactions timespan",
Expand Down
7 changes: 4 additions & 3 deletions core/test/results/sample_v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -2875,7 +2875,7 @@
}
]
},
"guidanceLevel": 3
"guidanceLevel": 4
},
"valid-source-maps": {
"id": "valid-source-maps",
Expand Down Expand Up @@ -2969,7 +2969,7 @@
"pathLength": 4
}
},
"guidanceLevel": 3
"guidanceLevel": 4
},
"csp-xss": {
"id": "csp-xss",
Expand Down Expand Up @@ -5852,7 +5852,7 @@
}
]
},
"guidanceLevel": 2
"guidanceLevel": 4
}
},
"configSettings": {
Expand Down Expand Up @@ -9468,6 +9468,7 @@
"opportunityResourceColumnLabel": "Opportunity",
"opportunitySavingsColumnLabel": "Estimated Savings",
"passedAuditsGroupTitle": "Passed audits",
"pwaRemovalMessage": "Alongside [Chrome’s updated Installability Criteria](https://developer.chrome.com/blog/update-install-criteria), Lighthouse will be deprecating the PWA category in a future release. Please refer to the [updated PWA documentation](https://developer.chrome.com/docs/devtools/progressive-web-apps/) for future PWA testing.",
"runtimeAnalysisWindow": "Initial page load",
"runtimeAnalysisWindowSnapshot": "Point-in-time snapshot",
"runtimeAnalysisWindowTimespan": "User interactions timespan",
Expand Down
3 changes: 3 additions & 0 deletions proto/lighthouse-result.proto
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,9 @@ message I18n {

// Descriptive label that this analysis considers a snapshot of the page at a single point in time
string runtime_analysis_window_snapshot = 66;

// Message for PWA deprecation.
string pwa_removal_message = 67;
}

// The message holding all formatted strings used in the renderer.
Expand Down
6 changes: 6 additions & 0 deletions report/renderer/pwa-category-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ export class PwaCategoryRenderer extends CategoryRenderer {
render(category, groupDefinitions = {}) {
const categoryElem = this.dom.createElement('div', 'lh-category');
categoryElem.id = category.id;
// Deprecation warning banner.
const pwaMessageContainer = this.dom.createComponent('warningsToplevel');
const pwaMessageEl = this.dom.find('.lh-warnings__msg', pwaMessageContainer);
pwaMessageEl.append(this.dom.convertMarkdownLinkSnippets(Globals.strings.pwaRemovalMessage));

categoryElem.append(pwaMessageContainer);
categoryElem.append(this.renderCategoryHeader(category, groupDefinitions));

const auditRefs = category.auditRefs;
Expand Down
3 changes: 3 additions & 0 deletions report/renderer/report-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,9 @@ const UIStrings = {
openInANewTabTooltip: 'Open in a new tab',
/** Generic category name for all resources that could not be attributed to a 1st or 3rd party entity. */
unattributable: 'Unattributable',

/** Message communicating the removal of the PWA category. */
pwaRemovalMessage: 'Alongside [Chrome’s updated Installability Criteria](https://developer.chrome.com/blog/update-install-criteria), Lighthouse will be deprecating the PWA category in a future release. Please refer to the [updated PWA documentation](https://developer.chrome.com/docs/devtools/progressive-web-apps/) for future PWA testing.',
};

export {
Expand Down
5 changes: 4 additions & 1 deletion report/test/renderer/report-renderer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,10 @@ describe('ReportRenderer', () => {
const warningResults = Object.assign({}, sampleResults, {runWarnings: []});
const container = renderer._dom.document().body;
const output = renderer.renderReport(warningResults, container);
assert.strictEqual(output.querySelector('.lh-warnings--toplevel'), null);
const warningEls = output.querySelectorAll('.lh-warnings--toplevel');
// PWA deprecation warning.
expect(warningEls).toHaveLength(1);
expect(warningEls[0].textContent).toContain('deprecating the PWA category');
});

it('renders a warning section', () => {
Expand Down
3 changes: 3 additions & 0 deletions shared/localization/locales/en-US.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions shared/localization/locales/en-XL.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 851525e

Please sign in to comment.