Skip to content
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

Add __experimentalEnableQuoteBlockV2 flag #40089

Merged
merged 4 commits into from
Apr 7, 2022

Conversation

oandregal
Copy link
Member

@oandregal oandregal commented Apr 6, 2022

What?

This PR adds a mechanism for mobile to know when the site supports the Quote v2 (inner blocks).

Why?

Mobile needs to know when to load the v1 and the v2 of the quote block.

How?

By adding a __experimentalEnableQuoteBlockV2 flag to the block editor settings endpoint. It's set to false and it'll be set to true by #25892 (see context)

How to test

  • Comment lines 22 and 23 here so the code runs for any request, and not only for a 'mobile' request.
  • Go to "Gutenberg > Experiments" and enable the quote v2 experiment.
  • Load the post editor, open the devtools, and execute wp.apiFetch({path: '/wp-block-editor/v1/settings/', method: 'GET'}). The expected result is that the flag __experimentalEnableQuoteBlockV2 is present and is true.
  • Go to "Gutenberg > Experiments" and disable the quote v2 experiment.
  • Load the post editor, open the devtools, and execute wp.apiFetch({path: '/wp-block-editor/v1/settings/', method: 'GET'}). The expected result is that the flag __experimentalEnableQuoteBlockV2 is present and is false.

@oandregal oandregal self-assigned this Apr 6, 2022
@oandregal oandregal added the [Block] Quote Affects the Quote Block label Apr 6, 2022
@oandregal oandregal added the Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) label Apr 6, 2022
@oandregal oandregal force-pushed the add/quote-v2-block-editor-settings branch from c8d08ff to bb11909 Compare April 6, 2022 15:16
Copy link
Member

@geriux geriux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I tested this locally and it returns the expected data.

@oandregal oandregal merged commit 36fcdb2 into trunk Apr 7, 2022
@oandregal oandregal deleted the add/quote-v2-block-editor-settings branch April 7, 2022 10:16
@github-actions github-actions bot added this to the Gutenberg 13.0 milestone Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Quote Affects the Quote Block Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants