Skip to content

v0.8.0

Compare
Choose a tag to compare
@mweidner037 mweidner037 released this 20 Feb 17:23
· 43 commits to master since this release

Refactor of core, crdts, and collabs packages to simplify the library and (hopefully) reduce learning curve.

Major

  • Simplify naming scheme for Collabs: the main CRDTs now have names like "CVar" or "CValueSet". Alternate semantics are either options on the main CRDTs or deleted.
  • Reduce "C*" names to avoid cluttering Collabs. (Interfaces -> I, e.g., CMap -> IMap; events & events records drop the C, e.g., CSetEvent -> SetEvent.)
  • In the collabs package, only re-export the "commonly-used" exports. For advanced use cases, import other stuff from core or crdts directly.
  • Rename CObject.addChild -> CObject.registerCollab, so that it is the same as CRuntime.
  • AbstractDoc that you can extend to wrap your CRuntime and top-level Collabs. This lets you carry them around in one var, like a Y.Doc.
  • Replace "batching" with "transactions" (CRuntime.transact method, CRuntime "Transaction" event).
  • Remove context and "generic" MessageMeta, which I found confusing & not very type seafe. Instead, there is UpdateMeta; its runtimeExtra property can be extended by the Runtime, but not by other ancestors.
  • CollabIDs: instead of make/get from CollabID class, use Parent.fromID and Parent.idOf (which replace getNamePath / getDescendant). Also, they're now JSON-serializable.
  • Make IList "positions" more useful, and remove the CCursor wrapper (instead, use positions directly).

Minor

  • Remove less useful serializers.
  • Namespace some utility functions with static classes or singletons.
  • Change load/save type - instead of serializing all children immediately, parents can pass this responsibility to the Runtime (see SavedStateTreeSerializer).
  • Add CConst.
  • Redo AbstractSet, etc. in a way that appears to be working type-wise. (Basically: give up on TS mixins, just use JS mixins and type them manually.)
  • Add Collab.finalize method. This avoids needing every CSet user to expose a "ValueDelete" event.
  • Rewrite CRuntime. It is now a simplified "flat" implementation, instead of several layers with confusing interactions.
  • Rewrite CText to use a CValueList internally, instead of re-implementing it.
  • Move the benchmark text trace into a JSON file instead of JS, so Github doesn't show us as a "majority JS" project.
  • Misc cleanup (e.g., all Collabs take an options object instead of misc optional constructor params).

Alpha software - API subject to change.