diff --git a/core/audits/layout-shifts.js b/core/audits/layout-shifts.js index 4680e9c1cee4..924594f6de44 100644 --- a/core/audits/layout-shifts.js +++ b/core/audits/layout-shifts.js @@ -61,7 +61,7 @@ class LayoutShifts extends Audit { static async audit(artifacts, context) { const trace = artifacts.traces[Audit.DEFAULT_PASS]; const traceEngineResult = await TraceEngineResult.request({trace}, context); - const clusters = traceEngineResult.data.LayoutShifts.clusters ?? []; + const clusters = traceEngineResult.parsedTrace.LayoutShifts.clusters ?? []; const {cumulativeLayoutShift: clsSavings, impactByNodeId} = await CumulativeLayoutShiftComputed.request(trace, context); const traceElements = artifacts.TraceElements diff --git a/core/computed/metrics/lantern-metric.js b/core/computed/metrics/lantern-metric.js index 307bef465311..7d91e0eb6c86 100644 --- a/core/computed/metrics/lantern-metric.js +++ b/core/computed/metrics/lantern-metric.js @@ -38,10 +38,10 @@ async function getComputationDataParamsFromTrace(data, context) { const graph = await PageDependencyGraph.request({...data, fromTrace: true}, context); const traceEngineResult = await TraceEngineResult.request(data, context); - const frameId = traceEngineResult.data.Meta.mainFrameId; - const navigationId = traceEngineResult.data.Meta.mainFrameNavigations[0].args.data.navigationId; + const frameId = traceEngineResult.parsedTrace.Meta.mainFrameId; + const navigationId = traceEngineResult.parsedTrace.Meta.mainFrameNavigations[0].args.data.navigationId; const processedNavigation = Lantern.TraceEngineComputationData.createProcessedNavigation( - traceEngineResult.data, frameId, navigationId); + traceEngineResult.parsedTrace, frameId, navigationId); const simulator = data.simulator || (await LoadSimulator.request(data, context)); return {simulator, graph, processedNavigation}; diff --git a/core/computed/page-dependency-graph.js b/core/computed/page-dependency-graph.js index 8bbc196ec12b..8f1fdd7c3a6c 100644 --- a/core/computed/page-dependency-graph.js +++ b/core/computed/page-dependency-graph.js @@ -26,7 +26,7 @@ class PageDependencyGraph { if (data.fromTrace) { const traceEngineResult = await TraceEngineResult.request({trace}, context); - const parsedTrace = traceEngineResult.data; + const parsedTrace = traceEngineResult.parsedTrace; const requests = Lantern.TraceEngineComputationData.createNetworkRequests(trace, parsedTrace); const graph = diff --git a/core/computed/trace-engine-result.js b/core/computed/trace-engine-result.js index cf26b4b95e53..5cb761ddbb71 100644 --- a/core/computed/trace-engine-result.js +++ b/core/computed/trace-engine-result.js @@ -35,7 +35,7 @@ class TraceEngineResult { ), {}); if (!processor.parsedTrace) throw new Error('No data'); if (!processor.insights) throw new Error('No insights'); - return {data: processor.parsedTrace, insights: processor.insights}; + return {parsedTrace: processor.parsedTrace, insights: processor.insights}; } /** diff --git a/core/gather/gatherers/root-causes.js b/core/gather/gatherers/root-causes.js index 3a2b76914770..cef1ca67a76a 100644 --- a/core/gather/gatherers/root-causes.js +++ b/core/gather/gatherers/root-causes.js @@ -21,7 +21,7 @@ class RootCauses extends BaseGatherer { /** * @param {LH.Gatherer.Driver} driver - * @param {LH.Artifacts.TraceEngineResult['data']} parsedTrace + * @param {LH.Artifacts.TraceEngineResult['parsedTrace']} parsedTrace * @return {Promise} */ static async runRootCauseAnalysis(driver, parsedTrace) { @@ -137,7 +137,7 @@ class RootCauses extends BaseGatherer { async getArtifact(context) { const trace = context.dependencies.Trace; const traceEngineResult = await TraceEngineResult.request({trace}, context); - return RootCauses.runRootCauseAnalysis(context.driver, traceEngineResult.data); + return RootCauses.runRootCauseAnalysis(context.driver, traceEngineResult.parsedTrace); } } diff --git a/core/gather/gatherers/trace-elements.js b/core/gather/gatherers/trace-elements.js index 6b083051b6e2..10cc60ccc204 100644 --- a/core/gather/gatherers/trace-elements.js +++ b/core/gather/gatherers/trace-elements.js @@ -122,7 +122,7 @@ class TraceElements extends BaseGatherer { * that may have caused the shift. * * @param {LH.Trace} trace - * @param {LH.Artifacts.TraceEngineResult['data']} traceEngineResult + * @param {LH.Artifacts.TraceEngineResult['parsedTrace']} traceEngineResult * @param {LH.Artifacts.TraceEngineRootCauses} rootCauses * @param {LH.Gatherer.Context} context * @return {Promise>} @@ -322,7 +322,7 @@ class TraceElements extends BaseGatherer { const lcpNodeData = await TraceElements.getLcpElement(trace, context); const shiftsData = await TraceElements.getTopLayoutShifts( - trace, traceEngineResult.data, rootCauses, context); + trace, traceEngineResult.parsedTrace, rootCauses, context); const animatedElementData = await this.getAnimatedElements(mainThreadEvents); const responsivenessElementData = await TraceElements.getResponsivenessElement(trace, context); diff --git a/types/artifacts.d.ts b/types/artifacts.d.ts index 5a9fd23f5b88..064cbd56b5fb 100644 --- a/types/artifacts.d.ts +++ b/types/artifacts.d.ts @@ -510,8 +510,7 @@ declare module Artifacts { } interface TraceEngineResult { - // TODO: rename to paredtrace - data: TraceEngine.Handlers.Types.ParsedTrace; + parsedTrace: TraceEngine.Handlers.Types.ParsedTrace; insights: TraceEngine.Insights.Types.TraceInsightSets; }