automerge / automerge-go

MIT License
94 stars 6 forks source link

Revamp API #2

Closed ConradIrwin closed 1 year ago

ConradIrwin commented 1 year ago

This commit significantly changes the API for interacting with the Doc to reduce the overall surface area, and tidy up some unnecessary error returns.

A short summary of changes:

Many of the read-only methods provided by automerge-rs return an AMresult that is guaranteed to be AM_RESULT_SUCCESS. A number of APIs on the document have had their error handler removed.

Methods that take an optional list of arguments have been updated to take var-args instead. That is significantly nicer to use in the common case of 0 or 1 arguments, and still possible if you are passing many.

The Change type was added so that you can now use automerge-go to explore the history graph of an automerge document. Operations are not yet exposed.