Skip to content

Conversation

@connorjclark
Copy link
Collaborator

@connorjclark connorjclark commented Mar 20, 2024

ref #15841

This moves the meat of all the computed lantern metrics to lib/lantern/metrics, leaving behind just a ComputedArtifact wrapper and a conversion from Lighthouse data to Lantern data.

A change to note is that the Lantern metrics now do not directly call what they depend on, but instead are expected to be called with any dependent metric values they require. This change was made to remove caching of results (the purpose of Lighthouse's ComputedArtifact) from the library.

* @param {{trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, settings?: LH.Audit.Context['settings'], URL?: LH.Artifacts.URL}} opts
*/
function getComputationDataFromFixture({trace, devtoolsLog, settings, URL}) {
settings = settings || {};
Copy link
Contributor

Choose a reason for hiding this comment

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

settings would always be filled out in a real scenario right? Maybe the fallback should be a copy of the default settings?

Copy link
Collaborator Author

@connorjclark connorjclark Mar 27, 2024

Choose a reason for hiding this comment

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

settings and devtoolslog and URL are not real input to the planned lantern library, but they are used here as that's what Lighthouse was using. this will be addressed in a followup pr (see above TODO)

speed index is only test that is passing a settings object

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.

3 participants