Skip to content

How to resolve dependency cycle? #439

@alexvbush

Description

@alexvbush

I am going through migrating a legacy codebase onto using Needle and encountered circular dependencies. Some of my scopes have children scopes that in turn declare one of the great great parent components as their dependency, hence the dependency cycle.

The scenario I'm dealing with isn't necessarily an error - the UI I have is for users browsing through folders which means the user can open one folder and then another subfolder and then another infinitively showing the same UI/component as a child of the previous one. Think dropbox file browsing.

The issue I'm experiencing won't be a problem at runtime but since Needle is trying to resolve the dependency tree before compile time so that it can be deterministic and correct at compile time it can't really process it.

How can this be resolved? Some sort of a "break" at some point with BootstrapComponent creating a second parallel dependency tree for the part of the app I want to circularly depend on?

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