Skip to content

Commit

Permalink
build!: reduce module size by remove duplicate storage for protos fil…
Browse files Browse the repository at this point in the history
…es (#1249)

Significantly reduce the module size
 -- | before | after
-- | -- | --|
package size | 869.6 kB |575.4KB
unpacked size | 10.9 MB | 5. MB

This is a BREAKING_CHANGE!
A client library refer to `protos/..` file should throw error with gax updates. To fix it, we should refer to `build/protos/..` instead.
  • Loading branch information
summer-ji-eng authored May 5, 2022
1 parent a50542e commit 4d2a04d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"files": [
"build/src",
"build/tools/compileProtos.js",
"protos",
"build/protos/"
],
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion src/googleError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export class GoogleErrorDecoder {

constructor() {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const errorProtoJson = require('../../protos/status.json');
const errorProtoJson = require('../../build/protos/status.json');
this.root = protobuf.Root.fromJSON(errorProtoJson);
this.anyType = this.root.lookupType('google.protobuf.Any');
this.statusType = this.root.lookupType('google.rpc.Status');
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/google-gax-packaging-test-app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ async function testEchoError(client: EchoClient) {
'..',
'..',
'..',
'build',
'protos',
'google',
'rpc'
Expand Down

0 comments on commit 4d2a04d

Please sign in to comment.