Hello all,
In this post I’d like to discuss the adoption of Blocknote as the next rich editor of XWiki, as a replacement for CKEditor 4.
This discussion will focus on the most relevant point to be mindful of this post’s length, but a design page exists with more details.
So first, let me start with a view of the web editor landscape (a first version of this study was done earlier; I updated it today with some more libraries and re-evaluated the existing ones).
Dismissed options
- ProseMirror: too low level for our needs, more of a framework to build editors (i.e., we would rather not redevelop ourselves all the UI elements of an editor).
- Editor.js, Novel, Quill, BlockSuite, Remirror, ContentTools, Pell: very low activity in the past years.
- TinyMCE, CKEditor 5: Incompatible license (GPL2).
- Gutenberg: In the process of moving from GPL to MPL since 2021, we can consider the license as incompatible.
- Tiptap: Based on ProseMirror, for our experiments on Cristal, we decided to move away from it since the interesting UI elements were progressively becoming paid extensions.
- Milkdown: Focused on Markdown support only, so not relevant for XWiki’s needs.
- Slate: documented as beta by its maintainers
- Draft.js (Facebook): Archived
- Plate: Decently active, MIT, but maintained by a single developer
- Trix: no documented support for real-time, very minimalistic documentation
- Lexical: compatible license, backed by meta, but at the same level of abstraction as ProseMirror. Low-level APIs, not many rich UI elements available as extensions (e.g., no quick action extension).
Remaining choice
To the best of my knowledge, the only remaining choice is BlockNote:
Positive points:
- Actively maintained
- Backed by a small company
- Compatible MPL license (except for a few modules using GPL, but we don’t use those).
- Good default of rich UI elements
- Good support for realtime edition (based on yjs)
- We have a good knowledge of the editor thanks to experiments with Cristal
Negative points:
But there is also quite the list of more concerning points that I’d like to highlight (note that I start with the assumption that we want to be 100% iso-compliant with what was possible with CKEditor 4).
@ClementEXWiki @mflorea please let me know if you think there are other important points to highlight.
Before going into the technical aspects. Blocknote is currently maintained by a small company (TypeCell) with 3 main developers. This is a threat to the longevity of the project, and it’s unclear what would happen if the company stopped maintaining the project.
On the technical side (non-exhaustive list):
- The project is heavily relying on React, forcing us to have to know this front-end framework in addition to Vue. We can encapsulate React in the single Blocknote module, but it is still adding more work to integrate with Vue components.
- Many elements or interactions are difficult to remove from the UI (e.g., it is impossible to disable table cell resizing).
- The existence of predefined UI elements can lead to incompatibility with our needs (e.g., Blocknote tables can only have a single header).
- There are some technical limitations preventing us from fully integrating macros in an iso-functional way (e.g., custom blocks cannot be nested, meaning that wiki macros cannot be nested).
- Some nesting of elements is not possible in Blocknote (e.g., it is not possible to add lists in table cells).
- More generally, several concepts are not easily extensible (e.g., adding more parameters to images).
You can look for the issues created by @ClementEXWiki on TypeCellOS/BlockNote and the issues created on our Jira for the Blocknote component for an exhaustive list of currently documented issues.
Conclusion
I think we can say that there is no perfect option.
But, despite its current limitations, Blocknote is the closest we can get to a rich editor matching the needs of XWiki without fully redeveloping the UI elements needed for a rich editor from scratch (based on Prosemirror or Lexical).
Please let me know what you think!
Thanks.