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

Make GCB compatible with 6.5 #178

Merged
merged 31 commits into from
Mar 13, 2024
Merged

Make GCB compatible with 6.5 #178

merged 31 commits into from
Mar 13, 2024

Conversation

kienstra
Copy link
Contributor

@kienstra kienstra commented Mar 12, 2024

Changes

  • Fixes GCB so it's compatible with 6.5. We'll need to release this before 6.5.
  • Makes 'Tested up to' 6.5

Testing instructions

Not needed

* @param {Object} post Post object.
*/
const setupEditor = ( post ) => {
setupEditorState( post );
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file is a big wrapper for setupEditorState.

It's not needed anymore.

@kienstra kienstra changed the title Make 'Tested up to' 6.5 Make GCB compatible with 6.5 Mar 13, 2024
@kienstra
Copy link
Contributor Author

kienstra commented Mar 13, 2024

How to test GCB for the next WP version

If you're wondering how we test this plugin for WP releases…

We just bump the version in the PHPUnit tests and e2e tests.

For example, with WP 6.5:

diff --git a/.circleci/config.yml b/.circleci/config.yml
index 6faa3d89..02eb5165 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -86,7 +86,7 @@ jobs:
       - run:
           name: Installing WordPress and setting up tests
           command: |
-            git clone git://develop.git.wordpress.org/ wordpress-develop
+            git clone -b 6.5 git://develop.git.wordpress.org/ wordpress-develop
             cp wordpress-develop/wp-tests-config-sample.php wordpress-develop/wp-tests-config.php
             sed -i 's/localhost/127.0.0.1/g' wordpress-develop/wp-tests-config.php
             sed -i 's/yourpasswordhere/<insert password here>/g' wordpress-develop/wp-tests-config.php
diff --git a/.wp-env.json b/.wp-env.json
index b00b8969..04e74fa4 100644
--- a/.wp-env.json
+++ b/.wp-env.json
@@ -1,5 +1,5 @@
 {
-       "core": null,
+       "core": "WordPress/WordPress#6.5-branch",
        "plugins": [ ".", "./tests/e2e/plugins/testing-blocks" ],
        "phpVersion": "8.3"
 }

…then we see if the tests pass.

Then, we'll revert that change, and merge the PR, like this PR.

These tests are complete enough that once they pass, you'll know GCB is compatible with the next WP version.

There's no need for manual testing.

setupEditor( post );

if ( setEditedPost ) {
setEditedPost( post.type, post.id );
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixes a console error in WP 6.5:

wp.data.dispatch( 'core/editor' ).setupEditorState is deprecated since version 6.5. Please use wp.data.dispatch( 'core/editor' ).setEditedPost instead.

@kienstra
Copy link
Contributor Author

Thanks so much for approving this, @dreamwhisper!

@kienstra kienstra merged commit 8fb1877 into develop Mar 13, 2024
13 checks passed
@kienstra kienstra deleted the bump/tested-up-to-6.5 branch March 13, 2024 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants