Universal Editor for Headless CMS: Part 3, Rich Text Editor Selection

Anton Tishchenko
Anton Tishchenko
Cover Image for Universal Editor for Headless CMS: Part 3, Rich Text Editor Selection

Rich Text Editor is a crucial part of the web page editing process. We need these capabilities for our editor. As it is a common task, we may not make it by ourselves and rely on third-party implementations. There are a bunch of JavaScript libraries available for this task: free and paid. Let’s review the available options and select one of them.

CKEditor

CKEditor is a powerful, modern-looking rich text editor. It has enough features for our case. It has even some extra that we don’t need: real-time collaboration, comments, tracking changes, export and import to various formats, AI assistant, pagination, spellcheck, and math equations. It is distributed under a dual license: commercial and open-source. It is not clear, what price they would ask for a commercial license. Prices are available only by request. It should be about $1 per user per month, which could be quite expensive if you have many users. I don’t want to introduce additional costs in this phase of the project. There is also an open-source license. CKEditor is available under a GPL 2 license. But, it is a viral license. It means that if you start to use it, you should make your project also available under GPL 2 license. That is unacceptable, we are not sure for now, how we will distribute Headless Universal Editor. The main problem is not that it will require me to make my code open-source. The biggest problem is that we should make this project GPL 2 licensed. It will limit usage. Any website that will start to use it, should make their code open-source and also available by GPL 2. And we don’t want to limit ourselves to only GPL 2 open-source distribution. I don’t think that it is an acceptable license for the major part of websites. CKEditor was not always distributed by GPL 2. The previous version was available under a triple GPL+LGPL+MPL license. You were able to use the MPL license without the requirement to make your project open source. The previous version is quite outdated, we don’t consider it. This licensing change was the reason, why many clients moved from CKEditor to TinyMCE.

If you are flexible in a cost question, CKEditor is a great option. Sitecore started to use it for their Pages editing interface. And Sitecore used this editor for ContentHub for a long time. It means that this editor is a decent choice.

TinyMCE

I am a fan of TinyMCE. I used it in many of my projects. For example, I moved Sitecore TinyMCE integration by Emanuele Ciriachi to the next level with proper Sitecore serialization, continuous integration, Sitecore 10+ support, NPM usage, and many other small imports. TinyMCE was also available by dual licenses similar to CKEditor. Previously, I used both commercial(TinyCloud) and open source depending on the project and my needs. Again, for this project, we want to start with a free license to avoid extra costs in the first phases. But, unfortunately, we don’t have this option anymore. TinyMCE made licensing changes similar to CKEditor. The previous TinyMCE version was available under the MIT license. MIT license allows you to do everything that you want with source code without any restrictions. Now, they also move to GPL 2. GPL 2 is a viral license. If you include any software under a GPL 2 license in your project, you have to make it GPL 2 as well. It is Groundhog Day for some developers. They moved to TinyMCE, because of licensing change of CKEditor. Now, they have the same situation and they need to find another alternative. There is a fork and community suggestion to continue developing TinyMCE under the MIT license. But, it is hard to predict the future and I don’t want to be stuck with an outdated version forever.

That is a tough ethical question of open source developed by companies. You may contribute to their products to make them better and use them for your work. But one day they can make this licensing shift and you will stuck on some version. And you will not be able to use the latest and greatest from the project that you help to prosper. But that is a deep philosophical question, not for this article.

Quill

Quill has fewer abilities compared to CKEditor or TinyMCE. But, these abilities are just enough for inline page editing. You need to edit text and don’t do something crazy. Especially, the more abilities we add to RTE, the harder it will be to support them across different headless CMSs.

Quill has only BSD-3 license. It is not viral, so it works for us. The product that we will release may have any license with no restrictions.

Lexical

Modern and quite promising Rich Text Editor from Meta(Facebook). It is the replacement of draft-js. It is distributed under the MIT license, which makes it suitable for our needs. The only disadvantage for us is that it is React-based. It will force us to stick with React as a framework for editing interface. Even if we choose React, I don’t want this requirement from RTE. It can make pivots more complex.

Slate

Slate is a well-known and established RTE. The main advantage of this editor is that it is plugin-focused. It means that if you need to modify the logic of your RTE, it will be very easy to do with Slate. It is distributed under MIT license, which gives us the green light. But it is also React-based, which adds additional dependency that we would like to avoid.

Other alternatives

There are many other good alternatives: ProseMirror, TipTap (which is based on ProseMirror), editor.js, and others. They are less popular, but look good. We also took a quick look at them. They are quite good, fit our needs, but have lower popularity. That is the only reason for those alternatives. It doesn’t make sense to look further if you found the option that works well for you. Probably, there is some hidden diamond. But it will take time and effort to find it and understand that it is a diamond.

Conclusion

We are going to select Quill at this point. It is free, it has license that suit our needs and it has all functionality that we need for now. Unfortunately, we need to skip 2 market leaders TinyMCE and CKEditor due to their pricing and licensing policies. It doesn’t mean that they will not fit your needs, but they doesn’t fit our needs at this point of time.