3 ms·
The very reason why libraries like Lexical & ProseMirror exist, is because it's painful to work with contenteditable APIs. And even with those libraries, try i
by lewisjoe 3y ago
The very reason why libraries like Lexical & ProseMirror exist, is because it's painful to work with contenteditable APIs.
And even with those libraries, try implementing features like multi-columns and cross-block selections.
And the most important problem: try implementing a pure HTML editor using ProseMirror / Lexical - i.e the editor should accept HTML exactly as it is, from arbitrary sources, like how contenteditable accepts. (You can't)
Those libraries depend on tightly controlling what goes into the editor, which is an amazing trade-off if you are building a tightly controlled editor. But good luck, building an email editor that accepts any wild HTML.
- Closi 3y agoAlso note some of the limitations with Lexical - e.g. you can't even drag and drop highlighted text within a block.
- jitl 3y agoLexical is not mature and I wouldn’t recommend it for a project yet. Draft.JS (Facebook’s previous ContentEditable framework) stagnated for a long time. Use ProseMirror/TipTap - much lower risk.
- KRAKRISMOTT 3y agoBut lexical provides so much more semantic data. You can build actual operational transforms while for prosemirror the quickest way for collab editing is almost always binding it to a third party CRDT like y.js (which while admittedly works, makes it somewhat hard to customize compared to op transforms).
- jitl 3y agoWell the 3rd party collaboration libraries for ProseMirror are all using Operation (Step) and transformation interfaces exposed by ProseMirror, right? Or do you mean to say those are too "black box" to build nicely on top of? https://prosemirror.net/docs/ref/#transform https://prosemirror.net/docs/ref/#transform https://prosemirror.net/docs/ref/#collab https://prosemirror.net/docs/ref/#collab