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 6 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": "Lighthouse will be deprecating the PWA category with Lighthouse version 12.0. More information about its deprecation [here](https://developer.chrome.com/blog/update-install-criteria?hl=en). For recommended PWA testing, refer to the documentation [here](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": "Lighthouse will be deprecating the PWA category with Lighthouse version 12.0. More information about its deprecation [here](https://developer.chrome.com/blog/update-install-criteria?hl=en). For recommended PWA testing, refer to the documentation [here](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": "Lighthouse will be deprecating the PWA category with Lighthouse version 12.0. More information about its deprecation [here](https://developer.chrome.com/blog/update-install-criteria?hl=en). For recommended PWA testing, refer to the documentation [here](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": "Lighthouse will be deprecating the PWA category with Lighthouse version 12.0. More information about its deprecation [here](https://developer.chrome.com/blog/update-install-criteria?hl=en). For recommended PWA testing, refer to the documentation [here](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": "Lighthouse will be deprecating the PWA category with Lighthouse version 12.0. More information about its deprecation [here](https://developer.chrome.com/blog/update-install-criteria?hl=en). For recommended PWA testing, refer to the documentation [here](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: 'Lighthouse will be deprecating the PWA category with Lighthouse version 12.0. More information about its deprecation [here](https://developer.chrome.com/blog/update-install-criteria?hl=en). For recommended PWA testing, refer to the documentation [here](https://developer.chrome.com/docs/devtools/progressive-web-apps/).',
adrianaixba marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

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

re https://developer.chrome.com/blog/update-install-criteria?hl=en

@connorjclark @brendankenny can we just leave hl=en in for translators. Will they change this link to use their own locale?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah this was an artifact of copying/pasting.. i can remove the ?hl=en :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

They will not change that.

Do we cover the same languages? We could add this programatically.

Copy link
Member

Choose a reason for hiding this comment

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

Looks like they don't cover every language we do. Let's just remove the ?hl=en, maybe the site can automatically detect locale.

};

export {
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