Ask HN: How to Move Away from DraftJS
5 points| catchmeifyoucan | 5 years ago | reply
We currently use draftjs in our project, but we found later that it’s mobile support is lackluster, and overall it hasn’t been a great editor for us. Considering slate or TinyMCE, but right now all of our users data is sitting as Serialized RawDraftContent. Any good ideas on moving folks over, and what’s a good intermediary format to store rich text soo we can switch editors for the future. Raw HTML might take too much space possibly.
[+] [-] gitgud|5 years ago|reply
> and what’s a good intermediary format to store rich text soo we can switch editors for the future. Raw HTML might take too much space possibly.
Unfortunately, HTML is probably the best solution, as it's portable to almost any WSIWYG editor and self contained. The space issue usually comes up with storing images, (shameless plug) that's why I made a quill plugin to shrink images.
https://github.com/benwinding/quill-image-compress
[+] [-] catchmeifyoucan|5 years ago|reply
I guess we'll have to write a converter from Draft to HTML and HTML to Quill as our newer formats.
[+] [-] hiimshort|5 years ago|reply
I don't have any experience with TinyMCE, but I would imagine there are similar issues to do with rich editing experiences. My best advice is to pick a simpler solution if you can. If something like QuillJS satisfies your needs with its out-the-box experience, then that may ne netter than investing time building your own edjtor with Slate. If, however, your editing is unique and/or complex, then Slate provides a decent base to work off of.
[+] [-] andfrob|5 years ago|reply
Also - definitely use HTML as storage. More portable between editors.
[+] [-] onurozkan|5 years ago|reply
- CKEditor 5 (supports json export/import) - Tiptap 2 (beta, but very stable / requires sponsorship / supports many frameworks) - Remirror (under development, almost stable, free)
[+] [-] alexmingoia|5 years ago|reply
[+] [-] koolakalaban|5 years ago|reply