-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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(audit): align meta properties with LHR #5540
Conversation
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.
hot damn.
looking around.. computed artifacts and gatherers still use a 'name', but thats a separate issue.
It's a little challenging to determine if any description
s were left out of the rename from here. :/ But i'm sure it's fine. :)
curious: how much of this was done via 'rename symbol' ?
Yeah it was a little tricky renaming to something else we were using, haha.
0% :(, it doesn't seem to be very reliable with js yet, maybe it's an insiders bug, but first time I tried it, it went nuts and changed an extra ~70 unnecessary files with imports and other nonsense. type checking caught a few extra things though which is nice! |
there's two more instances of |
hm @paulirish where? vscode isn't finding any more non-string ones :/ |
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 clean up! Mostly comments to try to ward off the // eslint-disable-next-line max-len
invasion :)
'`[role="columnheader"/"rowheader"]` do not have data cells they describe.', | ||
helpText: 'Screen readers have features to make navigating tables easier. Ensuring table ' + | ||
// eslint-disable-next-line max-len |
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.
other shifts were fixed, just fix this one as well? :)
helpText: 'Text-based responses should be served with compression (gzip, deflate or brotli)' + | ||
title: 'Enable text compression', | ||
// eslint-disable-next-line max-len | ||
description: 'Text-based responses should be served with compression (gzip, deflate or brotli)' + |
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.
easy shift :)
id: 'first-contentful-paint', | ||
title: 'First Contentful Paint', | ||
// eslint-disable-next-line max-len | ||
description: 'First contentful paint marks the time at which the first text/image is painted. ' + |
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.
😬😬🎉
helpText: 'First Meaningful Paint measures when the primary content of a page is visible. ' + | ||
id: 'first-meaningful-paint', | ||
title: 'First Meaningful Paint', | ||
// eslint-disable-next-line max-len |
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.
🌵 🍰 😰
name: 'pwa-page-transitions', | ||
helpText: 'Transitions should feel snappy as you tap around, even on a slow network, a key ' + | ||
id: 'pwa-page-transitions', | ||
// eslint-disable-next-line max-len |
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.
🏷 🍃 🚈
name: 'missing-description', | ||
helpText: 'This is missing required description (and failure description)', | ||
id: 'missing-description', | ||
title: 'Missing required artifacts', |
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.
description
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.
err.. if its the same test then we'd leave out title
and failureTitle
but provide a description.
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.
Ha, I meant that the title said it was missing artifacts but good point
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.
we already have missing-title
for that, this one is really the help text check, git diff is confused
name: 'missing-category', | ||
description: 'Missing required artifacts', | ||
helpText: 'This is missing required artifacts', | ||
id: 'missing-category', |
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.
we also got these wrong :)
docs/architecture.md
Outdated
* **Audit failure description** - Short user-visible title for a failing audit. eg. “Some image elements do not have `[alt]` attributes.” | ||
* **Audit help text** - Explanation of why the user should care about the audit. Not necessarily how to fix it, unless there is no external link that explains it. ([See helpText guidelines](CONTRIBUTING.md#helptext-guidelines)). eg. “Informative elements should aim for short, descriptive alternate text. Decorative elements can be ignored with an empty alt attribute. [Learn more].” | ||
* **Audit title** - Short user-visible title for the successful audit. eg. “All image elements have `[alt]` attributes.” | ||
* **Audit failure title** - Short user-visible title for a failing audit. eg. “Some image elements do not have `[alt]` attributes.” |
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.
should we change it to **Audit failureTitle**
just to be crystal clear it's that property name?
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
lighthouse-core/config/config.js
Outdated
@@ -8,13 +8,13 @@ | |||
const defaultConfigPath = './default-config.js'; | |||
const defaultConfig = require('./default-config.js'); | |||
const fullConfig = require('./full-config.js'); | |||
const constants = require('./constants'); | |||
const constants = require('./constants.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.
:)
@@ -8,7 +8,7 @@ | |||
const Config = require('../../config/config'); | |||
const assert = require('assert'); | |||
const path = require('path'); | |||
const defaultConfig = require('../../config/default-config.js'); | |||
const defaultConfig = require('../../config/default-config'); |
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.
:( :(
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.
lol this was also vscode, I have no idea why it's inconsistent
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.
oooooh wait I think it's trying to match the ones around it! so clever :D
name: 'missing-description', | ||
helpText: 'This is missing required description (and failure description)', | ||
id: 'missing-description', | ||
title: 'Missing required artifacts', |
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.
err.. if its the same test then we'd leave out title
and failureTitle
but provide a description.
audits: [basePath + '/missing-help-text'], | ||
}), /meta.helpText property/); | ||
audits: [basePath + '/missing-description'], | ||
}), /meta.description property/); | ||
|
||
assert.throws(_ => new Config({ | ||
audits: [ | ||
class EmptyStringHelpTextAudit extends Audit { |
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.
hm @paulirish where? vscode isn't finding any more non-string ones :/
yeah i was just looking for any of them. relax that case sensitivity ;)
helptext -> description
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.
fixed
name: 'empty-string-help-text', | ||
description: 'description', | ||
helpText: '', | ||
id: 'empty-string-help-text', |
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.
helptext -> description
and you fixed the one in valid-custom-audit already. :)
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 gotcha :) fixed!
audits: [basePath + '/missing-description'], | ||
}), /meta.description property/); | ||
audits: [basePath + '/missing-title'], | ||
}), /meta.title property/); | ||
|
||
assert.throws(_ => new Config({ | ||
audits: [ | ||
class BinaryButNoFailureDescAudit extends Audit { |
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.
failureTitle
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
We updated the output, but not the input. Before we get stuck with helpText for a year and officially ship the major, we should do that :)
name -> id
description -> title
helpText -> description