Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: How to Move Away from DraftJS
5 points by catchmeifyoucan 47 days ago | hide | past | favorite | 7 comments
Hey HN,

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.




Try https://quilljs.com/ It's open source, sleek and has a really simple plugin system, which makes modifying the editor, very easy.

> 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


It's kind of cool that this data is saved as Ops. Seems like a smart way to do it! I think sticking with HTML makes sense as well, or even the Quill Ops system.

I guess we'll have to write a converter from Draft to HTML and HTML to Quill as our newer formats.


Last year I built out a custom rich text editor using Slate. It certainly is powerful and fit right into the existing React app. We did, however, run into a handful of issues. The biggest thing with Slate was the need to implement most things myself. Slate functions great as a core for editor operations, but beyond that you're pretty much on your own. Some interactions were easy but more complex wysiwyg editing became difficult to reconcile with Slate's API. I've even needed to patch Slate once or twice to get things working properly.

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.


TinyMCE person here. We are actually working at integrating Slate into TinyMCE, so you'll end up with the best of both worlds! See https://www.tiny.cloud/blog/real-time-collaborative-editing-...

Also - definitely use HTML as storage. More portable between editors.


There are 3 options you may consider;

- CKEditor 5 (supports json export/import) - Tiptap 2 (beta, but very stable / requires sponsorship / supports many frameworks) - Remirror (under development, almost stable, free)



TipTap is a great editor, the newest version is in beta. It’s robust because it’s built on ProseMirror but also easy to use.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: