-
Notifications
You must be signed in to change notification settings - Fork 129
Upgrade bluebird to 3.x #430
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
Conversation
|
Thanks, but this breaks the API. Thinky should return operational errors when they are, so tests shouldn't be updated. |
|
So maybe thinky should use own Promise library like this: I can update PR. |
|
Nah that wouldn't work because people can still throw in the |
|
This is basically replacing |
|
They can throw error inside the then handler and it will be catch by |
|
@neumino Yes, I read your first comment when you were explaining that. But I don't think I follow. This are all the breaking changes in Bluebird 3.0. What exactly in that list would "break" thinky's API? Both Moreover, assuming the API changes and you would like to cut a release, you have semver to back you up. I'm saying all these because it looks like thinky is falling behind on updates. Dependency versions are locked. It's not even using latest |
|
What changes is that About the dependencies, rethinkdbdash is update to date. If you install thinky 2.3, you get rethinkdbdash 2.3.x (though it looks like npm is not smart enough and falls to 2.2.8 now by default).
|
|
Thanks for the explanation! If you want, I could try and send a new PR for this.
That's what I'm getting, yes.
No reason, really. I was just trying to make a point about updates. |
|
isn't this can be solved just by upgrading thinky to version 3.0 |
|
we can create a special branch for thinky version 2 for LTS and just upgrading bluebird to version 3 |
|
I second that. I'm offering myself for a PR if needed. |
|
Maintaining two branches is just more work. If someone send a PR that update thinky to bluebird 3 while being backward compatible, I'll merge it. As far as I know, it's just about making all the errors called with |
|
ok after taking a look at the code i think we need to fix the following:
|
|
No, you shouldn't change Promise.error to Promise.catch, you just want to make the error operational. |
|
my bad you are totally right, sorry usually i always used to do normal rejection :P |
|
@digital-flowers ├─┬ rethinkdbdash@2.3.25
│ └── bluebird@3.4.6
└── validator@3.22.2 |
|
ooh so rethinkdbdash already using bluebird 3 |
|
I started working on a PR for this. @neumino Could you elaborate on why you'd like to change errors to If that is case, then semver if what you need. Not masking your errors. Just release |
|
To clarify, what I believe you want is this: const Promise = require('bluebird');
new Promise(function(resolve, reject) {
var e = new Error('boom');
e.isOperational = true; // Basically, the same as `new OperationalError()`
return reject(e);
}).error((err) => {
console.log('Got an OperationalError');
});But then, the Promise spec states that there is no |
|
☝️ There it is, @neumino. Let's hope you reconsider your position on errors. If not, well ¯_(ツ)_/¯. |
|
The changes were in bluebird 3 were to make bluebird compatible with the spec. The breaking change is that |
Correct. That's what I explained my previous comment.
It does if you want to use Bluebird 3.
Yes, we got that. But upgrading is not enforced to users. It's entirely up to them. So, again, if you do a MAJOR bump in thinky everything's good and dandy. I completely understand if you don't want to do that, but your proposed alternative seems like a bad design decision in the long term. |
No it doesn't. Rethinkdbdash was migrated to bluebird 3 without introducing breaking change. Bumping to a major number doesn't remove the pain for people to update their code if they want to update thinky. |
No description provided.