AutomergeText is meant to work with the encoding/decoding setup, but that implies a heavier document structure than may be warranted in some cases. It would be nice to have an option to set up an AutomergeText instance on a document where the creation of the AutomergeText instance would also immediately create the relevant structure in the document, if the structure wasn't already in place. If the document already has structure where AutomergeText is attempting to be created, it should throw an error or fail initialization - haven't thought throw the call site usage on that point.
Currently you need to:
create the Automerge document
establish the schema into the document (either directly, or by encoding a structure into it)
then establish AutomergeText so that it binds to the schema you created.
Even more optimized might be creating a document as well as the structure, so that you've got a one-shot setup for a document with a single text instance for collaborating editing of that text value.
AutomergeText is meant to work with the encoding/decoding setup, but that implies a heavier document structure than may be warranted in some cases. It would be nice to have an option to set up an
AutomergeText
instance on a document where the creation of theAutomergeText
instance would also immediately create the relevant structure in the document, if the structure wasn't already in place. If the document already has structure whereAutomergeText
is attempting to be created, it should throw an error or fail initialization - haven't thought throw the call site usage on that point.Currently you need to:
Even more optimized might be creating a document as well as the structure, so that you've got a one-shot setup for a document with a single text instance for collaborating editing of that text value.