writeSyncStep1 = (encoder, doc) => {
  encoding.writeVarUint(encoder, messageYjsSyncStep1);
  const sv = Y.encodeStateVector(doc);
  encoding.writeVarUint8Array(encoder, sv);
}
Create a sync step 1 message based on the state of the current shared document.

@param {encoding.Encoder} encoder
@param {Y.Doc} doc