marklagendijk / ui-router.stateHelper

A helper module for AngularUI Router, which allows you to define your states as an object tree.
MIT License
235 stars 40 forks source link

Code can't be minified (and won't work in strict-di mode) #11

Closed alonbardavid closed 9 years ago

alonbardavid commented 9 years ago

The original source-code (not the minified one) doesn't use the bracket or inject notation to declare the stateHelper provider, so it can't be directly minified.

Also it'll fail if using the new strict-di mode introduced in 1.3

slavafomin commented 9 years ago

Hello! Thanks for this library!

I can confirm the issue with minification. It just broke our production server )

I can see that your are using ng-min in Gulp to annotate source code before actual minification. By the way ng-min is deprecated in favor of: https://github.com/olov/ng-annotate#how-does-ng-annotate-compare-to-ngmin.

I'm not sure how this problem should be resolved from the library standpoint though, but I will add ng-annotate to the build process of my project to be on the safe side = )

Right now, I have to include provided minified file to my project instead of original one.

marklagendijk commented 9 years ago

The assumption that the source code of an external Angular component will be minify proof, is a wrong one. Either use the provided minified file, or use something like ng-annotate yourself.

alonbardavid commented 9 years ago

you still did not address the use of ng-strict-di (which is a recommended practice) for those who want to use the "non-minified" version.

For instance when I develop, I use ng-strict-di and non-minified versions of all frameworks. My only recourse is to take copy and modify the code to work well with ng-strict-di.

willsoto commented 9 years ago

It should be noted that the lack of DI friendliness on the non-minified version makes NPM installing a bit of a hassle, since it looks like npm wants to use the non-minified version by default.

Just FYI.