Live data from Hacker News

Facebook open sources Lexical, an extensible text editor library

lexical.dev

131–140 of 141 posts

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

#131
post #129

Earlier quoted context omitted.

No idea :D https://github.com/facebook/lexical/pull/1733

I thought it was some kind of crazy obscure low-level optimization black magic, but probably not. :)

I had to take a second pass on it. I thought I was maybe onto something when I wrote that originally. Is it a V8 perf hack? Nope, just my brain not functioning correctly at the time :P

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

#132

Earlier quoted context omitted.

Perhaps not intentionally broken but I still have issues with double texting on the Messenger mac/web app. iMessages also has this issues as well... Telegram, Discord, WeChat, MSN Messenger, etc. all seem to have figured out how to prevent double texts from occurring.

Excuse my ignorance, but what is a "double text"?

Probably the same text being sent twice.

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

#133
post #73

How hard it’ll be to build a notion like UX using lexical ? Have been using editorjs for same

I'd like to hear anyone else's experience of building a Notion like editor (or any other block based/full page editor) Something guides never cover and I am stuck on is how to let users drop "widgets" into these RTEs. Think photos and galleries, where what is displayed in the editor is not what is present in the output (the real output could be 1+ React tags with attributes set) ; tables where the edit view is a spre…

[deleted]

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

#134
post #109

Earlier quoted context omitted.

Hey Adam, is Meta using / planning on using Lexical for React Native as well?

Adam? You mean Dominic/trueadm? We have some ideas for supporting RN once we have iOS/Android versions of Lexical.

Oh right, Dominic, sorry about that! Thanks for the reply.

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

#135
post #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.

When you say inline markdown shortcut, is an example of that pressing Ctrl-B on some highlighted text in order to surround it with asterisks?

And is the idea of mentions that we can use Lexical to provide nice things like pop-up auto-complete of a username / automatically transform the username into a link inside of the input text?

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

#136
post #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.

Another follow-up question: Do you think Lexical would be a good fit for a "live preview" type editor?

Live preview = the editor is WYSIWYG but the storage format is Markdow

Example: https://help.obsidian.md/Live+preview+update

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

#137

Earlier quoted context omitted.

But, let's say I'd like to parse this stored state and send an email (as HTML) on the server? My best guess is to use a NodeJS/V8 instance on the server to somehow transform JSON to HTML using Lexical's serializer (if something like that exists). Even this is tricky because it might depend on browser DOM apis for the conversion. A better solution would be support language specific bindings to get HTML from JSON with…

Yeah, I'd roll with Node/Deno and use Lexical that way. :)

Deno

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

#139

Earlier quoted context omitted.

But, let's say I'd like to parse this stored state and send an email (as HTML) on the server? My best guess is to use a NodeJS/V8 instance on the server to somehow transform JSON to HTML using Lexical's serializer (if something like that exists). Even this is tricky because it might depend on browser DOM apis for the conversion. A better solution would be support language specific bindings to get HTML from JSON with…

Yeah, I'd roll with Node/Deno and use Lexical that way. :)

There's no documentation on how you do that. I'm struggling with this exact point now

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

#140

Is this meant to be a good drop-in rich-text/WYSIWYG editor? What is the format that it creates that you could then persist in a database? Does it just save its state in HTML or some JSON format or what?

The core Lexical library is really a framework for building such editors. However, we also provide many common rich-text features out-of-the-box via separate packages, such as @lexical/rich-text. We also expose bindings for React (and hope to have them for other frameworks soon). Check out the lexical-playground package on GitHub for an example of how you can create a rich-text editor by adding plugins to the Lexical…

And how is the data saved on the BE? is it the case we can save it as JSON or HTML?
Post reply on HN