Skip to content

Releases: ssannandeji/Zenject-2019

Version 6.2.1 (Unity 2017.4+ LTS)

19 Jul 04:39
Compare
Choose a tag to compare

Hotfix release for issue with testframework

  • Changed to have all the test helper classes in one place underneath OptionalExtras/TestFramework and also fixed to not place it in a zip
  • Fixed rare issue when instantiating prefabs in ZenjectUnitTestFixture (#506)

Version 6.2.0 (Unity 2017.4+ LTS)

18 Jul 07:43
Compare
Choose a tag to compare

Bug fix release with some minor extensions. Note that this will be the start of a new LTS branch that will remain compatible with Unity LTS by remaining on Unity 2017.4.0f1.

  • Fixed to support signals defined as structs instead of classes
  • Fixed support for UWP platform with .NET scripting backend
  • Added unity project management asmdef files
  • Added back IInstantiator interface to be used as an alternative to directly injecting DiContainer
  • Fixed compiler warning about missing assignment for Inject fields when using Rider IDE (#483)
  • Added optional signals support to the non unity zenject dll build
  • Fixed BindSignal to support mapping to multiple bindings at once

Version 6.1.1

18 Jun 08:19
Compare
Choose a tag to compare

Hotfix release for #480

Version 6.1.0

17 Jun 13:43
Compare
Choose a tag to compare

Targetting Unity 2017.4.0 but compatible up to 2018.2 and possibly more

Large release with lots of new features, bug fixes, and performance improvements. Some API changes to be aware of before upgrading. See the upgrade guide for details

This will also be the beginning of a Zenject LTS stream that will follow Unity LTS

Significant:

  • Replaced the signals system with a very different 'event bus' like approach. Also fully decoupled signals from zenject core so it can be unchecked from OptionalExtras when importing
  • Removed ability to use AsSingle with the same type across multiple bind statements. If you want to map multiple contracts to the same AsSingle, you need to include multiple types in the Bind(..) or use FromResolve
  • Renamed Factory<> to PlaceholderFactory<>
  • Changed behaviour during OnApplicationQuit to not forcefully destroy all scenes and their contents. This was added previously to force a reasonable destruction order, however it breaks things on android so was turned off by default. However it can be re-enabled via ZenjectSettings for people that need a predictable destruction order
  • Changed validate keyboard shortcut from CTRL+SHIFT+V to CTRL+ALT+V to avoid conflict with Vuforia

Notable:

  • Performance improvements - in some cases doubling the startup speed. Also allocates a lot less garbage now by using memory pools internally
  • Added support for automatically loading parent scene contracts and decorated scenes by including a config file in resources that specifies default scenes for certain contract names
  • Added support for "decorator" bindings by calling Container.Decorate (see docs for usage)
  • Added support for much more complex custom factory configuration using FromIFactory in addition to just FromFactory
  • Added new type of Test Fixture called SceneTestFixture to run tests on a given production scene
  • Added ability to use [Inject], IInitializable, etc. from within custom user DLLs by referencing Zenject-Usage.dll
  • Added ability to add user supplied validation logic by deriving from IValidatable
  • Also added a way to set global zenject settings to control things like validation behaviour, error output, etc. through the ProjectContext inspector
  • Renamed Zenject.Lazy class to Zenject.LazyInject to avoid name conflict with System.Lazy on .NET 4.6 (we cannot use System.Lazy directly because of issues with IL2CPP)
  • Fixed to automatically inject StateMachineBehaviour derived classes attached to Animator components
  • Changed the default value for includeInactive parameter to FromComponentX methods to be true, since this is very important when instantiating prefabs and therefore makes more sense as a default
  • Fixed some issues related to binding open generic types
  • Added documentation for ZenAutoInjecter to allow injection to occur when using GameObject.Instantiate
  • Added debugging window to monitor all active memory pools (aka Memory Pool Monitor Window)
  • Changed MonoMemoryPool to automatically revert to the original parents during despawn
  • Changed to automatically add profiling information for ITickable.Tick, IInitializable.Initialize, IDisposable.Dispose methods, when inside the unity editor and when the unity profiler is open. This now functions similar to MonoBehaviours in that these methods will automatically be listed in Profiler.
  • Bind methods that involve a lookup now have a plural and non-plural versions (this includes FromComponentInChildren, FromComponentInParents, FromComponentSibling, FromComponentInNewPrefab, FromResource, FromResolveAll, and FromSubContainerResolveAll)
  • Misc. bug fixes

Minor:

  • Updated the sample projects to use more modern techniques
  • Added missing bind methods to Container.Bind such as ByNewPrefabMethod, ByNewPrefabInstaller, ByNewPrefaResourceInstaller, and ByNewPrefabResourceMethod
  • Added events on SceneContext, GameObjectContext, and ProjectContext to hook into post-install / pre-install events
  • Standardized the naming of the bind methods for custom interfaces for factories and memory pools. BindFactoryContract was renamed to BindFactoryCustomInterface and the overload of BindMemoryPool taking a custom interface was renamed BindMemoryPoolCustomInterface
  • Added optional InjectSources argument for FromResolve and FromResolveGetter bind methods
  • Changed ZenjectEditorWindow to handle failures better
  • Added DisposeBlock class to make it easier to avoid unnecessary per frame memory allocations
  • Added StaticMemoryPool class for cases where you want to store a pool statically instead of inside a container
  • Added ability to combine Dispose pattern with PlaceholderFactory<> to pool objects without needing to explicitly create a MemoryPool class (see memory pool docs for details)
  • Added methods to expand and shrink memory pools. Also added optional OnDestroy user method to handle shrink operations
  • Added ability to more easily pool facade/subcontainers
  • Added Resize() method to Memory Pool classes
  • Added FromComponentOnRoot bind method for game object contexts
  • Added ZenjectStreams class for easier integration with UniRx
  • Added FromMethodMultipleUntyped bind method
  • Renamed ByNewPrefab to ByNewContextPrefab
  • Added FromComponentOn/FromComponentsOn bind methods
  • Added FromComponentOnRoot/FromComponentsOnRoot bind methods

Version 5.5.1

12 Mar 09:38
Compare
Choose a tag to compare

Hotfix release. Fixed compatibility issue with UniRx + the different scripting runtimes

Version 5.5.0

06 Mar 18:45
Compare
Choose a tag to compare

Minor release, mostly bug fixes

Bug fixes

  • Fixed some bugs with NonLazy bind method
  • Changed validation to output only the errors relevant to the user
  • Changed to automatically instantiate new game objects in the correct scene rather than the active scene
  • Minor optimizations to memory allocations
  • Fixed to have [inject] attribute inherited from abstract or virtual properties
  • Fixed errors related to Unity 2018

New features

  • Added ZenAutoInjector MonoBehaviour for cases where prefabs are instantiated from outside zenject
  • Added LazyInject method for rare cases where you need to ensure something is injected before using it
  • Added optional build define ZEN_STRIP_ASSERTS_IN_BUILDS as a trade off of error messages for speed

API changes

  • Removed support for TickableManager.IsPaused

Version 5.4.0

02 Oct 07:09
Compare
Choose a tag to compare

Big change to the way integration tests work, and some better error output.

  • Completely changed how ZenjectIntegrationTestFixture works, to use Unity's support for playmode tests
  • Improved validation error output. Now outputs multiple errors at once, and also is more readable.
  • Fixed signals that have value-type parameters to work properly with IL2CPP without a need for a reference wrapper class or anything
  • Added back .NET 3.5 Moq dll as an alternative to the newer Moq dll

Version 5.3.0

18 Sep 12:12
Compare
Choose a tag to compare

Some optimizations, bug fixes, and a few new bind methods

Notable

  • Added optimizations to speed up startup time for scenes with many transforms. In some cases it should be 5x faster to scan the initial scene hierarchy.
  • Added optimizations to minimize memory allocations
  • Added new bind methods FromNewComponentOnNewPrefab and FromNewComponentOnNewPrefabResource
  • Added new bind methods for FromSubContainerResolve() bindings: ByNewPrefabMethod, ByNewPrefabResourceMethod, ByNewPrefabInstaller, and ByNewPrefabResourceInstaller
  • Added support for having multiple "parent contract names" for the same scene
  • Fixed rare exception that was occurring sometimes with circular dependencies
  • Added better support for binding open generic types to open generic derived classes
  • Bug fix - FromNewComponentOnNewGameObject was causing [Inject] methods to be executed after awake
  • Added support for declaring collections of dependencies using IList<> instead of just List<>
  • Bug fix - validation wasn't working when using FromResolveGetter with identifiers
  • Changed to skip analyzing unity types (ie. those inside UnityEngine namespace) to minimize reflection costs
  • Fixed AutoMocking to work by upgrading to newer Moq dll

Minor

  • Added back Container.Install method as an alternative to FooInstaller.Install
  • Added ability to lazily initialize GameObjectContext
  • Added Position and Rotation to GameObjectCreationParameters
  • Changed execution order extension methods to be proper methods to avoid namespace issues
  • Added non-generic DeclareSignal overload
  • Added BindFactoryContract and FromIFactoryResolve methods to make it easier to have custom factory interfaces
  • Added support for custom memory pool interfaces
  • Added UnbindInterfacesTo method
  • Added support for loading asset bundles with FromComponentInNewPrefab instead of prefabs
  • Added ability to pass 'late bindings' to next scene dynamically using ZenjectSceneLoader
  • Added support for injecting into C# 4.6 get-only properties
  • Added more attributes to play more nicely with resharper
  • Changed to disable support for profiling Zenject methods by default (need to define ZEN_PROFILING_ENABLED)

Version 5.2.1

11 Jul 17:07
Compare
Choose a tag to compare

Minor release with just a few bug fixes

  • Changed BindInstance and FromInstance to by default allow null values. This makes more sense as a default since null values are often used during validation. Also, if the user wants to require non-null, they can add their own assert statement next to the bind statement
  • Fix errors about ambiguous types between System.Tuple and UniRx.Tuple
  • Fix compatibility issues with Unity 2017
  • Fix for issue #274 - Identifiers were not supported properly when using Lazy<>
  • Fix for issue #280 - Factories should not be instantiated upon each use
  • Fix for issue #278 - Project context had a bug related to loading scenes additively
  • Changed to inject on dependency roots before the inject queue
  • Added better error checking/handling for circular dependencies
  • Fix WSA compiler error
  • Added a search predicate to FromComponentInChildren and to FromComponentInHierarchy
  • Added an option to include inactive objects to FromComponentInChildren and FromComponentInHierarchy.
  • Added support for injecting C# 6.0 get-only (readonly properties).

Version 5.2.0

30 Apr 22:35
Compare
Choose a tag to compare

Minor release with just a few fixes.

  • Fixed to compile again on WSA
  • Fixed to be backwards compatible with Unity 5.5
  • Removed MemoryPool DespawnAll() method because of its reliance on GetHashCode (issue #241)
  • Added support for late install in decorator contexts
  • Fixed to always trigger injection before the Awake event for MonoBehaviours attached to ProjectContext
  • Added new bind method FromScriptableObjectResource which doesn't instantiate the scriptable object (issue #218)