Releases: ZolutionSoftware/Rezolver
2.1
- v2.1 of Rezolver, added
netstandard2.1(supports dynamic cache) andnetcoreapp3(because otherwise 3.x apps will reference the 2.2 binary - v3.0 of both the
Extensions.DependencyInjectionandExtensions.Hostingpackages - both updated to use the v3 packages from MS - v2.2 of AspNetCore.Hosting package - will be the last now that Asp.Net Core hosting is done through the generic host.
- Exposed the
RezolverServiceProviderFactoryin the Hosting package to external code so that you can use theUseServiceProviderFactorymethod on host builders such as that used by Blazor WebAssembly apps.
v2
Version 2
Improves performance and consolidates a bunch of APIs
1.4
- Adds generic host integration (#80), see more on rezolver.co.uk
- Adds autofactory injection - read the documentation
- Adds
Lazy<T>injection - read the documentation - Fixes a critical release-build bug (#77)
- (Asp.Net) Core 2.2 now minimum version for all integration packages..
1.3.4
Description
This is a minor patch release which adds SourceLink support to the three published packages, as well as removes the net461 TFM from the Rezolver package (because it's not needed).
Also, the Asp.Net Core packages have been bumped to version v2.1 with dependencies on Asp.Net Core updated v2.1 (yes, we did run the integration tests before doing that!).
1.3.3
Description
Bugfix release targeting three specific issues:
- #53 Contravariant Singletons not working quite as expected
- #72 Singletons matched covariantly don't honour singleton pattern
- #73 Nested generic with multiple parameters throws exception
The #53 and #72 weren't strictly critical as Rezolver would create instances correctly, it would just create too many instances.
#73, however, is a critical bug that prevents Rezolver from being able to work with complex multi-parameter generics where the outer type arguments are mapped to parameters that are nested inside a base or interface's generic parameters, eg:
class Foo<T, U> : IFoo<IBar<T, U>>
Single-parameter generics were not affected, nor were generics where the interfaces/bases had the same number of parameters.
In the above case, attempting to register the type Foo<,> against the interface type IFoo<IBar<,>> would result in an IndexOutOfRangeException.
This releases fixes that.
1.3.2
v1.3.2 is primarily a 'new feature' release. There were some bugs closed with this release, but they were just bugs that had been raised on the new stuff.
In many new features were added to this release. The documentation for these new features is already available on the documentation site - you'll find links below.
This release also updates the two (Asp).Net Core integration packages to 2.0.1
New Features
- #62 - Generic Covariance
- Mixed Variance
- #64 - Enumerable Projections
- #67 - Targeting specific constructors for open generics
- #66 - List/Collection Member Bindings
- Per-member bindings fluent API
Nuget Packages
Asp.Net Core 2 Support
This release specifically targets Asp.Net Core 2 support (#56) and the netstandard2.0 target framework. As always, up to date documentation is available over at http://rezolver.co.uk.
Bug Fixes
- Issue #57 - Singletons in
IEnumerable<>created a second instance for objects which were also requested individually. So if the last-registered target forFoowas a singleton, the single instance obtained when resolvingFoowas not the same as the last instance in anIEnumerable<Foo> - Issue #58 - Same as above, but for scoped objects in a scope.
New features & changes
- Issue #59 - All auto-generated enumerables will now return objects in registration order regardless of whether the original registration was against an open or closed generic. Could also call this a bug, although the original behaviour of returning enumerables in order of least generic to most generic was by-design.
- Issue #60 - All three packages now have
.netstandard2.0as a target platform. In the case of the Asp.Net Core extension packages, it's now the only platform they target. - Test suites have all been updated to use xUnit 2.3 with its .Net Standard 2.0 support: tests now discover and run in approx 1/4 of the time they took before!
Nuget Packages
- Rezolver 1.3.1
- Rezolver.Microsoft.Extensions.DependencyInjection 2.0.0
- Rezolver.Microsoft.AspNetCore.Hosting 2.0.0
In future the idea is that we'll keep the DI and Hosting packages' major versions aligned with the .Net Core version numbers. Let's see if we can stick to it!
1.3
Notes
Bunch of new features have been added in this release, along with a few bugfixes.
Please note - When issues are linked, any implementation notes on those issues are likely to be draft only. Focus on the feature not the implementation 😉
Where possible, links are included to the official documentation site so you can immediately get up and running with the new functionality.
.Net Core 2.0 and Asp.Net Core 2.0
Because the core library (Rezolver.dll) targets .Net Standard 1.1 - .Net Core 2.0 applications and libraries will also be able to use it without fuss.
However, the Asp.Net Core integration packages have not yet been tested with Asp.Net Core 2.0.
They might well work, but I need to try them out on test applications and get the specification tests project updated. Issue #56 is tracking that work. If changes need to be made to either the DependencyInjection extension package or AspNetCore Hosting Integration package, then they'll be published as v2.0 packages ASAP.
New features
Here's a rundown of the new features that have been added in 1.3
Enumerables
- (#26) - Enumerables of generic types (backed either by open generic or closed generic registrations) are now more 'natural' - you can now mix registrations of
IFoo<>withIFoo<Bar>and get an enumerable containing all objects which match the requested type. - Lazy & Eager Enumerables are now supported. All enumerables are now lazy by default but you can enable eager enumerables either globally or per-service-type very easily.
Generics
- (#46) - Open generics with generic constraints are now supported - including in enumerables
- (#44) - Contravariant Type Parameters are now supported. For single-resolve operations, Rezolver will locate the least derived registration (i.e. closest match) for a requested type per contravariant rules.
- Nested contravariance is also supported - i.e. contravariance for
FooinAction<Action<Action<Foo>>> - Enumerables of contravariant types will include all registrations that match, in order of least derived to most derived.
- Contravariance can be disabled globally, per-generic or per-type (when passed as an argument to a contravariant parameter)
- Nested contravariance is also supported - i.e. contravariance for
Decorators
- (#52) - Decorator Delegates supported for all types excluding open generics. Decorator delegates allow you decorate types which don't have constructors or which can't be subclassed - e.g. Arrays, Value Types, Delegates etc.
Collections/Arrays
Rezolver can now inject arrays and common list and collection types. The functionality builds on the support for IEnumerable<T> to produce collections with the same contents as an enumerable. Read the documentation for each, which includes also how to disable the behaviour, here:
- (#51) - Array Injection
- (#37) -
List<T>Injection (AlsoIList<T>andIReadOnlyList<T>) - (#37) -
Collection<T>Injection (AlsoICollection<T>,ReadOnlyCollection<T>,ICollection<T>andIReadOnlyCollection<T>)
Bug Fixes
- #42 - When using an
OverridingContainer, enumerables would replace the inherited container's enumerable. Now it extends it. - #43 - Same as above, but at the
OverridingTargetContainerlevel.
Next steps
As mentioned above, verification of Asp.Net Core 2.0 integration is next on the list.
After that, we'll be looking at auto injection of Func<[Tn, ]*, T> delegate types, Lazy<T> injection and, possibly, auto-registration of concrete types - e.g. request Bar and have the container automatically register it if it's non-abstract with a reachable constructor.
Rezolver 1.2 (Initial)
This release contains a few breaking changes; & a bunch of bugfixes, new APIs and performance improvements.
It's not the last release of 1.2, as I have more planned, but I feel the current 'Ready For Release' issue list has reached critical mass and it's time to get them out there :)
There are no binaries for this release - the packages are available on nuget:
- Rezolver IOC Package
- Rezolver MS DI Extensions Package
- Rezolver Asp.Net Core Hosting Extensions Package
Bugs Fixed
- #25 - You could only call
RegisterDecoratoron an object which implementedITargetContainerOwner. - #27 - Bug that prevented mixing of open and closed generic decorators
- #28 - Transient/Scoped disposable dependencies of Singletons are now guaranteed to have the same lifetime as the singleton.
Breaking changes
- For #25 the
ITargetContainerOwnerinterface has been subsumed intoITargetContainer, so now all target containers can contain other target containers via theRegisterContainermethod. If you had any references to it, simply replace it withITargetContainer. - #33 -
ICompileContextProviderhas been subsumed intoITargetCompiler. TheCreateCompileContextAPI was moved intoITargetCompilerunchanged - again, just replace references for one to another. - #34 -
ChildTargetContainerhas been renamed toOverridingTargetContainerbecause it matches more closely what it actually does. This was also in response to #25, since allITargetContainerobjects can now have others registered inside them (and therefore technically all target containers can be 'child' containers). - (See #32 below) - Can no longer switch on/off auto-resolving
IEnumerable<>via a constructor parameter onTargetContainer- this is now controlled by a Target Container Behaviour.
Enhancements/New APIS
- #29 -
IResolveContextinterface added (implemented byResolveContext). Provides flexibility in factory methods and during compilation. Overhauled the way in which child contexts are created - adding aNewmethod to the interface so it's easy to reuse an existing context to resolve a new type without needing to worry about flowing the current container/scope as the context will do that for you. - #6 - Now fully complete.
Target.ForTypeet al is now the only static API for creating targets. AllRegister*APIs match up, and the old generic extension methods have been obliterated as per 1.1s obsolete notices. - #32 - Behaviours for conntainer and target containers. Similar to the
IConfigureOptions<>mechanism used by Asp.Net Core et al:ITargetContainerBehaviourgets called when a newTargetContainer(or derivative) is created. The idea is that the behaviour can add registrations to the behaviour which alter how types are resolved. The automatic resolving ofIEnumerable<T>has been reimplemented using this. In the future, Auto Func, Lazy plus more besides will also be implemented in this way.IContainerBehavioursimilar to above, but specifically for new containers. This is currently used to control the compilation strategy (and will be extended in the next few sub releases and/or in 1.3) and the default member injection strategy used by a container. Again, much more is planned for this in the future.
- #7 - Default member injection behaviours are now controlled by container behaviours (see before) but in addition to this we now have a bunch of static singletons for common strategies, in the
MemberBindingBehaviourstatic class. For more, see the updated member injection documentation. - #13 - This is an internal optimisation to speed up the process of compiling expressions from targets.
1.1.71702.500
This will (should!) be the last 1.1 release, there will be more commits to the repository as I add more documentation, but there'll be no more package updates.
Package updates
Site updates
The documentation site has also had a bit of a facelift, and some extra content added. Completing the rest of the important stuff is next (see the project board).
Issues closed in this release:
- #16 -
ResolveContextnow hasResolve<>operations - might addIContainerinterface to it in the future) - #17 -
DelegateTarget/ExpressionTargetbreaking changes to Create/Register API - mainly stuff being moved or removed, some stuff soft-obsoleted and will become illegal in 1.2 - #10 - Documentation for
RegisterFactory - #9 - Documentation for Objects as Services
Other
Also have laid the groundwork for #6 - The suggestion to do away with the global generic extensions from @n-sidorov. The new Target.For*** APIs are there, and the ITarget-related extensions have been moved there also.
1.2 will see all nasty extension methods being made compiler errors, with 1.3 seeing them removed.