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

WP 6.3 Compatibility: Fix the errors of "setImmediate is not defined" #2039

Merged
merged 3 commits into from
Aug 4, 2023

Conversation

eason9487
Copy link
Member

@eason9487 eason9487 commented Aug 3, 2023

Changes proposed in this Pull Request:

Closes #2040

WordPress 6.3 will remove setImmediate, so the following errors were found while testing with WP 6.3-rc3.

image

Ref:

To fix it, this PR:

  • Replace the deprecated setImmediate with setTimeout.
  • Added test cases about compatibility to AdaptiveForm component.

Screenshots:

Kapture.2023-08-03.at.16.37.51.mp4

Detailed test instructions:

WP 6.3 is not yet released. One of the ways to test this PR with a RC version is using WP-CLI:

wp core update --version=6.3-RC3

AdaptiveForm

  1. Go to the onboarding flow or the Edit Free Listings page.
  2. On the shipping section, select some audience countries and set up shipping config.
  3. Remove one of the audience countries.
  4. Check if the shipping config of the removed country is removed as well.

useCroppedImageSelector

Refer to the test instructions in #1906.

Changelog entry

Fix - WordPress 6.3 compatibility: The forms and image selector may not work due to "setImmediate" deprecation.

@eason9487 eason9487 requested a review from a team August 3, 2023 09:28
@eason9487 eason9487 self-assigned this Aug 3, 2023
@github-actions github-actions bot added changelog: fix Took care of something that wasn't working. type: bug The issue is a confirmed bug. labels Aug 3, 2023
@eason9487 eason9487 added the priority: critical The issue is critical—e.g. a fatal error, security problem affecting many customers. label Aug 3, 2023
Copy link
Contributor

@martynmjones martynmjones left a comment

Choose a reason for hiding this comment

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

Hey @eason9487, thanks for the quick fix 🙌

Tested locally and confirmed that:

  • Error is no longer triggered during onboarding
  • Image crop selection is working correctly
  • No references left to setImmediate in the code
  • Tests are passing

So LGTM ✅

@eason9487 eason9487 merged commit 0dffc53 into develop Aug 4, 2023
4 checks passed
@eason9487 eason9487 deleted the fix/wp-6-3-compatibility branch August 4, 2023 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: fix Took care of something that wasn't working. priority: critical The issue is critical—e.g. a fatal error, security problem affecting many customers. type: bug The issue is a confirmed bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

setImmediate polyfill removed from WordPress 6.3 causing error
2 participants