News for hackers. Stuff that matters.
Re:Facebook open sources Lexical, an extensible text editor ... by trueadm on Thursday April 14, 2022 @08:03AM (#31025742)
The EditorState is fully JSON serializable. You can use JSON.stringify in the browser, or an alternative on other platforms. You can then pass the stringified values around and parse them using `editor.parseEditorState()`
Re:Facebook open sources Lexical, an extensible text editor ... by lewisjoe on Thursday April 14, 2022 @08:19AM (#31025895)
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 zero dependecies.

Any chance you thought along these lines?

Re:Facebook open sources Lexical, an extensible text editor ... by trueadm on Thursday April 14, 2022 @08:35AM (#31026077)
Yeah, I'd roll with Node/Deno and use Lexical that way. :)
Re:Facebook open sources Lexical, an extensible text editor ... by zhamdi on Wednesday April 20, 2022 @07:07AM (#31095157)
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 ... by CanRau on Sunday April 17, 2022 @01:00AM (#31058647)
Deno