cujojs / wire

A light, fast, flexible Javascript IOC container
Other
862 stars 71 forks source link

Remove artificial dot traversal limit #165

Closed briancavalier closed 9 years ago

briancavalier commented 9 years ago

Right now, wire imposes an artificial limit for traversing dots in $ref. You're only allowed to have 1 dot. The original reasoning was that we wanted to steer people away from recreating global/window-like deeply nested namespacing patterns, since IoC really frees you from needing that.

The current limit seems a little heavy handed, though, and I don't really feel strongly anymore that we need to forcibly limit nesting. So, I propose we remove the limit and allow arbitrarily deep $ref resolution.

unscriptable commented 9 years ago

While I'm adamant that 1 dot is more than enough for well-architected IoC apps, that code to enforce 1-dot references is undoubtedly heavy-handed. We shouldn't be artificially limiting folks.

I'd be happier about this change if the documentation and examples only showed one dot (or less).

briancavalier commented 9 years ago

1 dot is more than enough for well-architected IoC apps

Agreed.

documentation and examples only showed one dot (or less)

Good point. We'll just have to ensure that we always present the right guidance in docs.