3 ms·
What format is content stored in? Is it all RTF under the hood or something else more custom? Curious to know. Also what's the difference between using SlateJS
by far34 8y ago
What format is content stored in? Is it all RTF under the hood or something else more custom? Curious to know.
Also what's the difference between using SlateJS vs. say Monaco editor which powers VSCode?
- molikto 8y agomonaco is not a rich text editor
- arsalanb 8y agoStored as a series of operational transformations, I think. This site helps understand it — https://operational-transformation.github.io/ https://operational-transformation.github.io/
- paperpunk 8y agoYou define an internal schema, which is essentially just a tree structure according to your own use-case. In this way it lets you do editing of more complicated page elements than a typical WYSWYG editor. You can provide (or use others') serialisers and deserialisers to convert between that representation and something else, e.g. RTF, HTML.
- dumbfoundded 8y agoThe whole point of slate is an immutable representation of a document. Without getting too much in the weeds, a document is an immutable object. Edits to the document are transforms. The obvious benefit is undo/redo is pretty simple. The more subtle benefit is that really complicated document rules become tractable. I built temi.com using this (https://www.temi.com/good-audio-quality https://www.temi.com/good-audio-quality). One feature that Slate enables pretty easily is incremental saves. Since the object is immutable, you can pass changes to the server instead of the entire document by just checking element ids. You can get multi-person edits relatively easily as well.