static async compute_(data, context) {
    const {trace, settings, devtoolsLog, URL, SourceMaps} = data;
    const [{mainThreadEvents}, networkRecords] = await Promise.all([
      ProcessedTrace.request(trace, context),
      NetworkRecords.request(devtoolsLog, context),
    ]);

    if (data.fromTrace) {
      const traceEngineResult =
        await TraceEngineResult.request({trace, settings, SourceMaps}, context);
      const parsedTrace = traceEngineResult.parsedTrace;
      const requests =
        Lantern.TraceEngineComputationData.createNetworkRequests(trace, parsedTrace);
      const graph =
        Lantern.TraceEngineComputationData.createGraph(requests, trace, parsedTrace, URL);
      // @ts-expect-error for now, ignore that this is a SyntheticNetworkEvent instead of LH's NetworkEvent.
      return graph;
    }

    // TODO: currently the trace version has no requests that failed, or requests that have "Preflight".
    //       so the following gets the devtools log version _closer_ to the exact same results as the trace.
    // const lanternRequests = networkRecords.map(NetworkRequest.asLanternNetworkRequest).filter(r => !r.failed && r.resourceType !== 'Preflight');

    const lanternRequests = networkRecords.map(NetworkRequest.asLanternNetworkRequest);
    return Lantern.Graph.PageDependencyGraph.createGraph(mainThreadEvents, lanternRequests, URL);
  }
@param {{trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, settings: LH.Audit.Context['settings'], URL: LH.Artifacts['URL'], SourceMaps: LH.Artifacts['SourceMaps'], fromTrace: boolean}} data
@param {LH.Artifacts.ComputedContext} context
@return {Promise<LH.Gatherer.Simulation.GraphNode>}