-
Notifications
You must be signed in to change notification settings - Fork 1.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
[Gutenberg] Enable reusable block only in WP.com sites #14623
Conversation
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
The installable build is failing because it requires this PR to be merged first. |
# Conflicts: # build.gradle
You can test the changes on this Pull Request by downloading the APK here. |
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.
Hi @fluiddot thanks for these changes. I tested on WP.com sites ( including atomic) and the reusable block behavior worked as expected. While testing on self hosted sites, I can see that the block is unsupported. However, I got undefined for the block's name. Let me know if you are able to reproduce. I utilized the APK here for testing.
Thank you very much @jd-alexander for reviewing it ❤️ ! Regarding the unsupported block issue, there’s already an opened issue related to this. In fact, I have a PR with the fix but it’s blocked due to other translation problems. |
Ah, I didn't notice it. Thanks for the sharing @fluiddot . So it a case where we will wait until that PR is ready before merging this? |
The issue is happening for all unsupported blocks so it’s not necessarily blocking this PR. Anyways, as the fix has to land in the current release 1.53.0 (it will be included as a beta fix) because it’s a major issue, it will most likely be merged before this one 😄 . |
Understood! In that case, I will give approval to these PRs. |
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.
Approved via WordPress/gutenberg#31744 (review)
I created the Gutenberg Mobile tag |
I did a quick test with the last installable build and the editor crashes upon opening 😨 , I'm going to hold the merge of this PR until I find the cause. |
I made a build locally (using local GB-mobile, not the binary) and it's not happening so I'm wondering if it has to do with the RN binaries 🤔 . |
I'll try to generate new RN binaries once the CircleCI outage ends and test again. |
Just wanted to mark this PR as needing review since I also saw the crash when opening the editor from the Peril APK build. Didnt want someone to accidentally merge. Thanks!
After testing further, I noticed that the crash was introduced in a previous commit on GB-mobile |
@jd-alexander @cameronvoell Looks like the crash is not caused by this PR so I think we could merge this PR and fix the crash on a new PR, wdyt? |
The crash will be fixed after merging this PR 🎊 . |
# Conflicts: # build.gradle
The ref was accidentally changed when resolving conflicts with develop branch.
@@ -7,7 +7,7 @@ buildscript { | |||
ext.kotlin_ktx_version = '1.2.0' | |||
ext.wordPressUtilsVersion = '1.40.0' | |||
ext.detektVersion = '1.15.0' | |||
ext.gutenbergMobileVersion = 'v1.53.1' | |||
ext.gutenbergMobileVersion = 'develop-c55652b5fabf0e4edd08b79da4b78418aa886410' |
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.
This reference is pointing to the commit that introduced the fix for the Android crash referenced in this comment.
I've tested the last installable build and the crash is no longer happening 🎊 . @jd-alexander @cameronvoell the PR is ready to review and merge, let me know if I can help with anything else 🙇 . |
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.
@antonis just reviewed and approved the PR so I'm going to merge it, let me know @jd-alexander and @cameronvoell if you have any concerns regarding this, thank you all for the help provided in this PR 🙇 ! |
gutenberg-mobile
PR: wordpress-mobile/gutenberg-mobile#3490guteberg
PR: WordPress/gutenberg#31744WordPress-iOS
PR: wordpress-mobile/WordPress-iOS#16475Depends on: #14529
This PR enables the reusable block and adds a capability into the editor to limit the availability of this type of block to only WP.com sites.
Why reusable block is disabled in self-hosted sites
Related issue: wordpress-mobile/gutenberg-mobile#3457
The main reason for disabling this block in self-hosted sites is related to the case of having a reusable block that contains a self-reference (a reference to the same reusable block). While in WP.com sites this is working properly, in self-hosted sites, fetching data from the endpoint that holds the data for reusable blocks (
/wp-json/wp/v2/blocks
) in this case, the site returns a bad response so we don't have data for displaying them.NOTE: This is reproducible on self-hosted sites with and without Jetpack, although the error response is different.
Regression Notes
The Reusable block has been enabled so it could affect those posts/pages that contain this type of block.
General testing
The following tests have been performed to assure that the editor works as expected:
Present block content (preview mode)
PR: WordPress/gutenberg#25265
This was tested in the following 3 different scenarios:
WordPress.com site
Create a WordPress.com site or use an already created one.
Self-hosted site with Jetpack
Create a self-hosted site with Jetpack (I used https://jurassic.ninja/create/) or use an already created one.
Self-hosted site without Jetpack
Create a self-hosted site without Jetpack (I created a local one using this instructions) or use your own.
Additional improvements for rendering Reusable block
PR: WordPress/gutenberg#30966
NOTE: Reusable blocks can be managed by navigating to the "Reusable blocks page":
https://wordpress.com/types/wp_block/<YOUR_WPCOM_SITE_DOMAIN>
https://<YOUR_SELF_HOSTED_SITE_DOMAIN>/wp-admin/edit.php?post_type=wp_block
Here are the steps for creating reusable blocks in the web version:
Option 1:
Option 2:
Preview content
Deleted reusable block
Recursive block rendering
Add convert to regular blocks action to Reusable block
PR: WordPress/gutenberg#31012
Undo/redo
It's important that we verify that the undo/redo actions work as expected when converting to regular blocks.
Verify that the reusable block is only available in WP.com sites
WordPress.com site - Reusable block is enabled
Create a WordPress.com site or use an already created one.
WordPress.com site (Atomic) - Reusable block is enabled
Create an Atomic site via WordPress.com site or use an already created one.
Self-hosted site with Jetpack - Reusable block is disabled
Create a self-hosted site with Jetpack (I used https://jurassic.ninja/create/) or use an already created one.
Self-hosted site without Jetpack - Reusable block is disabled
Create a self-hosted site without Jetpack (I created a local one using this instructions) or use your own.
No automated tests have been added but I plan to add them in the future.
PR submission checklist:
RELEASE-NOTES.txt
if necessary.