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.

Where Next?

Popular General Dev topics Top

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
First poster: davearonson
Welcome to the third part of this series aimed to help you unleash a power never seen on Earth using the Almighty Vim. If you don’t under...
New
ankur
Disassembly support, similar to what is there in Visual Studio, would be a great feature to have for low level programming (C, C++), and ...
New
herminiotorres
Someone where use Doom Emacs right now? I like to starting this topic to discuss it and learn a little bit more, not just only the emacs ...
New
CommunityNews
https://vimgifs-544mvq4w0-mraza007.vercel.app/ This thread was posted by one of our members via one of our news source trackers.
New
First poster: iPaul
TL;DR: You want to teach yourself vim (the best text editor known to human kind) in the fastest way possible. This is my way of doing it....
New
First poster: bot
See full diagram here: https://rawgit.com/darcyparker/1886716/raw/eab57dfe784f016085251771d65a75a471ca22d4/vimModeStateDiagram.svg This...
New
AstonJ
Anyone seen Neovide? Looks pretty neat! This is a simple graphical user interface for Neovim (an aggressively refactored and updated Vi...
New
malloryerik
I’m trying it out tonight. Any tips or experiences? I’ve actually had quite a bit of success with chatting with GPT-4, at least until it...
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 these benchmarks might not be the exact picture of real-world scenario, but still I expect a Rust web framework performing a ...
New
AstonJ
You might be thinking we should just ask who’s not using VSCode :joy: however there are some new additions in the space that might give V...
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
PragmaticBookshelf
“Finding the Boundaries” Hero’s Journey with Noel Rappin @noelrappin Even when you’re ultimately right about what the future ho...
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
Help
I am trying to crate a game for the Nintendo switch, I wanted to use Java as I am comfortable with that programming language. Can you use...
New
New
New
CommunityNews
A Brief Review of the Minisforum V3 AMD Tablet. Update: I have created an awesome-minisforum-v3 GitHub repository to list information fo...
New
AstonJ
Curious what kind of results others are getting, I think actually prefer the 7B model to the 32B model, not only is it faster but the qua...
New