Why does AUI change the default jquery $.ajax calls to use traditional: true?

I noticed that aui.js is setting traditional to true for the default jquery ajax setup. Here’s the code from the file:

// Setting Traditional to handle our default param serialisation.
// See http://api.jquery.com/jQuery.param/ for more information.
_jquery2.default.ajaxSettings.traditional = true;

Doing this breaks other calls to ajax that require traditional to be false.

It doesn’t seem right that a library like aui should change the default ajax settings. Can this be changed to have internal aui ajax manually set traditional = true, or have aui use a noConflict instance of jquery rather than forcing this change on everything?

As a workaround, after aui.js is loaded, I’ve inserted this script to flip the setting back to normal so that the other ajax calls in our app continue to function normally without being impacted by the aui change:

        traditional: false

Does anyone know how to request such a change to the aui team?

Hi @ScottMitchell,

The AUI team agrees with you that this shouldn’t be part of what AUI does.

Sadly, this configuration option was a relic of history. As best I could figure, it made its way in to AUI in ~2009, and was there to make AJAX calls in atlassian-gadgets work, as well as Jira’s REST framework. Unfortunately, that also means most every AJAX call in Atlassian products has been using the traditional mode for quite some time.

The AUI team is aware that if or when products start to update their jQuery versions to 2+ or 3+, that config option would not work. They are also aware, though, that changing the option would cause some AJAX calls in those products to break. As such, it is considered a breaking change, so the earliest they can remove it is in a major version.

Update: a previous version of my comment suggested the config was removed in AUI 8.0, but it is still there. There was discussion about removing it, but it stayed in AUI for the 8.0 release: https://ecosystem.atlassian.net/browse/AUI-4592

I’ve re-opened the issue above track the removal in the next major version.

Hope that helps.