petkaantonov / bluebird

:bird: :zap: Bluebird is a full featured promise library with unmatched performance.
http://bluebirdjs.com
MIT License
20.45k stars 2.33k forks source link

Question: a new release? #1600

Open mrmurphy opened 5 years ago

mrmurphy commented 5 years ago

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!

benjamingr commented 5 years ago

@petkaantonov just runs a script to do it. @petkaantonov

petkaantonov commented 5 years ago

I was procrastinating on release to see if something comes up with the async hooks

yosiat commented 5 years ago

@petkaantonov any update?

rafde commented 5 years ago

I was hoping to get Promise.allSettled included in the next Bluebird release so it matches native promise API.

benjamingr commented 5 years ago

@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 :]

rafde commented 5 years ago

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

benjamingr commented 5 years ago

@rafde here is the allSettled discussion issue: https://github.com/tc39/proposal-promise-allSettled/issues/17

I don't mind un-deprecating it.

petkaantonov commented 5 years ago

Well .allSettled could just be the same line of code with no deprecation warning

Ill release tonight

benjamingr commented 4 years ago

@petkaantonov can this be closed?

trmaphi commented 3 years ago

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);
trmaphi commented 3 years ago

@petkaantonov could you check the return value of Promise.allSettled in bluebird

TysonAndre commented 3 years ago

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?