diff --git a/changelog.txt b/changelog.txt index b957b5a935..c2651030a6 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,12 @@ *** WooCommerce Google Listings and Ads Changelog *** += 2.5.2 - 2023-08-08 = +* Fix - Remove `add_woocommerce_extended_task_list_item` and `remove_woocommerce_extended_task_list_item` hooks. +* Fix - WordPress 6.3 compatibility: The forms and image selector may not work due to "setImmediate" deprecation. +* Tweak - Use the latest API to add an item to the WC tasks list. +* Tweak - WC 8.0 compatibility. +* Tweak - WP 6.3 compatibility. + = 2.5.1 - 2023-08-01 = * Dev - Setup wp-env for E2E tests. * Dev - automate merging trunk to develop after a release. diff --git a/google-listings-and-ads.php b/google-listings-and-ads.php index 5ea08fc894..8dd3d58d06 100644 --- a/google-listings-and-ads.php +++ b/google-listings-and-ads.php @@ -3,17 +3,17 @@ * Plugin Name: Google Listings and Ads * Plugin URL: https://wordpress.org/plugins/google-listings-and-ads/ * Description: Native integration with Google that allows merchants to easily display their products across Google’s network. - * Version: 2.5.1 + * Version: 2.5.2 * Author: WooCommerce * Author URI: https://woocommerce.com/ * Text Domain: google-listings-and-ads * Requires at least: 5.9 - * Tested up to: 6.2 + * Tested up to: 6.3 * Requires PHP: 7.4 * Requires PHP Architecture: 64 bits * * WC requires at least: 6.9 - * WC tested up to: 7.9 + * WC tested up to: 8.0 * Woo: * * @package WooCommerce\Admin @@ -30,7 +30,7 @@ defined( 'ABSPATH' ) || exit; -define( 'WC_GLA_VERSION', '2.5.1' ); // WRCS: DEFINED_VERSION. +define( 'WC_GLA_VERSION', '2.5.2' ); // WRCS: DEFINED_VERSION. define( 'WC_GLA_MIN_PHP_VER', '7.4' ); define( 'WC_GLA_MIN_WC_VER', '6.9' ); diff --git a/js/src/components/adaptive-form/adaptive-form.js b/js/src/components/adaptive-form/adaptive-form.js index 7e72248acc..9194fd43af 100644 --- a/js/src/components/adaptive-form/adaptive-form.js +++ b/js/src/components/adaptive-form/adaptive-form.js @@ -196,12 +196,12 @@ function AdaptiveForm( { onSubmit, extendAdapter, children, ...props }, ref ) { // Related to WC 6.9. Only one delegate can be consumed at a time in this render prop to // ensure the updating states will always be the latest when calling. if ( batchQueue.length ) { - // Use `setImmediate` to avoid the warning of request state updates while rendering. + // Use `setTimeout` to avoid the warning of request state updates while rendering. // Mutating a React hook state is an anti-pattern in most cases. Here is done intentionally // because it's necessary to ensure this component will be triggered re-rendering through // `setBatchQueue`, but also to avoid calling `setBatchQueue` here and triggering additional // rendering again. - setImmediate( () => setDelegation( batchQueue.shift() ) ); + setTimeout( () => setDelegation( batchQueue.shift() ) ); } /* === Start of enhancement-related codes === */ diff --git a/js/src/components/adaptive-form/adaptive-form.test.js b/js/src/components/adaptive-form/adaptive-form.test.js index 3b343535c6..7c2b9a1eea 100644 --- a/js/src/components/adaptive-form/adaptive-form.test.js +++ b/js/src/components/adaptive-form/adaptive-form.test.js @@ -196,4 +196,113 @@ describe( 'AdaptiveForm', () => { expect( inspect ).toHaveBeenLastCalledWith( false, 0 ); } ); + + describe( 'Compatibility patches', () => { + it( 'Should update all changes to values for the synchronous multiple calls to `setValue`', async () => { + render( + + { ( { setValue, values } ) => { + return ( + <> +