Skip to content

Breaking: Remove support for "Node-style" error-first callbacks #428

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

Merged
merged 5 commits into from
Jul 3, 2019

Conversation

kadamwhite
Copy link
Collaborator

Our original HTTP transport superagent does not use Promises by default, so all versions of this library to date have supported Node-style error-first callbacks, e.g. .get( ( err, data ) => { if ( err ) {} ... } ). However, Promises are the preferred and recommended way of using this library, and the vast majority of library consumers do not utilize the callback method signature.

While evaluating additional transport providers, particularly fetch, it became obvious that continuing to support callback-style asynchronous methods would be cumbersome with Promise-aware, modern transport methods like fetch or libraries like axios. As part of the slimming-down of our API for Version 2, this PR removes support for the node-style callback signature on all transport methods.

Maintaining this node-style interface, which support threads indicate is
rarely used (especially given the rising popularity of `async`/`await`),
no longer outweights the benefit of providing a consistent interface
regardless of the transport library used.
This completes the work to phase out the "node-style" error-first callbacks
@kadamwhite kadamwhite merged commit 8c9a2bc into master Jul 3, 2019
@kadamwhite kadamwhite deleted the remove-callback-support branch July 3, 2019 16:34
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.

1 participant