slate v0.41.0 Release Notes

Release Date: 2018-09-21 // over 5 years ago
  • ๐Ÿ—„ ###### DEPRECATED

    The withoutNormalization helper has been renamed to withoutNormalizing. This is to stay consistent with the new helpers for withoutSaving and withoutMerging.

    BREAKING

    ๐Ÿšš The the "operation flags" concept was removed. This was a confusing concept that was implemented in multiple different ways and led to the logic around normalizing, saving, and merging operations being more complex than it needed to be. These flags have been replaced with three simpler helper functions: withoutNormalizing, withoutSaving and withoutMerging.

    change.withoutNormalizing(() => {
      nodes.forEach(node => change.removeNodeByKey(node.key))
    })
    
    change.withoutSaving(() => {
      change.setValue({ decorations })
    })
    

    This means that you no longer use the { normalize: false } or { save: false } options as arguments to individual change methods, and instead use these new helper methods to apply these behaviors to groups of changes at once.

    ๐Ÿšš The "normalize" change methods have been removed. Previously there were a handful of different normalization change methods like normalizeNodeByPath, normalizeParentByKey, etc. These were confusing because it put the onus on the implemented to know exact which nodes needed to be normalized. They have been removed, and implementers no longer ever need to worry about which specific nodes to normalize, as Slate will handle that for them.

    ๐Ÿšš The internal refindNode and refindPath methods were removed. These should never have been exposed in the first place, and are now no longer present on the Element interface. These were only used internally during the normalization process.