-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Earn: do not register premium content blocks when gutenberg features are not available #44191
Conversation
{ /* eslint-disable-next-line wpcalypso/jsx-classname-namespace */ } | ||
<Block.div className="wp-block-button"> | ||
<RichText | ||
placeholder={ __( 'Add text…', 'full-site-editing' ) } |
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.
ℹ️ String reuse speeds up translation and improves consistency. The following string might make a good alternative and has already been translated 103 times:
translate( 'Add text…' )
ES Score: 9
Caution: This PR affects files in the FSE Plugin on WordPress.com D46452-code has been created so you can easily test it on your sandbox. See this FieldGuide page about developing in the FSE Plugin for more info: PCYsg-ly5-p2 |
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
So latest WP 5.4.2 has a mix of Gutenberg plugin versions of 6.6-7.5 https://developer.wordpress.org/block-editor/principles/versions-in-wordpress/ so I'm pretty sure provides context isn't available, meaning that decoupled buttons won't work. I believe this originally landed in WordPress/gutenberg#21467 (landed in 8.0) Chatting through some options with Kirk, when we detect that we don't have our required features available:
|
…tures are not available
54df03c
to
ffe1b0f
Compare
Unrelated E2E failure for Gutenberg media upload looks like it's timing out on multiple branch runs. Manual testing looks okay so likely that test needs tuning. |
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 followed the instructions to test on Atomic ephemeral and this worked as described. I used Gutenberg 8.5.1 for my testing.
Thanks!
const supportsDecoupledBlocks = !! ( | ||
__experimentalAlignmentHookSettingsProvider && __experimentalBlock | ||
); |
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.
Thanks, I was starting to investigate experimental feature usage (#44251), I can tick these off.
Thanks for the review @sirreal! I'll go ahead and land this to unblock the next FSE release |
Fixes #44160 this PR simply opts to not register the premium content block when our desired gutenberg features are not available.
Previously in #42715 we added the ability to decouple the premium content buttons from the container block. This depended on the provides context block feature that landed in Gutenberg plugin ~8.0. Latest WP 5.4.2 has a mix of Gutenberg plugin versions of 6.6-7.5 https://developer.wordpress.org/block-editor/principles/versions-in-wordpress meaning that a fallback approach isn't viable in this case (we'd have to guess the passed planId).
Testing Instructions
FSE plugin / Build FSE plugin (pull_request)
In this PR's GH workflow