Skip to content

Long-term solution[Break change] on improve loadProtoJSON #340

@summer-ji-eng

Description

@summer-ji-eng

To speed up the loadProtoJSON and addressed googleapis/gax-nodejs#1196, we have temperately solution use hashobject(JSON.stringify(json)).

Because hashobject is work for both nodejs and browser( see package.json).

For long-term ultimate goal is to reduce the dependency(i.e remove hashobject). To get rid of hashobject cause breaking change. Because crypto is Node.js specific module. And to use in browser, we need window.crypto.subtle. But the digest is asynchronies function return promise.

Example in
https://github.com/googleapis/google-auth-library-nodejs/blob/main/src/crypto/crypto.ts#L76-L81

Draft implementation PR in gax:
googleapis/gax-nodejs@0ce1a4c

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions