Skip to content

Conversation

@ellatrix
Copy link
Contributor

@ellatrix ellatrix commented Oct 23, 2023

Description

Coblocks extends all blocks (through the editor.BlockListBlock filter) with a withSelect HoC, subscribing all blocks to the currently selected block. This means that on typing, the selected block updates, and all blocks on the page re-render because they are all subscribed to changes to the selected block.

I went through all functions in addAllEditorProps to which props is being passed to, but none of them seem to be using props.selected, so it looks like this subscription can be removed without further changes.

Screenshots

Types of changes

Use the React Dev Tools and enable highlight on re-render. Type in a block and watch all blocks re-render.

image

How has this been tested?

Acceptance criteria

Checklist:

  • My code is tested
  • My code follows accessibility standards
  • My code has proper inline documentation
  • I've included any necessary tests
  • I've included developer documentation
  • I've added proper labels to this pull request

@AnthonyLedesma AnthonyLedesma added this to the Next Release milestone Oct 23, 2023
Copy link
Member

@AnthonyLedesma AnthonyLedesma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent find. Thank you so much for looking into this issue!

@AnthonyLedesma AnthonyLedesma merged commit 6b1f3fd into godaddy-wordpress:master Oct 26, 2023
@ellatrix ellatrix deleted the fix/perf-issue branch November 3, 2023 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants