Conversation
|
I'm not 100% sure on this one. Both approaches result in the same outcome right? |
|
The asserts approach is indirect. It is a bit sneaky. It means that, to get dead code elimination, you have to ALSO remove all asserts. Long ago, I learned to leave asserts in production code. Whereas the The only downside to the goog.DEBUG approach is that it does require optimisations |
|
This cljs feature has just landed: Now we have compile time constants which can be oveerriden for all |
|
When running unit tests, Clairvoyant is a bit noisy, having a Closure constant would probably be the most flexible option for this. Are you open to a patch for this behaviour? |
Right in our projects we have moved to explicitly changing the value of
js/goog.DEBUGto indicate a production build.Would you be open to changing the behaviour of clairvoyant to use this switch instead?
Sorry for the churn but we do now think this is a better more explicit way of indicating a production build.
I have tested this as well and the closure compiler does remove the dead code produced by this macro with :advanced optimizations.
Stu