replaceWith(newAsset) {
    const thisUrl = this.url;
    if (thisUrl && (!newAsset.url || newAsset.isAsset)) {
      this._updateUrlIndex(undefined, thisUrl);
      this._url = undefined;
      newAsset.url = thisUrl;
    }
    newAsset = this.assetGraph.addAsset(newAsset);
    for (const incomingRelation of this.incomingRelations) {
      incomingRelation.to = newAsset;
    }
    if (!thisUrl && newAsset.url) {
      newAsset.url = null;
    }
    this.assetGraph.removeAsset(this);
    return newAsset;
  }
Replace the asset in the graph with another asset, then remove
it from the graph.

Updates the incoming relations of the old asset to point at the
new one and preserves the url of the old asset if it's not
inline.

@param {Asset} newAsset The asset to put replace this one with.
@return {Asset} The new asset.