Version 5.0.1

@svermeulen svermeulen released this Feb 17, 2017 · 10 commits to master since this release

  • Hotfix. Signal UniRx integration was completely broken (issue #202)
  • Added backwards compatibility for Unity 5.4
  • Reverted change in 5 that modified the behaviour of transform parenting for GameObjectContext
  • Reverted change in 5 that was causing inactive game objects to not be injected


Version 5.0

@svermeulen svermeulen released this Feb 13, 2017 · 26 commits to master since this release


Notable parts of this release includes the long awaited support for Memory Pools, a re-design of Commands/Signals, and support for late resolve via Lazy<> construct. It also includes some API breaking changes to make it easier for new users. Some of the bind methods were renamed to better represent what they mean, and in some cases the scope is now required to be made explicit, to avoid accidentally using transient scope. Finally, there was also some significant performance improvements for when using Zenject in scenes with many transforms.

New Features

  • Added Lazy<> construct so that you can have the resolve occur upon first usage
  • Added menu option "Validate All Active Scenes"
  • Added support for memory pools. This includes a fluent interface similar to how factories work
  • Added DiContainer.QueueForInject method to support adding pre-made instances to the initial inject list
  • Added new construction methods
    • FromMethodMultiple
    • FromComponentInHierarchy
    • FromComponentSibling
    • FromComponentInParents
    • FromComponentInChildren
    • FromScriptableObjectResource


  • Updated sample projects to be easier to understand
  • Improved error messages to include full type names
  • Changed list bindings to default to optional so that you don't have to do this explicitly constantly
  • Changed to require that the scope be explicitly set for some of the bind methods to avoid extremely common errors of accidentally leaving it as transient. Bind methods that are more like "look ups" (eg. FromMethod, FromComponentInParents, etc.) have it as optional, however bind methods that create new instances require that it be set explicitly
  • Renamed BindAllInterfaces to BindInterfacesTo and BindAllInterfacesAndSelf to BindInterfacesAndSelfTo to avoid the extremely common mistake of forgetting the To
  • Removed support for passing arguments to InjectGameObject and InstantiatePrefab methods (issue #125)
  • Removed UnityEventManager since it isn't core to keep things lightweight
  • Renamed the Resolve overload that included an ID to ResolveId to avoid the ambiguity with the non generic version of Resolve
  • Renamed the following construction methods. This was motivated by the fact that with the new construction methods it's unclear which ones are "look ups" versus creating new instances
    • FromComponent => FromNewComponentOn
    • FromSiblingComponent => FromNewComponentSibling
    • FromGameObject => FromNewComponentOnNewGameObject
    • FromPrefab => FromComponentInNewPrefab
    • FromPrefabResource => FromComponentInNewPrefabResource
    • FromSubContainerResolve.ByPrefab => FromSubContainerResolve.ByNewPrefab
  • Signals package received significant changes
    • The order of generic arguments to the Signal<> base class was changed to have parameters first to be consistent with everything else
    • The functionality of commands was merged into signals

Bug fixes

  • (optimization) Fixed major performance issue for scenes that have a lot of transforms Re issue #188.
  • (optimization) Fixed to avoid the extra performance costs of calling SetParent by directly passing the parent to the GameObject.Instantiate method issue #188
  • Fixed extremely rare bug that would cause an infinite loop when using complex subcontainer setups
  • Fixed to work with nunit test case attributes
  • Fixed to instantiate prefabs without always changing them to be active
  • Fixed WithArguments bind method to support passing null values
  • Fixed context menu to work properly when creating installers etc. issue #200
  • Fixed issue with ZenUtilInternal.InjectGameObjectForComponent method to support looking up non-monobehaviours.
  • Fixed NonLazy() bind method to work properly wtihin sub containers


Version 4.7

@svermeulen svermeulen released this Nov 6, 2016 · 101 commits to master since this release

  • Removed the concept of triggers in favour of just directly calling Signal.Fire, since using Trigger was too much overhead for not enough gain. Also changed to allow subscribing using += and unsubscribing using -=
  • Fixed issue for Windows Store platform where zenject was not properly stripping out the WSA generated constructors
  • Changed to automatically choose the public constructor if faced with a choice between public and private
  • Fix to IL2CPP builds to work again
  • Added support for using the WithArguments bind method combined with FromFactory
  • Improved validation of multi-scene setups using Contract Names to output better error messages


Version 4.6

@svermeulen svermeulen released this Oct 23, 2016 · 120 commits to master since this release

  • Changed Validation to run at edit time rather than requiring that we enter play mode. This is significantly faster. Also added a hotkey to "validate then run" since it's fast enough to use as a pre-run check
  • Added InstantiateComponentOnNewGameObject method
  • Changed to install ScriptableObjectInstallers before MonoInstallers since it is common to include settings in ScriptableObjectInstallers (including settings for MonoInstallers)
  • Added new option to ZenjectBinding BindType parameter to bind from the base class
  • Changed to allow specifying singleton identifiers as object rather than just string
  • Added design-time support to Scene Parenting by using Contract Names (see docs for details)
  • Changed Scene Decorators to use Contract Names as well (see docs for details)
  • Fixed to ensure that the order that initial instances on the container are injected in follows their dependency order #161
  • Added LoadSceneAsync method to ZenjectSceneLoader class. Also removed the option to pass in postBindings since nobody uses this and it's kind of bad practice anyway. Also renamed LoadSceneContainerMode to LoadSceneRelationship
  • Added AutoRun field on SceneContext for cases where you want to start it manually
  • Removed the IBinder and IResolver interfaces since they weren't really used and were a maintenance headache
  • Renamed WithGameObjectGroup to UnderTransformGroupX and also added UnderTransform method
  • Added helper classes to make writing integration tests or unit tests with Unity's EditorTestRunner easier
  • Added documentation on ZenjectEditorWindow, Unit Testing, and Integration Testing
  • Misc. bug fixes


Version 4.5

@svermeulen svermeulen released this Sep 2, 2016 · 169 commits to master since this release

Very minor release with just a few bug fixes:

  • Fixed DiContainer.ResolveTypeAll() method to properly search in parent containers
  • Fixed exception that was occurring with Factories when using derived parameter types
  • Fixed FromResolve to properly search in parent containers
  • Fixed exception that was occurring with FromMethod when using derived parameter types


Version 4.4

@svermeulen svermeulen released this Jul 23, 2016 · 183 commits to master since this release


  • Changed the way installers are called from other installers, to allow strongly typed parameter passing
  • Added untyped version of FromMethod
  • Added FromSiblingComponent bind method
  • Added non-generic FromFactory bind method

Bug fixes

  • Minor bug fix to command binding to work with InheritInSubcontainers() method
  • Bug fix - NonLazy method was not working properly when used with ByInstaller or ByMethod


Version 4.3

@svermeulen svermeulen released this Jun 4, 2016 · 209 commits to master since this release

  • Changed to disallow using null with BindInstance by default, to catch these errors earlier
  • Changed to use UnityEngine.Object when referring to prefabs to allow people to get some stronger type checking of prefabs at edit time
  • (bug fix) for Hololens with Unity 5.4
  • (bug fix) Scene decorator property was not being serialized correctly
  • (bug fix) Custom factories were not validating in some cases


Version 4.2

@svermeulen svermeulen released this May 30, 2016 · 222 commits to master since this release

  • Finally updated the documentation and made Zenject 4 the official version
  • Renamed FromGetter to FromGetterResolve
  • Added some optimizations to convention binding
  • Renamed InstallPrefab to InstallPrefabResource
  • (bug) Fixed PrefabFactory to work with abstract types
  • (bug) Fixed some bugs related to convention binding
  • (bug) Fixed bug with Unity 5.3.5 where the list of installers would not serialize properly
  • (but) Fixed minor bug with validation



Version 4.1

@svermeulen svermeulen released this May 15, 2016 · 261 commits to master since this release

NOTE: Documentation is still severely out of date which is the reason this is still marked as pre-release

  • Changed ResolveAll method to be optional by default, so it can return the empty list
  • Removed Zenject.Commands namespace in favour of just Zenject
  • Added convention based binding (eg. Container.Bind().To(x => x.AllTypes().DerivingFrom()))
  • Fixed GameObjectCompositionRoot to expose an optional facade property in its inspector
  • Renamed CompositionRoot to Context.
  • Changed to just re-use the InjectAttribute instead of PostInjectAttribute
  • Better support for making custom Unity EditorWindow implementations that use Zenject
  • Added right click Menu items in project pane to create templates of common zenject C# files
  • Renamed TestWithContainer to ZenjectUnitTestFixture
  • Added simple test framework for both unit tests and integration tests
  • Changed Identifier to be type object so it can be used with enums (or other types)
  • Added InjectLocal attribute
  • Changed to guarantee that any component that is injected into another component has itself been injected already
  • Fixed an issue where calling Resolve<> or Instantiate<> inside an installer would cause objects to be injected twice
  • Fixes to WSA platform
  • Changed to automatically call ScriptableObject.CreateInstance when creating types that derive from ScriptableObject
  • Fix to non-unity build


Version 3.11

@svermeulen svermeulen released this May 15, 2016 · 291 commits to master since this release

Note: This will be the last release of Zenject 3.x (Zenject 4 introduces some API-breaking changes).

  • Bug fix - Calling Resolve<> or Instantiate<> inside an installer was causing the object to be injected twice
  • Added StaticCompositionRoot as an even higher level container than ProjectCompositionRoot, for cases where you want to add dependencies directly to the Zenject assembly before Unity even starts up
  • Bug fix - loading the same scene multiple times with LoadSceneAdditive was not working
  • Fixed compiler errors with Unity 5.4