getObjectSize(obj) {
    let size;
    try {
      const jsonString = JSON.stringify(obj);
      const encoder = new TextEncoder();
      const uint8Array = encoder.encode(jsonString);
      size = uint8Array.length;
    } catch (e) {
      log("error", "uibuilder:getObjectSize", "Could not stringify, cannot determine size", obj, e)();
    }
    return size;
  }
Attempt to get rough size of an object
@param {*} obj Any serialisable object
@returns {number|undefined} Rough size of object in bytes or undefined