This repository was archived by the owner on Nov 18, 2025. It is now read-only.
fix: minify all common proto JSON files#1338
Merged
alexander-fenster merged 1 commit intomainfrom Sep 7, 2022
Merged
Conversation
e94c3da to
1a18687
Compare
ruyadorno
approved these changes
Sep 7, 2022
ruyadorno
left a comment
There was a problem hiding this comment.
LGTM 👍
Just curious on the choice of using a tools/minify.js file vs using the builtin uglify-js cli ?
Contributor
Author
This script will eventually be called from all client libraries (because each library has its own proto JSON shipped, and I want them all to be minified). So if we had used |
alexander-fenster
added a commit
that referenced
this pull request
Sep 7, 2022
alexander-fenster
added a commit
that referenced
this pull request
Sep 7, 2022
gcf-merge-on-green bot
pushed a commit
that referenced
this pull request
Sep 7, 2022
🤖 I have created a release *beep* *boop* --- ## [3.5.0](v3.4.0...v3.5.0) (2022-09-07) ### Features * MinifyProtoJson script exported as a bin ([#1340](#1340)) ([7956eb6](7956eb6)) ### Bug Fixes * Minify all common proto JSON files ([#1338](#1338)) ([7569cc8](7569cc8)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
miguelvelezsa
pushed a commit
to googleapis/google-cloud-node
that referenced
this pull request
Jul 23, 2025
🤖 I have created a release *beep* *boop* --- ## [3.5.0](googleapis/gax-nodejs@v3.4.0...v3.5.0) (2022-09-07) ### Features * MinifyProtoJson script exported as a bin ([#1340](googleapis/gax-nodejs#1340)) ([7956eb6](googleapis/gax-nodejs@7956eb6)) ### Bug Fixes * Minify all common proto JSON files ([#1338](googleapis/gax-nodejs#1338)) ([7569cc8](googleapis/gax-nodejs@7569cc8)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
miguelvelezsa
pushed a commit
to googleapis/google-cloud-node-core
that referenced
this pull request
Oct 22, 2025
🤖 I have created a release *beep* *boop* --- ## [3.5.0](googleapis/gax-nodejs@v3.4.0...v3.5.0) (2022-09-07) ### Features * MinifyProtoJson script exported as a bin ([#1340](googleapis/gax-nodejs#1340)) ([7956eb6](googleapis/gax-nodejs@7956eb6)) ### Bug Fixes * Minify all common proto JSON files ([#1338](googleapis/gax-nodejs#1338)) ([7569cc8](googleapis/gax-nodejs@7569cc8)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
GautamSharda
pushed a commit
to googleapis/google-cloud-node-core
that referenced
this pull request
Oct 29, 2025
🤖 I have created a release *beep* *boop* --- ## [3.5.0](googleapis/gax-nodejs@v3.4.0...v3.5.0) (2022-09-07) ### Features * MinifyProtoJson script exported as a bin ([#1340](googleapis/gax-nodejs#1340)) ([7956eb6](googleapis/gax-nodejs@7956eb6)) ### Bug Fixes * Minify all common proto JSON files ([#1338](googleapis/gax-nodejs#1338)) ([7569cc8](googleapis/gax-nodejs@7569cc8)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
GautamSharda
pushed a commit
to googleapis/google-cloud-node-core
that referenced
this pull request
Oct 29, 2025
🤖 I have created a release *beep* *boop* --- ## [3.5.0](googleapis/gax-nodejs@v3.4.0...v3.5.0) (2022-09-07) ### Features * MinifyProtoJson script exported as a bin ([#1340](googleapis/gax-nodejs#1340)) ([7956eb6](googleapis/gax-nodejs@7956eb6)) ### Bug Fixes * Minify all common proto JSON files ([#1338](googleapis/gax-nodejs#1338)) ([7569cc8](googleapis/gax-nodejs@7569cc8)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We ship several proto JSON files by copying them to the
build/folder before packing the package. These files are loaded intoprotobufjsand are not supposed to be read by a human (we ship.d.tsfor humans). Since some libraries would benefit from having faster cold start time, and the size of the loaded files directly affects cold start time, let's minify these proto JSONs.I'm exporting this small script because we can do the same in the libraries.
Size comparison:
Original files (in
protos/folder):Minified files (in
build/protos):