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(lantern): move lantern metrics to lib/lantern #15875

Merged
merged 12 commits into from
Mar 29, 2024
Merged

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
Member

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

core/computed/metrics/lantern-metric.js Outdated Show resolved Hide resolved
core/computed/metrics/lantern-metric.js Outdated Show resolved Hide resolved
@connorjclark connorjclark merged commit 0475357 into main Mar 29, 2024
29 checks passed
@connorjclark connorjclark deleted the lantern-mv-metrics branch March 29, 2024 01:49
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.

None yet

3 participants