1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-01 05:16:10 +01:00

deprecate plugin.data

This commit is contained in:
Ian Storm Taylor 2018-08-22 14:29:20 -07:00
parent a07f526192
commit 510b47f8d6
2 changed files with 10 additions and 1 deletions

View File

@ -75,6 +75,8 @@ const selection = document.createSelection({
**The `renderPortal` property of plugins is deprecated.** This allows `slate-react` to be slightly slimmer, since this behavior can be handled in React 16 with the new `<React.Fragment>` using the `renderEditor` property instead, in a way that offers more control over the portal behavior.
**The `data` property of plugins is deprecated.** This property wasn't well designed and circumvented the core tenet that all changes to the `value` object will flow through operations inside `Change` objects. It was mostly used for view-layer state which should be handled with React-specific conventions for state management instead.
---
### `0.38.0` — August 21, 2018

View File

@ -107,7 +107,14 @@ class Value extends Record(DEFAULTS) {
// Allow plugins to set a default value for `data`.
if (options.plugins) {
for (const plugin of options.plugins) {
if (plugin.data) data = data.merge(plugin.data)
if (plugin.data) {
logger.deprecate(
'0.39.0',
'The plugin `data` property is deprecated.'
)
data = data.merge(plugin.data)
}
}
}