Live data from Hacker News

Facebook open sources Lexical, an extensible text editor library

lexical.dev

21–30 of 141 posts

Re: Facebook open sources Lexical, an extensible text editor library

#22
post #21

Let's say I'm building a stack overflow style editor (you type markdown and it gets rendered in a preview tab) -- would there be any reason to use lexical?

Yeah, you could easily do that. We do the exactly that right now for Workplace.

You could also roll with a `` but that can be limiting if you want additional functionality further on down the line – such as mentions or inline markdown shortcuts.

Re: Facebook open sources Lexical, an extensible text editor library

#23
One of the big frustrations with DraftJS is that Facebook moved on (which is understandable), but the core repo wasn’t given control to the community, so patches and updates couldn’t be pulled in. Obviously it’s open source and could be hard forked, but that’s not ideal.

I’d be curious if there are plans internally to make sure Lexical continues to be supported by Facebook and doesn’t end up with the same fate.

Re: Facebook open sources Lexical, an extensible text editor library

#25
post #8

Earlier quoted context omitted.

You don't need React. Lexical has no dependencies, so you can build bindings for your framework/library of choice. There are folks working on a SolidJS implementation right now. You could also do it with VanillaJS if you wanted too. The reason we have React bindings from the start, is because we needed these internally at Meta.

Any particular reason Meta decided to implement it's own editor library instead of building on top of ProseMirror?

ProseMirror wasn't a good fit for us because it's integration (especially with React 18+) isn't quite there. Furthermore, we're also looking into building native ports of Lexical, and given's Lexical's API isn't DOM centric, it allows us to do that.

Lastly, we found ProseMirror was too heavy in terms of bytes for very minimal almost plain-text interfaces where we only wanted mentions + hashtags + custom emojis. Lexical comes in at around 22kb min+gzip, so it works really well for us.

Re: Facebook open sources Lexical, an extensible text editor library

#26
Is this in production on Facebook? I have not had the greatest experiences with their rich text editor, from not being able to remove styling on subsequent lines, to getting a nice little note saying that you can't edit rich text posts on mobile. Hoping lexical brings some improvements here.

Re: Facebook open sources Lexical, an extensible text editor library

#27
post #26

Is this in production on Facebook? I have not had the greatest experiences with their rich text editor, from not being able to remove styling on subsequent lines, to getting a nice little note saying that you can't edit rich text posts on mobile. Hoping lexical brings some improvements here.

It is in production at Facebook. We're slowly rolling out to more surfaces, replacing our existing DraftJS implementations as we go. We've noticed a big improvement internally from doing so, both in terms of less bugs but also performance and accessibility.

Re: Facebook open sources Lexical, an extensible text editor library

#28

One of the big frustrations with DraftJS is that Facebook moved on (which is understandable), but the core repo wasn’t given control to the community, so patches and updates couldn’t be pulled in. Obviously it’s open source and could be hard forked, but that’s not ideal. I’d be curious if there are plans internally to make sure Lexical continues to be supported by Facebook and doesn’t end up with the same fate.

I completely understand. I can't guarantee anything, no on can in software. However, we do have a dedicated full-time team working on Lexical. DraftJS never had that, it only had a few part-time maintainers at Facebook.

Re: Facebook open sources Lexical, an extensible text editor library

#30
The examples shown on the site are code editing. Which puts it in direct competition with the more established Monaco from Microsoft [1].

Competition is welcome, but the description sounds like this is more of a library than a finished product (which Monaco isn't), and if so, some examples showing how to take advantage of that would have been helpful.

[1] https://microsoft.github.io/monaco-editor/

Post reply on HN