slate v0.28.0 Release Notes
Release Date: 2017-10-25 // over 6 years ago-
NEW
State
objects now have an embeddedstate.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-levelvalidateNode
plugin function, or via the newschema
objects.The
normalize*
change methods no longer take aschema
argument. Previously you had to maintain a reference to your schema, and pass it into the normalize methods when you called them. SinceState
objects now have an embeddedstate.schema
property, this is no longer needed.