-
Notifications
You must be signed in to change notification settings - Fork 74
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
updates for using lighthouse v3 #178
Conversation
lib/index.ts
Outdated
const parseChromeFlags = require('lighthouse/lighthouse-cli/run').parseChromeFlags; | ||
const perfConfig: any = require('./lh-config'); | ||
const perfConfig: any = require('lighthouse/lighthouse-core/config/plots-config.js'); | ||
perfConfig.extends = 'lighthouse:default'; |
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.
note: already fixed in LH master branch and has to be removed
it will be nice if someone takes a look at it before further work on it... |
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.
in 3.0 you have the choice of using lantern's simulated throttling or keep using the devtools throttling. I would recommend using lantern (on by default via the default lighthouse config), but maybe a user should be able to change this.
lib/index.ts
Outdated
const parseChromeFlags = require('lighthouse/lighthouse-cli/run').parseChromeFlags; | ||
const perfConfig: any = require('./lh-config'); | ||
const perfConfig: any = require('lighthouse/lighthouse-core/config/plots-config.js'); |
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 think you should just provide a config file here in this repo. We don't have much reason to maintain that plots-config fwiw. :)
metrics
audit
while everything you need is in the new audit called metrics
it doesnt come with human-readable names. Since you provide those in messages.ts
maybe its fine and all you really need is metrics
. I think this could work.
individual audits
If you really need all the individual audits:
module.exports = {
extends: 'lighthouse:default',
settings: {
onlyAudits: defaultConfig.categories.performance.auditRefs
.filter(a => a.group && a.group === 'metrics')
.map(a => a.id)
},
};
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.
Paul, thanks. Would you like to keep all metrics we already have or reduce their number? I'm kinda confused because I faced that people just ignore FCP and rely only on FMP in perf aduits/case studies etc. As result with 3.0 and plots-config I thought maybe trends were changed...
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 way we look at the problem now is:
key metrics
- FCP
- Speed Index
- TTI
worthwhile diagnostic metrics
- FMP
- FCPUIdle
EIL is interesting but could use some work. it'll also change substantially in the future. And it's not on the same timescale as the others.
FirstVC should mostly be duplicated by FCP.
VizComplete is cool unless it marked the wrong thing, in which case it and Speed Index are totally useless. :)
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.
@paulirish but VizComplete is not part of metrics.
auditRefs: [
{id: 'first-contentful-paint', weight: 3, group: 'metrics'},
{id: 'first-meaningful-paint', weight: 1, group: 'metrics'},
{id: 'speed-index', weight: 4, group: 'metrics'},
{id: 'interactive', weight: 5, group: 'metrics'},
{id: 'first-cpu-idle', weight: 2, group: 'metrics'},
{id: 'estimated-input-latency', weight: 0, group: 'metrics'},
Should it be added there?
Or, should we use pwmetrics-events
and get it manually?
lib/metrics.ts
Outdated
lighthouseVersion: res.lighthouseVersion, | ||
initialUrl: res.initialUrl, | ||
url: res.url | ||
initialUrl: res.finalUrl, |
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.
initial is final?
i'd recommend adopting requestedUrl
and finalUrl
names for this metrics export.
lib/utils/messages.ts
Outdated
case 'estimated-input-latency': | ||
return 'Estimated Input Latency'; | ||
case 'first-cpu-idle': | ||
return 'Time to First Interactive'; |
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 metric is renamed so it'd be best to call it "First CPU Idle" now
lib/utils/messages.ts
Outdated
@@ -44,24 +44,16 @@ const getMessage = function (messageType: string, ...args: any[]) { | |||
return `No matching message prefix: ${args[0]}`; | |||
case 'METRIC_IS_UNAVAILABLE': | |||
return `Sorry, ${args[0]} metric is unavailable`; | |||
case 'ttfcp': | |||
case 'first-meaningful-paint': |
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.
seems wrong.
in 3.0 FCP is both in 'metrics' audit and its own. i would def recommend showing both FCP and FMP in pwmetrics. (plots doesnt have FCP)
at list tests passed ;) |
lib/metrics/metrics.ts
Outdated
// Copyright 2018 Google Inc. All Rights Reserved. | ||
// Licensed under the Apache License, Version 2.0. See LICENSE | ||
|
||
export default { |
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 see this one useful for people using expectations and stuff. What they need is just import our constants and use them for expectations config.
const METRICS = require('pwmetrics/lib/metrics-adapter/metrics');
module.exports = {
url: 'http://my-awesome-site.com'
flags: {
expectations: true
},
expectations: {
[METRICS. TTFCP]: {
warn: '>=1000',
error: '>=2000'
}
}
}
Other then that cleaner for our code to have map metrics ids.
@paulirish we are good to go after solving #178 (comment) Since LH 3.0 is done, It will be nice to announce pwmetrics updates right after LH announcement. |
@paulirish can you take a look here 👀? |
Opened questions are:
|
package.json
Outdated
"chrome-launcher": "^0.10.2", | ||
"google-auth-library": "^0.10.0", | ||
"googleapis": "^16.0.0", | ||
"lighthouse": "^2.9.4", | ||
"lighthouse": "3.0.0", |
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.
you can bump it to 3.0.3 now
package.json
Outdated
"mocha": "^3.2.0", | ||
"sinon": "^1.17.7", | ||
"sinon-chai": "^2.8.0", | ||
"typescript": "^2.0.3" | ||
"typescript": "2.9.1-insiders.20180516", |
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 can go to 3.0.0 now too :)
package.json
Outdated
"mocha": "^3.2.0", | ||
"sinon": "^1.17.7", | ||
"sinon-chai": "^2.8.0", | ||
"typescript": "^2.0.3" | ||
"typescript": "2.9.1-insiders.20180516", | ||
"vscode-chrome-debug-core": "3.23.8" |
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 this is added. was it types?
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 think it's fixed in LH now, so can be dropped 👍
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.
hmm, still needed because without that tsc build failed
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.
huh. weird. we're about to remove that dependency: GoogleChrome/lighthouse#5836
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.
probably we will wait for PR to be merged...
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.
dropped 💥
just waiting for next LH release
.travis.yml
Outdated
- npm install -g --no-progress yarn@v0.22.0 | ||
- lighthouse-extension/node_modules | ||
- lighthouse-viewer/node_modules | ||
- /home/travis/.rvm/gems/ |
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 two lighthouse-* folders dont make sense to me here.
and i dont think you're running ruby, so you can nuke this one too.
lib/index.ts
Outdated
@@ -107,15 +98,15 @@ class PWMetrics { | |||
} | |||
|
|||
if (resultHasExpectationErrors && this.flags.expectations) { | |||
throw new Error(messages.getMessage('HAS_EXPECTATION_ERRORS')); | |||
console.log(getMessage('HAS_EXPECTATION_ERRORS')); |
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.
you want to let things continue in this case? im fine with that, just pointing out that the behavior is changing. :)
probably should console.error() if its staying non-throwing.
recipes/gulp/gulpfile.js
Outdated
@@ -57,22 +39,19 @@ const runPwmetrics = function() { | |||
* @param {Object} results - Pwmetrics results obtained through Lighthouse | |||
*/ | |||
const handleOk = function(results) { | |||
stopServer(); | |||
console.log(results); | |||
console.log(JSON.stringify(results, null, 4)); |
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.
4 -> 2. 😝
types/types.ts
Outdated
4: number; // PSI timing | ||
5: number; // VISUALLY_COMPLETE timing | ||
6: number; // TTFI timing | ||
7: number; // TTCI timing |
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.
since these are changing position, i guess these sheets will be a bit broken 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.
nice catch 👍
lib/metrics/metrics.ts
Outdated
TTFCP: 'first-contentful-paint', | ||
TTFMP: 'first-meaningful-paint', | ||
TTF_CPU_IDLE: 'first-cpu-idle', | ||
TTCI: 'interactive', |
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.
TTI
lib/metrics/metrics.ts
Outdated
export default { | ||
TTFCP: 'first-contentful-paint', | ||
TTFMP: 'first-meaningful-paint', | ||
TTF_CPU_IDLE: 'first-cpu-idle', |
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.
TTFCPUIDLE ? :)
lib/metrics/metrics.ts
Outdated
TTFMP: 'first-meaningful-paint', | ||
TTF_CPU_IDLE: 'first-cpu-idle', | ||
TTCI: 'interactive', | ||
PSI: 'speed-index', |
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.
PSI -> SI everywhere. we ditched perceptual speed index and now just calculate speed index.
Finally CI passes 🎉 |
@paulirish we are ready, I think) |
I'm going to merge it at the and of the day today. In case of issues/comments, we can fix them in separate PR. |
Sounds good
On Sep 12, 2018 1:53 AM, "Artem Denysov" <notifications@github.com> wrote:
I'm going to merge it at the and of the day today. In case of
issues/comments, we can fix them in separate PR.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#178 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACZF769dOQLQ79EonDF3VpIrX_2yFHiks5uaMt4gaJpZM4UQeKE>
.
|
Merged 🎉 |
Still wondering about version, |
i'd say stick to semver so only bump major if you have a breaking change. but since pwmetrics is using simulated throttling instead of devtools (right?), then the metrics numbers aren't really comparable. that'd be a breaking change. :) so 4.0! :) |
yup. thanks) |
Core of changes to use LH v3
Has to be merged after final release and test of v3 version.