Ajax: Support an alternative completeCallback API for transports #4634
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Apart from the existing API:
a new API is now available:
This makes it possible to add new parameters in the future without relying on
their order among parameters and being able to provide them selectively.
Ref gh-4405
+37 bytes. Not changing existing transports would make that smaller but we'll need to change the XHR one anyway to land #4405 and then the build gets smaller if we update it in all the places I modified in the PR.
Note: This still needs tests. That said, we don't have any direct tests for
jQuery.ajaxTransport
, its only implicitly tested by the virtue of two core transports using this API. Therefore, before landing this I'd like to write a few tests for the API first. I'm opening this draft PR now to gain feedback whether this is a direction in which we'd like to go.Checklist