-
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
Inspector Controls: Stabilize the experimental control groups #47105
Inspector Controls: Stabilize the experimental control groups #47105
Conversation
Size Change: +48 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
Flaky tests detected in 8b5d693. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4003564357
|
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.
It would be a good idea to make this change backward compatible. Custom blocks are probably using __experimentalGroup
at least for advanced controls.
Here's a quick directory search: https://wpdirectory.net/search/01GPJHG378MPCAKYVJPK1AY3JF
Definitely. I'll finish off working on this tomorrow. |
36a63c0
to
3d6a919
Compare
@aaronrobertshaw and @Mamaduka just want to confirm inspector control tabs are intended for inclusion in 6.2? If so, I am going to add this to the 6.2 project board for consideration because I think this PR is likely a prerequisite for the tabs being included. |
@ndiego That's the plan. The block inspector tabs are required for the off-canvas editor for the navigation block, so this will be needed as well. I'm out of the office until Monday but it's top of my list to push along then. |
3d6a919
to
f2186d5
Compare
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.
LGTM, only left a minor comment about the deprecation message.
I'm not sure what tests are in place for this feature currently, but it might be good to add some (maybe in another PR), especially for the new 'styles' slot which is unused in core. Usually for that it would involve e2e tests that make use of test plugins. The plugin could provide a custom block implementation that uses all the inspector control groups.
@aaronrobertshaw this looks great! We can get this in 15.1, right? cc @bph @femkreations regarding documentation. This is a pretty big change that block plugin developers will need to account for in prepping their plugins for 6.2. |
Thanks for the the ping, @ndiego - I added the "needs dev note" label to surface this for the release documentation. |
1e35a1f
to
a36fbf0
Compare
Agreed, these changes need a dev note. Should it be on its own or part of a wider "stabilized APIs" dev note? If grouped with other stabilized APIs, a section detailing this PR's changes could be: __experimentalGroupThe In addition to stabilizing the <InspectorControls group="styles">
// Add your custom styles related controls here.
</InspectorControls> |
My feeling is that the dev note might be best as part of the one for the block settings tabs, as the features are so closely related. |
Noting for developers that I already created an issue around sharing this explicitly on the developer blog: WordPress/developer-blog-content#57 |
'`__experimentalGroup` property in `InspectorControlsFill`', | ||
{ | ||
since: '6.2', | ||
version: '6.4', |
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.
Should we follow-up on these deprecations as we've reached the target version.
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.
PR is up removing the deprecations and old experimental prop here: #56023
Related:
What?
__experimentalGroup
prop for the inspector control slot fills.styles
inspector controls groupdefault
group assettings
Why?
With the stabilization of the Block Inspector tabs, which paves the way for the off-canvas navigation editor, it makes sense to stabilize the inspector control groups. Without this, we'll end up with a situation where plugins use the experimental API more because of the lack of a stable API.
How?
__experimental
prefix from the Inspector Control SlotFills' group propsstyles
inspector controls group slot and adds it to the styles block inspector tabdefault
group assettings
. Allows block to explicitly assign a control tosettings
which would render where thedefault
group does now.Testing Instructions
Check there are no further references to
__experimentalGroup
Edit a post containing various blocks, select each of them ensuring the appropriate panels display within the Block Inspector tabs
Override the display of Block Inspector tabs and confirm appropriate group slots still render correctly
Click for quick and dirty patch to update block editor setting to test disabling tab display across blocks
Check blocks that cover each of the block supports below and ensure their controls still render
Check the controls for the following blocks appear
Check the advanced controls are correct for Template Part
Test adding a control to a block via the
styles
group. Ensure adding such a control causes the styles tab to display if a block would otherwise not show the tab.Test assigning a control to the
settings
group and ensure it still gets rendered into the Settings tab.Example diff adding a control via styles and settings groups