mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-29 01:50:06 +02:00
deprecate plugin.data
This commit is contained in:
@@ -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 `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
|
### `0.38.0` — August 21, 2018
|
||||||
|
@@ -107,7 +107,14 @@ class Value extends Record(DEFAULTS) {
|
|||||||
// Allow plugins to set a default value for `data`.
|
// Allow plugins to set a default value for `data`.
|
||||||
if (options.plugins) {
|
if (options.plugins) {
|
||||||
for (const plugin of 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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user