Hacker News new | ask | show | jobs
by inyono 2302 days ago
Core contributor of Edtr.io here:

Slate works well for editing text. Anything with a more complicated layout / UX gets really messy though, since with Slate, you always have to deal with the DOM / Slate's wrapper around contenteditable. And at least before Slate 0.50+, we (& the developers of Schul-Cloud independently of us) ran always in bugs, etc. This is why Edtr.io (similarly to ReactPages, fka ORY Editor) builds it own state management & layouting outside of Slate. And let Slate do what they do best, editing rich-text.

1 comments

Here's the problem relying on slate (I've used it and all the others [quill, ckeditor, etc etc]) -- you are also relying on Ian Storm Taylor and he's known for going on a streak and re-writing things in a breaking manner. IMO you should just build the entire thing yourself.
> "... and re-writing things in a breaking manner. IMO you should just build the entire thing yourself."

Well that could be said for literally any 3rd party library. New updates may break things, that's why you need to pin the exact version you use to prevent things breaking.

I would rather use a library which has been tested and used by many people, than reinvent the wheel on a bunch of things...

That’s one of the reasons we only rely on Slate for our text plugin. So we could swap Slate for some different rich-text editor in the future if we need to. Though I have to say, we are very happy with Slate.
Nice. I honestly have been looking for something like this for awhile. All the examples I found with slate were either insufficient or outdated (i.e. canner editor) -- and in a focus on speed (being a solo founder), I couldn't compromise. I'm going to try to implement this for my editor on my site. Would be cool to be able to publish content with custom components (closest I could find for CKEditor [which I'm using] is: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/...) -- but the implementation for that is rather clunky (more so on the render side -- e.g. how do I save the data in my database such that I know which components to call? CSS classes? data attributes?) So the underlying structure of having JSON for the data structure with Slate (and now this) gives me more confidence as a dev.
Try ProseMirror. There’s a high learning curve at the beginning, but it’s pretty simple to make custom nodes and plugins once you understand the framework and APIs.
Would love to hear from you on how it goes :)