dapr / js-sdk

Dapr SDK for Javascript
Apache License 2.0
194 stars 82 forks source link

Replacing callbacks #522

Closed SoTrx closed 10 months ago

SoTrx commented 12 months ago

Description

I replaced callbacks in the gRPC client implementation with their promise equivalent.

It uses promisify. I considered wrapping the client itself, but I couldn't do it in a truly type-safe way.

Issue reference

483

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

Ps: Sorry for the delay, I kind of forgot that this issue existed to be honest.

codecov[bot] commented 12 months ago

Codecov Report

Patch coverage: 21.37% and project coverage change: +0.22% :tada:

Comparison is base (553affa) 35.23% compared to head (2d93a85) 35.46%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #522 +/- ## ========================================== + Coverage 35.23% 35.46% +0.22% ========================================== Files 90 90 Lines 10143 10117 -26 Branches 415 394 -21 ========================================== + Hits 3574 3588 +14 + Misses 6503 6463 -40 Partials 66 66 ``` | [Files Changed](https://app.codecov.io/gh/dapr/js-sdk/pull/522?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dapr) | Coverage Δ | | |---|---|---| | [src/implementation/Client/GRPCClient/state.ts](https://app.codecov.io/gh/dapr/js-sdk/pull/522?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dapr#diff-c3JjL2ltcGxlbWVudGF0aW9uL0NsaWVudC9HUlBDQ2xpZW50L3N0YXRlLnRz) | `6.95% <3.03%> (+1.44%)` | :arrow_up: | | [.../implementation/Client/GRPCClient/configuration.ts](https://app.codecov.io/gh/dapr/js-sdk/pull/522?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dapr#diff-c3JjL2ltcGxlbWVudGF0aW9uL0NsaWVudC9HUlBDQ2xpZW50L2NvbmZpZ3VyYXRpb24udHM=) | `10.52% <5.26%> (+1.43%)` | :arrow_up: | | [src/implementation/Client/GRPCClient/metadata.ts](https://app.codecov.io/gh/dapr/js-sdk/pull/522?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dapr#diff-c3JjL2ltcGxlbWVudGF0aW9uL0NsaWVudC9HUlBDQ2xpZW50L21ldGFkYXRhLnRz) | `22.72% <7.69%> (+6.06%)` | :arrow_up: | | [src/implementation/Client/GRPCClient/invoker.ts](https://app.codecov.io/gh/dapr/js-sdk/pull/522?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dapr#diff-c3JjL2ltcGxlbWVudGF0aW9uL0NsaWVudC9HUlBDQ2xpZW50L2ludm9rZXIudHM=) | `26.47% <11.11%> (+4.24%)` | :arrow_up: | | [src/implementation/Client/GRPCClient/secret.ts](https://app.codecov.io/gh/dapr/js-sdk/pull/522?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dapr#diff-c3JjL2ltcGxlbWVudGF0aW9uL0NsaWVudC9HUlBDQ2xpZW50L3NlY3JldC50cw==) | `20.00% <11.11%> (+6.95%)` | :arrow_up: | | [src/implementation/Client/GRPCClient/health.ts](https://app.codecov.io/gh/dapr/js-sdk/pull/522?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dapr#diff-c3JjL2ltcGxlbWVudGF0aW9uL0NsaWVudC9HUlBDQ2xpZW50L2hlYWx0aC50cw==) | `36.36% <14.28%> (+9.09%)` | :arrow_up: | | [src/implementation/Client/GRPCClient/lock.ts](https://app.codecov.io/gh/dapr/js-sdk/pull/522?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dapr#diff-c3JjL2ltcGxlbWVudGF0aW9uL0NsaWVudC9HUlBDQ2xpZW50L2xvY2sudHM=) | `25.00% <14.28%> (+9.00%)` | :arrow_up: | | [src/implementation/Client/GRPCClient/binding.ts](https://app.codecov.io/gh/dapr/js-sdk/pull/522?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dapr#diff-c3JjL2ltcGxlbWVudGF0aW9uL0NsaWVudC9HUlBDQ2xpZW50L2JpbmRpbmcudHM=) | `33.33% <25.00%> (+7.01%)` | :arrow_up: | | [src/implementation/Client/GRPCClient/GRPCClient.ts](https://app.codecov.io/gh/dapr/js-sdk/pull/522?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dapr#diff-c3JjL2ltcGxlbWVudGF0aW9uL0NsaWVudC9HUlBDQ2xpZW50L0dSUENDbGllbnQudHM=) | `78.57% <60.00%> (+1.82%)` | :arrow_up: | | [src/implementation/Client/GRPCClient/pubsub.ts](https://app.codecov.io/gh/dapr/js-sdk/pull/522?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dapr#diff-c3JjL2ltcGxlbWVudGF0aW9uL0NsaWVudC9HUlBDQ2xpZW50L3B1YnN1Yi50cw==) | `87.23% <62.50%> (+4.62%)` | :arrow_up: | | ... and [1 more](https://app.codecov.io/gh/dapr/js-sdk/pull/522?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dapr) | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

dapr-bot commented 11 months ago

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

dapr-bot commented 10 months ago

This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!