question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Documentation is missing Change.normalize

See original GitHub issue

The documentation here –

https://docs.slatejs.org/slate-core/change

– needs the normalize function.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
SmilinBriancommented, Jun 5, 2018

Wow, I feel like Cameron’s comment about withoutNormalization() should be documented somewhere!

1reaction
camerackercommented, May 11, 2018

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 with withoutNormalization is it calls normalization on all nodes in the document, so it should be used sparingly and strategically. The risk of calling change.normalize() is that this causes the entire document to be normalized, which is expensive, and this is doubly true for calling change.normalize() in conjunction with withoutNormalization 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 a withoutNormalization call, or you’ve accidentally used setFlag('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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found