Skip to content
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

Support for ES6 Promises #708

Closed
wants to merge 6 commits into from
Closed

Conversation

MaxDesiatov
Copy link

@MaxDesiatov MaxDesiatov commented Nov 2, 2017

In this pull request all user-facing APIs that take callbacks now also return promises. This change is backwards compatible.

Some tests had to be changed, as previously there were expectations that callbacks were called immediately in the same event loop cycle. This is no longer true as callbacks are scheduled with promises, but shouldn't break any user code, which should have been written with an expectation that callbacks are asynchronous in the first place.

Additional tests were added to verify that all promises resolve successfully.

This fork is also published as https://www.npmjs.com/package/noble-promise in the meantime, as I see that main repository had no merging activity for some time. I still hope that this PR will be merged eventually.

@sandeepmistry could you please have a look at this PR? Thanks a lot for the library and I look forward to your feedback.

@jacobrosenthal jacobrosenthal added this to the 2.0 milestone Jan 31, 2018
@ghost
Copy link

ghost commented Jun 5, 2018

so what would it take to get this merged?

@ghost
Copy link

ghost commented Jun 5, 2018

as a review, I'd like to see the actual 4.x requirement done in a separate PR rather than hidden in this PR.

@ghost ghost mentioned this pull request Jun 5, 2018
@MaxDesiatov
Copy link
Author

happy to apply any changes to merge this as required by current maintainers, which I guess are @sandeepmistry and @jacobrosenthal

@MaxDesiatov
Copy link
Author

MaxDesiatov commented Jun 5, 2018

ok, I see there are a few conflicts. Happy to fix those if there is any indication that is the only thing blocking this from being merged. Otherwise, would love to know what else might be needed

@ghost
Copy link

ghost commented Jun 5, 2018

@MaxDesiatov : the Node 4.x changes are here #691, so when the time for rebase comes you'll need to remove your node 4.x changes.

@MaxDesiatov
Copy link
Author

no problem, can do that as soon as #691 is merged

@ghost
Copy link

ghost commented Jun 6, 2018

@MaxDesiatov : It'll also need some examples when the go ahead is given.

@jacobrosenthal
Copy link
Member

Touches a lot of code sadly (mostly because of whitespace) And sad we also have to touch our tests so much. Are people still doing callback AND promise apis? That would let all the existing tests pass to start with and give much more confidence.

@ghost
Copy link

ghost commented Jun 7, 2018

I think the nice part about doing both promises and callbacks is that folks can start using promises immediately and then we could deprecate the callbacks for 3.x

@rzr
Copy link

rzr commented Feb 23, 2020

Please forward change to downstream fork:
#923

@MaxDesiatov MaxDesiatov closed this Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants