Operational Transformation in Meteor.js?

眉间皱痕 提交于 2019-12-30 06:08:35

问题


Does Meteor.js support Operational Transformation yet?

I'm working on a project which is some what related to Etherpad for which I thought of using Meteor.js(which I think is very much suited for this kind of project). Operational transformation is very important for my project if I think of making it scalable. My current knowledge suggest that meteor does't support operational transformation out of box (correct me if I am wrong here). So basically my question is how to implement operational transformation in meteor.js?

I tried using this library google-diff-match-patch, by Neil Fraser, but had problems while applying patches(though it worked outside meteor.js quite easily).

So any suggestions?


回答1:


After seeing several Meteor projects make use of OT (i.e. http://cocodojo.meteor.com/), I decided to go for a proper integration.

I've created a smart package to integrate ShareJS into meteor. Please come check it out and add your pull requests: https://github.com/mizzao/meteor-sharejs

Demo App: http://documents.meteor.com




回答2:


An in-browser collaborative text editor has two major components: the text area itself, which must behave well in coordinating the user's typing with other edits that are received from the server; and the data model for sending, receiving, and combining these edits.

Meteor today doesn't provide special help for either of these things specifically, but it does provide real-time data transport, and a way to move data automatically between the client and server.

If I were to implement EtherPad on Meteor, I've always imagined I would use a collection as an "operation log". User changes would be sent to the server, where they would be appended to the official log of operations (basically diffs) which would automatically stream to all clients. The client would have the work of applying diffs that come in and reconciling them with typing that hasn't been acknowledged by the server yet.

It's a tough implementation challenge. Good luck!



来源:https://stackoverflow.com/questions/11594043/operational-transformation-in-meteor-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!