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

Replace Bluebird with native promises and async/await #7171

Open
richarddd opened this issue Jan 3, 2020 · 6 comments
Open

Replace Bluebird with native promises and async/await #7171

richarddd opened this issue Jan 3, 2020 · 6 comments

Comments

@richarddd
Copy link
Contributor

richarddd commented Jan 3, 2020

Well, this a rather big one and should be done in steps and with caution, preferably one file at the time.

I have been working with the framework for some time now and when you start digging into the core there are a lot of "old-ways" of doing stuff.

Proposed solution:

I divided this task into thee different issues, which should be handled in order

  1. (Configure all promise returning functions as async functions #8368) Configure all promise returning functions as async
  2. (Refactor any (Bb)Promise[resolve, reject] constructs #8603) Refactor any (Bb)Promise[resolve, reject] constructs
  3. (Refactor all BbPromise.x usage which doesn't have native counterparts #8369) Convert all functions that rely on non-standard BbPromise usage to async/await and native promise interface
  4. (This issue):
  • Remove BbPromise.config calls
  • Replace all BbPromise occurrences with Promise
@medikoo medikoo added breaking A breaking change bug labels Jan 7, 2020
@medikoo
Copy link
Contributor

medikoo commented Jan 7, 2020

@richarddd great thanks for putting light on that.

Use async/await to avoid promise hell

We're aware of that issue, and want to do that shift soon. Still it'll require drop of support for Node.js v6+, and that's technically breaking semver wise, so we hold it until v2.0.0 release.

Use native promises

This best if done with async/await (otherwise it's doubled effort)

Remove lodash

We can do that now. I would start by replacing those that can be easily fill in by native counterparts (as _.forEach, _.includes etc.). PR is welcome

@medikoo medikoo changed the title Cleanup code: native promises, async/await, remove lodash etc Replace Bluebird with native promises and async/await May 20, 2020
@medikoo
Copy link
Contributor

medikoo commented May 20, 2020

@richarddd I've updated this issue to be strictly about refactor to native promises and async/await, I've also outlined a proposal on how we can approach it

@muskeinsingh
Copy link

@medikoo if we have a breakdown on how we can approach it probably I can pitch in, if that's okay.

@medikoo
Copy link
Contributor

medikoo commented May 21, 2020

@muskeinsingh it'll simply be about refactoring all files that use bluebird so they do not use it.

Still at this point we need to wait for release of v2 first (and realization of #7362). We can assume this task is blocked until then

@muskeinsingh
Copy link

@medikoo sure. I'll be waiting for an update on that!

@medikoo
Copy link
Contributor

medikoo commented Oct 8, 2020

As we've dropped Node.js v6 dependency we can handle this now. I've split this into three issues. Please see updated top level description for details

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

3 participants