[FlexJS] Release builds vs debug builds

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[FlexJS] Release builds vs debug builds

Josh Tynjala
At the FlexJS Summit, some of those who are working on real world apps
mentioned that they eventually run into trouble as their app grows larger.
The release builds stop working properly, and it's easier to deploy the
debug build than to try to make Closure compiler happy to fix the release
build.

I just wanted to bring up a reminder of one option that's available to you
today, when the Closure compiler's advanced optimizations are giving you
trouble. FalconJX lets you pass in options for Closure compiler. That will
let you turn down Closure compiler's optimization level to
SIMPLE_OPTIMIZATIONS or WHITESPACE_ONLY for your release builds:

-js-compiler-option="—compilation_level SIMPLE_OPTIMIZATIONS"

-js-compiler-option="—compilation_level WHITESPACE_ONLY"

SIMPLE_OPTIMIZATIONS will still rename some things in the release build,
like local variables. However, it's much safer to use than
ADVANCED_OPTIMIZATIONS because it doesn't rename members of classes.

WHITESPACE_ONLY will give you a release build that is concatenated and
minified, but nothing is renamed. This is the safest option that shouldn't
break any app.

It's worth mentioning that if you use Closure compiler on its own, it
defaults to SIMPLE_OPTIMIZATIONS. Even Google makes people opt into
ADVANCED_OPTIMIZATIONS, since it requires being so careful about how you
write your code.

- Josh
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [FlexJS] Release builds vs debug builds

piotrz
Hi Josh,

Precious information!

Thank you!
Piotr
Apache Flex PMC
piotrzarzycki21@gmail.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [FlexJS] Release builds vs debug builds

Christofer Dutz
+1 … I should definitely add a direct config option to the maven mojo instead of having to pass this in using the “additionalCompilerOptions” tag.

Chris

Am 23.05.17, 21:07 schrieb "piotrz" <[hidden email]>:

    Hi Josh,
   
    Precious information!
   
    Thank you!
    Piotr
   
   
   
    -----
    Apache Flex PMC
    [hidden email]
    --
    View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-Release-builds-vs-debug-builds-tp61798p61806.html
    Sent from the Apache Flex Development mailing list archive at Nabble.com.
   

Loading...