Description
Which @angular/* package(s) are relevant/related to the feature request?
No response
Description
Angular has removed the showCircularDependency flag. I understand it is for performance improvement, But for already existing big enterprise-level applications, with many developers, it poses a big problem. Since many devs are working, an import-based circular dependency can be easily inserted in any part of the code, and with the useful 'circular dependency warnings' removed, there is no way to find such issues. And these issues may cause application to actually break in production. Which causes a huge impact on our reputation with the customer. We tried the alternatives suggested, but no luck
-
Eslint -> import/no-cycle -> Makes our linter in CI run for more than 1.5 hours and finally breaks
14:55:00 Linting "@abcd/mnop-efgh"...
16:27:07 Cannot contact xyz-slave1: java.lang.InterruptedException
This is probably because our application is very big -
Madge -> Only found the type-based circular dependencies and no other circular dependencies... It is able to detect all circ-deps for a smaller application, But since our app is huge it is probably not able to find anything relevant.
Proposed solution
-
Keep the showCircularDependencies flag for development and not have it in production. In the angular.json we can have a warning, if showCircularDependencies is set to true, stating, "Do not use in Production as it will slow the build".
-
Angular can have another script, which after running can let us know the circular dependency warnings. This script can be based on the build, used in Angular-13 or before... which finds circular dependencies. This script will be different from the build so no performance impact will be there.
Alternatives considered
As mentioned above eslint and madge were tried, but no value was added.