-
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(fr): align base artifacts with legacy gather-runner #12510
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.
Will base artifacts be available in gatherers as dependencies, or can we just pass them in FRTransitionalContext
separately?
function finalizeArtifacts(baseArtifacts, gathererArtifacts) { | ||
const warnings = baseArtifacts.LighthouseRunWarnings | ||
.concat(gathererArtifacts.LighthouseRunWarnings || []); | ||
warnings.push(...getEnvironmentWarnings({ |
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.
nit: use another concat
here?
// TODO(FR-COMPAT): This assertion can be removed when full compatibility is reached. | ||
expect(auditResults.length).toMatchInlineSnapshot(`112`); | ||
// TODO(FR-COMPAT): This assertion can be removed when full compatibility is reached. HEAD | ||
expect(auditResults.length).toMatchInlineSnapshot(`141`); |
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.
👀
Great question, this does not yet enable base artifacts as dependencies. We can talk about how to accomplish that when the need arises (has it already come up for you?). URL is the biggest one I can think of, but that's already available on the phaseContext. |
Yes, I know I think it would be easier to include base artifacts separately in the context, or include them as dependencies for all gatherers by default. Essentially I want to avoid writing: /** @type {LH.Gatherer.FRTransitionalContext<'HostFormFactor'>} */
meta = {
supportedModes = ['navigation'],
dependencies: {HostFormFactor: HostFormFactor.symbol},
} |
I was really hoping to avoid this for the reason that it's not obvious when base artifacts are actually populated and if they're available at the time they would be needed for the dependency. Making artifact dependency relationships explicit is pretty nice FR result.
That would actually be my ideal approach 😄 |
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.
For our current set of Gatherers, it looks like we only need to depend on HostFormFactor
and Settings
. Explicit dependencies probably make sense here since there are so few instances of us depending on base artifacts.
Summary
Brings the base artifacts support in FR up to snuff with legacy gather runner.
Related Issues/PRs
ref #11313