Facebook open sources Lexical, an extensible text editor library
This feels half baked and confusing.<p>More than half docs page are blank:<p>- <a href="https://lexical.dev/docs/concepts/commands" rel="nofollow">https://lexical.dev/docs/concepts/commands</a><p>- <a href="https://lexical.dev/docs/getting-started/quick-start" rel="nofollow">https://lexical.dev/docs/getting-started/quick-start</a><p>- <a href="https://lexical.dev/docs/concepts/extending-nodes" rel="nofollow">https://lexical.dev/docs/concepts/extending-nodes</a><p>- <a href="https://lexical.dev/docs/concepts/editor-state" rel="nofollow">https://lexical.dev/docs/concepts/editor-state</a><p>- <a href="https://lexical.dev/docs/api/lexical" rel="nofollow">https://lexical.dev/docs/api/lexical</a><p>- <a href="https://lexical.dev/docs/api/lexical-selection" rel="nofollow">https://lexical.dev/docs/api/lexical-selection</a><p>- <a href="https://lexical.dev/docs/api/lexical-text" rel="nofollow">https://lexical.dev/docs/api/lexical-text</a><p>- <a href="https://lexical.dev/docs/api/lexical-offset" rel="nofollow">https://lexical.dev/docs/api/lexical-offset</a><p>> An extensible text editor library<p>> Lexical is an extensible JavaScript web text-editor framework<p>The terminology is also confusing. In some places its called a library. In other places it's called a framework. Then other commenters mentioned that the demo gives the impression that it is a full package editor, but is just pegging onto CodeMirror. That's clarified here?<p>> It doesn't directly concern itself with UI components<p>> core of Lexical is ... a DOM reconciler that takes a set of editor states, diffs the changes, and updates the DOM according to their state.<p>> Lexical is designed for everyone. It follows best practices established in WCAG<p>These are weird and conflated set of buzzwords. Why should something that isn't concerned with UI components be concerned with accessibility best practices?<p>I'm building my own text editor and I thought VSCode was impressive enough. See this well written article about their text buffer reimplementation: <a href="https://code.visualstudio.com/blogs/2018/03/23/text-buffer-reimplementation" rel="nofollow">https://code.visualstudio.com/blogs/2018/03/23/text-buffer-r...</a>. Then I realized Ace.js has some even crazy magic implementation that can handle millions of LoC files without lag. Can Lexical handle 100k+ LoC? Normally I'd benchmark myself, but in this case I don't see other compelling reasons too. The author mentioned the 22kB bundle size is less than Draft.js by Facebook, but Slate.js is 10kB and much more mature.<p>Some features that could make Lexical have "powerful features" as claimed: UNDO/REDO manager (without storing the entire state on the stack, which is just not scalable on memory), possibly implementing the Command pattern, then make easy consumption of collaborative editing such as with Operational Transform.