-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
New Audit: using deprecated APIs #1470
Conversation
|
||
const Gatherer = require('./gatherer'); | ||
|
||
class ConsoleViolations extends Gatherer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Afaict, this will gather all logs added to console rather than just violations, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right. All logging generated by chrome. Not those using the console
api. Are you thinking a rename of the class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically yeah. Console logs don't go through Log.entryAdded? Thought they did!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently they've been broken out into https://chromedevtools.github.io/debugger-protocol-viewer/tot/Runtime/#event-consoleAPICalled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
afterPass(options) { | ||
return this.endConsoleMessageCollect(options.driver) | ||
.then(entries => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove this function and just go to catch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
"name": "Avoiding deprecated APIs and browser interventions", | ||
"audits": { | ||
"deprecations": { | ||
"expectedValue": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't these not do anything since it's unscored?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. Just adding as a creative of habit. Removed.
PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good
@@ -17,4 +17,4 @@ | |||
|
|||
body { | |||
background-color: #eee; | |||
} | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new line was bad?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure why vscode stripped it. Done.
function deprecationsTest() { | ||
stampTemplate('deprecations-tmpl', document.head); | ||
|
||
// Some APIs atm are not triggering Chrome's deprecation messags. https://crbug.com/680832. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
messages
, but maybe something more like // TODO: some deprecated API messages are not currently being logged correctly. See: https://crbug.com/680832
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
// FAIL | ||
const xhr = new XMLHttpRequest(); | ||
xhr.open('GET', 'https://lighthouse-viewer.appspot.com/data', false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you do this to the local server? Ideally we wouldn't have any external connections for npm run smoke
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
|
||
const Gatherer = require('./gatherer'); | ||
|
||
class ConsoleLogEntry extends Gatherer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this sounds like "console.log
entries" now :) What about just LogEntries
to mirror debugger protocol's Log
domain? (also made it plural to match e.g. tags-blocking-first-paint
, styles
, all-event-listeners
, etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a great name, is it? Hmm. We need something in between console messages and console logs entries only produced by chrome. LogEntries
is better but it's still ambiguous. What about ChromeConsoleLogs
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like having console + log still associates with console.log
. ChromeConsoleMessages
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
this._logEntries.push(entry); | ||
} | ||
|
||
beginConsoleMessageCollect(driver) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just inline beginConsoleMessageCollect
and endConsoleMessageCollect
? They're really short
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
'use strict'; | ||
|
||
/** | ||
* @fileoverview Audits a page to determine if it is calling deprecated APIs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe slightly more specific about auditing the log messages to surface deprecated API warnings or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
// MediaStreamTrack.getSources(); // FAIL | ||
// } catch(e) {} | ||
|
||
// console.timeline(); // FAIL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it be crazy to uncomment these so we'd be forced to keep up to date as they're fixed and so the expectations file would no longer match? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we want to do that b/c smokehouse tests will fail indefinitely until Chrome fixes it. That could be an annoying while :\
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, I meant uncomment these but keep smokehouse expectation at 4 and let chrome eventually fixing the broken deprecations break the test, then update the expectations. But no problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh got it. Done.
|
||
// FAIL | ||
const xhr = new XMLHttpRequest(); | ||
xhr.open('GET', 'dbw_tester.html', false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, forgot to include earlier: on the topic of cross origin requests, can you change the https://unknown.com
(which appears to be a real site, just not https) to something like https://unknown.invalid
, which is reserved for testing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -117,7 +117,7 @@ module.exports = [ | |||
score: false, | |||
extendedInfo: { | |||
value: { | |||
length: 4 | |||
length: 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how did this one change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The xhr got switched to include another http1.1 resource: xhr.open('GET', 'dbw_tester.html', false);
. Moved from using an http2 endpoint (lighthouse-viewer.appspot.com).
PTAL |
Travis is happy now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
about time, travis. LGTM
🐴 🚃 🎚 🏣 ➡️ 🚨
Horse powerful IOT warning?
…On Wed, Jan 18, 2017, 8:55 PM Brendan Kenny ***@***.***> wrote:
Merged #1470 <#1470>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1470 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAOigCQX-c8PkbvLRCJRLZT47hPlxo3Lks5rTuyigaJpZM4Ljdw->
.
|
R: all
Part of #1458.