CommunityNews

CommunityNews

Slate – A completely customizable framework for building rich text editors

Why?

Why create Slate? Well… (Beware: this section has a few of my opinions!)

Before creating Slate, I tried a lot of the other rich text libraries out there—Draft.js, Prosemirror, Quill, etc. What I found was that while getting simple examples to work was easy enough, once you started trying to build something like Medium, Dropbox Paper or Google Docs, you ran into deeper issues…

  • The editor’s “schema” was hardcoded and hard to customize. Things like bold and italic were supported out of the box, but what about comments, or embeds, or even more domain-specific needs?
  • Transforming the documents programmatically was very convoluted. Writing as a user may have worked, but making programmatic changes, which is critical for building advanced behaviors, was needlessly complex.
  • Serializing to HTML, Markdown, etc. seemed like an afterthought. Simple things like transforming a document to HTML or Markdown involved writing lots of boilerplate code, for what seemed like very common use cases.
  • Re-inventing the view layer seemed inefficient and limiting. Most editors rolled their own views, instead of using existing technologies like React, so you have to learn a whole new system with new “gotchas”.
  • Collaborative editing wasn’t designed for in advance. Often the editor’s internal representation of data made it impossible to use to for a realtime, collaborative editing use case without basically rewriting the editor.
  • The repositories were monolithic, not small and reusable. The code bases for many of the editors often didn’t expose the internal tooling that could have been re-used by developers, leading to having to reinvent the wheel.
  • Building complex, nested documents was impossible. Many editors were designed around simplistic “flat” documents, making things like tables, embeds and captions difficult to reason about and sometimes impossible.

Of course not every editor exhibits all of these issues, but if you’ve tried using another editor you might have run into similar problems. To get around the limitations of their API’s and achieve the user experience you’re after, you have to resort to very hacky things. And some experiences are just plain impossible to achieve.

If that sounds familiar, you might like Slate.

Which brings me to how Slate solves all of that…

Read in full here:

This thread was posted by one of our members via one of our news source trackers.

First Post!

bot

bot

Corresponding tweet for this thread:

Share link for this tweet.

Popular General Dev topics Top

AstonJ
SpaceVim seems to be gaining in features and popularity and I just wondered how it compares with SpaceMacs in 2020 - anyone have any thou...
New
AstonJ
Thanks to @foxtrottwist’s and @Tomas’s posts in this thread: Poll: Which code editor do you use? I bought Onivim! :nerd_face: https://on...
New
First poster: bot
What you need to know before try Emacs. When it comes to Emacs, every programmer should have heard its name more or less. After all, Ema...
New
AstonJ
Please share your favourite Vim tips here :nerd_face:
New
AstonJ
Inspired by some of the comments in our https://forum.devtalk.com/t/your-vim-tips/4748 (in particular those by Mafinar and Hallski) …what...
New
First poster: bot
At Replit, we want to give our users the most powerful, flexible, and easy-to-get-started coding environment. However, it has been limiti...
New
CommunityNews
This is neither an in-depth article about advanced vim features nor is it an ideology-inducing primer on why the oh-so-powerful god of ed...
New
First poster: bot
Vim’s netrw file browser is good enough. With a few tweaks there is no need for plugin like NERDtree. For many tasks you may not even nee...
New
First poster: jaeyson
Nova. The beautiful, fast, flexible, native Mac code editor from Panic.
New
dqops
If you are making your own formats of YAML files, you may like the article that we wrote showing how to make Visual Studio Code and a few...
New

Other popular topics Top

DevotionGeo
I know that -t flag is used along with -i flag for getting an interactive shell. But I cannot digest what the man page for docker run com...
New
DevotionGeo
The V Programming Language Simple language for building maintainable programs V is already mentioned couple of times in the forum, but I...
New
New
Margaret
Hello everyone! This thread is to tell you about what authors from The Pragmatic Bookshelf are writing on Medium.
1132 25321 748
New
AstonJ
We’ve talked about his book briefly here but it is quickly becoming obsolete - so he’s decided to create a series of 7 podcasts, the firs...
New
PragmaticBookshelf
Author Spotlight James Stanier @jstanier James Stanier, author of Effective Remote Work , discusses how to rethink the office as we e...
New
AstonJ
If you get Can't find emacs in your PATH when trying to install Doom Emacs on your Mac you… just… need to install Emacs first! :lol: bre...
New
PragmaticBookshelf
Author Spotlight Jamis Buck @jamis This month, we have the pleasure of spotlighting author Jamis Buck, who has written Mazes for Prog...
New
AstonJ
If you want a quick and easy way to block any website on your Mac using Little Snitch simply… File > New Rule: And select Deny, O...
New
DevotionGeo
I have always used antique keyboards like Cherry MX 1800 or Cherry MX 8100 and almost always have modified the switches in some way, like...
New