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.

feature request: option to disable document normalization on editor initialization

See original GitHub issue

slate editor constructor includes:

    // Run `onChange` on the passed-in value because we need to ensure that it
    // is normalized, and queue the resulting change.
    const change = props.value.change()
    stack.run('onChange', change, this)
    this.queueChange(change)
    this.state.value = change.value

While this is great in general, when dealing with big, complex documents, the normalization of the all document can be very long (a few seconds). It would be awesome if we can add an option prop that disable the initial value validation/normalisation. Obviously, in this case, the responsibility of ensuring the supplied value it valid moves to the developer.

Issue Analytics

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

github_iconTop GitHub Comments

6reactions
DanweDEcommented, Mar 13, 2019

Is this documented anywhere on https://docs.slatejs.org/ I couldn’t really find anything relevant when searching for “normalize”.

Also, is there a utility function to normalize a document, ideally without a whole editor instance e.g. for passing a normalized document to the editor while normalize: false is set?

2reactions
tommoorcommented, Aug 12, 2018

Would definitely appreciate this option, as mentioned normalization can hang the browser window for a few seconds. If I can guarantee that the content was previously saved out of Slate then this step seems like it could be skipped for a better user experience.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Language Server Protocol Specification - 3.17
This document describes the 3.17.x version of the language server protocol. ... is exchanged between the client and server during the initialize request....
Read more >
Cannot find reference 'xxx' in __init__.py - Stack Overflow
To fix, in Settings > Editor > File Types , in the "Recognized File Types" list click on "Text" and in the "File...
Read more >
Mask Editor Overview - MATLAB & Simulink - MathWorks
The Mask Editor dialog box helps you create and customize the block mask. The Mask Editor dialog box opens when you create or...
Read more >
modules/libpref/init/StaticPrefList.yaml ... - mozilla-central
Find changesets by keywords (author, files, the commit message), revision number or hash, or revset expression. modules/libpref/init/StaticPrefList.yaml ...
Read more >
VS Code API | Visual Studio Code Extension API
The notebooks functionality is composed of three loosely coupled components: NotebookSerializer enable the editor to open, show, and save notebooks ...
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