These are chat archives for rwth-acis/yjs

11th
Mar 2015
Corentin Cadiou
@cphyc
Mar 11 2015 09:32
ok
Corentin Cadiou
@cphyc
Mar 11 2015 10:27
Would it be possible to chat?
Kevin Jahns
@dmonad
Mar 11 2015 10:44
sure
chat like in talking or writing?, i'm here
Corentin Cadiou
@cphyc
Mar 11 2015 13:44
As you want, I had some questions about how the synchro is made
So that I can decide how to build a minimal type that would let me have a RT editor
Sorry, I think we missed each other this morning
Kevin Jahns
@dmonad
Mar 11 2015 14:08
^^ No problem.
Do you have any specific questions?
Corentin Cadiou
@cphyc
Mar 11 2015 15:09
Just to let you know, I'm writing a draft with the current grammar
Corentin Cadiou
@cphyc
Mar 11 2015 15:14
type RTE = ((paragraph|embed)*p_properties)+
type p_properties = p_property*
type p_property = list | align | width
type align = left | right | center
type list = bullet | enum | null
type width = int
type embed = (video|audio | picture)*source
type paragraph = (char * c_properties)+
type c_properties = c_property*
type c_property = font | font_size | bold | italics | underline | strikethrough | color | background | author | author_cursor
Corentin Cadiou
@cphyc
Mar 11 2015 15:44
and a last question, what do you use to manage the tree of your projects (lib/ build/, …)?
Kevin Jahns
@dmonad
Mar 11 2015 15:59
I really like your thinking: thanks for the grammar
What exactly do you mean with manage?
Do you want to know the meanings of the directories?
Corentin Cadiou
@cphyc
Mar 11 2015 16:00
Just which tool you're using to browserify the libs etc…
Kevin Jahns
@dmonad
Mar 11 2015 16:00
gulp
Corentin Cadiou
@cphyc
Mar 11 2015 16:01
Ow, of course!
Kevin Jahns
@dmonad
Mar 11 2015 16:01
gulp build will build (browserify) everything
Corentin Cadiou
@cphyc
Mar 11 2015 16:01
ok, nice
Corentin Cadiou
@cphyc
Mar 11 2015 16:06
Is their somewhere the interface (the OOP meaning of it) of the object that has to be implemented?
Kevin Jahns
@dmonad
Mar 11 2015 16:13
Not really. But the problem has been approached by sharejs as well. They have a dedicated rich text type (we should provide at least the same functionality). Furthermore, they explained some of the problems they have. Maybe this thread could prove to be helpful.
Corentin Cadiou
@cphyc
Mar 11 2015 16:28
Didn't you say that https://github.com/ottypes/rich-text#diff was not possible to implement ?
Corentin Cadiou
@cphyc
Mar 11 2015 16:37
Because they propose to use the data structure I presented before (list of (strings*attributes))
Corentin Cadiou
@cphyc
Mar 11 2015 16:50
it's just that I'm not liking the idea of having a very big object in JS (one for each character) because it may be really inefficient. So if it is possible to format a bunch of text in one operation, it's way faster
Kevin Jahns
@dmonad
Mar 11 2015 16:56
No, you can't implement the rich text ot type. But they thought about the problem and the type of conflicts that may occur.
The y-text type works like this: every character in a text is represented as an (very small) object. This is how my algorithm works. I'm going to improve the space complexity, but also currently, Yjs does not require too much space.
Sorry I have to go now
Kevin Jahns
@dmonad
Mar 11 2015 21:03

I'd propose the following type (sorry its far away from BNF).

RichText = { 
paragraphs : [paragraph*],
}

paragraph = {
  sentences : [word*],
  aligning: ..,
  style: [styleDef],
  cursorInformation: {
    user1 : cursorDef,
    ..
  }
}
// when the paragraph is converted to a string (concatenation of words),
// then this will represent the selection inside this string.
styleDef = {
  from: Integer,
  to: Integer,
  type: "bold" | "Italic" | ..
}
cursorDef = {
  from: Integer,
  to: Integer
}
word = {
  content : String (a real js String),
}

This is my rough sketch. What do you think?

Kevin Jahns
@dmonad
Mar 11 2015 22:14
I really thought more about the semantics of concurrent actions. The fact that this notion stores words as a string is not only more efficient, but does also preserve the intention of some actions (e.g. two users concurrently fix the word "syntx"