-
Notifications
You must be signed in to change notification settings - Fork 60
async refactor - refactor internal methods as async #108
Conversation
@kumavis the async refactor will be a breaking change. We need to wait for the dependencies to be ready before we can merge it in. In the mean time there have been some other big changes in the way that the queries work (eg #107), so I think we will need to use that as a starting point rather than my refactors (some of which have already been ported into master). I'm sorry we can't use this, as I see you've put a lot of effort into it. |
@dirkmc can you clarify your reasoning here
this is why I created this PR. in order to:
this PR was also made specifically with #107 in mind, with an eye on reducing conflicts |
d807ccb
to
9786f05
Compare
9786f05
to
87fa8c7
Compare
@kumavis thanks for putting this PR together. We would prefer to refactor everything at once rather than piece-meal. There will likely be further changes to the DHT code before that big refactor can be made, so we would like to hold off on any more async/await refactoring for the time being. When we are ready to do so we will look at using this PR as part of the big refactor. |
I strongly recommend against needing a big refactor in the first place if it can be avoided
can you provide reasoning here. I think this is a bad idea and hinders contribution to this project |
my philosophy: |
@dirkmc can i get some more concrete criticism on this approach, thanks |
@kumavis I'm just a contributor to this repo. There's an endeavour for converting a lot of our repos to async/await: ipfs/js-ipfs#1670. I'm sure they could use your help. |
@dirkmc whoops, didnt realize. thanks |
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.
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.
Looked into the changes and everything looks good!
Only needs the pify
to be replaced, as stated by Alan!
This is ready to merge 🚀 Will continue breaking off little pieces of async refactor in separate PRs 😸 |
@dirkmc thanks for kicking off this refactor! |
Thanks for putting in the work to take this on @kumavis 💪👍 |
This is an experiment in taking some of the excellent async refactors in #82 and applying them as non-breaking changes
The goal of this PR is to reduce the amount of unmerged code in the PR that is blocked by dependencies undergoing their own async refactors. Unmerged refactors will inevitably conflict with other ongoing contributions (e.g. #107)
A question - is the introduction of
async
/await
if event used internally a breaking change to minimum platform support (e.g. node@6)? If so would something like@babel/register
be considered a sufficient solution?I tried to match code style and compared the
feat/async-await
andmaster
branches with great care.Some notes:
_sendCorrectionRecord
was broken out as perfeat/async-await
_getValueOrPeers
return signature unchanged but_getValueOrPeersAsync
returns an object as perfeat/async-await
_findNProvidersAsync
is not refactored into an async iterator as perfeat/async-await
but could befeat/async-await
could be included without breaking changes, but I thought this should undergo review before continuing work