chrome-devtools-frontend 1.0.1013875 → 1.0.1014346
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/front_end/core/i18n/locales/en-US.json +3 -0
- package/front_end/core/i18n/locales/en-XL.json +3 -0
- package/front_end/models/issues_manager/DeprecationIssue.ts +10 -0
- package/front_end/panels/lighthouse/LighthouseStartView.ts +1 -0
- package/package.json +1 -1
- package/scripts/eslint_rules/lib/check_component_naming.js +14 -6
- package/scripts/eslint_rules/tests/check_component_naming_test.js +23 -0
@@ -1412,6 +1412,9 @@
|
|
1412
1412
|
"models/issues_manager/DeprecationIssue.ts | hostCandidateAttributeGetter": {
|
1413
1413
|
"message": "RTCPeerConnectionIceErrorEvent.hostCandidate is deprecated. Please use RTCPeerConnectionIceErrorEvent.address or RTCPeerConnectionIceErrorEvent.port instead."
|
1414
1414
|
},
|
1415
|
+
"models/issues_manager/DeprecationIssue.ts | identityInCanMakePaymentEvent": {
|
1416
|
+
"message": "The merchant origin and arbitrary data from the canmakepayment service worker event are deprecated and will be removed: topOrigin, paymentRequestOrigin, methodData, modifiers."
|
1417
|
+
},
|
1415
1418
|
"models/issues_manager/DeprecationIssue.ts | insecurePrivateNetworkSubresourceRequest": {
|
1416
1419
|
"message": "The website requested a subresource from a network that it could only access because of its users' privileged network position. These requests expose non-public devices and servers to the internet, increasing the risk of a cross-site request forgery (CSRF) attack, and/or information leakage. To mitigate these risks, Chrome deprecates requests to non-public subresources when initiated from non-secure contexts, and will start blocking them."
|
1417
1420
|
},
|
@@ -1412,6 +1412,9 @@
|
|
1412
1412
|
"models/issues_manager/DeprecationIssue.ts | hostCandidateAttributeGetter": {
|
1413
1413
|
"message": "RTCPeerConnectionIceErrorEvent.hostCandidate îś d̂ép̂ŕêćât́êd́. P̂ĺêáŝé ûśê RTCPeerConnectionIceErrorEvent.address ór̂ RTCPeerConnectionIceErrorEvent.port ín̂śt̂éâd́."
|
1414
1414
|
},
|
1415
|
+
"models/issues_manager/DeprecationIssue.ts | identityInCanMakePaymentEvent": {
|
1416
|
+
"message": "T̂h́ê ḿêŕĉh́âńt̂ ór̂íĝín̂ án̂d́ âŕb̂ít̂ŕâŕŷ d́ât́â f́r̂óm̂ t́ĥé canmakepayment ŝér̂v́îćê ẃôŕk̂ér̂ év̂én̂t́ âŕê d́êṕr̂éĉát̂éd̂ án̂d́ ŵíl̂ĺ b̂é r̂ém̂óv̂éd̂: topOrigin, paymentRequestOrigin, methodData, modifiers."
|
1417
|
+
},
|
1415
1418
|
"models/issues_manager/DeprecationIssue.ts | insecurePrivateNetworkSubresourceRequest": {
|
1416
1419
|
"message": "T̂h́ê ẃêb́ŝít̂é r̂éq̂úêśt̂éd̂ á ŝúb̂ŕêśôúr̂ćê f́r̂óm̂ á n̂ét̂ẃôŕk̂ t́ĥát̂ ít̂ ćôúl̂d́ ôńl̂ý âćĉéŝś b̂éĉáûśê óf̂ ít̂ś ûśêŕŝ' ṕr̂ív̂íl̂éĝéd̂ ńêt́ŵór̂ḱ p̂óŝít̂íôń. T̂h́êśê ŕêq́ûéŝt́ŝ éx̂ṕôśê ńôń-p̂úb̂ĺîć d̂év̂íĉéŝ án̂d́ ŝér̂v́êŕŝ t́ô t́ĥé îńt̂ér̂ńêt́, îńĉŕêáŝín̂ǵ t̂h́ê ŕîśk̂ óf̂ á ĉŕôśŝ-śît́ê ŕêq́ûéŝt́ f̂ór̂ǵêŕŷ (ĆŜŔF̂) át̂t́âćk̂, án̂d́/ôŕ îńf̂ór̂ḿât́îón̂ ĺêák̂áĝé. T̂ó m̂ít̂íĝát̂é t̂h́êśê ŕîśk̂ś, Ĉh́r̂óm̂é d̂ép̂ŕêćât́êś r̂éq̂úêśt̂ś t̂ó n̂ón̂-ṕûb́l̂íĉ śûb́r̂éŝóûŕĉéŝ ẃĥén̂ ín̂ít̂íât́êd́ f̂ŕôḿ n̂ón̂-śêćûŕê ćôńt̂éx̂t́ŝ, án̂d́ ŵíl̂ĺ ŝt́âŕt̂ b́l̂óĉḱîńĝ t́ĥém̂."
|
1417
1420
|
},
|
@@ -119,6 +119,12 @@ const UIStrings = {
|
|
119
119
|
*/
|
120
120
|
hostCandidateAttributeGetter:
|
121
121
|
'`RTCPeerConnectionIceErrorEvent.hostCandidate` is deprecated. Please use `RTCPeerConnectionIceErrorEvent.address` or `RTCPeerConnectionIceErrorEvent.port` instead.',
|
122
|
+
/**
|
123
|
+
* @description A deprecation warning shown in the DevTools Issues tab,
|
124
|
+
* when a service worker reads one of the fields from an event named
|
125
|
+
* "canmakepayment".
|
126
|
+
*/
|
127
|
+
identityInCanMakePaymentEvent: 'The merchant origin and arbitrary data from the `canmakepayment` service worker event are deprecated and will be removed: `topOrigin`, `paymentRequestOrigin`, `methodData`, `modifiers`.',
|
122
128
|
/**
|
123
129
|
* @description TODO(crbug.com/1320343): Description needed for translation
|
124
130
|
*/
|
@@ -377,6 +383,10 @@ export class DeprecationIssue extends Issue {
|
|
377
383
|
case Protocol.Audits.DeprecationIssueType.HostCandidateAttributeGetter:
|
378
384
|
messageFunction = i18nLazyString(UIStrings.hostCandidateAttributeGetter);
|
379
385
|
break;
|
386
|
+
case Protocol.Audits.DeprecationIssueType.IdentityInCanMakePaymentEvent:
|
387
|
+
messageFunction = i18nLazyString(UIStrings.identityInCanMakePaymentEvent);
|
388
|
+
feature = 5190978431352832;
|
389
|
+
break;
|
380
390
|
case Protocol.Audits.DeprecationIssueType.InsecurePrivateNetworkSubresourceRequest:
|
381
391
|
messageFunction = i18nLazyString(UIStrings.insecurePrivateNetworkSubresourceRequest);
|
382
392
|
feature = 5436853517811712;
|
package/package.json
CHANGED
@@ -19,6 +19,7 @@ module.exports = {
|
|
19
19
|
noDefineCall: 'Could not find a defineComponent() call for the component {{ tagName }}.',
|
20
20
|
defineCallNonLiteral: 'defineComponent() first argument must be a string literal.',
|
21
21
|
staticLiteralInvalid: 'static readonly litTagName must use a literal string, with no interpolation.',
|
22
|
+
duplicateStaticLitTagName: 'found a duplicated litTagName: {{ tagName }}',
|
22
23
|
litTagNameNotLiteral:
|
23
24
|
'litTagName must be defined as a string passed in as LitHtml.literal`component-name`, but no tagged template was found.',
|
24
25
|
staticLiteralNotReadonly: 'static litTagName must be readonly.'
|
@@ -90,8 +91,9 @@ module.exports = {
|
|
90
91
|
});
|
91
92
|
}
|
92
93
|
|
93
|
-
|
94
|
-
|
94
|
+
// Map of litTagName to the class node.
|
95
|
+
/** @type {Map<string, any}>} */
|
96
|
+
const componentClassDefinitionLitTagNameNodes = new Map();
|
95
97
|
|
96
98
|
/** @type {Set<string>} */
|
97
99
|
const defineComponentCallsFound = new Set();
|
@@ -147,8 +149,15 @@ module.exports = {
|
|
147
149
|
// Grab the name of the component, e.g:
|
148
150
|
// LitHtml.literal`devtools-foo` will pull "devtools-foo" out.
|
149
151
|
const componentTagName = componentTagNameNode.value.quasi.quasis[0].value.cooked;
|
150
|
-
|
151
|
-
|
152
|
+
|
153
|
+
// Now we ensure that we haven't found this tag name before. If we
|
154
|
+
// have, we have two components with the same litTagName property,
|
155
|
+
// which is an error.
|
156
|
+
if (componentClassDefinitionLitTagNameNodes.has(componentTagName)) {
|
157
|
+
context.report({node: componentClassDefinition, messageId: 'duplicateStaticLitTagName', data: {tagName: componentTagName}});
|
158
|
+
}
|
159
|
+
|
160
|
+
componentClassDefinitionLitTagNameNodes.set(componentTagName, componentClassDefinition);
|
152
161
|
}
|
153
162
|
|
154
163
|
// Find all defineComponent() calls and store the arguments to them.
|
@@ -177,8 +186,7 @@ module.exports = {
|
|
177
186
|
}
|
178
187
|
}
|
179
188
|
|
180
|
-
for (const
|
181
|
-
const {tagName, classNode} = foundComponentClass;
|
189
|
+
for (const [tagName, classNode] of componentClassDefinitionLitTagNameNodes) {
|
182
190
|
// Check that each tagName has a matching entry in both other places we expect it.
|
183
191
|
if (!defineComponentCallsFound.has(tagName)) {
|
184
192
|
context.report({node: classNode, messageId: 'noDefineCall', data: {tagName}});
|
@@ -233,5 +233,28 @@ ruleTester.run('check_component_naming', rule, {
|
|
233
233
|
filename: 'front_end/ui/components/Foo.ts',
|
234
234
|
errors: [{messageId: 'noDefineCall', data: {tagName: 'devtools-bar'}}]
|
235
235
|
},
|
236
|
+
{
|
237
|
+
// Multiple components in one file is valid.
|
238
|
+
// But here devtools-foo is fine, but devtools-bar has the wrong static tag name
|
239
|
+
code: `export class Foo extends HTMLElement {
|
240
|
+
static readonly litTagName = LitHtml.literal\`devtools-foo\`
|
241
|
+
}
|
242
|
+
|
243
|
+
export class Bar extends HTMLElement {
|
244
|
+
static readonly litTagName = LitHtml.literal\`devtools-foo\`
|
245
|
+
}
|
246
|
+
|
247
|
+
ComponentHelpers.CustomElements.defineComponent('devtools-foo', Foo);
|
248
|
+
ComponentHelpers.CustomElements.defineComponent('devtools-bar', Foo);
|
249
|
+
|
250
|
+
declare global {
|
251
|
+
interface HTMLElementTagNameMap {
|
252
|
+
'devtools-foo': Foo
|
253
|
+
'devtools-bar': Bar
|
254
|
+
}
|
255
|
+
}`,
|
256
|
+
filename: 'front_end/ui/components/Foo.ts',
|
257
|
+
errors: [{messageId: 'duplicateStaticLitTagName', data: {tagName: 'devtools-foo'}}]
|
258
|
+
},
|
236
259
|
]
|
237
260
|
});
|