Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: warning banner for PWA category deprecation #15741

Merged
merged 12 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7117,6 +7117,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 Lighthouse version 12.0. For recommended PWA testing, refer to the following [documentation](https://developer.chrome.com/docs/devtools/progressive-web-apps/).",
"runtimeAnalysisWindow": "Initial page load",
"runtimeAnalysisWindowSnapshot": "Point-in-time snapshot",
"runtimeAnalysisWindowTimespan": "User interactions timespan",
Expand Down Expand Up @@ -12197,6 +12198,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 Lighthouse version 12.0. For recommended PWA testing, refer to the following [documentation](https://developer.chrome.com/docs/devtools/progressive-web-apps/).",
"runtimeAnalysisWindow": "Initial page load",
"runtimeAnalysisWindowSnapshot": "Point-in-time snapshot",
"runtimeAnalysisWindowTimespan": "User interactions timespan",
Expand Down Expand Up @@ -17256,6 +17258,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 Lighthouse version 12.0. For recommended PWA testing, refer to the following [documentation](https://developer.chrome.com/docs/devtools/progressive-web-apps/).",
"runtimeAnalysisWindow": "Initial page load",
"runtimeAnalysisWindowSnapshot": "Point-in-time snapshot",
"runtimeAnalysisWindowTimespan": "User interactions timespan",
Expand Down Expand Up @@ -25208,6 +25211,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 Lighthouse version 12.0. For recommended PWA testing, refer to the following [documentation](https://developer.chrome.com/docs/devtools/progressive-web-apps/).",
"runtimeAnalysisWindow": "Initial page load",
"runtimeAnalysisWindowSnapshot": "Point-in-time snapshot",
"runtimeAnalysisWindowTimespan": "User interactions timespan",
Expand Down
1 change: 1 addition & 0 deletions core/test/results/sample_v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -9467,6 +9467,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 Lighthouse version 12.0. For recommended PWA testing, refer to the following [documentation](https://developer.chrome.com/docs/devtools/progressive-web-apps/).",
"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
1 change: 1 addition & 0 deletions report/renderer/report-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ export class ReportRenderer {

const reportContainer = this._dom.createElement('div', 'lh-container');
const reportSection = this._dom.createElement('div', 'lh-report');

adrianaixba marked this conversation as resolved.
Show resolved Hide resolved
reportSection.append(this._renderReportWarnings(report));

let scoreHeader;
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 Lighthouse version 12.0. For recommended PWA testing, refer to the following [documentation](https://developer.chrome.com/docs/devtools/progressive-web-apps/).',
adrianaixba marked this conversation as resolved.
Show resolved Hide resolved
};

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.

Loading