Yjs - Near-Realtime Collaborative Editing

Yjs For detailed information, please visit the Yjs Website.

Purpose

Yjs [1] [2] is a novel frontend library that leverages collaborative editing on multiple data types. It is the open-source implementation of a novel algorithm, called YATA [2] for peer-to-peer (P2P) near real-time (NRT) shared editing. In contrast to other existing shared editing frameworks that support only a very limited number of document structures, Yjs encourages developers to build custom data types.

Description

Yjs works on modern Web browsers, including mobile (e.g., Android devices) and offers a quick and easy way to embed collaboration in Web applications.

The purpose of Yjs is to enable rapid prototyping and to offer a simple way for building scalable and reliable collaboration features in Web applications, on the client-side. Moreover, as described in [2], regardless of being P2P or a client-server approach, the available NRT collaboration tools (e.g. OT-based) mostly support linear data such as text or other specific ones (e.g. tree-like). Applications based on complex models must therefore map the underlying data to the data structure that is supported by the used collaboration framework. However, this process is time consuming, application-specific and often hard to achieve.

All in all, Yjs provides an open-source implementation which works directly in Web browsers, can be used P2P and offers a developer-friendly, easy and intuitive way for rapidly enabling NRT collaboration on custom data types. A custom type can use existing implemented types in order to give meaning to the actions on the data and to fire custom events. Currently, the library has implemented support for lists, associative arrays, XML, text, JSON, Polymer elements, ACE code editor, and rich text types.

To maintain modularity and to be able to employ Yjs in various Web engineering settings, the communication protocols and the shared data type formats support are implemented as dedicated interchangeable modules. This greatly simplifies the process of integrating the framework into an existing project, since such projects typically use diverse communication protocols (e.g., WebRTC, Web Sockets, XMPP). The collection of connector modules and type modules are available as open-source JavaScript libraries on Yjs GitHub.

Finally, besides the usage in real-world open-source products, Yjs has been thoroughly evaluated in a simulated distributed environment for performance, testing the conflict resolution and its scalability, with excellent results.

Provided Services

Scaling and Integration

Overall, the Yjs library with its various connectors and types was well received by the open-source developer community. The library’s Website and repository analytics show that the Website gathered in one year over 11600 page views from more than 4500 users and the library has been downloaded over 800 times. Yjs was used to enable shared editing with the popular Quill rich text editor, which is very similar to Google Docs. The richtext component is already used by two companies in production, for NRT shared text editing on the Web, embedded in WebRTC video meeting tools.

Usage Examples

Material

Yjs poster presented at the International Conference on Web Engineering, Rotterdam, 2015 on Slideshare:

Yjs: A Framework for Near Real-time P2P Shared Editing on Arbitrary Data Types from Nicolaescu Petru

Related tools

Developers and Contributors

References

  1. P. Nicolaescu, K. Jahns, M. Derntl, and R. Klamma, “Yjs: A Framework for Near Real-Time P2P Shared Editing on Arbitrary Data Types,” in Proceedings of the 15th International Conference on Web Engineering, ICWE 2015, Rotterdam, The Netherlands, June 23-26, 2015, 2015, pp. 675–678. DOI: 10.1007/978-3-319-19890-3_55
  2. P. Nicolaescu, K. Jahns, M. Derntl, and R. Klamma, “Near Real-Time Peer-to-Peer Shared Editing on Extensible Data Types,” in GROUP 2016, Sunibel, USA, November 13-16 (to appear), 2016, vol. 9891, pp. 570–574. DOI: 10.1145/2957276.2957310
  3. P. Nicolaescu, G. Toubekis, and R. Klamma, “A Microservice Approach for Near Real-Time Collaborative 3D Objects Annotation on the Web,” in Proceedings of the 14th International Conference on Web-based Learning (ICWL), Guangzhou, China, November 5-8, 2015, 2015, pp. 187–196. DOI: 10.1007/978-3-319-25515-6_17