Skip to content

Proposal: Deprecate Backbone-style callbacks #56

Closed
@andrewimm

Description

@andrewimm

For legacy reasons, the SDK currently supports handling asynchronous actions through two separate methods: Backbone-style success/error callbacks, and Promises. We would like to explore the idea of deprecating the callbacks interface in favor of only using Promises, and we would like community input on this decision.

Why deprecate this piece of the SDK?
We believe that the callbacks format is a less-than-optimal approach to structuring asynchronous code. With ES6, Promises are a feature of the JS language, and we want to discourage async formats that allow developers to fall into "callback hell."
From a code perspective, these require internal methods to have a bunch of boilerplate in order to support wrapping controller methods that use Promises. Removing these callbacks would reduce complexity and remove bytes from nearly every publicly-exposed method.

Proposed deprecation path:
In 1.7.0, using Backbone callbacks will log a warning that the format is now deprecated, and will be removed in 1.8. These warning will only be in the non-minified SDK, so they will not affect production.
In 1.8.0, we completely remove callbacks support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:featureNew feature or improvement of existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions