These are chat archives for rwth-acis/yjs

4th
Mar 2015
Corentin Cadiou
@cphyc
Mar 04 2015 12:32
Hi
I am starting to develop a realtime collaborative app relying on yjs (on of my colleague saw you at the latest defcon)
Kevin Jahns
@dmonad
Mar 04 2015 12:36
Hi
defcon?, I hope you mean FOSDEM, Yjs has not (yet) military application
Corentin Cadiou
@cphyc
Mar 04 2015 12:37
Ow my bad, I meant Fosdem
Kevin Jahns
@dmonad
Mar 04 2015 12:37
Are you the one who wants to create a collaborative text editor?
Corentin Cadiou
@cphyc
Mar 04 2015 12:37
Yes
Kevin Jahns
@dmonad
Mar 04 2015 12:38
Something similar to ACE? Why do you not use a shared textarea?
Corentin Cadiou
@cphyc
Mar 04 2015 12:39
It would be more like an etherpad, but without the need of a central server
Kevin Jahns
@dmonad
Mar 04 2015 12:39
Ah cool. So what do you want to know?
Corentin Cadiou
@cphyc
Mar 04 2015 12:40
I was wondering to which extent yjs had been (unit-)tested
And is the library going to change a lot in the future ?
Kevin Jahns
@dmonad
Mar 04 2015 12:41
In my thesis I proved that the algorithm is correct. I do black box testing by letting several users collaborating on different data types.
Corentin Cadiou
@cphyc
Mar 04 2015 12:41
Is your thesis public? I'd be interested in having a glance at it !
Kevin Jahns
@dmonad
Mar 04 2015 12:42
I created this during my Bachelor thesis. I'm going to publish a paper with my advisor soon.
Yes the library is going to change a lot I guess.
I plan to have a stable interface in version 1.0
I'm currently working on the 0.5 version. We will have 3 more milestones and then I don't want to change it anymore
Corentin Cadiou
@cphyc
Mar 04 2015 12:46
ok, do you have any guess on how much time it'll take until the definitive version?
Kevin Jahns
@dmonad
Mar 04 2015 12:47
This is hard to say. Something like 3 month
But I don't know if the changes will affect you.
Maybe you have seen my release plan - I haven't figured out the best way to store the operations in a database, and UNDO is also quite complex because it contradicts with some of the other features.
If you use linear structures only, then the changes won't affect you much
Kevin Jahns
@dmonad
Mar 04 2015 12:54
In the next version I introduce the concept of custom type. You could extend the text type which I don't plan to change in the future
Kevin Jahns
@dmonad
Mar 04 2015 13:02
To put my answer to the tests right: This is an automatic test which simulates users who collaborate heavily with a high latency connection. But I have unit tests for every public method too.
Corentin Cadiou
@cphyc
Mar 04 2015 13:22
Okay, thanks for you help
I think I will first focus on text type to start with
why is the UNDO operation contradicting other features?
Kevin Jahns
@dmonad
Mar 04 2015 13:28
It contradicts with the current implementation of the garbage collector which collects all the deleted operations. Of course, you could simply turn of GC, but then you would eventually end up with a very big History Buffer (where all the operations are stored).
It should also be possible to specify where undo is supported (only on a text structure, or for the whole shared document).
For this I have to refactor some of the operations.
By the way: I haven't deployed the custom types and the next release yet. so you have to clone the repositories with git.
Corentin Cadiou
@cphyc
Mar 04 2015 13:40
Ok, that's what I did
Thanks for your help
Kevin Jahns
@dmonad
Mar 04 2015 13:41
You are welcome, write if you run into troubles.
Corentin Cadiou
@cphyc
Mar 04 2015 14:05
Is their some doc on how to sync XML values?
Or is it disabled?
Kevin Jahns
@dmonad
Mar 04 2015 14:58
Check out the xml type. In order to make that work you also have to include the list type in your source code.
Note: dom binding does not work yet.
Corentin Cadiou
@cphyc
Mar 04 2015 15:14
ok
is the .getDom() method working?
Kevin Jahns
@dmonad
Mar 04 2015 15:20
There are still some bugs. But it pretty much works
Corentin Cadiou
@cphyc
Mar 04 2015 15:20
ok, nice
Corentin Cadiou
@cphyc
Mar 04 2015 15:43
How am I supposed to make it work, for each call I get the error "TypeError: this._model is undefined" on FF
(each call of .getDom())
Kevin Jahns
@dmonad
Mar 04 2015 15:45
You cloned Yjs with git, right? I forgot: you also have to switch to the 0.5 branch
git checkout 0.5
Corentin Cadiou
@cphyc
Mar 04 2015 15:45
ok, I was on the master branch
Corentin Cadiou
@cphyc
Mar 04 2015 16:14
Do you have any example of the use of Y-xml ?
Kevin Jahns
@dmonad
Mar 04 2015 16:29
Nope. Not yet. doesn't it work for you?
Corentin Cadiou
@cphyc
Mar 04 2015 16:30
I don't really get the way your lib is structured so I don't know how to do it (and hence I'm looking for an example)
Kevin Jahns
@dmonad
Mar 04 2015 16:33
Well.. you can do this:
var yxml = new Y.Xml("tagname")
// put it on the shared object
y.val("xml",yxml)
// now you can use the shared xml element.
yxml.attr("someAttribute","newValue")
... // all the methods you find on the git repo
Create a dom object
```
var dom = yxml.getDom();
dom.setAttribute("someAttribute","othervalue")
yxml.attr("someAttribute") === "othervalue" // true
// it does also work the other way around
Does this help?
Corentin Cadiou
@cphyc
Mar 04 2015 16:36
Yes!
Btw, thanks for the help (and the work)
Kevin Jahns
@dmonad
Mar 04 2015 16:38
Sure, I'd be interested in your project when it is ready ;)
Corentin Cadiou
@cphyc
Mar 04 2015 16:38
I'll let you know (after having harassed you long enough)
Kevin Jahns
@dmonad
Mar 04 2015 17:00
don't worry about it ;)
Corentin Cadiou
@cphyc
Mar 04 2015 17:03
I filed an issue on gitHub because I get an error
Kevin Jahns
@dmonad
Mar 04 2015 17:10
I'll have a look at it
Kevin Jahns
@dmonad
Mar 04 2015 17:21
I'm going to include this case in my documentation for the next release. Read the issue. This is what you have to do:
 var connector = new Y.WebRTC("test", {url: config.server});

 var y = new Y(connector);
 var yxml = new Y.Xml(document.getElementById("comm"));

 // Set it here
 y.val("myxml",yxml)

 /* leave this
 connector.whenSynced(function() {
   y.val("xml", yxml);
 });
 */
 yxml.getDom(); // ← no error here