Skip to content

core(fr): update flow API for 10.0 #14388

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

Merged
merged 17 commits into from
Oct 19, 2022
Merged

core(fr): update flow API for 10.0 #14388

merged 17 commits into from
Oct 19, 2022

Conversation

adamraine
Copy link
Member

@adamraine adamraine commented Sep 13, 2022

Part of #14049

  • Only one config can be used for the entire user flow. Individual steps can specify settings overrides via the step flags but cannot use an entirely different config.
  • Step runners use page as a top level parameter rather than stuffing it into {page, config, flags}
  • New StepFlags extends LH.Flags which contains the step name instead of doing {stepName, flags}
  • Rename stepName -> name

@adamraine adamraine requested a review from a team as a code owner September 13, 2022 21:32
@adamraine adamraine requested review from brendankenny and removed request for a team September 13, 2022 21:32
@adamraine adamraine changed the title core(fr): update flow API for release core(fr): update flow API for 10.0 Sep 14, 2022
@adamraine
Copy link
Member Author

TODO: Docs need updating

Rest of this should be reviewable though.

@adamraine adamraine added the 10.0 label Sep 21, 2022

/**
* @param {LH.Artifacts} artifacts
* @return {string}
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's surprising to me that TS agrees this is string instead of string=. I know the switch covers all enumerations of gather mode, but ... javascript 🙃

wdyt of 1) throwing an error in a default case or 2) removing the switch and capitalizing the gather mode to get the desired string?

Copy link
Member Author

Choose a reason for hiding this comment

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

I prefer option 1. Option 2 doesn't cover i18n and I don't want to support custom gather modes.

Copy link
Collaborator

@connorjclark connorjclark Oct 19, 2022

Choose a reason for hiding this comment

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

Wait, how does the current code cover i18n? should this function be a report UIString? (if so, this should be a followup)

Copy link
Member Author

@adamraine adamraine Oct 19, 2022

Choose a reason for hiding this comment

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

It doesn't support i18n, we should do it in a followup.

@@ -119,10 +119,16 @@ if (typeof self !== 'undefined') {
// @ts-expect-error
self.runLighthouseNavigation = runLighthouseNavigation;
// @ts-expect-error
self.runLighthouseNavigation2 = navigation;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I was actually thinking self.navigation, etc.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also @paulirish might be changing this to be just exports soon?

@adamraine adamraine merged commit 5410eae into main Oct 19, 2022
@adamraine adamraine deleted the reformat-fr-options branch October 19, 2022 21:32
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.

4 participants