Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor BlockForType and BlockListBlock components #5616

Closed
geriux opened this issue Mar 30, 2023 · 0 comments · Fixed by WordPress/gutenberg#50108
Closed

Refactor BlockForType and BlockListBlock components #5616

geriux opened this issue Mar 30, 2023 · 0 comments · Fixed by WordPress/gutenberg#50108
Assignees

Comments

@geriux
Copy link
Contributor

geriux commented Mar 30, 2023

The BlockForType and BlockListBlock components need to be refactored for better performance and maintainability. The following changes should be made:

  • Simplify the way styles are passed down to BlockForType by revisiting how we use getMergedGlobalStyles.
  • Probably avoid using BlockForType I think this was added to be able to use hooks within BlockListBlock, maybe it's worth revisiting just removing it and integrating it with the main component.
  • Reduce the length of the render method in BlockListBlock to improve performance.
  • Refactor away from using class components for better readability and maintainability.
  • Consider extracting the onMerge logic into a shared file, and check with the web team for their feedback.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant