News for hackers. Stuff that matters.
Re:Closure Compiler: High-level overview of a compilation job by dvcrn on Monday July 04, 2016 @12:54AM (#12028944)
The closure compiler is one of these engineering secrets that I wish more people knew about. The advanced compilation with dead code elimination [0] is insane. It needs a bit of extra work on top to fully utilise but you get a payoff that you can't achieve with other minifiers.

[0]: https://developers.google.com/closure/compiler/docs/api-tuto...

Re:Closure Compiler: High-level overview of a compilation job by happyslobro on Monday July 04, 2016 @05:20AM (#12029602)
Clojurescript is what introduced me to the Closure compiler. It killed three birds with one stone: it unbloated the client build, saved me from writing validation logic twice in two different languages, and I can stop writing JavaScript.
Re:Closure Compiler: High-level overview of a compilation job by localvoid on Monday July 04, 2016 @04:18AM (#12029421)
There also an amazing tool[0] that processes TypeScript and adds JSDoc annotations for closure compiler, so it can optimize way much better[1]

[0]: https://github.com/angular/tsickle

[1]: https://github.com/google/closure-compiler/wiki/Type-Based-P...

Re:Closure Compiler: High-level overview of a compilation job by malisper on Monday July 04, 2016 @05:45AM (#12029684)
How much of a speedup do you get by adding JSDoc type annotations?
Re:Closure Compiler: High-level overview of a compilation job by localvoid on Monday July 04, 2016 @06:59AM (#12029975)
It depends on the code base. When I've migrated from js code base with 100% gcc type coverage to TypeScript, gcc(without tsickle) in advanced mode stopped rewriting many methods into simple functions, didn't minified many symbols, with 100% type coverage gcc minified all symbols.

When I've tried synthetic UI benchmarks, code with 100% type coverage on desktop machines had the same performance, on old mobile phones it was 0-10% faster(depends on the use case).

Minified code size with 100% type coverage were slightly smaller on small projects, but with the API for building UI Components that I've used, minified code with 100% type coverage should be significantly smaller on a large project.

Re:Closure Compiler: High-level overview of a compilation job by bhouston on Sunday July 03, 2016 @08:36PM (#12028312)
It would be cool if this could be used with standard NPM modules in an easy way.
Re:Closure Compiler: High-level overview of a compilation job by skybrian on Sunday July 03, 2016 @09:44PM (#12028519)
Re:Closure Compiler: High-level overview of a compilation job by Scarbutt on Sunday July 03, 2016 @10:00PM (#12028566)
Didn't know it was used so much out of Google, that's a lot of downloads and that just for NPM, I would guess maven and direct downloads are even bigger? not counting clojurescript and scalajs which bundle closure in their compiler.
Re:Closure Compiler: High-level overview of a compilation job by achen2345 on Sunday July 03, 2016 @11:30PM (#12028770)
Its not very many. My own package gets way more traffic than that months after I pulled out of NPM.

https://www.npmjs.com/package/prettydiff

Re:Closure Compiler: High-level overview of a compilation job by Scarbutt on Monday July 04, 2016 @12:29AM (#12028885)
True, forgot how big the JS ecosystem is.