[go: nahoru, domu]

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(config): remove gatherer options support #11743

Merged
merged 3 commits into from
Dec 2, 2020

Conversation

patrickhulce
Copy link
Collaborator

Summary (Why)
Gatherer options as implemented today fundamentally clash with the more useful level of artifact options proposed by FR. They aren't being used anywhere in Lighthouse core and I doubt they ever caught on in custom config land (plugins can't define gatherers). Removing them now will ease the config transition plan with minimal cost.

Summary (What)
Removes support for gatherer options. We added them three years ago at the same time as audit options when we first started playing around with LR and originally planned to utilize them for scoped opportunities until we scrapped that plan before I/O that year and we never ended up using them since.

It's a breaking change because custom gatherers might have discovered gatherer options but they aren't particularly useful if you already own the gatherer implementation so I doubt they caught on much.

There's also a small feature improvement here that de-dupes gatherers by artifact name instead of the file path. This would result on overwriting of artifacts at runtime anyway so they're already being de-duped today, but you don't find out about it until much later.

Related Issues/PRs
ref #11313

@patrickhulce patrickhulce requested a review from a team as a code owner December 1, 2020 22:13
@patrickhulce patrickhulce requested review from Beytoven and removed request for a team December 1, 2020 22:13
@google-cla google-cla bot added the cla: yes label Dec 1, 2020
Copy link
Collaborator
@connorjclark connorjclark left a comment

Choose a reason for hiding this comment

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

+1

couldn't find any mention to this feature in markdown files

} else {
throw new Error('Invalid expanded Gatherer: ' + JSON.stringify(gathererDefn));
}
});

const mergedDefns = mergeOptionsOfItems(gathererDefns);
// De-dupe gatherers by artifact name.
const mergedDefns = Array.from(
Copy link
Collaborator

Choose a reason for hiding this comment

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

neat pattern

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.

Love this! My kind of PR :)

lighthouse-core/config/config.js Outdated Show resolved Hide resolved
lighthouse-core/test/config/config-test.js Outdated Show resolved Hide resolved
lighthouse-core/test/config/config-test.js Show resolved Hide resolved
@brendankenny brendankenny assigned brendankenny and unassigned Beytoven Dec 1, 2020
@brendankenny brendankenny removed the request for review from Beytoven December 1, 2020 23:23
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.

oops, hit submit too soon:

Review stolen from @Beytoven with his permission. LGTM!

Co-authored-by: Brendan Kenny <bckenny@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants