8000 Angular Circular Dependencies - removing showCircularDependency flag has resulted in problems for big enterprise applications · Issue #24870 · angular/angular-cli · GitHub
[go: up one dir, main page]

Skip to content
Angular Circular Dependencies - removing showCircularDependency flag has resulted in problems for big enterprise applications #24870
Closed as not planned
@ajitprak

Description

@ajitprak

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

  1. 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

  2. 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

  1. 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".

  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0