-
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
[core/block-editor] Breaking Change introduced in getSettings (styles property removed) #32966
Comments
@youknowriad @aristath — looks like this is from #30034. |
you can access that property by doing |
I believe you're correct if not on WP 5.7, but that store appears to be effected by this as well; Even then, it should be added back to
Appologies, the link shared pointed to the wrong timeline with PR that removed it. Following https://github.com/WordPress/gutenberg/blame/33244eef0b7dfcda73883cb9225293aa7525616d/packages/edit-post/src/editor.js#L123 should lead you to the correct commit that began removing 'styles' for getSettings #27947.
While the commit that removed it is older than the initial commit linked, it's not by much, and appears to still point to it being introduced in the lastest release of WP (5.7.x) |
👍 Thanks for the exploration, that commit looks right yes. I think the |
I'm curious why you feel it shouldn't belong there even if it's not always used; It could return as an empty array if not used for that instance? I'm curious of this because if it's deprecated in gutenberg/packages/edit-post/src/index.js Line 26 in ee69822
|
Gutenberg is a module architecture, each package has a defined purpose:
|
Thanks for additional context; And glad to see this being looked at as larger than WP. So it seems like it would be more beneficial to adjust the Type Defs for EditorSettings and have the WP side of Gutenberg extend that, adding styles as a prop. Then potentially move |
Nice to meet you. The reason is that the styles property has been removed in Is this state in Custom HTML Block correct? I considered submitting a pull request myself, but I apologize that I couldn't find a function to get styles. |
I confirmed that the styles were returned in #28165. |
@t-hamano I am facing the same issue as you described and my styles are not passing from https://github.com/WordPress/gutenberg/blob/wp/5.8/packages/block-library/src/html/edit.js#L39 Could you please explain how is this solved? |
Update: This is fixed with WP 5.9 |
Description
It appears that styles was removed from the
core/block-editor
settings, however, there was no deprecation warning or documentation update (docs and type definitions still state that settings should exist).Line of code that appears to remove it. https://github.com/WordPress/gutenberg/blame/4834fad30e39e47d71a93e2e08d31b3b856711e1/packages/edit-post/src/editor.js#L112
Expected behaviour
When using
useSelect()
to selectcore/block-editor
and retrieve styles fromgetSettings()
enqueued styles should be there or an empty Array.Actual behaviour
When using
useSelect()
to selectcore/block-editor
thestyles
property has been completely removed.Code snippet (optional)
WordPress information
Device information
The text was updated successfully, but these errors were encountered: