Breaking: #96263 - Remove jQuery promise support for AJAX requests¶
See forge#96263
Description¶
With forge#89738, a polyfill for jQuery promises was introduced to ease the
migration of $.ajax()
to our AJAX request API.
The polyfilled methods done()
and fail()
are now removed.
Impact¶
Relying on the existence of the polyfill will trigger JavaScript errors.
Affected Installations¶
All extensions using the polyfilled methods are affected.
Migration¶
For success handling, replace done()
with then()
.
Example:
// Polyfill
new AjaxRequest('/foobar/baz').get().done(function(response) {
// do stuff
});
// Native
new AjaxRequest('/foobar/baz').get().then(async function(response) {
// do stuff
});
For error handling, replace fail()
with catch()
.
Example:
// Polyfill
new AjaxRequest('/foobar/baz').get().fail(function() {
// oh noes
});
// Native
new AjaxRequest('/foobar/baz').get().catch(function() {
// oh noes
});