electrolyte icon indicating copy to clipboard operation
electrolyte copied to clipboard

Provide a container factory rather than an immediate global container

Open neverfox opened this issue 10 years ago • 1 comments

I've been running into an issue with electrolyte where the fact that it operates as a global container (cached by node once required) makes it problematic to use when you have one electrolyte project using another electrolyte library as a dependency (since node doesn't guarantee that your dependency won't just use a higher level electrolyte in node_modules). So I get collisions on component names, which silently override the earlier ones. It also makes testing harder because I cannot create isolated containers for a given test suite.

neverfox avatar Dec 13 '14 02:12 neverfox

I think being able to add a namespace to the container would solve the problem. Maybe when you require Electrolyte you could specify the name of the container you want to retrieve?

jsumners avatar Dec 27 '14 19:12 jsumners