slate v0.23.0 Release Notes

Release Date: 2017-09-10 // over 6 years ago
  • NEW

    Slate models now have Model.fromJSON(object) and model.toJSON() methods. These methods operate with the canonical JSON form (which used to be called "raw"). This way you don't need to import a serializer to retrieve JSON, if you have the model you can serialize/deserialize.

    Models also have toJS and fromJS aliases. This is just to match Immutable.js objects, which have both methods. For Slate though, the methods are equivalent.

    BREAKING

    ๐Ÿšš The isNative property of State 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 the Raw serializer, you can now use the fromJSON and toJSON on the models directly.

    The toRaw options for the Plain and Html serializers are now called toJSON. 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 the terse 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 the Html serializer is now called defaultBlock. This is just to make it more clear that it supports not only setting the default type but also data and isVoid.