JSON OT Type

95 views
Skip to first unread message

James Keener

unread,
Mar 1, 2016, 8:42:58 PM3/1/16
to sha...@googlegroups.com
Is there a repository for the new JSON type? Would migrating to using
the new type be simple for code written using the json0 type?

Thanks!
Jim

Joseph Gentle

unread,
Mar 2, 2016, 5:31:48 PM3/2/16
to sha...@googlegroups.com
The repo is here:
http://github.com/josephg/json1

Although the code isn't complete. I don't have a good story around
conflict resolution, and I'm not sure how to resolve that given the
current API. I'm thinking of allowing operations to fail. (Eg, if I
move doc.a.x -> doc.y and you delete doc.a, what happens?)

-J
> --
> You received this message because you are subscribed to the Google Groups "ShareJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sharejs+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Joseph Gentle

unread,
Mar 2, 2016, 5:32:28 PM3/2/16
to sha...@googlegroups.com
And yeah - it should be easy to migrate. The old ops will still work
through a compatibility layer. The replacement type will give you a
superset of the functionality.

Geoff Goodman

unread,
Mar 2, 2016, 6:06:24 PM3/2/16
to sha...@googlegroups.com
I've been wondering for a while if some of the issues with the json type and move operations and the potential for cyclical graphs could be resolved by the introduction of 'pointers'.

Basically, the DAG of a json object could be partially (on demand) or completely flattened to a normalized structure where some (or all) nodes are special reference pointers. This idea would mean martialing between the in-memory structure with pointers and the consumable structure that would be resolved back to a graph. An interesting property that comes from allowing pointers is that we are no longer limited to a Tree (DAG) but could introduce some circular references via pointers.

Instead of thinking about move operations as transferring subsets of the graph, you can instead think about string / array operations on a pointer.

Thoughts?

Geoff
Reply all
Reply to author
Forward
0 new messages