refactor(deps): Remove @google-cloud/promisify
dependency in favor of native implementation
#1967
Labels
api: storage
Issues related to the googleapis/nodejs-storage API.
next major: breaking change
this is a change that we should wait to bundle into the next major version
priority: p3
Desirable enhancement or fix. May not be included in next release.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
Currently we utilize
@google-cloud/promisify
in numerous files to create functions and methods that handle both callback and Promises APIs. The problem with this approach is that it's difficult to determine when something is promisified on the type-level and it makes debugging/understanding the codebase a bit more cumbersome (it can come off as 'magic' for newcomers).Source:
nodejs-storage/src/file.ts
Lines 4121 to 4130 in a9c4c18
Example (difficult to understand how a
Promise
is returned):nodejs-storage/src/file.ts
Lines 1532 to 1676 in a9c4c18
Going forward, we should handle the logic directly in the methods - in a seamless way when possible.
Idea: Perhaps have an internal/
private
Promise
-only (async/await
) version of methods, and have thepublic
methods internally handling all difference between callback andPromise
(e.g. most logic would be in the internalized-async/await
function).The text was updated successfully, but these errors were encountered: