简体   繁体   English

带有 JSON 补丁的 ShareDB (CRF-6902)

[英]ShareDB with JSON-Patch (CRF-6902)

If I read the documentation correctly, one needs to create "JSON0 OT Type" records for any change in the target data-model and send these to the ShareDB backend for transformation and forwarding to other clients.如果我正确阅读了文档,则需要为目标数据模型中的任何更改创建“JSON0 OT 类型”记录,并将这些记录发送到 ShareDB 后端进行转换并转发给其他客户端。 There also seems to be a newer "JSON1 OT Type".似乎还有一个更新的“JSON1 OT 类型”。

Since I have a libray which already produces JSON-Patch records, I was wondering if it is possible to use this JSON-Patch (CRF-6902) standard to specify the changes to the ShareDB backend.由于我有一个已经生成 JSON-Patch 记录的库,我想知道是否可以使用这个 JSON-Patch (CRF-6902) 标准来指定对 ShareDB 后端的更改。

json0 (and other ShareDB types) don't just define a "shape" of the patch: they also implement a number of methods that are responsible for performing operational transform, so they need to use the op shape they've defined. json0 (和其他ShareDB类型)不只是定义了该补丁的“形状”:他们也实行了一些方法,负责执行业务转变,所以他们需要使用他们所定义的运算形状。

Your options are:您的选择是:

  • Disregard your CRF-6902 patches and create new ShareDB patches忽略您的 CRF-6902 补丁并创建新的 ShareDB 补丁
  • Work out how to transform CRF-6902 patches into json0 patches研究如何将 CRF-6902 补丁转换为json0补丁
  • Write your own OT type that works with CRF-6902编写您自己的适用于 CRF-6902 的 OT 类型

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM