Documentation is missing Change.normalize
See original GitHub issueIssue Analytics
- State:
- Created 5 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Configuring Normalization Rules for Display and Local Fields
Primo VE enables you to modify the normalization rules for the out-of-the-box display fields (such as Title or Contributor).
Read more >Name normalization - Relativity Documentation
Name normalization analyzes email document headers to identify all aliases, such as proper names, email addresses, and more, and the entities, ...
Read more >Normalizing - Slate
Slate editors can edit complex, nested data structures. ... And now when normalizeNode runs, no changes are made, so the document is valid!...
Read more >Manually normalize a software model in workspace
You can manually normalize a software discovery model that has not been fully normalized (partially normalized, publisher normalized, or match ...
Read more >Configuring normalization settings for datasets
You must create a job to normalize the datasets. · Enable inline or continuous normalization for a dataset to normalize when CIs are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Wow, I feel like Cameron’s comment about
withoutNormalization()
should be documented somewhere!Yes, the vast majority of programmatic change functions will trigger a normalization automatically on the blocks that have changed, this is an important step in ensuring that your document conforms to the schema after every change that is made to it, regardless of whether the change originates from within the editor or not.
withoutNormalization
is a function that I think may be poorly named, but it basically defers normalization until after the entirety of a set of changes is applied. It’s intended to hide the need for a user to continuously pass{ normalize: false }
to change functions, and also to prevent the risk of having an unnormalized document after the changes where normalization has been suppressed are complete. The major flaw withwithoutNormalization
is it calls normalization on all nodes in the document, so it should be used sparingly and strategically. The risk of callingchange.normalize()
is that this causes the entire document to be normalized, which is expensive, and this is doubly true for callingchange.normalize()
in conjunction withwithoutNormalization
as your document will be normalized twice.That you have a situation where
setBlocks
is not triggering a normalization means that normalization is being suppressed somehow, and it’s not really clear where without looking at a code snippet. Some big ones that come to mind are you’re somehow stuck in some weird nesting of awithoutNormalization
call, or you’ve accidentally usedsetFlag('normalize', false)
somewhere and it’s been disabled at a very wide level. It may also be that the normalization is happening but not at the interval where you expect it, but again its kinda hard to tell without a snippet.