Changelog - 2026-10-06
The container names a cycle and caches any singleton
Bug Fix Behavior ChangeIn one line. Seven defects in @venizia/ignis-inversion are fixed, so the container behaves the same whatever the class names, the values or the key types.
What changed
- A subclass's property
@injectno longer leaks. It was written into its parent's metadata, so the parent and every sibling then required that binding. Property metadata is now copy-on-write per class. @inject({ target: X, isOptional: true })resolves toundefinedwhenXwas never registered, instead of throwing.- A cycle throws with its path.
A -> B -> Aended inRangeError: Maximum call stack size exceeded. It now throwsCircular dependency | services.A -> services.B -> services.A. A cycle through anawaitis not detected. - Singletons cache any value. A singleton that cached
null,false,0or''survivedcontainer.clear();clear()now clears every cached value. A singleton that answeredundefinedran on every read; it now runs once. - Two symbols with one description are two keys.
Symbol('x')and anotherSymbol('x')shared one binding.Symbol.for('x')is still one key everywhere. - A missing
{ namespace, key }is reported asnamespace.key, not[object Object]. - Metadata with both a class and a key resolves by the class (the key its registration recorded), with the key as the fallback.
@injectitself still takes one or the other.
Who is affected
- A
@providemethod or a singleton provider that returnsundefinedand expects to be asked again. It is now asked once. Return the value when it exists, or bind it transient. - Code that caught the old
RangeErrorfrom a cycle. It now gets anApplicationErrornaming the path. - Code that looks a symbol-keyed binding up by its string (
String(symbol)). The second symbol with a description is stored asSymbol(x)#2. Look it up by the symbol. - Everyone else. No change, beyond errors that now name what failed.
Details
A singleton promise that rejects stays cached until clear(). This is unchanged on purpose: dropping it would silence the unhandled-rejection report of a caller that never awaits it.