New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove document normalize calls #353
Comments
Alternatively this might be solved by instead using a |
@ianstormtaylor we have been having some hang ups with some medium-sized documents (50-100 block nodes). When I do some basic profiling with Chrome, I notice that the majority of time is being spent in Please let me know if I can help speed this up as it seems most of Slate's performance issue come from normalize. |
I made some changes according to this document on my own branch, specifically for I noticed that all of the
|
Hey @tyler-johnson sorry I just saw your comments here, I don't know how I missed them. I separately arrived at the same conclusion for |
Done now. Thanks @SamyPesse and @Soreine!! |
There are a handful of bugs with the history (undo/redo) that are from
Node.normalize
calls in the transform logic.Previously we used to call
.normalize()
to ensure that the document never got into "weird" states. This worked fine before we moved to operations, but now that all updates to Slate are performed via undo-able operations, the.normalize()
calls are now harmful, since they don't actually add operations to the operation stack, so they aren't able to be undone. This results in strange errors when trying to undo certain behaviors (mostly around removing nodes, splitting nodes, and joining nodes).Instead of calling
.normalize()
, the transforms themselves should know about the potential "weird" states a transform can leave the document in, and handle them directly with more operations.A list of transforms to cover: #354
Also, I think this should make performance better since we won't need to be iterating the whole document with every call to normalize 🎉
The text was updated successfully, but these errors were encountered: