Releases: ssannandeji/Zenject-2019
Version 5.1.0
Highlights here include fixes for Unity 5.6, changing to inject on dynamically created objects before awake, and a few new bind methods. Minor breaking change where SignalManager is now included in ProjectContext automatically. And Signals no longer support value type parameters on IL2CPP platforms.
Details:
- Fixes related to upgrading to Unity 5.6
- Moved Zenject folder to plugins directory
- Changed to trigger injection before Awake / OnEnable / Start for dynamically instantaited prefabs. This is nice because you can treat [Inject] methods more like constructors, and then use Awake/Start for initialization logic, for both dynamically created objects and objects in the scene at the start
- Marked the [Inject] attribute with MeansImplicitUseAttribute to improve integration with JetBrains Resharper
- Fixed bug that was happening when using ZenjectSceneLoader with LoadSceneMode.Single (it was destroying ProjectContext)
- Added support for declaring [Inject] methods with return type IEnumerator similar to Start
- Changed UnderTransform bind method overload to accept InjectContext instead of just DiContainer to be consistent with the other action overloads
- Added new bind method FromComponentOn that takes an Action<> instead of a specific game object
- Changed to just always include SignalManager in the project context since this is where it should always be declared anyway
- Changed to require that all signal parameters be reference types when on IL2CPP platforms. See docs for why this is necessary.
- Added new signal bind method that gets both parameters and a handler class (so you can perform an operation on the parameters before forwarding to the handler for example)
Minor
- Fixed bug where some fields marked as InjectOptional were still producing errors
- Changed to allow doing Bind().FromNewComponentOnNewGameObject()
- [Memory pools] Minor change to allow specifying an explicit interface for the memory pool itself
- [Memory pools] Fixed bug where validation was failing
- [Memory pools] Added Listen and Unlisten methods to ISignal
- Changed Pause/Resume methods on TickableManager to be inherited from parents
- Added an option to exclude self (current object) in FromComponentInChildren and FromComponentInParents
- Fixed minor issue when using FromSubContainerResolve with factories
Version 5.0.2
- Fixed to allow parameterized tests using double parameters in ZenjectIntegrationTestFixtures
- Added another overload to BindMemoryPool to allow creating them directly without creating an empty subclass
- Changed memory pools to take an IFactory<> instead of a provider so that they can be instantiated directly by anyone that wants to do some custom stuff with it without needing to use BindMemoryPool
- Bug fix to validation for game object contexts
- Fixed script execution order to ensure that tickables, initializables, etc. are executed before MonoBehaviours in the scene (this is how it was in older versions)
- Changed to call IInitializable.Initialize immediately for GameObjextContext prefabs that are created dynamically. This is nice because otherwise, when you create a GameObjectContext via a factory, you can't use it immediately Unity waits until the end of the frame to call Start() to trigger Initialize
- Changed to use a runtime check inside profiler blocks to allow creating unit tests outside unity
- Fixed signals to validate properly
- Renamed FromScriptableObjectResource to FromNewScriptableObjectResource for consistency.
- Added a few missing factory bindings (FromComponentInHierarchy and FromNewScriptableObjectResource)
- Fixed signal installer bindings to work properly with AsTransient and multi-bindings
Version 5.0.1
- 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
Summary
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
Changes
- 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
- 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
- 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
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
Features
- 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
- 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
- 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