Compare commits
213 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
13ed66c326 | ||
|
|
1c35198839 | ||
|
|
a7021b9212 | ||
|
|
1fa1f1a668 | ||
|
|
243e62e320 | ||
|
|
15e933ee5b | ||
|
|
605e1052ac | ||
|
|
16c00525d1 | ||
|
|
e9da461625 | ||
|
|
a071c07ee2 | ||
|
|
8dad4f6ed4 | ||
|
|
0980609cc9 | ||
|
|
29f3f3f722 | ||
|
|
04139d3b7e | ||
|
|
45814c4e00 | ||
|
|
cf365b8902 | ||
|
|
aff10fa4db | ||
|
|
181595293f | ||
|
|
ee133ef334 | ||
|
|
661232f23c | ||
|
|
541a93d152 | ||
|
|
d6e1cd42a2 | ||
|
|
51e20fb9c7 | ||
|
|
e32aef4c9f | ||
|
|
9c4074e3e3 | ||
|
|
aadef59934 | ||
|
|
6a13419c62 | ||
|
|
1ace3e3120 | ||
|
|
c95dae3c33 | ||
|
|
82e2254302 | ||
|
|
6e9f990d5c | ||
|
|
7d4adf314d | ||
|
|
8745fd64ca | ||
|
|
638c575dfc | ||
|
|
acf8d37616 | ||
|
|
ae8be1ec6b | ||
|
|
a5f76cee84 | ||
|
|
2013266d56 | ||
|
|
b08aeee4fc | ||
|
|
183f30878e | ||
|
|
5e4c56af29 | ||
|
|
13bef69be4 | ||
|
|
b1d70ef25e | ||
|
|
6f3a291ef5 | ||
|
|
2a601ac6f6 | ||
|
|
82b3e50d49 | ||
|
|
4bfe484fc2 | ||
|
|
b9e21665e2 | ||
|
|
06e7caab2d | ||
|
|
c8ded24842 | ||
|
|
dae0f71cbc | ||
|
|
81c601c65f | ||
|
|
56165a3c10 | ||
|
|
5e0d602e12 | ||
|
|
420821be31 | ||
|
|
d1fda080d9 | ||
|
|
dd5e2adc87 | ||
|
|
ee983ceff6 | ||
|
|
ee116b8ca4 | ||
|
|
d4ef54358b | ||
|
|
ebc628adfc | ||
|
|
4563ccc98e | ||
|
|
a4f7f5c987 | ||
|
|
4a7f09c32d | ||
|
|
f78dc52d7b | ||
|
|
f9f8228db6 | ||
|
|
60b75d1862 | ||
|
|
9b3fe2f197 | ||
|
|
6b153896dd | ||
|
|
66a7d2720d | ||
|
|
d50d34dc12 | ||
|
|
8cc374cabb | ||
|
|
8e9e62b3d0 | ||
|
|
9b45a78e58 | ||
|
|
f862fae473 | ||
|
|
0493d99d57 | ||
|
|
a1026bc365 | ||
|
|
fe4564542b | ||
|
|
7b52111c31 | ||
|
|
c184cb961b | ||
|
|
02f2f6b0fe | ||
|
|
e47dee53a3 | ||
|
|
9b6183ea70 | ||
|
|
79ec71d559 | ||
|
|
bf4d5f24a8 | ||
|
|
9d0373b85b | ||
|
|
f8ad9abcc0 | ||
|
|
b25977be06 | ||
|
|
bffbb6ca27 | ||
|
|
8f63147dbc | ||
|
|
7a274565e5 | ||
|
|
75793d0ced | ||
|
|
7ec409e09f | ||
|
|
fec03dc6e1 | ||
|
|
3142b0f161 | ||
|
|
042bcee482 | ||
|
|
b3e09d001f | ||
|
|
dcec0fe967 | ||
|
|
ae790b6947 | ||
|
|
4b08cbe875 | ||
|
|
01173879a0 | ||
|
|
6f99ee5c34 | ||
|
|
8d1bccbea0 | ||
|
|
b6c278f8e4 | ||
|
|
5a9f59913e | ||
|
|
bf493216a2 | ||
|
|
d37d0ef9af | ||
|
|
c7a6e74dd9 | ||
|
|
24570b791a | ||
|
|
f99853529e | ||
|
|
159f37474d | ||
|
|
1b63f5efde | ||
|
|
c3ba8173d7 | ||
|
|
7a89c1cc6d | ||
|
|
c5b47e88ac | ||
|
|
dc3c6a5d42 | ||
|
|
a9c2ec6ba0 | ||
|
|
f166b9efc5 | ||
|
|
0441b83f74 | ||
|
|
90c82a6a02 | ||
|
|
da25905b73 | ||
|
|
3c07a938cd | ||
|
|
55ccacc442 | ||
|
|
946a11f03d | ||
|
|
93f3a49396 | ||
|
|
3eed100b8d | ||
|
|
eb136ae1bf | ||
|
|
006d0a2643 | ||
|
|
7959bdf5ac | ||
|
|
6f9ee0d9ba | ||
|
|
d901d5f5e4 | ||
|
|
b2c7706a2e | ||
|
|
4d926cf841 | ||
|
|
0314a1b709 | ||
|
|
8a5b69e86c | ||
|
|
ce5250b9d8 | ||
|
|
f51c791490 | ||
|
|
b75305a082 | ||
|
|
8d80fd5614 | ||
|
|
bad6c913fc | ||
|
|
85d85540e7 | ||
|
|
80f1cfd21b | ||
|
|
729d7ed3aa | ||
|
|
0a89150fab | ||
|
|
6fc33e40bb | ||
|
|
7f6592a6b7 | ||
|
|
b9cdbcc6fa | ||
|
|
2a78cdba48 | ||
|
|
b02662c36e | ||
|
|
f44f463e9d | ||
|
|
757bb118ce | ||
|
|
5417ffb999 | ||
|
|
4de979bc33 | ||
|
|
875f56586e | ||
|
|
249b712648 | ||
|
|
58cefae839 | ||
|
|
d9c5ab5fa8 | ||
|
|
6d99ed07f0 | ||
|
|
e55ed9f2b4 | ||
|
|
bb0bfcc5c8 | ||
|
|
b24de43fe2 | ||
|
|
446560d9e8 | ||
|
|
148e46f043 | ||
|
|
e8f20dabd3 | ||
|
|
96ed8b0f98 | ||
|
|
c663230c1b | ||
|
|
0a8118367d | ||
|
|
f932f560bd | ||
|
|
f9542b90db | ||
|
|
014495febd | ||
|
|
82f11c421f | ||
|
|
9059618d1f | ||
|
|
9a8f8fba05 | ||
|
|
3ba89edf7d | ||
|
|
fea6de3bf9 | ||
|
|
2a644f2f0c | ||
|
|
f189ae11b0 | ||
|
|
2e9f8f6d03 | ||
|
|
860934de06 | ||
|
|
792440a71d | ||
|
|
1aacc0e967 | ||
|
|
d4b0c8cbbd | ||
|
|
d6526f12fb | ||
|
|
d3af98cd17 | ||
|
|
e33eb6a928 | ||
|
|
d1be152983 | ||
|
|
548a77833a | ||
|
|
5ba0a7492a | ||
|
|
c65f11b308 | ||
|
|
77b83cae2a | ||
|
|
f609c22be8 | ||
|
|
670854e9d8 | ||
|
|
2bb7ba03cd | ||
|
|
686be484fc | ||
|
|
60de3ce5b0 | ||
|
|
b6fe47efe1 | ||
|
|
e5f16812b3 | ||
|
|
3eb933400a | ||
|
|
58a479be9b | ||
|
|
f835a72151 | ||
|
|
50fa81d191 | ||
|
|
93e75e0111 | ||
|
|
cbcdebf33e | ||
|
|
7c842efd52 | ||
|
|
60daa082f7 | ||
|
|
5681ba84bf | ||
|
|
978203d73e | ||
|
|
d5c7d51dc4 | ||
|
|
bba92f6a73 | ||
|
|
31e80f0727 | ||
|
|
f23bb36635 | ||
|
|
b39e9d6450 | ||
|
|
d93aa8a2ba |
16
.gitignore
vendored
16
.gitignore
vendored
@@ -1,8 +1,12 @@
|
||||
/node_modules/
|
||||
.kateproject.d
|
||||
.kateproject
|
||||
node_modules
|
||||
bower_components
|
||||
build
|
||||
build_test
|
||||
.directory
|
||||
.c9
|
||||
myftppass
|
||||
.codio
|
||||
.settings
|
||||
.settings
|
||||
.jshintignore
|
||||
.jshintrc
|
||||
.validate.json
|
||||
/y.js
|
||||
/y.js.map
|
||||
|
||||
4
.gitmodules
vendored
Normal file
4
.gitmodules
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
[submodule "dist"]
|
||||
path = dist
|
||||
url = https://github.com/y-js/yjs.git
|
||||
branch = dist
|
||||
8
.travis.yml
Normal file
8
.travis.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
language: node_js
|
||||
before_install:
|
||||
- "npm install -g bower"
|
||||
node_js:
|
||||
- "0.12"
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
12
Examples/OfflineEditing/index.html
Normal file
12
Examples/OfflineEditing/index.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<button id="button">Disconnect</button>
|
||||
<h1 id="contenteditable" contentEditable></h1>
|
||||
<textarea style="width:80%;" rows=40 id="textfield"></textarea>
|
||||
|
||||
<script src="../../node_modules/simplewebrtc/simplewebrtc.bundle.js"></script>
|
||||
<script src="../../y.js"></script>
|
||||
<script src="./index.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
50
Examples/OfflineEditing/index.js
Normal file
50
Examples/OfflineEditing/index.js
Normal file
@@ -0,0 +1,50 @@
|
||||
/* global Y */
|
||||
|
||||
// create a shared object. This function call will return a promise!
|
||||
Y({
|
||||
db: {
|
||||
name: 'IndexedDB',
|
||||
namespace: 'offlineEditingDemo'
|
||||
},
|
||||
connector: {
|
||||
name: 'WebRTC',
|
||||
room: 'offlineEditingDemo',
|
||||
debug: true
|
||||
}
|
||||
}).then(function (yconfig) {
|
||||
// yconfig holds all the information about the shared object
|
||||
window.yconfig = yconfig
|
||||
// yconfig.root holds the shared element
|
||||
window.y = yconfig.root
|
||||
|
||||
// now we bind the textarea and the contenteditable h1 element
|
||||
// to a shared element
|
||||
var textarea = document.getElementById('textfield')
|
||||
var contenteditable = document.getElementById('contenteditable')
|
||||
yconfig.root.observePath(['text'], function (text) {
|
||||
// every time the 'text' property of the yconfig.root changes,
|
||||
// this function is called. Then we bind it to the html elements
|
||||
if (text != null) {
|
||||
// when the text property is deleted, text may be undefined!
|
||||
// This is why we have to check if text exists..
|
||||
text.bind(textarea)
|
||||
text.bind(contenteditable)
|
||||
}
|
||||
})
|
||||
// create a shared TextBind
|
||||
var textpromise = yconfig.root.get('text')
|
||||
if (textpromise == null) {
|
||||
yconfig.root.set('text', Y.TextBind)
|
||||
}
|
||||
// We also provide a button for disconnecting/reconnecting the shared element
|
||||
var button = document.querySelector('#button')
|
||||
button.onclick = function () {
|
||||
if (button.innerText === 'Disconnect') {
|
||||
yconfig.disconnect()
|
||||
button.innerText = 'Reconnect'
|
||||
} else {
|
||||
yconfig.reconnect()
|
||||
button.innerText = 'Disconnect'
|
||||
}
|
||||
}
|
||||
})
|
||||
12
Examples/TextBind/index.html
Normal file
12
Examples/TextBind/index.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<button id="button">Disconnect</button>
|
||||
<h1 id="contenteditable" contentEditable></h1>
|
||||
<textarea style="width:80%;" rows=40 id="textfield"></textarea>
|
||||
|
||||
<script src="../../node_modules/simplewebrtc/simplewebrtc.bundle.js"></script>
|
||||
<script src="../../y.js"></script>
|
||||
<script src="./index.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
47
Examples/TextBind/index.js
Normal file
47
Examples/TextBind/index.js
Normal file
@@ -0,0 +1,47 @@
|
||||
/* global Y */
|
||||
|
||||
// create a shared object. This function call will return a promise!
|
||||
Y({
|
||||
db: {
|
||||
name: 'Memory'
|
||||
},
|
||||
connector: {
|
||||
name: 'WebRTC',
|
||||
room: 'TextBindDemo',
|
||||
debug: true
|
||||
}
|
||||
}).then(function (yconfig) {
|
||||
// yconfig holds all the information about the shared object
|
||||
window.yconfig = yconfig
|
||||
// yconfig.root holds the shared element
|
||||
window.y = yconfig.root
|
||||
|
||||
// now we bind the textarea and the contenteditable h1 element
|
||||
// to a shared element
|
||||
var textarea = document.getElementById('textfield')
|
||||
var contenteditable = document.getElementById('contenteditable')
|
||||
yconfig.root.observePath(['text'], function (text) {
|
||||
// every time the 'text' property of the yconfig.root changes,
|
||||
// this function is called. Then we bind it to the html elements
|
||||
if (text != null) {
|
||||
// when the text property is deleted, text may be undefined!
|
||||
// This is why we have to check if text exists..
|
||||
text.bind(textarea)
|
||||
text.bind(contenteditable)
|
||||
}
|
||||
})
|
||||
// create a shared TextBind
|
||||
yconfig.root.set('text', Y.TextBind)
|
||||
|
||||
// We also provide a button for disconnecting/reconnecting the shared element
|
||||
var button = document.querySelector('#button')
|
||||
button.onclick = function () {
|
||||
if (button.innerText === 'Disconnect') {
|
||||
yconfig.disconnect()
|
||||
button.innerText = 'Reconnect'
|
||||
} else {
|
||||
yconfig.reconnect()
|
||||
button.innerText = 'Disconnect'
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1,6 +1,8 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Kevin Jahns <kevin.jahns@rwth-aachen.de>.
|
||||
Copyright (c) 2014
|
||||
- Kevin Jahns <kevin.jahns@rwth-aachen.de>.
|
||||
- Chair of Computer Science 5 (Databases & Information Systems), RWTH Aachen University, Germany
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
182
README.md
182
README.md
@@ -1,99 +1,145 @@
|
||||
|
||||
# 
|
||||
[](http://layers.dbis.rwth-aachen.de/jenkins/job/Yatta/)
|
||||
# 
|
||||
|
||||
A Real-Time web framework that manages concurrency control for arbitrary data types.
|
||||
Yatta! provides similar functionality as [ShareJs](https://github.com/share/ShareJS) and [OpenCoweb](https://github.com/opencoweb/coweb),
|
||||
but does not require you to understand how the internals work. The predefined data types provide a simple API to access your shared data types.
|
||||
[](https://travis-ci.org/y-js/yjs)
|
||||
|
||||
Predefined data types:
|
||||
* Text - [Collaborative Text Editing Example](http://dadamonad.github.io/Yatta/examples/TextEditing/)
|
||||
* Json - [Tutorial](http://dadamonad.github.io/Yatta/examples/PeerJs-Json/)
|
||||
* XML - [XML Example](http://dadamonad.github.io/Yatta/examples/XmlExample/) Collaboratively manipulate the dom with native dom-features and jQuery.
|
||||
Yjs is a framework for optimistic concurrency control and automatic conflict resolution on shared data types. The framework implements a new OT-like concurrency algorithm and provides similar functionality as [ShareJs] and [OpenCoweb]. Yjs was designed to handle concurrent actions on arbitrary complex data types like Text, Json, and XML. We provide a tutorial and some applications for this framework on our [homepage](http://y-js.org/).
|
||||
|
||||
Unlike other frameworks, Yatta! supports P2P message propagation and is not bound to a specific communication protocol.
|
||||
You can create you own shared types easily. Therefore, you can take matters into your own hand by defining the meaning of the shared types and ensure that it is valid, while Yjs ensures data consistency (everyone will eventually end up with the same data). We already provide data types for
|
||||
|
||||
| Name | Description
|
||||
| ---------------------------------------------------- | ---------------------------------------------
|
||||
y-object | Add, update, and remove properties of an object. Circular references are supported. Included in Yjs
|
||||
[y-list](https://github.com/y-js/y-list) | A shared linked list implementation. Circular references are supported
|
||||
[y-selections](https://github.com/y-js/y-selections) | Manages selections on types that use linear structures (e.g. the y-list type). You can select a range of elements and assign meaning to them.
|
||||
[y-xml](https://github.com/y-js/y-xml) | An implementation of the DOM. You can create a two way binding to Browser DOM objects
|
||||
[y-text](https://github.com/y-js/y-text) | Collaborate on text. You can create a two way binding to textareas, input elements, or HTML elements (e.g. *h1*, or *p*)
|
||||
[y-richtext](https://github.com/y-js/y-richtext) | Collaborate on rich text. You can create a two way binding to several editors
|
||||
|
||||
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 - read [this wiki page](https://github.com/y-js/yjs/wiki/Custom-Connectors). Currently, we support the following communication protocols:
|
||||
|
||||
Name | Description
|
||||
---------------------------------------- | -------------------------------------------------------
|
||||
[y-xmpp](https://github.com/y-js/y-xmpp) | Propagate updates in a XMPP multi-user-chat room ([XEP-0045](http://xmpp.org/extensions/xep-0045.html))
|
||||
[y-webrtc](https://github.com/y-js/y-webrtc) | Propagate updates Browser2Browser via WebRTC
|
||||
[y-test](https://github.com/y-js/y-test) | A Connector for testing purposes. It is designed to simulate delays that happen in worst case scenarios
|
||||
|
||||
|
||||
You can use Yjs client-, and server- side. You can get it as via npm, and bower. We even provide polymer elements for Yjs!
|
||||
|
||||
The advantages over similar frameworks are support for
|
||||
* .. P2P message propagation and arbitrary communication protocols
|
||||
* .. arbitrary complex data types
|
||||
* .. offline editing: Changes are stored persistently and only relevant changes are propagated on rejoin
|
||||
* .. AnyUndo: Undo *any* action that was executed in constant time (coming..)
|
||||
* .. Intention Preservation: When working on Text, the intention of your changes are preserved. This is particularily important when working offline. Every type has a notion on how we define Intention Preservation on it.
|
||||
|
||||
It is possible to add any communication protocol to Yatta. Currently it supports:
|
||||
* [PeerJs](http://peerjs.com/) - A WebRTC Framework
|
||||
* [SimpleWebRTC](http://simplewebrtc.com/) - Another WebRTC Framework (coming soon)
|
||||
* [IWC](http://dbis.rwth-aachen.de/cms/projects/the-xmpp-experience#interwidget-communication) - Inter-widget Communication
|
||||
|
||||
## Use it!
|
||||
The [examples](./examples/) provide an excellent starting point for beginners. Also the [API Documentation](http://dadamonad.github.io/Yatta/doc/) could prove to be very helpful.
|
||||
You can find a tutorial, and examples on the [website](http://y-js.org). Furthermore, the [github wiki](https://github.com/y-js/yjs/wiki) offers more information about how you can use Yjs in your application.
|
||||
|
||||
Either clone this git repository, install it with [bower](http://bower.io/), or install it with [npm](https://www.npmjs.org/package/yatta).
|
||||
Either clone this git repository, install it with [bower](http://bower.io/), or install it with [npm](https://www.npmjs.org/package/yjs).
|
||||
|
||||
### Bower
|
||||
```
|
||||
bower install Yatta
|
||||
bower install y-js/yjs
|
||||
```
|
||||
Then you include the libraries directly from the installation folder.
|
||||
```
|
||||
<script src="./bower_components/yatta.js"></script>
|
||||
<script src="./bower_components/yjs/y.js"></script>
|
||||
```
|
||||
|
||||
### Npm
|
||||
```
|
||||
npm install yatta --save
|
||||
npm install yjs --save
|
||||
```
|
||||
|
||||
And use it like this with *npm*:
|
||||
```
|
||||
Yatta = require("yatta");
|
||||
Y = require("yjs");
|
||||
```
|
||||
|
||||
# Y()
|
||||
In order to create an instance of Y, you need to have a connection object (instance of a Connector). Then, you can create a shared data type like this:
|
||||
```
|
||||
var y = new Y(connector);
|
||||
```
|
||||
|
||||
|
||||
## About
|
||||
Find out more about the concurrent editing problem here
|
||||
[Cooperation, Concurrency, Conflicts, and Convergence](http://opencoweb.org/ocwdocs/intro/openg.html) and here
|
||||
[Operational Transformation (OT)](http://en.wikipedia.org/wiki/Operational_transformation)
|
||||
|
||||
My Bachelor Thesis project aim was to develop a P2P OT Framework that enables collaboration on XML documents and supports
|
||||
[Intention Preservation](http://www3.ntu.edu.sg/home/czsun/projects/otfaq/#intentionPreservation).
|
||||
After some time I realized that OT has significant drawbacks in P2P environments.
|
||||
|
||||
With my gained experiences I came up with a new approach. I named it *Yata* - Yet Another Transformation Approach.
|
||||
It enables concurrent editing with the following space and time properties:
|
||||
* Time complexity: O(S), whereby S is the number of operations that are inserted concurrently at the same position (no transformation against operations that happen on different positions).
|
||||
* Space complexity = O(|Document|), whereby |Document| is the size of the shared document.
|
||||
|
||||
This means that my approach beats all OT time complexities. Furthermore, Yatta has a very strict definition of Intention Preservation, and I was able to
|
||||
show that it is never violated.
|
||||
|
||||
Another advantage of Yata is that propagated messages are very small.
|
||||
Background: In Real-Time P2P OT algorithms you have to send a state-vector with each message that defines the state of the History Buffer
|
||||
on which the operation was created. This is not necessary in Yata.
|
||||
|
||||
The downside of this approach is that the History Buffer holds at least as many operations as there are characters in the document.
|
||||
In contrast, an OT algorithm can have an empty History Buffer while the document size is very big.
|
||||
|
||||
Eventually (after my thesis), I will publish more information about Yata.
|
||||
|
||||
So, how did I come up with the name for the implementation (Yatta! is not Yata)?
|
||||
Yatta! means "I did it!" in Japanese. You scream it when you accomplish something (for proper application I refer to the Yatta-man in [Heroes](http://heroeswiki.com/Yatta!)).
|
||||
There is also this awesome video on the Internet that will change your life [Yatta](https://www.youtube.com/watch?v=kL5DDSglM_s).
|
||||
|
||||
## Status
|
||||
Yatta! 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](https://github.com/DadaMonad/Yatta/issues)).
|
||||
|
||||
### Current Issues
|
||||
* HTML editable tag
|
||||
* More efficient representation of text.
|
||||
* Use a better data structure for the History Buffer - it should be possible to use Arrays.
|
||||
* SimpleRTC support
|
||||
# Y.Map
|
||||
Yjs includes only one type by default - the Y.Map type. It mimics the behaviour of a javascript Object. You can create, update, and remove properies on the Y.Map type. Furthermore, you can observe changes on this type as you can observe changes on Javascript Objects with [Object.observe](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe) - an ECMAScript 7 proposal which is likely to become accepted by the committee. Until then, we have our own implementation.
|
||||
|
||||
|
||||
## Support
|
||||
Please report _any_ issues to the [Github issue page](https://github.com/DadaMonad/Yatta/issues)!
|
||||
I would appreciate if developers gave me feedback on how _convenient_ the framework is, and if it is easy to use. Particularly the XML-support may not support every DOM-methods - if you encounter a method that does not cause any change on other peers,
|
||||
please state function name, and sample parameters. However, there are browser-specific features, that Yatta won't support.
|
||||
##### Reference
|
||||
* Create
|
||||
```
|
||||
var map = y.set("new_map", Y.Map).then(function(map){
|
||||
map // is my map type
|
||||
});
|
||||
```
|
||||
* Every instance of Y is an Y.Map
|
||||
```
|
||||
var y = new Y(options);
|
||||
```
|
||||
* .get(name)
|
||||
* Retrieve the value of a property. If the value is a type, `.get(name)` returns a promise
|
||||
* .set(name, value)
|
||||
* Set/update a property. `value` may be a primitive type, or a custom type definition (e.g. `Y.Map`)
|
||||
* .delete(name)
|
||||
* Delete a property
|
||||
* .observe(observer)
|
||||
* The `observer` is called whenever something on this object changes. Throws *add*, *update*, and *delete* events
|
||||
* .observePath(path, observer)
|
||||
* `path` is an array of property names. `observer` is called when the property under `path` is set, deleted, or updated
|
||||
* .unobserve(f)
|
||||
* Delete an observer
|
||||
|
||||
# A note on intention preservation
|
||||
When users create/update/delete the same property concurrently, only one change will prevail. Changes on different properties do not conflict with each other.
|
||||
|
||||
# A note on time complexities
|
||||
* .get(name)
|
||||
* O(1)
|
||||
* .set(name, value)
|
||||
* O(1)
|
||||
* .delete(name)
|
||||
* O(1)
|
||||
* Apply a delete operation from another user
|
||||
* O(1)
|
||||
* Apply an update operation from another user (set/update a property)
|
||||
* Yjs does not transform against operations that do not conflict with each other.
|
||||
* An operation conflicts with another operation if it changes the same property.
|
||||
* Overall worst case complexety: O(|conflicts|!)
|
||||
|
||||
# Status
|
||||
Yjs is a work in progress. Different versions of the *y-* repositories may not work together. Just drop me a line if you run into troubles.
|
||||
|
||||
## Get help
|
||||
There are some friendly people on [](https://gitter.im/y-js/yjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) who may help you with your problem, and answer your questions.
|
||||
|
||||
Please report _any_ issues to the [Github issue page](https://github.com/y-js/yjs/issues)! I try to fix them very soon, if possible.
|
||||
|
||||
## Changelog
|
||||
##### 1.0
|
||||
This is a complete rewrite of the 0.5 version of Yjs. Since Yjs 1.0 it is possible to work asynchronously on a persistent database, which enables offline support.
|
||||
* Switched to semver versioning
|
||||
* Requires a promise implementation in environment (es6 promises suffice, included in all the major browsers). Otherwise you have to include a polyfill
|
||||
* Y.Object has been renamed to Y.Map
|
||||
* Y.Map exchanges `.val(name [, value])` in favor of `.set(name, value)` and `.get(name)`
|
||||
* Y.Map `.get(name)` returns a promise, if the value is a custom type
|
||||
* The Connector definition slightly changed (I'll update the wiki)
|
||||
* The Type definitions completely changed, so you have to rewrite them (I'll rewrite the article in the wiki)
|
||||
* Support for several packaging systems
|
||||
|
||||
|
||||
## Contribution
|
||||
I created this framework during my bachelor thesis at the chair of computer science 5 [(i5)](http://dbis.rwth-aachen.de/cms), RWTH University. Since December 2014 I'm working on Yjs as a part of my student worker job at the i5.
|
||||
|
||||
## License
|
||||
Yatta! is licensed under the [MIT License](./LICENSE.txt).
|
||||
|
||||
<kevin.jahns@rwth-aachen.de>
|
||||
|
||||
|
||||
Yjs is licensed under the [MIT License](./LICENSE.txt).
|
||||
|
||||
<yjs@dbis.rwth-aachen.de>
|
||||
|
||||
[ShareJs]: https://github.com/sh | ||||