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

Update deprecated jQuery methods (Backport #4625 to v3.2) #4674

Merged
merged 3 commits into from
Oct 14, 2022

Conversation

elia
Copy link
Member

@elia elia commented Oct 13, 2022

Summary

Backport #4625 to v3.2 in order to solve JS errors in the backend.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

  • I have written a thorough PR description.
  • I have kept my commits small and atomic.
  • I have used clear, explanatory commit messages.

The following are not always needed (cross them out if they are not):

  • I have added automated tests to cover my changes.
  • I have attached screenshots to demo visual changes.
  • I have opened a PR to update the guides.
  • I have updated the readme to account for my changes.

From the jQuery upgrade guide:

The jqXHR object returned from jQuery.ajax() is a jQuery Deferred and
has historically had three extra methods with names matching the
arguments object of success, error, and complete. This often confused
people who did not realize that the returned object should be treated
like a Deferred. As of jQuery 3.0 these methods have been removed.
As replacements, use the Deferred standard methods of done, fail,
and always, or use the new then and catch methods for Promises/A+
compliance.

Note that this does not have any impact at all on the ajax callbacks
of the same name passed through the options object, which continue to
exist and are not deprecated. This only affects the jqXHR methods.
Specs did not catch the deprecated method "error" because there were
not any tests that checked for an AJAX error. Added steps to a current
current test to ensure an AJAX call fails to cover the method "fail"
and "then" incase those methods might be deprecated in the future
@elia elia marked this pull request as ready for review October 13, 2022 17:15
Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

Thanks Elia!

@kennyadsl kennyadsl merged commit 2d695fb into solidusio:v3.2 Oct 14, 2022
@kennyadsl kennyadsl deleted the elia/backport-4625 branch October 14, 2022 10:27
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.

None yet

4 participants