Conversation
|
Size Change: +19 B (0%) Total Size: 1.42 MB
ℹ️ View Unchanged
|
gwwar
approved these changes
Mar 26, 2021
Contributor
There was a problem hiding this comment.
@talldan this helps quite a bit! 🤔 The previous selector behavior is curious, since I didn't spot any common mistakes with redux data triggering too many updates.
I also did a quick profile while dragging on this branch. It looks like ToolbarItems render while dragging, so that might be a good spot to do a similar optimization on the navigation-link RichText in edit.js
Contributor
|
This is beyond my skill to code review or debug, but I wanted to note that I'm seeing a navigation block error, both in trunk but also in this branch: #30177 (comment)
|
Contributor
|
Nice steps @jasmussen 💖 that's a lot easier to profile consistently. |
Contributor
Author
|
I'll follow up with further PRs looking into the other issues. |
ellatrix
reviewed
Mar 27, 2021
7 tasks
This was referenced Mar 30, 2021
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.


Description
This takes us a step closer to fixing the root cause of #30177
The underlying cause is that
useNestedSettingsUpdateperforms a shallow equality check before updating a block list's settings.This combined with the way navigation link was passing through a new array for
allowedBlockson every render, causing the settings to update, resulted in a cascading render.This was compounded for some reason when using the
isDraggingBlocksselector. Still not entirely sure why that would be, but I'll continue looking into that. It might be that updating the block list settings is causing the inner blocks to re-render, which is also causing the action that updates the dragged blocks to trigger 🤷♂️ .This first step tidies up the nav link block. It might also be worth changing the way
useNestedSettingsUpdatechecks for equality. Some of the props may need more than just shallow equality.How has this been tested?
git revert 19fa71b)Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist: