-
Notifications
You must be signed in to change notification settings - Fork 363
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
[SEMVER-MAJOR] Always use bluebird as the Promise implementation #790
Conversation
Hi @jannyHou, I guess this is a good start. Now you need to clean up |
Also remove these three lines and make sure tests are still passing on Node v0.10: https://github.com/strongloop/loopback-datasource-juggler/blob/1e9bbd27873077ef374ea5487121a70173757364/test/init.js#L30-L32 |
Hi @bajtos , I fixed 2 of 3 failures, and now tests pass on node v.10. Actually the third one is an unhandled error msg instead of a failure(at least mocha doesn't count it), and I get the same error when I run the code cloned from master branch. I guess it's not caused by my change but I'll see how to fix it(because it seems related to promise). I commented And I created a list of promisified apis whose doc might need update: Thanks! |
"mocha": "^2.1.0", | ||
"should": "^5.0.0" | ||
}, | ||
"dependencies": { | ||
"async": "~1.0.0", | ||
"bluebird": "^2.9.9", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While you are making this change, could you please upgrade Bluebird to 3.x?
The new code looks right.
No need to keep that code in, we will always have the promise library as long as Node handles dependencies correctly (which is safe to assume).
👍 |
bbee288
to
deec6f4
Compare
@@ -27,6 +27,3 @@ if (!('getModelBuilder' in global)) { | |||
}; | |||
} | |||
|
|||
if (!('Promise' in global)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the trailing empty line (L29) too.
@jannyHou code changes LGTM. Please rebase your patch on top of the current master and add an entry to https://github.com/strongloop/loopback-datasource-juggler/blob/master/3.0-RELEASE-NOTES.md The idea is write a short text explaining loopback users (developers) what this change means for their applications and provide instructions how to upgrade. @superkhau could you please help here? |
Also include a link to this pull request to make it easy to look up more details if needed in the future. |
d299f06
to
ede1050
Compare
|
||
## Always use bluebird as promise library | ||
|
||
In version 3.0, we always use bluebird as our promise library instead of `global.Promise`. We consider Bluebird API a part of LoopBack API from now on, you are welcome to use any Bluebird-specific methods in your applications. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep line width at 80 characters max, it makes it easier to review diffs.
@jannyHou One more minor comment to address. Once you address it, please go ahead and land the PR without waiting for another review. |
13d800e
to
c4a2489
Compare
Replace `global.Promise` with `bluebird`
135e1ea
to
853ca03
Compare
[SEMVER-MAJOR] Always use bluebird as the Promise implementation
This pr is created for updating files to use
bluebird
as promise library.Details see here:
Connect to strongloop-internal/scrum-loopback#615
Related: strongloop/loopback#1896