Skip to content

Commit

Permalink
core(deprecations): backport translated strings (#14482)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamraine committed Oct 31, 2022
1 parent 364ccdf commit 5932d59
Show file tree
Hide file tree
Showing 10 changed files with 898 additions and 977 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -307,13 +307,12 @@ const expectations = {
},
},
'deprecations': {
_maxChromiumVersion: '103.0.5017.0', // TODO: deprecation strings need to be translated
// see https://github.com/GoogleChrome/lighthouse/issues/13895
score: 0,
details: {
items: [
{
value: /'window.webkitStorageInfo' is deprecated/,
value: /`window.webkitStorageInfo` is deprecated/,
source: {
type: 'source-location',
url: 'http://localhost:10200/dobetterweb/dbw_tester.js',
Expand All @@ -324,8 +323,7 @@ const expectations = {
subItems: undefined,
},
{
_maxChromiumVersion: '103.0.5017.0',
value: /Synchronous XMLHttpRequest on the main thread is deprecated/,
value: /Synchronous `XMLHttpRequest` on the main thread is deprecated/,
source: {
type: 'source-location',
url: 'http://localhost:10200/dobetterweb/dbw_tester.html',
Expand Down
593 changes: 12 additions & 581 deletions lighthouse-core/audits/deprecations.js

Large diffs are not rendered by default.

573 changes: 573 additions & 0 deletions lighthouse-core/lib/deprecations-strings.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lighthouse-core/lib/network-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const RESOURCE_TYPES = {
Ping: 'Ping',
Preflight: 'Preflight',
CSPViolationReport: 'CSPViolationReport',
Prefetch: 'Prefetch',
};

class NetworkRequest {
Expand Down
13 changes: 2 additions & 11 deletions lighthouse-core/scripts/i18n/collect-strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -653,15 +653,8 @@ function resolveMessageCollisions(strings) {

try {
expect(collidingMessages).toEqual([
'$MARKDOWN_SNIPPET_0$ is deprecated. Please use $MARKDOWN_SNIPPET_1$ instead.',
'$MARKDOWN_SNIPPET_0$ is deprecated. Please use $MARKDOWN_SNIPPET_1$ instead.',
'$MARKDOWN_SNIPPET_0$ is deprecated. Please use $MARKDOWN_SNIPPET_1$ instead.',
'$MARKDOWN_SNIPPET_0$ is deprecated. Please use $MARKDOWN_SNIPPET_1$ instead.',
'$MARKDOWN_SNIPPET_0$ is deprecated. Please use $MARKDOWN_SNIPPET_1$ instead.',
'$MARKDOWN_SNIPPET_0$ is deprecated. Please use $MARKDOWN_SNIPPET_1$ instead.',
'$MARKDOWN_SNIPPET_0$ is deprecated. Please use $MARKDOWN_SNIPPET_1$ instead.',
'$MARKDOWN_SNIPPET_0$ is deprecated. Please use $MARKDOWN_SNIPPET_1$ or $MARKDOWN_SNIPPET_2$ instead.',
'$MARKDOWN_SNIPPET_0$ is deprecated. Please use $MARKDOWN_SNIPPET_1$ or $MARKDOWN_SNIPPET_2$ instead.',
'$MARKDOWN_SNIPPET_0$ is deprecated. Please use standardized $MARKDOWN_SNIPPET_1$ instead.',
'$MARKDOWN_SNIPPET_0$ is deprecated. Please use standardized $MARKDOWN_SNIPPET_1$ instead.',
'ARIA $MARKDOWN_SNIPPET_0$ elements do not have accessible names.',
'ARIA $MARKDOWN_SNIPPET_0$ elements do not have accessible names.',
'ARIA $MARKDOWN_SNIPPET_0$ elements do not have accessible names.',
Expand All @@ -681,8 +674,6 @@ function resolveMessageCollisions(strings) {
'Name',
'Potential Savings',
'Potential Savings',
'Triggering $MARKDOWN_SNIPPET_0$ from cross origin iframes has been deprecated and will be removed in the future.',
'Triggering $MARKDOWN_SNIPPET_0$ from cross origin iframes has been deprecated and will be removed in the future.',
'Use the $MARKDOWN_SNIPPET_0$ component and set the appropriate $MARKDOWN_SNIPPET_1$. $LINK_START_0$Learn more$LINK_END_0$.',
'Use the $MARKDOWN_SNIPPET_0$ component and set the appropriate $MARKDOWN_SNIPPET_1$. $LINK_START_0$Learn more$LINK_END_0$.',
]);
Expand Down
15 changes: 13 additions & 2 deletions lighthouse-core/test/audits/deprecations-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,23 @@ describe('Deprecations audit', () => {
columnNumber: 100,
},
},
{
type: 'PrefixedVideoDisplayingFullscreen',
sourceCodeLocation: {
url: URL,
lineNumber: 101,
columnNumber: 100,
},
},
],
},
SourceMaps: [],
ScriptElements: [],
}, context);

assert.equal(auditResult.score, 0);
expect(auditResult.displayValue).toBeDisplayString('3 warnings found');
assert.equal(auditResult.details.items.length, 3);
expect(auditResult.displayValue).toBeDisplayString('4 warnings found');
assert.equal(auditResult.details.items.length, 4);
assert.equal(auditResult.details.items[0].value, 'Deprecation message 123');
assert.equal(auditResult.details.items[0].source.url, URL);
assert.equal(auditResult.details.items[0].source.line, 123);
Expand All @@ -77,5 +85,8 @@ describe('Deprecations audit', () => {
text: expect.toBeDisplayString('This change will go into effect with milestone 109.'),
url: 'https://chromiumdash.appspot.com/schedule',
});
expect(auditResult.details.items[3].value).toBeDisplayString(
// eslint-disable-next-line max-len
'HTMLVideoElement.webkitDisplayingFullscreen is deprecated. Please use Document.fullscreenElement instead.');
});
});
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
"cpy": "^8.1.2",
"cross-env": "^7.0.2",
"csv-validator": "^0.0.3",
"devtools-protocol": "0.0.999451",
"devtools-protocol": "0.0.1034970",
"es-main": "^1.0.2",
"eslint": "^8.4.1",
"eslint-config-google": "^0.14.0",
Expand Down Expand Up @@ -209,8 +209,8 @@
"yargs-parser": "^21.0.0"
},
"resolutions": {
"puppeteer/**/devtools-protocol": "0.0.999451",
"puppeteer-core/**/devtools-protocol": "0.0.999451"
"puppeteer/**/devtools-protocol": "0.0.1034970",
"puppeteer-core/**/devtools-protocol": "0.0.1034970"
},
"repository": "GoogleChrome/lighthouse",
"keywords": [
Expand Down

0 comments on commit 5932d59

Please sign in to comment.