-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
blocks package: Replace hardcoded store names #28789
blocks package: Replace hardcoded store names #28789
Conversation
Size Change: +33 B (0%) Total Size: 1.37 MB
ℹ️ View Unchanged
|
Well, this doesn't work 😄 I guess it's related to circular reference. gutenberg/packages/core-data/package.json Line 31 in 8d61b88
|
Right, this refactor helps to catch some fundamental issues with the code that were hidden. The only question now is what should depend on what 😅 @youknowriad and @mcsf, something to think about once you find the time. My guess is that |
OK, I'm trying to fix the root issue by moving the logic for template parts to the block implementation. |
@@ -144,7 +145,7 @@ export function getBlockLabel( blockType, attributes, context = 'visual' ) { | |||
// Attempt to find entity title if block is a template part. | |||
// Require slug to request, otherwise entity is uncreated and will throw 404. | |||
if ( 'core/template-part' === blockType.name && attributes.slug ) { | |||
const entity = select( 'core' ).getEntityRecord( | |||
const entity = select( coreStore ).getEntityRecord( |
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.
Yep, this should definitely be moved to the block itself :) I think we have a function for that right?
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.
Yes, I'm on it. I found the PR where it was introduced: #28330. It only confirms that it should be moved.
Replaced with #28828. Let's continue there, thanks @david-szabo97 for raising this issue 💯 |
Description
Related to #27088
Replace hardcoded store names with their store object.
How has this been tested?
Make sure tests are passing. Smoke test.
Types of changes
Code Quality
Checklist: