slate v0.15.0 Release Notes
Release Date: 2016-11-17 // over 7 years ago-
BREAKING
The unique
key
generated values have changed. Previously, Slate generated unique keys that looked like'9dk3'
. But they were not very conflict-resistant. Now the keys are simple string of auto-incrementing numbers, like'0'
,'1'
,'2'
. This makes more clear that keys are simply a convenient way to uniquely reference nodes in the short-term lifespan of a single in-memory instance of Slate. They are not designed to be used for long-term uniqueness. A newsetKeyGenerator
function has been exported that allows you to pass in your own key generating mechanism if you want to ensure uniqueness.0️⃣ The
Raw
serializer doesn't preserve keys by default. Previously, theRaw
serializer would omit keys when passed theterse: true
option, but preserve them without it. Now it will always omit keys, unless you pass the newpreserveKeys: true
option. This better reflects that keys are temporary, in-memory IDs.⚡️ Operations on the document now update the selection when needed. This won't affect you unless you were doing some very specific things with transforms and updating selections. Overall, this makes it much easier to write transforms, since in most cases, the underlying operations will update the selection as you would expect without you doing anything.
🗄 ###### DEPRECATED
Node accessor methods no longer accept being passed another node! Previously, node accessor methods like
node.getParent
could be passed either akey
string or anode
object. For performance reasons, passing in anode
object is being deprecated. So if you have any calls that look like:node.getParent(descendant)
, they will now need to be written asnode.getParent(descendant.key)
. They will throw a warning for now, and will throw an error in a later version of Slate.