-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not working due to the isDependecyUsedInAnyDeclaration check #26
Comments
isDependecyUsedInAnyDeclaration
check
Does the sort order break your whole app? I.e. does Angular give you module loading errors? |
@joakimbeng thanks for responding. Yes, the sort order breaks the app and I also get the module loading error. My observation is that when the check exists, many files in the project aren't added to the I will try to reproduce the issue in a clean project and share more information when I can. |
You can see the issue in this repo. Just run |
@joakimbeng, just want to check in if there's any update. Thanks! |
I assume that there's a misunderstanding on the purpose of the sorting: this gunt module sorts modules according "define before use", but does not sort module dependencies in front of modules using those: See #7 (comment) Maybe that should be clarified in the README. |
@simon04 I would argue that "use" = "depend" (i.e. A uses B is similar to A depends on B). So the plugin should support dependencies as well. Otherwise, it wouldn't work even for a simple (yet realistic) example in the repo I provided. |
1 similar comment
@simon04 I would argue that "use" = "depend" (i.e. A uses B is similar to A depends on B). So the plugin should support dependencies as well. Otherwise, it wouldn't work even for a simple (yet realistic) example in the repo I provided. |
Issue #25 is related, see especially #25 (comment).
"Define" has to come before "use". But it does not matter whether the |
I hear you. I (and probably those submitting similar tickets) need correct order for dependencies because I define stuff in module A (e.g. BaseController) that is used in module B depending on A. Per my question, the order works correctly if the check |
"I need correct order for dependencies": angular does not, and this gulp task does not provide it. I created a small gist to show that a module |
@simon04 thanks for providing the gist. If you add a global var like Regarding the linked issue #7, I suppose there's a way to fix the cyclic dep error while still ensuring dependency order. But I might be wrong. |
@buunguyen why do you use global variables? All best practices discourages that, and so does this plugin. |
I have an app where a module is contained in multiple files in a folder. There's a main file which declares the module (i.e.
angular.module('mod', [])
) and other files that add stuff to it (e.g.angular.module('mod').controller('c1')
). gulp-angular-filesort doesn't sort files correctly at all. However, if if I comment out the checkisDependecyUsedInAnyDeclaration
, it starts working.I'm not exactly sure what this check is for and why it is needed. Is it an optimization? If it is, it breaks the case like my app where a module is contained in multiple files. Can you shed some light? Thank you.
The text was updated successfully, but these errors were encountered: