Skip to content

Loading…

Check for circular dependencies #8

Open
mathieumast opened this Issue · 4 comments

2 participants

@mathieumast

Inverted detects "eventBus" proto as circular dependency with this configuration :

  main : {
    module : "Main",
    scope : "singleton",
    props : {
      eventBus : "*eventBus",
      router : "*router"
    }
  },

  router : {
    module : "Router",
    scope : "singleton",
    args : [ "*routeServer", "*routeLayer" ],
    props : {
      eventBus : "*eventBus",
    }
  },

  ...

It's not a circular dependency, eventBus is not in the same branch on the configuration tree.
I must comment loop in checkForCircular function.

@philmander
Owner

Thanks, can you share the config for eventBus as well please?

I will try and take a look at the weekend

@mathieumast mathieumast reopened this
@mathieumast

For your information, i have created a lite require plugin for get protos with require() or define() : https://github.com/mathieumast/require-plugins/blob/master/invert.js

@philmander
Owner

Sorry its taken me so long to look at this. Just being replicating your setup and the circular dependency checking code does need some work.

Instead of using a require js plugin to get protos, you can add injectAppContext: true, to your conf. Then you can use this.__appContext__.getProto(...) within your module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.