Skip to content
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

Merged
merged 4 commits into from
Jun 25, 2018
Merged

Conversation

patrickhulce
Copy link
Collaborator

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

Copy link
Member

@paulirish paulirish left a 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 descriptions 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' ?

@patrickhulce
Copy link
Collaborator Author

It's a little challenging to determine if any descriptions were left out of the rename from here. :/ But i'm sure it's fine. :)

Yeah it was a little tricky renaming to something else we were using, haha.

curious: how much of this was done via 'rename symbol' ?

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!

@paulirish
Copy link
Member

paulirish commented Jun 21, 2018

there's two more instances of helptext that should probably be renamed (though its not a bug). also some FailureDesc

@patrickhulce
Copy link
Collaborator Author

hm @paulirish where? vscode isn't finding any more non-string ones :/
image

image

Copy link
Member

@brendankenny brendankenny left a 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
Copy link
Member

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)' +
Copy link
Member

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. ' +
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

description

Copy link
Member

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.

Copy link
Member

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

Copy link
Collaborator Author

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',
Copy link
Member

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 :)

* **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.”
Copy link
Member

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -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');
Copy link
Member

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');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:( :(

Copy link
Collaborator Author

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

Copy link
Collaborator Author

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',
Copy link
Member

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 {
Copy link
Member

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

Copy link
Collaborator Author

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',
Copy link
Member

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. :)

Copy link
Collaborator Author

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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

failureTitle

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@patrickhulce patrickhulce merged commit 6285e1e into master Jun 25, 2018
@patrickhulce patrickhulce deleted the audit_property_names branch June 25, 2018 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants