Reinmar
What definitely helped too was having a very specific use case (rich-text editing) which guided many of our decisions. We focused heavily on getting the user experience right for common editing scenarios. And I fully agree that it's not just about conflict resolution, but also things like preserving position mappings. All these mechanisms need to work together for the experience to make sense to the end user.
This is an older piece (from 2018), but we shared more details about our approach here: https://ckeditor.com/blog/lessons-learned-from-creating-a-ri...
One clear issue with OT that we still face today is its complexity. It's nearly 8 years since we launched it, and we still occasionally run into bugs in OT – even though it sits at the very core of our engine. I remember seeing a similar comment from the Google Docs team :D
Actually, back in 2015 when we started prototyping CKEditor 5, we started with this approach as well. Our goal from the beginning was to combine real-time editing capabilities with an engine capable of storing and rendering complex rich-text structures (nested tables, complex nested lists, other rich widgets, etc.). We quickly realized that a linear structure is going to be a huge bottleneck. In the end, if you want to represent trees, storing them as a linear structure is counterproductive.
So, we went for a tree model. That got many things in the engine an order of magnitude harder (OT being one). But I choose to encapsulate this complexity in the model rather than make it leak to particular plugins.
In fact, from what I remember, https://github.com/quilljs/quill/issues/117 (e.g. https://github.com/quilljs/quill/issues/117#issuecomment-644...) is a good example of issues that we avoided.
I also talked to companies that built their platforms on top of Quill. One of them ended up gluing together countless Quill instances to power their editor and overcome the limitations of the linear data model but is now looking for a way to rebuild their editor from scratch due to the issues (performance, complexity, stability).
So, yes. You can implement a rich-text editor based on a linear model. But it has its immediate limitations that you need to take into consideration.
I'm actually part of the team that built real-time collaboration for CKEditor 5. As the article says, we use a tree-structured representation for rich-text data and decided (many years ago) to go with OT. My guess always was that GDocs also uses a tree structure as the internal data model or that at least Google Wave did. I think I based this on a comment from a Google employee who summed up their OT implementation as hard to stabilize, even over many years.
I know it's possible to kind of represent rich-text data in form of a linear structure. This makes the implementation of the OT much much simpler. But then the editor itself becomes much more limited or you need to combine multiple instances of its model to represent more complex data. E.g., AFAIK Quill (mentioned in the other comment) does not offer stable tables implementation. Something that wasn't that big of a deal for us.
Just for clarification, while OT for plain-text (linear model) might be simple to implement, OT for typical rich-text editors (like Google Docs) that need to rely on a tree-structured data model is a whole different story: https://ckeditor.com/blog/lessons-learned-from-creating-a-ri....
Exactly the experience that we have in CKEditor 5. OT is awfully complex. However, we can fine tune it for new operations and different scenarios of usage (e.g. undoing changes is one of them). With CRDT, at least to my understanding, we might've been limited to what we'd took into consideration on day one. Seeing how many things we learnt very late in the process (5 years so far, some documented in https://ckeditor.com/blog/Lessons-learned-from-creating-a-ri...) makes me thing that we'd sink the company twice already.
My colleague wrote down our thoughts in https://ckeditor.com/blog/Lessons-learned-from-creating-a-ri....
The other aspect of CRDT that's in some scary is what @mdpye explains in https://news.ycombinator.com/item?id=24621113. With OT, if we get the corner cases right, we can tune and extend the implementation. With CRDT that might be game over.
WYSIWYG editor for GitHub: challenge accepted!
Major release of CKEditor 5 – word count, autocorrect, base64 upload adapter
Yes, the "Free for Open Source" initiative is up and running. For now, we didn't promote it a lot because we wanted to learn how it works, but from what I know, the custom license that we proposed is already used by a couple of projects.
Based on the feedback that we got so far, we're right now working on a simplified version of this license. Its initial version still had some restrictions which didn't work for Apache2/MIT projects with a commercial branch. Plus, it was simply too long for normal people :). We're removing these limitations. Once it will be polished, we will talk about it more officially on ckeditor.com.
Anyway, we had big plans for mobile support in CKEditor 5. Then we started doing more research [1] and it turned out there are critical issues with how WebKit works. You can guess, you can try, but with a tone of hacks you still won't be able to guarantee a smooth UI and great UX.
Right now, we're in a state where:
* after spending several months on it, text editing is well supported on iOS and Android (including spellcheck and stuff) – we don't get any bug reports recently about that part,
* the default UI is not working great on smaller devices.
The sad part is – we don't have any bigger plans to address the latter. We have some smaller ideas for making the current UI more responsive, but there will still be fundamental issues that you will face when using it:
* The conflict between the native UI (the balloons/panels with paste/copy/cut/bold/italic) and the custom editor UI. I've been bringing that to the W3C's attention since 2015 and nothing happened since then (most recent topics: [2], [3]). Right now, I don't have the funds anymore to lobby for this (neither have anyone else, apparently), so those topics seem to be completely stale.
* Inability to display your UI and implement functions like scrolling to the caret in a reliable way on WebKit due to its broken viewport mechanics [4]. I even talked about this with one of the Apple devs responsible for the current behavior and he agreed that there may be a problem (a good first step :D), but I got literally zero feedback after the last year's TPAC in Lyon when I presented this issue. * And more...
IMO, it's due to those issues that we haven't seen a single editor (implementing more than some really basic functions) with a good and stable UX on both iOS and Android. Every solution I saw was flawed in one way or another. I'm not saying that it's completely impossible to build such a solution, but rather that, taken all the obstacles and moderate demand (desktop is still the main platform for rich-text editing), the ROI seems too low for anyone to invest enough in it.
Anyway, feel free to contact me (e.g. via https://twitter.com/reinmarpl) if you'd like to discuss this more.
[1] https://github.com/ckeditor/ckeditor5-design/issues/149
[2] https://github.com/w3c/editing/issues/176
[3] https://github.com/w3c/editing/issues/182 (my presentation from last year's TPAC)
[4] https://gist.github.com/Reinmar/91c70d2882523f47da7c49805042...
You reminded me that I was planning to refresh it a bit since it's over 3 years old now. I'd like to cover the rise of modern rich-text editors like CKEditor 5, ProseMirror, Draft.js and perhaps dive a bit into what we've learned when developing CKEditor 5 (because after 4 years of work it's actually out by now [1]). If you have any questions or you're curious about some particular aspects, please let me know :)
You can have a nice structured HTML and it will be as portable, as interoperable (if not more) as that JSON.
Another take on this (by my colleague from CKEditor team): https://medium.com/content-uneditable/a-standard-for-rich-te...
> From these thousands of businesses and millions of downloads, a very small group (less than 0,5%) decides to enter into business relations with CKSource.
Source: https://github.com/ckeditor/ckeditor5/issues/991
CKEditor (a rich-text editor) is this kind of really complex piece of software which requires years of experience and years of development. It's also a piece of software which is complex enough to scare people from contributing to it. So people use it for free and report bugs to you. That's all. With that conversion rate about 0.5% and a rather niche market, it's possible to slowly grow your business (as we did – CKSource is 40+ people today), but hard to keep up with the world.
Just to give a context – CKEditor 5 (which was written completely from scratch) required 5+ experienced developers working for more than 4 years right now. Therefore, for CKEditor 5 we chose GPL2+. We hope to have a more healthy paying/free users ratio. The future will show us if that's a good direction
BTW, you say that:
> commercial licenses can be a serious pain to navigate in many companies
From my experience, it's actually the opposite. Companies like our commercial license because it's easier for them than going with e.g. LGPL or MPL and hoping they won't violate it.
> From these thousands of businesses and millions of downloads, a very small group (less than 0,5%) decides to enter into business relations with CKSource.
Source: https://github.com/ckeditor/ckeditor5/issues/991
However, the difference is that all CKEditor 4's plugins were open sourced and licensed under a permissive set of GPL2+/LGPL/MPL licenses. So the project was funded by a combination of support, SLAs and commercial licenses.
With CKEditor 5 (a completely new project) we chose GPL2+. I will be able to tell you how it worked for us in a couple of years
Major release of CKEditor 5 – distraction free writing, inline widgets and more
I reported a similar one to the WebKit team a couple of months ago:
* https://gist.github.com/Reinmar/91c70d2882523f47da7c49805042...
* https://bugs.webkit.org/show_bug.cgi?id=191204
This is an issue with the viewport mechanics making it impossible to position anything in the viewport when the software keyboard is visible. This is something that every rich-text editor developer deals with and that's why none of them work really nice on iOS.
Chrome (Blink) behaves much better here – just like one would expect it to. This means that there's a pattern which Safari developers could implement in it too. Also, I talked about this with Safari's developer who worked on the current mechanism and I got the impression they weren't aware of how problematic the current implementation is for developers. So, big +1.
From my own experience, making the app I'm working on (CKEditor 5 - a web based rich-text editor) compatible with mobile Safari is right now impossible. None of the RTEs work well in mobile Safari because of its quirks and bugs.
If Apple will overdo this (just like Microsoft did with IE6), that may affect iOS's usefulness. Sure, right now you can't build a business without your presence there, but there may be a breaking point. It's hard to imagine and I kinda doubt it will happen (I rather agree with the author of this article that Apple will invest enough to keep Safari alive), but it's a possibility. Microsoft screwed it up once, so can Apple.
However, that made me think about Brave (https://brave.com/). What are your thoughts about it? It's also privacy oriented, but it's actually built on top of Chromium. What is even more interesting, Brave was founded by Brendan Eich (the co-founder of Mozilla).
I basically went through the same thinking process myself. I'm a moderate idealist and would like Firefox to succeed because it's important for the web that there's no monopoly. However, my realist soul tells me that Firefox is losing badly and it's hard to tell where it's going to end. It's a pity that Microsoft didn't choose Gecko – I wonder if they even seriously considered it.
With Microsoft joining Chromium, we're slowly entering a duopoly of WebKit and Chromium. It's still a much better situation than the dark IE6 times. However, it's hard to tell whether WebKit (AFAIU, supported mainly by Apple and Samsung) will keep up with Chromium (Google and Microsoft) in a long term. I'm afraid that it will look like a Cold War's arms race – one of the parties will invest so much that the other will just lose economically (not being able to afford that many developers). Such economical wars make developers happy, because the web progresses very fast, but I think it actually leads to a monopoly.
Anyway, I'm still keeping my fingers crossed for Gecko. They do a great job there and perhaps will be able to partner with a big enough company to keep its pace and market share.
Anyway, I don't think that anyone would actually think that I worked on this for 3 years. But when applied to software (to which this story lead me), I often hear "it took them 3 years to fix this". It's pretty much the same here. The bug was there, it caused serious issues (also with other systems), I applied various random workarounds and I spent a lot of time on it and yet, it got fixed by an accident much much later.
The art of debugging – or how it took me 3 years to fix my PC
So, some of my colleagues see CRDT as a potential saviour. There was even a paper on CRDT for tree structures that we might use (can't find a link now). However, we'd rather go with a linear model for CRDT. That'd make it a bit easier on the CRDT level but it would require some really smart decisions about: types of changes, the structure of the linear model and how it is transformed to the tree model (that we need after all). We know, though, that without an actual implementation, it's just a theoretical discussion. Therefore, we started thinking whether we could add CRDT "below" our current tree model. That might allow validating the concept in a real-life. Can't wait to do that :)
BTW, in the meantime, we recommend this paper: https://arxiv.org/abs/1810.02137