slate v0.23.0 Release Notes
Release Date: 2017-09-10 // over 6 years ago-
NEW
Slate models now have
Model.fromJSON(object)
andmodel.toJSON()
methods. These methods operate with the canonical JSON form (which used to be called "raw"). This way you don't need toimport
a serializer to retrieve JSON, if you have the model you can serialize/deserialize.Models also have
toJS
andfromJS
aliases. This is just to match Immutable.js objects, which have both methods. For Slate though, the methods are equivalent.BREAKING
๐ The
isNative
property ofState
has been removed. Previously this was used for performance reasons to avoid re-rendering, but it is no longer needed. This shouldn't really affect most people because it's rare that you'd be relying on this property to exist.๐ ###### DEPRECATED
๐ The
Raw
serializer is now deprecated. The entire "raw" concept is being removed, in favor of allowing all models to be able to serialize and deserialize to JSON themselves. Instead of using theRaw
serializer, you can now use thefromJSON
andtoJSON
on the models directly.The
toRaw
options for thePlain
andHtml
serializers are now calledtoJSON
. This is to stay symmetrical with the removal of the "raw" concept everywhere.๐ The
terse
option for JSON serialization has been deprecated! This option causes lots of abstraction leakiness because it means there is no one canonical JSON representation of objects. You had to work with either terse or not terse data.The
Html
serializer no longer uses theterse
representation. This shouldn't actually be an issue for anyone because the main manifestation of this has a deprecation notice with a patch in place for now.0๏ธโฃ The
defaultBlockType
of theHtml
serializer is now calleddefaultBlock
. This is just to make it more clear that it supports not only setting the defaulttype
but alsodata
andisVoid
.