You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Suggestion to use Closure Compiler for Ahead of Time Compilation #2981
Suggestion to use Closure Compiler for Ahead of Time Compilation after generating ngfactory files.
OS?
Windows 10
Versions
angular-cli: 1.0.0-beta.19
node: 6.9.1
I am sure Angular CLI team is working hard on the features like AoT with support for Lazy Loading.
While you finalize this feature, I wanted to suggest you to use Closure Compiler after generating ngfactory files using ngc, because it seems to be the only tool that would transpile the ES2015 Rollup Bundle to ES5 with 100% reliability.
While compiling large projects with ngc (after generating ngfactory), it returns Heep Errors. Please have a look at:
If you are interested in following the progress, better subscribe to the Closure support issue in Angular itself (angular/angular#8550).
I suppose nothing can happen here before that is closed and released.
But it says that "All of our code now has Closure annotations" are they referring to the angular code or the code aot compiler generates. Does it mean that our custom components, directives etc should also have closure Annotations? and same goes for the angular plugins as well?
The only reason I refuse to use the CLI for Enterprise projects is because it does not support ClosureCompiler. During ng-conf it was announced that internal teams at Google validate the latest versions of Angular and these teams are using ClosureCompiler. I would feel way more comfortable using a similar build process that replicates how teams at Google bundle Angular web apps. Webpack may be the popular option, but there could be smaller bundles produced through other methods and more optimal code splitting. The core team is already experimenting with going straight from AOT => ClosureCompiler (https://github.com/alexeagle/closure-compiler-angular-bundling). It would be nice if the CLI would support this and Code Splitting.
Reacted by Naveed Ahmed, Victor Bianchi, midzer, Leonel Franchelli, Ivaylo Ivanov, Selene Blok, Niklas, Igor Bodnar, HEMANG THANKI, Amir Shiri and 3 more
There is limited support for ngc => ClosureCompiler and third party libraries ATM but that will change over time. Use "externs" to support third party libraries.
+1 on the request for updates. After all the work that went into Closure support and fanfare around it during the 4.0 release, I was surprised to see The Past, Present, and Future of the Angular CLI not even acknowledge this.
@hansl could you give us some related issues to the refactoring the team is working on? I've been following this for a while and would like to see where it goes. :)
Reacted by Naveed Ahmed, Stephen Belovarich, Szpadel, Elvis Begovic, Pusztai Tibor, Klemen Oslaj, Mező István and Vojtech Mašek
Activity
Meligy commentedon Nov 6, 2016
+1 recorded above.
Some related discussion from the Angular repo angular/angular#8550
ivaylopivanov commentedon Mar 6, 2017
@filipesilva is there a short or long term plan to support closure's advanced optimization?
filipesilva commentedon Mar 6, 2017
We've been looking at ways we can add it but so far there isn't any viable solution.
Meligy commentedon Mar 7, 2017
If you are interested in following the progress, better subscribe to the Closure support issue in Angular itself (angular/angular#8550).
I suppose nothing can happen here before that is closed and released.
JohannesRudolph commentedon Mar 25, 2017
4.0 just announced experimental support for closure compiler for the framework itself I suppose...
naveedahmed1 commentedon Mar 25, 2017
Yes, here are the details, http://angularjs.blogspot.com/2017/03/angular-400-now-available.html .
But it says that "All of our code now has Closure annotations" are they referring to the angular code or the code aot compiler generates. Does it mean that our custom components, directives etc should also have closure Annotations? and same goes for the angular plugins as well?
steveblue commentedon Apr 6, 2017
The only reason I refuse to use the CLI for Enterprise projects is because it does not support ClosureCompiler. During ng-conf it was announced that internal teams at Google validate the latest versions of Angular and these teams are using ClosureCompiler. I would feel way more comfortable using a similar build process that replicates how teams at Google bundle Angular web apps. Webpack may be the popular option, but there could be smaller bundles produced through other methods and more optimal code splitting. The core team is already experimenting with going straight from AOT => ClosureCompiler (https://github.com/alexeagle/closure-compiler-angular-bundling). It would be nice if the CLI would support this and Code Splitting.
elvisbegovic commentedon Apr 28, 2017
hope we can see this one day in cli, actually bundle i know there is gzip but even
saulshanabrook commentedon Jun 28, 2017
It seems like it is working not with rxjs https://github.com/angular/closure-demo
steveblue commentedon Jun 28, 2017
There is limited support for ngc => ClosureCompiler and third party libraries ATM but that will change over time. Use "externs" to support third party libraries.
aldo-roman commentedon Sep 24, 2017
Hi everyone, any updates on this?
angular/angular#8550 was closed early this year.
I see all the demo repos but they use
ngcdirectly, and notangular-cli. Is there a way to include closure compiler on the building pipe?Cheers!
buu700 commentedon Oct 6, 2017
+1 on the request for updates. After all the work that went into Closure support and fanfare around it during the 4.0 release, I was surprised to see The Past, Present, and Future of the Angular CLI not even acknowledge this.
Edit: angular/angular#19058
hansl commentedon Feb 20, 2018
We're reworking the entire build chain, so closing this.
steve-todorov commentedon Feb 20, 2018
@hansl could you give us some related issues to the refactoring the team is working on? I've been following this for a while and would like to see where it goes. :)
naveedahmed1 commentedon Aug 31, 2019
Any update on this?
angular-automatic-lock-bot commentedon Oct 1, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.