3 ms·
I would love to see it used with real-world examples. There are two main situations IMO where this would be useful: - For developers creating websites. The cos
by franciscop 10y ago
I would love to see it used with real-world examples. There are two main situations IMO where this would be useful:
- For developers creating websites. The cost of set-up would be high because you'd need concatenation+minification+etc in place, so I'd love seeing some examples to see whether or not is worth it. From what I know, this could be similar to tree-shaking, so there could be huge gains here.
- For library creators. However the top-most variables would have to be preserved, since other developers need to use them (which seems possible[1]), so I'll be trying it out.
I am also wondering about the performance boost for JS (besides file size) and whether this would be useful for something like Node.js or not (free performance). If anyone has more information please share it.
[1] http://stackoverflow.com/q/3025827/938236 http://stackoverflow.com/q/3025827/938236
- thelgevold 10y agoI have a comparison using an Angular app here: http://www.syntaxsuccess.com/viewarticle/angular-application-bundles http://www.syntaxsuccess.com/viewarticle/angular-application...
- thelgevold 10y agoHere is a little bigger app as well http://www.syntaxsuccess.com/viewarticle/migrating-my-angular-demo-to-use-the-closure-compiler http://www.syntaxsuccess.com/viewarticle/migrating-my-angula...
- franciscop 10y agoThanks, apparently I already saw that! Since one comment there is mine.
- bearforcenine 10y agoAt Lucid Software we use the Closure Compiler with advanced optimizations to build both Lucidchart and Lucidpress. You can see some work we did with it in respect to Angular here: https://www.lucidchart.com/techblog/2016/09/26/improving-angular-2-load-times/ https://www.lucidchart.com/techblog/2016/09/26/improving-ang... I don't have a direct comparison to Uglify, but as of last fall advanced optimizations does save us about 2.5 MB over simple optimizations. We're also using Tsickle (https://github.com/angular/tsickle https://github.com/angular/tsickle) and Clutz (https://github.com/angular/clutz https://github.com/angular/clutz) to be able to use TypeScript with our Closure Compiler compatible codebase. Closure Code can be depended upon in TypeScript code and vice versa. It's been awesome to use the type system of TypeScript in combination with the minification power of the Closure Compiler. The build process is definitely a bit crazy at the moment, though. Disclaimer: I work at Lucid Software.
- dmitriid 10y agoThe biggest real-world example is arguably Angular's codebase, referenced in answers to your comment. What these comments don't mention though: - Angular's build system is an unholy mess, good luck understanding how it works - They had to build their own tools such as hacks into TypeScript compiler to make sure Google Closure Compiler understands their code Other "answers" reference things like "a custom snapshot build of Angular".