-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
May I use global.Promise=require("bluebird") ? #1026
Comments
Yes, it is. In general - the issue tracker is not the place to ask support questions - you can use the disqus comments in the docs, stack overflow or other support channels. Since the answer wasn't obvious from the docs - please feel free to follow up with a docs pull request. |
Caveat: Note that bluebird intentionally does not support direct promise subclassing. It is extremely rare to see this used in Node or in general. If someone ever asks for this (and in almost 3 years no one ever has) it can be considered. |
No subclassing |
I'm having issues with this, when I put Bluebird on |
@wmertens You might want to file a distinct issue with this. Sounds like a conflict between Babel's promises polyfill and Bluebird. |
some of babel's transformations turn code like this: const foo = new Promise(resolve => resolve(true)); into const foo = new corejs.Promise(resolve => resolve(true)); in which case obviously the |
Thanks @phpnode that makes a lot of sense. There are Babel tweaks like https://babeljs.io/docs/plugins/transform-async-to-module-method/ but that's for the async/await polyfill specifically, no override. According to https://github.com/babel/babel-loader the only way might be: require('babel-runtime/core-js/promise').default = require('bluebird'); (I don't use Babel so I haven't tested this.) |
changing |
Please, try to use |
The new version of level-party let us use a version of leveldb with promises support, allowing to remove most of the former level/base logic. That level/base module was further simplified to simply return the levelup db object, giving access to the whole levelup API (see https://github.com/Level/levelup#api), moving specific behaviors to level/utils. A custom version of level-geospatial is used to be able to use promise until that PR is merged richorama/level-geospatial#2
Is it suitable to replace the v8's Promise implementation?
The text was updated successfully, but these errors were encountered: