-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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 native promises as default #2917
Comments
I agree. I use node 0.12 and can't use catch() without hack |
This will have to wait for 5.0, IMO qualifies as backwards-breaking. I agree with the suggestion though. |
@Jokero – what is the hack you used? Fair enough that this is still a work in progress, but in the meantime it would be great if the ES6 compatibility page on the mongoose website could be updated. It currently states:
Given that the document is titled to suggest it is about support of ES6-native features, the use of the unqualified phrase 'promises' to me strongly implied native promises, particularly now that they are supported without any flags on the latest stable node 0.12.x (and consequently wrote a fair amount of code on that assumption before realising it was incorrect). If you click through the link, it does indeed lead to the mpromises website, but in the meantime perhaps the page could be updated to explicitly state that only mpromises are supported right now (perhaps by just replacing 'promises' with 'mpromises') to avoid any confusion. |
@kencoken, I use it: require('mongoose/node_modules/mpromise').prototype.catch = function(onReject) {
return this.then(undefined, onReject);
}; |
See #2688 |
@Jokero thanks for this! That's really helpful for now 👍 |
Two years since this issue guys, are there any updates? |
No updates yet. Stay tuned 👍 |
@vkarpov15 Can we please remove lib/promise.js and use native Promises? We can put in |
Yep that's the plan 👍 |
Fixed in 5.0 branch. |
* Upgrade deps to latest releases * Add --exit flag to test script (required since mocha@4 - https://boneskull.com/mocha-v4-nears-release/#mochawontforceexit) * Use native promises instead of mongoose Promise.ES6 (not provided in mongoose@5 anymore - Automattic/mongoose#2917)
* Upgrade deps to latest releases * Add --exit flag to test script (required since mocha@4 - https://boneskull.com/mocha-v4-nears-release/#mochawontforceexit) * Use native promises instead of mongoose Promise.ES6 (not provided in mongoose@5 anymore - Automattic/mongoose#2917)
Use native promises (node v 0.12+) as default. For old versions of node.js use old promise library
The text was updated successfully, but these errors were encountered: