Re:React's Diff Algorithm
by moonboots on Sunday December 29, 2013 @07:20PM
(#6982306)
Instead of performing OT at the DOM level, you could do it at the data/JSON level with ShareJS and continuously feed this JSON into React.
[ Parent
| on HN ]
If the underlying data is structured as plain-text or JSON, I think that’s the way to go. But I’m specifically thinking of collaborative rich text editing, in which case you’re probably using HTML both as the data format and the presentation/editing format.
For data as plain text, one could imagine to have an editor based on Markdown. I’ve seen shareJS used this way. IMHO once one wants more sophisticated formatting options this is not as user-friendly as a WYSIWIG solution.
Alternatively, the HTML needs to be converted client-side on the fly to something like JSONML http://www.jsonml.org/ Would that be feasible from a performance perspective?