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

Promisify the codebase #1006

Closed
sindresorhus opened this issue Feb 11, 2017 · 7 comments
Closed

Promisify the codebase #1006

sindresorhus opened this issue Feb 11, 2017 · 7 comments

Comments

@sindresorhus
Copy link
Member

Would be nice to cleanup the codebase to use promises instead of callbacks: https://github.com/yeoman/generator/search?utf8=%E2%9C%93&q=cb

For public methods we could support both until the next major version and then remove callback support.

@addyosmani
Copy link
Member

I'm in support of this. To take it a step further: is your proposal to strictly upgrade the codebase to use promises or are we talking about a shift to async/await as part of this switch away from callbacks?

@SBoudrias
Copy link
Member

I think that's all our publicly facing API.

For internal methods we should think about what to use instead of async for scheduling series of async functions.

@sindresorhus
Copy link
Member Author

Woot. I'll take a look later today.

Either Bluebird or https://github.com/sindresorhus/promise-fun/blob/master/readme.md#packages

@sindresorhus
Copy link
Member Author

@SBoudrias Looks good. I think we should also deprecate the this.async() pattern in favor of saying that something is async if the user returns a promise, otherwise it's sync. This is also an excellent pattern with async/await.

@addyosmani
Copy link
Member

Looks good. I think we should also deprecate the this.async() pattern in favor of saying that something is async if the user returns a promise, otherwise it's sync

I like the idea of deprecating this.async() unless there's strong opposition. Seems like a sensible call for ergonomics.

@addyosmani
Copy link
Member

@mischah Noticed you added the in-progress label to this one. Are you working on it? :)

@SBoudrias
Copy link
Member

This made it into 2.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants