mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-12 02:03:59 +02:00
Warn when normalization removes node (#4769)
* Warn when normalization removes node Slate requires the invariant that children are all blocks or all inlines. It enforces this in default normalization by removing children. When such a node is removed, it's almost certainly due to a programming error: the developer needs to fix their application to ensure it maintains this invariant. But currently Slate does not tell the developer this. I made such a programming error, and spent a long time debugging nodes that mysteriously went missing. I would have fixed it within 30 seconds if Slate had warned me when it detected this error. (Note I have used console.warn despite the eslint rule. As far as I can see, Slate has no other facility for runtime warnings.) * Add changeset
This commit is contained in:
5
.changeset/wild-penguins-shout.md
Normal file
5
.changeset/wild-penguins-shout.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'slate': patch
|
||||
---
|
||||
|
||||
Warn when normalization removes node
|
Reference in New Issue
Block a user