Repository navigation
[6.x] Don't rebuild Bard editors when the content hasn't changed - #15700
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pressing Enter in a long Bard with nested Bards in its sets felt laggy, and the Add Set button showed up late.
Solution
The cause: whenever the parent updated, every nested Bard threw away its content and rebuilt it. The check that decides whether to rebuild compared JSON strings and saved content often leaves out default attributes that the editor always writes out. So the strings never matched even when nothing had changed
Now it compares the parsed documents, so nested editors only rebuild when their content really changed. Enter is noticeably faster, though it still takes a moment on pages with lots of sets.