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
Site editor: Mount both wp_template and wp_template_part EntityProviders to avoid remounting #25870
Conversation
|
Size Change: +22 B (0%) Total Size: 1.18 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This tests well for me, I think we can merge it 🚀
My one thought is that it seems weird to have to wrap so many entity providers like this:
- entity provider (root/site)
- entity provider (wp_template)
- entity provider (wp_template_part)
- entity provider (global styles)
I wonder if there is a way we can abstract that further into one component - or maybe let entity provider handle multiple entities? Not sure. It feels like it could be cleaner.
But I don't think we need to figure that out right now :)
Definitely! A multi-entity provider would be great. We will need to discuss this with the core team. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also agree that a multi-entity provider would be awesome!
I'm not familiar enough with EntityProvider and its implication to have a good idea on how to build it though.
Fixes: #25743
Description
EntityProvideruses a different context provider component for each entity type. Which results in a remount since we are changing the component.Unfortunately,
EntityProvideris at the top of our tree, which results in a full Editor remount. Causing all the states to be lost. To avoid the remount, we introduce bothEntityProviderin the tree, rather than one dynamic component.How has this been tested?
yarn wp-env startTypes of changes
Bug fix
Checklist: