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

Use any-promise? #71

Closed
knpwrs opened this issue Oct 22, 2015 · 8 comments
Closed

Use any-promise? #71

knpwrs opened this issue Oct 22, 2015 · 8 comments

Comments

@knpwrs
Copy link

knpwrs commented Oct 22, 2015

Do you think it would make sense to use any-promise for this library? While I personally *love Bluebird, I don't see any Bluebird-specific functionality being used and this would allow for people to pick their own Promise library (or go native).

I noticed that bluebird-cls is included as a dependency, but continuation-local-storage is a dev dependency. Maybe, if this library were to go the route of using any-promise, it would make sense to move bluebird and bluebird-cls to devDependencies for testing purposes and then either move the require of bluebird-cls to a test or gate it off using process.env.NODE_ENV !== "production" so it could be trimmed out with something like Envify.

Open to hearing your thoughts.

@analog-nico
Copy link
Member

Good pointer @KenPowers ! We were already discussing in issue #65 how to move forward considering that more and more people will want to switch to native promises. any-promise could be the perfect solution. I'll look into it.

BTW, cls-bluebird is a dependency that is only used if you call rp.bindCLS(ns). Otherwise the library is not even required. Of course if we choose the approach to allow users to inject their preferred promise library then cls-bluebird doesn't need to be a dependency anymore.

@MarkHerhold
Copy link

I mentioned in #65 that native-or-bluebird could also be a consideration.

@jonathanong
Copy link

we deprecated native-or-bluebird in favor of any-promise

@analog-nico
Copy link
Member

Thanks for the info @jonathanong ! I guess it is time that I start working on the new Request-Promise version.

@jonathanong
Copy link

would also be nice to not include bluebird as a dependency, especially because the current version is out of date. i'm a stickler for duplicate dependencies in my tree :)

@analog-nico
Copy link
Member

Agreed, @jonathanong. When any-promise will be introduced the user has to install the preferred promise library herself - if not only using native promises.

@benjamingr
Copy link

Bluebird is still much faster than native promises and I've run into cases where this was an issue with request myself (obviously biased as a bluebird person though), for the very least you should wait until v8 5.1 lands.

Also note, bluebird still has much easier to debug semantics :)

@analog-nico
Copy link
Member

Hey buddies, I just released [email protected] and along with it request-promise-native and request-promise-any.

All three libraries share the same core and will be maintained in parallel. The migration is straight forward so feel free to choose the Promise implementation you like best.

Thanks everyone for contributing to this discussion. Cheers!

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

5 participants