All Versions
139
Latest Version
Avg Release Cycle
8 days
Latest Release
1756 days ago

Changelog History
Page 7

  • v0.31.0 Changes

    November 16, 2017
    NEW

    โž• Added a new Operation model. This model is used to store operations for the history stack, and (de)serializes them in a consistent way for collaborative editing use cases.

    BREAKING

    Operation objects in Slate are now immutable records. Previously they were native, mutable JavaScript objects. Now, there's a new immutable Operation model in Slate, ensuring that all of the data inside Value objects are immutable. And it allows for easy serialization of operations using operation.toJSON() for when sending them between editors. This should not affect most users, unless you are relying on changing the values of the low-level Slate operations (simply reading them is fine).

    Operation lists in Slate are now immutable lists. Previously they were native, mutable JavaScript arrays. Now, to keep consistent with other immutable uses, they are immutable lists. This should not affect most users.


  • v0.30.0 Changes

    October 27, 2017
    BREAKING

    โœ‚ Remove all previously deprecated code paths. This helps to reduce some of the complexity in Slate by not having to handle these code paths anymore. And it helps to reduce file size. When upgrading, it's highly recommended that you upgrade to the previous version first and ensure there are no deprecation warnings being logged, then upgrade to this version.


  • v0.29.0 Changes

    October 27, 2017
    NEW

    โž• Added the new Value model to replace State. The new model is exactly the same, but with a new name. There is also a shimmed State model exported that warns when used, to ease migration.

    BREAKING

    The set_state operation has been renamed set_value. This shouldn't affect almost anyone, but in the event that you were relying on the low-level operation types you'll need to update this.

    ๐Ÿ—„ ###### DEPRECATED

    The "state" has been renamed to "value" everywhere. All of the current references are maintained as deprecations, so you should be able to upgrade and see warnings logged instead of being greeted with a broken editor. This is to reduce the confusion between React's "state" and Slate's editor value, and in an effort to further mimic the native DOM APIs.


  • v0.28.0 Changes

    October 25, 2017
    NEW

    State objects now have an embedded state.schema property. This new schema property is used to automatically normalize the state as it changes, according to the editor's current schema. This makes normalization much easier.

    BREAKING

    The Schema objects in Slate have changed! Previously, they used to be where you could define normalization rules, define rendering rules, and define decoration rules. This was overloaded, and made other improvements hard. Now, rendering and decorating is done via the newly added plugin functions (renderNode, renderMark, decorateNode). And validation is done either via the lower-level validateNode plugin function, or via the new schema objects.

    The normalize* change methods no longer take a schema argument. Previously you had to maintain a reference to your schema, and pass it into the normalize methods when you called them. Since State objects now have an embedded state.schema property, this is no longer needed.


  • v0.27.0 Changes

    October 14, 2017
    BREAKING

    The Range model is now called Leaf. This is to disambiguate with the concept of "ranges" that is used throughout the codebase to be synonymous to selections. For example in methods like getBlocksAtRange(selection).

    The text.ranges property in the JSON representation is now text.leaves. When passing in JSON with text.ranges you'll now receive a deprecation warning in the console in development.

    ๐Ÿ—„ ###### DEPRECATED

    The Selection model is now called Range. This is to make it more clear what a "selection" really is, to make many of the other methods that act on "ranges" make sense, and to more closely parallel the native DOM API for selections and ranges. A mock Selection object is still exported with deprecated static methods, to make the transition to the new API easier.

    The Text.getRanges() method is now Text.getLeaves(). It will still work, and it will return a list of leaves, but you will see a deprecation warning in the console in development.


  • v0.26.0 Changes

    October 13, 2017
    BREAKING

    The decorate function of schema rules has changed. Previously, in decorate you would receive a text node and the matched node, and you'd need to manually add any marks you wanted to the text node's characters. Now, "decorations" have changed to just be Selection objects with marks in the selection.marks property. Instead of applying the marks yourself, you simply return selection ranges with the marks to be applied, and Slate will apply them internally. This makes it possible to write much more complex decoration behaviors. Check out the revamped code-highlighting example and the new search-highlighting example to see this in action.

    The set_data operation type has been replaced by set_state. With the new state.decorations property, it doesn't make sense to have a new operation type for every property of State objects. Instead, the new set_state operation more closely mimics the existing set_mark and set_node operations.

    ๐Ÿ—„ ###### DEPRECATED

    NEW

    You can now set decorations based on external information. Previously, the "decoration" logic in Slate was always based off of the text of a node, and would only re-render when that text changed. Now, there is a new state.decorations property that you can set via change.setState({ decorations }). You can use this to add presentation-only marks to arbitrary ranges of text in the document. Check out the new search-highlighting example to see this in action.

    The setData change method has been replaced by setState. Previously you would call change.setData(data). But as new State properties are introduced it doesn't make sense to need to add new change methods each time. Instead, the new change.setState(properties) more closesely mimics the existing setMarkByKey and setNodeByKey. To achieve the old behavior, you can do change.setState({ data }).

    The preserveStateData option of state.toJSON has changed. The same behavior is now called preserveData instead. This makes it consistent with all of the existing options, and the new preserveDecorations option as well.


  • v0.25.0 Changes

    September 21, 2017
    BREAKING

    The insertBlock change method no longer replaces empty blocks. Previously if you used insertBlock and the selection was in an empty block, it would replace it. Now you'll need to perform that check yourself and use the new replaceNodeByKey method instead.

    The Block.create and Inline.create methods no longer normalize. Previously if you used one of them to create a block or inline with zero nodes in it, they would automatically add a single empty text node as the only child. This was unexpected in certain situations, and if you were relying on this you'll need to handle it manually instead now.


  • v0.24.0 Changes

    September 11, 2017
    NEW

    Slate is now a "monorepo". Instead of a single package, Slate has been divided up into individual packages so that you can only require what you need, cutting down on file size. In the process, some helpful modules that used to be internal-only are now exposed.

    There's a new slate-hyperscript helper. This was possible thanks to the work on slate-sugar, which paved the way.

    ๐Ÿ“ฆ The slate-prop-types package is now exposed. Previously this was an internal module, but now you can use it for adding prop types to any components or plugins you create.

    ๐Ÿ“ฆ The slate-simulator package is now exposed. Previously this was an internal testing utility, but now you can use it in your own tests as well. It's currently pretty bare bones, but we can add to it over time.

    BREAKING

    immutable is now a peer dependency of Slate. Previously it was a regular dependency, but this prevented you from bringing your own version, or you'd have duplication. You'll need to ensure you install it!

    ๐Ÿ“ฆ The Html, Plain and Raw serializers are broken into new packages. Previously you'd import them from slate. But now you'll import them from slate-html-serializer and slate-plain-serializer. And the Raw serializer that was deprecated is now removed.

    ๐Ÿ“ฆ The Editor and Placeholder components are broken into a new React-specific package. Previously you'd import them from slate. But now you import { Editor } from 'slate-react' instead.


  • v0.23.0 Changes

    September 10, 2017
    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.


  • v0.22.10

    November 10, 2019