Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Turn on ADVANCED_OPTIMIZATIONS when compiling protobuf JS #5509

Closed
wants to merge 1 commit into from

Conversation

jjbubudi
Copy link

@jjbubudi jjbubudi commented Dec 26, 2018

Fixes protocolbuffers/protobuf-javascript#92

After optimization the bundle size went from ~156KB to ~47KB (uncompressed)

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@jjbubudi
Copy link
Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@jjbubudi jjbubudi changed the title Enable ADVANCED_OPTIMIZATIONS in Closure Compiler Turn on ADVANCED_OPTIMIZATIONS when compiling protobuf JS Dec 26, 2018
@BSBandme BSBandme requested a review from TeBoring December 26, 2018 22:20
@jjbubudi jjbubudi changed the title Turn on ADVANCED_OPTIMIZATIONS when compiling protobuf JS [WIP] Turn on ADVANCED_OPTIMIZATIONS when compiling protobuf JS Dec 29, 2018
@jjbubudi jjbubudi force-pushed the js-optimizations branch 2 times, most recently from c0c8489 to 2c31a47 Compare December 30, 2018 05:27

exports.goog = goog;
exports.jspb = jspb;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jspb is available in the google-protobuf module. Exporting jspb here and subsequently using it in test will result in a lot of undefined symbol errors because the compiled google-protobuf is expecting obfuscated symbols.

@@ -67,7 +67,7 @@ console.log("var global = Function('return this')();");
console.log("var googleProtobuf = require('google-protobuf');");
console.log("var testdeps = require('testdeps_commonjs');");
console.log("global.goog = testdeps.goog;");
console.log("global.jspb = testdeps.jspb;");
console.log("global.jspb = googleProtobuf.jspb;");
Copy link
Author

@jjbubudi jjbubudi Dec 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment above. We should use google-protobuf's jspb instead of the one we exported for tests.

@skyjia
Copy link

skyjia commented May 28, 2020

any updates on this PR?

@TeBoring TeBoring requested review from lukesandberg and removed request for TeBoring May 17, 2021 21:54
@TeBoring TeBoring assigned lukesandberg and unassigned TeBoring May 17, 2021
@acozzette
Copy link
Member

We are closing all open JavaScript pull requests because the JavaScript implementation is moving to a new repository: https://github.com/protocolbuffers/protobuf-javascript Sorry for the inconvenience but please feel free to reopen the pull request in the new repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JavaScript: Closure compilation at the advanced level (WIP)
6 participants