-
Couldn't load subscription status.
- Fork 25
Description
I was looking at the recent release and saw there are yjs bindings. I've just spent some time building out yjs bindings for a mobx-keystone backed application.
One thing I encountered was using Y.Map for simple props can lead to very inefficient data storage. This is mentioned somewhat out-of-the-way in the yjs/y-utility repository.
The specific case I had was a model storing positional data: ~like
@model("Point")
class Point extends Model({
x: tProp(types.number, 0),
y: tProp(types.number, 0)
}) {
@modelAction
moveBy(x: number, y: number) {
this.x += x;
this.y += y;
}
}Due to the lack of data pruning in Y.Map while doing interleaved writes of plain values, a relatively short editing session on the order of minutes would lead to storing hundreds ok kb of data.
When I switched to using the YKeyValue utility, the stored size of my documents stays very small. I would be quite happy to use the new official bindings, but would need to find a way to use YKeyValue for plain values. Is that something you think could be ~easily supported by the official bindings?