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

Ajax: Support an alternative completeCallback API for transports #4634

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mgol
Copy link
Member

@mgol mgol commented Mar 1, 2020

Summary

Apart from the existing API:

function( status, statusText, responses, headers ) {}

a new API is now available:

function( { status, statusText, responses, headers } ) {}

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

@mgol mgol self-assigned this Mar 1, 2020
@mgol mgol mentioned this pull request Mar 1, 2020
4 tasks
@mgol mgol added Discuss in Meeting Reserved for Issues and PRs that anyone would like to discuss in the weekly meeting. and removed Discuss in Meeting Reserved for Issues and PRs that anyone would like to discuss in the weekly meeting. Needs review labels Mar 2, 2020
Base automatically changed from master to main February 1, 2021 22:02
@mgol
Copy link
Member Author

mgol commented Sep 17, 2021

Closing & re-opening the PR to trigger the EasyCLA check...

Apart from the existing API:

```js
function( status, statusText, responses, headers ) {}
```
a new API is now available:
```js
function( { status, statusText, responses, headers } ) {}
```

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 jquerygh-4405
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

1 participant