Check for circular dependencies #8

Open
mathieumast opened this Issue Feb 14, 2013 · 4 comments

Comments

Projects
None yet
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

This comment has been minimized.

Show comment
Hide comment
@philmander

philmander Feb 14, 2013

Owner

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

I will try and take a look at the weekend

Owner

philmander commented Feb 14, 2013

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

I will try and take a look at the weekend

@mathieumast

This comment has been minimized.

Show comment
Hide comment

@mathieumast mathieumast reopened this Feb 14, 2013

@mathieumast

This comment has been minimized.

Show comment
Hide comment
@mathieumast

mathieumast Feb 14, 2013

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

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

This comment has been minimized.

Show comment
Hide comment
@philmander

philmander Mar 31, 2013

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.

Owner

philmander commented Mar 31, 2013

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