inverted icon indicating copy to clipboard operation
inverted copied to clipboard

Check for circular dependencies

Open mathieumast opened this issue 12 years ago • 4 comments

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.

mathieumast avatar Feb 14 '13 13:02 mathieumast

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

I will try and take a look at the weekend

philmander avatar Feb 14 '13 13:02 philmander

My project is share on google code : http://code.google.com/p/gisfizz/ My configuration of inverted : http://code.google.com/p/gisfizz/source/browse/src/main/webapp/js/appContext.js

mathieumast avatar Feb 14 '13 16:02 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

mathieumast avatar Feb 14 '13 16:02 mathieumast

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.

philmander avatar Mar 31 '13 13:03 philmander