-
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
extension: refactor option/flag passing (breaking change) #5769
Conversation
let's defer this a tad. |
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.
LGTM!
🎉 🎉 to understandable options/flags/settings flow :)
|
||
const results = await background.runLighthouseForConnection(connection, url, options, | ||
categoryIDs); | ||
// TODO(paulirish): update LR to provide flags and map outputFormat -> output |
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 like this TODO shouldn't be in this file? (work here is already done)
@@ -73,19 +73,17 @@ async function runLighthouseInExtension(options, categoryIDs) { | |||
* Run lighthouse for connection and provide similar results as in CLI. | |||
* @param {Connection} connection | |||
* @param {string} url | |||
* @param {{flags: LH.Flags} & {outputFormat: string, logAssets: boolean}} options Lighthouse options. | |||
* @param {LH.Flags & {logAssets: boolean}} flags Lighthouse flags plus logAssets |
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.
logAssets
could also be a fifth parameter to the function, or we could wait for some future refactor of saveArtifacts
/saveAssets
/logAssets
(or this could @return {Promise<LH.RunnerResult|void>}
and the caller could pull the artifacts
off there)
tsc also flags
as needing to be updated to just using |
disclaimer: This is a breaking change for our integrations with them so all the clients must also update for this to work.
So I'm okay with delaying this PR for a bit.
This simplifies how we were juggling "options" coming in from extension/devtools/LR. Basically we were passing around an
options
object in the 2 -background files and all we cared about was itsflags
property. And in the case of LR, 2 other props came in onoptions
and eventually are delivered intoRunner.run
, despite our typing.reviewers:
runner.js only has a rename. boring.
the background files have all the good stuff.