Open mrmurphy opened 5 years ago
@petkaantonov just runs a script to do it. @petkaantonov
I was procrastinating on release to see if something comes up with the async hooks
@petkaantonov any update?
I was hoping to get Promise.allSettled included in the next Bluebird release so it matches native promise API.
@rafde we could happily add that in - via a Promise.allSettled = Promise.settle
since bluebird's settle was an inspiration for allSettled.
I am not sure about adding a new behavior/feature that implements allSettled other than that :]
I noticed settled in the code base, and also noticed https://github.com/petkaantonov/bluebird/blob/master/src/settle.js#L44
Thanks for the response
@rafde here is the allSettled discussion issue: https://github.com/tc39/proposal-promise-allSettled/issues/17
I don't mind un-deprecating it.
Well .allSettled
could just be the same line of code with no deprecation warning
Ill release tonight
@petkaantonov can this be closed?
the Promise.allSettled() implementation in bluebird seems to be different from spec https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled.
const promise1 = Promise.resolve('Resolved!');
const promise2 = Promise.reject('Rejected!');
const promise3 = Promise.resolve('Resolved!');
const promise4 = Promise.reject('Rejected!');
const promises = [promise1, promise2, promise3, promise4];
//Expect:
// [ { status: 'fulfilled', value: 'Resolved!' },
// { status: 'rejected', reason: 'Rejected!' },
// { status: 'fulfilled', value: 'Resolved!' },
// { status: 'rejected', reason: 'Rejected!' } ]
//Result:
// [ PromiseInspection { _bitField: 33554432, _settledValueField: 'Resolved!' },
// PromiseInspection { _bitField: 16777216, _settledValueField: 'Rejected!' },
// PromiseInspection { _bitField: 33554432, _settledValueField: 'Resolved!' },
// PromiseInspection { _bitField: 16777216, _settledValueField: 'Rejected!' } ]
const results = await Promise.allSettled(promises);
@petkaantonov could you check the return value of Promise.allSettled
in bluebird
the Promise.allSettled() implementation in bluebird seems to be different from spec https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled.
It may make sense to change allSettled in a new major 4.x release, since anything using https://github.com/petkaantonov/bluebird/releases/tag/v3.7.2 with bluebird.allSettled() would be calling value() instead of using .value
.
There's also the question of whether it makes sense to continue to keep settled
in 4.x with the original semantics of providing a callback. Leaving in settled
would make migration easier, I guess?
I'm so sorry to be asking this in an issue, but it seems like the best place for it. I see that since the release of 3.5.5 support for async hooks has been merged. I'm delighted, because this is really important to our setup! But it looks like that'll be going into the next release. I've tried to figure out how to run from the master branch but it's not as easy as just
npm install <github_repo>#master
, since there's a pre-compilation step.Are releases made at a regular interval, or just when it feels like it's time for a release? Thanks!