Yjs is a framework for optimistic concurrency control and automatic conflict resolution on arbitrary data types. The framework implements a new OT-like concurrency algorithm and provides similar functionality as ShareJs and OpenCoweb. Yjs was designed to take away the pain from concurrently editing complex data types like Text, Json, and XML. You can find some applications for this framework here.
In the future, we want to enable users to implement their own collaborative types. Currently we provide data types for
- Text
- Json (even circular structures)
- XML
Unlike other frameworks, Yjs supports P2P message propagation and is not bound to a specific communication protocol. Therefore, Yjs is extremely scalable and can be used in a wide range of application scenarios.
We support several communication protocols as so called Connectors. You can create your own connector too - as it is described here. Currently, we support the following communication protocols:
- XMPP-Connector - Propagates updates in a XMPP multi-user-chat room
- WebRTC-Connector - Propagate updates directly with WebRTC
- IWC-Connector - Inter-widget Communication
You can use Yjs client-, and server- side. You can get it as via npm, and bower. We even provide a polymer element for Yjs!
The theoretical advantages over similar frameworks are support for
- .. P2P message propagation and arbitrary communication protocols
- .. arbitrary complex data types
- .. offline editing: Only relevant changes are propagated on rejoin (unimplemented)
- .. AnyUndo: Undo any action that was executed in constant time (unimplemented)
- .. Intention Preservation: When working on Text, the intention of your changes are preserved. This is particularily important when working offline.
Use it!
You find a tutorial, examples, and documentation on the website.
Either clone this git repository, install it with bower, or install it with npm.
Bower
bower install rwth-acis/yjs
Then you include the libraries directly from the installation folder.
<script src="./bower_components/yjs/y.js"></script>
Npm
npm install yjs --save
And use it like this with npm:
Y = require("yjs");
Status
Yjs is still in an early development phase. Don't expect that everything is working fine. But I would become really motivated if you gave me some feedback :) (github).
Current Issues
- The History Buffer should be able to store operations in a database
- Documentation
- Reimplement support for XML as a data type
- Custom data types
Get help
Please report any issues to the Github issue page! I try to fix them very soon, if possible.
Contribution
I created this framework during my bachelor thesis at the chair of computer science 5 (i5), RWTH University. Since December 2014 I'm working on Yjs as a part of my student worker job at the i5.
License
Yjs is licensed under the MIT License.