Opened 7 months ago
Last modified 7 weeks ago
#61728 new defect (bug)
Stabilize experimental block supports including typography, border, and common flags
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | trunk |
Component: | Editor | Keywords: | has-patch |
Focuses: | Cc: |
Description (last modified by )
Stabilize the experimental block support keys.
The only current block support requiring stabilization is border support, its mapping to a stable key is: __experimentalBorder
→ border
.
Typography support has several experimental features that will be mapped to stable keys as follows:
__experimentalFontFamily
→fontFamily
__experimentalTextDecoration
→textDecoration
__experimentalFontStyle
→fontStyle
__experimentalFontWeight
→fontWeight
__experimentalLetterSpacing
→letterSpacing
__experimentalTextTransform
→textTransform
There are also a couple of shared experimental support flags common across block supports. They will be mapped to stable keys as follows:
__experimentalSkipSerialization
→skipSerialization
__experimentalDefaultControls
→defaultControls
This work is being tracked in the Gutenberg repo in:
- https://github.com/WordPress/gutenberg/issues/63001
- https://github.com/WordPress/gutenberg/issues/64312
These updates will require syncing code from Gutenberg however, a slightly different implementation in core will be required to avoid the need for filters to apply the transformation of experimental to stable properties.
The overall goal is to stabilize the experimental block support features. They have been in use for multiple releases, are ready for wider documentation, and are unlikely to change.
This issue will track the backporting of changes from the following Gutenberg PRs:
Typography Stabilization: https://github.com/WordPress/gutenberg/pull/63401
Border Stabilization: https://github.com/WordPress/gutenberg/pull/66918
Common Flag Stabilization: https://github.com/WordPress/gutenberg/pull/67018
Change History (15)
This ticket was mentioned in PR #7069 on WordPress/wordpress-develop by @andrewserong.
7 months ago
#1
- Keywords has-patch added
@andrewserong commented on PR #7069:
7 months ago
#2
Based on discussion over in https://github.com/WordPress/gutenberg/pull/63401#issuecomment-2249588880, I've updated this to move the stabilization to _after_ the filter is run. This ensures that any opt-outs, etc, performed by plugins are appropriately stabilized before the props are set.
I've also moved the logic into a private method so that set_props
is easier to read.
#3
@
5 months ago
- Description modified (diff)
- Milestone changed from 6.7 to Future Release
Just updating the milestone and description for this one as this change has been punted to WP 6.8.
@aaronrobertshaw commented on PR #7069:
3 months ago
#4
The latest plan is to backport all the block support stabilization updates in a single PR. This will include stabilizing border block supports and shared experimental flags such as __experimentalDefaultControls
and __experimentalSkipSerialization
.
More details can be found in https://github.com/WordPress/gutenberg/pull/66918#issuecomment-2472374805.
In the near future, I'll pick up this backport and update it accordingly, while @andrewserong is away.
#5
@
2 months ago
- Description modified (diff)
- Milestone changed from Future Release to 6.8
- Summary changed from Stabilize experimental Typography block support keys to Stabilize experimental block supports including typography, border, and common flags
- Version changed from 6.7 to trunk
@aaronrobertshaw commented on PR #7069:
2 months ago
#6
I've pushed some updates to this PR bringing in the broader stabilization of other block supports e.g. __experimentalBorder
, __experimentalSkipSerialization
etc.
The trac ticket and PR description have been updated with the latest info.
@ramonopoly commented on PR #7069:
2 months ago
#7
So far I've tested this PR against https://github.com/WordPress/gutenberg/pull/63401 (Typography)
✅ Typography controls work as expected with and without __experimental*
✅ Everything renders correctly in the site editor and frontend
✅ Disabling supports, e.g., __experimentalFontFamily
disables controls in the UI
@ramonopoly commented on PR #7069:
2 months ago
#8
@aaronrobertshaw commented on PR #7069:
2 months ago
#9
Thanks for testing @ramonjd and apologies for the confusion. I should have updated the test instructions on this PR further.
I'm not sure what I should be seeing in the editor. I understand the packages eventually need to be updated, but I expected no regressions in the UI.
The TL;DR is we need the JS package updates.
I've added the longer version to the PR test instructions but the PHP changes here stabilize the block supports in the block type. My understanding is the stabilized block type data is passed to the editor but the JS block support hooks etc will still be checking the __experimental
prefixed block support keys. They don't exist after stabilization hence the "missing" UI elements as the editor believes the blocks don't have support.
How have you been testing this @aaronrobertshaw ?
I'd primarily tested using the unit tests and by creating blocks with global and block support styles applied on trunk, then switching to this branch and checking they were still applied correctly on the frontend. I'm definitely open to better testing approaches but my brain broke trying to come up with one.
The PR test instructions have been updated to something more useful. I'll re-test it all myself tomorrow as I'm out of time this evening.
@ramonopoly commented on PR #7069:
2 months ago
#10
To test I used the Gutenberg plugin, but disabled the gutenberg_stabilize_experimental_block_supports
hook and prevented Gutenberg from registering typography and border block supports.
So far, with the exception of border, the support and common flags appear stable and work as expected.
I'll do another test tomorrow.
@ramonopoly commented on PR #7069:
2 months ago
#11
Thanks for pulling across https://github.com/WordPress/gutenberg/pull/67552!!
This is testing well for me in all scenarios so far.
✅ typgography.__experimental*
and their stable counterparts work as expected
✅ __experimentalBorder
and border
the same
✅ blocks with skipSerialization
e.g., image, appear as expected
✅ changes to __experimentalDefaultControls
and defaultControls
have effect in the UI
@aaronrobertshaw commented on PR #7069:
2 months ago
#12
Quick update:
There's an alternate approach being explored as part of https://github.com/WordPress/gutenberg/pull/67729. I'll hold off on committing this PR until that plays out.
@aaronrobertshaw commented on PR #7069:
7 weeks ago
#13
It's on the cards that the approach within this PR might be reverted in Gutenberg (see https://github.com/WordPress/gutenberg/pull/68163) and the stabilization of block supports punted for 6.8.
#14
@
7 weeks ago
- Description modified (diff)
- Milestone changed from 6.8 to Awaiting Review
Punting this for 6.9/TBD
@ramonopoly commented on PR #7069:
7 weeks ago
#15
Closing this PR for now as the Gutenberg code has been reverted.
See https://github.com/WordPress/gutenberg/pull/67729#issuecomment-2553200639 for context behind the decision to revert.
Trac ticket: https://core.trac.wordpress.org/ticket/61728
🚧 🚧 🚧 WIP: This is currently a work in progress and is not yet ready for review 🚧 🚧 🚧
This PR syncs some of the changes from https://github.com/WordPress/gutenberg/pull/63401, however uses a slightly different approach for applying the transformations so that we do not depend on filters.
More details TBC as this PR is still a work in progress.