[HN Gopher] Slate - A completely customizable framework for buil...
___________________________________________________________________
Slate - A completely customizable framework for building rich text
editors
Author : corentin88
Score : 47 points
Date : 2021-07-29 19:02 UTC (3 hours ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| otrahuevada wrote:
| Been looking for something like this but minus React for _ages_.
| I'd like our users to build their own RTE according to their
| needs, having a common data model on every one of them.
|
| Is there such a thing out there?
| seanstrom wrote:
| Have a look at ProseMirror, let us know if this seems like what
| you want!
|
| https://prosemirror.net/
| louisstow wrote:
| Would second ProseMirror. It was powerful enough for me to
| build essentially a code editor: https://qworp.com/
| hanspagel wrote:
| Based on ProseMirror, more popular than raw ProseMirror,
| inspired by Slate (years ago), but framework-agnostic and more
| advanced in some areas (like collaborative editing):
|
| https://tiptap.dev
| [deleted]
| hartator wrote:
| No image support? It's the main thing that's a pain in the ass to
| support.
| hanspagel wrote:
| There are editors that handle images very well by default, like
| Quill or Trix.
|
| If you start diving deeper you'll find out that image handling
| is just super complex and the behaviour is dependant on what
| you're building. Then you'll be happy to have full control
| about the behaviour with editors like Slate, ProseMirror or
| Tiptap.
| TheRealNGenius wrote:
| Just wanted to note to those thinking of using it: beware of
| Quill. I used it for my project, but it was not made for
| saving and then displaying the rich text. At least for me, it
| was a hassle figuring out how to accomplish this.
| motives wrote:
| The customisability is definitely a plus, you can make slate
| fit in perfectly with almost any UI. Whilst you don't get
| complex image handling by default, I think their image
| handling example [0] is a really nice minimal implementation
| which is quite intuitive.
|
| [0] - https://www.slatejs.org/examples/images
| topicseed wrote:
| The basic package is bare though very much functional. The
| problem with whatabout's for such an editor is what do you put
| behind "image support"?
|
| Some would need uploads, others just links, then copy and
| pasting, alt, captions, styling, etc...
|
| Slate makes it easy to extend its core with custom blocks. Now,
| it's definitely some work but it's actually very intuitive to
| work with.
| cris-ward wrote:
| Word of warning, their readme says 'Some of its APIs are not
| "finalized" and will have breaking changes over time as we
| discover better solutions.'
|
| I started using this library several years ago and have
| eventually had to rework it using prosemirror because I just
| couldn't keep up with the breaking changes.
|
| Both libraries work in very similar ways, with slate using React
| for its rendering layer. However Prosemirror has been v1 for
| quite a while and in retrospect I'd have saved myself a lot of
| headaches if I'd taken the above warning more seriously.
| dmitryminkovsky wrote:
| Same experience here. They changed APIs with no warning at
| version 0.46, breaking whatever spotty iOS/Android support they
| had. That's not a knock against them: mobile contentEditable is
| terribly difficult to get right. But the surprise total
| deprecation of their stable branch was uncool to say the least,
| even if they did warn the software was beta. I heard Slate
| raised money to fix Android support, but whether or not that's
| true, the whole thing was a really bad experience.
|
| I also wholeheartedly recommend ProseMirror. It's a bit
| complicated in some ways, but it _works_ across platforms, is
| used in production widely at big companies despite sort of
| flying under the radar, and has been stable for years. If
| you're looking for a fully baked React integration, TipTap[0]
| seems really nice, or if something minimalist then a plug for
| my own integration: use-prosemirror[1].
|
| [0] https://www.tiptap.dev
|
| [1] https://github.com/dminkovsky/use-prosemirror
___________________________________________________________________
(page generated 2021-07-29 23:00 UTC)